@commercelayer/app-elements 0.0.40 → 0.0.41
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/dist/{Async-62e1f464.js → Async-5be35984.js} +2 -2
- package/dist/{InputDateComponent-654687ab.js → InputDateComponent-b532f2f6.js} +1 -1
- package/dist/{Select-bc3c1a8c.js → Select-b113c4d2.js} +2 -2
- package/dist/main-aa47b0fe.js +19290 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +75 -73
- package/dist/{overrides-b28bb177.js → overrides-000f7185.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/ui/atoms/Avatar.d.ts +1 -10
- package/dist/ui/atoms/Avatar.presets.d.ts +13 -0
- package/dist/ui/atoms/Icon.d.ts +1 -0
- package/dist/ui/{resources/OrderSummary.d.ts → composite/ActionButtons.d.ts} +4 -6
- package/dist/ui/composite/CardDialog.d.ts +11 -0
- package/dist/ui/lists/ListDetailsItem.d.ts +13 -1
- package/dist/ui/lists/ListItem.d.ts +1 -1
- package/dist/ui/resources/ShipmentParcels.d.ts +7 -0
- package/dist/utils/tracking.d.ts +153 -0
- package/package.json +3 -2
- package/dist/main-82eabb5a.js +0 -16221
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { type Parcel, type Shipment } from '@commercelayer/sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare function getParcelTrackingDetail(parcel?: Parcel): TrackingDetail | undefined;
|
|
4
|
+
export declare function getShipmentRates(shipment: Shipment): Rate[];
|
|
5
|
+
export declare function getShipmentRate(shipment: Shipment): Rate | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Check whether the `shipment` has just one tracking number.
|
|
8
|
+
* @param shipment Shipment
|
|
9
|
+
*/
|
|
10
|
+
export declare function hasSingleTracking(shipment: Shipment): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Check whether the `shipment` has tracking information or not.
|
|
13
|
+
* @param shipment Shipment
|
|
14
|
+
*/
|
|
15
|
+
export declare function hasTracking(shipment: Shipment): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @docs https://www.easypost.com/docs/api#tracking-detail-object
|
|
18
|
+
*/
|
|
19
|
+
declare const trackingDetailSchema: z.ZodObject<{
|
|
20
|
+
/** "TrackingDetail" */
|
|
21
|
+
object: z.ZodLiteral<"TrackingDetail">;
|
|
22
|
+
/** Description of the scan event */
|
|
23
|
+
message: z.ZodNullable<z.ZodString>;
|
|
24
|
+
/** Status of the package at the time of the scan event, possible values are "unknown", "pre_transit", "in_transit", "out_for_delivery", "delivered", "available_for_pickup", "return_to_sender", "failure", "cancelled" or "error" */
|
|
25
|
+
status: z.ZodNullable<z.ZodString>;
|
|
26
|
+
/** Additional details about the current status, possible values are "unknown", "status_update", "departed_facility", "arrived_at_facility", "out_for_delivery", "arrived_at_destination" */
|
|
27
|
+
status_detail: z.ZodNullable<z.ZodString>;
|
|
28
|
+
/** The timestamp when the tracking scan occurred */
|
|
29
|
+
datetime: z.ZodNullable<z.ZodString>;
|
|
30
|
+
/** The original source of the information for this scan event, usually the carrier */
|
|
31
|
+
source: z.ZodNullable<z.ZodString>;
|
|
32
|
+
/** The location associated with the scan event */
|
|
33
|
+
tracking_location: z.ZodObject<{
|
|
34
|
+
/** "TrackingLocation" */
|
|
35
|
+
object: z.ZodLiteral<"TrackingLocation">;
|
|
36
|
+
/** The city where the scan event occurred (if available) */
|
|
37
|
+
city: z.ZodNullable<z.ZodString>;
|
|
38
|
+
/** The state where the scan event occurred (if available) */
|
|
39
|
+
state: z.ZodNullable<z.ZodString>;
|
|
40
|
+
/** The country where the scan event occurred (if available) */
|
|
41
|
+
country: z.ZodNullable<z.ZodString>;
|
|
42
|
+
/** The postal code where the scan event occurred (if available) */
|
|
43
|
+
zip: z.ZodNullable<z.ZodString>;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
object: "TrackingLocation";
|
|
46
|
+
city: string | null;
|
|
47
|
+
state: string | null;
|
|
48
|
+
country: string | null;
|
|
49
|
+
zip: string | null;
|
|
50
|
+
}, {
|
|
51
|
+
object: "TrackingLocation";
|
|
52
|
+
city: string | null;
|
|
53
|
+
state: string | null;
|
|
54
|
+
country: string | null;
|
|
55
|
+
zip: string | null;
|
|
56
|
+
}>;
|
|
57
|
+
description: z.ZodNullable<z.ZodString>;
|
|
58
|
+
carrier_code: z.ZodNullable<z.ZodString>;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
object: "TrackingDetail";
|
|
61
|
+
source: string | null;
|
|
62
|
+
description: string | null;
|
|
63
|
+
status: string | null;
|
|
64
|
+
message: string | null;
|
|
65
|
+
status_detail: string | null;
|
|
66
|
+
datetime: string | null;
|
|
67
|
+
tracking_location: {
|
|
68
|
+
object: "TrackingLocation";
|
|
69
|
+
city: string | null;
|
|
70
|
+
state: string | null;
|
|
71
|
+
country: string | null;
|
|
72
|
+
zip: string | null;
|
|
73
|
+
};
|
|
74
|
+
carrier_code: string | null;
|
|
75
|
+
}, {
|
|
76
|
+
object: "TrackingDetail";
|
|
77
|
+
source: string | null;
|
|
78
|
+
description: string | null;
|
|
79
|
+
status: string | null;
|
|
80
|
+
message: string | null;
|
|
81
|
+
status_detail: string | null;
|
|
82
|
+
datetime: string | null;
|
|
83
|
+
tracking_location: {
|
|
84
|
+
object: "TrackingLocation";
|
|
85
|
+
city: string | null;
|
|
86
|
+
state: string | null;
|
|
87
|
+
country: string | null;
|
|
88
|
+
zip: string | null;
|
|
89
|
+
};
|
|
90
|
+
carrier_code: string | null;
|
|
91
|
+
}>;
|
|
92
|
+
/**
|
|
93
|
+
* @docs https://www.easypost.com/docs/api#rates
|
|
94
|
+
*/
|
|
95
|
+
declare const rateSchema: z.ZodObject<{
|
|
96
|
+
/** unique, begins with 'rate_' */
|
|
97
|
+
id: z.ZodString;
|
|
98
|
+
/** "test" or "production" */
|
|
99
|
+
mode: z.ZodUnion<[z.ZodLiteral<"test">, z.ZodLiteral<"production">]>;
|
|
100
|
+
/** service level/name @docs https://www.easypost.com/docs/api#service-levels */
|
|
101
|
+
service: z.ZodString;
|
|
102
|
+
/** name of carrier */
|
|
103
|
+
carrier: z.ZodString;
|
|
104
|
+
/** ID of the CarrierAccount record used to generate this rate */
|
|
105
|
+
carrier_account_id: z.ZodString;
|
|
106
|
+
/** ID of the Shipment this rate belongs to */
|
|
107
|
+
shipment_id: z.ZodString;
|
|
108
|
+
/** the actual rate quote for this service */
|
|
109
|
+
rate: z.ZodNumber;
|
|
110
|
+
/** currency for the rate */
|
|
111
|
+
currency: z.ZodString;
|
|
112
|
+
/** delivery days for this service */
|
|
113
|
+
delivery_days: z.ZodNumber;
|
|
114
|
+
/** date for delivery */
|
|
115
|
+
delivery_date: z.ZodString;
|
|
116
|
+
/** *This field is deprecated and should be ignored. @deprecated */
|
|
117
|
+
est_delivery_days: z.ZodNumber;
|
|
118
|
+
/** formatted date for delivery */
|
|
119
|
+
formatted_delivery_date: z.ZodString;
|
|
120
|
+
/** the actual formatted rate quote for this service */
|
|
121
|
+
formatted_rate: z.ZodString;
|
|
122
|
+
}, "strip", z.ZodTypeAny, {
|
|
123
|
+
id: string;
|
|
124
|
+
mode: "test" | "production";
|
|
125
|
+
service: string;
|
|
126
|
+
carrier: string;
|
|
127
|
+
carrier_account_id: string;
|
|
128
|
+
shipment_id: string;
|
|
129
|
+
rate: number;
|
|
130
|
+
currency: string;
|
|
131
|
+
delivery_days: number;
|
|
132
|
+
delivery_date: string;
|
|
133
|
+
est_delivery_days: number;
|
|
134
|
+
formatted_delivery_date: string;
|
|
135
|
+
formatted_rate: string;
|
|
136
|
+
}, {
|
|
137
|
+
id: string;
|
|
138
|
+
mode: "test" | "production";
|
|
139
|
+
service: string;
|
|
140
|
+
carrier: string;
|
|
141
|
+
carrier_account_id: string;
|
|
142
|
+
shipment_id: string;
|
|
143
|
+
rate: number;
|
|
144
|
+
currency: string;
|
|
145
|
+
delivery_days: number;
|
|
146
|
+
delivery_date: string;
|
|
147
|
+
est_delivery_days: number;
|
|
148
|
+
formatted_delivery_date: string;
|
|
149
|
+
formatted_rate: string;
|
|
150
|
+
}>;
|
|
151
|
+
export type TrackingDetail = z.infer<typeof trackingDetailSchema>;
|
|
152
|
+
export type Rate = z.infer<typeof rateSchema>;
|
|
153
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercelayer/app-elements",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.41",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"react-select": "^5.7.2",
|
|
36
36
|
"swr": "^2.1.5",
|
|
37
37
|
"ts-invariant": "^0.10.3",
|
|
38
|
-
"type-fest": "^3.7.2"
|
|
38
|
+
"type-fest": "^3.7.2",
|
|
39
|
+
"zod": "^3.21.4"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
42
|
"@commercelayer/eslint-config-ts-react": "^1.0.0",
|