repzo 1.0.230 → 1.0.231
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 +20 -0
- package/lib/index.js +46 -0
- package/lib/types/index.d.ts +171 -1
- package/package.json +1 -1
- package/src/index.ts +120 -0
- package/src/types/index.ts +174 -1
package/lib/index.d.ts
CHANGED
|
@@ -39,6 +39,8 @@ export declare const end_points: {
|
|
|
39
39
|
readonly INVOICE: "fullinvoices";
|
|
40
40
|
readonly PROFORMA: "proforma";
|
|
41
41
|
readonly PRINT_SETTINGS: "print-settings";
|
|
42
|
+
readonly PDF_TEMPLATE_GALLERY: "pdf-template-gallery";
|
|
43
|
+
readonly PDF_TEMPLATE: "pdf-template";
|
|
42
44
|
readonly PAYMENT: "payments";
|
|
43
45
|
readonly REFUND: "refund";
|
|
44
46
|
readonly SETTLEMENT: "settlement";
|
|
@@ -167,6 +169,8 @@ export default class Repzo {
|
|
|
167
169
|
readonly INVOICE: "fullinvoices";
|
|
168
170
|
readonly PROFORMA: "proforma";
|
|
169
171
|
readonly PRINT_SETTINGS: "print-settings";
|
|
172
|
+
readonly PDF_TEMPLATE_GALLERY: "pdf-template-gallery";
|
|
173
|
+
readonly PDF_TEMPLATE: "pdf-template";
|
|
170
174
|
readonly PAYMENT: "payments";
|
|
171
175
|
readonly REFUND: "refund";
|
|
172
176
|
readonly SETTLEMENT: "settlement";
|
|
@@ -1139,4 +1143,20 @@ export default class Repzo {
|
|
|
1139
1143
|
create: (body: Service.PrintSetting.Create.Body) => Promise<Service.PrintSetting.Create.Result>;
|
|
1140
1144
|
update: (id: Service.PrintSetting.Update.ID, body: Service.PrintSetting.Update.Body) => Promise<Service.PrintSetting.Update.Result>;
|
|
1141
1145
|
};
|
|
1146
|
+
pdfTemplateGallery: {
|
|
1147
|
+
_path: "pdf-template-gallery";
|
|
1148
|
+
find: (params?: Service.PdfTemplateGallery.Find.Params) => Promise<Service.PdfTemplateGallery.Find.Result>;
|
|
1149
|
+
get: (id: Service.PdfTemplateGallery.Get.ID, params?: Service.PdfTemplateGallery.Get.Params) => Promise<Service.PdfTemplateGallery.Get.Result>;
|
|
1150
|
+
create: (body: Service.PdfTemplateGallery.Create.Body) => Promise<Service.PdfTemplateGallery.Create.Result>;
|
|
1151
|
+
update: (id: Service.PdfTemplateGallery.Update.ID, body: Service.PdfTemplateGallery.Update.Body) => Promise<Service.PdfTemplateGallery.Update.Result>;
|
|
1152
|
+
remove: (id: Service.PdfTemplateGallery.Remove.ID) => Promise<Service.PdfTemplateGallery.Remove.Result>;
|
|
1153
|
+
};
|
|
1154
|
+
pdfTemplate: {
|
|
1155
|
+
_path: "pdf-template";
|
|
1156
|
+
find: (params?: Service.PdfTemplate.Find.Params) => Promise<Service.PdfTemplate.Find.Result>;
|
|
1157
|
+
get: (id: Service.PdfTemplate.Get.ID, params?: Service.PdfTemplate.Get.Params) => Promise<Service.PdfTemplate.Get.Result>;
|
|
1158
|
+
create: (body: Service.PdfTemplate.Create.Body) => Promise<Service.PdfTemplate.Create.Result>;
|
|
1159
|
+
update: (id: Service.PdfTemplate.Update.ID, body: Service.PdfTemplate.Update.Body) => Promise<Service.PdfTemplate.Update.Result>;
|
|
1160
|
+
remove: (id: Service.PdfTemplate.Remove.ID) => Promise<Service.PdfTemplate.Remove.Result>;
|
|
1161
|
+
};
|
|
1142
1162
|
}
|
package/lib/index.js
CHANGED
|
@@ -40,6 +40,8 @@ export const end_points = {
|
|
|
40
40
|
INVOICE: "fullinvoices",
|
|
41
41
|
PROFORMA: "proforma",
|
|
42
42
|
PRINT_SETTINGS: "print-settings",
|
|
43
|
+
PDF_TEMPLATE_GALLERY: "pdf-template-gallery",
|
|
44
|
+
PDF_TEMPLATE: "pdf-template",
|
|
43
45
|
PAYMENT: "payments",
|
|
44
46
|
REFUND: "refund",
|
|
45
47
|
SETTLEMENT: "settlement",
|
|
@@ -2336,6 +2338,50 @@ class Repzo {
|
|
|
2336
2338
|
return res;
|
|
2337
2339
|
},
|
|
2338
2340
|
};
|
|
2341
|
+
this.pdfTemplateGallery = {
|
|
2342
|
+
_path: Repzo._end_points.PDF_TEMPLATE_GALLERY,
|
|
2343
|
+
find: async (params) => {
|
|
2344
|
+
let res = await this._fetch(this.svAPIEndpoint, this.pdfTemplateGallery._path, params);
|
|
2345
|
+
return res;
|
|
2346
|
+
},
|
|
2347
|
+
get: async (id, params) => {
|
|
2348
|
+
return await this._fetch(this.svAPIEndpoint, this.pdfTemplateGallery._path + `/${id}`, params);
|
|
2349
|
+
},
|
|
2350
|
+
create: async (body) => {
|
|
2351
|
+
let res = await this._create(this.svAPIEndpoint, this.pdfTemplateGallery._path, body);
|
|
2352
|
+
return res;
|
|
2353
|
+
},
|
|
2354
|
+
update: async (id, body) => {
|
|
2355
|
+
let res = await this._update(this.svAPIEndpoint, this.pdfTemplateGallery._path + `/${id}`, body);
|
|
2356
|
+
return res;
|
|
2357
|
+
},
|
|
2358
|
+
remove: async (id) => {
|
|
2359
|
+
let res = await this._delete(this.svAPIEndpoint, this.pdfTemplateGallery._path + `/${id}`);
|
|
2360
|
+
return res;
|
|
2361
|
+
},
|
|
2362
|
+
};
|
|
2363
|
+
this.pdfTemplate = {
|
|
2364
|
+
_path: Repzo._end_points.PDF_TEMPLATE,
|
|
2365
|
+
find: async (params) => {
|
|
2366
|
+
let res = await this._fetch(this.svAPIEndpoint, this.pdfTemplate._path, params);
|
|
2367
|
+
return res;
|
|
2368
|
+
},
|
|
2369
|
+
get: async (id, params) => {
|
|
2370
|
+
return await this._fetch(this.svAPIEndpoint, this.pdfTemplate._path + `/${id}`, params);
|
|
2371
|
+
},
|
|
2372
|
+
create: async (body) => {
|
|
2373
|
+
let res = await this._create(this.svAPIEndpoint, this.pdfTemplate._path, body);
|
|
2374
|
+
return res;
|
|
2375
|
+
},
|
|
2376
|
+
update: async (id, body) => {
|
|
2377
|
+
let res = await this._update(this.svAPIEndpoint, this.pdfTemplate._path + `/${id}`, body);
|
|
2378
|
+
return res;
|
|
2379
|
+
},
|
|
2380
|
+
remove: async (id) => {
|
|
2381
|
+
let res = await this._delete(this.svAPIEndpoint, this.pdfTemplate._path + `/${id}`);
|
|
2382
|
+
return res;
|
|
2383
|
+
},
|
|
2384
|
+
};
|
|
2339
2385
|
this.svAPIEndpoint =
|
|
2340
2386
|
!options?.env || options?.env == "production"
|
|
2341
2387
|
? "https://sv.api.repzo.me"
|
package/lib/types/index.d.ts
CHANGED
|
@@ -240,7 +240,7 @@ export interface CalendarWeeklyGroup {
|
|
|
240
240
|
}
|
|
241
241
|
export type Model = "quickConvertToPdf" | "warehouses" | "transfers" | "transactions" | "taxes" | "productvariations" | "products" | "pricelistsitems" | "pricelists" | "payments" | "ledger_payments" | "mslsales" | "mslproducts" | "measureunits" | "measureunitfamilies" | "invoicesitems" | "invoices" | "ledger_goods" | "fullinvoices" | "checks" | "clients" | "activities" | "bigReports" | "admins";
|
|
242
242
|
export type DocumentTypes = "form" | "quickConvertToPdf" | "clients" | "asset" | "assetUnit" | "workorder" | "clientLocation" | "clientContact" | "commentsThread" | "workorderRequest" | "workorderPortal" | "invoice" | "products" | "productvariations" | "representatives" | "productcategories" | "productSubCategory" | "speciality" | "line" | "banner" | "intgAvailableApps" | "availability_msl" | "reminders" | "audits" | "availability" | "photos" | "planogram" | "tasks" | "checks" | "notificationsCenter" | "admins" | "settings" | "printWorkorderPortalLink" | "bulkExport" | "generateRule" | "scheduleEmail" | "custom-list-item" | "days" | "bulkImport" | "sv.activitiesstorechecks" | "retailExecutionPreset" | "paymentMethod" | "approvalRequest" | "activityFormV2Result" | "formV2" | "payments" | "ocrInvoiceJob" | "contract" | "contractInstallment" | "form" | "paymentMethod" | "aiObjectDetectionModelVersion" | "aiObjectDetectionTask" | "assetPart" | "assetPartReceival" | "assetPartUnit" | "returnAssetPartUnit" | "storeAssetPartUnit" | "activityAiSalesOrder" | "ocrInvoiceJobGroup";
|
|
243
|
-
export type PrintTypes = "workorder" | "form" | "invoice" | "proforma" | "settlement";
|
|
243
|
+
export type PrintTypes = "workorder" | "form" | "invoice" | "proforma" | "settlement" | "formV2";
|
|
244
244
|
export type InvoiceFontStyles = "InvoiceHeaderTitle" | "InvoiceTaxNumber" | "InvoiceType" | "InvoiceInfo" | "ItemsHeader" | "ItemLabel" | "ItemValue" | "ItemVariant" | "TotalItemsQty" | "TotalAmount" | "RepReciver" | "Address" | "PrintTime" | "InvoiceHeader" | "ClientBalance";
|
|
245
245
|
type Granularity = "Year" | "Year Month" | "Year Week" | "Month" | "Year Month Day" | "Year Month Day Time" | "Year Month Day Time Offset";
|
|
246
246
|
export interface MediaDoc {
|
|
@@ -17357,6 +17357,176 @@ export declare namespace Service {
|
|
|
17357
17357
|
type Result = Data;
|
|
17358
17358
|
}
|
|
17359
17359
|
}
|
|
17360
|
+
namespace PdfTemplateGallery {
|
|
17361
|
+
export interface Data {
|
|
17362
|
+
_id: string;
|
|
17363
|
+
html_media?: string | MediaDoc;
|
|
17364
|
+
settings?: {
|
|
17365
|
+
[key: string]: any;
|
|
17366
|
+
};
|
|
17367
|
+
cover_photo?: string | MediaDoc;
|
|
17368
|
+
name: string;
|
|
17369
|
+
locale: "en" | "ar";
|
|
17370
|
+
ai_prompt?: string;
|
|
17371
|
+
document_type: PrintTypes;
|
|
17372
|
+
disabled: boolean;
|
|
17373
|
+
createdAt: string;
|
|
17374
|
+
updatedAt: string;
|
|
17375
|
+
}
|
|
17376
|
+
export interface CreateBody {
|
|
17377
|
+
html_media?: string;
|
|
17378
|
+
settings?: {
|
|
17379
|
+
[key: string]: any;
|
|
17380
|
+
};
|
|
17381
|
+
cover_photo?: string;
|
|
17382
|
+
name: string;
|
|
17383
|
+
locale: "en" | "ar";
|
|
17384
|
+
ai_prompt?: string;
|
|
17385
|
+
document_type: PrintTypes;
|
|
17386
|
+
disabled?: boolean;
|
|
17387
|
+
}
|
|
17388
|
+
export interface UpdateBody {
|
|
17389
|
+
html_media?: string;
|
|
17390
|
+
settings?: {
|
|
17391
|
+
[key: string]: any;
|
|
17392
|
+
};
|
|
17393
|
+
cover_photo?: string;
|
|
17394
|
+
name?: string;
|
|
17395
|
+
locale?: "en" | "ar";
|
|
17396
|
+
ai_prompt?: string;
|
|
17397
|
+
document_type?: PrintTypes;
|
|
17398
|
+
}
|
|
17399
|
+
export type PopulatedDoc = Data & {
|
|
17400
|
+
html_media_populated?: MediaDoc;
|
|
17401
|
+
cover_photo_populated?: MediaDoc;
|
|
17402
|
+
};
|
|
17403
|
+
type PopulatedKeys = "html_media" | "cover_photo";
|
|
17404
|
+
export namespace Find {
|
|
17405
|
+
type Params = DefaultPaginationQueryParams & {
|
|
17406
|
+
_id?: string | string[];
|
|
17407
|
+
name?: string;
|
|
17408
|
+
locale?: "en" | "ar";
|
|
17409
|
+
document_type?: PrintTypes;
|
|
17410
|
+
disabled?: boolean;
|
|
17411
|
+
};
|
|
17412
|
+
interface Result extends DefaultPaginationResult {
|
|
17413
|
+
data: PopulatedDoc[];
|
|
17414
|
+
}
|
|
17415
|
+
}
|
|
17416
|
+
export namespace Get {
|
|
17417
|
+
type ID = string;
|
|
17418
|
+
type Params = {
|
|
17419
|
+
populatedKeys?: PopulatedKeys[];
|
|
17420
|
+
};
|
|
17421
|
+
type Result = PopulatedDoc;
|
|
17422
|
+
}
|
|
17423
|
+
export namespace Create {
|
|
17424
|
+
type Body = CreateBody;
|
|
17425
|
+
type Result = Data;
|
|
17426
|
+
}
|
|
17427
|
+
export namespace Update {
|
|
17428
|
+
type ID = string;
|
|
17429
|
+
type Body = UpdateBody;
|
|
17430
|
+
type Result = Data;
|
|
17431
|
+
}
|
|
17432
|
+
export namespace Remove {
|
|
17433
|
+
type ID = string;
|
|
17434
|
+
type Result = Data;
|
|
17435
|
+
}
|
|
17436
|
+
export {};
|
|
17437
|
+
}
|
|
17438
|
+
namespace PdfTemplate {
|
|
17439
|
+
export interface Data {
|
|
17440
|
+
_id: string;
|
|
17441
|
+
html_media?: string | MediaDoc;
|
|
17442
|
+
settings?: {
|
|
17443
|
+
[key: string]: any;
|
|
17444
|
+
};
|
|
17445
|
+
cover_photo?: string | MediaDoc;
|
|
17446
|
+
name: string;
|
|
17447
|
+
is_default: boolean;
|
|
17448
|
+
creator: AdminCreator;
|
|
17449
|
+
editor?: AdminCreator;
|
|
17450
|
+
locale: "en" | "ar";
|
|
17451
|
+
pdf_template_gallery?: string;
|
|
17452
|
+
publish_time?: number | null;
|
|
17453
|
+
document_type: PrintTypes;
|
|
17454
|
+
disabled: boolean;
|
|
17455
|
+
company_namespace: string[];
|
|
17456
|
+
createdAt: string;
|
|
17457
|
+
updatedAt: string;
|
|
17458
|
+
}
|
|
17459
|
+
export interface CreateBody {
|
|
17460
|
+
html_media?: string;
|
|
17461
|
+
settings?: {
|
|
17462
|
+
[key: string]: any;
|
|
17463
|
+
};
|
|
17464
|
+
cover_photo?: string;
|
|
17465
|
+
name: string;
|
|
17466
|
+
is_default?: boolean;
|
|
17467
|
+
locale: "en" | "ar";
|
|
17468
|
+
pdf_template_gallery?: string;
|
|
17469
|
+
publish_time?: number | null;
|
|
17470
|
+
document_type: PrintTypes;
|
|
17471
|
+
}
|
|
17472
|
+
export interface UpdateBody {
|
|
17473
|
+
html_media?: string;
|
|
17474
|
+
settings?: {
|
|
17475
|
+
[key: string]: any;
|
|
17476
|
+
};
|
|
17477
|
+
cover_photo?: string;
|
|
17478
|
+
name?: string;
|
|
17479
|
+
is_default?: boolean;
|
|
17480
|
+
locale?: "en" | "ar";
|
|
17481
|
+
pdf_template_gallery?: string;
|
|
17482
|
+
publish_time?: number | null;
|
|
17483
|
+
document_type?: PrintTypes;
|
|
17484
|
+
}
|
|
17485
|
+
export type PopulatedDoc = Data & {
|
|
17486
|
+
html_media_populated?: MediaDoc;
|
|
17487
|
+
cover_photo_populated?: MediaDoc;
|
|
17488
|
+
pdf_template_gallery_populated?: PdfTemplateGallery.Data;
|
|
17489
|
+
};
|
|
17490
|
+
type PopulatedKeys = "html_media" | "cover_photo" | "pdf_template_gallery";
|
|
17491
|
+
export namespace Find {
|
|
17492
|
+
type Params = DefaultPaginationQueryParams & {
|
|
17493
|
+
name?: string | string[];
|
|
17494
|
+
locale?: "en" | "ar" | ("en" | "ar")[];
|
|
17495
|
+
document_type?: PrintTypes | PrintTypes[];
|
|
17496
|
+
is_default?: boolean;
|
|
17497
|
+
pdf_template_gallery?: string | string[];
|
|
17498
|
+
publish_time?: number | (number | null)[];
|
|
17499
|
+
disabled?: boolean;
|
|
17500
|
+
_id?: string | string[];
|
|
17501
|
+
"creator._id"?: string | string[];
|
|
17502
|
+
"editor._id"?: string | string[];
|
|
17503
|
+
};
|
|
17504
|
+
interface Result extends DefaultPaginationResult {
|
|
17505
|
+
data: PopulatedDoc[];
|
|
17506
|
+
}
|
|
17507
|
+
}
|
|
17508
|
+
export namespace Get {
|
|
17509
|
+
type ID = string;
|
|
17510
|
+
type Params = {
|
|
17511
|
+
populatedKeys?: PopulatedKeys[];
|
|
17512
|
+
};
|
|
17513
|
+
type Result = PopulatedDoc;
|
|
17514
|
+
}
|
|
17515
|
+
export namespace Create {
|
|
17516
|
+
type Body = CreateBody;
|
|
17517
|
+
type Result = Data;
|
|
17518
|
+
}
|
|
17519
|
+
export namespace Update {
|
|
17520
|
+
type ID = string;
|
|
17521
|
+
type Body = UpdateBody;
|
|
17522
|
+
type Result = Data;
|
|
17523
|
+
}
|
|
17524
|
+
export namespace Remove {
|
|
17525
|
+
type ID = string;
|
|
17526
|
+
type Result = Data;
|
|
17527
|
+
}
|
|
17528
|
+
export {};
|
|
17529
|
+
}
|
|
17360
17530
|
}
|
|
17361
17531
|
export type StringId = string;
|
|
17362
17532
|
export type NameSpaces = string[];
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -50,6 +50,8 @@ export const end_points = {
|
|
|
50
50
|
INVOICE: "fullinvoices",
|
|
51
51
|
PROFORMA: "proforma",
|
|
52
52
|
PRINT_SETTINGS: "print-settings",
|
|
53
|
+
PDF_TEMPLATE_GALLERY: "pdf-template-gallery",
|
|
54
|
+
PDF_TEMPLATE: "pdf-template",
|
|
53
55
|
PAYMENT: "payments",
|
|
54
56
|
REFUND: "refund",
|
|
55
57
|
SETTLEMENT: "settlement",
|
|
@@ -5944,6 +5946,124 @@ export default class Repzo {
|
|
|
5944
5946
|
return res;
|
|
5945
5947
|
},
|
|
5946
5948
|
};
|
|
5949
|
+
|
|
5950
|
+
pdfTemplateGallery = {
|
|
5951
|
+
_path: Repzo._end_points.PDF_TEMPLATE_GALLERY,
|
|
5952
|
+
|
|
5953
|
+
find: async (
|
|
5954
|
+
params?: Service.PdfTemplateGallery.Find.Params,
|
|
5955
|
+
): Promise<Service.PdfTemplateGallery.Find.Result> => {
|
|
5956
|
+
let res: Service.PdfTemplateGallery.Find.Result = await this._fetch(
|
|
5957
|
+
this.svAPIEndpoint,
|
|
5958
|
+
this.pdfTemplateGallery._path,
|
|
5959
|
+
params,
|
|
5960
|
+
);
|
|
5961
|
+
return res;
|
|
5962
|
+
},
|
|
5963
|
+
|
|
5964
|
+
get: async (
|
|
5965
|
+
id: Service.PdfTemplateGallery.Get.ID,
|
|
5966
|
+
params?: Service.PdfTemplateGallery.Get.Params,
|
|
5967
|
+
): Promise<Service.PdfTemplateGallery.Get.Result> => {
|
|
5968
|
+
return await this._fetch(
|
|
5969
|
+
this.svAPIEndpoint,
|
|
5970
|
+
this.pdfTemplateGallery._path + `/${id}`,
|
|
5971
|
+
params,
|
|
5972
|
+
);
|
|
5973
|
+
},
|
|
5974
|
+
|
|
5975
|
+
create: async (
|
|
5976
|
+
body: Service.PdfTemplateGallery.Create.Body,
|
|
5977
|
+
): Promise<Service.PdfTemplateGallery.Create.Result> => {
|
|
5978
|
+
let res = await this._create(
|
|
5979
|
+
this.svAPIEndpoint,
|
|
5980
|
+
this.pdfTemplateGallery._path,
|
|
5981
|
+
body,
|
|
5982
|
+
);
|
|
5983
|
+
return res;
|
|
5984
|
+
},
|
|
5985
|
+
|
|
5986
|
+
update: async (
|
|
5987
|
+
id: Service.PdfTemplateGallery.Update.ID,
|
|
5988
|
+
body: Service.PdfTemplateGallery.Update.Body,
|
|
5989
|
+
): Promise<Service.PdfTemplateGallery.Update.Result> => {
|
|
5990
|
+
let res: Service.PdfTemplateGallery.Update.Result = await this._update(
|
|
5991
|
+
this.svAPIEndpoint,
|
|
5992
|
+
this.pdfTemplateGallery._path + `/${id}`,
|
|
5993
|
+
body,
|
|
5994
|
+
);
|
|
5995
|
+
return res;
|
|
5996
|
+
},
|
|
5997
|
+
|
|
5998
|
+
remove: async (
|
|
5999
|
+
id: Service.PdfTemplateGallery.Remove.ID,
|
|
6000
|
+
): Promise<Service.PdfTemplateGallery.Remove.Result> => {
|
|
6001
|
+
let res: Service.PdfTemplateGallery.Remove.Result = await this._delete(
|
|
6002
|
+
this.svAPIEndpoint,
|
|
6003
|
+
this.pdfTemplateGallery._path + `/${id}`,
|
|
6004
|
+
);
|
|
6005
|
+
return res;
|
|
6006
|
+
},
|
|
6007
|
+
};
|
|
6008
|
+
|
|
6009
|
+
pdfTemplate = {
|
|
6010
|
+
_path: Repzo._end_points.PDF_TEMPLATE,
|
|
6011
|
+
|
|
6012
|
+
find: async (
|
|
6013
|
+
params?: Service.PdfTemplate.Find.Params,
|
|
6014
|
+
): Promise<Service.PdfTemplate.Find.Result> => {
|
|
6015
|
+
let res: Service.PdfTemplate.Find.Result = await this._fetch(
|
|
6016
|
+
this.svAPIEndpoint,
|
|
6017
|
+
this.pdfTemplate._path,
|
|
6018
|
+
params,
|
|
6019
|
+
);
|
|
6020
|
+
return res;
|
|
6021
|
+
},
|
|
6022
|
+
|
|
6023
|
+
get: async (
|
|
6024
|
+
id: Service.PdfTemplate.Get.ID,
|
|
6025
|
+
params?: Service.PdfTemplate.Get.Params,
|
|
6026
|
+
): Promise<Service.PdfTemplate.Get.Result> => {
|
|
6027
|
+
return await this._fetch(
|
|
6028
|
+
this.svAPIEndpoint,
|
|
6029
|
+
this.pdfTemplate._path + `/${id}`,
|
|
6030
|
+
params,
|
|
6031
|
+
);
|
|
6032
|
+
},
|
|
6033
|
+
|
|
6034
|
+
create: async (
|
|
6035
|
+
body: Service.PdfTemplate.Create.Body,
|
|
6036
|
+
): Promise<Service.PdfTemplate.Create.Result> => {
|
|
6037
|
+
let res = await this._create(
|
|
6038
|
+
this.svAPIEndpoint,
|
|
6039
|
+
this.pdfTemplate._path,
|
|
6040
|
+
body,
|
|
6041
|
+
);
|
|
6042
|
+
return res;
|
|
6043
|
+
},
|
|
6044
|
+
|
|
6045
|
+
update: async (
|
|
6046
|
+
id: Service.PdfTemplate.Update.ID,
|
|
6047
|
+
body: Service.PdfTemplate.Update.Body,
|
|
6048
|
+
): Promise<Service.PdfTemplate.Update.Result> => {
|
|
6049
|
+
let res: Service.PdfTemplate.Update.Result = await this._update(
|
|
6050
|
+
this.svAPIEndpoint,
|
|
6051
|
+
this.pdfTemplate._path + `/${id}`,
|
|
6052
|
+
body,
|
|
6053
|
+
);
|
|
6054
|
+
return res;
|
|
6055
|
+
},
|
|
6056
|
+
|
|
6057
|
+
remove: async (
|
|
6058
|
+
id: Service.PdfTemplate.Remove.ID,
|
|
6059
|
+
): Promise<Service.PdfTemplate.Remove.Result> => {
|
|
6060
|
+
let res: Service.PdfTemplate.Remove.Result = await this._delete(
|
|
6061
|
+
this.svAPIEndpoint,
|
|
6062
|
+
this.pdfTemplate._path + `/${id}`,
|
|
6063
|
+
);
|
|
6064
|
+
return res;
|
|
6065
|
+
},
|
|
6066
|
+
};
|
|
5947
6067
|
}
|
|
5948
6068
|
|
|
5949
6069
|
function normalizeParams(params: Params): { [key: string]: any } {
|
package/src/types/index.ts
CHANGED
|
@@ -382,7 +382,8 @@ export type PrintTypes =
|
|
|
382
382
|
| "form"
|
|
383
383
|
| "invoice"
|
|
384
384
|
| "proforma"
|
|
385
|
-
| "settlement"
|
|
385
|
+
| "settlement"
|
|
386
|
+
| "formV2";
|
|
386
387
|
|
|
387
388
|
export type InvoiceFontStyles =
|
|
388
389
|
| "InvoiceHeaderTitle"
|
|
@@ -19415,6 +19416,178 @@ export namespace Service {
|
|
|
19415
19416
|
export type Result = Data;
|
|
19416
19417
|
}
|
|
19417
19418
|
}
|
|
19419
|
+
|
|
19420
|
+
export namespace PdfTemplateGallery {
|
|
19421
|
+
export interface Data {
|
|
19422
|
+
_id: string;
|
|
19423
|
+
html_media?: string | MediaDoc;
|
|
19424
|
+
settings?: { [key: string]: any };
|
|
19425
|
+
cover_photo?: string | MediaDoc;
|
|
19426
|
+
name: string;
|
|
19427
|
+
locale: "en" | "ar";
|
|
19428
|
+
ai_prompt?: string;
|
|
19429
|
+
document_type: PrintTypes;
|
|
19430
|
+
disabled: boolean;
|
|
19431
|
+
createdAt: string;
|
|
19432
|
+
updatedAt: string;
|
|
19433
|
+
}
|
|
19434
|
+
|
|
19435
|
+
export interface CreateBody {
|
|
19436
|
+
html_media?: string;
|
|
19437
|
+
settings?: { [key: string]: any };
|
|
19438
|
+
cover_photo?: string;
|
|
19439
|
+
name: string;
|
|
19440
|
+
locale: "en" | "ar";
|
|
19441
|
+
ai_prompt?: string;
|
|
19442
|
+
document_type: PrintTypes;
|
|
19443
|
+
disabled?: boolean;
|
|
19444
|
+
}
|
|
19445
|
+
|
|
19446
|
+
export interface UpdateBody {
|
|
19447
|
+
html_media?: string;
|
|
19448
|
+
settings?: { [key: string]: any };
|
|
19449
|
+
cover_photo?: string;
|
|
19450
|
+
name?: string;
|
|
19451
|
+
locale?: "en" | "ar";
|
|
19452
|
+
ai_prompt?: string;
|
|
19453
|
+
document_type?: PrintTypes;
|
|
19454
|
+
}
|
|
19455
|
+
|
|
19456
|
+
export type PopulatedDoc = Data & {
|
|
19457
|
+
html_media_populated?: MediaDoc;
|
|
19458
|
+
cover_photo_populated?: MediaDoc;
|
|
19459
|
+
};
|
|
19460
|
+
|
|
19461
|
+
type PopulatedKeys = "html_media" | "cover_photo";
|
|
19462
|
+
|
|
19463
|
+
export namespace Find {
|
|
19464
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
19465
|
+
_id?: string | string[];
|
|
19466
|
+
name?: string;
|
|
19467
|
+
locale?: "en" | "ar";
|
|
19468
|
+
document_type?: PrintTypes;
|
|
19469
|
+
disabled?: boolean;
|
|
19470
|
+
};
|
|
19471
|
+
export interface Result extends DefaultPaginationResult {
|
|
19472
|
+
data: PopulatedDoc[];
|
|
19473
|
+
}
|
|
19474
|
+
}
|
|
19475
|
+
|
|
19476
|
+
export namespace Get {
|
|
19477
|
+
export type ID = string;
|
|
19478
|
+
export type Params = { populatedKeys?: PopulatedKeys[] };
|
|
19479
|
+
export type Result = PopulatedDoc;
|
|
19480
|
+
}
|
|
19481
|
+
|
|
19482
|
+
export namespace Create {
|
|
19483
|
+
export type Body = CreateBody;
|
|
19484
|
+
export type Result = Data;
|
|
19485
|
+
}
|
|
19486
|
+
|
|
19487
|
+
export namespace Update {
|
|
19488
|
+
export type ID = string;
|
|
19489
|
+
export type Body = UpdateBody;
|
|
19490
|
+
export type Result = Data;
|
|
19491
|
+
}
|
|
19492
|
+
|
|
19493
|
+
export namespace Remove {
|
|
19494
|
+
export type ID = string;
|
|
19495
|
+
export type Result = Data;
|
|
19496
|
+
}
|
|
19497
|
+
}
|
|
19498
|
+
|
|
19499
|
+
export namespace PdfTemplate {
|
|
19500
|
+
export interface Data {
|
|
19501
|
+
_id: string;
|
|
19502
|
+
html_media?: string | MediaDoc;
|
|
19503
|
+
settings?: { [key: string]: any };
|
|
19504
|
+
cover_photo?: string | MediaDoc;
|
|
19505
|
+
name: string;
|
|
19506
|
+
is_default: boolean;
|
|
19507
|
+
creator: AdminCreator;
|
|
19508
|
+
editor?: AdminCreator;
|
|
19509
|
+
locale: "en" | "ar";
|
|
19510
|
+
pdf_template_gallery?: string;
|
|
19511
|
+
publish_time?: number | null;
|
|
19512
|
+
document_type: PrintTypes;
|
|
19513
|
+
disabled: boolean;
|
|
19514
|
+
company_namespace: string[];
|
|
19515
|
+
createdAt: string;
|
|
19516
|
+
updatedAt: string;
|
|
19517
|
+
}
|
|
19518
|
+
|
|
19519
|
+
export interface CreateBody {
|
|
19520
|
+
html_media?: string;
|
|
19521
|
+
settings?: { [key: string]: any };
|
|
19522
|
+
cover_photo?: string;
|
|
19523
|
+
name: string;
|
|
19524
|
+
is_default?: boolean;
|
|
19525
|
+
locale: "en" | "ar";
|
|
19526
|
+
pdf_template_gallery?: string;
|
|
19527
|
+
publish_time?: number | null;
|
|
19528
|
+
document_type: PrintTypes;
|
|
19529
|
+
}
|
|
19530
|
+
|
|
19531
|
+
export interface UpdateBody {
|
|
19532
|
+
html_media?: string;
|
|
19533
|
+
settings?: { [key: string]: any };
|
|
19534
|
+
cover_photo?: string;
|
|
19535
|
+
name?: string;
|
|
19536
|
+
is_default?: boolean;
|
|
19537
|
+
locale?: "en" | "ar";
|
|
19538
|
+
pdf_template_gallery?: string;
|
|
19539
|
+
publish_time?: number | null;
|
|
19540
|
+
document_type?: PrintTypes;
|
|
19541
|
+
}
|
|
19542
|
+
|
|
19543
|
+
export type PopulatedDoc = Data & {
|
|
19544
|
+
html_media_populated?: MediaDoc;
|
|
19545
|
+
cover_photo_populated?: MediaDoc;
|
|
19546
|
+
pdf_template_gallery_populated?: PdfTemplateGallery.Data;
|
|
19547
|
+
};
|
|
19548
|
+
|
|
19549
|
+
type PopulatedKeys = "html_media" | "cover_photo" | "pdf_template_gallery";
|
|
19550
|
+
|
|
19551
|
+
export namespace Find {
|
|
19552
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
19553
|
+
name?: string | string[];
|
|
19554
|
+
locale?: "en" | "ar" | ("en" | "ar")[];
|
|
19555
|
+
document_type?: PrintTypes | PrintTypes[];
|
|
19556
|
+
is_default?: boolean;
|
|
19557
|
+
pdf_template_gallery?: string | string[];
|
|
19558
|
+
publish_time?: number | (number | null)[];
|
|
19559
|
+
disabled?: boolean;
|
|
19560
|
+
_id?: string | string[];
|
|
19561
|
+
"creator._id"?: string | string[];
|
|
19562
|
+
"editor._id"?: string | string[];
|
|
19563
|
+
};
|
|
19564
|
+
export interface Result extends DefaultPaginationResult {
|
|
19565
|
+
data: PopulatedDoc[];
|
|
19566
|
+
}
|
|
19567
|
+
}
|
|
19568
|
+
|
|
19569
|
+
export namespace Get {
|
|
19570
|
+
export type ID = string;
|
|
19571
|
+
export type Params = { populatedKeys?: PopulatedKeys[] };
|
|
19572
|
+
export type Result = PopulatedDoc;
|
|
19573
|
+
}
|
|
19574
|
+
|
|
19575
|
+
export namespace Create {
|
|
19576
|
+
export type Body = CreateBody;
|
|
19577
|
+
export type Result = Data;
|
|
19578
|
+
}
|
|
19579
|
+
|
|
19580
|
+
export namespace Update {
|
|
19581
|
+
export type ID = string;
|
|
19582
|
+
export type Body = UpdateBody;
|
|
19583
|
+
export type Result = Data;
|
|
19584
|
+
}
|
|
19585
|
+
|
|
19586
|
+
export namespace Remove {
|
|
19587
|
+
export type ID = string;
|
|
19588
|
+
export type Result = Data;
|
|
19589
|
+
}
|
|
19590
|
+
}
|
|
19418
19591
|
}
|
|
19419
19592
|
|
|
19420
19593
|
export type StringId = string;
|