@thorprovider/adapters 4.2.0 → 4.3.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/CHANGELOG.md +6 -0
- package/PROVIDER_IMPLEMENTATION_ANALYSIS.md +659 -0
- package/README.md +19 -0
- package/dist/index.d.mts +249 -2
- package/dist/index.d.ts +249 -2
- package/dist/index.js +1450 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1448 -2
- package/dist/index.mjs.map +1 -1
- package/docs/RETRY_SOLUTION_SUMMARY.md +26 -11
- package/docs/authentication.md +115 -62
- package/docs/capabilities-system.md +34 -2
- package/docs/category-customization.md +37 -29
- package/docs/fetch-reliability-solution.md +127 -278
- package/docs/getting-started.md +43 -29
- package/docs/profile-management.md +68 -38
- package/docs/providers-overview.md +14 -0
- package/docs/services-overview.md +20 -2
- package/package.json +10 -6
- package/quick-reference.md +34 -0
- package/src/factory/index.ts +4 -0
- package/src/index.ts +3 -0
- package/src/providers/index.ts +3 -0
- package/src/providers/medusa/admin.test.ts +404 -0
- package/src/providers/medusa/admin.ts +442 -0
- package/src/providers/medusa/auth.test.ts +137 -0
- package/src/providers/medusa/auth.ts +96 -1
- package/src/providers/medusa/index.ts +21 -1
- package/src/providers/shopify/auth.ts +6 -0
- package/src/providers/stelorder/client.test-helpers.ts +3 -0
- package/src/providers/stelorder/client.test.ts +58 -0
- package/src/providers/stelorder/client.ts +326 -0
- package/src/providers/stelorder/index.test.ts +48 -0
- package/src/providers/stelorder/index.ts +685 -0
- package/src/providers/stelorder/live-smoke.test.ts +54 -0
- package/src/providers/stelorder/transforms.test.ts +103 -0
- package/src/providers/stelorder/transforms.ts +631 -0
- package/src/resilience/README.md +70 -48
- package/src/types/capabilities.types.ts +51 -0
- package/vitest.config.ts +13 -0
- package/vitest.setup.ts +6 -0
- package/.turbo/turbo-build.log +0 -18
- package/dist/.tsbuildinfo +0 -1
- package/src/core/errors.js +0 -161
- package/src/core/fetch-utils.js +0 -240
- package/src/core/logger.js +0 -63
- package/src/metadata/channel-scope-validation.js +0 -136
- package/src/metadata/channel-scope.js +0 -174
- package/src/metadata/index.js +0 -31
- package/src/providers/medusa/auth.js +0 -601
- package/src/providers/medusa/index.js +0 -2485
- package/src/providers/medusa/payment.js +0 -265
- package/src/providers/medusa/transforms.js +0 -505
- package/src/types/capabilities.types.js +0 -141
- package/src/types/provider.js +0 -9
- package/src/utils/payment-utils.js +0 -152
|
@@ -1,26 +1,32 @@
|
|
|
1
|
-
# Profile Management
|
|
2
|
-
|
|
3
1
|
---
|
|
2
|
+
title: Profile Management
|
|
3
|
+
purpose: Guide for managing customer profiles using capability-aware patterns for cross-backend compatibility
|
|
4
4
|
type: how-to
|
|
5
5
|
tags: [profile, account, customer, metadata, avatar]
|
|
6
6
|
related:
|
|
7
7
|
- authentication.md
|
|
8
8
|
- capabilities-system.md
|
|
9
9
|
- services-overview.md
|
|
10
|
-
updated: 2026-
|
|
10
|
+
updated: 2026-05-03
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
+
# Profile Management
|
|
14
|
+
|
|
13
15
|
Guide for managing customer profiles using capability-aware patterns for cross-backend compatibility.
|
|
14
16
|
|
|
15
17
|
## Prerequisites
|
|
16
18
|
|
|
17
19
|
- [Authentication set up](authentication.md)
|
|
18
|
-
- User logged in
|
|
20
|
+
- User logged in (`commerce.auth` available and `isAuthenticated()` returns `true`)
|
|
19
21
|
|
|
20
22
|
## Quick Example
|
|
21
23
|
|
|
22
24
|
```typescript
|
|
23
|
-
import {
|
|
25
|
+
import { createProvider } from '@thorprovider/adapters';
|
|
26
|
+
|
|
27
|
+
const commerce = createProvider({ provider: 'medusa', config: { ... } });
|
|
28
|
+
|
|
29
|
+
if (!commerce.auth) throw new Error('Auth not available');
|
|
24
30
|
|
|
25
31
|
// Simple profile update
|
|
26
32
|
const updated = await commerce.auth.updateCustomer({
|
|
@@ -41,6 +47,10 @@ const { updateEmail, updateProfile, deleteAccount } = commerce.capabilities;
|
|
|
41
47
|
if (updateEmail) {
|
|
42
48
|
// Render email update field
|
|
43
49
|
}
|
|
50
|
+
|
|
51
|
+
if (updateProfile) {
|
|
52
|
+
// Render name/phone fields
|
|
53
|
+
}
|
|
44
54
|
```
|
|
45
55
|
|
|
46
56
|
### Step 2: Retrieve Current Profile
|
|
@@ -48,6 +58,8 @@ if (updateEmail) {
|
|
|
48
58
|
Fetch the customer object to populate your forms.
|
|
49
59
|
|
|
50
60
|
```typescript
|
|
61
|
+
if (!commerce.auth) return;
|
|
62
|
+
|
|
51
63
|
const customer = await commerce.auth.getCurrentCustomer();
|
|
52
64
|
```
|
|
53
65
|
|
|
@@ -56,18 +68,24 @@ const customer = await commerce.auth.getCurrentCustomer();
|
|
|
56
68
|
Handle updates carefully, checking for specific field support.
|
|
57
69
|
|
|
58
70
|
```typescript
|
|
59
|
-
async function handleUpdate(formData
|
|
60
|
-
|
|
61
|
-
|
|
71
|
+
async function handleUpdate(formData: {
|
|
72
|
+
firstName: string;
|
|
73
|
+
lastName: string;
|
|
74
|
+
email?: string;
|
|
75
|
+
}) {
|
|
76
|
+
if (!commerce.auth) throw new Error('Auth not available');
|
|
77
|
+
|
|
78
|
+
const updateData: Record<string, unknown> = {};
|
|
79
|
+
|
|
62
80
|
if (commerce.capabilities.updateProfile) {
|
|
63
81
|
updateData.first_name = formData.firstName;
|
|
64
82
|
updateData.last_name = formData.lastName;
|
|
65
83
|
}
|
|
66
|
-
|
|
67
|
-
if (commerce.capabilities.updateEmail) {
|
|
84
|
+
|
|
85
|
+
if (commerce.capabilities.updateEmail && formData.email) {
|
|
68
86
|
updateData.email = formData.email;
|
|
69
87
|
}
|
|
70
|
-
|
|
88
|
+
|
|
71
89
|
return await commerce.auth.updateCustomer(updateData);
|
|
72
90
|
}
|
|
73
91
|
```
|
|
@@ -78,42 +96,54 @@ Handle password changes based on whether the backend supports direct or email-ba
|
|
|
78
96
|
|
|
79
97
|
```typescript
|
|
80
98
|
if (commerce.capabilities.changePasswordDirect) {
|
|
99
|
+
// Direct password change (Shopify, Spree, Magento)
|
|
81
100
|
await commerce.auth.updateCustomer({
|
|
82
|
-
|
|
83
|
-
password: 'new',
|
|
101
|
+
password: 'NewPassword123!',
|
|
84
102
|
});
|
|
103
|
+
} else if (commerce.capabilities.changePasswordViaEmail) {
|
|
104
|
+
// Email-based reset (Medusa v2)
|
|
105
|
+
await commerce.auth.requestPasswordReset(customer.email);
|
|
85
106
|
}
|
|
86
107
|
```
|
|
87
108
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
1. **Check Capabilities First:** Avoid rendering buttons for features the backend doesn't support.
|
|
91
|
-
2. **Use Metadata for Extensions:** Store extra info like `avatar_url` or `notifications` in `customer.metadata`.
|
|
92
|
-
3. **Handle Errors explicitly:** Distinguish between `EMAIL_TAKEN` and generic update errors.
|
|
93
|
-
4. **Validate on Client:** Use patterns/regex for phone and email before sending to the adapter.
|
|
94
|
-
5. **Protect UI with Loading States:** Backend operations can take time; show a spinner.
|
|
95
|
-
|
|
96
|
-
## ❌ DONT's
|
|
109
|
+
### Step 5: Account Deletion
|
|
97
110
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
111
|
+
```typescript
|
|
112
|
+
if (commerce.capabilities.deleteAccount && commerce.auth) {
|
|
113
|
+
await commerce.auth.deleteCustomerAccount();
|
|
114
|
+
}
|
|
115
|
+
```
|
|
103
116
|
|
|
104
|
-
##
|
|
117
|
+
## Avatar Management
|
|
105
118
|
|
|
106
|
-
|
|
107
|
-
Since many backends don't support native avatars, use an external service (S3/Cloudinary) and store the URL in metadata.
|
|
119
|
+
Most backends don't support native avatar uploads. Use an external service (S3, Cloudinary) and store the URL in metadata.
|
|
108
120
|
|
|
109
121
|
```typescript
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
122
|
+
// Check capability first
|
|
123
|
+
if (commerce.capabilities.avatarViaMetadata && commerce.auth) {
|
|
124
|
+
await commerce.auth.updateCustomer({
|
|
125
|
+
metadata: { avatar_url: 'https://cdn.example.com/avatars/user-123.jpg' },
|
|
126
|
+
});
|
|
127
|
+
}
|
|
113
128
|
```
|
|
114
129
|
|
|
115
|
-
|
|
116
|
-
|
|
130
|
+
> ⚠️ **Backend Disparity:** `uploadAvatar` (native file upload) is `false` for all current providers. Use `avatarViaMetadata` instead.
|
|
131
|
+
|
|
132
|
+
## ✅ DO's
|
|
133
|
+
|
|
134
|
+
1. **Check `commerce.capabilities` first:** Avoid rendering buttons for features the backend doesn't support.
|
|
135
|
+
2. **Use metadata for extensions:** Store extra info like `avatar_url` or notification preferences in `customer.metadata`.
|
|
136
|
+
3. **Handle errors explicitly:** Distinguish between `EMAIL_TAKEN` and generic update errors.
|
|
137
|
+
4. **Validate on client:** Use patterns/regex for phone and email before sending to the adapter.
|
|
138
|
+
5. **Re-fetch after update:** After a successful update, refresh the local customer state.
|
|
139
|
+
|
|
140
|
+
## ❌ DONT's
|
|
141
|
+
|
|
142
|
+
1. **Don't assume all backends are equal:** Medusa v2 has different capabilities than Shopify or WooCommerce.
|
|
143
|
+
2. **Don't hardcode profile fields:** Use the `UpdateCustomerData` type from `@thorprovider/adapters`.
|
|
144
|
+
3. **Don't ignore account deletion:** Provide a way for users to delete their account if `deleteAccount` is `true`.
|
|
145
|
+
4. **Don't send sensitive data in metadata:** Metadata is often visible to the user and may be less secure.
|
|
146
|
+
5. **Don't call `commerce.auth.updateCustomer` without checking `commerce.auth`:** It may be undefined.
|
|
117
147
|
|
|
118
148
|
## Common Errors & Solutions
|
|
119
149
|
|
|
@@ -128,16 +158,16 @@ Render only the fields supported by the current provider.
|
|
|
128
158
|
## Common Pitfalls
|
|
129
159
|
|
|
130
160
|
> ⚠️ **Pitfall 1: Metadata Overwrites**
|
|
131
|
-
> Some backends overwrite the entire metadata object instead of merging. Always fetch the current
|
|
161
|
+
> Some backends overwrite the entire metadata object instead of merging. Always fetch the current metadata first if you want to preserve existing fields.
|
|
132
162
|
|
|
133
163
|
> ⚠️ **Pitfall 2: Password Complexity**
|
|
134
|
-
> Backends have different password requirements. Let the backend validate and
|
|
164
|
+
> Backends have different password requirements. Let the backend validate and surface the error message.
|
|
135
165
|
|
|
136
166
|
## Troubleshooting
|
|
137
167
|
|
|
138
168
|
| Issue | Solution |
|
|
139
169
|
|-------|----------|
|
|
140
|
-
| Profile data not saving | Check if the user session is still active |
|
|
170
|
+
| Profile data not saving | Check if the user session is still active (`isAuthenticated()`) |
|
|
141
171
|
| Metadata field missing | Ensure the key exists in the backend's allowed metadata list |
|
|
142
172
|
| 403 Forbidden | User might not have permission to update their own profile |
|
|
143
173
|
|
|
@@ -42,6 +42,18 @@ Our primary integration, highly optimized for headless performance.
|
|
|
42
42
|
**Status:** 🚧 In Development (Phase 1)
|
|
43
43
|
Focusing on Storefront API integration for product discovery and cart.
|
|
44
44
|
|
|
45
|
+
### Stel Order
|
|
46
|
+
**Status:** ✅ ERP Adapter (v1)
|
|
47
|
+
Single-company ERP integration for catalog, categories, inventory visibility, customers (STEL clients), sales orders, and payment/delivery option listing.
|
|
48
|
+
|
|
49
|
+
**Scope & Limitations:**
|
|
50
|
+
- **Supported:** Products, categories (aliased as collections), warehouses/inventory, customers, orders, payment methods, delivery options, storefront context
|
|
51
|
+
- **Unsupported:** Cart, checkout, customer auth/profile self-service, discount codes, fulfillment orchestration, recommendations, advanced search
|
|
52
|
+
- **Rate limits:** 60 req/min + low daily limits — designed to minimize API round-trips
|
|
53
|
+
- **Single-company:** No multi-tenant/storefront channel assumptions; `requiresStorefront: false`
|
|
54
|
+
- **No variants:** STEL products are single-SKU; the adapter creates one synthetic variant per product
|
|
55
|
+
- **Client-side search:** STEL has no fulltext search; `getProducts({ query })` filters in-memory after fetch
|
|
56
|
+
|
|
45
57
|
### WooCommerce
|
|
46
58
|
**Status:** 🗓️ Planned
|
|
47
59
|
Targeting the REST API for hybrid headless setups.
|
|
@@ -62,9 +74,11 @@ graph TD
|
|
|
62
74
|
B --> C[Medusa Provider]
|
|
63
75
|
B --> D[Shopify Provider]
|
|
64
76
|
B --> E[Mock Provider]
|
|
77
|
+
B --> F2[Stel Order Provider]
|
|
65
78
|
C --> F[Unified Commerce Interface]
|
|
66
79
|
D --> F
|
|
67
80
|
E --> F
|
|
81
|
+
F2 --> F
|
|
68
82
|
```
|
|
69
83
|
|
|
70
84
|
## Design Decisions
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Services Overview
|
|
2
|
-
|
|
3
1
|
---
|
|
2
|
+
title: Services Overview
|
|
3
|
+
purpose: Overview of adapter services and provider capabilities
|
|
4
4
|
type: guide
|
|
5
5
|
tags: [architecture, services, commerce, api, architecture]
|
|
6
6
|
related:
|
|
@@ -10,6 +10,8 @@ related:
|
|
|
10
10
|
updated: 2026-02-28
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
+
# Services Overview
|
|
14
|
+
|
|
13
15
|
Overview of the functional services provided by Thor adapters and how they interact to provide a unified e-commerce interface.
|
|
14
16
|
|
|
15
17
|
## Overview
|
|
@@ -63,6 +65,22 @@ Handles customer account management and secure sessions.
|
|
|
63
65
|
- Profile and address management
|
|
64
66
|
- Metadata extensions
|
|
65
67
|
|
|
68
|
+
### 5. ERP Adapters (Stel Order)
|
|
69
|
+
Not all providers are full storefronts. ERP adapters like **Stel Order** expose a subset of services:
|
|
70
|
+
|
|
71
|
+
| Service | Stel Order Support |
|
|
72
|
+
|---------|-------------------|
|
|
73
|
+
| Products & Categories | ✅ Read-only catalog with inventory visibility |
|
|
74
|
+
| Collections | ✅ Aliased from categories |
|
|
75
|
+
| Cart & Checkout | ❌ Not supported (ERP has no cart concept) |
|
|
76
|
+
| Authentication | ❌ Not supported (API-key auth only, no customer login) |
|
|
77
|
+
| Customers (CRM) | ✅ Read + update via STEL clients endpoint |
|
|
78
|
+
| Orders | ✅ Read sales orders; no create/cancel from adapter |
|
|
79
|
+
| Payment Methods | ✅ List STEL payment options |
|
|
80
|
+
| Shipping/Delivery | ✅ List STEL delivery options |
|
|
81
|
+
|
|
82
|
+
Unsupported methods throw `ProviderAPIError` (501) with a clear message explaining the ERP limitation.
|
|
83
|
+
|
|
66
84
|
## Service Interactions
|
|
67
85
|
|
|
68
86
|
```mermaid
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thorprovider/adapters",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "Framework-agnostic commerce adapters for Thor Commerce ecosystem - Multi-platform support with unified API",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org",
|
|
@@ -11,16 +11,18 @@
|
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
|
-
"development": "./
|
|
15
|
-
"import": "./dist/index.
|
|
16
|
-
"require": "./dist/index.js"
|
|
14
|
+
"development": "./dist/index.mjs",
|
|
15
|
+
"import": "./dist/index.mjs",
|
|
16
|
+
"require": "./dist/index.js",
|
|
17
|
+
"default": "./dist/index.mjs"
|
|
17
18
|
}
|
|
18
19
|
},
|
|
19
20
|
"scripts": {
|
|
20
21
|
"build": "tsup",
|
|
21
22
|
"dev": "tsup --watch",
|
|
22
23
|
"type-check": "tsc --noEmit",
|
|
23
|
-
"test": "
|
|
24
|
+
"test": "vitest run --config vitest.config.ts",
|
|
25
|
+
"test:live": "vitest run --config vitest.config.ts src/providers/stelorder/live-smoke.test.ts",
|
|
24
26
|
"generate:agent-index": "node ../../scripts/generate-package-agents-index.cjs packages/adapters @thorprovider/adapters"
|
|
25
27
|
},
|
|
26
28
|
"dependencies": {
|
|
@@ -31,8 +33,10 @@
|
|
|
31
33
|
"jose": "^6.2.2"
|
|
32
34
|
},
|
|
33
35
|
"devDependencies": {
|
|
36
|
+
"msw": "^2.12.3",
|
|
34
37
|
"tsup": "^8.0.0",
|
|
35
|
-
"typescript": "^5.0.0"
|
|
38
|
+
"typescript": "^5.0.0",
|
|
39
|
+
"vitest": "^3.2.4"
|
|
36
40
|
},
|
|
37
41
|
"repository": {
|
|
38
42
|
"type": "git",
|
package/quick-reference.md
CHANGED
|
@@ -52,11 +52,45 @@ Framework-agnostic business logic SDK for e-commerce operations. Provides unifie
|
|
|
52
52
|
- **Collections**: Product collections/categories
|
|
53
53
|
- **Customer**: Authentication, profile management
|
|
54
54
|
- **Orders**: Order history, details, tracking
|
|
55
|
+
- **Auth — Multi-Tenant**: `linkCustomerToChannel()` — links authenticated customer to sales channel (Medusa only)
|
|
56
|
+
|
|
57
|
+
### Admin Client (Medusa only)
|
|
58
|
+
`provider.admin` — available when `adminConfig.apiKey` is set. Exposes 15 methods for the `/admin/thor/` endpoints:
|
|
59
|
+
```typescript
|
|
60
|
+
const commerce = createProvider({ provider: 'medusa', config: { ..., adminConfig: { apiKey: '...' } } })
|
|
61
|
+
if (!commerce.admin) throw new Error('Admin not configured')
|
|
62
|
+
|
|
63
|
+
// Sales Channel — Customers / API Keys / Categories
|
|
64
|
+
await commerce.admin.getChannelCustomers(salesChannelId, { limit, offset })
|
|
65
|
+
await commerce.admin.getChannelApiKeys(salesChannelId)
|
|
66
|
+
await commerce.admin.getChannelCategories(salesChannelId, { limit, offset, include_descendants })
|
|
67
|
+
|
|
68
|
+
// Category ↔ Sales Channel assignments
|
|
69
|
+
await commerce.admin.getCategorySalesChannels(categoryId)
|
|
70
|
+
await commerce.admin.assignCategoryToChannels(categoryId, { sales_channel_ids: [...] })
|
|
71
|
+
await commerce.admin.unassignCategoryFromChannels(categoryId, { sales_channel_ids: [...] })
|
|
72
|
+
|
|
73
|
+
// Collection ↔ Sales Channel assignments
|
|
74
|
+
await commerce.admin.getCollectionSalesChannels(collectionId)
|
|
75
|
+
await commerce.admin.assignCollectionToChannels(collectionId, { sales_channel_ids: [...] })
|
|
76
|
+
await commerce.admin.unassignCollectionFromChannels(collectionId, { sales_channel_ids: [...] })
|
|
77
|
+
|
|
78
|
+
// Storefront Config (visual theme, SEO defaults)
|
|
79
|
+
await commerce.admin.getStorefrontConfig(salesChannelId)
|
|
80
|
+
await commerce.admin.updateStorefrontConfig(salesChannelId, { theme_accent_color, logo_url, currency_code, seo_defaults })
|
|
81
|
+
|
|
82
|
+
// Site Designer Config (page builder config with history)
|
|
83
|
+
await commerce.admin.getSiteConfig(salesChannelId)
|
|
84
|
+
await commerce.admin.updateSiteConfig(salesChannelId, { config: { ... } })
|
|
85
|
+
await commerce.admin.getSiteConfigHistory(salesChannelId, { limit, offset })
|
|
86
|
+
await commerce.admin.restoreSiteConfig(salesChannelId, version)
|
|
87
|
+
```
|
|
55
88
|
|
|
56
89
|
### Provider Architecture
|
|
57
90
|
```
|
|
58
91
|
createProvider() → Provider instance
|
|
59
92
|
├── MedusaProvider (complete implementation)
|
|
93
|
+
├── StelOrderProvider (ERP: catalog, CRM, orders — no cart/checkout/auth)
|
|
60
94
|
├── ShopifyProvider (planned)
|
|
61
95
|
└── Custom providers (extensible)
|
|
62
96
|
```
|
package/src/factory/index.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { BigCommerceProvider, type BigCommerceProviderConfig } from '../provider
|
|
|
17
17
|
import { WooCommerceProvider, type WooCommerceProviderConfig } from '../providers/woocommerce';
|
|
18
18
|
import { SpreeProvider, type SpreeProviderConfig } from '../providers/spree';
|
|
19
19
|
import { MagentoProvider, type MagentoProviderConfig } from '../providers/magento';
|
|
20
|
+
import { StelOrderProvider, type StelOrderProviderConfig } from '../providers/stelorder';
|
|
20
21
|
import { MockProvider, type MockProviderConfig } from '../providers/mock';
|
|
21
22
|
import { ProviderNotFoundError, ConfigurationError } from '../core/errors';
|
|
22
23
|
import type { ProviderTypeString } from '@thorprovider/types';
|
|
@@ -33,6 +34,7 @@ export type ProviderType = ProviderTypeString;
|
|
|
33
34
|
export type ProviderFactoryConfig =
|
|
34
35
|
| { provider: 'mock'; config: MockProviderConfig }
|
|
35
36
|
| { provider: 'medusa'; config: MedusaProviderConfig }
|
|
37
|
+
| { provider: 'stelorder'; config: StelOrderProviderConfig }
|
|
36
38
|
| { provider: 'shopify'; config: ShopifyProviderConfig }
|
|
37
39
|
| { provider: 'bigcommerce'; config: BigCommerceProviderConfig }
|
|
38
40
|
| { provider: 'woocommerce'; config: WooCommerceProviderConfig }
|
|
@@ -79,6 +81,8 @@ export function createProvider(options: ProviderFactoryConfig | RuntimeProviderC
|
|
|
79
81
|
return new MockProvider(config);
|
|
80
82
|
case 'medusa':
|
|
81
83
|
return new MedusaProvider(config);
|
|
84
|
+
case 'stelorder':
|
|
85
|
+
return new StelOrderProvider(config);
|
|
82
86
|
case 'shopify':
|
|
83
87
|
return new ShopifyProvider(config);
|
|
84
88
|
case 'bigcommerce':
|
package/src/index.ts
CHANGED
|
@@ -40,6 +40,7 @@ export {
|
|
|
40
40
|
export {
|
|
41
41
|
MOCK_CAPABILITIES,
|
|
42
42
|
MEDUSA_CAPABILITIES,
|
|
43
|
+
STELORDER_CAPABILITIES,
|
|
43
44
|
SHOPIFY_CAPABILITIES,
|
|
44
45
|
BIGCOMMERCE_CAPABILITIES,
|
|
45
46
|
WOOCOMMERCE_CAPABILITIES,
|
|
@@ -193,6 +194,8 @@ export {
|
|
|
193
194
|
export {
|
|
194
195
|
MedusaProvider,
|
|
195
196
|
type MedusaProviderConfig,
|
|
197
|
+
StelOrderProvider,
|
|
198
|
+
type StelOrderProviderConfig,
|
|
196
199
|
MockProvider,
|
|
197
200
|
type MockProviderConfig,
|
|
198
201
|
ShopifyProvider,
|
package/src/providers/index.ts
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
export { MedusaProvider } from './medusa';
|
|
7
7
|
export type { MedusaProviderConfig } from './medusa';
|
|
8
8
|
|
|
9
|
+
export { StelOrderProvider } from './stelorder';
|
|
10
|
+
export type { StelOrderProviderConfig } from './stelorder';
|
|
11
|
+
|
|
9
12
|
export { ShopifyProvider } from './shopify';
|
|
10
13
|
export type { ShopifyProviderConfig } from './shopify';
|
|
11
14
|
|