repzo 1.0.22 → 1.0.24
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 +2 -0
- package/lib/index.d.ts +624 -305
- package/lib/index.js +1424 -914
- package/lib/types/index.d.ts +4482 -4188
- package/package.json +1 -1
- package/src/index.ts +43 -0
- package/src/types/index.ts +142 -1
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1907,4 +1907,47 @@ 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
|
+
};
|
|
1937
|
+
|
|
1938
|
+
updateIntegrationMeta = {
|
|
1939
|
+
_path: "/update-integration-meta",
|
|
1940
|
+
create: async (
|
|
1941
|
+
body: Service.UpdateIntegrationMeta.Create.Body,
|
|
1942
|
+
params?: Service.UpdateIntegrationMeta.Create.Params
|
|
1943
|
+
): Promise<Service.UpdateIntegrationMeta.Create.Result> => {
|
|
1944
|
+
let res = await this._create(
|
|
1945
|
+
this.svAPIEndpoint,
|
|
1946
|
+
this.updateIntegrationMeta._path,
|
|
1947
|
+
body,
|
|
1948
|
+
params
|
|
1949
|
+
);
|
|
1950
|
+
return res;
|
|
1951
|
+
},
|
|
1952
|
+
};
|
|
1910
1953
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -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
|
|
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,144 @@ 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
|
+
}
|
|
4462
|
+
|
|
4463
|
+
export namespace UpdateIntegrationMeta {
|
|
4464
|
+
export namespace Create {
|
|
4465
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
4466
|
+
_id: string;
|
|
4467
|
+
type: string;
|
|
4468
|
+
};
|
|
4469
|
+
export type Body =
|
|
4470
|
+
| { key: string; value: any }[]
|
|
4471
|
+
| { integration_meta_keys: { key: string; value: any }[] };
|
|
4472
|
+
export interface Result {
|
|
4473
|
+
[key: string]: any;
|
|
4474
|
+
}
|
|
4475
|
+
}
|
|
4476
|
+
}
|
|
4336
4477
|
}
|
|
4337
4478
|
|
|
4338
4479
|
export type StringId = string;
|