Skip to content

Commit a1a5aaf

Browse files
Adding Sample Test Event for big_cartel-new-order (#7006)
* Updated component source code to import test event and run sampleEmit * Adding test event json file * Updating package.json version * Updated component source code to import test event and run sampleEmit * Adding test event json file * Updating package.json version * Update pnpm-lock.yaml
1 parent e534013 commit a1a5aaf

File tree

5 files changed

+201
-2
lines changed

5 files changed

+201
-2
lines changed

components/big_cartel/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/big_cartel",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "Pipedream Big Cartel Components",
55
"main": "big_cartel.app.mjs",
66
"keywords": [

components/big_cartel/sources/new-order/new-order.mjs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import common from "../common.mjs";
2+
import sampleEmit from "./test-event.mjs";
23

34
export default {
45
key: "big_cartel-new-order",
56
name: "New Order Event",
67
description: "Emit new events when a new order is created. [See the docs here](https://developers.bigcartel.com/api/v1#get-all-orders)",
7-
version: "0.0.2",
8+
version: "0.0.3",
9+
810
type: "source",
911
dedupe: "unique",
1012
...common,
@@ -26,4 +28,5 @@ export default {
2628
return item?.attributes?.created_at;
2729
},
2830
},
31+
sampleEmit,
2932
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default "{\n \"data\": {\n \"id\": \"LMFN-543196\",\n \"type\": \"orders\",\n \"attributes\": {\n \"item_count\": 1,\n \"item_total\": \"100.1\",\n \"discount_total\": \"10.0\",\n \"shipping_total\": \"10.0\",\n \"tax_total\": \"0.0\",\n \"total\": \"100.1\",\n \"customer_first_name\": \"Joe\",\n \"customer_last_name\": \"Somebody\",\n \"customer_email\": \"[email protected]\",\n \"customer_phone_number\": \"+1 (123) 456-7890\",\n \"customer_opted_in_to_marketing\": false,\n \"customer_note\": \"Created by Joe\",\n \"shipping_address_1\": \"123 some street\",\n \"shipping_address_2\": \"#123\",\n \"shipping_city\": \"Somewhere\",\n \"shipping_state\": \"UT\",\n \"shipping_zip\": \"64801\",\n \"shipping_latitude\": null,\n \"shipping_longitude\": null,\n \"shipping_status\": \"unshipped\",\n \"payment_status\": \"completed\",\n \"created_at\": \"2014-12-25T00:00:00.000Z\",\n \"updated_at\": \"2014-12-25T00:00:00.000Z\",\n \"completed_at\": \"2014-12-25T00:00:00.000Z\"\n },\n \"links\": {\n \"self\": \"https://api.bigcartel.com/v1/accounts/1/orders/LMFN-543196\"\n },\n \"relationships\": {\n \"currency\": {\n \"data\": {\n \"type\": \"currencies\",\n \"id\": \"USD\"\n }\n },\n \"shipping_country\": {\n \"data\": {\n \"type\": \"countries\",\n \"id\": \"US\"\n }\n },\n \"events\": {\n \"data\": [\n {\n \"type\": \"order_events\",\n \"id\": \"1\"\n }\n ]\n },\n \"items\": {\n \"data\": [\n {\n \"type\": \"order_line_items\",\n \"id\": \"2\"\n }\n ]\n },\n \"transactions\": {\n \"data\": [\n {\n \"type\": \"order_transactions/payments\",\n \"id\": \"3\"\n }\n ]\n },\n \"adjustments\": {\n \"data\": [\n {\n \"type\": \"order_adjustments/shipping\",\n \"id\": \"4\"\n },\n {\n \"type\": \"order_adjustments/tax\",\n \"id\": \"5\"\n },\n {\n \"type\": \"order_adjustments/discount\",\n \"id\": \"6\"\n }\n ]\n }\n }\n },\n \"included\": [\n {\n \"id\": \"USD\",\n \"type\": \"currencies\",\n \"attributes\": {\n \"name\": \"U.S. Dollar\",\n \"sign\": \"$\",\n \"locale\": \"en-US\"\n }\n },\n {\n \"id\": \"US\",\n \"type\": \"countries\",\n \"attributes\": {\n \"name\": \"United States\"\n }\n },\n {\n \"id\": \"1\",\n \"type\": \"order_events\",\n \"attributes\": {\n \"created_at\": \"2014-12-25T00:00:00.000Z\",\n \"message\": \"Payment completed\"\n }\n },\n {\n \"id\": \"2\",\n \"type\": \"order_line_items\",\n \"attributes\": {\n \"product_name\": \"This product\",\n \"product_option_name\": \"This option\",\n \"quantity\": 1,\n \"price\": \"100.0\",\n \"total\": \"100.0\",\n \"image_url\": \"https://images.bigcartel.com/some_resource/12345/-/example.jpg\"\n },\n \"relationships\": {\n \"product\": {\n \"data\": {\n \"type\": \"product\",\n \"id\": \"7\"\n }\n },\n \"product_option\": {\n \"data\": {\n \"type\": \"product_option\",\n \"id\": \"8\"\n }\n }\n }\n },\n {\n \"id\": \"3\",\n \"type\": \"order_transactions/payments\",\n \"attributes\": {\n \"label\": \"Visa ending in 1234\",\n \"amount\": \"100.0\",\n \"processor\": \"stripe\",\n \"processor_id\": \"ex_123456789\",\n \"processor_url\": \"https://manage.stripe.com/test/payments/ex_123456789\"\n },\n \"relationships\": {\n \"currency\": {\n \"data\": {\n \"type\": \"currencies\",\n \"id\": \"USD\"\n }\n }\n }\n },\n {\n \"id\": \"4\",\n \"type\": \"order_adjustments/shipping\",\n \"attributes\": {\n \"amount\": \"10.0\",\n \"label\": \"Shipping charges\"\n }\n },\n {\n \"id\": \"5\",\n \"type\": \"order_adjustments/tax\",\n \"attributes\": {\n \"amount\": \"0.1\"\n }\n },\n {\n \"id\": \"6\",\n \"type\": \"order_adjustments/discount\",\n \"attributes\": {\n \"amount\": \"10.0\",\n \"label\": \"[FREESHIPPING] Free shipping discount\"\n }\n }\n ]\n}"

pnpm-lock.yaml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sources/new-order/test-event.mjs

+183
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
export default {
2+
"data": {
3+
"id": "LMFN-543196",
4+
"type": "orders",
5+
"attributes": {
6+
"item_count": 1,
7+
"item_total": "100.1",
8+
"discount_total": "10.0",
9+
"shipping_total": "10.0",
10+
"tax_total": "0.0",
11+
"total": "100.1",
12+
"customer_first_name": "Joe",
13+
"customer_last_name": "Somebody",
14+
"customer_email": "[email protected]",
15+
"customer_phone_number": "+1 (123) 456-7890",
16+
"customer_opted_in_to_marketing": false,
17+
"customer_note": "Created by Joe",
18+
"shipping_address_1": "123 some street",
19+
"shipping_address_2": "#123",
20+
"shipping_city": "Somewhere",
21+
"shipping_state": "UT",
22+
"shipping_zip": "64801",
23+
"shipping_latitude": null,
24+
"shipping_longitude": null,
25+
"shipping_status": "unshipped",
26+
"payment_status": "completed",
27+
"created_at": "2014-12-25T00:00:00.000Z",
28+
"updated_at": "2014-12-25T00:00:00.000Z",
29+
"completed_at": "2014-12-25T00:00:00.000Z"
30+
},
31+
"links": {
32+
"self": "https://api.bigcartel.com/v1/accounts/1/orders/LMFN-543196"
33+
},
34+
"relationships": {
35+
"currency": {
36+
"data": {
37+
"type": "currencies",
38+
"id": "USD"
39+
}
40+
},
41+
"shipping_country": {
42+
"data": {
43+
"type": "countries",
44+
"id": "US"
45+
}
46+
},
47+
"events": {
48+
"data": [
49+
{
50+
"type": "order_events",
51+
"id": "1"
52+
}
53+
]
54+
},
55+
"items": {
56+
"data": [
57+
{
58+
"type": "order_line_items",
59+
"id": "2"
60+
}
61+
]
62+
},
63+
"transactions": {
64+
"data": [
65+
{
66+
"type": "order_transactions/payments",
67+
"id": "3"
68+
}
69+
]
70+
},
71+
"adjustments": {
72+
"data": [
73+
{
74+
"type": "order_adjustments/shipping",
75+
"id": "4"
76+
},
77+
{
78+
"type": "order_adjustments/tax",
79+
"id": "5"
80+
},
81+
{
82+
"type": "order_adjustments/discount",
83+
"id": "6"
84+
}
85+
]
86+
}
87+
}
88+
},
89+
"included": [
90+
{
91+
"id": "USD",
92+
"type": "currencies",
93+
"attributes": {
94+
"name": "U.S. Dollar",
95+
"sign": "$",
96+
"locale": "en-US"
97+
}
98+
},
99+
{
100+
"id": "US",
101+
"type": "countries",
102+
"attributes": {
103+
"name": "United States"
104+
}
105+
},
106+
{
107+
"id": "1",
108+
"type": "order_events",
109+
"attributes": {
110+
"created_at": "2014-12-25T00:00:00.000Z",
111+
"message": "Payment completed"
112+
}
113+
},
114+
{
115+
"id": "2",
116+
"type": "order_line_items",
117+
"attributes": {
118+
"product_name": "This product",
119+
"product_option_name": "This option",
120+
"quantity": 1,
121+
"price": "100.0",
122+
"total": "100.0",
123+
"image_url": "https://images.bigcartel.com/some_resource/12345/-/example.jpg"
124+
},
125+
"relationships": {
126+
"product": {
127+
"data": {
128+
"type": "product",
129+
"id": "7"
130+
}
131+
},
132+
"product_option": {
133+
"data": {
134+
"type": "product_option",
135+
"id": "8"
136+
}
137+
}
138+
}
139+
},
140+
{
141+
"id": "3",
142+
"type": "order_transactions/payments",
143+
"attributes": {
144+
"label": "Visa ending in 1234",
145+
"amount": "100.0",
146+
"processor": "stripe",
147+
"processor_id": "ex_123456789",
148+
"processor_url": "https://manage.stripe.com/test/payments/ex_123456789"
149+
},
150+
"relationships": {
151+
"currency": {
152+
"data": {
153+
"type": "currencies",
154+
"id": "USD"
155+
}
156+
}
157+
}
158+
},
159+
{
160+
"id": "4",
161+
"type": "order_adjustments/shipping",
162+
"attributes": {
163+
"amount": "10.0",
164+
"label": "Shipping charges"
165+
}
166+
},
167+
{
168+
"id": "5",
169+
"type": "order_adjustments/tax",
170+
"attributes": {
171+
"amount": "0.1"
172+
}
173+
},
174+
{
175+
"id": "6",
176+
"type": "order_adjustments/discount",
177+
"attributes": {
178+
"amount": "10.0",
179+
"label": "[FREESHIPPING] Free shipping discount"
180+
}
181+
}
182+
]
183+
}

0 commit comments

Comments
 (0)