@useairfoil/producer-shopify 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +201 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/main.mjs +7 -5
- package/dist/main.mjs.map +1 -1
- package/dist/{src-Bgvuhcfk.mjs → src-YBU_KSf5.mjs} +272 -273
- package/dist/src-YBU_KSf5.mjs.map +1 -0
- package/package.json +17 -17
- package/src/create-table.ts +6 -1
- package/src/main.ts +8 -2
- package/src/resources/carts/row.ts +59 -35
- package/src/resources/customers/row.ts +67 -39
- package/src/resources/orders/row.ts +242 -116
- package/src/resources/products/row.ts +72 -42
- package/src/resources/refunds/row.ts +84 -44
- package/src/resources/shared.ts +77 -70
- package/src/start.ts +2 -2
- package/dist/src-Bgvuhcfk.mjs.map +0 -1
|
@@ -1,52 +1,76 @@
|
|
|
1
1
|
import { Iceberg } from "@useairfoil/connector-kit";
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { moneyBag } from "../shared";
|
|
5
5
|
|
|
6
6
|
export const CartLineItemSchema = Schema.Struct({
|
|
7
|
-
id: Schema.String.pipe(
|
|
7
|
+
id: Schema.String.pipe(Schema.annotateKey({ description: "Unique cart line identifier." })),
|
|
8
8
|
properties: Schema.NullOr(Schema.String).pipe(
|
|
9
|
-
|
|
10
|
-
),
|
|
11
|
-
quantity: Schema.Int.pipe(
|
|
12
|
-
variantId: Schema.String.pipe(
|
|
13
|
-
key: Schema.String.pipe(
|
|
14
|
-
discountedPrice: Schema.String.pipe(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
9
|
+
Schema.annotateKey({ description: "Custom line properties stored as JSON." }),
|
|
10
|
+
),
|
|
11
|
+
quantity: Schema.Int.pipe(Schema.annotateKey({ description: "Quantity of the cart line." })),
|
|
12
|
+
variantId: Schema.String.pipe(Schema.annotateKey({ description: "Product variant identifier." })),
|
|
13
|
+
key: Schema.String.pipe(Schema.annotateKey({ description: "Unique key for the cart line." })),
|
|
14
|
+
discountedPrice: Schema.String.pipe(
|
|
15
|
+
Schema.annotateKey({ description: "Price after discounts." }),
|
|
16
|
+
),
|
|
17
|
+
discounts: Schema.String.pipe(
|
|
18
|
+
Schema.annotateKey({ description: "Line discounts stored as JSON." }),
|
|
19
|
+
),
|
|
20
|
+
giftCard: Schema.Boolean.pipe(
|
|
21
|
+
Schema.annotateKey({ description: "Whether the line is a gift card." }),
|
|
22
|
+
),
|
|
23
|
+
grams: Schema.Int.pipe(Schema.annotateKey({ description: "Weight of the line in grams." })),
|
|
24
|
+
linePrice: Schema.String.pipe(Schema.annotateKey({ description: "Total price for the line." })),
|
|
25
|
+
originalLinePrice: Schema.String.pipe(
|
|
26
|
+
Schema.annotateKey({ description: "Line price before discounts." }),
|
|
27
|
+
),
|
|
28
|
+
originalPrice: Schema.String.pipe(
|
|
29
|
+
Schema.annotateKey({ description: "Unit price before discounts." }),
|
|
30
|
+
),
|
|
31
|
+
price: Schema.String.pipe(Schema.annotateKey({ description: "Current unit price." })),
|
|
32
|
+
productId: Schema.String.pipe(Schema.annotateKey({ description: "Product identifier." })),
|
|
33
|
+
sku: Schema.NullOr(Schema.String).pipe(
|
|
34
|
+
Schema.annotateKey({ description: "Stock keeping unit for the line." }),
|
|
35
|
+
),
|
|
36
|
+
taxable: Schema.Boolean.pipe(Schema.annotateKey({ description: "Whether the line is taxable." })),
|
|
37
|
+
title: Schema.String.pipe(Schema.annotateKey({ description: "Title of the cart line." })),
|
|
38
|
+
totalDiscount: Schema.String.pipe(
|
|
39
|
+
Schema.annotateKey({ description: "Total discount for the line." }),
|
|
40
|
+
),
|
|
41
|
+
vendor: Schema.String.pipe(Schema.annotateKey({ description: "Vendor of the product." })),
|
|
42
|
+
discountedPriceSet: moneyBag.pipe(Schema.annotateKey({ description: "Price after discounts." })),
|
|
43
|
+
linePriceSet: moneyBag.pipe(Schema.annotateKey({ description: "Total price for the line." })),
|
|
44
|
+
originalLinePriceSet: moneyBag.pipe(
|
|
45
|
+
Schema.annotateKey({ description: "Line price before discounts." }),
|
|
46
|
+
),
|
|
47
|
+
priceSet: moneyBag.pipe(Schema.annotateKey({ description: "Current unit price." })),
|
|
48
|
+
totalDiscountSet: moneyBag.pipe(
|
|
49
|
+
Schema.annotateKey({ description: "Total discount for the line." }),
|
|
50
|
+
),
|
|
33
51
|
parentRelationship: Schema.NullOr(Schema.String).pipe(
|
|
34
|
-
|
|
52
|
+
Schema.annotateKey({ description: "Parent relationship stored as JSON." }),
|
|
35
53
|
),
|
|
36
54
|
});
|
|
37
55
|
|
|
38
56
|
export const CartSchema = Schema.Struct({
|
|
39
|
-
id: Schema.String.pipe(
|
|
40
|
-
token: Schema.String.pipe(
|
|
57
|
+
id: Schema.String.pipe(Schema.annotateKey({ description: "Unique cart identifier." })),
|
|
58
|
+
token: Schema.String.pipe(Schema.annotateKey({ description: "Token for the cart." })),
|
|
41
59
|
topic: Schema.Literals(["carts/create", "carts/update"]).pipe(
|
|
42
|
-
|
|
60
|
+
Schema.annotateKey({ description: "Webhook topic that last changed the cart." }),
|
|
61
|
+
),
|
|
62
|
+
lineItems: Schema.Array(CartLineItemSchema).pipe(
|
|
63
|
+
Schema.annotateKey({ description: "Items in the cart." }),
|
|
64
|
+
),
|
|
65
|
+
note: Schema.NullOr(Schema.String).pipe(
|
|
66
|
+
Schema.annotateKey({ description: "Note added to the cart." }),
|
|
67
|
+
),
|
|
68
|
+
updatedAt: Schema.Date.pipe(
|
|
69
|
+
Schema.annotateKey({ description: "Time when the cart was last changed." }),
|
|
43
70
|
),
|
|
44
|
-
|
|
45
|
-
|
|
71
|
+
createdAt: Schema.Date.pipe(
|
|
72
|
+
Schema.annotateKey({ description: "Time when the cart was created." }),
|
|
46
73
|
),
|
|
47
|
-
note: Schema.NullOr(Schema.String).pipe(field(5, "Note added to the cart.")),
|
|
48
|
-
updatedAt: Schema.Date.pipe(field(6, "Time when the cart was last changed.")),
|
|
49
|
-
createdAt: Schema.Date.pipe(field(7, "Time when the cart was created.")),
|
|
50
74
|
})
|
|
51
75
|
.annotate({
|
|
52
76
|
description: "Latest state of each cart in a Shopify store.",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Iceberg } from "@useairfoil/connector-kit";
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
3
|
|
|
4
|
-
import { address
|
|
4
|
+
import { address } from "../shared";
|
|
5
5
|
|
|
6
6
|
export const CustomerStateSchema = Schema.Literals(["DECLINED", "DISABLED", "ENABLED", "INVITED"]);
|
|
7
7
|
|
|
@@ -40,69 +40,97 @@ export const ProductSubscriberStatusSchema = Schema.Literals([
|
|
|
40
40
|
]);
|
|
41
41
|
|
|
42
42
|
export const CustomerAddressSchema = Schema.Struct({
|
|
43
|
-
id: Schema.String.pipe(
|
|
44
|
-
...address
|
|
43
|
+
id: Schema.String.pipe(Schema.annotateKey({ description: "Unique address identifier." })),
|
|
44
|
+
...address.fields,
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
export const CustomerSchema = Schema.Struct({
|
|
48
|
-
id: Schema.String.pipe(
|
|
49
|
-
legacyResourceId: Schema.String.pipe(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
id: Schema.String.pipe(Schema.annotateKey({ description: "Unique customer identifier." })),
|
|
49
|
+
legacyResourceId: Schema.String.pipe(
|
|
50
|
+
Schema.annotateKey({ description: "Numeric customer identifier stored as text." }),
|
|
51
|
+
),
|
|
52
|
+
firstName: Schema.NullOr(Schema.String).pipe(Schema.annotateKey({ description: "First name." })),
|
|
53
|
+
lastName: Schema.NullOr(Schema.String).pipe(Schema.annotateKey({ description: "Last name." })),
|
|
54
|
+
displayName: Schema.String.pipe(
|
|
55
|
+
Schema.annotateKey({ description: "Full name shown in Shopify." }),
|
|
56
|
+
),
|
|
57
|
+
email: Schema.NullOr(Schema.String).pipe(
|
|
58
|
+
Schema.annotateKey({ description: "Default email address." }),
|
|
59
|
+
),
|
|
54
60
|
emailMarketingState: Schema.NullOr(EmailMarketingStateSchema).pipe(
|
|
55
|
-
|
|
61
|
+
Schema.annotateKey({ description: "Email marketing consent state." }),
|
|
56
62
|
),
|
|
57
63
|
emailMarketingOptInLevel: Schema.NullOr(MarketingOptInLevelSchema).pipe(
|
|
58
|
-
|
|
64
|
+
Schema.annotateKey({ description: "Email marketing opt-in level." }),
|
|
59
65
|
),
|
|
60
66
|
emailMarketingUpdatedAt: Schema.NullOr(Schema.Date).pipe(
|
|
61
|
-
|
|
67
|
+
Schema.annotateKey({ description: "Time when email marketing consent last changed." }),
|
|
68
|
+
),
|
|
69
|
+
phone: Schema.NullOr(Schema.String).pipe(
|
|
70
|
+
Schema.annotateKey({ description: "Default phone number." }),
|
|
62
71
|
),
|
|
63
|
-
phone: Schema.NullOr(Schema.String).pipe(field(10, "Default phone number.")),
|
|
64
72
|
smsMarketingState: Schema.NullOr(SmsMarketingStateSchema).pipe(
|
|
65
|
-
|
|
73
|
+
Schema.annotateKey({ description: "SMS marketing consent state." }),
|
|
66
74
|
),
|
|
67
75
|
smsMarketingOptInLevel: Schema.NullOr(MarketingOptInLevelSchema).pipe(
|
|
68
|
-
|
|
76
|
+
Schema.annotateKey({ description: "SMS marketing opt-in level." }),
|
|
69
77
|
),
|
|
70
78
|
smsMarketingUpdatedAt: Schema.NullOr(Schema.Date).pipe(
|
|
71
|
-
|
|
79
|
+
Schema.annotateKey({ description: "Time when SMS marketing consent last changed." }),
|
|
72
80
|
),
|
|
73
81
|
smsMarketingCollectedFrom: Schema.NullOr(ConsentCollectedFromSchema).pipe(
|
|
74
|
-
|
|
82
|
+
Schema.annotateKey({ description: "Where SMS marketing consent was collected." }),
|
|
83
|
+
),
|
|
84
|
+
note: Schema.NullOr(Schema.String).pipe(
|
|
85
|
+
Schema.annotateKey({ description: "Merchant note about the customer." }),
|
|
86
|
+
),
|
|
87
|
+
state: CustomerStateSchema.pipe(Schema.annotateKey({ description: "Customer account state." })),
|
|
88
|
+
verifiedEmail: Schema.Boolean.pipe(
|
|
89
|
+
Schema.annotateKey({ description: "Whether the email address is verified." }),
|
|
90
|
+
),
|
|
91
|
+
taxExempt: Schema.Boolean.pipe(
|
|
92
|
+
Schema.annotateKey({ description: "Whether the customer is exempt from tax." }),
|
|
75
93
|
),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
verifiedEmail: Schema.Boolean.pipe(field(17, "Whether the email address is verified.")),
|
|
79
|
-
taxExempt: Schema.Boolean.pipe(field(18, "Whether the customer is exempt from tax.")),
|
|
80
|
-
taxExemptions: Schema.Array(Schema.String.annotate({ fieldId: 100 })).pipe(
|
|
81
|
-
field(19, "Tax exemptions that apply to the customer."),
|
|
94
|
+
taxExemptions: Schema.Array(Schema.String).pipe(
|
|
95
|
+
Schema.annotateKey({ description: "Tax exemptions that apply to the customer." }),
|
|
82
96
|
),
|
|
83
|
-
tags: Schema.Array(Schema.String
|
|
84
|
-
|
|
97
|
+
tags: Schema.Array(Schema.String).pipe(
|
|
98
|
+
Schema.annotateKey({ description: "Tags added to the customer." }),
|
|
99
|
+
),
|
|
100
|
+
locale: Schema.NullOr(Schema.String).pipe(
|
|
101
|
+
Schema.annotateKey({ description: "Customer language." }),
|
|
102
|
+
),
|
|
103
|
+
numberOfOrders: Schema.Int.pipe(
|
|
104
|
+
Schema.annotateKey({ description: "Number of orders the customer placed." }),
|
|
85
105
|
),
|
|
86
|
-
locale: Schema.NullOr(Schema.String).pipe(field(21, "Customer language.")),
|
|
87
|
-
numberOfOrders: Schema.Int.pipe(field(22, "Number of orders the customer placed.")),
|
|
88
106
|
amountSpent: Schema.Struct({
|
|
89
|
-
amount: Schema.String.pipe(
|
|
90
|
-
currencyCode: Schema.String.pipe(
|
|
91
|
-
}).pipe(
|
|
92
|
-
lastOrderId: Schema.NullOr(Schema.String).pipe(
|
|
107
|
+
amount: Schema.String.pipe(Schema.annotateKey({ description: "Amount spent." })),
|
|
108
|
+
currencyCode: Schema.String.pipe(Schema.annotateKey({ description: "Shop currency code." })),
|
|
109
|
+
}).pipe(Schema.annotateKey({ description: "Total amount spent in the shop currency." })),
|
|
110
|
+
lastOrderId: Schema.NullOr(Schema.String).pipe(
|
|
111
|
+
Schema.annotateKey({ description: "Most recent order identifier." }),
|
|
112
|
+
),
|
|
93
113
|
productSubscriberStatus: Schema.NullOr(ProductSubscriberStatusSchema).pipe(
|
|
94
|
-
|
|
114
|
+
Schema.annotateKey({ description: "Subscription status for products." }),
|
|
95
115
|
),
|
|
96
116
|
dataSaleOptOut: Schema.NullOr(Schema.Boolean).pipe(
|
|
97
|
-
|
|
117
|
+
Schema.annotateKey({ description: "Whether the customer opted out of data sale." }),
|
|
118
|
+
),
|
|
119
|
+
defaultAddressId: Schema.NullOr(Schema.String).pipe(
|
|
120
|
+
Schema.annotateKey({ description: "Default address identifier." }),
|
|
121
|
+
),
|
|
122
|
+
addresses: Schema.Array(CustomerAddressSchema).pipe(
|
|
123
|
+
Schema.annotateKey({ description: "Saved addresses." }),
|
|
124
|
+
),
|
|
125
|
+
createdAt: Schema.Date.pipe(
|
|
126
|
+
Schema.annotateKey({ description: "Time when the customer was created." }),
|
|
127
|
+
),
|
|
128
|
+
updatedAt: Schema.Date.pipe(
|
|
129
|
+
Schema.annotateKey({ description: "Time when the customer was last changed." }),
|
|
98
130
|
),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
field(28, "Saved addresses."),
|
|
131
|
+
_deleted: Schema.optional(Schema.Boolean).pipe(
|
|
132
|
+
Schema.annotateKey({ description: "Whether the customer was deleted." }),
|
|
102
133
|
),
|
|
103
|
-
createdAt: Schema.Date.pipe(field(29, "Time when the customer was created.")),
|
|
104
|
-
updatedAt: Schema.Date.pipe(field(30, "Time when the customer was last changed.")),
|
|
105
|
-
_deleted: Schema.optional(Schema.Boolean).pipe(field(31, "Whether the customer was deleted.")),
|
|
106
134
|
})
|
|
107
135
|
.annotate({
|
|
108
136
|
description: "Customers in a Shopify store.",
|