@ingridab/sdk 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.d.ts +3569 -0
- package/dist/index.js +5000 -0
- package/package.json +59 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3569 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description AddonType defines the specific type of addon offered.\n\n - ADDON_TYPE_UNSPECIFIED: Addon type is unspecified or unknown.\n - CUSTOM: A custom addon specified by the carrier or merchant.\n - CARRY_IN: An addon for carrying the delivery item into the recipient\'s premises.\n - LEAVE_AT_DOOR: An addon for leaving the item at the door without requiring a signature.\n - UNWRAPPING: An addon for unwrapping the delivered item.
|
|
5
|
+
* @default ADDON_TYPE_UNSPECIFIED
|
|
6
|
+
*/
|
|
7
|
+
declare type AddonAddonType = AddonAddonTypeEnum;
|
|
8
|
+
|
|
9
|
+
declare type AddonAddonTypeEnum =
|
|
10
|
+
| 'ADDON_TYPE_UNSPECIFIED'
|
|
11
|
+
| 'CUSTOM'
|
|
12
|
+
| 'CARRY_IN'
|
|
13
|
+
| 'LEAVE_AT_DOOR'
|
|
14
|
+
| 'UNWRAPPING';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @description Common address entity that used almost everywhere in Ingrid\'s API.
|
|
18
|
+
*/
|
|
19
|
+
declare type Address = {
|
|
20
|
+
/**
|
|
21
|
+
* @type array | undefined
|
|
22
|
+
*/
|
|
23
|
+
address_lines?: string[];
|
|
24
|
+
/**
|
|
25
|
+
* @description Number of the apartment.
|
|
26
|
+
* @type string | undefined
|
|
27
|
+
*/
|
|
28
|
+
apartment_number?: string;
|
|
29
|
+
/**
|
|
30
|
+
* @type string | undefined
|
|
31
|
+
*/
|
|
32
|
+
attn?: string;
|
|
33
|
+
/**
|
|
34
|
+
* @type string | undefined
|
|
35
|
+
*/
|
|
36
|
+
building_name?: string;
|
|
37
|
+
/**
|
|
38
|
+
* @type string | undefined
|
|
39
|
+
*/
|
|
40
|
+
care_of?: string;
|
|
41
|
+
/**
|
|
42
|
+
* @type string | undefined
|
|
43
|
+
*/
|
|
44
|
+
city?: string;
|
|
45
|
+
/**
|
|
46
|
+
* @type object | undefined
|
|
47
|
+
*/
|
|
48
|
+
coordinates?: Coordinates;
|
|
49
|
+
/**
|
|
50
|
+
* @description Country should be specified as two uppercase letters (ISO Alpha-2).\nExample `SE` for Sweden, `ES` for Spain.
|
|
51
|
+
* @type string | undefined
|
|
52
|
+
*/
|
|
53
|
+
country?: string;
|
|
54
|
+
/**
|
|
55
|
+
* @type string | undefined
|
|
56
|
+
*/
|
|
57
|
+
door_code?: string;
|
|
58
|
+
/**
|
|
59
|
+
* @type string | undefined
|
|
60
|
+
*/
|
|
61
|
+
floor_number?: string;
|
|
62
|
+
/**
|
|
63
|
+
* @type string | undefined
|
|
64
|
+
*/
|
|
65
|
+
name?: string;
|
|
66
|
+
/**
|
|
67
|
+
* @type string | undefined
|
|
68
|
+
*/
|
|
69
|
+
po_box_id?: string;
|
|
70
|
+
/**
|
|
71
|
+
* @type string | undefined
|
|
72
|
+
*/
|
|
73
|
+
postal_code?: string;
|
|
74
|
+
/**
|
|
75
|
+
* @type string | undefined
|
|
76
|
+
*/
|
|
77
|
+
region?: string;
|
|
78
|
+
/**
|
|
79
|
+
* @description Name of the street.
|
|
80
|
+
* @type string | undefined
|
|
81
|
+
*/
|
|
82
|
+
street?: string;
|
|
83
|
+
/**
|
|
84
|
+
* @description Number of the street.
|
|
85
|
+
* @type string | undefined
|
|
86
|
+
*/
|
|
87
|
+
street_number?: string;
|
|
88
|
+
/**
|
|
89
|
+
* @type string | undefined
|
|
90
|
+
*/
|
|
91
|
+
subregion?: string;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @description Ingrid Address API helps to collect clean addresses.\n\nAll errors follow RFC 7807 Problem Details format.
|
|
96
|
+
*/
|
|
97
|
+
declare type Address_2 = {
|
|
98
|
+
/**
|
|
99
|
+
* @description ISO 3166-1 alpha-2 country code.
|
|
100
|
+
* @minLength 2
|
|
101
|
+
* @maxLength 2
|
|
102
|
+
* @type string
|
|
103
|
+
*/
|
|
104
|
+
countryCode: string;
|
|
105
|
+
/**
|
|
106
|
+
* @description Postal code.\nFormatting and validation rules are conditional and based on the country code.
|
|
107
|
+
* @type string
|
|
108
|
+
*/
|
|
109
|
+
postalCode: string;
|
|
110
|
+
/**
|
|
111
|
+
* @description Required for countries:\n##### North America\n* **US** (United States) - *State*\n* **CA** (Canada) - *Province/Territory*\n* **MX** (Mexico) - *State (Estado)*\n\n##### South America\n* **BR** (Brazil) - *State (Estado)* \n* **AR** (Argentina) - *Province*\n\n##### Asia Pacific\n* **AU** (Australia) - *State/Territory*\n* **CN** (China) - *Province*\n* **JP** (Japan) - *Prefecture* \n* **MY** (Malaysia) - *State*\n* **KR** (South Korea) - *Province/City-Province*\n* **ID** (Indonesia) - *Province*\n* **TH** (Thailand) - *Province (Changwat)*\n\n##### Europe\n* **IT** (Italy) - *Province* (2-letter abbreviation like MI, RM)\n* **ES** (Spain) - *Province* \n* **IE** (Ireland) - *County*
|
|
112
|
+
* @type string | undefined
|
|
113
|
+
*/
|
|
114
|
+
administrativeArea?: string;
|
|
115
|
+
/**
|
|
116
|
+
* @description Usually the District, Suburb, or Neighborhood.\nTypically not required unless explicitly specified in our documentation.
|
|
117
|
+
* @type string | undefined
|
|
118
|
+
*/
|
|
119
|
+
subAdministrativeArea?: string;
|
|
120
|
+
/**
|
|
121
|
+
* @description The primary locality of the address.\nUsually the City, Town, Village, or Municipality.
|
|
122
|
+
* @type string | undefined
|
|
123
|
+
*/
|
|
124
|
+
locality?: string;
|
|
125
|
+
/**
|
|
126
|
+
* @description The neighborhood, suburb, or district within the locality.\nTypically not required unless explicitly specified in our documentation.\n\nCritical for:\n- Japan (chome/district names)\n- UK (London districts like \"Soho\" or \"Brixton\")\n- Latin America (colonia)
|
|
127
|
+
* @type string | undefined
|
|
128
|
+
*/
|
|
129
|
+
subLocality?: string;
|
|
130
|
+
/**
|
|
131
|
+
* @description An ordered array of street address lines.\nIndex 0: Primary street info (Street name + Number, or Block number).\nIndex 1+: Secondary info (Apartment, Suite, Floor, Building Name).
|
|
132
|
+
* @type array | undefined
|
|
133
|
+
*/
|
|
134
|
+
addressLines?: string[];
|
|
135
|
+
/**
|
|
136
|
+
* @type string | undefined
|
|
137
|
+
*/
|
|
138
|
+
type?: AddressType;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @description Represents an address suitable for delivery.
|
|
143
|
+
*/
|
|
144
|
+
declare type AddressAddress = {
|
|
145
|
+
/**
|
|
146
|
+
* @description \nRefers to a ISO-3166 alpha 2 country code.
|
|
147
|
+
* @type string
|
|
148
|
+
*/
|
|
149
|
+
country_code: string;
|
|
150
|
+
/**
|
|
151
|
+
* @description Refers to a first-level administrative subdivision code (ISO-3166-2) without the country_code prefix.\nExample: region for Washington, D.C. = `DC` (from `US-DC`).\nException: for some countries (e.g. Mexico, Hong Kong) we store the subdivision name instead.\nExample: region for Hong Kong = `Kowloon`.
|
|
152
|
+
* @type string | undefined
|
|
153
|
+
*/
|
|
154
|
+
region_code?: string;
|
|
155
|
+
/**
|
|
156
|
+
* @description Refers to a second-level administrative subdivision below the region (ISO-3166-2), without the country_code prefix.\nExample: region for Washington State = `WA` (from `US-WA`), subregion for King County = `033` (from `US-WA-033`).\nException: for some countries (e.g. Mexico, Hong Kong) we store the subdivision name instead.\nExample: subregion within Hong Kong/Kowloon = `Tsim Sha Tsui`.
|
|
157
|
+
* @type string | undefined
|
|
158
|
+
*/
|
|
159
|
+
subregion_code?: string;
|
|
160
|
+
/**
|
|
161
|
+
* @description Refers to a postal code or zipcode.
|
|
162
|
+
* @type string | undefined
|
|
163
|
+
*/
|
|
164
|
+
postal_code?: string;
|
|
165
|
+
/**
|
|
166
|
+
* @description Refers to a city, postal_town or locality.
|
|
167
|
+
* @type string | undefined
|
|
168
|
+
*/
|
|
169
|
+
city?: string;
|
|
170
|
+
/**
|
|
171
|
+
* @description List of strings, each a part of the address, e.g., street name, street number, building name, floor.
|
|
172
|
+
* @type array | undefined
|
|
173
|
+
*/
|
|
174
|
+
address_lines?: string[];
|
|
175
|
+
/**
|
|
176
|
+
* @description Street name of the address.
|
|
177
|
+
* @type string | undefined
|
|
178
|
+
*/
|
|
179
|
+
street?: string;
|
|
180
|
+
/**
|
|
181
|
+
* @description Street number of the address.
|
|
182
|
+
* @type string | undefined
|
|
183
|
+
*/
|
|
184
|
+
street_number?: string;
|
|
185
|
+
/**
|
|
186
|
+
* @description Apartment number of the address.
|
|
187
|
+
* @type string | undefined
|
|
188
|
+
*/
|
|
189
|
+
apartment_number?: string;
|
|
190
|
+
/**
|
|
191
|
+
* @description Building name of the address.
|
|
192
|
+
* @type string | undefined
|
|
193
|
+
*/
|
|
194
|
+
building_name?: string;
|
|
195
|
+
/**
|
|
196
|
+
* @description Floor number of the address.
|
|
197
|
+
* @type string | undefined
|
|
198
|
+
*/
|
|
199
|
+
floor_number?: string;
|
|
200
|
+
/**
|
|
201
|
+
* @description PO Box identifier of the address.
|
|
202
|
+
* @type string | undefined
|
|
203
|
+
*/
|
|
204
|
+
po_box_id?: string;
|
|
205
|
+
/**
|
|
206
|
+
* @description Full name associated with the address, for example company name.
|
|
207
|
+
* @type string | undefined
|
|
208
|
+
*/
|
|
209
|
+
name?: string;
|
|
210
|
+
/**
|
|
211
|
+
* @description Care of information associated with the address.
|
|
212
|
+
* @type string | undefined
|
|
213
|
+
*/
|
|
214
|
+
care_of?: string;
|
|
215
|
+
/**
|
|
216
|
+
* @description Represents a latitude/longitude pair.\nUnless specified otherwise, this must conform to the WGS84 standard.\nValues must be within normalized ranges.
|
|
217
|
+
* @type object | undefined
|
|
218
|
+
*/
|
|
219
|
+
coordinates?: AddressCoordinates;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* @description Types of modifications the validation API made to the original address.
|
|
224
|
+
*/
|
|
225
|
+
declare type AddressChange = AddressChangeEnum;
|
|
226
|
+
|
|
227
|
+
declare type AddressChangeEnum =
|
|
228
|
+
| 'postalCodeFixed'
|
|
229
|
+
| 'localityFixed'
|
|
230
|
+
| 'spellingCorrected'
|
|
231
|
+
| 'componentsAdded'
|
|
232
|
+
| 'componentsRemoved';
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* @description Represents a latitude/longitude pair.\nUnless specified otherwise, this must conform to the WGS84 standard.\nValues must be within normalized ranges.
|
|
236
|
+
*/
|
|
237
|
+
declare type AddressCoordinates = {
|
|
238
|
+
/**
|
|
239
|
+
* @description The latitude in degrees. Must be within the range -90.0 to +90.0, inclusive.
|
|
240
|
+
* @type number, double
|
|
241
|
+
*/
|
|
242
|
+
lat: number;
|
|
243
|
+
/**
|
|
244
|
+
* @description The longitude in degrees. Must be within the range -180.0 to +180.0, inclusive.
|
|
245
|
+
* @type number, double
|
|
246
|
+
*/
|
|
247
|
+
lng: number;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
declare type AddressDebugParams = Pick<ParticleParamsMap['address'], 'customization'>;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* @description Response containing the full address resolved from a prediction ID.
|
|
254
|
+
*/
|
|
255
|
+
declare type AddressDetailsResponse = {
|
|
256
|
+
/**
|
|
257
|
+
* @description The full address resolved from the prediction.
|
|
258
|
+
*/
|
|
259
|
+
address: Address_2;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
declare type AddressParticleInputState = DeepPartial<V1AlphaAddressContact>;
|
|
263
|
+
|
|
264
|
+
declare type AddressParticleParams = {
|
|
265
|
+
mode: 'postalCode' | 'addressForm';
|
|
266
|
+
prefillAddress?: RecipientContact;
|
|
267
|
+
customization?: {
|
|
268
|
+
address?: { vatTypes?: string[] };
|
|
269
|
+
addressBook?: { displayMode?: 'off' | 'inline' | 'popup' };
|
|
270
|
+
suggestions?: { displayMode?: 'inline' | 'popup' };
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
declare const addressParticleParamsValidator = z.object({
|
|
275
|
+
mode: z.enum(['postalCode', 'addressForm']),
|
|
276
|
+
prefillAddress: recipientContactValidator.optional(),
|
|
277
|
+
customization: z
|
|
278
|
+
.object({
|
|
279
|
+
address: z
|
|
280
|
+
.object({
|
|
281
|
+
vatTypes: z.array(z.string()).optional(), // TODO: TBD - we'll probably need multiselect input to handle this in the Playground
|
|
282
|
+
})
|
|
283
|
+
.optional(),
|
|
284
|
+
addressBook: z
|
|
285
|
+
.object({
|
|
286
|
+
displayMode: z.enum(['off', 'inline', 'popup']).optional(),
|
|
287
|
+
})
|
|
288
|
+
.optional(),
|
|
289
|
+
suggestions: z
|
|
290
|
+
.object({
|
|
291
|
+
displayMode: z.enum(['inline', 'popup']).optional(),
|
|
292
|
+
})
|
|
293
|
+
.optional(),
|
|
294
|
+
})
|
|
295
|
+
.optional(),
|
|
296
|
+
}) satisfies z.ZodType<AddressParticleParams>;
|
|
297
|
+
|
|
298
|
+
declare type AddressPresetParams = Pick<ParticleParamsMap['address'], 'mode' | 'prefillAddress'>;
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* @description The contact to create.
|
|
302
|
+
*/
|
|
303
|
+
declare type AddressServiceCreateContactMutationRequest = V1AlphaAddressContact;
|
|
304
|
+
|
|
305
|
+
declare type AddressServiceCreateContactPathParams = {
|
|
306
|
+
/**
|
|
307
|
+
* @description The resource id of the address book the contact should belong to.\nTypically this is the customer ID.
|
|
308
|
+
* @pattern [^/]+
|
|
309
|
+
* @type string
|
|
310
|
+
*/
|
|
311
|
+
address_book_id: string;
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* @description A successful response.
|
|
316
|
+
*/
|
|
317
|
+
declare type AddressServiceDeleteContact200 = object;
|
|
318
|
+
|
|
319
|
+
declare type AddressServiceDeleteContactPathParams = {
|
|
320
|
+
/**
|
|
321
|
+
* @description The resource id of the address book the contact belongs to.\nTypically this is the customer ID.
|
|
322
|
+
* @pattern [^/]+
|
|
323
|
+
* @type string
|
|
324
|
+
*/
|
|
325
|
+
address_book_id: string;
|
|
326
|
+
/**
|
|
327
|
+
* @description The contact ID to delete.
|
|
328
|
+
* @pattern [^/]+
|
|
329
|
+
* @type string
|
|
330
|
+
*/
|
|
331
|
+
contact_id: string;
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
declare type AddressServiceListContactsPathParams = {
|
|
335
|
+
/**
|
|
336
|
+
* @description The resource id of the set of contacts to retrieve.\nTypically this is the customer ID.
|
|
337
|
+
* @pattern [^/]+
|
|
338
|
+
* @type string
|
|
339
|
+
*/
|
|
340
|
+
address_book_id: string;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
declare type AddressServiceListContactsQueryParams = {
|
|
344
|
+
/**
|
|
345
|
+
* @description Country code defined as ISO 3166-1 alpha-2, country code of the addresses.
|
|
346
|
+
* @type string | undefined
|
|
347
|
+
*/
|
|
348
|
+
country_code?: string;
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* @description The contact to update.
|
|
353
|
+
*/
|
|
354
|
+
declare type AddressServiceUpdateContactMutationRequest = {
|
|
355
|
+
/**
|
|
356
|
+
* @description Represents an address suitable for delivery.
|
|
357
|
+
* @type object
|
|
358
|
+
*/
|
|
359
|
+
address: AddressAddress;
|
|
360
|
+
/**
|
|
361
|
+
* @description The email address of the contact.
|
|
362
|
+
* @type string | undefined
|
|
363
|
+
*/
|
|
364
|
+
email?: string;
|
|
365
|
+
/**
|
|
366
|
+
* @description A phone number, including region and optional extension.
|
|
367
|
+
* @type object | undefined
|
|
368
|
+
*/
|
|
369
|
+
phone_number?: ContactPhoneNumber_2;
|
|
370
|
+
/**
|
|
371
|
+
* @description Full name associated with the contact.
|
|
372
|
+
* @type string | undefined
|
|
373
|
+
*/
|
|
374
|
+
name?: string;
|
|
375
|
+
/**
|
|
376
|
+
* @description First name associated with the contact.
|
|
377
|
+
* @type string | undefined
|
|
378
|
+
*/
|
|
379
|
+
first_name?: string;
|
|
380
|
+
/**
|
|
381
|
+
* @description Last name associated with the contact.
|
|
382
|
+
* @type string | undefined
|
|
383
|
+
*/
|
|
384
|
+
last_name?: string;
|
|
385
|
+
/**
|
|
386
|
+
* @description National ID number associated with the contact.
|
|
387
|
+
* @type string | undefined
|
|
388
|
+
*/
|
|
389
|
+
national_id_number?: string;
|
|
390
|
+
/**
|
|
391
|
+
* @description Company name associated with the contact.
|
|
392
|
+
* @type string | undefined
|
|
393
|
+
*/
|
|
394
|
+
company_name?: string;
|
|
395
|
+
/**
|
|
396
|
+
* @description VAT number associated with the contact.
|
|
397
|
+
* @type string | undefined
|
|
398
|
+
*/
|
|
399
|
+
vat?: string;
|
|
400
|
+
/**
|
|
401
|
+
* @description Customs number associated with the contact.
|
|
402
|
+
* @type string | undefined
|
|
403
|
+
*/
|
|
404
|
+
customs_number?: string;
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
declare type AddressSuggestionsService = {
|
|
408
|
+
list: DataResolver<
|
|
409
|
+
{ params: AutocompleteAddressQuery['QueryParams']; token: string; siteId: string },
|
|
410
|
+
AutocompleteAddressQuery['Response']
|
|
411
|
+
>;
|
|
412
|
+
resolve: DataResolver<
|
|
413
|
+
{
|
|
414
|
+
params: GetAddressDetailsQuery['PathParams'];
|
|
415
|
+
token: string;
|
|
416
|
+
siteId: string;
|
|
417
|
+
},
|
|
418
|
+
GetAddressDetailsQuery['Response']
|
|
419
|
+
>;
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
declare type AddressType = AddressTypeEnum;
|
|
423
|
+
|
|
424
|
+
declare type AddressTypeEnum = 'unknown' | 'residential' | 'commercial';
|
|
425
|
+
|
|
426
|
+
declare type AddressValidationService = {
|
|
427
|
+
validateAddress: DataResolver<
|
|
428
|
+
{ payload: ValidateAddressMutation['Request']; token: string; siteId: string },
|
|
429
|
+
ValidateAddressMutation['Response']
|
|
430
|
+
>;
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
declare type Alert = {
|
|
434
|
+
/**
|
|
435
|
+
* @type object | undefined
|
|
436
|
+
*/
|
|
437
|
+
awaiting_supplier?: AlertAwaitingSupplierPayload;
|
|
438
|
+
/**
|
|
439
|
+
* @type string | undefined
|
|
440
|
+
*/
|
|
441
|
+
created_at?: string;
|
|
442
|
+
/**
|
|
443
|
+
* @type object | undefined
|
|
444
|
+
*/
|
|
445
|
+
delivery_attempt_failed?: AlertDeliveryAttemptFailedPayload;
|
|
446
|
+
/**
|
|
447
|
+
* @type object | undefined
|
|
448
|
+
*/
|
|
449
|
+
delivery_delayed?: AlertDeliveryDelayedPayload;
|
|
450
|
+
/**
|
|
451
|
+
* @type object | undefined
|
|
452
|
+
*/
|
|
453
|
+
delivery_delayed_from_carrier?: AlertDeliveryDelayedFromCarrierPayload;
|
|
454
|
+
/**
|
|
455
|
+
* @type object | undefined
|
|
456
|
+
*/
|
|
457
|
+
estimated_delivery_time_updated?: AlertEstimatedDeliveryTimeUpdatedPayload;
|
|
458
|
+
/**
|
|
459
|
+
* @type object | undefined
|
|
460
|
+
*/
|
|
461
|
+
linehaul?: AlertLinehaulPayload;
|
|
462
|
+
/**
|
|
463
|
+
* @type object | undefined
|
|
464
|
+
*/
|
|
465
|
+
out_for_delivery?: AlertOutForDeliveryPayload;
|
|
466
|
+
/**
|
|
467
|
+
* @type object | undefined
|
|
468
|
+
*/
|
|
469
|
+
submission_delayed?: AlertSubmissionDelayedPayload;
|
|
470
|
+
/**
|
|
471
|
+
* @type string | undefined
|
|
472
|
+
*/
|
|
473
|
+
type?: AlertType;
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
declare type AlertAwaitingSupplierPayload = {
|
|
477
|
+
/**
|
|
478
|
+
* @type object | undefined
|
|
479
|
+
*/
|
|
480
|
+
estimated_time?: EstimatedTime;
|
|
481
|
+
/**
|
|
482
|
+
* @description Provides a date interval. Depending on a case, `start` and `end` parts are not guaranteed to be present.
|
|
483
|
+
* @type object | undefined
|
|
484
|
+
*/
|
|
485
|
+
estimated_time_range?: DateTimeRange;
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
declare type AlertDeliveryAttemptFailedPayload = object;
|
|
489
|
+
|
|
490
|
+
declare type AlertDeliveryDelayedFromCarrierPayload = object;
|
|
491
|
+
|
|
492
|
+
declare type AlertDeliveryDelayedPayload = object;
|
|
493
|
+
|
|
494
|
+
declare type AlertEstimatedDeliveryTimeUpdatedPayload = object;
|
|
495
|
+
|
|
496
|
+
declare type AlertLinehaulPayload = {
|
|
497
|
+
/**
|
|
498
|
+
* @type object | undefined
|
|
499
|
+
*/
|
|
500
|
+
estimated_time?: EstimatedTime;
|
|
501
|
+
/**
|
|
502
|
+
* @description Provides a date interval. Depending on a case, `start` and `end` parts are not guaranteed to be present.
|
|
503
|
+
* @type object | undefined
|
|
504
|
+
*/
|
|
505
|
+
estimated_time_range?: DateTimeRange;
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
declare type AlertOutForDeliveryPayload = object;
|
|
509
|
+
|
|
510
|
+
declare type AlertSubmissionDelayedPayload = object;
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* @default ALERT_UNDEFINED
|
|
514
|
+
*/
|
|
515
|
+
declare type AlertType = AlertTypeEnum;
|
|
516
|
+
|
|
517
|
+
declare type AlertTypeEnum =
|
|
518
|
+
| 'ALERT_UNDEFINED'
|
|
519
|
+
| 'ALERT_DELIVERY_DELAYED'
|
|
520
|
+
| 'ALERT_ESTIMATED_DELIVERY_TIME_UPDATED'
|
|
521
|
+
| 'ALERT_DELIVERY_ATTEMPT_FAILED'
|
|
522
|
+
| 'ALERT_OUT_FOR_DELIVERY'
|
|
523
|
+
| 'ALERT_SUBMISSION_DELAYED'
|
|
524
|
+
| 'ALERT_DELIVERY_DELAYED_FROM_CARRIER'
|
|
525
|
+
| 'ALERT_AWAITING_SUPPLIER'
|
|
526
|
+
| 'ALERT_LINEHAUL_TO_CARRIER';
|
|
527
|
+
|
|
528
|
+
declare type AtlasErrorsBadRequestError = AtlasErrorsProblemDetails & {
|
|
529
|
+
/**
|
|
530
|
+
* @type number
|
|
531
|
+
*/
|
|
532
|
+
status: AtlasErrorsBadRequestErrorStatusEnum;
|
|
533
|
+
/**
|
|
534
|
+
* @type string
|
|
535
|
+
*/
|
|
536
|
+
title: AtlasErrorsBadRequestErrorTitleEnum;
|
|
537
|
+
/**
|
|
538
|
+
* @type string
|
|
539
|
+
*/
|
|
540
|
+
type: AtlasErrorsBadRequestErrorTypeEnum;
|
|
541
|
+
};
|
|
542
|
+
|
|
543
|
+
declare type AtlasErrorsBadRequestErrorStatusEnum = 400;
|
|
544
|
+
|
|
545
|
+
declare type AtlasErrorsBadRequestErrorTitleEnum = 'Bad Request';
|
|
546
|
+
|
|
547
|
+
declare type AtlasErrorsBadRequestErrorTypeEnum =
|
|
548
|
+
'https://docs.ingrid.com/developer-resources/ingrid-api/errors/common/bad-request';
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* @description A detailed, machine-readable validation error.\nThis corresponds to the `finalDetailedError` in the Go package.
|
|
552
|
+
*/
|
|
553
|
+
declare type AtlasErrorsDetailedError = {
|
|
554
|
+
/**
|
|
555
|
+
* @description A stable, machine-readable error code (and translation key).\ne.g., \"error.email.required\"
|
|
556
|
+
* @type string
|
|
557
|
+
*/
|
|
558
|
+
code: string;
|
|
559
|
+
/**
|
|
560
|
+
* @description The final, translated, human-readable message for this specific failure.
|
|
561
|
+
* @type string
|
|
562
|
+
*/
|
|
563
|
+
detail: string;
|
|
564
|
+
/**
|
|
565
|
+
* @description The specific JSON path that caused the error.\ne.g., \"/email\"
|
|
566
|
+
* @type string, json-pointer
|
|
567
|
+
*/
|
|
568
|
+
param: string;
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
declare type AtlasErrorsNotFoundError = AtlasErrorsProblemDetails & {
|
|
572
|
+
/**
|
|
573
|
+
* @type number
|
|
574
|
+
*/
|
|
575
|
+
status: AtlasErrorsNotFoundErrorStatusEnum;
|
|
576
|
+
/**
|
|
577
|
+
* @type string
|
|
578
|
+
*/
|
|
579
|
+
title: AtlasErrorsNotFoundErrorTitleEnum;
|
|
580
|
+
/**
|
|
581
|
+
* @type string
|
|
582
|
+
*/
|
|
583
|
+
type: AtlasErrorsNotFoundErrorTypeEnum;
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
declare type AtlasErrorsNotFoundErrorStatusEnum = 404;
|
|
587
|
+
|
|
588
|
+
declare type AtlasErrorsNotFoundErrorTitleEnum = 'Not Found';
|
|
589
|
+
|
|
590
|
+
declare type AtlasErrorsNotFoundErrorTypeEnum =
|
|
591
|
+
'https://docs.ingrid.com/developer-resources/ingrid-api/errors/common/not-found';
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* @description The standard, RFC 9457-compliant error response for our B2B APIs.\nThis corresponds to the `finalProblemDetails` in the Go package.
|
|
595
|
+
*/
|
|
596
|
+
declare type AtlasErrorsProblemDetails = {
|
|
597
|
+
/**
|
|
598
|
+
* @description A URI reference that identifies the problem type.\nThis MUST link to public documentation.\ne.g., \"https://developer-next.ingrid.com/errors/validation-error\"
|
|
599
|
+
* @type string, uri
|
|
600
|
+
*/
|
|
601
|
+
type: string;
|
|
602
|
+
/**
|
|
603
|
+
* @description A short, human-readable summary of the problem type (translated).\ne.g., \"Validation Failed\"
|
|
604
|
+
* @type string
|
|
605
|
+
*/
|
|
606
|
+
title: string;
|
|
607
|
+
/**
|
|
608
|
+
* @description The HTTP status code.\ne.g., 400
|
|
609
|
+
* @type integer, int32
|
|
610
|
+
*/
|
|
611
|
+
status: number;
|
|
612
|
+
/**
|
|
613
|
+
* @description A human-readable explanation specific to this occurrence (translated).\ne.g., \"One or more fields failed validation.\"
|
|
614
|
+
* @type string | undefined
|
|
615
|
+
*/
|
|
616
|
+
detail?: string;
|
|
617
|
+
/**
|
|
618
|
+
* @description A unique identifier for the request that caused the error. Typically to be\nshared with Ingrid support for debugging.
|
|
619
|
+
* @type string | undefined, uri
|
|
620
|
+
*/
|
|
621
|
+
instance?: string;
|
|
622
|
+
/**
|
|
623
|
+
* @description An array of detailed validation errors.\nThis is omitted if not applicable.
|
|
624
|
+
* @type array | undefined
|
|
625
|
+
*/
|
|
626
|
+
errors?: AtlasErrorsDetailedError[];
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
declare type AtlasErrorsServerError = AtlasErrorsProblemDetails & {
|
|
630
|
+
/**
|
|
631
|
+
* @type number
|
|
632
|
+
*/
|
|
633
|
+
status: AtlasErrorsServerErrorStatusEnum;
|
|
634
|
+
/**
|
|
635
|
+
* @type string
|
|
636
|
+
*/
|
|
637
|
+
title: AtlasErrorsServerErrorTitleEnum;
|
|
638
|
+
/**
|
|
639
|
+
* @type string
|
|
640
|
+
*/
|
|
641
|
+
type: AtlasErrorsServerErrorTypeEnum;
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
declare type AtlasErrorsServerErrorStatusEnum = 500;
|
|
645
|
+
|
|
646
|
+
declare type AtlasErrorsServerErrorTitleEnum = 'Internal Server Error';
|
|
647
|
+
|
|
648
|
+
declare type AtlasErrorsServerErrorTypeEnum =
|
|
649
|
+
'https://docs.ingrid.com/developer-resources/ingrid-api/errors/common/internal-server-error';
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* @description The request has succeeded.
|
|
653
|
+
*/
|
|
654
|
+
declare type AutocompleteAddress200 = SearchAddressesResponse;
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* @description The server could not understand the request due to invalid syntax.
|
|
658
|
+
*/
|
|
659
|
+
declare type AutocompleteAddress400 = AtlasErrorsBadRequestError;
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* @description Server error
|
|
663
|
+
*/
|
|
664
|
+
declare type AutocompleteAddress500 = AtlasErrorsServerError;
|
|
665
|
+
|
|
666
|
+
declare type AutocompleteAddressQuery = {
|
|
667
|
+
Response: AutocompleteAddress200;
|
|
668
|
+
QueryParams: AutocompleteAddressQueryParams;
|
|
669
|
+
Errors: AutocompleteAddress400 | AutocompleteAddress500;
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
declare type AutocompleteAddressQueryParams = {
|
|
673
|
+
/**
|
|
674
|
+
* @description ISO 3166-1 alpha-2 country code.
|
|
675
|
+
* @pattern ^[A-Z]{2}$
|
|
676
|
+
* @type string
|
|
677
|
+
*/
|
|
678
|
+
countryCode: CountryCode;
|
|
679
|
+
/**
|
|
680
|
+
* @description The text typed by the user. Ignored if `containerId` is provided.
|
|
681
|
+
* @type string | undefined
|
|
682
|
+
*/
|
|
683
|
+
query?: string;
|
|
684
|
+
/**
|
|
685
|
+
* @description The ID of a parent result (where `action` was `expand`).\nUsed to fetch children (e.g., units in a building).
|
|
686
|
+
* @type string | undefined
|
|
687
|
+
*/
|
|
688
|
+
containerId?: string;
|
|
689
|
+
/**
|
|
690
|
+
* @description Indicates which address field the user is currently editing.\nHelps the API optimize results for the relevant field context.
|
|
691
|
+
* @type string | undefined
|
|
692
|
+
*/
|
|
693
|
+
focus?: AutocompleteFocus;
|
|
694
|
+
};
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* @description Indicates which address field the user is currently editing.\nHelps the API optimize results for the relevant field context.
|
|
698
|
+
*/
|
|
699
|
+
declare type AutocompleteFocus = AutocompleteFocusEnum;
|
|
700
|
+
|
|
701
|
+
declare type AutocompleteFocusEnum =
|
|
702
|
+
| 'addressLines'
|
|
703
|
+
| 'postalCode'
|
|
704
|
+
| 'locality'
|
|
705
|
+
| 'administrativeArea';
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* i18next uses interpolation of plural rule suffixes (https://cldr.unicode.org/index/cldr-spec/plural-rules#TOC-Determining-Plural-Categories)
|
|
709
|
+
* for type safety, cut the suffix out if it exists in translation source file
|
|
710
|
+
*/
|
|
711
|
+
declare type BaseKey<K> = K extends `${infer B}_${Intl.LDMLPluralRule}` ? B : K;
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* TODO: this will come from the site config most probably and
|
|
715
|
+
* the shape of the model will be different - for now it's kept as simple
|
|
716
|
+
* as possible for MVP purposes
|
|
717
|
+
*/
|
|
718
|
+
|
|
719
|
+
declare type BaseParticleDef<K extends ParticleType> = {
|
|
720
|
+
type: K;
|
|
721
|
+
customization?: ParticleCustomizationConfig<K>;
|
|
722
|
+
params: ParticleParamsMap[K];
|
|
723
|
+
};
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* @description A phone number, including region and optional extension.
|
|
727
|
+
*/
|
|
728
|
+
declare type ContactPhoneNumber = {
|
|
729
|
+
/**
|
|
730
|
+
* @description \nThe country code where the delivery will occur (ISO 3166-1 alpha-2).
|
|
731
|
+
* @type string
|
|
732
|
+
*/
|
|
733
|
+
country_code: string;
|
|
734
|
+
/**
|
|
735
|
+
* @description The main phone number, formatted as per the region\'s conventions.
|
|
736
|
+
* @type string
|
|
737
|
+
*/
|
|
738
|
+
number: string;
|
|
739
|
+
/**
|
|
740
|
+
* @description An optional phone number extension.
|
|
741
|
+
* @type string | undefined
|
|
742
|
+
*/
|
|
743
|
+
extension?: string;
|
|
744
|
+
};
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* @description A phone number, including region and optional extension.
|
|
748
|
+
*/
|
|
749
|
+
declare type ContactPhoneNumber_2 = {
|
|
750
|
+
/**
|
|
751
|
+
* @description \nThe country code where the delivery will occur (ISO 3166-1 alpha-2).
|
|
752
|
+
* @type string
|
|
753
|
+
*/
|
|
754
|
+
country_code: string;
|
|
755
|
+
/**
|
|
756
|
+
* @description The main phone number, formatted as per the region\'s conventions.
|
|
757
|
+
* @type string
|
|
758
|
+
*/
|
|
759
|
+
number: string;
|
|
760
|
+
/**
|
|
761
|
+
* @description An optional phone number extension.
|
|
762
|
+
* @type string | undefined
|
|
763
|
+
*/
|
|
764
|
+
extension?: string;
|
|
765
|
+
};
|
|
766
|
+
|
|
767
|
+
declare type ContactsService = {
|
|
768
|
+
listContactBookEntries: DataResolver<
|
|
769
|
+
{
|
|
770
|
+
params: AddressServiceListContactsPathParams & AddressServiceListContactsQueryParams;
|
|
771
|
+
token: string;
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
entries: { id: string; label: string; secondaryLabel: string }[];
|
|
775
|
+
}
|
|
776
|
+
>;
|
|
777
|
+
getContactBookEntry: DataResolver<
|
|
778
|
+
{
|
|
779
|
+
params: { entry_id: string; address_book_id: string };
|
|
780
|
+
token: string;
|
|
781
|
+
},
|
|
782
|
+
{ address: V1AlphaAddressContact } | null
|
|
783
|
+
>;
|
|
784
|
+
upsertContactBookEntry: DataResolver<
|
|
785
|
+
{
|
|
786
|
+
payload:
|
|
787
|
+
| AddressServiceCreateContactMutationRequest
|
|
788
|
+
| AddressServiceUpdateContactMutationRequest;
|
|
789
|
+
params: AddressServiceCreateContactPathParams;
|
|
790
|
+
token: string;
|
|
791
|
+
},
|
|
792
|
+
V1AlphaAddressContact
|
|
793
|
+
>;
|
|
794
|
+
deleteContactBookEntry: DataResolver<
|
|
795
|
+
{ params: AddressServiceDeleteContactPathParams; token: string },
|
|
796
|
+
AddressServiceDeleteContact200
|
|
797
|
+
>;
|
|
798
|
+
};
|
|
799
|
+
|
|
800
|
+
declare type Coordinates = {
|
|
801
|
+
/**
|
|
802
|
+
* @type number | undefined, double
|
|
803
|
+
*/
|
|
804
|
+
lat?: number;
|
|
805
|
+
/**
|
|
806
|
+
* @type number | undefined, double
|
|
807
|
+
*/
|
|
808
|
+
lng?: number;
|
|
809
|
+
};
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* @pattern ^[A-Z]{2}$
|
|
813
|
+
*/
|
|
814
|
+
declare type CountryCode = string;
|
|
815
|
+
|
|
816
|
+
declare interface CountrySelectorDebugParams {
|
|
817
|
+
name: string;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
declare type CountrySelectorParams = {
|
|
821
|
+
mode: 'select';
|
|
822
|
+
name: string;
|
|
823
|
+
customization?: Record<never, never>;
|
|
824
|
+
};
|
|
825
|
+
|
|
826
|
+
declare const countrySelectorParticleParamsValidator = z.object({
|
|
827
|
+
mode: z.enum(['select']),
|
|
828
|
+
name: z.string(),
|
|
829
|
+
customization: z.object({}).optional(),
|
|
830
|
+
}) satisfies z.ZodType<CountrySelectorParams>;
|
|
831
|
+
|
|
832
|
+
declare interface CountrySelectorPresetParams {
|
|
833
|
+
mode: ParticleParamsMap['countrySelector']['mode'];
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
export declare const createAddressMolecule: ({ mode, prefillAddress }: AddressPresetParams) => ({ customization }: AddressDebugParams) => {
|
|
837
|
+
type: "address";
|
|
838
|
+
customization: {
|
|
839
|
+
address?: {
|
|
840
|
+
vatTypes?: string[];
|
|
841
|
+
};
|
|
842
|
+
addressBook?: {
|
|
843
|
+
displayMode?: "off" | "inline" | "popup";
|
|
844
|
+
};
|
|
845
|
+
suggestions?: {
|
|
846
|
+
displayMode?: "inline" | "popup";
|
|
847
|
+
};
|
|
848
|
+
} | undefined;
|
|
849
|
+
params: {
|
|
850
|
+
mode: "postalCode" | "addressForm";
|
|
851
|
+
prefillAddress: RecipientContact | undefined;
|
|
852
|
+
};
|
|
853
|
+
};
|
|
854
|
+
|
|
855
|
+
export declare const createCountrySelectorMolecule: ({ mode }: CountrySelectorPresetParams) => ({ name }: CountrySelectorDebugParams) => {
|
|
856
|
+
type: "countrySelector";
|
|
857
|
+
params: {
|
|
858
|
+
mode: "select";
|
|
859
|
+
name: string;
|
|
860
|
+
};
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
export declare const createDeliveryMolecule: ({ mode }: DeliveryPresetParams) => ({ name, customization }: DeliveryDebugParams) => {
|
|
864
|
+
type: "delivery";
|
|
865
|
+
customization: {
|
|
866
|
+
choice?: {
|
|
867
|
+
carrierInstructions?: "off" | "inline" | "popup";
|
|
868
|
+
gaplessAddonsList?: boolean;
|
|
869
|
+
gaplessCarrierList?: boolean;
|
|
870
|
+
gaplessDeliveryList?: boolean;
|
|
871
|
+
labels?: "off" | "chips" | "text";
|
|
872
|
+
showAddons?: boolean;
|
|
873
|
+
showCustomInfoText?: boolean;
|
|
874
|
+
showCustomText?: boolean;
|
|
875
|
+
showDiscountedPrice?: boolean;
|
|
876
|
+
showFreeShippingIndicator?: boolean;
|
|
877
|
+
showPrice?: boolean;
|
|
878
|
+
showRadioIndicator?: boolean;
|
|
879
|
+
showReturnPromise?: boolean;
|
|
880
|
+
showShippingLogo?: boolean;
|
|
881
|
+
};
|
|
882
|
+
location?: {
|
|
883
|
+
gaplessList?: boolean;
|
|
884
|
+
mapDefaultVisible?: boolean;
|
|
885
|
+
mapDefaultZoom?: number;
|
|
886
|
+
mapFitboundsMaxZoom?: number;
|
|
887
|
+
mapPosition?: "start" | "end";
|
|
888
|
+
mapToggleEnabled?: boolean;
|
|
889
|
+
};
|
|
890
|
+
productList?: {
|
|
891
|
+
defaultView?: "off" | "list" | "summary";
|
|
892
|
+
showImage?: boolean;
|
|
893
|
+
showMetadata?: boolean;
|
|
894
|
+
showPrice?: boolean;
|
|
895
|
+
showQuantity?: boolean;
|
|
896
|
+
summaryText?: "none" | "products" | "firstProductAndMore";
|
|
897
|
+
};
|
|
898
|
+
summary?: {
|
|
899
|
+
previewAddons?: boolean;
|
|
900
|
+
showFreeShippingIndicator?: boolean;
|
|
901
|
+
};
|
|
902
|
+
} | undefined;
|
|
903
|
+
params: {
|
|
904
|
+
mode: "active" | "passive";
|
|
905
|
+
name: string;
|
|
906
|
+
};
|
|
907
|
+
};
|
|
908
|
+
|
|
909
|
+
export declare const createFreeShippingIndicatorMolecule: () => ({ name, customization }: FreeShippingIndicatorDebugParams) => {
|
|
910
|
+
type: "freeShippingIndicator";
|
|
911
|
+
customization: {
|
|
912
|
+
showExhaustedLevelsMessage?: boolean;
|
|
913
|
+
} | undefined;
|
|
914
|
+
params: {
|
|
915
|
+
name: string;
|
|
916
|
+
};
|
|
917
|
+
};
|
|
918
|
+
|
|
919
|
+
declare type DataResolver<Args, Output> = (args: Args) => Promise<Output>;
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* @description Provides a date interval. Depending on a case, `start` and `end` parts are not guaranteed to be present.
|
|
923
|
+
*/
|
|
924
|
+
declare type DateTimeRange = {
|
|
925
|
+
/**
|
|
926
|
+
* @description End of the interval. Date is returned in RFC3339 format. Example `2018-09-08T22:47:31Z`.
|
|
927
|
+
* @type string | undefined
|
|
928
|
+
*/
|
|
929
|
+
end?: string;
|
|
930
|
+
/**
|
|
931
|
+
* @type string | undefined
|
|
932
|
+
*/
|
|
933
|
+
start?: string;
|
|
934
|
+
};
|
|
935
|
+
|
|
936
|
+
declare type DeepPartial<T> = T extends (infer U)[]
|
|
937
|
+
? // this prevents the array elements from being undefined
|
|
938
|
+
// DeepPartial<string[]> would be string[] | undefined instead of (string | undefined)[]
|
|
939
|
+
DeepPartial<U>[]
|
|
940
|
+
: T extends object
|
|
941
|
+
? {
|
|
942
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
943
|
+
}
|
|
944
|
+
: T;
|
|
945
|
+
|
|
946
|
+
/**
|
|
947
|
+
* @description An Addon represents an additional service or feature offered with a delivery.
|
|
948
|
+
*/
|
|
949
|
+
declare type DeliveryAddon = {
|
|
950
|
+
/**
|
|
951
|
+
* @description The display-friendly name of the addon, e.g., \"Gift Wrapping\", \"Leave at Door\".\nDisplay name and description are localized, if translations are provided.
|
|
952
|
+
* @type string
|
|
953
|
+
*/
|
|
954
|
+
display_name: string;
|
|
955
|
+
/**
|
|
956
|
+
* @description The price of the addon in minor currency units, e.g., cents.
|
|
957
|
+
* @type string | undefined, int64
|
|
958
|
+
*/
|
|
959
|
+
readonly price?: string;
|
|
960
|
+
/**
|
|
961
|
+
* @description AddonType defines the specific type of addon offered.\n\n - ADDON_TYPE_UNSPECIFIED: Addon type is unspecified or unknown.\n - CUSTOM: A custom addon specified by the carrier or merchant.\n - CARRY_IN: An addon for carrying the delivery item into the recipient\'s premises.\n - LEAVE_AT_DOOR: An addon for leaving the item at the door without requiring a signature.\n - UNWRAPPING: An addon for unwrapping the delivered item.
|
|
962
|
+
* @type string | undefined
|
|
963
|
+
*/
|
|
964
|
+
addon_type?: AddonAddonType;
|
|
965
|
+
/**
|
|
966
|
+
* @description Indicates if this addon should be preselected by default.
|
|
967
|
+
* @type boolean | undefined
|
|
968
|
+
*/
|
|
969
|
+
preselected?: boolean;
|
|
970
|
+
/**
|
|
971
|
+
* @description Indicates if this addon was chosen.
|
|
972
|
+
* @type boolean | undefined
|
|
973
|
+
*/
|
|
974
|
+
chosen?: boolean;
|
|
975
|
+
/**
|
|
976
|
+
* @description Unique addon identifier.
|
|
977
|
+
* @type string | undefined
|
|
978
|
+
*/
|
|
979
|
+
readonly id?: string;
|
|
980
|
+
/**
|
|
981
|
+
* @description The external identifier of an addon, used for integration purposes.
|
|
982
|
+
* @type string | undefined
|
|
983
|
+
*/
|
|
984
|
+
readonly external_id?: string;
|
|
985
|
+
/**
|
|
986
|
+
* @description The display-friendly description of the addon.\nDisplay name and description are localized, if translations are provided.
|
|
987
|
+
* @type string | undefined
|
|
988
|
+
*/
|
|
989
|
+
readonly description?: string;
|
|
990
|
+
};
|
|
991
|
+
|
|
992
|
+
declare const deliveryArgsSchema = z.object({ sessionId: z.string(), token: z.string() });
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* @description DeliveryType defines the method or mode of delivery.\n\n - DELIVERY_TYPE_UNSPECIFIED: Delivery type is unspecified or unknown.\n - DELIVERY: Delivery to a customer\'s home or address.\n - PICKUP: Delivery to a service point or locker.\n - MAILBOX: Delivery to a customer\'s mailbox.\n - INSTORE: Delivery to a merchant\'s store for in-store pickup.
|
|
996
|
+
* @default DELIVERY_TYPE_UNSPECIFIED
|
|
997
|
+
*/
|
|
998
|
+
declare type DeliveryCategoryDeliveryType = DeliveryCategoryDeliveryTypeEnum;
|
|
999
|
+
|
|
1000
|
+
declare type DeliveryCategoryDeliveryTypeEnum =
|
|
1001
|
+
| 'DELIVERY_TYPE_UNSPECIFIED'
|
|
1002
|
+
| 'DELIVERY'
|
|
1003
|
+
| 'PICKUP'
|
|
1004
|
+
| 'MAILBOX'
|
|
1005
|
+
| 'INSTORE';
|
|
1006
|
+
|
|
1007
|
+
/**
|
|
1008
|
+
* @description OptionsSource specifies the origin of the delivery options.\n\n - OPTIONS_SOURCE_UNSPECIFIED: Source of the options is unspecified.\n - FALLBACK: Delivery options come from a fallback configuration.\n - CARRIER: Delivery options are sourced directly from the carrier.
|
|
1009
|
+
* @default OPTIONS_SOURCE_UNSPECIFIED
|
|
1010
|
+
*/
|
|
1011
|
+
declare type DeliveryCategoryOptionsSource = DeliveryCategoryOptionsSourceEnum;
|
|
1012
|
+
|
|
1013
|
+
declare type DeliveryCategoryOptionsSourceEnum =
|
|
1014
|
+
| 'OPTIONS_SOURCE_UNSPECIFIED'
|
|
1015
|
+
| 'FALLBACK'
|
|
1016
|
+
| 'CARRIER';
|
|
1017
|
+
|
|
1018
|
+
declare type DeliveryCategoryPriceLevels = {
|
|
1019
|
+
/**
|
|
1020
|
+
* @description Available price levels for the carrier product.\nOnly the base price and prices with the `total_value` price rule are included.
|
|
1021
|
+
* @type array | undefined
|
|
1022
|
+
*/
|
|
1023
|
+
price_levels?: PriceLevelsPriceLevel[];
|
|
1024
|
+
};
|
|
1025
|
+
|
|
1026
|
+
/**
|
|
1027
|
+
* @description Information about a warehouse.\nAll this data is stored in the site configuration.
|
|
1028
|
+
*/
|
|
1029
|
+
declare type DeliveryCategoryWarehouse = {
|
|
1030
|
+
/**
|
|
1031
|
+
* @description Unique identifier of the warehouse.
|
|
1032
|
+
* @type string
|
|
1033
|
+
*/
|
|
1034
|
+
id: string;
|
|
1035
|
+
/**
|
|
1036
|
+
* @description Represents an address suitable for delivery.
|
|
1037
|
+
* @type object
|
|
1038
|
+
*/
|
|
1039
|
+
address: V1AlphaDeliveryAddress;
|
|
1040
|
+
/**
|
|
1041
|
+
* @description The external identifier of a warehouse, used for integration purposes.
|
|
1042
|
+
* @type string | undefined
|
|
1043
|
+
*/
|
|
1044
|
+
external_id?: string;
|
|
1045
|
+
};
|
|
1046
|
+
|
|
1047
|
+
/**
|
|
1048
|
+
* @description Represents a latitude/longitude pair.\nUnless specified otherwise, this must conform to the WGS84 standard.\nValues must be within normalized ranges.
|
|
1049
|
+
*/
|
|
1050
|
+
declare type DeliveryCoordinates = {
|
|
1051
|
+
/**
|
|
1052
|
+
* @description The latitude in degrees. Must be within the range -90.0 to +90.0, inclusive.
|
|
1053
|
+
* @type number, double
|
|
1054
|
+
*/
|
|
1055
|
+
lat: number;
|
|
1056
|
+
/**
|
|
1057
|
+
* @description The longitude in degrees. Must be within the range -180.0 to +180.0, inclusive.
|
|
1058
|
+
* @type number, double
|
|
1059
|
+
*/
|
|
1060
|
+
lng: number;
|
|
1061
|
+
};
|
|
1062
|
+
|
|
1063
|
+
declare interface DeliveryDebugParams {
|
|
1064
|
+
name: string;
|
|
1065
|
+
customization?: ParticleCustomizationConfig<'delivery'>;
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
/**
|
|
1069
|
+
* @description The DeliveryCategory represents a grouping of delivery options that share the same type and other characteristics.
|
|
1070
|
+
*/
|
|
1071
|
+
declare type DeliveryDeliveryCategory = {
|
|
1072
|
+
/**
|
|
1073
|
+
* @description The unique identifier of a delivery category.
|
|
1074
|
+
* @type string
|
|
1075
|
+
*/
|
|
1076
|
+
id: string;
|
|
1077
|
+
/**
|
|
1078
|
+
* @description The external identifier of a category, used for integration purposes.
|
|
1079
|
+
* @type string | undefined
|
|
1080
|
+
*/
|
|
1081
|
+
external_id?: string;
|
|
1082
|
+
/**
|
|
1083
|
+
* @description DeliveryType defines the method or mode of delivery.\n\n - DELIVERY_TYPE_UNSPECIFIED: Delivery type is unspecified or unknown.\n - DELIVERY: Delivery to a customer\'s home or address.\n - PICKUP: Delivery to a service point or locker.\n - MAILBOX: Delivery to a customer\'s mailbox.\n - INSTORE: Delivery to a merchant\'s store for in-store pickup.
|
|
1084
|
+
* @type string
|
|
1085
|
+
*/
|
|
1086
|
+
delivery_type: DeliveryCategoryDeliveryType;
|
|
1087
|
+
/**
|
|
1088
|
+
* @description A human-readable name of the category, which will be presented to the customer.
|
|
1089
|
+
* @type string
|
|
1090
|
+
*/
|
|
1091
|
+
display_name: string;
|
|
1092
|
+
/**
|
|
1093
|
+
* @description Defines the order in which the category will be presented to the customer.
|
|
1094
|
+
* @type integer | undefined, int32
|
|
1095
|
+
*/
|
|
1096
|
+
sort_order?: number;
|
|
1097
|
+
/**
|
|
1098
|
+
* @description OptionsSource specifies the origin of the delivery options.\n\n - OPTIONS_SOURCE_UNSPECIFIED: Source of the options is unspecified.\n - FALLBACK: Delivery options come from a fallback configuration.\n - CARRIER: Delivery options are sourced directly from the carrier.
|
|
1099
|
+
* @type string
|
|
1100
|
+
*/
|
|
1101
|
+
options_source: DeliveryCategoryOptionsSource;
|
|
1102
|
+
/**
|
|
1103
|
+
* @description The delivery options available within this category.
|
|
1104
|
+
* @type array
|
|
1105
|
+
*/
|
|
1106
|
+
delivery_options: DeliveryDeliveryOption[];
|
|
1107
|
+
/**
|
|
1108
|
+
* @description Add-ons that are available for this category, e.g., gift wrapping, insurance.
|
|
1109
|
+
* @type array | undefined
|
|
1110
|
+
*/
|
|
1111
|
+
addons?: DeliveryAddon[];
|
|
1112
|
+
/**
|
|
1113
|
+
* @description Indicates if this category should be preselected by default.
|
|
1114
|
+
* @type boolean | undefined
|
|
1115
|
+
*/
|
|
1116
|
+
preselected?: boolean;
|
|
1117
|
+
/**
|
|
1118
|
+
* @description Indicates if this category was chosen by the user.
|
|
1119
|
+
* @type boolean | undefined
|
|
1120
|
+
*/
|
|
1121
|
+
chosen?: boolean;
|
|
1122
|
+
/**
|
|
1123
|
+
* @description Information about a warehouse.\nAll this data is stored in the site configuration.
|
|
1124
|
+
* @type object | undefined
|
|
1125
|
+
*/
|
|
1126
|
+
warehouse?: DeliveryCategoryWarehouse;
|
|
1127
|
+
/**
|
|
1128
|
+
* @description Tags associated with the delivery category, used for cross-reference purposes.
|
|
1129
|
+
* @type array | undefined
|
|
1130
|
+
*/
|
|
1131
|
+
readonly tags?: string[];
|
|
1132
|
+
/**
|
|
1133
|
+
* @description Information about active labels associated with the delivery category.\nLabels name and description are localized, if translations are provided.
|
|
1134
|
+
* @type array | undefined
|
|
1135
|
+
*/
|
|
1136
|
+
readonly labels?: DeliveryDeliveryCategoryLabel[];
|
|
1137
|
+
/**
|
|
1138
|
+
* @description Additional text that can be displayed with the category.\nThe presence of this field depends on the locale.
|
|
1139
|
+
* @type string | undefined
|
|
1140
|
+
*/
|
|
1141
|
+
readonly custom_text?: string;
|
|
1142
|
+
/**
|
|
1143
|
+
* @description Additional information that can be displayed with the category.\nThe presence of this field depends on the locale.
|
|
1144
|
+
* @type string | undefined
|
|
1145
|
+
*/
|
|
1146
|
+
readonly custom_info_text?: string;
|
|
1147
|
+
/**
|
|
1148
|
+
* @type object | undefined
|
|
1149
|
+
*/
|
|
1150
|
+
readonly price_levels?: Record<string, DeliveryCategoryPriceLevels>;
|
|
1151
|
+
};
|
|
1152
|
+
|
|
1153
|
+
/**
|
|
1154
|
+
* @description Labels provide additional, customer-facing information for the delivery category.
|
|
1155
|
+
*/
|
|
1156
|
+
declare type DeliveryDeliveryCategoryLabel = {
|
|
1157
|
+
/**
|
|
1158
|
+
* @description Unique identifier of the label.
|
|
1159
|
+
* @type string | undefined
|
|
1160
|
+
*/
|
|
1161
|
+
id?: string;
|
|
1162
|
+
/**
|
|
1163
|
+
* @description Display name of the label.
|
|
1164
|
+
* @type string | undefined
|
|
1165
|
+
*/
|
|
1166
|
+
name?: string;
|
|
1167
|
+
/**
|
|
1168
|
+
* @description Description of the label displayed to the customer.
|
|
1169
|
+
* @type string | undefined
|
|
1170
|
+
*/
|
|
1171
|
+
description?: string;
|
|
1172
|
+
/**
|
|
1173
|
+
* @description LabelType defines the type of label.\n\n - LABEL_TYPE_UNKNOWN: Label type is unknown.\n - LABEL_TYPE_SUSTAINABILITY: A sustainability-related label.\n - LABEL_TYPE_PRIORITY: A priority delivery label.\n - LABEL_TYPE_CUSTOM: A custom label defined by the merchant.\n - LABEL_TYPE_SWAN: A Nordic Swan eco-label.
|
|
1174
|
+
* @type string | undefined
|
|
1175
|
+
*/
|
|
1176
|
+
type?: LabelLabelType;
|
|
1177
|
+
/**
|
|
1178
|
+
* @description Color code for the label, e.g., hex value.
|
|
1179
|
+
* @type string | undefined
|
|
1180
|
+
*/
|
|
1181
|
+
color?: string;
|
|
1182
|
+
/**
|
|
1183
|
+
* @description URI or identifier for the label icon.
|
|
1184
|
+
* @type string | undefined
|
|
1185
|
+
*/
|
|
1186
|
+
icon?: string;
|
|
1187
|
+
/**
|
|
1188
|
+
* @description Color code for the label in dark mode, e.g., hex value.
|
|
1189
|
+
* @type string | undefined
|
|
1190
|
+
*/
|
|
1191
|
+
dark_mode_color?: string;
|
|
1192
|
+
};
|
|
1193
|
+
|
|
1194
|
+
declare type DeliveryDeliveryNode = {
|
|
1195
|
+
/**
|
|
1196
|
+
* @description Constraints on the node\'s handoff.
|
|
1197
|
+
* @type object | undefined
|
|
1198
|
+
*/
|
|
1199
|
+
handoff?: DeliveryNodeHandoff;
|
|
1200
|
+
/**
|
|
1201
|
+
* @description Where the node is physically located.
|
|
1202
|
+
* @type object
|
|
1203
|
+
*/
|
|
1204
|
+
location: DeliveryDeliveryNodeLocation;
|
|
1205
|
+
/**
|
|
1206
|
+
* @description What roles the node can perform.
|
|
1207
|
+
* @type array
|
|
1208
|
+
*/
|
|
1209
|
+
roles: DeliveryNodeRole[];
|
|
1210
|
+
/**
|
|
1211
|
+
* @description Additional metadata about the node.\nFor cross-reference purposes.
|
|
1212
|
+
* @type array | undefined
|
|
1213
|
+
*/
|
|
1214
|
+
tags?: string[];
|
|
1215
|
+
};
|
|
1216
|
+
|
|
1217
|
+
/**
|
|
1218
|
+
* @description Where the node is physically located.
|
|
1219
|
+
*/
|
|
1220
|
+
declare type DeliveryDeliveryNodeLocation = {
|
|
1221
|
+
/**
|
|
1222
|
+
* @description To provide full information about the location.
|
|
1223
|
+
* @type object | undefined
|
|
1224
|
+
*/
|
|
1225
|
+
by_value?: LocationByValue;
|
|
1226
|
+
/**
|
|
1227
|
+
* @description To reference an existing location.
|
|
1228
|
+
* @type object | undefined
|
|
1229
|
+
*/
|
|
1230
|
+
by_ref?: LocationByRef;
|
|
1231
|
+
};
|
|
1232
|
+
|
|
1233
|
+
/**
|
|
1234
|
+
* @description The DeliveryOption represents the details of a specific delivery option.
|
|
1235
|
+
*/
|
|
1236
|
+
declare type DeliveryDeliveryOption = {
|
|
1237
|
+
/**
|
|
1238
|
+
* @description The unique identifier of the delivery option.
|
|
1239
|
+
* @type string
|
|
1240
|
+
*/
|
|
1241
|
+
id: string;
|
|
1242
|
+
/**
|
|
1243
|
+
* @description The Carrier contains details about the shipping carrier associated with this delivery option.
|
|
1244
|
+
* @type object
|
|
1245
|
+
*/
|
|
1246
|
+
carrier: DeliveryOptionCarrier;
|
|
1247
|
+
/**
|
|
1248
|
+
* @description The PickupLocation represents a physical location from which a delivery can be retrieved.
|
|
1249
|
+
* @type object | undefined
|
|
1250
|
+
*/
|
|
1251
|
+
pickup_location?: DeliveryPickupLocation;
|
|
1252
|
+
/**
|
|
1253
|
+
* @description ETD stands for Estimated Time of Delivery.
|
|
1254
|
+
* @type object
|
|
1255
|
+
*/
|
|
1256
|
+
etd: DeliveryETD;
|
|
1257
|
+
/**
|
|
1258
|
+
* @description Indicates if this delivery option should be preselected by default.
|
|
1259
|
+
* @type boolean | undefined
|
|
1260
|
+
*/
|
|
1261
|
+
preselected?: boolean;
|
|
1262
|
+
/**
|
|
1263
|
+
* @description Indicates if this delivery option was chosen by the customer.
|
|
1264
|
+
* @type boolean | undefined
|
|
1265
|
+
*/
|
|
1266
|
+
chosen?: boolean;
|
|
1267
|
+
/**
|
|
1268
|
+
* @description The expiration timestamp in UTC of the delivery option.
|
|
1269
|
+
* @type string | undefined, date-time
|
|
1270
|
+
*/
|
|
1271
|
+
expire_time?: string;
|
|
1272
|
+
/**
|
|
1273
|
+
* @description Price associated with the delivery option in minor currency units, e.g., cents.
|
|
1274
|
+
* @type string, int64
|
|
1275
|
+
*/
|
|
1276
|
+
price: string;
|
|
1277
|
+
/**
|
|
1278
|
+
* @description Where delivery originates from.
|
|
1279
|
+
* @type object
|
|
1280
|
+
*/
|
|
1281
|
+
origin: DeliveryOptionOrigin;
|
|
1282
|
+
};
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* @description Represents a distance measurement with both spatial distance and estimated travel time.
|
|
1286
|
+
*/
|
|
1287
|
+
declare type DeliveryDistance = {
|
|
1288
|
+
/**
|
|
1289
|
+
* @description Approximate distance in meters.
|
|
1290
|
+
* @type string | undefined, int64
|
|
1291
|
+
*/
|
|
1292
|
+
readonly meters?: string;
|
|
1293
|
+
/**
|
|
1294
|
+
* @description Approximate duration in minutes.
|
|
1295
|
+
* @type string | undefined, int64
|
|
1296
|
+
*/
|
|
1297
|
+
readonly minutes?: string;
|
|
1298
|
+
};
|
|
1299
|
+
|
|
1300
|
+
/**
|
|
1301
|
+
* @description ETD stands for Estimated Time of Delivery.
|
|
1302
|
+
*/
|
|
1303
|
+
declare type DeliveryETD = {
|
|
1304
|
+
/**
|
|
1305
|
+
* @description Relative represents an ETD as a range of time units.
|
|
1306
|
+
* @type object | undefined
|
|
1307
|
+
*/
|
|
1308
|
+
relative?: ETDRelative;
|
|
1309
|
+
/**
|
|
1310
|
+
* @description Absolute represents an ETD as a single or pair of timestamps.
|
|
1311
|
+
* @type object | undefined
|
|
1312
|
+
*/
|
|
1313
|
+
absolute?: ETDAbsolute;
|
|
1314
|
+
/**
|
|
1315
|
+
* @description Custom represents an ETD in a human-readable text format.
|
|
1316
|
+
* @type object | undefined
|
|
1317
|
+
*/
|
|
1318
|
+
custom?: ETDCustom;
|
|
1319
|
+
};
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* @description A Fulfillment details when a delivery can be fulfilled.
|
|
1323
|
+
*/
|
|
1324
|
+
declare type DeliveryFulfillment = {
|
|
1325
|
+
/**
|
|
1326
|
+
* @description Readiness specifies a time range when the goods will be ready for shipment.
|
|
1327
|
+
* @type object
|
|
1328
|
+
*/
|
|
1329
|
+
readiness: FulfillmentReadiness;
|
|
1330
|
+
/**
|
|
1331
|
+
* @description List of category tags, to which the `Readiness` applies.\nIf empty, the `Readiness` applies to all categories.
|
|
1332
|
+
* @type array | undefined
|
|
1333
|
+
*/
|
|
1334
|
+
category_tags?: string[];
|
|
1335
|
+
};
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* @description Represents a single item.
|
|
1339
|
+
*/
|
|
1340
|
+
declare type DeliveryLineItem = {
|
|
1341
|
+
/**
|
|
1342
|
+
* @description The unique item identifier of the item.
|
|
1343
|
+
* @type string
|
|
1344
|
+
*/
|
|
1345
|
+
sku: string;
|
|
1346
|
+
/**
|
|
1347
|
+
* @description The item name or title, which is suitable for presentation to the customer.
|
|
1348
|
+
* @type string
|
|
1349
|
+
*/
|
|
1350
|
+
title: string;
|
|
1351
|
+
/**
|
|
1352
|
+
* @description Total quantity of the item.
|
|
1353
|
+
* @type integer, int32
|
|
1354
|
+
*/
|
|
1355
|
+
quantity: number;
|
|
1356
|
+
/**
|
|
1357
|
+
* @description Weight of a single item in grams, must be greater than 0.
|
|
1358
|
+
* @type integer | undefined, int32
|
|
1359
|
+
*/
|
|
1360
|
+
weight?: number;
|
|
1361
|
+
/**
|
|
1362
|
+
* @description Represents the dimensions of the item.
|
|
1363
|
+
* @type object | undefined
|
|
1364
|
+
*/
|
|
1365
|
+
dimensions?: LineItemDimensions;
|
|
1366
|
+
/**
|
|
1367
|
+
* @description Non-negative discount applied to the item, or items. Unit is cents.
|
|
1368
|
+
* @type string | undefined, int64
|
|
1369
|
+
*/
|
|
1370
|
+
discount?: string;
|
|
1371
|
+
/**
|
|
1372
|
+
* @description Non-negative price of a single item after applying discounts. Unit is cents.
|
|
1373
|
+
* @type string | undefined, int64
|
|
1374
|
+
*/
|
|
1375
|
+
price?: string;
|
|
1376
|
+
/**
|
|
1377
|
+
* @description URI of the product image, e.g., thumbnail.
|
|
1378
|
+
* @type string | undefined
|
|
1379
|
+
*/
|
|
1380
|
+
image_uri?: string;
|
|
1381
|
+
/**
|
|
1382
|
+
* @description Used to control the behaviour of the filter/price rules.\nEquivalent of cart_items_attributes in the `Delivery Checkout` API.
|
|
1383
|
+
* @type array | undefined
|
|
1384
|
+
*/
|
|
1385
|
+
attributes?: string[];
|
|
1386
|
+
};
|
|
1387
|
+
|
|
1388
|
+
/**
|
|
1389
|
+
* @description Constraints on the node\'s handoff.
|
|
1390
|
+
*/
|
|
1391
|
+
declare type DeliveryNodeHandoff = {
|
|
1392
|
+
/**
|
|
1393
|
+
* @description The earliest time the node can hand off the delivery.
|
|
1394
|
+
* @type string | undefined, date-time
|
|
1395
|
+
*/
|
|
1396
|
+
earliest_time?: string;
|
|
1397
|
+
/**
|
|
1398
|
+
* @description The latest time the node can hand off the delivery.
|
|
1399
|
+
* @type string | undefined, date-time
|
|
1400
|
+
*/
|
|
1401
|
+
latest_time?: string;
|
|
1402
|
+
};
|
|
1403
|
+
|
|
1404
|
+
/**
|
|
1405
|
+
* @description Set of available roles for the node.\n\n - ROLE_UNSPECIFIED: Role is unspecified.\n - ORIGIN: The node is the origin of the delivery.\n - DESTINATION: The node is the destination of the delivery.
|
|
1406
|
+
* @default ROLE_UNSPECIFIED
|
|
1407
|
+
*/
|
|
1408
|
+
declare type DeliveryNodeRole = DeliveryNodeRoleEnum;
|
|
1409
|
+
|
|
1410
|
+
declare type DeliveryNodeRoleEnum = 'ROLE_UNSPECIFIED' | 'ORIGIN' | 'DESTINATION';
|
|
1411
|
+
|
|
1412
|
+
/**
|
|
1413
|
+
* @description The Carrier contains details about the shipping carrier associated with this delivery option.
|
|
1414
|
+
*/
|
|
1415
|
+
declare type DeliveryOptionCarrier = {
|
|
1416
|
+
/**
|
|
1417
|
+
* @description The name of the carrier company, e.g., \"DHL\", \"FedEx\".
|
|
1418
|
+
* @type string
|
|
1419
|
+
*/
|
|
1420
|
+
name: string;
|
|
1421
|
+
/**
|
|
1422
|
+
* @description The product or service level name provided by the carrier, e.g., \"Parcel\", \"Standard\".
|
|
1423
|
+
* @type string
|
|
1424
|
+
*/
|
|
1425
|
+
product_name: string;
|
|
1426
|
+
/**
|
|
1427
|
+
* @description The product or service level identifier provided by the carrier, e.g., \"dhl-par\", \"ups-std\".
|
|
1428
|
+
* @type string
|
|
1429
|
+
*/
|
|
1430
|
+
product_id: string;
|
|
1431
|
+
/**
|
|
1432
|
+
* @description The original sort order assigned by the carrier.
|
|
1433
|
+
* @type integer | undefined, int32
|
|
1434
|
+
*/
|
|
1435
|
+
sort_order?: number;
|
|
1436
|
+
/**
|
|
1437
|
+
* @description Carrier-specific metadata.
|
|
1438
|
+
* @type object | undefined
|
|
1439
|
+
*/
|
|
1440
|
+
meta?: Record<string, string>;
|
|
1441
|
+
/**
|
|
1442
|
+
* @description Merchant-specific carrier product identifier.
|
|
1443
|
+
* @type string
|
|
1444
|
+
*/
|
|
1445
|
+
external_id: string;
|
|
1446
|
+
};
|
|
1447
|
+
|
|
1448
|
+
/**
|
|
1449
|
+
* @description Where delivery originates from.
|
|
1450
|
+
*/
|
|
1451
|
+
declare type DeliveryOptionOrigin = {
|
|
1452
|
+
/**
|
|
1453
|
+
* @description Unique identifier of the origin.
|
|
1454
|
+
* @type string
|
|
1455
|
+
*/
|
|
1456
|
+
id: string;
|
|
1457
|
+
/**
|
|
1458
|
+
* @description Represents an address suitable for delivery.
|
|
1459
|
+
* @type object
|
|
1460
|
+
*/
|
|
1461
|
+
address: V1AlphaDeliveryAddress;
|
|
1462
|
+
/**
|
|
1463
|
+
* @description External identifier of the origin, used for integration purposes.
|
|
1464
|
+
* @type string | undefined
|
|
1465
|
+
*/
|
|
1466
|
+
external_id?: string;
|
|
1467
|
+
};
|
|
1468
|
+
|
|
1469
|
+
declare type DeliveryParticleParams = {
|
|
1470
|
+
mode: 'active' | 'passive';
|
|
1471
|
+
name: string;
|
|
1472
|
+
customization?: {
|
|
1473
|
+
choice?: {
|
|
1474
|
+
carrierInstructions?: 'off' | 'inline' | 'popup';
|
|
1475
|
+
gaplessAddonsList?: boolean;
|
|
1476
|
+
gaplessCarrierList?: boolean;
|
|
1477
|
+
gaplessDeliveryList?: boolean;
|
|
1478
|
+
labels?: 'off' | 'chips' | 'text';
|
|
1479
|
+
showAddons?: boolean;
|
|
1480
|
+
showCustomInfoText?: boolean;
|
|
1481
|
+
showCustomText?: boolean;
|
|
1482
|
+
showDiscountedPrice?: boolean;
|
|
1483
|
+
showFreeShippingIndicator?: boolean;
|
|
1484
|
+
showPrice?: boolean;
|
|
1485
|
+
showRadioIndicator?: boolean;
|
|
1486
|
+
showReturnPromise?: boolean;
|
|
1487
|
+
showShippingLogo?: boolean;
|
|
1488
|
+
};
|
|
1489
|
+
location?: {
|
|
1490
|
+
gaplessList?: boolean;
|
|
1491
|
+
mapDefaultVisible?: boolean;
|
|
1492
|
+
mapDefaultZoom?: number;
|
|
1493
|
+
mapFitboundsMaxZoom?: number;
|
|
1494
|
+
mapPosition?: 'start' | 'end';
|
|
1495
|
+
mapToggleEnabled?: boolean;
|
|
1496
|
+
};
|
|
1497
|
+
productList?: {
|
|
1498
|
+
defaultView?: 'off' | 'list' | 'summary';
|
|
1499
|
+
showImage?: boolean;
|
|
1500
|
+
showMetadata?: boolean;
|
|
1501
|
+
showPrice?: boolean;
|
|
1502
|
+
showQuantity?: boolean;
|
|
1503
|
+
summaryText?: 'none' | 'products' | 'firstProductAndMore';
|
|
1504
|
+
};
|
|
1505
|
+
summary?: {
|
|
1506
|
+
previewAddons?: boolean;
|
|
1507
|
+
showFreeShippingIndicator?: boolean;
|
|
1508
|
+
};
|
|
1509
|
+
};
|
|
1510
|
+
};
|
|
1511
|
+
|
|
1512
|
+
declare const deliveryParticleParamsValidator = z.object({
|
|
1513
|
+
customization: deliveryCustomizationValidator,
|
|
1514
|
+
|
|
1515
|
+
// TODO: the passive `mode` has hardcoded logic, but IMHO the behaviour should come from granular config (components + policies), not from `mode` branches.
|
|
1516
|
+
// Just an simple example:
|
|
1517
|
+
// components: {
|
|
1518
|
+
// continue_button: { display: 'hidden' },
|
|
1519
|
+
// pickup_location: { display: 'popup', interaction: 'preview' // or edit }
|
|
1520
|
+
// }
|
|
1521
|
+
//
|
|
1522
|
+
// actionPolicy: {
|
|
1523
|
+
// select_item: 'deny'
|
|
1524
|
+
// }
|
|
1525
|
+
//
|
|
1526
|
+
mode: z.enum(['active', 'passive']),
|
|
1527
|
+
name: z.string(),
|
|
1528
|
+
}) satisfies z.ZodType<DeliveryParticleParams>;
|
|
1529
|
+
|
|
1530
|
+
/**
|
|
1531
|
+
* @description The PickupLocation represents a physical location from which a delivery can be retrieved.
|
|
1532
|
+
*/
|
|
1533
|
+
declare type DeliveryPickupLocation = {
|
|
1534
|
+
/**
|
|
1535
|
+
* @description Internal location identifier, used within the system.
|
|
1536
|
+
* @type string
|
|
1537
|
+
*/
|
|
1538
|
+
id: string;
|
|
1539
|
+
/**
|
|
1540
|
+
* @description External identifier provided by the merchant or carrier.
|
|
1541
|
+
* @type string
|
|
1542
|
+
*/
|
|
1543
|
+
external_id: string;
|
|
1544
|
+
/**
|
|
1545
|
+
* @description LocationType defines the type of the pickup location.\n\n - LOCATION_TYPE_UNSPECIFIED: Unspecified type.\n - LOCKER: A locker pickup location.\n - STORE: A store pickup location.\n - POSTOFFICE: A post office pickup location.\n - MANNED: A manned pickup location, e.g., staffed desk.
|
|
1546
|
+
* @type string | undefined
|
|
1547
|
+
*/
|
|
1548
|
+
location_type?: PickupLocationLocationType;
|
|
1549
|
+
/**
|
|
1550
|
+
* @description The title of the location displayed to the customer.
|
|
1551
|
+
* @type string
|
|
1552
|
+
*/
|
|
1553
|
+
title: string;
|
|
1554
|
+
/**
|
|
1555
|
+
* @description Contact represents generic contact information.
|
|
1556
|
+
* @type object | undefined
|
|
1557
|
+
*/
|
|
1558
|
+
visiting_contact?: V1AlphaDeliveryContact;
|
|
1559
|
+
/**
|
|
1560
|
+
* @description Contact represents generic contact information.
|
|
1561
|
+
* @type object | undefined
|
|
1562
|
+
*/
|
|
1563
|
+
delivery_contact?: V1AlphaDeliveryContact;
|
|
1564
|
+
/**
|
|
1565
|
+
* @description OperationalHours define when the pickup location is operating.
|
|
1566
|
+
* @type object | undefined
|
|
1567
|
+
*/
|
|
1568
|
+
operational_hours?: PickupLocationOperationalHours;
|
|
1569
|
+
/**
|
|
1570
|
+
* @description Additional informational sections about the pickup location.
|
|
1571
|
+
* @type array | undefined
|
|
1572
|
+
*/
|
|
1573
|
+
sections?: PickupLocationSection[];
|
|
1574
|
+
/**
|
|
1575
|
+
* @description Distances define the walking and driving distances to the pickup location.
|
|
1576
|
+
* @type object | undefined
|
|
1577
|
+
*/
|
|
1578
|
+
distances?: PickupLocationDistances;
|
|
1579
|
+
};
|
|
1580
|
+
|
|
1581
|
+
declare interface DeliveryPresetParams {
|
|
1582
|
+
mode: ParticleParamsMap['delivery']['mode'];
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
/**
|
|
1586
|
+
* @description ReturnPromise contains promise for returns and exchanges for a user and a cart.
|
|
1587
|
+
*/
|
|
1588
|
+
declare type DeliveryReturnsPromise = {
|
|
1589
|
+
/**
|
|
1590
|
+
* @description Unique identifier for the return promise.
|
|
1591
|
+
* @type string | undefined
|
|
1592
|
+
*/
|
|
1593
|
+
readonly id?: string;
|
|
1594
|
+
/**
|
|
1595
|
+
* @description Currency code for the return promise, e.g., \"USD\", \"EUR\".
|
|
1596
|
+
* @type string | undefined
|
|
1597
|
+
*/
|
|
1598
|
+
readonly currency_code?: string;
|
|
1599
|
+
/**
|
|
1600
|
+
* @description Indicates whether returns are enabled. See `return_cost` for the associated cost.
|
|
1601
|
+
* @type boolean | undefined
|
|
1602
|
+
*/
|
|
1603
|
+
readonly returns_enabled?: boolean;
|
|
1604
|
+
/**
|
|
1605
|
+
* @description Non-negative cost of returning the item, or items. Unit is cents.
|
|
1606
|
+
* @type string | undefined, int64
|
|
1607
|
+
*/
|
|
1608
|
+
readonly return_cost?: string;
|
|
1609
|
+
/**
|
|
1610
|
+
* @description Indicates whether exchanges are enabled. See `exchange_cost` for the associated cost.
|
|
1611
|
+
* @type boolean | undefined
|
|
1612
|
+
*/
|
|
1613
|
+
readonly exchanges_enabled?: boolean;
|
|
1614
|
+
/**
|
|
1615
|
+
* @description Non-negative cost of exchanging the item, or items. Unit is cents.
|
|
1616
|
+
* @type string | undefined, int64
|
|
1617
|
+
*/
|
|
1618
|
+
readonly exchange_cost?: string;
|
|
1619
|
+
/**
|
|
1620
|
+
* @description Time in days to return or exchange the item.
|
|
1621
|
+
* @type integer | undefined, int32
|
|
1622
|
+
*/
|
|
1623
|
+
readonly return_time_days?: number;
|
|
1624
|
+
/**
|
|
1625
|
+
* @description Return Policy text suitable for presentation to the customer.
|
|
1626
|
+
* @type string | undefined
|
|
1627
|
+
*/
|
|
1628
|
+
readonly return_policy_text?: string;
|
|
1629
|
+
/**
|
|
1630
|
+
* @description Return Policy URL, which is suitable for presentation to the customer.
|
|
1631
|
+
* @type string | undefined
|
|
1632
|
+
*/
|
|
1633
|
+
readonly return_policy_url?: string;
|
|
1634
|
+
/**
|
|
1635
|
+
* @description Indicates if the return promise is unavailable due to API failures or other issues.\nWhen true, consider displaying a \"Return details unavailable\" message to the end user.
|
|
1636
|
+
* @type boolean | undefined
|
|
1637
|
+
*/
|
|
1638
|
+
readonly is_unavailable?: boolean;
|
|
1639
|
+
};
|
|
1640
|
+
|
|
1641
|
+
declare type DeliveryService = {
|
|
1642
|
+
getSession: DataResolver<GetDeliverySessionArgs, DeliverySession>;
|
|
1643
|
+
};
|
|
1644
|
+
|
|
1645
|
+
/**
|
|
1646
|
+
* @description A Session is the primary resource for handling the delivery options and the customer lifecycle.
|
|
1647
|
+
*/
|
|
1648
|
+
declare type DeliverySession = {
|
|
1649
|
+
/**
|
|
1650
|
+
* @type string | undefined
|
|
1651
|
+
*/
|
|
1652
|
+
name?: string;
|
|
1653
|
+
/**
|
|
1654
|
+
* @description State defines the current state of the session.\n\n - STATE_UNSPECIFIED: Default value. This value is unused.\n - ACTIVE: Session is active and can be modified.\n - COMPLETED: Session is completed and can not be modified.
|
|
1655
|
+
* @type string | undefined
|
|
1656
|
+
*/
|
|
1657
|
+
state?: SessionState;
|
|
1658
|
+
/**
|
|
1659
|
+
* @description Purchase describes purchase experience.
|
|
1660
|
+
* @type object
|
|
1661
|
+
*/
|
|
1662
|
+
purchase: SessionPurchase;
|
|
1663
|
+
/**
|
|
1664
|
+
* @description The deliveries included in this session.
|
|
1665
|
+
* @type array
|
|
1666
|
+
*/
|
|
1667
|
+
deliveries: V1AlphaDeliveryDelivery[];
|
|
1668
|
+
/**
|
|
1669
|
+
* @description The timestamp when the session was created.
|
|
1670
|
+
* @type string | undefined, date-time
|
|
1671
|
+
*/
|
|
1672
|
+
readonly create_time?: string;
|
|
1673
|
+
/**
|
|
1674
|
+
* @description The timestamp when the session was last updated.
|
|
1675
|
+
* @type string | undefined, date-time
|
|
1676
|
+
*/
|
|
1677
|
+
readonly update_time?: string;
|
|
1678
|
+
/**
|
|
1679
|
+
* @description The current etag of the session.\nIf an etag is provided and does not match the current etag of the session,\nupdates and completion will be blocked and an ABORTED error will be returned.
|
|
1680
|
+
* @type string | undefined
|
|
1681
|
+
*/
|
|
1682
|
+
etag?: string;
|
|
1683
|
+
/**
|
|
1684
|
+
* @description ReturnPromise contains promise for returns and exchanges for a user and a cart.
|
|
1685
|
+
* @type object | undefined
|
|
1686
|
+
*/
|
|
1687
|
+
returns_promise?: DeliveryReturnsPromise;
|
|
1688
|
+
};
|
|
1689
|
+
|
|
1690
|
+
/**
|
|
1691
|
+
* @description - UNKNOWN: Delivery type is not known for some reason\n - DELIVERY: Home delivery\n - PICKUP: Delivery to a service point or a locker\n - MAILBOX: Delivery to customer\'s mailbox\n - INSTORE: Delivery to one of the merchants stores\n - INWAREHOUSE: Delivery to the warehouse. This type is used with chain delivery in warehouse-warehouse-delivery/pickup.
|
|
1692
|
+
* @default UNKNOWN
|
|
1693
|
+
*/
|
|
1694
|
+
declare type DeliveryType = DeliveryTypeEnum;
|
|
1695
|
+
|
|
1696
|
+
declare type DeliveryTypeEnum =
|
|
1697
|
+
| 'UNKNOWN'
|
|
1698
|
+
| 'DELIVERY'
|
|
1699
|
+
| 'PICKUP'
|
|
1700
|
+
| 'MAILBOX'
|
|
1701
|
+
| 'INSTORE'
|
|
1702
|
+
| 'INWAREHOUSE';
|
|
1703
|
+
|
|
1704
|
+
/**
|
|
1705
|
+
* @description Indicates intended direction of parcel, shipment etc.\n\n - OUTBOUND: From merchant to customer.\n - RETURN: Return from customer to merchant.\n - UNSPECIFIED: Unspecified means we do not know the direction. It is the default state when we do not know any better.
|
|
1706
|
+
* @default UNKNOWN_DIRECTION_TYPE
|
|
1707
|
+
*/
|
|
1708
|
+
declare type DirectionType = DirectionTypeEnum;
|
|
1709
|
+
|
|
1710
|
+
declare type DirectionTypeEnum = 'UNKNOWN_DIRECTION_TYPE' | 'OUTBOUND' | 'RETURN' | 'UNSPECIFIED';
|
|
1711
|
+
|
|
1712
|
+
declare type DisplayItem = {
|
|
1713
|
+
/**
|
|
1714
|
+
* @type integer | undefined, int32
|
|
1715
|
+
*/
|
|
1716
|
+
discount?: number;
|
|
1717
|
+
/**
|
|
1718
|
+
* @type string | undefined
|
|
1719
|
+
*/
|
|
1720
|
+
image?: string;
|
|
1721
|
+
/**
|
|
1722
|
+
* @type string | undefined
|
|
1723
|
+
*/
|
|
1724
|
+
name?: string;
|
|
1725
|
+
/**
|
|
1726
|
+
* @type integer | undefined, int32
|
|
1727
|
+
*/
|
|
1728
|
+
price?: number;
|
|
1729
|
+
/**
|
|
1730
|
+
* @description quantity - current quantity of items.
|
|
1731
|
+
* @type integer | undefined, int32
|
|
1732
|
+
*/
|
|
1733
|
+
quantity?: number;
|
|
1734
|
+
/**
|
|
1735
|
+
* @type string | undefined
|
|
1736
|
+
*/
|
|
1737
|
+
sku?: string;
|
|
1738
|
+
/**
|
|
1739
|
+
* @type integer | undefined, int32
|
|
1740
|
+
*/
|
|
1741
|
+
total_price?: number;
|
|
1742
|
+
};
|
|
1743
|
+
|
|
1744
|
+
declare type EstimatedTime = {
|
|
1745
|
+
/**
|
|
1746
|
+
* @description Earliest date in RFC3339 format.
|
|
1747
|
+
* @type string | undefined
|
|
1748
|
+
*/
|
|
1749
|
+
earliest?: string;
|
|
1750
|
+
/**
|
|
1751
|
+
* @description Latest date in RFC3339 format.
|
|
1752
|
+
* @type string | undefined
|
|
1753
|
+
*/
|
|
1754
|
+
latest?: string;
|
|
1755
|
+
};
|
|
1756
|
+
|
|
1757
|
+
/**
|
|
1758
|
+
* @description Absolute represents an ETD as a single or pair of timestamps.
|
|
1759
|
+
*/
|
|
1760
|
+
declare type ETDAbsolute = {
|
|
1761
|
+
/**
|
|
1762
|
+
* @description The earliest possible delivery time. If unspecified, delivery is considered to be immediate.
|
|
1763
|
+
* @type string | undefined, date-time
|
|
1764
|
+
*/
|
|
1765
|
+
earliest_time?: string;
|
|
1766
|
+
/**
|
|
1767
|
+
* @description The latest possible delivery time. If unspecified, there is no guaranteed maximum time.
|
|
1768
|
+
* @type string | undefined, date-time
|
|
1769
|
+
*/
|
|
1770
|
+
latest_time?: string;
|
|
1771
|
+
};
|
|
1772
|
+
|
|
1773
|
+
/**
|
|
1774
|
+
* @description Custom represents an ETD in a human-readable text format.
|
|
1775
|
+
*/
|
|
1776
|
+
declare type ETDCustom = {
|
|
1777
|
+
/**
|
|
1778
|
+
* @description Description in a text form, e.g., \"Before Christmas\", \"Same day if ordered before 2PM\".
|
|
1779
|
+
* @type string
|
|
1780
|
+
*/
|
|
1781
|
+
text: string;
|
|
1782
|
+
};
|
|
1783
|
+
|
|
1784
|
+
/**
|
|
1785
|
+
* @description Relative represents an ETD as a range of time units.
|
|
1786
|
+
*/
|
|
1787
|
+
declare type ETDRelative = {
|
|
1788
|
+
/**
|
|
1789
|
+
* @description TimeUnit specifies the unit of time measurement for ETD.\n\n - TIME_UNIT_UNSPECIFIED: Default value. This value is unused.\n - TIME_UNIT_MINUTE: Minutes\n - TIME_UNIT_HOUR: Hours\n - TIME_UNIT_DAY: Calendar days\n - TIME_UNIT_BUSINESS_DAY: Business days (excluding weekends and holidays)\n - TIME_UNIT_WEEK: Calendar weeks\n - TIME_UNIT_MONTH: Calendar months
|
|
1790
|
+
* @type string
|
|
1791
|
+
*/
|
|
1792
|
+
unit: ETDTimeUnit;
|
|
1793
|
+
/**
|
|
1794
|
+
* @description The minimum number of time units. If unspecified, there is no lower bound.\nValue of zero means delivery within the same time unit period (e.g., same day if unit is DAY).
|
|
1795
|
+
* @type integer | undefined, int32
|
|
1796
|
+
*/
|
|
1797
|
+
earliest?: number;
|
|
1798
|
+
/**
|
|
1799
|
+
* @description Maximum number of time units. If unspecified, there is no upper bound.\nValue of zero means delivery within the same time unit period (e.g., same day if unit is DAY).
|
|
1800
|
+
* @type integer | undefined, int32
|
|
1801
|
+
*/
|
|
1802
|
+
latest?: number;
|
|
1803
|
+
};
|
|
1804
|
+
|
|
1805
|
+
/**
|
|
1806
|
+
* @description TimeUnit specifies the unit of time measurement for ETD.\n\n - TIME_UNIT_UNSPECIFIED: Default value. This value is unused.\n - TIME_UNIT_MINUTE: Minutes\n - TIME_UNIT_HOUR: Hours\n - TIME_UNIT_DAY: Calendar days\n - TIME_UNIT_BUSINESS_DAY: Business days (excluding weekends and holidays)\n - TIME_UNIT_WEEK: Calendar weeks\n - TIME_UNIT_MONTH: Calendar months
|
|
1807
|
+
* @default TIME_UNIT_UNSPECIFIED
|
|
1808
|
+
*/
|
|
1809
|
+
declare type ETDTimeUnit = ETDTimeUnitEnum;
|
|
1810
|
+
|
|
1811
|
+
declare type ETDTimeUnitEnum =
|
|
1812
|
+
| 'TIME_UNIT_UNSPECIFIED'
|
|
1813
|
+
| 'TIME_UNIT_MINUTE'
|
|
1814
|
+
| 'TIME_UNIT_HOUR'
|
|
1815
|
+
| 'TIME_UNIT_DAY'
|
|
1816
|
+
| 'TIME_UNIT_BUSINESS_DAY'
|
|
1817
|
+
| 'TIME_UNIT_WEEK'
|
|
1818
|
+
| 'TIME_UNIT_MONTH';
|
|
1819
|
+
|
|
1820
|
+
declare type Event_2<T> = { payload: T };
|
|
1821
|
+
|
|
1822
|
+
declare type EventsMap = {
|
|
1823
|
+
countryChange: (event: Event_2<{ country_code: string }>) => void;
|
|
1824
|
+
addressSubmit: (event: Event_2<AddressParticleInputState>) => void;
|
|
1825
|
+
selectionChange: (event: Event_2<{ deliveryId: string; categoryId: string }>) => void;
|
|
1826
|
+
ready: () => void;
|
|
1827
|
+
error: (error: unknown) => void;
|
|
1828
|
+
};
|
|
1829
|
+
|
|
1830
|
+
declare type ExceptionStatus = {
|
|
1831
|
+
/**
|
|
1832
|
+
* @type string | undefined
|
|
1833
|
+
*/
|
|
1834
|
+
created_at?: string;
|
|
1835
|
+
/**
|
|
1836
|
+
* @description status of the exception currently conforms to the `tracking.Status`.
|
|
1837
|
+
* @type string | undefined
|
|
1838
|
+
*/
|
|
1839
|
+
status?: string;
|
|
1840
|
+
};
|
|
1841
|
+
|
|
1842
|
+
declare interface FreeShippingIndicatorDebugParams {
|
|
1843
|
+
name: string;
|
|
1844
|
+
customization?: ParticleCustomizationConfig<'freeShippingIndicator'>;
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
declare type FreeShippingIndicatorParams = {
|
|
1848
|
+
name: string;
|
|
1849
|
+
deliveryId?: string;
|
|
1850
|
+
customization?: {
|
|
1851
|
+
showExhaustedLevelsMessage?: boolean;
|
|
1852
|
+
};
|
|
1853
|
+
};
|
|
1854
|
+
|
|
1855
|
+
declare const freeShippingIndicatorParticleParamsValidator = z.object({
|
|
1856
|
+
name: z.string(),
|
|
1857
|
+
deliveryId: z.string().optional(),
|
|
1858
|
+
customization: z
|
|
1859
|
+
.object({
|
|
1860
|
+
showExhaustedLevelsMessage: z.boolean().optional(),
|
|
1861
|
+
})
|
|
1862
|
+
.optional(),
|
|
1863
|
+
}) satisfies z.ZodType<FreeShippingIndicatorParams>;
|
|
1864
|
+
|
|
1865
|
+
/**
|
|
1866
|
+
* @description Readiness specifies a time range when the goods will be ready for shipment.
|
|
1867
|
+
*/
|
|
1868
|
+
declare type FulfillmentReadiness = {
|
|
1869
|
+
/**
|
|
1870
|
+
* @description The earliest timestamp when the goods will be ready for shipment.
|
|
1871
|
+
* @type string, date-time
|
|
1872
|
+
*/
|
|
1873
|
+
earliest_time: string;
|
|
1874
|
+
/**
|
|
1875
|
+
* @description The latest timestamp when the goods will be ready for shipment.\nIf not specified, the goods will be ready indefinitely after start_time.
|
|
1876
|
+
* @type string | undefined, date-time
|
|
1877
|
+
*/
|
|
1878
|
+
latest_time?: string;
|
|
1879
|
+
};
|
|
1880
|
+
|
|
1881
|
+
/**
|
|
1882
|
+
* @description The request has succeeded.
|
|
1883
|
+
*/
|
|
1884
|
+
declare type GetAddressDetails200 = AddressDetailsResponse;
|
|
1885
|
+
|
|
1886
|
+
/**
|
|
1887
|
+
* @description The server could not understand the request due to invalid syntax.
|
|
1888
|
+
*/
|
|
1889
|
+
declare type GetAddressDetails400 = AtlasErrorsBadRequestError;
|
|
1890
|
+
|
|
1891
|
+
/**
|
|
1892
|
+
* @description The server cannot find the requested resource.
|
|
1893
|
+
*/
|
|
1894
|
+
declare type GetAddressDetails404 = AtlasErrorsNotFoundError;
|
|
1895
|
+
|
|
1896
|
+
/**
|
|
1897
|
+
* @description Server error
|
|
1898
|
+
*/
|
|
1899
|
+
declare type GetAddressDetails500 = AtlasErrorsServerError;
|
|
1900
|
+
|
|
1901
|
+
declare type GetAddressDetailsPathParams = {
|
|
1902
|
+
/**
|
|
1903
|
+
* @description The opaque identifier from a prediction (where `action` was `resolve`).
|
|
1904
|
+
* @type string
|
|
1905
|
+
*/
|
|
1906
|
+
id: string;
|
|
1907
|
+
};
|
|
1908
|
+
|
|
1909
|
+
declare type GetAddressDetailsQuery = {
|
|
1910
|
+
Response: GetAddressDetails200;
|
|
1911
|
+
PathParams: GetAddressDetailsPathParams;
|
|
1912
|
+
Errors: GetAddressDetails400 | GetAddressDetails404 | GetAddressDetails500;
|
|
1913
|
+
};
|
|
1914
|
+
|
|
1915
|
+
declare type GetDeliverySessionArgs = z.infer<typeof deliveryArgsSchema>;
|
|
1916
|
+
|
|
1917
|
+
declare type GetTrackingDataArgs = z.infer<typeof trackingArgsSchema>;
|
|
1918
|
+
|
|
1919
|
+
declare type GetTrackingDataResponse = {
|
|
1920
|
+
/**
|
|
1921
|
+
* @type boolean
|
|
1922
|
+
*/
|
|
1923
|
+
has_private_view: boolean;
|
|
1924
|
+
/**
|
|
1925
|
+
* @type object
|
|
1926
|
+
*/
|
|
1927
|
+
order: Order;
|
|
1928
|
+
/**
|
|
1929
|
+
* @description parcel_options is a map of parcel tracking numbers to options.
|
|
1930
|
+
* @type object | undefined
|
|
1931
|
+
*/
|
|
1932
|
+
parcel_options?: Record<string, GetTrackingDataResponseOptions>;
|
|
1933
|
+
/**
|
|
1934
|
+
* @type string
|
|
1935
|
+
*/
|
|
1936
|
+
site_id: string;
|
|
1937
|
+
/**
|
|
1938
|
+
* @type string
|
|
1939
|
+
*/
|
|
1940
|
+
tos_id: string;
|
|
1941
|
+
};
|
|
1942
|
+
|
|
1943
|
+
declare type GetTrackingDataResponseOptions = {
|
|
1944
|
+
/**
|
|
1945
|
+
* @type boolean | undefined
|
|
1946
|
+
*/
|
|
1947
|
+
ica_bankid_flow?: boolean;
|
|
1948
|
+
};
|
|
1949
|
+
|
|
1950
|
+
declare function initIngrid(params: Params): Promise<{
|
|
1951
|
+
compound: {
|
|
1952
|
+
mount: (containerSelector: string, options?: {
|
|
1953
|
+
signal?: AbortSignal;
|
|
1954
|
+
}) => Promise<void>;
|
|
1955
|
+
unmount: (callback?: (() => void) | undefined) => void;
|
|
1956
|
+
update: (newConfig: Partial<UpdatableConfig>) => void;
|
|
1957
|
+
on: <K extends keyof EventsMap>(event: K, callback: EventsMap[K]) => () => boolean;
|
|
1958
|
+
};
|
|
1959
|
+
setLocale: (locale: Locale) => void;
|
|
1960
|
+
__internal: SDKInternal;
|
|
1961
|
+
}>;
|
|
1962
|
+
export default initIngrid;
|
|
1963
|
+
|
|
1964
|
+
declare const _internalBrand: unique symbol;
|
|
1965
|
+
|
|
1966
|
+
declare type Item = {
|
|
1967
|
+
/**
|
|
1968
|
+
* @description Attributes represents a collection of key-value pairs containing additional item properties.\nBoth keys and values are strings. Examples: {\"brand\": \"Nike\", \"material\": \"cotton\"}.
|
|
1969
|
+
* @type object | undefined
|
|
1970
|
+
*/
|
|
1971
|
+
attributes?: Record<string, string>;
|
|
1972
|
+
/**
|
|
1973
|
+
* @description CancelledQuantity is the number of items that have been cancelled.
|
|
1974
|
+
* @type integer | undefined, int32
|
|
1975
|
+
*/
|
|
1976
|
+
cancelled_quantity?: number;
|
|
1977
|
+
/**
|
|
1978
|
+
* @description CancelledTotalPrice is the total price for all cancelled items of the same SKU in cents.
|
|
1979
|
+
* @type integer | undefined, int32
|
|
1980
|
+
*/
|
|
1981
|
+
cancelled_total_price?: number;
|
|
1982
|
+
/**
|
|
1983
|
+
* @description Discount is the discount for a given item in cents. Example: `20000` represents `200.00`.
|
|
1984
|
+
* @type integer | undefined, int32
|
|
1985
|
+
*/
|
|
1986
|
+
discount?: number;
|
|
1987
|
+
/**
|
|
1988
|
+
* @description Image is the URL of the image of the given cart item.
|
|
1989
|
+
* @type string | undefined
|
|
1990
|
+
*/
|
|
1991
|
+
image?: string;
|
|
1992
|
+
/**
|
|
1993
|
+
* @description Name is the product name or title.
|
|
1994
|
+
* @type string | undefined
|
|
1995
|
+
*/
|
|
1996
|
+
name?: string;
|
|
1997
|
+
/**
|
|
1998
|
+
* @description Price is the price of a single item with applied discounts in cents. Example: `20000` represents `200.00`.
|
|
1999
|
+
* @type integer | undefined, int32
|
|
2000
|
+
*/
|
|
2001
|
+
price?: number;
|
|
2002
|
+
/**
|
|
2003
|
+
* @description Quantity is the total number of a given non-cancelled product item in the cart.
|
|
2004
|
+
* @type integer | undefined, int32
|
|
2005
|
+
*/
|
|
2006
|
+
quantity?: number;
|
|
2007
|
+
/**
|
|
2008
|
+
* @description SKU is a unique product identifier.
|
|
2009
|
+
* @type string | undefined
|
|
2010
|
+
*/
|
|
2011
|
+
sku?: string;
|
|
2012
|
+
/**
|
|
2013
|
+
* @type integer | undefined, int32
|
|
2014
|
+
*/
|
|
2015
|
+
total_price?: number;
|
|
2016
|
+
/**
|
|
2017
|
+
* @description Properties that define item variant.
|
|
2018
|
+
* @type object | undefined
|
|
2019
|
+
*/
|
|
2020
|
+
variant?: ItemVariant;
|
|
2021
|
+
};
|
|
2022
|
+
|
|
2023
|
+
/**
|
|
2024
|
+
* @description Properties that define item variant.
|
|
2025
|
+
*/
|
|
2026
|
+
declare type ItemVariant = {
|
|
2027
|
+
/**
|
|
2028
|
+
* @type string | undefined
|
|
2029
|
+
*/
|
|
2030
|
+
color?: string;
|
|
2031
|
+
/**
|
|
2032
|
+
* @type string | undefined
|
|
2033
|
+
*/
|
|
2034
|
+
size?: string;
|
|
2035
|
+
};
|
|
2036
|
+
|
|
2037
|
+
/**
|
|
2038
|
+
* @description LabelType defines the type of label.\n\n - LABEL_TYPE_UNKNOWN: Label type is unknown.\n - LABEL_TYPE_SUSTAINABILITY: A sustainability-related label.\n - LABEL_TYPE_PRIORITY: A priority delivery label.\n - LABEL_TYPE_CUSTOM: A custom label defined by the merchant.\n - LABEL_TYPE_SWAN: A Nordic Swan eco-label.
|
|
2039
|
+
* @default LABEL_TYPE_UNKNOWN
|
|
2040
|
+
*/
|
|
2041
|
+
declare type LabelLabelType = LabelLabelTypeEnum;
|
|
2042
|
+
|
|
2043
|
+
declare type LabelLabelTypeEnum =
|
|
2044
|
+
| 'LABEL_TYPE_UNKNOWN'
|
|
2045
|
+
| 'LABEL_TYPE_SUSTAINABILITY'
|
|
2046
|
+
| 'LABEL_TYPE_PRIORITY'
|
|
2047
|
+
| 'LABEL_TYPE_CUSTOM'
|
|
2048
|
+
| 'LABEL_TYPE_SWAN';
|
|
2049
|
+
|
|
2050
|
+
declare type LineItem = {
|
|
2051
|
+
/**
|
|
2052
|
+
* @description Currency represented as a symbol (ISO-4217 - 3 letters string). Examples: USD, PLN, SEK.
|
|
2053
|
+
* @type string
|
|
2054
|
+
*/
|
|
2055
|
+
currency: string;
|
|
2056
|
+
/**
|
|
2057
|
+
* @description Discount is the discount for a given item in cents. Example: `20000` represents `200.00`.
|
|
2058
|
+
* @type integer | undefined, int32
|
|
2059
|
+
*/
|
|
2060
|
+
discount?: number;
|
|
2061
|
+
/**
|
|
2062
|
+
* @description Image is the URL of the image of the given cart item.
|
|
2063
|
+
* @type string | undefined
|
|
2064
|
+
*/
|
|
2065
|
+
image?: string;
|
|
2066
|
+
/**
|
|
2067
|
+
* @description Name is the product name or title.
|
|
2068
|
+
* @type string | undefined
|
|
2069
|
+
*/
|
|
2070
|
+
name?: string;
|
|
2071
|
+
/**
|
|
2072
|
+
* @description Price is the price of a single item with applied discounts in cents. Example: `20000` represents `200.00`.
|
|
2073
|
+
* @type integer, int32
|
|
2074
|
+
*/
|
|
2075
|
+
price: number;
|
|
2076
|
+
/**
|
|
2077
|
+
* @description Properties that define item variant.
|
|
2078
|
+
* @type object | undefined
|
|
2079
|
+
*/
|
|
2080
|
+
properties?: Record<string, string>;
|
|
2081
|
+
/**
|
|
2082
|
+
* @description Quantity is the total number of a given product item in the cart.
|
|
2083
|
+
* @type integer, int32
|
|
2084
|
+
*/
|
|
2085
|
+
quantity: number;
|
|
2086
|
+
/**
|
|
2087
|
+
* @description SKU is a unique product identifier.
|
|
2088
|
+
* @type string
|
|
2089
|
+
*/
|
|
2090
|
+
sku: string;
|
|
2091
|
+
/**
|
|
2092
|
+
* @type integer | undefined, int32
|
|
2093
|
+
*/
|
|
2094
|
+
total_price?: number;
|
|
2095
|
+
};
|
|
2096
|
+
|
|
2097
|
+
/**
|
|
2098
|
+
* @description Represents the dimensions of the item.
|
|
2099
|
+
*/
|
|
2100
|
+
declare type LineItemDimensions = {
|
|
2101
|
+
/**
|
|
2102
|
+
* @description Height of the item in millimeters, must be greater than 0.
|
|
2103
|
+
* @type integer, int32
|
|
2104
|
+
*/
|
|
2105
|
+
height: number;
|
|
2106
|
+
/**
|
|
2107
|
+
* @description Length of the item in millimeters, must be greater than 0.
|
|
2108
|
+
* @type integer, int32
|
|
2109
|
+
*/
|
|
2110
|
+
length: number;
|
|
2111
|
+
/**
|
|
2112
|
+
* @description Width of the item in millimeters, must be greater than 0.
|
|
2113
|
+
* @type integer, int32
|
|
2114
|
+
*/
|
|
2115
|
+
width: number;
|
|
2116
|
+
};
|
|
2117
|
+
|
|
2118
|
+
declare type Locale = 'en-US' | 'pl-PL' | 'sv-SE';
|
|
2119
|
+
|
|
2120
|
+
declare type Location_2 = {
|
|
2121
|
+
/**
|
|
2122
|
+
* @description Common address entity that used almost everywhere in Ingrid\'s API.
|
|
2123
|
+
* @type object
|
|
2124
|
+
*/
|
|
2125
|
+
address: Address;
|
|
2126
|
+
/**
|
|
2127
|
+
* @description location_external_id - external identifier for the location.
|
|
2128
|
+
* @type string | undefined
|
|
2129
|
+
*/
|
|
2130
|
+
location_external_id?: string;
|
|
2131
|
+
/**
|
|
2132
|
+
* @description - UNKNOWN_PICKUP_LOCATION_TYPE: Location type is not known for some reason\n - LOCKER: Locker location type. Example Instabox or a DHL locker\n - STORE: Can be a merchant\'s store or any other store that handles logistics\n - POSTOFFICE: Postal office\n - MANNED: A manned service point\n - AGE_VERIFICATION: Location that supports age verification (age check)
|
|
2133
|
+
* @type string | undefined
|
|
2134
|
+
*/
|
|
2135
|
+
location_type?: PickupLocationType;
|
|
2136
|
+
/**
|
|
2137
|
+
* @type object | undefined
|
|
2138
|
+
*/
|
|
2139
|
+
operational_hours?: OperationalHours;
|
|
2140
|
+
/**
|
|
2141
|
+
* @description pickup_instructions - instructions for the customer to pick up the parcel.
|
|
2142
|
+
* @type string | undefined
|
|
2143
|
+
*/
|
|
2144
|
+
pickup_instructions?: string;
|
|
2145
|
+
};
|
|
2146
|
+
|
|
2147
|
+
/**
|
|
2148
|
+
* @description To reference an existing location.
|
|
2149
|
+
*/
|
|
2150
|
+
declare type LocationByRef = {
|
|
2151
|
+
/**
|
|
2152
|
+
* @description External identifier provided by the merchant or carrier.
|
|
2153
|
+
* @type string
|
|
2154
|
+
*/
|
|
2155
|
+
external_id: string;
|
|
2156
|
+
};
|
|
2157
|
+
|
|
2158
|
+
/**
|
|
2159
|
+
* @description To provide full information about the location.
|
|
2160
|
+
*/
|
|
2161
|
+
declare type LocationByValue = {
|
|
2162
|
+
/**
|
|
2163
|
+
* @description External identifier provided by the merchant or carrier.
|
|
2164
|
+
* @type string
|
|
2165
|
+
*/
|
|
2166
|
+
external_id: string;
|
|
2167
|
+
/**
|
|
2168
|
+
* @description Contact represents generic contact information.
|
|
2169
|
+
* @type object
|
|
2170
|
+
*/
|
|
2171
|
+
delivery_contact: V1AlphaDeliveryContact;
|
|
2172
|
+
/**
|
|
2173
|
+
* @description Contact represents generic contact information.
|
|
2174
|
+
* @type object | undefined
|
|
2175
|
+
*/
|
|
2176
|
+
visiting_contact?: V1AlphaDeliveryContact;
|
|
2177
|
+
/**
|
|
2178
|
+
* @description Location name that is displayed to the customer.
|
|
2179
|
+
* @type string | undefined
|
|
2180
|
+
*/
|
|
2181
|
+
display_name?: string;
|
|
2182
|
+
};
|
|
2183
|
+
|
|
2184
|
+
declare type MethodOverrides<T> = {
|
|
2185
|
+
[K in keyof T]?: T[K] extends (...args: any[]) => any ? T[K] | WithDefault<T[K]> : never;
|
|
2186
|
+
};
|
|
2187
|
+
|
|
2188
|
+
declare type MoleculesConfig = {
|
|
2189
|
+
[K in ParticleType]: BaseParticleDef<K>;
|
|
2190
|
+
}[ParticleType][];
|
|
2191
|
+
|
|
2192
|
+
declare type OperationalHours = {
|
|
2193
|
+
/**
|
|
2194
|
+
* @type array | undefined
|
|
2195
|
+
*/
|
|
2196
|
+
free_text?: string[];
|
|
2197
|
+
/**
|
|
2198
|
+
* @type string | undefined
|
|
2199
|
+
*/
|
|
2200
|
+
fri?: string;
|
|
2201
|
+
/**
|
|
2202
|
+
* @type string | undefined
|
|
2203
|
+
*/
|
|
2204
|
+
mon?: string;
|
|
2205
|
+
/**
|
|
2206
|
+
* @type string | undefined
|
|
2207
|
+
*/
|
|
2208
|
+
sat?: string;
|
|
2209
|
+
/**
|
|
2210
|
+
* @type string | undefined
|
|
2211
|
+
*/
|
|
2212
|
+
sun?: string;
|
|
2213
|
+
/**
|
|
2214
|
+
* @type string | undefined
|
|
2215
|
+
*/
|
|
2216
|
+
thu?: string;
|
|
2217
|
+
/**
|
|
2218
|
+
* @type string | undefined
|
|
2219
|
+
*/
|
|
2220
|
+
tue?: string;
|
|
2221
|
+
/**
|
|
2222
|
+
* @type string | undefined
|
|
2223
|
+
*/
|
|
2224
|
+
wed?: string;
|
|
2225
|
+
};
|
|
2226
|
+
|
|
2227
|
+
declare type Order = {
|
|
2228
|
+
/**
|
|
2229
|
+
* @type string | undefined
|
|
2230
|
+
*/
|
|
2231
|
+
access_token?: string;
|
|
2232
|
+
/**
|
|
2233
|
+
* @type string
|
|
2234
|
+
*/
|
|
2235
|
+
analytics_id: string;
|
|
2236
|
+
/**
|
|
2237
|
+
* @type object | undefined
|
|
2238
|
+
*/
|
|
2239
|
+
cart?: OrderCart;
|
|
2240
|
+
/**
|
|
2241
|
+
* @type string | undefined
|
|
2242
|
+
*/
|
|
2243
|
+
external_id?: string;
|
|
2244
|
+
/**
|
|
2245
|
+
* @type array | undefined
|
|
2246
|
+
*/
|
|
2247
|
+
items?: DisplayItem[];
|
|
2248
|
+
/**
|
|
2249
|
+
* @type array | undefined
|
|
2250
|
+
*/
|
|
2251
|
+
parcels?: Parcel[];
|
|
2252
|
+
/**
|
|
2253
|
+
* @type string | undefined, int64
|
|
2254
|
+
*/
|
|
2255
|
+
preselected_parcel_index?: string;
|
|
2256
|
+
/**
|
|
2257
|
+
* @type string | undefined
|
|
2258
|
+
*/
|
|
2259
|
+
preselected_parcel_tracking_number?: string;
|
|
2260
|
+
/**
|
|
2261
|
+
* @description sender_name is the name of the sender of the order. This maybe a site name or a merchant name.
|
|
2262
|
+
* @type string | undefined
|
|
2263
|
+
*/
|
|
2264
|
+
sender_name?: string;
|
|
2265
|
+
/**
|
|
2266
|
+
* @type string | undefined
|
|
2267
|
+
*/
|
|
2268
|
+
site_name?: string;
|
|
2269
|
+
};
|
|
2270
|
+
|
|
2271
|
+
declare type OrderCart = {
|
|
2272
|
+
/**
|
|
2273
|
+
* @type string | undefined
|
|
2274
|
+
*/
|
|
2275
|
+
currency?: string;
|
|
2276
|
+
/**
|
|
2277
|
+
* @type array | undefined
|
|
2278
|
+
*/
|
|
2279
|
+
items?: Item[];
|
|
2280
|
+
/**
|
|
2281
|
+
* @type object | undefined
|
|
2282
|
+
*/
|
|
2283
|
+
prices?: OrderCartPrices;
|
|
2284
|
+
};
|
|
2285
|
+
|
|
2286
|
+
declare type OrderCartPrices = {
|
|
2287
|
+
/**
|
|
2288
|
+
* @description ShippingComponents represents the shipping components of the cart.
|
|
2289
|
+
* @type array | undefined
|
|
2290
|
+
*/
|
|
2291
|
+
shipping_components?: OrderCartPricesShippingComponent[];
|
|
2292
|
+
/**
|
|
2293
|
+
* @type object | undefined
|
|
2294
|
+
*/
|
|
2295
|
+
total?: OrderCartPricesTotals;
|
|
2296
|
+
};
|
|
2297
|
+
|
|
2298
|
+
declare type OrderCartPricesShippingComponent = {
|
|
2299
|
+
/**
|
|
2300
|
+
* @description Discount represents the discount of the shipping component in cents.
|
|
2301
|
+
* @type integer | undefined, int32
|
|
2302
|
+
*/
|
|
2303
|
+
discount?: number;
|
|
2304
|
+
/**
|
|
2305
|
+
* @description Name represents the name of the shipping component. Translated to the given locale.
|
|
2306
|
+
* @type string | undefined
|
|
2307
|
+
*/
|
|
2308
|
+
name?: string;
|
|
2309
|
+
/**
|
|
2310
|
+
* @description Price represents the price of the shipping component in cents.
|
|
2311
|
+
* @type integer | undefined, int32
|
|
2312
|
+
*/
|
|
2313
|
+
price?: number;
|
|
2314
|
+
};
|
|
2315
|
+
|
|
2316
|
+
declare type OrderCartPricesTotals = {
|
|
2317
|
+
/**
|
|
2318
|
+
* @description Discount represents the total discount of the cart with a shipping discount included.
|
|
2319
|
+
* @type integer | undefined, int32
|
|
2320
|
+
*/
|
|
2321
|
+
discount?: number;
|
|
2322
|
+
/**
|
|
2323
|
+
* @description ItemsDiscount represents the total discount of the cart items in cents.
|
|
2324
|
+
* @type integer | undefined, int32
|
|
2325
|
+
*/
|
|
2326
|
+
items_discount?: number;
|
|
2327
|
+
/**
|
|
2328
|
+
* @description ItemsPrice represents the total price of the cart items in cents with items discount applied.
|
|
2329
|
+
* @type integer | undefined, int32
|
|
2330
|
+
*/
|
|
2331
|
+
items_price?: number;
|
|
2332
|
+
/**
|
|
2333
|
+
* @description Price represents the total price of the cart in cents with discount and shipping price applied.
|
|
2334
|
+
* @type integer | undefined, int32
|
|
2335
|
+
*/
|
|
2336
|
+
price?: number;
|
|
2337
|
+
/**
|
|
2338
|
+
* @description ShippingDiscount represents the total shipping discount of the cart in cents.
|
|
2339
|
+
* @type integer | undefined, int32
|
|
2340
|
+
*/
|
|
2341
|
+
shipping_discount?: number;
|
|
2342
|
+
/**
|
|
2343
|
+
* @description ShippingPrice represents the total shipping price of the cart in cents with shipping discount applied.
|
|
2344
|
+
* @type integer | undefined, int32
|
|
2345
|
+
*/
|
|
2346
|
+
shipping_price?: number;
|
|
2347
|
+
/**
|
|
2348
|
+
* @description Tax represents the total tax of the cart in cents.
|
|
2349
|
+
* @type integer | undefined, int32
|
|
2350
|
+
*/
|
|
2351
|
+
tax?: number;
|
|
2352
|
+
};
|
|
2353
|
+
|
|
2354
|
+
export declare interface Params {
|
|
2355
|
+
styles?: StyleTokens;
|
|
2356
|
+
dataProviders?: {
|
|
2357
|
+
services?: ServicesOverrides;
|
|
2358
|
+
};
|
|
2359
|
+
token: string;
|
|
2360
|
+
siteId: string;
|
|
2361
|
+
locale: Locale;
|
|
2362
|
+
molecules: MoleculesConfig;
|
|
2363
|
+
env?: 'production' | 'stage' | 'development';
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
declare type Parcel = {
|
|
2367
|
+
/**
|
|
2368
|
+
* @type array | undefined
|
|
2369
|
+
*/
|
|
2370
|
+
alerts?: Alert[];
|
|
2371
|
+
/**
|
|
2372
|
+
* @type string | undefined
|
|
2373
|
+
*/
|
|
2374
|
+
carrier?: string;
|
|
2375
|
+
/**
|
|
2376
|
+
* @description Enabled when we\'re not receiving tracking updates.\nLike when the always_show_tracking_links flag is enabled on the carrier product.
|
|
2377
|
+
* @type boolean | undefined
|
|
2378
|
+
*/
|
|
2379
|
+
carrier_fallback_enabled?: boolean;
|
|
2380
|
+
/**
|
|
2381
|
+
* @description carrier_link is the link to the carrier\'s tracking.
|
|
2382
|
+
* @type string | undefined
|
|
2383
|
+
*/
|
|
2384
|
+
carrier_link?: string;
|
|
2385
|
+
/**
|
|
2386
|
+
* @type string | undefined
|
|
2387
|
+
*/
|
|
2388
|
+
carrier_product_id?: string;
|
|
2389
|
+
/**
|
|
2390
|
+
* @type string | undefined
|
|
2391
|
+
*/
|
|
2392
|
+
carrier_product_ref?: string;
|
|
2393
|
+
/**
|
|
2394
|
+
* @description - UNKNOWN: Delivery type is not known for some reason\n - DELIVERY: Home delivery\n - PICKUP: Delivery to a service point or a locker\n - MAILBOX: Delivery to customer\'s mailbox\n - INSTORE: Delivery to one of the merchants stores\n - INWAREHOUSE: Delivery to the warehouse. This type is used with chain delivery in warehouse-warehouse-delivery/pickup.
|
|
2395
|
+
* @type string | undefined
|
|
2396
|
+
*/
|
|
2397
|
+
delivery_type?: DeliveryType;
|
|
2398
|
+
/**
|
|
2399
|
+
* @description Indicates intended direction of parcel, shipment etc.\n\n - OUTBOUND: From merchant to customer.\n - RETURN: Return from customer to merchant.\n - UNSPECIFIED: Unspecified means we do not know the direction. It is the default state when we do not know any better.
|
|
2400
|
+
* @type string | undefined
|
|
2401
|
+
*/
|
|
2402
|
+
direction_type?: DirectionType;
|
|
2403
|
+
/**
|
|
2404
|
+
* @type string | undefined
|
|
2405
|
+
*/
|
|
2406
|
+
display_carrier_name?: string;
|
|
2407
|
+
/**
|
|
2408
|
+
* @type string | undefined
|
|
2409
|
+
*/
|
|
2410
|
+
eta?: string;
|
|
2411
|
+
/**
|
|
2412
|
+
* @description Exceptions contains list af all exceptions that happened for a given parcel.
|
|
2413
|
+
* @type array | undefined
|
|
2414
|
+
*/
|
|
2415
|
+
exceptions?: ExceptionStatus[];
|
|
2416
|
+
/**
|
|
2417
|
+
* @type integer | undefined, int32
|
|
2418
|
+
*/
|
|
2419
|
+
index?: number;
|
|
2420
|
+
/**
|
|
2421
|
+
* @type array | undefined
|
|
2422
|
+
*/
|
|
2423
|
+
line_items?: LineItem[];
|
|
2424
|
+
/**
|
|
2425
|
+
* @type object | undefined
|
|
2426
|
+
*/
|
|
2427
|
+
location?: Location_2;
|
|
2428
|
+
/**
|
|
2429
|
+
* @type array | undefined
|
|
2430
|
+
*/
|
|
2431
|
+
progress?: ProgressItem[];
|
|
2432
|
+
/**
|
|
2433
|
+
* @type string | undefined
|
|
2434
|
+
*/
|
|
2435
|
+
requested_shipping_method?: string;
|
|
2436
|
+
/**
|
|
2437
|
+
* @description sender_name is the name of the sender for this parcel.
|
|
2438
|
+
* @type string | undefined
|
|
2439
|
+
*/
|
|
2440
|
+
sender_name?: string;
|
|
2441
|
+
/**
|
|
2442
|
+
* @description Deprecated: use carrier_link instead.\nThe logic behind this value changes and the new field will guarantee the graceful switchover.
|
|
2443
|
+
* @type string | undefined
|
|
2444
|
+
*/
|
|
2445
|
+
tracking_link?: string;
|
|
2446
|
+
/**
|
|
2447
|
+
* @type string | undefined
|
|
2448
|
+
*/
|
|
2449
|
+
tracking_number?: string;
|
|
2450
|
+
};
|
|
2451
|
+
|
|
2452
|
+
declare type ParticleCustomizationConfig<T extends ParticleType> = ParticleCustomizationConfigMap[T];
|
|
2453
|
+
|
|
2454
|
+
declare type ParticleCustomizationConfigMap = {
|
|
2455
|
+
address: AddressParticleParams['customization'];
|
|
2456
|
+
countrySelector: CountrySelectorParams['customization'];
|
|
2457
|
+
delivery: DeliveryParticleParams['customization'];
|
|
2458
|
+
freeShippingIndicator: FreeShippingIndicatorParams['customization'];
|
|
2459
|
+
tracking: TrackingNumberParams['customization'];
|
|
2460
|
+
};
|
|
2461
|
+
|
|
2462
|
+
declare type ParticleMapType = {
|
|
2463
|
+
address: { readonly validator: typeof addressParticleParamsValidator };
|
|
2464
|
+
countrySelector: { readonly validator: typeof countrySelectorParticleParamsValidator };
|
|
2465
|
+
delivery: { readonly validator: typeof deliveryParticleParamsValidator };
|
|
2466
|
+
freeShippingIndicator: {
|
|
2467
|
+
readonly validator: typeof freeShippingIndicatorParticleParamsValidator;
|
|
2468
|
+
};
|
|
2469
|
+
tracking: { readonly validator: typeof trackingNumberParamsValidator };
|
|
2470
|
+
};
|
|
2471
|
+
|
|
2472
|
+
declare type ParticleParamsMap = {
|
|
2473
|
+
address: AddressParticleParams;
|
|
2474
|
+
countrySelector: CountrySelectorParams;
|
|
2475
|
+
delivery: DeliveryParticleParams;
|
|
2476
|
+
freeShippingIndicator: FreeShippingIndicatorParams;
|
|
2477
|
+
tracking: TrackingNumberParams;
|
|
2478
|
+
};
|
|
2479
|
+
|
|
2480
|
+
declare type ParticleType = keyof ParticleMapType;
|
|
2481
|
+
|
|
2482
|
+
/**
|
|
2483
|
+
* @description Distances define the walking and driving distances to the pickup location.
|
|
2484
|
+
*/
|
|
2485
|
+
declare type PickupLocationDistances = {
|
|
2486
|
+
/**
|
|
2487
|
+
* @description Represents a distance measurement with both spatial distance and estimated travel time.
|
|
2488
|
+
* @type object | undefined
|
|
2489
|
+
*/
|
|
2490
|
+
walking?: DeliveryDistance;
|
|
2491
|
+
/**
|
|
2492
|
+
* @description Represents a distance measurement with both spatial distance and estimated travel time.
|
|
2493
|
+
* @type object | undefined
|
|
2494
|
+
*/
|
|
2495
|
+
driving?: DeliveryDistance;
|
|
2496
|
+
};
|
|
2497
|
+
|
|
2498
|
+
/**
|
|
2499
|
+
* @description LocationType defines the type of the pickup location.\n\n - LOCATION_TYPE_UNSPECIFIED: Unspecified type.\n - LOCKER: A locker pickup location.\n - STORE: A store pickup location.\n - POSTOFFICE: A post office pickup location.\n - MANNED: A manned pickup location, e.g., staffed desk.
|
|
2500
|
+
* @default LOCATION_TYPE_UNSPECIFIED
|
|
2501
|
+
*/
|
|
2502
|
+
declare type PickupLocationLocationType = PickupLocationLocationTypeEnum;
|
|
2503
|
+
|
|
2504
|
+
declare type PickupLocationLocationTypeEnum =
|
|
2505
|
+
| 'LOCATION_TYPE_UNSPECIFIED'
|
|
2506
|
+
| 'LOCKER'
|
|
2507
|
+
| 'STORE'
|
|
2508
|
+
| 'POSTOFFICE'
|
|
2509
|
+
| 'MANNED';
|
|
2510
|
+
|
|
2511
|
+
/**
|
|
2512
|
+
* @description OperationalHours define when the pickup location is operating.
|
|
2513
|
+
*/
|
|
2514
|
+
declare type PickupLocationOperationalHours = {
|
|
2515
|
+
/**
|
|
2516
|
+
* @description Opening hours for Monday.
|
|
2517
|
+
* @type array | undefined
|
|
2518
|
+
*/
|
|
2519
|
+
monday?: string[];
|
|
2520
|
+
/**
|
|
2521
|
+
* @description Opening hours for Tuesday.
|
|
2522
|
+
* @type array | undefined
|
|
2523
|
+
*/
|
|
2524
|
+
tuesday?: string[];
|
|
2525
|
+
/**
|
|
2526
|
+
* @description Opening hours for Wednesday.
|
|
2527
|
+
* @type array | undefined
|
|
2528
|
+
*/
|
|
2529
|
+
wednesday?: string[];
|
|
2530
|
+
/**
|
|
2531
|
+
* @description Opening hours for Thursday.
|
|
2532
|
+
* @type array | undefined
|
|
2533
|
+
*/
|
|
2534
|
+
thursday?: string[];
|
|
2535
|
+
/**
|
|
2536
|
+
* @description Opening hours for Friday.
|
|
2537
|
+
* @type array | undefined
|
|
2538
|
+
*/
|
|
2539
|
+
friday?: string[];
|
|
2540
|
+
/**
|
|
2541
|
+
* @description Opening hours for Saturday.
|
|
2542
|
+
* @type array | undefined
|
|
2543
|
+
*/
|
|
2544
|
+
saturday?: string[];
|
|
2545
|
+
/**
|
|
2546
|
+
* @description Opening hours for Sunday.
|
|
2547
|
+
* @type array | undefined
|
|
2548
|
+
*/
|
|
2549
|
+
sunday?: string[];
|
|
2550
|
+
/**
|
|
2551
|
+
* @description Free-text operational hours for fallback.
|
|
2552
|
+
* @type array | undefined
|
|
2553
|
+
*/
|
|
2554
|
+
free_text?: string[];
|
|
2555
|
+
};
|
|
2556
|
+
|
|
2557
|
+
/**
|
|
2558
|
+
* @description Section provides extra information about the pickup location.
|
|
2559
|
+
*/
|
|
2560
|
+
declare type PickupLocationSection = {
|
|
2561
|
+
/**
|
|
2562
|
+
* @description The title of the section displayed to the customer.
|
|
2563
|
+
* @type string
|
|
2564
|
+
*/
|
|
2565
|
+
title: string;
|
|
2566
|
+
/**
|
|
2567
|
+
* @description The columns of items in the section.
|
|
2568
|
+
* @type array
|
|
2569
|
+
*/
|
|
2570
|
+
columns: SectionColumn[];
|
|
2571
|
+
};
|
|
2572
|
+
|
|
2573
|
+
/**
|
|
2574
|
+
* @description - UNKNOWN_PICKUP_LOCATION_TYPE: Location type is not known for some reason\n - LOCKER: Locker location type. Example Instabox or a DHL locker\n - STORE: Can be a merchant\'s store or any other store that handles logistics\n - POSTOFFICE: Postal office\n - MANNED: A manned service point\n - AGE_VERIFICATION: Location that supports age verification (age check)
|
|
2575
|
+
* @default UNKNOWN_PICKUP_LOCATION_TYPE
|
|
2576
|
+
*/
|
|
2577
|
+
declare type PickupLocationType = PickupLocationTypeEnum;
|
|
2578
|
+
|
|
2579
|
+
declare type PickupLocationTypeEnum =
|
|
2580
|
+
| 'UNKNOWN_PICKUP_LOCATION_TYPE'
|
|
2581
|
+
| 'LOCKER'
|
|
2582
|
+
| 'STORE'
|
|
2583
|
+
| 'POSTOFFICE'
|
|
2584
|
+
| 'MANNED'
|
|
2585
|
+
| 'AGE_VERIFICATION';
|
|
2586
|
+
|
|
2587
|
+
/**
|
|
2588
|
+
* @description A single address prediction returned by the autocomplete endpoint.
|
|
2589
|
+
*/
|
|
2590
|
+
declare type Prediction = {
|
|
2591
|
+
/**
|
|
2592
|
+
* @description Opaque identifier. Passed to the details endpoint (if `action` is `resolve`) or back to the autocomplete endpoint as `containerId` (if `action` is `expand`).
|
|
2593
|
+
* @type string
|
|
2594
|
+
*/
|
|
2595
|
+
id: string;
|
|
2596
|
+
/**
|
|
2597
|
+
* @description Primary display text (e.g., \"Buckingham Road\").
|
|
2598
|
+
* @type string
|
|
2599
|
+
*/
|
|
2600
|
+
label: string;
|
|
2601
|
+
/**
|
|
2602
|
+
* @description Secondary display text providing additional context (e.g., \"Redcar, TS10 3JQ\").
|
|
2603
|
+
* @type string | undefined
|
|
2604
|
+
*/
|
|
2605
|
+
secondaryLabel?: string;
|
|
2606
|
+
/**
|
|
2607
|
+
* @description Indicates the client action when the user selects this prediction:\n- `resolve`: Leaf node. Call the details endpoint with this prediction\'s `id`.\n- `expand`: Container node. Call the autocomplete endpoint with `containerId` set to this prediction\'s `id`.
|
|
2608
|
+
*/
|
|
2609
|
+
action: PredictionAction;
|
|
2610
|
+
/**
|
|
2611
|
+
* @description If `action` is `expand`, indicates how many child results are inside this container.\nUseful for UI badges (e.g., \"60 Addresses\").
|
|
2612
|
+
* @type integer | undefined, int32
|
|
2613
|
+
*/
|
|
2614
|
+
count?: number;
|
|
2615
|
+
/**
|
|
2616
|
+
* @description Semantic type of the result, useful for icon selection in the UI.
|
|
2617
|
+
*/
|
|
2618
|
+
type?: PredictionType;
|
|
2619
|
+
};
|
|
2620
|
+
|
|
2621
|
+
/**
|
|
2622
|
+
* @description Indicates the client action when a user selects a prediction.
|
|
2623
|
+
*/
|
|
2624
|
+
declare type PredictionAction = PredictionActionEnum;
|
|
2625
|
+
|
|
2626
|
+
declare type PredictionActionEnum = 'resolve' | 'expand';
|
|
2627
|
+
|
|
2628
|
+
/**
|
|
2629
|
+
* @description Semantic type of the prediction result, useful for icon selection in the UI.
|
|
2630
|
+
*/
|
|
2631
|
+
declare type PredictionType = PredictionTypeEnum;
|
|
2632
|
+
|
|
2633
|
+
declare type PredictionTypeEnum = 'streetAddress' | 'postalCode' | 'locality' | 'premise' | 'street';
|
|
2634
|
+
|
|
2635
|
+
declare type PriceLevelsPriceLevel = {
|
|
2636
|
+
/**
|
|
2637
|
+
* @description Indicates if this price level is active.
|
|
2638
|
+
* @type boolean | undefined
|
|
2639
|
+
*/
|
|
2640
|
+
active?: boolean;
|
|
2641
|
+
/**
|
|
2642
|
+
* @description Indicates if this is the base price.
|
|
2643
|
+
* @type boolean | undefined
|
|
2644
|
+
*/
|
|
2645
|
+
base?: boolean;
|
|
2646
|
+
/**
|
|
2647
|
+
* @description The activation price for this level.\nUnit is the smallest currency unit, e.g., cents for USD, yen for JPY.
|
|
2648
|
+
* @type string | undefined, int64
|
|
2649
|
+
*/
|
|
2650
|
+
activation_price?: string;
|
|
2651
|
+
/**
|
|
2652
|
+
* @description The delivery price for this level.\nUnit is the smallest currency unit, e.g., cents for USD, yen for JPY.
|
|
2653
|
+
* @type string | undefined, int64
|
|
2654
|
+
*/
|
|
2655
|
+
delivery_price?: string;
|
|
2656
|
+
};
|
|
2657
|
+
|
|
2658
|
+
declare type ProgressItem = {
|
|
2659
|
+
/**
|
|
2660
|
+
* @description Provides a date interval. Depending on a case, `start` and `end` parts are not guaranteed to be present.
|
|
2661
|
+
* @type object | undefined
|
|
2662
|
+
*/
|
|
2663
|
+
estimated_time?: DateTimeRange;
|
|
2664
|
+
/**
|
|
2665
|
+
* @type string
|
|
2666
|
+
*/
|
|
2667
|
+
step: Step;
|
|
2668
|
+
/**
|
|
2669
|
+
* @type string
|
|
2670
|
+
*/
|
|
2671
|
+
time: string;
|
|
2672
|
+
};
|
|
2673
|
+
|
|
2674
|
+
declare type RawTranslationKey =
|
|
2675
|
+
| 'address.address_book.billing.modal.aria.label'
|
|
2676
|
+
| 'address.address_book.delivery.modal.aria.label'
|
|
2677
|
+
| 'address.confirm'
|
|
2678
|
+
| 'address.confirm.billing.aria.label'
|
|
2679
|
+
| 'address.confirm.delivery.aria.label'
|
|
2680
|
+
| 'address.delete'
|
|
2681
|
+
| 'address.delete_confirmation.banner.content'
|
|
2682
|
+
| 'address.delete_confirmation.banner.title'
|
|
2683
|
+
| 'address.edit'
|
|
2684
|
+
| 'address.edit.billing.aria.label'
|
|
2685
|
+
| 'address.edit.delivery.aria.label'
|
|
2686
|
+
| 'address.error_modal.category_lost.description'
|
|
2687
|
+
| 'address.error_modal.category_lost.title'
|
|
2688
|
+
| 'address.error_modal.confirm'
|
|
2689
|
+
| 'address.error_modal.general.description'
|
|
2690
|
+
| 'address.error_modal.general.title'
|
|
2691
|
+
| 'address.error_modal.invalid_postal_code.description'
|
|
2692
|
+
| 'address.error_modal.invalid_postal_code.title'
|
|
2693
|
+
| 'address.error_modal.location_lost.description'
|
|
2694
|
+
| 'address.error_modal.location_lost.title'
|
|
2695
|
+
| 'address.error_modal.no_options.description'
|
|
2696
|
+
| 'address.error_modal.no_options.title'
|
|
2697
|
+
| 'address.form.add_address'
|
|
2698
|
+
| 'address.form.add_company_data'
|
|
2699
|
+
| 'address.form.field.address_details.label'
|
|
2700
|
+
| 'address.form.field.address_line.label'
|
|
2701
|
+
| 'address.form.field.address_lines.hint'
|
|
2702
|
+
| 'address.form.field.address_lines.label'
|
|
2703
|
+
| 'address.form.field.apartment_number.label'
|
|
2704
|
+
| 'address.form.field.apartment_number.tooltip'
|
|
2705
|
+
| 'address.form.field.care_of.label'
|
|
2706
|
+
| 'address.form.field.city.label'
|
|
2707
|
+
| 'address.form.field.company_name.label'
|
|
2708
|
+
| 'address.form.field.country.label'
|
|
2709
|
+
| 'address.form.field.customs_number.label'
|
|
2710
|
+
| 'address.form.field.email.label'
|
|
2711
|
+
| 'address.form.field.email.tooltip'
|
|
2712
|
+
| 'address.form.field.first_name.label'
|
|
2713
|
+
| 'address.form.field.floor_number.label'
|
|
2714
|
+
| 'address.form.field.last_name.label'
|
|
2715
|
+
| 'address.form.field.name.label'
|
|
2716
|
+
| 'address.form.field.national_id_number.label'
|
|
2717
|
+
| 'address.form.field.phone_number.label'
|
|
2718
|
+
| 'address.form.field.phone_number.tooltip'
|
|
2719
|
+
| 'address.form.field.phone_number_country.label'
|
|
2720
|
+
| 'address.form.field.po_box_id.label'
|
|
2721
|
+
| 'address.form.field.postal_code.label'
|
|
2722
|
+
| 'address.form.field.region.label'
|
|
2723
|
+
| 'address.form.field.street.label'
|
|
2724
|
+
| 'address.form.field.street_number.label'
|
|
2725
|
+
| 'address.form.field.subregion.label'
|
|
2726
|
+
| 'address.form.field.vat.label'
|
|
2727
|
+
| 'address.form.field.vat_type.label'
|
|
2728
|
+
| 'address.form.field_optional'
|
|
2729
|
+
| 'address.form.validation.address_line.invalid'
|
|
2730
|
+
| 'address.form.validation.phone_number.invalid'
|
|
2731
|
+
| 'address.form.validation.postal_code.invalid'
|
|
2732
|
+
| 'address.form.validation.region.select_valid_region'
|
|
2733
|
+
| 'address.form.validation.street_number.missing'
|
|
2734
|
+
| 'address.form.validation.street_number.required'
|
|
2735
|
+
| 'address.form.vat_other_country'
|
|
2736
|
+
| 'address.list.add_new_address'
|
|
2737
|
+
| 'address.list.save_and_continue'
|
|
2738
|
+
| 'address.list.title'
|
|
2739
|
+
| 'address.save'
|
|
2740
|
+
| 'address.save_anyway'
|
|
2741
|
+
| 'address.suggestion.address_incorrect.description'
|
|
2742
|
+
| 'address.suggestion.address_incorrect.header'
|
|
2743
|
+
| 'address.suggestion.street_number.action'
|
|
2744
|
+
| 'address.suggestion.street_number.description'
|
|
2745
|
+
| 'address.suggestion.street_number.header'
|
|
2746
|
+
| 'address.suggestion.suggested_address.action'
|
|
2747
|
+
| 'address.suggestion.suggested_address.header'
|
|
2748
|
+
| 'address.suggestion_list.show_all'
|
|
2749
|
+
| 'address.use_different_address'
|
|
2750
|
+
| 'address.validation_modal.billing.aria.label'
|
|
2751
|
+
| 'address.validation_modal.delivery.aria.label'
|
|
2752
|
+
| 'address.verify.continue_anyway'
|
|
2753
|
+
| 'address.verify.continue_with_entered'
|
|
2754
|
+
| 'address.verify.edit_entered'
|
|
2755
|
+
| 'address.verify.entered'
|
|
2756
|
+
| 'address.verify.invalid_address_disclaimer'
|
|
2757
|
+
| 'address.verify.similar_address_disclaimer'
|
|
2758
|
+
| 'address.verify.suggested'
|
|
2759
|
+
| 'address.verify.title'
|
|
2760
|
+
| 'address.verify.use_suggested'
|
|
2761
|
+
| 'aria.open_popup'
|
|
2762
|
+
| 'compound.error_boundary.description'
|
|
2763
|
+
| 'compound.error_boundary.retry'
|
|
2764
|
+
| 'compound.error_boundary.title'
|
|
2765
|
+
| 'compound_footer.logo_alt'
|
|
2766
|
+
| 'country.GB'
|
|
2767
|
+
| 'country.PL'
|
|
2768
|
+
| 'country.SE'
|
|
2769
|
+
| 'country.US'
|
|
2770
|
+
| 'country_selector.select_country'
|
|
2771
|
+
| 'delivery.aria.open_carrier_popup'
|
|
2772
|
+
| 'delivery.cannot_load_thumbnail'
|
|
2773
|
+
| 'delivery.check_availability'
|
|
2774
|
+
| 'delivery.courier_instructions.add_popup_header'
|
|
2775
|
+
| 'delivery.courier_instructions.add_trigger'
|
|
2776
|
+
| 'delivery.courier_instructions.cancel'
|
|
2777
|
+
| 'delivery.courier_instructions.edit'
|
|
2778
|
+
| 'delivery.courier_instructions.remove'
|
|
2779
|
+
| 'delivery.courier_instructions.save'
|
|
2780
|
+
| 'delivery.fsi_levels_exhausted'
|
|
2781
|
+
| 'delivery.fsi_progress_bar_label'
|
|
2782
|
+
| 'delivery.fsi_remaining.DELIVERY'
|
|
2783
|
+
| 'delivery.fsi_remaining.DELIVERY_TYPE_UNSPECIFIED'
|
|
2784
|
+
| 'delivery.fsi_remaining.INSTORE'
|
|
2785
|
+
| 'delivery.fsi_remaining.MAILBOX'
|
|
2786
|
+
| 'delivery.fsi_remaining.PICKUP'
|
|
2787
|
+
| 'delivery.hide_details'
|
|
2788
|
+
| 'delivery.select_carrier'
|
|
2789
|
+
| 'delivery.show_details'
|
|
2790
|
+
| 'global.add_services'
|
|
2791
|
+
| 'global.address'
|
|
2792
|
+
| 'global.available_services'
|
|
2793
|
+
| 'global.back'
|
|
2794
|
+
| 'global.cancel'
|
|
2795
|
+
| 'global.change'
|
|
2796
|
+
| 'global.close'
|
|
2797
|
+
| 'global.continue'
|
|
2798
|
+
| 'global.country'
|
|
2799
|
+
| 'global.delete'
|
|
2800
|
+
| 'global.deliveries'
|
|
2801
|
+
| 'global.delivery'
|
|
2802
|
+
| 'global.delivery_options'
|
|
2803
|
+
| 'global.edit'
|
|
2804
|
+
| 'global.free'
|
|
2805
|
+
| 'global.loading'
|
|
2806
|
+
| 'global.pickup_locations'
|
|
2807
|
+
| 'global.postal_code'
|
|
2808
|
+
| 'global.save_my_choice'
|
|
2809
|
+
| 'global.select_pickup_location'
|
|
2810
|
+
| 'global.show'
|
|
2811
|
+
| 'global.show_available_services'
|
|
2812
|
+
| 'global.validation.invalid'
|
|
2813
|
+
| 'global.validation.invalid_email'
|
|
2814
|
+
| 'global.validation.max_length'
|
|
2815
|
+
| 'global.validation.min_length'
|
|
2816
|
+
| 'global.validation.required'
|
|
2817
|
+
| 'location_map.default_marker_label'
|
|
2818
|
+
| 'location_popup.toggle_map.label'
|
|
2819
|
+
| 'pickup_location.hide_opening_hours'
|
|
2820
|
+
| 'pickup_location.show_opening_hours'
|
|
2821
|
+
| 'pickup_location.walk'
|
|
2822
|
+
| 'product_list.first_product_and_more_one'
|
|
2823
|
+
| 'product_list.first_product_and_more_other'
|
|
2824
|
+
| 'product_list.hide_details'
|
|
2825
|
+
| 'product_list.products_one'
|
|
2826
|
+
| 'product_list.products_other'
|
|
2827
|
+
| 'product_list.quantity'
|
|
2828
|
+
| 'product_list.show_details'
|
|
2829
|
+
| 'returns.exchange_and_return_title'
|
|
2830
|
+
| 'returns.exchange_or_return_promise_days_one'
|
|
2831
|
+
| 'returns.exchange_or_return_promise_days_other'
|
|
2832
|
+
| 'returns.exchange_promise_days_one'
|
|
2833
|
+
| 'returns.exchange_promise_days_other'
|
|
2834
|
+
| 'returns.exchange_title'
|
|
2835
|
+
| 'returns.free_exchange'
|
|
2836
|
+
| 'returns.free_return'
|
|
2837
|
+
| 'returns.paid_exchange'
|
|
2838
|
+
| 'returns.paid_return'
|
|
2839
|
+
| 'returns.return_promise_days_one'
|
|
2840
|
+
| 'returns.return_promise_days_other'
|
|
2841
|
+
| 'returns.return_title'
|
|
2842
|
+
| 'split_delivery.of_total'
|
|
2843
|
+
| 'split_delivery.title'
|
|
2844
|
+
| 'time.absolute'
|
|
2845
|
+
| 'time.friday'
|
|
2846
|
+
| 'time.minute_unit_one'
|
|
2847
|
+
| 'time.minute_unit_other'
|
|
2848
|
+
| 'time.monday'
|
|
2849
|
+
| 'time.no_estimated_time'
|
|
2850
|
+
| 'time.relative'
|
|
2851
|
+
| 'time.relative_range'
|
|
2852
|
+
| 'time.saturday'
|
|
2853
|
+
| 'time.sunday'
|
|
2854
|
+
| 'time.thursday'
|
|
2855
|
+
| 'time.tuesday'
|
|
2856
|
+
| 'time.wednesday'
|
|
2857
|
+
| 'tracking.track_delivery_with';
|
|
2858
|
+
|
|
2859
|
+
declare type RecipientContact = {
|
|
2860
|
+
first_name?: string;
|
|
2861
|
+
last_name?: string;
|
|
2862
|
+
contact_id?: string;
|
|
2863
|
+
address: {
|
|
2864
|
+
country_code: string;
|
|
2865
|
+
region_code?: string;
|
|
2866
|
+
postal_code?: string;
|
|
2867
|
+
city?: string;
|
|
2868
|
+
address_lines?: string[];
|
|
2869
|
+
};
|
|
2870
|
+
email?: string;
|
|
2871
|
+
phone_number?: {
|
|
2872
|
+
country_code: string;
|
|
2873
|
+
number: string;
|
|
2874
|
+
extension?: string;
|
|
2875
|
+
};
|
|
2876
|
+
};
|
|
2877
|
+
|
|
2878
|
+
declare type RecursiveObjectValues<T> = T extends object ? RecursiveObjectValues<T[keyof T]> : T;
|
|
2879
|
+
|
|
2880
|
+
declare interface SDKInternal {
|
|
2881
|
+
readonly [_internalBrand]: never;
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
/**
|
|
2885
|
+
* @description Response containing a list of address predictions from the autocomplete endpoint.
|
|
2886
|
+
*/
|
|
2887
|
+
declare type SearchAddressesResponse = {
|
|
2888
|
+
/**
|
|
2889
|
+
* @description List of address predictions matching the search query or container expansion.
|
|
2890
|
+
* @type array
|
|
2891
|
+
*/
|
|
2892
|
+
predictions: Prediction[];
|
|
2893
|
+
};
|
|
2894
|
+
|
|
2895
|
+
/**
|
|
2896
|
+
* @description Column contains a list of items displayed in a single section column.
|
|
2897
|
+
*/
|
|
2898
|
+
declare type SectionColumn = {
|
|
2899
|
+
/**
|
|
2900
|
+
* @description The items within the column.
|
|
2901
|
+
* @type array
|
|
2902
|
+
*/
|
|
2903
|
+
items: SectionItem[];
|
|
2904
|
+
};
|
|
2905
|
+
|
|
2906
|
+
/**
|
|
2907
|
+
* @description Item represents a single piece of information in a section.
|
|
2908
|
+
*/
|
|
2909
|
+
declare type SectionItem = {
|
|
2910
|
+
/**
|
|
2911
|
+
* @description The URI for the item\'s icon.
|
|
2912
|
+
* @type string | undefined
|
|
2913
|
+
*/
|
|
2914
|
+
icon_uri?: string;
|
|
2915
|
+
/**
|
|
2916
|
+
* @description The text description of the item.
|
|
2917
|
+
* @type string | undefined
|
|
2918
|
+
*/
|
|
2919
|
+
text?: string;
|
|
2920
|
+
/**
|
|
2921
|
+
* @description The URI for a link associated with the item.
|
|
2922
|
+
* @type string | undefined
|
|
2923
|
+
*/
|
|
2924
|
+
link_uri?: string;
|
|
2925
|
+
};
|
|
2926
|
+
|
|
2927
|
+
declare type Services = {
|
|
2928
|
+
delivery: {
|
|
2929
|
+
getSession: DeliveryService['getSession'];
|
|
2930
|
+
};
|
|
2931
|
+
tracking: {
|
|
2932
|
+
getTrackingData: TrackingService['getTrackingData'];
|
|
2933
|
+
};
|
|
2934
|
+
translations: {
|
|
2935
|
+
formatMessage: TranslationsService['formatMessage'];
|
|
2936
|
+
registerTranslations: TranslationsService['registerTranslations'];
|
|
2937
|
+
};
|
|
2938
|
+
address: {
|
|
2939
|
+
listContactBookEntries: ContactsService['listContactBookEntries'];
|
|
2940
|
+
getContactBookEntry: ContactsService['getContactBookEntry'];
|
|
2941
|
+
upsertContactBookEntry: ContactsService['upsertContactBookEntry'];
|
|
2942
|
+
deleteContactBookEntry: ContactsService['deleteContactBookEntry'];
|
|
2943
|
+
listSuggestions: AddressSuggestionsService['list'];
|
|
2944
|
+
resolveSuggestion: AddressSuggestionsService['resolve'];
|
|
2945
|
+
validateAddress: AddressValidationService['validateAddress'];
|
|
2946
|
+
};
|
|
2947
|
+
};
|
|
2948
|
+
|
|
2949
|
+
export declare type ServicesOverrides = {
|
|
2950
|
+
[Domain in keyof Services]?: MethodOverrides<Services[Domain]>;
|
|
2951
|
+
};
|
|
2952
|
+
|
|
2953
|
+
/**
|
|
2954
|
+
* @description Purchase describes purchase experience.
|
|
2955
|
+
*/
|
|
2956
|
+
declare type SessionPurchase = {
|
|
2957
|
+
/**
|
|
2958
|
+
* @description \nThe country code where the delivery will occur (ISO 3166-1 alpha-2).
|
|
2959
|
+
* @type string
|
|
2960
|
+
*/
|
|
2961
|
+
country_code: string;
|
|
2962
|
+
/**
|
|
2963
|
+
* @description The currency code for the transaction (ISO 4217).
|
|
2964
|
+
* @type string
|
|
2965
|
+
*/
|
|
2966
|
+
currency_code: string;
|
|
2967
|
+
/**
|
|
2968
|
+
* @description The total discount applied to the purchase (non-negative, in cents).
|
|
2969
|
+
* @type string | undefined, int64
|
|
2970
|
+
*/
|
|
2971
|
+
total_discount?: string;
|
|
2972
|
+
/**
|
|
2973
|
+
* @description The total value of the purchase after discounts are applied (non-negative, in cents).
|
|
2974
|
+
* @type string | undefined, int64
|
|
2975
|
+
*/
|
|
2976
|
+
total_value?: string;
|
|
2977
|
+
/**
|
|
2978
|
+
* @description List of vouchers.
|
|
2979
|
+
* @type array | undefined
|
|
2980
|
+
*/
|
|
2981
|
+
vouchers?: string[];
|
|
2982
|
+
/**
|
|
2983
|
+
* @description Locales list defined as lc-CC compliant with ISO 3166-1, in order of preference(first supported one will be chosen).
|
|
2984
|
+
* @type array | undefined
|
|
2985
|
+
*/
|
|
2986
|
+
locales?: string[];
|
|
2987
|
+
};
|
|
2988
|
+
|
|
2989
|
+
/**
|
|
2990
|
+
* @description State defines the current state of the session.\n\n - STATE_UNSPECIFIED: Default value. This value is unused.\n - ACTIVE: Session is active and can be modified.\n - COMPLETED: Session is completed and can not be modified.
|
|
2991
|
+
* @default STATE_UNSPECIFIED
|
|
2992
|
+
*/
|
|
2993
|
+
declare type SessionState = SessionStateEnum;
|
|
2994
|
+
|
|
2995
|
+
declare type SessionStateEnum = 'STATE_UNSPECIFIED' | 'ACTIVE' | 'COMPLETED';
|
|
2996
|
+
|
|
2997
|
+
/**
|
|
2998
|
+
* @default STEP_UNKNOWN
|
|
2999
|
+
*/
|
|
3000
|
+
declare type Step = StepEnum;
|
|
3001
|
+
|
|
3002
|
+
declare type StepEnum =
|
|
3003
|
+
| 'STEP_UNKNOWN'
|
|
3004
|
+
| 'STEP_CONFIRMED_BY_MERCHANT'
|
|
3005
|
+
| 'STEP_PREPARED_BY_MERCHANT'
|
|
3006
|
+
| 'STEP_SUBMITTED_TO_CARRIER'
|
|
3007
|
+
| 'STEP_ON_ROUTE'
|
|
3008
|
+
| 'STEP_DELIVERED_TO_PICKUP_POINT'
|
|
3009
|
+
| 'STEP_DELIVERED_TO_CONSUMER'
|
|
3010
|
+
| 'STEP_TERMINATED'
|
|
3011
|
+
| 'STEP_SENT_BACK'
|
|
3012
|
+
| 'STEP_RETURN_REQUESTED'
|
|
3013
|
+
| 'STEP_DELIVERED_TO_MERCHANT'
|
|
3014
|
+
| 'STEP_AWAITING_SUPPLIER'
|
|
3015
|
+
| 'STEP_LINEHAUL_TO_CARRIER'
|
|
3016
|
+
| 'STEP_RETURN_APPROVED'
|
|
3017
|
+
| 'STEP_RETURN_DECLINED'
|
|
3018
|
+
| 'STEP_RETURN_COMPLETED'
|
|
3019
|
+
| 'STEP_REPLACEMENT_SENT'
|
|
3020
|
+
| 'STEP_RETURN_CANCELLED';
|
|
3021
|
+
|
|
3022
|
+
declare type StyleTokens = Partial<Record<ThemeCssVariables, string>>;
|
|
3023
|
+
|
|
3024
|
+
declare type ThemeCssVariables = `--${RecursiveObjectValues<typeof variableNames>}`;
|
|
3025
|
+
|
|
3026
|
+
declare const trackingArgsSchema = z.union([
|
|
3027
|
+
z.object({ token: z.string(), locale: z.enum(localeList) }),
|
|
3028
|
+
z.object({ email: z.string(), tos_id: z.string(), locale: z.enum(localeList) }),
|
|
3029
|
+
]);
|
|
3030
|
+
|
|
3031
|
+
declare type TrackingData = GetTrackingDataResponse;
|
|
3032
|
+
|
|
3033
|
+
declare type TrackingNumberParams = {
|
|
3034
|
+
parcelIndex: string;
|
|
3035
|
+
customization?: Record<never, never>;
|
|
3036
|
+
};
|
|
3037
|
+
|
|
3038
|
+
declare const trackingNumberParamsValidator = z.object({
|
|
3039
|
+
parcelIndex: z.string(),
|
|
3040
|
+
customization: z.object({}).optional(),
|
|
3041
|
+
}) satisfies z.ZodType<TrackingNumberParams>;
|
|
3042
|
+
|
|
3043
|
+
declare type TrackingService = {
|
|
3044
|
+
getTrackingData: DataResolver<GetTrackingDataArgs, TrackingData>;
|
|
3045
|
+
};
|
|
3046
|
+
|
|
3047
|
+
declare type TranslationKey = BaseKey<RawTranslationKey>;
|
|
3048
|
+
|
|
3049
|
+
declare type TranslationsService = {
|
|
3050
|
+
formatMessage: (locale: Locale, key: TranslationKey, values?: Record<string, unknown>) => string;
|
|
3051
|
+
registerTranslations: (
|
|
3052
|
+
locale: Locale,
|
|
3053
|
+
namespace: string,
|
|
3054
|
+
translations: Record<string, string>
|
|
3055
|
+
) => void;
|
|
3056
|
+
};
|
|
3057
|
+
|
|
3058
|
+
/** @public */
|
|
3059
|
+
declare interface UpdatableConfig {
|
|
3060
|
+
styles?: StyleTokens;
|
|
3061
|
+
}
|
|
3062
|
+
|
|
3063
|
+
/**
|
|
3064
|
+
* @description Contact represents generic contact information.
|
|
3065
|
+
*/
|
|
3066
|
+
declare type V1AlphaAddressContact = {
|
|
3067
|
+
/**
|
|
3068
|
+
* @description The identifier of the contact.
|
|
3069
|
+
* @type string | undefined
|
|
3070
|
+
*/
|
|
3071
|
+
contact_id?: string;
|
|
3072
|
+
/**
|
|
3073
|
+
* @description Represents an address suitable for delivery.
|
|
3074
|
+
* @type object
|
|
3075
|
+
*/
|
|
3076
|
+
address: AddressAddress;
|
|
3077
|
+
/**
|
|
3078
|
+
* @description The email address of the contact.
|
|
3079
|
+
* @type string | undefined
|
|
3080
|
+
*/
|
|
3081
|
+
email?: string;
|
|
3082
|
+
/**
|
|
3083
|
+
* @description A phone number, including region and optional extension.
|
|
3084
|
+
* @type object | undefined
|
|
3085
|
+
*/
|
|
3086
|
+
phone_number?: ContactPhoneNumber_2;
|
|
3087
|
+
/**
|
|
3088
|
+
* @description Full name associated with the contact.
|
|
3089
|
+
* @type string | undefined
|
|
3090
|
+
*/
|
|
3091
|
+
name?: string;
|
|
3092
|
+
/**
|
|
3093
|
+
* @description First name associated with the contact.
|
|
3094
|
+
* @type string | undefined
|
|
3095
|
+
*/
|
|
3096
|
+
first_name?: string;
|
|
3097
|
+
/**
|
|
3098
|
+
* @description Last name associated with the contact.
|
|
3099
|
+
* @type string | undefined
|
|
3100
|
+
*/
|
|
3101
|
+
last_name?: string;
|
|
3102
|
+
/**
|
|
3103
|
+
* @description National ID number associated with the contact.
|
|
3104
|
+
* @type string | undefined
|
|
3105
|
+
*/
|
|
3106
|
+
national_id_number?: string;
|
|
3107
|
+
/**
|
|
3108
|
+
* @description Company name associated with the contact.
|
|
3109
|
+
* @type string | undefined
|
|
3110
|
+
*/
|
|
3111
|
+
company_name?: string;
|
|
3112
|
+
/**
|
|
3113
|
+
* @description VAT number associated with the contact.
|
|
3114
|
+
* @type string | undefined
|
|
3115
|
+
*/
|
|
3116
|
+
vat?: string;
|
|
3117
|
+
/**
|
|
3118
|
+
* @description Customs number associated with the contact.
|
|
3119
|
+
* @type string | undefined
|
|
3120
|
+
*/
|
|
3121
|
+
customs_number?: string;
|
|
3122
|
+
};
|
|
3123
|
+
|
|
3124
|
+
/**
|
|
3125
|
+
* @description Represents an address suitable for delivery.
|
|
3126
|
+
*/
|
|
3127
|
+
declare type V1AlphaDeliveryAddress = {
|
|
3128
|
+
/**
|
|
3129
|
+
* @description \nRefers to a ISO-3166 alpha 2 country code.
|
|
3130
|
+
* @type string
|
|
3131
|
+
*/
|
|
3132
|
+
country_code: string;
|
|
3133
|
+
/**
|
|
3134
|
+
* @description Refers to a first-level administrative subdivision code (ISO-3166-2) without the country_code prefix.\nExample: region for Washington, D.C. = `DC` (from `US-DC`).\nException: for some countries (e.g. Mexico, Hong Kong) the subdivision name is used instead.\nExample: region for Hong Kong = `Kowloon`.
|
|
3135
|
+
* @type string | undefined
|
|
3136
|
+
*/
|
|
3137
|
+
region_code?: string;
|
|
3138
|
+
/**
|
|
3139
|
+
* @description Refers to a postal code or zipcode.
|
|
3140
|
+
* @type string | undefined
|
|
3141
|
+
*/
|
|
3142
|
+
postal_code?: string;
|
|
3143
|
+
/**
|
|
3144
|
+
* @description Refers to a city, postal_town or locality.
|
|
3145
|
+
* @type string | undefined
|
|
3146
|
+
*/
|
|
3147
|
+
city?: string;
|
|
3148
|
+
/**
|
|
3149
|
+
* @description List of strings, each a part of the address, e.g., street name, street number, building name, floor.
|
|
3150
|
+
* @type array | undefined
|
|
3151
|
+
*/
|
|
3152
|
+
address_lines?: string[];
|
|
3153
|
+
/**
|
|
3154
|
+
* @description Represents a latitude/longitude pair.\nUnless specified otherwise, this must conform to the WGS84 standard.\nValues must be within normalized ranges.
|
|
3155
|
+
* @type object | undefined
|
|
3156
|
+
*/
|
|
3157
|
+
coordinates?: DeliveryCoordinates;
|
|
3158
|
+
};
|
|
3159
|
+
|
|
3160
|
+
/**
|
|
3161
|
+
* @description Contact represents generic contact information.
|
|
3162
|
+
*/
|
|
3163
|
+
declare type V1AlphaDeliveryContact = {
|
|
3164
|
+
/**
|
|
3165
|
+
* @description Represents an address suitable for delivery.
|
|
3166
|
+
* @type object
|
|
3167
|
+
*/
|
|
3168
|
+
address: V1AlphaDeliveryAddress;
|
|
3169
|
+
/**
|
|
3170
|
+
* @description The email address of the contact.
|
|
3171
|
+
* @type string | undefined
|
|
3172
|
+
*/
|
|
3173
|
+
email?: string;
|
|
3174
|
+
/**
|
|
3175
|
+
* @description A phone number, including region and optional extension.
|
|
3176
|
+
* @type object | undefined
|
|
3177
|
+
*/
|
|
3178
|
+
phone_number?: ContactPhoneNumber;
|
|
3179
|
+
/**
|
|
3180
|
+
* @description The given name of the recipient.\nUses AIP-148 terminology; prefer given_name over first_name as the given name\nis not placed first in many cultures.\nIf the integrator cannot differentiate between given and family name,\nthe entire name may be supplied in this field.
|
|
3181
|
+
* @type string | undefined
|
|
3182
|
+
*/
|
|
3183
|
+
given_name?: string;
|
|
3184
|
+
/**
|
|
3185
|
+
* @description The family name of the recipient.\nUses AIP-148 terminology; prefer family_name over last_name as the family name\nis not placed last in many cultures.
|
|
3186
|
+
* @type string | undefined
|
|
3187
|
+
*/
|
|
3188
|
+
family_name?: string;
|
|
3189
|
+
/**
|
|
3190
|
+
* @description The company name of the recipient.
|
|
3191
|
+
* @type string | undefined
|
|
3192
|
+
*/
|
|
3193
|
+
company_name?: string;
|
|
3194
|
+
};
|
|
3195
|
+
|
|
3196
|
+
/**
|
|
3197
|
+
* @description The delivery represents a single delivery of goods to a recipient.\nIt includes information about the goods, the recipient details, the fulfillment methods and the delivery options.
|
|
3198
|
+
*/
|
|
3199
|
+
declare type V1AlphaDeliveryDelivery = {
|
|
3200
|
+
/**
|
|
3201
|
+
* @description The unique identifier of a delivery.
|
|
3202
|
+
* @type string
|
|
3203
|
+
*/
|
|
3204
|
+
id: string;
|
|
3205
|
+
/**
|
|
3206
|
+
* @description The goods that are to be delivered.
|
|
3207
|
+
* @type array
|
|
3208
|
+
*/
|
|
3209
|
+
line_items: DeliveryLineItem[];
|
|
3210
|
+
/**
|
|
3211
|
+
* @description The available fulfillments for the delivery.\nIn the future this will be deprecated in favour of `nodes`.
|
|
3212
|
+
* @type array
|
|
3213
|
+
*/
|
|
3214
|
+
fulfillments: DeliveryFulfillment[];
|
|
3215
|
+
/**
|
|
3216
|
+
* @description Contact represents generic contact information.
|
|
3217
|
+
* @type object
|
|
3218
|
+
*/
|
|
3219
|
+
recipient_contact: V1AlphaDeliveryContact;
|
|
3220
|
+
/**
|
|
3221
|
+
* @description Used to control the behaviour of the filter/price rules.\nEquivalent of cart_attributes in the `Delivery Checkout` API.
|
|
3222
|
+
* @type array | undefined
|
|
3223
|
+
*/
|
|
3224
|
+
attributes?: string[];
|
|
3225
|
+
/**
|
|
3226
|
+
* @description The available delivery categories for this delivery.
|
|
3227
|
+
* @type array | undefined
|
|
3228
|
+
*/
|
|
3229
|
+
readonly delivery_categories?: DeliveryDeliveryCategory[];
|
|
3230
|
+
/**
|
|
3231
|
+
* @description ID of the TOS, only present for the session `complete` and `get` calls.
|
|
3232
|
+
* @type string | undefined
|
|
3233
|
+
*/
|
|
3234
|
+
readonly tos_id?: string;
|
|
3235
|
+
/**
|
|
3236
|
+
* @description ID assigned by the merchant to a specific delivery.\nOnly present for the session `complete` and `get` calls.\nUsed as external ID of the TOS.
|
|
3237
|
+
* @type string | undefined
|
|
3238
|
+
*/
|
|
3239
|
+
readonly external_id?: string;
|
|
3240
|
+
/**
|
|
3241
|
+
* @description List of nodes that take part in the delivery.
|
|
3242
|
+
* @type array | undefined
|
|
3243
|
+
*/
|
|
3244
|
+
nodes?: DeliveryDeliveryNode[];
|
|
3245
|
+
};
|
|
3246
|
+
|
|
3247
|
+
/**
|
|
3248
|
+
* @description The request has succeeded.
|
|
3249
|
+
*/
|
|
3250
|
+
declare type ValidateAddress200 = ValidationResult;
|
|
3251
|
+
|
|
3252
|
+
/**
|
|
3253
|
+
* @description The server could not understand the request due to invalid syntax.
|
|
3254
|
+
*/
|
|
3255
|
+
declare type ValidateAddress400 = AtlasErrorsBadRequestError;
|
|
3256
|
+
|
|
3257
|
+
/**
|
|
3258
|
+
* @description Server error
|
|
3259
|
+
*/
|
|
3260
|
+
declare type ValidateAddress500 = AtlasErrorsServerError;
|
|
3261
|
+
|
|
3262
|
+
declare type ValidateAddressMutation = {
|
|
3263
|
+
Response: ValidateAddress200;
|
|
3264
|
+
Request: ValidateAddressMutationRequest;
|
|
3265
|
+
Errors: ValidateAddress400 | ValidateAddress500;
|
|
3266
|
+
};
|
|
3267
|
+
|
|
3268
|
+
declare type ValidateAddressMutationRequest = ValidateAddressRequest;
|
|
3269
|
+
|
|
3270
|
+
/**
|
|
3271
|
+
* @description Request to validate and standardize an address.
|
|
3272
|
+
*/
|
|
3273
|
+
declare type ValidateAddressRequest = {
|
|
3274
|
+
/**
|
|
3275
|
+
* @description The address to validate against postal reference data.
|
|
3276
|
+
*/
|
|
3277
|
+
address: Address_2;
|
|
3278
|
+
};
|
|
3279
|
+
|
|
3280
|
+
/**
|
|
3281
|
+
* @description Metadata about the quality and granularity of the address match.
|
|
3282
|
+
*/
|
|
3283
|
+
declare type ValidationAnalysis = {
|
|
3284
|
+
/**
|
|
3285
|
+
* @description How granular the match was against reference data.
|
|
3286
|
+
*/
|
|
3287
|
+
verificationLevel: VerificationLevel;
|
|
3288
|
+
/**
|
|
3289
|
+
* @description List of modifications the API made to the original address.
|
|
3290
|
+
* @type array | undefined
|
|
3291
|
+
*/
|
|
3292
|
+
changes?: AddressChange[];
|
|
3293
|
+
};
|
|
3294
|
+
|
|
3295
|
+
/**
|
|
3296
|
+
* @description Result of address validation against postal reference data.\nContains the validation status, a standardized candidate address, match analysis,\nand per-field reports for UI highlighting.
|
|
3297
|
+
*/
|
|
3298
|
+
declare type ValidationResult = {
|
|
3299
|
+
/**
|
|
3300
|
+
* @description High-level validation status for UI logic:\n- `valid`: High confidence match. Save the `candidate` automatically.\n- `suspect`: Match found but with significant changes. Prompt the user \"Did you mean?\".\n- `invalid`: No deliverable address found. Block submission.
|
|
3301
|
+
*/
|
|
3302
|
+
status: ValidationStatus;
|
|
3303
|
+
/**
|
|
3304
|
+
* @description The standardized, corrected address.\nPresent if `status` is `valid` or `suspect`. Absent if `invalid`.
|
|
3305
|
+
*/
|
|
3306
|
+
candidate?: Address_2;
|
|
3307
|
+
/**
|
|
3308
|
+
* @description Metadata about the quality of the match.
|
|
3309
|
+
*/
|
|
3310
|
+
analysis: ValidationAnalysis;
|
|
3311
|
+
/**
|
|
3312
|
+
* @description Per-field validation status. Keys correspond to address field names.\nUseful for highlighting specific inputs in the UI (e.g., red border on postal code).
|
|
3313
|
+
* @type object | undefined
|
|
3314
|
+
*/
|
|
3315
|
+
fieldReports?: object;
|
|
3316
|
+
};
|
|
3317
|
+
|
|
3318
|
+
/**
|
|
3319
|
+
* @description High-level validation status for UI logic.\nActs as a traffic light for the address validation result.
|
|
3320
|
+
*/
|
|
3321
|
+
declare type ValidationStatus = ValidationStatusEnum;
|
|
3322
|
+
|
|
3323
|
+
declare type ValidationStatusEnum = 'valid' | 'suspect' | 'invalid';
|
|
3324
|
+
|
|
3325
|
+
declare const variableNames: {
|
|
3326
|
+
readonly color: {
|
|
3327
|
+
readonly bg: {
|
|
3328
|
+
readonly primary: "color-bg-primary";
|
|
3329
|
+
readonly primaryHover: "color-bg-primaryHover";
|
|
3330
|
+
readonly primarySubtle: "color-bg-primarySubtle";
|
|
3331
|
+
readonly primarySubtleHover: "color-bg-primarySubtleHover";
|
|
3332
|
+
readonly primaryInverse: "color-bg-primaryInverse";
|
|
3333
|
+
readonly primaryInverseHover: "color-bg-primaryInverseHover";
|
|
3334
|
+
readonly secondaryInverse: "color-bg-secondaryInverse";
|
|
3335
|
+
readonly secondaryInverseHover: "color-bg-secondaryInverseHover";
|
|
3336
|
+
readonly primaryInverseSubtle: "color-bg-primaryInverseSubtle";
|
|
3337
|
+
readonly primaryInverseSubtleHover: "color-bg-primaryInverseSubtleHover";
|
|
3338
|
+
readonly primaryDisabled: "color-bg-primaryDisabled";
|
|
3339
|
+
readonly secondary: "color-bg-secondary";
|
|
3340
|
+
readonly secondaryHover: "color-bg-secondaryHover";
|
|
3341
|
+
readonly tertiary: "color-bg-tertiary";
|
|
3342
|
+
readonly tertiaryHover: "color-bg-tertiaryHover";
|
|
3343
|
+
readonly danger: "color-bg-danger";
|
|
3344
|
+
readonly dangerHover: "color-bg-dangerHover";
|
|
3345
|
+
readonly dangerInverse: "color-bg-dangerInverse";
|
|
3346
|
+
readonly dangerInverseHover: "color-bg-dangerInverseHover";
|
|
3347
|
+
readonly dangerInverseSubtle: "color-bg-dangerInverseSubtle";
|
|
3348
|
+
readonly dangerInverseSubtleHover: "color-bg-dangerInverseSubtleHover";
|
|
3349
|
+
readonly dangerDisabled: "color-bg-dangerDisabled";
|
|
3350
|
+
readonly warning: "color-bg-warning";
|
|
3351
|
+
readonly warningHover: "color-bg-warningHover";
|
|
3352
|
+
readonly warningInverse: "color-bg-warningInverse";
|
|
3353
|
+
readonly warningInverseHover: "color-bg-warningInverseHover";
|
|
3354
|
+
readonly warningInverseSubtle: "color-bg-warningInverseSubtle";
|
|
3355
|
+
readonly warningInverseSubtleHover: "color-bg-warningInverseSubtleHover";
|
|
3356
|
+
readonly warningDisabled: "color-bg-warningDisabled";
|
|
3357
|
+
readonly success: "color-bg-success";
|
|
3358
|
+
readonly successHover: "color-bg-successHover";
|
|
3359
|
+
readonly successInverse: "color-bg-successInverse";
|
|
3360
|
+
readonly successInverseHover: "color-bg-successInverseHover";
|
|
3361
|
+
readonly successInverseSubtle: "color-bg-successInverseSubtle";
|
|
3362
|
+
readonly successInverseSubtleHover: "color-bg-successInverseSubtleHover";
|
|
3363
|
+
readonly successDisabled: "color-bg-successDisabled";
|
|
3364
|
+
readonly accent: "color-bg-accent";
|
|
3365
|
+
readonly inactive: "color-bg-inactive";
|
|
3366
|
+
readonly inactiveHover: "color-bg-inactiveHover";
|
|
3367
|
+
readonly inactiveSubtle: "color-bg-inactiveSubtle";
|
|
3368
|
+
readonly inactiveSubtleHover: "color-bg-inactiveSubtleHover";
|
|
3369
|
+
readonly inactiveDisabled: "color-bg-inactiveDisabled";
|
|
3370
|
+
readonly accentHover: "color-bg-accentHover";
|
|
3371
|
+
readonly accentInverse: "color-bg-accentInverse";
|
|
3372
|
+
readonly accentInverseHover: "color-bg-accentInverseHover";
|
|
3373
|
+
readonly accentInverseSubtle: "color-bg-accentInverseSubtle";
|
|
3374
|
+
readonly accentInverseSubtleHover: "color-bg-accentInverseSubtleHover";
|
|
3375
|
+
readonly accentDisabled: "color-bg-accentDisabled";
|
|
3376
|
+
readonly primarySubtleDisabled: "color-bg-primarySubtleDisabled";
|
|
3377
|
+
readonly shadow: "color-bg-shadow";
|
|
3378
|
+
};
|
|
3379
|
+
readonly fg: {
|
|
3380
|
+
readonly primary: "color-fg-primary";
|
|
3381
|
+
readonly primaryHover: "color-fg-primaryHover";
|
|
3382
|
+
readonly primarySubtle: "color-fg-primarySubtle";
|
|
3383
|
+
readonly primarySubtleHover: "color-fg-primarySubtleHover";
|
|
3384
|
+
readonly primaryInverse: "color-fg-primaryInverse";
|
|
3385
|
+
readonly primaryInverseHover: "color-fg-primaryInverseHover";
|
|
3386
|
+
readonly primaryDisabled: "color-fg-primaryDisabled";
|
|
3387
|
+
readonly primaryInverseDisabled: "color-fg-primaryInverseDisabled";
|
|
3388
|
+
readonly secondary: "color-fg-secondary";
|
|
3389
|
+
readonly secondaryHover: "color-fg-secondaryHover";
|
|
3390
|
+
readonly danger: "color-fg-danger";
|
|
3391
|
+
readonly dangerHover: "color-fg-dangerHover";
|
|
3392
|
+
readonly dangerDisabled: "color-fg-dangerDisabled";
|
|
3393
|
+
readonly dangerInverse: "color-fg-dangerInverse";
|
|
3394
|
+
readonly dangerInverseHover: "color-fg-dangerInverseHover";
|
|
3395
|
+
readonly dangerInverseDisabled: "color-fg-dangerInverseDisabled";
|
|
3396
|
+
readonly warning: "color-fg-warning";
|
|
3397
|
+
readonly warningHover: "color-fg-warningHover";
|
|
3398
|
+
readonly warningDisabled: "color-fg-warningDisabled";
|
|
3399
|
+
readonly warningInverse: "color-fg-warningInverse";
|
|
3400
|
+
readonly warningInverseHover: "color-fg-warningInverseHover";
|
|
3401
|
+
readonly warningInverseDisabled: "color-fg-warningInverseDisabled";
|
|
3402
|
+
readonly success: "color-fg-success";
|
|
3403
|
+
readonly successHover: "color-fg-successHover";
|
|
3404
|
+
readonly successDisabled: "color-fg-successDisabled";
|
|
3405
|
+
readonly successInverse: "color-fg-successInverse";
|
|
3406
|
+
readonly successInverseHover: "color-fg-successInverseHover";
|
|
3407
|
+
readonly successInverseDisabled: "color-fg-successInverseDisabled";
|
|
3408
|
+
readonly accent: "color-fg-accent";
|
|
3409
|
+
readonly inactive: "color-fg-inactive";
|
|
3410
|
+
readonly inactiveHover: "color-fg-inactiveHover";
|
|
3411
|
+
readonly inactiveSubtle: "color-fg-inactiveSubtle";
|
|
3412
|
+
readonly inactiveSubtleHover: "color-fg-inactiveSubtleHover";
|
|
3413
|
+
readonly inactiveDisabled: "color-fg-inactiveDisabled";
|
|
3414
|
+
readonly inactiveInverse: "color-fg-inactiveInverse";
|
|
3415
|
+
readonly inactiveInverseHover: "color-fg-inactiveInverseHover";
|
|
3416
|
+
readonly inactiveInverseDisabled: "color-fg-inactiveInverseDisabled";
|
|
3417
|
+
readonly accentHover: "color-fg-accentHover";
|
|
3418
|
+
readonly accentDisabled: "color-fg-accentDisabled";
|
|
3419
|
+
readonly accentInverse: "color-fg-accentInverse";
|
|
3420
|
+
readonly accentInverseHover: "color-fg-accentInverseHover";
|
|
3421
|
+
readonly accentInverseDisabled: "color-fg-accentInverseDisabled";
|
|
3422
|
+
readonly primarySubtleInverse: "color-fg-primarySubtleInverse";
|
|
3423
|
+
readonly primarySubtleInverseHover: "color-fg-primarySubtleInverseHover";
|
|
3424
|
+
readonly primarySubtleDisabled: "color-fg-primarySubtleDisabled";
|
|
3425
|
+
};
|
|
3426
|
+
readonly border: {
|
|
3427
|
+
readonly primary: "color-border-primary";
|
|
3428
|
+
readonly primaryHover: "color-border-primaryHover";
|
|
3429
|
+
readonly primarySubtle: "color-border-primarySubtle";
|
|
3430
|
+
readonly secondary: "color-border-secondary";
|
|
3431
|
+
readonly secondaryHover: "color-border-secondaryHover";
|
|
3432
|
+
readonly primarySubtleHover: "color-border-primarySubtleHover";
|
|
3433
|
+
readonly primaryDisabled: "color-border-primaryDisabled";
|
|
3434
|
+
readonly primaryInverse: "color-border-primaryInverse";
|
|
3435
|
+
readonly danger: "color-border-danger";
|
|
3436
|
+
readonly dangerHover: "color-border-dangerHover";
|
|
3437
|
+
readonly dangerDisabled: "color-border-dangerDisabled";
|
|
3438
|
+
readonly dangerInverse: "color-border-dangerInverse";
|
|
3439
|
+
readonly warning: "color-border-warning";
|
|
3440
|
+
readonly warningHover: "color-border-warningHover";
|
|
3441
|
+
readonly warningDisabled: "color-border-warningDisabled";
|
|
3442
|
+
readonly warningInverse: "color-border-warningInverse";
|
|
3443
|
+
readonly success: "color-border-success";
|
|
3444
|
+
readonly successHover: "color-border-successHover";
|
|
3445
|
+
readonly successDisabled: "color-border-successDisabled";
|
|
3446
|
+
readonly successInverse: "color-border-successInverse";
|
|
3447
|
+
readonly accent: "color-border-accent";
|
|
3448
|
+
readonly inactive: "color-border-inactive";
|
|
3449
|
+
readonly inactiveHover: "color-border-inactiveHover";
|
|
3450
|
+
readonly inactiveSubtle: "color-border-inactiveSubtle";
|
|
3451
|
+
readonly inactiveSubtleHover: "color-border-inactiveSubtleHover";
|
|
3452
|
+
readonly inactiveDisabled: "color-border-inactiveDisabled";
|
|
3453
|
+
readonly accentHover: "color-border-accentHover";
|
|
3454
|
+
readonly accentDisabled: "color-border-accentDisabled";
|
|
3455
|
+
readonly accentInverse: "color-border-accentInverse";
|
|
3456
|
+
};
|
|
3457
|
+
};
|
|
3458
|
+
readonly radii: {
|
|
3459
|
+
readonly '25': "radii-25";
|
|
3460
|
+
readonly '50': "radii-50";
|
|
3461
|
+
readonly '75': "radii-75";
|
|
3462
|
+
readonly '100': "radii-100";
|
|
3463
|
+
readonly '125': "radii-125";
|
|
3464
|
+
readonly '200': "radii-200";
|
|
3465
|
+
readonly '300': "radii-300";
|
|
3466
|
+
readonly none: "radii-none";
|
|
3467
|
+
readonly full: "radii-full";
|
|
3468
|
+
};
|
|
3469
|
+
readonly space: {
|
|
3470
|
+
readonly '0': "space-0";
|
|
3471
|
+
readonly '12': "space-12";
|
|
3472
|
+
readonly '25': "space-25";
|
|
3473
|
+
readonly '50': "space-50";
|
|
3474
|
+
readonly '75': "space-75";
|
|
3475
|
+
readonly '100': "space-100";
|
|
3476
|
+
readonly '150': "space-150";
|
|
3477
|
+
readonly '200': "space-200";
|
|
3478
|
+
readonly '250': "space-250";
|
|
3479
|
+
readonly '300': "space-300";
|
|
3480
|
+
};
|
|
3481
|
+
readonly size: {
|
|
3482
|
+
readonly '0': "size-0";
|
|
3483
|
+
readonly '12': "size-12";
|
|
3484
|
+
readonly '25': "size-25";
|
|
3485
|
+
readonly '50': "size-50";
|
|
3486
|
+
readonly '75': "size-75";
|
|
3487
|
+
readonly '100': "size-100";
|
|
3488
|
+
readonly '150': "size-150";
|
|
3489
|
+
readonly '200': "size-200";
|
|
3490
|
+
readonly '300': "size-300";
|
|
3491
|
+
readonly '350': "size-350";
|
|
3492
|
+
readonly '400': "size-400";
|
|
3493
|
+
readonly '600': "size-600";
|
|
3494
|
+
readonly '800': "size-800";
|
|
3495
|
+
readonly '1000': "size-1000";
|
|
3496
|
+
readonly '1200': "size-1200";
|
|
3497
|
+
readonly '1400': "size-1400";
|
|
3498
|
+
readonly '1500': "size-1500";
|
|
3499
|
+
readonly '1800': "size-1800";
|
|
3500
|
+
readonly '2000': "size-2000";
|
|
3501
|
+
readonly '2100': "size-2100";
|
|
3502
|
+
readonly '3000': "size-3000";
|
|
3503
|
+
readonly '4000': "size-4000";
|
|
3504
|
+
readonly '4500': "size-4500";
|
|
3505
|
+
readonly '6000': "size-6000";
|
|
3506
|
+
readonly '8000': "size-8000";
|
|
3507
|
+
readonly '9000': "size-9000";
|
|
3508
|
+
readonly '12000': "size-12000";
|
|
3509
|
+
readonly full: "size-full";
|
|
3510
|
+
};
|
|
3511
|
+
readonly font: {
|
|
3512
|
+
readonly default: "font-default";
|
|
3513
|
+
};
|
|
3514
|
+
readonly borderWidth: {
|
|
3515
|
+
readonly none: "borderWidth-none";
|
|
3516
|
+
readonly default: "borderWidth-default";
|
|
3517
|
+
readonly thick: "borderWidth-thick";
|
|
3518
|
+
readonly thicker: "borderWidth-thicker";
|
|
3519
|
+
};
|
|
3520
|
+
readonly fontSize: {
|
|
3521
|
+
readonly xsm: "fontSize-xsm";
|
|
3522
|
+
readonly sm: "fontSize-sm";
|
|
3523
|
+
readonly md: "fontSize-md";
|
|
3524
|
+
readonly lg: "fontSize-lg";
|
|
3525
|
+
};
|
|
3526
|
+
readonly letterSpacing: {
|
|
3527
|
+
readonly xsm: "letterSpacing-xsm";
|
|
3528
|
+
readonly sm: "letterSpacing-sm";
|
|
3529
|
+
readonly md: "letterSpacing-md";
|
|
3530
|
+
readonly lg: "letterSpacing-lg";
|
|
3531
|
+
};
|
|
3532
|
+
readonly fontWeight: {
|
|
3533
|
+
readonly regular: "fontWeight-regular";
|
|
3534
|
+
readonly emphasis: "fontWeight-emphasis";
|
|
3535
|
+
};
|
|
3536
|
+
readonly lineHeight: {
|
|
3537
|
+
readonly sm: "lineHeight-sm";
|
|
3538
|
+
readonly md: "lineHeight-md";
|
|
3539
|
+
};
|
|
3540
|
+
readonly opacity: {
|
|
3541
|
+
readonly none: "opacity-none";
|
|
3542
|
+
readonly light: "opacity-light";
|
|
3543
|
+
readonly medium: "opacity-medium";
|
|
3544
|
+
readonly strong: "opacity-strong";
|
|
3545
|
+
readonly full: "opacity-full";
|
|
3546
|
+
readonly xlight: "opacity-xlight";
|
|
3547
|
+
};
|
|
3548
|
+
readonly shadow: {
|
|
3549
|
+
readonly '0': "shadow-0";
|
|
3550
|
+
readonly '50': "shadow-50";
|
|
3551
|
+
readonly '150': "shadow-150";
|
|
3552
|
+
};
|
|
3553
|
+
};
|
|
3554
|
+
|
|
3555
|
+
/**
|
|
3556
|
+
* @description Granularity of the address match against reference data.
|
|
3557
|
+
*/
|
|
3558
|
+
declare type VerificationLevel = VerificationLevelEnum;
|
|
3559
|
+
|
|
3560
|
+
declare type VerificationLevelEnum = 'premise' | 'street' | 'locality' | 'none';
|
|
3561
|
+
|
|
3562
|
+
declare type WithDefault<T extends (...args: any[]) => any> = {
|
|
3563
|
+
readonly __tag: 'withDefault';
|
|
3564
|
+
readonly factory: (defaultFn: T) => T;
|
|
3565
|
+
};
|
|
3566
|
+
|
|
3567
|
+
export declare const withDefault: <T extends (...args: any[]) => any>(factory: (defaultFn: T) => T) => WithDefault<T>;
|
|
3568
|
+
|
|
3569
|
+
export { }
|