repzo 1.0.22 → 1.0.23

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/changelog.md CHANGED
@@ -16,6 +16,7 @@
16
16
  - update payment.listOfAcceptedKeys @maramalshen
17
17
  - add Service: BankList @maramalshen
18
18
  - Update JoinActionsWeHook.JoinData @maramalshen
19
+ - Patch Action @maramalshen
19
20
 
20
21
  ### Changed
21
22
 
package/lib/index.d.ts CHANGED
@@ -304,4 +304,9 @@ export default class Repzo {
304
304
  addDetail(detail: string, meta?: any): any;
305
305
  };
306
306
  };
307
+ patchAction: {
308
+ _path: string;
309
+ create: (body: Service.PatchAction.Create.Body, params?: Service.PatchAction.Create.Params) => Promise<Service.PatchAction.Create.Result>;
310
+ update: (body: Service.PatchAction.Update.Body) => Promise<Service.PatchAction.Update.Result>;
311
+ };
307
312
  }
package/lib/index.js CHANGED
@@ -614,6 +614,17 @@ export default class Repzo {
614
614
  return res;
615
615
  },
616
616
  };
617
+ this.patchAction = {
618
+ _path: "/patch-action",
619
+ create: async (body, params) => {
620
+ const res = await this._create(this.svAPIEndpoint, this.patchAction._path, body, params);
621
+ return res;
622
+ },
623
+ update: async (body) => {
624
+ const res = await this._update(this.svAPIEndpoint, this.patchAction._path, body);
625
+ return res;
626
+ },
627
+ };
617
628
  this.svAPIEndpoint =
618
629
  !options?.env || options?.env == "production"
619
630
  ? "https://sv.api.repzo.me"
@@ -2871,11 +2871,14 @@ export declare namespace Service {
2871
2871
  origin_warehouse?: string[] | string;
2872
2872
  custom_status?: string[] | string;
2873
2873
  status?: InvoiceStatus | InvoiceStatus[];
2874
- is_void: false;
2874
+ is_void?: false;
2875
2875
  has_return?: boolean;
2876
2876
  [key: string]: any;
2877
2877
  populatedKeys?: PopulatedKeys[];
2878
2878
  sortPage?: SortingKeys;
2879
+ "serial_number.formatted"?: string[] | string;
2880
+ "return_serial_number.formatted"?: string[] | string;
2881
+ returned_from?: string[] | string;
2879
2882
  };
2880
2883
  interface Result extends DefaultPaginationResult {
2881
2884
  data: InvoiceSchemaWithPopulatedKeys[];
@@ -4261,7 +4264,89 @@ export declare namespace Service {
4261
4264
  };
4262
4265
  app_category: string;
4263
4266
  }
