repzo 1.0.168 → 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 +10 -2
- package/lib/index.js +36 -0
- package/lib/types/index.d.ts +16 -9
- package/package.json +1 -1
- package/src/index.ts +55 -0
- package/src/types/index.ts +14 -5
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 =
|
|
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 =
|
|
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;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -14061,7 +14061,7 @@ export declare namespace Service {
|
|
|
14061
14061
|
}[];
|
|
14062
14062
|
}
|
|
14063
14063
|
export const fieldType_enums: readonly ["Text", "String", "Phone", "Email", "Date", "Number", "List", "Separator", "Heading", "Media", "Signature", "DateTime", "YesNo", "ProductBarcodeScan", "BarcodeScan", "GeoPoint"];
|
|
14064
|
-
export type FormV2FieldType =
|
|
14064
|
+
export type FormV2FieldType = typeof fieldType_enums[number];
|
|
14065
14065
|
interface FieldPrintSettings {
|
|
14066
14066
|
three_inch: {
|
|
14067
14067
|
grid_column?: 1 | 2;
|
|
@@ -14203,7 +14203,7 @@ export declare namespace Service {
|
|
|
14203
14203
|
}
|
|
14204
14204
|
namespace ActivityFormV2Result {
|
|
14205
14205
|
const fieldType_enums: readonly ["Text", "String", "Phone", "Email", "Date", "Number", "List", "Separator", "Heading", "Media", "Signature", "DateTime", "YesNo", "ProductBarcodeScan", "BarcodeScan", "GeoPoint"];
|
|
14206
|
-
type FormV2FieldType =
|
|
14206
|
+
type FormV2FieldType = typeof fieldType_enums[number];
|
|
14207
14207
|
interface FieldResult {
|
|
14208
14208
|
_id?: string;
|
|
14209
14209
|
field_id: string;
|
|
@@ -14478,7 +14478,7 @@ export declare namespace Service {
|
|
|
14478
14478
|
}
|
|
14479
14479
|
namespace TimelineReport {
|
|
14480
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"];
|
|
14481
|
-
type ActivityType =
|
|
14481
|
+
type ActivityType = typeof activity_types[number];
|
|
14482
14482
|
export interface Data {
|
|
14483
14483
|
_id: StringId;
|
|
14484
14484
|
company_namespace: string[];
|
|
@@ -15090,7 +15090,6 @@ export declare namespace Service {
|
|
|
15090
15090
|
export interface CreateBody {
|
|
15091
15091
|
creator?: Admin;
|
|
15092
15092
|
nameSpace: string;
|
|
15093
|
-
company_namespace: string[];
|
|
15094
15093
|
services: ServiceOptionMap;
|
|
15095
15094
|
is_test_reset?: boolean;
|
|
15096
15095
|
}
|
|
@@ -15129,14 +15128,12 @@ export declare namespace Service {
|
|
|
15129
15128
|
field: "_id" | "status";
|
|
15130
15129
|
type: "asc" | "desc";
|
|
15131
15130
|
}[];
|
|
15132
|
-
options?: boolean;
|
|
15133
15131
|
};
|
|
15134
|
-
interface
|
|
15132
|
+
interface Result extends DefaultPaginationResult {
|
|
15135
15133
|
data: (Data & {
|
|
15136
15134
|
expired?: boolean;
|
|
15137
15135
|
})[];
|
|
15138
15136
|
}
|
|
15139
|
-
type Result = PaginatedResult | ServiceOptionMap;
|
|
15140
15137
|
}
|
|
15141
15138
|
export namespace Get {
|
|
15142
15139
|
type ID = string;
|
|
@@ -15155,9 +15152,19 @@ export declare namespace Service {
|
|
|
15155
15152
|
type ID = string;
|
|
15156
15153
|
type Result = Data;
|
|
15157
15154
|
}
|
|
15155
|
+
export namespace Options {
|
|
15156
|
+
type Params = {
|
|
15157
|
+
options: true;
|
|
15158
|
+
};
|
|
15159
|
+
type Result = ServiceOptionMap;
|
|
15160
|
+
}
|
|
15158
15161
|
export {};
|
|
15159
15162
|
}
|
|
15160
15163
|
namespace TestResetCompanyNamespace {
|
|
15164
|
+
namespace Options {
|
|
15165
|
+
type Params = ResetCompanyNamespace.Options.Params;
|
|
15166
|
+
type Result = ResetCompanyNamespace.Options.Result;
|
|
15167
|
+
}
|
|
15161
15168
|
namespace Find {
|
|
15162
15169
|
type Params = ResetCompanyNamespace.Find.Params;
|
|
15163
15170
|
type Result = ResetCompanyNamespace.Find.Result;
|
|
@@ -15168,7 +15175,7 @@ export declare namespace Service {
|
|
|
15168
15175
|
type Result = ResetCompanyNamespace.Get.Result;
|
|
15169
15176
|
}
|
|
15170
15177
|
namespace Create {
|
|
15171
|
-
type Body = ResetCompanyNamespace.Create.Body
|
|
15178
|
+
type Body = Omit<ResetCompanyNamespace.Create.Body, "is_test_reset">;
|
|
15172
15179
|
type Result = ResetCompanyNamespace.Create.Result;
|
|
15173
15180
|
}
|
|
15174
15181
|
namespace Update {
|
|
@@ -15178,7 +15185,7 @@ export declare namespace Service {
|
|
|
15178
15185
|
}
|
|
15179
15186
|
namespace TimelineTimeList {
|
|
15180
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"];
|
|
15181
|
-
type ActivityType =
|
|
15188
|
+
type ActivityType = typeof activity_types[number];
|
|
15182
15189
|
export interface Data {
|
|
15183
15190
|
_id: StringId;
|
|
15184
15191
|
company_namespace: string[];
|
package/package.json
CHANGED
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> => {
|
package/src/types/index.ts
CHANGED
|
@@ -16733,7 +16733,7 @@ export namespace Service {
|
|
|
16733
16733
|
export interface CreateBody {
|
|
16734
16734
|
creator?: Admin;
|
|
16735
16735
|
nameSpace: string;
|
|
16736
|
-
company_namespace: string[];
|
|
16736
|
+
// company_namespace: string[];
|
|
16737
16737
|
services: ServiceOptionMap;
|
|
16738
16738
|
is_test_reset?: boolean;
|
|
16739
16739
|
}
|
|
@@ -16773,12 +16773,10 @@ export namespace Service {
|
|
|
16773
16773
|
field: "_id" | "status";
|
|
16774
16774
|
type: "asc" | "desc";
|
|
16775
16775
|
}[];
|
|
16776
|
-
options?: boolean;
|
|
16777
16776
|
};
|
|
16778
|
-
export interface
|
|
16777
|
+
export interface Result extends DefaultPaginationResult {
|
|
16779
16778
|
data: (Data & { expired?: boolean })[];
|
|
16780
16779
|
}
|
|
16781
|
-
export type Result = PaginatedResult | ServiceOptionMap;
|
|
16782
16780
|
}
|
|
16783
16781
|
export namespace Get {
|
|
16784
16782
|
export type ID = string;
|
|
@@ -16793,9 +16791,17 @@ export namespace Service {
|
|
|
16793
16791
|
export type ID = string;
|
|
16794
16792
|
export type Result = Data;
|
|
16795
16793
|
}
|
|
16794
|
+
export namespace Options {
|
|
16795
|
+
export type Params = { options: true };
|
|
16796
|
+
export type Result = ServiceOptionMap;
|
|
16797
|
+
}
|
|
16796
16798
|
}
|
|
16797
16799
|
|
|
16798
16800
|
export namespace TestResetCompanyNamespace {
|
|
16801
|
+
export namespace Options {
|
|
16802
|
+
export type Params = ResetCompanyNamespace.Options.Params;
|
|
16803
|
+
export type Result = ResetCompanyNamespace.Options.Result;
|
|
16804
|
+
}
|
|
16799
16805
|
export namespace Find {
|
|
16800
16806
|
export type Params = ResetCompanyNamespace.Find.Params;
|
|
16801
16807
|
export type Result = ResetCompanyNamespace.Find.Result;
|
|
@@ -16806,7 +16812,10 @@ export namespace Service {
|
|
|
16806
16812
|
export type Result = ResetCompanyNamespace.Get.Result;
|
|
16807
16813
|
}
|
|
16808
16814
|
export namespace Create {
|
|
16809
|
-
export type Body =
|
|
16815
|
+
export type Body = Omit<
|
|
16816
|
+
ResetCompanyNamespace.Create.Body,
|
|
16817
|
+
"is_test_reset"
|
|
16818
|
+
>;
|
|
16810
16819
|
export type Result = ResetCompanyNamespace.Create.Result;
|
|
16811
16820
|
}
|
|
16812
16821
|
export namespace Update {
|