repzo 1.0.98 → 1.0.100

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/src/index.ts CHANGED
@@ -3172,11 +3172,13 @@ export default class Repzo {
3172
3172
  return res;
3173
3173
  },
3174
3174
  get: async (
3175
- id: Service.AssetPart.Get.ID
3175
+ id: Service.AssetPart.Get.ID,
3176
+ params?: Service.AssetPart.Get.Params
3176
3177
  ): Promise<Service.AssetPart.Get.Result> => {
3177
3178
  return await this._fetch(
3178
3179
  this.svAPIEndpoint,
3179
- this.assetPart._path + `/${id}`
3180
+ this.assetPart._path + `/${id}`,
3181
+ params
3180
3182
  );
3181
3183
  },
3182
3184
  create: async (
@@ -3224,11 +3226,13 @@ export default class Repzo {
3224
3226
  return res;
3225
3227
  },
3226
3228
  get: async (
3227
- id: Service.AssetPartUnit.Get.ID
3229
+ id: Service.AssetPartUnit.Get.ID,
3230
+ params?: Service.AssetPartUnit.Get.Params
3228
3231
  ): Promise<Service.AssetPartUnit.Get.Result> => {
3229
3232
  return await this._fetch(
3230
3233
  this.svAPIEndpoint,
3231
- this.assetPartUnit._path + `/${id}`
3234
+ this.assetPartUnit._path + `/${id}`,
3235
+ params
3232
3236
  );
3233
3237
  },
3234
3238
  update: async (
@@ -3257,11 +3261,13 @@ export default class Repzo {
3257
3261
  return res;
3258
3262
  },
3259
3263
  get: async (
3260
- id: Service.AssetPartReceival.Get.ID
3264
+ id: Service.AssetPartReceival.Get.ID,
3265
+ params?: Service.AssetPartReceival.Get.Params
3261
3266
  ): Promise<Service.AssetPartReceival.Get.Result> => {
3262
3267
  return await this._fetch(
3263
3268
  this.svAPIEndpoint,
3264
- this.assetPartReceival._path + `/${id}`
3269
+ this.assetPartReceival._path + `/${id}`,
3270
+ params
3265
3271
  );
3266
3272
  },
3267
3273
  create: async (
@@ -3312,11 +3318,13 @@ export default class Repzo {
3312
3318
  return res;
3313
3319
  },
3314
3320
  get: async (
3315
- id: Service.AssetPartTransfer.Get.ID
3321
+ id: Service.AssetPartTransfer.Get.ID,
3322
+ params?: Service.AssetPartTransfer.Get.Params
3316
3323
  ): Promise<Service.AssetPartTransfer.Get.Result> => {
3317
3324
  return await this._fetch(
3318
3325
  this.svAPIEndpoint,
3319
- this.assetPartTransfer._path + `/${id}`
3326
+ this.assetPartTransfer._path + `/${id}`,
3327
+ params
3320
3328
  );
3321
3329
  },
3322
3330
  create: async (
@@ -3367,11 +3375,13 @@ export default class Repzo {
3367
3375
  return res;
3368
3376
  },
3369
3377
  get: async (
3370
- id: Service.ReturnAssetPartUnit.Get.ID
3378
+ id: Service.ReturnAssetPartUnit.Get.ID,
3379
+ params?: Service.ReturnAssetPartUnit.Get.Params
3371
3380
  ): Promise<Service.ReturnAssetPartUnit.Get.Result> => {
3372
3381
  return await this._fetch(
3373
3382
  this.svAPIEndpoint,
3374
- this.returnAssetPartUnit._path + `/${id}`
3383
+ this.returnAssetPartUnit._path + `/${id}`,
3384
+ params
3375
3385
  );
3376
3386
  },
3377
3387
  create: async (
@@ -3422,11 +3432,13 @@ export default class Repzo {
3422
3432
  return res;
3423
3433
  },
3424
3434
  get: async (
3425
- id: Service.StoreAssetPartUnit.Get.ID
3435
+ id: Service.StoreAssetPartUnit.Get.ID,
3436
+ params?: Service.StoreAssetPartUnit.Get.Params
3426
3437
  ): Promise<Service.StoreAssetPartUnit.Get.Result> => {
3427
3438
  return await this._fetch(
3428
3439
  this.svAPIEndpoint,
3429
- this.storeAssetPartUnit._path + `/${id}`
3440
+ this.storeAssetPartUnit._path + `/${id}`,
3441
+ params
3430
3442
  );
3431
3443
  },
3432
3444
  create: async (
@@ -8166,6 +8166,13 @@ export namespace Service {
8166
8166
  updatedAt?: Date;
8167
8167
  }
8168
8168
 
8169
+ type PopulatedKeys =
8170
+ | "asset_part_types"
8171
+ | "assets"
8172
+ | "asset_units"
8173
+ | "media"
8174
+ | "cover_photo";
8175
+
8169
8176
  export namespace Find {
8170
8177
  export type Params = DefaultPaginationQueryParams & {
8171
8178
  _id?: StringId[] | StringId;
@@ -8179,13 +8186,7 @@ export namespace Service {
8179
8186
  asset_part_types?: string[] | string;
8180
8187
  assets?: string[] | string;
8181
8188
  asset_units?: string[] | string;
8182
- populatesKeys?: (
8183
- | "asset_part_types"
8184
- | "assets"
8185
- | "asset_units"
8186
- | "media"
8187
- | "cover_photo"
8188
- )[];
8189
+ populatesKeys?: PopulatedKeys[];
8189
8190
  sortBy?: {
8190
8191
  field:
8191
8192
  | "_id"
@@ -8204,6 +8205,10 @@ export namespace Service {
8204
8205
  }
8205
8206
  export namespace Get {
8206
8207
  export type ID = string;
8208
+ export type Params = {
8209
+ populatesKeys?: PopulatedKeys[];
8210
+ [key: string]: any;
8211
+ };
8207
8212
  export type Result = Data | PopulatedDoc;
8208
8213
  }
8209
8214
  export namespace Create {
@@ -8233,6 +8238,7 @@ export namespace Service {
8233
8238
  | "returned"
8234
8239
  | "stored";
8235
8240
  asset_part_receival: StringId;
8241
+ asset_part_return?: StringId;
8236
8242
  asset_part_index: number;
8237
8243
  splitted_from?: StringId;
8238
8244
  client: StringId;
@@ -8277,6 +8283,7 @@ export namespace Service {
8277
8283
  | "returned"
8278
8284
  | "stored";
8279
8285
  asset_part_receival: StringId | AssetPartReceival.Data;
8286
+ asset_part_return?: StringId | ReturnAssetPartUnit.Data;
8280
8287
  asset_part_index: number;
8281
8288
  splitted_from?: StringId | Data;
8282
8289
  client:
@@ -8393,10 +8400,21 @@ export namespace Service {
8393
8400
  | "rejected";
8394
8401
  }
8395
8402
 
8403
+ type PopulatedKeys =
8404
+ | "asset_part_receival"
8405
+ | "asset_part_return"
8406
+ | "asset_part"
8407
+ | "client"
8408
+ | "warehouse"
8409
+ | "teams"
8410
+ | "custom_status"
8411
+ | "media";
8412
+
8396
8413
  export namespace Find {
8397
8414
  export type Params = DefaultPaginationQueryParams & {
8398
8415
  _id?: StringId[] | StringId;
8399
8416
  asset_part_receival?: StringId[] | StringId;
8417
+ asset_part_return?: StringId[] | StringId;
8400
8418
  client?: StringId[] | StringId;
8401
8419
  warehouse?: StringId[] | StringId;
8402
8420
  receival_warehouse?: StringId[] | StringId;
@@ -8413,15 +8431,7 @@ export namespace Service {
8413
8431
  to_updatedAt?: number;
8414
8432
  from_createdAt?: number;
8415
8433
  to_createdAt?: number;
8416
- populatesKeys?: (
8417
- | "asset_part_receival"
8418
- | "asset_part"
8419
- | "client"
8420
- | "warehouse"
8421
- | "teams"
8422
- | "custom_status"
8423
- | "media"
8424
- )[];
8434
+ populatesKeys?: PopulatedKeys[];
8425
8435
  sortBy?: {
8426
8436
  field: "_id" | "asset_part_index" | "createdAt" | "updatedAt";
8427
8437
  type: "asc" | "desc";
@@ -8443,6 +8453,10 @@ export namespace Service {
8443
8453
  }
8444
8454
  export namespace Get {
8445
8455
  export type ID = string;
8456
+ export type Params = {
8457
+ populatesKeys?: PopulatedKeys[];
8458
+ [key: string]: any;
8459
+ };
8446
8460
  export type Result = Data | PopulatedDoc;
8447
8461
  }
8448
8462
  export namespace Update {
@@ -8568,6 +8582,16 @@ export namespace Service {
8568
8582
  workorder?: StringId;
8569
8583
  }
8570
8584
 
8585
+ type PopulatedKeys =
8586
+ | "asset_part"
8587
+ | "client"
8588
+ | "warehouse"
8589
+ | "teams"
8590
+ | "custom_status"
8591
+ | "media"
8592
+ | "signature"
8593
+ | "workorder";
8594
+
8571
8595
  export namespace Find {
8572
8596
  export type Params = DefaultPaginationQueryParams & {
8573
8597
  _id?: StringId[] | StringId;
@@ -8595,16 +8619,7 @@ export namespace Service {
8595
8619
  from_updatedAt?: number;
8596
8620
  to_updatedAt?: number;
8597
8621
  workorder?: StringId | StringId[];
8598
- populatesKeys?: (
8599
- | "asset_part"
8600
- | "client"
8601
- | "warehouse"
8602
- | "teams"
8603
- | "custom_status"
8604
- | "media"
8605
- | "signature"
8606
- | "workorder"
8607
- )[];
8622
+ populatesKeys?: PopulatedKeys[];
8608
8623
  sortBy?: {
8609
8624
  field: "_id" | "time" | "createdAt" | "updatedAt";
8610
8625
  type: "asc" | "desc";
@@ -8617,6 +8632,10 @@ export namespace Service {
8617
8632
  }
8618
8633
  export namespace Get {
8619
8634
  export type ID = string;
8635
+ export type Params = {
8636
+ populatesKeys?: PopulatedKeys[];
8637
+ [key: string]: any;
8638
+ };
8620
8639
  export type Result = Data | PopulatedDoc;
8621
8640
  }
8622
8641
  export namespace Create {
@@ -8660,6 +8679,7 @@ export namespace Service {
8660
8679
  | "failed";
8661
8680
  sync_id: string;
8662
8681
  asset_part_units: {
8682
+ _id: StringId;
8663
8683
  asset_part_unit: StringId;
8664
8684
  qty: number;
8665
8685
  asset_part?: StringId;
@@ -8706,6 +8726,7 @@ export namespace Service {
8706
8726
  | "failed";
8707
8727
  sync_id: string;
8708
8728
  asset_part_units: {
8729
+ _id: StringId;
8709
8730
  asset_part_unit:
8710
8731
  | StringId
8711
8732
  | (AssetPartUnit.Data & {
@@ -8741,7 +8762,7 @@ export namespace Service {
8741
8762
  }
8742
8763
  export interface CreateBody {
8743
8764
  creator?: AdminOrRep;
8744
- serial_number: SerialNumber;
8765
+ serial_number?: SerialNumber;
8745
8766
  type: "load" | "unload";
8746
8767
  from: StringId;
8747
8768
  to: StringId;
@@ -8752,6 +8773,7 @@ export namespace Service {
8752
8773
  status?: "pending";
8753
8774
  sync_id: string;
8754
8775
  asset_part_units: {
8776
+ _id?: StringId;
8755
8777
  asset_part_unit: StringId;
8756
8778
  qty: number;
8757
8779
  asset_part?: StringId;
@@ -8790,6 +8812,7 @@ export namespace Service {
8790
8812
  | "failed";
8791
8813
  sync_id?: string;
8792
8814
  asset_part_units?: {
8815
+ _id?: StringId;
8793
8816
  asset_part_unit: StringId;
8794
8817
  qty: number;
8795
8818
  asset_part_name?: string;
@@ -8813,6 +8836,13 @@ export namespace Service {
8813
8836
  stage?: number;
8814
8837
  failed_reasons?: { code: string; message: string; [key: string]: any }[];
8815
8838
  }
8839
+ type PopulatedKeys =
8840
+ | "asset_part_unit"
8841
+ | "warehouse"
8842
+ | "teams"
8843
+ | "custom_status"
8844
+ | "from"
8845
+ | "to";
8816
8846
 
8817
8847
  export namespace Find {
8818
8848
  export type Params = DefaultPaginationQueryParams & {
@@ -8844,14 +8874,7 @@ export namespace Service {
8844
8874
  to_createdAt?: number;
8845
8875
  from_updatedAt?: number;
8846
8876
  to_updatedAt?: number;
8847
- populatesKeys?: (
8848
- | "asset_part_unit"
8849
- | "warehouse"
8850
- | "teams"
8851
- | "custom_status"
8852
- | "from"
8853
- | "to"
8854
- )[];
8877
+ populatesKeys?: PopulatedKeys[];
8855
8878
  sortBy?: {
8856
8879
  field: "_id" | "time" | "createdAt" | "updatedAt";
8857
8880
  type: "asc" | "desc";
@@ -8864,7 +8887,17 @@ export namespace Service {
8864
8887
  }
8865
8888
  export namespace Get {
8866
8889
  export type ID = StringId;
8867
- export type Result = Data | PopulatedDoc;
8890
+ export type Params = {
8891
+ withCycle?: boolean;
8892
+ validityCheck?: boolean;
8893
+ populatesKeys?: PopulatedKeys[];
8894
+ [key: string]: any; // integration_meta.
8895
+ };
8896
+ export type Result = (Data | PopulatedDoc) & {
8897
+ cycle?: Cycle.Schema;
8898
+ validityCheck?: ValidityCheck;
8899
+ you_can_approve?: boolean;
8900
+ };
8868
8901
  }
8869
8902
  export namespace Create {
8870
8903
  export type Body = CreateBody;
@@ -9064,6 +9097,16 @@ export namespace Service {
9064
9097
  updatedAt?: Date;
9065
9098
  }
9066
9099
 
9100
+ type PopulatedKeys =
9101
+ | "client"
9102
+ | "asset_part_unit"
9103
+ | "warehouse"
9104
+ | "teams"
9105
+ | "custom_status"
9106
+ | "meadia"
9107
+ | "signature"
9108
+ | "workorder";
9109
+
9067
9110
  export namespace Find {
9068
9111
  export type Params = DefaultPaginationQueryParams & {
9069
9112
  _id?: StringId[] | StringId;
@@ -9091,16 +9134,7 @@ export namespace Service {
9091
9134
  from_updatedAt?: number;
9092
9135
  to_updatedAt?: number;
9093
9136
  workorder?: StringId | StringId[];
9094
- populatesKeys?: (
9095
- | "client"
9096
- | "asset_part_unit"
9097
- | "warehouse"
9098
- | "teams"
9099
- | "custom_status"
9100
- | "meadia"
9101
- | "signature"
9102
- | "workorder"
9103
- )[];
9137
+ populatesKeys?: PopulatedKeys[];
9104
9138
  sortBy?: {
9105
9139
  field: "_id" | "time" | "createdAt" | "updatedAt";
9106
9140
  type: "asc" | "desc";
@@ -9113,7 +9147,16 @@ export namespace Service {
9113
9147
  }
9114
9148
  export namespace Get {
9115
9149
  export type ID = string;
9116
- export type Result = Data | PopulatedDoc;
9150
+ export type Params = {
9151
+ withCycle?: boolean;
9152
+ validityCheck?: boolean;
9153
+ populatesKeys?: PopulatedKeys[];
9154
+ [key: string]: any; // integration_meta.
9155
+ };
9156
+ export type Result = (Data | PopulatedDoc) & {
9157
+ cycle?: Cycle.Schema;
9158
+ validityCheck?: ValidityCheck;
9159
+ };
9117
9160
  }
9118
9161
  export namespace Create {
9119
9162
  export type Body = CreateBody;
@@ -9299,6 +9342,14 @@ export namespace Service {
9299
9342
  updatedAt?: Date;
9300
9343
  }
9301
9344
 
9345
+ type PopulatedKeys =
9346
+ | "asset_part_unit"
9347
+ | "warehouse"
9348
+ | "teams"
9349
+ | "custom_status"
9350
+ | "meadia"
9351
+ | "signature";
9352
+
9302
9353
  export namespace Find {
9303
9354
  export type Params = DefaultPaginationQueryParams & {
9304
9355
  _id?: StringId[] | StringId;
@@ -9324,14 +9375,7 @@ export namespace Service {
9324
9375
  to_createdAt?: number;
9325
9376
  from_updatedAt?: number;
9326
9377
  to_updatedAt?: number;
9327
- populatesKeys?: (
9328
- | "asset_part_unit"
9329
- | "warehouse"
9330
- | "teams"
9331
- | "custom_status"
9332
- | "meadia"
9333
- | "signature"
9334
- )[];
9378
+ populatesKeys?: PopulatedKeys[];
9335
9379
  sortBy?: {
9336
9380
  field: "_id" | "time" | "createdAt" | "updatedAt";
9337
9381
  type: "asc" | "desc";
@@ -9343,8 +9387,17 @@ export namespace Service {
9343
9387
  }
9344
9388
  }
9345
9389
  export namespace Get {
9346
- export type ID = string;
9347
- export type Result = Data | PopulatedDoc;
9390
+ export type ID = StringId;
9391
+ export type Params = {
9392
+ withCycle?: boolean;
9393
+ validityCheck?: boolean;
9394
+ populatesKeys?: PopulatedKeys[];
9395
+ [key: string]: any; // integration_meta.
9396
+ };
9397
+ export type Result = (Data | PopulatedDoc) & {
9398
+ cycle?: Cycle.Schema;
9399
+ validityCheck?: ValidityCheck;
9400
+ };
9348
9401
  }
9349
9402
  export namespace Create {
9350
9403
  export type Body = CreateBody;
@@ -10659,6 +10712,10 @@ export interface AdminOrRep {
10659
10712
  admin?: StringId;
10660
10713
  rep?: StringId;
10661
10714
  }
10715
+ interface ValidityCheck {
10716
+ valid: boolean;
10717
+ reasons: { message: string; code: string }[];
10718
+ }
10662
10719
  type PopulatedMediaStorage = Pick<
10663
10720
  Service.MediaStorage.MediaStorageSchema,
10664
10721
  | "_id"