repzo 1.0.278 → 1.0.280
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 +42 -2
- package/lib/index.js +97 -0
- package/lib/types/index.d.ts +460 -1
- package/package.json +1 -1
- package/src/index.ts +223 -0
- package/src/oas/calendar.yaml +329 -0
- package/src/oas/line-target.yaml +208 -0
- package/src/oas/plan.yaml +258 -0
- package/src/oas/target-rule.yaml +256 -0
- package/src/types/index.ts +619 -2
package/changelog.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
### Added
|
|
6
6
|
|
|
7
|
+
- add: LineTarget service and type; OAS YAML
|
|
8
|
+
- add: TargetRule, Plan, and Calendar services and types; OAS YAMLs for each
|
|
7
9
|
- add: Automatic retry logic for HTTP requests with exponential backoff (default: 3 attempts, configurable via `retryAttempts` option)
|
|
8
10
|
- add: `retryAttempts` option to SDK constructor for configuring retry behavior @mkhamis
|
|
9
11
|
- add: 401 error protection - authentication errors are never retried @mkhamis
|
package/lib/index.d.ts
CHANGED
|
@@ -137,10 +137,14 @@ export declare const end_points: {
|
|
|
137
137
|
readonly JOB_CATEGORY: "job-category";
|
|
138
138
|
readonly JOB_CATEGORY_AUTOSKIP_ANALYZE: "job-category-autoskip-analyze";
|
|
139
139
|
readonly VISIT_REASON: "visit-reason";
|
|
140
|
+
readonly TARGET_RULE: "target-rule";
|
|
141
|
+
readonly PLAN: "plan";
|
|
142
|
+
readonly CALENDAR: "calendar";
|
|
143
|
+
readonly LINE_TARGET: "line-target";
|
|
140
144
|
readonly BULK_IMPORT: "bulk-import";
|
|
141
145
|
};
|
|
142
146
|
export type EndPoints = (typeof end_points)[keyof typeof end_points];
|
|
143
|
-
export declare const availableService: readonly ["client", "product", "variant", "category", "sub_category", "brand", "product_group", "tax", "measureunit", "measureunitFamily", "media", "priceList", "priceListItem", "team", "returnReason", "rep", "tag", "warehouse", "route", "productModifiersGroup", "channel", "speciality", "clientContact", "paymentTerm", "bank", "bank_list", "customStatus", "customList", "customListItem", "inventoryAdjustmentReason", "workorder", "workorderRequest", "supplier", "quickConvertToPdf", "visit", "activityFeedback", "activityFeedbackV2", "feedbackOption", "invoice", "proforma", "payment", "refund", "settlement", "voidSettlement", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "activityItemStatus", "adjustInventory", "inventory", "integrationApp", "joinActionsWebHook", "patchAction", "updateIntegrationMeta", "assetPartType", "assetPart", "assetPartUnit", "assetPartReceival", "assetPartTransfer", "returnAssetPartUnit", "storeAssetPartUnit", "ocrInvoiceJobTemplate", "ocrInvoiceJobGroup", "activityAiSalesOrder", "ocrInvoiceJob", "ocrInvoiceJobPage", "settings", "mailUnsubscribe", "approvalRequest", "safeInvoiceSerialCounter", "clientLocation", "assetType", "asset", "assetUnit", "workorderPortal", "approval", "workorderCategory", "contract", "contractInstallment", "repBalanceSummary", "workorderPortalLink", "customField", "salesAnalyticsReport", "clmPresentation", "clmSequence", "clmSlide", "clmFetch", "pdfMergeField", "visitReason"];
|
|
147
|
+
export declare const availableService: readonly ["client", "product", "variant", "category", "sub_category", "brand", "product_group", "tax", "measureunit", "measureunitFamily", "media", "priceList", "priceListItem", "team", "returnReason", "rep", "tag", "warehouse", "route", "productModifiersGroup", "channel", "speciality", "clientContact", "paymentTerm", "bank", "bank_list", "customStatus", "customList", "customListItem", "inventoryAdjustmentReason", "workorder", "workorderRequest", "supplier", "quickConvertToPdf", "visit", "activityFeedback", "activityFeedbackV2", "feedbackOption", "invoice", "proforma", "payment", "refund", "settlement", "voidSettlement", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "activityItemStatus", "adjustInventory", "inventory", "integrationApp", "joinActionsWebHook", "patchAction", "updateIntegrationMeta", "assetPartType", "assetPart", "assetPartUnit", "assetPartReceival", "assetPartTransfer", "returnAssetPartUnit", "storeAssetPartUnit", "ocrInvoiceJobTemplate", "ocrInvoiceJobGroup", "activityAiSalesOrder", "ocrInvoiceJob", "ocrInvoiceJobPage", "settings", "mailUnsubscribe", "approvalRequest", "safeInvoiceSerialCounter", "clientLocation", "assetType", "asset", "assetUnit", "workorderPortal", "approval", "workorderCategory", "contract", "contractInstallment", "repBalanceSummary", "workorderPortalLink", "customField", "salesAnalyticsReport", "clmPresentation", "clmSequence", "clmSlide", "clmFetch", "pdfMergeField", "visitReason", "targetRule", "plan", "calendar", "lineTarget", "bulkImport"];
|
|
144
148
|
export type AvailableService = (typeof availableService)[number];
|
|
145
149
|
export default class Repzo {
|
|
146
150
|
private svAPIEndpoint;
|
|
@@ -290,6 +294,10 @@ export default class Repzo {
|
|
|
290
294
|
readonly JOB_CATEGORY: "job-category";
|
|
291
295
|
readonly JOB_CATEGORY_AUTOSKIP_ANALYZE: "job-category-autoskip-analyze";
|
|
292
296
|
readonly VISIT_REASON: "visit-reason";
|
|
297
|
+
readonly TARGET_RULE: "target-rule";
|
|
298
|
+
readonly PLAN: "plan";
|
|
299
|
+
readonly CALENDAR: "calendar";
|
|
300
|
+
readonly LINE_TARGET: "line-target";
|
|
293
301
|
readonly BULK_IMPORT: "bulk-import";
|
|
294
302
|
};
|
|
295
303
|
private _retryRequest;
|
|
@@ -298,7 +306,7 @@ export default class Repzo {
|
|
|
298
306
|
private _update;
|
|
299
307
|
private _patch;
|
|
300
308
|
private _delete;
|
|
301
|
-
available_services: readonly ["client", "product", "variant", "category", "sub_category", "brand", "product_group", "tax", "measureunit", "measureunitFamily", "media", "priceList", "priceListItem", "team", "returnReason", "rep", "tag", "warehouse", "route", "productModifiersGroup", "channel", "speciality", "clientContact", "paymentTerm", "bank", "bank_list", "customStatus", "customList", "customListItem", "inventoryAdjustmentReason", "workorder", "workorderRequest", "supplier", "quickConvertToPdf", "visit", "activityFeedback", "activityFeedbackV2", "feedbackOption", "invoice", "proforma", "payment", "refund", "settlement", "voidSettlement", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "activityItemStatus", "adjustInventory", "inventory", "integrationApp", "joinActionsWebHook", "patchAction", "updateIntegrationMeta", "assetPartType", "assetPart", "assetPartUnit", "assetPartReceival", "assetPartTransfer", "returnAssetPartUnit", "storeAssetPartUnit", "ocrInvoiceJobTemplate", "ocrInvoiceJobGroup", "activityAiSalesOrder", "ocrInvoiceJob", "ocrInvoiceJobPage", "settings", "mailUnsubscribe", "approvalRequest", "safeInvoiceSerialCounter", "clientLocation", "assetType", "asset", "assetUnit", "workorderPortal", "approval", "workorderCategory", "contract", "contractInstallment", "repBalanceSummary", "workorderPortalLink", "customField", "salesAnalyticsReport", "clmPresentation", "clmSequence", "clmSlide", "clmFetch", "pdfMergeField", "visitReason"];
|
|
309
|
+
available_services: readonly ["client", "product", "variant", "category", "sub_category", "brand", "product_group", "tax", "measureunit", "measureunitFamily", "media", "priceList", "priceListItem", "team", "returnReason", "rep", "tag", "warehouse", "route", "productModifiersGroup", "channel", "speciality", "clientContact", "paymentTerm", "bank", "bank_list", "customStatus", "customList", "customListItem", "inventoryAdjustmentReason", "workorder", "workorderRequest", "supplier", "quickConvertToPdf", "visit", "activityFeedback", "activityFeedbackV2", "feedbackOption", "invoice", "proforma", "payment", "refund", "settlement", "voidSettlement", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "activityItemStatus", "adjustInventory", "inventory", "integrationApp", "joinActionsWebHook", "patchAction", "updateIntegrationMeta", "assetPartType", "assetPart", "assetPartUnit", "assetPartReceival", "assetPartTransfer", "returnAssetPartUnit", "storeAssetPartUnit", "ocrInvoiceJobTemplate", "ocrInvoiceJobGroup", "activityAiSalesOrder", "ocrInvoiceJob", "ocrInvoiceJobPage", "settings", "mailUnsubscribe", "approvalRequest", "safeInvoiceSerialCounter", "clientLocation", "assetType", "asset", "assetUnit", "workorderPortal", "approval", "workorderCategory", "contract", "contractInstallment", "repBalanceSummary", "workorderPortalLink", "customField", "salesAnalyticsReport", "clmPresentation", "clmSequence", "clmSlide", "clmFetch", "pdfMergeField", "visitReason", "targetRule", "plan", "calendar", "lineTarget", "bulkImport"];
|
|
302
310
|
generateUUID: ({ prefix, suffix, length, }: {
|
|
303
311
|
prefix?: string;
|
|
304
312
|
suffix?: string;
|
|
@@ -1346,6 +1354,38 @@ export default class Repzo {
|
|
|
1346
1354
|
update: (id: Service.VisitReason.Update.ID, body: Service.VisitReason.Update.Body) => Promise<Service.VisitReason.Update.Result>;
|
|
1347
1355
|
remove: (id: Service.VisitReason.Remove.ID) => Promise<Service.VisitReason.Remove.Result>;
|
|
1348
1356
|
};
|
|
1357
|
+
targetRule: {
|
|
1358
|
+
_path: "target-rule";
|
|
1359
|
+
find: (params?: Service.TargetRule.Find.Params) => Promise<Service.TargetRule.Find.Result>;
|
|
1360
|
+
get: (id: Service.TargetRule.Get.ID) => Promise<Service.TargetRule.Get.Result>;
|
|
1361
|
+
create: (body: Service.TargetRule.Create.Body) => Promise<Service.TargetRule.Create.Result>;
|
|
1362
|
+
update: (id: Service.TargetRule.Update.ID, body: Service.TargetRule.Update.Body) => Promise<Service.TargetRule.Update.Result>;
|
|
1363
|
+
remove: (id: Service.TargetRule.Remove.ID) => Promise<Service.TargetRule.Remove.Result>;
|
|
1364
|
+
};
|
|
1365
|
+
plan: {
|
|
1366
|
+
_path: "plan";
|
|
1367
|
+
find: (params?: Service.Plan.Find.Params) => Promise<Service.Plan.Find.Result>;
|
|
1368
|
+
get: (id: Service.Plan.Get.ID, params?: Service.Plan.Get.Params) => Promise<Service.Plan.Get.Result>;
|
|
1369
|
+
create: (body: Service.Plan.Create.Body) => Promise<Service.Plan.Create.Result>;
|
|
1370
|
+
update: (id: Service.Plan.Update.ID, body: Service.Plan.Update.Body) => Promise<Service.Plan.Update.Result>;
|
|
1371
|
+
remove: (id: Service.Plan.Remove.ID) => Promise<Service.Plan.Remove.Result>;
|
|
1372
|
+
};
|
|
1373
|
+
calendar: {
|
|
1374
|
+
_path: "calendar";
|
|
1375
|
+
find: (params?: Service.Calendar.Find.Params) => Promise<Service.Calendar.Find.Result>;
|
|
1376
|
+
get: (id: Service.Calendar.Get.ID, params?: Service.Calendar.Get.Params) => Promise<Service.Calendar.Get.Result>;
|
|
1377
|
+
create: (body: Service.Calendar.Create.Body, params?: Service.Calendar.Create.Params) => Promise<Service.Calendar.Create.Result>;
|
|
1378
|
+
update: (id: Service.Calendar.Update.ID, body: Service.Calendar.Update.Body) => Promise<Service.Calendar.Update.Result>;
|
|
1379
|
+
remove: (id: Service.Calendar.Remove.ID) => Promise<Service.Calendar.Remove.Result>;
|
|
1380
|
+
};
|
|
1381
|
+
lineTarget: {
|
|
1382
|
+
_path: "line-target";
|
|
1383
|
+
find: (params?: Service.LineTarget.Find.Params) => Promise<Service.LineTarget.Find.Result>;
|
|
1384
|
+
get: (id: Service.LineTarget.Get.ID, params?: Service.LineTarget.Get.Params) => Promise<Service.LineTarget.Get.Result>;
|
|
1385
|
+
create: (body: Service.LineTarget.Create.Body) => Promise<Service.LineTarget.Create.Result>;
|
|
1386
|
+
update: (id: Service.LineTarget.Update.ID, body: Service.LineTarget.Update.Body) => Promise<Service.LineTarget.Update.Result>;
|
|
1387
|
+
remove: (id: Service.LineTarget.Remove.ID, params?: Service.LineTarget.Remove.Params) => Promise<Service.LineTarget.Remove.Result>;
|
|
1388
|
+
};
|
|
1349
1389
|
bulkImport: {
|
|
1350
1390
|
_path: "bulk-import";
|
|
1351
1391
|
find: (params?: Service.BulkImport.Find.Params) => Promise<Service.BulkImport.Find.Result>;
|
package/lib/index.js
CHANGED
|
@@ -139,6 +139,10 @@ export const end_points = {
|
|
|
139
139
|
JOB_CATEGORY: "job-category",
|
|
140
140
|
JOB_CATEGORY_AUTOSKIP_ANALYZE: "job-category-autoskip-analyze",
|
|
141
141
|
VISIT_REASON: "visit-reason",
|
|
142
|
+
TARGET_RULE: "target-rule",
|
|
143
|
+
PLAN: "plan",
|
|
144
|
+
CALENDAR: "calendar",
|
|
145
|
+
LINE_TARGET: "line-target",
|
|
142
146
|
BULK_IMPORT: "bulk-import",
|
|
143
147
|
};
|
|
144
148
|
export const availableService = [
|
|
@@ -238,6 +242,11 @@ export const availableService = [
|
|
|
238
242
|
"clmFetch",
|
|
239
243
|
"pdfMergeField",
|
|
240
244
|
"visitReason",
|
|
245
|
+
"targetRule",
|
|
246
|
+
"plan",
|
|
247
|
+
"calendar",
|
|
248
|
+
"lineTarget",
|
|
249
|
+
"bulkImport",
|
|
241
250
|
];
|
|
242
251
|
class Repzo {
|
|
243
252
|
constructor(apiKey, options) {
|
|
@@ -2795,6 +2804,94 @@ class Repzo {
|
|
|
2795
2804
|
return res;
|
|
2796
2805
|
},
|
|
2797
2806
|
};
|
|
2807
|
+
this.targetRule = {
|
|
2808
|
+
_path: Repzo._end_points.TARGET_RULE,
|
|
2809
|
+
find: async (params) => {
|
|
2810
|
+
let res = await this._fetch(this.svAPIEndpoint, this.targetRule._path, params);
|
|
2811
|
+
return res;
|
|
2812
|
+
},
|
|
2813
|
+
get: async (id) => {
|
|
2814
|
+
return await this._fetch(this.svAPIEndpoint, this.targetRule._path + `/${id}`);
|
|
2815
|
+
},
|
|
2816
|
+
create: async (body) => {
|
|
2817
|
+
let res = await this._create(this.svAPIEndpoint, this.targetRule._path, body);
|
|
2818
|
+
return res;
|
|
2819
|
+
},
|
|
2820
|
+
update: async (id, body) => {
|
|
2821
|
+
let res = await this._update(this.svAPIEndpoint, this.targetRule._path + `/${id}`, body);
|
|
2822
|
+
return res;
|
|
2823
|
+
},
|
|
2824
|
+
remove: async (id) => {
|
|
2825
|
+
let res = await this._delete(this.svAPIEndpoint, this.targetRule._path + `/${id}`);
|
|
2826
|
+
return res;
|
|
2827
|
+
},
|
|
2828
|
+
};
|
|
2829
|
+
this.plan = {
|
|
2830
|
+
_path: Repzo._end_points.PLAN,
|
|
2831
|
+
find: async (params) => {
|
|
2832
|
+
let res = await this._fetch(this.svAPIEndpoint, this.plan._path, params);
|
|
2833
|
+
return res;
|
|
2834
|
+
},
|
|
2835
|
+
get: async (id, params) => {
|
|
2836
|
+
return await this._fetch(this.svAPIEndpoint, this.plan._path + `/${id}`, params);
|
|
2837
|
+
},
|
|
2838
|
+
create: async (body) => {
|
|
2839
|
+
let res = await this._create(this.svAPIEndpoint, this.plan._path, body);
|
|
2840
|
+
return res;
|
|
2841
|
+
},
|
|
2842
|
+
update: async (id, body) => {
|
|
2843
|
+
let res = await this._update(this.svAPIEndpoint, this.plan._path + `/${id}`, body);
|
|
2844
|
+
return res;
|
|
2845
|
+
},
|
|
2846
|
+
remove: async (id) => {
|
|
2847
|
+
let res = await this._delete(this.svAPIEndpoint, this.plan._path + `/${id}`);
|
|
2848
|
+
return res;
|
|
2849
|
+
},
|
|
2850
|
+
};
|
|
2851
|
+
this.calendar = {
|
|
2852
|
+
_path: Repzo._end_points.CALENDAR,
|
|
2853
|
+
find: async (params) => {
|
|
2854
|
+
let res = await this._fetch(this.svAPIEndpoint, this.calendar._path, params);
|
|
2855
|
+
return res;
|
|
2856
|
+
},
|
|
2857
|
+
get: async (id, params) => {
|
|
2858
|
+
return await this._fetch(this.svAPIEndpoint, this.calendar._path + `/${id}`, params);
|
|
2859
|
+
},
|
|
2860
|
+
create: async (body, params) => {
|
|
2861
|
+
let res = await this._create(this.svAPIEndpoint, this.calendar._path, body, params);
|
|
2862
|
+
return res;
|
|
2863
|
+
},
|
|
2864
|
+
update: async (id, body) => {
|
|
2865
|
+
let res = await this._update(this.svAPIEndpoint, this.calendar._path + `/${id}`, body);
|
|
2866
|
+
return res;
|
|
2867
|
+
},
|
|
2868
|
+
remove: async (id) => {
|
|
2869
|
+
let res = await this._delete(this.svAPIEndpoint, this.calendar._path + `/${id}`);
|
|
2870
|
+
return res;
|
|
2871
|
+
},
|
|
2872
|
+
};
|
|
2873
|
+
this.lineTarget = {
|
|
2874
|
+
_path: Repzo._end_points.LINE_TARGET,
|
|
2875
|
+
find: async (params) => {
|
|
2876
|
+
let res = await this._fetch(this.svAPIEndpoint, this.lineTarget._path, params);
|
|
2877
|
+
return res;
|
|
2878
|
+
},
|
|
2879
|
+
get: async (id, params) => {
|
|
2880
|
+
return await this._fetch(this.svAPIEndpoint, this.lineTarget._path + `/${id}`, params);
|
|
2881
|
+
},
|
|
2882
|
+
create: async (body) => {
|
|
2883
|
+
let res = await this._create(this.svAPIEndpoint, this.lineTarget._path, body);
|
|
2884
|
+
return res;
|
|
2885
|
+
},
|
|
2886
|
+
update: async (id, body) => {
|
|
2887
|
+
let res = await this._update(this.svAPIEndpoint, this.lineTarget._path + `/${id}`, body);
|
|
2888
|
+
return res;
|
|
2889
|
+
},
|
|
2890
|
+
remove: async (id, params) => {
|
|
2891
|
+
let res = await this._delete(this.svAPIEndpoint, this.lineTarget._path + (id ? `/${id}` : ""), params);
|
|
2892
|
+
return res;
|
|
2893
|
+
},
|
|
2894
|
+
};
|
|
2798
2895
|
this.bulkImport = {
|
|
2799
2896
|
_path: Repzo._end_points.BULK_IMPORT,
|
|
2800
2897
|
find: async (params) => {
|