repzo 1.0.185 → 1.0.187

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
@@ -101,10 +101,11 @@ export declare const end_points: {
101
101
  readonly REPORT_COLUMN: "report-column";
102
102
  readonly REPORT_SORT: "report-sort";
103
103
  readonly REPORT_FILTER: "report-filter";
104
+ readonly SAFE_CRUD: "safe-crud";
104
105
  };
105
- export type EndPoints = (typeof end_points)[keyof typeof end_points];
106
+ export type EndPoints = typeof end_points[keyof typeof end_points];
106
107
  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", "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"];
107
- export type AvailableService = (typeof availableService)[number];
108
+ export type AvailableService = typeof availableService[number];
108
109
  export default class Repzo {
109
110
  private svAPIEndpoint;
110
111
  headers: Headers;
@@ -213,6 +214,7 @@ export default class Repzo {
213
214
  readonly REPORT_COLUMN: "report-column";
214
215
  readonly REPORT_SORT: "report-sort";
215
216
  readonly REPORT_FILTER: "report-filter";
217
+ readonly SAFE_CRUD: "safe-crud";
216
218
  };
217
219
  private _fetch;
218
220
  private _create;
@@ -1016,4 +1018,8 @@ export default class Repzo {
1016
1018
  create: (body: Service.ReportFilter.Create.Body) => Promise<Service.ReportFilter.Create.Result>;
1017
1019
  update: (id: Service.ReportFilter.Update.ID, body: Service.ReportFilter.Update.Body) => Promise<Service.ReportFilter.Update.Result>;
1018
1020
  };
1021
+ safeCrud: {
1022
+ _path: "safe-crud";
1023
+ create: (body: Service.SafeCrud.Create.Body) => Promise<Service.SafeCrud.Create.Result>;
1024
+ };
1019
1025
  }
package/lib/index.js CHANGED
@@ -102,6 +102,7 @@ export const end_points = {
102
102
  REPORT_COLUMN: "report-column",
103
103
  REPORT_SORT: "report-sort",
104
104
  REPORT_FILTER: "report-filter",
105
+ SAFE_CRUD: "safe-crud",
105
106
  };
106
107
  export const availableService = [
107
108
  "client",
@@ -2088,6 +2089,13 @@ class Repzo {
2088
2089
  return res;
2089
2090
  },
2090
2091
  };
2092
+ this.safeCrud = {
2093
+ _path: Repzo._end_points.SAFE_CRUD,
2094
+ create: async (body) => {
2095
+ let res = await this._create(this.svAPIEndpoint, this.safeCrud._path, body);
2096
+ return res;
2097
+ },
2098
+ };
2091
2099
  this.svAPIEndpoint =
2092
2100
  !options?.env || options?.env == "production"
2093
2101
  ? "https://sv.api.repzo.me"
@@ -15780,6 +15780,9 @@ export declare namespace Service {
15780
15780
  done_workorders: number;
15781
15781
  inprogress_workorders: number;
15782
15782
  overdue_workorders: number;
15783
+ open_workorders: number;
15784
+ onhold_workorders: number;
15785
+ cancelled_workorders: number;
15783
15786
  }
15784
15787
  namespace Find {
15785
15788
  type Params = DefaultPaginationQueryParams & {
@@ -16376,6 +16379,33 @@ export declare namespace Service {
16376
16379
  type Result = Data;
16377
16380
  }
16378
16381
  }
16382
+ namespace SafeCrud {
16383
+ interface Body {
16384
+ collection: "company";
16385
+ filters?: {
16386
+ [key: string]: any;
16387
+ };
16388
+ }
16389
+ interface CompanyBody extends Body {
16390
+ collection: "company";
16391
+ filters?: {
16392
+ name_space?: string | string[];
16393
+ };
16394
+ }
16395
+ interface CompanyResult {
16396
+ _id: StringId;
16397
+ name_space: string;
16398
+ allow_treating_invoice_as_proforma_for_etax?: boolean;
16399
+ }
16400
+ type Data = CompanyResult;
16401
+ export namespace Create {
16402
+ type Body = CompanyBody;
16403
+ interface Result extends DefaultPaginationResult {
16404
+ data: Data[];
16405
+ }
16406
+ }
16407
+ export {};
16408
+ }
16379
16409
  }
16380
16410
  export type StringId = string;
16381
16411
  export type NameSpaces = string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.185",
3
+ "version": "1.0.187",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
package/src/index.ts CHANGED
@@ -112,6 +112,7 @@ export const end_points = {
112
112
  REPORT_COLUMN: "report-column",
113
113
  REPORT_SORT: "report-sort",
114
114
  REPORT_FILTER: "report-filter",
115
+ SAFE_CRUD: "safe-crud",
115
116
  } as const;
116
117
  export type EndPoints = (typeof end_points)[keyof typeof end_points];
117
118
 
@@ -5327,6 +5328,20 @@ export default class Repzo {
5327
5328
  return res;
5328
5329
  },
5329
5330
  };
5331
+
5332
+ safeCrud = {
5333
+ _path: Repzo._end_points.SAFE_CRUD,
5334
+ create: async (
5335
+ body: Service.SafeCrud.Create.Body,
5336
+ ): Promise<Service.SafeCrud.Create.Result> => {
5337
+ let res = await this._create(
5338
+ this.svAPIEndpoint,
5339
+ this.safeCrud._path,
5340
+ body,
5341
+ );
5342
+ return res;
5343
+ },
5344
+ };
5330
5345
  }
5331
5346
 
5332
5347
  function normalizeParams(params: Params): { [key: string]: any } {
@@ -17832,6 +17832,9 @@ export namespace Service {
17832
17832
  done_workorders: number;
17833
17833
  inprogress_workorders: number;
17834
17834
  overdue_workorders: number;
17835
+ open_workorders: number;
17836
+ onhold_workorders: number;
17837
+ cancelled_workorders: number;
17835
17838
  }
17836
17839
 
17837
17840
  export namespace Find {
@@ -18541,6 +18544,29 @@ export namespace Service {
18541
18544
  export type Result = Data;
18542
18545
  }
18543
18546
  }
18547
+
18548
+ export namespace SafeCrud {
18549
+ interface Body {
18550
+ collection: "company";
18551
+ filters?: { [key: string]: any };
18552
+ }
18553
+ interface CompanyBody extends Body {
18554
+ collection: "company";
18555
+ filters?: { name_space?: string | string[] };
18556
+ }
18557
+ interface CompanyResult {
18558
+ _id: StringId;
18559
+ name_space: string;
18560
+ allow_treating_invoice_as_proforma_for_etax?: boolean;
18561
+ }
18562
+ type Data = CompanyResult;
18563
+ export namespace Create {
18564
+ export type Body = CompanyBody;
18565
+ export interface Result extends DefaultPaginationResult {
18566
+ data: Data[];
18567
+ }
18568
+ }
18569
+ }
18544
18570
  }
18545
18571
 
18546
18572
  export type StringId = string;