@thorprovider/adapters 4.1.0 → 4.2.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/CHANGELOG.md +17 -0
- package/README.md +36 -2
- package/dist/index.d.mts +171 -2
- package/dist/index.d.ts +171 -2
- package/dist/index.js +2102 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2098 -0
- package/dist/index.mjs.map +1 -1
- package/docs/capabilities-system.md +30 -0
- package/docs/getting-started.md +32 -11
- package/docs/providers-overview.md +23 -3
- package/docs/services-overview.md +16 -0
- package/package.json +10 -6
- package/quick-reference.md +1 -0
- package/src/factory/index.ts +8 -0
- package/src/index.ts +6 -0
- package/src/providers/index.ts +6 -0
- package/src/providers/mock/index.ts +427 -0
- package/src/providers/mock/mock.ts +917 -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/types/capabilities.types.ts +84 -0
- package/vitest.config.ts +13 -0
- package/vitest.setup.ts +6 -0
- package/.turbo/turbo-build.log +0 -18
- package/.turbo/turbo-test.log +0 -1
- package/.turbo/turbo-type-check.log +0 -0
- package/dist/.tsbuildinfo +0 -1
- package/publish.log +0 -93
|
@@ -16,6 +16,39 @@ import type { BackendCapabilities } from '@thorprovider/types';
|
|
|
16
16
|
|
|
17
17
|
export type { BackendCapabilities };
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Mock backend capabilities
|
|
21
|
+
*
|
|
22
|
+
* Fixture-backed provider used when a storefront has not yet been connected
|
|
23
|
+
* to a real backend. Supports the minimum commerce flows needed for layout,
|
|
24
|
+
* preview, navigation, region switching, and cart prototyping.
|
|
25
|
+
*/
|
|
26
|
+
export const MOCK_CAPABILITIES: Readonly<BackendCapabilities> = {
|
|
27
|
+
updateProfile: false,
|
|
28
|
+
updateEmail: false,
|
|
29
|
+
changePasswordDirect: false,
|
|
30
|
+
changePasswordViaEmail: false,
|
|
31
|
+
deleteAccount: false,
|
|
32
|
+
uploadAvatar: false,
|
|
33
|
+
avatarViaMetadata: false,
|
|
34
|
+
customAttributes: false,
|
|
35
|
+
fetchOrders: true,
|
|
36
|
+
cancelOrder: true,
|
|
37
|
+
manageAddresses: false,
|
|
38
|
+
defaultAddress: false,
|
|
39
|
+
applyDiscounts: true,
|
|
40
|
+
shippingCalculation: true,
|
|
41
|
+
guestCheckout: true,
|
|
42
|
+
savedPaymentMethods: false,
|
|
43
|
+
listPaymentProviders: true,
|
|
44
|
+
regionSpecificPayments: true,
|
|
45
|
+
wishlist: false,
|
|
46
|
+
advancedSearch: false,
|
|
47
|
+
facetedFilters: false,
|
|
48
|
+
productReviews: false,
|
|
49
|
+
loyaltyProgram: false,
|
|
50
|
+
};
|
|
51
|
+
|
|
19
52
|
/**
|
|
20
53
|
* Medusa backend capabilities
|
|
21
54
|
*
|
|
@@ -66,6 +99,57 @@ export const MEDUSA_CAPABILITIES: Readonly<BackendCapabilities> = {
|
|
|
66
99
|
loyaltyProgram: false, // Requires custom implementation
|
|
67
100
|
};
|
|
68
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Stel Order backend capabilities
|
|
104
|
+
*
|
|
105
|
+
* ERP/document API with catalog, CRM, inventory visibility, and sales documents,
|
|
106
|
+
* but without cart, checkout, customer auth, or storefront-native payment flows.
|
|
107
|
+
*/
|
|
108
|
+
export const STELORDER_CAPABILITIES: Readonly<BackendCapabilities> = {
|
|
109
|
+
// Profile Management
|
|
110
|
+
updateProfile: false,
|
|
111
|
+
updateEmail: false,
|
|
112
|
+
changePasswordDirect: false,
|
|
113
|
+
changePasswordViaEmail: false,
|
|
114
|
+
deleteAccount: false,
|
|
115
|
+
|
|
116
|
+
// Avatar
|
|
117
|
+
uploadAvatar: false,
|
|
118
|
+
avatarViaMetadata: false,
|
|
119
|
+
|
|
120
|
+
// Custom Attributes
|
|
121
|
+
customAttributes: false,
|
|
122
|
+
|
|
123
|
+
// Orders
|
|
124
|
+
fetchOrders: true,
|
|
125
|
+
cancelOrder: false,
|
|
126
|
+
|
|
127
|
+
// Addresses
|
|
128
|
+
manageAddresses: true,
|
|
129
|
+
defaultAddress: false,
|
|
130
|
+
|
|
131
|
+
// Cart/Checkout
|
|
132
|
+
applyDiscounts: false,
|
|
133
|
+
shippingCalculation: false,
|
|
134
|
+
guestCheckout: false,
|
|
135
|
+
savedPaymentMethods: false,
|
|
136
|
+
listPaymentProviders: true,
|
|
137
|
+
regionSpecificPayments: false,
|
|
138
|
+
|
|
139
|
+
// Wishlist
|
|
140
|
+
wishlist: false,
|
|
141
|
+
|
|
142
|
+
// Search
|
|
143
|
+
advancedSearch: false,
|
|
144
|
+
facetedFilters: false,
|
|
145
|
+
|
|
146
|
+
// Reviews
|
|
147
|
+
productReviews: false,
|
|
148
|
+
|
|
149
|
+
// Loyalty
|
|
150
|
+
loyaltyProgram: false,
|
|
151
|
+
};
|
|
152
|
+
|
|
69
153
|
/**
|
|
70
154
|
* Shopify backend capabilities
|
|
71
155
|
*
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineConfig } from 'vitest/config'
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
test: {
|
|
5
|
+
environment: 'node',
|
|
6
|
+
globals: true,
|
|
7
|
+
setupFiles: ['./vitest.setup.ts'],
|
|
8
|
+
include: ['src/**/*.test.ts'],
|
|
9
|
+
restoreMocks: true,
|
|
10
|
+
clearMocks: true,
|
|
11
|
+
mockReset: true,
|
|
12
|
+
},
|
|
13
|
+
})
|
package/vitest.setup.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { afterAll, afterEach, beforeAll } from 'vitest'
|
|
2
|
+
import { server } from './src/providers/stelorder/client.test-helpers'
|
|
3
|
+
|
|
4
|
+
beforeAll(() => server.listen({ onUnhandledRequest: 'error' }))
|
|
5
|
+
afterEach(() => server.resetHandlers())
|
|
6
|
+
afterAll(() => server.close())
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
CLI Building entry: {"index":"src/index.ts"}
|
|
2
|
-
CLI Using tsconfig: tsconfig.json
|
|
3
|
-
CLI tsup v8.5.1
|
|
4
|
-
CLI Using tsup config: /home/nelson/dev/thorprovider/repos/thorcommerce/packages/adapters/tsup.config.ts
|
|
5
|
-
CLI Target: esnext
|
|
6
|
-
CLI Cleaning output folder
|
|
7
|
-
CJS Build start
|
|
8
|
-
ESM Build start
|
|
9
|
-
ESM dist/index.mjs 270.54 KB
|
|
10
|
-
ESM dist/index.mjs.map 554.19 KB
|
|
11
|
-
ESM ⚡️ Build success in 89ms
|
|
12
|
-
CJS dist/index.js 275.05 KB
|
|
13
|
-
CJS dist/index.js.map 554.54 KB
|
|
14
|
-
CJS ⚡️ Build success in 93ms
|
|
15
|
-
DTS Build start
|
|
16
|
-
DTS ⚡️ Build success in 2621ms
|
|
17
|
-
DTS dist/index.d.ts 88.39 KB
|
|
18
|
-
DTS dist/index.d.mts 88.39 KB
|
package/.turbo/turbo-test.log
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
command not found: jest
|
|
File without changes
|