@sixtyninecommerce/client 0.4.0 → 0.5.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.
- package/dist/commerce/checkout.d.ts +5 -1
- package/dist/commerce/checkout.d.ts.map +1 -1
- package/dist/commerce/checkout.js +23 -1
- package/dist/commerce/checkout.js.map +1 -1
- package/dist/commerce/customer.d.ts +3 -1
- package/dist/commerce/customer.d.ts.map +1 -1
- package/dist/commerce/customer.js +13 -1
- package/dist/commerce/customer.js.map +1 -1
- package/dist/commerce/payments.d.ts +3 -1
- package/dist/commerce/payments.d.ts.map +1 -1
- package/dist/commerce/payments.js +9 -1
- package/dist/commerce/payments.js.map +1 -1
- package/dist/commerce/pickup-location-parser.d.ts +6 -0
- package/dist/commerce/pickup-location-parser.d.ts.map +1 -0
- package/dist/commerce/pickup-location-parser.js +97 -0
- package/dist/commerce/pickup-location-parser.js.map +1 -0
- package/dist/commerce/queries.d.ts +24 -12
- package/dist/commerce/queries.d.ts.map +1 -1
- package/dist/commerce/queries.js +144 -2
- package/dist/commerce/queries.js.map +1 -1
- package/dist/commerce/shipping.d.ts +3 -0
- package/dist/commerce/shipping.d.ts.map +1 -1
- package/dist/commerce/shipping.js +7 -3
- package/dist/commerce/shipping.js.map +1 -1
- package/dist/commerce/subscriptions.d.ts +16 -1
- package/dist/commerce/subscriptions.d.ts.map +1 -1
- package/dist/commerce/subscriptions.js +64 -4
- package/dist/commerce/subscriptions.js.map +1 -1
- package/dist/content/collections.d.ts +9 -0
- package/dist/content/collections.d.ts.map +1 -0
- package/dist/content/collections.js +39 -0
- package/dist/content/collections.js.map +1 -0
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/index.js +2 -0
- package/dist/content/index.js.map +1 -1
- package/dist/currency/exchange.d.ts +5 -1
- package/dist/currency/exchange.d.ts.map +1 -1
- package/dist/currency/exchange.js +25 -1
- package/dist/currency/exchange.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/types.d.ts +195 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -9
package/dist/commerce/queries.js
CHANGED
|
@@ -49,6 +49,7 @@ export const GET_PRODUCT = `
|
|
|
49
49
|
variants {
|
|
50
50
|
id name sku
|
|
51
51
|
price priceWithTax currencyCode stockLevel
|
|
52
|
+
stockOnHand stockAllocated saleable
|
|
52
53
|
priceListName retailPrice retailPriceWithTax
|
|
53
54
|
priceTiers { minQuantity price priceWithTax discountLabel }
|
|
54
55
|
availabilityByLocation { locationId locationName inStock }
|
|
@@ -105,6 +106,7 @@ export const GET_PRODUCT_BY_ID = `
|
|
|
105
106
|
variants {
|
|
106
107
|
id name sku
|
|
107
108
|
price priceWithTax currencyCode stockLevel
|
|
109
|
+
stockOnHand stockAllocated saleable
|
|
108
110
|
priceListName retailPrice retailPriceWithTax
|
|
109
111
|
priceTiers { minQuantity price priceWithTax discountLabel }
|
|
110
112
|
availabilityByLocation { locationId locationName inStock }
|
|
@@ -150,6 +152,7 @@ export const LIST_PRODUCTS = `
|
|
|
150
152
|
variants {
|
|
151
153
|
id name sku
|
|
152
154
|
price priceWithTax currencyCode stockLevel
|
|
155
|
+
stockOnHand stockAllocated saleable
|
|
153
156
|
priceListName retailPrice retailPriceWithTax
|
|
154
157
|
priceTiers { minQuantity price priceWithTax discountLabel }
|
|
155
158
|
availabilityByLocation { locationId locationName inStock }
|
|
@@ -214,6 +217,7 @@ export const GET_COLLECTION = `
|
|
|
214
217
|
featuredAsset { source presets { m { url webpUrl } } }
|
|
215
218
|
}
|
|
216
219
|
price priceWithTax currencyCode stockLevel
|
|
220
|
+
stockOnHand stockAllocated saleable
|
|
217
221
|
priceListName retailPrice retailPriceWithTax
|
|
218
222
|
priceTiers { minQuantity price priceWithTax discountLabel }
|
|
219
223
|
availabilityByLocation { locationId locationName inStock }
|
|
@@ -268,6 +272,12 @@ const ORDER_FIELDS = `
|
|
|
268
272
|
customer { id firstName lastName emailAddress }
|
|
269
273
|
couponCodes
|
|
270
274
|
`;
|
|
275
|
+
const ORDER_FULFILLMENTS_FRAGMENT = `
|
|
276
|
+
fulfillments {
|
|
277
|
+
id state method trackingCode createdAt updatedAt
|
|
278
|
+
lines { orderLineId quantity }
|
|
279
|
+
}
|
|
280
|
+
`;
|
|
271
281
|
export const ACTIVE_ORDER = `
|
|
272
282
|
query ActiveOrder {
|
|
273
283
|
activeOrder { ${ORDER_FIELDS} }
|
|
@@ -398,6 +408,54 @@ export const ADD_PAYMENT = `
|
|
|
398
408
|
}
|
|
399
409
|
}
|
|
400
410
|
`;
|
|
411
|
+
const PICKUP_LOCATION_FIELDS = `
|
|
412
|
+
provider
|
|
413
|
+
carrier
|
|
414
|
+
locationCode
|
|
415
|
+
name
|
|
416
|
+
address {
|
|
417
|
+
streetLine1
|
|
418
|
+
number
|
|
419
|
+
postalCode
|
|
420
|
+
city
|
|
421
|
+
countryCode
|
|
422
|
+
region
|
|
423
|
+
}
|
|
424
|
+
openingHours {
|
|
425
|
+
weekday
|
|
426
|
+
open
|
|
427
|
+
close
|
|
428
|
+
}
|
|
429
|
+
details
|
|
430
|
+
`;
|
|
431
|
+
export const PICKUP_LOCATIONS = `
|
|
432
|
+
query PickupLocations($input: PickupLocationSearchInput!) {
|
|
433
|
+
pickupLocations(input: $input) {
|
|
434
|
+
${PICKUP_LOCATION_FIELDS}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
`;
|
|
438
|
+
export const ACTIVE_ORDER_PICKUP_LOCATION = `
|
|
439
|
+
query ActiveOrderPickupLocation {
|
|
440
|
+
activeOrderPickupLocation {
|
|
441
|
+
${PICKUP_LOCATION_FIELDS}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
`;
|
|
445
|
+
export const SET_ACTIVE_ORDER_PICKUP_LOCATION = `
|
|
446
|
+
mutation SetActiveOrderPickupLocation($location: StoredPickupLocationInput!) {
|
|
447
|
+
setActiveOrderPickupLocation(location: $location) {
|
|
448
|
+
__typename
|
|
449
|
+
... on Order {
|
|
450
|
+
id code state
|
|
451
|
+
}
|
|
452
|
+
... on ErrorResult {
|
|
453
|
+
errorCode
|
|
454
|
+
message
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
`;
|
|
401
459
|
export const CREATE_STRIPE_PAYMENT_INTENT = `
|
|
402
460
|
mutation CreateStripePaymentIntent {
|
|
403
461
|
createStripePaymentIntent
|
|
@@ -412,6 +470,18 @@ export const MOLLIE_PAYMENT_METHODS = `
|
|
|
412
470
|
minimumAmount { value currency }
|
|
413
471
|
maximumAmount { value currency }
|
|
414
472
|
image { size1x size2x svg }
|
|
473
|
+
status
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
`;
|
|
477
|
+
export const ORDERED_MOLLIE_PAYMENT_METHODS = `
|
|
478
|
+
query OrderedMolliePaymentMethods($paymentMethodCode: String!) {
|
|
479
|
+
orderedMolliePaymentMethods(paymentMethodCode: $paymentMethodCode) {
|
|
480
|
+
id
|
|
481
|
+
code
|
|
482
|
+
description
|
|
483
|
+
imageUrl
|
|
484
|
+
status
|
|
415
485
|
}
|
|
416
486
|
}
|
|
417
487
|
`;
|
|
@@ -423,6 +493,15 @@ export const CREATE_MOLLIE_PAYMENT_INTENT = `
|
|
|
423
493
|
}
|
|
424
494
|
}
|
|
425
495
|
`;
|
|
496
|
+
export const SYNC_MOLLIE_PAYMENT_STATUS = `
|
|
497
|
+
mutation SyncMolliePaymentStatus($orderCode: String!) {
|
|
498
|
+
syncMolliePaymentStatus(orderCode: $orderCode) {
|
|
499
|
+
id
|
|
500
|
+
code
|
|
501
|
+
state
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
`;
|
|
426
505
|
export const LOGIN = `
|
|
427
506
|
mutation Login($email: String!, $password: String!) {
|
|
428
507
|
login(username: $email, password: $password) {
|
|
@@ -456,6 +535,7 @@ export const GET_CURRENT_CUSTOMER = `
|
|
|
456
535
|
items {
|
|
457
536
|
id code state totalWithTax createdAt
|
|
458
537
|
lines { id quantity productVariant { name } }
|
|
538
|
+
${ORDER_FULFILLMENTS_FRAGMENT}
|
|
459
539
|
}
|
|
460
540
|
totalItems
|
|
461
541
|
}
|
|
@@ -469,6 +549,7 @@ export const GET_CUSTOMER_ORDERS = `
|
|
|
469
549
|
items {
|
|
470
550
|
id code state totalWithTax createdAt
|
|
471
551
|
lines { id quantity productVariant { name } }
|
|
552
|
+
${ORDER_FULFILLMENTS_FRAGMENT}
|
|
472
553
|
}
|
|
473
554
|
totalItems
|
|
474
555
|
}
|
|
@@ -592,7 +673,10 @@ export const AVAILABLE_COUNTRIES = `
|
|
|
592
673
|
`;
|
|
593
674
|
export const ORDER_BY_CODE = `
|
|
594
675
|
query OrderByCode($code: String!) {
|
|
595
|
-
orderByCode(code: $code) {
|
|
676
|
+
orderByCode(code: $code) {
|
|
677
|
+
${ORDER_FIELDS}
|
|
678
|
+
${ORDER_FULFILLMENTS_FRAGMENT}
|
|
679
|
+
}
|
|
596
680
|
}
|
|
597
681
|
`;
|
|
598
682
|
export const FAVORITE_VARIANT_IDS = `
|
|
@@ -610,6 +694,7 @@ export const MY_FAVORITES = `
|
|
|
610
694
|
productVariant {
|
|
611
695
|
id name sku
|
|
612
696
|
price priceWithTax currencyCode stockLevel
|
|
697
|
+
stockOnHand stockAllocated saleable
|
|
613
698
|
priceListName retailPrice retailPriceWithTax
|
|
614
699
|
priceTiers { minQuantity price priceWithTax discountLabel }
|
|
615
700
|
availabilityByLocation { locationId locationName inStock }
|
|
@@ -652,6 +737,7 @@ const CHANNEL_CUSTOM_FIELDS_FRAGMENT = `
|
|
|
652
737
|
cdnDomain maintenanceMode
|
|
653
738
|
urlLocaleStrategy urlLocalePrefixDefault
|
|
654
739
|
twitterHandle defaultOgImageId llmsTxtEnabled
|
|
740
|
+
storefrontUrl quotesEnabled
|
|
655
741
|
}
|
|
656
742
|
`;
|
|
657
743
|
export const GET_ACTIVE_CHANNEL = `
|
|
@@ -714,6 +800,7 @@ export const GET_PRODUCT_RECOMMENDATIONS = `
|
|
|
714
800
|
variants {
|
|
715
801
|
id name sku
|
|
716
802
|
price priceWithTax currencyCode stockLevel
|
|
803
|
+
stockOnHand stockAllocated saleable
|
|
717
804
|
priceListName retailPrice retailPriceWithTax
|
|
718
805
|
priceTiers { minQuantity price priceWithTax discountLabel }
|
|
719
806
|
availabilityByLocation { locationId locationName inStock }
|
|
@@ -730,10 +817,41 @@ export const GET_EXCHANGE_RATES = `
|
|
|
730
817
|
}
|
|
731
818
|
}
|
|
732
819
|
`;
|
|
820
|
+
const CONVERTED_AMOUNT_FIELDS = `
|
|
821
|
+
originalAmount originalCurrency convertedAmount targetCurrency rate rateDate
|
|
822
|
+
`;
|
|
733
823
|
export const CONVERT_CURRENCY = `
|
|
734
824
|
query ConvertCurrency($amount: String!, $from: String!, $to: String!) {
|
|
735
825
|
convertCurrency(amount: $amount, fromCurrency: $from, toCurrency: $to) {
|
|
736
|
-
|
|
826
|
+
${CONVERTED_AMOUNT_FIELDS}
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
`;
|
|
830
|
+
export const GET_EXCHANGE_RATE = `
|
|
831
|
+
query ExchangeRate($targetCurrency: String!) {
|
|
832
|
+
exchangeRate(targetCurrency: $targetCurrency) {
|
|
833
|
+
baseCurrency targetCurrency rate inverseRate rateDate
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
`;
|
|
837
|
+
export const CONVERT_FROM_BASE = `
|
|
838
|
+
query ConvertFromBase($amount: String!, $targetCurrency: String!) {
|
|
839
|
+
convertFromBase(amount: $amount, targetCurrency: $targetCurrency) {
|
|
840
|
+
${CONVERTED_AMOUNT_FIELDS}
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
`;
|
|
844
|
+
export const CONVERT_TO_BASE = `
|
|
845
|
+
query ConvertToBase($amount: String!, $sourceCurrency: String!) {
|
|
846
|
+
convertToBase(amount: $amount, sourceCurrency: $sourceCurrency) {
|
|
847
|
+
${CONVERTED_AMOUNT_FIELDS}
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
`;
|
|
851
|
+
export const CONVERT_TO_MULTIPLE = `
|
|
852
|
+
query ConvertToMultiple($amount: String!, $from: String!, $to: [String!]!) {
|
|
853
|
+
convertToMultiple(amount: $amount, fromCurrency: $from, toCurrencies: $to) {
|
|
854
|
+
currency amount rate
|
|
737
855
|
}
|
|
738
856
|
}
|
|
739
857
|
`;
|
|
@@ -803,4 +921,28 @@ export const GET_BRANDING = `
|
|
|
803
921
|
}
|
|
804
922
|
}
|
|
805
923
|
`;
|
|
924
|
+
export const ACTIVE_CHANNEL_ORDER_CONSTRAINTS = `
|
|
925
|
+
query ActiveChannelOrderConstraints {
|
|
926
|
+
activeChannelOrderConstraints {
|
|
927
|
+
minOrderAmountGross
|
|
928
|
+
fulfillmentMinOrderNet
|
|
929
|
+
currencyCode
|
|
930
|
+
customerIsExempt
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
`;
|
|
934
|
+
export const MY_ORDER_INVOICES = `
|
|
935
|
+
query MyOrderInvoices($orderCode: String!) {
|
|
936
|
+
myOrderInvoices(orderCode: $orderCode) {
|
|
937
|
+
id invoiceNumber invoicedOn totalWithTax currencyCode languageCode createdAt
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
`;
|
|
941
|
+
export const MY_INVOICE_PDF = `
|
|
942
|
+
query MyInvoicePdf($invoiceId: ID!) {
|
|
943
|
+
myInvoicePdf(invoiceId: $invoiceId) {
|
|
944
|
+
base64 filename invoiceNumber
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
`;
|
|
806
948
|
//# sourceMappingURL=queries.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/commerce/queries.ts"],"names":[],"mappings":"AAQA,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BjC,CAAC;AAEF,MAAM,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,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4B3B,CAAC;AAIF,MAAM,CAAC,MAAM,gCAAgC,GAAG;;;;;;;;;CAS/C,CAAC;AAIF,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;CAMhC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;CAM7B,CAAC"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { HttpClient } from '../core/http.js';
|
|
2
2
|
import type { DeliveryOption, DeliveryOptionsInput, DropOffPoint, DropOffPointInput, ShipmentTrackingInfo } from '../types.js';
|
|
3
|
+
export declare const DROP_OFF_POINTS = "\n query MyparcelDropOffPoints($input: MyparcelDropOffPointInput!) {\n myparcelDropOffPoints(input: $input) {\n location_code\n location_name\n street\n number\n number_suffix\n postal_code\n city\n cc\n phone\n reference\n longitude\n latitude\n available_days\n cut_off_time\n carrier_id\n distance\n }\n }\n";
|
|
4
|
+
export declare const DELIVERY_OPTIONS = "\n query MyparcelDeliveryOptions($input: MyparcelDeliveryOptionsInput!) {\n myparcelDeliveryOptions(input: $input) {\n date\n time {\n start\n end\n price_comment\n price { amount currency }\n type\n }\n }\n }\n";
|
|
5
|
+
export declare const TRACK_SHIPMENT = "\n query MyparcelTrackShipment($barcode: String!, $postalCode: String!) {\n myparcelTrackShipment(barcode: $barcode, postalCode: $postalCode) {\n shipment_id\n status {\n current\n final\n }\n history {\n status\n time\n }\n barcode\n link_consumer_portal\n }\n }\n";
|
|
3
6
|
export declare function createShippingMethods(http: HttpClient): {
|
|
4
7
|
getDropOffPoints(input: DropOffPointInput): Promise<DropOffPoint[]>;
|
|
5
8
|
getDeliveryOptions(input: DeliveryOptionsInput): Promise<DeliveryOption[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shipping.d.ts","sourceRoot":"","sources":["../../src/commerce/shipping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"shipping.d.ts","sourceRoot":"","sources":["../../src/commerce/shipping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,eAAe,mZAqB3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,kRAa5B,CAAC;AAEF,eAAO,MAAM,cAAc,qVAgB1B,CAAC;AAqFF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU;4BAEpB,iBAAiB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;8BAQzC,oBAAoB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;2BAQnD,MAAM,cAAc,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;EAQjG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const DROP_OFF_POINTS = `
|
|
1
|
+
export const DROP_OFF_POINTS = `
|
|
2
2
|
query MyparcelDropOffPoints($input: MyparcelDropOffPointInput!) {
|
|
3
3
|
myparcelDropOffPoints(input: $input) {
|
|
4
4
|
location_code
|
|
@@ -20,7 +20,7 @@ const DROP_OFF_POINTS = `
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
`;
|
|
23
|
-
const DELIVERY_OPTIONS = `
|
|
23
|
+
export const DELIVERY_OPTIONS = `
|
|
24
24
|
query MyparcelDeliveryOptions($input: MyparcelDeliveryOptionsInput!) {
|
|
25
25
|
myparcelDeliveryOptions(input: $input) {
|
|
26
26
|
date
|
|
@@ -28,11 +28,13 @@ const DELIVERY_OPTIONS = `
|
|
|
28
28
|
start
|
|
29
29
|
end
|
|
30
30
|
price_comment
|
|
31
|
+
price { amount currency }
|
|
32
|
+
type
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
`;
|
|
35
|
-
const TRACK_SHIPMENT = `
|
|
37
|
+
export const TRACK_SHIPMENT = `
|
|
36
38
|
query MyparcelTrackShipment($barcode: String!, $postalCode: String!) {
|
|
37
39
|
myparcelTrackShipment(barcode: $barcode, postalCode: $postalCode) {
|
|
38
40
|
shipment_id
|
|
@@ -76,6 +78,8 @@ function mapDeliveryOption(raw) {
|
|
|
76
78
|
start: t.start,
|
|
77
79
|
end: t.end,
|
|
78
80
|
priceComment: t.price_comment,
|
|
81
|
+
price: t.price,
|
|
82
|
+
deliveryType: t.type,
|
|
79
83
|
})),
|
|
80
84
|
};
|
|
81
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shipping.js","sourceRoot":"","sources":["../../src/commerce/shipping.ts"],"names":[],"mappings":"AASA,MAAM,eAAe,GAAiB;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"shipping.js","sourceRoot":"","sources":["../../src/commerce/shipping.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,eAAe,GAAiB;;;;;;;;;;;;;;;;;;;;;CAqB5C,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAiB;;;;;;;;;;;;;CAa7C,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAiB;;;;;;;;;;;;;;;;CAgB3C,CAAC;AAwCF,SAAS,eAAe,CAAC,GAAoB;IAC3C,OAAO;QACL,YAAY,EAAE,GAAG,CAAC,aAAa;QAC/B,YAAY,EAAE,GAAG,CAAC,aAAa;QAC/B,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,YAAY,EAAE,GAAG,CAAC,aAAa;QAC/B,UAAU,EAAE,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OAAO,CAC7B,eAAe,EACf,EAAE,KAAK,EAAE,CACV,CAAC;YACF,OAAO,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QACzD,CAAC;QAED,KAAK,CAAC,kBAAkB,CAAC,KAA2B;YAClD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAC7B,gBAAgB,EAChB,EAAE,KAAK,EAAE,CACV,CAAC;YACF,OAAO,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC7D,CAAC;QAED,KAAK,CAAC,aAAa,CAAC,OAAe,EAAE,UAAkB;YACrD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAC7B,cAAc,EACd,EAAE,OAAO,EAAE,UAAU,EAAE,CACxB,CAAC;YACF,OAAO,WAAW,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QACjD,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import type { HttpClient } from '../core/http.js';
|
|
2
|
-
import type { CustomerSubscription } from '../types.js';
|
|
2
|
+
import type { CustomerSubscription, MyPaymentMandate, SetupPaymentMandateResult, SubscriptionPlanPublic } from '../types.js';
|
|
3
|
+
export declare const SUBSCRIPTION_PLANS = "\n query SubscriptionPlans {\n subscriptionPlans { \n id\n name\n description\n currencyCode\n price\n billingInterval\n billingIntervalCount\n trialDays\n minCycles\n maxCycles\n }\n }\n";
|
|
4
|
+
export declare const MY_PAYMENT_MANDATES = "\n query MyPaymentMandates {\n myPaymentMandates { \n id\n provider\n mandateMethod\n mandateStatus\n isDefault\n createdAt\n }\n }\n";
|
|
5
|
+
export declare const SETUP_PAYMENT_MANDATE = "\n mutation SetupPaymentMandate($input: SetupPaymentMandateInput!) {\n setupPaymentMandate(input: $input) {\n mandate { \n id\n provider\n mandateMethod\n mandateStatus\n isDefault\n createdAt\n }\n checkoutUrl\n clientSecret\n }\n }\n";
|
|
6
|
+
export declare const CREATE_MY_SUBSCRIPTION = "\n mutation CreateMySubscription($input: CreateMySubscriptionInput!) {\n createMySubscription(input: $input) { \n id\n planName\n currencyCode\n recurringPrice\n billingInterval\n currentStatus\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n cancelAtPeriodEnd\n createdAt\n }\n }\n";
|
|
7
|
+
export declare const MY_SUBSCRIPTIONS = "\n query MySubscriptions {\n mySubscriptions { \n id\n planName\n currencyCode\n recurringPrice\n billingInterval\n currentStatus\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n cancelAtPeriodEnd\n createdAt\n }\n }\n";
|
|
8
|
+
export declare const PAUSE_MY_SUBSCRIPTION = "\n mutation PauseMySubscription($id: ID!, $reason: String) {\n pauseMySubscription(id: $id, reason: $reason) { \n id\n planName\n currencyCode\n recurringPrice\n billingInterval\n currentStatus\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n cancelAtPeriodEnd\n createdAt\n }\n }\n";
|
|
9
|
+
export declare const RESUME_MY_SUBSCRIPTION = "\n mutation ResumeMySubscription($id: ID!) {\n resumeMySubscription(id: $id) { \n id\n planName\n currencyCode\n recurringPrice\n billingInterval\n currentStatus\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n cancelAtPeriodEnd\n createdAt\n }\n }\n";
|
|
10
|
+
export declare const CANCEL_MY_SUBSCRIPTION = "\n mutation CancelMySubscription($id: ID!, $reason: String, $immediate: Boolean) {\n cancelMySubscription(id: $id, reason: $reason, immediate: $immediate) { \n id\n planName\n currencyCode\n recurringPrice\n billingInterval\n currentStatus\n currentPeriodStart\n currentPeriodEnd\n nextRenewalAt\n cancelAtPeriodEnd\n createdAt\n }\n }\n";
|
|
3
11
|
export declare function createSubscriptionsMethods(http: HttpClient): {
|
|
4
12
|
getMySubscriptions(): Promise<CustomerSubscription[]>;
|
|
13
|
+
getSubscriptionPlans(): Promise<SubscriptionPlanPublic[]>;
|
|
14
|
+
getMyPaymentMandates(): Promise<MyPaymentMandate[]>;
|
|
15
|
+
setupPaymentMandate(input: {
|
|
16
|
+
provider: string;
|
|
17
|
+
redirectUrl: string;
|
|
18
|
+
}): Promise<SetupPaymentMandateResult>;
|
|
19
|
+
createSubscription(planId: string, mandateId: string): Promise<CustomerSubscription>;
|
|
5
20
|
pauseMySubscription(id: string, reason?: string): Promise<CustomerSubscription>;
|
|
6
21
|
resumeMySubscription(id: string): Promise<CustomerSubscription>;
|
|
7
22
|
cancelMySubscription(id: string, options?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/commerce/subscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/commerce/subscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,oBAAoB,EACpB,gBAAgB,EAChB,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAsCrB,eAAO,MAAM,kBAAkB,+MAI9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,qJAI/B,CAAC;AAEF,eAAO,MAAM,qBAAqB,6QAQjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,wTAIlC,CAAC;AAEF,eAAO,MAAM,gBAAgB,wPAI5B,CAAC;AAEF,eAAO,MAAM,qBAAqB,wTAIjC,CAAC;AAEF,eAAO,MAAM,sBAAsB,wRAIlC,CAAC;AAEF,eAAO,MAAM,sBAAsB,sWAIlC,CAAC;AAEF,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,UAAU;0BAE3B,OAAO,CAAC,oBAAoB,EAAE,CAAC;4BAO7B,OAAO,CAAC,sBAAsB,EAAE,CAAC;4BAOjC,OAAO,CAAC,gBAAgB,EAAE,CAAC;+BAOxB;QAC/B,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;KACrB,GAAG,OAAO,CAAC,yBAAyB,CAAC;+BAQL,MAAM,aAAa,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;4BAQ5D,MAAM,WAAW,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;6BAQtD,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;6BAS/D,MAAM,YACA;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GACjD,OAAO,CAAC,oBAAoB,CAAC;EAQnC"}
|
|
@@ -11,22 +11,66 @@ const SUBSCRIPTION_FIELDS = `
|
|
|
11
11
|
cancelAtPeriodEnd
|
|
12
12
|
createdAt
|
|
13
13
|
`;
|
|
14
|
-
const
|
|
14
|
+
const SUBSCRIPTION_PLAN_PUBLIC_FIELDS = `
|
|
15
|
+
id
|
|
16
|
+
name
|
|
17
|
+
description
|
|
18
|
+
currencyCode
|
|
19
|
+
price
|
|
20
|
+
billingInterval
|
|
21
|
+
billingIntervalCount
|
|
22
|
+
trialDays
|
|
23
|
+
minCycles
|
|
24
|
+
maxCycles
|
|
25
|
+
`;
|
|
26
|
+
const PAYMENT_MANDATE_FIELDS = `
|
|
27
|
+
id
|
|
28
|
+
provider
|
|
29
|
+
mandateMethod
|
|
30
|
+
mandateStatus
|
|
31
|
+
isDefault
|
|
32
|
+
createdAt
|
|
33
|
+
`;
|
|
34
|
+
export const SUBSCRIPTION_PLANS = `
|
|
35
|
+
query SubscriptionPlans {
|
|
36
|
+
subscriptionPlans { ${SUBSCRIPTION_PLAN_PUBLIC_FIELDS} }
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
export const MY_PAYMENT_MANDATES = `
|
|
40
|
+
query MyPaymentMandates {
|
|
41
|
+
myPaymentMandates { ${PAYMENT_MANDATE_FIELDS} }
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
export const SETUP_PAYMENT_MANDATE = `
|
|
45
|
+
mutation SetupPaymentMandate($input: SetupPaymentMandateInput!) {
|
|
46
|
+
setupPaymentMandate(input: $input) {
|
|
47
|
+
mandate { ${PAYMENT_MANDATE_FIELDS} }
|
|
48
|
+
checkoutUrl
|
|
49
|
+
clientSecret
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
export const CREATE_MY_SUBSCRIPTION = `
|
|
54
|
+
mutation CreateMySubscription($input: CreateMySubscriptionInput!) {
|
|
55
|
+
createMySubscription(input: $input) { ${SUBSCRIPTION_FIELDS} }
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
export const MY_SUBSCRIPTIONS = `
|
|
15
59
|
query MySubscriptions {
|
|
16
60
|
mySubscriptions { ${SUBSCRIPTION_FIELDS} }
|
|
17
61
|
}
|
|
18
62
|
`;
|
|
19
|
-
const PAUSE_MY_SUBSCRIPTION = `
|
|
63
|
+
export const PAUSE_MY_SUBSCRIPTION = `
|
|
20
64
|
mutation PauseMySubscription($id: ID!, $reason: String) {
|
|
21
65
|
pauseMySubscription(id: $id, reason: $reason) { ${SUBSCRIPTION_FIELDS} }
|
|
22
66
|
}
|
|
23
67
|
`;
|
|
24
|
-
const RESUME_MY_SUBSCRIPTION = `
|
|
68
|
+
export const RESUME_MY_SUBSCRIPTION = `
|
|
25
69
|
mutation ResumeMySubscription($id: ID!) {
|
|
26
70
|
resumeMySubscription(id: $id) { ${SUBSCRIPTION_FIELDS} }
|
|
27
71
|
}
|
|
28
72
|
`;
|
|
29
|
-
const CANCEL_MY_SUBSCRIPTION = `
|
|
73
|
+
export const CANCEL_MY_SUBSCRIPTION = `
|
|
30
74
|
mutation CancelMySubscription($id: ID!, $reason: String, $immediate: Boolean) {
|
|
31
75
|
cancelMySubscription(id: $id, reason: $reason, immediate: $immediate) { ${SUBSCRIPTION_FIELDS} }
|
|
32
76
|
}
|
|
@@ -37,6 +81,22 @@ export function createSubscriptionsMethods(http) {
|
|
|
37
81
|
const data = await http.graphql(MY_SUBSCRIPTIONS);
|
|
38
82
|
return data.mySubscriptions;
|
|
39
83
|
},
|
|
84
|
+
async getSubscriptionPlans() {
|
|
85
|
+
const data = await http.graphql(SUBSCRIPTION_PLANS);
|
|
86
|
+
return data.subscriptionPlans;
|
|
87
|
+
},
|
|
88
|
+
async getMyPaymentMandates() {
|
|
89
|
+
const data = await http.graphql(MY_PAYMENT_MANDATES);
|
|
90
|
+
return data.myPaymentMandates;
|
|
91
|
+
},
|
|
92
|
+
async setupPaymentMandate(input) {
|
|
93
|
+
const data = await http.graphql(SETUP_PAYMENT_MANDATE, { input });
|
|
94
|
+
return data.setupPaymentMandate;
|
|
95
|
+
},
|
|
96
|
+
async createSubscription(planId, mandateId) {
|
|
97
|
+
const data = await http.graphql(CREATE_MY_SUBSCRIPTION, { input: { planId, mandateId } });
|
|
98
|
+
return data.createMySubscription;
|
|
99
|
+
},
|
|
40
100
|
async pauseMySubscription(id, reason) {
|
|
41
101
|
const data = await http.graphql(PAUSE_MY_SUBSCRIPTION, { id, reason });
|
|
42
102
|
return data.pauseMySubscription;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../src/commerce/subscriptions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../src/commerce/subscriptions.ts"],"names":[],"mappings":"AAQA,MAAM,mBAAmB,GAAG;;;;;;;;;;;;CAY3B,CAAC;AAEF,MAAM,+BAA+B,GAAG;;;;;;;;;;;CAWvC,CAAC;AAEF,MAAM,sBAAsB,GAAG;;;;;;;CAO9B,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG;;0BAER,+BAA+B;;CAExD,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG;;0BAET,sBAAsB;;CAE/C,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB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AE,SAAS,EAAE,EAAE,CACjC,CAAC;YACF,OAAO,IAAI,CAAC,oBAAoB,CAAC;QACnC,CAAC;QAED,KAAK,CAAC,mBAAmB,CAAC,EAAU,EAAE,MAAe;YACnD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAC7B,qBAAqB,EACrB,EAAE,EAAE,EAAE,MAAM,EAAE,CACf,CAAC;YACF,OAAO,IAAI,CAAC,mBAAmB,CAAC;QAClC,CAAC;QAED,KAAK,CAAC,oBAAoB,CAAC,EAAU;YACnC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAC7B,sBAAsB,EACtB,EAAE,EAAE,EAAE,CACP,CAAC;YACF,OAAO,IAAI,CAAC,oBAAoB,CAAC;QACnC,CAAC;QAED,KAAK,CAAC,oBAAoB,CACxB,EAAU,EACV,OAAkD;YAElD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAC7B,sBAAsB,EACtB,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,KAAK,EAAE,CACxE,CAAC;YACF,OAAO,IAAI,CAAC,oBAAoB,CAAC;QACnC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HttpClient } from '../core/http.js';
|
|
2
|
+
import type { CmsCollection, CmsCollectionDetail, CmsCollectionItem, CmsCollectionItemList, CollectionItemsQuery, RequestOptions } from '../types.js';
|
|
3
|
+
export declare function createCmsCollectionMethods(http: HttpClient): {
|
|
4
|
+
getCollections(options?: RequestOptions): Promise<CmsCollection[]>;
|
|
5
|
+
getCollection(collectionId: string, options?: RequestOptions): Promise<CmsCollectionDetail>;
|
|
6
|
+
getCollectionItems(collectionId: string, query?: CollectionItemsQuery, options?: RequestOptions): Promise<CmsCollectionItemList>;
|
|
7
|
+
getCollectionItem(collectionId: string, itemId: string, languageCode?: string, options?: RequestOptions): Promise<CmsCollectionItem>;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=collections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/content/collections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACf,MAAM,aAAa,CAAC;AA0BrB,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,UAAU;6BAGxB,cAAc,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;gCAOxD,MAAM,YACV,cAAc,GACvB,OAAO,CAAC,mBAAmB,CAAC;qCAcf,MAAM,UACZ,oBAAoB,YAClB,cAAc,GACvB,OAAO,CAAC,qBAAqB,CAAC;oCAoBjB,MAAM,UACZ,MAAM,iBACC,MAAM,YACX,cAAc,GACvB,OAAO,CAAC,iBAAiB,CAAC;EAWhC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export function createCmsCollectionMethods(http) {
|
|
2
|
+
return {
|
|
3
|
+
async getCollections(options) {
|
|
4
|
+
const envelope = await http.cmsGet('/collections', {}, options);
|
|
5
|
+
return envelope.data;
|
|
6
|
+
},
|
|
7
|
+
async getCollection(collectionId, options) {
|
|
8
|
+
const envelope = await http.cmsGet(`/collections/${collectionId}`, {}, options);
|
|
9
|
+
return envelope.data;
|
|
10
|
+
},
|
|
11
|
+
async getCollectionItems(collectionId, query, options) {
|
|
12
|
+
const params = {};
|
|
13
|
+
if (query?.parentId)
|
|
14
|
+
params.parent_id = query.parentId;
|
|
15
|
+
if (query?.slug)
|
|
16
|
+
params.slug = query.slug;
|
|
17
|
+
if (query?.search)
|
|
18
|
+
params.search = query.search;
|
|
19
|
+
if (query?.sort)
|
|
20
|
+
params.sort = query.sort;
|
|
21
|
+
if (query?.languageCode)
|
|
22
|
+
params.language_code = query.languageCode;
|
|
23
|
+
if (query?.limit != null)
|
|
24
|
+
params.limit = String(query.limit);
|
|
25
|
+
if (query?.offset != null)
|
|
26
|
+
params.offset = String(query.offset);
|
|
27
|
+
const envelope = await http.cmsGet(`/collections/${collectionId}/items`, params, options);
|
|
28
|
+
return { items: envelope.data, total: envelope.pagination.total };
|
|
29
|
+
},
|
|
30
|
+
async getCollectionItem(collectionId, itemId, languageCode, options) {
|
|
31
|
+
const params = {};
|
|
32
|
+
if (languageCode)
|
|
33
|
+
params.language_code = languageCode;
|
|
34
|
+
const envelope = await http.cmsGet(`/collections/${collectionId}/items/${itemId}`, params, options);
|
|
35
|
+
return envelope.data;
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=collections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.js","sourceRoot":"","sources":["../../src/content/collections.ts"],"names":[],"mappings":"AAkCA,MAAM,UAAU,0BAA0B,CAAC,IAAgB;IACzD,OAAO;QAEL,KAAK,CAAC,cAAc,CAAC,OAAwB;YAC3C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAyB,cAAc,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;YACxF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;QAGD,KAAK,CAAC,aAAa,CACjB,YAAoB,EACpB,OAAwB;YAExB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAChC,gBAAgB,YAAY,EAAE,EAC9B,EAAE,EACF,OAAO,CACR,CAAC;YACF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;QAMD,KAAK,CAAC,kBAAkB,CACtB,YAAoB,EACpB,KAA4B,EAC5B,OAAwB;YAExB,MAAM,MAAM,GAA2B,EAAE,CAAC;YAC1C,IAAI,KAAK,EAAE,QAAQ;gBAAE,MAAM,CAAC,SAAS,GA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
|
|
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;
|
|
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;AAW/D,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,GAAG,aAAa,CAYtF"}
|
package/dist/content/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createAssetMethods } from './assets.js';
|
|
2
2
|
import { createCollectionPageMethods } from './collection-pages.js';
|
|
3
|
+
import { createCmsCollectionMethods } from './collections.js';
|
|
3
4
|
import { createFormMethods } from './forms.js';
|
|
4
5
|
import { createContentItemMethods } from './items.js';
|
|
5
6
|
import { createMenuMethods } from './menus.js';
|
|
@@ -16,6 +17,7 @@ export function createContentModule(http, ctx) {
|
|
|
16
17
|
...createMenuMethods(http),
|
|
17
18
|
...createSitemapMethods(http),
|
|
18
19
|
...createCollectionPageMethods(http),
|
|
20
|
+
...createCmsCollectionMethods(http),
|
|
19
21
|
};
|
|
20
22
|
}
|
|
21
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +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,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,O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rE,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;QAC1B,GAAG,oBAAoB,CAAC,IAAI,CAAC;QAC7B,GAAG,2BAA2B,CAAC,IAAI,CAAC;QACpC,GAAG,0BAA0B,CAAC,IAAI,CAAC;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { HttpClient } from '../core/http.js';
|
|
2
|
-
import type { ConvertedAmount, ExchangeRate } from '../types.js';
|
|
2
|
+
import type { BulkConversionResult, ConvertedAmount, ExchangeRate } from '../types.js';
|
|
3
3
|
export declare function createExchangeMethods(http: HttpClient): {
|
|
4
4
|
getExchangeRates(): Promise<ExchangeRate[]>;
|
|
5
|
+
getExchangeRate(targetCurrency: string): Promise<ExchangeRate | null>;
|
|
5
6
|
convertCurrency(amount: string, fromCurrency: string, toCurrency: string): Promise<ConvertedAmount>;
|
|
7
|
+
convertFromBase(amount: string, targetCurrency: string): Promise<ConvertedAmount>;
|
|
8
|
+
convertToBase(amount: string, sourceCurrency: string): Promise<ConvertedAmount>;
|
|
9
|
+
convertToMultiple(amount: string, fromCurrency: string, toCurrencies: string[]): Promise<BulkConversionResult[]>;
|
|
6
10
|
};
|
|
7
11
|
//# sourceMappingURL=exchange.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exchange.d.ts","sourceRoot":"","sources":["../../src/currency/exchange.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exchange.d.ts","sourceRoot":"","sources":["../../src/currency/exchange.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEvF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU;wBAExB,OAAO,CAAC,YAAY,EAAE,CAAC;oCASX,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;4BAQjE,MAAM,gBACA,MAAM,cACR,MAAM,GACjB,OAAO,CAAC,eAAe,CAAC;4BAUG,MAAM,kBAAkB,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;0BAS3D,MAAM,kBAAkB,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;8BAc3E,MAAM,gBACA,MAAM,gBACN,MAAM,EAAE,GACrB,OAAO,CAAC,oBAAoB,EAAE,CAAC;EAQrC"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { CONVERT_CURRENCY, GET_EXCHANGE_RATES } from '../commerce/queries.js';
|
|
1
|
+
import { CONVERT_CURRENCY, CONVERT_FROM_BASE, CONVERT_TO_BASE, CONVERT_TO_MULTIPLE, GET_EXCHANGE_RATE, GET_EXCHANGE_RATES, } from '../commerce/queries.js';
|
|
2
2
|
export function createExchangeMethods(http) {
|
|
3
3
|
return {
|
|
4
4
|
async getExchangeRates() {
|
|
5
5
|
const data = await http.graphql(GET_EXCHANGE_RATES);
|
|
6
6
|
return data.exchangeRates;
|
|
7
7
|
},
|
|
8
|
+
async getExchangeRate(targetCurrency) {
|
|
9
|
+
const data = await http.graphql(GET_EXCHANGE_RATE, {
|
|
10
|
+
targetCurrency,
|
|
11
|
+
});
|
|
12
|
+
return data.exchangeRate;
|
|
13
|
+
},
|
|
8
14
|
async convertCurrency(amount, fromCurrency, toCurrency) {
|
|
9
15
|
const data = await http.graphql(CONVERT_CURRENCY, {
|
|
10
16
|
amount,
|
|
@@ -13,6 +19,24 @@ export function createExchangeMethods(http) {
|
|
|
13
19
|
});
|
|
14
20
|
return data.convertCurrency;
|
|
15
21
|
},
|
|
22
|
+
async convertFromBase(amount, targetCurrency) {
|
|
23
|
+
const data = await http.graphql(CONVERT_FROM_BASE, {
|
|
24
|
+
amount,
|
|
25
|
+
targetCurrency,
|
|
26
|
+
});
|
|
27
|
+
return data.convertFromBase;
|
|
28
|
+
},
|
|
29
|
+
async convertToBase(amount, sourceCurrency) {
|
|
30
|
+
const data = await http.graphql(CONVERT_TO_BASE, {
|
|
31
|
+
amount,
|
|
32
|
+
sourceCurrency,
|
|
33
|
+
});
|
|
34
|
+
return data.convertToBase;
|
|
35
|
+
},
|
|
36
|
+
async convertToMultiple(amount, fromCurrency, toCurrencies) {
|
|
37
|
+
const data = await http.graphql(CONVERT_TO_MULTIPLE, { amount, from: fromCurrency, to: toCurrencies });
|
|
38
|
+
return data.convertToMultiple;
|
|
39
|
+
},
|
|
16
40
|
};
|
|
17
41
|
}
|
|
18
42
|
//# sourceMappingURL=exchange.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../src/currency/exchange.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../src/currency/exchange.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAIhC,MAAM,UAAU,qBAAqB,CAAC,IAAgB;IACpD,OAAO;QACL,KAAK,CAAC,gBAAgB;YACpB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAoC,kBAAkB,CAAC,CAAC;YACvF,OAAO,IAAI,CAAC,aAAa,CAAC;QAC5B,CAAC;QAMD,KAAK,CAAC,eAAe,CAAC,cAAsB;YAC1C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAwC,iBAAiB,EAAE;gBACxF,cAAc;aACf,CAAC,CAAC;YACH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