@thorprovider/types 5.7.8 → 5.7.9
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/.turbo/turbo-build.log +18 -0
- package/.turbo/turbo-type-check.log +0 -0
- package/AGENTS.md +1 -1
- package/README.md +8 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/index.d.mts +373 -124
- package/dist/index.d.ts +373 -124
- package/dist/index.js +0 -138
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +0 -125
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/publish.log +60 -0
- package/src/admin/DropshippingAdmin.ts +0 -35
- package/src/cart.ts +40 -0
- package/src/catalog.ts +210 -0
- package/src/collection.ts +10 -0
- package/src/commerce-provider.ts +36 -0
- package/src/commerce.ts +88 -0
- package/src/index.ts +30 -16
- package/src/provider.ts +14 -178
- package/src/storefront.ts +5 -32
package/src/storefront.ts
CHANGED
|
@@ -15,9 +15,11 @@
|
|
|
15
15
|
* Supported commerce platform types for storefront identification.
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* Keep this type in sync with
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* Keep this type in sync with ProviderTypeString from provider.ts and the
|
|
19
|
+
* runtime registry in @thorprovider/adapters
|
|
20
|
+
* (packages/adapters/src/factory/provider-types.ts).
|
|
21
|
+
* When adding a new provider, update packages/types/src/provider.ts, this
|
|
22
|
+
* type, and the adapters registry.
|
|
21
23
|
*
|
|
22
24
|
* Currently supported:
|
|
23
25
|
* - ✅ 'mock': Backend-optional layout/design mode using fixture data
|
|
@@ -98,32 +100,3 @@ export interface StorefrontContext {
|
|
|
98
100
|
*/
|
|
99
101
|
metadata?: Record<string, unknown>;
|
|
100
102
|
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Storefront validation error.
|
|
104
|
-
* Thrown when storefront configuration is invalid or missing.
|
|
105
|
-
*
|
|
106
|
-
* @example
|
|
107
|
-
* ```typescript
|
|
108
|
-
* throw new StorefrontConfigError(
|
|
109
|
-
* 'Medusa requires NEXT_PUBLIC_SALES_CHANNEL_ID',
|
|
110
|
-
* 'medusa',
|
|
111
|
-
* 'NEXT_PUBLIC_SALES_CHANNEL_ID',
|
|
112
|
-
* );
|
|
113
|
-
* ```
|
|
114
|
-
*/
|
|
115
|
-
export class StorefrontConfigError extends Error {
|
|
116
|
-
public readonly platformType: string;
|
|
117
|
-
public readonly requiredEnvVar?: string;
|
|
118
|
-
|
|
119
|
-
constructor(
|
|
120
|
-
message: string,
|
|
121
|
-
platformType: string,
|
|
122
|
-
requiredEnvVar?: string,
|
|
123
|
-
) {
|
|
124
|
-
super(message);
|
|
125
|
-
this.name = 'StorefrontConfigError';
|
|
126
|
-
this.platformType = platformType;
|
|
127
|
-
this.requiredEnvVar = requiredEnvVar;
|
|
128
|
-
}
|
|
129
|
-
}
|