repzo 1.0.275 → 1.0.277

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
@@ -136,9 +136,11 @@ export declare const end_points: {
136
136
  readonly ADMIN: "admin";
137
137
  readonly JOB_CATEGORY: "job-category";
138
138
  readonly JOB_CATEGORY_AUTOSKIP_ANALYZE: "job-category-autoskip-analyze";
139
+ readonly VISIT_REASON: "visit-reason";
140
+ readonly BULK_IMPORT: "bulk-import";
139
141
  };
140
142
  export type EndPoints = (typeof end_points)[keyof typeof end_points];
141
- 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", "voidSettlement", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "activityItemStatus", "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", "clmPresentation", "clmSequence", "clmSlide", "clmFetch", "pdfMergeField"];
143
+ 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", "voidSettlement", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "activityItemStatus", "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", "clmPresentation", "clmSequence", "clmSlide", "clmFetch", "pdfMergeField", "visitReason"];
142
144
  export type AvailableService = (typeof availableService)[number];
143
145
  export default class Repzo {
144
146
  private svAPIEndpoint;
@@ -287,6 +289,8 @@ export default class Repzo {
287
289
  readonly ADMIN: "admin";
288
290
  readonly JOB_CATEGORY: "job-category";
289
291
  readonly JOB_CATEGORY_AUTOSKIP_ANALYZE: "job-category-autoskip-analyze";
292
+ readonly VISIT_REASON: "visit-reason";
293
+ readonly BULK_IMPORT: "bulk-import";
290
294
  };
291
295
  private _retryRequest;
292
296
  private _fetch;
@@ -294,7 +298,7 @@ export default class Repzo {
294
298
  private _update;
295
299
  private _patch;
296
300
  private _delete;
297
- available_services: 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", "voidSettlement", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "activityItemStatus", "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", "clmPresentation", "clmSequence", "clmSlide", "clmFetch", "pdfMergeField"];
301
+ available_services: 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", "voidSettlement", "check", "day", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "activityItemStatus", "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", "clmPresentation", "clmSequence", "clmSlide", "clmFetch", "pdfMergeField", "visitReason"];
298
302
  generateUUID: ({ prefix, suffix, length, }: {
299
303
  prefix?: string;
300
304
  suffix?: string;
@@ -1334,4 +1338,19 @@ export default class Repzo {
1334
1338
  _path: "job-category-autoskip-analyze";
1335
1339
  create: (body: Service.JobCategoryAutoSkipAnalyze.Create.Body) => Promise<Service.JobCategoryAutoSkipAnalyze.Create.Result>;
1336
1340
  };
1341
+ visitReason: {
1342
+ _path: "visit-reason";
1343
+ find: (params?: Service.VisitReason.Find.Params) => Promise<Service.VisitReason.Find.Result>;
1344
+ get: (id: Service.VisitReason.Get.ID) => Promise<Service.VisitReason.Get.Result>;
1345
+ create: (body: Service.VisitReason.Create.Body) => Promise<Service.VisitReason.Create.Result>;
1346
+ update: (id: Service.VisitReason.Update.ID, body: Service.VisitReason.Update.Body) => Promise<Service.VisitReason.Update.Result>;
1347
+ remove: (id: Service.VisitReason.Remove.ID) => Promise<Service.VisitReason.Remove.Result>;
1348
+ };
1349
+ bulkImport: {
1350
+ _path: "bulk-import";
1351
+ find: (params?: Service.BulkImport.Find.Params) => Promise<Service.BulkImport.Find.Result>;
1352
+ get: (id: Service.BulkImport.Get.ID) => Promise<Service.BulkImport.Get.Result>;
1353
+ create: (params: Service.BulkImport.Create.Params, body: Service.BulkImport.Create.Body) => Promise<Service.BulkImport.Create.Result>;
1354
+ update: (id: Service.BulkImport.Update.ID) => Promise<Service.BulkImport.Update.Result>;
1355
+ };
1337
1356
  }
package/lib/index.js CHANGED
@@ -138,6 +138,8 @@ export const end_points = {
138
138
  ADMIN: "admin",
139
139
  JOB_CATEGORY: "job-category",
140
140
  JOB_CATEGORY_AUTOSKIP_ANALYZE: "job-category-autoskip-analyze",
141
+ VISIT_REASON: "visit-reason",
142
+ BULK_IMPORT: "bulk-import",
141
143
  };
142
144
  export const availableService = [
143
145
  "client",
@@ -235,6 +237,7 @@ export const availableService = [
235
237
  "clmSlide",
236
238
  "clmFetch",
237
239
  "pdfMergeField",
240
+ "visitReason",
238
241
  ];
239
242
  class Repzo {
240
243
  constructor(apiKey, options) {
@@ -2770,6 +2773,46 @@ class Repzo {
2770
2773
  return res;
2771
2774
  },
2772
2775
  };
2776
+ this.visitReason = {
2777
+ _path: Repzo._end_points.VISIT_REASON,
2778
+ find: async (params) => {
2779
+ let res = await this._fetch(this.svAPIEndpoint, this.visitReason._path, params);
2780
+ return res;
2781
+ },
2782
+ get: async (id) => {
2783
+ return await this._fetch(this.svAPIEndpoint, this.visitReason._path + `/${id}`);
2784
+ },
2785
+ create: async (body) => {
2786
+ let res = await this._create(this.svAPIEndpoint, this.visitReason._path, body);
2787
+ return res;
2788
+ },
2789
+ update: async (id, body) => {
2790
+ let res = await this._update(this.svAPIEndpoint, this.visitReason._path + `/${id}`, body);
2791
+ return res;
2792
+ },
2793
+ remove: async (id) => {
2794
+ let res = await this._delete(this.svAPIEndpoint, this.visitReason._path + `/${id}`);
2795
+ return res;
2796
+ },
2797
+ };
2798
+ this.bulkImport = {
2799
+ _path: Repzo._end_points.BULK_IMPORT,
2800
+ find: async (params) => {
2801
+ let res = await this._fetch(this.svAPIEndpoint, this.bulkImport._path, params);
2802
+ return res;
2803
+ },
2804
+ get: async (id) => {
2805
+ return await this._fetch(this.svAPIEndpoint, this.bulkImport._path + `/${id}`);
2806
+ },
2807
+ create: async (params, body) => {
2808
+ let res = await this._create(this.svAPIEndpoint, this.bulkImport._path, body, params);
2809
+ return res;
2810
+ },
2811
+ update: async (id) => {
2812
+ let res = await this._update(this.svAPIEndpoint, this.bulkImport._path + `/${id}`, {});
2813
+ return res;
2814
+ },
2815
+ };
2773
2816
  this.svAPIEndpoint =
2774
2817
  !options?.env || options?.env == "production"
2775
2818
  ? "https://sv.api.repzo.me"
@@ -2951,6 +2951,7 @@ export declare namespace Service {
2951
2951
  skip_if_calendar_day_is_more_than?: number;
2952
2952
  enable_auto_skip_activity_existence?: boolean;
2953
2953
  auto_skip_activity_slugs?: AutoSkipActivitySlugs[];
2954
+ auto_skip_activity_slugs_operator?: "and" | "or";
2954
2955
  };
2955
2956
  createdAt: string;
2956
2957
  updatedAt: string;
@@ -4569,6 +4570,8 @@ export declare namespace Service {
4569
4570
  extra?: {};
4570
4571
  };
4571
4572
  delayed?: boolean;
4573
+ visit_reason?: StringId;
4574
+ visit_note?: string;
4572
4575
  createdAt: Date;
4573
4576
  updatedAt: Date;
4574
4577
  }
@@ -4796,8 +4799,9 @@ export declare namespace Service {
4796
4799
  user?: string | Rep.RepSchema;
4797
4800
  client?: string | Client.ClientSchema;
4798
4801
  route?: string | Route.RouteSchema;
4802
+ visit_reason?: StringId | Pick<VisitReason.Data, "_id" | "name">;
4799
4803
  };
4800
- export type PopulatedKeys = "notes" | "tasks" | "photos" | "forms" | "audits" | "tags" | "availability" | "teams" | "client" | "user" | "route";
4804
+ export type PopulatedKeys = "notes" | "tasks" | "photos" | "forms" | "audits" | "tags" | "availability" | "teams" | "client" | "user" | "route" | "visit_reason";
4801
4805
  export namespace Find {
4802
4806
  type Params = DefaultPaginationQueryParams & {
4803
4807
  user?: string;
@@ -4818,6 +4822,7 @@ export declare namespace Service {
4818
4822
  from_updatedAt?: number;
4819
4823
  from__id?: string;
4820
4824
  to__id?: string;
4825
+ visit_reason?: StringId | StringId[];
4821
4826
  [key: string]: any;
4822
4827
  populatedKeys?: PopulatedKeys[];
4823
4828
  sortBy?: {
@@ -15099,7 +15104,8 @@ export declare namespace Service {
15099
15104
  activities: (ActivityAuditVisitDetails | ActivityPhotoVisitDetails | ActivityAvailabilityVisitDetails | ActivityNoteVisitDetails | ActivityTaskVisitDetails | ActivityPlanogramVisitDetails | ActivityShelfshareVisitDetails | ActivitySecondaryDisplayVisitDetails | ActivityCheckoutDisplayVisitDetails | ActivityItemStatusVisitDetails | ActivityFormResultVisitDetails | ActivityFormV2ResultVisitDetails | ActivityStorecheckVisitDetails | ActivityFeedbackVisitDetails | ApprovalRequestVisitDetails | AssetPartReceivalVisitDetails | AssetPartTransferVisitDetails | ReturnAssetPartUnitVisitDetails | StoreAssetPartUnitVisitDetails | PaymentVisitDetails | RefundVisitDetails | ConvertProformaVisitDetails | FullInvoiceVisitDetails | ProformaVisitDetails | ReturnWholeInvoiceVisitDetails | VoidInvoiceVisitDetails | CLMFeedbackActivityVisitDetails)[];
15100
15105
  feed_back_option?: StringId;
15101
15106
  feed_back_option_label?: string;
15102
- } & Pick<Visit.Data, "closed_by_system" | "geoPoint" | "start_time" | "end_time" | "total_time" | "start_out_of_geofence" | "end_out_of_geofence" | "auto_closed_by_geofence" | "auto_closed_by_geofence_reason" | "client_geo_location" | "delta_distance">;
15107
+ visit_reason_name?: string;
15108
+ } & Pick<Visit.Data, "closed_by_system" | "geoPoint" | "start_time" | "end_time" | "total_time" | "start_out_of_geofence" | "end_out_of_geofence" | "auto_closed_by_geofence" | "auto_closed_by_geofence_reason" | "client_geo_location" | "delta_distance" | "visit_reason" | "visit_note">;
15103
15109
  export type CLMFeedbackActivity = {
15104
15110
  activity_type: "clm-feedback-activity";
15105
15111
  activity_id: StringId;
@@ -19043,6 +19049,157 @@ export declare namespace Service {
19043
19049
  }
19044
19050
  export {};
19045
19051
  }
19052
+ namespace VisitReason {
19053
+ interface Data {
19054
+ _id: StringId;
19055
+ company_namespace: string[];
19056
+ name: string;
19057
+ disabled: boolean;
19058
+ createdAt: string;
19059
+ updatedAt: string;
19060
+ __v?: number;
19061
+ }
19062
+ interface CreateBody {
19063
+ company_namespace?: string[];
19064
+ name: string;
19065
+ disabled?: boolean;
19066
+ }
19067
+ type UpdateBody = Partial<CreateBody>;
19068
+ namespace Find {
19069
+ type Params = DefaultPaginationQueryParams & {
19070
+ _id?: StringId | StringId[];
19071
+ search?: string;
19072
+ name?: string | string[];
19073
+ disabled?: boolean;
19074
+ from_updatedAt?: number;
19075
+ to_updatedAt?: number;
19076
+ from_createdAt?: number;
19077
+ to_createdAt?: number;
19078
+ };
19079
+ interface Result extends DefaultPaginationResult {
19080
+ data: Data[];
19081
+ }
19082
+ }
19083
+ namespace Get {
19084
+ type ID = StringId;
19085
+ type Result = Data;
19086
+ }
19087
+ namespace Create {
19088
+ type Body = CreateBody;
19089
+ type Result = Data;
19090
+ }
19091
+ namespace Update {
19092
+ type ID = StringId;
19093
+ type Body = UpdateBody;
19094
+ type Result = Data;
19095
+ }
19096
+ namespace Remove {
19097
+ type ID = StringId;
19098
+ type Result = Data;
19099
+ }
19100
+ }
19101
+ namespace BulkImport {
19102
+ type BulkImportType = "insertTags" | "insertClients" | "insertReps" | "updateReps" | "updateClients" | "insertProducts" | "insertVariants" | "updateProducts" | "updateVariants" | "updateCategories" | "updateSubCategories" | "insertCategories" | "insertSubCategories" | "insertAvailabilityMsl" | "updateAvailabilityMsl" | "updateAvailabilityMslWithProducts" | "updateMslWithVariants" | "insertJobCategories" | "updateJobCategories" | "updateJobs" | "insertJobs" | "updateTags" | "insertRoutes" | "updateRoutes" | "updateRoutesWithClients" | "insertPlans" | "updatePlans" | "updatePlansWithRules" | "weeklyGroupRules" | "weeklyRules" | "updateRulesWithRoutes" | "updateTargetRulesWithClients" | "updateTargetRulesWithReps" | "insertTransfers" | "adjustAccounts" | "insertRules" | "updateRules" | "insertInvoices" | "insertWarehouses" | "updateWarehouses" | "insertProductGroups" | "updateProductGroups" | "updatePriceListItems" | "updateMeasureunit" | "insertMeasureunit" | "insertMeasureunitFamily" | "updateMeasureunitFamily" | "insertLineTarget" | "clientLineClassification" | "updateLineTarget" | "insertReceivingMaterials" | "insertRetailExecutionPresets" | "updateRetailExecutionPresets" | "insertCustomListItems" | "updateCustomListItems" | "insertAssets" | "updateAssets" | "insertAssetUnits" | "updateAssetUnits" | "insertSpeciality" | "updateSpeciality" | "insertClientLocation" | "updateClientLocation" | "deleteLineTarget" | "updatePromotions" | "insertReminders" | "updateReminders" | "insertVariantBatch" | "updateVariantBatch" | "insertSettlements" | "updateClientUblInfo" | "insertSuppliers" | "updateSuppliers" | "insertTargetRules" | "insertContractInstallments" | "updateContractInstallments" | "insertContracts" | "updateContracts" | "insertAssetPartTypes" | "updateAssetPartTypes" | "insertAssetParts" | "updateAssetParts";
19103
+ interface ToBeInserted {
19104
+ model: Model;
19105
+ method?: "set" | "push";
19106
+ __ref_doc?: boolean;
19107
+ handleSpecialProcess?: boolean;
19108
+ insertedDocs?: {
19109
+ [key: string]: any;
19110
+ }[];
19111
+ docs: {
19112
+ [key: string]: any;
19113
+ }[];
19114
+ }
19115
+ interface ToBeUpdated {
19116
+ model: Model;
19117
+ method?: "set" | "push";
19118
+ __ref_doc?: boolean;
19119
+ key?: string;
19120
+ handleSpecialProcess?: boolean;
19121
+ docs: {
19122
+ [key: string]: any;
19123
+ }[];
19124
+ }
19125
+ interface ToBeDeleted {
19126
+ model: Model;
19127
+ method?: "set" | "push";
19128
+ __ref_doc: boolean;
19129
+ handleSpecialProcess?: boolean;
19130
+ docs: {
19131
+ [key: string]: any;
19132
+ }[];
19133
+ }
19134
+ export interface Data {
19135
+ messages: string[];
19136
+ _errors: string[];
19137
+ _warnings: string[];
19138
+ data: object;
19139
+ success: boolean;
19140
+ processed?: boolean;
19141
+ type: BulkImportType;
19142
+ creator: AdminOrRepOrTenantOrClient;
19143
+ editor?: AdminOrRepOrTenantOrClient;
19144
+ company_namespace: string[];
19145
+ toBeInserted: ToBeInserted[];
19146
+ toBeUpdated: ToBeUpdated[];
19147
+ toBeDeleted: ToBeDeleted[];
19148
+ second_phase_status?: "success" | "failed" | "partial";
19149
+ status: "building_report_in_progress" | "building_report_completed" | "building_report_failed" | "in_progress" | "success" | "failed" | "partial";
19150
+ media?: StringId[];
19151
+ _id: StringId;
19152
+ teams: string[];
19153
+ createdAt: Date;
19154
+ updatedAt: Date;
19155
+ }
19156
+ export type CreateBody = FormData;
19157
+ export interface UpdateBody {
19158
+ company_namespace?: string[];
19159
+ name?: string;
19160
+ disabled?: boolean;
19161
+ }
19162
+ export type PopulatedDoc = Data & {
19163
+ media?: StringId[] | MediaDoc[];
19164
+ };
19165
+ type PopulatedKeys = "media";
19166
+ export namespace Find {
19167
+ type Params = DefaultPaginationQueryParams & {
19168
+ populatedKeys?: PopulatedKeys | PopulatedKeys[];
19169
+ processed?: boolean;
19170
+ success?: boolean;
19171
+ from_updatedAt?: number;
19172
+ to_updatedAt?: number;
19173
+ creator?: StringId | StringId[];
19174
+ "creator._id"?: StringId | StringId[];
19175
+ from_time?: number;
19176
+ to_time?: number;
19177
+ second_phase_status: Data["second_phase_status"] | Data["second_phase_status"][];
19178
+ status?: Data["status"] | Data["status"][];
19179
+ type?: Data["type"] | Data["type"][];
19180
+ };
19181
+ interface Result extends DefaultPaginationResult {
19182
+ data: PopulatedDoc[];
19183
+ }
19184
+ }
19185
+ export namespace Get {
19186
+ type ID = StringId;
19187
+ type Result = PopulatedDoc;
19188
+ }
19189
+ export namespace Create {
19190
+ type Params = {
19191
+ type: Data["type"];
19192
+ [key: string]: any;
19193
+ };
19194
+ type Body = CreateBody;
19195
+ type Result = Data;
19196
+ }
19197
+ export namespace Update {
19198
+ type ID = StringId;
19199
+ type Result = Data;
19200
+ }
19201
+ export {};
19202
+ }
19046
19203
  }
19047
19204
  export type StringId = string;
19048
19205
  export type NameSpaces = string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.275",
3
+ "version": "1.0.277",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -51,12 +51,12 @@
51
51
  "homepage": "https://github.com/Repzo/repzo-ts#readme",
52
52
  "dependencies": {
53
53
  "@babel/parser": "^7.14.7",
54
- "@types/axios": "^0.9.36",
55
54
  "uuid": "^8.3.2"
56
55
  },
57
56
  "devDependencies": {
58
57
  "@apidevtools/swagger-parser": "^12.0.0",
59
58
  "@redocly/openapi-cli": "^0.12.16",
59
+ "@types/axios": "^0.9.36",
60
60
  "@types/node": "^24.10.0",
61
61
  "@types/uuid": "^8.3.4",
62
62
  "axios": "^0.26.1",
package/src/index.ts CHANGED
@@ -148,6 +148,8 @@ export const end_points = {
148
148
  ADMIN: "admin",
149
149
  JOB_CATEGORY: "job-category",
150
150
  JOB_CATEGORY_AUTOSKIP_ANALYZE: "job-category-autoskip-analyze",
151
+ VISIT_REASON: "visit-reason",
152
+ BULK_IMPORT: "bulk-import",
151
153
  } as const;
152
154
  export type EndPoints = (typeof end_points)[keyof typeof end_points];
153
155
 
@@ -247,6 +249,7 @@ export const availableService = [
247
249
  "clmSlide",
248
250
  "clmFetch",
249
251
  "pdfMergeField",
252
+ "visitReason",
250
253
  ] as const;
251
254
  export type AvailableService = (typeof availableService)[number];
252
255
 
@@ -6951,6 +6954,102 @@ export default class Repzo {
6951
6954
  return res;
6952
6955
  },
6953
6956
  };
6957
+
6958
+ visitReason = {
6959
+ _path: Repzo._end_points.VISIT_REASON,
6960
+ find: async (
6961
+ params?: Service.VisitReason.Find.Params,
6962
+ ): Promise<Service.VisitReason.Find.Result> => {
6963
+ let res: Service.VisitReason.Find.Result = await this._fetch(
6964
+ this.svAPIEndpoint,
6965
+ this.visitReason._path,
6966
+ params,
6967
+ );
6968
+ return res;
6969
+ },
6970
+ get: async (
6971
+ id: Service.VisitReason.Get.ID,
6972
+ ): Promise<Service.VisitReason.Get.Result> => {
6973
+ return await this._fetch(
6974
+ this.svAPIEndpoint,
6975
+ this.visitReason._path + `/${id}`,
6976
+ );
6977
+ },
6978
+ create: async (
6979
+ body: Service.VisitReason.Create.Body,
6980
+ ): Promise<Service.VisitReason.Create.Result> => {
6981
+ let res = await this._create(
6982
+ this.svAPIEndpoint,
6983
+ this.visitReason._path,
6984
+ body,
6985
+ );
6986
+ return res;
6987
+ },
6988
+ update: async (
6989
+ id: Service.VisitReason.Update.ID,
6990
+ body: Service.VisitReason.Update.Body,
6991
+ ): Promise<Service.VisitReason.Update.Result> => {
6992
+ let res: Service.VisitReason.Update.Result = await this._update(
6993
+ this.svAPIEndpoint,
6994
+ this.visitReason._path + `/${id}`,
6995
+ body,
6996
+ );
6997
+ return res;
6998
+ },
6999
+ remove: async (
7000
+ id: Service.VisitReason.Remove.ID,
7001
+ ): Promise<Service.VisitReason.Remove.Result> => {
7002
+ let res: Service.VisitReason.Remove.Result = await this._delete(
7003
+ this.svAPIEndpoint,
7004
+ this.visitReason._path + `/${id}`,
7005
+ );
7006
+ return res;
7007
+ },
7008
+ };
7009
+
7010
+ bulkImport = {
7011
+ _path: Repzo._end_points.BULK_IMPORT,
7012
+ find: async (
7013
+ params?: Service.BulkImport.Find.Params,
7014
+ ): Promise<Service.BulkImport.Find.Result> => {
7015
+ let res: Service.BulkImport.Find.Result = await this._fetch(
7016
+ this.svAPIEndpoint,
7017
+ this.bulkImport._path,
7018
+ params,
7019
+ );
7020
+ return res;
7021
+ },
7022
+ get: async (
7023
+ id: Service.BulkImport.Get.ID,
7024
+ ): Promise<Service.BulkImport.Get.Result> => {
7025
+ return await this._fetch(
7026
+ this.svAPIEndpoint,
7027
+ this.bulkImport._path + `/${id}`,
7028
+ );
7029
+ },
7030
+ create: async (
7031
+ params: Service.BulkImport.Create.Params,
7032
+ body: Service.BulkImport.Create.Body,
7033
+ ): Promise<Service.BulkImport.Create.Result> => {
7034
+ let res = await this._create(
7035
+ this.svAPIEndpoint,
7036
+ this.bulkImport._path,
7037
+ body,
7038
+ params,
7039
+ );
7040
+ return res;
7041
+ },
7042
+ update: async (
7043
+ id: Service.BulkImport.Update.ID,
7044
+ ): Promise<Service.BulkImport.Update.Result> => {
7045
+ let res: Service.BulkImport.Update.Result = await this._update(
7046
+ this.svAPIEndpoint,
7047
+ this.bulkImport._path + `/${id}`,
7048
+ {},
7049
+ );
7050
+ return res;
7051
+ },
7052
+ };
6954
7053
  }
6955
7054
 
6956
7055
  function normalizeParams(params: Params): { [key: string]: any } {
@@ -3502,6 +3502,7 @@ export namespace Service {
3502
3502
  skip_if_calendar_day_is_more_than?: number; // (1-31)
3503
3503
  enable_auto_skip_activity_existence?: boolean;
3504
3504
  auto_skip_activity_slugs?: AutoSkipActivitySlugs[];
3505
+ auto_skip_activity_slugs_operator?: "and" | "or";
3505
3506
  };
3506
3507
  createdAt: string;
3507
3508
  updatedAt: string;
@@ -5229,6 +5230,8 @@ export namespace Service {
5229
5230
  extra?: {};
5230
5231
  };
5231
5232
  delayed?: boolean;
5233
+ visit_reason?: StringId;
5234
+ visit_note?: string;
5232
5235
  createdAt: Date;
5233
5236
  updatedAt: Date;
5234
5237
  }
@@ -5457,6 +5460,7 @@ export namespace Service {
5457
5460
  user?: string | Rep.RepSchema;
5458
5461
  client?: string | Client.ClientSchema;
5459
5462
  route?: string | Route.RouteSchema;
5463
+ visit_reason?: StringId | Pick<VisitReason.Data, "_id" | "name">;
5460
5464
  };
5461
5465
  export type PopulatedKeys =
5462
5466
  | "notes"
@@ -5469,7 +5473,8 @@ export namespace Service {
5469
5473
  | "teams"
5470
5474
  | "client"
5471
5475
  | "user"
5472
- | "route";
5476
+ | "route"
5477
+ | "visit_reason";
5473
5478
  export namespace Find {
5474
5479
  export type Params = DefaultPaginationQueryParams & {
5475
5480
  user?: string;
@@ -5490,6 +5495,7 @@ export namespace Service {
5490
5495
  from_updatedAt?: number;
5491
5496
  from__id?: string;
5492
5497
  to__id?: string;
5498
+ visit_reason?: StringId | StringId[];
5493
5499
  [key: string]: any; // integration_meta.
5494
5500
  populatedKeys?: PopulatedKeys[];
5495
5501
  sortBy?: {
@@ -16702,6 +16708,7 @@ export namespace Service {
16702
16708
  )[];
16703
16709
  feed_back_option?: StringId;
16704
16710
  feed_back_option_label?: string;
16711
+ visit_reason_name?: string;
16705
16712
  } & Pick<
16706
16713
  Visit.Data,
16707
16714
  | "closed_by_system"
@@ -16715,6 +16722,8 @@ export namespace Service {
16715
16722
  | "auto_closed_by_geofence_reason"
16716
16723
  | "client_geo_location"
16717
16724
  | "delta_distance"
16725
+ | "visit_reason"
16726
+ | "visit_note"
16718
16727
  >;
16719
16728
 
16720
16729
  // CLMFeedbackActivity ********************************************************************
@@ -21417,6 +21426,244 @@ export namespace Service {
21417
21426
  export type Result = Data;
21418
21427
  }
21419
21428
  }
21429
+
21430
+ export namespace VisitReason {
21431
+ export interface Data {
21432
+ _id: StringId;
21433
+ company_namespace: string[];
21434
+ name: string;
21435
+ disabled: boolean;
21436
+ createdAt: string;
21437
+ updatedAt: string;
21438
+ __v?: number;
21439
+ }
21440
+ export interface CreateBody {
21441
+ company_namespace?: string[];
21442
+ name: string;
21443
+ disabled?: boolean;
21444
+ }
21445
+ export type UpdateBody = Partial<CreateBody>;
21446
+
21447
+ export namespace Find {
21448
+ export type Params = DefaultPaginationQueryParams & {
21449
+ _id?: StringId | StringId[];
21450
+ search?: string;
21451
+ name?: string | string[];
21452
+ disabled?: boolean;
21453
+ from_updatedAt?: number;
21454
+ to_updatedAt?: number;
21455
+ from_createdAt?: number;
21456
+ to_createdAt?: number;
21457
+ };
21458
+ export interface Result extends DefaultPaginationResult {
21459
+ data: Data[];
21460
+ }
21461
+ }
21462
+ export namespace Get {
21463
+ export type ID = StringId;
21464
+ export type Result = Data;
21465
+ }
21466
+ export namespace Create {
21467
+ export type Body = CreateBody;
21468
+ export type Result = Data;
21469
+ }
21470
+ export namespace Update {
21471
+ export type ID = StringId;
21472
+ export type Body = UpdateBody;
21473
+ export type Result = Data;
21474
+ }
21475
+ export namespace Remove {
21476
+ export type ID = StringId;
21477
+ export type Result = Data;
21478
+ }
21479
+ }
21480
+
21481
+ export namespace BulkImport {
21482
+ type BulkImportType =
21483
+ | "insertTags"
21484
+ | "insertClients"
21485
+ | "insertReps"
21486
+ | "updateReps"
21487
+ | "updateClients"
21488
+ | "insertProducts"
21489
+ | "insertVariants"
21490
+ | "updateProducts"
21491
+ | "updateVariants"
21492
+ | "updateCategories"
21493
+ | "updateSubCategories"
21494
+ | "insertCategories"
21495
+ | "insertSubCategories"
21496
+ | "insertAvailabilityMsl"
21497
+ | "updateAvailabilityMsl"
21498
+ | "updateAvailabilityMslWithProducts"
21499
+ | "updateMslWithVariants"
21500
+ | "insertJobCategories"
21501
+ | "updateJobCategories"
21502
+ | "updateJobs"
21503
+ | "insertJobs"
21504
+ | "updateTags"
21505
+ | "insertRoutes"
21506
+ | "updateRoutes"
21507
+ | "updateRoutesWithClients"
21508
+ | "insertPlans"
21509
+ | "updatePlans"
21510
+ | "updatePlansWithRules"
21511
+ | "weeklyGroupRules"
21512
+ | "weeklyRules"
21513
+ | "updateRulesWithRoutes"
21514
+ | "updateTargetRulesWithClients"
21515
+ | "updateTargetRulesWithReps"
21516
+ | "insertTransfers"
21517
+ | "adjustAccounts"
21518
+ | "insertRules"
21519
+ | "updateRules"
21520
+ | "insertInvoices"
21521
+ | "insertWarehouses"
21522
+ | "updateWarehouses"
21523
+ | "insertProductGroups"
21524
+ | "updateProductGroups"
21525
+ | "updatePriceListItems"
21526
+ | "updateMeasureunit"
21527
+ | "insertMeasureunit"
21528
+ | "insertMeasureunitFamily"
21529
+ | "updateMeasureunitFamily"
21530
+ | "insertLineTarget"
21531
+ | "clientLineClassification"
21532
+ | "updateLineTarget"
21533
+ | "insertReceivingMaterials"
21534
+ | "insertRetailExecutionPresets"
21535
+ | "updateRetailExecutionPresets"
21536
+ | "insertCustomListItems"
21537
+ | "updateCustomListItems"
21538
+ | "insertAssets"
21539
+ | "updateAssets"
21540
+ | "insertAssetUnits"
21541
+ | "updateAssetUnits"
21542
+ | "insertSpeciality"
21543
+ | "updateSpeciality"
21544
+ | "insertClientLocation"
21545
+ | "updateClientLocation"
21546
+ | "deleteLineTarget"
21547
+ | "updatePromotions"
21548
+ | "insertReminders"
21549
+ | "updateReminders"
21550
+ | "insertVariantBatch"
21551
+ | "updateVariantBatch"
21552
+ | "insertSettlements"
21553
+ | "updateClientUblInfo"
21554
+ | "insertSuppliers"
21555
+ | "updateSuppliers"
21556
+ | "insertTargetRules"
21557
+ | "insertContractInstallments"
21558
+ | "updateContractInstallments"
21559
+ | "insertContracts"
21560
+ | "updateContracts"
21561
+ | "insertAssetPartTypes"
21562
+ | "updateAssetPartTypes"
21563
+ | "insertAssetParts"
21564
+ | "updateAssetParts";
21565
+
21566
+ interface ToBeInserted {
21567
+ model: Model;
21568
+ method?: "set" | "push";
21569
+ __ref_doc?: boolean;
21570
+ handleSpecialProcess?: boolean;
21571
+ insertedDocs?: { [key: string]: any }[];
21572
+ docs: { [key: string]: any }[];
21573
+ }
21574
+ interface ToBeUpdated {
21575
+ model: Model;
21576
+ method?: "set" | "push";
21577
+ __ref_doc?: boolean;
21578
+ key?: string;
21579
+ handleSpecialProcess?: boolean;
21580
+ docs: { [key: string]: any }[];
21581
+ }
21582
+ interface ToBeDeleted {
21583
+ model: Model;
21584
+ method?: "set" | "push";
21585
+ __ref_doc: boolean;
21586
+ handleSpecialProcess?: boolean;
21587
+ docs: { [key: string]: any }[];
21588
+ }
21589
+
21590
+ export interface Data {
21591
+ messages: string[];
21592
+ _errors: string[];
21593
+ _warnings: string[];
21594
+ data: object;
21595
+ success: boolean;
21596
+ processed?: boolean;
21597
+ type: BulkImportType;
21598
+ creator: AdminOrRepOrTenantOrClient;
21599
+ editor?: AdminOrRepOrTenantOrClient;
21600
+ company_namespace: string[];
21601
+ toBeInserted: ToBeInserted[];
21602
+ toBeUpdated: ToBeUpdated[];
21603
+ toBeDeleted: ToBeDeleted[];
21604
+ second_phase_status?: "success" | "failed" | "partial";
21605
+ status:
21606
+ | "building_report_in_progress"
21607
+ | "building_report_completed"
21608
+ | "building_report_failed"
21609
+ | "in_progress"
21610
+ | "success"
21611
+ | "failed"
21612
+ | "partial";
21613
+ media?: StringId[];
21614
+ _id: StringId;
21615
+ teams: string[];
21616
+ createdAt: Date;
21617
+ updatedAt: Date;
21618
+ }
21619
+ export type CreateBody = FormData;
21620
+ export interface UpdateBody {
21621
+ company_namespace?: string[];
21622
+ name?: string;
21623
+ disabled?: boolean;
21624
+ }
21625
+
21626
+ export type PopulatedDoc = Data & {
21627
+ media?: StringId[] | MediaDoc[];
21628
+ };
21629
+
21630
+ type PopulatedKeys = "media";
21631
+
21632
+ export namespace Find {
21633
+ export type Params = DefaultPaginationQueryParams & {
21634
+ populatedKeys?: PopulatedKeys | PopulatedKeys[];
21635
+ processed?: boolean;
21636
+ success?: boolean;
21637
+ from_updatedAt?: number;
21638
+ to_updatedAt?: number;
21639
+ creator?: StringId | StringId[];
21640
+ "creator._id"?: StringId | StringId[];
21641
+ from_time?: number;
21642
+ to_time?: number;
21643
+ second_phase_status:
21644
+ | Data["second_phase_status"]
21645
+ | Data["second_phase_status"][];
21646
+ status?: Data["status"] | Data["status"][];
21647
+ type?: Data["type"] | Data["type"][];
21648
+ };
21649
+ export interface Result extends DefaultPaginationResult {
21650
+ data: PopulatedDoc[];
21651
+ }
21652
+ }
21653
+ export namespace Get {
21654
+ export type ID = StringId;
21655
+ export type Result = PopulatedDoc;
21656
+ }
21657
+ export namespace Create {
21658
+ export type Params = { type: Data["type"]; [key: string]: any };
21659
+ export type Body = CreateBody;
21660
+ export type Result = Data;
21661
+ }
21662
+ export namespace Update {
21663
+ export type ID = StringId;
21664
+ export type Result = Data;
21665
+ }
21666
+ }
21420
21667
  }
21421
21668
 
21422
21669
  export type StringId = string;