@shipengine/elements 0.28.0 → 0.30.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/index.cjs +163 -102
- package/index.js +163 -102
- package/package.json +3 -3
- package/src/components/templates/edit-billing-form/edit-billing-form.d.ts +1 -2
- package/src/components/templates/onboarding/onboarding.d.ts +3 -1
- package/src/components/templates/shipment-form/shipment-form.d.ts +2 -1
- package/src/components/templates/wallet-card/wallet-card.d.ts +3 -1
- package/src/components/templates/wallet-form/wallet-schema.d.ts +23 -3
- package/src/elements/account-settings/account-settings.d.ts +1 -0
- package/src/elements/configure-shipment/hooks/use-address.d.ts +1 -0
- package/src/elements/configure-shipment/hooks/use-shipment-form.d.ts +1 -0
- package/src/elements/onboarding/onboarding.d.ts +1 -0
- package/src/elements/purchase-label/purchase-label.d.ts +1 -0
- package/src/elements/view-shipment/view-shipment.d.ts +1 -0
- package/src/elements/void-label/void-label.d.ts +1 -0
- package/src/hooks/use-get-or-create-shipment.d.ts +4 -3
- package/src/locales/en/index.d.ts +1 -0
- package/src/testing/test-utils.d.ts +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { Provider } from "@shipengine/alchemy";
|
|
3
3
|
export declare const billingAddressSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<z.extendShape<{
|
|
4
4
|
addressLine1: z.ZodString;
|
|
5
5
|
addressLine2: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>;
|
|
@@ -14,6 +14,7 @@ export declare const billingAddressSchema: z.ZodEffects<z.ZodEffects<z.ZodEffect
|
|
|
14
14
|
addressLine1: z.ZodEffects<z.ZodString, string, string>;
|
|
15
15
|
addressLine2: z.ZodEffects<z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>, string | undefined, string | null | undefined>;
|
|
16
16
|
companyName: z.ZodString;
|
|
17
|
+
email: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string, string | null | undefined>;
|
|
17
18
|
phone: z.ZodString;
|
|
18
19
|
}>, "strip", z.ZodTypeAny, {
|
|
19
20
|
addressLine2?: string | undefined;
|
|
@@ -25,9 +26,11 @@ export declare const billingAddressSchema: z.ZodEffects<z.ZodEffects<z.ZodEffect
|
|
|
25
26
|
phone: string;
|
|
26
27
|
postalCode: string;
|
|
27
28
|
stateProvince: string;
|
|
29
|
+
email: string;
|
|
28
30
|
}, {
|
|
29
31
|
addressLine2?: string | null | undefined;
|
|
30
32
|
stateProvince?: string | null | undefined;
|
|
33
|
+
email?: string | null | undefined;
|
|
31
34
|
addressLine1: string;
|
|
32
35
|
cityLocality: string;
|
|
33
36
|
companyName: string;
|
|
@@ -45,9 +48,11 @@ export declare const billingAddressSchema: z.ZodEffects<z.ZodEffects<z.ZodEffect
|
|
|
45
48
|
phone: string;
|
|
46
49
|
postalCode: string;
|
|
47
50
|
stateProvince: string;
|
|
51
|
+
email: string;
|
|
48
52
|
}, {
|
|
49
53
|
addressLine2?: string | null | undefined;
|
|
50
54
|
stateProvince?: string | null | undefined;
|
|
55
|
+
email?: string | null | undefined;
|
|
51
56
|
addressLine1: string;
|
|
52
57
|
cityLocality: string;
|
|
53
58
|
companyName: string;
|
|
@@ -65,9 +70,11 @@ export declare const billingAddressSchema: z.ZodEffects<z.ZodEffects<z.ZodEffect
|
|
|
65
70
|
phone: string;
|
|
66
71
|
postalCode: string;
|
|
67
72
|
stateProvince: string;
|
|
73
|
+
email: string;
|
|
68
74
|
}, {
|
|
69
75
|
addressLine2?: string | null | undefined;
|
|
70
76
|
stateProvince?: string | null | undefined;
|
|
77
|
+
email?: string | null | undefined;
|
|
71
78
|
addressLine1: string;
|
|
72
79
|
cityLocality: string;
|
|
73
80
|
companyName: string;
|
|
@@ -85,9 +92,11 @@ export declare const billingAddressSchema: z.ZodEffects<z.ZodEffects<z.ZodEffect
|
|
|
85
92
|
phone: string;
|
|
86
93
|
postalCode: string;
|
|
87
94
|
stateProvince: string;
|
|
95
|
+
email: string;
|
|
88
96
|
}, {
|
|
89
97
|
addressLine2?: string | null | undefined;
|
|
90
98
|
stateProvince?: string | null | undefined;
|
|
99
|
+
email?: string | null | undefined;
|
|
91
100
|
addressLine1: string;
|
|
92
101
|
cityLocality: string;
|
|
93
102
|
companyName: string;
|
|
@@ -113,6 +122,7 @@ export declare const walletSchema: z.ZodObject<{
|
|
|
113
122
|
addressLine1: z.ZodEffects<z.ZodString, string, string>;
|
|
114
123
|
addressLine2: z.ZodEffects<z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string | undefined, string | null | undefined>, string | undefined, string | null | undefined>;
|
|
115
124
|
companyName: z.ZodString;
|
|
125
|
+
email: z.ZodEffects<z.ZodNullable<z.ZodOptional<z.ZodString>>, string, string | null | undefined>;
|
|
116
126
|
phone: z.ZodString;
|
|
117
127
|
}>, "strip", z.ZodTypeAny, {
|
|
118
128
|
addressLine2?: string | undefined;
|
|
@@ -124,9 +134,11 @@ export declare const walletSchema: z.ZodObject<{
|
|
|
124
134
|
phone: string;
|
|
125
135
|
postalCode: string;
|
|
126
136
|
stateProvince: string;
|
|
137
|
+
email: string;
|
|
127
138
|
}, {
|
|
128
139
|
addressLine2?: string | null | undefined;
|
|
129
140
|
stateProvince?: string | null | undefined;
|
|
141
|
+
email?: string | null | undefined;
|
|
130
142
|
addressLine1: string;
|
|
131
143
|
cityLocality: string;
|
|
132
144
|
companyName: string;
|
|
@@ -144,9 +156,11 @@ export declare const walletSchema: z.ZodObject<{
|
|
|
144
156
|
phone: string;
|
|
145
157
|
postalCode: string;
|
|
146
158
|
stateProvince: string;
|
|
159
|
+
email: string;
|
|
147
160
|
}, {
|
|
148
161
|
addressLine2?: string | null | undefined;
|
|
149
162
|
stateProvince?: string | null | undefined;
|
|
163
|
+
email?: string | null | undefined;
|
|
150
164
|
addressLine1: string;
|
|
151
165
|
cityLocality: string;
|
|
152
166
|
companyName: string;
|
|
@@ -164,9 +178,11 @@ export declare const walletSchema: z.ZodObject<{
|
|
|
164
178
|
phone: string;
|
|
165
179
|
postalCode: string;
|
|
166
180
|
stateProvince: string;
|
|
181
|
+
email: string;
|
|
167
182
|
}, {
|
|
168
183
|
addressLine2?: string | null | undefined;
|
|
169
184
|
stateProvince?: string | null | undefined;
|
|
185
|
+
email?: string | null | undefined;
|
|
170
186
|
addressLine1: string;
|
|
171
187
|
cityLocality: string;
|
|
172
188
|
companyName: string;
|
|
@@ -184,9 +200,11 @@ export declare const walletSchema: z.ZodObject<{
|
|
|
184
200
|
phone: string;
|
|
185
201
|
postalCode: string;
|
|
186
202
|
stateProvince: string;
|
|
203
|
+
email: string;
|
|
187
204
|
}, {
|
|
188
205
|
addressLine2?: string | null | undefined;
|
|
189
206
|
stateProvince?: string | null | undefined;
|
|
207
|
+
email?: string | null | undefined;
|
|
190
208
|
addressLine1: string;
|
|
191
209
|
cityLocality: string;
|
|
192
210
|
companyName: string;
|
|
@@ -216,7 +234,7 @@ export declare const walletSchema: z.ZodObject<{
|
|
|
216
234
|
expirationMonth: number;
|
|
217
235
|
expirationYear: number;
|
|
218
236
|
name: string;
|
|
219
|
-
provider:
|
|
237
|
+
provider: Provider;
|
|
220
238
|
}, {
|
|
221
239
|
number: string;
|
|
222
240
|
name: string;
|
|
@@ -234,6 +252,7 @@ export declare const walletSchema: z.ZodObject<{
|
|
|
234
252
|
phone: string;
|
|
235
253
|
postalCode: string;
|
|
236
254
|
stateProvince: string;
|
|
255
|
+
email: string;
|
|
237
256
|
};
|
|
238
257
|
creditCard: {
|
|
239
258
|
cardNumber: string;
|
|
@@ -241,12 +260,13 @@ export declare const walletSchema: z.ZodObject<{
|
|
|
241
260
|
expirationMonth: number;
|
|
242
261
|
expirationYear: number;
|
|
243
262
|
name: string;
|
|
244
|
-
provider:
|
|
263
|
+
provider: Provider;
|
|
245
264
|
};
|
|
246
265
|
}, {
|
|
247
266
|
address: {
|
|
248
267
|
addressLine2?: string | null | undefined;
|
|
249
268
|
stateProvince?: string | null | undefined;
|
|
269
|
+
email?: string | null | undefined;
|
|
250
270
|
addressLine1: string;
|
|
251
271
|
cityLocality: string;
|
|
252
272
|
companyName: string;
|
|
@@ -9,6 +9,7 @@ export type UseAddressProps = {
|
|
|
9
9
|
shipment?: SE.SalesOrderShipment;
|
|
10
10
|
};
|
|
11
11
|
export declare const useAddress: ({ compatibleCountryCodes, onChange, onValidation, salesOrder, shipment, }: UseAddressProps) => {
|
|
12
|
+
addressLoading: boolean;
|
|
12
13
|
addressErrors: SE.CodedError[] | undefined;
|
|
13
14
|
addressPreference: Templates.AddressPreference | undefined;
|
|
14
15
|
charsetWarning: Templates.CharsetWarning | undefined;
|
|
@@ -13,6 +13,7 @@ export type UseShipmentFormProps = {
|
|
|
13
13
|
shipment?: SE.SalesOrderShipment;
|
|
14
14
|
};
|
|
15
15
|
export declare const useShipmentForm: ({ compatibleCountryCodes, onAddressValidation, onApplyPreset, onChangeAddress, onShipmentUpdated, onSubmit, salesOrder, shipment, }: UseShipmentFormProps) => {
|
|
16
|
+
addressLoading: boolean;
|
|
16
17
|
addressPreference: import("../../../components/templates").AddressPreference | undefined;
|
|
17
18
|
carriers: SE.Carrier[] | undefined;
|
|
18
19
|
charsetWarning: import("../../../components/templates").CharsetWarning | undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { SalesOrderShipment } from "@shipengine/alchemy";
|
|
2
|
+
export declare const useGetOrCreateShipment: (onShipmentUpdated: ((shipment: SalesOrderShipment) => void | Promise<void>) | undefined, shipmentId?: string) => {
|
|
2
3
|
errors: import("@shipengine/alchemy").CodedError[] | undefined;
|
|
3
4
|
isLoading: boolean;
|
|
4
|
-
refetchShipment: <TPageData>(options?: (import("react-query").RefetchOptions & import("react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("react-query").QueryObserverResult<
|
|
5
|
-
shipment:
|
|
5
|
+
refetchShipment: <TPageData>(options?: (import("react-query").RefetchOptions & import("react-query").RefetchQueryFilters<TPageData>) | undefined) => Promise<import("react-query").QueryObserverResult<SalesOrderShipment, import("@shipengine/alchemy").CodedError[]>>;
|
|
6
|
+
shipment: SalesOrderShipment | undefined;
|
|
6
7
|
};
|