repzo 1.0.25 → 1.0.27
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 +7 -0
- package/lib/index.js +18 -0
- package/lib/types/index.d.ts +78 -0
- package/package.json +1 -1
- package/src/index.ts +42 -0
- package/src/types/index.ts +167 -1
- package/test.js +11 -0
- package/test.ts +0 -8
package/lib/index.d.ts
CHANGED
|
@@ -186,6 +186,13 @@ export default class Repzo {
|
|
|
186
186
|
find: (params?: Service.Workorder.Find.Params) => Promise<Service.Workorder.Find.Result>;
|
|
187
187
|
get: (id: Service.Workorder.Get.ID, params?: Service.Workorder.Get.Params) => Promise<Service.Workorder.Get.Result>;
|
|
188
188
|
};
|
|
189
|
+
quickConvertToPdf: {
|
|
190
|
+
_path: string;
|
|
191
|
+
find: (params?: Service.QuickConvertToPdf.Find.Params) => Promise<Service.QuickConvertToPdf.Find.Result>;
|
|
192
|
+
get: (id: Service.QuickConvertToPdf.Get.ID, params?: Service.QuickConvertToPdf.Get.Params) => Promise<Service.QuickConvertToPdf.Get.Result>;
|
|
193
|
+
create: (body: Service.QuickConvertToPdf.Create.Body) => Promise<Service.QuickConvertToPdf.Create.Result>;
|
|
194
|
+
remove: (id: Service.QuickConvertToPdf.Remove.ID) => Promise<Service.QuickConvertToPdf.Remove.Result>;
|
|
195
|
+
};
|
|
189
196
|
invoice: {
|
|
190
197
|
_path: string;
|
|
191
198
|
find: (params?: Service.FullInvoice.Find.Params) => Promise<Service.FullInvoice.Find.Result>;
|
package/lib/index.js
CHANGED
|
@@ -488,6 +488,24 @@ export default class Repzo {
|
|
|
488
488
|
return await this._fetch(this.svAPIEndpoint, this.workorder._path + `/${id}`, params);
|
|
489
489
|
},
|
|
490
490
|
};
|
|
491
|
+
this.quickConvertToPdf = {
|
|
492
|
+
_path: "/quick-convert-to-pdf",
|
|
493
|
+
find: async (params) => {
|
|
494
|
+
let res = await this._fetch(this.svAPIEndpoint, this.quickConvertToPdf._path, params);
|
|
495
|
+
return res;
|
|
496
|
+
},
|
|
497
|
+
get: async (id, params) => {
|
|
498
|
+
return await this._fetch(this.svAPIEndpoint, this.quickConvertToPdf._path + `/${id}`, params);
|
|
499
|
+
},
|
|
500
|
+
create: async (body) => {
|
|
501
|
+
let res = await this._create(this.svAPIEndpoint, this.quickConvertToPdf._path, body);
|
|
502
|
+
return res;
|
|
503
|
+
},
|
|
504
|
+
remove: async (id) => {
|
|
505
|
+
let res = await this._delete(this.svAPIEndpoint, this.quickConvertToPdf._path + `/${id}`);
|
|
506
|
+
return res;
|
|
507
|
+
},
|
|
508
|
+
};
|
|
491
509
|
this.invoice = {
|
|
492
510
|
_path: "/fullinvoices",
|
|
493
511
|
find: async (params) => {
|
package/lib/types/index.d.ts
CHANGED
|
@@ -193,6 +193,37 @@ export interface CalendarWeeklyGroup {
|
|
|
193
193
|
note?: string;
|
|
194
194
|
_id: string;
|
|
195
195
|
}
|
|
196
|
+
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";
|
|
197
|
+
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";
|
|
198
|
+
export type PrintTypes = DocumentTypes & ("workorder" | "form");
|
|
199
|
+
export interface MediaDoc {
|
|
200
|
+
_id?: string;
|
|
201
|
+
media_id: string;
|
|
202
|
+
media_type: "csv" | "json" | "image" | "pdf" | "ppt" | "pptx" | "xls" | "xlsx" | "thumbnail" | "doc" | "docx" | "images";
|
|
203
|
+
mime_type: "image/jpeg" | string;
|
|
204
|
+
ContentType: "image/jpeg" | string;
|
|
205
|
+
file_name: string;
|
|
206
|
+
width: number;
|
|
207
|
+
height: number;
|
|
208
|
+
company_namespace: string[];
|
|
209
|
+
ContentLength?: number;
|
|
210
|
+
ETag?: string;
|
|
211
|
+
Metadata?: {};
|
|
212
|
+
key: string;
|
|
213
|
+
pathSuffix: string;
|
|
214
|
+
pathPrefix: string;
|
|
215
|
+
parentDocumentType?: DocumentTypes;
|
|
216
|
+
parentDocumentId?: string;
|
|
217
|
+
parentDocumentKey?: string;
|
|
218
|
+
publicUrl: string;
|
|
219
|
+
baseUrl: string;
|
|
220
|
+
type_name: "FileAttachment" | "ImageAttachment";
|
|
221
|
+
thumbnails: thumbnailStoragePopulated;
|
|
222
|
+
extension: string;
|
|
223
|
+
bucket_name: string;
|
|
224
|
+
region: string;
|
|
225
|
+
time: number;
|
|
226
|
+
}
|
|
196
227
|
export declare namespace Service {
|
|
197
228
|
namespace Client {
|
|
198
229
|
interface Financials {
|
|
@@ -2539,6 +2570,53 @@ export declare namespace Service {
|
|
|
2539
2570
|
}
|
|
2540
2571
|
export {};
|
|
2541
2572
|
}
|
|
2573
|
+
namespace QuickConvertToPdf {
|
|
2574
|
+
export interface QuickConvertToPdfSchema {
|
|
2575
|
+
_id?: string;
|
|
2576
|
+
creator: AdminCreator | RepCreator | ClientCreator;
|
|
2577
|
+
document_id?: string[];
|
|
2578
|
+
document_type: PrintTypes;
|
|
2579
|
+
print_media?: string | MediaDoc;
|
|
2580
|
+
state?: "queued" | "initiated" | "started" | "delayed" | "completed" | "in_progress" | "failed";
|
|
2581
|
+
content?: string;
|
|
2582
|
+
sync_id: string;
|
|
2583
|
+
}
|
|
2584
|
+
interface CreateBody {
|
|
2585
|
+
document_id?: string[];
|
|
2586
|
+
document_type: PrintTypes;
|
|
2587
|
+
sync_id: string;
|
|
2588
|
+
}
|
|
2589
|
+
type PopulatedKeys = "print_media";
|
|
2590
|
+
export namespace Find {
|
|
2591
|
+
type Params = DefaultPaginationQueryParams & {
|
|
2592
|
+
document_id?: string;
|
|
2593
|
+
document_type?: PrintTypes;
|
|
2594
|
+
print_media?: string | MediaDoc;
|
|
2595
|
+
disabled?: boolean;
|
|
2596
|
+
};
|
|
2597
|
+
interface Result extends DefaultPaginationResult {
|
|
2598
|
+
data: QuickConvertToPdfSchema[];
|
|
2599
|
+
absolute_total: number;
|
|
2600
|
+
page_total: number;
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
export namespace Get {
|
|
2604
|
+
type ID = string;
|
|
2605
|
+
interface Params {
|
|
2606
|
+
populatedKeys?: PopulatedKeys[];
|
|
2607
|
+
}
|
|
2608
|
+
type Result = QuickConvertToPdfSchema;
|
|
2609
|
+
}
|
|
2610
|
+
export namespace Create {
|
|
2611
|
+
type Body = CreateBody;
|
|
2612
|
+
type Result = QuickConvertToPdfSchema;
|
|
2613
|
+
}
|
|
2614
|
+
export namespace Remove {
|
|
2615
|
+
type ID = string;
|
|
2616
|
+
type Result = QuickConvertToPdfSchema;
|
|
2617
|
+
}
|
|
2618
|
+
export {};
|
|
2619
|
+
}
|
|
2542
2620
|
namespace FullInvoice {
|
|
2543
2621
|
export interface InvoiceSchema {
|
|
2544
2622
|
_id: string;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1259,6 +1259,48 @@ export default class Repzo {
|
|
|
1259
1259
|
);
|
|
1260
1260
|
},
|
|
1261
1261
|
};
|
|
1262
|
+
quickConvertToPdf = {
|
|
1263
|
+
_path: "/quick-convert-to-pdf",
|
|
1264
|
+
find: async (
|
|
1265
|
+
params?: Service.QuickConvertToPdf.Find.Params
|
|
1266
|
+
): Promise<Service.QuickConvertToPdf.Find.Result> => {
|
|
1267
|
+
let res: Service.QuickConvertToPdf.Find.Result = await this._fetch(
|
|
1268
|
+
this.svAPIEndpoint,
|
|
1269
|
+
this.quickConvertToPdf._path,
|
|
1270
|
+
params
|
|
1271
|
+
);
|
|
1272
|
+
return res;
|
|
1273
|
+
},
|
|
1274
|
+
get: async (
|
|
1275
|
+
id: Service.QuickConvertToPdf.Get.ID,
|
|
1276
|
+
params?: Service.QuickConvertToPdf.Get.Params
|
|
1277
|
+
): Promise<Service.QuickConvertToPdf.Get.Result> => {
|
|
1278
|
+
return await this._fetch(
|
|
1279
|
+
this.svAPIEndpoint,
|
|
1280
|
+
this.quickConvertToPdf._path + `/${id}`,
|
|
1281
|
+
params
|
|
1282
|
+
);
|
|
1283
|
+
},
|
|
1284
|
+
create: async (
|
|
1285
|
+
body: Service.QuickConvertToPdf.Create.Body
|
|
1286
|
+
): Promise<Service.QuickConvertToPdf.Create.Result> => {
|
|
1287
|
+
let res = await this._create(
|
|
1288
|
+
this.svAPIEndpoint,
|
|
1289
|
+
this.quickConvertToPdf._path,
|
|
1290
|
+
body
|
|
1291
|
+
);
|
|
1292
|
+
return res;
|
|
1293
|
+
},
|
|
1294
|
+
remove: async (
|
|
1295
|
+
id: Service.QuickConvertToPdf.Remove.ID
|
|
1296
|
+
): Promise<Service.QuickConvertToPdf.Remove.Result> => {
|
|
1297
|
+
let res: Service.QuickConvertToPdf.Remove.Result = await this._delete(
|
|
1298
|
+
this.svAPIEndpoint,
|
|
1299
|
+
this.quickConvertToPdf._path + `/${id}`
|
|
1300
|
+
);
|
|
1301
|
+
return res;
|
|
1302
|
+
},
|
|
1303
|
+
};
|
|
1262
1304
|
invoice = {
|
|
1263
1305
|
_path: "/fullinvoices",
|
|
1264
1306
|
find: async (
|
package/src/types/index.ts
CHANGED
|
@@ -231,7 +231,117 @@ export interface CalendarWeeklyGroup {
|
|
|
231
231
|
note?: string;
|
|
232
232
|
_id: string;
|
|
233
233
|
}
|
|
234
|
-
|
|
234
|
+
export type Model =
|
|
235
|
+
| "quickConvertToPdf"
|
|
236
|
+
| "warehouses"
|
|
237
|
+
| "transfers"
|
|
238
|
+
| "transactions"
|
|
239
|
+
| "taxes"
|
|
240
|
+
| "productvariations"
|
|
241
|
+
| "products"
|
|
242
|
+
| "pricelistsitems"
|
|
243
|
+
| "pricelists"
|
|
244
|
+
| "payments"
|
|
245
|
+
| "ledger_payments"
|
|
246
|
+
| "mslsales"
|
|
247
|
+
| "mslproducts"
|
|
248
|
+
| "measureunits"
|
|
249
|
+
| "measureunitfamilies"
|
|
250
|
+
| "invoicesitems"
|
|
251
|
+
| "invoices"
|
|
252
|
+
| "ledger_goods"
|
|
253
|
+
| "fullinvoices"
|
|
254
|
+
| "checks"
|
|
255
|
+
| "clients"
|
|
256
|
+
| "activities"
|
|
257
|
+
| "bigReports"
|
|
258
|
+
| "admins";
|
|
259
|
+
export type DocumentTypes =
|
|
260
|
+
| "form"
|
|
261
|
+
| "quickConvertToPdf"
|
|
262
|
+
| "clients"
|
|
263
|
+
| "asset"
|
|
264
|
+
| "assetUnit"
|
|
265
|
+
| "workorder"
|
|
266
|
+
| "clientLocation"
|
|
267
|
+
| "clientContact"
|
|
268
|
+
| "commentsThread"
|
|
269
|
+
| "workorderRequest"
|
|
270
|
+
| "workorderPortal"
|
|
271
|
+
| "invoice"
|
|
272
|
+
| "products"
|
|
273
|
+
| "productvariations"
|
|
274
|
+
| "representatives"
|
|
275
|
+
| "productcategories"
|
|
276
|
+
| "productSubCategory"
|
|
277
|
+
| "speciality"
|
|
278
|
+
| "line"
|
|
279
|
+
| "banner"
|
|
280
|
+
| "intgAvailableApps"
|
|
281
|
+
| "availability_msl"
|
|
282
|
+
| "reminders"
|
|
283
|
+
| "audits"
|
|
284
|
+
| "availability"
|
|
285
|
+
| "photos"
|
|
286
|
+
| "planogram"
|
|
287
|
+
| "tasks"
|
|
288
|
+
| "checks"
|
|
289
|
+
| "notificationsCenter"
|
|
290
|
+
| "admins"
|
|
291
|
+
| "settings"
|
|
292
|
+
| "printWorkorderPortalLink"
|
|
293
|
+
| "bulkExport"
|
|
294
|
+
| "generateRule"
|
|
295
|
+
| "scheduleEmail"
|
|
296
|
+
| "custom-list-item"
|
|
297
|
+
| "days"
|
|
298
|
+
| "bulkImport"
|
|
299
|
+
| "sv.activitiesstorechecks"
|
|
300
|
+
| "retailExecutionPreset"
|
|
301
|
+
| "paymentMethod"
|
|
302
|
+
| "approvalRequest";
|
|
303
|
+
export type PrintTypes = DocumentTypes & ("workorder" | "form");
|
|
304
|
+
|
|
305
|
+
export interface MediaDoc {
|
|
306
|
+
_id?: string;
|
|
307
|
+
media_id: string;
|
|
308
|
+
media_type:
|
|
309
|
+
| "csv"
|
|
310
|
+
| "json"
|
|
311
|
+
| "image"
|
|
312
|
+
| "pdf"
|
|
313
|
+
| "ppt"
|
|
314
|
+
| "pptx"
|
|
315
|
+
| "xls"
|
|
316
|
+
| "xlsx"
|
|
317
|
+
| "thumbnail"
|
|
318
|
+
| "doc"
|
|
319
|
+
| "docx"
|
|
320
|
+
| "images";
|
|
321
|
+
mime_type: "image/jpeg" | string;
|
|
322
|
+
ContentType: "image/jpeg" | string;
|
|
323
|
+
file_name: string;
|
|
324
|
+
width: number;
|
|
325
|
+
height: number;
|
|
326
|
+
company_namespace: string[];
|
|
327
|
+
ContentLength?: number;
|
|
328
|
+
ETag?: string;
|
|
329
|
+
Metadata?: {};
|
|
330
|
+
key: string;
|
|
331
|
+
pathSuffix: string;
|
|
332
|
+
pathPrefix: string;
|
|
333
|
+
parentDocumentType?: DocumentTypes;
|
|
334
|
+
parentDocumentId?: string;
|
|
335
|
+
parentDocumentKey?: string;
|
|
336
|
+
publicUrl: string;
|
|
337
|
+
baseUrl: string;
|
|
338
|
+
type_name: "FileAttachment" | "ImageAttachment";
|
|
339
|
+
thumbnails: thumbnailStoragePopulated;
|
|
340
|
+
extension: string;
|
|
341
|
+
bucket_name: string;
|
|
342
|
+
region: string;
|
|
343
|
+
time: number;
|
|
344
|
+
}
|
|
235
345
|
// <reference path = "vehicle.ts" />
|
|
236
346
|
export namespace Service {
|
|
237
347
|
export namespace Client {
|
|
@@ -2797,6 +2907,62 @@ export namespace Service {
|
|
|
2797
2907
|
}
|
|
2798
2908
|
}
|
|
2799
2909
|
|
|
2910
|
+
export namespace QuickConvertToPdf {
|
|
2911
|
+
export interface QuickConvertToPdfSchema {
|
|
2912
|
+
_id?: string;
|
|
2913
|
+
creator: AdminCreator | RepCreator | ClientCreator;
|
|
2914
|
+
document_id?: string[];
|
|
2915
|
+
document_type: PrintTypes;
|
|
2916
|
+
print_media?: string | MediaDoc;
|
|
2917
|
+
state?:
|
|
2918
|
+
| "queued"
|
|
2919
|
+
| "initiated"
|
|
2920
|
+
| "started"
|
|
2921
|
+
| "delayed"
|
|
2922
|
+
| "completed"
|
|
2923
|
+
| "in_progress"
|
|
2924
|
+
| "failed";
|
|
2925
|
+
content?: string;
|
|
2926
|
+
sync_id: string;
|
|
2927
|
+
}
|
|
2928
|
+
interface CreateBody {
|
|
2929
|
+
document_id?: string[];
|
|
2930
|
+
document_type: PrintTypes;
|
|
2931
|
+
sync_id: string;
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2934
|
+
type PopulatedKeys = "print_media";
|
|
2935
|
+
export namespace Find {
|
|
2936
|
+
export type Params = DefaultPaginationQueryParams & {
|
|
2937
|
+
document_id?: string;
|
|
2938
|
+
document_type?: PrintTypes;
|
|
2939
|
+
print_media?: string | MediaDoc;
|
|
2940
|
+
disabled?: boolean;
|
|
2941
|
+
};
|
|
2942
|
+
export interface Result extends DefaultPaginationResult {
|
|
2943
|
+
data: QuickConvertToPdfSchema[];
|
|
2944
|
+
absolute_total: number;
|
|
2945
|
+
page_total: number;
|
|
2946
|
+
}
|
|
2947
|
+
}
|
|
2948
|
+
export namespace Get {
|
|
2949
|
+
export type ID = string;
|
|
2950
|
+
export interface Params {
|
|
2951
|
+
populatedKeys?: PopulatedKeys[];
|
|
2952
|
+
}
|
|
2953
|
+
export type Result = QuickConvertToPdfSchema;
|
|
2954
|
+
}
|
|
2955
|
+
export namespace Create {
|
|
2956
|
+
export type Body = CreateBody;
|
|
2957
|
+
export type Result = QuickConvertToPdfSchema;
|
|
2958
|
+
}
|
|
2959
|
+
|
|
2960
|
+
export namespace Remove {
|
|
2961
|
+
export type ID = string;
|
|
2962
|
+
export type Result = QuickConvertToPdfSchema;
|
|
2963
|
+
}
|
|
2964
|
+
}
|
|
2965
|
+
|
|
2800
2966
|
export namespace FullInvoice {
|
|
2801
2967
|
export interface InvoiceSchema {
|
|
2802
2968
|
_id: string;
|
package/test.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Repzo from "./lib/index.js";
|
|
2
|
+
// import Repzo from "repzo"
|
|
3
|
+
let repzo = new Repzo("qOIWZDYSjObf5W1Pti3efUM1D6S9vaqk8I_GoxOLnas");
|
|
4
|
+
let workorders = await repzo.workorder.get("63832c86180e66bcde05a49c")
|
|
5
|
+
console.log(workorders);
|
|
6
|
+
// let clients = repzo.client.find({ search: "Mecca" });
|
|
7
|
+
// console.log(clients);
|
|
8
|
+
// repzo.client.create({ name: "kf" });
|
|
9
|
+
// repzo.headers["ho"] = "faf";
|
|
10
|
+
// repzo.client.update("", {});
|
|
11
|
+
// repzo.
|
package/test.ts
DELETED