4267
+ namespace PatchAction {
4268
+ type ReadOperator = "lte" | "lt" | "gte" | "gt" | "eq" | "ne" | "in" | "nin" | "search";
4269
+ type WriteOperator = "set" | "addToSet" | "pull";
4270
+ type Slug = "client" | "product" | "availability-msl" | "product-category" | "product-sub-category" | "product-brand" | "variant" | "product-group" | "msl" | "rep" | "line-classification" | "line" | "activity-storecheck" | "measureunits" | "promotions" | "tax" | "tag" | "warehouse" | "client-channel" | "measureunit-family" | "paymentterms";
4271
+ interface ReadQuery {
4272
+ /**
4273
+ * @type {string} filed to filter by
4274
+ */
4275
+ key: string;
4276
+ value: string | string[] | [] | null | number | boolean | number[] | boolean[] | null[];
4277
+ /**
4278
+ * @type {string} Operator value set according to filter document and of enum type set according to each corresponding key
4279
+ * @example {<"eq">}
4280
+ */
4281
+ operator: ReadOperator;
4282
+ }
4283
+ interface WriteQuery {
4284
+ /**
4285
+ * @type {string} filed to filter by
4286
+ */
4287
+ key: string;
4288
+ value: any;
4289
+ /**
4290
+ * @type {string} command value set according to filter document and of enum type set according to each corresponding key
4291
+ * @example {<"addToSet">}
4292
+ */
4293
+ command: WriteOperator;
4294
+ }
4295
+ interface FormattedWriteQuery {
4296
+ /**
4297
+ * @type {string} update $command key
4298
+ */
4299
+ [key: string]: {
4300
+ /**
4301
+ * @type {string } update field key and update value
4302
+ */
4303
+ [key: string]: any;
4304
+ };
4305
+ }
4306
+ interface CreateBody {
4307
+ /**
4308
+ * @type {string} name of model (an enum value) as specified in patch-filter schema
4309
+ */
4310
+ slug: Slug;
4311
+ /**
4312
+ * @type {ReadQuery} an array of objects key sent in body to include read-filter keys, values and operators
4313
+ * @example {<[ {key: "field_test", value: "ex_1", "operator": "eq"}, {key: "second_field", value: ["ex_2"], "operator": "in"} ]>}
4314
+ */
4315
+ readQuery: ReadQuery[];
4316
+ }
4317
+ interface UpdateBody {
4318
+ /**
4319
+ * @type {string} name of model (an enum value) as specified in patch-filter schema
4320
+ */
4321
+ slug: Slug;
4322
+ /**
4323
+ * @type {ReadQuery} an array of objects key sent in body to include read-filter keys, values and operators
4324
+ * @example {<[ {key: "field_test", value: "ex_1", "operator": "eq"}, {key: "second_field", value: ["ex_2"], "operator": "in"} ]>}
4325
+ */
4326
+ readQuery: ReadQuery[];
4327
+ /**
4328
+ * @type {WriteQuery} an object sent in body to include write-filter key, value and an update command accordingly
4329
+ * @example {<{ key: "field_test", value: "ex_1", "command": "set" }>}
4330
+ */
4331
+ writeQuery: WriteQuery | FormattedWriteQuery;
4332
+ }
4333
+ export namespace Create {
4334
+ type Params = DefaultPaginationQueryParams & {
4335
+ [key: string]: any;
4336
+ };
4337
+ type Body = CreateBody;
4338
+ type Result = DefaultPaginationResult;
4339
+ }
4340
+ export namespace Update {
4341
+ type Body = UpdateBody;
4342
+ type Result = {
4343
+ nFound: number;
4344
+ nModified: number;
4345
+ };
4346
+ }
4347
+ export {};
4348
+ }
4264
4349
  }
4265
- export declare type StringId = string;
4266
- export declare type NameSpaces = string[];
4350
+ export type StringId = string;
4351
+ export type NameSpaces = string[];
4267
4352
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -1907,4 +1907,31 @@ export default class Repzo {
1907
1907
  return this;
1908
1908
  }
1909
1909
  };
1910
+
1911
+ patchAction = {
1912
+ _path: "/patch-action",
1913
+ create: async (
1914
+ body: Service.PatchAction.Create.Body,
1915
+ params?: Service.PatchAction.Create.Params
1916
+ ): Promise<Service.PatchAction.Create.Result> => {
1917
+ const res: Service.PatchAction.Create.Result = await this._create(
1918
+ this.svAPIEndpoint,
1919
+ this.patchAction._path,
1920
+ body,
1921
+ params
1922
+ );
1923
+ return res;
1924
+ },
1925
+
1926
+ update: async (
1927
+ body: Service.PatchAction.Update.Body
1928
+ ): Promise<Service.PatchAction.Update.Result> => {
1929
+ const res: Service.PatchAction.Update.Result = await this._update(
1930
+ this.svAPIEndpoint,
1931
+ this.patchAction._path,
1932
+ body
1933
+ );
1934
+ return res;
1935
+ },
1936
+ };
1910
1937
  }
@@ -2962,11 +2962,14 @@ export namespace Service {
2962
2962
  origin_warehouse?: string[] | string;
2963
2963
  custom_status?: string[] | string;
2964
2964
  status?: InvoiceStatus | InvoiceStatus[];
2965
- is_void: false;
2965
+ is_void?: false;
2966
2966
  has_return?: boolean;
2967
2967
  [key: string]: any; // integration_meta.
2968
2968
  populatedKeys?: PopulatedKeys[];
2969
2969
  sortPage?: SortingKeys;
2970
+ "serial_number.formatted"?: string[] | string;
2971
+ "return_serial_number.formatted"?: string[] | string;
2972
+ returned_from?: string[] | string;
2970
2973
  };
