@secondcloset/types 2.7.25 → 2.7.28-beta.mini-732.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/_common/facility.ts +33 -15
- package/src/_common/index.ts +2 -1
- package/src/_common/organization.ts +2 -18
- package/src/fulfillment/order/order.ts +2 -2
- package/src/fulfillment/shipment/package.ts +1 -0
- package/src/logistics/index.ts +2 -1
- package/src/logistics/serviceArea.ts +14 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@secondcloset/types",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.28-beta.mini-732.1",
|
|
4
4
|
"description": "secondcloset type declaration and definitions",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
},
|
|
20
20
|
"homepage": "https://github.com/SecondCloset/types#readme",
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"typescript": "^
|
|
22
|
+
"typescript": "^4.6.3"
|
|
23
23
|
}
|
|
24
24
|
}
|
package/src/_common/facility.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Version } from ".";
|
|
2
|
+
import { Common } from "..";
|
|
1
3
|
import { ServiceArea } from "./serviceArea";
|
|
2
4
|
|
|
3
5
|
export type FacilityCode =
|
|
@@ -32,19 +34,35 @@ export type FacilityCity =
|
|
|
32
34
|
| "Medley"
|
|
33
35
|
| "Houston";
|
|
34
36
|
|
|
35
|
-
export
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
export type Facility<V = Version> = V extends "V1"
|
|
38
|
+
? {
|
|
39
|
+
id: number;
|
|
40
|
+
name: FacilityCode;
|
|
41
|
+
phone: string;
|
|
42
|
+
email: string;
|
|
43
|
+
address: {
|
|
44
|
+
table: {
|
|
45
|
+
street: string;
|
|
46
|
+
city: FacilityCity;
|
|
47
|
+
province: string;
|
|
48
|
+
country: string;
|
|
49
|
+
postal_code: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
service_area: ServiceArea;
|
|
53
|
+
}
|
|
54
|
+
: {
|
|
55
|
+
id: string;
|
|
56
|
+
name: FacilityCode;
|
|
57
|
+
enabled: boolean;
|
|
58
|
+
service_area: ServiceArea;
|
|
59
|
+
address: {
|
|
60
|
+
street: string;
|
|
61
|
+
city: string;
|
|
62
|
+
province: string;
|
|
63
|
+
country: string;
|
|
64
|
+
postal_code: string;
|
|
65
|
+
};
|
|
66
|
+
created_at: string;
|
|
67
|
+
updated_at: string;
|
|
47
68
|
};
|
|
48
|
-
};
|
|
49
|
-
service_area: ServiceArea;
|
|
50
|
-
}
|
package/src/_common/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type Version = "V1" | "V2";
|
|
1
2
|
export * from "./facility";
|
|
2
3
|
export * from "./serviceArea";
|
|
3
4
|
export * from "./user";
|
|
@@ -7,4 +8,4 @@ export * from "./organization";
|
|
|
7
8
|
export * from "./credential";
|
|
8
9
|
export * from "./file";
|
|
9
10
|
export * from "./note";
|
|
10
|
-
export * from "./activityHistory";
|
|
11
|
+
export * from "./activityHistory";
|
|
@@ -2,8 +2,7 @@ import { BaseImage } from "./image";
|
|
|
2
2
|
import { BaseAddress } from "./address";
|
|
3
3
|
import { BaseUser } from "./user";
|
|
4
4
|
import { Carrier } from "../fulfillment";
|
|
5
|
-
import {
|
|
6
|
-
import { FacilityCode } from "./facility";
|
|
5
|
+
import { Facility } from "./facility";
|
|
7
6
|
|
|
8
7
|
export type OrganizationConfigKey =
|
|
9
8
|
| "default_fulfilled_from"
|
|
@@ -74,21 +73,6 @@ export interface Organization extends BaseOrganization {
|
|
|
74
73
|
facility_service_areas?: FacilityServiceArea[];
|
|
75
74
|
}
|
|
76
75
|
|
|
77
|
-
interface Facility {
|
|
78
|
-
id: string;
|
|
79
|
-
name: FacilityCode | string;
|
|
80
|
-
enabled: boolean;
|
|
81
|
-
service_area: ServiceArea;
|
|
82
|
-
address: {
|
|
83
|
-
street: string;
|
|
84
|
-
city: string;
|
|
85
|
-
province: string;
|
|
86
|
-
country: string;
|
|
87
|
-
postal_code: string;
|
|
88
|
-
};
|
|
89
|
-
created_at: string;
|
|
90
|
-
updated_at: string;
|
|
91
|
-
}
|
|
92
76
|
export interface Region {
|
|
93
77
|
id?: string;
|
|
94
78
|
region_code: string;
|
|
@@ -97,7 +81,7 @@ export interface Region {
|
|
|
97
81
|
country_name: string;
|
|
98
82
|
}
|
|
99
83
|
export interface FacilityServiceArea {
|
|
100
|
-
facility: Facility
|
|
84
|
+
facility: Facility<"V2">;
|
|
101
85
|
default_regions: Region[];
|
|
102
86
|
organization_regions: Region[];
|
|
103
87
|
}
|
|
@@ -30,7 +30,7 @@ export type OrderPlatform =
|
|
|
30
30
|
| "shipstaion"
|
|
31
31
|
| "external_api";
|
|
32
32
|
|
|
33
|
-
interface
|
|
33
|
+
export interface FulfillmentOrderAddress extends BaseAddress {
|
|
34
34
|
customer_id: string;
|
|
35
35
|
contact_name: string;
|
|
36
36
|
customer_phone_number: string | null;
|
|
@@ -57,7 +57,7 @@ export interface Order {
|
|
|
57
57
|
shipping_service: string | null;
|
|
58
58
|
signature_required?: boolean;
|
|
59
59
|
customer: Customer;
|
|
60
|
-
address:
|
|
60
|
+
address: FulfillmentOrderAddress;
|
|
61
61
|
created_at: string;
|
|
62
62
|
updated_at: string;
|
|
63
63
|
organization: Organization;
|
package/src/logistics/index.ts
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FacilityCode, ServiceArea as ServiceAreaCode } from "../_common";
|
|
2
|
+
|
|
3
|
+
export interface ServiceArea {
|
|
4
|
+
id: number;
|
|
5
|
+
facilities: FacilityCode[];
|
|
6
|
+
name: ServiceAreaCode;
|
|
7
|
+
humanized_name: string;
|
|
8
|
+
timezone: string;
|
|
9
|
+
address: { country: string; province: string };
|
|
10
|
+
standard_boundary: { latitude: number; longitude: number }[];
|
|
11
|
+
extended_boundary: { latitude: number; longitude: number }[];
|
|
12
|
+
created_at: string;
|
|
13
|
+
updated_at: string;
|
|
14
|
+
}
|