@asstio-dev/storefront 0.54.0 → 0.55.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/README.md +107 -0
- package/dist/account/cookies.d.ts +12 -0
- package/dist/account/cookies.js +6 -0
- package/dist/account/index.d.ts +1 -1
- package/dist/account/index.js +1 -1
- package/dist/account/next.d.ts +34 -4
- package/dist/account/next.js +154 -28
- package/dist/attribution/browser.d.ts +35 -0
- package/dist/attribution/browser.js +63 -0
- package/dist/attribution/codec.d.ts +76 -0
- package/dist/attribution/codec.js +466 -0
- package/dist/attribution/index.d.ts +8 -0
- package/dist/attribution/index.js +8 -0
- package/dist/attribution/next.d.ts +76 -0
- package/dist/attribution/next.js +239 -0
- package/dist/checkout/server.d.ts +6 -0
- package/dist/checkout/server.js +2 -2
- package/dist/consent/index.d.ts +1 -1
- package/dist/consent/index.js +1 -1
- package/dist/consent/notice.d.ts +7 -0
- package/dist/consent/notice.js +36 -0
- package/dist/consent/server.d.ts +9 -1
- package/dist/consent/server.js +1 -0
- package/dist/schema.d.ts +148 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +13 -4
- package/src/schema.d.ts +148 -0
package/src/schema.d.ts
CHANGED
|
@@ -237,6 +237,26 @@ export interface paths {
|
|
|
237
237
|
patch?: never;
|
|
238
238
|
trace?: never;
|
|
239
239
|
};
|
|
240
|
+
"/v1/checkout/attribution": {
|
|
241
|
+
parameters: {
|
|
242
|
+
query?: never;
|
|
243
|
+
header?: never;
|
|
244
|
+
path?: never;
|
|
245
|
+
cookie?: never;
|
|
246
|
+
};
|
|
247
|
+
get?: never;
|
|
248
|
+
put?: never;
|
|
249
|
+
post?: never;
|
|
250
|
+
/**
|
|
251
|
+
* Drop the cart's order-source touches
|
|
252
|
+
* @description Called when the shopper withdraws measurement consent: every checkout of the cart that has no order yet keeps no touches, and so does any checkout the cart starts later. No body. It never starts a checkout and never contacts a payment provider. A missing or unknown cart answers 204 too (nothing to do, and nothing to tell). No X-Market, X-Country or X-Locale is needed; the route works on a paused site. Publishable or server key only. On 503 retry: the clear is idempotent.
|
|
253
|
+
*/
|
|
254
|
+
delete: operations["ClearCheckoutAttribution"];
|
|
255
|
+
options?: never;
|
|
256
|
+
head?: never;
|
|
257
|
+
patch?: never;
|
|
258
|
+
trace?: never;
|
|
259
|
+
};
|
|
240
260
|
"/v1/checkout/{attemptId}": {
|
|
241
261
|
parameters: {
|
|
242
262
|
query?: never;
|
|
@@ -2173,6 +2193,21 @@ export interface components {
|
|
|
2173
2193
|
consumer: boolean;
|
|
2174
2194
|
paths: components["schemas"]["AccountPathsDto"];
|
|
2175
2195
|
};
|
|
2196
|
+
SiteAttributionDto: {
|
|
2197
|
+
checkoutPaths: string[];
|
|
2198
|
+
dropPaths: string[];
|
|
2199
|
+
enabled: boolean;
|
|
2200
|
+
ignoreReferrerHosts: string[];
|
|
2201
|
+
/** Format: int32 */
|
|
2202
|
+
lookbackDays: number | string;
|
|
2203
|
+
/** Format: int32 */
|
|
2204
|
+
minNoticeVersion: number | null | string;
|
|
2205
|
+
touches: components["schemas"]["SiteAttributionTouchesDto"];
|
|
2206
|
+
};
|
|
2207
|
+
SiteAttributionTouchesDto: {
|
|
2208
|
+
content: boolean;
|
|
2209
|
+
term: boolean;
|
|
2210
|
+
};
|
|
2176
2211
|
SiteCapabilitiesDto: {
|
|
2177
2212
|
checkout: boolean;
|
|
2178
2213
|
priceQueries: boolean;
|
|
@@ -2180,6 +2215,7 @@ export interface components {
|
|
|
2180
2215
|
};
|
|
2181
2216
|
SiteDto: {
|
|
2182
2217
|
accounts: null | components["schemas"]["SiteAccountsDto"];
|
|
2218
|
+
attribution?: null | components["schemas"]["SiteAttributionDto"];
|
|
2183
2219
|
bindings: components["schemas"]["BindingDto"][];
|
|
2184
2220
|
capabilities: components["schemas"]["SiteCapabilitiesDto"];
|
|
2185
2221
|
code: string;
|
|
@@ -2255,6 +2291,33 @@ export interface components {
|
|
|
2255
2291
|
label: string;
|
|
2256
2292
|
};
|
|
2257
2293
|
StartCheckoutRequest: {
|
|
2294
|
+
/** @description Optional. Where the order came from, as the device captured it under measurement consent. Absent, null or not an object: what the checkout holds is not changed. A capture never produces a problem answer: a member of the wrong kind reads as absent, and unknown members are ignored. */
|
|
2295
|
+
attribution?: null | {
|
|
2296
|
+
/** @description null (or not an array): the device does not grant measurement. []: it grants measurement and holds no touch. Otherwise the device's touches, oldest first, at most 5; when more are sent, the first and the newest four are kept. */
|
|
2297
|
+
touches?: {
|
|
2298
|
+
/**
|
|
2299
|
+
* Format: date-time
|
|
2300
|
+
* @description When the landing happened, UTC (yyyy-MM-ddTHH:mm:ssZ).
|
|
2301
|
+
*/
|
|
2302
|
+
at?: null | string;
|
|
2303
|
+
/** @description utm_campaign, normalised. */
|
|
2304
|
+
campaign?: null | string;
|
|
2305
|
+
/** @description Which kind of click id the landing carried — gclid, gbraid, wbraid, msclkid, fbclid or ttclid — never its value; null when none. */
|
|
2306
|
+
clickIdKind?: null | string;
|
|
2307
|
+
/** @description utm_content, normalised; kept only when the site keeps it. */
|
|
2308
|
+
content?: null | string;
|
|
2309
|
+
/** @description The landing page's site-relative path, without its query. */
|
|
2310
|
+
landingPath?: null | string;
|
|
2311
|
+
/** @description utm_medium, normalised. */
|
|
2312
|
+
medium?: null | string;
|
|
2313
|
+
/** @description The referring site's host, never its path or query. */
|
|
2314
|
+
referrerHost?: null | string;
|
|
2315
|
+
/** @description utm_source, normalised. */
|
|
2316
|
+
source?: null | string;
|
|
2317
|
+
/** @description utm_term, normalised; kept only when the site keeps it. */
|
|
2318
|
+
term?: null | string;
|
|
2319
|
+
}[] | null;
|
|
2320
|
+
};
|
|
2258
2321
|
option: null | string;
|
|
2259
2322
|
returnOrigin: null | string;
|
|
2260
2323
|
};
|
|
@@ -3989,6 +4052,8 @@ export interface operations {
|
|
|
3989
4052
|
"X-Locale"?: string;
|
|
3990
4053
|
/** @description The cart's bearer token. The checkout works on this cart. */
|
|
3991
4054
|
"X-Cart-Token": string;
|
|
4055
|
+
/** @description Optional. The guest shopper token (sft_…), sent with an attribution capture only when there is no shopper session and the device grants measurement: the server checks the grant on the token's consent record before it keeps any touch (with a session, the account's record is read instead and the token is not). It is never stored with the checkout, and the route never mints a token; without it, or with an unknown one, the touches are not kept and the checkout answers as it would without them. */
|
|
4056
|
+
"X-Shopper-Token"?: string;
|
|
3992
4057
|
/** @description Optional. The shopper session (sfs_…) of a signed-in shopper, server-to-server with the site's server key only: it opens the principal's saved carts and orders, and is never needed for a guest cart or order. On a site without accounts it is not read. Not in the CORS allow-list. */
|
|
3993
4058
|
"X-Shopper-Session"?: string;
|
|
3994
4059
|
};
|
|
@@ -4093,6 +4158,89 @@ export interface operations {
|
|
|
4093
4158
|
};
|
|
4094
4159
|
};
|
|
4095
4160
|
};
|
|
4161
|
+
ClearCheckoutAttribution: {
|
|
4162
|
+
parameters: {
|
|
4163
|
+
query?: never;
|
|
4164
|
+
header: {
|
|
4165
|
+
/** @description Publishable, preview or secret site key. Required on every request; secret keys are server-side only. */
|
|
4166
|
+
"X-Site-Key": string;
|
|
4167
|
+
/** @description Market code (e.g. "eur"). Optional when the site has one market; else the default binding's market. */
|
|
4168
|
+
"X-Market"?: string;
|
|
4169
|
+
/** @description ISO 3166-1 alpha-2 country (e.g. "DE"). Optional when the market has one country; catalog reads fall back to the market's default country, cart and checkout require it. */
|
|
4170
|
+
"X-Country"?: string;
|
|
4171
|
+
/** @description Locale tag as the site spells it (e.g. "sv"). Optional: the country's default locale. Accept-Language selects nothing. */
|
|
4172
|
+
"X-Locale"?: string;
|
|
4173
|
+
/** @description Optional. The cart whose checkouts drop their order-source touches. A missing or unknown token answers 204. */
|
|
4174
|
+
"X-Cart-Token"?: string;
|
|
4175
|
+
};
|
|
4176
|
+
path?: never;
|
|
4177
|
+
cookie?: never;
|
|
4178
|
+
};
|
|
4179
|
+
requestBody?: never;
|
|
4180
|
+
responses: {
|
|
4181
|
+
/** @description No Content */
|
|
4182
|
+
204: {
|
|
4183
|
+
headers: {
|
|
4184
|
+
[name: string]: unknown;
|
|
4185
|
+
};
|
|
4186
|
+
content?: never;
|
|
4187
|
+
};
|
|
4188
|
+
/** @description problem+json. Not answered by this route: it has no 400 of its own, and X-Market, X-Country and X-Locale play no part in it. */
|
|
4189
|
+
400: {
|
|
4190
|
+
headers: {
|
|
4191
|
+
[name: string]: unknown;
|
|
4192
|
+
};
|
|
4193
|
+
content: {
|
|
4194
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
4195
|
+
};
|
|
4196
|
+
};
|
|
4197
|
+
/** @description problem+json. SITE_KEY_MISSING or SITE_KEY_INVALID; SESSION_INVALID when an X-Shopper-Session is sent on a site with accounts and does not validate. */
|
|
4198
|
+
401: {
|
|
4199
|
+
headers: {
|
|
4200
|
+
[name: string]: unknown;
|
|
4201
|
+
};
|
|
4202
|
+
content: {
|
|
4203
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
4204
|
+
};
|
|
4205
|
+
};
|
|
4206
|
+
/** @description problem+json. PERMISSION_DENIED (a key other than the site's publishable or server key: no secret or preview key), SECRET_KEY_FROM_BROWSER (the server key from a browser); with an X-Shopper-Session: SERVER_KEY_REQUIRED or SESSION_FROM_BROWSER. */
|
|
4207
|
+
403: {
|
|
4208
|
+
headers: {
|
|
4209
|
+
[name: string]: unknown;
|
|
4210
|
+
};
|
|
4211
|
+
content: {
|
|
4212
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
4213
|
+
};
|
|
4214
|
+
};
|
|
4215
|
+
/** @description problem+json. NOT_FOUND for an unrouted path only: a missing or unknown cart answers 204, and the route works on a paused site. */
|
|
4216
|
+
404: {
|
|
4217
|
+
headers: {
|
|
4218
|
+
[name: string]: unknown;
|
|
4219
|
+
};
|
|
4220
|
+
content: {
|
|
4221
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
4222
|
+
};
|
|
4223
|
+
};
|
|
4224
|
+
/** @description problem+json. RATE_LIMITED; retryAfterSeconds and the Retry-After header say how long to wait. */
|
|
4225
|
+
429: {
|
|
4226
|
+
headers: {
|
|
4227
|
+
[name: string]: unknown;
|
|
4228
|
+
};
|
|
4229
|
+
content: {
|
|
4230
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
4231
|
+
};
|
|
4232
|
+
};
|
|
4233
|
+
/** @description problem+json. CHECKOUT_UNAVAILABLE (the cart's lock timed out or the clear failed; nothing is promised cleared — retry); SITE_KEYS_SYNCING (the server key before the site's first key sync; Retry-After) or SITE_REGISTRY_WARMING. */
|
|
4234
|
+
503: {
|
|
4235
|
+
headers: {
|
|
4236
|
+
[name: string]: unknown;
|
|
4237
|
+
};
|
|
4238
|
+
content: {
|
|
4239
|
+
"application/problem+json": components["schemas"]["StorefrontProblem"];
|
|
4240
|
+
};
|
|
4241
|
+
};
|
|
4242
|
+
};
|
|
4243
|
+
};
|
|
4096
4244
|
GetCheckout: {
|
|
4097
4245
|
parameters: {
|
|
4098
4246
|
query?: never;
|