repzo 1.0.239 → 1.0.241
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/lib/index.d.ts +18 -2
- package/lib/index.js +32 -0
- package/lib/types/index.d.ts +93 -0
- package/package.json +1 -1
- package/src/index.ts +74 -0
- package/src/types/index.ts +102 -0
package/lib/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export declare const end_points: {
|
|
|
41
41
|
readonly PRINT_SETTINGS: "print-settings";
|
|
42
42
|
readonly PDF_TEMPLATE_GALLERY: "pdf-template-gallery";
|
|
43
43
|
readonly PDF_TEMPLATE: "pdf-template";
|
|
44
|
+
readonly PDF_MERGE_FIELD: "pdf-merge-fields";
|
|
44
45
|
readonly PAYMENT: "payments";
|
|
45
46
|
readonly REFUND: "refund";
|
|
46
47
|
readonly SETTLEMENT: "settlement";
|
|
@@ -120,9 +121,10 @@ export declare const end_points: {
|
|
|
120
121
|
readonly COMPARE_INVOICE_TO_WAREHOUSE: "compare-invoice-to-warehouse";
|
|
121
122
|
readonly AUTHENTICATE: "authenticate";
|
|
122
123
|
readonly OPTIONAL_BUSINESS_APP_SERVICE: "optional-business-app-service";
|
|
124
|
+
readonly PROMOTION_USAGE: "promotion-usage";
|
|
123
125
|
};
|
|
124
126
|
export type EndPoints = (typeof end_points)[keyof typeof end_points];
|
|
125
|
-
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", "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"];
|
|
127
|
+
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", "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"];
|
|
126
128
|
export type AvailableService = (typeof availableService)[number];
|
|
127
129
|
export default class Repzo {
|
|
128
130
|
private svAPIEndpoint;
|
|
@@ -176,6 +178,7 @@ export default class Repzo {
|
|
|
176
178
|
readonly PRINT_SETTINGS: "print-settings";
|
|
177
179
|
readonly PDF_TEMPLATE_GALLERY: "pdf-template-gallery";
|
|
178
180
|
readonly PDF_TEMPLATE: "pdf-template";
|
|
181
|
+
readonly PDF_MERGE_FIELD: "pdf-merge-fields";
|
|
179
182
|
readonly PAYMENT: "payments";
|
|
180
183
|
readonly REFUND: "refund";
|
|
181
184
|
readonly SETTLEMENT: "settlement";
|
|
@@ -255,6 +258,7 @@ export default class Repzo {
|
|
|
255
258
|
readonly COMPARE_INVOICE_TO_WAREHOUSE: "compare-invoice-to-warehouse";
|
|
256
259
|
readonly AUTHENTICATE: "authenticate";
|
|
257
260
|
readonly OPTIONAL_BUSINESS_APP_SERVICE: "optional-business-app-service";
|
|
261
|
+
readonly PROMOTION_USAGE: "promotion-usage";
|
|
258
262
|
};
|
|
259
263
|
private _retryRequest;
|
|
260
264
|
private _fetch;
|
|
@@ -262,7 +266,7 @@ export default class Repzo {
|
|
|
262
266
|
private _update;
|
|
263
267
|
private _patch;
|
|
264
268
|
private _delete;
|
|
265
|
-
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", "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"];
|
|
269
|
+
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", "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"];
|
|
266
270
|
generateUUID: ({ prefix, suffix, length, }: {
|
|
267
271
|
prefix?: string;
|
|
268
272
|
suffix?: string;
|
|
@@ -1178,9 +1182,21 @@ export default class Repzo {
|
|
|
1178
1182
|
update: (id: Service.PdfTemplate.Update.ID, body: Service.PdfTemplate.Update.Body) => Promise<Service.PdfTemplate.Update.Result>;
|
|
1179
1183
|
remove: (id: Service.PdfTemplate.Remove.ID) => Promise<Service.PdfTemplate.Remove.Result>;
|
|
1180
1184
|
};
|
|
1185
|
+
pdfMergeField: {
|
|
1186
|
+
_path: "pdf-merge-fields";
|
|
1187
|
+
find: (params?: Service.PdfMergeField.Find.Params) => Promise<Service.PdfMergeField.Find.Result>;
|
|
1188
|
+
get: (id: Service.PdfMergeField.Get.ID) => Promise<Service.PdfMergeField.Get.Result>;
|
|
1189
|
+
create: (body: Service.PdfMergeField.Create.Body) => Promise<Service.PdfMergeField.Create.Result>;
|
|
1190
|
+
update: (id: Service.PdfMergeField.Update.ID, body: Service.PdfMergeField.Update.Body) => Promise<Service.PdfMergeField.Update.Result>;
|
|
1191
|
+
remove: (id: Service.PdfMergeField.Remove.ID) => Promise<Service.PdfMergeField.Remove.Result>;
|
|
1192
|
+
};
|
|
1181
1193
|
optionalBusinessAppService: {
|
|
1182
1194
|
_path: "optional-business-app-service";
|
|
1183
1195
|
find: () => Promise<Service.OptionalBusinessAppService.Find.Result>;
|
|
1184
1196
|
create: () => Promise<Service.OptionalBusinessAppService.Create.Result>;
|
|
1185
1197
|
};
|
|
1198
|
+
promotionUsage: {
|
|
1199
|
+
_path: "promotion-usage";
|
|
1200
|
+
find: (params?: Service.PromotionUsage.Find.Params) => Promise<Service.PromotionUsage.Find.Result>;
|
|
1201
|
+
};
|
|
1186
1202
|
}
|
package/lib/index.js
CHANGED
|
@@ -43,6 +43,7 @@ export const end_points = {
|
|
|
43
43
|
PRINT_SETTINGS: "print-settings",
|
|
44
44
|
PDF_TEMPLATE_GALLERY: "pdf-template-gallery",
|
|
45
45
|
PDF_TEMPLATE: "pdf-template",
|
|
46
|
+
PDF_MERGE_FIELD: "pdf-merge-fields",
|
|
46
47
|
PAYMENT: "payments",
|
|
47
48
|
REFUND: "refund",
|
|
48
49
|
SETTLEMENT: "settlement",
|
|
@@ -122,6 +123,7 @@ export const end_points = {
|
|
|
122
123
|
COMPARE_INVOICE_TO_WAREHOUSE: "compare-invoice-to-warehouse",
|
|
123
124
|
AUTHENTICATE: "authenticate",
|
|
124
125
|
OPTIONAL_BUSINESS_APP_SERVICE: "optional-business-app-service",
|
|
126
|
+
PROMOTION_USAGE: "promotion-usage",
|
|
125
127
|
};
|
|
126
128
|
export const availableService = [
|
|
127
129
|
"client",
|
|
@@ -217,6 +219,7 @@ export const availableService = [
|
|
|
217
219
|
"clmSequence",
|
|
218
220
|
"clmSlide",
|
|
219
221
|
"clmFetch",
|
|
222
|
+
"pdfMergeField",
|
|
220
223
|
];
|
|
221
224
|
class Repzo {
|
|
222
225
|
constructor(apiKey, options) {
|
|
@@ -2422,6 +2425,28 @@ class Repzo {
|
|
|
2422
2425
|
return res;
|
|
2423
2426
|
},
|
|
2424
2427
|
};
|
|
2428
|
+
this.pdfMergeField = {
|
|
2429
|
+
_path: Repzo._end_points.PDF_MERGE_FIELD,
|
|
2430
|
+
find: async (params) => {
|
|
2431
|
+
let res = await this._fetch(this.svAPIEndpoint, this.pdfMergeField._path, params);
|
|
2432
|
+
return res;
|
|
2433
|
+
},
|
|
2434
|
+
get: async (id) => {
|
|
2435
|
+
return await this._fetch(this.svAPIEndpoint, this.pdfMergeField._path + `/${id}`);
|
|
2436
|
+
},
|
|
2437
|
+
create: async (body) => {
|
|
2438
|
+
let res = await this._create(this.svAPIEndpoint, this.pdfMergeField._path, body);
|
|
2439
|
+
return res;
|
|
2440
|
+
},
|
|
2441
|
+
update: async (id, body) => {
|
|
2442
|
+
let res = await this._update(this.svAPIEndpoint, this.pdfMergeField._path + `/${id}`, body);
|
|
2443
|
+
return res;
|
|
2444
|
+
},
|
|
2445
|
+
remove: async (id) => {
|
|
2446
|
+
let res = await this._delete(this.svAPIEndpoint, this.pdfMergeField._path + `/${id}`);
|
|
2447
|
+
return res;
|
|
2448
|
+
},
|
|
2449
|
+
};
|
|
2425
2450
|
this.optionalBusinessAppService = {
|
|
2426
2451
|
_path: Repzo._end_points.OPTIONAL_BUSINESS_APP_SERVICE,
|
|
2427
2452
|
find: async () => {
|
|
@@ -2433,6 +2458,13 @@ class Repzo {
|
|
|
2433
2458
|
return res;
|
|
2434
2459
|
},
|
|
2435
2460
|
};
|
|
2461
|
+
this.promotionUsage = {
|
|
2462
|
+
_path: Repzo._end_points.PROMOTION_USAGE,
|
|
2463
|
+
find: async (params) => {
|
|
2464
|
+
let res = await this._fetch(this.svAPIEndpoint, this.promotionUsage._path, params);
|
|
2465
|
+
return res;
|
|
2466
|
+
},
|
|
2467
|
+
};
|
|
2436
2468
|
this.svAPIEndpoint =
|
|
2437
2469
|
!options?.env || options?.env == "production"
|
|
2438
2470
|
? "https://sv.api.repzo.me"
|
package/lib/types/index.d.ts
CHANGED
|
@@ -12148,6 +12148,8 @@ export declare namespace Service {
|
|
|
12148
12148
|
manual_discounts_limit_value?: number;
|
|
12149
12149
|
promotions_enabled: boolean;
|
|
12150
12150
|
round_discounted_price: boolean;
|
|
12151
|
+
enable_promotion_freshness_window: boolean;
|
|
12152
|
+
promotion_freshness_window_in_minutes: number;
|
|
12151
12153
|
};
|
|
12152
12154
|
teams_shared_collections: string[];
|
|
12153
12155
|
days_of_work: "Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday";
|
|
@@ -12332,6 +12334,8 @@ export declare namespace Service {
|
|
|
12332
12334
|
manual_discounts_limit_value: number;
|
|
12333
12335
|
promotions_enabled: boolean;
|
|
12334
12336
|
round_discounted_price: boolean;
|
|
12337
|
+
enable_promotion_freshness_window: boolean;
|
|
12338
|
+
promotion_freshness_window_in_minutes: number;
|
|
12335
12339
|
};
|
|
12336
12340
|
teams_shared_collections?: string[];
|
|
12337
12341
|
days_of_work?: "Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday";
|
|
@@ -17585,6 +17589,95 @@ export declare namespace Service {
|
|
|
17585
17589
|
}
|
|
17586
17590
|
}
|
|
17587
17591
|
}
|
|
17592
|
+
namespace PdfMergeField {
|
|
17593
|
+
interface Data {
|
|
17594
|
+
_id: string;
|
|
17595
|
+
document_type: PrintTypes;
|
|
17596
|
+
key: string;
|
|
17597
|
+
description?: string;
|
|
17598
|
+
label?: string;
|
|
17599
|
+
is_array: boolean;
|
|
17600
|
+
type: "string" | "number" | "media" | "date" | "boolean" | "object";
|
|
17601
|
+
has_children?: boolean;
|
|
17602
|
+
format?: string;
|
|
17603
|
+
required: boolean;
|
|
17604
|
+
sample_value?: any;
|
|
17605
|
+
children?: Data[];
|
|
17606
|
+
createdAt?: Date;
|
|
17607
|
+
updatedAt?: Date;
|
|
17608
|
+
}
|
|
17609
|
+
interface CreateBody {
|
|
17610
|
+
document_type: PrintTypes;
|
|
17611
|
+
key: string;
|
|
17612
|
+
description?: string;
|
|
17613
|
+
label?: string;
|
|
17614
|
+
is_array: boolean;
|
|
17615
|
+
type: "string" | "number" | "media" | "date" | "boolean" | "object";
|
|
17616
|
+
has_children?: boolean;
|
|
17617
|
+
format?: string;
|
|
17618
|
+
required: boolean;
|
|
17619
|
+
sample_value?: any;
|
|
17620
|
+
children?: Data[];
|
|
17621
|
+
}
|
|
17622
|
+
interface UpdateBody {
|
|
17623
|
+
document_type?: PrintTypes;
|
|
17624
|
+
key?: string;
|
|
17625
|
+
description?: string;
|
|
17626
|
+
label?: string;
|
|
17627
|
+
is_array?: boolean;
|
|
17628
|
+
type?: "string" | "number" | "media" | "date" | "boolean" | "object";
|
|
17629
|
+
has_children?: boolean;
|
|
17630
|
+
format?: string;
|
|
17631
|
+
required?: boolean;
|
|
17632
|
+
sample_value?: any;
|
|
17633
|
+
children?: Data[];
|
|
17634
|
+
}
|
|
17635
|
+
namespace Find {
|
|
17636
|
+
type Params = DefaultPaginationQueryParams & {
|
|
17637
|
+
_id?: string | string[];
|
|
17638
|
+
document_type?: PrintTypes | PrintTypes[];
|
|
17639
|
+
key?: string;
|
|
17640
|
+
label?: string;
|
|
17641
|
+
};
|
|
17642
|
+
interface Result extends DefaultPaginationResult {
|
|
17643
|
+
data: Data[];
|
|
17644
|
+
}
|
|
17645
|
+
}
|
|
17646
|
+
namespace Get {
|
|
17647
|
+
type ID = string;
|
|
17648
|
+
type Result = Data;
|
|
17649
|
+
}
|
|
17650
|
+
namespace Create {
|
|
17651
|
+
type Body = CreateBody;
|
|
17652
|
+
type Result = Data;
|
|
17653
|
+
}
|
|
17654
|
+
namespace Update {
|
|
17655
|
+
type ID = string;
|
|
17656
|
+
type Body = UpdateBody;
|
|
17657
|
+
type Result = Data;
|
|
17658
|
+
}
|
|
17659
|
+
namespace Remove {
|
|
17660
|
+
type ID = string;
|
|
17661
|
+
type Result = Data;
|
|
17662
|
+
}
|
|
17663
|
+
}
|
|
17664
|
+
namespace PromotionUsage {
|
|
17665
|
+
interface Data {
|
|
17666
|
+
usage_per: "promo" | "client" | "rep";
|
|
17667
|
+
promo: StringId;
|
|
17668
|
+
rep?: StringId;
|
|
17669
|
+
client?: StringId;
|
|
17670
|
+
count: number;
|
|
17671
|
+
}
|
|
17672
|
+
namespace Find {
|
|
17673
|
+
type Params = DefaultPaginationQueryParams & {
|
|
17674
|
+
[key: string]: any;
|
|
17675
|
+
};
|
|
17676
|
+
interface Result extends DefaultPaginationResult {
|
|
17677
|
+
data: Data[];
|
|
17678
|
+
}
|
|
17679
|
+
}
|
|
17680
|
+
}
|
|
17588
17681
|
}
|
|
17589
17682
|
export type StringId = string;
|
|
17590
17683
|
export type NameSpaces = string[];
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -53,6 +53,7 @@ export const end_points = {
|
|
|
53
53
|
PRINT_SETTINGS: "print-settings",
|
|
54
54
|
PDF_TEMPLATE_GALLERY: "pdf-template-gallery",
|
|
55
55
|
PDF_TEMPLATE: "pdf-template",
|
|
56
|
+
PDF_MERGE_FIELD: "pdf-merge-fields",
|
|
56
57
|
PAYMENT: "payments",
|
|
57
58
|
REFUND: "refund",
|
|
58
59
|
SETTLEMENT: "settlement",
|
|
@@ -132,6 +133,7 @@ export const end_points = {
|
|
|
132
133
|
COMPARE_INVOICE_TO_WAREHOUSE: "compare-invoice-to-warehouse",
|
|
133
134
|
AUTHENTICATE: "authenticate",
|
|
134
135
|
OPTIONAL_BUSINESS_APP_SERVICE: "optional-business-app-service",
|
|
136
|
+
PROMOTION_USAGE: "promotion-usage",
|
|
135
137
|
} as const;
|
|
136
138
|
export type EndPoints = (typeof end_points)[keyof typeof end_points];
|
|
137
139
|
|
|
@@ -229,6 +231,7 @@ export const availableService = [
|
|
|
229
231
|
"clmSequence",
|
|
230
232
|
"clmSlide",
|
|
231
233
|
"clmFetch",
|
|
234
|
+
"pdfMergeField",
|
|
232
235
|
] as const;
|
|
233
236
|
export type AvailableService = (typeof availableService)[number];
|
|
234
237
|
|
|
@@ -6138,6 +6141,63 @@ export default class Repzo {
|
|
|
6138
6141
|
},
|
|
6139
6142
|
};
|
|
6140
6143
|
|
|
6144
|
+
pdfMergeField = {
|
|
6145
|
+
_path: Repzo._end_points.PDF_MERGE_FIELD,
|
|
6146
|
+
|
|
6147
|
+
find: async (
|
|
6148
|
+
params?: Service.PdfMergeField.Find.Params,
|
|
6149
|
+
): Promise<Service.PdfMergeField.Find.Result> => {
|
|
6150
|
+
let res: Service.PdfMergeField.Find.Result = await this._fetch(
|
|
6151
|
+
this.svAPIEndpoint,
|
|
6152
|
+
this.pdfMergeField._path,
|
|
6153
|
+
params,
|
|
6154
|
+
);
|
|
6155
|
+
return res;
|
|
6156
|
+
},
|
|
6157
|
+
|
|
6158
|
+
get: async (
|
|
6159
|
+
id: Service.PdfMergeField.Get.ID,
|
|
6160
|
+
): Promise<Service.PdfMergeField.Get.Result> => {
|
|
6161
|
+
return await this._fetch(
|
|
6162
|
+
this.svAPIEndpoint,
|
|
6163
|
+
this.pdfMergeField._path + `/${id}`,
|
|
6164
|
+
);
|
|
6165
|
+
},
|
|
6166
|
+
|
|
6167
|
+
create: async (
|
|
6168
|
+
body: Service.PdfMergeField.Create.Body,
|
|
6169
|
+
): Promise<Service.PdfMergeField.Create.Result> => {
|
|
6170
|
+
let res = await this._create(
|
|
6171
|
+
this.svAPIEndpoint,
|
|
6172
|
+
this.pdfMergeField._path,
|
|
6173
|
+
body,
|
|
6174
|
+
);
|
|
6175
|
+
return res;
|
|
6176
|
+
},
|
|
6177
|
+
|
|
6178
|
+
update: async (
|
|
6179
|
+
id: Service.PdfMergeField.Update.ID,
|
|
6180
|
+
body: Service.PdfMergeField.Update.Body,
|
|
6181
|
+
): Promise<Service.PdfMergeField.Update.Result> => {
|
|
6182
|
+
let res: Service.PdfMergeField.Update.Result = await this._update(
|
|
6183
|
+
this.svAPIEndpoint,
|
|
6184
|
+
this.pdfMergeField._path + `/${id}`,
|
|
6185
|
+
body,
|
|
6186
|
+
);
|
|
6187
|
+
return res;
|
|
6188
|
+
},
|
|
6189
|
+
|
|
6190
|
+
remove: async (
|
|
6191
|
+
id: Service.PdfMergeField.Remove.ID,
|
|
6192
|
+
): Promise<Service.PdfMergeField.Remove.Result> => {
|
|
6193
|
+
let res: Service.PdfMergeField.Remove.Result = await this._delete(
|
|
6194
|
+
this.svAPIEndpoint,
|
|
6195
|
+
this.pdfMergeField._path + `/${id}`,
|
|
6196
|
+
);
|
|
6197
|
+
return res;
|
|
6198
|
+
},
|
|
6199
|
+
};
|
|
6200
|
+
|
|
6141
6201
|
optionalBusinessAppService = {
|
|
6142
6202
|
_path: Repzo._end_points.OPTIONAL_BUSINESS_APP_SERVICE,
|
|
6143
6203
|
find: async (): Promise<Service.OptionalBusinessAppService.Find.Result> => {
|
|
@@ -6158,6 +6218,20 @@ export default class Repzo {
|
|
|
6158
6218
|
return res;
|
|
6159
6219
|
},
|
|
6160
6220
|
};
|
|
6221
|
+
|
|
6222
|
+
promotionUsage = {
|
|
6223
|
+
_path: Repzo._end_points.PROMOTION_USAGE,
|
|
6224
|
+
find: async (
|
|
6225
|
+
params?: Service.PromotionUsage.Find.Params,
|
|
6226
|
+
): Promise<Service.PromotionUsage.Find.Result> => {
|
|
6227
|
+
let res: Service.PromotionUsage.Find.Result = await this._fetch(
|
|
6228
|
+
this.svAPIEndpoint,
|
|
6229
|
+
this.promotionUsage._path,
|
|
6230
|
+
params,
|
|
6231
|
+
);
|
|
6232
|
+
return res;
|
|
6233
|
+
},
|
|
6234
|
+
};
|
|
6161
6235
|
}
|
|
6162
6236
|
|
|
6163
6237
|
function normalizeParams(params: Params): { [key: string]: any } {
|
package/src/types/index.ts
CHANGED
|
@@ -12944,6 +12944,8 @@ export namespace Service {
|
|
|
12944
12944
|
manual_discounts_limit_value?: number;
|
|
12945
12945
|
promotions_enabled: boolean;
|
|
12946
12946
|
round_discounted_price: boolean;
|
|
12947
|
+
enable_promotion_freshness_window: boolean;
|
|
12948
|
+
promotion_freshness_window_in_minutes: number;
|
|
12947
12949
|
};
|
|
12948
12950
|
teams_shared_collections: string[];
|
|
12949
12951
|
days_of_work:
|
|
@@ -13101,6 +13103,8 @@ export namespace Service {
|
|
|
13101
13103
|
manual_discounts_limit_value: number;
|
|
13102
13104
|
promotions_enabled: boolean;
|
|
13103
13105
|
round_discounted_price: boolean;
|
|
13106
|
+
enable_promotion_freshness_window: boolean;
|
|
13107
|
+
promotion_freshness_window_in_minutes: number;
|
|
13104
13108
|
};
|
|
13105
13109
|
teams_shared_collections?: string[];
|
|
13106
13110
|
days_of_work?:
|
|
@@ -19651,6 +19655,104 @@ export namespace Service {
|
|
|
19651
19655
|
}
|
|
19652
19656
|
}
|
|
19653
19657
|
}
|
|
19658
|
+
|
|
19659
|
+
export namespace PdfMergeField {
|
|
19660
|
+
export interface Data {
|
|
19661
|
+
_id: string;
|
|
19662
|
+
document_type: PrintTypes;
|
|
19663
|
+
key: string;
|
|
19664
|
+
description?: string;
|
|
19665
|
+
label?: string;
|
|
19666
|
+
is_array: boolean;
|
|
19667
|
+
type: "string" | "number" | "media" | "date" | "boolean" | "object";
|
|
19668
|
+
has_children?: boolean;
|
|
19669
|
+
format?: string;
|
|
19670
|
+
required: boolean;
|
|
19671
|
+
sample_value?: any;
|
|
19672
|
+
children?: Data[];
|
|
19673
|
+
createdAt?: Date;
|
|
19674
|
+
updatedAt?: Date;
|
|
19675
|
+
}
|
|
19676
|
+
|
|
19677
|
+
export interface CreateBody {
|
|
19678
|
+
document_type: PrintTypes;
|
|
19679
|
+
key: string;
|
|
19680
|
+
description?: string;
|
|
19681
|
+
label?: string;
|
|
19682
|
+
is_array: boolean;
|
|
19683
|
+
type: "string" | "number" | "media" | "date" | "boolean" | "object";
|
|
19684
|
+
has_children?: boolean;
|
|
19685
|
+
format?: string;
|
|
19686
|
+
required: boolean;
|
|
19687
|
+
sample_value?: any;
|
|
19688
|
+
children?: Data[];
|
|
19689
|
+
}
|
|
19690
|
+
|
|
19691
|
+
export interface UpdateBody {
|
|
19692
|
+
document_type?: PrintTypes;
|
|
19693
|
+
key?: string;
|
|
19694
|
+
description?: string;
|
|
19695
|
+
label?: string;
|
|
19696
|
+
is_array?: boolean;
|
|
19697
|
+
type?: "string" | "number" | "media" | "date" | "boolean" | "object";
|
|
19698
|
+
has_children?: boolean;
|
|
19699
|
+
format?: string;
|
|
19700
|
+
required?: boolean;
|
|
19701
|
+
sample_value?: any;
|
|
19702
|
+
children?: Data[];
|
|
19703
|
+
}
|
|
19704
|
+
|
|
19705
|
+
export namespace Find {
|
|
19706
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
19707
|
+
_id?: string | string[];
|
|
19708
|
+
document_type?: PrintTypes | PrintTypes[];
|
|
19709
|
+
key?: string;
|
|
19710
|
+
label?: string;
|
|
19711
|
+
};
|
|
19712
|
+
export interface Result extends DefaultPaginationResult {
|
|
19713
|
+
data: Data[];
|
|
19714
|
+
}
|
|
19715
|
+
}
|
|
19716
|
+
|
|
19717
|
+
export namespace Get {
|
|
19718
|
+
export type ID = string;
|
|
19719
|
+
export type Result = Data;
|
|
19720
|
+
}
|
|
19721
|
+
|
|
19722
|
+
export namespace Create {
|
|
19723
|
+
export type Body = CreateBody;
|
|
19724
|
+
export type Result = Data;
|
|
19725
|
+
}
|
|
19726
|
+
|
|
19727
|
+
export namespace Update {
|
|
19728
|
+
export type ID = string;
|
|
19729
|
+
export type Body = UpdateBody;
|
|
19730
|
+
export type Result = Data;
|
|
19731
|
+
}
|
|
19732
|
+
|
|
19733
|
+
export namespace Remove {
|
|
19734
|
+
export type ID = string;
|
|
19735
|
+
export type Result = Data;
|
|
19736
|
+
}
|
|
19737
|
+
}
|
|
19738
|
+
|
|
19739
|
+
export namespace PromotionUsage {
|
|
19740
|
+
export interface Data {
|
|
19741
|
+
usage_per: "promo" | "client" | "rep";
|
|
19742
|
+
promo: StringId;
|
|
19743
|
+
rep?: StringId;
|
|
19744
|
+
client?: StringId;
|
|
19745
|
+
count: number;
|
|
19746
|
+
}
|
|
19747
|
+
export namespace Find {
|
|
19748
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
19749
|
+
[key: string]: any;
|
|
19750
|
+
};
|
|
19751
|
+
export interface Result extends DefaultPaginationResult {
|
|
19752
|
+
data: Data[];
|
|
19753
|
+
}
|
|
19754
|
+
}
|
|
19755
|
+
}
|
|
19654
19756
|
}
|
|
19655
19757
|
|
|
19656
19758
|
export type StringId = string;
|