2971
2974
  export interface Result extends DefaultPaginationResult {
2972
2975
  data: InvoiceSchemaWithPopulatedKeys[];
@@ -4333,6 +4336,129 @@ export namespace Service {
4333
4336
  app_settings: { repo: string; serviceEndPoint: string; meta: {} };
4334
4337
  app_category: string;
4335
4338
  }
4339
+
4340
+ export namespace PatchAction {
4341
+ type ReadOperator =
4342
+ | "lte"
4343
+ | "lt"
4344
+ | "gte"
4345
+ | "gt"
4346
+ | "eq"
4347
+ | "ne"
4348
+ | "in"
4349
+ | "nin"
4350
+ | "search";
4351
+ type WriteOperator = "set" | "addToSet" | "pull";
4352
+ type Slug =
4353
+ | "client"
4354
+ | "product"
4355
+ | "availability-msl"
4356
+ | "product-category"
4357
+ | "product-sub-category"
4358
+ | "product-brand"
4359
+ | "variant"
4360
+ | "product-group"
4361
+ | "msl"
4362
+ | "rep"
4363
+ | "line-classification"
4364
+ | "line"
4365
+ | "activity-storecheck"
4366
+ | "measureunits"
4367
+ | "promotions"
4368
+ | "tax"
4369
+ | "tag"
4370
+ | "warehouse"
4371
+ | "client-channel"
4372
+ | "measureunit-family"
4373
+ | "paymentterms";
4374
+
4375
+ interface ReadQuery {
4376
+ /**
4377
+ * @type {string} filed to filter by
4378
+ */
4379
+ key: string;
4380
+ value:
4381
+ | string
4382
+ | string[]
4383
+ | []
4384
+ | null
4385
+ | number
4386
+ | boolean
4387
+ | number[]
4388
+ | boolean[]
4389
+ | null[];
4390
+ /**
4391
+ * @type {string} Operator value set according to filter document and of enum type set according to each corresponding key
4392
+ * @example {<"eq">}
4393
+ */
4394
+ operator: ReadOperator;
4395
+ }
4396
+ interface WriteQuery {
4397
+ /**
4398
+ * @type {string} filed to filter by
4399
+ */
4400
+ key: string;
4401
+ value: any;
4402
+ /**
4403
+ * @type {string} command value set according to filter document and of enum type set according to each corresponding key
4404
+ * @example {<"addToSet">}
4405
+ */
4406
+ command: WriteOperator;
4407
+ }
4408
+ interface FormattedWriteQuery {
4409
+ /**
4410
+ * @type {string} update $command key
4411
+ */
4412
+ [key: string]: {
4413
+ /**
4414
+ * @type {string } update field key and update value
4415
+ */
4416
+ [key: string]: any;
4417
+ };
4418
+ }
4419
+ interface CreateBody {
4420
+ /**
4421
+ * @type {string} name of model (an enum value) as specified in patch-filter schema
4422
+ */
4423
+ slug: Slug;
4424
+ /**
4425
+ * @type {ReadQuery} an array of objects key sent in body to include read-filter keys, values and operators
4426
+ * @example {<[ {key: "field_test", value: "ex_1", "operator": "eq"}, {key: "second_field", value: ["ex_2"], "operator": "in"} ]>}
4427
+ */
4428
+ readQuery: ReadQuery[];
4429
+ }
4430
+ interface UpdateBody {
4431
+ /**
4432
+ * @type {string} name of model (an enum value) as specified in patch-filter schema
4433
+ */
4434
+ slug: Slug;
4435
+ /**
4436
+ * @type {ReadQuery} an array of objects key sent in body to include read-filter keys, values and operators
4437
+ * @example {<[ {key: "field_test", value: "ex_1", "operator": "eq"}, {key: "second_field", value: ["ex_2"], "operator": "in"} ]>}
4438
+ */
4439
+ readQuery: ReadQuery[];
4440
+ /**
4441
+ * @type {WriteQuery} an object sent in body to include write-filter key, value and an update command accordingly
4442
+ * @example {<{ key: "field_test", value: "ex_1", "command": "set" }>}
4443
+ */
4444
+ writeQuery: WriteQuery | FormattedWriteQuery;
4445
+ }
4446
+
4447
+ export namespace Create {
4448
+ export type Params = DefaultPaginationQueryParams & {
4449
+ [key: string]: any;
4450
+ };
4451
+ export type Body = CreateBody;
4452
+ export type Result = DefaultPaginationResult;
4453
+ }
4454
+ export namespace Update {
4455
+ export type Body = UpdateBody;
4456
+ export type Result = {
4457
+ nFound: number;
4458
+ nModified: number;
4459
+ };
4460
+ }
4461
+ }
4336
4462
  }
4337
4463
 
4338
4464
  export type StringId = string;