@daffodil/driver 0.91.0 → 0.92.3-rc.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/fesm2022/daffodil-driver-hubspot-testing.mjs +3 -3
- package/fesm2022/daffodil-driver-hubspot-testing.mjs.map +1 -1
- package/fesm2022/daffodil-driver-in-memory.mjs +7 -7
- package/fesm2022/daffodil-driver-in-memory.mjs.map +1 -1
- package/fesm2022/daffodil-driver-magento-testing.mjs +9 -9
- package/fesm2022/daffodil-driver-magento-testing.mjs.map +1 -1
- package/fesm2022/daffodil-driver-magento.mjs +86 -88
- package/fesm2022/daffodil-driver-magento.mjs.map +1 -1
- package/fesm2022/daffodil-driver-shopify-testing.mjs +85 -59
- package/fesm2022/daffodil-driver-shopify-testing.mjs.map +1 -1
- package/fesm2022/daffodil-driver-shopify.mjs +383 -242
- package/fesm2022/daffodil-driver-shopify.mjs.map +1 -1
- package/fesm2022/daffodil-driver.mjs +3 -3
- package/fesm2022/daffodil-driver.mjs.map +1 -1
- package/magento/index.d.ts +20 -26
- package/package.json +1 -1
- package/shopify/index.d.ts +2933 -1530
- package/shopify/testing/index.d.ts +55 -29
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { faker } from '@faker-js/faker/locale/en_US';
|
|
2
|
+
import { gql, provideNamedApollo } from 'apollo-angular';
|
|
1
3
|
import { inject, InjectionToken } from '@angular/core';
|
|
2
4
|
import { InMemoryCache, from } from '@apollo/client/core';
|
|
3
|
-
import { provideNamedApollo } from 'apollo-angular';
|
|
4
5
|
import { setContext } from '@apollo/client/link/context';
|
|
5
6
|
import { onError } from '@apollo/client/link/error';
|
|
6
7
|
import { HttpHeaders } from '@angular/common/http';
|
|
@@ -88,7 +89,10 @@ var ShopifyCartDeliveryGroupType;
|
|
|
88
89
|
/** The delivery group only contains subscription merchandise. */
|
|
89
90
|
ShopifyCartDeliveryGroupType["Subscription"] = "SUBSCRIPTION";
|
|
90
91
|
})(ShopifyCartDeliveryGroupType || (ShopifyCartDeliveryGroupType = {}));
|
|
91
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* Error codes returned by [`CartUserError`](https://shopify.dev/docs/api/storefront/current/objects/CartUserError) during cart mutations. Covers validation failures for addresses, quantities, delivery options, merchandise lines, discount codes, and metafields.
|
|
94
|
+
*
|
|
95
|
+
*/
|
|
92
96
|
var ShopifyCartErrorCode;
|
|
93
97
|
(function (ShopifyCartErrorCode) {
|
|
94
98
|
/** The specified address field contains emojis. */
|
|
@@ -107,6 +111,8 @@ var ShopifyCartErrorCode;
|
|
|
107
111
|
ShopifyCartErrorCode["Invalid"] = "INVALID";
|
|
108
112
|
/** Company location not found or not allowed. */
|
|
109
113
|
ShopifyCartErrorCode["InvalidCompanyLocation"] = "INVALID_COMPANY_LOCATION";
|
|
114
|
+
/** The delivery address was not found. */
|
|
115
|
+
ShopifyCartErrorCode["InvalidDeliveryAddressId"] = "INVALID_DELIVERY_ADDRESS_ID";
|
|
110
116
|
/** Delivery group was not found in cart. */
|
|
111
117
|
ShopifyCartErrorCode["InvalidDeliveryGroup"] = "INVALID_DELIVERY_GROUP";
|
|
112
118
|
/** Delivery option was not valid. */
|
|
@@ -137,10 +143,36 @@ var ShopifyCartErrorCode;
|
|
|
137
143
|
ShopifyCartErrorCode["MissingDiscountCode"] = "MISSING_DISCOUNT_CODE";
|
|
138
144
|
/** Missing note. */
|
|
139
145
|
ShopifyCartErrorCode["MissingNote"] = "MISSING_NOTE";
|
|
146
|
+
/** The note length must be below the specified maximum. */
|
|
147
|
+
ShopifyCartErrorCode["NoteTooLong"] = "NOTE_TOO_LONG";
|
|
148
|
+
/** Only one delivery address can be selected. */
|
|
149
|
+
ShopifyCartErrorCode["OnlyOneDeliveryAddressCanBeSelected"] = "ONLY_ONE_DELIVERY_ADDRESS_CAN_BE_SELECTED";
|
|
150
|
+
/** Credit card has expired. */
|
|
151
|
+
ShopifyCartErrorCode["PaymentsCreditCardBaseExpired"] = "PAYMENTS_CREDIT_CARD_BASE_EXPIRED";
|
|
152
|
+
/** Credit card gateway is not supported. */
|
|
153
|
+
ShopifyCartErrorCode["PaymentsCreditCardBaseGatewayNotSupported"] = "PAYMENTS_CREDIT_CARD_BASE_GATEWAY_NOT_SUPPORTED";
|
|
154
|
+
/** Credit card error. */
|
|
155
|
+
ShopifyCartErrorCode["PaymentsCreditCardGeneric"] = "PAYMENTS_CREDIT_CARD_GENERIC";
|
|
156
|
+
/** Credit card month is invalid. */
|
|
157
|
+
ShopifyCartErrorCode["PaymentsCreditCardMonthInclusion"] = "PAYMENTS_CREDIT_CARD_MONTH_INCLUSION";
|
|
158
|
+
/** Credit card number is invalid. */
|
|
159
|
+
ShopifyCartErrorCode["PaymentsCreditCardNumberInvalid"] = "PAYMENTS_CREDIT_CARD_NUMBER_INVALID";
|
|
160
|
+
/** Credit card number format is invalid. */
|
|
161
|
+
ShopifyCartErrorCode["PaymentsCreditCardNumberInvalidFormat"] = "PAYMENTS_CREDIT_CARD_NUMBER_INVALID_FORMAT";
|
|
162
|
+
/** Credit card verification value is blank. */
|
|
163
|
+
ShopifyCartErrorCode["PaymentsCreditCardVerificationValueBlank"] = "PAYMENTS_CREDIT_CARD_VERIFICATION_VALUE_BLANK";
|
|
164
|
+
/** Credit card verification value is invalid for card type. */
|
|
165
|
+
ShopifyCartErrorCode["PaymentsCreditCardVerificationValueInvalidForCardType"] = "PAYMENTS_CREDIT_CARD_VERIFICATION_VALUE_INVALID_FOR_CARD_TYPE";
|
|
166
|
+
/** Credit card has expired. */
|
|
167
|
+
ShopifyCartErrorCode["PaymentsCreditCardYearExpired"] = "PAYMENTS_CREDIT_CARD_YEAR_EXPIRED";
|
|
168
|
+
/** Credit card expiry year is invalid. */
|
|
169
|
+
ShopifyCartErrorCode["PaymentsCreditCardYearInvalidExpiryYear"] = "PAYMENTS_CREDIT_CARD_YEAR_INVALID_EXPIRY_YEAR";
|
|
140
170
|
/** The payment method is not supported. */
|
|
141
171
|
ShopifyCartErrorCode["PaymentMethodNotSupported"] = "PAYMENT_METHOD_NOT_SUPPORTED";
|
|
142
172
|
/** The given province cannot be found. */
|
|
143
173
|
ShopifyCartErrorCode["ProvinceNotFound"] = "PROVINCE_NOT_FOUND";
|
|
174
|
+
/** Too many delivery addresses on Cart. */
|
|
175
|
+
ShopifyCartErrorCode["TooManyDeliveryAddresses"] = "TOO_MANY_DELIVERY_ADDRESSES";
|
|
144
176
|
/** A general error occurred during address validation. */
|
|
145
177
|
ShopifyCartErrorCode["UnspecifiedAddressError"] = "UNSPECIFIED_ADDRESS_ERROR";
|
|
146
178
|
/** Validation failed. */
|
|
@@ -148,102 +180,18 @@ var ShopifyCartErrorCode;
|
|
|
148
180
|
/** The given zip code is unsupported. */
|
|
149
181
|
ShopifyCartErrorCode["ZipCodeNotSupported"] = "ZIP_CODE_NOT_SUPPORTED";
|
|
150
182
|
})(ShopifyCartErrorCode || (ShopifyCartErrorCode = {}));
|
|
151
|
-
/**
|
|
152
|
-
var
|
|
153
|
-
(function (
|
|
154
|
-
/**
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
|
|
158
|
-
/** The
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
ShopifyCheckoutErrorCode["CustomerAlreadyUsedOncePerCustomerDiscountNotice"] = "CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE";
|
|
164
|
-
/** Discount already applied. */
|
|
165
|
-
ShopifyCheckoutErrorCode["DiscountAlreadyApplied"] = "DISCOUNT_ALREADY_APPLIED";
|
|
166
|
-
/** Discount code isn't working right now. Please contact us for help. */
|
|
167
|
-
ShopifyCheckoutErrorCode["DiscountCodeApplicationFailed"] = "DISCOUNT_CODE_APPLICATION_FAILED";
|
|
168
|
-
/** Discount disabled. */
|
|
169
|
-
ShopifyCheckoutErrorCode["DiscountDisabled"] = "DISCOUNT_DISABLED";
|
|
170
|
-
/** Discount expired. */
|
|
171
|
-
ShopifyCheckoutErrorCode["DiscountExpired"] = "DISCOUNT_EXPIRED";
|
|
172
|
-
/** Discount limit reached. */
|
|
173
|
-
ShopifyCheckoutErrorCode["DiscountLimitReached"] = "DISCOUNT_LIMIT_REACHED";
|
|
174
|
-
/** Discount not found. */
|
|
175
|
-
ShopifyCheckoutErrorCode["DiscountNotFound"] = "DISCOUNT_NOT_FOUND";
|
|
176
|
-
/** Checkout is already completed. */
|
|
177
|
-
ShopifyCheckoutErrorCode["Empty"] = "EMPTY";
|
|
178
|
-
/** Queue token has expired. */
|
|
179
|
-
ShopifyCheckoutErrorCode["ExpiredQueueToken"] = "EXPIRED_QUEUE_TOKEN";
|
|
180
|
-
/** Gift card has already been applied. */
|
|
181
|
-
ShopifyCheckoutErrorCode["GiftCardAlreadyApplied"] = "GIFT_CARD_ALREADY_APPLIED";
|
|
182
|
-
/** Gift card code is invalid. */
|
|
183
|
-
ShopifyCheckoutErrorCode["GiftCardCodeInvalid"] = "GIFT_CARD_CODE_INVALID";
|
|
184
|
-
/** Gift card currency does not match checkout currency. */
|
|
185
|
-
ShopifyCheckoutErrorCode["GiftCardCurrencyMismatch"] = "GIFT_CARD_CURRENCY_MISMATCH";
|
|
186
|
-
/** Gift card has no funds left. */
|
|
187
|
-
ShopifyCheckoutErrorCode["GiftCardDepleted"] = "GIFT_CARD_DEPLETED";
|
|
188
|
-
/** Gift card is disabled. */
|
|
189
|
-
ShopifyCheckoutErrorCode["GiftCardDisabled"] = "GIFT_CARD_DISABLED";
|
|
190
|
-
/** Gift card is expired. */
|
|
191
|
-
ShopifyCheckoutErrorCode["GiftCardExpired"] = "GIFT_CARD_EXPIRED";
|
|
192
|
-
/** Gift card was not found. */
|
|
193
|
-
ShopifyCheckoutErrorCode["GiftCardNotFound"] = "GIFT_CARD_NOT_FOUND";
|
|
194
|
-
/** Gift card cannot be applied to a checkout that contains a gift card. */
|
|
195
|
-
ShopifyCheckoutErrorCode["GiftCardUnusable"] = "GIFT_CARD_UNUSABLE";
|
|
196
|
-
/** The input value should be greater than or equal to the minimum value allowed. */
|
|
197
|
-
ShopifyCheckoutErrorCode["GreaterThanOrEqualTo"] = "GREATER_THAN_OR_EQUAL_TO";
|
|
198
|
-
/** Higher value discount applied. */
|
|
199
|
-
ShopifyCheckoutErrorCode["HigherValueDiscountApplied"] = "HIGHER_VALUE_DISCOUNT_APPLIED";
|
|
200
|
-
/** The input value is invalid. */
|
|
201
|
-
ShopifyCheckoutErrorCode["Invalid"] = "INVALID";
|
|
202
|
-
/** Cannot specify country and presentment currency code. */
|
|
203
|
-
ShopifyCheckoutErrorCode["InvalidCountryAndCurrency"] = "INVALID_COUNTRY_AND_CURRENCY";
|
|
204
|
-
/** Input Zip is invalid for country provided. */
|
|
205
|
-
ShopifyCheckoutErrorCode["InvalidForCountry"] = "INVALID_FOR_COUNTRY";
|
|
206
|
-
/** Input Zip is invalid for country and province provided. */
|
|
207
|
-
ShopifyCheckoutErrorCode["InvalidForCountryAndProvince"] = "INVALID_FOR_COUNTRY_AND_PROVINCE";
|
|
208
|
-
/** Invalid province in country. */
|
|
209
|
-
ShopifyCheckoutErrorCode["InvalidProvinceInCountry"] = "INVALID_PROVINCE_IN_COUNTRY";
|
|
210
|
-
/** Queue token is invalid. */
|
|
211
|
-
ShopifyCheckoutErrorCode["InvalidQueueToken"] = "INVALID_QUEUE_TOKEN";
|
|
212
|
-
/** Invalid region in country. */
|
|
213
|
-
ShopifyCheckoutErrorCode["InvalidRegionInCountry"] = "INVALID_REGION_IN_COUNTRY";
|
|
214
|
-
/** Invalid state in country. */
|
|
215
|
-
ShopifyCheckoutErrorCode["InvalidStateInCountry"] = "INVALID_STATE_IN_COUNTRY";
|
|
216
|
-
/** The input value should be less than the maximum value allowed. */
|
|
217
|
-
ShopifyCheckoutErrorCode["LessThan"] = "LESS_THAN";
|
|
218
|
-
/** The input value should be less than or equal to the maximum value allowed. */
|
|
219
|
-
ShopifyCheckoutErrorCode["LessThanOrEqualTo"] = "LESS_THAN_OR_EQUAL_TO";
|
|
220
|
-
/** Line item was not found in checkout. */
|
|
221
|
-
ShopifyCheckoutErrorCode["LineItemNotFound"] = "LINE_ITEM_NOT_FOUND";
|
|
222
|
-
/** Checkout is locked. */
|
|
223
|
-
ShopifyCheckoutErrorCode["Locked"] = "LOCKED";
|
|
224
|
-
/** Maximum number of discount codes limit reached. */
|
|
225
|
-
ShopifyCheckoutErrorCode["MaximumDiscountCodeLimitReached"] = "MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED";
|
|
226
|
-
/** Missing payment input. */
|
|
227
|
-
ShopifyCheckoutErrorCode["MissingPaymentInput"] = "MISSING_PAYMENT_INPUT";
|
|
228
|
-
/** Not enough in stock. */
|
|
229
|
-
ShopifyCheckoutErrorCode["NotEnoughInStock"] = "NOT_ENOUGH_IN_STOCK";
|
|
230
|
-
/** Input value is not supported. */
|
|
231
|
-
ShopifyCheckoutErrorCode["NotSupported"] = "NOT_SUPPORTED";
|
|
232
|
-
/** The input value needs to be blank. */
|
|
233
|
-
ShopifyCheckoutErrorCode["Present"] = "PRESENT";
|
|
234
|
-
/** Product is not published for this customer. */
|
|
235
|
-
ShopifyCheckoutErrorCode["ProductNotAvailable"] = "PRODUCT_NOT_AVAILABLE";
|
|
236
|
-
/** Shipping rate expired. */
|
|
237
|
-
ShopifyCheckoutErrorCode["ShippingRateExpired"] = "SHIPPING_RATE_EXPIRED";
|
|
238
|
-
/** Throttled during checkout. */
|
|
239
|
-
ShopifyCheckoutErrorCode["ThrottledDuringCheckout"] = "THROTTLED_DURING_CHECKOUT";
|
|
240
|
-
/** The input value is too long. */
|
|
241
|
-
ShopifyCheckoutErrorCode["TooLong"] = "TOO_LONG";
|
|
242
|
-
/** The amount of the payment does not match the value to be paid. */
|
|
243
|
-
ShopifyCheckoutErrorCode["TotalPriceMismatch"] = "TOTAL_PRICE_MISMATCH";
|
|
244
|
-
/** Unable to apply discount. */
|
|
245
|
-
ShopifyCheckoutErrorCode["UnableToApply"] = "UNABLE_TO_APPLY";
|
|
246
|
-
})(ShopifyCheckoutErrorCode || (ShopifyCheckoutErrorCode = {}));
|
|
183
|
+
/** The code for the cart warning. */
|
|
184
|
+
var ShopifyCartWarningCode;
|
|
185
|
+
(function (ShopifyCartWarningCode) {
|
|
186
|
+
/** A delivery address with the same details already exists on this cart. */
|
|
187
|
+
ShopifyCartWarningCode["DuplicateDeliveryAddress"] = "DUPLICATE_DELIVERY_ADDRESS";
|
|
188
|
+
/** The merchandise does not have enough stock. */
|
|
189
|
+
ShopifyCartWarningCode["MerchandiseNotEnoughStock"] = "MERCHANDISE_NOT_ENOUGH_STOCK";
|
|
190
|
+
/** The merchandise is out of stock. */
|
|
191
|
+
ShopifyCartWarningCode["MerchandiseOutOfStock"] = "MERCHANDISE_OUT_OF_STOCK";
|
|
192
|
+
/** Gift cards are not available as a payment method. */
|
|
193
|
+
ShopifyCartWarningCode["PaymentsGiftCardsUnavailable"] = "PAYMENTS_GIFT_CARDS_UNAVAILABLE";
|
|
194
|
+
})(ShopifyCartWarningCode || (ShopifyCartWarningCode = {}));
|
|
247
195
|
/** The set of valid sort keys for the Collection query. */
|
|
248
196
|
var ShopifyCollectionSortKeys;
|
|
249
197
|
(function (ShopifyCollectionSortKeys) {
|
|
@@ -277,6 +225,14 @@ var ShopifyCompletionErrorCode;
|
|
|
277
225
|
ShopifyCompletionErrorCode["PaymentInvalidPaymentMethod"] = "PAYMENT_INVALID_PAYMENT_METHOD";
|
|
278
226
|
ShopifyCompletionErrorCode["PaymentTransientError"] = "PAYMENT_TRANSIENT_ERROR";
|
|
279
227
|
})(ShopifyCompletionErrorCode || (ShopifyCompletionErrorCode = {}));
|
|
228
|
+
/** The precision of the value returned by a count field. */
|
|
229
|
+
var ShopifyCountPrecision;
|
|
230
|
+
(function (ShopifyCountPrecision) {
|
|
231
|
+
/** The count is at least the value. A limit was reached. */
|
|
232
|
+
ShopifyCountPrecision["AtLeast"] = "AT_LEAST";
|
|
233
|
+
/** The count is exactly the value. */
|
|
234
|
+
ShopifyCountPrecision["Exact"] = "EXACT";
|
|
235
|
+
})(ShopifyCountPrecision || (ShopifyCountPrecision = {}));
|
|
280
236
|
/**
|
|
281
237
|
* The code designating a country/region, which generally follows ISO 3166-1 alpha-2 guidelines.
|
|
282
238
|
* If a territory doesn't have a country code value in the `CountryCode` enum, then it might be considered a subdivision
|
|
@@ -849,7 +805,7 @@ var ShopifyCurrencyCode;
|
|
|
849
805
|
ShopifyCurrencyCode["Byn"] = "BYN";
|
|
850
806
|
/**
|
|
851
807
|
* Belarusian Ruble (BYR).
|
|
852
|
-
* @deprecated `BYR` is deprecated. Use `BYN` available from version `2021-01` onwards instead. Deprecated in version 0.
|
|
808
|
+
* @deprecated `BYR` is deprecated. Use `BYN` available from version `2021-01` onwards instead. Deprecated in version 0.92.0. Will be removed in version 0.95.0.
|
|
853
809
|
*/
|
|
854
810
|
ShopifyCurrencyCode["Byr"] = "BYR";
|
|
855
811
|
/** Belize Dollar (BZD). */
|
|
@@ -1062,7 +1018,7 @@ var ShopifyCurrencyCode;
|
|
|
1062
1018
|
ShopifyCurrencyCode["Ssp"] = "SSP";
|
|
1063
1019
|
/**
|
|
1064
1020
|
* Sao Tome And Principe Dobra (STD).
|
|
1065
|
-
* @deprecated `STD` is deprecated. Use `STN` available from version `2022-07` onwards instead. Deprecated in version 0.
|
|
1021
|
+
* @deprecated `STD` is deprecated. Use `STN` available from version `2022-07` onwards instead. Deprecated in version 0.92.0. Will be removed in version 0.95.0.
|
|
1066
1022
|
*/
|
|
1067
1023
|
ShopifyCurrencyCode["Std"] = "STD";
|
|
1068
1024
|
/** Sao Tome And Principe Dobra (STN). */
|
|
@@ -1103,7 +1059,7 @@ var ShopifyCurrencyCode;
|
|
|
1103
1059
|
ShopifyCurrencyCode["Ved"] = "VED";
|
|
1104
1060
|
/**
|
|
1105
1061
|
* Venezuelan Bolivares (VEF).
|
|
1106
|
-
* @deprecated `VEF` is deprecated. Use `VES` available from version `2020-10` onwards instead. Deprecated in version 0.
|
|
1062
|
+
* @deprecated `VEF` is deprecated. Use `VES` available from version `2020-10` onwards instead. Deprecated in version 0.92.0. Will be removed in version 0.95.0.
|
|
1107
1063
|
*/
|
|
1108
1064
|
ShopifyCurrencyCode["Vef"] = "VEF";
|
|
1109
1065
|
/** Venezuelan Bolivares Soberanos (VES). */
|
|
@@ -1131,7 +1087,10 @@ var ShopifyCurrencyCode;
|
|
|
1131
1087
|
/** Zambian Kwacha (ZMW). */
|
|
1132
1088
|
ShopifyCurrencyCode["Zmw"] = "ZMW";
|
|
1133
1089
|
})(ShopifyCurrencyCode || (ShopifyCurrencyCode = {}));
|
|
1134
|
-
/**
|
|
1090
|
+
/**
|
|
1091
|
+
* Error codes returned by the [`CustomerUserError`](https://shopify.dev/docs/api/storefront/current/objects/CustomerUserError) object. These codes identify specific validation and processing failures for customer-related mutations, including account creation, updates, password resets, and address management.
|
|
1092
|
+
*
|
|
1093
|
+
*/
|
|
1135
1094
|
var ShopifyCustomerErrorCode;
|
|
1136
1095
|
(function (ShopifyCustomerErrorCode) {
|
|
1137
1096
|
/** Customer already enabled. */
|
|
@@ -1166,7 +1125,9 @@ var ShopifyCustomerErrorCode;
|
|
|
1166
1125
|
ShopifyCustomerErrorCode["UnidentifiedCustomer"] = "UNIDENTIFIED_CUSTOMER";
|
|
1167
1126
|
})(ShopifyCustomerErrorCode || (ShopifyCustomerErrorCode = {}));
|
|
1168
1127
|
/**
|
|
1169
|
-
*
|
|
1128
|
+
* Controls how delivery addresses are validated during cart operations. The default validation checks only the country code, while strict validation verifies all address fields against Shopify's checkout rules and rejects invalid addresses.
|
|
1129
|
+
*
|
|
1130
|
+
* Used by [`DeliveryAddressInput`](https://shopify.dev/docs/api/storefront/current/input-objects/DeliveryAddressInput) when setting buyer identity preferences, and by [`CartSelectableAddressInput`](https://shopify.dev/docs/api/storefront/current/input-objects/CartSelectableAddressInput) and [`CartSelectableAddressUpdateInput`](https://shopify.dev/docs/api/storefront/current/input-objects/CartSelectableAddressUpdateInput) when managing cart delivery addresses.
|
|
1170
1131
|
*
|
|
1171
1132
|
*/
|
|
1172
1133
|
var ShopifyDeliveryAddressValidationStrategy;
|
|
@@ -1208,7 +1169,12 @@ var ShopifyDigitalWallet;
|
|
|
1208
1169
|
/** Shopify Pay. */
|
|
1209
1170
|
ShopifyDigitalWallet["ShopifyPay"] = "SHOPIFY_PAY";
|
|
1210
1171
|
})(ShopifyDigitalWallet || (ShopifyDigitalWallet = {}));
|
|
1211
|
-
/**
|
|
1172
|
+
/**
|
|
1173
|
+
* Controls how a discount's value is distributed across entitled lines. A discount can either spread its value across all entitled lines or apply the full value to each line individually.
|
|
1174
|
+
*
|
|
1175
|
+
* Used by the [`DiscountApplication`](https://shopify.dev/docs/api/storefront/current/interfaces/DiscountApplication) interface and its implementations to capture the intentions of a discount source at the time of application.
|
|
1176
|
+
*
|
|
1177
|
+
*/
|
|
1212
1178
|
var ShopifyDiscountApplicationAllocationMethod;
|
|
1213
1179
|
(function (ShopifyDiscountApplicationAllocationMethod) {
|
|
1214
1180
|
/** The value is spread across all entitled lines. */
|
|
@@ -1217,7 +1183,7 @@ var ShopifyDiscountApplicationAllocationMethod;
|
|
|
1217
1183
|
ShopifyDiscountApplicationAllocationMethod["Each"] = "EACH";
|
|
1218
1184
|
/**
|
|
1219
1185
|
* The value is specifically applied onto a particular line.
|
|
1220
|
-
* @deprecated Use ACROSS instead. Deprecated in version 0.
|
|
1186
|
+
* @deprecated Use ACROSS instead. Deprecated in version 0.92.0. Will be removed in version 0.95.0.
|
|
1221
1187
|
*/
|
|
1222
1188
|
ShopifyDiscountApplicationAllocationMethod["One"] = "ONE";
|
|
1223
1189
|
})(ShopifyDiscountApplicationAllocationMethod || (ShopifyDiscountApplicationAllocationMethod = {}));
|
|
@@ -1287,7 +1253,12 @@ var ShopifyImageContentType;
|
|
|
1287
1253
|
/** A WEBP image. */
|
|
1288
1254
|
ShopifyImageContentType["Webp"] = "WEBP";
|
|
1289
1255
|
})(ShopifyImageContentType || (ShopifyImageContentType = {}));
|
|
1290
|
-
/**
|
|
1256
|
+
/**
|
|
1257
|
+
* Supported languages for retrieving translated storefront content. Pass a language code to the [`@inContext`](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/in-context) directive to return product titles, descriptions, and other translatable fields in that language.
|
|
1258
|
+
*
|
|
1259
|
+
* The [`Localization`](https://shopify.dev/docs/api/storefront/current/objects/Localization) object provides the list of available languages for the active country, and each [`Country`](https://shopify.dev/docs/api/storefront/current/objects/Country) in [`availableCountries`](https://shopify.dev/docs/api/storefront/current/objects/Localization#field-Localization.fields.availableCountries) includes its own available languages.
|
|
1260
|
+
*
|
|
1261
|
+
*/
|
|
1291
1262
|
var ShopifyLanguageCode;
|
|
1292
1263
|
(function (ShopifyLanguageCode) {
|
|
1293
1264
|
/** Afrikaans. */
|
|
@@ -1632,6 +1603,8 @@ var ShopifyMenuItemType;
|
|
|
1632
1603
|
ShopifyMenuItemType["Collection"] = "COLLECTION";
|
|
1633
1604
|
/** A collection link. */
|
|
1634
1605
|
ShopifyMenuItemType["Collections"] = "COLLECTIONS";
|
|
1606
|
+
/** A customer account page link. */
|
|
1607
|
+
ShopifyMenuItemType["CustomerAccountPage"] = "CUSTOMER_ACCOUNT_PAGE";
|
|
1635
1608
|
/** A frontpage link. */
|
|
1636
1609
|
ShopifyMenuItemType["Frontpage"] = "FRONTPAGE";
|
|
1637
1610
|
/** An http link. */
|
|
@@ -1650,6 +1623,8 @@ var ShopifyMenuItemType;
|
|
|
1650
1623
|
/** Possible error codes that can be returned by `MetafieldDeleteUserError`. */
|
|
1651
1624
|
var ShopifyMetafieldDeleteErrorCode;
|
|
1652
1625
|
(function (ShopifyMetafieldDeleteErrorCode) {
|
|
1626
|
+
/** The current app is not authorized to perform this action. */
|
|
1627
|
+
ShopifyMetafieldDeleteErrorCode["AppNotAuthorized"] = "APP_NOT_AUTHORIZED";
|
|
1653
1628
|
/** The owner ID is invalid. */
|
|
1654
1629
|
ShopifyMetafieldDeleteErrorCode["InvalidOwner"] = "INVALID_OWNER";
|
|
1655
1630
|
/** Metafield not found. */
|
|
@@ -1658,6 +1633,8 @@ var ShopifyMetafieldDeleteErrorCode;
|
|
|
1658
1633
|
/** Possible error codes that can be returned by `MetafieldsSetUserError`. */
|
|
1659
1634
|
var ShopifyMetafieldsSetUserErrorCode;
|
|
1660
1635
|
(function (ShopifyMetafieldsSetUserErrorCode) {
|
|
1636
|
+
/** The current app is not authorized to perform this action. */
|
|
1637
|
+
ShopifyMetafieldsSetUserErrorCode["AppNotAuthorized"] = "APP_NOT_AUTHORIZED";
|
|
1661
1638
|
/** The input value is blank. */
|
|
1662
1639
|
ShopifyMetafieldsSetUserErrorCode["Blank"] = "BLANK";
|
|
1663
1640
|
/** The input value isn't included in the list. */
|
|
@@ -1711,7 +1688,14 @@ var ShopifyOrderFinancialStatus;
|
|
|
1711
1688
|
/** Displayed as **Voided**. */
|
|
1712
1689
|
ShopifyOrderFinancialStatus["Voided"] = "VOIDED";
|
|
1713
1690
|
})(ShopifyOrderFinancialStatus || (ShopifyOrderFinancialStatus = {}));
|
|
1714
|
-
/**
|
|
1691
|
+
/**
|
|
1692
|
+
* The aggregated fulfillment status of an [`Order`](https://shopify.dev/docs/api/storefront/current/objects/Order), summarizing the state of all line items. Used for display purposes.
|
|
1693
|
+
*
|
|
1694
|
+
* Statuses range from unfulfilled to fully fulfilled, with intermediate states such as in progress and on hold.
|
|
1695
|
+
*
|
|
1696
|
+
* Learn more about [order statuses](https://help.shopify.com/manual/fulfillment/managing-orders/order-status).
|
|
1697
|
+
*
|
|
1698
|
+
*/
|
|
1715
1699
|
var ShopifyOrderFulfillmentStatus;
|
|
1716
1700
|
(function (ShopifyOrderFulfillmentStatus) {
|
|
1717
1701
|
/** Displayed as **Fulfilled**. All of the items in the order have been fulfilled. */
|
|
@@ -1765,20 +1749,6 @@ var ShopifyPageSortKeys;
|
|
|
1765
1749
|
/** Sort by the `updated_at` value. */
|
|
1766
1750
|
ShopifyPageSortKeys["UpdatedAt"] = "UPDATED_AT";
|
|
1767
1751
|
})(ShopifyPageSortKeys || (ShopifyPageSortKeys = {}));
|
|
1768
|
-
/** The valid values for the types of payment token. */
|
|
1769
|
-
var ShopifyPaymentTokenType;
|
|
1770
|
-
(function (ShopifyPaymentTokenType) {
|
|
1771
|
-
/** Apple Pay token type. */
|
|
1772
|
-
ShopifyPaymentTokenType["ApplePay"] = "APPLE_PAY";
|
|
1773
|
-
/** Google Pay token type. */
|
|
1774
|
-
ShopifyPaymentTokenType["GooglePay"] = "GOOGLE_PAY";
|
|
1775
|
-
/** Shopify Pay token type. */
|
|
1776
|
-
ShopifyPaymentTokenType["ShopifyPay"] = "SHOPIFY_PAY";
|
|
1777
|
-
/** Stripe token type. */
|
|
1778
|
-
ShopifyPaymentTokenType["StripeVaultToken"] = "STRIPE_VAULT_TOKEN";
|
|
1779
|
-
/** Vault payment token type. */
|
|
1780
|
-
ShopifyPaymentTokenType["Vault"] = "VAULT";
|
|
1781
|
-
})(ShopifyPaymentTokenType || (ShopifyPaymentTokenType = {}));
|
|
1782
1752
|
/** Decides the distribution of results. */
|
|
1783
1753
|
var ShopifyPredictiveSearchLimitScope;
|
|
1784
1754
|
(function (ShopifyPredictiveSearchLimitScope) {
|
|
@@ -1811,7 +1781,12 @@ var ShopifyPreferenceDeliveryMethodType;
|
|
|
1811
1781
|
/** A delivery method used to send items directly to a buyer’s specified address. */
|
|
1812
1782
|
ShopifyPreferenceDeliveryMethodType["Shipping"] = "SHIPPING";
|
|
1813
1783
|
})(ShopifyPreferenceDeliveryMethodType || (ShopifyPreferenceDeliveryMethodType = {}));
|
|
1814
|
-
/**
|
|
1784
|
+
/**
|
|
1785
|
+
* Sort options for products within a [`Collection`](https://shopify.dev/docs/api/storefront/current/objects/Collection). Used by the [`products`](https://shopify.dev/docs/api/storefront/current/objects/Collection#field-Collection.fields.products) connection to order results by best-selling, price, title, creation date, or the collection's default and manual ordering.
|
|
1786
|
+
*
|
|
1787
|
+
* > Note: The [`RELEVANCE`](https://shopify.dev/docs/api/storefront/current/enums/ProductCollectionSortKeys#enums-RELEVANCE) key applies only when you specify a search query.
|
|
1788
|
+
*
|
|
1789
|
+
*/
|
|
1815
1790
|
var ShopifyProductCollectionSortKeys;
|
|
1816
1791
|
(function (ShopifyProductCollectionSortKeys) {
|
|
1817
1792
|
/** Sort by the `best-selling` value. */
|
|
@@ -1877,7 +1852,12 @@ var ShopifyProductRecommendationIntent;
|
|
|
1877
1852
|
/** Offer customers a mix of products that are similar or complementary to a product for which recommendations are to be fetched. An example is substitutable products that display in a You may also like section. */
|
|
1878
1853
|
ShopifyProductRecommendationIntent["Related"] = "RELATED";
|
|
1879
1854
|
})(ShopifyProductRecommendationIntent || (ShopifyProductRecommendationIntent = {}));
|
|
1880
|
-
/**
|
|
1855
|
+
/**
|
|
1856
|
+
* Sorting options for the [`products`](https://shopify.dev/docs/api/storefront/current/queries/products) query. Supports sorting products by criteria such as best-selling and price, and by product attributes such as type, and vendor.
|
|
1857
|
+
*
|
|
1858
|
+
* > Note: Use the [`RELEVANCE`](https://shopify.dev/docs/api/storefront/current/enums/ProductSortKeys#enums-RELEVANCE) key only when a search query is specified.
|
|
1859
|
+
*
|
|
1860
|
+
*/
|
|
1881
1861
|
var ShopifyProductSortKeys;
|
|
1882
1862
|
(function (ShopifyProductSortKeys) {
|
|
1883
1863
|
/** Sort by the `best_selling` value. */
|
|
@@ -1987,6 +1967,65 @@ var ShopifySellingPlanCheckoutChargeType;
|
|
|
1987
1967
|
/** The checkout charge is a fixed price amount. */
|
|
1988
1968
|
ShopifySellingPlanCheckoutChargeType["Price"] = "PRICE";
|
|
1989
1969
|
})(ShopifySellingPlanCheckoutChargeType || (ShopifySellingPlanCheckoutChargeType = {}));
|
|
1970
|
+
/** Represents a valid selling plan interval. */
|
|
1971
|
+
var ShopifySellingPlanInterval;
|
|
1972
|
+
(function (ShopifySellingPlanInterval) {
|
|
1973
|
+
/** Day interval. */
|
|
1974
|
+
ShopifySellingPlanInterval["Day"] = "DAY";
|
|
1975
|
+
/** Month interval. */
|
|
1976
|
+
ShopifySellingPlanInterval["Month"] = "MONTH";
|
|
1977
|
+
/** Week interval. */
|
|
1978
|
+
ShopifySellingPlanInterval["Week"] = "WEEK";
|
|
1979
|
+
/** Year interval. */
|
|
1980
|
+
ShopifySellingPlanInterval["Year"] = "YEAR";
|
|
1981
|
+
})(ShopifySellingPlanInterval || (ShopifySellingPlanInterval = {}));
|
|
1982
|
+
/** The payment frequency for a Shop Pay Installments Financing Plan. */
|
|
1983
|
+
var ShopifyShopPayInstallmentsFinancingPlanFrequency;
|
|
1984
|
+
(function (ShopifyShopPayInstallmentsFinancingPlanFrequency) {
|
|
1985
|
+
/** Monthly payment frequency. */
|
|
1986
|
+
ShopifyShopPayInstallmentsFinancingPlanFrequency["Monthly"] = "MONTHLY";
|
|
1987
|
+
/** Weekly payment frequency. */
|
|
1988
|
+
ShopifyShopPayInstallmentsFinancingPlanFrequency["Weekly"] = "WEEKLY";
|
|
1989
|
+
})(ShopifyShopPayInstallmentsFinancingPlanFrequency || (ShopifyShopPayInstallmentsFinancingPlanFrequency = {}));
|
|
1990
|
+
/** The loan type for a Shop Pay Installments Financing Plan Term. */
|
|
1991
|
+
var ShopifyShopPayInstallmentsLoan;
|
|
1992
|
+
(function (ShopifyShopPayInstallmentsLoan) {
|
|
1993
|
+
/** An interest-bearing loan type. */
|
|
1994
|
+
ShopifyShopPayInstallmentsLoan["Interest"] = "INTEREST";
|
|
1995
|
+
/** A split-pay loan type. */
|
|
1996
|
+
ShopifyShopPayInstallmentsLoan["SplitPay"] = "SPLIT_PAY";
|
|
1997
|
+
/** A zero-percent loan type. */
|
|
1998
|
+
ShopifyShopPayInstallmentsLoan["ZeroPercent"] = "ZERO_PERCENT";
|
|
1999
|
+
})(ShopifyShopPayInstallmentsLoan || (ShopifyShopPayInstallmentsLoan = {}));
|
|
2000
|
+
/** Represents the delivery method type for a Shop Pay payment request. */
|
|
2001
|
+
var ShopifyShopPayPaymentRequestDeliveryMethodType;
|
|
2002
|
+
(function (ShopifyShopPayPaymentRequestDeliveryMethodType) {
|
|
2003
|
+
/** The delivery method type is pickup. */
|
|
2004
|
+
ShopifyShopPayPaymentRequestDeliveryMethodType["Pickup"] = "PICKUP";
|
|
2005
|
+
/** The delivery method type is shipping. */
|
|
2006
|
+
ShopifyShopPayPaymentRequestDeliveryMethodType["Shipping"] = "SHIPPING";
|
|
2007
|
+
})(ShopifyShopPayPaymentRequestDeliveryMethodType || (ShopifyShopPayPaymentRequestDeliveryMethodType = {}));
|
|
2008
|
+
/** The types of resources potentially present in a sitemap. */
|
|
2009
|
+
var ShopifySitemapType;
|
|
2010
|
+
(function (ShopifySitemapType) {
|
|
2011
|
+
/** Articles present in the sitemap. */
|
|
2012
|
+
ShopifySitemapType["Article"] = "ARTICLE";
|
|
2013
|
+
/** Blogs present in the sitemap. */
|
|
2014
|
+
ShopifySitemapType["Blog"] = "BLOG";
|
|
2015
|
+
/** Collections present in the sitemap. */
|
|
2016
|
+
ShopifySitemapType["Collection"] = "COLLECTION";
|
|
2017
|
+
/**
|
|
2018
|
+
* Metaobjects present in the sitemap. Only metaobject types with the
|
|
2019
|
+
* [`renderable` capability](https://shopify.dev/docs/apps/build/custom-data/metaobjects/use-metaobject-capabilities#render-metaobjects-as-web-pages)
|
|
2020
|
+
* are included in sitemap.
|
|
2021
|
+
*
|
|
2022
|
+
*/
|
|
2023
|
+
ShopifySitemapType["Metaobject"] = "METAOBJECT";
|
|
2024
|
+
/** Pages present in the sitemap. */
|
|
2025
|
+
ShopifySitemapType["Page"] = "PAGE";
|
|
2026
|
+
/** Products present in the sitemap. */
|
|
2027
|
+
ShopifySitemapType["Product"] = "PRODUCT";
|
|
2028
|
+
})(ShopifySitemapType || (ShopifySitemapType = {}));
|
|
1990
2029
|
/** The code of the error that occurred during cart submit for completion. */
|
|
1991
2030
|
var ShopifySubmissionErrorCode;
|
|
1992
2031
|
(function (ShopifySubmissionErrorCode) {
|
|
@@ -2080,40 +2119,14 @@ var ShopifySubmissionErrorCode;
|
|
|
2080
2119
|
ShopifySubmissionErrorCode["PaymentsShopifyPaymentsRequired"] = "PAYMENTS_SHOPIFY_PAYMENTS_REQUIRED";
|
|
2081
2120
|
ShopifySubmissionErrorCode["PaymentsUnacceptablePaymentAmount"] = "PAYMENTS_UNACCEPTABLE_PAYMENT_AMOUNT";
|
|
2082
2121
|
ShopifySubmissionErrorCode["PaymentsWalletContentMissing"] = "PAYMENTS_WALLET_CONTENT_MISSING";
|
|
2122
|
+
/** Redirect to checkout required to complete this action. */
|
|
2123
|
+
ShopifySubmissionErrorCode["RedirectToCheckoutRequired"] = "REDIRECT_TO_CHECKOUT_REQUIRED";
|
|
2083
2124
|
ShopifySubmissionErrorCode["TaxesDeliveryGroupIdNotFound"] = "TAXES_DELIVERY_GROUP_ID_NOT_FOUND";
|
|
2084
2125
|
ShopifySubmissionErrorCode["TaxesLineIdNotFound"] = "TAXES_LINE_ID_NOT_FOUND";
|
|
2085
2126
|
ShopifySubmissionErrorCode["TaxesMustBeDefined"] = "TAXES_MUST_BE_DEFINED";
|
|
2127
|
+
/** Validation failed. */
|
|
2128
|
+
ShopifySubmissionErrorCode["ValidationCustom"] = "VALIDATION_CUSTOM";
|
|
2086
2129
|
})(ShopifySubmissionErrorCode || (ShopifySubmissionErrorCode = {}));
|
|
2087
|
-
/** The different kinds of order transactions. */
|
|
2088
|
-
var ShopifyTransactionKind;
|
|
2089
|
-
(function (ShopifyTransactionKind) {
|
|
2090
|
-
/**
|
|
2091
|
-
* An amount reserved against the cardholder's funding source.
|
|
2092
|
-
* Money does not change hands until the authorization is captured.
|
|
2093
|
-
*
|
|
2094
|
-
*/
|
|
2095
|
-
ShopifyTransactionKind["Authorization"] = "AUTHORIZATION";
|
|
2096
|
-
/** A transfer of the money that was reserved during the authorization stage. */
|
|
2097
|
-
ShopifyTransactionKind["Capture"] = "CAPTURE";
|
|
2098
|
-
/** Money returned to the customer when they have paid too much. */
|
|
2099
|
-
ShopifyTransactionKind["Change"] = "CHANGE";
|
|
2100
|
-
/** An authorization for a payment taken with an EMV credit card reader. */
|
|
2101
|
-
ShopifyTransactionKind["EmvAuthorization"] = "EMV_AUTHORIZATION";
|
|
2102
|
-
/** An authorization and capture performed together in a single step. */
|
|
2103
|
-
ShopifyTransactionKind["Sale"] = "SALE";
|
|
2104
|
-
})(ShopifyTransactionKind || (ShopifyTransactionKind = {}));
|
|
2105
|
-
/** Transaction statuses describe the status of a transaction. */
|
|
2106
|
-
var ShopifyTransactionStatus;
|
|
2107
|
-
(function (ShopifyTransactionStatus) {
|
|
2108
|
-
/** There was an error while processing the transaction. */
|
|
2109
|
-
ShopifyTransactionStatus["Error"] = "ERROR";
|
|
2110
|
-
/** The transaction failed. */
|
|
2111
|
-
ShopifyTransactionStatus["Failure"] = "FAILURE";
|
|
2112
|
-
/** The transaction is pending. */
|
|
2113
|
-
ShopifyTransactionStatus["Pending"] = "PENDING";
|
|
2114
|
-
/** The transaction succeeded. */
|
|
2115
|
-
ShopifyTransactionStatus["Success"] = "SUCCESS";
|
|
2116
|
-
})(ShopifyTransactionStatus || (ShopifyTransactionStatus = {}));
|
|
2117
2130
|
/** The accepted types of unit of measurement. */
|
|
2118
2131
|
var ShopifyUnitPriceMeasurementMeasuredType;
|
|
2119
2132
|
(function (ShopifyUnitPriceMeasurementMeasuredType) {
|
|
@@ -2160,7 +2173,20 @@ var ShopifyUnitSystem;
|
|
|
2160
2173
|
/** Metric system of weights and measures. */
|
|
2161
2174
|
ShopifyUnitSystem["MetricSystem"] = "METRIC_SYSTEM";
|
|
2162
2175
|
})(ShopifyUnitSystem || (ShopifyUnitSystem = {}));
|
|
2163
|
-
/**
|
|
2176
|
+
/** Possible error codes that can be returned by `ShopPayPaymentRequestSessionUserErrors`. */
|
|
2177
|
+
var ShopifyUserErrorsShopPayPaymentRequestSessionUserErrorsCode;
|
|
2178
|
+
(function (ShopifyUserErrorsShopPayPaymentRequestSessionUserErrorsCode) {
|
|
2179
|
+
/** Idempotency key has already been used. */
|
|
2180
|
+
ShopifyUserErrorsShopPayPaymentRequestSessionUserErrorsCode["IdempotencyKeyAlreadyUsed"] = "IDEMPOTENCY_KEY_ALREADY_USED";
|
|
2181
|
+
/** Payment request input is invalid. */
|
|
2182
|
+
ShopifyUserErrorsShopPayPaymentRequestSessionUserErrorsCode["PaymentRequestInvalidInput"] = "PAYMENT_REQUEST_INVALID_INPUT";
|
|
2183
|
+
/** Payment request not found. */
|
|
2184
|
+
ShopifyUserErrorsShopPayPaymentRequestSessionUserErrorsCode["PaymentRequestNotFound"] = "PAYMENT_REQUEST_NOT_FOUND";
|
|
2185
|
+
})(ShopifyUserErrorsShopPayPaymentRequestSessionUserErrorsCode || (ShopifyUserErrorsShopPayPaymentRequestSessionUserErrorsCode = {}));
|
|
2186
|
+
/**
|
|
2187
|
+
* Units of measurement for weight, supporting both metric and imperial systems. Used by [`ProductVariant`](https://shopify.dev/docs/api/storefront/current/objects/ProductVariant) to specify the unit for the variant's weight value.
|
|
2188
|
+
*
|
|
2189
|
+
*/
|
|
2164
2190
|
var ShopifyWeightUnit;
|
|
2165
2191
|
(function (ShopifyWeightUnit) {
|
|
2166
2192
|
/** Metric system unit of mass. */
|
|
@@ -2173,6 +2199,208 @@ var ShopifyWeightUnit;
|
|
|
2173
2199
|
ShopifyWeightUnit["Pounds"] = "POUNDS";
|
|
2174
2200
|
})(ShopifyWeightUnit || (ShopifyWeightUnit = {}));
|
|
2175
2201
|
|
|
2202
|
+
/**
|
|
2203
|
+
* Apollo GraphQL client name identifier for the Shopify driver.
|
|
2204
|
+
* Used to distinguish this client instance from other Apollo clients in the application.
|
|
2205
|
+
*/
|
|
2206
|
+
const APOLLO_CLIENT_NAME = 'shopify';
|
|
2207
|
+
|
|
2208
|
+
/**
|
|
2209
|
+
* Transforms a DaffIdentifiable id and object type into a Shopify object id
|
|
2210
|
+
*
|
|
2211
|
+
* @param id - numerical code that represents a shopify object id
|
|
2212
|
+
* @param type - Shopify type (e.g. Product, Collection, CollectionImage, etc.)
|
|
2213
|
+
* @returns Shopify-readable url (e.g. gid://shopify/Product/777172771721)
|
|
2214
|
+
*/
|
|
2215
|
+
const shopifyIdTransformer = (id, type) => {
|
|
2216
|
+
const shopifyProductId = `gid://shopify/${type}/${id}`;
|
|
2217
|
+
return shopifyProductId;
|
|
2218
|
+
};
|
|
2219
|
+
|
|
2220
|
+
/**
|
|
2221
|
+
* Transforms a faker-js generated object name to a valid shopify handle (lowercase chars with hyphens instead of spaces)
|
|
2222
|
+
*
|
|
2223
|
+
* @param title - name of a product
|
|
2224
|
+
* @returns shopify-readable handle
|
|
2225
|
+
*/
|
|
2226
|
+
const shopifyHandleTransformer = (title) => {
|
|
2227
|
+
const noSpaces = title.replace(/ /g, '-');
|
|
2228
|
+
const handle = noSpaces.toLowerCase();
|
|
2229
|
+
return handle;
|
|
2230
|
+
};
|
|
2231
|
+
|
|
2232
|
+
/**
|
|
2233
|
+
* Transforms a DaffLocatable url into a Shopify handle string
|
|
2234
|
+
*
|
|
2235
|
+
* See {@link DaffLocatable} for more information on the requirements for the url argument.
|
|
2236
|
+
*
|
|
2237
|
+
* @param url - DaffLocatable url (e.g. /coffee-pot.html)
|
|
2238
|
+
* @returns shopify-readable handle
|
|
2239
|
+
*/
|
|
2240
|
+
const shopifyUrlTransformer = (url) => {
|
|
2241
|
+
const noLeadingSlashes = url.split('/').pop() || '';
|
|
2242
|
+
const noTrailingExtension = noLeadingSlashes.split('.')[0];
|
|
2243
|
+
const handle = noTrailingExtension;
|
|
2244
|
+
return handle;
|
|
2245
|
+
};
|
|
2246
|
+
|
|
2247
|
+
/**
|
|
2248
|
+
* Transforms an abstract {@link ShopifyImageNode} into a concrete type (e.g. ShopifyProductImageNode) by modifying the Shopify id
|
|
2249
|
+
*
|
|
2250
|
+
* See {@link ShopifyObjectTypes} for more information on the requirements for the type argument.
|
|
2251
|
+
*
|
|
2252
|
+
* @param node - default ShopifyImageNode created by factory (id initially left empty)
|
|
2253
|
+
* @param type - name of Shopify image object (e.g. CollectionImage, ProductImage)
|
|
2254
|
+
*/
|
|
2255
|
+
const shopifyImageTransformer = (node, type) => ({
|
|
2256
|
+
id: shopifyIdTransformer(`${faker.number.int({ min: 10000000000 })}`, type),
|
|
2257
|
+
altText: node.altText,
|
|
2258
|
+
url: node.url,
|
|
2259
|
+
});
|
|
2260
|
+
|
|
2261
|
+
/**
|
|
2262
|
+
* Generates a route path based on the Shopify resource type and handle.
|
|
2263
|
+
*
|
|
2264
|
+
* @param type The Shopify resource type (COLLECTION, PRODUCT, PAGE, etc.)
|
|
2265
|
+
* @param handle The resource handle/slug
|
|
2266
|
+
* @returns The formatted route path
|
|
2267
|
+
* @throws Error if type is empty
|
|
2268
|
+
*/
|
|
2269
|
+
const getShopifyRoutePath = (type, handle) => {
|
|
2270
|
+
if (!type) {
|
|
2271
|
+
throw new Error('Type cannot be empty');
|
|
2272
|
+
}
|
|
2273
|
+
switch (type) {
|
|
2274
|
+
case ShopifyMenuItemType.Collection:
|
|
2275
|
+
return `/collections/${handle}`;
|
|
2276
|
+
case ShopifyMenuItemType.Product:
|
|
2277
|
+
return `/products/${handle}`;
|
|
2278
|
+
case ShopifyMenuItemType.Page:
|
|
2279
|
+
return `/pages/${handle}`;
|
|
2280
|
+
default:
|
|
2281
|
+
return `/${type.toLowerCase()}s/${handle}`;
|
|
2282
|
+
}
|
|
2283
|
+
};
|
|
2284
|
+
|
|
2285
|
+
/**
|
|
2286
|
+
* Returns whether a ShopifyFilter['values'][number]['input'] {@link ShopifyFilter} JSON string is applied in a given Shopify Collection query request.
|
|
2287
|
+
*/
|
|
2288
|
+
const daffShopifyIsFilterApplied = (shopifyFilterJSONInput, shopifyProductFilters) => {
|
|
2289
|
+
const visited = {};
|
|
2290
|
+
const parsedData = JSON.parse(shopifyFilterJSONInput);
|
|
2291
|
+
const filterName = Object.keys(parsedData)[0];
|
|
2292
|
+
const filterValue = parsedData[filterName];
|
|
2293
|
+
for (const queryFilter of shopifyProductFilters) {
|
|
2294
|
+
if (isValidVisit(visited, filterName, queryFilter[filterName]) && JSON.stringify(queryFilter[filterName]) === JSON.stringify(filterValue)) {
|
|
2295
|
+
return true;
|
|
2296
|
+
}
|
|
2297
|
+
if (filterName === 'available' || filterName === 'price') {
|
|
2298
|
+
if (queryFilter[filterName] !== null) {
|
|
2299
|
+
visited[filterName] = true;
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
return false;
|
|
2304
|
+
};
|
|
2305
|
+
/**
|
|
2306
|
+
* Checks if the visit on a filter is valid, i.e., it is not null. For the 'available' and 'price' filters, we must also check that they have not been
|
|
2307
|
+
* previously visited, since Shopify only considers the first occurrence.
|
|
2308
|
+
*/
|
|
2309
|
+
function isValidVisit(visited, filterName, filterValue) {
|
|
2310
|
+
if (filterName === 'available' || filterName === 'price') {
|
|
2311
|
+
return !(visited[filterName]) && filterValue !== null;
|
|
2312
|
+
}
|
|
2313
|
+
return filterValue !== null;
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
/**
|
|
2317
|
+
* Transforms a shopifyFilterJSONInput string {@link ShopifyFilter} into a JSON object that can later be parsed for useful filtering information.
|
|
2318
|
+
*/
|
|
2319
|
+
const daffShopifyFilterJSONInputResultTransformer = (shopifyFilterJSONInput) => {
|
|
2320
|
+
const parsedData = JSON.parse(shopifyFilterJSONInput);
|
|
2321
|
+
return parsedData;
|
|
2322
|
+
};
|
|
2323
|
+
|
|
2324
|
+
/**
|
|
2325
|
+
* Transforms a ShopifyFilter['values'] {@link ShopifyFilter} object into daffodil-readable filter options
|
|
2326
|
+
*/
|
|
2327
|
+
const daffShopifyFilterOptionsTransformer = (shopifyFilterValues, appliedFilters) => {
|
|
2328
|
+
const filterOptions = {};
|
|
2329
|
+
for (const option of shopifyFilterValues) {
|
|
2330
|
+
filterOptions[option.label] = {
|
|
2331
|
+
label: option.label,
|
|
2332
|
+
value: option.input,
|
|
2333
|
+
count: undefined,
|
|
2334
|
+
applied: daffShopifyIsFilterApplied(option.input, appliedFilters),
|
|
2335
|
+
};
|
|
2336
|
+
}
|
|
2337
|
+
return filterOptions;
|
|
2338
|
+
};
|
|
2339
|
+
|
|
2340
|
+
/**
|
|
2341
|
+
* Checks if a string is a valid, and coerces it into a {@link ShopifyProductCollectionSortKeys} object, or returns the CollectionDefault sortkey
|
|
2342
|
+
*/
|
|
2343
|
+
const shopifyProductCollectionSortKeyCoercer = (sortkey) => {
|
|
2344
|
+
const validSortKeys = Object.fromEntries(Object.values(ShopifyProductCollectionSortKeys).map(key => [key, true]));
|
|
2345
|
+
return validSortKeys[sortkey] ? sortkey : ShopifyProductCollectionSortKeys.CollectionDefault;
|
|
2346
|
+
};
|
|
2347
|
+
|
|
2348
|
+
const shopifyCollectionFiltersFragment = gql `
|
|
2349
|
+
fragment collectionFiltersFragment on Filter {
|
|
2350
|
+
id
|
|
2351
|
+
label
|
|
2352
|
+
presentation
|
|
2353
|
+
type
|
|
2354
|
+
values {
|
|
2355
|
+
count
|
|
2356
|
+
id
|
|
2357
|
+
label
|
|
2358
|
+
input
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2361
|
+
`;
|
|
2362
|
+
|
|
2363
|
+
const shopifyProductCoreFragment = gql `
|
|
2364
|
+
fragment productCoreFragment on Product {
|
|
2365
|
+
handle
|
|
2366
|
+
title
|
|
2367
|
+
id
|
|
2368
|
+
description
|
|
2369
|
+
onlineStoreUrl
|
|
2370
|
+
availableForSale
|
|
2371
|
+
}
|
|
2372
|
+
`;
|
|
2373
|
+
const shopifyCollectionCoreFragment = gql `
|
|
2374
|
+
fragment collectionCoreFragment on Collection {
|
|
2375
|
+
handle
|
|
2376
|
+
title
|
|
2377
|
+
id
|
|
2378
|
+
description
|
|
2379
|
+
onlineStoreUrl
|
|
2380
|
+
}
|
|
2381
|
+
`;
|
|
2382
|
+
|
|
2383
|
+
const shopifyImageFragment = gql `
|
|
2384
|
+
fragment imageFragment on Image {
|
|
2385
|
+
altText
|
|
2386
|
+
id
|
|
2387
|
+
url
|
|
2388
|
+
}
|
|
2389
|
+
`;
|
|
2390
|
+
|
|
2391
|
+
const shopifyProductPriceRangeFragment = gql `
|
|
2392
|
+
fragment productPriceRangeFragment on ProductPriceRange {
|
|
2393
|
+
maxVariantPrice {
|
|
2394
|
+
amount
|
|
2395
|
+
currencyCode
|
|
2396
|
+
}
|
|
2397
|
+
minVariantPrice {
|
|
2398
|
+
amount
|
|
2399
|
+
currencyCode
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
`;
|
|
2403
|
+
|
|
2176
2404
|
/**
|
|
2177
2405
|
* Creates an Apollo authentication link that adds the Shopify Storefront API (public) access token to requests.
|
|
2178
2406
|
*
|
|
@@ -2234,12 +2462,6 @@ function createHttpLink(url) {
|
|
|
2234
2462
|
});
|
|
2235
2463
|
}
|
|
2236
2464
|
|
|
2237
|
-
/**
|
|
2238
|
-
* Apollo GraphQL client name identifier for the Shopify driver.
|
|
2239
|
-
* Used to distinguish this client instance from other Apollo clients in the application.
|
|
2240
|
-
*/
|
|
2241
|
-
const APOLLO_CLIENT_NAME = 'shopify';
|
|
2242
|
-
|
|
2243
2465
|
/**
|
|
2244
2466
|
* Provides an Apollo client configuration for Shopify's Storefront API.
|
|
2245
2467
|
*
|
|
@@ -2261,90 +2483,9 @@ const provideShopifyDriver = (config) => provideNamedApollo(() => {
|
|
|
2261
2483
|
};
|
|
2262
2484
|
});
|
|
2263
2485
|
|
|
2264
|
-
/**
|
|
2265
|
-
* Provides an Apollo client configuration for Shopify's Storefront API.
|
|
2266
|
-
*
|
|
2267
|
-
* @deprecated, prefer using provideShopifyDriver Deprecated in version 0.89.0. Will be removed in version 0.92.0.
|
|
2268
|
-
*
|
|
2269
|
-
* @param domain - The Shopify store domain (e.g. "https://daffodil-demo-alpha.myshopify.com")
|
|
2270
|
-
* @param accessToken - The Shopify Storefront API access token.
|
|
2271
|
-
* @returns An Apollo client provider configured with a Shopify store domain and Storefront API access token.
|
|
2272
|
-
*/
|
|
2273
|
-
function provideShopifyApolloDriver(domain, accessToken) {
|
|
2274
|
-
return provideShopifyDriver({
|
|
2275
|
-
domain,
|
|
2276
|
-
accessToken,
|
|
2277
|
-
});
|
|
2278
|
-
}
|
|
2279
|
-
|
|
2280
|
-
/**
|
|
2281
|
-
* Transforms a DaffIdentifiable id and object type into a Shopify object id
|
|
2282
|
-
*
|
|
2283
|
-
* See {@link DaffIdentifiable} for more information on the requirements for the id argument.
|
|
2284
|
-
*
|
|
2285
|
-
* @param id - string
|
|
2286
|
-
* @param type - string
|
|
2287
|
-
* @returns string
|
|
2288
|
-
*/
|
|
2289
|
-
const shopifyIdTransformer = (id, type) => {
|
|
2290
|
-
const shopifyProductId = `gid://shopify/${type}/${id}`;
|
|
2291
|
-
return shopifyProductId;
|
|
2292
|
-
};
|
|
2293
|
-
|
|
2294
|
-
/**
|
|
2295
|
-
* Transforms a faker-js generated object name to a valid shopify handle (lowercase chars with hyphens instead of spaces)
|
|
2296
|
-
*
|
|
2297
|
-
* @param title - string
|
|
2298
|
-
* @returns string
|
|
2299
|
-
*/
|
|
2300
|
-
const shopifyHandleTransformer = (title) => {
|
|
2301
|
-
const noSpaces = title.replace(/ /g, '-');
|
|
2302
|
-
const handle = noSpaces.toLowerCase();
|
|
2303
|
-
return handle;
|
|
2304
|
-
};
|
|
2305
|
-
|
|
2306
|
-
/**
|
|
2307
|
-
* Transforms a DaffLocatable url into a Shopify handle string
|
|
2308
|
-
*
|
|
2309
|
-
* See {@link DaffLocatable} for more information on the requirements for the url argument.
|
|
2310
|
-
*
|
|
2311
|
-
* @param url - string
|
|
2312
|
-
* @returns string
|
|
2313
|
-
*/
|
|
2314
|
-
const shopifyUrlTransformer = (url) => {
|
|
2315
|
-
const noLeadingSlashes = url.split('/').pop() || '';
|
|
2316
|
-
const noTrailingExtension = noLeadingSlashes.split('.')[0];
|
|
2317
|
-
const handle = noTrailingExtension;
|
|
2318
|
-
return handle;
|
|
2319
|
-
};
|
|
2320
|
-
|
|
2321
|
-
/**
|
|
2322
|
-
* Generates a route path based on the Shopify resource type and handle.
|
|
2323
|
-
*
|
|
2324
|
-
* @param type The Shopify resource type (COLLECTION, PRODUCT, PAGE, etc.)
|
|
2325
|
-
* @param handle The resource handle/slug
|
|
2326
|
-
* @returns The formatted route path
|
|
2327
|
-
* @throws Error if type is empty
|
|
2328
|
-
*/
|
|
2329
|
-
const getShopifyRoutePath = (type, handle) => {
|
|
2330
|
-
if (!type) {
|
|
2331
|
-
throw new Error('Type cannot be empty');
|
|
2332
|
-
}
|
|
2333
|
-
switch (type) {
|
|
2334
|
-
case ShopifyMenuItemType.Collection:
|
|
2335
|
-
return `/collections/${handle}`;
|
|
2336
|
-
case ShopifyMenuItemType.Product:
|
|
2337
|
-
return `/products/${handle}`;
|
|
2338
|
-
case ShopifyMenuItemType.Page:
|
|
2339
|
-
return `/pages/${handle}`;
|
|
2340
|
-
default:
|
|
2341
|
-
return `/${type.toLowerCase()}s/${handle}`;
|
|
2342
|
-
}
|
|
2343
|
-
};
|
|
2344
|
-
|
|
2345
2486
|
/**
|
|
2346
2487
|
* Generated bundle index. Do not edit.
|
|
2347
2488
|
*/
|
|
2348
2489
|
|
|
2349
|
-
export { APOLLO_CLIENT_NAME, ShopifyArticleSortKeys, ShopifyBlogSortKeys, ShopifyCardBrand, ShopifyCartCardSource, ShopifyCartDeliveryGroupType, ShopifyCartErrorCode,
|
|
2490
|
+
export { APOLLO_CLIENT_NAME, ShopifyArticleSortKeys, ShopifyBlogSortKeys, ShopifyCardBrand, ShopifyCartCardSource, ShopifyCartDeliveryGroupType, ShopifyCartErrorCode, ShopifyCartWarningCode, ShopifyCollectionSortKeys, ShopifyCompletionErrorCode, ShopifyCountPrecision, ShopifyCountryCode, ShopifyCropRegion, ShopifyCurrencyCode, ShopifyCustomerErrorCode, ShopifyDeliveryAddressValidationStrategy, ShopifyDeliveryMethodType, ShopifyDigitalWallet, ShopifyDiscountApplicationAllocationMethod, ShopifyDiscountApplicationTargetSelection, ShopifyDiscountApplicationTargetType, ShopifyFilterPresentation, ShopifyFilterType, ShopifyImageContentType, ShopifyLanguageCode, ShopifyLocationSortKeys, ShopifyMediaContentType, ShopifyMediaHost, ShopifyMediaPresentationFormat, ShopifyMenuItemType, ShopifyMetafieldDeleteErrorCode, ShopifyMetafieldsSetUserErrorCode, ShopifyOrderCancelReason, ShopifyOrderFinancialStatus, ShopifyOrderFulfillmentStatus, ShopifyOrderSortKeys, ShopifyPageSortKeys, ShopifyPredictiveSearchLimitScope, ShopifyPredictiveSearchType, ShopifyPreferenceDeliveryMethodType, ShopifyProductCollectionSortKeys, ShopifyProductImageSortKeys, ShopifyProductMediaSortKeys, ShopifyProductRecommendationIntent, ShopifyProductSortKeys, ShopifyProductVariantSortKeys, ShopifySearchPrefixQueryType, ShopifySearchSortKeys, ShopifySearchType, ShopifySearchUnavailableProductsType, ShopifySearchableField, ShopifySellingPlanCheckoutChargeType, ShopifySellingPlanInterval, ShopifyShopPayInstallmentsFinancingPlanFrequency, ShopifyShopPayInstallmentsLoan, ShopifyShopPayPaymentRequestDeliveryMethodType, ShopifySitemapType, ShopifySubmissionErrorCode, ShopifyUnitPriceMeasurementMeasuredType, ShopifyUnitPriceMeasurementMeasuredUnit, ShopifyUnitSystem, ShopifyUserErrorsShopPayPaymentRequestSessionUserErrorsCode, ShopifyWeightUnit, daffShopifyFilterJSONInputResultTransformer, daffShopifyFilterOptionsTransformer, daffShopifyIsFilterApplied, getShopifyRoutePath, provideShopifyDriver, shopifyCollectionCoreFragment, shopifyCollectionFiltersFragment, shopifyHandleTransformer, shopifyIdTransformer, shopifyImageFragment, shopifyImageTransformer, shopifyProductCollectionSortKeyCoercer, shopifyProductCoreFragment, shopifyProductPriceRangeFragment, shopifyUrlTransformer };
|
|
2350
2491
|
//# sourceMappingURL=daffodil-driver-shopify.mjs.map
|