@secondcloset/types 2.7.22 → 2.7.24-beta.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@secondcloset/types",
3
- "version": "2.7.22",
3
+ "version": "2.7.24-beta.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": "^3.9.5"
22
+ "typescript": "^4.6.3"
23
23
  }
24
24
  }
@@ -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 =
@@ -12,6 +14,9 @@ export type FacilityCode =
12
14
  | "yul1"
13
15
  | "lax1"
14
16
  | "lax2"
17
+ | "nyc1"
18
+ | "mia1"
19
+ | "hou1"
15
20
  | "unknown";
16
21
 
17
22
  export type DeprecatedFacilityCode = "yyz1" | "yyz2";
@@ -24,21 +29,40 @@ export type FacilityCity =
24
29
  | "Ottawa"
25
30
  | "Montreal"
26
31
  | "Buena Park"
27
- | "Santa Fe Springs";
32
+ | "Santa Fe Springs"
33
+ | "Carlstadt"
34
+ | "Medley"
35
+ | "Houston";
28
36
 
29
- export interface Facility {
30
- id: number;
31
- name: FacilityCode;
32
- phone: string;
33
- email: string;
34
- address: {
35
- table: {
36
- street: string;
37
- city: FacilityCity;
38
- province: string;
39
- country: string;
40
- postal_code: string;
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;
41
68
  };
42
- };
43
- service_area: ServiceArea;
44
- }
@@ -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,7 +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 { ServiceArea } from "./serviceArea";
5
+ import { Facility } from "./facility";
6
6
 
7
7
  export type OrganizationConfigKey =
8
8
  | "default_fulfilled_from"
@@ -73,21 +73,6 @@ export interface Organization extends BaseOrganization {
73
73
  facility_service_areas?: FacilityServiceArea[];
74
74
  }
75
75
 
76
- interface Facility {
77
- id: string;
78
- name: string;
79
- enabled: boolean;
80
- service_area: ServiceArea;
81
- address: {
82
- street: string;
83
- city: string;
84
- province: string;
85
- country: string;
86
- postal_code: string;
87
- };
88
- created_at: string;
89
- updated_at: string;
90
- }
91
76
  export interface Region {
92
77
  id?: string;
93
78
  region_code: string;
@@ -96,7 +81,7 @@ export interface Region {
96
81
  country_name: string;
97
82
  }
98
83
  export interface FacilityServiceArea {
99
- facility: Facility;
84
+ facility: Facility<"V2">;
100
85
  default_regions: Region[];
101
86
  organization_regions: Region[];
102
87
  }
@@ -1 +1,9 @@
1
- export type ServiceArea = "yyz" | "yvr" | "yow" | "yul" | "lax";
1
+ export type ServiceArea =
2
+ | "yyz"
3
+ | "yvr"
4
+ | "yow"
5
+ | "yul"
6
+ | "lax"
7
+ | "nyc"
8
+ | "mia"
9
+ | "hou";
@@ -4,6 +4,11 @@ import { Pallet } from "./pallet";
4
4
  import { Bin } from "./bin";
5
5
  import { ManualItem } from "./manualItem";
6
6
 
7
+ export enum LocationItemStatus {
8
+ DAMAGED = "DAMAGED",
9
+ NORMAL = "NORMAL",
10
+ }
11
+
7
12
  export interface LocationItem {
8
13
  id: string;
9
14
  lot_number?: string;
@@ -20,4 +25,5 @@ export interface LocationItem {
20
25
  bin: Bin;
21
26
  created_at: string;
22
27
  updated_at: string;
28
+ status: LocationItemStatus;
23
29
  }