repzo 1.0.167 → 1.0.169

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
@@ -96,9 +96,9 @@ export declare const end_points: {
96
96
  readonly WORKORDER_AGENDA: "workorder-agenda";
97
97
  readonly MODULE_CUSTOM_VALIDATOR: "module-custom-validator";
98
98
  };
99
- export type EndPoints = (typeof end_points)[keyof typeof end_points];
99
+ export type EndPoints = typeof end_points[keyof typeof end_points];
100
100
  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"];
101
- export type AvailableService = (typeof availableService)[number];
101
+ export type AvailableService = typeof availableService[number];
102
102
  export default class Repzo {
103
103
  private svAPIEndpoint;
104
104
  headers: Headers;
@@ -924,6 +924,7 @@ export default class Repzo {
924
924
  };
925
925
  resetCompanyNamespace: {
926
926
  _path: "reset-company-namespace";
927
+ options: () => Promise<Service.ResetCompanyNamespace.Options.Result>;
927
928
  find: (params?: Service.ResetCompanyNamespace.Find.Params) => Promise<Service.ResetCompanyNamespace.Find.Result>;
928
929
  get: (id: Service.ResetCompanyNamespace.Get.ID, params?: Service.ResetCompanyNamespace.Get.Params) => Promise<Service.ResetCompanyNamespace.Get.Result>;
929
930
  create: (body: Service.ResetCompanyNamespace.Create.Body) => Promise<Service.ResetCompanyNamespace.Create.Result>;
@@ -931,6 +932,13 @@ export default class Repzo {
931
932
  };
932
933
  testResetCompanyNamespace: {
933
934
  _path: "test-reset-company-namespace";
935
+ reset: ({ nameSpace, services, }: {
936
+ nameSpace: string;
937
+ services: {
938
+ [key: string]: boolean;
939
+ }[];
940
+ }) => Promise<Service.TestResetCompanyNamespace.Create.Result>;
941
+ options: () => Promise<Service.TestResetCompanyNamespace.Options.Result>;
934
942
  find: (params?: Service.TestResetCompanyNamespace.Find.Params) => Promise<Service.TestResetCompanyNamespace.Find.Result>;
935
943
  get: (id: Service.TestResetCompanyNamespace.Get.ID, params?: Service.TestResetCompanyNamespace.Get.Params) => Promise<Service.TestResetCompanyNamespace.Get.Result>;
936
944
  create: (body: Service.TestResetCompanyNamespace.Create.Body) => Promise<Service.TestResetCompanyNamespace.Create.Result>;
package/lib/index.js CHANGED
@@ -1858,6 +1858,13 @@ class Repzo {
1858
1858
  };
1859
1859
  this.resetCompanyNamespace = {
1860
1860
  _path: Repzo._end_points.RESET_COMPANY_NAMESPACE,
1861
+ options: async () => {
1862
+ const params = {
1863
+ options: true,
1864
+ };
1865
+ let res = await this._fetch(this.svAPIEndpoint, this.resetCompanyNamespace._path, params);
1866
+ return res;
1867
+ },
1861
1868
  find: async (params) => {
1862
1869
  let res = await this._fetch(this.svAPIEndpoint, this.resetCompanyNamespace._path, params);
1863
1870
  return res;
@@ -1876,6 +1883,35 @@ class Repzo {
1876
1883
  };
1877
1884
  this.testResetCompanyNamespace = {
1878
1885
  _path: Repzo._end_points.TEST_RESET_COMPANY_NAMESPACE,
1886
+ reset: async ({ nameSpace, services, }) => {
1887
+ try {
1888
+ const repzo_services = await this.testResetCompanyNamespace.options();
1889
+ for (let service in repzo_services) {
1890
+ const repzo_service = service;
1891
+ const match = services.find((s) => s[repzo_service]);
1892
+ if (match) {
1893
+ repzo_services[repzo_service].checked = match[repzo_service];
1894
+ }
1895
+ repzo_services[repzo_service].checked = true;
1896
+ }
1897
+ const body = {
1898
+ nameSpace,
1899
+ services: repzo_services,
1900
+ };
1901
+ return await this.testResetCompanyNamespace.create(body);
1902
+ }
1903
+ catch (e) {
1904
+ console.error(e);
1905
+ throw e;
1906
+ }
1907
+ },
1908
+ options: async () => {
1909
+ const params = {
1910
+ options: true,
1911
+ };
1912
+ let res = await this._fetch(this.svAPIEndpoint, this.testResetCompanyNamespace._path, params);
1913
+ return res;
1914
+ },
1879
1915
  find: async (params) => {
1880
1916
  let res = await this._fetch(this.svAPIEndpoint, this.testResetCompanyNamespace._path, params);
1881
1917
  return res;
@@ -1774,6 +1774,8 @@ export declare namespace Service {
1774
1774
  from_time?: number;
1775
1775
  to_time?: number;
1776
1776
  parentDocumentId?: string[] | string;
1777
+ type_name?: "FileAttachment" | "ImageAttachment";
1778
+ media_type?: MediaType | MediaType[];
1777
1779
  sortBy?: {
1778
1780
  field: "_id";
1779
1781
  type: "asc" | "desc";
@@ -14059,7 +14061,7 @@ export declare namespace Service {
14059
14061
  }[];
14060
14062
  }
14061
14063
  export const fieldType_enums: readonly ["Text", "String", "Phone", "Email", "Date", "Number", "List", "Separator", "Heading", "Media", "Signature", "DateTime", "YesNo", "ProductBarcodeScan", "BarcodeScan", "GeoPoint"];
14062
- export type FormV2FieldType = (typeof fieldType_enums)[number];
14064
+ export type FormV2FieldType = typeof fieldType_enums[number];
14063
14065
  interface FieldPrintSettings {
14064
14066
  three_inch: {
14065
14067
  grid_column?: 1 | 2;
@@ -14201,7 +14203,7 @@ export declare namespace Service {
14201
14203
  }
14202
14204
  namespace ActivityFormV2Result {
14203
14205
  const fieldType_enums: readonly ["Text", "String", "Phone", "Email", "Date", "Number", "List", "Separator", "Heading", "Media", "Signature", "DateTime", "YesNo", "ProductBarcodeScan", "BarcodeScan", "GeoPoint"];
14204
- type FormV2FieldType = (typeof fieldType_enums)[number];
14206
+ type FormV2FieldType = typeof fieldType_enums[number];
14205
14207
  interface FieldResult {
14206
14208
  _id?: string;
14207
14209
  field_id: string;
@@ -14476,7 +14478,7 @@ export declare namespace Service {
14476
14478
  }
14477
14479
  namespace TimelineReport {
14478
14480
  export const activity_types: readonly ["day", "client", "visit", "payment", "activity-photo", "activity-audit", "activity-availability", "activity-checkout-display", "activity-feedback", "activity-form-result", "activity-form-v2-result", "activity-item-status", "activity-note", "activity-planogram", "activity-secondary-display", "activity-shelfshare", "activity-storecheck", "activity-task", "approval-request", "asset-part-receival", "asset-part-transfer", "asset", "asset-part", "asset-unit", "reminders", "return-asset-part-unit", "store-asset-part-unit", "refund", "settlement", "convert-proforma", "transfer", "proforma", "receiving-material", "void-invoice", "fullinvoices", "workorder", "workorder-request", "return-whole-invoice", "cycle"];
14479
- type ActivityType = (typeof activity_types)[number];
14481
+ type ActivityType = typeof activity_types[number];
14480
14482
  export interface Data {
14481
14483
  _id: StringId;
14482
14484
  company_namespace: string[];
@@ -15088,7 +15090,6 @@ export declare namespace Service {
15088
15090
  export interface CreateBody {
15089
15091
  creator?: Admin;
15090
15092
  nameSpace: string;
15091
- company_namespace: string[];
15092
15093
  services: ServiceOptionMap;
15093
15094
  is_test_reset?: boolean;
15094
15095
  }
@@ -15127,14 +15128,12 @@ export declare namespace Service {
15127
15128
  field: "_id" | "status";
15128
15129
  type: "asc" | "desc";
15129
15130
  }[];
15130
- options?: boolean;
15131
15131
  };
15132
- interface PaginatedResult extends DefaultPaginationResult {
15132
+ interface Result extends DefaultPaginationResult {
15133
15133
  data: (Data & {
15134
15134
  expired?: boolean;
15135
15135
  })[];
15136
15136
  }
15137
- type Result = PaginatedResult | ServiceOptionMap;
15138
15137
  }
15139
15138
  export namespace Get {
15140
15139
  type ID = string;
@@ -15153,9 +15152,19 @@ export declare namespace Service {
15153
15152
  type ID = string;
15154
15153
  type Result = Data;
15155
15154
  }
15155
+ export namespace Options {
15156
+ type Params = {
15157
+ options: true;
15158
+ };
15159
+ type Result = ServiceOptionMap;
15160
+ }
15156
15161
  export {};
15157
15162
  }
15158
15163
  namespace TestResetCompanyNamespace {
15164
+ namespace Options {
15165
+ type Params = ResetCompanyNamespace.Options.Params;
15166
+ type Result = ResetCompanyNamespace.Options.Result;
15167
+ }
15159
15168
  namespace Find {
15160
15169
  type Params = ResetCompanyNamespace.Find.Params;
15161
15170
  type Result = ResetCompanyNamespace.Find.Result;
@@ -15166,7 +15175,7 @@ export declare namespace Service {
15166
15175
  type Result = ResetCompanyNamespace.Get.Result;
15167
15176
  }
15168
15177
  namespace Create {
15169
- type Body = ResetCompanyNamespace.Create.Body;
15178
+ type Body = Omit<ResetCompanyNamespace.Create.Body, "is_test_reset">;
15170
15179
  type Result = ResetCompanyNamespace.Create.Result;
15171
15180
  }
15172
15181
  namespace Update {
@@ -15176,7 +15185,7 @@ export declare namespace Service {
15176
15185
  }
15177
15186
  namespace TimelineTimeList {
15178
15187
  export const activity_types: readonly ["day", "client", "visit", "payment", "activity-photo", "activity-audit", "activity-availability", "activity-checkout-display", "activity-feedback", "activity-form-result", "activity-form-v2-result", "activity-item-status", "activity-note", "activity-planogram", "activity-secondary-display", "activity-shelfshare", "activity-storecheck", "activity-task", "approval-request", "asset-part-receival", "asset-part-transfer", "asset", "asset-part", "asset-unit", "reminders", "return-asset-part-unit", "store-asset-part-unit", "refund", "settlement", "convert-proforma", "transfer", "proforma", "receiving-material", "void-invoice", "fullinvoices", "workorder", "workorder-request", "return-whole-invoice", "cycle"];
15179
- type ActivityType = (typeof activity_types)[number];
15188
+ type ActivityType = typeof activity_types[number];
15180
15189
  export interface Data {
15181
15190
  _id: StringId;
15182
15191
  company_namespace: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.167",
3
+ "version": "1.0.169",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
package/src/index.ts CHANGED
@@ -4781,6 +4781,19 @@ export default class Repzo {
4781
4781
 
4782
4782
  resetCompanyNamespace = {
4783
4783
  _path: Repzo._end_points.RESET_COMPANY_NAMESPACE,
4784
+ options:
4785
+ async (): Promise<Service.ResetCompanyNamespace.Options.Result> => {
4786
+ const params: Service.ResetCompanyNamespace.Options.Params = {
4787
+ options: true,
4788
+ };
4789
+ let res: Service.ResetCompanyNamespace.Options.Result =
4790
+ await this._fetch(
4791
+ this.svAPIEndpoint,
4792
+ this.resetCompanyNamespace._path,
4793
+ params,
4794
+ );
4795
+ return res;
4796
+ },
4784
4797
  find: async (
4785
4798
  params?: Service.ResetCompanyNamespace.Find.Params,
4786
4799
  ): Promise<Service.ResetCompanyNamespace.Find.Result> => {
@@ -4825,6 +4838,48 @@ export default class Repzo {
4825
4838
 
4826
4839
  testResetCompanyNamespace = {
4827
4840
  _path: Repzo._end_points.TEST_RESET_COMPANY_NAMESPACE,
4841
+ reset: async ({
4842
+ nameSpace,
4843
+ services,
4844
+ }: {
4845
+ nameSpace: string;
4846
+ services: { [key: string]: boolean }[];
4847
+ }): Promise<Service.TestResetCompanyNamespace.Create.Result> => {
4848
+ try {
4849
+ const repzo_services = await this.testResetCompanyNamespace.options();
4850
+ for (let service in repzo_services) {
4851
+ const repzo_service =
4852
+ service as Service.ResetCompanyNamespace.Services;
4853
+ const match = services.find((s) => s[repzo_service]);
4854
+ if (match) {
4855
+ repzo_services[repzo_service].checked = match[repzo_service];
4856
+ }
4857
+ repzo_services[repzo_service].checked = true;
4858
+ }
4859
+ const body: Service.TestResetCompanyNamespace.Create.Body = {
4860
+ nameSpace,
4861
+ services: repzo_services,
4862
+ };
4863
+ return await this.testResetCompanyNamespace.create(body);
4864
+ } catch (e) {
4865
+ console.error(e);
4866
+ throw e;
4867
+ }
4868
+ },
4869
+
4870
+ options:
4871
+ async (): Promise<Service.TestResetCompanyNamespace.Options.Result> => {
4872
+ const params: Service.TestResetCompanyNamespace.Options.Params = {
4873
+ options: true,
4874
+ };
4875
+ let res: Service.TestResetCompanyNamespace.Options.Result =
4876
+ await this._fetch(
4877
+ this.svAPIEndpoint,
4878
+ this.testResetCompanyNamespace._path,
4879
+ params,
4880
+ );
4881
+ return res;
4882
+ },
4828
4883
  find: async (
4829
4884
  params?: Service.TestResetCompanyNamespace.Find.Params,
4830
4885
  ): Promise<Service.TestResetCompanyNamespace.Find.Result> => {
@@ -2111,6 +2111,8 @@ export namespace Service {
2111
2111
  from_time?: number;
2112
2112
  to_time?: number;
2113
2113
  parentDocumentId?: string[] | string;
2114
+ type_name?: "FileAttachment" | "ImageAttachment";
2115
+ media_type?: MediaType | MediaType[];
2114
2116
  sortBy?: {
2115
2117
  field: "_id";
2116
2118
  type: "asc" | "desc";
@@ -16731,7 +16733,7 @@ export namespace Service {
16731
16733
  export interface CreateBody {
16732
16734
  creator?: Admin;
16733
16735
  nameSpace: string;
16734
- company_namespace: string[];
16736
+ // company_namespace: string[];
16735
16737
  services: ServiceOptionMap;
16736
16738
  is_test_reset?: boolean;
16737
16739
  }
@@ -16771,12 +16773,10 @@ export namespace Service {
16771
16773
  field: "_id" | "status";
16772
16774
  type: "asc" | "desc";
16773
16775
  }[];
16774
- options?: boolean;
16775
16776
  };
16776
- export interface PaginatedResult extends DefaultPaginationResult {
16777
+ export interface Result extends DefaultPaginationResult {
16777
16778
  data: (Data & { expired?: boolean })[];
16778
16779
  }
16779
- export type Result = PaginatedResult | ServiceOptionMap;
16780
16780
  }
16781
16781
  export namespace Get {
16782
16782
  export type ID = string;
@@ -16791,9 +16791,17 @@ export namespace Service {
16791
16791
  export type ID = string;
16792
16792
  export type Result = Data;
16793
16793
  }
16794
+ export namespace Options {
16795
+ export type Params = { options: true };
16796
+ export type Result = ServiceOptionMap;
16797
+ }
16794
16798
  }
16795
16799
 
16796
16800
  export namespace TestResetCompanyNamespace {
16801
+ export namespace Options {
16802
+ export type Params = ResetCompanyNamespace.Options.Params;
16803
+ export type Result = ResetCompanyNamespace.Options.Result;
16804
+ }
16797
16805
  export namespace Find {
16798
16806
  export type Params = ResetCompanyNamespace.Find.Params;
16799
16807
  export type Result = ResetCompanyNamespace.Find.Result;
@@ -16804,7 +16812,10 @@ export namespace Service {
16804
16812
  export type Result = ResetCompanyNamespace.Get.Result;
16805
16813
  }
16806
16814
  export namespace Create {
16807
- export type Body = ResetCompanyNamespace.Create.Body;
16815
+ export type Body = Omit<
16816
+ ResetCompanyNamespace.Create.Body,
16817
+ "is_test_reset"
16818
+ >;
16808
16819
  export type Result = ResetCompanyNamespace.Create.Result;
16809
16820
  }
16810
16821
  export namespace Update {