import axios from "axios"; import { v4 as uuid } from "uuid"; import type { Params, Data, Service, Options, Headers, StringId, NameSpaces, } from "./types/index"; import { generateUUID } from "./helper.js"; export const end_points = { CLIENT: "client", PRODUCT: "product", VARIANT: "variant", CATEGORY: "product-category", SUB_CATEGORY: "product-sub-category", BRAND: "product-brand", PRODUCT_GROUP: "product-group", TAX: "tax", MEASUREUNIT: "measureunits", MEASUREUNIT_FAMILY: "measureunit-family", MEDIA: "media", CYCLES: "cycles", CYCLE_REPORT: "cycle-report", PRICELIST: "pricelists", PRICELIST_ITEM: "pricelistsitems", TEAM: "teams", RETURN_REASON: "return-reason", REP: "rep", REP_BALANCE_SUMMARY: "rep-balance-summary", TAG: "tag", WAREHOUSE: "warehouse", ROUTE: "route", GEO_ZONE: "geo-zone", PRODUCT_MODIFIERS_GROUP: "product-modifiers-group", CHANNEL: "client-channel", SPECIALITY: "speciality", CLIENT_CONTACT: "client-contact", PAYMENT_TERM: "paymentterms", BANK: "banks", BANK_LIST: "bankslists", CUSTOM_STATUS: "custom-status", CUSTOM_LIST: "custom-list", CUSTOM_LIST_ITEM: "custom-list-item", INVENTORY_ADJUSTMENT_REASON: "inventory-adjustment-reason", WORKORDER: "workorder", WORKORDER_REQUEST: "workorder-request", SUPPLIER: "supplier", QUICK_CONVERT_TO_PDF: "quick-convert-to-pdf", VISIT: "visit", INVOICE: "fullinvoices", PROFORMA: "proforma", PRINT_SETTINGS: "print-settings", PDF_TEMPLATE_GALLERY: "pdf-template-gallery", PDF_TEMPLATE: "pdf-template", PDF_MERGE_FIELD: "pdf-merge-fields", PAYMENT: "payments", REFUND: "refund", SETTLEMENT: "settlement", VOID_SETTLEMENT: "void-settlement", CHECK: "checks", DAY: "day", DAY_SHIFT: "day-shift", RECEIVING_MATERIAL: "receiving-material", ADJUST_ACCOUNT: "adjust-account", TRANSFER: "transfer", MSL: "msl", MSL_PRODUCT: "msl-products", MEDIA_STORAGE: "media-storage", STORECHECK_TEMPLATE: "storecheck-template", ACTIVITY_STORECHECK: "activity-storecheck", ACTIVITY_ITEM_STATUS: "activity-item-status", ITEM_STATUS_TYPE: "item-status-type", ADJUST_INVENTORY: "adjust-inventory", INVENTORY: "inventory", INTEGRATION_APP: "integration-app", JOIN_ACTIONS_WEBHOOK: "svix-integration", INTEGRATION_ACTION_LOG: "integration-action-log", INTEGRATION_COMMAND_LOG: "integration-command-log", PATCH_ACTION: "patch-action", UPDATE_INTEGRATION_META: "update-integration-meta", ASSET_PART_TYPE: "asset-part-type", ASSET_PART: "asset-part", ASSET_PART_UNIT: "asset-part-unit", ASSET_PART_RECEIVAL: "asset-part-receival", ASSET_PART_TRANSFER: "asset-part-transfer", RETURN_ASSET_PART_UNIT: "return-asset-part-unit", STORE_ASSET_PART_UNIT: "store-asset-part-unit", OCR_INVOICE_JOB_TEMPLATE: "ocr-invoice-job-template", OCR_INVOICE_JOB_GROUP: "ocr-invoice-job-group", ACTIVITY_AI_SALES_ORDER: "activity-ai-sales-order", OCR_INVOICE_JOB: "ocr-invoice-job", OCR_INVOICE_JOB_PAGE: "ocr-invoice-job-page", SETTINGS: "settings", MAIL_UNSUBSCRIBE: "mail-unsubscribe", APPROVAL_REQUEST: "approval-request", SAFE_INVOICE_SERIAL_COUNTER: "safe-invoice-serial-counter", CLIENT_LOCATION: "client-location", ASSET_TYPE: "asset-type", ASSET: "asset", ASSET_UNIT: "asset-unit", WORKORDER_PORTAL: "workorder-portal", APPROVAL: "approvals", ACTIVITY_FEEDBACK: "activity-feedback", ACTIVITY_FEEDBACKV2: "activity-feedback-v2", FEEDBACK_OPTION: "feedback-options", WORKORDER_CATEGORY: "workorder-category", CONTRACT: "contract", CONTRACT_INSTALLMENT: "contract-installment", WORKORDER_PORTAL_LINK: "workorder-portal-link", CUSTOM_FIELD: "customfields", TIMELINE_REPORT: "timeline-report", RESET_COMPANY_NAMESPACE: "reset-company-namespace", TEST_RESET_COMPANY_NAMESPACE: "test-reset-company-namespace", TIMELINE_TIME_LIST: "timeline-time-list", SALES_ANALYTICS_REPORT: "sales-analytics-report", WORKORDER_AGENDA: "workorder-agenda", MODULE_CUSTOM_VALIDATOR: "module-custom-validator", NOTIFICATIONS_CENTER: "notifications-center", REPORT_COLUMN_GROUP: "report-column-group", REPORT_COLUMN: "report-column", REPORT_SORT: "report-sort", REPORT_FILTER: "report-filter", SAFE_CRUD: "safe-crud", PAYMENT_METHOD: "payment-method", REPORT_VIEW: "report-view", REPORT_VIEW_DEFAULT: "report-view-default", REPORT_VIEW_FAVORITE: "report-view-favorite", COPY_REPORT_VIEW: "copy-report-view", CLM_PRESENTATION: "clm-presentation", CLM_SEQUENCE: "clm-sequence", CLM_SLIDE: "clm-slide", CLM_FEEDBACK_ACTIVITY: "clm-feedback-activity", CLM_FETCH: "clm-fetch", PROMOTIONS: "promotions", COMPARE_INVOICE_TO_WAREHOUSE: "compare-invoice-to-warehouse", AUTHENTICATE: "authenticate", OPTIONAL_BUSINESS_APP_SERVICE: "optional-business-app-service", PROMOTION_USAGE: "promotion-usage", CART: "cart", LATEST_SERIAL: "latest-serial", FORM_V2: "form-v2", ACTIVITY_FORM_V2_RESULT: "activity-form-v2-result", LINE_CLASSIFICATION: "line-classification", LINE: "line", CLIENT_LINE: "client-line", SCHEDULED_EMAILS: "scheduled-emails", DATA_FILE_WAREHOUSE: "data-file-warehouse", DATA_SESSION: "data-session", ADMIN: "admins", JOB_CATEGORY: "job-category", JOB_CATEGORY_AUTOSKIP_ANALYZE: "job-category-autoskip-analyze", VISIT_REASON: "visit-reason", TARGET_RULE: "target-rule", PLAN: "plan", CALENDAR: "calendar", LINE_TARGET: "line-target", BULK_IMPORT: "bulk-import", BULK_EXPORT: "bulk-export", DELIVERY_NOTE: "delivery-note", RESERVATION: "reservation", AI_OBJECT_DETECTION_DATASET: "ai-object-detection-dataset", AI_OBJECT_DETECTION_MODEL: "ai-object-detection-model", AI_OBJECT_DETECTION_MODEL_VERSION: "ai-object-detection-model-version", AI_OBJECT_DETECTION_MODEL_VERSION_EPOCH: "ai-object-detection-model-version-epoch", AI_OBJECT_DETECTION_MODEL_VERSION_TRAIN_AGENT: "ai-object-detection-model-version-train-agent", AI_OBJECT_DETECTION_LABEL: "ai-object-detection-label", AI_OBJECT_DETECTION_LABEL_GROUP: "ai-object-detection-label-group", AI_OBJECT_DETECTION_CATEGORY: "ai-object-detection-category", AI_OBJECT_DETECTION_SEGMENT: "ai-object-detection-segment", AI_OBJECT_DETECTION_LABEL_REPORT: "ai-object-detection-label-report", AI_OBJECT_DETECTION_SETTINGS: "ai-object-detection-settings", AI_OBJECT_DETECTION_DETECTION_SETTINGS: "ai-object-detection-detection-settings", AI_OBJECT_DETECTION_INFERENCE: "ai-object-detection-inference", AI_OBJECT_DETECTION_TASK: "ai-object-detection-task", AI_OBJECT_DETECTION_SESSION: "ai-object-detection-session", ACTIVITY_AI_OBJECT_DETECTION_SESSION_FRAME: "activity-ai-object-detection-session-frame", AI_OBJECT_DETECTION_SESSION_ANALYSIS: "ai-object-detection-session-analysis", AI_OBJECT_DETECTION_SESSION_ELECTION: "ai-object-detection-session-election", AI_OBJECT_DETECTION_SESSION_INSIGHT: "ai-object-detection-session-insight", AI_OBJECT_DETECTION_METRIC: "ai-object-detection-metric", AI_OBJECT_DETECTION_METRIC_RESULT: "ai-object-detection-metric-result", AI_OBJECT_DETECTION_MISSION: "ai-object-detection-mission", AI_OBJECT_DETECTION_MISSION_SET: "ai-object-detection-mission-set", AI_OBJECT_DETECTION_MISSION_RESULTS: "ai-object-detection-mission-results", AI_OBJECT_DETECTION_ASSIGNMENT_RULE: "ai-object-detection-assignment-rule", AI_OBJECT_DETECTION_ASSIGNED_MISSIONS: "ai-object-detection-assigned-missions", OBJECT_DETECTION_ANALYTICS_REPORT: "object-detection-analytics-report", } as const; export type EndPoints = (typeof end_points)[keyof typeof end_points]; export const availableService = [ "client", "product", "variant", "category", "sub_category", "brand", "product_group", "tax", "measureunit", "measureunitFamily", "media", "priceList", "priceListItem", "team", "returnReason", "rep", "tag", "warehouse", "route", "geoZone", "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", "dayShift", "receivingMaterial", "adjustAccount", "transfer", "msl", "mslProduct", "mediaStorage", "storecheckTemplate", "activityStorecheck", "activityItemStatus", "itemStatusType", "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", "targetRule", "plan", "calendar", "lineTarget", "bulkImport", "bulkExport", "aiObjectDetectionDataset", "aiObjectDetectionModel", "aiObjectDetectionModelVersion", "aiObjectDetectionModelVersionEpoch", "aiObjectDetectionModelVersionTrainAgent", "aiObjectDetectionLabel", "aiObjectDetectionLabelGroup", "aiObjectDetectionCategory", "aiObjectDetectionSegment", "aiObjectDetectionLabelReport", "aiObjectDetectionSettings", "aiObjectDetectionDetectionSettings", "aiObjectDetectionInference", "aiObjectDetectionTask", "aiObjectDetectionSession", "activityAiObjectDetectionSessionFrame", "aiObjectDetectionSessionAnalysis", "aiObjectDetectionSessionElection", "aiObjectDetectionSessionInsight", "aiObjectDetectionMetric", "aiObjectDetectionMetricResult", "aiObjectDetectionMission", "aiObjectDetectionMissionSet", "aiObjectDetectionMissionResults", "aiObjectDetectionAssignmentRule", "aiObjectDetectionAssignedMissions", "objectDetectionAnalyticsReport", ] as const; export type AvailableService = (typeof availableService)[number]; export default class Repzo { private svAPIEndpoint: string; headers: Headers; private timeout: number; private retryAttempts: number; private refresh_token?: string; private nameSpace?: string; private reauthCallBackFn?: (res: Service.Reauth.Result) => void; constructor(apiKey: string, options?: Options) { this.svAPIEndpoint = !options?.env || options?.env == "production" ? "https://sv.api.repzo.me" : options?.env == "staging" ? "https://staging.sv.api.repzo.me" : options?.env == "local" ? "http://localhost:3030" : ""; this.headers = { "api-key": apiKey, "Content-Type": "application/json", Accept: "application/json", }; if (options?.nameSpace) this.nameSpace = options.nameSpace; if (options?.refresh_token) this.refresh_token = options.refresh_token; if (options?.reauthCallBackFn) this.reauthCallBackFn = options.reauthCallBackFn; if (options?.headers) Object.assign(this.headers, options.headers); if (options?.timeout) { this.timeout = options.timeout; } else { this.timeout = 180000; } this.retryAttempts = options?.retryAttempts ?? 3; } private static _end_points = end_points; public static get END_POINTS() { return Repzo._end_points; } private async _retryRequest( requestFn: () => Promise, attempt: number = 1, ): Promise { try { return await requestFn(); } catch (error: any) { // Don't retry on 401 (Unauthorized) errors if ( error?.response?.status === 401 && this.refresh_token && this.nameSpace ) { try { await this.core.reauth(); } catch (e) { throw error; } } else { throw error; } // Retry if we haven't exceeded the retry attempts if (attempt < this.retryAttempts) { // Exponential backoff: wait 2^attempt seconds before retrying const delay = Math.pow(2, attempt) * 1000; await new Promise((resolve) => setTimeout(resolve, delay)); return this._retryRequest(requestFn, attempt + 1); } // If all retries failed, throw the error throw error; } } private async _fetch(baseUrl: string, path: string, params?: Params) { return this._retryRequest(async () => { if (params) { params = normalizeParams(params); } let res: any = await axios.get(`${baseUrl}/${path}`, { params, headers: this.headers, timeout: this.timeout, }); return res.data; }); } private async _create( baseUrl: string, path: string, body: Data, params?: Params, ) { return this._retryRequest(async () => { let res: any = await axios.post(`${baseUrl}/${path}`, body, { params, headers: this.headers, timeout: this.timeout, }); return res.data; }); } private async _update( baseUrl: string, path: string, body: Data, params?: Params, ) { return this._retryRequest(async () => { let res: any = await axios.put(`${baseUrl}/${path}`, body, { params, headers: this.headers, timeout: this.timeout, }); return res.data; }); } private async _patch( baseUrl: string, path: string, body: Data, params?: Params, ) { return this._retryRequest(async () => { let res: any = await axios.put(`${baseUrl}/${path}`, body, { params, headers: this.headers, timeout: this.timeout, }); return res.data; }); } private async _delete(baseUrl: string, path: string, params?: Params) { return this._retryRequest(async () => { let res: any = await axios.delete(`${baseUrl}/${path}`, { params, headers: this.headers, timeout: this.timeout, }); return res.data; }); } aiObjectDetectionDataset = { _path: Repzo._end_points.AI_OBJECT_DETECTION_DATASET, find: async ( params?: Service.AiObjectDetectionDataset.Find.Params, ): Promise => { let res: Service.AiObjectDetectionDataset.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionDataset._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionDataset.Get.ID, params?: Service.AiObjectDetectionDataset.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionDataset._path + `/${id}`, params, ); }, create: async ( body: Service.AiObjectDetectionDataset.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionDataset._path, body, ); return res; }, update: async ( id: Service.AiObjectDetectionDataset.Update.ID, body: Service.AiObjectDetectionDataset.Update.Body, ): Promise => { let res: Service.AiObjectDetectionDataset.Update.Result = await this._update( this.svAPIEndpoint, this.aiObjectDetectionDataset._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.AiObjectDetectionDataset.Remove.ID, ): Promise => { let res: Service.AiObjectDetectionDataset.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionDataset._path + `/${id}`, ); return res; }, }; aiObjectDetectionModel = { _path: Repzo._end_points.AI_OBJECT_DETECTION_MODEL, find: async ( params?: Service.AiObjectDetectionModel.Find.Params, ): Promise => { let res: Service.AiObjectDetectionModel.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionModel._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionModel.Get.ID, params?: Service.AiObjectDetectionModel.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionModel._path + `/${id}`, params, ); }, create: async ( body: Service.AiObjectDetectionModel.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionModel._path, body, ); return res; }, update: async ( id: Service.AiObjectDetectionModel.Update.ID, body: Service.AiObjectDetectionModel.Update.Body, ): Promise => { let res: Service.AiObjectDetectionModel.Update.Result = await this._update( this.svAPIEndpoint, this.aiObjectDetectionModel._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.AiObjectDetectionModel.Remove.ID, ): Promise => { let res: Service.AiObjectDetectionModel.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionModel._path + `/${id}`, ); return res; }, }; aiObjectDetectionModelVersion = { _path: Repzo._end_points.AI_OBJECT_DETECTION_MODEL_VERSION, find: async ( params?: Service.AiObjectDetectionModelVersion.Find.Params, ): Promise => { let res: Service.AiObjectDetectionModelVersion.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionModelVersion._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionModelVersion.Get.ID, params?: Service.AiObjectDetectionModelVersion.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionModelVersion._path + `/${id}`, params, ); }, create: async ( body: Service.AiObjectDetectionModelVersion.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionModelVersion._path, body, ); return res; }, remove: async ( id: Service.AiObjectDetectionModelVersion.Remove.ID, ): Promise => { let res: Service.AiObjectDetectionModelVersion.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionModelVersion._path + `/${id}`, ); return res; }, }; aiObjectDetectionModelVersionEpoch = { _path: Repzo._end_points.AI_OBJECT_DETECTION_MODEL_VERSION_EPOCH, find: async ( params: Service.AiObjectDetectionModelVersionEpoch.Find.Params, ): Promise => { let res: Service.AiObjectDetectionModelVersionEpoch.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionModelVersionEpoch._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionModelVersionEpoch.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionModelVersionEpoch._path + `/${id}`, ); }, }; aiObjectDetectionModelVersionTrainAgent = { _path: Repzo._end_points.AI_OBJECT_DETECTION_MODEL_VERSION_TRAIN_AGENT, get: async ( id: Service.AiObjectDetectionModelVersionTrainAgent.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionModelVersionTrainAgent._path + `/${id}`, ); }, }; aiObjectDetectionLabel = { _path: Repzo._end_points.AI_OBJECT_DETECTION_LABEL, find: async ( params?: Service.AiObjectDetectionLabel.Find.Params, ): Promise => { let res: Service.AiObjectDetectionLabel.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionLabel._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionLabel.Get.ID, params?: Service.AiObjectDetectionLabel.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionLabel._path + `/${id}`, params, ); }, create: async ( body: Service.AiObjectDetectionLabel.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionLabel._path, body, ); return res; }, update: async ( id: Service.AiObjectDetectionLabel.Update.ID, body: Service.AiObjectDetectionLabel.Update.Body, ): Promise => { let res: Service.AiObjectDetectionLabel.Update.Result = await this._update( this.svAPIEndpoint, this.aiObjectDetectionLabel._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.AiObjectDetectionLabel.Remove.ID, ): Promise => { let res: Service.AiObjectDetectionLabel.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionLabel._path + `/${id}`, ); return res; }, }; aiObjectDetectionLabelGroup = { _path: Repzo._end_points.AI_OBJECT_DETECTION_LABEL_GROUP, find: async ( params?: Service.AiObjectDetectionLabelGroup.Find.Params, ): Promise => { let res: Service.AiObjectDetectionLabelGroup.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionLabelGroup._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionLabelGroup.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionLabelGroup._path + `/${id}`, ); }, create: async ( body: Service.AiObjectDetectionLabelGroup.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionLabelGroup._path, body, ); return res; }, update: async ( id: Service.AiObjectDetectionLabelGroup.Update.ID, body: Service.AiObjectDetectionLabelGroup.Update.Body, ): Promise => { let res: Service.AiObjectDetectionLabelGroup.Update.Result = await this._update( this.svAPIEndpoint, this.aiObjectDetectionLabelGroup._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.AiObjectDetectionLabelGroup.Remove.ID, params?: Service.AiObjectDetectionLabelGroup.Remove.Params, ): Promise => { let res: Service.AiObjectDetectionLabelGroup.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionLabelGroup._path + `/${id}`, params, ); return res; }, }; aiObjectDetectionCategory = { _path: Repzo._end_points.AI_OBJECT_DETECTION_CATEGORY, find: async ( params?: Service.AiObjectDetectionCategory.Find.Params, ): Promise => { let res: Service.AiObjectDetectionCategory.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionCategory._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionCategory.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionCategory._path + `/${id}`, ); }, create: async ( body: Service.AiObjectDetectionCategory.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionCategory._path, body, ); return res; }, update: async ( id: Service.AiObjectDetectionCategory.Update.ID, body: Service.AiObjectDetectionCategory.Update.Body, ): Promise => { let res: Service.AiObjectDetectionCategory.Update.Result = await this._update( this.svAPIEndpoint, this.aiObjectDetectionCategory._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.AiObjectDetectionCategory.Remove.ID, params?: Service.AiObjectDetectionCategory.Remove.Params, ): Promise => { let res: Service.AiObjectDetectionCategory.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionCategory._path + `/${id}`, params, ); return res; }, }; aiObjectDetectionSegment = { _path: Repzo._end_points.AI_OBJECT_DETECTION_SEGMENT, find: async ( params?: Service.AiObjectDetectionSegment.Find.Params, ): Promise => { let res: Service.AiObjectDetectionSegment.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionSegment._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionSegment.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionSegment._path + `/${id}`, ); }, create: async ( body: Service.AiObjectDetectionSegment.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionSegment._path, body, ); return res; }, update: async ( id: Service.AiObjectDetectionSegment.Update.ID, body: Service.AiObjectDetectionSegment.Update.Body, ): Promise => { let res: Service.AiObjectDetectionSegment.Update.Result = await this._update( this.svAPIEndpoint, this.aiObjectDetectionSegment._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.AiObjectDetectionSegment.Remove.ID, ): Promise => { let res: Service.AiObjectDetectionSegment.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionSegment._path + `/${id}`, ); return res; }, }; aiObjectDetectionLabelReport = { _path: Repzo._end_points.AI_OBJECT_DETECTION_LABEL_REPORT, find: async ( params: Service.AiObjectDetectionLabelReport.Find.Params, ): Promise => { let res: Service.AiObjectDetectionLabelReport.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionLabelReport._path, params, ); return res; }, }; aiObjectDetectionSettings = { _path: Repzo._end_points.AI_OBJECT_DETECTION_SETTINGS, find: async (): Promise => { let res: Service.AiObjectDetectionSettings.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionSettings._path, ); return res; }, get: async ( id: Service.AiObjectDetectionSettings.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionSettings._path + `/${id}`, ); }, create: async ( body: Service.AiObjectDetectionSettings.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionSettings._path, body, ); return res; }, update: async ( id: Service.AiObjectDetectionSettings.Update.ID, body: Service.AiObjectDetectionSettings.Update.Body, ): Promise => { let res: Service.AiObjectDetectionSettings.Update.Result = await this._update( this.svAPIEndpoint, this.aiObjectDetectionSettings._path + `/${id}`, body, ); return res; }, patch: async ( body: Service.AiObjectDetectionSettings.Patch.Body, ): Promise => { let res: Service.AiObjectDetectionSettings.Patch.Result = await this._patch( this.svAPIEndpoint, this.aiObjectDetectionSettings._path, body, ); return res; }, remove: async ( id: Service.AiObjectDetectionSettings.Remove.ID, ): Promise => { let res: Service.AiObjectDetectionSettings.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionSettings._path + `/${id}`, ); return res; }, }; aiObjectDetectionDetectionSettings = { _path: Repzo._end_points.AI_OBJECT_DETECTION_DETECTION_SETTINGS, find: async (): Promise => { let res: Service.AiObjectDetectionDetectionSettings.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionDetectionSettings._path, ); return res; }, get: async ( id: Service.AiObjectDetectionDetectionSettings.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionDetectionSettings._path + `/${id}`, ); }, create: async ( body: Service.AiObjectDetectionDetectionSettings.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionDetectionSettings._path, body, ); return res; }, update: async ( id: Service.AiObjectDetectionDetectionSettings.Update.ID, body: Service.AiObjectDetectionDetectionSettings.Update.Body, ): Promise => { let res: Service.AiObjectDetectionDetectionSettings.Update.Result = await this._update( this.svAPIEndpoint, this.aiObjectDetectionDetectionSettings._path + `/${id}`, body, ); return res; }, patch: async ( body: Service.AiObjectDetectionDetectionSettings.Patch.Body, ): Promise => { let res: Service.AiObjectDetectionDetectionSettings.Patch.Result = await this._patch( this.svAPIEndpoint, this.aiObjectDetectionDetectionSettings._path, body, ); return res; }, remove: async ( id: Service.AiObjectDetectionDetectionSettings.Remove.ID, ): Promise => { let res: Service.AiObjectDetectionDetectionSettings.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionDetectionSettings._path + `/${id}`, ); return res; }, }; aiObjectDetectionInference = { _path: Repzo._end_points.AI_OBJECT_DETECTION_INFERENCE, create: async ( body: Service.AiObjectDetectionInference.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionInference._path, body, ); return res; }, }; aiObjectDetectionTask = { _path: Repzo._end_points.AI_OBJECT_DETECTION_TASK, find: async ( params?: Service.AiObjectDetectionTask.Find.Params, ): Promise => { let res: Service.AiObjectDetectionTask.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionTask._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionTask.Get.ID, params?: Service.AiObjectDetectionTask.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionTask._path + `/${id}`, params, ); }, create: async ( body: Service.AiObjectDetectionTask.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionTask._path, body, ); return res; }, update: async ( id: Service.AiObjectDetectionTask.Update.ID, body: Service.AiObjectDetectionTask.Update.Body, ): Promise => { let res: Service.AiObjectDetectionTask.Update.Result = await this._update( this.svAPIEndpoint, this.aiObjectDetectionTask._path + `/${id}`, body, ); return res; }, patch: async ( params: Service.AiObjectDetectionTask.Patch.Params, body: Service.AiObjectDetectionTask.Patch.Body, ): Promise => { let res: Service.AiObjectDetectionTask.Patch.Result = await this._patch( this.svAPIEndpoint, this.aiObjectDetectionTask._path, body, params, ); return res; }, remove: async ( id: Service.AiObjectDetectionTask.Remove.ID, ): Promise => { let res: Service.AiObjectDetectionTask.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionTask._path + `/${id}`, ); return res; }, }; aiObjectDetectionSession = { _path: Repzo._end_points.AI_OBJECT_DETECTION_SESSION, find: async ( params?: Service.AiObjectDetectionSession.Find.Params, ): Promise => { let res: Service.AiObjectDetectionSession.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionSession._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionSession.Get.ID, params?: Service.AiObjectDetectionSession.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionSession._path + `/${id}`, params, ); }, create: async ( body: Service.AiObjectDetectionSession.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionSession._path, body, ); return res; }, update: async ( id: Service.AiObjectDetectionSession.Update.ID, body: Service.AiObjectDetectionSession.Update.Body, ): Promise => { let res: Service.AiObjectDetectionSession.Update.Result = await this._update( this.svAPIEndpoint, this.aiObjectDetectionSession._path + `/${id}`, body, ); return res; }, patch: async ( params: Service.AiObjectDetectionSession.Patch.Params, body: Service.AiObjectDetectionSession.Patch.Body, ): Promise => { let res: Service.AiObjectDetectionSession.Patch.Result = await this._patch( this.svAPIEndpoint, this.aiObjectDetectionSession._path, body, params, ); return res; }, remove: async ( id: Service.AiObjectDetectionSession.Remove.ID, params?: Service.AiObjectDetectionSession.Remove.Params, ): Promise => { let res: Service.AiObjectDetectionSession.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionSession._path + `/${id}`, params, ); return res; }, }; activityAiObjectDetectionSessionFrame = { _path: Repzo._end_points.ACTIVITY_AI_OBJECT_DETECTION_SESSION_FRAME, create: async ( body: Service.ActivityAiObjectDetectionSessionFrame.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.activityAiObjectDetectionSessionFrame._path, body, ); return res; }, }; aiObjectDetectionSessionAnalysis = { _path: Repzo._end_points.AI_OBJECT_DETECTION_SESSION_ANALYSIS, find: async ( params?: Service.AiObjectDetectionSessionAnalysis.Find.Params, ): Promise => { let res: Service.AiObjectDetectionSessionAnalysis.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionSessionAnalysis._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionSessionAnalysis.Get.ID, params?: Service.AiObjectDetectionSessionAnalysis.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionSessionAnalysis._path + `/${id}`, params, ); }, create: async ( body: Service.AiObjectDetectionSessionAnalysis.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionSessionAnalysis._path, body, ); return res; }, update: async ( id: Service.AiObjectDetectionSessionAnalysis.Update.ID, body: Service.AiObjectDetectionSessionAnalysis.Update.Body, ): Promise => { let res: Service.AiObjectDetectionSessionAnalysis.Update.Result = await this._update( this.svAPIEndpoint, this.aiObjectDetectionSessionAnalysis._path + `/${id}`, body, ); return res; }, patch: async ( params: Service.AiObjectDetectionSessionAnalysis.Patch.Params, body: Service.AiObjectDetectionSessionAnalysis.Patch.Body, ): Promise => { let res: Service.AiObjectDetectionSessionAnalysis.Patch.Result = await this._patch( this.svAPIEndpoint, this.aiObjectDetectionSessionAnalysis._path, body, params, ); return res; }, remove: async ( id: Service.AiObjectDetectionSessionAnalysis.Remove.ID, ): Promise => { let res: Service.AiObjectDetectionSessionAnalysis.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionSessionAnalysis._path + `/${id}`, ); return res; }, }; aiObjectDetectionSessionElection = { _path: Repzo._end_points.AI_OBJECT_DETECTION_SESSION_ELECTION, create: async ( body: Service.AiObjectDetectionSessionElection.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionSessionElection._path, body, ); return res; }, }; aiObjectDetectionSessionInsight = { _path: Repzo._end_points.AI_OBJECT_DETECTION_SESSION_INSIGHT, find: async ( params?: Service.AiObjectDetectionSessionInsight.Find.Params, ): Promise => { let res: Service.AiObjectDetectionSessionInsight.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionSessionInsight._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionSessionInsight.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionSessionInsight._path + `/${id}`, ); }, create: async ( body: Service.AiObjectDetectionSessionInsight.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionSessionInsight._path, body, ); return res; }, }; aiObjectDetectionMetric = { _path: Repzo._end_points.AI_OBJECT_DETECTION_METRIC, find: async ( params?: Service.AiObjectDetectionMetric.Find.Params, ): Promise => { let res: Service.AiObjectDetectionMetric.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionMetric._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionMetric.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionMetric._path + `/${id}`, ); }, create: async ( body: Service.AiObjectDetectionMetric.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionMetric._path, body, ); return res; }, update: async ( id: Service.AiObjectDetectionMetric.Update.ID, body: Service.AiObjectDetectionMetric.Update.Body, ): Promise => { let res: Service.AiObjectDetectionMetric.Update.Result = await this._update( this.svAPIEndpoint, this.aiObjectDetectionMetric._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.AiObjectDetectionMetric.Remove.ID, ): Promise => { let res: Service.AiObjectDetectionMetric.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionMetric._path + `/${id}`, ); return res; }, }; aiObjectDetectionMetricResult = { _path: Repzo._end_points.AI_OBJECT_DETECTION_METRIC_RESULT, find: async ( params?: Service.AiObjectDetectionMetricResult.Find.Params, ): Promise => { let res: Service.AiObjectDetectionMetricResult.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionMetricResult._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionMetricResult.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionMetricResult._path + `/${id}`, ); }, create: async ( body: Service.AiObjectDetectionMetricResult.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionMetricResult._path, body, ); return res; }, update: async ( id: Service.AiObjectDetectionMetricResult.Update.ID, body: Service.AiObjectDetectionMetricResult.Update.Body, ): Promise => { let res: Service.AiObjectDetectionMetricResult.Update.Result = await this._update( this.svAPIEndpoint, this.aiObjectDetectionMetricResult._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.AiObjectDetectionMetricResult.Remove.ID, ): Promise => { let res: Service.AiObjectDetectionMetricResult.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionMetricResult._path + `/${id}`, ); return res; }, }; aiObjectDetectionMission = { _path: Repzo._end_points.AI_OBJECT_DETECTION_MISSION, find: async ( params?: Service.AiObjectDetectionMission.Find.Params, ): Promise => { let res: Service.AiObjectDetectionMission.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionMission._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionMission.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionMission._path + `/${id}`, ); }, create: async ( body: Service.AiObjectDetectionMission.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionMission._path, body, ); return res; }, update: async ( id: Service.AiObjectDetectionMission.Update.ID, body: Service.AiObjectDetectionMission.Update.Body, ): Promise => { let res: Service.AiObjectDetectionMission.Update.Result = await this._update( this.svAPIEndpoint, this.aiObjectDetectionMission._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.AiObjectDetectionMission.Remove.ID, ): Promise => { let res: Service.AiObjectDetectionMission.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionMission._path + `/${id}`, ); return res; }, }; aiObjectDetectionMissionSet = { _path: Repzo._end_points.AI_OBJECT_DETECTION_MISSION_SET, find: async ( params?: Service.AiObjectDetectionMissionSet.Find.Params, ): Promise => { let res: Service.AiObjectDetectionMissionSet.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionMissionSet._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionMissionSet.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionMissionSet._path + `/${id}`, ); }, create: async ( body: Service.AiObjectDetectionMissionSet.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionMissionSet._path, body, ); return res; }, update: async ( id: Service.AiObjectDetectionMissionSet.Update.ID, body: Service.AiObjectDetectionMissionSet.Update.Body, ): Promise => { let res: Service.AiObjectDetectionMissionSet.Update.Result = await this._update( this.svAPIEndpoint, this.aiObjectDetectionMissionSet._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.AiObjectDetectionMissionSet.Remove.ID, ): Promise => { let res: Service.AiObjectDetectionMissionSet.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionMissionSet._path + `/${id}`, ); return res; }, }; aiObjectDetectionMissionResults = { _path: Repzo._end_points.AI_OBJECT_DETECTION_MISSION_RESULTS, find: async ( params?: Service.AiObjectDetectionMissionResults.Find.Params, ): Promise => { let res: Service.AiObjectDetectionMissionResults.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionMissionResults._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionMissionResults.Get.ID, params?: Service.AiObjectDetectionMissionResults.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionMissionResults._path + `/${id}`, params, ); }, update: async ( id: Service.AiObjectDetectionMissionResults.Update.ID, body: Service.AiObjectDetectionMissionResults.Update.Body, ): Promise => { let res: Service.AiObjectDetectionMissionResults.Update.Result = await this._update( this.svAPIEndpoint, this.aiObjectDetectionMissionResults._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.AiObjectDetectionMissionResults.Remove.ID, ): Promise => { let res: Service.AiObjectDetectionMissionResults.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionMissionResults._path + `/${id}`, ); return res; }, }; aiObjectDetectionAssignmentRule = { _path: Repzo._end_points.AI_OBJECT_DETECTION_ASSIGNMENT_RULE, find: async ( params?: Service.AiObjectDetectionAssignmentRule.Find.Params, ): Promise => { let res: Service.AiObjectDetectionAssignmentRule.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionAssignmentRule._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionAssignmentRule.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionAssignmentRule._path + `/${id}`, ); }, create: async ( body: Service.AiObjectDetectionAssignmentRule.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.aiObjectDetectionAssignmentRule._path, body, ); return res; }, update: async ( id: Service.AiObjectDetectionAssignmentRule.Update.ID, body: Service.AiObjectDetectionAssignmentRule.Update.Body, ): Promise => { let res: Service.AiObjectDetectionAssignmentRule.Update.Result = await this._update( this.svAPIEndpoint, this.aiObjectDetectionAssignmentRule._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.AiObjectDetectionAssignmentRule.Remove.ID, ): Promise => { let res: Service.AiObjectDetectionAssignmentRule.Remove.Result = await this._delete( this.svAPIEndpoint, this.aiObjectDetectionAssignmentRule._path + `/${id}`, ); return res; }, }; aiObjectDetectionAssignedMissions = { _path: Repzo._end_points.AI_OBJECT_DETECTION_ASSIGNED_MISSIONS, find: async ( params: Service.AiObjectDetectionAssignedMissions.Find.Params, ): Promise => { let res: Service.AiObjectDetectionAssignedMissions.Find.Result = await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionAssignedMissions._path, params, ); return res; }, get: async ( id: Service.AiObjectDetectionAssignedMissions.Get.ID, params?: Service.AiObjectDetectionAssignedMissions.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.aiObjectDetectionAssignedMissions._path + `/${id}`, params, ); }, }; objectDetectionAnalyticsReport = { _path: Repzo._end_points.OBJECT_DETECTION_ANALYTICS_REPORT, find: async ( params?: Service.ObjectDetectionAnalyticsReport.Find.Params, ): Promise => { let res: Service.ObjectDetectionAnalyticsReport.Find.Result = await this._fetch( this.svAPIEndpoint, this.objectDetectionAnalyticsReport._path, params, ); return res; }, create: async ( body: Service.ObjectDetectionAnalyticsReport.Create.Body, params?: Service.ObjectDetectionAnalyticsReport.Create.Params, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.objectDetectionAnalyticsReport._path, body, params, ); return res; }, }; available_services = availableService; generateUUID = ({ prefix, suffix, length, }: { prefix?: string; suffix?: string; length: number; }): string => { return generateUUID(prefix, suffix, length); }; core = { updateHeader: (newHeaders: { authorization?: string; refresh_token?: string; }) => { if (newHeaders?.authorization) { this.headers["authorization"] = newHeaders.authorization; } if (newHeaders?.refresh_token) { this.headers["refresh_token"] = newHeaders.refresh_token; } }, reauth: async (): Promise => { const nameSpace = this.nameSpace; const refreshToken = this.refresh_token; if (!nameSpace || !refreshToken) { throw new Error("Missing required parameters for reauth"); } const headers = { "Content-Type": "application/json", Accept: "application/json", "X-NAME-SPACE": nameSpace, refresh_token: refreshToken, }; const res: any = await axios.get( `${this.svAPIEndpoint}/${Repzo._end_points.AUTHENTICATE}`, { headers: headers, timeout: this.timeout }, ); const result: Service.Reauth.Result = res.data; if (result.login_status == "success") { this.core.updateHeader({ authorization: result.access_token, refresh_token: result.refresh_token, }); if (this.reauthCallBackFn) this.reauthCallBackFn(result); } return result; }, }; client = { _path: Repzo._end_points.CLIENT, find: async ( params?: Service.Client.Find.Params, ): Promise => { let res: Service.Client.Find.Result = await this._fetch( this.svAPIEndpoint, this.client._path, params, ); return res; }, get: async ( id: Service.Client.Get.ID, params?: Service.Client.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.client._path + `/${id}`, params, ); }, create: async ( body: Service.Client.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.client._path, body); return res; }, update: async ( id: Service.Client.Update.ID, body: Service.Client.Update.Body, ): Promise => { let res: Service.Client.Update.Result = await this._update( this.svAPIEndpoint, this.client._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Client.Remove.ID, ): Promise => { let res: Service.Client.Remove.Result = await this._delete( this.svAPIEndpoint, this.client._path + `/${id}`, ); return res; }, }; product = { _path: Repzo._end_points.PRODUCT, find: async ( params?: Service.Product.Find.Params, ): Promise => { let res: Service.Product.Find.Result = await this._fetch( this.svAPIEndpoint, this.product._path, params, ); return res; }, get: async ( id: Service.Product.Get.ID, params?: Service.Product.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.product._path + `/${id}`, params, ); }, create: async ( body: Service.Product.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.product._path, body, ); return res; }, update: async ( id: Service.Product.Update.ID, body: Service.Product.Update.Body, ): Promise => { let res: Service.Product.Update.Result = await this._update( this.svAPIEndpoint, this.product._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Product.Remove.ID, ): Promise => { let res: Service.Product.Remove.Result = await this._delete( this.svAPIEndpoint, this.product._path + `/${id}`, ); return res; }, }; variant = { _path: Repzo._end_points.VARIANT, find: async ( params?: Service.Variant.Find.Params, ): Promise => { let res: Service.Variant.Find.Result = await this._fetch( this.svAPIEndpoint, this.variant._path, params, ); return res; }, get: async ( id: Service.Variant.Get.ID, params?: Service.Variant.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.variant._path + `/${id}`, params, ); }, create: async ( body: Service.Variant.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.variant._path, body, ); return res; }, update: async ( id: Service.Variant.Update.ID, body: Service.Variant.Update.Body, ): Promise => { let res: Service.Variant.Update.Result = await this._update( this.svAPIEndpoint, this.variant._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Variant.Remove.ID, ): Promise => { let res: Service.Variant.Remove.Result = await this._delete( this.svAPIEndpoint, this.variant._path + `/${id}`, ); return res; }, }; category = { _path: Repzo._end_points.CATEGORY, find: async ( params?: Service.Category.Find.Params, ): Promise => { let res: Service.Category.Find.Result = await this._fetch( this.svAPIEndpoint, this.category._path, params, ); return res; }, get: async ( id: Service.Category.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.category._path + `/${id}`, ); }, create: async ( body: Service.Category.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.category._path, body, ); return res; }, update: async ( id: Service.Category.Update.ID, body: Service.Category.Update.Body, ): Promise => { let res: Service.Category.Update.Result = await this._update( this.svAPIEndpoint, this.category._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Category.Remove.ID, ): Promise => { let res: Service.Category.Remove.Result = await this._delete( this.svAPIEndpoint, this.category._path + `/${id}`, ); return res; }, }; sub_category = { _path: Repzo._end_points.SUB_CATEGORY, find: async ( params?: Service.SubCategory.Find.Params, ): Promise => { let res: Service.SubCategory.Find.Result = await this._fetch( this.svAPIEndpoint, this.sub_category._path, params, ); return res; }, get: async ( id: Service.SubCategory.Get.ID, params?: Service.SubCategory.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.sub_category._path + `/${id}`, params, ); }, create: async ( body: Service.SubCategory.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.sub_category._path, body, ); return res; }, update: async ( id: Service.SubCategory.Update.ID, body: Service.SubCategory.Update.Body, ): Promise => { let res: Service.SubCategory.Update.Result = await this._update( this.svAPIEndpoint, this.sub_category._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.SubCategory.Remove.ID, ): Promise => { let res: Service.SubCategory.Remove.Result = await this._delete( this.svAPIEndpoint, this.sub_category._path + `/${id}`, ); return res; }, }; brand = { _path: Repzo._end_points.BRAND, find: async ( params?: Service.Brand.Find.Params, ): Promise => { let res: Service.Brand.Find.Result = await this._fetch( this.svAPIEndpoint, this.brand._path, params, ); return res; }, get: async ( id: Service.Brand.Get.ID, ): Promise => { return await this._fetch(this.svAPIEndpoint, this.brand._path + `/${id}`); }, create: async ( body: Service.Brand.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.brand._path, body); return res; }, update: async ( id: Service.Brand.Update.ID, body: Service.Brand.Update.Body, ): Promise => { let res: Service.Brand.Update.Result = await this._update( this.svAPIEndpoint, this.brand._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Brand.Remove.ID, ): Promise => { let res: Service.Brand.Remove.Result = await this._delete( this.svAPIEndpoint, this.brand._path + `/${id}`, ); return res; }, }; product_group = { _path: Repzo._end_points.PRODUCT_GROUP, find: async ( params?: Service.ProductGroup.Find.Params, ): Promise => { let res: Service.ProductGroup.Find.Result = await this._fetch( this.svAPIEndpoint, this.product_group._path, params, ); return res; }, get: async ( id: Service.ProductGroup.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.product_group._path + `/${id}`, ); }, create: async ( body: Service.ProductGroup.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.product_group._path, body, ); return res; }, update: async ( id: Service.ProductGroup.Update.ID, body: Service.ProductGroup.Update.Body, ): Promise => { let res: Service.ProductGroup.Update.Result = await this._update( this.svAPIEndpoint, this.product_group._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.ProductGroup.Remove.ID, ): Promise => { let res: Service.ProductGroup.Remove.Result = await this._delete( this.svAPIEndpoint, this.product_group._path + `/${id}`, ); return res; }, }; tax = { _path: Repzo._end_points.TAX, find: async ( params?: Service.Tax.Find.Params, ): Promise => { let res: Service.Tax.Find.Result = await this._fetch( this.svAPIEndpoint, this.tax._path, params, ); return res; }, get: async (id: Service.Tax.Get.ID): Promise => { return await this._fetch(this.svAPIEndpoint, this.tax._path + `/${id}`); }, create: async ( body: Service.Tax.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.tax._path, body); return res; }, update: async ( id: Service.Tax.Update.ID, body: Service.Tax.Update.Body, ): Promise => { let res: Service.Tax.Update.Result = await this._update( this.svAPIEndpoint, this.tax._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Tax.Remove.ID, ): Promise => { let res: Service.Tax.Remove.Result = await this._delete( this.svAPIEndpoint, this.tax._path + `/${id}`, ); return res; }, }; measureunit = { _path: Repzo._end_points.MEASUREUNIT, find: async ( params?: Service.MeasureUnit.Find.Params, ): Promise => { let res: Service.MeasureUnit.Find.Result = await this._fetch( this.svAPIEndpoint, this.measureunit._path, params, ); return res; }, get: async ( id: Service.MeasureUnit.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.measureunit._path + `/${id}`, ); }, create: async ( body: Service.MeasureUnit.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.measureunit._path, body, ); return res; }, update: async ( id: Service.MeasureUnit.Update.ID, body: Service.MeasureUnit.Update.Body, ): Promise => { let res: Service.MeasureUnit.Update.Result = await this._update( this.svAPIEndpoint, this.measureunit._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.MeasureUnit.Remove.ID, ): Promise => { let res: Service.MeasureUnit.Remove.Result = await this._delete( this.svAPIEndpoint, this.measureunit._path + `/${id}`, ); return res; }, }; measureunitFamily = { _path: Repzo._end_points.MEASUREUNIT_FAMILY, find: async ( params?: Service.MeasureUnitFamily.Find.Params, ): Promise => { let res: Service.MeasureUnitFamily.Find.Result = await this._fetch( this.svAPIEndpoint, this.measureunitFamily._path, params, ); return res; }, get: async ( id: Service.MeasureUnitFamily.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.measureunitFamily._path + `/${id}`, ); }, create: async ( body: Service.MeasureUnitFamily.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.measureunitFamily._path, body, ); return res; }, update: async ( id: Service.MeasureUnitFamily.Update.ID, body: Service.MeasureUnitFamily.Update.Body, ): Promise => { let res: Service.MeasureUnitFamily.Update.Result = await this._update( this.svAPIEndpoint, this.measureunitFamily._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.MeasureUnitFamily.Remove.ID, ): Promise => { let res: Service.MeasureUnitFamily.Remove.Result = await this._delete( this.svAPIEndpoint, this.measureunitFamily._path + `/${id}`, ); return res; }, }; media = { _path: Repzo._end_points.MEDIA, find: async ( params?: Service.Media.Find.Params, ): Promise => { let res: Service.Media.Find.Result = await this._fetch( this.svAPIEndpoint, this.media._path, params, ); return res; }, get: async ( id: Service.Media.Get.ID, ): Promise => { return await this._fetch(this.svAPIEndpoint, this.media._path + `/${id}`); }, create: async ( body: Service.Media.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.media._path, body); return res; }, update: async ( id: Service.Media.Update.ID, body: Service.Media.Update.Body, ): Promise => { let res: Service.Media.Update.Result = await this._update( this.svAPIEndpoint, this.media._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Media.Remove.ID, ): Promise => { let res: Service.Media.Remove.Result = await this._delete( this.svAPIEndpoint, this.media._path + `/${id}`, ); return res; }, }; priceList = { _path: Repzo._end_points.PRICELIST, find: async ( params?: Service.PriceList.Find.Params, ): Promise => { let res: Service.PriceList.Find.Result = await this._fetch( this.svAPIEndpoint, this.priceList._path, params, ); return res; }, get: async ( id: Service.PriceList.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.priceList._path + `/${id}`, ); }, create: async ( body: Service.PriceList.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.priceList._path, body, ); return res; }, update: async ( id: Service.PriceList.Update.ID, body: Service.PriceList.Update.Body, ): Promise => { let res: Service.PriceList.Update.Result = await this._update( this.svAPIEndpoint, this.priceList._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.PriceList.Remove.ID, ): Promise => { let res: Service.PriceList.Remove.Result = await this._delete( this.svAPIEndpoint, this.priceList._path + `/${id}`, ); return res; }, }; priceListItem = { _path: Repzo._end_points.PRICELIST_ITEM, find: async ( params?: Service.PriceListItem.Find.Params, ): Promise => { let res: Service.PriceListItem.Find.Result = await this._fetch( this.svAPIEndpoint, this.priceListItem._path, params, ); return res; }, get: async ( id: Service.PriceListItem.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.priceListItem._path + `/${id}`, ); }, create: async ( body: Service.PriceListItem.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.priceListItem._path, body, ); return res; }, update: async ( id: Service.PriceListItem.Update.ID, body: Service.PriceListItem.Update.Body, ): Promise => { let res: Service.PriceListItem.Update.Result = await this._update( this.svAPIEndpoint, this.priceListItem._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.PriceListItem.Remove.ID, ): Promise => { let res: Service.PriceListItem.Remove.Result = await this._delete( this.svAPIEndpoint, this.priceListItem._path + `/${id}`, ); return res; }, }; team = { _path: Repzo._end_points.TEAM, find: async ( params?: Service.Team.Find.Params, ): Promise => { let res: Service.Team.Find.Result = await this._fetch( this.svAPIEndpoint, this.team._path, params, ); return res; }, get: async (id: Service.Team.Get.ID): Promise => { return await this._fetch(this.svAPIEndpoint, this.team._path + `/${id}`); }, create: async ( body: Service.Team.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.team._path, body); return res; }, update: async ( id: Service.Team.Update.ID, body: Service.Team.Update.Body, ): Promise => { let res: Service.Team.Update.Result = await this._update( this.svAPIEndpoint, this.team._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Team.Remove.ID, ): Promise => { let res: Service.Team.Remove.Result = await this._delete( this.svAPIEndpoint, this.team._path + `/${id}`, ); return res; }, }; returnReason = { _path: Repzo._end_points.RETURN_REASON, find: async ( params?: Service.ReturnReason.Find.Params, ): Promise => { let res: Service.ReturnReason.Find.Result = await this._fetch( this.svAPIEndpoint, this.returnReason._path, params, ); return res; }, get: async ( id: Service.ReturnReason.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.returnReason._path + `/${id}`, ); }, create: async ( body: Service.ReturnReason.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.returnReason._path, body, ); return res; }, update: async ( id: Service.ReturnReason.Update.ID, body: Service.ReturnReason.Update.Body, ): Promise => { let res: Service.ReturnReason.Update.Result = await this._update( this.svAPIEndpoint, this.returnReason._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.ReturnReason.Remove.ID, ): Promise => { let res: Service.ReturnReason.Remove.Result = await this._delete( this.svAPIEndpoint, this.returnReason._path + `/${id}`, ); return res; }, }; rep = { _path: Repzo._end_points.REP, find: async ( params?: Service.Rep.Find.Params, ): Promise => { let res: Service.Rep.Find.Result = await this._fetch( this.svAPIEndpoint, this.rep._path, params, ); return res; }, get: async ( id: Service.Rep.Get.ID, params?: Service.Rep.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.rep._path + `/${id}`, params, ); }, create: async ( body: Service.Rep.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.rep._path, body); return res; }, update: async ( id: Service.Rep.Update.ID, body: Service.Rep.Update.Body, ): Promise => { let res: Service.Rep.Update.Result = await this._update( this.svAPIEndpoint, this.rep._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Rep.Remove.ID, ): Promise => { let res: Service.Rep.Remove.Result = await this._delete( this.svAPIEndpoint, this.rep._path + `/${id}`, ); return res; }, }; tag = { _path: Repzo._end_points.TAG, find: async ( params?: Service.Tag.Find.Params, ): Promise => { let res: Service.Tag.Find.Result = await this._fetch( this.svAPIEndpoint, this.tag._path, params, ); return res; }, get: async (id: Service.Tag.Get.ID): Promise => { return await this._fetch(this.svAPIEndpoint, this.tag._path + `/${id}`); }, create: async ( body: Service.Tag.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.tag._path, body); return res; }, update: async ( id: Service.Tag.Update.ID, body: Service.Tag.Update.Body, ): Promise => { let res: Service.Tag.Update.Result = await this._update( this.svAPIEndpoint, this.tag._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Tag.Remove.ID, ): Promise => { let res: Service.Tag.Remove.Result = await this._delete( this.svAPIEndpoint, this.tag._path + `/${id}`, ); return res; }, }; warehouse = { _path: Repzo._end_points.WAREHOUSE, find: async ( params?: Service.Warehouse.Find.Params, ): Promise => { let res: Service.Warehouse.Find.Result = await this._fetch( this.svAPIEndpoint, this.warehouse._path, params, ); return res; }, get: async ( id: Service.Warehouse.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.warehouse._path + `/${id}`, ); }, create: async ( body: Service.Warehouse.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.warehouse._path, body, ); return res; }, update: async ( id: Service.Warehouse.Update.ID, body: Service.Warehouse.Update.Body, ): Promise => { let res: Service.Warehouse.Update.Result = await this._update( this.svAPIEndpoint, this.warehouse._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Warehouse.Remove.ID, ): Promise => { let res: Service.Warehouse.Remove.Result = await this._delete( this.svAPIEndpoint, this.warehouse._path + `/${id}`, ); return res; }, }; route = { _path: Repzo._end_points.ROUTE, find: async ( params?: Service.Route.Find.Params, ): Promise => { let res: Service.Route.Find.Result = await this._fetch( this.svAPIEndpoint, this.route._path, params, ); return res; }, get: async ( id: Service.Route.Get.ID, ): Promise => { return await this._fetch(this.svAPIEndpoint, this.route._path + `/${id}`); }, create: async ( body: Service.Route.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.route._path, body); return res; }, update: async ( id: Service.Route.Update.ID, body: Service.Route.Update.Body, ): Promise => { let res: Service.Route.Update.Result = await this._update( this.svAPIEndpoint, this.route._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Route.Remove.ID, ): Promise => { let res: Service.Route.Remove.Result = await this._delete( this.svAPIEndpoint, this.route._path + `/${id}`, ); return res; }, }; geoZone = { _path: Repzo._end_points.GEO_ZONE, find: async ( params?: Service.GeoZone.Find.Params, ): Promise => { let res: Service.GeoZone.Find.Result = await this._fetch( this.svAPIEndpoint, this.geoZone._path, params, ); return res; }, get: async ( id: Service.GeoZone.Get.ID, params?: Service.GeoZone.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.geoZone._path + `/${id}`, params, ); }, create: async ( body: Service.GeoZone.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.geoZone._path, body, ); return res; }, update: async ( id: Service.GeoZone.Update.ID, body: Service.GeoZone.Update.Body, ): Promise => { let res: Service.GeoZone.Update.Result = await this._update( this.svAPIEndpoint, this.geoZone._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.GeoZone.Remove.ID, ): Promise => { let res: Service.GeoZone.Remove.Result = await this._delete( this.svAPIEndpoint, this.geoZone._path + `/${id}`, ); return res; }, }; productModifiersGroup = { _path: Repzo._end_points.PRODUCT_MODIFIERS_GROUP, find: async ( params?: Service.ProductModifiersGroup.Find.Params, ): Promise => { let res: Service.ProductModifiersGroup.Find.Result = await this._fetch( this.svAPIEndpoint, this.productModifiersGroup._path, params, ); return res; }, get: async ( id: Service.ProductModifiersGroup.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.productModifiersGroup._path + `/${id}`, ); }, create: async ( body: Service.ProductModifiersGroup.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.productModifiersGroup._path, body, ); return res; }, update: async ( id: Service.ProductModifiersGroup.Update.ID, body: Service.ProductModifiersGroup.Update.Body, ): Promise => { let res: Service.ProductModifiersGroup.Update.Result = await this._update( this.svAPIEndpoint, this.productModifiersGroup._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.ProductModifiersGroup.Remove.ID, ): Promise => { let res: Service.ProductModifiersGroup.Remove.Result = await this._delete( this.svAPIEndpoint, this.productModifiersGroup._path + `/${id}`, ); return res; }, }; channel = { _path: Repzo._end_points.CHANNEL, find: async ( params?: Service.Channel.Find.Params, ): Promise => { let res: Service.Channel.Find.Result = await this._fetch( this.svAPIEndpoint, this.channel._path, params, ); return res; }, get: async ( id: Service.Channel.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.channel._path + `/${id}`, ); }, create: async ( body: Service.Channel.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.channel._path, body, ); return res; }, update: async ( id: Service.Channel.Update.ID, body: Service.Channel.Update.Body, ): Promise => { let res: Service.Channel.Update.Result = await this._update( this.svAPIEndpoint, this.channel._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Channel.Remove.ID, ): Promise => { let res: Service.Channel.Remove.Result = await this._delete( this.svAPIEndpoint, this.channel._path + `/${id}`, ); return res; }, }; speciality = { _path: Repzo._end_points.SPECIALITY, find: async ( params?: Service.Speciality.Find.Params, ): Promise => { let res: Service.Speciality.Find.Result = await this._fetch( this.svAPIEndpoint, this.speciality._path, params, ); return res; }, get: async ( id: Service.Speciality.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.speciality._path + `/${id}`, ); }, create: async ( body: Service.Speciality.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.speciality._path, body, ); return res; }, update: async ( id: Service.Speciality.Update.ID, body: Service.Speciality.Update.Body, ): Promise => { let res: Service.Speciality.Update.Result = await this._update( this.svAPIEndpoint, this.speciality._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Speciality.Remove.ID, ): Promise => { let res: Service.Speciality.Remove.Result = await this._delete( this.svAPIEndpoint, this.speciality._path + `/${id}`, ); return res; }, }; clientContact = { _path: Repzo._end_points.CLIENT_CONTACT, find: async ( params?: Service.ClientContact.Find.Params, ): Promise => { let res: Service.ClientContact.Find.Result = await this._fetch( this.svAPIEndpoint, this.clientContact._path, params, ); return res; }, get: async ( id: Service.ClientContact.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.clientContact._path + `/${id}`, ); }, create: async ( body: Service.ClientContact.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.clientContact._path, body, ); return res; }, update: async ( id: Service.ClientContact.Update.ID, body: Service.ClientContact.Update.Body, ): Promise => { let res: Service.ClientContact.Update.Result = await this._update( this.svAPIEndpoint, this.clientContact._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.ClientContact.Remove.ID, ): Promise => { let res: Service.ClientContact.Remove.Result = await this._delete( this.svAPIEndpoint, this.clientContact._path + `/${id}`, ); return res; }, }; paymentTerm = { _path: Repzo._end_points.PAYMENT_TERM, find: async ( params?: Service.PaymentTerm.Find.Params, ): Promise => { let res: Service.PaymentTerm.Find.Result = await this._fetch( this.svAPIEndpoint, this.paymentTerm._path, params, ); return res; }, get: async ( id: Service.PaymentTerm.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.paymentTerm._path + `/${id}`, ); }, create: async ( body: Service.PaymentTerm.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.paymentTerm._path, body, ); return res; }, update: async ( id: Service.PaymentTerm.Update.ID, body: Service.PaymentTerm.Update.Body, ): Promise => { let res: Service.PaymentTerm.Update.Result = await this._update( this.svAPIEndpoint, this.paymentTerm._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.PaymentTerm.Remove.ID, ): Promise => { let res: Service.PaymentTerm.Remove.Result = await this._delete( this.svAPIEndpoint, this.paymentTerm._path + `/${id}`, ); return res; }, }; bank = { _path: Repzo._end_points.BANK, find: async ( params?: Service.Bank.Find.Params, ): Promise => { let res: Service.Bank.Find.Result = await this._fetch( this.svAPIEndpoint, this.bank._path, params, ); return res; }, get: async (id: Service.Bank.Get.ID): Promise => { return await this._fetch(this.svAPIEndpoint, this.bank._path + `/${id}`); }, create: async ( body: Service.Bank.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.bank._path, body); return res; }, update: async ( id: Service.Bank.Update.ID, body: Service.Bank.Update.Body, ): Promise => { let res: Service.Bank.Update.Result = await this._update( this.svAPIEndpoint, this.bank._path + `/${id}`, body, ); return res; }, }; bank_list = { _path: Repzo._end_points.BANK_LIST, find: async ( params?: Service.BankList.Find.Params, ): Promise => { let res: Service.BankList.Find.Result = await this._fetch( this.svAPIEndpoint, this.bank_list._path, params, ); return res; }, get: async ( id: Service.BankList.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.bank_list._path + `/${id}`, ); }, create: async ( body: Service.BankList.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.bank_list._path, body, ); return res; }, update: async ( id: Service.BankList.Update.ID, body: Service.BankList.Update.Body, ): Promise => { let res: Service.BankList.Update.Result = await this._update( this.svAPIEndpoint, this.bank_list._path + `/${id}`, body, ); return res; }, }; customStatus = { _path: Repzo._end_points.CUSTOM_STATUS, find: async ( params?: Service.CustomStatus.Find.Params, ): Promise => { let res: Service.CustomStatus.Find.Result = await this._fetch( this.svAPIEndpoint, this.customStatus._path, params, ); return res; }, get: async ( id: Service.CustomStatus.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.customStatus._path + `/${id}`, ); }, create: async ( body: Service.CustomStatus.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.customStatus._path, body, ); return res; }, update: async ( id: Service.CustomStatus.Update.ID, body: Service.CustomStatus.Update.Body, ): Promise => { let res: Service.CustomStatus.Update.Result = await this._update( this.svAPIEndpoint, this.customStatus._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.CustomStatus.Remove.ID, ): Promise => { let res: Service.CustomStatus.Remove.Result = await this._delete( this.svAPIEndpoint, this.customStatus._path + `/${id}`, ); return res; }, }; customList = { _path: Repzo._end_points.CUSTOM_LIST, find: async ( params?: Service.CustomList.Find.Params, ): Promise => { let res: Service.CustomList.Find.Result = await this._fetch( this.svAPIEndpoint, this.customList._path, params, ); return res; }, get: async ( id: Service.CustomList.Get.ID, params?: Service.CustomList.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.customList._path + `/${id}`, params, ); }, create: async ( body: Service.CustomList.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.customList._path, body, ); return res; }, update: async ( id: Service.CustomList.Update.ID, body: Service.CustomList.Update.Body, ): Promise => { let res: Service.CustomList.Update.Result = await this._update( this.svAPIEndpoint, this.customList._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.CustomList.Remove.ID, ): Promise => { let res: Service.CustomList.Remove.Result = await this._delete( this.svAPIEndpoint, this.customList._path + `/${id}`, ); return res; }, }; customListItem = { _path: Repzo._end_points.CUSTOM_LIST_ITEM, find: async ( params?: Service.CustomListItem.Find.Params, ): Promise => { let res: Service.CustomListItem.Find.Result = await this._fetch( this.svAPIEndpoint, this.customListItem._path, params, ); return res; }, get: async ( id: Service.CustomListItem.Get.ID, params?: Service.CustomListItem.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.customListItem._path + `/${id}`, params, ); }, create: async ( body: Service.CustomListItem.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.customListItem._path, body, ); return res; }, update: async ( id: Service.CustomListItem.Update.ID, body: Service.CustomListItem.Update.Body, ): Promise => { let res: Service.CustomListItem.Update.Result = await this._update( this.svAPIEndpoint, this.customListItem._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.CustomListItem.Remove.ID, ): Promise => { let res: Service.CustomListItem.Remove.Result = await this._delete( this.svAPIEndpoint, this.customListItem._path + `/${id}`, ); return res; }, }; inventoryAdjustmentReason = { _path: Repzo._end_points.INVENTORY_ADJUSTMENT_REASON, find: async ( params?: Service.InventoryAdjustmentReason.Find.Params, ): Promise => { let res: Service.InventoryAdjustmentReason.Find.Result = await this._fetch( this.svAPIEndpoint, this.inventoryAdjustmentReason._path, params, ); return res; }, get: async ( id: Service.InventoryAdjustmentReason.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.inventoryAdjustmentReason._path + `/${id}`, ); }, create: async ( body: Service.InventoryAdjustmentReason.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.inventoryAdjustmentReason._path, body, ); return res; }, update: async ( id: Service.InventoryAdjustmentReason.Update.ID, body: Service.InventoryAdjustmentReason.Update.Body, ): Promise => { let res: Service.InventoryAdjustmentReason.Update.Result = await this._update( this.svAPIEndpoint, this.customListItem._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.InventoryAdjustmentReason.Remove.ID, ): Promise => { let res: Service.InventoryAdjustmentReason.Remove.Result = await this._delete( this.svAPIEndpoint, this.inventoryAdjustmentReason._path + `/${id}`, ); return res; }, }; workorder = { _path: Repzo._end_points.WORKORDER, find: async ( params?: Service.Workorder.Find.Params, ): Promise => { let res: Service.Workorder.Find.Result = await this._fetch( this.svAPIEndpoint, this.workorder._path, params, ); return res; }, get: async ( id: Service.Workorder.Get.ID, params?: Service.Workorder.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.workorder._path + `/${id}`, params, ); }, create: async ( body: Service.Workorder.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.workorder._path, body, ); return res; }, update: async ( id: Service.Workorder.Update.ID, body: Service.Workorder.Update.Body, ): Promise => { let res: Service.Workorder.Update.Result = await this._update( this.svAPIEndpoint, this.workorder._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Workorder.Remove.ID, ): Promise => { let res: Service.Workorder.Remove.Result = await this._delete( this.svAPIEndpoint, this.workorder._path + `/${id}`, ); return res; }, }; workorderRequest = { _path: Repzo._end_points.WORKORDER_REQUEST, find: async ( params?: Service.WorkorderRequest.Find.Params, ): Promise => { let res: Service.WorkorderRequest.Find.Result = await this._fetch( this.svAPIEndpoint, this.workorderRequest._path, params, ); return res; }, get: async ( id: Service.WorkorderRequest.Get.ID, params?: Service.WorkorderRequest.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.workorderRequest._path + `/${id}`, params, ); }, create: async ( body: Service.WorkorderRequest.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.workorderRequest._path, body, ); return res; }, update: async ( id: Service.WorkorderRequest.Update.ID, body: Service.WorkorderRequest.Update.Body, ): Promise => { let res: Service.WorkorderRequest.Update.Result = await this._update( this.svAPIEndpoint, this.workorderRequest._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.WorkorderRequest.Remove.ID, ): Promise => { let res: Service.WorkorderRequest.Remove.Result = await this._delete( this.svAPIEndpoint, this.workorderRequest._path + `/${id}`, ); return res; }, }; supplier = { _path: Repzo._end_points.SUPPLIER, find: async ( params?: Service.Supplier.Find.Params, ): Promise => { let res: Service.Supplier.Find.Result = await this._fetch( this.svAPIEndpoint, this.supplier._path, params, ); return res; }, get: async ( id: Service.Supplier.Get.ID, params?: Service.Supplier.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.supplier._path + `/${id}`, params, ); }, create: async ( body: Service.Supplier.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.supplier._path, body, ); return res; }, update: async ( id: Service.Supplier.Update.ID, body: Service.Supplier.Update.Body, ): Promise => { let res: Service.Supplier.Update.Result = await this._update( this.svAPIEndpoint, this.supplier._path + `/${id}`, body, ); return res; }, }; quickConvertToPdf = { _path: Repzo._end_points.QUICK_CONVERT_TO_PDF, find: async ( params?: Service.QuickConvertToPdf.Find.Params, ): Promise => { let res: Service.QuickConvertToPdf.Find.Result = await this._fetch( this.svAPIEndpoint, this.quickConvertToPdf._path, params, ); return res; }, get: async ( id: Service.QuickConvertToPdf.Get.ID, params?: Service.QuickConvertToPdf.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.quickConvertToPdf._path + `/${id}`, params, ); }, create: async ( body: Service.QuickConvertToPdf.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.quickConvertToPdf._path, body, ); return res; }, remove: async ( id: Service.QuickConvertToPdf.Remove.ID, ): Promise => { let res: Service.QuickConvertToPdf.Remove.Result = await this._delete( this.svAPIEndpoint, this.quickConvertToPdf._path + `/${id}`, ); return res; }, }; visit = { _path: Repzo._end_points.VISIT, find: async ( params?: Service.Visit.Find.Params, ): Promise => { let res: Service.Visit.Find.Result = await this._fetch( this.svAPIEndpoint, this.visit._path, params, ); return res; }, get: async ( id: Service.Visit.Get.ID, params?: Service.Visit.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.visit._path + `/${id}`, params, ); }, create: async ( body: Service.Visit.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.visit._path, body); return res; }, update: async ( id: Service.Visit.Update.ID, body: Service.Visit.Update.Body, ): Promise => { let res: Service.Visit.Update.Result = await this._update( this.svAPIEndpoint, this.visit._path + `/${id}`, body, ); return res; }, }; activityFeedback = { _path: Repzo._end_points.ACTIVITY_FEEDBACK, find: async ( params?: Service.ActivityFeedback.Find.Params, ): Promise => { let res: Service.ActivityFeedback.Find.Result = await this._fetch( this.svAPIEndpoint, this.activityFeedback._path, params, ); return res; }, get: async ( id: Service.ActivityFeedback.Get.ID, params?: Service.ActivityFeedback.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.activityFeedback._path + `/${id}`, params, ); }, create: async ( body: Service.ActivityFeedback.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.activityFeedback._path, body, ); return res; }, update: async ( id: Service.ActivityFeedback.Update.ID, body: Service.ActivityFeedback.Update.Body, ): Promise => { let res: Service.ActivityFeedback.Update.Result = await this._update( this.svAPIEndpoint, this.activityFeedback._path + `/${id}`, body, ); return res; }, }; activityFeedbackV2 = { _path: Repzo._end_points.ACTIVITY_FEEDBACKV2, find: async ( params?: Service.ActivityFeedbackV2.Find.Params, ): Promise => { let res: Service.ActivityFeedbackV2.Find.Result = await this._fetch( this.svAPIEndpoint, this.activityFeedbackV2._path, params, ); return res; }, get: async ( id: Service.ActivityFeedbackV2.Get.ID, params?: Service.ActivityFeedbackV2.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.activityFeedbackV2._path + `/${id}`, params, ); }, create: async ( body: Service.ActivityFeedbackV2.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.activityFeedbackV2._path, body, ); return res; }, update: async ( id: Service.ActivityFeedbackV2.Update.ID, body: Service.ActivityFeedbackV2.Update.Body, ): Promise => { let res: Service.ActivityFeedbackV2.Update.Result = await this._update( this.svAPIEndpoint, this.activityFeedbackV2._path + `/${id}`, body, ); return res; }, }; feedbackOption = { _path: Repzo._end_points.FEEDBACK_OPTION, find: async ( params?: Service.FeedbackOption.Find.Params, ): Promise => { let res: Service.FeedbackOption.Find.Result = await this._fetch( this.svAPIEndpoint, this.feedbackOption._path, params, ); return res; }, get: async ( id: Service.FeedbackOption.Get.ID, params?: Service.FeedbackOption.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.feedbackOption._path + `/${id}`, params, ); }, create: async ( body: Service.FeedbackOption.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.feedbackOption._path, body, ); return res; }, update: async ( id: Service.FeedbackOption.Update.ID, body: Service.FeedbackOption.Update.Body, ): Promise => { let res: Service.FeedbackOption.Update.Result = await this._update( this.svAPIEndpoint, this.feedbackOption._path + `/${id}`, body, ); return res; }, }; invoice = { _path: Repzo._end_points.INVOICE, find: async ( params?: Service.FullInvoice.Find.Params, ): Promise => { let res: Service.FullInvoice.Find.Result = await this._fetch( this.svAPIEndpoint, this.invoice._path, params, ); return res; }, get: async ( id: Service.FullInvoice.Get.ID, params?: Service.FullInvoice.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.invoice._path + `/${id}`, params, ); }, create: async ( body: Service.FullInvoice.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.invoice._path, body, ); return res; }, update: async ( id: Service.FullInvoice.Update.ID, body: Service.FullInvoice.Update.Body, ): Promise => { let res: Service.FullInvoice.Update.Result = await this._update( this.svAPIEndpoint, this.invoice._path + `/${id}`, body, ); return res; }, }; proforma = { _path: Repzo._end_points.PROFORMA, find: async ( params?: Service.Proforma.Find.Params, ): Promise => { let res: Service.Proforma.Find.Result = await this._fetch( this.svAPIEndpoint, this.proforma._path, params, ); return res; }, get: async ( id: Service.Proforma.Get.ID, params?: Service.Proforma.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.proforma._path + `/${id}`, params, ); }, create: async ( body: Service.Proforma.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.proforma._path, body, ); return res; }, update: async ( id: Service.Proforma.Update.ID, body: Service.Proforma.Update.Body, ): Promise => { let res: Service.Proforma.Update.Result = await this._update( this.svAPIEndpoint, this.proforma._path + `/${id}`, body, ); return res; }, }; payment = { _path: Repzo._end_points.PAYMENT, find: async ( params?: Service.Payment.Find.Params, ): Promise => { let res: Service.Payment.Find.Result = await this._fetch( this.svAPIEndpoint, this.payment._path, params, ); return res; }, get: async ( id: Service.Payment.Get.ID, params?: Service.Payment.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.payment._path + `/${id}`, params, ); }, create: async ( body: Service.Payment.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.payment._path, body, ); return res; }, update: async ( id: Service.Payment.Update.ID, body: Service.Payment.Update.Body, ): Promise => { let res: Service.Payment.Update.Result = await this._update( this.svAPIEndpoint, this.payment._path + `/${id}`, body, ); return res; }, }; refund = { _path: Repzo._end_points.REFUND, find: async ( params?: Service.Refund.Find.Params, ): Promise => { let res: Service.Refund.Find.Result = await this._fetch( this.svAPIEndpoint, this.refund._path, params, ); return res; }, get: async ( id: Service.Refund.Get.ID, params?: Service.Refund.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.refund._path + `/${id}`, params, ); }, create: async ( body: Service.Refund.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.refund._path, body); return res; }, update: async ( id: Service.Refund.Update.ID, body: Service.Refund.Update.Body, ): Promise => { let res: Service.Refund.Update.Result = await this._update( this.svAPIEndpoint, this.refund._path + `/${id}`, body, ); return res; }, }; settlement = { _path: Repzo._end_points.SETTLEMENT, find: async ( params?: Service.Settlement.Find.Params, ): Promise => { let res: Service.Settlement.Find.Result = await this._fetch( this.svAPIEndpoint, this.settlement._path, params, ); return res; }, get: async ( id: Service.Settlement.Get.ID, params?: Service.Settlement.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.settlement._path + `/${id}`, params, ); }, create: async ( body: Service.Settlement.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.settlement._path, body, ); return res; }, }; void_settlement = { _path: Repzo._end_points.VOID_SETTLEMENT, create: async ( body: Service.VoidSettlement.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.void_settlement._path, body, ); return res; }, }; check = { _path: Repzo._end_points.CHECK, find: async ( params?: Service.Check.Find.Params, ): Promise => { let res: Service.Check.Find.Result = await this._fetch( this.svAPIEndpoint, this.check._path, params, ); return res; }, get: async ( id: Service.Check.Get.ID, params?: Service.Check.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.check._path + `/${id}`, params, ); }, create: async ( body: Service.Check.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.check._path, body); return res; }, }; day = { _path: Repzo._end_points.DAY, find: async ( params?: Service.Day.Find.Params, ): Promise => { let res: Service.Day.Find.Result = await this._fetch( this.svAPIEndpoint, this.day._path, params, ); return res; }, get: async ( id: Service.Day.Get.ID, params?: Service.Day.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.day._path + `/${id}`, params, ); }, create: async ( body: Service.Day.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.day._path, body); return res; }, }; dayShift = { _path: Repzo._end_points.DAY_SHIFT, find: async ( params?: Service.DayShift.Find.Params, ): Promise => { let res: Service.DayShift.Find.Result = await this._fetch( this.svAPIEndpoint, this.dayShift._path, params, ); return res; }, get: async ( id: Service.DayShift.Get.ID, params?: Service.DayShift.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.dayShift._path + `/${id}`, params, ); }, create: async ( body: Service.DayShift.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.dayShift._path, body, ); return res; }, update: async ( id: Service.DayShift.Update.ID, body: Service.DayShift.Update.Body, ): Promise => { let res: Service.DayShift.Update.Result = await this._update( this.svAPIEndpoint, this.dayShift._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.DayShift.Remove.ID, ): Promise => { let res: Service.DayShift.Remove.Result = await this._delete( this.svAPIEndpoint, this.dayShift._path + `/${id}`, ); return res; }, }; receivingMaterial = { _path: Repzo._end_points.RECEIVING_MATERIAL, find: async ( params?: Service.ReceivingMaterial.Find.Params, ): Promise => { let res: Service.ReceivingMaterial.Find.Result = await this._fetch( this.svAPIEndpoint, this.receivingMaterial._path, params, ); return res; }, get: async ( id: Service.ReceivingMaterial.Get.ID, params?: Service.ReceivingMaterial.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.receivingMaterial._path + `/${id}`, params, ); }, create: async ( body: Service.ReceivingMaterial.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.receivingMaterial._path, body, ); return res; }, update: async ( id: Service.ReceivingMaterial.Update.ID, body: Service.ReceivingMaterial.Update.Body, ): Promise => { let res: Service.ReceivingMaterial.Update.Result = await this._update( this.svAPIEndpoint, this.receivingMaterial._path + `/${id}`, body, ); return res; }, }; adjustAccount = { _path: Repzo._end_points.ADJUST_ACCOUNT, find: async ( params?: Service.AdjustAccount.Find.Params, ): Promise => { let res: Service.AdjustAccount.Find.Result = await this._fetch( this.svAPIEndpoint, this.adjustAccount._path, params, ); return res; }, get: async ( id: Service.AdjustAccount.Get.ID, params?: Service.AdjustAccount.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.adjustAccount._path + `/${id}`, params, ); }, create: async ( body: Service.AdjustAccount.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.adjustAccount._path, body, ); return res; }, }; transfer = { _path: Repzo._end_points.TRANSFER, find: async ( params?: Service.Transfer.Find.Params, ): Promise => { let res: Service.Transfer.Find.Result = await this._fetch( this.svAPIEndpoint, this.transfer._path, params, ); return res; }, get: async ( id: Service.Transfer.Get.ID, params?: Service.Transfer.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.transfer._path + `/${id}`, params, ); }, create: async ( body: Service.Transfer.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.transfer._path, body, ); return res; }, update: async ( id: Service.Transfer.Update.ID, body: Service.Transfer.Update.Body, ): Promise => { let res: Service.Transfer.Update.Result = await this._update( this.svAPIEndpoint, this.transfer._path + `/${id}`, body, ); return res; }, }; msl = { _path: Repzo._end_points.MSL, find: async ( params?: Service.Msl.Find.Params, ): Promise => { let res: Service.Msl.Find.Result = await this._fetch( this.svAPIEndpoint, this.msl._path, params, ); return res; }, get: async ( id: Service.Msl.Get.ID, params?: Service.Msl.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.msl._path + `/${id}`, params, ); }, create: async ( body: Service.Msl.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.msl._path, body); return res; }, update: async ( id: Service.Msl.Update.ID, body: Service.Msl.Update.Body, ): Promise => { let res: Service.Msl.Update.Result = await this._update( this.svAPIEndpoint, this.msl._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Msl.Remove.ID, ): Promise => { let res: Service.Msl.Remove.Result = await this._delete( this.svAPIEndpoint, this.msl._path + `/${id}`, ); return res; }, }; mslProduct = { _path: Repzo._end_points.MSL_PRODUCT, find: async ( params?: Service.MslProduct.Find.Params, ): Promise => { let res: Service.MslProduct.Find.Result = await this._fetch( this.svAPIEndpoint, this.mslProduct._path, params, ); return res; }, get: async ( id: Service.MslProduct.Get.ID, params?: Service.MslProduct.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.mslProduct._path + `/${id}`, params, ); }, create: async ( body: Service.MslProduct.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.mslProduct._path, body, ); return res; }, update: async ( id: Service.MslProduct.Update.ID, body: Service.MslProduct.Update.Body, ): Promise => { let res: Service.MslProduct.Update.Result = await this._update( this.svAPIEndpoint, this.mslProduct._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.MslProduct.Remove.ID, ): Promise => { let res: Service.MslProduct.Remove.Result = await this._delete( this.svAPIEndpoint, this.mslProduct._path + `/${id}`, ); return res; }, }; mediaStorage = { _path: Repzo._end_points.MEDIA_STORAGE, find: async ( params?: Service.MediaStorage.Find.Params, ): Promise => { let res: Service.MediaStorage.Find.Result = await this._fetch( this.svAPIEndpoint, this.mediaStorage._path, params, ); return res; }, get: async ( id: Service.MediaStorage.Get.ID, params?: Service.MediaStorage.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.mediaStorage._path + `/${id}`, params, ); }, create: async ( body: Service.MediaStorage.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.mediaStorage._path, body, ); return res; }, update: async ( id: Service.MediaStorage.Update.ID, body: Service.MediaStorage.Update.Body, ): Promise => { let res: Service.MediaStorage.Update.Result = await this._update( this.svAPIEndpoint, this.mediaStorage._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.MediaStorage.Remove.ID, ): Promise => { let res: Service.MediaStorage.Remove.Result = await this._delete( this.svAPIEndpoint, this.mediaStorage._path + `/${id}`, ); return res; }, }; storecheckTemplate = { _path: Repzo._end_points.STORECHECK_TEMPLATE, find: async ( params?: Service.StorecheckTemplate.Find.Params, ): Promise => { let res: Service.StorecheckTemplate.Find.Result = await this._fetch( this.svAPIEndpoint, this.storecheckTemplate._path, params, ); return res; }, get: async ( id: Service.StorecheckTemplate.Get.ID, params?: Service.StorecheckTemplate.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.storecheckTemplate._path + `/${id}`, params, ); }, create: async ( body: Service.StorecheckTemplate.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.storecheckTemplate._path, body, ); return res; }, update: async ( id: Service.StorecheckTemplate.Update.ID, body: Service.StorecheckTemplate.Update.Body, ): Promise => { let res: Service.StorecheckTemplate.Update.Result = await this._update( this.svAPIEndpoint, this.storecheckTemplate._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.StorecheckTemplate.Remove.ID, ): Promise => { let res: Service.StorecheckTemplate.Remove.Result = await this._delete( this.svAPIEndpoint, this.storecheckTemplate._path + `/${id}`, ); return res; }, }; activityStorecheck = { _path: Repzo._end_points.ACTIVITY_STORECHECK, find: async ( params?: Service.ActivityStorecheck.Find.Params, ): Promise => { let res: Service.ActivityStorecheck.Find.Result = await this._fetch( this.svAPIEndpoint, this.activityStorecheck._path, params, ); return res; }, get: async ( id: Service.ActivityStorecheck.Get.ID, params?: Service.ActivityStorecheck.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.activityStorecheck._path + `/${id}`, params, ); }, create: async ( body: Service.ActivityStorecheck.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.activityStorecheck._path, body, ); return res; }, update: async ( id: Service.ActivityStorecheck.Update.ID, body: Service.ActivityStorecheck.Update.Body, ): Promise => { let res: Service.ActivityStorecheck.Update.Result = await this._update( this.svAPIEndpoint, this.activityStorecheck._path + `/${id}`, body, ); return res; }, }; activityItemStatus = { _path: Repzo._end_points.ACTIVITY_ITEM_STATUS, find: async ( params?: Service.ActivityItemStatus.Find.Params, ): Promise => { let res: Service.ActivityItemStatus.Find.Result = await this._fetch( this.svAPIEndpoint, this.activityItemStatus._path, params, ); return res; }, get: async ( id: Service.ActivityItemStatus.Get.ID, params?: Service.ActivityItemStatus.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.activityItemStatus._path + `/${id}`, params, ); }, create: async ( body: Service.ActivityItemStatus.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.activityItemStatus._path, body, ); return res; }, update: async ( id: Service.ActivityItemStatus.Update.ID, body: Service.ActivityItemStatus.Update.Body, ): Promise => { let res: Service.ActivityItemStatus.Update.Result = await this._update( this.svAPIEndpoint, this.activityItemStatus._path + `/${id}`, body, ); return res; }, }; itemStatusType = { _path: Repzo._end_points.ITEM_STATUS_TYPE, find: async ( params?: Service.ItemStatusType.Find.Params, ): Promise => { let res: Service.ItemStatusType.Find.Result = await this._fetch( this.svAPIEndpoint, this.itemStatusType._path, params, ); return res; }, get: async ( id: Service.ItemStatusType.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.itemStatusType._path + `/${id}`, ); }, create: async ( body: Service.ItemStatusType.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.itemStatusType._path, body, ); return res; }, update: async ( id: Service.ItemStatusType.Update.ID, body: Service.ItemStatusType.Update.Body, ): Promise => { let res: Service.ItemStatusType.Update.Result = await this._update( this.svAPIEndpoint, this.itemStatusType._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.ItemStatusType.Remove.ID, ): Promise => { let res: Service.ItemStatusType.Remove.Result = await this._delete( this.svAPIEndpoint, this.itemStatusType._path + `/${id}`, ); return res; }, }; adjustInventory = { _path: Repzo._end_points.ADJUST_INVENTORY, find: async ( params?: Service.AdjustInventory.Find.Params, ): Promise => { let res: Service.AdjustInventory.Find.Result = await this._fetch( this.svAPIEndpoint, this.adjustInventory._path, params, ); return res; }, get: async ( id: Service.AdjustInventory.Get.ID, params?: Service.AdjustInventory.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.adjustInventory._path + `/${id}`, params, ); }, create: async ( body: Service.AdjustInventory.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.adjustInventory._path, body, ); return res; }, }; inventory = { _path: Repzo._end_points.INVENTORY, find: async ( params?: Service.Inventory.Find.Params, ): Promise => { let res: Service.Inventory.Find.Result = await this._fetch( this.svAPIEndpoint, this.inventory._path, params, ); return res; }, }; integrationApp = { _path: Repzo._end_points.INTEGRATION_APP, find: async ( params?: Service.App.Find.Params, ): Promise => { let res: Service.App.Find.Result = await this._fetch( this.svAPIEndpoint, this.integrationApp._path, params, ); return res; }, get: async ( id: Service.App.Get.ID, params?: Service.App.Find.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.integrationApp._path + `/${id}`, params, ); }, create: async ( body: Service.App.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.integrationApp._path, body, ); return res; }, update: async ( id: Service.App.Update.ID, body: Service.App.Update.Body, ): Promise => { let res: Service.App.Update.Result = await this._update( this.svAPIEndpoint, this.integrationApp._path + `/${id}`, body, ); return res; }, }; joinActionsWebHook = { _path: Repzo._end_points.JOIN_ACTIONS_WEBHOOK, update: async ( id: null, body: Service.JoinActionsWeHook.Data, ): Promise => { let res: Service.JoinActionsWeHook.Result = await this._update( this.svAPIEndpoint, this.joinActionsWebHook._path, body, ); return res; }, }; static ActionLogs = class { _path: string = "integration-action-log"; available_app_name: string = ""; available_app_id: StringId = ""; app_id: StringId = ""; action: string = ""; status: Service.ActionLogs.Status; error?: any; start_time: number; end_time?: number; total_time?: number; company_namespace?: NameSpaces; body?: any; meta?: any; message: string; details: Service.ActionLogs.Detail[]; sync_id: string; isOld: boolean; constructor( public superThis: Repzo, sync_id: string, ) { this.start_time = Date.now(); this.status = "processing"; this.message = "Log Created"; this.details = []; this.sync_id = sync_id; this.isOld = true; } async load(sync_id: string) { const params: Service.ActionLogs.Find.Params = { sync_id: sync_id }; const res: Service.ActionLogs.Find.Result = await this.superThis._fetch( this.superThis.svAPIEndpoint, this._path, params, ); if (!res?.data?.length) throw new Error(`Action Log Not found, sync_id: ${sync_id}`); const action_log: Service.ActionLogs.Schema = res.data[0]; this.sync_id = sync_id; this.details = action_log.details; this.status = action_log.status; this.error = action_log.error; this.start_time = action_log.start_time; this.body = action_log.body; this.meta = action_log.meta; this.message = action_log.message; this.app_id = action_log.app_id; this.available_app_id = action_log.available_app_id; this.available_app_name = action_log.available_app_name; this.company_namespace = action_log.company_namespace; this.action = action_log.action; this.isOld = true; return this; } setStatus(status: Service.ActionLogs.Status, error?: any) { this.details.push({ timestamp: Date.now(), content: `status was changed from ${this.status} to ${status}`, }); this.status = status; if (error) { if (typeof error == "string") { this.error = { message: error }; } else if (error.message || error.response?.data) { this.error = { // json: error.toJSON ? error.toJSON() : undefined, message: error.message, responseData: error.response?.data, }; } else { this.error = error; } return this; } return this; } setBody(body: any) { this.body = body; return this; } setMeta(meta: any) { this.meta = meta; return this; } async commit() { let doc: Service.ActionLogs.Create.Body = { available_app_name: this.available_app_name, available_app_id: this.available_app_id, app_id: this.app_id, action: this.action, company_namespace: this.company_namespace, status: this.status, error: this.error ? this.error : undefined, start_time: this.start_time, end_time: Date.now(), total_time: Date.now() - this.start_time, body: this.body, meta: this.meta, message: this.message, details: this.details, sync_id: this.sync_id, }; try { const res: Service.ActionLogs.Create.Result = await this.superThis._create( this.superThis.svAPIEndpoint, this._path, doc, ); } catch (e) { console.error(e); } return this; } addDetail(detail: string, meta?: any) { let d: Service.ActionLogs.Detail = { timestamp: Date.now(), content: detail, }; this.message = detail; if (meta) d.meta = meta; this.details.push(d); return this; } }; static CommandLog = class { _path: string = "integration-command-log"; available_app_name: string; available_app_id: StringId; app_id: StringId; command: string; status: Service.CommandLog.Status; error?: any; start_time: number; end_time?: number; total_time?: number; company_namespace: NameSpaces; body?: any; sync_details: { timestamp: number; body: { [key: string]: any } }[]; error_details: { timestamp: number; error: { [key: string]: any } }[]; meta?: any; message: string; details: Service.CommandLog.Detail[]; sync_id: string; isOld: boolean; priority?: number; isPrioritized: boolean; retries: number; queuedAt?: Date; failedAt?: Date; succeededAt?: Date; skippedAt?: Date; receivedAt?: Date; processedAt?: Date; onGoing: boolean; trigger?: string; constructor( public superThis: Repzo, app: Service.App.Schema_with_populated_AvailableApp, command: string, trigger?: string, ) { this.app_id = app._id; this.available_app_id = app.available_app._id; this.available_app_name = app.available_app.name; this.company_namespace = app.company_namespace; this.start_time = Date.now(); this.status = "received"; this.message = "Request received"; this.command = command; this.details = [{ timestamp: Date.now(), content: "Request received" }]; this.sync_id = uuid(); this.isOld = false; this.isPrioritized = false; this.retries = 1; this.trigger = trigger; this.onGoing = true; this.sync_details = []; this.error_details = []; } async load(sync_id?: string, retries?: number) { if (sync_id) { const params: Service.CommandLog.Find.Params = { sync_id: sync_id }; const res: Service.CommandLog.Find.Result = await this.superThis._fetch( this.superThis.svAPIEndpoint, this._path, params, ); if (!res?.data?.length) throw new Error(`Command Log Not found, sync_id: ${sync_id}`); const command_log: Service.CommandLog.Schema = res.data[0]; if (command_log) { this.sync_id = sync_id; this.details = command_log.details; this.status = command_log.status; this.error = command_log.error; this.start_time = command_log.start_time; this.body = command_log.body; this.meta = command_log.meta; this.message = command_log.message; this.retries = retries !== undefined ? retries : command_log.retries || this.retries; // retries !== undefined ? retries : command_log.retries; this.isOld = true; this.failedAt = command_log.failedAt; this.succeededAt = command_log.succeededAt; this.skippedAt = command_log.skippedAt; this.receivedAt = command_log.receivedAt; this.processedAt = command_log.processedAt; this.onGoing = command_log.onGoing || false; this.trigger = command_log.trigger; this.sync_details = command_log.sync_details; this.error_details = command_log.error_details; // this.priority = command_log.priority // ? command_log.priority // : this.priority // ? this.priority // : undefined; } } return this; } setStatus(status: Service.CommandLog.Status, error?: any) { this.addDetail(`status was changed from ${this.status} to ${status}`); this.status = status; if (error) { if (!this.error_details) this.error_details = []; if (typeof error == "string") { this.error = { message: error }; } else if (error.message || error.response?.data) { this.error = { // json: error.toJSON ? error.toJSON() : undefined, message: error.message, responseData: error.response?.data, }; } else { this.error = error; } this.error_details = [ { timestamp: Date.now(), error: this.error, }, ]; return this; } switch (status) { case "fail": this.failedAt = new Date(); this.onGoing = false; break; case "processing": this.processedAt = new Date(); this.onGoing = true; break; case "queued": this.queuedAt = new Date(); this.onGoing = true; break; case "received": this.receivedAt = new Date(); this.onGoing = true; break; case "skipped": this.skippedAt = new Date(); this.onGoing = false; break; case "success": this.succeededAt = new Date(); this.onGoing = false; break; } return this; } setBody(body: any) { this.body = body; if (!this.sync_details) this.sync_details = []; this.sync_details = [ { timestamp: Date.now(), body: this.body, }, ]; return this; } setMeta(meta: any) { this.meta = meta; return this; } async commit() { let doc: Service.CommandLog.Create.Body = { available_app_name: this.available_app_name, available_app_id: this.available_app_id, app_id: this.app_id, command: this.command, status: this.status, error: this.error ? this.error : undefined, start_time: this.start_time, end_time: Date.now(), total_time: Date.now() - this.start_time, company_namespace: this.company_namespace, body: this.body, meta: this.meta, message: this.message, details: this.details, sync_id: this.sync_id, // priority: this.priority ? this.priority : undefined, queuedAt: this.queuedAt ? this.queuedAt : undefined, failedAt: this.failedAt ? this.failedAt : undefined, succeededAt: this.succeededAt ? this.succeededAt : undefined, skippedAt: this.skippedAt ? this.skippedAt : undefined, receivedAt: this.receivedAt ? this.receivedAt : undefined, processedAt: this.processedAt ? this.processedAt : undefined, onGoing: this.onGoing !== undefined ? this.onGoing : undefined, retries: this.retries !== undefined ? this.retries : undefined, trigger: this.trigger, sync_details: this.sync_details, error_details: this.error_details, }; try { const res: Service.CommandLog.Create.Result = await this.superThis._create( this.superThis.svAPIEndpoint, this._path, doc, ); this.isOld = true; } catch (e) { console.error(e); } return this; } addDetail(detail: string, meta?: any) { if (!this.details) this.details = []; this.details = [ { timestamp: Date.now(), content: detail, meta, }, ]; this.message = detail; return this; } }; patchAction = { _path: Repzo._end_points.PATCH_ACTION, create: async ( body: Service.PatchAction.Create.Body, params?: Service.PatchAction.Create.Params, ): Promise => { const res: Service.PatchAction.Create.Result = await this._create( this.svAPIEndpoint, this.patchAction._path, body, params, ); return res; }, update: async ( body: Service.PatchAction.Update.Body, ): Promise => { const res: Service.PatchAction.Update.Result = await this._update( this.svAPIEndpoint, this.patchAction._path, body, ); return res; }, }; updateIntegrationMeta = { _path: Repzo._end_points.UPDATE_INTEGRATION_META, create: async ( body: Service.UpdateIntegrationMeta.Create.Body, params?: Service.UpdateIntegrationMeta.Create.Params, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.updateIntegrationMeta._path, body, params, ); return res; }, }; assetPartType = { _path: Repzo._end_points.ASSET_PART_TYPE, find: async ( params?: Service.AssetPartType.Find.Params, ): Promise => { let res: Service.AssetPartType.Find.Result = await this._fetch( this.svAPIEndpoint, this.assetPartType._path, params, ); return res; }, get: async ( id: Service.AssetPartType.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.assetPartType._path + `/${id}`, ); }, create: async ( body: Service.AssetPartType.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.assetPartType._path, body, ); return res; }, update: async ( id: Service.AssetPartType.Update.ID, body: Service.AssetPartType.Update.Body, ): Promise => { let res: Service.AssetPartType.Update.Result = await this._update( this.svAPIEndpoint, this.assetPartType._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.AssetPartType.Remove.ID, ): Promise => { let res: Service.AssetPartType.Remove.Result = await this._delete( this.svAPIEndpoint, this.assetPartType._path + `/${id}`, ); return res; }, }; assetPart = { _path: Repzo._end_points.ASSET_PART, find: async ( params?: Service.AssetPart.Find.Params, ): Promise => { let res: Service.AssetPart.Find.Result = await this._fetch( this.svAPIEndpoint, this.assetPart._path, params, ); return res; }, get: async ( id: Service.AssetPart.Get.ID, params?: Service.AssetPart.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.assetPart._path + `/${id}`, params, ); }, create: async ( body: Service.AssetPart.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.assetPart._path, body, ); return res; }, update: async ( id: Service.AssetPart.Update.ID, body: Service.AssetPart.Update.Body, ): Promise => { let res: Service.AssetPart.Update.Result = await this._update( this.svAPIEndpoint, this.assetPart._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.AssetPart.Remove.ID, ): Promise => { let res: Service.AssetPart.Remove.Result = await this._delete( this.svAPIEndpoint, this.assetPart._path + `/${id}`, ); return res; }, }; assetPartUnit = { _path: Repzo._end_points.ASSET_PART_UNIT, find: async ( params?: Service.AssetPartUnit.Find.Params, ): Promise => { let res: Service.AssetPartUnit.Find.Result = await this._fetch( this.svAPIEndpoint, this.assetPartUnit._path, params, ); return res; }, get: async ( id: Service.AssetPartUnit.Get.ID, params?: Service.AssetPartUnit.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.assetPartUnit._path + `/${id}`, params, ); }, update: async ( id: Service.AssetPartUnit.Update.ID, body: Service.AssetPartUnit.Update.Body, ): Promise => { let res: Service.AssetPartUnit.Update.Result = await this._update( this.svAPIEndpoint, this.assetPartUnit._path + `/${id}`, body, ); return res; }, }; assetPartReceival = { _path: Repzo._end_points.ASSET_PART_RECEIVAL, find: async ( params?: Service.AssetPartReceival.Find.Params, ): Promise => { let res: Service.AssetPartReceival.Find.Result = await this._fetch( this.svAPIEndpoint, this.assetPartReceival._path, params, ); return res; }, get: async ( id: Service.AssetPartReceival.Get.ID, params?: Service.AssetPartReceival.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.assetPartReceival._path + `/${id}`, params, ); }, create: async ( body: Service.AssetPartReceival.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.assetPartReceival._path, body, ); return res; }, update: async ( id: Service.AssetPartReceival.Update.ID, body: Service.AssetPartReceival.Update.Body, ): Promise => { let res: Service.AssetPartReceival.Update.Result = await this._update( this.svAPIEndpoint, this.assetPartReceival._path + `/${id}`, body, ); return res; }, patch: async ( params: Service.AssetPartReceival.Patch.Params, body: Service.AssetPartReceival.Patch.Body, ): Promise => { let res: Service.AssetPartReceival.Patch.Result = await this._patch( this.svAPIEndpoint, this.assetPartReceival._path, body, params, ); return res; }, }; assetPartTransfer = { _path: Repzo._end_points.ASSET_PART_TRANSFER, find: async ( params?: Service.AssetPartTransfer.Find.Params, ): Promise => { let res: Service.AssetPartTransfer.Find.Result = await this._fetch( this.svAPIEndpoint, this.assetPartTransfer._path, params, ); return res; }, get: async ( id: Service.AssetPartTransfer.Get.ID, params?: Service.AssetPartTransfer.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.assetPartTransfer._path + `/${id}`, params, ); }, create: async ( body: Service.AssetPartTransfer.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.assetPartTransfer._path, body, ); return res; }, update: async ( id: Service.AssetPartTransfer.Update.ID, body: Service.AssetPartTransfer.Update.Body, ): Promise => { let res: Service.AssetPartTransfer.Update.Result = await this._update( this.svAPIEndpoint, this.assetPartTransfer._path + `/${id}`, body, ); return res; }, patch: async ( params: Service.AssetPartTransfer.Patch.Params, body: Service.AssetPartTransfer.Patch.Body, ): Promise => { let res: Service.AssetPartTransfer.Patch.Result = await this._patch( this.svAPIEndpoint, this.assetPartTransfer._path, body, params, ); return res; }, }; returnAssetPartUnit = { _path: Repzo._end_points.RETURN_ASSET_PART_UNIT, find: async ( params?: Service.ReturnAssetPartUnit.Find.Params, ): Promise => { let res: Service.ReturnAssetPartUnit.Find.Result = await this._fetch( this.svAPIEndpoint, this.returnAssetPartUnit._path, params, ); return res; }, get: async ( id: Service.ReturnAssetPartUnit.Get.ID, params?: Service.ReturnAssetPartUnit.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.returnAssetPartUnit._path + `/${id}`, params, ); }, create: async ( body: Service.ReturnAssetPartUnit.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.returnAssetPartUnit._path, body, ); return res; }, update: async ( id: Service.ReturnAssetPartUnit.Update.ID, body: Service.ReturnAssetPartUnit.Update.Body, ): Promise => { let res: Service.ReturnAssetPartUnit.Update.Result = await this._update( this.svAPIEndpoint, this.returnAssetPartUnit._path + `/${id}`, body, ); return res; }, patch: async ( params: Service.ReturnAssetPartUnit.Patch.Params, body: Service.ReturnAssetPartUnit.Patch.Body, ): Promise => { let res: Service.ReturnAssetPartUnit.Patch.Result = await this._patch( this.svAPIEndpoint, this.returnAssetPartUnit._path, body, params, ); return res; }, }; storeAssetPartUnit = { _path: Repzo._end_points.STORE_ASSET_PART_UNIT, find: async ( params?: Service.StoreAssetPartUnit.Find.Params, ): Promise => { let res: Service.StoreAssetPartUnit.Find.Result = await this._fetch( this.svAPIEndpoint, this.storeAssetPartUnit._path, params, ); return res; }, get: async ( id: Service.StoreAssetPartUnit.Get.ID, params?: Service.StoreAssetPartUnit.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.storeAssetPartUnit._path + `/${id}`, params, ); }, create: async ( body: Service.StoreAssetPartUnit.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.storeAssetPartUnit._path, body, ); return res; }, update: async ( id: Service.StoreAssetPartUnit.Update.ID, body: Service.StoreAssetPartUnit.Update.Body, ): Promise => { let res: Service.StoreAssetPartUnit.Update.Result = await this._update( this.svAPIEndpoint, this.storeAssetPartUnit._path + `/${id}`, body, ); return res; }, patch: async ( params: Service.StoreAssetPartUnit.Patch.Params, body: Service.StoreAssetPartUnit.Patch.Body, ): Promise => { let res: Service.StoreAssetPartUnit.Patch.Result = await this._patch( this.svAPIEndpoint, this.storeAssetPartUnit._path, body, params, ); return res; }, }; ocrInvoiceJobTemplate = { _path: Repzo._end_points.OCR_INVOICE_JOB_TEMPLATE, find: async ( params?: Service.OcrInvoiceJobTemplate.Find.Params, ): Promise => { let res: Service.OcrInvoiceJobTemplate.Find.Result = await this._fetch( this.svAPIEndpoint, this.ocrInvoiceJobTemplate._path, params, ); return res; }, get: async ( id: Service.OcrInvoiceJobTemplate.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.ocrInvoiceJobTemplate._path + `/${id}`, ); }, create: async ( body: Service.OcrInvoiceJobTemplate.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.ocrInvoiceJobTemplate._path, body, ); return res; }, update: async ( id: Service.OcrInvoiceJobTemplate.Update.ID, body: Service.OcrInvoiceJobTemplate.Update.Body, ): Promise => { let res: Service.OcrInvoiceJobTemplate.Update.Result = await this._update( this.svAPIEndpoint, this.ocrInvoiceJobTemplate._path + `/${id}`, body, ); return res; }, }; ocrInvoiceJobGroup = { _path: Repzo._end_points.OCR_INVOICE_JOB_GROUP, find: async ( params?: Service.OcrInvoiceJobGroup.Find.Params, ): Promise => { let res: Service.OcrInvoiceJobGroup.Find.Result = await this._fetch( this.svAPIEndpoint, this.ocrInvoiceJobGroup._path, params, ); return res; }, get: async ( id: Service.OcrInvoiceJobGroup.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.ocrInvoiceJobGroup._path + `/${id}`, ); }, create: async ( body: Service.OcrInvoiceJobGroup.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.ocrInvoiceJobGroup._path, body, ); return res; }, }; activityAiSalesOrder = { _path: Repzo._end_points.ACTIVITY_AI_SALES_ORDER, find: async ( params?: Service.ActivityAiSalesOrder.Find.Params, ): Promise => { let res: Service.ActivityAiSalesOrder.Find.Result = await this._fetch( this.svAPIEndpoint, this.activityAiSalesOrder._path, params, ); return res; }, get: async ( id: Service.ActivityAiSalesOrder.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.activityAiSalesOrder._path + `/${id}`, ); }, create: async ( body: Service.ActivityAiSalesOrder.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.activityAiSalesOrder._path, body, ); return res; }, }; ocrInvoiceJob = { _path: Repzo._end_points.OCR_INVOICE_JOB, find: async ( params?: Service.OcrInvoiceJob.Find.Params, ): Promise => { let res: Service.OcrInvoiceJob.Find.Result = await this._fetch( this.svAPIEndpoint, this.ocrInvoiceJob._path, params, ); return res; }, get: async ( id: Service.OcrInvoiceJob.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.ocrInvoiceJob._path + `/${id}`, ); }, }; ocrInvoiceJobPage = { _path: Repzo._end_points.OCR_INVOICE_JOB_PAGE, find: async ( params?: Service.OcrInvoiceJobPage.Find.Params, ): Promise => { let res: Service.OcrInvoiceJobPage.Find.Result = await this._fetch( this.svAPIEndpoint, this.ocrInvoiceJobPage._path, params, ); return res; }, get: async ( id: Service.OcrInvoiceJobPage.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.ocrInvoiceJobPage._path + `/${id}`, ); }, update: async ( id: Service.OcrInvoiceJobPage.Update.ID, body: Service.OcrInvoiceJobPage.Update.Body, ): Promise => { let res: Service.OcrInvoiceJobPage.Update.Result = await this._update( this.svAPIEndpoint, this.ocrInvoiceJobPage._path + `/${id}`, body, ); return res; }, }; settings = { _path: Repzo._end_points.SETTINGS, find: async ( params?: Service.Settings.Find.Params, ): Promise => { let res: Service.Settings.Find.Result = await this._fetch( this.svAPIEndpoint, this.settings._path, params, ); return res; }, get: async ( id: Service.Settings.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.settings._path + `/${id}`, ); }, update: async ( id: Service.Settings.Update.ID, body: Service.Settings.Update.Body, ): Promise => { let res: Service.Settings.Update.Result = await this._update( this.svAPIEndpoint, this.settings._path + `/${id}`, body, ); return res; }, }; mailUnsubscribe = { _path: Repzo._end_points.MAIL_UNSUBSCRIBE, get: async ( id: Service.MailUnsubsrcibe.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.ocrInvoiceJobPage._path + `/${id}`, ); }, create: async ( params: Service.MailUnsubsrcibe.Create.Params, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.activityAiSalesOrder._path, {}, params, ); return res; }, }; approvalRequest = { _path: Repzo._end_points.APPROVAL_REQUEST, find: async ( params?: Service.ApprovalRequest.Find.Params, ): Promise => { let res: Service.ApprovalRequest.Find.Result = await this._fetch( this.svAPIEndpoint, this.approvalRequest._path, params, ); return res; }, get: async ( id: Service.ApprovalRequest.Get.ID, params?: Service.ApprovalRequest.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.approvalRequest._path + `/${id}`, params, ); }, create: async ( body: Service.ApprovalRequest.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.approvalRequest._path, body, ); return res; }, update: async ( id: Service.ApprovalRequest.Update.ID, body: Service.ApprovalRequest.Update.Body, ): Promise => { let res: Service.ApprovalRequest.Update.Result = await this._update( this.svAPIEndpoint, this.approvalRequest._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.ApprovalRequest.Update.ID, params: Service.ApprovalRequest.Remove.Params, ): Promise => { let res: Service.ApprovalRequest.Remove.Result = await this._delete( this.svAPIEndpoint, this.approvalRequest._path + `/${id}`, params, ); return res; }, }; safeInvoiceSerialCounter = { _path: Repzo._end_points.SAFE_INVOICE_SERIAL_COUNTER, update: async ( id: Service.SafeInvoiceSerialCounter.Update.ID, body: Service.SafeInvoiceSerialCounter.Update.Body, ): Promise => { let res: Service.SafeInvoiceSerialCounter.Update.Result = await this._update( this.svAPIEndpoint, this.safeInvoiceSerialCounter._path + `/${id}`, body, ); return res; }, }; clientLocation = { _path: Repzo._end_points.CLIENT_LOCATION, find: async ( params?: Service.ClientLocation.Find.Params, ): Promise => { let res: Service.ClientLocation.Find.Result = await this._fetch( this.svAPIEndpoint, this.clientLocation._path, params, ); return res; }, get: async ( id: Service.ClientLocation.Get.ID, params?: Service.ClientLocation.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.clientLocation._path + `/${id}`, params, ); }, create: async ( body: Service.ClientLocation.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.clientLocation._path, body, ); return res; }, update: async ( id: Service.ClientLocation.Update.ID, body: Service.ClientLocation.Update.Body, ): Promise => { let res: Service.ClientLocation.Update.Result = await this._update( this.svAPIEndpoint, this.clientLocation._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.ClientLocation.Update.ID, params: Service.ClientLocation.Remove.Params, ): Promise => { let res: Service.ClientLocation.Remove.Result = await this._delete( this.svAPIEndpoint, this.clientLocation._path + `/${id}`, params, ); return res; }, }; assetType = { _path: Repzo._end_points.ASSET_TYPE, find: async ( params?: Service.AssetType.Find.Params, ): Promise => { let res: Service.AssetType.Find.Result = await this._fetch( this.svAPIEndpoint, this.assetType._path, params, ); return res; }, get: async ( id: Service.AssetType.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.assetType._path + `/${id}`, ); }, create: async ( body: Service.AssetType.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.assetType._path, body, ); return res; }, update: async ( id: Service.AssetType.Update.ID, body: Service.AssetType.Update.Body, ): Promise => { let res: Service.AssetType.Update.Result = await this._update( this.svAPIEndpoint, this.assetType._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.AssetType.Update.ID, params: Service.AssetType.Remove.Params, ): Promise => { let res: Service.AssetType.Remove.Result = await this._delete( this.svAPIEndpoint, this.assetType._path + `/${id}`, params, ); return res; }, }; asset = { _path: Repzo._end_points.ASSET, find: async ( params?: Service.Asset.Find.Params, ): Promise => { let res: Service.Asset.Find.Result = await this._fetch( this.svAPIEndpoint, this.asset._path, params, ); return res; }, get: async ( id: Service.Asset.Get.ID, params?: Service.Asset.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.asset._path + `/${id}`, params, ); }, create: async ( body: Service.Asset.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.asset._path, body); return res; }, update: async ( id: Service.Asset.Update.ID, body: Service.Asset.Update.Body, ): Promise => { let res: Service.Asset.Update.Result = await this._update( this.svAPIEndpoint, this.asset._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Asset.Update.ID, params: Service.Asset.Remove.Params, ): Promise => { let res: Service.Asset.Remove.Result = await this._delete( this.svAPIEndpoint, this.asset._path + `/${id}`, params, ); return res; }, }; assetUnit = { _path: Repzo._end_points.ASSET_UNIT, find: async ( params?: Service.AssetUnit.Find.Params, ): Promise => { let res: Service.AssetUnit.Find.Result = await this._fetch( this.svAPIEndpoint, this.assetUnit._path, params, ); return res; }, get: async ( id: Service.AssetUnit.Get.ID, params?: Service.AssetUnit.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.assetUnit._path + `/${id}`, params, ); }, create: async ( body: Service.AssetUnit.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.assetUnit._path, body, ); return res; }, update: async ( id: Service.AssetUnit.Update.ID, body: Service.AssetUnit.Update.Body, ): Promise => { let res: Service.AssetUnit.Update.Result = await this._update( this.svAPIEndpoint, this.assetUnit._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.AssetUnit.Update.ID, params: Service.AssetUnit.Remove.Params, ): Promise => { let res: Service.AssetUnit.Remove.Result = await this._delete( this.svAPIEndpoint, this.assetUnit._path + `/${id}`, params, ); return res; }, }; workorderPortal = { _path: Repzo._end_points.WORKORDER_PORTAL, find: async ( params?: Service.WorkorderPortal.Find.Params, ): Promise => { let res: Service.WorkorderPortal.Find.Result = await this._fetch( this.svAPIEndpoint, this.workorderPortal._path, params, ); return res; }, get: async ( id: Service.WorkorderPortal.Get.ID, params?: Service.WorkorderPortal.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.workorderPortal._path + `/${id}`, params, ); }, create: async ( body: Service.WorkorderPortal.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.workorderPortal._path, body, ); return res; }, update: async ( id: Service.WorkorderPortal.Update.ID, body: Service.WorkorderPortal.Update.Body, ): Promise => { let res: Service.WorkorderPortal.Update.Result = await this._update( this.svAPIEndpoint, this.workorderPortal._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.WorkorderPortal.Update.ID, ): Promise => { let res: Service.WorkorderPortal.Remove.Result = await this._delete( this.svAPIEndpoint, this.workorderPortal._path + `/${id}`, ); return res; }, }; approval = { _path: Repzo._end_points.APPROVAL, find: async ( params?: Service.Approval.Find.Params, ): Promise => { let res: Service.Approval.Find.Result = await this._fetch( this.svAPIEndpoint, this.approval._path, params, ); return res; }, get: async ( id: Service.Approval.Get.ID, params?: Service.Approval.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.approval._path + `/${id}`, params, ); }, create: async ( body: Service.Approval.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.approval._path, body, ); return res; }, update: async ( id: Service.Approval.Update.ID, body: Service.Approval.Update.Body, ): Promise => { let res: Service.Approval.Update.Result = await this._update( this.svAPIEndpoint, this.approval._path + `/${id}`, body, ); return res; }, patch: async ( params: Service.Approval.Patch.Params, body: Service.Approval.Patch.Body, ): Promise => { let res: Service.Approval.Patch.Result = await this._patch( this.svAPIEndpoint, this.approval._path, body, params, ); return res; }, remove: async ( id: Service.Approval.Remove.ID, ): Promise => { let res: Service.Approval.Remove.Result = await this._delete( this.svAPIEndpoint, this.approval._path + `/${id}`, ); return res; }, }; workorderCategory = { _path: Repzo._end_points.WORKORDER_CATEGORY, find: async ( params?: Service.WorkorderCategory.Find.Params, ): Promise => { let res: Service.WorkorderCategory.Find.Result = await this._fetch( this.svAPIEndpoint, this.workorderCategory._path, params, ); return res; }, get: async ( id: Service.WorkorderCategory.Get.ID, params?: Service.WorkorderCategory.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.workorderCategory._path + `/${id}`, params, ); }, create: async ( body: Service.WorkorderCategory.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.workorderCategory._path, body, ); return res; }, update: async ( id: Service.WorkorderCategory.Update.ID, body: Service.WorkorderCategory.Update.Body, ): Promise => { let res: Service.WorkorderCategory.Update.Result = await this._update( this.svAPIEndpoint, this.workorderCategory._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.WorkorderCategory.Remove.ID, ): Promise => { let res: Service.WorkorderCategory.Remove.Result = await this._delete( this.svAPIEndpoint, this.workorderCategory._path + `/${id}`, ); return res; }, }; contract = { _path: Repzo._end_points.CONTRACT, find: async ( params?: Service.Contract.Find.Params, ): Promise => { let res: Service.Contract.Find.Result = await this._fetch( this.svAPIEndpoint, this.contract._path, params, ); return res; }, get: async ( id: Service.Contract.Get.ID, params?: Service.Contract.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.contract._path + `/${id}`, params, ); }, create: async ( body: Service.Contract.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.contract._path, body, ); return res; }, update: async ( id: Service.Contract.Update.ID, body: Service.Contract.Update.Body, ): Promise => { let res: Service.Contract.Update.Result = await this._update( this.svAPIEndpoint, this.contract._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Contract.Remove.ID, ): Promise => { let res: Service.Contract.Remove.Result = await this._delete( this.svAPIEndpoint, this.contract._path + `/${id}`, ); return res; }, }; contractInstallment = { _path: Repzo._end_points.CONTRACT_INSTALLMENT, find: async ( params?: Service.ContractInstallment.Find.Params, ): Promise => { let res: Service.ContractInstallment.Find.Result = await this._fetch( this.svAPIEndpoint, this.contractInstallment._path, params, ); return res; }, get: async ( id: Service.ContractInstallment.Get.ID, params?: Service.ContractInstallment.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.contractInstallment._path + `/${id}`, params, ); }, create: async ( body: Service.ContractInstallment.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.contractInstallment._path, body, ); return res; }, update: async ( id: Service.ContractInstallment.Update.ID, body: Service.ContractInstallment.Update.Body, ): Promise => { let res: Service.ContractInstallment.Update.Result = await this._update( this.svAPIEndpoint, this.contractInstallment._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.ContractInstallment.Remove.ID, ): Promise => { let res: Service.ContractInstallment.Remove.Result = await this._delete( this.svAPIEndpoint, this.contractInstallment._path + `/${id}`, ); return res; }, }; repBalanceSummary = { _path: Repzo._end_points.REP_BALANCE_SUMMARY, find: async ( params: Service.RepBalanceSummary.Find.Params, ): Promise => { let res: Service.RepBalanceSummary.Find.Result = await this._fetch( this.svAPIEndpoint, this.repBalanceSummary._path, params, ); return res; }, }; workorderPortalLink = { _path: Repzo._end_points.WORKORDER_PORTAL_LINK, find: async ( params?: Service.WorkorderPortalLink.Find.Params, ): Promise => { let res: Service.WorkorderPortalLink.Find.Result = await this._fetch( this.svAPIEndpoint, this.workorderPortalLink._path, params, ); return res; }, get: async ( id: Service.WorkorderPortalLink.Get.ID, params?: Service.WorkorderPortalLink.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.workorderPortalLink._path + `/${id}`, params, ); }, create: async ( body: Service.WorkorderPortalLink.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.workorderPortalLink._path, body, ); return res; }, update: async ( id: Service.WorkorderPortalLink.Update.ID, body: Service.WorkorderPortalLink.Update.Body, ): Promise => { let res: Service.WorkorderPortalLink.Update.Result = await this._update( this.svAPIEndpoint, this.workorderPortalLink._path + `/${id}`, body, ); return res; }, patch: async ( id: Service.WorkorderPortalLink.Patch.ID, body: Service.WorkorderPortalLink.Patch.Body, ): Promise => { let res: Service.WorkorderPortalLink.Patch.Result = await this._patch( this.svAPIEndpoint, this.workorderPortalLink._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.WorkorderPortalLink.Remove.ID, ): Promise => { let res: Service.WorkorderPortalLink.Remove.Result = await this._delete( this.svAPIEndpoint, this.workorderPortalLink._path + `/${id}`, ); return res; }, }; customField = { _path: Repzo._end_points.CUSTOM_FIELD, find: async ( params?: Service.CustomField.Find.Params, ): Promise => { let res: Service.CustomField.Find.Result = await this._fetch( this.svAPIEndpoint, this.customField._path, params, ); return res; }, get: async ( id: Service.CustomField.Get.ID, params?: Service.CustomField.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.customField._path + `/${id}`, params, ); }, create: async ( body: Service.CustomField.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.customField._path, body, ); return res; }, update: async ( id: Service.CustomField.Update.ID, body: Service.CustomField.Update.Body, ): Promise => { let res: Service.CustomField.Update.Result = await this._update( this.svAPIEndpoint, this.customField._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.CustomField.Update.ID, params: Service.CustomField.Remove.Params, ): Promise => { let res: Service.CustomField.Remove.Result = await this._delete( this.svAPIEndpoint, this.customField._path + `/${id}`, params, ); return res; }, }; resetCompanyNamespace = { _path: Repzo._end_points.RESET_COMPANY_NAMESPACE, options: async (): Promise => { const params: Service.ResetCompanyNamespace.Options.Params = { options: true, }; let res: Service.ResetCompanyNamespace.Options.Result = await this._fetch( this.svAPIEndpoint, this.resetCompanyNamespace._path, params, ); return res; }, find: async ( params?: Service.ResetCompanyNamespace.Find.Params, ): Promise => { let res: Service.ResetCompanyNamespace.Find.Result = await this._fetch( this.svAPIEndpoint, this.resetCompanyNamespace._path, params, ); return res; }, get: async ( id: Service.ResetCompanyNamespace.Get.ID, params?: Service.ResetCompanyNamespace.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.resetCompanyNamespace._path + `/${id}`, params, ); }, create: async ( body: Service.ResetCompanyNamespace.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.resetCompanyNamespace._path, body, ); return res; }, update: async ( id: Service.ResetCompanyNamespace.Update.ID, ): Promise => { let res: Service.ResetCompanyNamespace.Update.Result = await this._update( this.svAPIEndpoint, this.resetCompanyNamespace._path + `/${id}`, {}, ); return res; }, }; testResetCompanyNamespace = { _path: Repzo._end_points.TEST_RESET_COMPANY_NAMESPACE, reset: async ({ nameSpace, services, }: { nameSpace: string; services: { [key: string]: boolean }[]; }): Promise => { try { const repzo_services = await this.testResetCompanyNamespace.options(); for (let service in repzo_services) { const repzo_service = service as Service.ResetCompanyNamespace.Services; const match = services.find((s) => s[repzo_service]); if (match) { repzo_services[repzo_service].checked = match[repzo_service]; } repzo_services[repzo_service].checked = true; } const body: Service.TestResetCompanyNamespace.Create.Body = { nameSpace, services: repzo_services, }; return await this.testResetCompanyNamespace.create(body); } catch (e) { console.error(e); throw e; } }, options: async (): Promise => { const params: Service.TestResetCompanyNamespace.Options.Params = { options: true, }; let res: Service.TestResetCompanyNamespace.Options.Result = await this._fetch( this.svAPIEndpoint, this.testResetCompanyNamespace._path, params, ); return res; }, find: async ( params?: Service.TestResetCompanyNamespace.Find.Params, ): Promise => { let res: Service.TestResetCompanyNamespace.Find.Result = await this._fetch( this.svAPIEndpoint, this.testResetCompanyNamespace._path, params, ); return res; }, get: async ( id: Service.TestResetCompanyNamespace.Get.ID, params?: Service.TestResetCompanyNamespace.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.testResetCompanyNamespace._path + `/${id}`, params, ); }, create: async ( body: Service.TestResetCompanyNamespace.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.testResetCompanyNamespace._path, body, ); return res; }, update: async ( id: Service.TestResetCompanyNamespace.Update.ID, ): Promise => { let res: Service.TestResetCompanyNamespace.Update.Result = await this._update( this.svAPIEndpoint, this.testResetCompanyNamespace._path + `/${id}`, {}, ); return res; }, }; timelineTimeList = { _path: Repzo._end_points.TIMELINE_TIME_LIST, find: async ( params?: Service.TimelineTimeList.Find.Params, ): Promise => { let res: Service.TimelineTimeList.Find.Result = await this._fetch( this.svAPIEndpoint, this.timelineTimeList._path, params, ); return res; }, }; salesAnalyticsReport = { _path: Repzo._end_points.SALES_ANALYTICS_REPORT, find: async ( params?: Service.SalesAnalyticsReport.Find.Params, ): Promise => { let res: Service.SalesAnalyticsReport.Find.Result = await this._fetch( this.svAPIEndpoint, this.salesAnalyticsReport._path, params, ); return res; }, create: async ( body: Service.SalesAnalyticsReport.CreateBody, params?: Service.SalesAnalyticsReport.Create.Params, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.salesAnalyticsReport._path, body, params, ); return res; }, }; workorderAgenda = { _path: Repzo._end_points.WORKORDER_AGENDA, find: async ( params: Service.WorkorderAgenda.Find.Params, ): Promise => { let res: Service.WorkorderAgenda.Find.Result = await this._fetch( this.svAPIEndpoint, this.workorderAgenda._path, params, ); return res; }, get: async ( id: Service.WorkorderAgenda.Get.ID, params?: Service.WorkorderAgenda.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.workorderAgenda._path + `/${id}`, params, ); }, }; moduleCustomValidator = { _path: Repzo._end_points.MODULE_CUSTOM_VALIDATOR, find: async ( params: Service.ModuleCustomValidator.Find.Params, ): Promise => { let res: Service.ModuleCustomValidator.Find.Result = await this._fetch( this.svAPIEndpoint, this.moduleCustomValidator._path, params, ); return res; }, get: async ( id: Service.ModuleCustomValidator.Get.ID, params: Service.ModuleCustomValidator.Find.Params, ): Promise => { let res: Service.ModuleCustomValidator.Find.Result = await this._fetch( this.svAPIEndpoint, this.moduleCustomValidator._path + `/${id}`, params, ); return res; }, create: async ( body: Service.ModuleCustomValidator.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.moduleCustomValidator._path, body, ); return res; }, update: async ( id: Service.ModuleCustomValidator.Update.ID, body: Service.ModuleCustomValidator.Update.Body, ): Promise => { let res: Service.ModuleCustomValidator.Update.Result = await this._update( this.svAPIEndpoint, this.moduleCustomValidator._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.ModuleCustomValidator.Remove.ID, params: Service.ModuleCustomValidator.Remove.Params, ): Promise => { let res: Service.ModuleCustomValidator.Remove.Result = await this._delete( this.svAPIEndpoint, this.moduleCustomValidator._path + `/${id}`, params, ); return res; }, }; notificationsCenter = { _path: Repzo._end_points.NOTIFICATIONS_CENTER, find: async ( params?: Service.NotificationsCenter.Find.Params, ): Promise => { let res: Service.NotificationsCenter.Find.Result = await this._fetch( this.svAPIEndpoint, this.notificationsCenter._path, params, ); return res; }, get: async ( id: Service.NotificationsCenter.Get.ID, params?: Service.NotificationsCenter.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.notificationsCenter._path + `/${id}`, params, ); }, create: async ( body: Service.NotificationsCenter.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.notificationsCenter._path, body, ); return res; }, update: async ( id: Service.NotificationsCenter.Update.ID, body: Service.NotificationsCenter.Update.Body, ): Promise => { let res: Service.NotificationsCenter.Update.Result = await this._update( this.svAPIEndpoint, this.notificationsCenter._path + `/${id}`, body, ); return res; }, patch: async ( body: Service.NotificationsCenter.Patch.Body, ): Promise => { let res: Service.NotificationsCenter.Patch.Result = await this._patch( this.svAPIEndpoint, this.notificationsCenter._path, body, ); return res; }, }; reportColumnGroup = { _path: Repzo._end_points.REPORT_COLUMN_GROUP, find: async ( params?: Service.ReportColumnGroup.Find.Params, ): Promise => { let res: Service.ReportColumnGroup.Find.Result = await this._fetch( this.svAPIEndpoint, this.reportColumnGroup._path, params, ); return res; }, get: async ( id: Service.ReportColumnGroup.Get.ID, params?: Service.ReportColumnGroup.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.reportColumnGroup._path + `/${id}`, params, ); }, create: async ( body: Service.ReportColumnGroup.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.reportColumnGroup._path, body, ); return res; }, update: async ( id: Service.ReportColumnGroup.Update.ID, body: Service.ReportColumnGroup.Update.Body, ): Promise => { let res: Service.ReportColumnGroup.Update.Result = await this._update( this.svAPIEndpoint, this.reportColumnGroup._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.ReportColumnGroup.Remove.ID, params: Service.ReportColumnGroup.Remove.Params, ): Promise => { let res: Service.ReportColumnGroup.Remove.Result = await this._delete( this.svAPIEndpoint, this.reportColumnGroup._path + `/${id}`, params, ); return res; }, }; reportColumn = { _path: Repzo._end_points.REPORT_COLUMN, find: async ( params?: Service.ReportColumn.Find.Params, ): Promise => { let res: Service.ReportColumn.Find.Result = await this._fetch( this.svAPIEndpoint, this.reportColumn._path, params, ); return res; }, get: async ( id: Service.ReportColumn.Get.ID, params?: Service.ReportColumn.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.reportColumn._path + `/${id}`, params, ); }, create: async ( body: Service.ReportColumn.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.reportColumn._path, body, ); return res; }, update: async ( id: Service.ReportColumn.Update.ID, body: Service.ReportColumn.Update.Body, ): Promise => { let res: Service.ReportColumn.Update.Result = await this._update( this.svAPIEndpoint, this.reportColumn._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.ReportColumn.Remove.ID, params: Service.ReportColumn.Remove.Params, ): Promise => { let res: Service.ReportColumn.Remove.Result = await this._delete( this.svAPIEndpoint, this.reportColumn._path + `/${id}`, params, ); return res; }, }; reportSort = { _path: Repzo._end_points.REPORT_SORT, find: async ( params?: Service.ReportSort.Find.Params, ): Promise => { let res: Service.ReportSort.Find.Result = await this._fetch( this.svAPIEndpoint, this.reportSort._path, params, ); return res; }, get: async ( id: Service.ReportSort.Get.ID, params?: Service.ReportSort.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.reportSort._path + `/${id}`, params, ); }, create: async ( body: Service.ReportSort.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.reportSort._path, body, ); return res; }, update: async ( id: Service.ReportSort.Update.ID, body: Service.ReportSort.Update.Body, ): Promise => { let res: Service.ReportSort.Update.Result = await this._update( this.svAPIEndpoint, this.reportSort._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.ReportSort.Remove.ID, params: Service.ReportSort.Remove.Params, ): Promise => { let res: Service.ReportSort.Remove.Result = await this._delete( this.svAPIEndpoint, this.reportSort._path + `/${id}`, params, ); return res; }, }; reportFilter = { _path: Repzo._end_points.REPORT_FILTER, find: async ( params?: Service.ReportFilter.Find.Params, ): Promise => { let res: Service.ReportFilter.Find.Result = await this._fetch( this.svAPIEndpoint, this.reportFilter._path, params, ); return res; }, get: async ( id: Service.ReportFilter.Get.ID, params?: Service.ReportFilter.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.reportFilter._path + `/${id}`, params, ); }, create: async ( body: Service.ReportFilter.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.reportFilter._path, body, ); return res; }, update: async ( id: Service.ReportFilter.Update.ID, body: Service.ReportFilter.Update.Body, ): Promise => { let res: Service.ReportFilter.Update.Result = await this._update( this.svAPIEndpoint, this.reportFilter._path + `/${id}`, body, ); return res; }, }; safeCrud = { _path: Repzo._end_points.SAFE_CRUD, create: async ( body: Service.SafeCrud.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.safeCrud._path, body, ); return res; }, }; paymentMethod = { _path: Repzo._end_points.PAYMENT_METHOD, find: async ( params?: Service.PaymentMethod.Find.Params, ): Promise => { let res: Service.PaymentMethod.Find.Result = await this._fetch( this.svAPIEndpoint, this.paymentMethod._path, params, ); return res; }, get: async ( id: Service.PaymentMethod.Get.ID, params?: Service.PaymentMethod.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.paymentMethod._path + `/${id}`, params, ); }, create: async ( body: Service.PaymentMethod.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.paymentMethod._path, body, ); return res; }, update: async ( id: Service.PaymentMethod.Update.ID, body: Service.PaymentMethod.Update.Body, ): Promise => { let res: Service.PaymentMethod.Update.Result = await this._update( this.svAPIEndpoint, this.paymentMethod._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.PaymentMethod.Update.ID, params: Service.PaymentMethod.Remove.Params, ): Promise => { let res: Service.PaymentMethod.Remove.Result = await this._delete( this.svAPIEndpoint, this.paymentMethod._path + `/${id}`, params, ); return res; }, }; reportView = { _path: Repzo._end_points.REPORT_VIEW, find: async ( params?: Service.ReportView.Find.Params, ): Promise => { let res: Service.ReportView.Find.Result = await this._fetch( this.svAPIEndpoint, this.reportView._path, params, ); return res; }, get: async ( id: Service.ReportView.Get.ID, params?: Service.ReportView.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.reportView._path + `/${id}`, params, ); }, create: async ( body: Service.ReportView.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.reportView._path, body, ); return res; }, update: async ( id: Service.ReportView.Update.ID, body: Service.ReportView.Update.Body, ): Promise => { let res: Service.ReportView.Update.Result = await this._update( this.svAPIEndpoint, this.reportView._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.ReportView.Remove.ID, params: Service.ReportView.Remove.Params, ): Promise => { let res: Service.ReportView.Remove.Result = await this._delete( this.svAPIEndpoint, this.reportView._path + `/${id}`, params, ); return res; }, }; reportViewFavorite = { _path: Repzo._end_points.REPORT_VIEW_FAVORITE, find: async ( params?: Service.ReportViewFavorite.Find.Params, ): Promise => { let res: Service.ReportViewFavorite.Find.Result = await this._fetch( this.svAPIEndpoint, this.reportViewFavorite._path, params, ); return res; }, get: async ( id: Service.ReportViewFavorite.Get.ID, params?: Service.ReportViewFavorite.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.reportViewFavorite._path + `/${id}`, params, ); }, create: async ( body: Service.ReportViewFavorite.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.reportViewFavorite._path, body, ); return res; }, remove: async ( id: Service.ReportViewFavorite.Remove.ID, params: Service.ReportViewFavorite.Remove.Params, ): Promise => { let res: Service.ReportViewFavorite.Remove.Result = await this._delete( this.svAPIEndpoint, this.reportViewFavorite._path + `/${id}`, params, ); return res; }, }; reportViewDefault = { _path: Repzo._end_points.REPORT_VIEW_DEFAULT, find: async ( params?: Service.ReportViewDefault.Find.Params, ): Promise => { let res: Service.ReportViewDefault.Find.Result = await this._fetch( this.svAPIEndpoint, this.reportViewDefault._path, params, ); return res; }, get: async ( id: Service.ReportViewDefault.Get.ID, params?: Service.ReportViewDefault.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.reportViewDefault._path + `/${id}`, params, ); }, create: async ( body: Service.ReportViewDefault.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.reportViewDefault._path, body, ); return res; }, remove: async ( id: Service.ReportViewDefault.Remove.ID, params: Service.ReportViewDefault.Remove.Params, ): Promise => { let res: Service.ReportViewDefault.Remove.Result = await this._delete( this.svAPIEndpoint, this.reportViewDefault._path + `/${id}`, params, ); return res; }, }; copyReportView = { _path: Repzo._end_points.COPY_REPORT_VIEW, update: async ( id: Service.CopyReportView.Update.ID, body: Service.CopyReportView.Update.Body, ): Promise => { let res: Service.CopyReportView.Update.Result = await this._update( this.svAPIEndpoint, this.copyReportView._path + `/${id}`, body, ); return res; }, }; clmPresentation = { _path: Repzo._end_points.CLM_PRESENTATION, find: async ( params?: Service.CLMPresentation.Find.Params, ): Promise => { let res: Service.CLMPresentation.Find.Result = await this._fetch( this.svAPIEndpoint, this.clmPresentation._path, params, ); return res; }, get: async ( id: Service.CLMPresentation.Get.ID, params?: Service.CLMPresentation.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.clmPresentation._path + `/${id}`, params, ); }, create: async ( body: Service.CLMPresentation.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.clmPresentation._path, body, ); return res; }, update: async ( id: Service.CLMPresentation.Update.ID, body: Service.CLMPresentation.Update.Body, ): Promise => { let res: Service.CLMPresentation.Update.Result = await this._update( this.svAPIEndpoint, this.clmPresentation._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.CLMPresentation.Update.ID, ): Promise => { let res: Service.CLMPresentation.Remove.Result = await this._delete( this.svAPIEndpoint, this.clmPresentation._path + `/${id}`, ); return res; }, }; clmSequence = { _path: Repzo._end_points.CLM_SEQUENCE, find: async ( params?: Service.CLMSequence.Find.Params, ): Promise => { let res: Service.CLMSequence.Find.Result = await this._fetch( this.svAPIEndpoint, this.clmSequence._path, params, ); return res; }, get: async ( id: Service.CLMSequence.Get.ID, params?: Service.CLMSequence.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.clmSequence._path + `/${id}`, params, ); }, create: async ( body: Service.CLMSequence.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.clmSequence._path, body, ); return res; }, update: async ( id: Service.CLMSequence.Update.ID, body: Service.CLMSequence.Update.Body, ): Promise => { let res: Service.CLMSequence.Update.Result = await this._update( this.svAPIEndpoint, this.clmSequence._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.CLMSequence.Update.ID, ): Promise => { let res: Service.CLMSequence.Remove.Result = await this._delete( this.svAPIEndpoint, this.clmSequence._path + `/${id}`, ); return res; }, }; clmSlide = { _path: Repzo._end_points.CLM_SLIDE, find: async ( params?: Service.CLMSlide.Find.Params, ): Promise => { let res: Service.CLMSlide.Find.Result = await this._fetch( this.svAPIEndpoint, this.clmSlide._path, params, ); return res; }, get: async ( id: Service.CLMSlide.Get.ID, params?: Service.CLMSlide.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.clmSlide._path + `/${id}`, params, ); }, create: async ( body: Service.CLMSlide.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.clmSlide._path, body, ); return res; }, update: async ( id: Service.CLMSlide.Update.ID, body: Service.CLMSlide.Update.Body, ): Promise => { let res: Service.CLMSlide.Update.Result = await this._update( this.svAPIEndpoint, this.clmSlide._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.CLMSlide.Update.ID, ): Promise => { let res: Service.CLMSlide.Remove.Result = await this._delete( this.svAPIEndpoint, this.clmSlide._path + `/${id}`, ); return res; }, }; clmFeedbackActivity = { _path: Repzo._end_points.CLM_FEEDBACK_ACTIVITY, find: async ( params?: Service.CLMFeedbackActivity.Find.Params, ): Promise => { let res: Service.CLMFeedbackActivity.Find.Result = await this._fetch( this.svAPIEndpoint, this.clmFeedbackActivity._path, params, ); return res; }, get: async ( id: Service.CLMFeedbackActivity.Get.ID, params?: Service.CLMFeedbackActivity.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.clmFeedbackActivity._path + `/${id}`, params, ); }, create: async ( body: Service.CLMFeedbackActivity.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.clmFeedbackActivity._path, body, ); return res; }, }; clmFetch = { _path: Repzo._end_points.CLM_FETCH, find: async ( params?: Service.CLMFetch.Find.Params, ): Promise => { let res: Service.CLMFetch.Find.Result = await this._fetch( this.svAPIEndpoint, this.clmFetch._path, params, ); return res; }, }; cycle = { _path: Repzo._end_points.CYCLES, find: async ( params?: Service.Cycle.Find.Params, ): Promise => { let res: Service.Cycle.Find.Result = await this._fetch( this.svAPIEndpoint, this.cycle._path, params, ); return res; }, get: async ( id: Service.Cycle.Get.ID, params?: Service.Cycle.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.cycle._path + `/${id}`, params, ); }, }; cycleReport = { _path: Repzo._end_points.CYCLE_REPORT, find: async ( params?: Service.CycleReport.Find.Params, ): Promise => { let res: Service.CycleReport.Find.Result = await this._fetch( this.svAPIEndpoint, this.cycleReport._path, params, ); return res; }, }; promotions = { _path: Repzo._end_points.PROMOTIONS, find: async ( params?: Service.Promotion.Find.Params, ): Promise => { let res: Service.Promotion.Find.Result = await this._fetch( this.svAPIEndpoint, this.promotions._path, params, ); return res; }, get: async ( id: Service.Promotion.Get.ID, params?: Service.Promotion.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.promotions._path + `/${id}`, params, ); }, create: async ( body: Service.Promotion.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.promotions._path, body, ); return res; }, update: async ( id: Service.Promotion.Update.ID, body: Service.Promotion.Update.Body, ): Promise => { let res: Service.Promotion.Update.Result = await this._update( this.svAPIEndpoint, this.promotions._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Promotion.Update.ID, params: Service.Promotion.Remove.Params, ): Promise => { let res: Service.Promotion.Remove.Result = await this._delete( this.svAPIEndpoint, this.promotions._path + `/${id}`, params, ); return res; }, }; compareInvoiceToWarehouse = { _path: Repzo._end_points.COMPARE_INVOICE_TO_WAREHOUSE, find: async ( params?: Service.CompareInvoiceToWarehouse.Find.Params, ): Promise => { let res: Service.CompareInvoiceToWarehouse.Find.Result = await this._fetch( this.svAPIEndpoint, this.compareInvoiceToWarehouse._path, params, ); return res; }, }; printSettings = { _path: Repzo._end_points.PRINT_SETTINGS, find: async ( params?: Service.PrintSetting.Find.Params, ): Promise => { let res: Service.PrintSetting.Find.Result = await this._fetch( this.svAPIEndpoint, this.printSettings._path, params, ); return res; }, get: async ( id: Service.PrintSetting.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.printSettings._path + `/${id}`, ); }, create: async ( body: Service.PrintSetting.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.printSettings._path, body, ); return res; }, update: async ( id: Service.PrintSetting.Update.ID, body: Service.PrintSetting.Update.Body, ): Promise => { let res: Service.PrintSetting.Update.Result = await this._update( this.svAPIEndpoint, this.printSettings._path + `/${id}`, body, ); return res; }, }; pdfTemplateGallery = { _path: Repzo._end_points.PDF_TEMPLATE_GALLERY, find: async ( params?: Service.PdfTemplateGallery.Find.Params, ): Promise => { let res: Service.PdfTemplateGallery.Find.Result = await this._fetch( this.svAPIEndpoint, this.pdfTemplateGallery._path, params, ); return res; }, get: async ( id: Service.PdfTemplateGallery.Get.ID, params?: Service.PdfTemplateGallery.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.pdfTemplateGallery._path + `/${id}`, params, ); }, create: async ( body: Service.PdfTemplateGallery.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.pdfTemplateGallery._path, body, ); return res; }, update: async ( id: Service.PdfTemplateGallery.Update.ID, body: Service.PdfTemplateGallery.Update.Body, ): Promise => { let res: Service.PdfTemplateGallery.Update.Result = await this._update( this.svAPIEndpoint, this.pdfTemplateGallery._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.PdfTemplateGallery.Remove.ID, ): Promise => { let res: Service.PdfTemplateGallery.Remove.Result = await this._delete( this.svAPIEndpoint, this.pdfTemplateGallery._path + `/${id}`, ); return res; }, }; pdfTemplate = { _path: Repzo._end_points.PDF_TEMPLATE, find: async ( params?: Service.PdfTemplate.Find.Params, ): Promise => { let res: Service.PdfTemplate.Find.Result = await this._fetch( this.svAPIEndpoint, this.pdfTemplate._path, params, ); return res; }, get: async ( id: Service.PdfTemplate.Get.ID, params?: Service.PdfTemplate.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.pdfTemplate._path + `/${id}`, params, ); }, create: async ( body: Service.PdfTemplate.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.pdfTemplate._path, body, ); return res; }, update: async ( id: Service.PdfTemplate.Update.ID, body: Service.PdfTemplate.Update.Body, ): Promise => { let res: Service.PdfTemplate.Update.Result = await this._update( this.svAPIEndpoint, this.pdfTemplate._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.PdfTemplate.Remove.ID, ): Promise => { let res: Service.PdfTemplate.Remove.Result = await this._delete( this.svAPIEndpoint, this.pdfTemplate._path + `/${id}`, ); return res; }, }; pdfMergeField = { _path: Repzo._end_points.PDF_MERGE_FIELD, find: async ( params?: Service.PdfMergeField.Find.Params, ): Promise => { let res: Service.PdfMergeField.Find.Result = await this._fetch( this.svAPIEndpoint, this.pdfMergeField._path, params, ); return res; }, get: async ( id: Service.PdfMergeField.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.pdfMergeField._path + `/${id}`, ); }, create: async ( body: Service.PdfMergeField.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.pdfMergeField._path, body, ); return res; }, update: async ( id: Service.PdfMergeField.Update.ID, body: Service.PdfMergeField.Update.Body, ): Promise => { let res: Service.PdfMergeField.Update.Result = await this._update( this.svAPIEndpoint, this.pdfMergeField._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.PdfMergeField.Remove.ID, ): Promise => { let res: Service.PdfMergeField.Remove.Result = await this._delete( this.svAPIEndpoint, this.pdfMergeField._path + `/${id}`, ); return res; }, }; optionalBusinessAppService = { _path: Repzo._end_points.OPTIONAL_BUSINESS_APP_SERVICE, find: async (): Promise => { let res: Service.OptionalBusinessAppService.Find.Result = await this._fetch( this.svAPIEndpoint, this.optionalBusinessAppService._path, ); return res; }, create: async (): Promise => { let res = await this._create( this.svAPIEndpoint, this.optionalBusinessAppService._path, {}, ); return res; }, }; promotionUsage = { _path: Repzo._end_points.PROMOTION_USAGE, find: async ( params?: Service.PromotionUsage.Find.Params, ): Promise => { let res: Service.PromotionUsage.Find.Result = await this._fetch( this.svAPIEndpoint, this.promotionUsage._path, params, ); return res; }, }; cart = { _path: Repzo._end_points.CART, find: async ( params?: Service.Cart.Find.Params, ): Promise => { let res: Service.Cart.Find.Result = await this._fetch( this.svAPIEndpoint, this.cart._path, params, ); return res; }, get: async ( id: Service.Cart.Get.ID, params?: Service.Cart.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.cart._path + `/${id}`, params, ); }, create: async ( body: Service.Cart.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.cart._path, body); return res; }, remove: async ( id: Service.Cart.Remove.ID, params?: Service.Cart.Get.Params, ): Promise => { let res: Service.Cart.Remove.Result = await this._delete( this.svAPIEndpoint, this.cart._path + id ? `/${id}` : "", params, ); return res; }, }; latestSerial = { _path: Repzo._end_points.LATEST_SERIAL, find: async ( params?: Service.LatestSerial.Find.Params, ): Promise => { let res: Service.LatestSerial.Find.Result = await this._fetch( this.svAPIEndpoint, this.latestSerial._path, params, ); return res; }, }; formV2 = { _path: Repzo._end_points.FORM_V2, find: async ( params?: Service.FormV2.Find.Params, ): Promise => { let res: Service.FormV2.Find.Result = await this._fetch( this.svAPIEndpoint, this.formV2._path, params, ); return res; }, get: async ( id: Service.FormV2.Get.ID, params?: Service.FormV2.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.formV2._path + `/${id}`, params, ); }, create: async ( body: Service.FormV2.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.formV2._path, body); return res; }, update: async ( id: Service.FormV2.Update.ID, body: Service.FormV2.Update.Body, ): Promise => { let res: Service.FormV2.Update.Result = await this._update( this.svAPIEndpoint, this.formV2._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.FormV2.Update.ID, ): Promise => { let res: Service.FormV2.Remove.Result = await this._delete( this.svAPIEndpoint, this.formV2._path + `/${id}`, ); return res; }, }; activityFormV2Result = { _path: Repzo._end_points.ACTIVITY_FORM_V2_RESULT, find: async ( params?: Service.ActivityFormV2Result.Find.Params, ): Promise => { let res: Service.ActivityFormV2Result.Find.Result = await this._fetch( this.svAPIEndpoint, this.activityFormV2Result._path, params, ); return res; }, get: async ( id: Service.ActivityFormV2Result.Get.ID, params?: Service.ActivityFormV2Result.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.activityFormV2Result._path + `/${id}`, params, ); }, create: async ( body: Service.ActivityFormV2Result.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.activityFormV2Result._path, body, ); return res; }, update: async ( id: Service.ActivityFormV2Result.Update.ID, body: Service.ActivityFormV2Result.Update.Body, ): Promise => { let res: Service.ActivityFormV2Result.Update.Result = await this._update( this.svAPIEndpoint, this.activityFormV2Result._path + `/${id}`, body, ); return res; }, patch: async ( params: Service.ActivityFormV2Result.Patch.Params, body: Service.ActivityFormV2Result.Patch.Body, ): Promise => { let res: Service.ActivityFormV2Result.Patch.Result = await this._patch( this.svAPIEndpoint, this.activityFormV2Result._path, body, params, ); return res; }, }; lineClassification = { _path: Repzo._end_points.LINE_CLASSIFICATION, find: async ( params?: Service.LineClassification.Find.Params, ): Promise => { let res: Service.LineClassification.Find.Result = await this._fetch( this.svAPIEndpoint, this.lineClassification._path, params, ); return res; }, get: async ( id: Service.LineClassification.Get.ID, params?: Service.LineClassification.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.lineClassification._path + `/${id}`, params, ); }, create: async ( body: Service.LineClassification.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.lineClassification._path, body, ); return res; }, update: async ( id: Service.LineClassification.Update.ID, body: Service.LineClassification.Update.Body, ): Promise => { let res: Service.LineClassification.Update.Result = await this._update( this.svAPIEndpoint, this.lineClassification._path + `/${id}`, body, ); return res; }, patch: async ( body: Service.LineClassification.Patch.Body, ): Promise => { let res: Service.LineClassification.Patch.Result = await this._patch( this.svAPIEndpoint, this.lineClassification._path, body, ); return res; }, remove: async ( id: Service.LineClassification.Update.ID, ): Promise => { let res: Service.LineClassification.Remove.Result = await this._delete( this.svAPIEndpoint, this.lineClassification._path + `/${id}`, ); return res; }, }; line = { _path: Repzo._end_points.LINE, find: async ( params?: Service.Line.Find.Params, ): Promise => { let res: Service.Line.Find.Result = await this._fetch( this.svAPIEndpoint, this.line._path, params, ); return res; }, get: async ( id: Service.Line.Get.ID, params?: Service.Line.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.line._path + `/${id}`, params, ); }, create: async ( body: Service.Line.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.line._path, body); return res; }, update: async ( id: Service.Line.Update.ID, body: Service.Line.Update.Body, ): Promise => { let res: Service.Line.Update.Result = await this._update( this.svAPIEndpoint, this.line._path + `/${id}`, body, ); return res; }, patch: async ( body: Service.Line.Patch.Body, ): Promise => { let res: Service.Line.Patch.Result = await this._patch( this.svAPIEndpoint, this.line._path, body, ); return res; }, remove: async ( id: Service.Line.Update.ID, ): Promise => { let res: Service.Line.Remove.Result = await this._delete( this.svAPIEndpoint, this.line._path + `/${id}`, ); return res; }, }; clientLine = { _path: Repzo._end_points.CLIENT_LINE, find: async ( params?: Service.ClientLine.Find.Params, ): Promise => { let res: Service.ClientLine.Find.Result = await this._fetch( this.svAPIEndpoint, this.clientLine._path, params, ); return res; }, get: async ( id: Service.ClientLine.Get.ID, params?: Service.ClientLine.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.clientLine._path + `/${id}`, params, ); }, create: async ( body: Service.ClientLine.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.clientLine._path, body, ); return res; }, update: async ( id: Service.ClientLine.Update.ID, body: Service.ClientLine.Update.Body, ): Promise => { let res: Service.ClientLine.Update.Result = await this._update( this.svAPIEndpoint, this.clientLine._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.ClientLine.Update.ID, ): Promise => { let res: Service.ClientLine.Remove.Result = await this._delete( this.svAPIEndpoint, this.clientLine._path + `/${id}`, ); return res; }, }; scheduledEmails = { _path: Repzo._end_points.SCHEDULED_EMAILS, find: async ( params?: Service.ScheduledEmails.Find.Params, ): Promise => { let res: Service.ScheduledEmails.Find.Result = await this._fetch( this.svAPIEndpoint, this.scheduledEmails._path, params, ); return res; }, get: async ( id: Service.ScheduledEmails.Get.ID, params?: Service.ScheduledEmails.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.scheduledEmails._path + `/${id}`, params, ); }, create: async ( body: Service.ScheduledEmails.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.scheduledEmails._path, body, ); return res; }, update: async ( id: Service.ScheduledEmails.Update.ID, body: Service.ScheduledEmails.Update.Body, ): Promise => { let res: Service.ScheduledEmails.Update.Result = await this._update( this.svAPIEndpoint, this.scheduledEmails._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.ScheduledEmails.Update.ID, ): Promise => { let res: Service.ScheduledEmails.Remove.Result = await this._delete( this.svAPIEndpoint, this.scheduledEmails._path + `/${id}`, ); return res; }, }; dataFileWarehouse = { _path: Repzo._end_points.DATA_FILE_WAREHOUSE, find: async ( params?: Service.DataFileWarehouse.Find.Params, ): Promise => { let res: Service.DataFileWarehouse.Find.Result = await this._fetch( this.svAPIEndpoint, this.dataFileWarehouse._path, params, ); return res; }, get: async ( id: Service.DataFileWarehouse.Get.ID, params?: Service.DataFileWarehouse.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.dataFileWarehouse._path + `/${id}`, params, ); }, create: async ( body: Service.DataFileWarehouse.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.dataFileWarehouse._path, body, ); return res; }, update: async ( id: Service.DataFileWarehouse.Update.ID, body: Service.DataFileWarehouse.Update.Body, ): Promise => { let res: Service.DataFileWarehouse.Update.Result = await this._update( this.svAPIEndpoint, this.dataFileWarehouse._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.DataFileWarehouse.Update.ID, ): Promise => { let res: Service.DataFileWarehouse.Remove.Result = await this._delete( this.svAPIEndpoint, this.dataFileWarehouse._path + `/${id}`, ); return res; }, }; dataSession = { _path: Repzo._end_points.DATA_SESSION, find: async ( params?: Service.DataSession.Find.Params, ): Promise => { let res: Service.DataSession.Find.Result = await this._fetch( this.svAPIEndpoint, this.dataSession._path, params, ); return res; }, get: async ( id: Service.DataSession.Get.ID, params?: Service.DataSession.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.dataSession._path + `/${id}`, params, ); }, create: async ( body: Service.DataSession.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.dataSession._path, body, ); return res; }, update: async ( id: Service.DataSession.Update.ID, body: Service.DataSession.Update.Body, ): Promise => { let res: Service.DataSession.Update.Result = await this._update( this.svAPIEndpoint, this.dataSession._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.DataSession.Update.ID, ): Promise => { let res: Service.DataSession.Remove.Result = await this._delete( this.svAPIEndpoint, this.dataSession._path + `/${id}`, ); return res; }, }; admin = { _path: Repzo._end_points.ADMIN, find: async ( params?: Service.Admin.Find.Params, ): Promise => { let res: Service.Admin.Find.Result = await this._fetch( this.svAPIEndpoint, this.admin._path, params, ); return res; }, get: async ( id: Service.Admin.Get.ID, params?: Service.Admin.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.admin._path + `/${id}`, params, ); }, create: async ( body: Service.Admin.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.admin._path, body); return res; }, update: async ( id: Service.Admin.Update.ID, body: Service.Admin.Update.Body, ): Promise => { let res: Service.Admin.Update.Result = await this._update( this.svAPIEndpoint, this.admin._path + `/${id}`, body, ); return res; }, globalize: async ( id: Service.Admin.Globalize.ID, ): Promise => { let res: Service.Admin.Globalize.Result = await this._update( this.svAPIEndpoint, this.admin._path + `/${id}`, {}, { globalize: true }, ); return res; }, remove: async ( id: Service.Admin.Update.ID, ): Promise => { let res: Service.Admin.Remove.Result = await this._delete( this.svAPIEndpoint, this.admin._path + `/${id}`, ); return res; }, }; jobCategory = { _path: Repzo._end_points.JOB_CATEGORY, find: async ( params?: Service.JobCategory.Find.Params, ): Promise => { let res: Service.JobCategory.Find.Result = await this._fetch( this.svAPIEndpoint, this.jobCategory._path, params, ); return res; }, get: async ( id: Service.JobCategory.Get.ID, params?: Service.JobCategory.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.jobCategory._path + `/${id}`, params, ); }, create: async ( body: Service.JobCategory.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.jobCategory._path, body, ); return res; }, update: async ( id: Service.JobCategory.Update.ID, body: Service.JobCategory.Update.Body, ): Promise => { let res: Service.JobCategory.Update.Result = await this._update( this.svAPIEndpoint, this.jobCategory._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.JobCategory.Remove.ID, ): Promise => { let res: Service.JobCategory.Remove.Result = await this._delete( this.svAPIEndpoint, this.jobCategory._path + `/${id}`, ); return res; }, }; jobCategoryAutoSkipAnalyze = { _path: Repzo._end_points.JOB_CATEGORY_AUTOSKIP_ANALYZE, create: async ( body: Service.JobCategoryAutoSkipAnalyze.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.jobCategoryAutoSkipAnalyze._path, body, ); return res; }, }; visitReason = { _path: Repzo._end_points.VISIT_REASON, find: async ( params?: Service.VisitReason.Find.Params, ): Promise => { let res: Service.VisitReason.Find.Result = await this._fetch( this.svAPIEndpoint, this.visitReason._path, params, ); return res; }, get: async ( id: Service.VisitReason.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.visitReason._path + `/${id}`, ); }, create: async ( body: Service.VisitReason.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.visitReason._path, body, ); return res; }, update: async ( id: Service.VisitReason.Update.ID, body: Service.VisitReason.Update.Body, ): Promise => { let res: Service.VisitReason.Update.Result = await this._update( this.svAPIEndpoint, this.visitReason._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.VisitReason.Remove.ID, ): Promise => { let res: Service.VisitReason.Remove.Result = await this._delete( this.svAPIEndpoint, this.visitReason._path + `/${id}`, ); return res; }, }; targetRule = { _path: Repzo._end_points.TARGET_RULE, find: async ( params?: Service.TargetRule.Find.Params, ): Promise => { let res: Service.TargetRule.Find.Result = await this._fetch( this.svAPIEndpoint, this.targetRule._path, params, ); return res; }, get: async ( id: Service.TargetRule.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.targetRule._path + `/${id}`, ); }, create: async ( body: Service.TargetRule.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.targetRule._path, body, ); return res; }, update: async ( id: Service.TargetRule.Update.ID, body: Service.TargetRule.Update.Body, ): Promise => { let res: Service.TargetRule.Update.Result = await this._update( this.svAPIEndpoint, this.targetRule._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.TargetRule.Remove.ID, ): Promise => { let res: Service.TargetRule.Remove.Result = await this._delete( this.svAPIEndpoint, this.targetRule._path + `/${id}`, ); return res; }, }; plan = { _path: Repzo._end_points.PLAN, find: async ( params?: Service.Plan.Find.Params, ): Promise => { let res: Service.Plan.Find.Result = await this._fetch( this.svAPIEndpoint, this.plan._path, params, ); return res; }, get: async ( id: Service.Plan.Get.ID, params?: Service.Plan.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.plan._path + `/${id}`, params, ); }, create: async ( body: Service.Plan.Create.Body, ): Promise => { let res = await this._create(this.svAPIEndpoint, this.plan._path, body); return res; }, update: async ( id: Service.Plan.Update.ID, body: Service.Plan.Update.Body, ): Promise => { let res: Service.Plan.Update.Result = await this._update( this.svAPIEndpoint, this.plan._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Plan.Remove.ID, ): Promise => { let res: Service.Plan.Remove.Result = await this._delete( this.svAPIEndpoint, this.plan._path + `/${id}`, ); return res; }, }; calendar = { _path: Repzo._end_points.CALENDAR, find: async ( params?: Service.Calendar.Find.Params, ): Promise => { let res: Service.Calendar.Find.Result = await this._fetch( this.svAPIEndpoint, this.calendar._path, params, ); return res; }, get: async ( id: Service.Calendar.Get.ID, params?: Service.Calendar.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.calendar._path + `/${id}`, params, ); }, create: async ( body: Service.Calendar.Create.Body, params?: Service.Calendar.Create.Params, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.calendar._path, body, params, ); return res; }, update: async ( id: Service.Calendar.Update.ID, body: Service.Calendar.Update.Body, ): Promise => { let res: Service.Calendar.Update.Result = await this._update( this.svAPIEndpoint, this.calendar._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.Calendar.Remove.ID, ): Promise => { let res: Service.Calendar.Remove.Result = await this._delete( this.svAPIEndpoint, this.calendar._path + `/${id}`, ); return res; }, }; lineTarget = { _path: Repzo._end_points.LINE_TARGET, find: async ( params?: Service.LineTarget.Find.Params, ): Promise => { let res: Service.LineTarget.Find.Result = await this._fetch( this.svAPIEndpoint, this.lineTarget._path, params, ); return res; }, get: async ( id: Service.LineTarget.Get.ID, params?: Service.LineTarget.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.lineTarget._path + `/${id}`, params, ); }, create: async ( body: Service.LineTarget.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.lineTarget._path, body, ); return res; }, update: async ( id: Service.LineTarget.Update.ID, body: Service.LineTarget.Update.Body, ): Promise => { let res: Service.LineTarget.Update.Result = await this._update( this.svAPIEndpoint, this.lineTarget._path + `/${id}`, body, ); return res; }, remove: async ( id: Service.LineTarget.Remove.ID, params?: Service.LineTarget.Remove.Params, ): Promise => { let res: Service.LineTarget.Remove.Result = await this._delete( this.svAPIEndpoint, this.lineTarget._path + (id ? `/${id}` : ""), params, ); return res; }, }; bulkImport = { _path: Repzo._end_points.BULK_IMPORT, find: async ( params?: Service.BulkImport.Find.Params, ): Promise => { let res: Service.BulkImport.Find.Result = await this._fetch( this.svAPIEndpoint, this.bulkImport._path, params, ); return res; }, get: async ( id: Service.BulkImport.Get.ID, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.bulkImport._path + `/${id}`, ); }, create: async ( params: Service.BulkImport.Create.Params, body: Service.BulkImport.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.bulkImport._path, body, params, ); return res; }, update: async ( id: Service.BulkImport.Update.ID, ): Promise => { let res: Service.BulkImport.Update.Result = await this._update( this.svAPIEndpoint, this.bulkImport._path + `/${id}`, {}, ); return res; }, }; bulkExport = { _path: Repzo._end_points.BULK_EXPORT, find: async ( params?: Service.BulkExport.Find.Params, ): Promise => { let res: Service.BulkExport.Find.Result = await this._fetch( this.svAPIEndpoint, this.bulkExport._path, params, ); return res; }, create: async ( params: Service.BulkExport.Create.Params, body: Service.BulkExport.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.bulkExport._path, body, params, ); return res; }, }; deliveryNote = { _path: Repzo._end_points.DELIVERY_NOTE, find: async ( params?: Service.DeliveryNote.Find.Params, ): Promise => { let res: Service.DeliveryNote.Find.Result = await this._fetch( this.svAPIEndpoint, this.deliveryNote._path, params, ); return res; }, get: async ( id: Service.DeliveryNote.Get.ID, params?: Service.DeliveryNote.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.deliveryNote._path + `/${id}`, params, ); }, create: async ( body: Service.DeliveryNote.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.deliveryNote._path, body, ); return res; }, update: async ( id: Service.DeliveryNote.Update.ID, body: Service.DeliveryNote.Update.Body, ): Promise => { let res: Service.DeliveryNote.Update.Result = await this._update( this.svAPIEndpoint, this.deliveryNote._path + `/${id}`, body, ); return res; }, }; reservation = { _path: Repzo._end_points.RESERVATION, find: async ( params?: Service.Reservation.Find.Params, ): Promise => { let res: Service.Reservation.Find.Result = await this._fetch( this.svAPIEndpoint, this.reservation._path, params, ); return res; }, get: async ( id: Service.Reservation.Get.ID, params?: Service.Reservation.Get.Params, ): Promise => { return await this._fetch( this.svAPIEndpoint, this.reservation._path + `/${id}`, params, ); }, create: async ( body: Service.Reservation.Create.Body, ): Promise => { let res = await this._create( this.svAPIEndpoint, this.reservation._path, body, ); return res; }, update: async ( id: Service.Reservation.Update.ID, body: Service.Reservation.Update.Body, ): Promise => { let res: Service.Reservation.Update.Result = await this._update( this.svAPIEndpoint, this.reservation._path + `/${id}`, body, ); return res; }, }; } function normalizeParams(params: Params): { [key: string]: any } { const normalized: Record = {}; for (const key in params) { const value = params[key]; if (value === undefined || value === null) continue; if ( typeof value === "object" && !(value instanceof Date) && !(value instanceof String) ) { normalized[key] = JSON.stringify(value); } else { normalized[key] = value; } } return normalized; }