@sixtyninecommerce/client 0.1.0

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.
Files changed (130) hide show
  1. package/README.md +96 -0
  2. package/dist/client.d.ts +3 -0
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/client.js +37 -0
  5. package/dist/client.js.map +1 -0
  6. package/dist/commerce/cart.d.ts +11 -0
  7. package/dist/commerce/cart.d.ts.map +1 -0
  8. package/dist/commerce/cart.js +51 -0
  9. package/dist/commerce/cart.js.map +1 -0
  10. package/dist/commerce/checkout.d.ts +13 -0
  11. package/dist/commerce/checkout.d.ts.map +1 -0
  12. package/dist/commerce/checkout.js +55 -0
  13. package/dist/commerce/checkout.js.map +1 -0
  14. package/dist/commerce/customer.d.ts +15 -0
  15. package/dist/commerce/customer.d.ts.map +1 -0
  16. package/dist/commerce/customer.js +45 -0
  17. package/dist/commerce/customer.js.map +1 -0
  18. package/dist/commerce/index.d.ts +4 -0
  19. package/dist/commerce/index.d.ts.map +1 -0
  20. package/dist/commerce/index.js +20 -0
  21. package/dist/commerce/index.js.map +1 -0
  22. package/dist/commerce/products.d.ts +11 -0
  23. package/dist/commerce/products.d.ts.map +1 -0
  24. package/dist/commerce/products.js +47 -0
  25. package/dist/commerce/products.js.map +1 -0
  26. package/dist/commerce/queries.d.ts +29 -0
  27. package/dist/commerce/queries.d.ts.map +1 -0
  28. package/dist/commerce/queries.js +444 -0
  29. package/dist/commerce/queries.js.map +1 -0
  30. package/dist/commerce/search.d.ts +6 -0
  31. package/dist/commerce/search.d.ts.map +1 -0
  32. package/dist/commerce/search.js +23 -0
  33. package/dist/commerce/search.js.map +1 -0
  34. package/dist/constants.d.ts +7 -0
  35. package/dist/constants.d.ts.map +1 -0
  36. package/dist/constants.js +7 -0
  37. package/dist/constants.js.map +1 -0
  38. package/dist/content/assets.d.ts +6 -0
  39. package/dist/content/assets.d.ts.map +1 -0
  40. package/dist/content/assets.js +17 -0
  41. package/dist/content/assets.js.map +1 -0
  42. package/dist/content/forms.d.ts +7 -0
  43. package/dist/content/forms.d.ts.map +1 -0
  44. package/dist/content/forms.js +20 -0
  45. package/dist/content/forms.js.map +1 -0
  46. package/dist/content/index.d.ts +4 -0
  47. package/dist/content/index.d.ts.map +1 -0
  48. package/dist/content/index.js +17 -0
  49. package/dist/content/index.js.map +1 -0
  50. package/dist/content/items.d.ts +6 -0
  51. package/dist/content/items.d.ts.map +1 -0
  52. package/dist/content/items.js +23 -0
  53. package/dist/content/items.js.map +1 -0
  54. package/dist/content/menus.d.ts +7 -0
  55. package/dist/content/menus.d.ts.map +1 -0
  56. package/dist/content/menus.js +60 -0
  57. package/dist/content/menus.js.map +1 -0
  58. package/dist/content/resolve.d.ts +6 -0
  59. package/dist/content/resolve.d.ts.map +1 -0
  60. package/dist/content/resolve.js +11 -0
  61. package/dist/content/resolve.js.map +1 -0
  62. package/dist/content/strings.d.ts +6 -0
  63. package/dist/content/strings.d.ts.map +1 -0
  64. package/dist/content/strings.js +11 -0
  65. package/dist/content/strings.js.map +1 -0
  66. package/dist/core/context.d.ts +3 -0
  67. package/dist/core/context.d.ts.map +1 -0
  68. package/dist/core/context.js +93 -0
  69. package/dist/core/context.js.map +1 -0
  70. package/dist/core/headers.d.ts +5 -0
  71. package/dist/core/headers.d.ts.map +1 -0
  72. package/dist/core/headers.js +23 -0
  73. package/dist/core/headers.js.map +1 -0
  74. package/dist/core/http.d.ts +9 -0
  75. package/dist/core/http.d.ts.map +1 -0
  76. package/dist/core/http.js +140 -0
  77. package/dist/core/http.js.map +1 -0
  78. package/dist/currency/exchange.d.ts +7 -0
  79. package/dist/currency/exchange.d.ts.map +1 -0
  80. package/dist/currency/exchange.js +18 -0
  81. package/dist/currency/exchange.js.map +1 -0
  82. package/dist/currency/index.d.ts +4 -0
  83. package/dist/currency/index.d.ts.map +1 -0
  84. package/dist/currency/index.js +5 -0
  85. package/dist/currency/index.js.map +1 -0
  86. package/dist/errors.d.ts +12 -0
  87. package/dist/errors.d.ts.map +1 -0
  88. package/dist/errors.js +21 -0
  89. package/dist/errors.js.map +1 -0
  90. package/dist/index.d.ts +5 -0
  91. package/dist/index.d.ts.map +1 -0
  92. package/dist/index.js +4 -0
  93. package/dist/index.js.map +1 -0
  94. package/dist/media/index.d.ts +4 -0
  95. package/dist/media/index.d.ts.map +1 -0
  96. package/dist/media/index.js +12 -0
  97. package/dist/media/index.js.map +1 -0
  98. package/dist/media/urls.d.ts +31 -0
  99. package/dist/media/urls.d.ts.map +1 -0
  100. package/dist/media/urls.js +63 -0
  101. package/dist/media/urls.js.map +1 -0
  102. package/dist/navigation/index.d.ts +4 -0
  103. package/dist/navigation/index.d.ts.map +1 -0
  104. package/dist/navigation/index.js +5 -0
  105. package/dist/navigation/index.js.map +1 -0
  106. package/dist/navigation/routes.d.ts +8 -0
  107. package/dist/navigation/routes.d.ts.map +1 -0
  108. package/dist/navigation/routes.js +33 -0
  109. package/dist/navigation/routes.js.map +1 -0
  110. package/dist/pricing/format.d.ts +3 -0
  111. package/dist/pricing/format.d.ts.map +1 -0
  112. package/dist/pricing/format.js +13 -0
  113. package/dist/pricing/format.js.map +1 -0
  114. package/dist/pricing/index.d.ts +6 -0
  115. package/dist/pricing/index.d.ts.map +1 -0
  116. package/dist/pricing/index.js +41 -0
  117. package/dist/pricing/index.js.map +1 -0
  118. package/dist/pricing/tiers.d.ts +4 -0
  119. package/dist/pricing/tiers.d.ts.map +1 -0
  120. package/dist/pricing/tiers.js +31 -0
  121. package/dist/pricing/tiers.js.map +1 -0
  122. package/dist/pricing/validation.d.ts +10 -0
  123. package/dist/pricing/validation.d.ts.map +1 -0
  124. package/dist/pricing/validation.js +26 -0
  125. package/dist/pricing/validation.js.map +1 -0
  126. package/dist/types.d.ts +638 -0
  127. package/dist/types.d.ts.map +1 -0
  128. package/dist/types.js +2 -0
  129. package/dist/types.js.map +1 -0
  130. package/package.json +45 -0
