@shoppexio/storefront 1.0.57 → 1.0.59
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 +99 -0
- package/LICENSE +21 -0
- package/README.md +96 -180
- package/dist/chunk-ZVOFFURI.js +15364 -0
- package/dist/chunk-ZVOFFURI.js.map +1 -0
- package/dist/customer.cjs +16013 -1
- package/dist/customer.cjs.map +1 -1
- package/dist/{headless-customer.d.ts → customer.d.cts} +74 -61
- package/dist/customer.d.ts +336 -10
- package/dist/customer.js +726 -2
- package/dist/customer.js.map +1 -1
- package/dist/index.cjs +21533 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1979 -0
- package/dist/index.d.ts +1859 -49
- package/dist/index.js +6139 -0
- package/dist/index.js.map +1 -0
- package/package.json +18 -37
- package/dist/core/attribution.d.ts +0 -26
- package/dist/core/attribution.d.ts.map +0 -1
- package/dist/core/cache.d.ts +0 -26
- package/dist/core/cache.d.ts.map +0 -1
- package/dist/core/client.d.ts +0 -18
- package/dist/core/client.d.ts.map +0 -1
- package/dist/core/config.d.ts +0 -10
- package/dist/core/config.d.ts.map +0 -1
- package/dist/core/endpoint.d.ts +0 -2
- package/dist/core/endpoint.d.ts.map +0 -1
- package/dist/core/errors.d.ts +0 -34
- package/dist/core/errors.d.ts.map +0 -1
- package/dist/core/telemetry.d.ts +0 -20
- package/dist/core/telemetry.d.ts.map +0 -1
- package/dist/core/typed-client.d.ts +0 -15
- package/dist/core/typed-client.d.ts.map +0 -1
- package/dist/customer.d.ts.map +0 -1
- package/dist/headless-customer.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/modules/affiliates.d.ts +0 -15
- package/dist/modules/affiliates.d.ts.map +0 -1
- package/dist/modules/analytics.d.ts +0 -2
- package/dist/modules/analytics.d.ts.map +0 -1
- package/dist/modules/cart.d.ts +0 -62
- package/dist/modules/cart.d.ts.map +0 -1
- package/dist/modules/checkout.d.ts +0 -133
- package/dist/modules/checkout.d.ts.map +0 -1
- package/dist/modules/coupons.d.ts +0 -3
- package/dist/modules/coupons.d.ts.map +0 -1
- package/dist/modules/customer.d.ts +0 -147
- package/dist/modules/customer.d.ts.map +0 -1
- package/dist/modules/invoices.d.ts +0 -6
- package/dist/modules/invoices.d.ts.map +0 -1
- package/dist/modules/navigation.d.ts +0 -20
- package/dist/modules/navigation.d.ts.map +0 -1
- package/dist/modules/pages.d.ts +0 -10
- package/dist/modules/pages.d.ts.map +0 -1
- package/dist/modules/presence.d.ts +0 -12
- package/dist/modules/presence.d.ts.map +0 -1
- package/dist/modules/products.d.ts +0 -16
- package/dist/modules/products.d.ts.map +0 -1
- package/dist/modules/reviews.d.ts +0 -4
- package/dist/modules/reviews.d.ts.map +0 -1
- package/dist/modules/search.d.ts +0 -10
- package/dist/modules/search.d.ts.map +0 -1
- package/dist/modules/store.d.ts +0 -11
- package/dist/modules/store.d.ts.map +0 -1
- package/dist/modules/theme.d.ts +0 -27
- package/dist/modules/theme.d.ts.map +0 -1
- package/dist/shoppex.esm.js +0 -3
- package/dist/shoppex.esm.js.map +0 -1
- package/dist/shoppex.umd.js +0 -2
- package/dist/shoppex.umd.js.map +0 -1
- package/dist/types/api.d.ts +0 -757
- package/dist/types/api.d.ts.map +0 -1
- package/dist/types/cart.d.ts +0 -239
- package/dist/types/cart.d.ts.map +0 -1
- package/dist/types/config.d.ts +0 -18
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -7
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/theme-config.d.ts +0 -109
- package/dist/types/theme-config.d.ts.map +0 -1
- package/dist/utils/cart-line-id.d.ts +0 -5
- package/dist/utils/cart-line-id.d.ts.map +0 -1
- package/dist/utils/format.d.ts +0 -6
- package/dist/utils/format.d.ts.map +0 -1
- package/dist/utils/requested-currency.d.ts +0 -3
- package/dist/utils/requested-currency.d.ts.map +0 -1
- package/dist/utils/storage.d.ts +0 -10
- package/dist/utils/storage.d.ts.map +0 -1
- package/dist/utils/storefront-catalog.d.ts +0 -5
- package/dist/utils/storefront-catalog.d.ts.map +0 -1
- package/dist/utils/storefront-contact.d.ts +0 -32
- package/dist/utils/storefront-contact.d.ts.map +0 -1
- package/dist/utils/storefront-custom-fields.d.ts +0 -13
- package/dist/utils/storefront-custom-fields.d.ts.map +0 -1
- package/dist/utils/storefront-search.d.ts +0 -22
- package/dist/utils/storefront-search.d.ts.map +0 -1
- package/dist/utils/storefront-stock.d.ts +0 -14
- package/dist/utils/storefront-stock.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shoppexio/storefront",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.59",
|
|
4
|
+
"description": "Official JavaScript storefront SDK for Shoppex",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/ShoppexIO/
|
|
9
|
-
"directory": "packages/sdk"
|
|
8
|
+
"url": "git+https://github.com/ShoppexIO/storefront-js.git"
|
|
10
9
|
},
|
|
11
10
|
"homepage": "https://docs.shoppex.io/sdk/introduction",
|
|
12
11
|
"bugs": {
|
|
13
|
-
"url": "https://github.com/ShoppexIO/
|
|
12
|
+
"url": "https://github.com/ShoppexIO/storefront-js/issues"
|
|
14
13
|
},
|
|
15
14
|
"publishConfig": {
|
|
16
|
-
"
|
|
17
|
-
"
|
|
15
|
+
"access": "public",
|
|
16
|
+
"registry": "https://registry.npmjs.org"
|
|
18
17
|
},
|
|
19
|
-
"main": "./dist/
|
|
20
|
-
"module": "./dist/
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"module": "./dist/index.js",
|
|
21
20
|
"types": "./dist/index.d.ts",
|
|
22
21
|
"exports": {
|
|
23
22
|
".": {
|
|
24
23
|
"types": "./dist/index.d.ts",
|
|
25
|
-
"import": "./dist/
|
|
26
|
-
"require": "./dist/
|
|
24
|
+
"import": "./dist/index.js",
|
|
25
|
+
"require": "./dist/index.cjs"
|
|
27
26
|
},
|
|
28
27
|
"./customer": {
|
|
29
28
|
"types": "./dist/customer.d.ts",
|
|
@@ -32,41 +31,23 @@
|
|
|
32
31
|
}
|
|
33
32
|
},
|
|
34
33
|
"files": [
|
|
35
|
-
"dist"
|
|
34
|
+
"dist",
|
|
35
|
+
"README.md",
|
|
36
|
+
"CHANGELOG.md",
|
|
37
|
+
"LICENSE"
|
|
36
38
|
],
|
|
37
39
|
"scripts": {
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
+
"build": "tsup",
|
|
41
|
+
"dev": "tsup --watch",
|
|
40
42
|
"lint": "biome lint src",
|
|
41
|
-
"typecheck": "tsc --noEmit"
|
|
42
|
-
"test": "vitest run",
|
|
43
|
-
"test:watch": "vitest",
|
|
44
|
-
"smoke": "vitest run -c vitest.smoke.config.ts",
|
|
45
|
-
"deploy": "bun run build && ./scripts/deploy-cdn.sh"
|
|
43
|
+
"typecheck": "tsc --noEmit"
|
|
46
44
|
},
|
|
47
45
|
"keywords": [
|
|
48
46
|
"shoppex",
|
|
49
47
|
"storefront",
|
|
50
48
|
"sdk",
|
|
51
|
-
"ecommerce",
|
|
52
49
|
"checkout"
|
|
53
50
|
],
|
|
54
51
|
"author": "Shoppex",
|
|
55
|
-
"license": "MIT"
|
|
56
|
-
"devDependencies": {
|
|
57
|
-
"@types/node": "^22.19.15",
|
|
58
|
-
"ajv": "^8.18.0",
|
|
59
|
-
"jsdom": "^28.1.0",
|
|
60
|
-
"terser": "^5.46.0",
|
|
61
|
-
"typescript": "^5.8.3",
|
|
62
|
-
"vite": "^8.2.1",
|
|
63
|
-
"vite-plugin-dts": "^4.5.4",
|
|
64
|
-
"vitest": "^4.1.10"
|
|
65
|
-
},
|
|
66
|
-
"engines": {
|
|
67
|
-
"node": ">=18.0.0"
|
|
68
|
-
},
|
|
69
|
-
"dependencies": {
|
|
70
|
-
"@shoppex/contracts": "npm:@shoppexio/contracts@0.1.4"
|
|
71
|
-
}
|
|
52
|
+
"license": "MIT"
|
|
72
53
|
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UTM attribution for storefront page views.
|
|
3
|
-
*
|
|
4
|
-
* Campaign parameters only appear on the landing URL, but a visitor usually
|
|
5
|
-
* browses several pages before doing anything interesting. Without persistence
|
|
6
|
-
* every page after the first would be attributed to "direct" and the numbers
|
|
7
|
-
* would understate every campaign.
|
|
8
|
-
*
|
|
9
|
-
* Last-touch: a fresh set of parameters replaces the stored one, matching what
|
|
10
|
-
* merchants expect from analytics tools — the most recent campaign gets credit.
|
|
11
|
-
* Navigating without parameters keeps whatever was stored.
|
|
12
|
-
*/
|
|
13
|
-
declare const UTM_KEYS: readonly ["utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"];
|
|
14
|
-
type UtmKey = (typeof UTM_KEYS)[number];
|
|
15
|
-
export type UtmParameters = Partial<Record<UtmKey, string>>;
|
|
16
|
-
/**
|
|
17
|
-
* Resolves the UTM parameters to report for the current page view.
|
|
18
|
-
*
|
|
19
|
-
* Reads the current URL first; when it carries any campaign parameter that set
|
|
20
|
-
* wins and is persisted. Otherwise the stored set is returned unchanged.
|
|
21
|
-
*
|
|
22
|
-
* @returns the parameters, or undefined when there is nothing to report
|
|
23
|
-
*/
|
|
24
|
-
export declare function resolveUtmParameters(storeSlug: string): UtmParameters | undefined;
|
|
25
|
-
export {};
|
|
26
|
-
//# sourceMappingURL=attribution.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attribution.d.ts","sourceRoot":"","sources":["../../src/core/attribution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,QAAA,MAAM,QAAQ,kFAAmF,CAAC;AAElG,KAAK,MAAM,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAExC,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAqE5D;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAajF"}
|
package/dist/core/cache.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* In-memory cache with pending request deduplication.
|
|
3
|
-
*/
|
|
4
|
-
export interface CacheEntry<T> {
|
|
5
|
-
data: T;
|
|
6
|
-
expiresAt: number;
|
|
7
|
-
updatedAt: number;
|
|
8
|
-
ttl: number;
|
|
9
|
-
}
|
|
10
|
-
export interface CacheOptions {
|
|
11
|
-
ttl: number;
|
|
12
|
-
staleWhileRevalidate?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface CacheStats {
|
|
15
|
-
hits: number;
|
|
16
|
-
misses: number;
|
|
17
|
-
pendingRequests: number;
|
|
18
|
-
entries: number;
|
|
19
|
-
}
|
|
20
|
-
export declare function getCacheStats(): CacheStats;
|
|
21
|
-
export declare function clearCache(): void;
|
|
22
|
-
export declare function invalidateCache(prefixOrKey: string): void;
|
|
23
|
-
export declare function setCacheEntry<T>(key: string, data: T, ttl: number): void;
|
|
24
|
-
export declare function getCacheEntry<T>(key: string): CacheEntry<T> | null;
|
|
25
|
-
export declare function getOrFetch<T>(key: string, fetcher: () => Promise<T>, options: CacheOptions, shouldCache?: (value: T) => boolean): Promise<T>;
|
|
26
|
-
//# sourceMappingURL=cache.d.ts.map
|
package/dist/core/cache.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/core/cache.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,IAAI,EAAE,CAAC,CAAC;IACR,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB;AAcD,wBAAgB,aAAa,IAAI,UAAU,CAO1C;AAED,wBAAgB,UAAU,IAAI,IAAI,CAGjC;AAED,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAMzD;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAQxE;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAIlE;AAED,wBAAsB,UAAU,CAAC,CAAC,EAChC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACzB,OAAO,EAAE,YAAY,EACrB,WAAW,GAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAoB,GAC9C,OAAO,CAAC,CAAC,CAAC,CA8CZ"}
|
package/dist/core/client.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { SDKResponse } from '../types';
|
|
2
|
-
import { CacheOptions } from './cache';
|
|
3
|
-
interface RequestOptions {
|
|
4
|
-
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
5
|
-
body?: unknown;
|
|
6
|
-
timeout?: number;
|
|
7
|
-
retries?: number;
|
|
8
|
-
baseUrl?: string;
|
|
9
|
-
headers?: Record<string, string>;
|
|
10
|
-
cache?: (CacheOptions & {
|
|
11
|
-
key?: string;
|
|
12
|
-
}) | false;
|
|
13
|
-
}
|
|
14
|
-
export declare function request<T>(endpoint: string, options?: RequestOptions): Promise<SDKResponse<T>>;
|
|
15
|
-
export declare function get<T>(endpoint: string, options?: Omit<RequestOptions, 'method' | 'body'>): Promise<SDKResponse<T>>;
|
|
16
|
-
export declare function post<T>(endpoint: string, body?: unknown, options?: Omit<RequestOptions, 'method' | 'body'>): Promise<SDKResponse<T>>;
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAA6B,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvE,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAMxD,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,CAAC,YAAY,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,KAAK,CAAC;CACnD;AAuBD,wBAAsB,OAAO,CAAC,CAAC,EAC7B,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAyMzB;AAyHD,wBAAsB,GAAG,CAAC,CAAC,EACzB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,MAAM,CAAC,GAChD,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAEzB;AAED,wBAAsB,IAAI,CAAC,CAAC,EAC1B,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,MAAM,CAAC,GAChD,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAEzB"}
|
package/dist/core/config.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ShoppexConfig, ShoppexInitOptions } from '../types';
|
|
2
|
-
export declare const DEFAULT_API_BASE_URL = "https://api.shoppex.io";
|
|
3
|
-
export declare const DEFAULT_CHECKOUT_BASE_URL = "https://checkout.shoppex.io";
|
|
4
|
-
export declare function initConfig(storeSlug: string, options?: ShoppexInitOptions): ShoppexConfig;
|
|
5
|
-
export declare function getConfig(): ShoppexConfig;
|
|
6
|
-
export declare function isInitialized(): boolean;
|
|
7
|
-
export declare function resetConfig(): void;
|
|
8
|
-
export declare function setShopId(shopId: string): void;
|
|
9
|
-
export declare function getShopId(): string | null;
|
|
10
|
-
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAKlE,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAK7D,eAAO,MAAM,yBAAyB,gCAAgC,CAAC;AAEvE,wBAAgB,UAAU,CACxB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,aAAa,CAuBf;AAED,wBAAgB,SAAS,IAAI,aAAa,CAKzC;AAED,wBAAgB,aAAa,IAAI,OAAO,CAEvC;AAED,wBAAgB,WAAW,IAAI,IAAI,CAIlC;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED,wBAAgB,SAAS,IAAI,MAAM,GAAG,IAAI,CAEzC"}
|
package/dist/core/endpoint.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../src/core/endpoint.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,GACzD,MAAM,CAcR"}
|
package/dist/core/errors.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SDK Error Classes
|
|
3
|
-
*/
|
|
4
|
-
export declare class ShoppexError extends Error {
|
|
5
|
-
readonly code: string;
|
|
6
|
-
readonly statusCode?: number;
|
|
7
|
-
constructor(message: string, code: string, statusCode?: number);
|
|
8
|
-
}
|
|
9
|
-
export declare class NotInitializedError extends ShoppexError {
|
|
10
|
-
constructor();
|
|
11
|
-
}
|
|
12
|
-
export declare class NetworkError extends ShoppexError {
|
|
13
|
-
constructor(message: string, statusCode?: number);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* A refusal the SERVER made and named. `code` is the backend's `error_code`
|
|
17
|
-
* (e.g. `errors.checkout.coupon_no_longer_valid`) — the branchable identity of
|
|
18
|
-
* the refusal, stable across locales, unlike the localized `message`.
|
|
19
|
-
*
|
|
20
|
-
* Distinct from {@link NetworkError}, whose `code` is always `NETWORK_ERROR`:
|
|
21
|
-
* that one means "the request did not produce a named answer".
|
|
22
|
-
*/
|
|
23
|
-
export declare class ApiError extends ShoppexError {
|
|
24
|
-
readonly errorParams?: Record<string, unknown>;
|
|
25
|
-
constructor(message: string, code: string, statusCode?: number, errorParams?: Record<string, unknown>);
|
|
26
|
-
}
|
|
27
|
-
export declare class ValidationError extends ShoppexError {
|
|
28
|
-
readonly invalidFields?: string[];
|
|
29
|
-
constructor(message: string, invalidFields?: string[]);
|
|
30
|
-
}
|
|
31
|
-
export declare class CartError extends ShoppexError {
|
|
32
|
-
constructor(message: string);
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,qBAAa,YAAa,SAAQ,KAAK;IACrC,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;gBAExB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;CAO/D;AAED,qBAAa,mBAAoB,SAAQ,YAAY;;CASpD;AAED,qBAAa,YAAa,SAAQ,YAAY;gBAChC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;CAKjD;AAED;;;;;;;GAOG;AACH,qBAAa,QAAS,SAAQ,YAAY;IACxC,SAAgB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAGpD,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAOxC;AAED,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,SAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;gBAE7B,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE;CAMtD;AAED,qBAAa,SAAU,SAAQ,YAAY;gBAC7B,OAAO,EAAE,MAAM;CAK5B"}
|
package/dist/core/telemetry.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
type VisibilityStateValue = 'hidden' | 'visible' | 'prerender' | 'unloaded';
|
|
2
|
-
type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
3
|
-
export interface StorefrontClientErrorPayload {
|
|
4
|
-
endpoint: string;
|
|
5
|
-
method: RequestMethod;
|
|
6
|
-
message: string;
|
|
7
|
-
statusCode?: number;
|
|
8
|
-
source?: 'sdk';
|
|
9
|
-
phase?: 'request';
|
|
10
|
-
attemptCount?: number;
|
|
11
|
-
responseReceived?: boolean;
|
|
12
|
-
pageUrl?: string;
|
|
13
|
-
requestUrl?: string;
|
|
14
|
-
online?: boolean;
|
|
15
|
-
visibilityState?: VisibilityStateValue;
|
|
16
|
-
}
|
|
17
|
-
export declare function getStorefrontConnectionId(storeSlug: string): string | null;
|
|
18
|
-
export declare function reportStorefrontClientError(payload: StorefrontClientErrorPayload): Promise<void>;
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=telemetry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/core/telemetry.ts"],"names":[],"mappings":"AAOA,KAAK,oBAAoB,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AAC5E,KAAK,aAAa,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEvD,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,oBAAoB,CAAC;CACxC;AASD,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAY1E;AAwBD,wBAAsB,2BAA2B,CAAC,OAAO,EAAE,4BAA4B,GAAG,OAAO,CAAC,IAAI,CAAC,CAqDtG"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createApiClient } from '@shoppex/contracts';
|
|
2
|
-
type ApiClient = ReturnType<typeof createApiClient>;
|
|
3
|
-
/**
|
|
4
|
-
* Return a typed OpenAPI client bound to the SDK's configured API base URL.
|
|
5
|
-
* The client is cached per base URL and recreated when the SDK is re-initialized
|
|
6
|
-
* against a different host.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getTypedClient(token?: string): ApiClient;
|
|
9
|
-
/**
|
|
10
|
-
* Reset the cached client. Called when the SDK is re-initialized so that a new
|
|
11
|
-
* `apiBaseUrl` takes effect immediately on the next `client()` call.
|
|
12
|
-
*/
|
|
13
|
-
export declare function resetTypedClient(): void;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=typed-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typed-client.d.ts","sourceRoot":"","sources":["../../src/core/typed-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAKpD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAgBxD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAGvC"}
|
package/dist/customer.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customer.d.ts","sourceRoot":"","sources":["../src/customer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkJnB,CAAC;AAGF,eAAe,OAAO,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { AffiliateValidation, SDKResponse } from '../types';
|
|
2
|
-
export declare function setAffiliateCode(code: string | null | undefined, ttlDays?: number): string | null;
|
|
3
|
-
export declare function clearAffiliateCode(): void;
|
|
4
|
-
export declare function getAffiliateCode(): string | null;
|
|
5
|
-
export declare function validateAffiliateCode(code: string): Promise<SDKResponse<AffiliateValidation>>;
|
|
6
|
-
export declare function applyAffiliateCode(code: string): Promise<SDKResponse<AffiliateValidation>>;
|
|
7
|
-
/**
|
|
8
|
-
* Capture an affiliate code from the current URL and store it for 30 days (last-click).
|
|
9
|
-
*
|
|
10
|
-
* Example:
|
|
11
|
-
* - URL: https://mystore.com/product/abc?ref=deadbeef
|
|
12
|
-
* - captureAffiliateFromUrl() stores "deadbeef" and returns it.
|
|
13
|
-
*/
|
|
14
|
-
export declare function captureAffiliateFromUrl(param?: string): Promise<string | null>;
|
|
15
|
-
//# sourceMappingURL=affiliates.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"affiliates.d.ts","sourceRoot":"","sources":["../../src/modules/affiliates.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AA6CjE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,SAAmB,GAAG,MAAM,GAAG,IAAI,CAS3G;AAED,wBAAgB,kBAAkB,IAAI,IAAI,CAOzC;AAED,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAQhD;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAwDnG;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAOhG;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAAC,KAAK,SAAQ,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAwCnF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/modules/analytics.ts"],"names":[],"mappings":"AAKA,wBAAsB,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBzF"}
|
package/dist/modules/cart.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { CartItem, CartAddOptions, CartItemUpdate, CartPayload, CartStats, CartQuote, CartBasketMergeLine, CartCodeSource } from '../types';
|
|
2
|
-
export declare function getCartCoupon(): string | null;
|
|
3
|
-
export declare function getCartCouponSource(): CartCodeSource | null;
|
|
4
|
-
export declare function setCartCoupon(coupon: string | null | undefined, source?: CartCodeSource): string | null;
|
|
5
|
-
export declare function clearCartCoupon(): void;
|
|
6
|
-
export declare function getCart(): CartItem[];
|
|
7
|
-
/** Resolve a cart line_id for product+variant. When multiple configs exist, returns the first line. */
|
|
8
|
-
export declare function resolveCartLineId(productId: string, variantId: string, cart?: CartItem[]): string;
|
|
9
|
-
export declare function getCartItemCount(): number;
|
|
10
|
-
export declare function addToCart(productId: string, variantId: string, quantity?: number, options?: CartAddOptions): void;
|
|
11
|
-
export declare function setCartItem(productId: string, variantId: string, quantity?: number, options?: CartAddOptions): void;
|
|
12
|
-
/**
|
|
13
|
-
* Patch one cart line.
|
|
14
|
-
*
|
|
15
|
-
* TRI-STATE BOUNDS: `min_quantity`/`max_quantity` accept `null` to DELETE the
|
|
16
|
-
* stored bound — see {@link CartItemUpdate}. `undefined` (or an absent key)
|
|
17
|
-
* leaves it alone, which is why a removed ceiling needs its own spelling.
|
|
18
|
-
*
|
|
19
|
-
* NO-OP UPDATES DO NOT WRITE. An update that leaves the cart byte-identical
|
|
20
|
-
* returns without touching storage: no metadata bump, no `version` increment,
|
|
21
|
-
* and — because the storage write is what other tabs observe — no `storage`
|
|
22
|
-
* event. Writing anyway made an ineffective heal indistinguishable from a real
|
|
23
|
-
* cart change, and two tabs healing the same line could hand the event back and
|
|
24
|
-
* forth indefinitely. Line-shape healing of a legacy stored row is NOT this
|
|
25
|
-
* function's job: `normalizeCartItems` clamps and repairs on every READ, which
|
|
26
|
-
* is the chokepoint every access already flows through.
|
|
27
|
-
*/
|
|
28
|
-
export declare function updateCartItem(lineId: string, updates: CartItemUpdate): void;
|
|
29
|
-
export declare function removeFromCart(lineId: string): void;
|
|
30
|
-
/**
|
|
31
|
-
* Discards the cart entirely — and with it the proof that describes it.
|
|
32
|
-
*
|
|
33
|
-
* PAYMENT PATH. `latestQuoteToken` is evidence about a specific cart, and this
|
|
34
|
-
* is the one mutation after which that cart does not exist in any form. Held
|
|
35
|
-
* across the clear, the proof outlives its subject: a caller that clears and
|
|
36
|
-
* re-adds (Buy Now REPLACES the cart) hands `/from-cart` a token bound to the
|
|
37
|
-
* previous cart's hash, which is refused as `quote_token_stale` — a hand-off
|
|
38
|
-
* dead-ended by a proof nobody asked for. And with no re-quote in between there
|
|
39
|
-
* is nothing to replace it with, so the retry is refused identically.
|
|
40
|
-
*
|
|
41
|
-
* Only this path clears it. Every OTHER mutation turns one cart into another
|
|
42
|
-
* cart, where a proof that no longer matches is the server's to refuse: it
|
|
43
|
-
* answers `quote_token_stale`, the surfaces re-quote, and the buyer approves the
|
|
44
|
-
* new total. Dropping the proof there instead would silently remove the approved
|
|
45
|
-
* -total ceiling from a checkout that raced the re-quote, which is the failure
|
|
46
|
-
* the token exists to prevent.
|
|
47
|
-
*/
|
|
48
|
-
export declare function clearCart(): void;
|
|
49
|
-
export declare function createCartBackup(): void;
|
|
50
|
-
export declare function restoreCartFromBackup(): boolean;
|
|
51
|
-
export declare function mergeBaskets(items: CartBasketMergeLine[]): CartItem[];
|
|
52
|
-
export declare function moveBasketItem(fromProductId: string, fromVariantId: string, toProductId: string, toVariantId: string): void;
|
|
53
|
-
export declare function validateCartIntegrity(): boolean;
|
|
54
|
-
export declare function getCartStats(): CartStats;
|
|
55
|
-
export declare function getCartPayload(coupon?: string): CartPayload;
|
|
56
|
-
/** @internal — read by checkout(); exported only across module boundaries. */
|
|
57
|
-
export declare function getLatestQuoteToken(): string | null;
|
|
58
|
-
/** @internal — test seam and cart-reset hook. */
|
|
59
|
-
export declare function clearLatestQuoteToken(): void;
|
|
60
|
-
export declare function quoteCart(coupon?: string, currency?: string): Promise<import('..').SDKResponse<CartQuote>>;
|
|
61
|
-
export declare function serializeCart(coupon?: string): string;
|
|
62
|
-
//# sourceMappingURL=cart.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cart.d.ts","sourceRoot":"","sources":["../../src/modules/cart.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,cAAc,EACd,WAAW,EAEX,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,cAAc,EACf,MAAM,UAAU,CAAC;AAmJlB,wBAAgB,aAAa,IAAI,MAAM,GAAG,IAAI,CAE7C;AAED,wBAAgB,mBAAmB,IAAI,cAAc,GAAG,IAAI,CAE3D;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,MAAM,GAAE,cAAyB,GAChC,MAAM,GAAG,IAAI,CASf;AAED,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAkCD,wBAAgB,OAAO,IAAI,QAAQ,EAAE,CAGpC;AAED,uGAAuG;AACvG,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,QAAQ,EAAc,GAC3B,MAAM,CAQR;AAED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jE;AAED,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAWrD"}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { ApiChallenge, BuyerRewards } from '../types/api';
|
|
2
|
-
export interface CheckoutOptions {
|
|
3
|
-
autoRedirect?: boolean;
|
|
4
|
-
locale?: string;
|
|
5
|
-
email?: string;
|
|
6
|
-
coupon?: string;
|
|
7
|
-
currency?: string;
|
|
8
|
-
/**
|
|
9
|
-
* A Cloudflare Turnstile proof for the `storefront_checkout` action.
|
|
10
|
-
*
|
|
11
|
-
* Normally omitted. A checkout surface may provide a renewed proof when a
|
|
12
|
-
* legitimate shared network reaches the public invoice-create budget. The
|
|
13
|
-
* widget must run on the same origin that calls this SDK, while the proof is
|
|
14
|
-
* transport-only and does not change the checkout intent or its idempotency
|
|
15
|
-
* key.
|
|
16
|
-
*/
|
|
17
|
-
turnstileToken?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Referral (affiliate) code to submit, as a tri-state:
|
|
20
|
-
*
|
|
21
|
-
* - `undefined` — the SDK resolves it from storage (cart-applied referral
|
|
22
|
-
* code first, then the ambient `?ref=` attribution).
|
|
23
|
-
* - `''` — explicitly none: submit no referral code and do NOT re-read
|
|
24
|
-
* storage. This is how a caller pins "quoted WITHOUT a referral"; without
|
|
25
|
-
* it a code captured between the quote and the submit would be applied to
|
|
26
|
-
* a total the buyer never saw.
|
|
27
|
-
* - non-empty — pinned: submit exactly this code.
|
|
28
|
-
*
|
|
29
|
-
* `referralCode` is an alias and follows the same rules; `affiliateCode`
|
|
30
|
-
* wins when both are present.
|
|
31
|
-
*/
|
|
32
|
-
affiliateCode?: string;
|
|
33
|
-
/** Alias of {@link CheckoutOptions.affiliateCode}, same tri-state. */
|
|
34
|
-
referralCode?: string;
|
|
35
|
-
customerCheckoutPath?: '/dashboard/api/checkout';
|
|
36
|
-
/**
|
|
37
|
-
* The cart this hand-off was approved FOR, as `JSON.stringify(getCart())`.
|
|
38
|
-
*
|
|
39
|
-
* PAYMENT PATH. A caller that writes the cart and reads it back before
|
|
40
|
-
* checking out (Buy Now, which replaces the cart, is the sharp case) verifies
|
|
41
|
-
* a cart it read at one moment, while these functions read storage again on
|
|
42
|
-
* their way into the request — and localStorage is shared with every other
|
|
43
|
-
* tab on the domain. A write landing in that gap is billed without ever
|
|
44
|
-
* having passed the caller's verification.
|
|
45
|
-
*
|
|
46
|
-
* The caller cannot close that itself: any check it makes is one more read
|
|
47
|
-
* BEFORE this one. Pinning the expected bytes moves the comparison to the
|
|
48
|
-
* only place it can be conclusive — against the exact cart the call is about
|
|
49
|
-
* to POST. A mismatch refuses before anything is created or sent.
|
|
50
|
-
*
|
|
51
|
-
* Honoured identically by BOTH invoice-creating entry points, `checkout()`
|
|
52
|
-
* and `buildCheckoutUrl()` — they hit the same endpoint and create the same
|
|
53
|
-
* invoice, so a pin that held on one and not the other would be a promise
|
|
54
|
-
* the caller could not rely on. Only the refusal shape differs, following
|
|
55
|
-
* each function's own success shape: `checkout()` returns
|
|
56
|
-
* `{ success: false }`, `buildCheckoutUrl()` throws.
|
|
57
|
-
*
|
|
58
|
-
* Optional and additive: omitted, nothing changes, and the server is not
|
|
59
|
-
* involved either way.
|
|
60
|
-
*/
|
|
61
|
-
expectedCart?: string;
|
|
62
|
-
}
|
|
63
|
-
export interface CheckoutResult {
|
|
64
|
-
success: boolean;
|
|
65
|
-
redirectUrl?: string;
|
|
66
|
-
invoiceId?: string;
|
|
67
|
-
rewards?: BuyerRewards | null;
|
|
68
|
-
message?: string;
|
|
69
|
-
/**
|
|
70
|
-
* The server's machine-readable refusal identifier when the checkout was
|
|
71
|
-
* refused, e.g. `errors.checkout.price_increased_since_quote` or
|
|
72
|
-
* `errors.checkout.affiliate_code_not_applicable`. Branch on this rather
|
|
73
|
-
* than on `message`, which is localized display copy.
|
|
74
|
-
*
|
|
75
|
-
* The quote-proof family — `errors.checkout.quote_token_invalid`,
|
|
76
|
-
* `errors.checkout.quote_token_expired`, `errors.checkout.quote_token_stale`
|
|
77
|
-
* — says the proof this call submitted could not be honoured: not ours, past
|
|
78
|
-
* its window, or priced for a cart/currency/codes that have since moved. The
|
|
79
|
-
* server refuses rather than pricing without the ceiling, so the caller's
|
|
80
|
-
* response is always the same: `quoteCart()` again, show the buyer the new
|
|
81
|
-
* total, and only then retry. A retry with the same stale token is refused
|
|
82
|
-
* identically.
|
|
83
|
-
*
|
|
84
|
-
* Absent for failures the server never named (transport, timeout, an empty
|
|
85
|
-
* cart caught client-side).
|
|
86
|
-
*/
|
|
87
|
-
code?: string;
|
|
88
|
-
/**
|
|
89
|
-
* Human-verification challenge returned when a legitimate shared network
|
|
90
|
-
* reaches the invoice-create budget. Render the named provider on the same
|
|
91
|
-
* origin that calls the SDK, then retry with its proof as `turnstileToken`.
|
|
92
|
-
*/
|
|
93
|
-
challenge?: ApiChallenge;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Typed refusal from {@link buildCheckoutUrl}. The function keeps its existing
|
|
97
|
-
* throw-based contract while exposing a server-requested human-verification
|
|
98
|
-
* challenge so callers can render it and retry with `turnstileToken`.
|
|
99
|
-
*/
|
|
100
|
-
export declare class CheckoutCreateError extends Error {
|
|
101
|
-
readonly challenge?: ApiChallenge;
|
|
102
|
-
readonly code?: string;
|
|
103
|
-
readonly status?: number;
|
|
104
|
-
constructor(message: string, options?: {
|
|
105
|
-
challenge?: ApiChallenge;
|
|
106
|
-
code?: string;
|
|
107
|
-
status?: number;
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
export declare function checkout(couponOrOptions?: string | CheckoutOptions, options?: CheckoutOptions): Promise<CheckoutResult>;
|
|
111
|
-
/**
|
|
112
|
-
* Build checkout URL by creating invoice first.
|
|
113
|
-
* Returns the checkout URL for the created invoice.
|
|
114
|
-
*
|
|
115
|
-
* PAYMENT PATH. "Build a URL" names what this returns, not a lighter way to
|
|
116
|
-
* price a cart: it POSTs the same invoice-creating endpoint as `checkout()` and
|
|
117
|
-
* bills whatever storage holds when it reads. It therefore honours
|
|
118
|
-
* `CheckoutOptions.expectedCart` on exactly the same terms — a pinned cart that
|
|
119
|
-
* moved is refused, not invoiced.
|
|
120
|
-
*
|
|
121
|
-
* A refusal throws, like every other refusal on this function: the success
|
|
122
|
-
* shape is a URL string, so there is no in-band value that a caller could
|
|
123
|
-
* mistake for one. The thrown message is the buyer-facing copy, identical to
|
|
124
|
-
* the sentence `checkout()` returns, and callers that already handle the
|
|
125
|
-
* `Cart is empty` throw handle this one unchanged.
|
|
126
|
-
*/
|
|
127
|
-
export declare function buildCheckoutUrl(couponOrOptions?: string | CheckoutOptions, options?: CheckoutOptions): Promise<string>;
|
|
128
|
-
/**
|
|
129
|
-
* @deprecated Use buildCheckoutUrl instead.
|
|
130
|
-
* Sync version is no longer supported as invoice creation requires API call.
|
|
131
|
-
*/
|
|
132
|
-
export declare function buildCheckoutUrlSync(): never;
|
|
133
|
-
//# sourceMappingURL=checkout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/modules/checkout.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAM/D,MAAM,WAAW,eAAe;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;;;;;;OAaG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,yBAAyB,CAAC;IACjD;;;;;;;;;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