@use-stall/types 0.0.1 → 0.0.2
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 +6 -0
- package/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/extensions.d.ts +17 -0
- package/src/fulfillment.d.ts +57 -24
- package/src/orders.d.ts +4 -16
package/README.md
CHANGED
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ExtensionType {
|
|
2
|
+
id: string;
|
|
3
|
+
version: string;
|
|
4
|
+
created_at: string;
|
|
5
|
+
updated_at: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
icon: string;
|
|
9
|
+
keywords: string[];
|
|
10
|
+
authors: string[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export interface InstalledExtensionType {
|
|
15
|
+
id: string;
|
|
16
|
+
version: string;
|
|
17
|
+
}
|
package/src/fulfillment.d.ts
CHANGED
|
@@ -1,30 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
export interface FulfillmentProviderType {
|
|
3
|
-
id: string; // Unique ID for the provider
|
|
4
|
-
method: "pick-up" | "delivery" | "shipment"; // The fulfillment method type
|
|
5
|
-
name: string; // Name of the fulfillment method
|
|
6
|
-
description: string; // Description of the service
|
|
7
|
-
minOrderAmount?: number; // Minimum order value for eligibility (optional)
|
|
8
|
-
maxOrderAmount?: number; // Maximum order value for eligibility (optional)
|
|
9
|
-
restrictions?: Restriction[]; // Dynamic restrictions based on regions, products, etc.
|
|
10
|
-
fees?: FeeStructure[]; // Flexible fee structure based on conditions
|
|
11
|
-
estimatedFulfillmentTime?: number; // Estimated time for fulfillment in hours
|
|
12
|
-
metadata?:{[key:string]:any} // Additional metadata for the provider
|
|
13
|
-
}
|
|
1
|
+
import type { UnifiedCustomerAddressType } from "./customers";
|
|
14
2
|
|
|
15
|
-
export interface
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
export interface FulfillmentProvider {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
logo: string;
|
|
19
8
|
}
|
|
20
9
|
|
|
21
|
-
export interface
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
export interface FulfillmentType {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
configurations: {
|
|
15
|
+
customer: boolean;
|
|
16
|
+
address: boolean;
|
|
17
|
+
};
|
|
24
18
|
}
|
|
25
19
|
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
export type FulFillmentStatus =
|
|
21
|
+
| "pending"
|
|
22
|
+
| "packing"
|
|
23
|
+
| "dispatched"
|
|
24
|
+
| "en-route"
|
|
25
|
+
| "delivered"
|
|
26
|
+
| "cancelled"
|
|
27
|
+
| "returned";
|
|
28
|
+
|
|
29
|
+
export interface FulFillmentLineItem {
|
|
30
|
+
id: string;
|
|
31
|
+
sku: string;
|
|
32
|
+
name: string;
|
|
33
|
+
dimensions: {
|
|
34
|
+
length: string; // e.g. "10cm"
|
|
35
|
+
width: string; // e.g. "5cm"
|
|
36
|
+
height: string; // e.g. "3m"
|
|
37
|
+
weight: string; // e.g. "1kg"
|
|
38
|
+
};
|
|
39
|
+
quantity: number;
|
|
40
|
+
amount: number;
|
|
30
41
|
}
|
|
42
|
+
|
|
43
|
+
export interface OrderFulfillment {
|
|
44
|
+
id: string;
|
|
45
|
+
order_id: string;
|
|
46
|
+
tracking_number: string;
|
|
47
|
+
type_id: string;
|
|
48
|
+
provider_id: string;
|
|
49
|
+
status: FulFillmentStatus;
|
|
50
|
+
created_at: string;
|
|
51
|
+
updated_at: string;
|
|
52
|
+
delivered_at: string;
|
|
53
|
+
line_items: FulFillmentLineItem[];
|
|
54
|
+
fees: {
|
|
55
|
+
subtotal: number;
|
|
56
|
+
total: number;
|
|
57
|
+
currency: string;
|
|
58
|
+
};
|
|
59
|
+
address: {
|
|
60
|
+
destination: UnifiedCustomerAddressType;
|
|
61
|
+
departure: UnifiedCustomerAddressType;
|
|
62
|
+
};
|
|
63
|
+
}
|
package/src/orders.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { UnifiedCustomerAddressType } from "./customers";
|
|
2
|
+
|
|
1
3
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
4
|
export interface UnifiedOrderType {
|
|
3
5
|
id: string;
|
|
@@ -22,8 +24,8 @@ export interface UnifiedOrderType {
|
|
|
22
24
|
checkout_token: string;
|
|
23
25
|
customer_id: string;
|
|
24
26
|
customer_note: string;
|
|
25
|
-
billing:
|
|
26
|
-
shipping_address:
|
|
27
|
+
billing: UnifiedCustomerAddressType;
|
|
28
|
+
shipping_address: UnifiedCustomerAddressType;
|
|
27
29
|
line_items: UnifiedLineItemType[]; // Array of purchased items (products/variants)
|
|
28
30
|
currency: string; // Currency of the order
|
|
29
31
|
payment: UnifiedOrderPaymentDetailsType;
|
|
@@ -69,20 +71,6 @@ export interface UnifiedLineItemType {
|
|
|
69
71
|
metadata: Record<string, any>; // Optional custom fields
|
|
70
72
|
}
|
|
71
73
|
|
|
72
|
-
export interface UnifiedAddressType {
|
|
73
|
-
first_name: string;
|
|
74
|
-
last_name: string;
|
|
75
|
-
company: string;
|
|
76
|
-
address_1: string;
|
|
77
|
-
address_2: string;
|
|
78
|
-
city: string;
|
|
79
|
-
state: string;
|
|
80
|
-
postcode: string;
|
|
81
|
-
country: string;
|
|
82
|
-
email: string;
|
|
83
|
-
phone: string;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
74
|
export interface UnifiedTaxLineType {
|
|
87
75
|
id: string;
|
|
88
76
|
name: string;
|