@@ -0,0 +1,444 @@
1
+ export const GET_PRODUCT = `
2
+ query GetProduct($slug: String!) {
3
+ product(slug: $slug) {
4
+ id name slug description
5
+ featuredAsset {
6
+ source name
7
+ customFields { altText }
8
+ presets {
9
+ xxs { url webpUrl } xs { url webpUrl }
10
+ s { url webpUrl } m { url webpUrl }
11
+ l { url webpUrl } xl { url webpUrl }
12
+ }
13
+ }
14
+ assets {
15
+ source name
16
+ customFields { altText }
17
+ presets {
18
+ xs { url webpUrl } m { url webpUrl }
19
+ l { url webpUrl } xl { url webpUrl }
20
+ }
21
+ }
22
+ variants {
23
+ id name sku
24
+ price priceWithTax currencyCode stockLevel
25
+ priceListName retailPrice retailPriceWithTax
26
+ priceTiers { minQuantity price priceWithTax discountLabel }
27
+ options { id code name group { id name code } }
28
+ assets {
29
+ source name
30
+ customFields { altText }
31
+ presets { m { url webpUrl } l { url webpUrl } }
32
+ }
33
+ }
34
+ optionGroups { id name code options { id name code } }
35
+ facetValues { id name code facet { id name code } }
36
+ collections { id name slug }
37
+ }
38
+ }
39
+ `;
40
+ export const GET_PRODUCT_BY_ID = `
41
+ query GetProductById($id: ID!) {
42
+ product(id: $id) {
43
+ id name slug description
44
+ featuredAsset {
45
+ source name
46
+ customFields { altText }
47
+ presets {
48
+ xxs { url webpUrl } xs { url webpUrl }
49
+ s { url webpUrl } m { url webpUrl }
50
+ l { url webpUrl } xl { url webpUrl }
51
+ }
52
+ }
53
+ assets {
54
+ source name
55
+ customFields { altText }
56
+ presets {
57
+ xs { url webpUrl } m { url webpUrl }
58
+ l { url webpUrl } xl { url webpUrl }
59
+ }
60
+ }
61
+ variants {
62
+ id name sku
63
+ price priceWithTax currencyCode stockLevel
64
+ priceListName retailPrice retailPriceWithTax
65
+ priceTiers { minQuantity price priceWithTax discountLabel }
66
+ options { id code name group { id name code } }
67
+ assets {
68
+ source name
69
+ customFields { altText }
70
+ presets { m { url webpUrl } l { url webpUrl } }
71
+ }
72
+ }
73
+ optionGroups { id name code options { id name code } }
74
+ facetValues { id name code facet { id name code } }
75
+ collections { id name slug }
76
+ }
77
+ }
78
+ `;
79
+ export const LIST_PRODUCTS = `
80
+ query ListProducts($options: ProductListOptions) {
81
+ products(options: $options) {
82
+ items {
83
+ id name slug description
84
+ featuredAsset {
85
+ source name
86
+ customFields { altText }
87
+ presets { xs { url webpUrl } m { url webpUrl } l { url webpUrl } }
88
+ }
89
+ variants {
90
+ id name sku
91
+ price priceWithTax currencyCode stockLevel
92
+ priceListName retailPrice retailPriceWithTax
93
+ priceTiers { minQuantity price priceWithTax discountLabel }
94
+ }
95
+ facetValues { id name code facet { id name code } }
96
+ collections { id name slug }
97
+ }
98
+ totalItems
99
+ }
100
+ }
101
+ `;
102
+ export const LIST_FACETS = `
103
+ query ListFacets {
104
+ facets {
105
+ items {
106
+ id name code
107
+ values { id name code }
108
+ }
109
+ totalItems
110
+ }
111
+ }
112
+ `;
113
+ export const LIST_COLLECTIONS = `
114
+ query ListCollections($options: CollectionListOptions) {
115
+ collections(options: $options) {
116
+ items {
117
+ id name slug description
118
+ breadcrumbs { id name slug }
119
+ featuredAsset {
120
+ source
121
+ presets { xs { url webpUrl } m { url webpUrl } }
122
+ }
123
+ parent { id name slug }
124
+ children { id name slug }
125
+ }
126
+ totalItems
127
+ }
128
+ }
129
+ `;
130
+ export const GET_COLLECTION = `
131
+ query GetCollection($slug: String!) {
132
+ collection(slug: $slug) {
133
+ id name slug description
134
+ featuredAsset {
135
+ source
136
+ presets { l { url webpUrl } xl { url webpUrl } }
137
+ }
138
+ breadcrumbs { id name slug }
139
+ children { id name slug }
140
+ productVariants(options: { take: 20 }) {
141
+ items {
142
+ id
143
+ product {
144
+ id name slug
145
+ featuredAsset { source presets { m { url webpUrl } } }
146
+ }
147
+ price priceWithTax currencyCode stockLevel
148
+ priceListName retailPrice retailPriceWithTax
149
+ }
150
+ totalItems
151
+ }
152
+ }
153
+ }
154
+ `;
155
+ export const SEARCH_PRODUCTS = `
156
+ query SearchProducts($input: SearchInput!) {
157
+ search(input: $input) {
158
+ items {
159
+ productId productName slug description
160
+ price { ... on SinglePrice { value } ... on PriceRange { min max } }
161
+ priceWithTax { ... on SinglePrice { value } ... on PriceRange { min max } }
162
+ currencyCode
163
+ productAsset { preview focalPoint { x y } }
164
+ collectionIds
165
+ }
166
+ totalItems
167
+ facetValues { facetValue { id name code facet { id name code } } count }
168
+ }
169
+ }
170
+ `;
171
+ export const ACTIVE_ORDER = `
172
+ query ActiveOrder {
173
+ activeOrder {
174
+ id code state active
175
+ totalQuantity
176
+ subTotal subTotalWithTax
177
+ shipping shippingWithTax
178
+ total totalWithTax
179
+ currencyCode
180
+ lines {
181
+ id quantity
182
+ unitPrice unitPriceWithTax
183
+ linePrice linePriceWithTax
184
+ productVariant {
185
+ id name sku
186
+ product { id name slug }
187
+ options { id name group { name } }
188
+ }
189
+ featuredAsset { source presets { xs { url webpUrl } } }
190
+ }
191
+ shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }
192
+ customer { id firstName lastName emailAddress }
193
+ couponCodes
194
+ }
195
+ }
196
+ `;
197
+ export const ADD_TO_CART = `
198
+ mutation AddToCart($variantId: ID!, $quantity: Int!) {
199
+ addItemToOrder(productVariantId: $variantId, quantity: $quantity) {
200
+ ... on Order {
201
+ id code state active totalQuantity
202
+ subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode
203
+ lines {
204
+ id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax
205
+ productVariant { id name sku product { id name slug } options { id name group { name } } }
206
+ featuredAsset { source presets { xs { url webpUrl } } }
207
+ }
208
+ shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }
209
+ customer { id firstName lastName emailAddress }
210
+ couponCodes
211
+ }
212
+ ... on OrderModificationError { errorCode message }
213
+ ... on OrderLimitError { errorCode message maxItems }
214
+ ... on NegativeQuantityError { errorCode message }
215
+ ... on InsufficientStockError { errorCode message quantityAvailable order { id } }
216
+ }
217
+ }
218
+ `;
219
+ export const ADJUST_ORDER_LINE = `
220
+ mutation AdjustOrderLine($lineId: ID!, $quantity: Int!) {
221
+ adjustOrderLine(orderLineId: $lineId, quantity: $quantity) {
222
+ ... on Order {
223
+ id code state active totalQuantity
224
+ subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode
225
+ lines {
226
+ id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax
227
+ productVariant { id name sku product { id name slug } options { id name group { name } } }
228
+ featuredAsset { source presets { xs { url webpUrl } } }
229
+ }
230
+ shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }
231
+ customer { id firstName lastName emailAddress }
232
+ couponCodes
233
+ }
234
+ ... on OrderModificationError { errorCode message }
235
+ ... on OrderLimitError { errorCode message maxItems }
236
+ ... on NegativeQuantityError { errorCode message }
237
+ ... on InsufficientStockError { errorCode message quantityAvailable }
238
+ }
239
+ }
240
+ `;
241
+ export const REMOVE_ORDER_LINE = `
242
+ mutation RemoveOrderLine($lineId: ID!) {
243
+ removeOrderLine(orderLineId: $lineId) {
244
+ ... on Order {
245
+ id code state active totalQuantity
246
+ subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode
247
+ lines {
248
+ id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax
249
+ productVariant { id name sku product { id name slug } options { id name group { name } } }
250
+ featuredAsset { source presets { xs { url webpUrl } } }
251
+ }
252
+ shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }
253
+ customer { id firstName lastName emailAddress }
254
+ couponCodes
255
+ }
256
+ ... on OrderModificationError { errorCode message }
257
+ }
258
+ }
259
+ `;
260
+ export const APPLY_COUPON = `
261
+ mutation ApplyCoupon($code: String!) {
262
+ applyCouponCode(couponCode: $code) {
263
+ ... on Order {
264
+ id code state active totalQuantity
265
+ subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode
266
+ lines {
267
+ id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax
268
+ productVariant { id name sku product { id name slug } options { id name group { name } } }
269
+ featuredAsset { source presets { xs { url webpUrl } } }
270
+ }
271
+ couponCodes
272
+ }
273
+ ... on CouponCodeExpiredError { errorCode message couponCode }
274
+ ... on CouponCodeInvalidError { errorCode message couponCode }
275
+ ... on CouponCodeLimitError { errorCode message couponCode limit }
276
+ }
277
+ }
278
+ `;
279
+ export const REMOVE_COUPON = `
280
+ mutation RemoveCoupon($code: String!) {
281
+ removeCouponCode(couponCode: $code) {
282
+ id code state active totalQuantity
283
+ subTotal subTotalWithTax shipping shippingWithTax total totalWithTax currencyCode
284
+ lines {
285
+ id quantity unitPrice unitPriceWithTax linePrice linePriceWithTax
286
+ productVariant { id name sku product { id name slug } options { id name group { name } } }
287
+ featuredAsset { source presets { xs { url webpUrl } } }
288
+ }
289
+ couponCodes
290
+ }
291
+ }
292
+ `;
293
+ export const SET_CUSTOMER = `
294
+ mutation SetCustomer($input: CreateCustomerInput!) {
295
+ setCustomerForOrder(input: $input) {
296
+ ... on Order {
297
+ id customer { id firstName lastName emailAddress }
298
+ }
299
+ ... on AlreadyLoggedInError { errorCode message }
300
+ ... on EmailAddressConflictError { errorCode message }
301
+ ... on GuestCheckoutError { errorCode message }
302
+ ... on NoActiveOrderError { errorCode message }
303
+ }
304
+ }
305
+ `;
306
+ export const SET_SHIPPING_ADDRESS = `
307
+ mutation SetShippingAddress($input: CreateAddressInput!) {
308
+ setOrderShippingAddress(input: $input) {
309
+ ... on Order {
310
+ id shippingAddress { fullName streetLine1 streetLine2 city province postalCode countryCode }
311
+ }
312
+ ... on NoActiveOrderError { errorCode message }
313
+ }
314
+ }
315
+ `;
316
+ export const SET_BILLING_ADDRESS = `
317
+ mutation SetBillingAddress($input: CreateAddressInput!) {
318
+ setOrderBillingAddress(input: $input) {
319
+ ... on Order {
320
+ id
321
+ }
322
+ ... on NoActiveOrderError { errorCode message }
323
+ }
324
+ }
325
+ `;
326
+ export const ELIGIBLE_SHIPPING_METHODS = `
327
+ query ShippingMethods {
328
+ eligibleShippingMethods {
329
+ id name description price priceWithTax metadata
330
+ }
331
+ }
332
+ `;
333
+ export const SET_SHIPPING_METHOD = `
334
+ mutation SetShippingMethod($ids: [ID!]!) {
335
+ setOrderShippingMethod(shippingMethodId: $ids) {
336
+ ... on Order {
337
+ id shipping shippingWithTax total totalWithTax
338
+ }
339
+ ... on OrderModificationError { errorCode message }
340
+ ... on IneligibleShippingMethodError { errorCode message }
341
+ ... on NoActiveOrderError { errorCode message }
342
+ }
343
+ }
344
+ `;
345
+ export const ELIGIBLE_PAYMENT_METHODS = `
346
+ query PaymentMethods {
347
+ eligiblePaymentMethods {
348
+ id name code description isEligible eligibilityMessage
349
+ }
350
+ }
351
+ `;
352
+ export const TRANSITION_TO_ARRANGING_PAYMENT = `
353
+ mutation TransitionToArrangingPayment {
354
+ transitionOrderToState(state: "ArrangingPayment") {
355
+ ... on Order { id state }
356
+ ... on OrderStateTransitionError { errorCode message transitionError }
357
+ }
358
+ }
359
+ `;
360
+ export const ADD_PAYMENT = `
361
+ mutation AddPayment($input: PaymentInput!) {
362
+ addPaymentToOrder(input: $input) {
363
+ ... on Order { id code state totalWithTax }
364
+ ... on OrderPaymentStateError { errorCode message }
365
+ ... on IneligiblePaymentMethodError { errorCode message }
366
+ ... on PaymentFailedError { errorCode message paymentErrorMessage }
367
+ ... on PaymentDeclinedError { errorCode message paymentErrorMessage }
368
+ ... on OrderStateTransitionError { errorCode message transitionError }
369
+ ... on NoActiveOrderError { errorCode message }
370
+ }
371
+ }
372
+ `;
373
+ export const LOGIN = `
374
+ mutation Login($email: String!, $password: String!) {
375
+ login(username: $email, password: $password) {
376
+ ... on CurrentUser { id identifier }
377
+ ... on InvalidCredentialsError { errorCode message authenticationError }
378
+ ... on NotVerifiedError { errorCode message }
379
+ ... on NativeAuthStrategyError { errorCode message }
380
+ }
381
+ }
382
+ `;
383
+ export const REGISTER = `
384
+ mutation Register($input: RegisterCustomerInput!) {
385
+ registerCustomerAccount(input: $input) {
386
+ ... on Success { success }
387
+ ... on MissingPasswordError { errorCode message }
388
+ ... on PasswordValidationError { errorCode message validationErrorMessage }
389
+ ... on NativeAuthStrategyError { errorCode message }
390
+ }
391
+ }
392
+ `;
393
+ export const GET_CURRENT_CUSTOMER = `
394
+ query Me {
395
+ activeCustomer {
396
+ id firstName lastName emailAddress phoneNumber
397
+ addresses {
398
+ id fullName streetLine1 streetLine2 city province postalCode
399
+ country { code name }
400
+ defaultShippingAddress defaultBillingAddress
401
+ }
402
+ orders(options: { take: 10, sort: { createdAt: DESC } }) {
403
+ items {
404
+ id code state totalWithTax createdAt
405
+ lines { id quantity productVariant { name } }
406
+ }
407
+ totalItems
408
+ }
409
+ }
410
+ }
411
+ `;
412
+ export const GET_CUSTOMER_ORDERS = `
413
+ query CustomerOrders($options: OrderListOptions) {
414
+ activeCustomer {
415
+ orders(options: $options) {
416
+ items {
417
+ id code state totalWithTax createdAt
418
+ lines { id quantity productVariant { name } }
419
+ }
420
+ totalItems
421
+ }
422
+ }
423
+ }
424
+ `;
425
+ export const LOGOUT = `
426
+ mutation Logout {
427
+ logout { success }
428
+ }
429
+ `;
430
+ export const GET_EXCHANGE_RATES = `
431
+ query ExchangeRates {
432
+ exchangeRates {
433
+ baseCurrency targetCurrency rate inverseRate rateDate
434
+ }
435
+ }
436
+ `;
437
+ export const CONVERT_CURRENCY = `
438
+ query ConvertCurrency($amount: String!, $from: String!, $to: String!) {
439
+ convertCurrency(amount: $amount, fromCurrency: $from, toCurrency: $to) {
440
+ amount fromCurrency toCurrency rate result
441
+ }
442
+ }
443
+ `;
444
+ //# sourceMappingURL=queries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/commerce/queries.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsC1B,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsChC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;CAsB5B,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;CAU1B,CAAC;AAIF,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;CAgB/B,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;CAwB7B,CAAC;AAIF,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;CAe9B,CAAC;AAIF,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;CAyB3B,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;CAqB1B,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;CAqBhC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;CAkBhC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;CAkB3B,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;CAa5B,CAAC;AAIF,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;CAY3B,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;CASnC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;CASlC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;CAMxC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;CAWlC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;;;CAMvC,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG;;;;;;;CAO9C,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;CAY1B,CAAC;AAIF,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;CASpB,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;CASvB,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;CAkBnC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;CAYlC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG;;;;CAIrB,CAAC;AAIF,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;CAMjC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;CAM/B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { HttpClient } from '../core/http.js';
2
+ import type { SearchInput, SearchResult } from '../types.js';
3
+ export declare function createSearchMethods(http: HttpClient): {
4
+ searchProducts(input: SearchInput): Promise<SearchResult>;
5
+ };
6
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/commerce/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG7D,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU;0BAEpB,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;EAclE"}
@@ -0,0 +1,23 @@
1
+ import { SEARCH_PRODUCTS } from './queries.js';
2
+ export function createSearchMethods(http) {
3
+ return {
4
+ async searchProducts(input) {
5
+ const vars = { term: input.term };
6
+ if (input.collectionSlug)
7
+ vars.collectionSlug = input.collectionSlug;
8
+ if (input.facetValueIds?.length)
9
+ vars.facetValueIds = input.facetValueIds;
10
+ if (input.take != null)
11
+ vars.take = input.take;
12
+ if (input.skip != null)
13
+ vars.skip = input.skip;
14
+ if (input.sort)
15
+ vars.sort = input.sort;
16
+ const data = await http.graphql(SEARCH_PRODUCTS, {
17
+ input: vars,
18
+ });
19
+ return data.search;
20
+ },
21
+ };
22
+ }
23
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/commerce/search.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,UAAU,mBAAmB,CAAC,IAAgB;IAClD,OAAO;QACL,KAAK,CAAC,cAAc,CAAC,KAAkB;YACrC,MAAM,IAAI,GAA4B,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;YAC3D,IAAI,KAAK,CAAC,cAAc;gBAAE,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;YACrE,IAAI,KAAK,CAAC,aAAa,EAAE,MAAM;gBAAE,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;YAC1E,IAAI,KAAK,CAAC,IAAI,IAAI,IAAI;gBAAE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;YAC/C,IAAI,KAAK,CAAC,IAAI,IAAI,IAAI;gBAAE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;YAC/C,IAAI,KAAK,CAAC,IAAI;gBAAE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;YAEvC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAA2B,eAAe,EAAE;gBACzE,KAAK,EAAE,IAAI;aACZ,CAAC,CAAC;YACH,OAAO,IAAI,CAAC,MAAM,CAAC;QACrB,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const DEFAULT_VENDURE_URL = "https://engine.sixtyninecommerce.com";
2
+ export declare const DEFAULT_CMS_URL = "https://cms.sixtyninecommerce.com";
3
+ export declare const DEFAULT_PLUGINS_URL = "https://plugins.sixtyninecommerce.com";
4
+ export declare const SHOP_API_PATH = "/shop-api";
5
+ export declare const REQUEST_TIMEOUT_MS = 15000;
6
+ export declare const INIT_TIMEOUT_MS = 10000;
7
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,mBAAmB,yCAAyC,CAAC;AAG1E,eAAO,MAAM,eAAe,sCAAsC,CAAC;AAGnE,eAAO,MAAM,mBAAmB,0CAA0C,CAAC;AAG3E,eAAO,MAAM,aAAa,cAAc,CAAC;AAGzC,eAAO,MAAM,kBAAkB,QAAS,CAAC;AAGzC,eAAO,MAAM,eAAe,QAAS,CAAC"}
@@ -0,0 +1,7 @@
1
+ export const DEFAULT_VENDURE_URL = 'https://engine.sixtyninecommerce.com';
2
+ export const DEFAULT_CMS_URL = 'https://cms.sixtyninecommerce.com';
3
+ export const DEFAULT_PLUGINS_URL = 'https://plugins.sixtyninecommerce.com';
4
+ export const SHOP_API_PATH = '/shop-api';
5
+ export const REQUEST_TIMEOUT_MS = 15_000;
6
+ export const INIT_TIMEOUT_MS = 10_000;
7
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,mBAAmB,GAAG,sCAAsC,CAAC;AAG1E,MAAM,CAAC,MAAM,eAAe,GAAG,mCAAmC,CAAC;AAGnE,MAAM,CAAC,MAAM,mBAAmB,GAAG,uCAAuC,CAAC;AAG3E,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;AAGzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAGzC,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { HttpClient } from '../core/http.js';
2
+ import type { AssetQueryOptions } from '../types.js';
3
+ export declare function createAssetMethods(http: HttpClient): {
4
+ getAssets(options?: AssetQueryOptions): Promise<Record<string, unknown>>;
5
+ };
6
+ //# sourceMappingURL=assets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/content/assets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU;wBAErB,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;EAUjF"}
@@ -0,0 +1,17 @@
1
+ export function createAssetMethods(http) {
2
+ return {
3
+ async getAssets(options) {
4
+ const params = {};
5
+ if (options?.folderId)
6
+ params.folder_id = options.folderId;
7
+ if (options?.mimeType)
8
+ params.mime_type = options.mimeType;
9
+ if (options?.limit != null)
10
+ params.limit = String(options.limit);
11
+ if (options?.offset != null)
12
+ params.offset = String(options.offset);
13
+ return http.cmsGet('/assets', params);
14
+ },
15
+ };
16
+ }
17
+ //# sourceMappingURL=assets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assets.js","sourceRoot":"","sources":["../../src/content/assets.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,kBAAkB,CAAC,IAAgB;IACjD,OAAO;QACL,KAAK,CAAC,SAAS,CAAC,OAA2B;YACzC,MAAM,MAAM,GAA2B,EAAE,CAAC;YAC1C,IAAI,OAAO,EAAE,QAAQ;gBAAE,MAAM,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC;YAC3D,IAAI,OAAO,EAAE,QAAQ;gBAAE,MAAM,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC;YAC3D,IAAI,OAAO,EAAE,KAAK,IAAI,IAAI;gBAAE,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACjE,IAAI,OAAO,EAAE,MAAM,IAAI,IAAI;gBAAE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAEpE,OAAO,IAAI,CAAC,MAAM,CAA0B,SAAS,EAAE,MAAM,CAAC,CAAC;QACjE,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { HttpClient } from '../core/http.js';
2
+ import type { FormDefinition, FormSubmissionResult, StoreContext } from '../types.js';
3
+ export declare function createFormMethods(http: HttpClient, ctx: StoreContext): {
4
+ getForm(id: string): Promise<FormDefinition>;
5
+ submitForm(id: string, values: Record<string, unknown>): Promise<FormSubmissionResult>;
6
+ };
7
+ //# sourceMappingURL=forms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forms.d.ts","sourceRoot":"","sources":["../../src/content/forms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEtF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY;gBAE/C,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;mBAa7B,MAAM,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC;EAI/F"}
@@ -0,0 +1,20 @@
1
+ export function createFormMethods(http, ctx) {
2
+ return {
3
+ async getForm(id) {
4
+ const data = await http.cmsGet(`/forms/${id}`);
5
+ return {
6
+ ...data.data,
7
+ submitUrl: `${ctx.cmsUrl}/forms/${id}/submit`,
8
+ submitMethod: 'POST',
9
+ submitHeaders: {
10
+ 'Content-Type': 'application/json',
11
+ 'x-channel-id': ctx.channel.id,
12
+ },
13
+ };
14
+ },
15
+ async submitForm(id, values) {
16
+ return http.cmsPost(`/forms/${id}/submit`, values);
17
+ },
18
+ };
19
+ }
20
+ //# sourceMappingURL=forms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forms.js","sourceRoot":"","sources":["../../src/content/forms.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,iBAAiB,CAAC,IAAgB,EAAE,GAAiB;IACnE,OAAO;QACL,KAAK,CAAC,OAAO,CAAC,EAAU;YACtB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAA2B,UAAU,EAAE,EAAE,CAAC,CAAC;YACzE,OAAO;gBACL,GAAG,IAAI,CAAC,IAAI;gBACZ,SAAS,EAAE,GAAG,GAAG,CAAC,MAAM,UAAU,EAAE,SAAS;gBAC7C,YAAY,EAAE,MAAM;gBACpB,aAAa,EAAE;oBACb,cAAc,EAAE,kBAAkB;oBAClC,cAAc,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE;iBAC/B;aACF,CAAC;QACJ,CAAC;QAED,KAAK,CAAC,UAAU,CAAC,EAAU,EAAE,MAA+B;YAC1D,OAAO,IAAI,CAAC,OAAO,CAAuB,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAC3E,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { HttpClient } from '../core/http.js';
2
+ import type { ContentModule, StoreContext } from '../types.js';
3
+ export declare function createContentModule(http: HttpClient, ctx: StoreContext): ContentModule;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/content/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAQ/D,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,GAAG,aAAa,CAStF"}
@@ -0,0 +1,17 @@
1
+ import { createAssetMethods } from './assets.js';
2
+ import { createFormMethods } from './forms.js';
3
+ import { createContentItemMethods } from './items.js';
4
+ import { createMenuMethods } from './menus.js';
5
+ import { createResolveMethods } from './resolve.js';
6
+ import { createStringMethods } from './strings.js';
7
+ export function createContentModule(http, ctx) {
8
+ return {
9
+ ...createResolveMethods(http),
10
+ ...createContentItemMethods(http),
11
+ ...createAssetMethods(http),
12
+ ...createFormMethods(http, ctx),
13
+ ...createStringMethods(http),
14
+ ...createMenuMethods(http),
15
+ };
16
+ }
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/content/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,UAAU,mBAAmB,CAAC,IAAgB,EAAE,GAAiB;IACrE,OAAO;QACL,GAAG,oBAAoB,CAAC,IAAI,CAAC;QAC7B,GAAG,wBAAwB,CAAC,IAAI,CAAC;QACjC,GAAG,kBAAkB,CAAC,IAAI,CAAC;QAC3B,GAAG,iBAAiB,CAAC,IAAI,EAAE,GAAG,CAAC;QAC/B,GAAG,mBAAmB,CAAC,IAAI,CAAC;QAC5B,GAAG,iBAAiB,CAAC,IAAI,CAAC;KAC3B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { HttpClient } from '../core/http.js';
2
+ import type { ContentQueryOptions } from '../types.js';
3
+ export declare function createContentItemMethods(http: HttpClient): {
4
+ getContent(options: ContentQueryOptions): Promise<Record<string, unknown>>;
5
+ };
6
+ //# sourceMappingURL=items.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../src/content/items.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,UAAU;wBAE3B,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;EAanF"}
@@ -0,0 +1,23 @@
1
+ export function createContentItemMethods(http) {
2
+ return {
3
+ async getContent(options) {
4
+ const params = {};
5
+ if (options.collectionId)
6
+ params.collection_id = options.collectionId;
7
+ if (options.collectionSlug)
8
+ params.collection_slug = options.collectionSlug;
9
+ if (options.q)
10
+ params.q = options.q;
11
+ if (options.limit != null)
12
+ params.limit = String(options.limit);
13
+ if (options.offset != null)
14
+ params.offset = String(options.offset);
15
+ if (options.sort)
16
+ params.sort = options.sort;
17
+ if (options.languageCode)
18
+ params.language_code = options.languageCode;
19
+ return http.cmsGet('/search/collection-items', params);
20
+ },
21
+ };
22
+ }
23
+ //# sourceMappingURL=items.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"items.js","sourceRoot":"","sources":["../../src/content/items.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,wBAAwB,CAAC,IAAgB;IACvD,OAAO;QACL,KAAK,CAAC,UAAU,CAAC,OAA4B;YAC3C,MAAM,MAAM,GAA2B,EAAE,CAAC;YAC1C,IAAI,OAAO,CAAC,YAAY;gBAAE,MAAM,CAAC,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;YACtE,IAAI,OAAO,CAAC,cAAc;gBAAE,MAAM,CAAC,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;YAC5E,IAAI,OAAO,CAAC,CAAC;gBAAE,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;YACpC,IAAI,OAAO,CAAC,KAAK,IAAI,IAAI;gBAAE,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAChE,IAAI,OAAO,CAAC,MAAM,IAAI,IAAI;gBAAE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YACnE,IAAI,OAAO,CAAC,IAAI;gBAAE,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YAC7C,IAAI,OAAO,CAAC,YAAY;gBAAE,MAAM,CAAC,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;YAEtE,OAAO,IAAI,CAAC,MAAM,CAA0B,0BAA0B,EAAE,MAAM,CAAC,CAAC;QAClF,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { HttpClient } from '../core/http.js';
2
+ import type { Menu } from '../types.js';
3
+ export declare function createMenuMethods(http: HttpClient): {
4
+ getMenus(): Promise<Menu[]>;
5
+ getMenu(slugOrId: string): Promise<Menu>;
6
+ };
7
+ //# sourceMappingURL=menus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menus.d.ts","sourceRoot":"","sources":["../../src/content/menus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAY,MAAM,aAAa,CAAC;AA2DlD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU;gBAE5B,OAAO,CAAC,IAAI,EAAE,CAAC;sBAKT,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;EAejD"}