repzo 1.0.25 → 1.0.26

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 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) => {
@@ -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,54 @@ 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;
2580
+ print_media_populated?: MediaDoc;
2581
+ state?: "queued" | "initiated" | "started" | "delayed" | "completed" | "in_progress" | "failed";
2582
+ content?: string;
2583
+ sync_id: string;
2584
+ }
2585
+ interface CreateBody {
2586
+ document_id?: string[];
2587
+ document_type: PrintTypes;
2588
+ sync_id: string;
2589
+ }
2590
+ type PopulatedKeys = "print_media";
2591
+ export namespace Find {
2592
+ type Params = DefaultPaginationQueryParams & {
2593
+ document_id?: string;
2594
+ document_type?: PrintTypes;
2595
+ print_media?: string;
2596
+ disabled?: boolean;
2597
+ };
2598
+ interface Result extends DefaultPaginationResult {
2599
+ data: QuickConvertToPdfSchema[];
2600
+ absolute_total: number;
2601
+ page_total: number;
2602
+ }
2603
+ }
2604
+ export namespace Get {
2605
+ type ID = string;
2606
+ interface Params {
2607
+ populatedKeys?: PopulatedKeys[];
2608
+ }
2609
+ type Result = QuickConvertToPdfSchema;
2610
+ }
2611
+ export namespace Create {
2612
+ type Body = CreateBody;
2613
+ type Result = QuickConvertToPdfSchema;
2614
+ }
2615
+ export namespace Remove {
2616
+ type ID = string;
2617
+ type Result = QuickConvertToPdfSchema;
2618
+ }
2619
+ export {};
2620
+ }
2542
2621
  namespace FullInvoice {
2543
2622
  export interface InvoiceSchema {
2544
2623
  _id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
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 (
@@ -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,63 @@ 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;
2917
+ print_media_populated?: MediaDoc;
2918
+ state?:
2919
+ | "queued"
2920
+ | "initiated"
2921
+ | "started"
2922
+ | "delayed"
2923
+ | "completed"
2924
+ | "in_progress"
2925
+ | "failed";
2926
+ content?: string;
2927
+ sync_id: string;
2928
+ }
2929
+ interface CreateBody {
2930
+ document_id?: string[];
2931
+ document_type: PrintTypes;
2932
+ sync_id: string;
2933
+ }
2934
+
2935
+ type PopulatedKeys = "print_media";
2936
+ export namespace Find {
2937
+ export type Params = DefaultPaginationQueryParams & {
2938
+ document_id?: string;
2939
+ document_type?: PrintTypes;
2940
+ print_media?: string;
2941
+ disabled?: boolean;
2942
+ };
2943
+ export interface Result extends DefaultPaginationResult {
2944
+ data: QuickConvertToPdfSchema[];
2945
+ absolute_total: number;
2946
+ page_total: number;
2947
+ }
2948
+ }
2949
+ export namespace Get {
2950
+ export type ID = string;
2951
+ export interface Params {
2952
+ populatedKeys?: PopulatedKeys[];
2953
+ }
2954
+ export type Result = QuickConvertToPdfSchema;
2955
+ }
2956
+ export namespace Create {
2957
+ export type Body = CreateBody;
2958
+ export type Result = QuickConvertToPdfSchema;
2959
+ }
2960
+
2961
+ export namespace Remove {
2962
+ export type ID = string;
2963
+ export type Result = QuickConvertToPdfSchema;
2964
+ }
2965
+ }
2966
+
2800
2967
  export namespace FullInvoice {
2801
2968
  export interface InvoiceSchema {
2802
2969
  _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
@@ -1,8 +0,0 @@
1
- import Repzo from "./src/index.js";
2
- let repzo = new Repzo("");
3
- let clients = repzo.client.find({ search: "Mecca" });
4
- console.log(clients);
5
- repzo.client.create({ name: "kf" });
6
- repzo.headers["ho"] = "faf";
7
- repzo.client.update("", {});
8
- // repzo.