@smess/networking 2.1.0 → 2.2.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 +15 -0
- package/README.md +27 -2
- package/dist/core/hosts.d.ts +2 -0
- package/dist/core/hosts.d.ts.map +1 -1
- package/dist/core/hosts.js +2 -0
- package/dist/core/hosts.js.map +1 -1
- package/dist/modules/authentication/index.d.ts +19 -0
- package/dist/modules/authentication/index.d.ts.map +1 -1
- package/dist/modules/authentication/index.js +15 -0
- package/dist/modules/authentication/index.js.map +1 -1
- package/dist/modules/storefront/index.d.ts +160 -0
- package/dist/modules/storefront/index.d.ts.map +1 -0
- package/dist/modules/storefront/index.js +176 -0
- package/dist/modules/storefront/index.js.map +1 -0
- package/dist/modules/storefront/types.d.ts +499 -0
- package/dist/modules/storefront/types.d.ts.map +1 -0
- package/dist/modules/storefront/types.js +8 -0
- package/dist/modules/storefront/types.js.map +1 -0
- package/dist/modules/storefront-admin/index.d.ts +85 -0
- package/dist/modules/storefront-admin/index.d.ts.map +1 -0
- package/dist/modules/storefront-admin/index.js +80 -0
- package/dist/modules/storefront-admin/index.js.map +1 -0
- package/dist/modules/storefront-admin/types.d.ts +295 -0
- package/dist/modules/storefront-admin/types.d.ts.map +1 -0
- package/dist/modules/storefront-admin/types.js +2 -0
- package/dist/modules/storefront-admin/types.js.map +1 -0
- package/package.json +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@smess/networking`. Versions follow [semver](https://semver.org).
|
|
4
4
|
|
|
5
|
+
## 2.2.0 (2026-11-07)
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `@smess/networking/storefront`: the shop customer side of core's Storefront module (`/v1/storefront/*`):
|
|
10
|
+
catalog, stores, promos, cart, checkout, orders, profile and addresses, store metadata, favorites and
|
|
11
|
+
the contact message. `storeId` option → `X-Store-Id`; the guest cart token is kept in a
|
|
12
|
+
`CartTokenStore` (`memoryCartToken()` by default) and sent as `X-Nonce-Token` while signed out.
|
|
13
|
+
- `@smess/networking/storefront-admin`: the shop back office (`/v1/storefront/admin/*`): products,
|
|
14
|
+
orders (update, confirm, reject, status, resend confirmation), promos, customers, search, stores.
|
|
15
|
+
- `authentication(client).registerCustomer()`: shop sign-up (`POST /v1/authentication/customer/register`),
|
|
16
|
+
saves the session.
|
|
17
|
+
- `storefront` host key in `PRODUCTION_HOSTS` (`api.smess.vn`).
|
|
18
|
+
- `scripts/smoke-storefront.mjs`: read-only checks against a live storefront (`make smoke-storefront`).
|
|
19
|
+
|
|
5
20
|
## 2.1.0 (2026-11-07)
|
|
6
21
|
|
|
7
22
|
### Added
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ React Native.
|
|
|
7
7
|
- Built on `fetch`, no runtime dependencies, ESM, typed.
|
|
8
8
|
- One client per app: it knows core's hosts, the tenant header, the session and its refresh.
|
|
9
9
|
- One module per core-services Microservice: `authentication`, `sso`, `campaign`, `smeup-file`, `danara`,
|
|
10
|
-
`messenger`.
|
|
10
|
+
`messenger`, `storefront`, `storefront-admin`.
|
|
11
11
|
- One error type, `SmessApiError`, for every error format core emits.
|
|
12
12
|
|
|
13
13
|
Layers and the backend facts behind them: [docs/architecture.md](docs/architecture.md).
|
|
@@ -53,6 +53,28 @@ await forms.send({
|
|
|
53
53
|
});
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
+
### Online shop (Grand Paris Marché)
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import { createSmessClient, PRODUCTION_HOSTS, webStorageSession } from '@smess/networking';
|
|
60
|
+
import { authenticationRefresh } from '@smess/networking/authentication';
|
|
61
|
+
import { storefront } from '@smess/networking/storefront';
|
|
62
|
+
|
|
63
|
+
const smess = createSmessClient({
|
|
64
|
+
hosts: PRODUCTION_HOSTS,
|
|
65
|
+
clientId: SHOP_TENANT_ID, // scopes the catalog, stores and promos
|
|
66
|
+
session: webStorageSession(),
|
|
67
|
+
refresh: authenticationRefresh(),
|
|
68
|
+
});
|
|
69
|
+
const shop = storefront(smess, { storeId: () => selectedStoreId, cartToken: myCartTokenStore });
|
|
70
|
+
|
|
71
|
+
const page = await shop.products.list({ category: 'epice', per_page: 24 }); // Paginated<Product>
|
|
72
|
+
await shop.cart.addItem({ product_id: page.items[0].id, quantity: 1 }); // guest token kept for you
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The back office uses `storefrontAdmin(smess, { storeId })` from `@smess/networking/storefront-admin`
|
|
76
|
+
with a store employee's session.
|
|
77
|
+
|
|
56
78
|
### Tenant-scoped app, Next.js server component (Danara)
|
|
57
79
|
|
|
58
80
|
```ts
|
|
@@ -130,12 +152,14 @@ never sends one. smeup.email sends none (the tenant comes from the JWT); Danara
|
|
|
130
152
|
|
|
131
153
|
| Import | Backend module | Host key | Notes |
|
|
132
154
|
|---|---|---|---|
|
|
133
|
-
| `@smess/networking/authentication` | Authentication | `authentication` | password, OTP, refresh, reset, change password, logout |
|
|
155
|
+
| `@smess/networking/authentication` | Authentication | `authentication` | password, OTP, refresh, reset, change password, logout, shop customer sign-up |
|
|
134
156
|
| `@smess/networking/sso` | Sso | `sso` | `start`, `completeLogin(location.hash)`, `parseSsoCallback`, `readSsoError` |
|
|
135
157
|
| `@smess/networking/campaign` | Campaign (email) | `campaignApi` | the whole smeup.email API: sender, templates, campaigns, audiences, domains, addresses, short links, segments, automations, A/B tests, developers, SSO settings |
|
|
136
158
|
| `@smess/networking/smeup-file` | SMEUpFile | `smeupFile` | base64 upload |
|
|
137
159
|
| `@smess/networking/danara` | Danara | `danara` | identity, listings, sales, fit-out, leasing, owner portal, transit |
|
|
138
160
|
| `@smess/networking/messenger` | Messenger | `messenger` | website contact forms and leads (`send`), visitor events (`trackWebsiteEvent`) |
|
|
161
|
+
| `@smess/networking/storefront` | Storefront | `storefront` | shop customer side: catalog, stores, promos, cart (guest token as `X-Nonce-Token`), checkout, orders, profile and addresses, favorites, contact |
|
|
162
|
+
| `@smess/networking/storefront-admin` | Storefront (admin) | `storefront` | shop back office: products, orders (confirm, reject, status), promos, customers, search, stores |
|
|
139
163
|
| `@smess/networking/rx` | – | – | `fromSmess(signal => call)` → cancellable Observable (peer dep `rxjs`) |
|
|
140
164
|
|
|
141
165
|
Each module also exports its endpoint table (`campaignEmailEndpoints`, `danaraEndpoints`, …) and its
|
|
@@ -191,6 +215,7 @@ transformer or DTO, and a line in the route table snapshot (`test/__snapshots__`
|
|
|
191
215
|
make install # npm ci
|
|
192
216
|
make check # lint, typecheck, tests, build, publint
|
|
193
217
|
make smoke # read-only checks of the built package against PROD Danara (DANARA_CLIENT_ID=… make smoke)
|
|
218
|
+
make smoke-storefront # same against a PROD shop (STOREFRONT_CLIENT_ID=… make smoke-storefront)
|
|
194
219
|
```
|
|
195
220
|
|
|
196
221
|
Try a local build in an app without publishing: `npm pack`, then in the app
|
package/dist/core/hosts.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export declare const PRODUCTION_HOSTS: {
|
|
|
12
12
|
readonly smeupFile: "https://api.smess.vn";
|
|
13
13
|
/** `app.messenger_host`: public website forms and visitor events (`/v1/messenger/*`). */
|
|
14
14
|
readonly messenger: "https://api.smess.vn";
|
|
15
|
+
/** `app.storefront_host`: online shops, customer and back office (`/v1/storefront/*`). */
|
|
16
|
+
readonly storefront: "https://api.smess.vn";
|
|
15
17
|
/** `app.sso_host`: company single sign-on (`/v1/sso/*`). */
|
|
16
18
|
readonly sso: "https://sso.smess.vn";
|
|
17
19
|
/** `app.danara_host`: the Danara rentals API. */
|
package/dist/core/hosts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosts.d.ts","sourceRoot":"","sources":["../../src/core/hosts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;IAC3B,sEAAsE;;IAEtE,iFAAiF;;IAEjF,iEAAiE;;IAEjE,yFAAyF;;IAEzF,4DAA4D;;IAE5D,iDAAiD;;IAEjD,+CAA+C;;IAE/C,sEAAsE;;CAE9D,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAEvD,qHAAqH;AACrH,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"hosts.d.ts","sourceRoot":"","sources":["../../src/core/hosts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;IAC3B,sEAAsE;;IAEtE,iFAAiF;;IAEjF,iEAAiE;;IAEjE,yFAAyF;;IAEzF,0FAA0F;;IAE1F,4DAA4D;;IAE5D,iDAAiD;;IAEjD,+CAA+C;;IAE/C,sEAAsE;;CAE9D,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAEvD,qHAAqH;AACrH,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/core/hosts.js
CHANGED
|
@@ -12,6 +12,8 @@ export const PRODUCTION_HOSTS = {
|
|
|
12
12
|
smeupFile: 'https://api.smess.vn',
|
|
13
13
|
/** `app.messenger_host`: public website forms and visitor events (`/v1/messenger/*`). */
|
|
14
14
|
messenger: 'https://api.smess.vn',
|
|
15
|
+
/** `app.storefront_host`: online shops, customer and back office (`/v1/storefront/*`). */
|
|
16
|
+
storefront: 'https://api.smess.vn',
|
|
15
17
|
/** `app.sso_host`: company single sign-on (`/v1/sso/*`). */
|
|
16
18
|
sso: 'https://sso.smess.vn',
|
|
17
19
|
/** `app.danara_host`: the Danara rentals API. */
|
package/dist/core/hosts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosts.js","sourceRoot":"","sources":["../../src/core/hosts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,sEAAsE;IACtE,cAAc,EAAE,uBAAuB;IACvC,iFAAiF;IACjF,WAAW,EAAE,sBAAsB;IACnC,iEAAiE;IACjE,SAAS,EAAE,sBAAsB;IACjC,yFAAyF;IACzF,SAAS,EAAE,sBAAsB;IACjC,4DAA4D;IAC5D,GAAG,EAAE,sBAAsB;IAC3B,iDAAiD;IACjD,MAAM,EAAE,uBAAuB;IAC/B,+CAA+C;IAC/C,MAAM,EAAE,yBAAyB;IACjC,sEAAsE;IACtE,SAAS,EAAE,uBAAuB;CAC1B,CAAC"}
|
|
1
|
+
{"version":3,"file":"hosts.js","sourceRoot":"","sources":["../../src/core/hosts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,sEAAsE;IACtE,cAAc,EAAE,uBAAuB;IACvC,iFAAiF;IACjF,WAAW,EAAE,sBAAsB;IACnC,iEAAiE;IACjE,SAAS,EAAE,sBAAsB;IACjC,yFAAyF;IACzF,SAAS,EAAE,sBAAsB;IACjC,0FAA0F;IAC1F,UAAU,EAAE,sBAAsB;IAClC,4DAA4D;IAC5D,GAAG,EAAE,sBAAsB;IAC3B,iDAAiD;IACjD,MAAM,EAAE,uBAAuB;IAC/B,+CAA+C;IAC/C,MAAM,EAAE,yBAAyB;IACjC,sEAAsE;IACtE,SAAS,EAAE,uBAAuB;CAC1B,CAAC"}
|
|
@@ -38,6 +38,17 @@ export interface ResetPasswordInput {
|
|
|
38
38
|
token: string;
|
|
39
39
|
new_password: string;
|
|
40
40
|
}
|
|
41
|
+
/** `RegisterRequestDto`: a shop customer account for one tenant (an existing user gets a customer for it). */
|
|
42
|
+
export interface CustomerRegisterInput {
|
|
43
|
+
/** The tenant; defaults to the client's `clientId`. */
|
|
44
|
+
client_id?: string;
|
|
45
|
+
email: string;
|
|
46
|
+
password: string;
|
|
47
|
+
phone_number?: string | null;
|
|
48
|
+
name?: string | null;
|
|
49
|
+
address?: string | null;
|
|
50
|
+
tax_identification_number?: string | null;
|
|
51
|
+
}
|
|
41
52
|
export interface ChangePasswordInput {
|
|
42
53
|
old_password: string;
|
|
43
54
|
password: string;
|
|
@@ -53,6 +64,9 @@ export declare const authenticationEndpoints: {
|
|
|
53
64
|
readonly otpVerify: import("../../core/endpoint.js").Endpoint<"/v1/authentication/otp/verify", OtpVerifyInput, never, {
|
|
54
65
|
data: AuthenticationSucceeded | null;
|
|
55
66
|
}>;
|
|
67
|
+
readonly customerRegister: import("../../core/endpoint.js").Endpoint<"/v1/authentication/customer/register", CustomerRegisterInput, never, {
|
|
68
|
+
data: AuthenticationSucceeded | null;
|
|
69
|
+
}>;
|
|
56
70
|
readonly forgotPassword: import("../../core/endpoint.js").Endpoint<"/v1/authentication/forgot-password", IdentifierInput, never, undefined>;
|
|
57
71
|
readonly resetPassword: import("../../core/endpoint.js").Endpoint<"/v1/authentication/verify-reset-password-token", ResetPasswordInput, never, {
|
|
58
72
|
data: AuthenticationSucceeded | null;
|
|
@@ -74,6 +88,11 @@ export declare function authentication(client: SmessClient): {
|
|
|
74
88
|
/** Exchanges the code for a session. A wrong or expired code fails with `validation` / `invalid_code`. */
|
|
75
89
|
verify: (input: OtpVerifyInput) => Promise<Session>;
|
|
76
90
|
};
|
|
91
|
+
/**
|
|
92
|
+
* Creates a shop customer account for the tenant and signs in (`{data: {token, refreshToken}}`).
|
|
93
|
+
* Validation errors (blank email or password, bad `client_id`) are 400 `validation`.
|
|
94
|
+
*/
|
|
95
|
+
registerCustomer: (input: CustomerRegisterInput) => Promise<Session>;
|
|
77
96
|
/** Sends a reset link. Always succeeds. */
|
|
78
97
|
forgotPassword: (input: IdentifierInput) => Promise<undefined>;
|
|
79
98
|
/** Sets a new password from a reset-link token and signs in. A bad token fails with `invalid_reset_token`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/authentication/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAItD,uEAAuE;AACvE,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,mEAAmE;AACnE,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACzB,2FAA2F;IAC3F,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAMD,eAAO,MAAM,uBAAuB;;;uBAOkB,MAAM;;;;cAaxB,uBAAuB,GAAG,IAAI;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/authentication/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,KAAK,EAAE,eAA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cAMvB,uBAAuB,GAAG,IAAI;;;;cAajC,uBAAuB,GAAG,IAAI;;;;CAoB5D,CAAC;AAoBX,iHAAiH;AACjH,wBAAgB,qBAAqB,IAAI,eAAe,CAQvD;AAID,6GAA6G;AAC7G,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW;IAQ9C,sBAAsB;mBACD,UAAU;IAE/B,sGAAsG;6BACvE,MAAM;;QAOnC,qGAAqG;yBACpF,eAAe;QAChC,0GAA0G;wBACpF,cAAc;;IAItC;;;OAGG;8BAC6B,qBAAqB;IAMrD,2CAA2C;4BACnB,eAAe;IAEvC,8GAA8G;2BACjF,kBAAkB;4BAGvB,mBAAmB;IAE3C;;;OAGG;;EASN;AAED,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -29,6 +29,12 @@ export const authenticationEndpoints = {
|
|
|
29
29
|
path: '/v1/authentication/otp/verify',
|
|
30
30
|
auth: 'none',
|
|
31
31
|
}),
|
|
32
|
+
customerRegister: defineEndpoint()({
|
|
33
|
+
service: AUTH,
|
|
34
|
+
method: 'POST',
|
|
35
|
+
path: '/v1/authentication/customer/register',
|
|
36
|
+
auth: 'none',
|
|
37
|
+
}),
|
|
32
38
|
forgotPassword: defineEndpoint()({
|
|
33
39
|
service: AUTH,
|
|
34
40
|
method: 'POST',
|
|
@@ -106,6 +112,15 @@ export function authentication(client) {
|
|
|
106
112
|
/** Exchanges the code for a session. A wrong or expired code fails with `validation` / `invalid_code`. */
|
|
107
113
|
verify: async (input) => save(fromSucceeded(await client.call(e.otpVerify, { body: input }), 'invalid_code', 'The code is invalid or has expired.')),
|
|
108
114
|
},
|
|
115
|
+
/**
|
|
116
|
+
* Creates a shop customer account for the tenant and signs in (`{data: {token, refreshToken}}`).
|
|
117
|
+
* Validation errors (blank email or password, bad `client_id`) are 400 `validation`.
|
|
118
|
+
*/
|
|
119
|
+
registerCustomer: async (input) => {
|
|
120
|
+
const clientId = input.client_id ?? client.config.clientId;
|
|
121
|
+
const body = clientId ? { ...input, client_id: clientId } : input;
|
|
122
|
+
return save(fromSucceeded(await client.call(e.customerRegister, { body }), 'registration_failed', 'The account could not be created.'));
|
|
123
|
+
},
|
|
109
124
|
/** Sends a reset link. Always succeeds. */
|
|
110
125
|
forgotPassword: (input) => client.call(e.forgotPassword, { body: input }),
|
|
111
126
|
/** Sets a new password from a reset-link token and signs in. A bad token fails with `invalid_reset_token`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/authentication/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/authentication/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AA0DhE,yEAAyE;AAEzE,MAAM,IAAI,GAAG,gBAAyB,CAAC;AAEvC,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,KAAK,EAAE,cAAc,EAAyB,CAAC;QAC7C,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,gCAAgC;QACtC,IAAI,EAAE,MAAM;KACb,CAAC;IACF,OAAO,EAAE,cAAc,EAAwC,CAAC;QAC9D,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,kCAAkC;QACxC,IAAI,EAAE,MAAM;KACb,CAAC;IACF,UAAU,EAAE,cAAc,EAA8B,CAAC;QACvD,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,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,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YAC9B,CAAC;oBAAS,CAAC;gBACT,MAAM,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YAC/B,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storefront module, customer side (`src/Microservice/Storefront`, host `app.storefront_host` →
|
|
3
|
+
* api.smess.vn, prefix `/v1/storefront`).
|
|
4
|
+
*
|
|
5
|
+
* - The tenant is `X-Client-Id` (set `clientId` on the client): it scopes the catalog, the store list and
|
|
6
|
+
* promos, and picks the default store.
|
|
7
|
+
* - The store is `X-Store-Id` (numeric id or uuid). Without it the server uses the tenant's first store.
|
|
8
|
+
* Pass `storeId` to the module to pin one; it is sent on every call.
|
|
9
|
+
* - Guest carts are identified by a token the server returns as `cart.sessionToken`. While signed out the
|
|
10
|
+
* module sends it as `X-Nonce-Token` (the CORS allow-list has no `X-Session-Token`) and stores each new
|
|
11
|
+
* one in the `cartToken` store. Signed in, the cart belongs to the customer and no token is sent.
|
|
12
|
+
* - Catalog routes are anonymous (`auth: 'none'`): a stale Bearer would 401 them. Cart and checkout send
|
|
13
|
+
* the token when there is one (`optional`); customer and order routes need it (`required`).
|
|
14
|
+
* - Every response is `{data: …}` and is unwrapped; the page-number lists keep their `Paginated` envelope.
|
|
15
|
+
*/
|
|
16
|
+
import type { SmessClient } from '../../core/client.js';
|
|
17
|
+
import type { CallOptions } from '../../core/endpoint.js';
|
|
18
|
+
import type { MaybePromise } from '../../core/types.js';
|
|
19
|
+
import type { Acknowledged, AddFavoriteInput, AddToCartInput, AddressInput, CalculateShippingInput, Cart, CartBatchInput, Category, CheckoutInput, CheckoutValidation, CustomerProfile, FavoriteBatchInput, FavoriteBatchResult, FavoriteCategory, FavoriteCategoryRenamed, FavoriteProduct, FavoriteQuery, Order, OrderQuery, Paginated, Product, ProductQuery, Promo, PromoQuery, RecentSearch, RecentlyViewed, RenameFavoriteCategoryInput, Reorder, ShippingQuote, Store, StoreCustomerMetadata, StorefrontMessage, StorefrontMessageInput, TrackOrderInput, UpdateCartInput, UpdateCartItemInput, UpdateProfileInput } from './types.js';
|
|
20
|
+
export type * from './types.js';
|
|
21
|
+
export declare const storefrontEndpoints: {
|
|
22
|
+
readonly products: import("../../core/endpoint.js").Endpoint<"/v1/storefront/products/collection", never, ProductQuery, Paginated<Product>>;
|
|
23
|
+
/** Numeric id or slug. */
|
|
24
|
+
readonly product: import("../../core/endpoint.js").Endpoint<"/v1/storefront/products/{identifier}", never, never, Product>;
|
|
25
|
+
readonly categories: import("../../core/endpoint.js").Endpoint<"/v1/storefront/products/categories", never, never, Category[]>;
|
|
26
|
+
readonly stores: import("../../core/endpoint.js").Endpoint<"/v1/storefront/stores/list", never, never, Store[]>;
|
|
27
|
+
readonly store: import("../../core/endpoint.js").Endpoint<"/v1/storefront/stores/{uuid}/information", never, never, Store>;
|
|
28
|
+
readonly promos: import("../../core/endpoint.js").Endpoint<"/v1/storefront/promo/list", never, PromoQuery, Promo[]>;
|
|
29
|
+
readonly cart: import("../../core/endpoint.js").Endpoint<"/v1/storefront/cart", never, never, Cart>;
|
|
30
|
+
readonly updateCart: import("../../core/endpoint.js").Endpoint<"/v1/storefront/cart", UpdateCartInput, never, Cart>;
|
|
31
|
+
readonly addToCart: import("../../core/endpoint.js").Endpoint<"/v1/storefront/cart/items", AddToCartInput, never, Cart>;
|
|
32
|
+
readonly batchCartItems: import("../../core/endpoint.js").Endpoint<"/v1/storefront/cart/items/batch", CartBatchInput, never, Cart>;
|
|
33
|
+
readonly updateCartItem: import("../../core/endpoint.js").Endpoint<"/v1/storefront/cart/items/{cartItemId}", UpdateCartItemInput, never, Cart>;
|
|
34
|
+
readonly removeCartItem: import("../../core/endpoint.js").Endpoint<"/v1/storefront/cart/items/{cartItemId}", never, never, Cart | null>;
|
|
35
|
+
readonly clearCart: import("../../core/endpoint.js").Endpoint<"/v1/storefront/cart/items", never, never, Cart>;
|
|
36
|
+
readonly calculateShipping: import("../../core/endpoint.js").Endpoint<"/v1/storefront/cart/calculate-shipping", CalculateShippingInput, never, ShippingQuote>;
|
|
37
|
+
readonly validateCheckout: import("../../core/endpoint.js").Endpoint<"/v1/storefront/checkout/validate", never, never, CheckoutValidation>;
|
|
38
|
+
readonly checkout: import("../../core/endpoint.js").Endpoint<"/v1/storefront/checkout/process", CheckoutInput, never, Order>;
|
|
39
|
+
readonly orders: import("../../core/endpoint.js").Endpoint<"/v1/storefront/orders/collection", never, OrderQuery, Paginated<Order>>;
|
|
40
|
+
readonly order: import("../../core/endpoint.js").Endpoint<"/v1/storefront/orders/{id}", never, never, Order>;
|
|
41
|
+
readonly trackOrder: import("../../core/endpoint.js").Endpoint<"/v1/storefront/orders/track", TrackOrderInput, never, Order>;
|
|
42
|
+
readonly reorder: import("../../core/endpoint.js").Endpoint<"/v1/storefront/orders/{id}/reorder", never, never, Reorder>;
|
|
43
|
+
readonly cancelOrder: import("../../core/endpoint.js").Endpoint<"/v1/storefront/orders/{id}/cancel", never, never, Order>;
|
|
44
|
+
readonly profile: import("../../core/endpoint.js").Endpoint<"/v1/storefront/customer/profile", never, never, CustomerProfile>;
|
|
45
|
+
readonly updateProfile: import("../../core/endpoint.js").Endpoint<"/v1/storefront/customer/profile", UpdateProfileInput, never, CustomerProfile>;
|
|
46
|
+
readonly saveShippingAddress: import("../../core/endpoint.js").Endpoint<"/v1/storefront/customer/shipping-addresses", AddressInput, never, CustomerProfile>;
|
|
47
|
+
readonly deleteShippingAddress: import("../../core/endpoint.js").Endpoint<"/v1/storefront/customer/shipping-addresses/{id}", never, never, CustomerProfile>;
|
|
48
|
+
readonly saveBillingAddress: import("../../core/endpoint.js").Endpoint<"/v1/storefront/customer/billing-addresses", AddressInput, never, CustomerProfile>;
|
|
49
|
+
readonly deleteBillingAddress: import("../../core/endpoint.js").Endpoint<"/v1/storefront/customer/billing-addresses/{id}", never, never, CustomerProfile>;
|
|
50
|
+
readonly metadata: import("../../core/endpoint.js").Endpoint<"/v1/storefront/customer/metadata", never, never, StoreCustomerMetadata>;
|
|
51
|
+
readonly updatePreferences: import("../../core/endpoint.js").Endpoint<"/v1/storefront/customer/preferences", {
|
|
52
|
+
preferences: Record<string, unknown>;
|
|
53
|
+
}, never, StoreCustomerMetadata>;
|
|
54
|
+
readonly recordProductView: import("../../core/endpoint.js").Endpoint<"/v1/storefront/customer/product-view", {
|
|
55
|
+
product_id: number;
|
|
56
|
+
}, never, Acknowledged>;
|
|
57
|
+
readonly recentSearches: import("../../core/endpoint.js").Endpoint<"/v1/storefront/customer/recent-searches", never, never, RecentSearch[]>;
|
|
58
|
+
readonly recentlyViewed: import("../../core/endpoint.js").Endpoint<"/v1/storefront/customer/recently-viewed", never, {
|
|
59
|
+
limit?: number;
|
|
60
|
+
}, RecentlyViewed[]>;
|
|
61
|
+
readonly favorites: import("../../core/endpoint.js").Endpoint<"/v1/storefront/customer/favorites/collection", never, FavoriteQuery, Paginated<FavoriteProduct>>;
|
|
62
|
+
readonly addFavorite: import("../../core/endpoint.js").Endpoint<"/v1/storefront/customer/favorites", AddFavoriteInput, never, FavoriteProduct>;
|
|
63
|
+
readonly renameFavoriteCategory: import("../../core/endpoint.js").Endpoint<"/v1/storefront/customer/favorites/category", RenameFavoriteCategoryInput, never, FavoriteCategoryRenamed>;
|
|
64
|
+
readonly removeFavorite: import("../../core/endpoint.js").Endpoint<"/v1/storefront/customer/favorites/{productId}", never, never, Acknowledged>;
|
|
65
|
+
readonly favoriteCategories: import("../../core/endpoint.js").Endpoint<"/v1/storefront/customer/favorites/categories", never, never, FavoriteCategory[]>;
|
|
66
|
+
readonly batchFavorites: import("../../core/endpoint.js").Endpoint<"/v1/storefront/customer/favorites-batch", FavoriteBatchInput, never, FavoriteBatchResult>;
|
|
67
|
+
readonly sendMessage: import("../../core/endpoint.js").Endpoint<"/v1/storefront/messenger/send", StorefrontMessageInput, never, StorefrontMessage>;
|
|
68
|
+
};
|
|
69
|
+
/** Where the guest cart token lives between calls. */
|
|
70
|
+
export interface CartTokenStore {
|
|
71
|
+
get(): MaybePromise<string | null | undefined>;
|
|
72
|
+
set(token: string | null): MaybePromise<void>;
|
|
73
|
+
}
|
|
74
|
+
/** A cart token kept in memory (lost on reload). */
|
|
75
|
+
export declare function memoryCartToken(initial?: string | null): CartTokenStore;
|
|
76
|
+
export interface StorefrontOptions {
|
|
77
|
+
/** `X-Store-Id` on every call: a numeric store id or uuid, or a function read per call. */
|
|
78
|
+
storeId?: string | number | (() => string | number | null | undefined) | null | undefined;
|
|
79
|
+
/** The guest cart token store. Default: in memory. */
|
|
80
|
+
cartToken?: CartTokenStore | undefined;
|
|
81
|
+
}
|
|
82
|
+
export declare function storefront(client: SmessClient, options?: StorefrontOptions): {
|
|
83
|
+
products: {
|
|
84
|
+
list: (query?: ProductQuery, o?: CallOptions) => Promise<Paginated<Product>>;
|
|
85
|
+
/** By numeric id or slug. */
|
|
86
|
+
get: (identifier: string | number, o?: CallOptions) => Promise<Product>;
|
|
87
|
+
/** Category counts of the whole catalog. */
|
|
88
|
+
categories: (o?: CallOptions) => Promise<Category[]>;
|
|
89
|
+
};
|
|
90
|
+
stores: {
|
|
91
|
+
/** The tenant's stores (every active store without a tenant). */
|
|
92
|
+
list: (o?: CallOptions) => Promise<Store[]>;
|
|
93
|
+
/** One store with its shipping rules. */
|
|
94
|
+
get: (uuid: string, o?: CallOptions) => Promise<Store>;
|
|
95
|
+
};
|
|
96
|
+
promos: {
|
|
97
|
+
list: (query?: PromoQuery, o?: CallOptions) => Promise<Promo[]>;
|
|
98
|
+
};
|
|
99
|
+
cart: {
|
|
100
|
+
/** The current cart; a guest call without a token starts a new draft cart. */
|
|
101
|
+
get: (o?: CallOptions) => Promise<Cart>;
|
|
102
|
+
/** Notes, delivery fee and contact blocks. */
|
|
103
|
+
update: (input: UpdateCartInput, o?: CallOptions) => Promise<Cart>;
|
|
104
|
+
/** Adds a product (201). The guest token goes in the body, as the route reads it there. */
|
|
105
|
+
addItem: (input: AddToCartInput, o?: CallOptions) => Promise<Cart>;
|
|
106
|
+
/** Adds and updates by product id in one call; updates win over adds for the same product. */
|
|
107
|
+
batch: (input: CartBatchInput, o?: CallOptions) => Promise<Cart>;
|
|
108
|
+
updateItem: (cartItemId: string | number, input: UpdateCartItemInput, o?: CallOptions) => Promise<Cart>;
|
|
109
|
+
removeItem: (cartItemId: string | number, o?: CallOptions) => Promise<Cart | null>;
|
|
110
|
+
/** Removes every item. */
|
|
111
|
+
clear: (o?: CallOptions) => Promise<Cart>;
|
|
112
|
+
/** Needs a cart (token or session) and a store, otherwise 400. */
|
|
113
|
+
calculateShipping: (input: CalculateShippingInput, o?: CallOptions) => Promise<ShippingQuote>;
|
|
114
|
+
/** The guest cart token store, e.g. to forget the cart after an order. */
|
|
115
|
+
token: CartTokenStore;
|
|
116
|
+
};
|
|
117
|
+
checkout: {
|
|
118
|
+
validate: (o?: CallOptions) => Promise<CheckoutValidation>;
|
|
119
|
+
/** Places the order from `items` (201). `clientSecret` is set when the payment needs a confirmation. */
|
|
120
|
+
process: (input: CheckoutInput, o?: CallOptions) => Promise<Order>;
|
|
121
|
+
};
|
|
122
|
+
orders: {
|
|
123
|
+
list: (query?: OrderQuery, o?: CallOptions) => Promise<Paginated<Order>>;
|
|
124
|
+
get: (id: string | number, o?: CallOptions) => Promise<Order>;
|
|
125
|
+
track: (input: TrackOrderInput, o?: CallOptions) => Promise<Order>;
|
|
126
|
+
/** The order's products as they are now, ready to add to the cart. */
|
|
127
|
+
reorder: (id: string | number, o?: CallOptions) => Promise<Reorder>;
|
|
128
|
+
cancel: (id: string | number, o?: CallOptions) => Promise<Order>;
|
|
129
|
+
};
|
|
130
|
+
customer: {
|
|
131
|
+
/** Also counts a visit to the store when one is set. */
|
|
132
|
+
profile: (o?: CallOptions) => Promise<CustomerProfile>;
|
|
133
|
+
updateProfile: (input: UpdateProfileInput, o?: CallOptions) => Promise<CustomerProfile>;
|
|
134
|
+
/** Creates the address, or updates it when `id` is set. Returns the whole profile. */
|
|
135
|
+
saveShippingAddress: (input: AddressInput, o?: CallOptions) => Promise<CustomerProfile>;
|
|
136
|
+
deleteShippingAddress: (id: string | number, o?: CallOptions) => Promise<CustomerProfile>;
|
|
137
|
+
saveBillingAddress: (input: AddressInput, o?: CallOptions) => Promise<CustomerProfile>;
|
|
138
|
+
deleteBillingAddress: (id: string | number, o?: CallOptions) => Promise<CustomerProfile>;
|
|
139
|
+
/** The customer's stats in the current store (needs a store). */
|
|
140
|
+
metadata: (o?: CallOptions) => Promise<StoreCustomerMetadata>;
|
|
141
|
+
updatePreferences: (preferences: Record<string, unknown>, o?: CallOptions) => Promise<StoreCustomerMetadata>;
|
|
142
|
+
recordProductView: (productId: number, o?: CallOptions) => Promise<Acknowledged>;
|
|
143
|
+
recentSearches: (o?: CallOptions) => Promise<RecentSearch[]>;
|
|
144
|
+
/** Default limit 100. */
|
|
145
|
+
recentlyViewed: (limit?: number, o?: CallOptions) => Promise<RecentlyViewed[]>;
|
|
146
|
+
};
|
|
147
|
+
favorites: {
|
|
148
|
+
list: (query?: FavoriteQuery, o?: CallOptions) => Promise<Paginated<FavoriteProduct>>;
|
|
149
|
+
/** 201. */
|
|
150
|
+
add: (input: AddFavoriteInput, o?: CallOptions) => Promise<FavoriteProduct>;
|
|
151
|
+
renameCategory: (input: RenameFavoriteCategoryInput, o?: CallOptions) => Promise<FavoriteCategoryRenamed>;
|
|
152
|
+
remove: (productId: string | number, o?: CallOptions) => Promise<Acknowledged>;
|
|
153
|
+
categories: (o?: CallOptions) => Promise<FavoriteCategory[]>;
|
|
154
|
+
batch: (input: FavoriteBatchInput, o?: CallOptions) => Promise<FavoriteBatchResult>;
|
|
155
|
+
};
|
|
156
|
+
/** A contact message for the tenant (needs `clientId`). */
|
|
157
|
+
sendMessage: (input: StorefrontMessageInput, o?: CallOptions) => Promise<StorefrontMessage>;
|
|
158
|
+
};
|
|
159
|
+
export type StorefrontModule = ReturnType<typeof storefront>;
|
|
160
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/storefront/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,KAAK,EAAE,WAAW,EAAQ,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAwB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,IAAI,EACJ,cAAc,EACd,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,aAAa,EACb,KAAK,EACL,UAAU,EACV,SAAS,EACT,OAAO,EACP,YAAY,EACZ,KAAK,EACL,UAAU,EACV,YAAY,EACZ,cAAc,EACd,2BAA2B,EAC3B,OAAO,EACP,aAAa,EACb,KAAK,EACL,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,mBAAmB,YAAY,CAAC;AAShC,eAAO,MAAM,mBAAmB;;IAE9B,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA+BqC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;oBACxB,MAAM;;;;gBAOZ,MAAM;;;;;;;;;CAsBtD,CAAC;AAEX,sDAAsD;AACtD,MAAM,WAAW,cAAc;IAC7B,GAAG,IAAI,YAAY,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;IAC/C,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,YAAY,CAAC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D;sBAC1C,WAAW;+BACF,kBAAkB,MAAM,WAAW;QAC1D,sFAAsF;qCACzD,YAAY,MAAM,WAAW;oCAC9B,MAAM,GAAG,MAAM,MAAM,WAAW;oCAChC,YAAY,MAAM,WAAW;mCAC9B,MAAM,GAAG,MAAM,MAAM,WAAW;QAC3D,iEAAiE;uBAClD,WAAW;yCACO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,WAAW;uCAE1C,MAAM,MAAM,WAAW;6BAEjC,WAAW;QAChC,yBAAyB;iCACA,MAAM,MAAM,WAAW;;;uBAKjC,aAAa,MAAM,WAAW;QAC7C,WAAW;qBACE,gBAAgB,MAAM,WAAW;gCACtB,2BAA2B,MAAM,WAAW;4BAEhD,MAAM,GAAG,MAAM,MAAM,WAAW;yBACnC,WAAW;uBACb,kBAAkB,MAAM,WAAW;;IAGpD,2DAA2D;yBACtC,sBAAsB,MAAM,WAAW;EAE/D;AAED,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { unwrapData } from '../../core/decoders.js';
|
|
2
|
+
import { defineEndpoint } from '../../core/endpoint.js';
|
|
3
|
+
const route = () => (method, path, auth) => defineEndpoint()({ service: 'storefront', method, path, auth, decode: unwrapData });
|
|
4
|
+
const P = '/v1/storefront';
|
|
5
|
+
export const storefrontEndpoints = {
|
|
6
|
+
products: route()('GET', `${P}/products/collection`, 'none'),
|
|
7
|
+
/** Numeric id or slug. */
|
|
8
|
+
product: route()('GET', `${P}/products/{identifier}`, 'none'),
|
|
9
|
+
categories: route()('GET', `${P}/products/categories`, 'none'),
|
|
10
|
+
stores: route()('GET', `${P}/stores/list`, 'none'),
|
|
11
|
+
store: route()('GET', `${P}/stores/{uuid}/information`, 'none'),
|
|
12
|
+
promos: route()('GET', `${P}/promo/list`, 'none'),
|
|
13
|
+
cart: route()('GET', `${P}/cart`, 'optional'),
|
|
14
|
+
updateCart: route()('PUT', `${P}/cart`, 'optional'),
|
|
15
|
+
addToCart: route()('POST', `${P}/cart/items`, 'optional'),
|
|
16
|
+
batchCartItems: route()('POST', `${P}/cart/items/batch`, 'optional'),
|
|
17
|
+
updateCartItem: route()('PUT', `${P}/cart/items/{cartItemId}`, 'optional'),
|
|
18
|
+
removeCartItem: route()('DELETE', `${P}/cart/items/{cartItemId}`, 'optional'),
|
|
19
|
+
clearCart: route()('DELETE', `${P}/cart/items`, 'optional'),
|
|
20
|
+
calculateShipping: route()('POST', `${P}/cart/calculate-shipping`, 'optional'),
|
|
21
|
+
validateCheckout: route()('POST', `${P}/checkout/validate`, 'optional'),
|
|
22
|
+
checkout: route()('POST', `${P}/checkout/process`, 'optional'),
|
|
23
|
+
orders: route()('GET', `${P}/orders/collection`, 'required'),
|
|
24
|
+
order: route()('GET', `${P}/orders/{id}`, 'required'),
|
|
25
|
+
trackOrder: route()('POST', `${P}/orders/track`, 'required'),
|
|
26
|
+
reorder: route()('POST', `${P}/orders/{id}/reorder`, 'required'),
|
|
27
|
+
cancelOrder: route()('POST', `${P}/orders/{id}/cancel`, 'required'),
|
|
28
|
+
profile: route()('GET', `${P}/customer/profile`, 'required'),
|
|
29
|
+
updateProfile: route()('PUT', `${P}/customer/profile`, 'required'),
|
|
30
|
+
saveShippingAddress: route()('POST', `${P}/customer/shipping-addresses`, 'required'),
|
|
31
|
+
deleteShippingAddress: route()('DELETE', `${P}/customer/shipping-addresses/{id}`, 'required'),
|
|
32
|
+
saveBillingAddress: route()('POST', `${P}/customer/billing-addresses`, 'required'),
|
|
33
|
+
deleteBillingAddress: route()('DELETE', `${P}/customer/billing-addresses/{id}`, 'required'),
|
|
34
|
+
metadata: route()('GET', `${P}/customer/metadata`, 'required'),
|
|
35
|
+
updatePreferences: route()('PUT', `${P}/customer/preferences`, 'required'),
|
|
36
|
+
recordProductView: defineEndpoint()({
|
|
37
|
+
service: 'storefront',
|
|
38
|
+
method: 'POST',
|
|
39
|
+
path: `${P}/customer/product-view`,
|
|
40
|
+
auth: 'required',
|
|
41
|
+
}),
|
|
42
|
+
recentSearches: route()('GET', `${P}/customer/recent-searches`, 'required'),
|
|
43
|
+
recentlyViewed: route()('GET', `${P}/customer/recently-viewed`, 'required'),
|
|
44
|
+
favorites: route()('GET', `${P}/customer/favorites/collection`, 'required'),
|
|
45
|
+
addFavorite: route()('POST', `${P}/customer/favorites`, 'required'),
|
|
46
|
+
renameFavoriteCategory: route()('PUT', `${P}/customer/favorites/category`, 'required'),
|
|
47
|
+
removeFavorite: defineEndpoint()({
|
|
48
|
+
service: 'storefront',
|
|
49
|
+
method: 'DELETE',
|
|
50
|
+
path: `${P}/customer/favorites/{productId}`,
|
|
51
|
+
auth: 'required',
|
|
52
|
+
}),
|
|
53
|
+
favoriteCategories: route()('GET', `${P}/customer/favorites/categories`, 'required'),
|
|
54
|
+
batchFavorites: route()('POST', `${P}/customer/favorites-batch`, 'required'),
|
|
55
|
+
sendMessage: defineEndpoint()({
|
|
56
|
+
service: 'storefront',
|
|
57
|
+
method: 'POST',
|
|
58
|
+
path: `${P}/messenger/send`,
|
|
59
|
+
auth: 'none',
|
|
60
|
+
requiresTenant: true,
|
|
61
|
+
decode: unwrapData,
|
|
62
|
+
}),
|
|
63
|
+
};
|
|
64
|
+
/** A cart token kept in memory (lost on reload). */
|
|
65
|
+
export function memoryCartToken(initial = null) {
|
|
66
|
+
let token = initial;
|
|
67
|
+
return {
|
|
68
|
+
get: () => token,
|
|
69
|
+
set: (next) => {
|
|
70
|
+
token = next;
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export function storefront(client, options = {}) {
|
|
75
|
+
const e = storefrontEndpoints;
|
|
76
|
+
const cartToken = options.cartToken ?? memoryCartToken();
|
|
77
|
+
const storeHeader = () => {
|
|
78
|
+
const raw = typeof options.storeId === 'function' ? options.storeId() : options.storeId;
|
|
79
|
+
return raw === undefined || raw === null || raw === '' ? {} : { 'X-Store-Id': String(raw) };
|
|
80
|
+
};
|
|
81
|
+
/** Per-call options with the store header (call headers win). */
|
|
82
|
+
const scoped = (o) => ({ ...o, headers: { ...storeHeader(), ...o?.headers } });
|
|
83
|
+
/** Store scope plus, while signed out, the guest cart token. */
|
|
84
|
+
const cartScoped = async (o) => {
|
|
85
|
+
const signedIn = (await client.session.get()) !== null;
|
|
86
|
+
const token = signedIn ? null : await cartToken.get();
|
|
87
|
+
return { ...o, headers: { ...storeHeader(), ...(token ? { 'X-Nonce-Token': token } : {}), ...o?.headers } };
|
|
88
|
+
};
|
|
89
|
+
const keepToken = async (cart) => {
|
|
90
|
+
if (cart?.sessionToken && cart.sessionToken !== (await cartToken.get()))
|
|
91
|
+
await cartToken.set(cart.sessionToken);
|
|
92
|
+
return cart;
|
|
93
|
+
};
|
|
94
|
+
return {
|
|
95
|
+
products: {
|
|
96
|
+
list: (query, o) => client.call(e.products, { ...scoped(o), query }),
|
|
97
|
+
/** By numeric id or slug. */
|
|
98
|
+
get: (identifier, o) => client.call(e.product, { ...scoped(o), path: { identifier } }),
|
|
99
|
+
/** Category counts of the whole catalog. */
|
|
100
|
+
categories: (o) => client.call(e.categories, scoped(o)),
|
|
101
|
+
},
|
|
102
|
+
stores: {
|
|
103
|
+
/** The tenant's stores (every active store without a tenant). */
|
|
104
|
+
list: (o) => client.call(e.stores, scoped(o)),
|
|
105
|
+
/** One store with its shipping rules. */
|
|
106
|
+
get: (uuid, o) => client.call(e.store, { ...scoped(o), path: { uuid } }),
|
|
107
|
+
},
|
|
108
|
+
promos: {
|
|
109
|
+
list: (query, o) => client.call(e.promos, { ...scoped(o), query }),
|
|
110
|
+
},
|
|
111
|
+
cart: {
|
|
112
|
+
/** The current cart; a guest call without a token starts a new draft cart. */
|
|
113
|
+
get: async (o) => keepToken(await client.call(e.cart, await cartScoped(o))),
|
|
114
|
+
/** Notes, delivery fee and contact blocks. */
|
|
115
|
+
update: async (input, o) => keepToken(await client.call(e.updateCart, { ...(await cartScoped(o)), body: input })),
|
|
116
|
+
/** Adds a product (201). The guest token goes in the body, as the route reads it there. */
|
|
117
|
+
addItem: async (input, o) => {
|
|
118
|
+
const scope = await cartScoped(o);
|
|
119
|
+
const token = input.session_token ?? scope.headers?.['X-Nonce-Token'];
|
|
120
|
+
return keepToken(await client.call(e.addToCart, { ...scope, body: token ? { ...input, session_token: token } : input }));
|
|
121
|
+
},
|
|
122
|
+
/** Adds and updates by product id in one call; updates win over adds for the same product. */
|
|
123
|
+
batch: async (input, o) => keepToken(await client.call(e.batchCartItems, { ...(await cartScoped(o)), body: input })),
|
|
124
|
+
updateItem: async (cartItemId, input, o) => keepToken(await client.call(e.updateCartItem, { ...(await cartScoped(o)), path: { cartItemId }, body: input })),
|
|
125
|
+
removeItem: async (cartItemId, o) => keepToken(await client.call(e.removeCartItem, { ...(await cartScoped(o)), path: { cartItemId } })),
|
|
126
|
+
/** Removes every item. */
|
|
127
|
+
clear: async (o) => keepToken(await client.call(e.clearCart, await cartScoped(o))),
|
|
128
|
+
/** Needs a cart (token or session) and a store, otherwise 400. */
|
|
129
|
+
calculateShipping: async (input, o) => client.call(e.calculateShipping, { ...(await cartScoped(o)), body: input }),
|
|
130
|
+
/** The guest cart token store, e.g. to forget the cart after an order. */
|
|
131
|
+
token: cartToken,
|
|
132
|
+
},
|
|
133
|
+
checkout: {
|
|
134
|
+
validate: async (o) => client.call(e.validateCheckout, await cartScoped(o)),
|
|
135
|
+
/** Places the order from `items` (201). `clientSecret` is set when the payment needs a confirmation. */
|
|
136
|
+
process: async (input, o) => client.call(e.checkout, { ...(await cartScoped(o)), body: input }),
|
|
137
|
+
},
|
|
138
|
+
orders: {
|
|
139
|
+
list: (query, o) => client.call(e.orders, { ...scoped(o), query }),
|
|
140
|
+
get: (id, o) => client.call(e.order, { ...scoped(o), path: { id } }),
|
|
141
|
+
track: (input, o) => client.call(e.trackOrder, { ...scoped(o), body: input }),
|
|
142
|
+
/** The order's products as they are now, ready to add to the cart. */
|
|
143
|
+
reorder: (id, o) => client.call(e.reorder, { ...scoped(o), path: { id } }),
|
|
144
|
+
cancel: (id, o) => client.call(e.cancelOrder, { ...scoped(o), path: { id } }),
|
|
145
|
+
},
|
|
146
|
+
customer: {
|
|
147
|
+
/** Also counts a visit to the store when one is set. */
|
|
148
|
+
profile: (o) => client.call(e.profile, scoped(o)),
|
|
149
|
+
updateProfile: (input, o) => client.call(e.updateProfile, { ...scoped(o), body: input }),
|
|
150
|
+
/** Creates the address, or updates it when `id` is set. Returns the whole profile. */
|
|
151
|
+
saveShippingAddress: (input, o) => client.call(e.saveShippingAddress, { ...scoped(o), body: input }),
|
|
152
|
+
deleteShippingAddress: (id, o) => client.call(e.deleteShippingAddress, { ...scoped(o), path: { id } }),
|
|
153
|
+
saveBillingAddress: (input, o) => client.call(e.saveBillingAddress, { ...scoped(o), body: input }),
|
|
154
|
+
deleteBillingAddress: (id, o) => client.call(e.deleteBillingAddress, { ...scoped(o), path: { id } }),
|
|
155
|
+
/** The customer's stats in the current store (needs a store). */
|
|
156
|
+
metadata: (o) => client.call(e.metadata, scoped(o)),
|
|
157
|
+
updatePreferences: (preferences, o) => client.call(e.updatePreferences, { ...scoped(o), body: { preferences } }),
|
|
158
|
+
recordProductView: (productId, o) => client.call(e.recordProductView, { ...scoped(o), body: { product_id: productId } }),
|
|
159
|
+
recentSearches: (o) => client.call(e.recentSearches, scoped(o)),
|
|
160
|
+
/** Default limit 100. */
|
|
161
|
+
recentlyViewed: (limit, o) => client.call(e.recentlyViewed, { ...scoped(o), query: limit === undefined ? undefined : { limit } }),
|
|
162
|
+
},
|
|
163
|
+
favorites: {
|
|
164
|
+
list: (query, o) => client.call(e.favorites, { ...scoped(o), query }),
|
|
165
|
+
/** 201. */
|
|
166
|
+
add: (input, o) => client.call(e.addFavorite, { ...scoped(o), body: input }),
|
|
167
|
+
renameCategory: (input, o) => client.call(e.renameFavoriteCategory, { ...scoped(o), body: input }),
|
|
168
|
+
remove: (productId, o) => client.call(e.removeFavorite, { ...scoped(o), path: { productId } }),
|
|
169
|
+
categories: (o) => client.call(e.favoriteCategories, scoped(o)),
|
|
170
|
+
batch: (input, o) => client.call(e.batchFavorites, { ...scoped(o), body: input }),
|
|
171
|
+
},
|
|
172
|
+
/** A contact message for the tenant (needs `clientId`). */
|
|
173
|
+
sendMessage: (input, o) => client.call(e.sendMessage, { ...scoped(o), body: input }),
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/storefront/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AA6CxD,MAAM,KAAK,GACT,GAAyC,EAAE,CAC3C,CAAyB,MAAkB,EAAE,IAAO,EAAE,IAAc,EAAE,EAAE,CACtE,cAAc,EAA0B,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;AAEhH,MAAM,CAAC,GAAG,gBAAyB,CAAC;AAEpC,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,QAAQ,EAAE,KAAK,EAA0C,CAAC,KAAK,EAAE,GAAG,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACpG,0BAA0B;IAC1B,OAAO,EAAE,KAAK,EAAW,CAAC,KAAK,EAAE,GAAG,CAAC,wBAAwB,EAAE,MAAM,CAAC;IACtE,UAAU,EAAE,KAAK,EAAc,CAAC,KAAK,EAAE,GAAG,CAAC,sBAAsB,EAAE,MAAM,CAAC;IAC1E,MAAM,EAAE,KAAK,EAAW,CAAC,KAAK,EAAE,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC;IAC3D,KAAK,EAAE,KAAK,EAAS,CAAC,KAAK,EAAE,GAAG,CAAC,4BAA4B,EAAE,MAAM,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