repzo 1.0.103 → 1.0.105

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": "repzo",
3
- "version": "1.0.103",
3
+ "version": "1.0.105",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -13,6 +13,7 @@ import type {
13
13
  export default class Repzo {
14
14
  private svAPIEndpoint: string;
15
15
  headers: Headers;
16
+ private timeout: number;
16
17
  constructor(apiKey: string, options?: Options) {
17
18
  this.svAPIEndpoint =
18
19
  !options?.env || options?.env == "production"
@@ -29,6 +30,11 @@ export default class Repzo {
29
30
  Accept: "application/json",
30
31
  };
31
32
  if (options?.headers) Object.assign(this.headers, options.headers);
33
+ if (options?.timeout) {
34
+ this.timeout = options.timeout;
35
+ } else {
36
+ this.timeout = 180000;
37
+ }
32
38
  }
33
39
 
34
40
  private _end_points = {
@@ -107,6 +113,7 @@ export default class Repzo {
107
113
  let res = await axios.get(`${baseUrl}/${path}`, {
108
114
  params,
109
115
  headers: this.headers,
116
+ timeout: this.timeout,
110
117
  });
111
118
  return res.data;
112
119
  }
@@ -120,6 +127,7 @@ export default class Repzo {
120
127
  let res = await axios.post(`${baseUrl}/${path}`, body, {
121
128
  params,
122
129
  headers: this.headers,
130
+ timeout: this.timeout,
123
131
  });
124
132
  return res.data;
125
133
  }
@@ -133,6 +141,7 @@ export default class Repzo {
133
141
  let res = await axios.put(`${baseUrl}/${path}`, body, {
134
142
  params,
135
143
  headers: this.headers,
144
+ timeout: this.timeout,
136
145
  });
137
146
  return res.data;
138
147
  }
@@ -146,6 +155,7 @@ export default class Repzo {
146
155
  let res = await axios.put(`${baseUrl}/${path}`, body, {
147
156
  params,
148
157
  headers: this.headers,
158
+ timeout: this.timeout,
149
159
  });
150
160
  return res.data;
151
161
  }
@@ -154,6 +164,7 @@ export default class Repzo {
154
164
  let res = await axios.delete(`${baseUrl}/${path}`, {
155
165
  params,
156
166
  headers: this.headers,
167
+ timeout: this.timeout,
157
168
  });
158
169
  return res.data;
159
170
  }
@@ -8,6 +8,7 @@ export interface Data {
8
8
  export interface Options {
9
9
  env?: "staging" | "local" | "production";
10
10
  headers?: { [key: string]: string };
11
+ timeout?: number | undefined;
11
12
  }
12
13
  export interface Headers {
13
14
  "api-key": string;
@@ -4736,7 +4737,7 @@ export namespace Service {
4736
4737
  media_populated?: MediaPopulated;
4737
4738
  cover_photo_populated?: MediaPopulated;
4738
4739
  }
4739
- interface CreateBody {
4740
+ export interface CreateBody {
4740
4741
  company_namespace: string[];
4741
4742
  creator?: AdminCreator | RepCreator | ClientCreator;
4742
4743
  name: string;
@@ -4771,7 +4772,7 @@ export namespace Service {
4771
4772
  time: number;
4772
4773
  opened_by: AdminCreator | RepCreator | ClientCreator;
4773
4774
  }
4774
- interface UpdateBody {
4775
+ export interface UpdateBody {
4775
4776
  company_namespace: string[];
4776
4777
  _id?: string;
4777
4778
  creator?: AdminCreator | RepCreator | ClientCreator;
@@ -4898,7 +4899,7 @@ export namespace Service {
4898
4899
  content?: string;
4899
4900
  sync_id: string;
4900
4901
  }
4901
- interface CreateBody {
4902
+ export interface CreateBody {
4902
4903
  document_id?: string[];
4903
4904
  document_type: PrintTypes;
4904
4905
  sync_id: string;
@@ -5156,7 +5157,7 @@ export namespace Service {
5156
5157
  device_id?: string;
5157
5158
  device_unique_id?: string;
5158
5159
  }
5159
- interface CreateBody {
5160
+ export interface CreateBody {
5160
5161
  items?: Item.Body[];
5161
5162
  return_items?: Item.Body[];
5162
5163
  integration_meta?: { [key: string]: any };
@@ -5346,7 +5347,7 @@ export namespace Service {
5346
5347
  implemented_by?: AdminCreator | RepCreator | ClientCreator;
5347
5348
  business_day?: string;
5348
5349
  }
5349
- interface UpdateBody {
5350
+ export interface UpdateBody {
5350
5351
  integration_meta?: { [key: string]: any };
5351
5352
  issue_date?: string;
5352
5353
  }
@@ -5869,7 +5870,7 @@ export namespace Service {
5869
5870
  updatedAt: string;
5870
5871
  __v: number;
5871
5872
  }
5872
- interface CreateBody {
5873
+ export interface CreateBody {
5873
5874
  items: Item.Schema[];
5874
5875
  return_items?: Item.Schema[];
5875
5876
  integration_meta?: { [key: string]: any };
@@ -5964,7 +5965,7 @@ export namespace Service {
5964
5965
  payment_charge?: number;
5965
5966
  total_with_charges?: number;
5966
5967
  }
5967
- interface UpdateBody {
5968
+ export interface UpdateBody {
5968
5969
  _id?: string;
5969
5970
  items?: Item.Schema[];
5970
5971
  return_items?: Item.Schema[];
@@ -6333,7 +6334,7 @@ export namespace Service {
6333
6334
  updatedAt: string;
6334
6335
  __v: number;
6335
6336
  }
6336
- interface CreateBody {
6337
+ export interface CreateBody {
6337
6338
  amount: number;
6338
6339
  client_id: string;
6339
6340
  client_name: string;
@@ -6362,7 +6363,7 @@ export namespace Service {
6362
6363
  visit_id?: string;
6363
6364
  teams?: string[];
6364
6365
  }
6365
- interface UpdateBody {
6366
+ export interface UpdateBody {
6366
6367
  integration_meta?: { [key: string]: any };
6367
6368
  }
6368
6369
 
@@ -6474,7 +6475,7 @@ export namespace Service {
6474
6475
  updatedAt: string;
6475
6476
  __v: number;
6476
6477
  }
6477
- interface CreateBody {
6478
+ export interface CreateBody {
6478
6479
  amount: number;
6479
6480
  client_id: string;
6480
6481
  client_name: string;
@@ -6503,7 +6504,7 @@ export namespace Service {
6503
6504
  visit_id?: string;
6504
6505
  teams?: string[];
6505
6506
  }
6506
- interface UpdateBody {
6507
+ export interface UpdateBody {
6507
6508
  integration_meta?: { [key: string]: any };
6508
6509
  }
6509
6510
 
@@ -7246,7 +7247,7 @@ export namespace Service {
7246
7247
  updatedAt: string;
7247
7248
  __v: number;
7248
7249
  }
7249
- interface CreateBody {
7250
+ export interface CreateBody {
7250
7251
  serial_number?: SerialNumber;
7251
7252
  time: number;
7252
7253
  type?: TransferType;