@thorprovider/adapters 5.0.0 → 5.0.1
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/AGENTS.md +1 -1
- package/CHANGELOG.md +6 -0
- package/README.md +53 -631
- package/dist/index.d.mts +406 -194
- package/dist/index.d.ts +406 -194
- package/dist/index.js +3092 -604
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3081 -602
- package/dist/index.mjs.map +1 -1
- package/docs/RETRY_SOLUTION_SUMMARY.md +1 -1
- package/docs/authentication.md +0 -26
- package/docs/capabilities-system.md +66 -36
- package/docs/getting-started.md +1 -1
- package/docs/providers-overview.md +16 -13
- package/docs/update-documentation.md +10 -8
- package/package.json +6 -5
- package/quick-reference.md +0 -33
- package/src/backend/factory.ts +11 -1
- package/src/factory/index.ts +52 -74
- package/src/index.ts +17 -3
- package/src/providers/bigcommerce/bigcommerce.ts +6 -0
- package/src/providers/bigcommerce/index.ts +315 -0
- package/src/providers/bigcommerce/transforms.ts +227 -0
- package/src/providers/index.ts +16 -1
- package/src/providers/magento/index.ts +387 -0
- package/src/providers/magento/magento.ts +5 -0
- package/src/providers/magento/queries.ts +267 -0
- package/src/providers/magento/transforms.ts +249 -0
- package/src/providers/medusa/auth.test.ts +94 -92
- package/src/providers/medusa/auth.ts +72 -123
- package/src/providers/medusa/index.test.ts +392 -0
- package/src/providers/medusa/index.ts +1 -21
- package/src/providers/medusa/live-smoke.test.ts +412 -0
- package/src/providers/shopify/auth.ts +402 -0
- package/src/providers/shopify/index.ts +444 -0
- package/src/providers/shopify/mutations.ts +247 -0
- package/src/providers/shopify/queries.ts +324 -0
- package/src/providers/shopify/shopify.ts +7 -0
- package/src/providers/shopify/transforms.ts +275 -0
- package/src/providers/spree/index.ts +344 -0
- package/src/providers/spree/spree.ts +5 -0
- package/src/providers/spree/transforms.ts +254 -0
- package/src/providers/woocommerce/index.ts +310 -0
- package/src/providers/woocommerce/transforms.ts +254 -0
- package/src/providers/woocommerce/woocommerce.ts +5 -0
- package/src/types/capabilities.types.ts +250 -0
- package/vitest.live.config.ts +18 -0
|
@@ -150,6 +150,256 @@ export const STELORDER_CAPABILITIES: Readonly<BackendCapabilities> = {
|
|
|
150
150
|
loyaltyProgram: false,
|
|
151
151
|
};
|
|
152
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Shopify backend capabilities
|
|
155
|
+
*
|
|
156
|
+
* @see https://shopify.dev/docs/api/storefront
|
|
157
|
+
*/
|
|
158
|
+
export const SHOPIFY_CAPABILITIES: Readonly<BackendCapabilities> = {
|
|
159
|
+
// Profile Management
|
|
160
|
+
updateProfile: true,
|
|
161
|
+
updateEmail: true,
|
|
162
|
+
changePasswordDirect: true,
|
|
163
|
+
changePasswordViaEmail: true,
|
|
164
|
+
deleteAccount: false, // Requires admin API
|
|
165
|
+
|
|
166
|
+
// Avatar
|
|
167
|
+
uploadAvatar: false,
|
|
168
|
+
avatarViaMetadata: true,
|
|
169
|
+
|
|
170
|
+
// Custom Attributes
|
|
171
|
+
customAttributes: true,
|
|
172
|
+
|
|
173
|
+
// Orders
|
|
174
|
+
fetchOrders: true,
|
|
175
|
+
cancelOrder: true,
|
|
176
|
+
|
|
177
|
+
// Addresses
|
|
178
|
+
manageAddresses: true,
|
|
179
|
+
defaultAddress: true,
|
|
180
|
+
|
|
181
|
+
// Cart/Checkout
|
|
182
|
+
applyDiscounts: true,
|
|
183
|
+
shippingCalculation: true,
|
|
184
|
+
guestCheckout: true,
|
|
185
|
+
savedPaymentMethods: true,
|
|
186
|
+
listPaymentProviders: true,
|
|
187
|
+
regionSpecificPayments: false, // Global payment methods
|
|
188
|
+
|
|
189
|
+
// Wishlist
|
|
190
|
+
wishlist: false, // Requires app
|
|
191
|
+
|
|
192
|
+
// Search
|
|
193
|
+
advancedSearch: true,
|
|
194
|
+
facetedFilters: true,
|
|
195
|
+
|
|
196
|
+
// Reviews
|
|
197
|
+
productReviews: false, // Requires app
|
|
198
|
+
|
|
199
|
+
// Loyalty
|
|
200
|
+
loyaltyProgram: false, // Requires app
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* BigCommerce backend capabilities
|
|
205
|
+
*
|
|
206
|
+
* @see https://developer.bigcommerce.com/docs/rest-storefront
|
|
207
|
+
*/
|
|
208
|
+
export const BIGCOMMERCE_CAPABILITIES: Readonly<BackendCapabilities> = {
|
|
209
|
+
// Profile Management
|
|
210
|
+
updateProfile: true,
|
|
211
|
+
updateEmail: true,
|
|
212
|
+
changePasswordDirect: true,
|
|
213
|
+
changePasswordViaEmail: true,
|
|
214
|
+
deleteAccount: false,
|
|
215
|
+
|
|
216
|
+
// Avatar
|
|
217
|
+
uploadAvatar: false,
|
|
218
|
+
avatarViaMetadata: false,
|
|
219
|
+
|
|
220
|
+
// Custom Attributes
|
|
221
|
+
customAttributes: true,
|
|
222
|
+
|
|
223
|
+
// Orders
|
|
224
|
+
fetchOrders: true,
|
|
225
|
+
cancelOrder: false, // Admin API only
|
|
226
|
+
|
|
227
|
+
// Addresses
|
|
228
|
+
manageAddresses: true,
|
|
229
|
+
defaultAddress: false,
|
|
230
|
+
|
|
231
|
+
// Cart/Checkout
|
|
232
|
+
applyDiscounts: true,
|
|
233
|
+
shippingCalculation: true,
|
|
234
|
+
guestCheckout: true,
|
|
235
|
+
savedPaymentMethods: true,
|
|
236
|
+
listPaymentProviders: true,
|
|
237
|
+
regionSpecificPayments: false,
|
|
238
|
+
|
|
239
|
+
// Wishlist
|
|
240
|
+
wishlist: true, // Native support
|
|
241
|
+
|
|
242
|
+
// Search
|
|
243
|
+
advancedSearch: true,
|
|
244
|
+
facetedFilters: true,
|
|
245
|
+
|
|
246
|
+
// Reviews
|
|
247
|
+
productReviews: true, // Native support
|
|
248
|
+
|
|
249
|
+
// Loyalty
|
|
250
|
+
loyaltyProgram: false,
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* WooCommerce backend capabilities
|
|
255
|
+
*
|
|
256
|
+
* @see https://developer.woocommerce.com/docs/apis/store-api
|
|
257
|
+
*/
|
|
258
|
+
export const WOOCOMMERCE_CAPABILITIES: Readonly<BackendCapabilities> = {
|
|
259
|
+
// Profile Management
|
|
260
|
+
updateProfile: true,
|
|
261
|
+
updateEmail: true,
|
|
262
|
+
changePasswordDirect: false, // WordPress handles auth
|
|
263
|
+
changePasswordViaEmail: true,
|
|
264
|
+
deleteAccount: false,
|
|
265
|
+
|
|
266
|
+
// Avatar
|
|
267
|
+
uploadAvatar: false,
|
|
268
|
+
avatarViaMetadata: false, // Gravatar-based
|
|
269
|
+
|
|
270
|
+
// Custom Attributes
|
|
271
|
+
customAttributes: true, // Via meta_data
|
|
272
|
+
|
|
273
|
+
// Orders
|
|
274
|
+
fetchOrders: true,
|
|
275
|
+
cancelOrder: true,
|
|
276
|
+
|
|
277
|
+
// Addresses
|
|
278
|
+
manageAddresses: true,
|
|
279
|
+
defaultAddress: false, // Billing/shipping only
|
|
280
|
+
|
|
281
|
+
// Cart/Checkout
|
|
282
|
+
applyDiscounts: true, // Coupon codes
|
|
283
|
+
shippingCalculation: true,
|
|
284
|
+
guestCheckout: true,
|
|
285
|
+
savedPaymentMethods: false,
|
|
286
|
+
listPaymentProviders: true,
|
|
287
|
+
regionSpecificPayments: false,
|
|
288
|
+
|
|
289
|
+
// Wishlist
|
|
290
|
+
wishlist: false, // Requires plugin
|
|
291
|
+
|
|
292
|
+
// Search
|
|
293
|
+
advancedSearch: false, // Basic WP search
|
|
294
|
+
facetedFilters: false, // Requires plugin
|
|
295
|
+
|
|
296
|
+
// Reviews
|
|
297
|
+
productReviews: true, // Native WP reviews
|
|
298
|
+
|
|
299
|
+
// Loyalty
|
|
300
|
+
loyaltyProgram: false,
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Spree Commerce backend capabilities
|
|
305
|
+
*
|
|
306
|
+
* @see https://docs.spreecommerce.org/api-reference
|
|
307
|
+
*/
|
|
308
|
+
export const SPREE_CAPABILITIES: Readonly<BackendCapabilities> = {
|
|
309
|
+
// Profile Management
|
|
310
|
+
updateProfile: true,
|
|
311
|
+
updateEmail: true,
|
|
312
|
+
changePasswordDirect: true,
|
|
313
|
+
changePasswordViaEmail: true,
|
|
314
|
+
deleteAccount: false,
|
|
315
|
+
|
|
316
|
+
// Avatar
|
|
317
|
+
uploadAvatar: false,
|
|
318
|
+
avatarViaMetadata: false,
|
|
319
|
+
|
|
320
|
+
// Custom Attributes
|
|
321
|
+
customAttributes: false,
|
|
322
|
+
|
|
323
|
+
// Orders
|
|
324
|
+
fetchOrders: true,
|
|
325
|
+
cancelOrder: true,
|
|
326
|
+
|
|
327
|
+
// Addresses
|
|
328
|
+
manageAddresses: true,
|
|
329
|
+
defaultAddress: true,
|
|
330
|
+
|
|
331
|
+
// Cart/Checkout
|
|
332
|
+
applyDiscounts: true,
|
|
333
|
+
shippingCalculation: true,
|
|
334
|
+
guestCheckout: true,
|
|
335
|
+
savedPaymentMethods: false,
|
|
336
|
+
listPaymentProviders: true,
|
|
337
|
+
regionSpecificPayments: false,
|
|
338
|
+
|
|
339
|
+
// Wishlist
|
|
340
|
+
wishlist: true, // Native support
|
|
341
|
+
|
|
342
|
+
// Search
|
|
343
|
+
advancedSearch: false,
|
|
344
|
+
facetedFilters: true, // Taxon-based filtering
|
|
345
|
+
|
|
346
|
+
// Reviews
|
|
347
|
+
productReviews: false, // Requires extension
|
|
348
|
+
|
|
349
|
+
// Loyalty
|
|
350
|
+
loyaltyProgram: false,
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Adobe Commerce / Magento backend capabilities
|
|
355
|
+
*
|
|
356
|
+
* @see https://developer.adobe.com/commerce/webapi/graphql/
|
|
357
|
+
*/
|
|
358
|
+
export const MAGENTO_CAPABILITIES: Readonly<BackendCapabilities> = {
|
|
359
|
+
// Profile Management
|
|
360
|
+
updateProfile: true,
|
|
361
|
+
updateEmail: true,
|
|
362
|
+
changePasswordDirect: true,
|
|
363
|
+
changePasswordViaEmail: true,
|
|
364
|
+
deleteAccount: false, // Admin only
|
|
365
|
+
|
|
366
|
+
// Avatar
|
|
367
|
+
uploadAvatar: false,
|
|
368
|
+
avatarViaMetadata: false,
|
|
369
|
+
|
|
370
|
+
// Custom Attributes
|
|
371
|
+
customAttributes: true, // EAV model
|
|
372
|
+
|
|
373
|
+
// Orders
|
|
374
|
+
fetchOrders: true,
|
|
375
|
+
cancelOrder: true,
|
|
376
|
+
|
|
377
|
+
// Addresses
|
|
378
|
+
manageAddresses: true,
|
|
379
|
+
defaultAddress: true,
|
|
380
|
+
|
|
381
|
+
// Cart/Checkout
|
|
382
|
+
applyDiscounts: true,
|
|
383
|
+
shippingCalculation: true,
|
|
384
|
+
guestCheckout: true,
|
|
385
|
+
savedPaymentMethods: true,
|
|
386
|
+
listPaymentProviders: true,
|
|
387
|
+
regionSpecificPayments: true, // Store-view scoped
|
|
388
|
+
|
|
389
|
+
// Wishlist
|
|
390
|
+
wishlist: true, // Native support
|
|
391
|
+
|
|
392
|
+
// Search
|
|
393
|
+
advancedSearch: true, // Elasticsearch/OpenSearch
|
|
394
|
+
facetedFilters: true, // Layered navigation
|
|
395
|
+
|
|
396
|
+
// Reviews
|
|
397
|
+
productReviews: true, // Native support
|
|
398
|
+
|
|
399
|
+
// Loyalty
|
|
400
|
+
loyaltyProgram: false, // Requires extension
|
|
401
|
+
};
|
|
402
|
+
|
|
153
403
|
/**
|
|
154
404
|
* Type guard to check if an object is a valid BackendCapabilities
|
|
155
405
|
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineConfig } from 'vitest/config'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Vitest config for live smoke tests — no MSW setup (real HTTP).
|
|
5
|
+
* Forces TypeScript resolution over stale .js files in src/.
|
|
6
|
+
*/
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
resolve: {
|
|
9
|
+
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
|
|
10
|
+
},
|
|
11
|
+
test: {
|
|
12
|
+
environment: 'node',
|
|
13
|
+
globals: true,
|
|
14
|
+
include: ['src/**/live-smoke.test.ts'],
|
|
15
|
+
testTimeout: 45000,
|
|
16
|
+
retry: 1, // Retry once on transient network failures
|
|
17
|
+
},
|
|
18
|
+
})
|