@ingridab/sdk 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -13
- package/dist/LICENSES.md +1 -35
- package/dist/index.d.ts +964 -1162
- package/dist/index.js +702 -4306
- package/dist/internal.d.ts +305 -0
- package/dist/internal.js +35 -0
- package/package.json +20 -13
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,82 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @description
|
|
5
|
-
* @default ADDON_TYPE_UNSPECIFIED
|
|
4
|
+
* @description ABTest is the A/B test assignment associated with this request.\nNot supported yet.
|
|
6
5
|
*/
|
|
7
|
-
declare type
|
|
6
|
+
declare type ABTest = {
|
|
7
|
+
/**
|
|
8
|
+
* @description ExperimentID is the identifier of the experiment.
|
|
9
|
+
* @type string
|
|
10
|
+
*/
|
|
11
|
+
experimentId: string;
|
|
12
|
+
/**
|
|
13
|
+
* @description VariantID is the identifier of the variant the user has been assigned to.
|
|
14
|
+
* @type string
|
|
15
|
+
*/
|
|
16
|
+
variantId: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @description AddonType classifies an add-on service.
|
|
21
|
+
*/
|
|
22
|
+
declare type AddonType = AddonTypeEnum;
|
|
8
23
|
|
|
9
|
-
declare type
|
|
10
|
-
| '
|
|
11
|
-
| '
|
|
12
|
-
| '
|
|
13
|
-
| '
|
|
14
|
-
| '
|
|
24
|
+
declare type AddonTypeEnum =
|
|
25
|
+
| 'insurance'
|
|
26
|
+
| 'signature'
|
|
27
|
+
| 'age_verification'
|
|
28
|
+
| 'id_verification'
|
|
29
|
+
| 'notification'
|
|
30
|
+
| 'other';
|
|
15
31
|
|
|
16
32
|
/**
|
|
17
|
-
* @description
|
|
33
|
+
* @description Address is a physical location in a global addressing context.\n\nValidation of postal code, administrative area, and other locality fields\nis conditional on the country code.
|
|
18
34
|
*/
|
|
19
35
|
declare type Address = {
|
|
36
|
+
/**
|
|
37
|
+
* @description CountryCode is the ISO 3166-1 alpha-2 country code.
|
|
38
|
+
*/
|
|
39
|
+
countryCode: CountryCode;
|
|
40
|
+
/**
|
|
41
|
+
* @description PostalCode is the postal code. Formatting and validation rules are\nconditional on the country code.
|
|
42
|
+
* @type string
|
|
43
|
+
*/
|
|
44
|
+
postalCode: string;
|
|
45
|
+
/**
|
|
46
|
+
* @description AdministrativeArea is the first-level administrative subdivision\n(state, province, prefecture, etc.) as the ISO 3166-2 subdivision\ncode. Required for some destination countries — e.g. US, CA, MX, BR,\nAR, AU, CN, JP, MY, KR, ID, TH, IT, ES, IE — and ignored elsewhere.\nUse the country reference for specifics.
|
|
47
|
+
* @type string | undefined
|
|
48
|
+
*/
|
|
49
|
+
administrativeArea?: string;
|
|
50
|
+
/**
|
|
51
|
+
* @description SubAdministrativeArea is the second-level administrative subdivision\n(county, district, etc.). Typically not required unless the country\nreference says otherwise.
|
|
52
|
+
* @type string | undefined
|
|
53
|
+
*/
|
|
54
|
+
subAdministrativeArea?: string;
|
|
55
|
+
/**
|
|
56
|
+
* @description Locality is the primary locality of the address — usually the city,\ntown, village, or municipality.
|
|
57
|
+
* @type string | undefined
|
|
58
|
+
*/
|
|
59
|
+
locality?: string;
|
|
60
|
+
/**
|
|
61
|
+
* @description SubLocality is the neighborhood, suburb, or district within the\nlocality. Required by some countries (e.g. JP chome, UK London\ndistricts, Latin-American colonias); see the country reference.
|
|
62
|
+
* @type string | undefined
|
|
63
|
+
*/
|
|
64
|
+
subLocality?: string;
|
|
65
|
+
/**
|
|
66
|
+
* @description AddressLines are the ordered street address lines.\nIndex 0 holds primary street info (street name + number, or block\nnumber); subsequent indices hold secondary info (apartment, suite,\nfloor, building name).
|
|
67
|
+
* @type array | undefined
|
|
68
|
+
*/
|
|
69
|
+
addressLines?: string[];
|
|
70
|
+
/**
|
|
71
|
+
* @description Type is the kind of address (residential, commercial, etc.).
|
|
72
|
+
*/
|
|
73
|
+
type?: AddressType;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @description Common address entity that used almost everywhere in Ingrid\'s API.
|
|
78
|
+
*/
|
|
79
|
+
declare type Address_2 = {
|
|
20
80
|
/**
|
|
21
81
|
* @type array | undefined
|
|
22
82
|
*/
|
|
@@ -45,7 +105,7 @@ declare type Address = {
|
|
|
45
105
|
/**
|
|
46
106
|
* @type object | undefined
|
|
47
107
|
*/
|
|
48
|
-
coordinates?:
|
|
108
|
+
coordinates?: Coordinates_2;
|
|
49
109
|
/**
|
|
50
110
|
* @description Country should be specified as two uppercase letters (ISO Alpha-2).\nExample `SE` for Sweden, `ES` for Spain.
|
|
51
111
|
* @type string | undefined
|
|
@@ -94,7 +154,7 @@ declare type Address = {
|
|
|
94
154
|
/**
|
|
95
155
|
* @description Ingrid Address API helps to collect clean addresses.\n\nAll errors follow RFC 7807 Problem Details format.
|
|
96
156
|
*/
|
|
97
|
-
declare type
|
|
157
|
+
declare type Address_3 = {
|
|
98
158
|
/**
|
|
99
159
|
* @description ISO 3166-1 alpha-2 country code.
|
|
100
160
|
* @minLength 2
|
|
@@ -135,7 +195,7 @@ declare type Address_2 = {
|
|
|
135
195
|
/**
|
|
136
196
|
* @type string | undefined
|
|
137
197
|
*/
|
|
138
|
-
type?:
|
|
198
|
+
type?: AddressType_2;
|
|
139
199
|
};
|
|
140
200
|
|
|
141
201
|
/**
|
|
@@ -161,7 +221,7 @@ declare type AddressContactEntry = {
|
|
|
161
221
|
companyName?: string;
|
|
162
222
|
|
|
163
223
|
/** The address of the contact. */
|
|
164
|
-
address?:
|
|
224
|
+
address?: Address_3;
|
|
165
225
|
|
|
166
226
|
/** The email address of the contact. */
|
|
167
227
|
email?: string;
|
|
@@ -194,7 +254,7 @@ declare type AddressDetailsResponse = {
|
|
|
194
254
|
/**
|
|
195
255
|
* @description The full address resolved from the prediction.
|
|
196
256
|
*/
|
|
197
|
-
address:
|
|
257
|
+
address: Address_3;
|
|
198
258
|
};
|
|
199
259
|
|
|
200
260
|
/**
|
|
@@ -224,15 +284,13 @@ declare type AddressFormResponse = {
|
|
|
224
284
|
|
|
225
285
|
declare type AddressFormService = {
|
|
226
286
|
getAddressFormConfig: DataResolver<
|
|
227
|
-
{ params: GetAddressFormQuery['QueryParams']
|
|
287
|
+
{ params: GetAddressFormQuery['QueryParams'] } & SDKManagedTokenArg,
|
|
228
288
|
GetAddressFormQuery['Response']
|
|
229
289
|
>;
|
|
230
290
|
};
|
|
231
291
|
|
|
232
292
|
/* Excluded from this release type: AddressMoleculeCustomization */
|
|
233
293
|
|
|
234
|
-
declare type AddressMoleculeInputState = Partial<AddressContactEntry>;
|
|
235
|
-
|
|
236
294
|
/**
|
|
237
295
|
* Configuration params passed to the address molecule.
|
|
238
296
|
*
|
|
@@ -248,8 +306,8 @@ declare type AddressMoleculeInputState = Partial<AddressContactEntry>;
|
|
|
248
306
|
* ```
|
|
249
307
|
*/
|
|
250
308
|
declare type AddressMoleculeParams = {
|
|
251
|
-
/** The rendering mode for the address molecule. Currently `'addressForm'`
|
|
252
|
-
mode: 'addressForm';
|
|
309
|
+
/** The rendering mode for the address molecule. Currently `'addressForm'` and `'searchDriven'` are supported. */
|
|
310
|
+
mode: 'addressForm' | 'searchDriven';
|
|
253
311
|
customization?: AddressMoleculePublicCustomization;
|
|
254
312
|
};
|
|
255
313
|
|
|
@@ -266,7 +324,7 @@ declare type AddressMoleculePublicCustomization = {
|
|
|
266
324
|
/**
|
|
267
325
|
* Controls how the address book is presented.
|
|
268
326
|
*
|
|
269
|
-
* @defaultValue `'
|
|
327
|
+
* @defaultValue `'off'`
|
|
270
328
|
*/
|
|
271
329
|
displayMode?: 'off' | 'inline' | 'popup';
|
|
272
330
|
/**
|
|
@@ -290,25 +348,31 @@ declare type AddressMoleculePublicCustomization = {
|
|
|
290
348
|
|
|
291
349
|
declare type AddressSuggestionsService = {
|
|
292
350
|
list: DataResolver<
|
|
293
|
-
{ params: AutocompleteAddressQuery['QueryParams']
|
|
351
|
+
{ params: AutocompleteAddressQuery['QueryParams'] } & SDKManagedTokenArg,
|
|
294
352
|
AutocompleteAddressQuery['Response']
|
|
295
353
|
>;
|
|
296
354
|
resolve: DataResolver<
|
|
297
355
|
{
|
|
298
356
|
params: GetAddressDetailsQuery['PathParams'] & GetAddressDetailsQuery['QueryParams'];
|
|
299
|
-
|
|
300
|
-
},
|
|
357
|
+
} & SDKManagedTokenArg,
|
|
301
358
|
GetAddressDetailsQuery['Response']
|
|
302
359
|
>;
|
|
303
360
|
};
|
|
304
361
|
|
|
362
|
+
/**
|
|
363
|
+
* @description AddressType classifies an address.
|
|
364
|
+
*/
|
|
305
365
|
declare type AddressType = AddressTypeEnum;
|
|
306
366
|
|
|
367
|
+
declare type AddressType_2 = AddressTypeEnum_2;
|
|
368
|
+
|
|
307
369
|
declare type AddressTypeEnum = 'unknown' | 'residential' | 'commercial';
|
|
308
370
|
|
|
371
|
+
declare type AddressTypeEnum_2 = 'unknown' | 'residential' | 'commercial';
|
|
372
|
+
|
|
309
373
|
declare type AddressValidationService = {
|
|
310
374
|
validateAddress: DataResolver<
|
|
311
|
-
{ payload: ValidateAddressMutation['Request']
|
|
375
|
+
{ payload: ValidateAddressMutation['Request'] } & SDKManagedTokenArg,
|
|
312
376
|
ValidateAddressMutation['Response']
|
|
313
377
|
>;
|
|
314
378
|
};
|
|
@@ -558,7 +622,7 @@ declare type AutocompleteAddressQueryParams = {
|
|
|
558
622
|
* @pattern ^[A-Z]{2}$
|
|
559
623
|
* @type string
|
|
560
624
|
*/
|
|
561
|
-
countryCode:
|
|
625
|
+
countryCode: CountryCode_2;
|
|
562
626
|
/**
|
|
563
627
|
* @description Site identifier, referring to which site the autocompletion is performed for.
|
|
564
628
|
* @type string
|
|
@@ -598,12 +662,6 @@ declare type AutocompleteFocusEnum =
|
|
|
598
662
|
*/
|
|
599
663
|
declare type BaseKey<K> = K extends `${infer B}_${Intl.LDMLPluralRule}` ? B : K;
|
|
600
664
|
|
|
601
|
-
/**
|
|
602
|
-
* TODO: this will come from the site config most probably and
|
|
603
|
-
* the shape of the model will be different - for now it's kept as simple
|
|
604
|
-
* as possible for MVP purposes
|
|
605
|
-
*/
|
|
606
|
-
|
|
607
665
|
declare type BaseMoleculeDef<K extends MoleculeType> = {
|
|
608
666
|
type: K;
|
|
609
667
|
customization?: DeepPartial<MoleculeCustomizationConfig<K>>;
|
|
@@ -611,24 +669,45 @@ declare type BaseMoleculeDef<K extends MoleculeType> = {
|
|
|
611
669
|
};
|
|
612
670
|
|
|
613
671
|
/**
|
|
614
|
-
* @description
|
|
672
|
+
* @description Carrier identifies a delivery carrier.
|
|
673
|
+
*/
|
|
674
|
+
declare type Carrier = {
|
|
675
|
+
/**
|
|
676
|
+
* @description ID is the unique identifier for the carrier.
|
|
677
|
+
* @type string
|
|
678
|
+
*/
|
|
679
|
+
id: string;
|
|
680
|
+
/**
|
|
681
|
+
* @description Name is the display name of the carrier.
|
|
682
|
+
* @type string
|
|
683
|
+
*/
|
|
684
|
+
name: string;
|
|
685
|
+
/**
|
|
686
|
+
* @description LogoURL points to the carrier\'s logo image.
|
|
687
|
+
* @type string | undefined
|
|
688
|
+
*/
|
|
689
|
+
logoUrl?: string;
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* @description CarrierProduct identifies a specific product offered by a carrier.
|
|
615
694
|
*/
|
|
616
|
-
declare type
|
|
695
|
+
declare type CarrierProduct = {
|
|
617
696
|
/**
|
|
618
|
-
* @description
|
|
697
|
+
* @description ID is the unique identifier for the product.
|
|
619
698
|
* @type string
|
|
620
699
|
*/
|
|
621
|
-
|
|
700
|
+
id: string;
|
|
622
701
|
/**
|
|
623
|
-
* @description
|
|
702
|
+
* @description Name is the display name of the product.
|
|
624
703
|
* @type string
|
|
625
704
|
*/
|
|
626
|
-
|
|
705
|
+
name: string;
|
|
627
706
|
/**
|
|
628
|
-
* @description
|
|
707
|
+
* @description Description is a description of the product.
|
|
629
708
|
* @type string | undefined
|
|
630
709
|
*/
|
|
631
|
-
|
|
710
|
+
description?: string;
|
|
632
711
|
};
|
|
633
712
|
|
|
634
713
|
declare type ContactsService = {
|
|
@@ -638,8 +717,7 @@ declare type ContactsService = {
|
|
|
638
717
|
addressBookId: string;
|
|
639
718
|
countryCode?: string;
|
|
640
719
|
};
|
|
641
|
-
|
|
642
|
-
},
|
|
720
|
+
} & SDKManagedTokenArg,
|
|
643
721
|
{
|
|
644
722
|
entries: { id: string; label: string; secondaryLabel: string }[];
|
|
645
723
|
}
|
|
@@ -647,8 +725,7 @@ declare type ContactsService = {
|
|
|
647
725
|
getContactBookEntry: DataResolver<
|
|
648
726
|
{
|
|
649
727
|
params: { id: string; addressBookId: string };
|
|
650
|
-
|
|
651
|
-
},
|
|
728
|
+
} & SDKManagedTokenArg,
|
|
652
729
|
AddressContactEntry
|
|
653
730
|
>;
|
|
654
731
|
upsertContactBookEntry: DataResolver<
|
|
@@ -657,17 +734,49 @@ declare type ContactsService = {
|
|
|
657
734
|
params: {
|
|
658
735
|
addressBookId: string;
|
|
659
736
|
};
|
|
660
|
-
|
|
661
|
-
},
|
|
737
|
+
} & SDKManagedTokenArg,
|
|
662
738
|
AddressContactEntry
|
|
663
739
|
>;
|
|
664
740
|
deleteContactBookEntry: DataResolver<
|
|
665
|
-
{ params: { addressBookId: string; id: string }
|
|
741
|
+
{ params: { addressBookId: string; id: string } } & SDKManagedTokenArg,
|
|
666
742
|
object
|
|
667
743
|
>;
|
|
668
744
|
};
|
|
669
745
|
|
|
746
|
+
/**
|
|
747
|
+
* @description Context is caller-supplied information used for personalisation and\nanalytics. All fields are optional and are not validated against the\noffer token.
|
|
748
|
+
*/
|
|
749
|
+
declare type Context = {
|
|
750
|
+
/**
|
|
751
|
+
* @description User describes the end user the request is being made on behalf of.
|
|
752
|
+
*/
|
|
753
|
+
user?: User;
|
|
754
|
+
/**
|
|
755
|
+
* @description ABTest carries the A/B test assignment for this request. Not supported yet.
|
|
756
|
+
*/
|
|
757
|
+
abTest?: ABTest;
|
|
758
|
+
/**
|
|
759
|
+
* @description Fingerprint is an opaque, caller-generated fingerprint of the end user (e.g. for fraud or analytics).
|
|
760
|
+
* @type string | undefined
|
|
761
|
+
*/
|
|
762
|
+
fingerprint?: string;
|
|
763
|
+
};
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* @description Coordinates are geographic coordinates in the WGS 84 reference system.
|
|
767
|
+
*/
|
|
670
768
|
declare type Coordinates = {
|
|
769
|
+
/**
|
|
770
|
+
* @description Latitude in decimal degrees, in the range [-90, 90].
|
|
771
|
+
*/
|
|
772
|
+
latitude: Latitude;
|
|
773
|
+
/**
|
|
774
|
+
* @description Longitude in decimal degrees, in the range [-180, 180].
|
|
775
|
+
*/
|
|
776
|
+
longitude: Longitude;
|
|
777
|
+
};
|
|
778
|
+
|
|
779
|
+
declare type Coordinates_2 = {
|
|
671
780
|
/**
|
|
672
781
|
* @type number | undefined, double
|
|
673
782
|
*/
|
|
@@ -679,10 +788,18 @@ declare type Coordinates = {
|
|
|
679
788
|
};
|
|
680
789
|
|
|
681
790
|
/**
|
|
791
|
+
* @description CountryCode is an ISO 3166-1 alpha-2 two-letter country code.
|
|
792
|
+
* @minLength 2
|
|
793
|
+
* @maxLength 2
|
|
682
794
|
* @pattern ^[A-Z]{2}$
|
|
683
795
|
*/
|
|
684
796
|
declare type CountryCode = string;
|
|
685
797
|
|
|
798
|
+
/**
|
|
799
|
+
* @pattern ^[A-Z]{2}$
|
|
800
|
+
*/
|
|
801
|
+
declare type CountryCode_2 = string;
|
|
802
|
+
|
|
686
803
|
declare const countrySelectorMoleculeParamsValidator = z.object({
|
|
687
804
|
mode: z.enum(['select']),
|
|
688
805
|
name: z.string(),
|
|
@@ -696,19 +813,21 @@ declare type CountrySelectorParams = {
|
|
|
696
813
|
};
|
|
697
814
|
|
|
698
815
|
/**
|
|
699
|
-
* Creates a molecule configuration for the address
|
|
816
|
+
* Creates a molecule configuration for the address molecule.
|
|
700
817
|
*
|
|
701
818
|
* Renders an address form that collects and validates the shopper's shipping address.
|
|
702
819
|
*
|
|
703
|
-
* @param params - Configuration for the address
|
|
820
|
+
* @param params - Configuration for the address molecule. See `AddressMoleculeParams`.
|
|
704
821
|
* @returns A molecule descriptor to pass to the `molecules` array in {@link IngridInitParams}.
|
|
705
822
|
*
|
|
706
823
|
* @example
|
|
707
824
|
* ```ts
|
|
708
|
-
* const
|
|
825
|
+
* const instance = await ingrid.init({
|
|
709
826
|
* token: 'your-auth-token',
|
|
710
827
|
* siteId: 'your-site-id',
|
|
711
828
|
* locale: 'en-US',
|
|
829
|
+
* countryCode: 'US',
|
|
830
|
+
* currency: 'USD',
|
|
712
831
|
* molecules: [
|
|
713
832
|
* createAddressMolecule({
|
|
714
833
|
* mode: 'addressForm'
|
|
@@ -723,144 +842,15 @@ export declare const createAddressMolecule: ({ mode, customization }: MoleculePa
|
|
|
723
842
|
type: "address";
|
|
724
843
|
customization: AddressMoleculePublicCustomization | undefined;
|
|
725
844
|
params: {
|
|
726
|
-
mode: "addressForm";
|
|
727
|
-
};
|
|
728
|
-
};
|
|
729
|
-
|
|
730
|
-
/**
|
|
731
|
-
* Creates a molecule configuration for the country selector particle.
|
|
732
|
-
*
|
|
733
|
-
* Renders a country picker that allows the shopper to select their delivery country.
|
|
734
|
-
* Changing the country refreshes available delivery options.
|
|
735
|
-
*
|
|
736
|
-
* @param params - Configuration for the country selector particle. See `CountrySelectorParams`.
|
|
737
|
-
* @returns A molecule descriptor to pass to the `molecules` array in {@link IngridInitParams}.
|
|
738
|
-
*
|
|
739
|
-
* @example
|
|
740
|
-
* ```ts
|
|
741
|
-
* const ingrid = await initIngrid({
|
|
742
|
-
* token: 'your-auth-token',
|
|
743
|
-
* siteId: 'your-site-id',
|
|
744
|
-
* locale: 'en-US',
|
|
745
|
-
* molecules: [
|
|
746
|
-
* createCountrySelectorMolecule({ mode: 'select', name: 'country-picker' }),
|
|
747
|
-
* ],
|
|
748
|
-
* });
|
|
749
|
-
* ```
|
|
750
|
-
*
|
|
751
|
-
* @public
|
|
752
|
-
*/
|
|
753
|
-
export declare const createCountrySelectorMolecule: ({ mode, name, }: MoleculeParamsMap["countrySelector"]) => {
|
|
754
|
-
type: "countrySelector";
|
|
755
|
-
params: {
|
|
756
|
-
mode: "select";
|
|
757
|
-
name: string;
|
|
758
|
-
};
|
|
759
|
-
};
|
|
760
|
-
|
|
761
|
-
/**
|
|
762
|
-
* Creates a molecule configuration for the delivery particle.
|
|
763
|
-
*
|
|
764
|
-
* Renders a delivery options selector where the shopper can browse and choose a shipping method.
|
|
765
|
-
* Use `mode: 'active'` for a checkout flow where the shopper makes a selection, and
|
|
766
|
-
* `mode: 'passive'` for a read-only summary display.
|
|
767
|
-
*
|
|
768
|
-
* @param params - Configuration for the delivery particle. See `DeliveryParticleParams`.
|
|
769
|
-
* @returns A molecule descriptor to pass to the `molecules` array in {@link IngridInitParams}.
|
|
770
|
-
*
|
|
771
|
-
* @example
|
|
772
|
-
* ```ts
|
|
773
|
-
* const ingrid = await initIngrid({
|
|
774
|
-
* token: 'your-auth-token',
|
|
775
|
-
* siteId: 'your-site-id',
|
|
776
|
-
* locale: 'en-US',
|
|
777
|
-
* molecules: [
|
|
778
|
-
* createDeliveryMolecule({ mode: 'active', name: 'main-delivery' }),
|
|
779
|
-
* ],
|
|
780
|
-
* });
|
|
781
|
-
* ```
|
|
782
|
-
*
|
|
783
|
-
* @public
|
|
784
|
-
*/
|
|
785
|
-
export declare const createDeliveryMolecule: ({ mode, name, customization, }: MoleculeParamsMap["delivery"]) => {
|
|
786
|
-
type: "delivery";
|
|
787
|
-
customization: {
|
|
788
|
-
choice?: {
|
|
789
|
-
carrierInstructions?: "off" | "inline" | "popup";
|
|
790
|
-
gaplessAddonsList?: boolean;
|
|
791
|
-
gaplessCarrierList?: boolean;
|
|
792
|
-
gaplessDeliveryList?: boolean;
|
|
793
|
-
labels?: "off" | "chips" | "text";
|
|
794
|
-
showAddons?: boolean;
|
|
795
|
-
showCustomInfoText?: boolean;
|
|
796
|
-
showCustomText?: boolean;
|
|
797
|
-
showDiscountedPrice?: boolean;
|
|
798
|
-
showFreeShippingIndicator?: boolean;
|
|
799
|
-
showPrice?: boolean;
|
|
800
|
-
showRadioIndicator?: boolean;
|
|
801
|
-
showReturnPromise?: boolean;
|
|
802
|
-
showShippingLogo?: boolean;
|
|
803
|
-
};
|
|
804
|
-
location?: {
|
|
805
|
-
gaplessList?: boolean;
|
|
806
|
-
mapDefaultVisible?: boolean;
|
|
807
|
-
mapDefaultZoom?: number;
|
|
808
|
-
mapFitboundsMaxZoom?: number;
|
|
809
|
-
mapPosition?: "start" | "end";
|
|
810
|
-
mapToggleEnabled?: boolean;
|
|
811
|
-
};
|
|
812
|
-
productList?: {
|
|
813
|
-
defaultView?: "off" | "list" | "summary";
|
|
814
|
-
showImage?: boolean;
|
|
815
|
-
showMetadata?: boolean;
|
|
816
|
-
showPrice?: boolean;
|
|
817
|
-
showQuantity?: boolean;
|
|
818
|
-
summaryText?: "none" | "products" | "firstProductAndMore";
|
|
819
|
-
};
|
|
820
|
-
summary?: {
|
|
821
|
-
previewAddons?: boolean;
|
|
822
|
-
showFreeShippingIndicator?: boolean;
|
|
823
|
-
};
|
|
824
|
-
} | undefined;
|
|
825
|
-
params: {
|
|
826
|
-
mode: "active" | "passive";
|
|
827
|
-
name: string;
|
|
845
|
+
mode: "addressForm" | "searchDriven";
|
|
828
846
|
};
|
|
829
847
|
};
|
|
830
848
|
|
|
831
849
|
/**
|
|
832
|
-
*
|
|
833
|
-
*
|
|
834
|
-
* Renders a progress bar or message showing how close the shopper is to qualifying
|
|
835
|
-
* for free shipping. Pair it with a delivery molecule that has `showFreeShippingIndicator`
|
|
836
|
-
* enabled, or use it standalone via the `deliveryId` param.
|
|
837
|
-
*
|
|
838
|
-
* @param params - Configuration for the free shipping indicator particle. See `FreeShippingIndicatorParams`.
|
|
839
|
-
* @returns A molecule descriptor to pass to the `molecules` array in {@link IngridInitParams}.
|
|
840
|
-
*
|
|
841
|
-
* @example
|
|
842
|
-
* ```ts
|
|
843
|
-
* const ingrid = await initIngrid({
|
|
844
|
-
* token: 'your-auth-token',
|
|
845
|
-
* siteId: 'your-site-id',
|
|
846
|
-
* locale: 'en-US',
|
|
847
|
-
* molecules: [
|
|
848
|
-
* createFreeShippingIndicatorMolecule({ name: 'free-shipping' }),
|
|
849
|
-
* ],
|
|
850
|
-
* });
|
|
851
|
-
* ```
|
|
852
|
-
*
|
|
853
|
-
* @public
|
|
850
|
+
* @description Currency is an ISO 4217 three-letter currency code.
|
|
851
|
+
* @pattern ^[A-Z]{3}$
|
|
854
852
|
*/
|
|
855
|
-
|
|
856
|
-
type: "freeShippingIndicator";
|
|
857
|
-
customization: {
|
|
858
|
-
showExhaustedLevelsMessage?: boolean;
|
|
859
|
-
} | undefined;
|
|
860
|
-
params: {
|
|
861
|
-
name: string;
|
|
862
|
-
};
|
|
863
|
-
};
|
|
853
|
+
declare type Currency = string;
|
|
864
854
|
|
|
865
855
|
declare type DataResolver<Args, Output> = (args: Args) => Promise<Output>;
|
|
866
856
|
|
|
@@ -890,440 +880,133 @@ DeepPartial<U>[]
|
|
|
890
880
|
: T;
|
|
891
881
|
|
|
892
882
|
/**
|
|
893
|
-
* @description
|
|
883
|
+
* @description DeliveryAddress is a delivery destination address.\n\nIt extends Address with recipient- and delivery-specific fields and is used\nas the destination on `POST /v1/delivery/options` and\n`POST /v1/delivery/orders`.
|
|
894
884
|
*/
|
|
895
|
-
declare type
|
|
885
|
+
declare type DeliveryAddress = {
|
|
896
886
|
/**
|
|
897
|
-
* @description
|
|
898
|
-
* @type string
|
|
887
|
+
* @description CountryCode is the ISO 3166-1 alpha-2 country code.
|
|
899
888
|
*/
|
|
900
|
-
|
|
889
|
+
countryCode: CountryCode;
|
|
901
890
|
/**
|
|
902
|
-
* @description
|
|
903
|
-
* @type string
|
|
891
|
+
* @description PostalCode is the postal code. Formatting and validation rules are\nconditional on the country code.
|
|
892
|
+
* @type string
|
|
904
893
|
*/
|
|
905
|
-
|
|
894
|
+
postalCode: string;
|
|
906
895
|
/**
|
|
907
|
-
* @description
|
|
896
|
+
* @description AdministrativeArea is the first-level administrative subdivision\n(state, province, prefecture, etc.) as the ISO 3166-2 subdivision\ncode. Required for some destination countries — e.g. US, CA, MX, BR,\nAR, AU, CN, JP, MY, KR, ID, TH, IT, ES, IE — and ignored elsewhere.\nUse the country reference for specifics.
|
|
908
897
|
* @type string | undefined
|
|
909
898
|
*/
|
|
910
|
-
|
|
911
|
-
/**
|
|
912
|
-
* @description Indicates if this addon should be preselected by default.
|
|
913
|
-
* @type boolean | undefined
|
|
914
|
-
*/
|
|
915
|
-
preselected?: boolean;
|
|
916
|
-
/**
|
|
917
|
-
* @description Indicates if this addon was chosen.
|
|
918
|
-
* @type boolean | undefined
|
|
919
|
-
*/
|
|
920
|
-
chosen?: boolean;
|
|
899
|
+
administrativeArea?: string;
|
|
921
900
|
/**
|
|
922
|
-
* @description
|
|
901
|
+
* @description SubAdministrativeArea is the second-level administrative subdivision\n(county, district, etc.). Typically not required unless the country\nreference says otherwise.
|
|
923
902
|
* @type string | undefined
|
|
924
903
|
*/
|
|
925
|
-
|
|
904
|
+
subAdministrativeArea?: string;
|
|
926
905
|
/**
|
|
927
|
-
* @description
|
|
906
|
+
* @description Locality is the primary locality of the address — usually the city,\ntown, village, or municipality.
|
|
928
907
|
* @type string | undefined
|
|
929
908
|
*/
|
|
930
|
-
|
|
909
|
+
locality?: string;
|
|
931
910
|
/**
|
|
932
|
-
* @description
|
|
911
|
+
* @description SubLocality is the neighborhood, suburb, or district within the\nlocality. Required by some countries (e.g. JP chome, UK London\ndistricts, Latin-American colonias); see the country reference.
|
|
933
912
|
* @type string | undefined
|
|
934
913
|
*/
|
|
935
|
-
|
|
936
|
-
};
|
|
937
|
-
|
|
938
|
-
declare const deliveryArgsSchema = z.object({ sessionId: z.string(), token: z.string() });
|
|
939
|
-
|
|
940
|
-
/**
|
|
941
|
-
* @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.
|
|
942
|
-
* @default DELIVERY_TYPE_UNSPECIFIED
|
|
943
|
-
*/
|
|
944
|
-
declare type DeliveryCategoryDeliveryType = DeliveryCategoryDeliveryTypeEnum;
|
|
945
|
-
|
|
946
|
-
declare type DeliveryCategoryDeliveryTypeEnum =
|
|
947
|
-
| 'DELIVERY_TYPE_UNSPECIFIED'
|
|
948
|
-
| 'DELIVERY'
|
|
949
|
-
| 'PICKUP'
|
|
950
|
-
| 'MAILBOX'
|
|
951
|
-
| 'INSTORE';
|
|
952
|
-
|
|
953
|
-
/**
|
|
954
|
-
* @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.
|
|
955
|
-
* @default OPTIONS_SOURCE_UNSPECIFIED
|
|
956
|
-
*/
|
|
957
|
-
declare type DeliveryCategoryOptionsSource = DeliveryCategoryOptionsSourceEnum;
|
|
958
|
-
|
|
959
|
-
declare type DeliveryCategoryOptionsSourceEnum =
|
|
960
|
-
| 'OPTIONS_SOURCE_UNSPECIFIED'
|
|
961
|
-
| 'FALLBACK'
|
|
962
|
-
| 'CARRIER';
|
|
963
|
-
|
|
964
|
-
declare type DeliveryCategoryPriceLevels = {
|
|
914
|
+
subLocality?: string;
|
|
965
915
|
/**
|
|
966
|
-
* @description
|
|
916
|
+
* @description AddressLines are the ordered street address lines.\nIndex 0 holds primary street info (street name + number, or block\nnumber); subsequent indices hold secondary info (apartment, suite,\nfloor, building name).
|
|
967
917
|
* @type array | undefined
|
|
968
918
|
*/
|
|
969
|
-
|
|
970
|
-
};
|
|
971
|
-
|
|
972
|
-
/**
|
|
973
|
-
* @description Information about a warehouse.\nAll this data is stored in the site configuration.
|
|
974
|
-
*/
|
|
975
|
-
declare type DeliveryCategoryWarehouse = {
|
|
919
|
+
addressLines?: string[];
|
|
976
920
|
/**
|
|
977
|
-
* @description
|
|
978
|
-
* @type string
|
|
921
|
+
* @description Type is the kind of address (residential, commercial, etc.).
|
|
979
922
|
*/
|
|
980
|
-
|
|
923
|
+
type?: AddressType;
|
|
981
924
|
/**
|
|
982
|
-
* @description
|
|
983
|
-
* @type
|
|
925
|
+
* @description Instructions are free-text notes for the courier (door code, parking\nnotes, etc.). Honoured only when the selected service has\n`supports.courierInstructions: true`.
|
|
926
|
+
* @type string | undefined
|
|
984
927
|
*/
|
|
985
|
-
|
|
928
|
+
instructions?: string;
|
|
986
929
|
/**
|
|
987
|
-
* @description
|
|
930
|
+
* @description RecipientName is the name of the recipient, formatted as expected in the destination country.
|
|
988
931
|
* @type string | undefined
|
|
989
932
|
*/
|
|
990
|
-
|
|
933
|
+
recipientName?: string;
|
|
991
934
|
};
|
|
992
935
|
|
|
993
936
|
/**
|
|
994
|
-
* @description
|
|
937
|
+
* @description DeliveryCategory groups services by delivery type and provides display\nmetadata to organise the UI.
|
|
995
938
|
*/
|
|
996
|
-
declare type
|
|
997
|
-
/**
|
|
998
|
-
* @description The latitude in degrees. Must be within the range -90.0 to +90.0, inclusive.
|
|
999
|
-
* @type number, double
|
|
1000
|
-
*/
|
|
1001
|
-
lat: number;
|
|
939
|
+
declare type DeliveryCategory = {
|
|
1002
940
|
/**
|
|
1003
|
-
* @description
|
|
1004
|
-
* @type
|
|
941
|
+
* @description ID is the unique identifier for this category.
|
|
942
|
+
* @type string
|
|
1005
943
|
*/
|
|
1006
|
-
|
|
1007
|
-
};
|
|
1008
|
-
|
|
1009
|
-
/**
|
|
1010
|
-
* @description The DeliveryCategory represents a grouping of delivery options that share the same type and other characteristics.
|
|
1011
|
-
*/
|
|
1012
|
-
declare type DeliveryDeliveryCategory = {
|
|
944
|
+
id: string;
|
|
1013
945
|
/**
|
|
1014
|
-
* @description
|
|
946
|
+
* @description Name is the display name for this category.
|
|
1015
947
|
* @type string
|
|
1016
948
|
*/
|
|
1017
|
-
|
|
949
|
+
name: string;
|
|
1018
950
|
/**
|
|
1019
|
-
* @description
|
|
1020
|
-
* @type string | undefined
|
|
951
|
+
* @description DeliveryType is the kind of delivery for all services in this category.
|
|
1021
952
|
*/
|
|
1022
|
-
|
|
953
|
+
deliveryType: DeliveryType;
|
|
1023
954
|
/**
|
|
1024
|
-
* @description
|
|
1025
|
-
* @type
|
|
955
|
+
* @description Services are the available delivery services in this category.
|
|
956
|
+
* @type array
|
|
1026
957
|
*/
|
|
1027
|
-
|
|
958
|
+
services: DeliveryService_2[];
|
|
1028
959
|
/**
|
|
1029
|
-
* @description
|
|
1030
|
-
* @type
|
|
960
|
+
* @description Preselected indicates whether this category should be pre-selected\nby default. At most one category per delivery group is preselected.
|
|
961
|
+
* @type boolean | undefined
|
|
1031
962
|
*/
|
|
1032
|
-
|
|
963
|
+
preselected?: boolean;
|
|
1033
964
|
/**
|
|
1034
|
-
* @description
|
|
965
|
+
* @description SortOrder is the sort order for displaying this category (lower numbers first).
|
|
1035
966
|
* @type integer | undefined, int32
|
|
1036
967
|
*/
|
|
1037
|
-
|
|
968
|
+
sortOrder?: number;
|
|
1038
969
|
/**
|
|
1039
|
-
* @description
|
|
1040
|
-
* @type string
|
|
1041
|
-
*/
|
|
1042
|
-
options_source: DeliveryCategoryOptionsSource;
|
|
1043
|
-
/**
|
|
1044
|
-
* @description The delivery options available within this category.
|
|
1045
|
-
* @type array
|
|
1046
|
-
*/
|
|
1047
|
-
delivery_options: DeliveryDeliveryOption[];
|
|
1048
|
-
/**
|
|
1049
|
-
* @description Add-ons that are available for this category, e.g., gift wrapping, insurance.
|
|
1050
|
-
* @type array | undefined
|
|
1051
|
-
*/
|
|
1052
|
-
addons?: DeliveryAddon[];
|
|
1053
|
-
/**
|
|
1054
|
-
* @description Indicates if this category should be preselected by default.
|
|
1055
|
-
* @type boolean | undefined
|
|
1056
|
-
*/
|
|
1057
|
-
preselected?: boolean;
|
|
1058
|
-
/**
|
|
1059
|
-
* @description Indicates if this category was chosen by the user.
|
|
1060
|
-
* @type boolean | undefined
|
|
1061
|
-
*/
|
|
1062
|
-
chosen?: boolean;
|
|
1063
|
-
/**
|
|
1064
|
-
* @description Information about a warehouse.\nAll this data is stored in the site configuration.
|
|
1065
|
-
* @type object | undefined
|
|
1066
|
-
*/
|
|
1067
|
-
warehouse?: DeliveryCategoryWarehouse;
|
|
1068
|
-
/**
|
|
1069
|
-
* @description Tags associated with the delivery category, used for cross-reference purposes.
|
|
1070
|
-
* @type array | undefined
|
|
1071
|
-
*/
|
|
1072
|
-
readonly tags?: string[];
|
|
1073
|
-
/**
|
|
1074
|
-
* @description Information about active labels associated with the delivery category.\nLabels name and description are localized, if translations are provided.
|
|
1075
|
-
* @type array | undefined
|
|
1076
|
-
*/
|
|
1077
|
-
readonly labels?: DeliveryDeliveryCategoryLabel[];
|
|
1078
|
-
/**
|
|
1079
|
-
* @description Additional text that can be displayed with the category.\nThe presence of this field depends on the locale.
|
|
1080
|
-
* @type string | undefined
|
|
1081
|
-
*/
|
|
1082
|
-
readonly custom_text?: string;
|
|
1083
|
-
/**
|
|
1084
|
-
* @description Additional information that can be displayed with the category.\nThe presence of this field depends on the locale.
|
|
970
|
+
* @description CustomText is custom text to display alongside this category.
|
|
1085
971
|
* @type string | undefined
|
|
1086
972
|
*/
|
|
1087
|
-
|
|
973
|
+
customText?: string;
|
|
1088
974
|
/**
|
|
1089
|
-
* @
|
|
1090
|
-
*/
|
|
1091
|
-
readonly price_levels?: Record<string, DeliveryCategoryPriceLevels>;
|
|
1092
|
-
};
|
|
1093
|
-
|
|
1094
|
-
/**
|
|
1095
|
-
* @description Labels provide additional, customer-facing information for the delivery category.
|
|
1096
|
-
*/
|
|
1097
|
-
declare type DeliveryDeliveryCategoryLabel = {
|
|
1098
|
-
/**
|
|
1099
|
-
* @description Unique identifier of the label.
|
|
975
|
+
* @description WarningText is warning text to display for this category (e.g. delivery delays).
|
|
1100
976
|
* @type string | undefined
|
|
1101
977
|
*/
|
|
1102
|
-
|
|
978
|
+
warningText?: string;
|
|
1103
979
|
/**
|
|
1104
|
-
* @description
|
|
1105
|
-
* @type string | undefined
|
|
1106
|
-
*/
|
|
1107
|
-
name?: string;
|
|
1108
|
-
/**
|
|
1109
|
-
* @description Description of the label displayed to the customer.
|
|
1110
|
-
* @type string | undefined
|
|
1111
|
-
*/
|
|
1112
|
-
description?: string;
|
|
1113
|
-
/**
|
|
1114
|
-
* @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.
|
|
1115
|
-
* @type string | undefined
|
|
1116
|
-
*/
|
|
1117
|
-
type?: LabelLabelType;
|
|
1118
|
-
/**
|
|
1119
|
-
* @description Color code for the label, e.g., hex value.
|
|
1120
|
-
* @type string | undefined
|
|
1121
|
-
*/
|
|
1122
|
-
color?: string;
|
|
1123
|
-
/**
|
|
1124
|
-
* @description URI or identifier for the label icon.
|
|
1125
|
-
* @type string | undefined
|
|
1126
|
-
*/
|
|
1127
|
-
icon?: string;
|
|
1128
|
-
/**
|
|
1129
|
-
* @description Color code for the label in dark mode, e.g., hex value.
|
|
1130
|
-
* @type string | undefined
|
|
1131
|
-
*/
|
|
1132
|
-
dark_mode_color?: string;
|
|
1133
|
-
};
|
|
1134
|
-
|
|
1135
|
-
declare type DeliveryDeliveryNode = {
|
|
1136
|
-
/**
|
|
1137
|
-
* @description Constraints on the node\'s handoff.
|
|
1138
|
-
* @type object | undefined
|
|
1139
|
-
*/
|
|
1140
|
-
handoff?: DeliveryNodeHandoff;
|
|
1141
|
-
/**
|
|
1142
|
-
* @description Where the node is physically located.
|
|
1143
|
-
* @type object
|
|
1144
|
-
*/
|
|
1145
|
-
location: DeliveryDeliveryNodeLocation;
|
|
1146
|
-
/**
|
|
1147
|
-
* @description What roles the node can perform.
|
|
1148
|
-
* @type array
|
|
1149
|
-
*/
|
|
1150
|
-
roles: DeliveryNodeRole[];
|
|
1151
|
-
/**
|
|
1152
|
-
* @description Additional metadata about the node.\nFor cross-reference purposes.
|
|
980
|
+
* @description Tags are additional categorisation/filtering tags.
|
|
1153
981
|
* @type array | undefined
|
|
1154
982
|
*/
|
|
1155
983
|
tags?: string[];
|
|
1156
|
-
};
|
|
1157
|
-
|
|
1158
|
-
/**
|
|
1159
|
-
* @description Where the node is physically located.
|
|
1160
|
-
*/
|
|
1161
|
-
declare type DeliveryDeliveryNodeLocation = {
|
|
1162
984
|
/**
|
|
1163
|
-
* @description
|
|
1164
|
-
* @type
|
|
1165
|
-
*/
|
|
1166
|
-
by_value?: LocationByValue;
|
|
1167
|
-
/**
|
|
1168
|
-
* @description To reference an existing location.
|
|
1169
|
-
* @type object | undefined
|
|
985
|
+
* @description ExternalID is an external identifier for merchant-specific integrations.
|
|
986
|
+
* @type string | undefined
|
|
1170
987
|
*/
|
|
1171
|
-
|
|
988
|
+
externalId?: string;
|
|
1172
989
|
};
|
|
1173
990
|
|
|
1174
991
|
/**
|
|
1175
|
-
* @description
|
|
992
|
+
* @description DeliveryGroup holds the delivery options for a single shipment. In\nsplit-shipment scenarios the response carries multiple groups.
|
|
1176
993
|
*/
|
|
1177
|
-
declare type
|
|
994
|
+
declare type DeliveryGroup = {
|
|
1178
995
|
/**
|
|
1179
|
-
* @description
|
|
996
|
+
* @description ID is the unique identifier for this delivery group. Used to\ncorrelate with fulfillment groups in the request.
|
|
1180
997
|
* @type string
|
|
1181
998
|
*/
|
|
1182
999
|
id: string;
|
|
1183
1000
|
/**
|
|
1184
|
-
* @description
|
|
1185
|
-
* @type
|
|
1186
|
-
*/
|
|
1187
|
-
carrier: DeliveryOptionCarrier;
|
|
1188
|
-
/**
|
|
1189
|
-
* @description The PickupLocation represents a physical location from which a delivery can be retrieved.
|
|
1190
|
-
* @type object | undefined
|
|
1191
|
-
*/
|
|
1192
|
-
pickup_location?: DeliveryPickupLocation;
|
|
1193
|
-
/**
|
|
1194
|
-
* @description ETD stands for Estimated Time of Delivery.
|
|
1195
|
-
* @type object
|
|
1196
|
-
*/
|
|
1197
|
-
etd: DeliveryETD;
|
|
1198
|
-
/**
|
|
1199
|
-
* @description Indicates if this delivery option should be preselected by default.
|
|
1200
|
-
* @type boolean | undefined
|
|
1201
|
-
*/
|
|
1202
|
-
preselected?: boolean;
|
|
1203
|
-
/**
|
|
1204
|
-
* @description Indicates if this delivery option was chosen by the customer.
|
|
1205
|
-
* @type boolean | undefined
|
|
1206
|
-
*/
|
|
1207
|
-
chosen?: boolean;
|
|
1208
|
-
/**
|
|
1209
|
-
* @description The expiration timestamp in UTC of the delivery option.
|
|
1210
|
-
* @type string | undefined, date-time
|
|
1211
|
-
*/
|
|
1212
|
-
expire_time?: string;
|
|
1213
|
-
/**
|
|
1214
|
-
* @description Price associated with the delivery option in minor currency units, e.g., cents.
|
|
1215
|
-
* @type string, int64
|
|
1216
|
-
*/
|
|
1217
|
-
price: string;
|
|
1218
|
-
/**
|
|
1219
|
-
* @description Where delivery originates from.
|
|
1220
|
-
* @type object
|
|
1221
|
-
*/
|
|
1222
|
-
origin: DeliveryOptionOrigin;
|
|
1223
|
-
};
|
|
1224
|
-
|
|
1225
|
-
/**
|
|
1226
|
-
* @description Represents a distance measurement with both spatial distance and estimated travel time.
|
|
1227
|
-
*/
|
|
1228
|
-
declare type DeliveryDistance = {
|
|
1229
|
-
/**
|
|
1230
|
-
* @description Approximate distance in meters.
|
|
1231
|
-
* @type string | undefined, int64
|
|
1232
|
-
*/
|
|
1233
|
-
readonly meters?: string;
|
|
1234
|
-
/**
|
|
1235
|
-
* @description Approximate duration in minutes.
|
|
1236
|
-
* @type string | undefined, int64
|
|
1237
|
-
*/
|
|
1238
|
-
readonly minutes?: string;
|
|
1239
|
-
};
|
|
1240
|
-
|
|
1241
|
-
/**
|
|
1242
|
-
* @description ETD stands for Estimated Time of Delivery.
|
|
1243
|
-
*/
|
|
1244
|
-
declare type DeliveryETD = {
|
|
1245
|
-
/**
|
|
1246
|
-
* @description Relative represents an ETD as a range of time units.
|
|
1247
|
-
* @type object | undefined
|
|
1248
|
-
*/
|
|
1249
|
-
relative?: ETDRelative;
|
|
1250
|
-
/**
|
|
1251
|
-
* @description Absolute represents an ETD as a single or pair of timestamps.
|
|
1252
|
-
* @type object | undefined
|
|
1253
|
-
*/
|
|
1254
|
-
absolute?: ETDAbsolute;
|
|
1255
|
-
/**
|
|
1256
|
-
* @description Custom represents an ETD in a human-readable text format.
|
|
1257
|
-
* @type object | undefined
|
|
1258
|
-
*/
|
|
1259
|
-
custom?: ETDCustom;
|
|
1260
|
-
};
|
|
1261
|
-
|
|
1262
|
-
/**
|
|
1263
|
-
* @description A Fulfillment details when a delivery can be fulfilled.
|
|
1264
|
-
*/
|
|
1265
|
-
declare type DeliveryFulfillment = {
|
|
1266
|
-
/**
|
|
1267
|
-
* @description Readiness specifies a time range when the goods will be ready for shipment.
|
|
1268
|
-
* @type object
|
|
1269
|
-
*/
|
|
1270
|
-
readiness: FulfillmentReadiness;
|
|
1271
|
-
/**
|
|
1272
|
-
* @description List of category tags, to which the `Readiness` applies.\nIf empty, the `Readiness` applies to all categories.
|
|
1273
|
-
* @type array | undefined
|
|
1274
|
-
*/
|
|
1275
|
-
category_tags?: string[];
|
|
1276
|
-
};
|
|
1277
|
-
|
|
1278
|
-
/**
|
|
1279
|
-
* @description Represents a single item.
|
|
1280
|
-
*/
|
|
1281
|
-
declare type DeliveryLineItem = {
|
|
1282
|
-
/**
|
|
1283
|
-
* @description The unique item identifier of the item.
|
|
1284
|
-
* @type string
|
|
1285
|
-
*/
|
|
1286
|
-
sku: string;
|
|
1287
|
-
/**
|
|
1288
|
-
* @description The item name or title, which is suitable for presentation to the customer.
|
|
1289
|
-
* @type string
|
|
1290
|
-
*/
|
|
1291
|
-
title: string;
|
|
1292
|
-
/**
|
|
1293
|
-
* @description Total quantity of the item.
|
|
1294
|
-
* @type integer, int32
|
|
1295
|
-
*/
|
|
1296
|
-
quantity: number;
|
|
1297
|
-
/**
|
|
1298
|
-
* @description Weight of a single item in grams, must be greater than 0.
|
|
1299
|
-
* @type integer | undefined, int32
|
|
1300
|
-
*/
|
|
1301
|
-
weight?: number;
|
|
1302
|
-
/**
|
|
1303
|
-
* @description Represents the dimensions of the item.
|
|
1304
|
-
* @type object | undefined
|
|
1305
|
-
*/
|
|
1306
|
-
dimensions?: LineItemDimensions;
|
|
1307
|
-
/**
|
|
1308
|
-
* @description Non-negative discount applied to the item, or items. Unit is cents.
|
|
1309
|
-
* @type string | undefined, int64
|
|
1310
|
-
*/
|
|
1311
|
-
discount?: string;
|
|
1312
|
-
/**
|
|
1313
|
-
* @description Non-negative price of a single item after applying discounts. Unit is cents.
|
|
1314
|
-
* @type string | undefined, int64
|
|
1001
|
+
* @description Categories are the available delivery categories for this group.\nCategories organise services by delivery type (home delivery,\npickup, etc.).
|
|
1002
|
+
* @type array
|
|
1315
1003
|
*/
|
|
1316
|
-
|
|
1004
|
+
categories: DeliveryCategory[];
|
|
1317
1005
|
/**
|
|
1318
|
-
* @description
|
|
1006
|
+
* @description FulfillmentGroupRef references the fulfillment group in the request that this delivery group corresponds to.
|
|
1319
1007
|
* @type string | undefined
|
|
1320
1008
|
*/
|
|
1321
|
-
|
|
1322
|
-
/**
|
|
1323
|
-
* @description Used to control the behaviour of the filter/price rules.\nEquivalent of cart_items_attributes in the `Delivery Checkout` API.
|
|
1324
|
-
* @type array | undefined
|
|
1325
|
-
*/
|
|
1326
|
-
attributes?: string[];
|
|
1009
|
+
fulfillmentGroupRef?: string;
|
|
1327
1010
|
};
|
|
1328
1011
|
|
|
1329
1012
|
declare type DeliveryMoleculeParams = {
|
|
@@ -1340,11 +1023,18 @@ declare type DeliveryMoleculeParams = {
|
|
|
1340
1023
|
showCustomInfoText?: boolean;
|
|
1341
1024
|
showCustomText?: boolean;
|
|
1342
1025
|
showDiscountedPrice?: boolean;
|
|
1026
|
+
zeroPriceDisplay?: 'free' | '0';
|
|
1343
1027
|
showFreeShippingIndicator?: boolean;
|
|
1344
1028
|
showPrice?: boolean;
|
|
1345
1029
|
showRadioIndicator?: boolean;
|
|
1346
1030
|
showReturnPromise?: boolean;
|
|
1347
1031
|
showShippingLogo?: boolean;
|
|
1032
|
+
showDeliveryTime?: boolean;
|
|
1033
|
+
showLocationSection?: boolean;
|
|
1034
|
+
showLocationAddress?: boolean;
|
|
1035
|
+
showLocationCarrierName?: boolean;
|
|
1036
|
+
showLocationType?: boolean;
|
|
1037
|
+
categoryLabel?: 'name' | 'type';
|
|
1348
1038
|
};
|
|
1349
1039
|
location?: {
|
|
1350
1040
|
gaplessList?: boolean;
|
|
@@ -1353,6 +1043,15 @@ declare type DeliveryMoleculeParams = {
|
|
|
1353
1043
|
mapFitboundsMaxZoom?: number;
|
|
1354
1044
|
mapPosition?: 'start' | 'end';
|
|
1355
1045
|
mapToggleEnabled?: boolean;
|
|
1046
|
+
zeroPriceDisplay?: 'free' | '0';
|
|
1047
|
+
displayMode?: 'popup' | 'inline';
|
|
1048
|
+
selectionControl?: 'radio' | 'disabled';
|
|
1049
|
+
selectionAlignment?: 'left' | 'right';
|
|
1050
|
+
showLocationAddress?: boolean;
|
|
1051
|
+
showCarrierName?: boolean;
|
|
1052
|
+
showLocationType?: boolean;
|
|
1053
|
+
showOpeningHours?: boolean;
|
|
1054
|
+
showPrice?: boolean;
|
|
1356
1055
|
};
|
|
1357
1056
|
productList?: {
|
|
1358
1057
|
defaultView?: 'off' | 'list' | 'summary';
|
|
@@ -1361,276 +1060,166 @@ declare type DeliveryMoleculeParams = {
|
|
|
1361
1060
|
showPrice?: boolean;
|
|
1362
1061
|
showQuantity?: boolean;
|
|
1363
1062
|
summaryText?: 'none' | 'products' | 'firstProductAndMore';
|
|
1063
|
+
zeroPriceDisplay?: 'free' | '0';
|
|
1364
1064
|
};
|
|
1365
1065
|
summary?: {
|
|
1366
1066
|
previewAddons?: boolean;
|
|
1367
1067
|
showFreeShippingIndicator?: boolean;
|
|
1068
|
+
showDiscountedPrice?: boolean;
|
|
1069
|
+
zeroPriceDisplay?: 'free' | '0';
|
|
1070
|
+
categoryLabel?: 'name' | 'type';
|
|
1368
1071
|
};
|
|
1369
1072
|
};
|
|
1370
1073
|
};
|
|
1371
1074
|
|
|
1372
1075
|
declare const deliveryMoleculeParamsValidator = z.object({
|
|
1373
1076
|
customization: deliveryCustomizationValidator,
|
|
1374
|
-
|
|
1375
|
-
// TODO: the passive `mode` has hardcoded logic, but IMHO the behaviour should come from granular config (components + policies), not from `mode` branches.
|
|
1376
|
-
// Just an simple example:
|
|
1377
|
-
// components: {
|
|
1378
|
-
// continue_button: { display: 'hidden' },
|
|
1379
|
-
// pickup_location: { display: 'popup', interaction: 'preview' // or edit }
|
|
1380
|
-
// }
|
|
1381
|
-
//
|
|
1382
|
-
// actionPolicy: {
|
|
1383
|
-
// select_item: 'deny'
|
|
1384
|
-
// }
|
|
1385
|
-
//
|
|
1386
1077
|
mode: z.enum(['active', 'passive']),
|
|
1387
1078
|
name: z.string(),
|
|
1388
1079
|
}) satisfies z.ZodType<DeliveryMoleculeParams>;
|
|
1389
1080
|
|
|
1390
1081
|
/**
|
|
1391
|
-
* @description
|
|
1082
|
+
* @description DeliveryOptionsResponse is the response returned for a request to compute\ndelivery options.\n\nOptions are organised into groups (one per requested fulfillment group)\nand, within each group, into categories (by delivery type). Each service\nwithin a category is a selectable delivery option.
|
|
1392
1083
|
*/
|
|
1393
|
-
declare type
|
|
1394
|
-
/**
|
|
1395
|
-
* @description The earliest time the node can hand off the delivery.
|
|
1396
|
-
* @type string | undefined, date-time
|
|
1397
|
-
*/
|
|
1398
|
-
earliest_time?: string;
|
|
1084
|
+
declare type DeliveryOptionsResponse = {
|
|
1399
1085
|
/**
|
|
1400
|
-
* @description
|
|
1401
|
-
* @type
|
|
1086
|
+
* @description Groups are the delivery groups, one per fulfillment group in the\nrequest. For single-shipment orders this contains exactly one group;\nfor split shipments each group represents a separate delivery.
|
|
1087
|
+
* @type array
|
|
1402
1088
|
*/
|
|
1403
|
-
|
|
1089
|
+
groups: DeliveryGroup[];
|
|
1404
1090
|
};
|
|
1405
1091
|
|
|
1406
1092
|
/**
|
|
1407
|
-
* @description
|
|
1408
|
-
* @default ROLE_UNSPECIFIED
|
|
1093
|
+
* @description DeliveryRoute is the journey from origin to destination for a delivery.\nComplex deliveries may include multiple legs.
|
|
1409
1094
|
*/
|
|
1410
|
-
declare type
|
|
1411
|
-
|
|
1412
|
-
declare type DeliveryNodeRoleEnum = 'ROLE_UNSPECIFIED' | 'ORIGIN' | 'DESTINATION';
|
|
1413
|
-
|
|
1414
|
-
/**
|
|
1415
|
-
* @description The Carrier contains details about the shipping carrier associated with this delivery option.
|
|
1416
|
-
*/
|
|
1417
|
-
declare type DeliveryOptionCarrier = {
|
|
1095
|
+
declare type DeliveryRoute = {
|
|
1418
1096
|
/**
|
|
1419
|
-
* @description
|
|
1097
|
+
* @description ID is the unique identifier for this route.
|
|
1420
1098
|
* @type string
|
|
1421
1099
|
*/
|
|
1422
|
-
|
|
1423
|
-
/**
|
|
1424
|
-
* @description The product or service level name provided by the carrier, e.g., \"Parcel\", \"Standard\".
|
|
1425
|
-
* @type string
|
|
1426
|
-
*/
|
|
1427
|
-
product_name: string;
|
|
1428
|
-
/**
|
|
1429
|
-
* @description The product or service level identifier provided by the carrier, e.g., \"dhl-par\", \"ups-std\".
|
|
1430
|
-
* @type string
|
|
1431
|
-
*/
|
|
1432
|
-
product_id: string;
|
|
1433
|
-
/**
|
|
1434
|
-
* @description The original sort order assigned by the carrier.
|
|
1435
|
-
* @type integer | undefined, int32
|
|
1436
|
-
*/
|
|
1437
|
-
sort_order?: number;
|
|
1438
|
-
/**
|
|
1439
|
-
* @description Carrier-specific metadata.
|
|
1440
|
-
* @type object | undefined
|
|
1441
|
-
*/
|
|
1442
|
-
meta?: Record<string, string>;
|
|
1100
|
+
id: string;
|
|
1443
1101
|
/**
|
|
1444
|
-
* @description
|
|
1445
|
-
* @type
|
|
1102
|
+
* @description Legs are the individual steps of the delivery journey.
|
|
1103
|
+
* @type array
|
|
1446
1104
|
*/
|
|
1447
|
-
|
|
1105
|
+
legs: RouteLeg[];
|
|
1448
1106
|
};
|
|
1449
1107
|
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
declare type DeliveryOptionOrigin = {
|
|
1454
|
-
/**
|
|
1455
|
-
* @description Unique identifier of the origin.
|
|
1456
|
-
* @type string
|
|
1457
|
-
*/
|
|
1458
|
-
id: string;
|
|
1459
|
-
/**
|
|
1460
|
-
* @description Represents an address suitable for delivery.
|
|
1461
|
-
* @type object
|
|
1462
|
-
*/
|
|
1463
|
-
address: V1AlphaDeliveryAddress;
|
|
1464
|
-
/**
|
|
1465
|
-
* @description External identifier of the origin, used for integration purposes.
|
|
1466
|
-
* @type string | undefined
|
|
1467
|
-
*/
|
|
1468
|
-
external_id?: string;
|
|
1108
|
+
declare type DeliveryService = {
|
|
1109
|
+
getDeliveryOptions: DataResolver<GetDeliveryOptionsArgs, DeliveryOptionsResponse>;
|
|
1110
|
+
listLocations: DataResolver<ListLocationsArgs, ListLocationsResponse>;
|
|
1469
1111
|
};
|
|
1470
1112
|
|
|
1471
1113
|
/**
|
|
1472
|
-
* @description
|
|
1114
|
+
* @description DeliveryService is a specific, selectable shipping option.
|
|
1473
1115
|
*/
|
|
1474
|
-
declare type
|
|
1116
|
+
declare type DeliveryService_2 = {
|
|
1475
1117
|
/**
|
|
1476
|
-
* @description
|
|
1477
|
-
* @type string
|
|
1118
|
+
* @description Carrier provides this delivery service.
|
|
1478
1119
|
*/
|
|
1479
|
-
|
|
1120
|
+
carrier: Carrier;
|
|
1480
1121
|
/**
|
|
1481
|
-
* @description
|
|
1482
|
-
* @type string
|
|
1122
|
+
* @description Product is the carrier product for this delivery option. The product\n`id` is globally unique and should be used when selecting this\nservice.
|
|
1483
1123
|
*/
|
|
1484
|
-
|
|
1124
|
+
product: CarrierProduct;
|
|
1485
1125
|
/**
|
|
1486
|
-
* @description
|
|
1487
|
-
* @type string | undefined
|
|
1126
|
+
* @description DeliveryTime is when the delivery is expected to arrive.
|
|
1488
1127
|
*/
|
|
1489
|
-
|
|
1128
|
+
deliveryTime: DeliveryTime;
|
|
1490
1129
|
/**
|
|
1491
|
-
* @description
|
|
1492
|
-
* @type string
|
|
1130
|
+
* @description Price is the price for this delivery option.
|
|
1493
1131
|
*/
|
|
1494
|
-
|
|
1132
|
+
price: ServicePrice;
|
|
1495
1133
|
/**
|
|
1496
|
-
* @description
|
|
1497
|
-
* @type object | undefined
|
|
1134
|
+
* @description Location holds location details for the service.\n\n- For `instore` services this is set to the merchant store location.\n- For `pickup` services it is **not** populated by `/v1/delivery/options`.\n Pickup locations are fetched separately via `POST /v1/delivery/locations`,\n passing the service\'s `product.id` and the same `deliveryCriteria`.\n This keeps the options response small and avoids unnecessary location\n lookups when many pickup products are returned.
|
|
1498
1135
|
*/
|
|
1499
|
-
|
|
1500
|
-
/**
|
|
1501
|
-
* @description Contact represents generic contact information.
|
|
1502
|
-
* @type object | undefined
|
|
1503
|
-
*/
|
|
1504
|
-
delivery_contact?: V1AlphaDeliveryContact;
|
|
1505
|
-
/**
|
|
1506
|
-
* @description OperationalHours define when the pickup location is operating.
|
|
1507
|
-
* @type object | undefined
|
|
1508
|
-
*/
|
|
1509
|
-
operational_hours?: PickupLocationOperationalHours;
|
|
1136
|
+
location?: Location_2;
|
|
1510
1137
|
/**
|
|
1511
|
-
* @description
|
|
1138
|
+
* @description TimeSlots are the available time slots for scheduled delivery (if applicable).
|
|
1512
1139
|
* @type array | undefined
|
|
1513
1140
|
*/
|
|
1514
|
-
|
|
1515
|
-
/**
|
|
1516
|
-
* @description Distances define the walking and driving distances to the pickup location.
|
|
1517
|
-
* @type object | undefined
|
|
1518
|
-
*/
|
|
1519
|
-
distances?: PickupLocationDistances;
|
|
1520
|
-
};
|
|
1521
|
-
|
|
1522
|
-
/**
|
|
1523
|
-
* @description ReturnPromise contains promise for returns and exchanges for a user and a cart.
|
|
1524
|
-
*/
|
|
1525
|
-
declare type DeliveryReturnsPromise = {
|
|
1141
|
+
timeSlots?: TimeSlot[];
|
|
1526
1142
|
/**
|
|
1527
|
-
* @description
|
|
1528
|
-
* @type
|
|
1529
|
-
*/
|
|
1530
|
-
readonly id?: string;
|
|
1531
|
-
/**
|
|
1532
|
-
* @description Currency code for the return promise, e.g., \"USD\", \"EUR\".
|
|
1533
|
-
* @type string | undefined
|
|
1534
|
-
*/
|
|
1535
|
-
readonly currency_code?: string;
|
|
1536
|
-
/**
|
|
1537
|
-
* @description Indicates whether returns are enabled. See `return_cost` for the associated cost.
|
|
1538
|
-
* @type boolean | undefined
|
|
1143
|
+
* @description Routes describe the delivery journey from origin to destination.
|
|
1144
|
+
* @type array | undefined
|
|
1539
1145
|
*/
|
|
1540
|
-
|
|
1146
|
+
routes?: DeliveryRoute[];
|
|
1541
1147
|
/**
|
|
1542
|
-
* @description
|
|
1543
|
-
* @type string | undefined, int64
|
|
1148
|
+
* @description Supports lists features supported by this service.
|
|
1544
1149
|
*/
|
|
1545
|
-
|
|
1150
|
+
supports?: ServiceSupports;
|
|
1546
1151
|
/**
|
|
1547
|
-
* @description
|
|
1548
|
-
* @type
|
|
1152
|
+
* @description AvailableAddons are the add-ons that can be selected with this service.
|
|
1153
|
+
* @type array | undefined
|
|
1549
1154
|
*/
|
|
1550
|
-
|
|
1155
|
+
availableAddons?: ServiceAddon[];
|
|
1551
1156
|
/**
|
|
1552
|
-
* @description
|
|
1553
|
-
* @type
|
|
1157
|
+
* @description DefaultAddons are the add-ons included by default with this service.
|
|
1158
|
+
* @type array | undefined
|
|
1554
1159
|
*/
|
|
1555
|
-
|
|
1160
|
+
defaultAddons?: ServiceAddon[];
|
|
1556
1161
|
/**
|
|
1557
|
-
* @description
|
|
1558
|
-
* @type
|
|
1162
|
+
* @description Meta carries carrier-specific metadata.
|
|
1163
|
+
* @type object | undefined
|
|
1559
1164
|
*/
|
|
1560
|
-
|
|
1165
|
+
meta?: object;
|
|
1561
1166
|
/**
|
|
1562
|
-
* @description
|
|
1167
|
+
* @description ExternalMethodID is an external method identifier for merchant integrations.
|
|
1563
1168
|
* @type string | undefined
|
|
1564
1169
|
*/
|
|
1565
|
-
|
|
1170
|
+
externalMethodId?: string;
|
|
1566
1171
|
/**
|
|
1567
|
-
* @description
|
|
1568
|
-
* @type
|
|
1172
|
+
* @description Preselected indicates whether this service is pre-selected within\nits category. At most one service per category is preselected.
|
|
1173
|
+
* @type boolean | undefined
|
|
1569
1174
|
*/
|
|
1570
|
-
|
|
1175
|
+
preselected?: boolean;
|
|
1571
1176
|
/**
|
|
1572
|
-
* @description
|
|
1573
|
-
* @type
|
|
1177
|
+
* @description Token is an opaque token representing this delivery offer. Pass\nthis token in the `selections` array when creating an order to\nselect this service.\n\nThe token is a signed, self-contained payload that encodes the\noffered price, delivery details, and a hash of the request context\n(fulfillment groups + destination).\n\nThe token has a limited validity period. When `deliveryTime.expires`\nis set, the offer is valid until that timestamp; when it is not\nset, the offer is subject to the default validity window for the\ncarrier and may still be rejected with `offer-expired` at\norder-creation time.\n\nAt order creation time, the server validates the token\'s signature,\nexpiry, and that the submitted cart and destination match what was\noriginally offered.
|
|
1178
|
+
* @type string
|
|
1574
1179
|
*/
|
|
1575
|
-
|
|
1576
|
-
};
|
|
1577
|
-
|
|
1578
|
-
declare type DeliveryService = {
|
|
1579
|
-
getSession: DataResolver<GetDeliverySessionArgs, DeliverySession>;
|
|
1180
|
+
token: string;
|
|
1580
1181
|
};
|
|
1581
1182
|
|
|
1582
1183
|
/**
|
|
1583
|
-
* @description
|
|
1184
|
+
* @description DeliveryTime is the window in which a delivery is expected to occur.
|
|
1584
1185
|
*/
|
|
1585
|
-
declare type
|
|
1586
|
-
/**
|
|
1587
|
-
* @type string | undefined
|
|
1588
|
-
*/
|
|
1589
|
-
name?: string;
|
|
1590
|
-
/**
|
|
1591
|
-
* @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.
|
|
1592
|
-
* @type string | undefined
|
|
1593
|
-
*/
|
|
1594
|
-
state?: SessionState;
|
|
1186
|
+
declare type DeliveryTime = {
|
|
1595
1187
|
/**
|
|
1596
|
-
* @description
|
|
1597
|
-
* @type
|
|
1598
|
-
*/
|
|
1599
|
-
purchase: SessionPurchase;
|
|
1600
|
-
/**
|
|
1601
|
-
* @description The deliveries included in this session.
|
|
1602
|
-
* @type array
|
|
1188
|
+
* @description Earliest expected delivery date/time. When the time component is\n00:00:00, only the date is promised.
|
|
1189
|
+
* @type string, date-time
|
|
1603
1190
|
*/
|
|
1604
|
-
|
|
1191
|
+
earliest: string;
|
|
1605
1192
|
/**
|
|
1606
|
-
* @description
|
|
1607
|
-
* @type string
|
|
1193
|
+
* @description Latest expected delivery date/time. When the time component is\n00:00:00, only the date is promised.
|
|
1194
|
+
* @type string, date-time
|
|
1608
1195
|
*/
|
|
1609
|
-
|
|
1196
|
+
latest: string;
|
|
1610
1197
|
/**
|
|
1611
|
-
* @description
|
|
1198
|
+
* @description Expires is when this delivery time estimate expires and may need to be refreshed.
|
|
1612
1199
|
* @type string | undefined, date-time
|
|
1613
1200
|
*/
|
|
1614
|
-
|
|
1201
|
+
expires?: string;
|
|
1615
1202
|
/**
|
|
1616
|
-
* @description
|
|
1203
|
+
* @description Formatted is a human-readable formatted delivery time for display,\npre-formatted according to locale and merchant preferences.
|
|
1617
1204
|
* @type string | undefined
|
|
1618
1205
|
*/
|
|
1619
|
-
|
|
1620
|
-
/**
|
|
1621
|
-
* @description ReturnPromise contains promise for returns and exchanges for a user and a cart.
|
|
1622
|
-
* @type object | undefined
|
|
1623
|
-
*/
|
|
1624
|
-
returns_promise?: DeliveryReturnsPromise;
|
|
1206
|
+
formatted?: string;
|
|
1625
1207
|
};
|
|
1626
1208
|
|
|
1209
|
+
/**
|
|
1210
|
+
* @description DeliveryType is the kind of delivery a service performs.
|
|
1211
|
+
*/
|
|
1212
|
+
declare type DeliveryType = DeliveryTypeEnum;
|
|
1213
|
+
|
|
1627
1214
|
/**
|
|
1628
1215
|
* @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.
|
|
1629
1216
|
* @default UNKNOWN
|
|
1630
1217
|
*/
|
|
1631
|
-
declare type
|
|
1218
|
+
declare type DeliveryType_2 = DeliveryTypeEnum_2;
|
|
1219
|
+
|
|
1220
|
+
declare type DeliveryTypeEnum = 'delivery' | 'pickup' | 'mailbox' | 'instore';
|
|
1632
1221
|
|
|
1633
|
-
declare type
|
|
1222
|
+
declare type DeliveryTypeEnum_2 =
|
|
1634
1223
|
| 'UNKNOWN'
|
|
1635
1224
|
| 'DELIVERY'
|
|
1636
1225
|
| 'PICKUP'
|
|
@@ -1669,13 +1258,29 @@ declare type DisplayItem = {
|
|
|
1669
1258
|
*/
|
|
1670
1259
|
quantity?: number;
|
|
1671
1260
|
/**
|
|
1672
|
-
* @type string | undefined
|
|
1261
|
+
* @type string | undefined
|
|
1262
|
+
*/
|
|
1263
|
+
sku?: string;
|
|
1264
|
+
/**
|
|
1265
|
+
* @type integer | undefined, int32
|
|
1266
|
+
*/
|
|
1267
|
+
total_price?: number;
|
|
1268
|
+
};
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* @description DistanceDetail is a detailed distance measurement with optional\ntravel-time estimate.
|
|
1272
|
+
*/
|
|
1273
|
+
declare type DistanceDetail = {
|
|
1274
|
+
/**
|
|
1275
|
+
* @description Meters is the distance value in meters.
|
|
1276
|
+
* @type integer, int32
|
|
1673
1277
|
*/
|
|
1674
|
-
|
|
1278
|
+
meters: number;
|
|
1675
1279
|
/**
|
|
1280
|
+
* @description DurationMinutes is the estimated travel duration in minutes.
|
|
1676
1281
|
* @type integer | undefined, int32
|
|
1677
1282
|
*/
|
|
1678
|
-
|
|
1283
|
+
durationMinutes?: number;
|
|
1679
1284
|
};
|
|
1680
1285
|
|
|
1681
1286
|
declare type EstimatedTime = {
|
|
@@ -1691,75 +1296,41 @@ declare type EstimatedTime = {
|
|
|
1691
1296
|
latest?: string;
|
|
1692
1297
|
};
|
|
1693
1298
|
|
|
1694
|
-
|
|
1695
|
-
* @description Absolute represents an ETD as a single or pair of timestamps.
|
|
1696
|
-
*/
|
|
1697
|
-
declare type ETDAbsolute = {
|
|
1698
|
-
/**
|
|
1699
|
-
* @description The earliest possible delivery time. If unspecified, delivery is considered to be immediate.
|
|
1700
|
-
* @type string | undefined, date-time
|
|
1701
|
-
*/
|
|
1702
|
-
earliest_time?: string;
|
|
1703
|
-
/**
|
|
1704
|
-
* @description The latest possible delivery time. If unspecified, there is no guaranteed maximum time.
|
|
1705
|
-
* @type string | undefined, date-time
|
|
1706
|
-
*/
|
|
1707
|
-
latest_time?: string;
|
|
1708
|
-
};
|
|
1709
|
-
|
|
1710
|
-
/**
|
|
1711
|
-
* @description Custom represents an ETD in a human-readable text format.
|
|
1712
|
-
*/
|
|
1713
|
-
declare type ETDCustom = {
|
|
1714
|
-
/**
|
|
1715
|
-
* @description Description in a text form, e.g., \"Before Christmas\", \"Same day if ordered before 2PM\".
|
|
1716
|
-
* @type string
|
|
1717
|
-
*/
|
|
1718
|
-
text: string;
|
|
1719
|
-
};
|
|
1299
|
+
declare type Event_2<T> = { payload: T };
|
|
1720
1300
|
|
|
1721
1301
|
/**
|
|
1722
|
-
*
|
|
1302
|
+
* Map of all events emitted by the Ingrid compound.
|
|
1303
|
+
*
|
|
1304
|
+
* | Event | When it fires |
|
|
1305
|
+
* | ----------------- | --------------------------------------------------------------------- |
|
|
1306
|
+
* | `ready` | Compound is mounted and interactive |
|
|
1307
|
+
* | `addressSubmit` | Shopper confirms the address form |
|
|
1308
|
+
* | `countryChange` | Shopper selects a different country |
|
|
1309
|
+
* | `selectionChange` | Shopper selects a delivery option |
|
|
1310
|
+
* | `error` | An unhandled error occurs during mount or is caught by the compound's error boundary at runtime |
|
|
1311
|
+
*
|
|
1312
|
+
* @remarks
|
|
1313
|
+
* The `error` event fires in two situations:
|
|
1314
|
+
* - **Mount failure** — an error thrown while loading or initialising the compound.
|
|
1315
|
+
* - **Runtime boundary** — an unhandled React error caught by the compound's top-level
|
|
1316
|
+
* error boundary. In this case the compound renders a generic fallback UI and remains
|
|
1317
|
+
* alive; the integrator can use this event to log or react to the failure.
|
|
1318
|
+
*
|
|
1319
|
+
* Event names and payload shapes may evolve before the stable release.
|
|
1320
|
+
*
|
|
1321
|
+
* @public
|
|
1723
1322
|
*/
|
|
1724
|
-
declare type
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
* @type string
|
|
1728
|
-
*/
|
|
1729
|
-
unit: ETDTimeUnit;
|
|
1730
|
-
/**
|
|
1731
|
-
* @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).
|
|
1732
|
-
* @type integer | undefined, int32
|
|
1733
|
-
*/
|
|
1734
|
-
earliest?: number;
|
|
1323
|
+
export declare type EventsMap = {
|
|
1324
|
+
countryChange: (event: Event_2<{ country_code: string }>) => void;
|
|
1325
|
+
addressSubmit: (event: Event_2<Partial<AddressContactEntry>>) => void;
|
|
1735
1326
|
/**
|
|
1736
|
-
*
|
|
1737
|
-
*
|
|
1327
|
+
* Fires when the shopper selects a delivery option. `groupId`/`categoryId`
|
|
1328
|
+
* identify the choice within the options response; `serviceToken` is the
|
|
1329
|
+
* signed offer token to hand to the orchestrator for backend order creation.
|
|
1738
1330
|
*/
|
|
1739
|
-
|
|
1740
|
-
}
|
|
1741
|
-
|
|
1742
|
-
/**
|
|
1743
|
-
* @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
|
|
1744
|
-
* @default TIME_UNIT_UNSPECIFIED
|
|
1745
|
-
*/
|
|
1746
|
-
declare type ETDTimeUnit = ETDTimeUnitEnum;
|
|
1747
|
-
|
|
1748
|
-
declare type ETDTimeUnitEnum =
|
|
1749
|
-
| 'TIME_UNIT_UNSPECIFIED'
|
|
1750
|
-
| 'TIME_UNIT_MINUTE'
|
|
1751
|
-
| 'TIME_UNIT_HOUR'
|
|
1752
|
-
| 'TIME_UNIT_DAY'
|
|
1753
|
-
| 'TIME_UNIT_BUSINESS_DAY'
|
|
1754
|
-
| 'TIME_UNIT_WEEK'
|
|
1755
|
-
| 'TIME_UNIT_MONTH';
|
|
1756
|
-
|
|
1757
|
-
declare type Event_2<T> = { payload: T };
|
|
1758
|
-
|
|
1759
|
-
declare type EventsMap = {
|
|
1760
|
-
countryChange: (event: Event_2<{ country_code: string }>) => void;
|
|
1761
|
-
addressSubmit: (event: Event_2<AddressMoleculeInputState>) => void;
|
|
1762
|
-
selectionChange: (event: Event_2<{ deliveryId: string; categoryId: string }>) => void;
|
|
1331
|
+
selectionChange: (
|
|
1332
|
+
event: Event_2<{ groupId: string; categoryId: string; serviceToken: string }>
|
|
1333
|
+
) => void;
|
|
1763
1334
|
ready: () => void;
|
|
1764
1335
|
error: (error: unknown) => void;
|
|
1765
1336
|
};
|
|
@@ -1783,7 +1354,7 @@ declare type FormMeta = {
|
|
|
1783
1354
|
/**
|
|
1784
1355
|
* @description ISO 3166-1 alpha-2 country code for this form configuration.
|
|
1785
1356
|
*/
|
|
1786
|
-
countryCode:
|
|
1357
|
+
countryCode: CountryCode_2;
|
|
1787
1358
|
/**
|
|
1788
1359
|
* @description Text direction. `rtl` (Right-to-Left) is critical for\nlanguages like Arabic or Hebrew.
|
|
1789
1360
|
*/
|
|
@@ -1795,12 +1366,20 @@ declare type FormMeta = {
|
|
|
1795
1366
|
language: string;
|
|
1796
1367
|
};
|
|
1797
1368
|
|
|
1369
|
+
/**
|
|
1370
|
+
* @description Selects which address form configuration to return.
|
|
1371
|
+
*/
|
|
1372
|
+
declare type FormType = FormTypeEnum;
|
|
1373
|
+
|
|
1374
|
+
declare type FormTypeEnum = 'delivery' | 'billing';
|
|
1375
|
+
|
|
1798
1376
|
declare const freeShippingIndicatorMoleculeParamsValidator = z.object({
|
|
1799
1377
|
name: z.string(),
|
|
1800
1378
|
deliveryId: z.string().optional(),
|
|
1801
1379
|
customization: z
|
|
1802
1380
|
.object({
|
|
1803
1381
|
showExhaustedLevelsMessage: z.boolean().optional(),
|
|
1382
|
+
zeroPriceDisplay: z.enum(['free', '0']).optional(),
|
|
1804
1383
|
})
|
|
1805
1384
|
.optional(),
|
|
1806
1385
|
}) satisfies z.ZodType<FreeShippingIndicatorParams>;
|
|
@@ -1810,25 +1389,10 @@ declare type FreeShippingIndicatorParams = {
|
|
|
1810
1389
|
deliveryId?: string;
|
|
1811
1390
|
customization?: {
|
|
1812
1391
|
showExhaustedLevelsMessage?: boolean;
|
|
1392
|
+
zeroPriceDisplay?: 'free' | '0';
|
|
1813
1393
|
};
|
|
1814
1394
|
};
|
|
1815
1395
|
|
|
1816
|
-
/**
|
|
1817
|
-
* @description Readiness specifies a time range when the goods will be ready for shipment.
|
|
1818
|
-
*/
|
|
1819
|
-
declare type FulfillmentReadiness = {
|
|
1820
|
-
/**
|
|
1821
|
-
* @description The earliest timestamp when the goods will be ready for shipment.
|
|
1822
|
-
* @type string, date-time
|
|
1823
|
-
*/
|
|
1824
|
-
earliest_time: string;
|
|
1825
|
-
/**
|
|
1826
|
-
* @description The latest timestamp when the goods will be ready for shipment.\nIf not specified, the goods will be ready indefinitely after start_time.
|
|
1827
|
-
* @type string | undefined, date-time
|
|
1828
|
-
*/
|
|
1829
|
-
latest_time?: string;
|
|
1830
|
-
};
|
|
1831
|
-
|
|
1832
1396
|
/**
|
|
1833
1397
|
* @description The request has succeeded.
|
|
1834
1398
|
*/
|
|
@@ -1899,7 +1463,7 @@ declare type GetAddressFormQueryParams = {
|
|
|
1899
1463
|
* @pattern ^[A-Z]{2}$
|
|
1900
1464
|
* @type string
|
|
1901
1465
|
*/
|
|
1902
|
-
countryCode:
|
|
1466
|
+
countryCode: CountryCode_2;
|
|
1903
1467
|
/**
|
|
1904
1468
|
* @description Site identifier, referring to which site the form configurations are related to.
|
|
1905
1469
|
* @type string
|
|
@@ -1910,11 +1474,32 @@ declare type GetAddressFormQueryParams = {
|
|
|
1910
1474
|
* @type string | undefined
|
|
1911
1475
|
*/
|
|
1912
1476
|
postalCode?: string;
|
|
1477
|
+
/**
|
|
1478
|
+
* @description Selects which address form configuration to return.
|
|
1479
|
+
* @type string | undefined
|
|
1480
|
+
*/
|
|
1481
|
+
type?: FormType;
|
|
1913
1482
|
};
|
|
1914
1483
|
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1484
|
+
/**
|
|
1485
|
+
* Arguments for fetching delivery options in the stateless model.
|
|
1486
|
+
*
|
|
1487
|
+
* The cart/fulfillment data lives in the immutable snapshot referenced by
|
|
1488
|
+
* `deliveryCriteria` (created server-to-server via `POST /v1/delivery-criteria`).
|
|
1489
|
+
* Only per-request inputs are passed here.
|
|
1490
|
+
*/
|
|
1491
|
+
declare type GetDeliveryOptionsArgs = {
|
|
1492
|
+
/** Opaque reference to the immutable delivery-criteria snapshot. */
|
|
1493
|
+
deliveryCriteria: string;
|
|
1494
|
+
/** Destination address; resolved from the snapshot when omitted. */
|
|
1495
|
+
destination?: DeliveryAddress;
|
|
1496
|
+
/** Personalisation/analytics context, unrelated to the snapshot. */
|
|
1497
|
+
context?: Context;
|
|
1498
|
+
} & SDKManagedTokenArg;
|
|
1499
|
+
|
|
1500
|
+
declare type GetTrackingDataArgs =
|
|
1501
|
+
| ({ locale: Locale } & SDKManagedTokenArg)
|
|
1502
|
+
| { email: string; tos_id: string; locale: Locale };
|
|
1918
1503
|
|
|
1919
1504
|
declare type GetTrackingDataResponse = {
|
|
1920
1505
|
/**
|
|
@@ -1938,6 +1523,10 @@ declare type GetTrackingDataResponse = {
|
|
|
1938
1523
|
* @type string
|
|
1939
1524
|
*/
|
|
1940
1525
|
tos_id: string;
|
|
1526
|
+
/**
|
|
1527
|
+
* @type object | undefined
|
|
1528
|
+
*/
|
|
1529
|
+
withdrawal?: Withdrawal;
|
|
1941
1530
|
};
|
|
1942
1531
|
|
|
1943
1532
|
declare type GetTrackingDataResponseOptions = {
|
|
@@ -1983,13 +1572,20 @@ declare const ingrid: {
|
|
|
1983
1572
|
export default ingrid;
|
|
1984
1573
|
|
|
1985
1574
|
/**
|
|
1986
|
-
* The compound instance returned by
|
|
1575
|
+
* The compound instance returned by `ingrid.init`, used to control the lifecycle
|
|
1987
1576
|
* of the rendered Ingrid experience.
|
|
1988
1577
|
*
|
|
1989
1578
|
* @public
|
|
1990
1579
|
*/
|
|
1991
1580
|
export declare interface IngridCompound {
|
|
1992
|
-
/**
|
|
1581
|
+
/**
|
|
1582
|
+
* Mounts the Ingrid experience into the DOM element matching `containerSelector`.
|
|
1583
|
+
*
|
|
1584
|
+
* @param containerSelector - CSS selector for the container element to mount into.
|
|
1585
|
+
* @param options - Optional mount options.
|
|
1586
|
+
* @param options.signal - An `AbortSignal` to cancel the mount. If the signal fires before
|
|
1587
|
+
* the compound finishes loading, the mount is silently abandoned and no error is thrown.
|
|
1588
|
+
*/
|
|
1993
1589
|
mount(containerSelector: string, options?: {
|
|
1994
1590
|
signal?: AbortSignal;
|
|
1995
1591
|
}): Promise<void>;
|
|
@@ -1998,9 +1594,11 @@ export declare interface IngridCompound {
|
|
|
1998
1594
|
/** Updates runtime configuration of the mounted experience. */
|
|
1999
1595
|
update(newConfig: Partial<UpdatableConfig>): void;
|
|
2000
1596
|
/**
|
|
2001
|
-
* Subscribes to an SDK event.
|
|
1597
|
+
* Subscribes to an SDK event. See {@link EventsMap} for available events and their payloads.
|
|
2002
1598
|
*
|
|
2003
|
-
* @
|
|
1599
|
+
* @param event - The event name to subscribe to.
|
|
1600
|
+
* @param callback - Called each time the event fires.
|
|
1601
|
+
* @returns An unsubscribe function - call it to stop listening.
|
|
2004
1602
|
*/
|
|
2005
1603
|
on<K extends keyof EventsMap>(event: K, callback: EventsMap[K]): () => boolean;
|
|
2006
1604
|
}
|
|
@@ -2023,13 +1621,30 @@ export declare interface IngridCompound {
|
|
|
2023
1621
|
* @public
|
|
2024
1622
|
*/
|
|
2025
1623
|
export declare interface IngridInitParams {
|
|
2026
|
-
/**
|
|
2027
|
-
token
|
|
2028
|
-
/**
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
1624
|
+
/** Initial token for Ingrid built-in providers. */
|
|
1625
|
+
token?: string;
|
|
1626
|
+
/**
|
|
1627
|
+
* Optional callback for short-lived Ingrid API tokens, which are preferred.
|
|
1628
|
+
* Call your backend to fetch and return a fresh Ingrid API token along with its expiration timestamp: `{ accessToken, expiresAt }`.
|
|
1629
|
+
*/
|
|
1630
|
+
refreshToken?: () => Promise<TokenRefreshResult>;
|
|
1631
|
+
/**
|
|
1632
|
+
* Callback that returns a fresh delivery-context reference (the opaque
|
|
1633
|
+
* `deliveryCriteria` snapshot your backend creates via
|
|
1634
|
+
* `POST /v1/delivery-criteria`). Required for the delivery molecule.
|
|
1635
|
+
*
|
|
1636
|
+
* The SDK calls this to bootstrap the delivery flow and again to transparently
|
|
1637
|
+
* recover when a reference expires or is superseded.
|
|
1638
|
+
*
|
|
1639
|
+
* @example
|
|
1640
|
+
* ```ts
|
|
1641
|
+
* deliveryContextProvider: async () => {
|
|
1642
|
+
* const { deliveryContextReference } = await myBackend.getIngridDeliveryContext();
|
|
1643
|
+
* return deliveryContextReference;
|
|
1644
|
+
* }
|
|
1645
|
+
* ```
|
|
1646
|
+
*/
|
|
1647
|
+
deliveryContextProvider?: () => Promise<string>;
|
|
2033
1648
|
/** Ingrid site identifier. */
|
|
2034
1649
|
siteId: string;
|
|
2035
1650
|
/** The locale to use for the experience. */
|
|
@@ -2062,12 +1677,22 @@ export declare interface IngridInitParams {
|
|
|
2062
1677
|
export declare interface IngridInstance {
|
|
2063
1678
|
/** The compound instance used to mount, unmount, and update the Ingrid experience. */
|
|
2064
1679
|
compound: IngridCompound;
|
|
2065
|
-
/**
|
|
1680
|
+
/**
|
|
1681
|
+
* Updates the active locale for the experience.
|
|
1682
|
+
* If the locale is not supported, falls back to `'en-US'`.
|
|
1683
|
+
*/
|
|
2066
1684
|
setLocale(locale: Locale): void;
|
|
2067
1685
|
/** Updates the active purchase country code. */
|
|
2068
1686
|
setPurchaseCountry(countryCode: string): void;
|
|
2069
1687
|
/** Updates the active currency. */
|
|
2070
1688
|
setCurrency(currency: string): void;
|
|
1689
|
+
/**
|
|
1690
|
+
* Pre-emptively sets the current delivery-context reference (e.g. after the
|
|
1691
|
+
* cart changes and your backend issues a fresh `deliveryCriteria`). The
|
|
1692
|
+
* delivery molecule discards stale options and refetches with the new
|
|
1693
|
+
* reference.
|
|
1694
|
+
*/
|
|
1695
|
+
setDeliveryContext(reference: string): void;
|
|
2071
1696
|
/* Excluded from this release type: __internal */
|
|
2072
1697
|
}
|
|
2073
1698
|
|
|
@@ -2147,17 +1772,9 @@ declare type ItemVariant = {
|
|
|
2147
1772
|
};
|
|
2148
1773
|
|
|
2149
1774
|
/**
|
|
2150
|
-
* @description
|
|
2151
|
-
* @default LABEL_TYPE_UNKNOWN
|
|
1775
|
+
* @description Latitude is in decimal degrees (WGS 84) and ranges from -90 to 90.
|
|
2152
1776
|
*/
|
|
2153
|
-
declare type
|
|
2154
|
-
|
|
2155
|
-
declare type LabelLabelTypeEnum =
|
|
2156
|
-
| 'LABEL_TYPE_UNKNOWN'
|
|
2157
|
-
| 'LABEL_TYPE_SUSTAINABILITY'
|
|
2158
|
-
| 'LABEL_TYPE_PRIORITY'
|
|
2159
|
-
| 'LABEL_TYPE_CUSTOM'
|
|
2160
|
-
| 'LABEL_TYPE_SWAN';
|
|
1777
|
+
declare type Latitude = number;
|
|
2161
1778
|
|
|
2162
1779
|
declare type LineItem = {
|
|
2163
1780
|
/**
|
|
@@ -2207,34 +1824,98 @@ declare type LineItem = {
|
|
|
2207
1824
|
};
|
|
2208
1825
|
|
|
2209
1826
|
/**
|
|
2210
|
-
*
|
|
1827
|
+
* Arguments for searching pickup locations for a given location-based product.
|
|
1828
|
+
* Pickup locations are not embedded in the options response; they are fetched
|
|
1829
|
+
* lazily here using the selected service's `product.id`.
|
|
1830
|
+
*/
|
|
1831
|
+
declare type ListLocationsArgs = {
|
|
1832
|
+
/** Opaque reference to the immutable delivery-criteria snapshot. */
|
|
1833
|
+
deliveryCriteria: string;
|
|
1834
|
+
/** The carrier product to look up locations for (`DeliveryService.product.id`). */
|
|
1835
|
+
productId: string;
|
|
1836
|
+
/** Area to search around; resolved from the snapshot destination when omitted. */
|
|
1837
|
+
address?: Address;
|
|
1838
|
+
/** Optional coordinates to sort results by distance from. */
|
|
1839
|
+
latitude?: number;
|
|
1840
|
+
longitude?: number;
|
|
1841
|
+
/** Max number of locations to return (defaults to 10, capped at 20). */
|
|
1842
|
+
limit?: number;
|
|
1843
|
+
/** Personalisation/analytics context, unrelated to the snapshot. */
|
|
1844
|
+
context?: Context;
|
|
1845
|
+
} & SDKManagedTokenArg;
|
|
1846
|
+
|
|
1847
|
+
/**
|
|
1848
|
+
* @description ListLocationsResponse is the response containing pickup locations\nmatching the request.\n\nThe `for*` fields echo back the resolved request inputs (with snapshot\ndefaults applied) so the caller can see exactly which product, address,\nand reference point produced the listed locations.
|
|
2211
1849
|
*/
|
|
2212
|
-
declare type
|
|
1850
|
+
declare type ListLocationsResponse = {
|
|
2213
1851
|
/**
|
|
2214
|
-
* @description
|
|
2215
|
-
* @type
|
|
1852
|
+
* @description ForProductID is the carrier product the locations are listed for.
|
|
1853
|
+
* @type string
|
|
2216
1854
|
*/
|
|
2217
|
-
|
|
1855
|
+
forProductId: string;
|
|
2218
1856
|
/**
|
|
2219
|
-
* @description
|
|
2220
|
-
* @type integer, int32
|
|
1857
|
+
* @description ForAddress is the address the locations are listed for, after applying snapshot defaults.
|
|
2221
1858
|
*/
|
|
2222
|
-
|
|
1859
|
+
forAddress: Address;
|
|
2223
1860
|
/**
|
|
2224
|
-
* @description
|
|
2225
|
-
* @type integer, int32
|
|
1861
|
+
* @description ForLatitude is the latitude used for distance-based sorting, when supplied.
|
|
2226
1862
|
*/
|
|
2227
|
-
|
|
1863
|
+
forLatitude?: Latitude;
|
|
1864
|
+
/**
|
|
1865
|
+
* @description ForLongitude is the longitude used for distance-based sorting, when supplied.
|
|
1866
|
+
*/
|
|
1867
|
+
forLongitude?: Longitude;
|
|
1868
|
+
/**
|
|
1869
|
+
* @description Locations matching the request, ordered by distance from the\nreference point when one was supplied. May be empty if no\nlocations match.
|
|
1870
|
+
* @type array
|
|
1871
|
+
*/
|
|
1872
|
+
locations: Location_2[];
|
|
2228
1873
|
};
|
|
2229
1874
|
|
|
2230
1875
|
declare type Locale = 'en-US' | 'pl-PL' | 'sv-SE';
|
|
2231
1876
|
|
|
1877
|
+
/**
|
|
1878
|
+
* @description Location is a pickup point (service point, locker, store, etc.) where\nparcels can be collected.
|
|
1879
|
+
*/
|
|
2232
1880
|
declare type Location_2 = {
|
|
1881
|
+
/**
|
|
1882
|
+
* @description ID is the unique identifier for this location.
|
|
1883
|
+
* @type string
|
|
1884
|
+
*/
|
|
1885
|
+
id: string;
|
|
1886
|
+
/**
|
|
1887
|
+
* @description Name is the display name of the location.
|
|
1888
|
+
* @type string
|
|
1889
|
+
*/
|
|
1890
|
+
name: string;
|
|
1891
|
+
/**
|
|
1892
|
+
* @description Distance from the reference point (the customer\'s address or\ncoordinates supplied in the request) to this location. Only\npopulated when a reference point was supplied.
|
|
1893
|
+
*/
|
|
1894
|
+
distance?: LocationDistance;
|
|
1895
|
+
/**
|
|
1896
|
+
* @description Address is the physical address of the location.
|
|
1897
|
+
*/
|
|
1898
|
+
address: Address;
|
|
1899
|
+
/**
|
|
1900
|
+
* @description Coordinates are the geographic coordinates of the location.
|
|
1901
|
+
*/
|
|
1902
|
+
coordinates?: Coordinates;
|
|
1903
|
+
/**
|
|
1904
|
+
* @description LocationType is the kind of pickup location.
|
|
1905
|
+
*/
|
|
1906
|
+
locationType?: LocationType;
|
|
1907
|
+
/**
|
|
1908
|
+
* @description OperationalHours are the operating hours for each day of the week.
|
|
1909
|
+
*/
|
|
1910
|
+
operationalHours?: OperationalHours;
|
|
1911
|
+
};
|
|
1912
|
+
|
|
1913
|
+
declare type Location_3 = {
|
|
2233
1914
|
/**
|
|
2234
1915
|
* @description Common address entity that used almost everywhere in Ingrid\'s API.
|
|
2235
1916
|
* @type object
|
|
2236
1917
|
*/
|
|
2237
|
-
address:
|
|
1918
|
+
address: Address_2;
|
|
2238
1919
|
/**
|
|
2239
1920
|
* @description location_external_id - external identifier for the location.
|
|
2240
1921
|
* @type string | undefined
|
|
@@ -2248,7 +1929,7 @@ declare type Location_2 = {
|
|
|
2248
1929
|
/**
|
|
2249
1930
|
* @type object | undefined
|
|
2250
1931
|
*/
|
|
2251
|
-
operational_hours?:
|
|
1932
|
+
operational_hours?: OperationalHours_2;
|
|
2252
1933
|
/**
|
|
2253
1934
|
* @description pickup_instructions - instructions for the customer to pick up the parcel.
|
|
2254
1935
|
* @type string | undefined
|
|
@@ -2257,43 +1938,32 @@ declare type Location_2 = {
|
|
|
2257
1938
|
};
|
|
2258
1939
|
|
|
2259
1940
|
/**
|
|
2260
|
-
* @description
|
|
1941
|
+
* @description LocationDistance is the distance from a reference point to a location.\nAt least one mode of travel is populated when a reference point is\nsupplied.
|
|
2261
1942
|
*/
|
|
2262
|
-
declare type
|
|
1943
|
+
declare type LocationDistance = {
|
|
2263
1944
|
/**
|
|
2264
|
-
* @description
|
|
2265
|
-
* @type string
|
|
1945
|
+
* @description Walking distance and estimated duration.
|
|
2266
1946
|
*/
|
|
2267
|
-
|
|
1947
|
+
walking?: DistanceDetail;
|
|
1948
|
+
/**
|
|
1949
|
+
* @description Driving distance and estimated duration.
|
|
1950
|
+
*/
|
|
1951
|
+
driving?: DistanceDetail;
|
|
2268
1952
|
};
|
|
2269
1953
|
|
|
2270
1954
|
/**
|
|
2271
|
-
* @description
|
|
1955
|
+
* @description LocationType classifies a pickup location.
|
|
2272
1956
|
*/
|
|
2273
|
-
declare type
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
* @type string
|
|
2277
|
-
*/
|
|
2278
|
-
external_id: string;
|
|
2279
|
-
/**
|
|
2280
|
-
* @description Contact represents generic contact information.
|
|
2281
|
-
* @type object
|
|
2282
|
-
*/
|
|
2283
|
-
delivery_contact: V1AlphaDeliveryContact;
|
|
2284
|
-
/**
|
|
2285
|
-
* @description Contact represents generic contact information.
|
|
2286
|
-
* @type object | undefined
|
|
2287
|
-
*/
|
|
2288
|
-
visiting_contact?: V1AlphaDeliveryContact;
|
|
2289
|
-
/**
|
|
2290
|
-
* @description Location name that is displayed to the customer.
|
|
2291
|
-
* @type string | undefined
|
|
2292
|
-
*/
|
|
2293
|
-
display_name?: string;
|
|
2294
|
-
};
|
|
1957
|
+
declare type LocationType = LocationTypeEnum;
|
|
1958
|
+
|
|
1959
|
+
declare type LocationTypeEnum = 'manned' | 'locker' | 'post_office' | 'store';
|
|
2295
1960
|
|
|
2296
|
-
|
|
1961
|
+
/**
|
|
1962
|
+
* @description Longitude is in decimal degrees (WGS 84) and ranges from -180 to 180.
|
|
1963
|
+
*/
|
|
1964
|
+
declare type Longitude = number;
|
|
1965
|
+
|
|
1966
|
+
export declare type MethodOverrides<T> = {
|
|
2297
1967
|
[K in keyof T]?: T[K] extends (...args: any[]) => any ? T[K] | WithDefaultProvider<T[K]> : never;
|
|
2298
1968
|
};
|
|
2299
1969
|
|
|
@@ -2331,7 +2001,46 @@ declare type MoleculesConfig = {
|
|
|
2331
2001
|
|
|
2332
2002
|
declare type MoleculeType = keyof MoleculeMapType;
|
|
2333
2003
|
|
|
2004
|
+
/**
|
|
2005
|
+
* @description OperationalHours are the operating hours for a location, organised by\nday of the week.\n\nEach day field contains a free-form, human-readable representation of\nthe day\'s hours. Common forms:\n\n- A single window: `\"08:00-20:00\"`\n- Multiple windows separated by commas: `\"08:00-12:00, 13:00-18:00\"`\n- Closed: `\"closed\"`\n- Open all day: `\"24h\"` or `\"00:00-24:00\"`\n\nIf structured per-day data is not available from the carrier, populate\n`freeText` instead and leave the per-day fields empty. Times are\nexpressed in the location\'s local timezone.
|
|
2006
|
+
*/
|
|
2334
2007
|
declare type OperationalHours = {
|
|
2008
|
+
/**
|
|
2009
|
+
* @type string | undefined
|
|
2010
|
+
*/
|
|
2011
|
+
monday?: string;
|
|
2012
|
+
/**
|
|
2013
|
+
* @type string | undefined
|
|
2014
|
+
*/
|
|
2015
|
+
tuesday?: string;
|
|
2016
|
+
/**
|
|
2017
|
+
* @type string | undefined
|
|
2018
|
+
*/
|
|
2019
|
+
wednesday?: string;
|
|
2020
|
+
/**
|
|
2021
|
+
* @type string | undefined
|
|
2022
|
+
*/
|
|
2023
|
+
thursday?: string;
|
|
2024
|
+
/**
|
|
2025
|
+
* @type string | undefined
|
|
2026
|
+
*/
|
|
2027
|
+
friday?: string;
|
|
2028
|
+
/**
|
|
2029
|
+
* @type string | undefined
|
|
2030
|
+
*/
|
|
2031
|
+
saturday?: string;
|
|
2032
|
+
/**
|
|
2033
|
+
* @type string | undefined
|
|
2034
|
+
*/
|
|
2035
|
+
sunday?: string;
|
|
2036
|
+
/**
|
|
2037
|
+
* @description FreeText holds free-text operational hours when structured data is\nnot available. Used as a fallback when hours cannot be parsed into a\nday-by-day format.
|
|
2038
|
+
* @type array | undefined
|
|
2039
|
+
*/
|
|
2040
|
+
freeText?: string[];
|
|
2041
|
+
};
|
|
2042
|
+
|
|
2043
|
+
declare type OperationalHours_2 = {
|
|
2335
2044
|
/**
|
|
2336
2045
|
* @type array | undefined
|
|
2337
2046
|
*/
|
|
@@ -2524,7 +2233,7 @@ declare type Parcel = {
|
|
|
2524
2233
|
* @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.
|
|
2525
2234
|
* @type string | undefined
|
|
2526
2235
|
*/
|
|
2527
|
-
delivery_type?:
|
|
2236
|
+
delivery_type?: DeliveryType_2;
|
|
2528
2237
|
/**
|
|
2529
2238
|
* @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.
|
|
2530
2239
|
* @type string | undefined
|
|
@@ -2554,7 +2263,7 @@ declare type Parcel = {
|
|
|
2554
2263
|
/**
|
|
2555
2264
|
* @type object | undefined
|
|
2556
2265
|
*/
|
|
2557
|
-
location?:
|
|
2266
|
+
location?: Location_3;
|
|
2558
2267
|
/**
|
|
2559
2268
|
* @type array | undefined
|
|
2560
2269
|
*/
|
|
@@ -2579,97 +2288,6 @@ declare type Parcel = {
|
|
|
2579
2288
|
tracking_number?: string;
|
|
2580
2289
|
};
|
|
2581
2290
|
|
|
2582
|
-
/**
|
|
2583
|
-
* @description Distances define the walking and driving distances to the pickup location.
|
|
2584
|
-
*/
|
|
2585
|
-
declare type PickupLocationDistances = {
|
|
2586
|
-
/**
|
|
2587
|
-
* @description Represents a distance measurement with both spatial distance and estimated travel time.
|
|
2588
|
-
* @type object | undefined
|
|
2589
|
-
*/
|
|
2590
|
-
walking?: DeliveryDistance;
|
|
2591
|
-
/**
|
|
2592
|
-
* @description Represents a distance measurement with both spatial distance and estimated travel time.
|
|
2593
|
-
* @type object | undefined
|
|
2594
|
-
*/
|
|
2595
|
-
driving?: DeliveryDistance;
|
|
2596
|
-
};
|
|
2597
|
-
|
|
2598
|
-
/**
|
|
2599
|
-
* @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.
|
|
2600
|
-
* @default LOCATION_TYPE_UNSPECIFIED
|
|
2601
|
-
*/
|
|
2602
|
-
declare type PickupLocationLocationType = PickupLocationLocationTypeEnum;
|
|
2603
|
-
|
|
2604
|
-
declare type PickupLocationLocationTypeEnum =
|
|
2605
|
-
| 'LOCATION_TYPE_UNSPECIFIED'
|
|
2606
|
-
| 'LOCKER'
|
|
2607
|
-
| 'STORE'
|
|
2608
|
-
| 'POSTOFFICE'
|
|
2609
|
-
| 'MANNED';
|
|
2610
|
-
|
|
2611
|
-
/**
|
|
2612
|
-
* @description OperationalHours define when the pickup location is operating.
|
|
2613
|
-
*/
|
|
2614
|
-
declare type PickupLocationOperationalHours = {
|
|
2615
|
-
/**
|
|
2616
|
-
* @description Opening hours for Monday.
|
|
2617
|
-
* @type array | undefined
|
|
2618
|
-
*/
|
|
2619
|
-
monday?: string[];
|
|
2620
|
-
/**
|
|
2621
|
-
* @description Opening hours for Tuesday.
|
|
2622
|
-
* @type array | undefined
|
|
2623
|
-
*/
|
|
2624
|
-
tuesday?: string[];
|
|
2625
|
-
/**
|
|
2626
|
-
* @description Opening hours for Wednesday.
|
|
2627
|
-
* @type array | undefined
|
|
2628
|
-
*/
|
|
2629
|
-
wednesday?: string[];
|
|
2630
|
-
/**
|
|
2631
|
-
* @description Opening hours for Thursday.
|
|
2632
|
-
* @type array | undefined
|
|
2633
|
-
*/
|
|
2634
|
-
thursday?: string[];
|
|
2635
|
-
/**
|
|
2636
|
-
* @description Opening hours for Friday.
|
|
2637
|
-
* @type array | undefined
|
|
2638
|
-
*/
|
|
2639
|
-
friday?: string[];
|
|
2640
|
-
/**
|
|
2641
|
-
* @description Opening hours for Saturday.
|
|
2642
|
-
* @type array | undefined
|
|
2643
|
-
*/
|
|
2644
|
-
saturday?: string[];
|
|
2645
|
-
/**
|
|
2646
|
-
* @description Opening hours for Sunday.
|
|
2647
|
-
* @type array | undefined
|
|
2648
|
-
*/
|
|
2649
|
-
sunday?: string[];
|
|
2650
|
-
/**
|
|
2651
|
-
* @description Free-text operational hours for fallback.
|
|
2652
|
-
* @type array | undefined
|
|
2653
|
-
*/
|
|
2654
|
-
free_text?: string[];
|
|
2655
|
-
};
|
|
2656
|
-
|
|
2657
|
-
/**
|
|
2658
|
-
* @description Section provides extra information about the pickup location.
|
|
2659
|
-
*/
|
|
2660
|
-
declare type PickupLocationSection = {
|
|
2661
|
-
/**
|
|
2662
|
-
* @description The title of the section displayed to the customer.
|
|
2663
|
-
* @type string
|
|
2664
|
-
*/
|
|
2665
|
-
title: string;
|
|
2666
|
-
/**
|
|
2667
|
-
* @description The columns of items in the section.
|
|
2668
|
-
* @type array
|
|
2669
|
-
*/
|
|
2670
|
-
columns: SectionColumn[];
|
|
2671
|
-
};
|
|
2672
|
-
|
|
2673
2291
|
/**
|
|
2674
2292
|
* @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)
|
|
2675
2293
|
* @default UNKNOWN_PICKUP_LOCATION_TYPE
|
|
@@ -2732,29 +2350,65 @@ declare type PredictionType = PredictionTypeEnum;
|
|
|
2732
2350
|
|
|
2733
2351
|
declare type PredictionTypeEnum = 'streetAddress' | 'postalCode' | 'locality' | 'premise' | 'street';
|
|
2734
2352
|
|
|
2735
|
-
|
|
2353
|
+
/**
|
|
2354
|
+
* @description Price is a monetary amount in a specific currency, expressed in minor units.
|
|
2355
|
+
*/
|
|
2356
|
+
declare type Price = {
|
|
2736
2357
|
/**
|
|
2737
|
-
* @description
|
|
2738
|
-
* @type
|
|
2358
|
+
* @description Amount is the price in minor currency units (e.g. öre for SEK, cents\nfor USD). For example, `12500` represents `125.00 SEK` when\n`currency` is `SEK`.
|
|
2359
|
+
* @type integer, int32
|
|
2739
2360
|
*/
|
|
2740
|
-
|
|
2361
|
+
amount: number;
|
|
2741
2362
|
/**
|
|
2742
|
-
* @description
|
|
2743
|
-
|
|
2363
|
+
* @description Currency is the ISO 4217 currency code.
|
|
2364
|
+
*/
|
|
2365
|
+
currency: Currency;
|
|
2366
|
+
};
|
|
2367
|
+
|
|
2368
|
+
/**
|
|
2369
|
+
* @description PriceComponent is one component of a service\'s total price.\n\n`type` is the categorical kind of the component (machine-readable enum),\nwhile `id` is a stable identifier for this specific component within the\nservice. The same `type` may appear multiple times with different `id`s\n(e.g. two add-ons of type `addon`).
|
|
2370
|
+
*/
|
|
2371
|
+
declare type PriceComponent = {
|
|
2372
|
+
/**
|
|
2373
|
+
* @description ID is a stable identifier for this component within the service.\nDistinct from `type` — two components may share a `type` but always\nhave distinct `id`s.
|
|
2374
|
+
* @type string
|
|
2744
2375
|
*/
|
|
2745
|
-
|
|
2376
|
+
id: string;
|
|
2746
2377
|
/**
|
|
2747
|
-
* @description
|
|
2748
|
-
* @type string | undefined, int64
|
|
2378
|
+
* @description Type is the categorical kind of price component.
|
|
2749
2379
|
*/
|
|
2750
|
-
|
|
2380
|
+
type: PriceComponentType;
|
|
2751
2381
|
/**
|
|
2752
|
-
* @description
|
|
2753
|
-
* @type
|
|
2382
|
+
* @description Amount for this component in minor currency units. Components sum to the parent `ServicePrice.amount`.
|
|
2383
|
+
* @type integer, int32
|
|
2384
|
+
*/
|
|
2385
|
+
amount: number;
|
|
2386
|
+
/**
|
|
2387
|
+
* @description NetAmount is the net amount before tax, in minor currency units.
|
|
2388
|
+
* @type integer | undefined, int32
|
|
2389
|
+
*/
|
|
2390
|
+
netAmount?: number;
|
|
2391
|
+
/**
|
|
2392
|
+
* @description TaxRate is the tax rate expressed as a decimal fraction in the range [0, 1].
|
|
2393
|
+
* @minLength 0
|
|
2394
|
+
* @maxLength 1
|
|
2395
|
+
* @type number | undefined, float
|
|
2396
|
+
*/
|
|
2397
|
+
taxRate?: number;
|
|
2398
|
+
/**
|
|
2399
|
+
* @description TaxAmount is the tax amount in minor currency units.
|
|
2400
|
+
* @type integer | undefined, int32
|
|
2754
2401
|
*/
|
|
2755
|
-
|
|
2402
|
+
taxAmount?: number;
|
|
2756
2403
|
};
|
|
2757
2404
|
|
|
2405
|
+
/**
|
|
2406
|
+
* @description PriceComponentType classifies a price component.
|
|
2407
|
+
*/
|
|
2408
|
+
declare type PriceComponentType = PriceComponentTypeEnum;
|
|
2409
|
+
|
|
2410
|
+
declare type PriceComponentTypeEnum = 'shipping' | 'addon' | 'discount' | 'surcharge';
|
|
2411
|
+
|
|
2758
2412
|
declare type ProgressItem = {
|
|
2759
2413
|
/**
|
|
2760
2414
|
* @description Provides a date interval. Depending on a case, `start` and `end` parts are not guaranteed to be present.
|
|
@@ -2883,14 +2537,21 @@ declare type RawTranslationKey =
|
|
|
2883
2537
|
| 'delivery.courier_instructions.edit'
|
|
2884
2538
|
| 'delivery.courier_instructions.remove'
|
|
2885
2539
|
| 'delivery.courier_instructions.save'
|
|
2540
|
+
| 'delivery.filter_option.delivery'
|
|
2541
|
+
| 'delivery.filter_option.instore'
|
|
2542
|
+
| 'delivery.filter_option.mailbox'
|
|
2543
|
+
| 'delivery.filter_option.pickup'
|
|
2886
2544
|
| 'delivery.fsi_levels_exhausted'
|
|
2887
2545
|
| 'delivery.fsi_progress_bar_label'
|
|
2888
|
-
| 'delivery.fsi_remaining.
|
|
2889
|
-
| 'delivery.fsi_remaining.
|
|
2890
|
-
| 'delivery.fsi_remaining.
|
|
2891
|
-
| 'delivery.fsi_remaining.
|
|
2892
|
-
| 'delivery.fsi_remaining.PICKUP'
|
|
2546
|
+
| 'delivery.fsi_remaining.delivery'
|
|
2547
|
+
| 'delivery.fsi_remaining.instore'
|
|
2548
|
+
| 'delivery.fsi_remaining.mailbox'
|
|
2549
|
+
| 'delivery.fsi_remaining.pickup'
|
|
2893
2550
|
| 'delivery.hide_details'
|
|
2551
|
+
| 'delivery.location.type.locker'
|
|
2552
|
+
| 'delivery.location.type.manned'
|
|
2553
|
+
| 'delivery.location.type.post_office'
|
|
2554
|
+
| 'delivery.location.type.store'
|
|
2894
2555
|
| 'delivery.select_carrier'
|
|
2895
2556
|
| 'delivery.show_details'
|
|
2896
2557
|
| 'global.add_services'
|
|
@@ -2911,8 +2572,8 @@ declare type RawTranslationKey =
|
|
|
2911
2572
|
| 'global.loading'
|
|
2912
2573
|
| 'global.pickup_locations'
|
|
2913
2574
|
| 'global.postal_code'
|
|
2914
|
-
| 'global.
|
|
2915
|
-
| 'global.
|
|
2575
|
+
| 'global.save'
|
|
2576
|
+
| 'global.select_location'
|
|
2916
2577
|
| 'global.show'
|
|
2917
2578
|
| 'global.show_available_services'
|
|
2918
2579
|
| 'global.validation.invalid'
|
|
@@ -2964,10 +2625,70 @@ declare type RawTranslationKey =
|
|
|
2964
2625
|
|
|
2965
2626
|
declare type RecursiveObjectValues<T> = T extends object ? RecursiveObjectValues<T[keyof T]> : T;
|
|
2966
2627
|
|
|
2628
|
+
/**
|
|
2629
|
+
* @description RouteLeg is a single leg in a delivery route.
|
|
2630
|
+
*/
|
|
2631
|
+
declare type RouteLeg = {
|
|
2632
|
+
/**
|
|
2633
|
+
* @description Sequence is the order of this leg in the route (1-based, unique within a route).
|
|
2634
|
+
* @minLength 1
|
|
2635
|
+
* @type integer, int32
|
|
2636
|
+
*/
|
|
2637
|
+
sequence: number;
|
|
2638
|
+
/**
|
|
2639
|
+
* @description ShippingMethod is the carrier-specific shipping method used for this\nleg, in the `<carrier>-<product>` form. Independent from the\ntop-level `DeliveryService.product.id` because a service may chain\nmultiple shipping methods across legs.
|
|
2640
|
+
* @type string
|
|
2641
|
+
*/
|
|
2642
|
+
shippingMethod: string;
|
|
2643
|
+
/**
|
|
2644
|
+
* @description DeliveryType is the kind of delivery for this leg.
|
|
2645
|
+
*/
|
|
2646
|
+
deliveryType: DeliveryType;
|
|
2647
|
+
/**
|
|
2648
|
+
* @description From is the origin of this leg.
|
|
2649
|
+
*/
|
|
2650
|
+
from: RouteLocation;
|
|
2651
|
+
/**
|
|
2652
|
+
* @description To is the destination of this leg.
|
|
2653
|
+
*/
|
|
2654
|
+
to: RouteLocation;
|
|
2655
|
+
};
|
|
2656
|
+
|
|
2657
|
+
/**
|
|
2658
|
+
* @description RouteLocation is one endpoint of a route leg.
|
|
2659
|
+
*/
|
|
2660
|
+
declare type RouteLocation = {
|
|
2661
|
+
/**
|
|
2662
|
+
* @description Type is the kind of location.
|
|
2663
|
+
*/
|
|
2664
|
+
type: RouteLocationType;
|
|
2665
|
+
/**
|
|
2666
|
+
* @description Address of the location. Optional for warehouse/home which are known from context.
|
|
2667
|
+
*/
|
|
2668
|
+
address?: Address;
|
|
2669
|
+
/**
|
|
2670
|
+
* @description ExternalID is an external identifier (e.g. service-point ID, store ID).
|
|
2671
|
+
* @type string | undefined
|
|
2672
|
+
*/
|
|
2673
|
+
externalId?: string;
|
|
2674
|
+
};
|
|
2675
|
+
|
|
2676
|
+
/**
|
|
2677
|
+
* @description RouteLocationType classifies a location in a delivery route.
|
|
2678
|
+
*/
|
|
2679
|
+
declare type RouteLocationType = RouteLocationTypeEnum;
|
|
2680
|
+
|
|
2681
|
+
declare type RouteLocationTypeEnum = 'warehouse' | 'store' | 'home' | 'pickup' | 'hub';
|
|
2682
|
+
|
|
2967
2683
|
declare interface SDKInternal {
|
|
2968
2684
|
readonly [_internalBrand]: never;
|
|
2969
2685
|
}
|
|
2970
2686
|
|
|
2687
|
+
declare type SDKManagedTokenArg = {
|
|
2688
|
+
/** @deprecated This is an internal SDK-managed token for builtin providers. Do not rely on this directly. Custom providers should implement their own authentication mechanism if needed.*/
|
|
2689
|
+
token?: string;
|
|
2690
|
+
};
|
|
2691
|
+
|
|
2971
2692
|
/**
|
|
2972
2693
|
* @description Response containing a list of address predictions from the autocomplete endpoint.
|
|
2973
2694
|
*/
|
|
@@ -2980,40 +2701,95 @@ declare type SearchAddressesResponse = {
|
|
|
2980
2701
|
};
|
|
2981
2702
|
|
|
2982
2703
|
/**
|
|
2983
|
-
* @description
|
|
2704
|
+
* @description ServiceAddon is an add-on service that can be selected with a delivery.
|
|
2984
2705
|
*/
|
|
2985
|
-
declare type
|
|
2706
|
+
declare type ServiceAddon = {
|
|
2986
2707
|
/**
|
|
2987
|
-
* @description
|
|
2988
|
-
* @type
|
|
2708
|
+
* @description ID is the unique identifier for this add-on.
|
|
2709
|
+
* @type string
|
|
2710
|
+
*/
|
|
2711
|
+
id: string;
|
|
2712
|
+
/**
|
|
2713
|
+
* @description Name is the display name of the add-on.
|
|
2714
|
+
* @type string
|
|
2715
|
+
*/
|
|
2716
|
+
name: string;
|
|
2717
|
+
/**
|
|
2718
|
+
* @description Description is a description of the add-on.
|
|
2719
|
+
* @type string | undefined
|
|
2989
2720
|
*/
|
|
2990
|
-
|
|
2721
|
+
description?: string;
|
|
2722
|
+
/**
|
|
2723
|
+
* @description Price for this add-on.
|
|
2724
|
+
*/
|
|
2725
|
+
price?: Price;
|
|
2726
|
+
/**
|
|
2727
|
+
* @description ExternalID is an external identifier for merchant integrations.
|
|
2728
|
+
* @type string | undefined
|
|
2729
|
+
*/
|
|
2730
|
+
externalId?: string;
|
|
2731
|
+
/**
|
|
2732
|
+
* @description Type is the kind of add-on.
|
|
2733
|
+
*/
|
|
2734
|
+
type?: AddonType;
|
|
2735
|
+
/**
|
|
2736
|
+
* @description Selected indicates whether this add-on is currently selected.
|
|
2737
|
+
* @type boolean | undefined
|
|
2738
|
+
*/
|
|
2739
|
+
selected?: boolean;
|
|
2991
2740
|
};
|
|
2992
2741
|
|
|
2993
2742
|
/**
|
|
2994
|
-
* @description
|
|
2743
|
+
* @description ServicePrice is the pricing information for a delivery service.
|
|
2995
2744
|
*/
|
|
2996
|
-
declare type
|
|
2745
|
+
declare type ServicePrice = {
|
|
2997
2746
|
/**
|
|
2998
|
-
* @description
|
|
2999
|
-
* @type
|
|
2747
|
+
* @description Amount is the total price for this delivery option in minor currency units (e.g. cents/öre).
|
|
2748
|
+
* @type integer, int32
|
|
3000
2749
|
*/
|
|
3001
|
-
|
|
2750
|
+
amount: number;
|
|
3002
2751
|
/**
|
|
3003
|
-
* @description
|
|
3004
|
-
|
|
2752
|
+
* @description Currency is the ISO 4217 currency code.
|
|
2753
|
+
*/
|
|
2754
|
+
currency: Currency;
|
|
2755
|
+
/**
|
|
2756
|
+
* @description NetAmount is the net price before tax, in minor currency units. Populated when tax is applicable.
|
|
2757
|
+
* @type integer | undefined, int32
|
|
2758
|
+
*/
|
|
2759
|
+
netAmount?: number;
|
|
2760
|
+
/**
|
|
2761
|
+
* @description TaxRate is the tax rate expressed as a decimal fraction in the range\n[0, 1]. For example, `0.25` represents 25% VAT.
|
|
2762
|
+
* @minLength 0
|
|
2763
|
+
* @maxLength 1
|
|
2764
|
+
* @type number | undefined, float
|
|
2765
|
+
*/
|
|
2766
|
+
taxRate?: number;
|
|
2767
|
+
/**
|
|
2768
|
+
* @description TaxAmount is the tax amount in minor currency units. Equals `amount - netAmount` when both are populated.
|
|
2769
|
+
* @type integer | undefined, int32
|
|
2770
|
+
*/
|
|
2771
|
+
taxAmount?: number;
|
|
2772
|
+
/**
|
|
2773
|
+
* @description Components is the breakdown of the parts that make up `amount`\n(shipping, add-ons, surcharges, discounts). When populated, the\ncomponents sum to `amount`.
|
|
2774
|
+
* @type array | undefined
|
|
3005
2775
|
*/
|
|
3006
|
-
|
|
2776
|
+
components?: PriceComponent[];
|
|
3007
2777
|
/**
|
|
3008
|
-
* @description
|
|
2778
|
+
* @description Formatted is a human-readable formatted price for display.
|
|
3009
2779
|
* @type string | undefined
|
|
3010
2780
|
*/
|
|
3011
|
-
|
|
2781
|
+
formatted?: string;
|
|
2782
|
+
/**
|
|
2783
|
+
* @description IsFromPrice indicates whether this is a \"from\" price (the actual price may vary).
|
|
2784
|
+
* @type boolean | undefined
|
|
2785
|
+
*/
|
|
2786
|
+
isFromPrice?: boolean;
|
|
3012
2787
|
};
|
|
3013
2788
|
|
|
3014
2789
|
declare type Services = {
|
|
3015
2790
|
delivery: {
|
|
3016
|
-
|
|
2791
|
+
getDeliveryOptions: DeliveryService['getDeliveryOptions'];
|
|
2792
|
+
listLocations: DeliveryService['listLocations'];
|
|
3017
2793
|
};
|
|
3018
2794
|
tracking: {
|
|
3019
2795
|
getTrackingData: TrackingService['getTrackingData'];
|
|
@@ -3029,7 +2805,6 @@ declare type Services = {
|
|
|
3029
2805
|
* ```ts
|
|
3030
2806
|
* const entries = await services.address.listContactBookEntries({
|
|
3031
2807
|
* params: { addressBookId: 'book_123' },
|
|
3032
|
-
* token: authToken,
|
|
3033
2808
|
* });
|
|
3034
2809
|
* ```
|
|
3035
2810
|
*/
|
|
@@ -3053,54 +2828,44 @@ declare type Services = {
|
|
|
3053
2828
|
};
|
|
3054
2829
|
};
|
|
3055
2830
|
|
|
2831
|
+
/**
|
|
2832
|
+
* Per-domain overrides for the SDK's internal data-fetching services.
|
|
2833
|
+
* Each key maps to a domain (e.g. `address`), and each value is a partial map of
|
|
2834
|
+
* method overrides for that domain. Supply a plain function to replace the default
|
|
2835
|
+
* implementation entirely, or use {@link withDefaultProvider} to wrap it.
|
|
2836
|
+
*
|
|
2837
|
+
* @public
|
|
2838
|
+
*/
|
|
3056
2839
|
export declare type ServicesOverrides = {
|
|
3057
2840
|
[Domain in keyof Services]?: MethodOverrides<Services[Domain]>;
|
|
3058
2841
|
};
|
|
3059
2842
|
|
|
3060
2843
|
/**
|
|
3061
|
-
* @description
|
|
2844
|
+
* @description ServiceSupports describes which optional inputs and capabilities a\ndelivery service accepts at order-creation time.\n\nA flag set to `false` (or omitted) means the corresponding input is\nignored if supplied.
|
|
3062
2845
|
*/
|
|
3063
|
-
declare type
|
|
2846
|
+
declare type ServiceSupports = {
|
|
3064
2847
|
/**
|
|
3065
|
-
* @description
|
|
3066
|
-
* @type
|
|
3067
|
-
*/
|
|
3068
|
-
country_code: string;
|
|
3069
|
-
/**
|
|
3070
|
-
* @description The currency code for the transaction (ISO 4217).
|
|
3071
|
-
* @type string
|
|
3072
|
-
*/
|
|
3073
|
-
currency_code: string;
|
|
3074
|
-
/**
|
|
3075
|
-
* @description The total discount applied to the purchase (non-negative, in cents).
|
|
3076
|
-
* @type string | undefined, int64
|
|
2848
|
+
* @description Search indicates whether location search is available — i.e. the\ncaller can list alternative pickup locations via\n`POST /v1/delivery/locations` and override the preselected one in\nthe order\'s `selections[].locationId`.
|
|
2849
|
+
* @type boolean | undefined
|
|
3077
2850
|
*/
|
|
3078
|
-
|
|
2851
|
+
search?: boolean;
|
|
3079
2852
|
/**
|
|
3080
|
-
* @description
|
|
3081
|
-
* @type
|
|
2853
|
+
* @description DoorCode indicates whether a door code can be supplied via `selections[].doorCode`.
|
|
2854
|
+
* @type boolean | undefined
|
|
3082
2855
|
*/
|
|
3083
|
-
|
|
2856
|
+
doorCode?: boolean;
|
|
3084
2857
|
/**
|
|
3085
|
-
* @description
|
|
3086
|
-
* @type
|
|
2858
|
+
* @description CourierInstructions indicates whether free-text courier instructions\ncan be supplied via `selections[].courierInstructions`.
|
|
2859
|
+
* @type boolean | undefined
|
|
3087
2860
|
*/
|
|
3088
|
-
|
|
2861
|
+
courierInstructions?: boolean;
|
|
3089
2862
|
/**
|
|
3090
|
-
* @description
|
|
3091
|
-
* @type
|
|
2863
|
+
* @description CustomerNumber indicates whether a customer number is required or supported by the carrier (e.g. DHL lockers).
|
|
2864
|
+
* @type boolean | undefined
|
|
3092
2865
|
*/
|
|
3093
|
-
|
|
2866
|
+
customerNumber?: boolean;
|
|
3094
2867
|
};
|
|
3095
2868
|
|
|
3096
|
-
/**
|
|
3097
|
-
* @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.
|
|
3098
|
-
* @default STATE_UNSPECIFIED
|
|
3099
|
-
*/
|
|
3100
|
-
declare type SessionState = SessionStateEnum;
|
|
3101
|
-
|
|
3102
|
-
declare type SessionStateEnum = 'STATE_UNSPECIFIED' | 'ACTIVE' | 'COMPLETED';
|
|
3103
|
-
|
|
3104
2869
|
/**
|
|
3105
2870
|
* @default STEP_UNKNOWN
|
|
3106
2871
|
*/
|
|
@@ -3137,10 +2902,52 @@ declare type TextDirectionEnum = 'ltr' | 'rtl';
|
|
|
3137
2902
|
|
|
3138
2903
|
declare type ThemeCssVariables = `--${RecursiveObjectValues<typeof variableNames>}`;
|
|
3139
2904
|
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
2905
|
+
/**
|
|
2906
|
+
* @description TimeSlot is a selectable window for a scheduled delivery.
|
|
2907
|
+
*/
|
|
2908
|
+
declare type TimeSlot = {
|
|
2909
|
+
/**
|
|
2910
|
+
* @description ID is the unique identifier for this time slot. Use this when selecting a specific delivery window.
|
|
2911
|
+
* @type string
|
|
2912
|
+
*/
|
|
2913
|
+
id: string;
|
|
2914
|
+
/**
|
|
2915
|
+
* @description Start is the start of the delivery window.
|
|
2916
|
+
* @type string, date-time
|
|
2917
|
+
*/
|
|
2918
|
+
start: string;
|
|
2919
|
+
/**
|
|
2920
|
+
* @description End is the end of the delivery window.
|
|
2921
|
+
* @type string, date-time
|
|
2922
|
+
*/
|
|
2923
|
+
end: string;
|
|
2924
|
+
/**
|
|
2925
|
+
* @description Expires is when this time slot expires and is no longer bookable.
|
|
2926
|
+
* @type string | undefined, date-time
|
|
2927
|
+
*/
|
|
2928
|
+
expires?: string;
|
|
2929
|
+
/**
|
|
2930
|
+
* @description Formatted is a human-readable formatted time slot for display.
|
|
2931
|
+
* @type string | undefined
|
|
2932
|
+
*/
|
|
2933
|
+
formatted?: string;
|
|
2934
|
+
/**
|
|
2935
|
+
* @description AdditionalPrice is an additional price for selecting this time slot (if different from the base price).
|
|
2936
|
+
*/
|
|
2937
|
+
additionalPrice?: Price;
|
|
2938
|
+
};
|
|
2939
|
+
|
|
2940
|
+
/** Value returned by the SDK `refreshToken` callback. */
|
|
2941
|
+
declare type TokenRefreshResult = {
|
|
2942
|
+
/** Fresh short-lived Ingrid API token. */
|
|
2943
|
+
accessToken: string;
|
|
2944
|
+
/**
|
|
2945
|
+
* Expiry time for `accessToken` as a Unix epoch timestamp in milliseconds.
|
|
2946
|
+
* The SDK uses this to refresh auth before expiry. If the value is stale,
|
|
2947
|
+
* invalid, or affected by clock skew, the SDK refreshes reactively on 401 response.
|
|
2948
|
+
*/
|
|
2949
|
+
expiresAt: number;
|
|
2950
|
+
};
|
|
3144
2951
|
|
|
3145
2952
|
declare type TrackingData = GetTrackingDataResponse;
|
|
3146
2953
|
|
|
@@ -3169,132 +2976,40 @@ declare type TranslationsService = {
|
|
|
3169
2976
|
) => void;
|
|
3170
2977
|
};
|
|
3171
2978
|
|
|
3172
|
-
/**
|
|
3173
|
-
|
|
2979
|
+
/**
|
|
2980
|
+
* Runtime configuration that can be updated on a mounted compound via {@link IngridCompound.update}.
|
|
2981
|
+
*
|
|
2982
|
+
* @public
|
|
2983
|
+
*/
|
|
2984
|
+
export declare interface UpdatableConfig {
|
|
2985
|
+
/** Design token overrides to apply to the rendered experience without remounting. */
|
|
3174
2986
|
styles?: StyleTokens;
|
|
3175
2987
|
}
|
|
3176
2988
|
|
|
3177
2989
|
/**
|
|
3178
|
-
* @description
|
|
2990
|
+
* @description User describes the end user the request is being made on behalf of.
|
|
3179
2991
|
*/
|
|
3180
|
-
declare type
|
|
2992
|
+
declare type User = {
|
|
3181
2993
|
/**
|
|
3182
|
-
* @description \
|
|
2994
|
+
* @description ExternalRef is the merchant\'s reference for this user (e.g. customer ID).
|
|
3183
2995
|
* @type string
|
|
3184
2996
|
*/
|
|
3185
|
-
|
|
2997
|
+
externalRef: string;
|
|
3186
2998
|
/**
|
|
3187
|
-
* @description
|
|
2999
|
+
* @description Name is the full name of the user.
|
|
3188
3000
|
* @type string | undefined
|
|
3189
3001
|
*/
|
|
3190
|
-
|
|
3191
|
-
/**
|
|
3192
|
-
* @description Refers to a postal code or zipcode.
|
|
3193
|
-
* @type string | undefined
|
|
3194
|
-
*/
|
|
3195
|
-
postal_code?: string;
|
|
3196
|
-
/**
|
|
3197
|
-
* @description Refers to a city, postal_town or locality.
|
|
3198
|
-
* @type string | undefined
|
|
3199
|
-
*/
|
|
3200
|
-
city?: string;
|
|
3201
|
-
/**
|
|
3202
|
-
* @description List of strings, each a part of the address, e.g., street name, street number, building name, floor.
|
|
3203
|
-
* @type array | undefined
|
|
3204
|
-
*/
|
|
3205
|
-
address_lines?: string[];
|
|
3206
|
-
/**
|
|
3207
|
-
* @description Represents a latitude/longitude pair.\nUnless specified otherwise, this must conform to the WGS84 standard.\nValues must be within normalized ranges.
|
|
3208
|
-
* @type object | undefined
|
|
3209
|
-
*/
|
|
3210
|
-
coordinates?: DeliveryCoordinates;
|
|
3211
|
-
};
|
|
3212
|
-
|
|
3213
|
-
/**
|
|
3214
|
-
* @description Contact represents generic contact information.
|
|
3215
|
-
*/
|
|
3216
|
-
declare type V1AlphaDeliveryContact = {
|
|
3217
|
-
/**
|
|
3218
|
-
* @description Represents an address suitable for delivery.
|
|
3219
|
-
* @type object
|
|
3220
|
-
*/
|
|
3221
|
-
address: V1AlphaDeliveryAddress;
|
|
3002
|
+
name?: string;
|
|
3222
3003
|
/**
|
|
3223
|
-
* @description
|
|
3004
|
+
* @description Email is the email address of the user.
|
|
3224
3005
|
* @type string | undefined
|
|
3225
3006
|
*/
|
|
3226
3007
|
email?: string;
|
|
3227
3008
|
/**
|
|
3228
|
-
* @description
|
|
3229
|
-
* @type object | undefined
|
|
3230
|
-
*/
|
|
3231
|
-
phone_number?: ContactPhoneNumber;
|
|
3232
|
-
/**
|
|
3233
|
-
* @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.
|
|
3234
|
-
* @type string | undefined
|
|
3235
|
-
*/
|
|
3236
|
-
given_name?: string;
|
|
3237
|
-
/**
|
|
3238
|
-
* @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.
|
|
3239
|
-
* @type string | undefined
|
|
3240
|
-
*/
|
|
3241
|
-
family_name?: string;
|
|
3242
|
-
/**
|
|
3243
|
-
* @description The company name of the recipient.
|
|
3009
|
+
* @description Phone is the phone number of the user, including country code (E.164 format recommended).
|
|
3244
3010
|
* @type string | undefined
|
|
3245
3011
|
*/
|
|
3246
|
-
|
|
3247
|
-
};
|
|
3248
|
-
|
|
3249
|
-
/**
|
|
3250
|
-
* @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.
|
|
3251
|
-
*/
|
|
3252
|
-
declare type V1AlphaDeliveryDelivery = {
|
|
3253
|
-
/**
|
|
3254
|
-
* @description The unique identifier of a delivery.
|
|
3255
|
-
* @type string
|
|
3256
|
-
*/
|
|
3257
|
-
id: string;
|
|
3258
|
-
/**
|
|
3259
|
-
* @description The goods that are to be delivered.
|
|
3260
|
-
* @type array
|
|
3261
|
-
*/
|
|
3262
|
-
line_items: DeliveryLineItem[];
|
|
3263
|
-
/**
|
|
3264
|
-
* @description The available fulfillments for the delivery.\nIn the future this will be deprecated in favour of `nodes`.
|
|
3265
|
-
* @type array
|
|
3266
|
-
*/
|
|
3267
|
-
fulfillments: DeliveryFulfillment[];
|
|
3268
|
-
/**
|
|
3269
|
-
* @description Contact represents generic contact information.
|
|
3270
|
-
* @type object
|
|
3271
|
-
*/
|
|
3272
|
-
recipient_contact: V1AlphaDeliveryContact;
|
|
3273
|
-
/**
|
|
3274
|
-
* @description Used to control the behaviour of the filter/price rules.\nEquivalent of cart_attributes in the `Delivery Checkout` API.
|
|
3275
|
-
* @type array | undefined
|
|
3276
|
-
*/
|
|
3277
|
-
attributes?: string[];
|
|
3278
|
-
/**
|
|
3279
|
-
* @description The available delivery categories for this delivery.
|
|
3280
|
-
* @type array | undefined
|
|
3281
|
-
*/
|
|
3282
|
-
readonly delivery_categories?: DeliveryDeliveryCategory[];
|
|
3283
|
-
/**
|
|
3284
|
-
* @description ID of the TOS, only present for the session `complete` and `get` calls.
|
|
3285
|
-
* @type string | undefined
|
|
3286
|
-
*/
|
|
3287
|
-
readonly tos_id?: string;
|
|
3288
|
-
/**
|
|
3289
|
-
* @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.
|
|
3290
|
-
* @type string | undefined
|
|
3291
|
-
*/
|
|
3292
|
-
readonly external_id?: string;
|
|
3293
|
-
/**
|
|
3294
|
-
* @description List of nodes that take part in the delivery.
|
|
3295
|
-
* @type array | undefined
|
|
3296
|
-
*/
|
|
3297
|
-
nodes?: DeliveryDeliveryNode[];
|
|
3012
|
+
phone?: string;
|
|
3298
3013
|
};
|
|
3299
3014
|
|
|
3300
3015
|
/**
|
|
@@ -3332,7 +3047,7 @@ declare type ValidateAddressRequest = {
|
|
|
3332
3047
|
/**
|
|
3333
3048
|
* @description The address to validate against postal reference data.
|
|
3334
3049
|
*/
|
|
3335
|
-
address:
|
|
3050
|
+
address: Address_3;
|
|
3336
3051
|
};
|
|
3337
3052
|
|
|
3338
3053
|
/**
|
|
@@ -3361,7 +3076,7 @@ declare type ValidationResult = {
|
|
|
3361
3076
|
/**
|
|
3362
3077
|
* @description The standardized, corrected address.\nPresent if `status` is `valid` or `suspect`. Absent if `invalid`.
|
|
3363
3078
|
*/
|
|
3364
|
-
candidate?:
|
|
3079
|
+
candidate?: Address_3;
|
|
3365
3080
|
/**
|
|
3366
3081
|
* @description Metadata about the quality of the match.
|
|
3367
3082
|
*/
|
|
@@ -3637,7 +3352,7 @@ declare type WithDefaultProvider<T extends (...args: any[]) => any> = {
|
|
|
3637
3352
|
*
|
|
3638
3353
|
* @param factory - Receives the SDK's default implementation as `defaultFn`.
|
|
3639
3354
|
* Return a new function that calls `defaultFn` wherever you want the original behaviour.
|
|
3640
|
-
* @returns A
|
|
3355
|
+
* @returns A `WithDefaultProvider` wrapper understood by the SDK's service resolver.
|
|
3641
3356
|
*
|
|
3642
3357
|
* @example
|
|
3643
3358
|
* ```ts
|
|
@@ -3662,4 +3377,91 @@ declare type WithDefaultProvider<T extends (...args: any[]) => any> = {
|
|
|
3662
3377
|
*/
|
|
3663
3378
|
export declare const withDefaultProvider: <T extends (...args: any[]) => any>(factory: (defaultFn: T) => T) => WithDefaultProvider<T>;
|
|
3664
3379
|
|
|
3380
|
+
declare type Withdrawal = {
|
|
3381
|
+
/**
|
|
3382
|
+
* @type string | undefined
|
|
3383
|
+
*/
|
|
3384
|
+
acknowledged_at?: string;
|
|
3385
|
+
/**
|
|
3386
|
+
* @type string | undefined
|
|
3387
|
+
*/
|
|
3388
|
+
available_until?: string;
|
|
3389
|
+
/**
|
|
3390
|
+
* @type integer | undefined, int32
|
|
3391
|
+
*/
|
|
3392
|
+
days_remaining?: number;
|
|
3393
|
+
/**
|
|
3394
|
+
* @type object | undefined
|
|
3395
|
+
*/
|
|
3396
|
+
declared_by?: WithdrawalContact;
|
|
3397
|
+
/**
|
|
3398
|
+
* @type array | undefined
|
|
3399
|
+
*/
|
|
3400
|
+
items?: WithdrawalItem[];
|
|
3401
|
+
/**
|
|
3402
|
+
* @type string | undefined
|
|
3403
|
+
*/
|
|
3404
|
+
state?: WithdrawalState;
|
|
3405
|
+
/**
|
|
3406
|
+
* @type string | undefined
|
|
3407
|
+
*/
|
|
3408
|
+
withdrawal_form_url?: string;
|
|
3409
|
+
};
|
|
3410
|
+
|
|
3411
|
+
declare type WithdrawalContact = {
|
|
3412
|
+
/**
|
|
3413
|
+
* @type string | undefined
|
|
3414
|
+
*/
|
|
3415
|
+
email?: string;
|
|
3416
|
+
/**
|
|
3417
|
+
* @type string | undefined
|
|
3418
|
+
*/
|
|
3419
|
+
full_name?: string;
|
|
3420
|
+
};
|
|
3421
|
+
|
|
3422
|
+
declare type WithdrawalItem = {
|
|
3423
|
+
/**
|
|
3424
|
+
* @description Discount for a given item in cents. Example `20000` represents `200.00`.
|
|
3425
|
+
* @type integer | undefined, int32
|
|
3426
|
+
*/
|
|
3427
|
+
discount?: number;
|
|
3428
|
+
/**
|
|
3429
|
+
* @description Image is an URL of the image of the given cart item.
|
|
3430
|
+
* @type string | undefined
|
|
3431
|
+
*/
|
|
3432
|
+
image?: string;
|
|
3433
|
+
/**
|
|
3434
|
+
* @description Name is a product name or title.
|
|
3435
|
+
* @type string | undefined
|
|
3436
|
+
*/
|
|
3437
|
+
name?: string;
|
|
3438
|
+
/**
|
|
3439
|
+
* @description Price of the single item with applied discounts in cents. Example `20000` represents `200.00`.
|
|
3440
|
+
* @type integer | undefined, int32
|
|
3441
|
+
*/
|
|
3442
|
+
price?: number;
|
|
3443
|
+
/**
|
|
3444
|
+
* @description Quantity is a total number of a given product item in the cart.
|
|
3445
|
+
* @type integer | undefined, int32
|
|
3446
|
+
*/
|
|
3447
|
+
quantity?: number;
|
|
3448
|
+
/**
|
|
3449
|
+
* @type string | undefined
|
|
3450
|
+
*/
|
|
3451
|
+
sku?: string;
|
|
3452
|
+
};
|
|
3453
|
+
|
|
3454
|
+
/**
|
|
3455
|
+
* @default STATE_UNSPECIFIED
|
|
3456
|
+
*/
|
|
3457
|
+
declare type WithdrawalState = WithdrawalStateEnum;
|
|
3458
|
+
|
|
3459
|
+
declare type WithdrawalStateEnum =
|
|
3460
|
+
| 'STATE_UNSPECIFIED'
|
|
3461
|
+
| 'STATE_AVAILABLE'
|
|
3462
|
+
| 'STATE_ALREADY_ACKNOWLEDGED'
|
|
3463
|
+
| 'STATE_NOT_DELIVERED_YET'
|
|
3464
|
+
| 'STATE_WITHDRAWAL_WINDOW_EXPIRED'
|
|
3465
|
+
| 'STATE_COUNTRY_NOT_ELIGIBLE';
|
|
3466
|
+
|
|
3665
3467
|
export { }
|