@konversi/konversi-client 1.4.6 → 1.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,208 @@
1
+ import * as axios from 'axios';
2
+ import { AxiosRequestConfig } from 'axios';
3
+
4
+ declare const NOTIFICATION = "notification";
5
+ declare const USER_PERSONA = "user/user-persona";
6
+ declare const USER_PERSONA_CUSTOM_SCHEMA_PERMISSION = "user/user-persona-custom-schema-permission";
7
+ declare const USER_PERSONA_ENTITY_PERMISSION = "user/user-persona-entity-permission";
8
+ declare const USER_PERSONA_ENTITY_ACCESS_STATUS = "user/user-persona-entity-access-status";
9
+ declare const COMPANY_PERMISSION = "company-permission";
10
+ declare const COMPANY_OPTION = "company-option";
11
+ declare const INVITATION = "user/invitation";
12
+ declare const CUSTOMER = "contact/customer";
13
+ declare const PRODUCT = "product";
14
+ declare const PRODUCT_ITEM = "product/product-item";
15
+ declare const PRODUCT_GROUP = "product-group";
16
+ declare const PRODUCT_SUPPLIER = "product/product-supplier";
17
+ declare const PURCHASE_ORDER = "order/purchase-order";
18
+ declare const PURCHASE_ORDER_LINE = "order/purchase-order-line";
19
+ declare const QUOTE = "order/quote";
20
+ declare const QUOTE_LINE = "order/quote-line";
21
+ declare const SALES_ORDER = "order/sales-order";
22
+ declare const SALES_ORDER_LINE = "order/sales-order-line";
23
+ declare const RENTAL_ORDER = "order/rental-order";
24
+ declare const RENTAL_ORDER_LINE = "order/rental-order-line";
25
+ declare const SUPPLIER = "contact/supplier";
26
+ declare const WAREHOUSE = "warehouse";
27
+ declare const INCOMING_DELIVERY = "delivery/incoming-delivery";
28
+ declare const INCOMING_DELIVERY_LINE = "delivery/incoming-delivery-line";
29
+ declare const OUTGOING_DELIVERY = "delivery/outgoing-delivery";
30
+ declare const OUTGOING_DELIVERY_LINE = "delivery/outgoing-delivery-line";
31
+ declare const INTERNAL_DELIVERY = "delivery/internal-delivery";
32
+ declare const INTERNAL_DELIVERY_LINE = "delivery/internal-delivery-line";
33
+ declare const INVOICE = "invoice";
34
+ declare const INVOICE_LINE = "invoice/invoice-line";
35
+ declare const EXPENSE = "expense";
36
+ declare const EXPENSE_LINE = "expense/expense-line";
37
+ declare const PAYMENT = "accounting/payment";
38
+ declare const INCOMING_PAYMENT_METHOD = "accounting/incoming-payment-method";
39
+ declare const FIXED_ASSET = "fixed-asset";
40
+ declare const STORE = "store";
41
+ declare const STORE_PRODUCT = "store/store-product";
42
+ declare const STORE_PRODUCT_GROUP = "store/store-product-group";
43
+ declare const STORE_PRODUCT_ATTRIBUTE = "store/store-product-attribute";
44
+ declare const STORE_PRODUCT_ATTRIBUTE_VALUE = "store/store-product-attribute-value";
45
+ declare const ACCOUNT = "accounting/account";
46
+ declare const JOURNAL_ENTRY = "accounting/journal-entry";
47
+ declare const JOURNAL_ENTRY_LINE = "accounting/journal-entry-line";
48
+ declare const BILL_OF_MATERIALS = "manufacturing/bill-of-materials";
49
+ declare const BOM_COMPONENT = "manufacturing/bom-component";
50
+ declare const BOM_OPERATION = "manufacturing/bom-operation";
51
+ declare const PRODUCTION_ORDER = "manufacturing/production-order";
52
+ declare const PRODUCTION_ORDER_LINE = "manufacturing/production-order-line";
53
+ declare const JOB_CARD = "manufacturing/job-card";
54
+ declare const WORKSTATION = "manufacturing/workstation";
55
+ declare const SUBSIDIARY = "subsidiary";
56
+ declare const EMPLOYEE = "human-resources/employee";
57
+ declare const GEOFENCE = "geofence";
58
+ declare const SHIFT = "human-resources/employee/shift";
59
+ declare const ATTENDANCE = "human-resources/attendance";
60
+ declare const VEHICLE = "fleet/vehicle";
61
+ declare const DELIVERY_JOB = "fleet/delivery-job";
62
+ declare const CUSTOM_ENTITY_SCHEMA = "custom-entity/schema";
63
+ declare const CUSTOM_ENTITY_OBJECT = "custom-entity/object";
64
+ declare const CUSTOM_ENTITY_FIELD = "custom-entity/field";
65
+ declare const FORM = "form";
66
+ declare const CUSTOM_REPORT = "report/custom-report";
67
+ declare const AUTOMATION_JOB = "automation/job";
68
+ declare const AUTOMATION_SCRIPT = "automation/script";
69
+ declare const USER_ACTION = "automation/user-action";
70
+ declare const IOT_DEVICE = "iot/device";
71
+ declare const IOT_JOB = "iot/job";
72
+ declare const STOCK_ADJUSTMENT = "stock-adjustment";
73
+ declare const PURCHASE_ORDER_APPROVER = "approval/approver/purchase-order";
74
+ declare const SALES_ORDER_APPROVER = "approval/approver/sales-order";
75
+ declare const CUSTOM_DOCUMENT = "document-generator/custom-document";
76
+ declare const CUSTOM_FIELD = "custom-field";
77
+ declare const AUDIT_LOG = "audit-log";
78
+ declare const COMPANY_ALIAS = "company-alias";
79
+ declare const PRINT_JOB = "thermal-printer/print-job";
80
+ declare const WORK_ORDER = "order/sales-order?type=WORK_ORDER";
81
+ declare const SERVICE_ORDER = "order/sales-order?type=SERVICE_ORDER";
82
+ declare const IDENTIFIER_GROUP = "identifier/identifier-group";
83
+ declare const IDENTIFIER_TOKEN = "identifier/identifier-token";
84
+ declare const INCOMING_SHIPMENT = "shipment/incoming-shipment";
85
+ declare const OUTGOING_SHIPMENT = "shipment/outgoing-shipment";
86
+
87
+ declare const crudEndpoints_ACCOUNT: typeof ACCOUNT;
88
+ declare const crudEndpoints_ATTENDANCE: typeof ATTENDANCE;
89
+ declare const crudEndpoints_AUDIT_LOG: typeof AUDIT_LOG;
90
+ declare const crudEndpoints_AUTOMATION_JOB: typeof AUTOMATION_JOB;
91
+ declare const crudEndpoints_AUTOMATION_SCRIPT: typeof AUTOMATION_SCRIPT;
92
+ declare const crudEndpoints_BILL_OF_MATERIALS: typeof BILL_OF_MATERIALS;
93
+ declare const crudEndpoints_BOM_COMPONENT: typeof BOM_COMPONENT;
94
+ declare const crudEndpoints_BOM_OPERATION: typeof BOM_OPERATION;
95
+ declare const crudEndpoints_COMPANY_ALIAS: typeof COMPANY_ALIAS;
96
+ declare const crudEndpoints_COMPANY_OPTION: typeof COMPANY_OPTION;
97
+ declare const crudEndpoints_COMPANY_PERMISSION: typeof COMPANY_PERMISSION;
98
+ declare const crudEndpoints_CUSTOMER: typeof CUSTOMER;
99
+ declare const crudEndpoints_CUSTOM_DOCUMENT: typeof CUSTOM_DOCUMENT;
100
+ declare const crudEndpoints_CUSTOM_ENTITY_FIELD: typeof CUSTOM_ENTITY_FIELD;
101
+ declare const crudEndpoints_CUSTOM_ENTITY_OBJECT: typeof CUSTOM_ENTITY_OBJECT;
102
+ declare const crudEndpoints_CUSTOM_ENTITY_SCHEMA: typeof CUSTOM_ENTITY_SCHEMA;
103
+ declare const crudEndpoints_CUSTOM_FIELD: typeof CUSTOM_FIELD;
104
+ declare const crudEndpoints_CUSTOM_REPORT: typeof CUSTOM_REPORT;
105
+ declare const crudEndpoints_DELIVERY_JOB: typeof DELIVERY_JOB;
106
+ declare const crudEndpoints_EMPLOYEE: typeof EMPLOYEE;
107
+ declare const crudEndpoints_EXPENSE: typeof EXPENSE;
108
+ declare const crudEndpoints_EXPENSE_LINE: typeof EXPENSE_LINE;
109
+ declare const crudEndpoints_FIXED_ASSET: typeof FIXED_ASSET;
110
+ declare const crudEndpoints_FORM: typeof FORM;
111
+ declare const crudEndpoints_GEOFENCE: typeof GEOFENCE;
112
+ declare const crudEndpoints_IDENTIFIER_GROUP: typeof IDENTIFIER_GROUP;
113
+ declare const crudEndpoints_IDENTIFIER_TOKEN: typeof IDENTIFIER_TOKEN;
114
+ declare const crudEndpoints_INCOMING_DELIVERY: typeof INCOMING_DELIVERY;
115
+ declare const crudEndpoints_INCOMING_DELIVERY_LINE: typeof INCOMING_DELIVERY_LINE;
116
+ declare const crudEndpoints_INCOMING_PAYMENT_METHOD: typeof INCOMING_PAYMENT_METHOD;
117
+ declare const crudEndpoints_INCOMING_SHIPMENT: typeof INCOMING_SHIPMENT;
118
+ declare const crudEndpoints_INTERNAL_DELIVERY: typeof INTERNAL_DELIVERY;
119
+ declare const crudEndpoints_INTERNAL_DELIVERY_LINE: typeof INTERNAL_DELIVERY_LINE;
120
+ declare const crudEndpoints_INVITATION: typeof INVITATION;
121
+ declare const crudEndpoints_INVOICE: typeof INVOICE;
122
+ declare const crudEndpoints_INVOICE_LINE: typeof INVOICE_LINE;
123
+ declare const crudEndpoints_IOT_DEVICE: typeof IOT_DEVICE;
124
+ declare const crudEndpoints_IOT_JOB: typeof IOT_JOB;
125
+ declare const crudEndpoints_JOB_CARD: typeof JOB_CARD;
126
+ declare const crudEndpoints_JOURNAL_ENTRY: typeof JOURNAL_ENTRY;
127
+ declare const crudEndpoints_JOURNAL_ENTRY_LINE: typeof JOURNAL_ENTRY_LINE;
128
+ declare const crudEndpoints_NOTIFICATION: typeof NOTIFICATION;
129
+ declare const crudEndpoints_OUTGOING_DELIVERY: typeof OUTGOING_DELIVERY;
130
+ declare const crudEndpoints_OUTGOING_DELIVERY_LINE: typeof OUTGOING_DELIVERY_LINE;
131
+ declare const crudEndpoints_OUTGOING_SHIPMENT: typeof OUTGOING_SHIPMENT;
132
+ declare const crudEndpoints_PAYMENT: typeof PAYMENT;
133
+ declare const crudEndpoints_PRINT_JOB: typeof PRINT_JOB;
134
+ declare const crudEndpoints_PRODUCT: typeof PRODUCT;
135
+ declare const crudEndpoints_PRODUCTION_ORDER: typeof PRODUCTION_ORDER;
136
+ declare const crudEndpoints_PRODUCTION_ORDER_LINE: typeof PRODUCTION_ORDER_LINE;
137
+ declare const crudEndpoints_PRODUCT_GROUP: typeof PRODUCT_GROUP;
138
+ declare const crudEndpoints_PRODUCT_ITEM: typeof PRODUCT_ITEM;
139
+ declare const crudEndpoints_PRODUCT_SUPPLIER: typeof PRODUCT_SUPPLIER;
140
+ declare const crudEndpoints_PURCHASE_ORDER: typeof PURCHASE_ORDER;
141
+ declare const crudEndpoints_PURCHASE_ORDER_APPROVER: typeof PURCHASE_ORDER_APPROVER;
142
+ declare const crudEndpoints_PURCHASE_ORDER_LINE: typeof PURCHASE_ORDER_LINE;
143
+ declare const crudEndpoints_QUOTE: typeof QUOTE;
144
+ declare const crudEndpoints_QUOTE_LINE: typeof QUOTE_LINE;
145
+ declare const crudEndpoints_RENTAL_ORDER: typeof RENTAL_ORDER;
146
+ declare const crudEndpoints_RENTAL_ORDER_LINE: typeof RENTAL_ORDER_LINE;
147
+ declare const crudEndpoints_SALES_ORDER: typeof SALES_ORDER;
148
+ declare const crudEndpoints_SALES_ORDER_APPROVER: typeof SALES_ORDER_APPROVER;
149
+ declare const crudEndpoints_SALES_ORDER_LINE: typeof SALES_ORDER_LINE;
150
+ declare const crudEndpoints_SERVICE_ORDER: typeof SERVICE_ORDER;
151
+ declare const crudEndpoints_SHIFT: typeof SHIFT;
152
+ declare const crudEndpoints_STOCK_ADJUSTMENT: typeof STOCK_ADJUSTMENT;
153
+ declare const crudEndpoints_STORE: typeof STORE;
154
+ declare const crudEndpoints_STORE_PRODUCT: typeof STORE_PRODUCT;
155
+ declare const crudEndpoints_STORE_PRODUCT_ATTRIBUTE: typeof STORE_PRODUCT_ATTRIBUTE;
156
+ declare const crudEndpoints_STORE_PRODUCT_ATTRIBUTE_VALUE: typeof STORE_PRODUCT_ATTRIBUTE_VALUE;
157
+ declare const crudEndpoints_STORE_PRODUCT_GROUP: typeof STORE_PRODUCT_GROUP;
158
+ declare const crudEndpoints_SUBSIDIARY: typeof SUBSIDIARY;
159
+ declare const crudEndpoints_SUPPLIER: typeof SUPPLIER;
160
+ declare const crudEndpoints_USER_ACTION: typeof USER_ACTION;
161
+ declare const crudEndpoints_USER_PERSONA: typeof USER_PERSONA;
162
+ declare const crudEndpoints_USER_PERSONA_CUSTOM_SCHEMA_PERMISSION: typeof USER_PERSONA_CUSTOM_SCHEMA_PERMISSION;
163
+ declare const crudEndpoints_USER_PERSONA_ENTITY_ACCESS_STATUS: typeof USER_PERSONA_ENTITY_ACCESS_STATUS;
164
+ declare const crudEndpoints_USER_PERSONA_ENTITY_PERMISSION: typeof USER_PERSONA_ENTITY_PERMISSION;
165
+ declare const crudEndpoints_VEHICLE: typeof VEHICLE;
166
+ declare const crudEndpoints_WAREHOUSE: typeof WAREHOUSE;
167
+ declare const crudEndpoints_WORKSTATION: typeof WORKSTATION;
168
+ declare const crudEndpoints_WORK_ORDER: typeof WORK_ORDER;
169
+ declare namespace crudEndpoints {
170
+ export { crudEndpoints_ACCOUNT as ACCOUNT, crudEndpoints_ATTENDANCE as ATTENDANCE, crudEndpoints_AUDIT_LOG as AUDIT_LOG, crudEndpoints_AUTOMATION_JOB as AUTOMATION_JOB, crudEndpoints_AUTOMATION_SCRIPT as AUTOMATION_SCRIPT, crudEndpoints_BILL_OF_MATERIALS as BILL_OF_MATERIALS, crudEndpoints_BOM_COMPONENT as BOM_COMPONENT, crudEndpoints_BOM_OPERATION as BOM_OPERATION, crudEndpoints_COMPANY_ALIAS as COMPANY_ALIAS, crudEndpoints_COMPANY_OPTION as COMPANY_OPTION, crudEndpoints_COMPANY_PERMISSION as COMPANY_PERMISSION, crudEndpoints_CUSTOMER as CUSTOMER, crudEndpoints_CUSTOM_DOCUMENT as CUSTOM_DOCUMENT, crudEndpoints_CUSTOM_ENTITY_FIELD as CUSTOM_ENTITY_FIELD, crudEndpoints_CUSTOM_ENTITY_OBJECT as CUSTOM_ENTITY_OBJECT, crudEndpoints_CUSTOM_ENTITY_SCHEMA as CUSTOM_ENTITY_SCHEMA, crudEndpoints_CUSTOM_FIELD as CUSTOM_FIELD, crudEndpoints_CUSTOM_REPORT as CUSTOM_REPORT, crudEndpoints_DELIVERY_JOB as DELIVERY_JOB, crudEndpoints_EMPLOYEE as EMPLOYEE, crudEndpoints_EXPENSE as EXPENSE, crudEndpoints_EXPENSE_LINE as EXPENSE_LINE, crudEndpoints_FIXED_ASSET as FIXED_ASSET, crudEndpoints_FORM as FORM, crudEndpoints_GEOFENCE as GEOFENCE, crudEndpoints_IDENTIFIER_GROUP as IDENTIFIER_GROUP, crudEndpoints_IDENTIFIER_TOKEN as IDENTIFIER_TOKEN, crudEndpoints_INCOMING_DELIVERY as INCOMING_DELIVERY, crudEndpoints_INCOMING_DELIVERY_LINE as INCOMING_DELIVERY_LINE, crudEndpoints_INCOMING_PAYMENT_METHOD as INCOMING_PAYMENT_METHOD, crudEndpoints_INCOMING_SHIPMENT as INCOMING_SHIPMENT, crudEndpoints_INTERNAL_DELIVERY as INTERNAL_DELIVERY, crudEndpoints_INTERNAL_DELIVERY_LINE as INTERNAL_DELIVERY_LINE, crudEndpoints_INVITATION as INVITATION, crudEndpoints_INVOICE as INVOICE, crudEndpoints_INVOICE_LINE as INVOICE_LINE, crudEndpoints_IOT_DEVICE as IOT_DEVICE, crudEndpoints_IOT_JOB as IOT_JOB, crudEndpoints_JOB_CARD as JOB_CARD, crudEndpoints_JOURNAL_ENTRY as JOURNAL_ENTRY, crudEndpoints_JOURNAL_ENTRY_LINE as JOURNAL_ENTRY_LINE, crudEndpoints_NOTIFICATION as NOTIFICATION, crudEndpoints_OUTGOING_DELIVERY as OUTGOING_DELIVERY, crudEndpoints_OUTGOING_DELIVERY_LINE as OUTGOING_DELIVERY_LINE, crudEndpoints_OUTGOING_SHIPMENT as OUTGOING_SHIPMENT, crudEndpoints_PAYMENT as PAYMENT, crudEndpoints_PRINT_JOB as PRINT_JOB, crudEndpoints_PRODUCT as PRODUCT, crudEndpoints_PRODUCTION_ORDER as PRODUCTION_ORDER, crudEndpoints_PRODUCTION_ORDER_LINE as PRODUCTION_ORDER_LINE, crudEndpoints_PRODUCT_GROUP as PRODUCT_GROUP, crudEndpoints_PRODUCT_ITEM as PRODUCT_ITEM, crudEndpoints_PRODUCT_SUPPLIER as PRODUCT_SUPPLIER, crudEndpoints_PURCHASE_ORDER as PURCHASE_ORDER, crudEndpoints_PURCHASE_ORDER_APPROVER as PURCHASE_ORDER_APPROVER, crudEndpoints_PURCHASE_ORDER_LINE as PURCHASE_ORDER_LINE, crudEndpoints_QUOTE as QUOTE, crudEndpoints_QUOTE_LINE as QUOTE_LINE, crudEndpoints_RENTAL_ORDER as RENTAL_ORDER, crudEndpoints_RENTAL_ORDER_LINE as RENTAL_ORDER_LINE, crudEndpoints_SALES_ORDER as SALES_ORDER, crudEndpoints_SALES_ORDER_APPROVER as SALES_ORDER_APPROVER, crudEndpoints_SALES_ORDER_LINE as SALES_ORDER_LINE, crudEndpoints_SERVICE_ORDER as SERVICE_ORDER, crudEndpoints_SHIFT as SHIFT, crudEndpoints_STOCK_ADJUSTMENT as STOCK_ADJUSTMENT, crudEndpoints_STORE as STORE, crudEndpoints_STORE_PRODUCT as STORE_PRODUCT, crudEndpoints_STORE_PRODUCT_ATTRIBUTE as STORE_PRODUCT_ATTRIBUTE, crudEndpoints_STORE_PRODUCT_ATTRIBUTE_VALUE as STORE_PRODUCT_ATTRIBUTE_VALUE, crudEndpoints_STORE_PRODUCT_GROUP as STORE_PRODUCT_GROUP, crudEndpoints_SUBSIDIARY as SUBSIDIARY, crudEndpoints_SUPPLIER as SUPPLIER, crudEndpoints_USER_ACTION as USER_ACTION, crudEndpoints_USER_PERSONA as USER_PERSONA, crudEndpoints_USER_PERSONA_CUSTOM_SCHEMA_PERMISSION as USER_PERSONA_CUSTOM_SCHEMA_PERMISSION, crudEndpoints_USER_PERSONA_ENTITY_ACCESS_STATUS as USER_PERSONA_ENTITY_ACCESS_STATUS, crudEndpoints_USER_PERSONA_ENTITY_PERMISSION as USER_PERSONA_ENTITY_PERMISSION, crudEndpoints_VEHICLE as VEHICLE, crudEndpoints_WAREHOUSE as WAREHOUSE, crudEndpoints_WORKSTATION as WORKSTATION, crudEndpoints_WORK_ORDER as WORK_ORDER };
171
+ }
172
+
173
+ declare function call(axiosRequest: AxiosRequestConfig): Promise<axios.AxiosResponse<any, any>>;
174
+ declare function getAllCustomObjects(schemaName: string, queryParams?: any): Promise<any>;
175
+ declare function getCustomObjectById(schemaName: string, id: string): Promise<any>;
176
+ declare function updateCustomObject(schemaName: string, id: string, newData: any): Promise<any>;
177
+ declare function createCustomObject(schemaName: string, data: any): Promise<any>;
178
+ declare function deleteCustomObject(schemaName: string, id: string): Promise<any>;
179
+ declare function getAllObjects(entity: any, queryParams?: any): Promise<any>;
180
+ declare function getObjectById(entity: any, id: string): Promise<any>;
181
+ declare function updateObject(entity: any, id: string, newData: any): Promise<any>;
182
+ declare function createObject(entity: any, data: any): Promise<any>;
183
+ declare function deleteObject(entity: any, id: string): Promise<any>;
184
+ declare function runScript(scriptNameOrId: string, input: any, sync?: boolean): Promise<any>;
185
+ declare const konversiAPI: {
186
+ setToken: (token: string) => void;
187
+ setCompanyId: (companyId: string) => void;
188
+ setBaseUrl: (baseUrl: string) => void;
189
+ getAllCustomObjects: typeof getAllCustomObjects;
190
+ getCustomObjectById: typeof getCustomObjectById;
191
+ updateCustomObject: typeof updateCustomObject;
192
+ deleteCustomObject: typeof deleteCustomObject;
193
+ createCustomObject: typeof createCustomObject;
194
+ getAllObjects: typeof getAllObjects;
195
+ getObjectById: typeof getObjectById;
196
+ updateObject: typeof updateObject;
197
+ createObject: typeof createObject;
198
+ deleteObject: typeof deleteObject;
199
+ runScript: typeof runScript;
200
+ call: typeof call;
201
+ baseUrl: string | undefined;
202
+ token: string;
203
+ companyId: axios.AxiosHeaderValue | undefined;
204
+ };
205
+
206
+ declare const Entity: typeof crudEndpoints;
207
+
208
+ export { Entity, konversiAPI as default, runScript };
@@ -0,0 +1,208 @@
1
+ import * as axios from 'axios';
2
+ import { AxiosRequestConfig } from 'axios';
3
+
4
+ declare const NOTIFICATION = "notification";
5
+ declare const USER_PERSONA = "user/user-persona";
6
+ declare const USER_PERSONA_CUSTOM_SCHEMA_PERMISSION = "user/user-persona-custom-schema-permission";
7
+ declare const USER_PERSONA_ENTITY_PERMISSION = "user/user-persona-entity-permission";
8
+ declare const USER_PERSONA_ENTITY_ACCESS_STATUS = "user/user-persona-entity-access-status";
9
+ declare const COMPANY_PERMISSION = "company-permission";
10
+ declare const COMPANY_OPTION = "company-option";
11
+ declare const INVITATION = "user/invitation";
12
+ declare const CUSTOMER = "contact/customer";
13
+ declare const PRODUCT = "product";
14
+ declare const PRODUCT_ITEM = "product/product-item";
15
+ declare const PRODUCT_GROUP = "product-group";
16
+ declare const PRODUCT_SUPPLIER = "product/product-supplier";
17
+ declare const PURCHASE_ORDER = "order/purchase-order";
18
+ declare const PURCHASE_ORDER_LINE = "order/purchase-order-line";
19
+ declare const QUOTE = "order/quote";
20
+ declare const QUOTE_LINE = "order/quote-line";
21
+ declare const SALES_ORDER = "order/sales-order";
22
+ declare const SALES_ORDER_LINE = "order/sales-order-line";
23
+ declare const RENTAL_ORDER = "order/rental-order";
24
+ declare const RENTAL_ORDER_LINE = "order/rental-order-line";
25
+ declare const SUPPLIER = "contact/supplier";
26
+ declare const WAREHOUSE = "warehouse";
27
+ declare const INCOMING_DELIVERY = "delivery/incoming-delivery";
28
+ declare const INCOMING_DELIVERY_LINE = "delivery/incoming-delivery-line";
29
+ declare const OUTGOING_DELIVERY = "delivery/outgoing-delivery";
30
+ declare const OUTGOING_DELIVERY_LINE = "delivery/outgoing-delivery-line";
31
+ declare const INTERNAL_DELIVERY = "delivery/internal-delivery";
32
+ declare const INTERNAL_DELIVERY_LINE = "delivery/internal-delivery-line";
33
+ declare const INVOICE = "invoice";
34
+ declare const INVOICE_LINE = "invoice/invoice-line";
35
+ declare const EXPENSE = "expense";
36
+ declare const EXPENSE_LINE = "expense/expense-line";
37
+ declare const PAYMENT = "accounting/payment";
38
+ declare const INCOMING_PAYMENT_METHOD = "accounting/incoming-payment-method";
39
+ declare const FIXED_ASSET = "fixed-asset";
40
+ declare const STORE = "store";
41
+ declare const STORE_PRODUCT = "store/store-product";
42
+ declare const STORE_PRODUCT_GROUP = "store/store-product-group";
43
+ declare const STORE_PRODUCT_ATTRIBUTE = "store/store-product-attribute";
44
+ declare const STORE_PRODUCT_ATTRIBUTE_VALUE = "store/store-product-attribute-value";
45
+ declare const ACCOUNT = "accounting/account";
46
+ declare const JOURNAL_ENTRY = "accounting/journal-entry";
47
+ declare const JOURNAL_ENTRY_LINE = "accounting/journal-entry-line";
48
+ declare const BILL_OF_MATERIALS = "manufacturing/bill-of-materials";
49
+ declare const BOM_COMPONENT = "manufacturing/bom-component";
50
+ declare const BOM_OPERATION = "manufacturing/bom-operation";
51
+ declare const PRODUCTION_ORDER = "manufacturing/production-order";
52
+ declare const PRODUCTION_ORDER_LINE = "manufacturing/production-order-line";
53
+ declare const JOB_CARD = "manufacturing/job-card";
54
+ declare const WORKSTATION = "manufacturing/workstation";
55
+ declare const SUBSIDIARY = "subsidiary";
56
+ declare const EMPLOYEE = "human-resources/employee";
57
+ declare const GEOFENCE = "geofence";
58
+ declare const SHIFT = "human-resources/employee/shift";
59
+ declare const ATTENDANCE = "human-resources/attendance";
60
+ declare const VEHICLE = "fleet/vehicle";
61
+ declare const DELIVERY_JOB = "fleet/delivery-job";
62
+ declare const CUSTOM_ENTITY_SCHEMA = "custom-entity/schema";
63
+ declare const CUSTOM_ENTITY_OBJECT = "custom-entity/object";
64
+ declare const CUSTOM_ENTITY_FIELD = "custom-entity/field";
65
+ declare const FORM = "form";
66
+ declare const CUSTOM_REPORT = "report/custom-report";
67
+ declare const AUTOMATION_JOB = "automation/job";
68
+ declare const AUTOMATION_SCRIPT = "automation/script";
69
+ declare const USER_ACTION = "automation/user-action";
70
+ declare const IOT_DEVICE = "iot/device";
71
+ declare const IOT_JOB = "iot/job";
72
+ declare const STOCK_ADJUSTMENT = "stock-adjustment";
73
+ declare const PURCHASE_ORDER_APPROVER = "approval/approver/purchase-order";
74
+ declare const SALES_ORDER_APPROVER = "approval/approver/sales-order";
75
+ declare const CUSTOM_DOCUMENT = "document-generator/custom-document";
76
+ declare const CUSTOM_FIELD = "custom-field";
77
+ declare const AUDIT_LOG = "audit-log";
78
+ declare const COMPANY_ALIAS = "company-alias";
79
+ declare const PRINT_JOB = "thermal-printer/print-job";
80
+ declare const WORK_ORDER = "order/sales-order?type=WORK_ORDER";
81
+ declare const SERVICE_ORDER = "order/sales-order?type=SERVICE_ORDER";
82
+ declare const IDENTIFIER_GROUP = "identifier/identifier-group";
83
+ declare const IDENTIFIER_TOKEN = "identifier/identifier-token";
84
+ declare const INCOMING_SHIPMENT = "shipment/incoming-shipment";
85
+ declare const OUTGOING_SHIPMENT = "shipment/outgoing-shipment";
86
+
87
+ declare const crudEndpoints_ACCOUNT: typeof ACCOUNT;
88
+ declare const crudEndpoints_ATTENDANCE: typeof ATTENDANCE;
89
+ declare const crudEndpoints_AUDIT_LOG: typeof AUDIT_LOG;
90
+ declare const crudEndpoints_AUTOMATION_JOB: typeof AUTOMATION_JOB;
91
+ declare const crudEndpoints_AUTOMATION_SCRIPT: typeof AUTOMATION_SCRIPT;
92
+ declare const crudEndpoints_BILL_OF_MATERIALS: typeof BILL_OF_MATERIALS;
93
+ declare const crudEndpoints_BOM_COMPONENT: typeof BOM_COMPONENT;
94
+ declare const crudEndpoints_BOM_OPERATION: typeof BOM_OPERATION;
95
+ declare const crudEndpoints_COMPANY_ALIAS: typeof COMPANY_ALIAS;
96
+ declare const crudEndpoints_COMPANY_OPTION: typeof COMPANY_OPTION;
97
+ declare const crudEndpoints_COMPANY_PERMISSION: typeof COMPANY_PERMISSION;
98
+ declare const crudEndpoints_CUSTOMER: typeof CUSTOMER;
99
+ declare const crudEndpoints_CUSTOM_DOCUMENT: typeof CUSTOM_DOCUMENT;
100
+ declare const crudEndpoints_CUSTOM_ENTITY_FIELD: typeof CUSTOM_ENTITY_FIELD;
101
+ declare const crudEndpoints_CUSTOM_ENTITY_OBJECT: typeof CUSTOM_ENTITY_OBJECT;
102
+ declare const crudEndpoints_CUSTOM_ENTITY_SCHEMA: typeof CUSTOM_ENTITY_SCHEMA;
103
+ declare const crudEndpoints_CUSTOM_FIELD: typeof CUSTOM_FIELD;
104
+ declare const crudEndpoints_CUSTOM_REPORT: typeof CUSTOM_REPORT;
105
+ declare const crudEndpoints_DELIVERY_JOB: typeof DELIVERY_JOB;
106
+ declare const crudEndpoints_EMPLOYEE: typeof EMPLOYEE;
107
+ declare const crudEndpoints_EXPENSE: typeof EXPENSE;
108
+ declare const crudEndpoints_EXPENSE_LINE: typeof EXPENSE_LINE;
109
+ declare const crudEndpoints_FIXED_ASSET: typeof FIXED_ASSET;
110
+ declare const crudEndpoints_FORM: typeof FORM;
111
+ declare const crudEndpoints_GEOFENCE: typeof GEOFENCE;
112
+ declare const crudEndpoints_IDENTIFIER_GROUP: typeof IDENTIFIER_GROUP;
113
+ declare const crudEndpoints_IDENTIFIER_TOKEN: typeof IDENTIFIER_TOKEN;
114
+ declare const crudEndpoints_INCOMING_DELIVERY: typeof INCOMING_DELIVERY;
115
+ declare const crudEndpoints_INCOMING_DELIVERY_LINE: typeof INCOMING_DELIVERY_LINE;
116
+ declare const crudEndpoints_INCOMING_PAYMENT_METHOD: typeof INCOMING_PAYMENT_METHOD;
117
+ declare const crudEndpoints_INCOMING_SHIPMENT: typeof INCOMING_SHIPMENT;
118
+ declare const crudEndpoints_INTERNAL_DELIVERY: typeof INTERNAL_DELIVERY;
119
+ declare const crudEndpoints_INTERNAL_DELIVERY_LINE: typeof INTERNAL_DELIVERY_LINE;
120
+ declare const crudEndpoints_INVITATION: typeof INVITATION;
121
+ declare const crudEndpoints_INVOICE: typeof INVOICE;
122
+ declare const crudEndpoints_INVOICE_LINE: typeof INVOICE_LINE;
123
+ declare const crudEndpoints_IOT_DEVICE: typeof IOT_DEVICE;
124
+ declare const crudEndpoints_IOT_JOB: typeof IOT_JOB;
125
+ declare const crudEndpoints_JOB_CARD: typeof JOB_CARD;
126
+ declare const crudEndpoints_JOURNAL_ENTRY: typeof JOURNAL_ENTRY;
127
+ declare const crudEndpoints_JOURNAL_ENTRY_LINE: typeof JOURNAL_ENTRY_LINE;
128
+ declare const crudEndpoints_NOTIFICATION: typeof NOTIFICATION;
129
+ declare const crudEndpoints_OUTGOING_DELIVERY: typeof OUTGOING_DELIVERY;
130
+ declare const crudEndpoints_OUTGOING_DELIVERY_LINE: typeof OUTGOING_DELIVERY_LINE;
131
+ declare const crudEndpoints_OUTGOING_SHIPMENT: typeof OUTGOING_SHIPMENT;
132
+ declare const crudEndpoints_PAYMENT: typeof PAYMENT;
133
+ declare const crudEndpoints_PRINT_JOB: typeof PRINT_JOB;
134
+ declare const crudEndpoints_PRODUCT: typeof PRODUCT;
135
+ declare const crudEndpoints_PRODUCTION_ORDER: typeof PRODUCTION_ORDER;
136
+ declare const crudEndpoints_PRODUCTION_ORDER_LINE: typeof PRODUCTION_ORDER_LINE;
137
+ declare const crudEndpoints_PRODUCT_GROUP: typeof PRODUCT_GROUP;
138
+ declare const crudEndpoints_PRODUCT_ITEM: typeof PRODUCT_ITEM;
139
+ declare const crudEndpoints_PRODUCT_SUPPLIER: typeof PRODUCT_SUPPLIER;
140
+ declare const crudEndpoints_PURCHASE_ORDER: typeof PURCHASE_ORDER;
141
+ declare const crudEndpoints_PURCHASE_ORDER_APPROVER: typeof PURCHASE_ORDER_APPROVER;
142
+ declare const crudEndpoints_PURCHASE_ORDER_LINE: typeof PURCHASE_ORDER_LINE;
143
+ declare const crudEndpoints_QUOTE: typeof QUOTE;
144
+ declare const crudEndpoints_QUOTE_LINE: typeof QUOTE_LINE;
145
+ declare const crudEndpoints_RENTAL_ORDER: typeof RENTAL_ORDER;
146
+ declare const crudEndpoints_RENTAL_ORDER_LINE: typeof RENTAL_ORDER_LINE;
147
+ declare const crudEndpoints_SALES_ORDER: typeof SALES_ORDER;
148
+ declare const crudEndpoints_SALES_ORDER_APPROVER: typeof SALES_ORDER_APPROVER;
149
+ declare const crudEndpoints_SALES_ORDER_LINE: typeof SALES_ORDER_LINE;
150
+ declare const crudEndpoints_SERVICE_ORDER: typeof SERVICE_ORDER;
151
+ declare const crudEndpoints_SHIFT: typeof SHIFT;
152
+ declare const crudEndpoints_STOCK_ADJUSTMENT: typeof STOCK_ADJUSTMENT;
153
+ declare const crudEndpoints_STORE: typeof STORE;
154
+ declare const crudEndpoints_STORE_PRODUCT: typeof STORE_PRODUCT;
155
+ declare const crudEndpoints_STORE_PRODUCT_ATTRIBUTE: typeof STORE_PRODUCT_ATTRIBUTE;
156
+ declare const crudEndpoints_STORE_PRODUCT_ATTRIBUTE_VALUE: typeof STORE_PRODUCT_ATTRIBUTE_VALUE;
157
+ declare const crudEndpoints_STORE_PRODUCT_GROUP: typeof STORE_PRODUCT_GROUP;
158
+ declare const crudEndpoints_SUBSIDIARY: typeof SUBSIDIARY;
159
+ declare const crudEndpoints_SUPPLIER: typeof SUPPLIER;
160
+ declare const crudEndpoints_USER_ACTION: typeof USER_ACTION;
161
+ declare const crudEndpoints_USER_PERSONA: typeof USER_PERSONA;
162
+ declare const crudEndpoints_USER_PERSONA_CUSTOM_SCHEMA_PERMISSION: typeof USER_PERSONA_CUSTOM_SCHEMA_PERMISSION;
163
+ declare const crudEndpoints_USER_PERSONA_ENTITY_ACCESS_STATUS: typeof USER_PERSONA_ENTITY_ACCESS_STATUS;
164
+ declare const crudEndpoints_USER_PERSONA_ENTITY_PERMISSION: typeof USER_PERSONA_ENTITY_PERMISSION;
165
+ declare const crudEndpoints_VEHICLE: typeof VEHICLE;
166
+ declare const crudEndpoints_WAREHOUSE: typeof WAREHOUSE;
167
+ declare const crudEndpoints_WORKSTATION: typeof WORKSTATION;
168
+ declare const crudEndpoints_WORK_ORDER: typeof WORK_ORDER;
169
+ declare namespace crudEndpoints {
170
+ export { crudEndpoints_ACCOUNT as ACCOUNT, crudEndpoints_ATTENDANCE as ATTENDANCE, crudEndpoints_AUDIT_LOG as AUDIT_LOG, crudEndpoints_AUTOMATION_JOB as AUTOMATION_JOB, crudEndpoints_AUTOMATION_SCRIPT as AUTOMATION_SCRIPT, crudEndpoints_BILL_OF_MATERIALS as BILL_OF_MATERIALS, crudEndpoints_BOM_COMPONENT as BOM_COMPONENT, crudEndpoints_BOM_OPERATION as BOM_OPERATION, crudEndpoints_COMPANY_ALIAS as COMPANY_ALIAS, crudEndpoints_COMPANY_OPTION as COMPANY_OPTION, crudEndpoints_COMPANY_PERMISSION as COMPANY_PERMISSION, crudEndpoints_CUSTOMER as CUSTOMER, crudEndpoints_CUSTOM_DOCUMENT as CUSTOM_DOCUMENT, crudEndpoints_CUSTOM_ENTITY_FIELD as CUSTOM_ENTITY_FIELD, crudEndpoints_CUSTOM_ENTITY_OBJECT as CUSTOM_ENTITY_OBJECT, crudEndpoints_CUSTOM_ENTITY_SCHEMA as CUSTOM_ENTITY_SCHEMA, crudEndpoints_CUSTOM_FIELD as CUSTOM_FIELD, crudEndpoints_CUSTOM_REPORT as CUSTOM_REPORT, crudEndpoints_DELIVERY_JOB as DELIVERY_JOB, crudEndpoints_EMPLOYEE as EMPLOYEE, crudEndpoints_EXPENSE as EXPENSE, crudEndpoints_EXPENSE_LINE as EXPENSE_LINE, crudEndpoints_FIXED_ASSET as FIXED_ASSET, crudEndpoints_FORM as FORM, crudEndpoints_GEOFENCE as GEOFENCE, crudEndpoints_IDENTIFIER_GROUP as IDENTIFIER_GROUP, crudEndpoints_IDENTIFIER_TOKEN as IDENTIFIER_TOKEN, crudEndpoints_INCOMING_DELIVERY as INCOMING_DELIVERY, crudEndpoints_INCOMING_DELIVERY_LINE as INCOMING_DELIVERY_LINE, crudEndpoints_INCOMING_PAYMENT_METHOD as INCOMING_PAYMENT_METHOD, crudEndpoints_INCOMING_SHIPMENT as INCOMING_SHIPMENT, crudEndpoints_INTERNAL_DELIVERY as INTERNAL_DELIVERY, crudEndpoints_INTERNAL_DELIVERY_LINE as INTERNAL_DELIVERY_LINE, crudEndpoints_INVITATION as INVITATION, crudEndpoints_INVOICE as INVOICE, crudEndpoints_INVOICE_LINE as INVOICE_LINE, crudEndpoints_IOT_DEVICE as IOT_DEVICE, crudEndpoints_IOT_JOB as IOT_JOB, crudEndpoints_JOB_CARD as JOB_CARD, crudEndpoints_JOURNAL_ENTRY as JOURNAL_ENTRY, crudEndpoints_JOURNAL_ENTRY_LINE as JOURNAL_ENTRY_LINE, crudEndpoints_NOTIFICATION as NOTIFICATION, crudEndpoints_OUTGOING_DELIVERY as OUTGOING_DELIVERY, crudEndpoints_OUTGOING_DELIVERY_LINE as OUTGOING_DELIVERY_LINE, crudEndpoints_OUTGOING_SHIPMENT as OUTGOING_SHIPMENT, crudEndpoints_PAYMENT as PAYMENT, crudEndpoints_PRINT_JOB as PRINT_JOB, crudEndpoints_PRODUCT as PRODUCT, crudEndpoints_PRODUCTION_ORDER as PRODUCTION_ORDER, crudEndpoints_PRODUCTION_ORDER_LINE as PRODUCTION_ORDER_LINE, crudEndpoints_PRODUCT_GROUP as PRODUCT_GROUP, crudEndpoints_PRODUCT_ITEM as PRODUCT_ITEM, crudEndpoints_PRODUCT_SUPPLIER as PRODUCT_SUPPLIER, crudEndpoints_PURCHASE_ORDER as PURCHASE_ORDER, crudEndpoints_PURCHASE_ORDER_APPROVER as PURCHASE_ORDER_APPROVER, crudEndpoints_PURCHASE_ORDER_LINE as PURCHASE_ORDER_LINE, crudEndpoints_QUOTE as QUOTE, crudEndpoints_QUOTE_LINE as QUOTE_LINE, crudEndpoints_RENTAL_ORDER as RENTAL_ORDER, crudEndpoints_RENTAL_ORDER_LINE as RENTAL_ORDER_LINE, crudEndpoints_SALES_ORDER as SALES_ORDER, crudEndpoints_SALES_ORDER_APPROVER as SALES_ORDER_APPROVER, crudEndpoints_SALES_ORDER_LINE as SALES_ORDER_LINE, crudEndpoints_SERVICE_ORDER as SERVICE_ORDER, crudEndpoints_SHIFT as SHIFT, crudEndpoints_STOCK_ADJUSTMENT as STOCK_ADJUSTMENT, crudEndpoints_STORE as STORE, crudEndpoints_STORE_PRODUCT as STORE_PRODUCT, crudEndpoints_STORE_PRODUCT_ATTRIBUTE as STORE_PRODUCT_ATTRIBUTE, crudEndpoints_STORE_PRODUCT_ATTRIBUTE_VALUE as STORE_PRODUCT_ATTRIBUTE_VALUE, crudEndpoints_STORE_PRODUCT_GROUP as STORE_PRODUCT_GROUP, crudEndpoints_SUBSIDIARY as SUBSIDIARY, crudEndpoints_SUPPLIER as SUPPLIER, crudEndpoints_USER_ACTION as USER_ACTION, crudEndpoints_USER_PERSONA as USER_PERSONA, crudEndpoints_USER_PERSONA_CUSTOM_SCHEMA_PERMISSION as USER_PERSONA_CUSTOM_SCHEMA_PERMISSION, crudEndpoints_USER_PERSONA_ENTITY_ACCESS_STATUS as USER_PERSONA_ENTITY_ACCESS_STATUS, crudEndpoints_USER_PERSONA_ENTITY_PERMISSION as USER_PERSONA_ENTITY_PERMISSION, crudEndpoints_VEHICLE as VEHICLE, crudEndpoints_WAREHOUSE as WAREHOUSE, crudEndpoints_WORKSTATION as WORKSTATION, crudEndpoints_WORK_ORDER as WORK_ORDER };
171
+ }
172
+
173
+ declare function call(axiosRequest: AxiosRequestConfig): Promise<axios.AxiosResponse<any, any>>;
174
+ declare function getAllCustomObjects(schemaName: string, queryParams?: any): Promise<any>;
175
+ declare function getCustomObjectById(schemaName: string, id: string): Promise<any>;
176
+ declare function updateCustomObject(schemaName: string, id: string, newData: any): Promise<any>;
177
+ declare function createCustomObject(schemaName: string, data: any): Promise<any>;
178
+ declare function deleteCustomObject(schemaName: string, id: string): Promise<any>;
179
+ declare function getAllObjects(entity: any, queryParams?: any): Promise<any>;
180
+ declare function getObjectById(entity: any, id: string): Promise<any>;
181
+ declare function updateObject(entity: any, id: string, newData: any): Promise<any>;
182
+ declare function createObject(entity: any, data: any): Promise<any>;
183
+ declare function deleteObject(entity: any, id: string): Promise<any>;
184
+ declare function runScript(scriptNameOrId: string, input: any, sync?: boolean): Promise<any>;
185
+ declare const konversiAPI: {
186
+ setToken: (token: string) => void;
187
+ setCompanyId: (companyId: string) => void;
188
+ setBaseUrl: (baseUrl: string) => void;
189
+ getAllCustomObjects: typeof getAllCustomObjects;
190
+ getCustomObjectById: typeof getCustomObjectById;
191
+ updateCustomObject: typeof updateCustomObject;
192
+ deleteCustomObject: typeof deleteCustomObject;
193
+ createCustomObject: typeof createCustomObject;
194
+ getAllObjects: typeof getAllObjects;
195
+ getObjectById: typeof getObjectById;
196
+ updateObject: typeof updateObject;
197
+ createObject: typeof createObject;
198
+ deleteObject: typeof deleteObject;
199
+ runScript: typeof runScript;
200
+ call: typeof call;
201
+ baseUrl: string | undefined;
202
+ token: string;
203
+ companyId: axios.AxiosHeaderValue | undefined;
204
+ };
205
+
206
+ declare const Entity: typeof crudEndpoints;
207
+
208
+ export { Entity, konversiAPI as default, runScript };
package/dist/index.js ADDED
@@ -0,0 +1,436 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var __async = (__this, __arguments, generator) => {
30
+ return new Promise((resolve, reject) => {
31
+ var fulfilled = (value) => {
32
+ try {
33
+ step(generator.next(value));
34
+ } catch (e) {
35
+ reject(e);
36
+ }
37
+ };
38
+ var rejected = (value) => {
39
+ try {
40
+ step(generator.throw(value));
41
+ } catch (e) {
42
+ reject(e);
43
+ }
44
+ };
45
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
46
+ step((generator = generator.apply(__this, __arguments)).next());
47
+ });
48
+ };
49
+
50
+ // index.ts
51
+ var index_exports = {};
52
+ __export(index_exports, {
53
+ Entity: () => Entity,
54
+ default: () => index_default,
55
+ runScript: () => runScript
56
+ });
57
+ module.exports = __toCommonJS(index_exports);
58
+
59
+ // axiosAPI.ts
60
+ var import_axios = __toESM(require("axios"));
61
+ var baseURL = "https://api.konversi.id/api";
62
+ var timeout = 12e4;
63
+ var instance = import_axios.default.create({
64
+ baseURL,
65
+ timeout
66
+ });
67
+ var setBaseUrl = (baseUrl) => {
68
+ instance.defaults.baseURL = baseUrl;
69
+ };
70
+ var setAuthToken = (token) => {
71
+ instance.defaults.headers.common.authorization = `Bearer ${token}`;
72
+ };
73
+ var setCompanyId = (companyId) => {
74
+ instance.defaults.headers.common["Company"] = companyId;
75
+ };
76
+ var axiosAPI_default = instance;
77
+
78
+ // crudEndpoints.ts
79
+ var crudEndpoints_exports = {};
80
+ __export(crudEndpoints_exports, {
81
+ ACCOUNT: () => ACCOUNT,
82
+ ATTENDANCE: () => ATTENDANCE,
83
+ AUDIT_LOG: () => AUDIT_LOG,
84
+ AUTOMATION_JOB: () => AUTOMATION_JOB,
85
+ AUTOMATION_SCRIPT: () => AUTOMATION_SCRIPT,
86
+ BILL_OF_MATERIALS: () => BILL_OF_MATERIALS,
87
+ BOM_COMPONENT: () => BOM_COMPONENT,
88
+ BOM_OPERATION: () => BOM_OPERATION,
89
+ COMPANY_ALIAS: () => COMPANY_ALIAS,
90
+ COMPANY_OPTION: () => COMPANY_OPTION,
91
+ COMPANY_PERMISSION: () => COMPANY_PERMISSION,
92
+ CUSTOMER: () => CUSTOMER,
93
+ CUSTOM_DOCUMENT: () => CUSTOM_DOCUMENT,
94
+ CUSTOM_ENTITY_FIELD: () => CUSTOM_ENTITY_FIELD,
95
+ CUSTOM_ENTITY_OBJECT: () => CUSTOM_ENTITY_OBJECT,
96
+ CUSTOM_ENTITY_SCHEMA: () => CUSTOM_ENTITY_SCHEMA,
97
+ CUSTOM_FIELD: () => CUSTOM_FIELD,
98
+ CUSTOM_REPORT: () => CUSTOM_REPORT,
99
+ DELIVERY_JOB: () => DELIVERY_JOB,
100
+ EMPLOYEE: () => EMPLOYEE,
101
+ EXPENSE: () => EXPENSE,
102
+ EXPENSE_LINE: () => EXPENSE_LINE,
103
+ FIXED_ASSET: () => FIXED_ASSET,
104
+ FORM: () => FORM,
105
+ GEOFENCE: () => GEOFENCE,
106
+ IDENTIFIER_GROUP: () => IDENTIFIER_GROUP,
107
+ IDENTIFIER_TOKEN: () => IDENTIFIER_TOKEN,
108
+ INCOMING_DELIVERY: () => INCOMING_DELIVERY,
109
+ INCOMING_DELIVERY_LINE: () => INCOMING_DELIVERY_LINE,
110
+ INCOMING_PAYMENT_METHOD: () => INCOMING_PAYMENT_METHOD,
111
+ INCOMING_SHIPMENT: () => INCOMING_SHIPMENT,
112
+ INTERNAL_DELIVERY: () => INTERNAL_DELIVERY,
113
+ INTERNAL_DELIVERY_LINE: () => INTERNAL_DELIVERY_LINE,
114
+ INVITATION: () => INVITATION,
115
+ INVOICE: () => INVOICE,
116
+ INVOICE_LINE: () => INVOICE_LINE,
117
+ IOT_DEVICE: () => IOT_DEVICE,
118
+ IOT_JOB: () => IOT_JOB,
119
+ JOB_CARD: () => JOB_CARD,
120
+ JOURNAL_ENTRY: () => JOURNAL_ENTRY,
121
+ JOURNAL_ENTRY_LINE: () => JOURNAL_ENTRY_LINE,
122
+ NOTIFICATION: () => NOTIFICATION,
123
+ OUTGOING_DELIVERY: () => OUTGOING_DELIVERY,
124
+ OUTGOING_DELIVERY_LINE: () => OUTGOING_DELIVERY_LINE,
125
+ OUTGOING_SHIPMENT: () => OUTGOING_SHIPMENT,
126
+ PAYMENT: () => PAYMENT,
127
+ PRINT_JOB: () => PRINT_JOB,
128
+ PRODUCT: () => PRODUCT,
129
+ PRODUCTION_ORDER: () => PRODUCTION_ORDER,
130
+ PRODUCTION_ORDER_LINE: () => PRODUCTION_ORDER_LINE,
131
+ PRODUCT_GROUP: () => PRODUCT_GROUP,
132
+ PRODUCT_ITEM: () => PRODUCT_ITEM,
133
+ PRODUCT_SUPPLIER: () => PRODUCT_SUPPLIER,
134
+ PURCHASE_ORDER: () => PURCHASE_ORDER,
135
+ PURCHASE_ORDER_APPROVER: () => PURCHASE_ORDER_APPROVER,
136
+ PURCHASE_ORDER_LINE: () => PURCHASE_ORDER_LINE,
137
+ QUOTE: () => QUOTE,
138
+ QUOTE_LINE: () => QUOTE_LINE,
139
+ RENTAL_ORDER: () => RENTAL_ORDER,
140
+ RENTAL_ORDER_LINE: () => RENTAL_ORDER_LINE,
141
+ SALES_ORDER: () => SALES_ORDER,
142
+ SALES_ORDER_APPROVER: () => SALES_ORDER_APPROVER,
143
+ SALES_ORDER_LINE: () => SALES_ORDER_LINE,
144
+ SERVICE_ORDER: () => SERVICE_ORDER,
145
+ SHIFT: () => SHIFT,
146
+ STOCK_ADJUSTMENT: () => STOCK_ADJUSTMENT,
147
+ STORE: () => STORE,
148
+ STORE_PRODUCT: () => STORE_PRODUCT,
149
+ STORE_PRODUCT_ATTRIBUTE: () => STORE_PRODUCT_ATTRIBUTE,
150
+ STORE_PRODUCT_ATTRIBUTE_VALUE: () => STORE_PRODUCT_ATTRIBUTE_VALUE,
151
+ STORE_PRODUCT_GROUP: () => STORE_PRODUCT_GROUP,
152
+ SUBSIDIARY: () => SUBSIDIARY,
153
+ SUPPLIER: () => SUPPLIER,
154
+ USER_ACTION: () => USER_ACTION,
155
+ USER_PERSONA: () => USER_PERSONA,
156
+ USER_PERSONA_CUSTOM_SCHEMA_PERMISSION: () => USER_PERSONA_CUSTOM_SCHEMA_PERMISSION,
157
+ USER_PERSONA_ENTITY_ACCESS_STATUS: () => USER_PERSONA_ENTITY_ACCESS_STATUS,
158
+ USER_PERSONA_ENTITY_PERMISSION: () => USER_PERSONA_ENTITY_PERMISSION,
159
+ VEHICLE: () => VEHICLE,
160
+ WAREHOUSE: () => WAREHOUSE,
161
+ WORKSTATION: () => WORKSTATION,
162
+ WORK_ORDER: () => WORK_ORDER
163
+ });
164
+ var NOTIFICATION = "notification";
165
+ var USER_PERSONA = "user/user-persona";
166
+ var USER_PERSONA_CUSTOM_SCHEMA_PERMISSION = "user/user-persona-custom-schema-permission";
167
+ var USER_PERSONA_ENTITY_PERMISSION = "user/user-persona-entity-permission";
168
+ var USER_PERSONA_ENTITY_ACCESS_STATUS = "user/user-persona-entity-access-status";
169
+ var COMPANY_PERMISSION = "company-permission";
170
+ var COMPANY_OPTION = "company-option";
171
+ var INVITATION = "user/invitation";
172
+ var CUSTOMER = "contact/customer";
173
+ var PRODUCT = "product";
174
+ var PRODUCT_ITEM = "product/product-item";
175
+ var PRODUCT_GROUP = "product-group";
176
+ var PRODUCT_SUPPLIER = "product/product-supplier";
177
+ var PURCHASE_ORDER = "order/purchase-order";
178
+ var PURCHASE_ORDER_LINE = "order/purchase-order-line";
179
+ var QUOTE = "order/quote";
180
+ var QUOTE_LINE = "order/quote-line";
181
+ var SALES_ORDER = "order/sales-order";
182
+ var SALES_ORDER_LINE = "order/sales-order-line";
183
+ var RENTAL_ORDER = "order/rental-order";
184
+ var RENTAL_ORDER_LINE = "order/rental-order-line";
185
+ var SUPPLIER = "contact/supplier";
186
+ var WAREHOUSE = "warehouse";
187
+ var INCOMING_DELIVERY = "delivery/incoming-delivery";
188
+ var INCOMING_DELIVERY_LINE = "delivery/incoming-delivery-line";
189
+ var OUTGOING_DELIVERY = "delivery/outgoing-delivery";
190
+ var OUTGOING_DELIVERY_LINE = "delivery/outgoing-delivery-line";
191
+ var INTERNAL_DELIVERY = "delivery/internal-delivery";
192
+ var INTERNAL_DELIVERY_LINE = "delivery/internal-delivery-line";
193
+ var INVOICE = "invoice";
194
+ var INVOICE_LINE = "invoice/invoice-line";
195
+ var EXPENSE = "expense";
196
+ var EXPENSE_LINE = "expense/expense-line";
197
+ var PAYMENT = "accounting/payment";
198
+ var INCOMING_PAYMENT_METHOD = "accounting/incoming-payment-method";
199
+ var FIXED_ASSET = "fixed-asset";
200
+ var STORE = "store";
201
+ var STORE_PRODUCT = "store/store-product";
202
+ var STORE_PRODUCT_GROUP = "store/store-product-group";
203
+ var STORE_PRODUCT_ATTRIBUTE = "store/store-product-attribute";
204
+ var STORE_PRODUCT_ATTRIBUTE_VALUE = "store/store-product-attribute-value";
205
+ var ACCOUNT = "accounting/account";
206
+ var JOURNAL_ENTRY = "accounting/journal-entry";
207
+ var JOURNAL_ENTRY_LINE = "accounting/journal-entry-line";
208
+ var BILL_OF_MATERIALS = "manufacturing/bill-of-materials";
209
+ var BOM_COMPONENT = "manufacturing/bom-component";
210
+ var BOM_OPERATION = "manufacturing/bom-operation";
211
+ var PRODUCTION_ORDER = "manufacturing/production-order";
212
+ var PRODUCTION_ORDER_LINE = "manufacturing/production-order-line";
213
+ var JOB_CARD = "manufacturing/job-card";
214
+ var WORKSTATION = "manufacturing/workstation";
215
+ var SUBSIDIARY = "subsidiary";
216
+ var EMPLOYEE = "human-resources/employee";
217
+ var GEOFENCE = "geofence";
218
+ var SHIFT = "human-resources/employee/shift";
219
+ var ATTENDANCE = "human-resources/attendance";
220
+ var VEHICLE = "fleet/vehicle";
221
+ var DELIVERY_JOB = "fleet/delivery-job";
222
+ var CUSTOM_ENTITY_SCHEMA = "custom-entity/schema";
223
+ var CUSTOM_ENTITY_OBJECT = "custom-entity/object";
224
+ var CUSTOM_ENTITY_FIELD = "custom-entity/field";
225
+ var FORM = "form";
226
+ var CUSTOM_REPORT = "report/custom-report";
227
+ var AUTOMATION_JOB = "automation/job";
228
+ var AUTOMATION_SCRIPT = "automation/script";
229
+ var USER_ACTION = "automation/user-action";
230
+ var IOT_DEVICE = "iot/device";
231
+ var IOT_JOB = "iot/job";
232
+ var STOCK_ADJUSTMENT = "stock-adjustment";
233
+ var PURCHASE_ORDER_APPROVER = "approval/approver/purchase-order";
234
+ var SALES_ORDER_APPROVER = "approval/approver/sales-order";
235
+ var CUSTOM_DOCUMENT = "document-generator/custom-document";
236
+ var CUSTOM_FIELD = "custom-field";
237
+ var AUDIT_LOG = "audit-log";
238
+ var COMPANY_ALIAS = "company-alias";
239
+ var PRINT_JOB = "thermal-printer/print-job";
240
+ var WORK_ORDER = "order/sales-order?type=WORK_ORDER";
241
+ var SERVICE_ORDER = "order/sales-order?type=SERVICE_ORDER";
242
+ var IDENTIFIER_GROUP = "identifier/identifier-group";
243
+ var IDENTIFIER_TOKEN = "identifier/identifier-token";
244
+ var INCOMING_SHIPMENT = "shipment/incoming-shipment";
245
+ var OUTGOING_SHIPMENT = "shipment/outgoing-shipment";
246
+
247
+ // KonversiError.ts
248
+ var KonversiError = class extends Error {
249
+ constructor(message) {
250
+ super(message);
251
+ }
252
+ };
253
+
254
+ // index.ts
255
+ function call(axiosRequest) {
256
+ return __async(this, null, function* () {
257
+ return yield axiosAPI_default.request(axiosRequest);
258
+ });
259
+ }
260
+ function getAllCustomObjects(_0) {
261
+ return __async(this, arguments, function* (schemaName, queryParams = {}) {
262
+ var _a2, _b;
263
+ try {
264
+ const response = yield axiosAPI_default.request({
265
+ method: "get",
266
+ url: `custom-entity/object/${schemaName}`,
267
+ params: queryParams
268
+ });
269
+ return response.data;
270
+ } catch (e) {
271
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
272
+ }
273
+ });
274
+ }
275
+ function getCustomObjectById(schemaName, id) {
276
+ return __async(this, null, function* () {
277
+ var _a2, _b;
278
+ try {
279
+ const response = yield axiosAPI_default.request({
280
+ method: "get",
281
+ url: `custom-entity/object/${schemaName}/${id}`
282
+ });
283
+ return response.data;
284
+ } catch (e) {
285
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
286
+ }
287
+ });
288
+ }
289
+ function updateCustomObject(schemaName, id, newData) {
290
+ return __async(this, null, function* () {
291
+ var _a2, _b;
292
+ try {
293
+ const response = yield axiosAPI_default.request({
294
+ method: "put",
295
+ url: `custom-entity/object/${schemaName}/${id}`,
296
+ headers: {
297
+ "Content-Type": "application/json"
298
+ },
299
+ data: JSON.stringify(newData)
300
+ });
301
+ return response.data;
302
+ } catch (e) {
303
+ throw new KonversiError(e.message + ` ${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
304
+ }
305
+ });
306
+ }
307
+ function createCustomObject(schemaName, data) {
308
+ return __async(this, null, function* () {
309
+ var _a2, _b;
310
+ try {
311
+ const response = yield axiosAPI_default.request({
312
+ method: "post",
313
+ url: `custom-entity/object/${schemaName}`,
314
+ data
315
+ });
316
+ return response.data;
317
+ } catch (e) {
318
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
319
+ }
320
+ });
321
+ }
322
+ function deleteCustomObject(schemaName, id) {
323
+ return __async(this, null, function* () {
324
+ var _a2, _b;
325
+ try {
326
+ const response = yield axiosAPI_default.request({
327
+ method: "delete",
328
+ maxBodyLength: Infinity,
329
+ url: `custom-entity/object/${schemaName}/${id}`
330
+ });
331
+ return response.data;
332
+ } catch (e) {
333
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
334
+ }
335
+ });
336
+ }
337
+ function getAllObjects(_0) {
338
+ return __async(this, arguments, function* (entity, queryParams = {}) {
339
+ var _a2, _b;
340
+ try {
341
+ const response = yield axiosAPI_default.get(`${entity}`, {
342
+ params: queryParams
343
+ });
344
+ return response.data;
345
+ } catch (e) {
346
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
347
+ }
348
+ });
349
+ }
350
+ function getObjectById(entity, id) {
351
+ return __async(this, null, function* () {
352
+ var _a2, _b;
353
+ try {
354
+ const response = yield axiosAPI_default.get(`${entity}/${id}`);
355
+ return response.data;
356
+ } catch (e) {
357
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
358
+ }
359
+ });
360
+ }
361
+ function updateObject(entity, id, newData) {
362
+ return __async(this, null, function* () {
363
+ var _a2, _b;
364
+ try {
365
+ const response = yield axiosAPI_default.put(`${entity}/${id}`, newData);
366
+ return response.data;
367
+ } catch (e) {
368
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
369
+ }
370
+ });
371
+ }
372
+ function createObject(entity, data) {
373
+ return __async(this, null, function* () {
374
+ var _a2, _b;
375
+ try {
376
+ const response = yield axiosAPI_default.post(`${entity}`, data);
377
+ return response.data;
378
+ } catch (e) {
379
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
380
+ }
381
+ });
382
+ }
383
+ function deleteObject(entity, id) {
384
+ return __async(this, null, function* () {
385
+ var _a2, _b;
386
+ try {
387
+ const response = yield axiosAPI_default.delete(`${entity}/${id}`);
388
+ return response.data;
389
+ } catch (e) {
390
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
391
+ }
392
+ });
393
+ }
394
+ function runScript(scriptNameOrId, input, sync = false) {
395
+ return __async(this, null, function* () {
396
+ var _a2, _b;
397
+ try {
398
+ if (sync) {
399
+ const response2 = yield axiosAPI_default.post(`/automation/script/${scriptNameOrId}/run?mode=sync`, { input });
400
+ return response2.data;
401
+ }
402
+ const response = yield axiosAPI_default.post(`/automation/script/${scriptNameOrId}/run`, { input });
403
+ return response.data;
404
+ } catch (e) {
405
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
406
+ }
407
+ });
408
+ }
409
+ var _a;
410
+ var konversiAPI = {
411
+ setToken: setAuthToken,
412
+ setCompanyId,
413
+ setBaseUrl,
414
+ getAllCustomObjects,
415
+ getCustomObjectById,
416
+ updateCustomObject,
417
+ deleteCustomObject,
418
+ createCustomObject,
419
+ getAllObjects,
420
+ getObjectById,
421
+ updateObject,
422
+ createObject,
423
+ deleteObject,
424
+ runScript,
425
+ call,
426
+ baseUrl: axiosAPI_default.defaults.baseURL,
427
+ token: ((_a = axiosAPI_default.defaults.headers.common["Authorization"]) == null ? void 0 : _a.toString().split(" ")[1]) || "",
428
+ companyId: axiosAPI_default.defaults.headers.common["Company"]
429
+ };
430
+ var index_default = konversiAPI;
431
+ var Entity = crudEndpoints_exports;
432
+ // Annotate the CommonJS export names for ESM import in node:
433
+ 0 && (module.exports = {
434
+ Entity,
435
+ runScript
436
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,404 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+ var __async = (__this, __arguments, generator) => {
7
+ return new Promise((resolve, reject) => {
8
+ var fulfilled = (value) => {
9
+ try {
10
+ step(generator.next(value));
11
+ } catch (e) {
12
+ reject(e);
13
+ }
14
+ };
15
+ var rejected = (value) => {
16
+ try {
17
+ step(generator.throw(value));
18
+ } catch (e) {
19
+ reject(e);
20
+ }
21
+ };
22
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
23
+ step((generator = generator.apply(__this, __arguments)).next());
24
+ });
25
+ };
26
+
27
+ // axiosAPI.ts
28
+ import axios from "axios";
29
+ var baseURL = "https://api.konversi.id/api";
30
+ var timeout = 12e4;
31
+ var instance = axios.create({
32
+ baseURL,
33
+ timeout
34
+ });
35
+ var setBaseUrl = (baseUrl) => {
36
+ instance.defaults.baseURL = baseUrl;
37
+ };
38
+ var setAuthToken = (token) => {
39
+ instance.defaults.headers.common.authorization = `Bearer ${token}`;
40
+ };
41
+ var setCompanyId = (companyId) => {
42
+ instance.defaults.headers.common["Company"] = companyId;
43
+ };
44
+ var axiosAPI_default = instance;
45
+
46
+ // crudEndpoints.ts
47
+ var crudEndpoints_exports = {};
48
+ __export(crudEndpoints_exports, {
49
+ ACCOUNT: () => ACCOUNT,
50
+ ATTENDANCE: () => ATTENDANCE,
51
+ AUDIT_LOG: () => AUDIT_LOG,
52
+ AUTOMATION_JOB: () => AUTOMATION_JOB,
53
+ AUTOMATION_SCRIPT: () => AUTOMATION_SCRIPT,
54
+ BILL_OF_MATERIALS: () => BILL_OF_MATERIALS,
55
+ BOM_COMPONENT: () => BOM_COMPONENT,
56
+ BOM_OPERATION: () => BOM_OPERATION,
57
+ COMPANY_ALIAS: () => COMPANY_ALIAS,
58
+ COMPANY_OPTION: () => COMPANY_OPTION,
59
+ COMPANY_PERMISSION: () => COMPANY_PERMISSION,
60
+ CUSTOMER: () => CUSTOMER,
61
+ CUSTOM_DOCUMENT: () => CUSTOM_DOCUMENT,
62
+ CUSTOM_ENTITY_FIELD: () => CUSTOM_ENTITY_FIELD,
63
+ CUSTOM_ENTITY_OBJECT: () => CUSTOM_ENTITY_OBJECT,
64
+ CUSTOM_ENTITY_SCHEMA: () => CUSTOM_ENTITY_SCHEMA,
65
+ CUSTOM_FIELD: () => CUSTOM_FIELD,
66
+ CUSTOM_REPORT: () => CUSTOM_REPORT,
67
+ DELIVERY_JOB: () => DELIVERY_JOB,
68
+ EMPLOYEE: () => EMPLOYEE,
69
+ EXPENSE: () => EXPENSE,
70
+ EXPENSE_LINE: () => EXPENSE_LINE,
71
+ FIXED_ASSET: () => FIXED_ASSET,
72
+ FORM: () => FORM,
73
+ GEOFENCE: () => GEOFENCE,
74
+ IDENTIFIER_GROUP: () => IDENTIFIER_GROUP,
75
+ IDENTIFIER_TOKEN: () => IDENTIFIER_TOKEN,
76
+ INCOMING_DELIVERY: () => INCOMING_DELIVERY,
77
+ INCOMING_DELIVERY_LINE: () => INCOMING_DELIVERY_LINE,
78
+ INCOMING_PAYMENT_METHOD: () => INCOMING_PAYMENT_METHOD,
79
+ INCOMING_SHIPMENT: () => INCOMING_SHIPMENT,
80
+ INTERNAL_DELIVERY: () => INTERNAL_DELIVERY,
81
+ INTERNAL_DELIVERY_LINE: () => INTERNAL_DELIVERY_LINE,
82
+ INVITATION: () => INVITATION,
83
+ INVOICE: () => INVOICE,
84
+ INVOICE_LINE: () => INVOICE_LINE,
85
+ IOT_DEVICE: () => IOT_DEVICE,
86
+ IOT_JOB: () => IOT_JOB,
87
+ JOB_CARD: () => JOB_CARD,
88
+ JOURNAL_ENTRY: () => JOURNAL_ENTRY,
89
+ JOURNAL_ENTRY_LINE: () => JOURNAL_ENTRY_LINE,
90
+ NOTIFICATION: () => NOTIFICATION,
91
+ OUTGOING_DELIVERY: () => OUTGOING_DELIVERY,
92
+ OUTGOING_DELIVERY_LINE: () => OUTGOING_DELIVERY_LINE,
93
+ OUTGOING_SHIPMENT: () => OUTGOING_SHIPMENT,
94
+ PAYMENT: () => PAYMENT,
95
+ PRINT_JOB: () => PRINT_JOB,
96
+ PRODUCT: () => PRODUCT,
97
+ PRODUCTION_ORDER: () => PRODUCTION_ORDER,
98
+ PRODUCTION_ORDER_LINE: () => PRODUCTION_ORDER_LINE,
99
+ PRODUCT_GROUP: () => PRODUCT_GROUP,
100
+ PRODUCT_ITEM: () => PRODUCT_ITEM,
101
+ PRODUCT_SUPPLIER: () => PRODUCT_SUPPLIER,
102
+ PURCHASE_ORDER: () => PURCHASE_ORDER,
103
+ PURCHASE_ORDER_APPROVER: () => PURCHASE_ORDER_APPROVER,
104
+ PURCHASE_ORDER_LINE: () => PURCHASE_ORDER_LINE,
105
+ QUOTE: () => QUOTE,
106
+ QUOTE_LINE: () => QUOTE_LINE,
107
+ RENTAL_ORDER: () => RENTAL_ORDER,
108
+ RENTAL_ORDER_LINE: () => RENTAL_ORDER_LINE,
109
+ SALES_ORDER: () => SALES_ORDER,
110
+ SALES_ORDER_APPROVER: () => SALES_ORDER_APPROVER,
111
+ SALES_ORDER_LINE: () => SALES_ORDER_LINE,
112
+ SERVICE_ORDER: () => SERVICE_ORDER,
113
+ SHIFT: () => SHIFT,
114
+ STOCK_ADJUSTMENT: () => STOCK_ADJUSTMENT,
115
+ STORE: () => STORE,
116
+ STORE_PRODUCT: () => STORE_PRODUCT,
117
+ STORE_PRODUCT_ATTRIBUTE: () => STORE_PRODUCT_ATTRIBUTE,
118
+ STORE_PRODUCT_ATTRIBUTE_VALUE: () => STORE_PRODUCT_ATTRIBUTE_VALUE,
119
+ STORE_PRODUCT_GROUP: () => STORE_PRODUCT_GROUP,
120
+ SUBSIDIARY: () => SUBSIDIARY,
121
+ SUPPLIER: () => SUPPLIER,
122
+ USER_ACTION: () => USER_ACTION,
123
+ USER_PERSONA: () => USER_PERSONA,
124
+ USER_PERSONA_CUSTOM_SCHEMA_PERMISSION: () => USER_PERSONA_CUSTOM_SCHEMA_PERMISSION,
125
+ USER_PERSONA_ENTITY_ACCESS_STATUS: () => USER_PERSONA_ENTITY_ACCESS_STATUS,
126
+ USER_PERSONA_ENTITY_PERMISSION: () => USER_PERSONA_ENTITY_PERMISSION,
127
+ VEHICLE: () => VEHICLE,
128
+ WAREHOUSE: () => WAREHOUSE,
129
+ WORKSTATION: () => WORKSTATION,
130
+ WORK_ORDER: () => WORK_ORDER
131
+ });
132
+ var NOTIFICATION = "notification";
133
+ var USER_PERSONA = "user/user-persona";
134
+ var USER_PERSONA_CUSTOM_SCHEMA_PERMISSION = "user/user-persona-custom-schema-permission";
135
+ var USER_PERSONA_ENTITY_PERMISSION = "user/user-persona-entity-permission";
136
+ var USER_PERSONA_ENTITY_ACCESS_STATUS = "user/user-persona-entity-access-status";
137
+ var COMPANY_PERMISSION = "company-permission";
138
+ var COMPANY_OPTION = "company-option";
139
+ var INVITATION = "user/invitation";
140
+ var CUSTOMER = "contact/customer";
141
+ var PRODUCT = "product";
142
+ var PRODUCT_ITEM = "product/product-item";
143
+ var PRODUCT_GROUP = "product-group";
144
+ var PRODUCT_SUPPLIER = "product/product-supplier";
145
+ var PURCHASE_ORDER = "order/purchase-order";
146
+ var PURCHASE_ORDER_LINE = "order/purchase-order-line";
147
+ var QUOTE = "order/quote";
148
+ var QUOTE_LINE = "order/quote-line";
149
+ var SALES_ORDER = "order/sales-order";
150
+ var SALES_ORDER_LINE = "order/sales-order-line";
151
+ var RENTAL_ORDER = "order/rental-order";
152
+ var RENTAL_ORDER_LINE = "order/rental-order-line";
153
+ var SUPPLIER = "contact/supplier";
154
+ var WAREHOUSE = "warehouse";
155
+ var INCOMING_DELIVERY = "delivery/incoming-delivery";
156
+ var INCOMING_DELIVERY_LINE = "delivery/incoming-delivery-line";
157
+ var OUTGOING_DELIVERY = "delivery/outgoing-delivery";
158
+ var OUTGOING_DELIVERY_LINE = "delivery/outgoing-delivery-line";
159
+ var INTERNAL_DELIVERY = "delivery/internal-delivery";
160
+ var INTERNAL_DELIVERY_LINE = "delivery/internal-delivery-line";
161
+ var INVOICE = "invoice";
162
+ var INVOICE_LINE = "invoice/invoice-line";
163
+ var EXPENSE = "expense";
164
+ var EXPENSE_LINE = "expense/expense-line";
165
+ var PAYMENT = "accounting/payment";
166
+ var INCOMING_PAYMENT_METHOD = "accounting/incoming-payment-method";
167
+ var FIXED_ASSET = "fixed-asset";
168
+ var STORE = "store";
169
+ var STORE_PRODUCT = "store/store-product";
170
+ var STORE_PRODUCT_GROUP = "store/store-product-group";
171
+ var STORE_PRODUCT_ATTRIBUTE = "store/store-product-attribute";
172
+ var STORE_PRODUCT_ATTRIBUTE_VALUE = "store/store-product-attribute-value";
173
+ var ACCOUNT = "accounting/account";
174
+ var JOURNAL_ENTRY = "accounting/journal-entry";
175
+ var JOURNAL_ENTRY_LINE = "accounting/journal-entry-line";
176
+ var BILL_OF_MATERIALS = "manufacturing/bill-of-materials";
177
+ var BOM_COMPONENT = "manufacturing/bom-component";
178
+ var BOM_OPERATION = "manufacturing/bom-operation";
179
+ var PRODUCTION_ORDER = "manufacturing/production-order";
180
+ var PRODUCTION_ORDER_LINE = "manufacturing/production-order-line";
181
+ var JOB_CARD = "manufacturing/job-card";
182
+ var WORKSTATION = "manufacturing/workstation";
183
+ var SUBSIDIARY = "subsidiary";
184
+ var EMPLOYEE = "human-resources/employee";
185
+ var GEOFENCE = "geofence";
186
+ var SHIFT = "human-resources/employee/shift";
187
+ var ATTENDANCE = "human-resources/attendance";
188
+ var VEHICLE = "fleet/vehicle";
189
+ var DELIVERY_JOB = "fleet/delivery-job";
190
+ var CUSTOM_ENTITY_SCHEMA = "custom-entity/schema";
191
+ var CUSTOM_ENTITY_OBJECT = "custom-entity/object";
192
+ var CUSTOM_ENTITY_FIELD = "custom-entity/field";
193
+ var FORM = "form";
194
+ var CUSTOM_REPORT = "report/custom-report";
195
+ var AUTOMATION_JOB = "automation/job";
196
+ var AUTOMATION_SCRIPT = "automation/script";
197
+ var USER_ACTION = "automation/user-action";
198
+ var IOT_DEVICE = "iot/device";
199
+ var IOT_JOB = "iot/job";
200
+ var STOCK_ADJUSTMENT = "stock-adjustment";
201
+ var PURCHASE_ORDER_APPROVER = "approval/approver/purchase-order";
202
+ var SALES_ORDER_APPROVER = "approval/approver/sales-order";
203
+ var CUSTOM_DOCUMENT = "document-generator/custom-document";
204
+ var CUSTOM_FIELD = "custom-field";
205
+ var AUDIT_LOG = "audit-log";
206
+ var COMPANY_ALIAS = "company-alias";
207
+ var PRINT_JOB = "thermal-printer/print-job";
208
+ var WORK_ORDER = "order/sales-order?type=WORK_ORDER";
209
+ var SERVICE_ORDER = "order/sales-order?type=SERVICE_ORDER";
210
+ var IDENTIFIER_GROUP = "identifier/identifier-group";
211
+ var IDENTIFIER_TOKEN = "identifier/identifier-token";
212
+ var INCOMING_SHIPMENT = "shipment/incoming-shipment";
213
+ var OUTGOING_SHIPMENT = "shipment/outgoing-shipment";
214
+
215
+ // KonversiError.ts
216
+ var KonversiError = class extends Error {
217
+ constructor(message) {
218
+ super(message);
219
+ }
220
+ };
221
+
222
+ // index.ts
223
+ function call(axiosRequest) {
224
+ return __async(this, null, function* () {
225
+ return yield axiosAPI_default.request(axiosRequest);
226
+ });
227
+ }
228
+ function getAllCustomObjects(_0) {
229
+ return __async(this, arguments, function* (schemaName, queryParams = {}) {
230
+ var _a2, _b;
231
+ try {
232
+ const response = yield axiosAPI_default.request({
233
+ method: "get",
234
+ url: `custom-entity/object/${schemaName}`,
235
+ params: queryParams
236
+ });
237
+ return response.data;
238
+ } catch (e) {
239
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
240
+ }
241
+ });
242
+ }
243
+ function getCustomObjectById(schemaName, id) {
244
+ return __async(this, null, function* () {
245
+ var _a2, _b;
246
+ try {
247
+ const response = yield axiosAPI_default.request({
248
+ method: "get",
249
+ url: `custom-entity/object/${schemaName}/${id}`
250
+ });
251
+ return response.data;
252
+ } catch (e) {
253
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
254
+ }
255
+ });
256
+ }
257
+ function updateCustomObject(schemaName, id, newData) {
258
+ return __async(this, null, function* () {
259
+ var _a2, _b;
260
+ try {
261
+ const response = yield axiosAPI_default.request({
262
+ method: "put",
263
+ url: `custom-entity/object/${schemaName}/${id}`,
264
+ headers: {
265
+ "Content-Type": "application/json"
266
+ },
267
+ data: JSON.stringify(newData)
268
+ });
269
+ return response.data;
270
+ } catch (e) {
271
+ throw new KonversiError(e.message + ` ${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
272
+ }
273
+ });
274
+ }
275
+ function createCustomObject(schemaName, data) {
276
+ return __async(this, null, function* () {
277
+ var _a2, _b;
278
+ try {
279
+ const response = yield axiosAPI_default.request({
280
+ method: "post",
281
+ url: `custom-entity/object/${schemaName}`,
282
+ data
283
+ });
284
+ return response.data;
285
+ } catch (e) {
286
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
287
+ }
288
+ });
289
+ }
290
+ function deleteCustomObject(schemaName, id) {
291
+ return __async(this, null, function* () {
292
+ var _a2, _b;
293
+ try {
294
+ const response = yield axiosAPI_default.request({
295
+ method: "delete",
296
+ maxBodyLength: Infinity,
297
+ url: `custom-entity/object/${schemaName}/${id}`
298
+ });
299
+ return response.data;
300
+ } catch (e) {
301
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
302
+ }
303
+ });
304
+ }
305
+ function getAllObjects(_0) {
306
+ return __async(this, arguments, function* (entity, queryParams = {}) {
307
+ var _a2, _b;
308
+ try {
309
+ const response = yield axiosAPI_default.get(`${entity}`, {
310
+ params: queryParams
311
+ });
312
+ return response.data;
313
+ } catch (e) {
314
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
315
+ }
316
+ });
317
+ }
318
+ function getObjectById(entity, id) {
319
+ return __async(this, null, function* () {
320
+ var _a2, _b;
321
+ try {
322
+ const response = yield axiosAPI_default.get(`${entity}/${id}`);
323
+ return response.data;
324
+ } catch (e) {
325
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
326
+ }
327
+ });
328
+ }
329
+ function updateObject(entity, id, newData) {
330
+ return __async(this, null, function* () {
331
+ var _a2, _b;
332
+ try {
333
+ const response = yield axiosAPI_default.put(`${entity}/${id}`, newData);
334
+ return response.data;
335
+ } catch (e) {
336
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
337
+ }
338
+ });
339
+ }
340
+ function createObject(entity, data) {
341
+ return __async(this, null, function* () {
342
+ var _a2, _b;
343
+ try {
344
+ const response = yield axiosAPI_default.post(`${entity}`, data);
345
+ return response.data;
346
+ } catch (e) {
347
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
348
+ }
349
+ });
350
+ }
351
+ function deleteObject(entity, id) {
352
+ return __async(this, null, function* () {
353
+ var _a2, _b;
354
+ try {
355
+ const response = yield axiosAPI_default.delete(`${entity}/${id}`);
356
+ return response.data;
357
+ } catch (e) {
358
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
359
+ }
360
+ });
361
+ }
362
+ function runScript(scriptNameOrId, input, sync = false) {
363
+ return __async(this, null, function* () {
364
+ var _a2, _b;
365
+ try {
366
+ if (sync) {
367
+ const response2 = yield axiosAPI_default.post(`/automation/script/${scriptNameOrId}/run?mode=sync`, { input });
368
+ return response2.data;
369
+ }
370
+ const response = yield axiosAPI_default.post(`/automation/script/${scriptNameOrId}/run`, { input });
371
+ return response.data;
372
+ } catch (e) {
373
+ throw new KonversiError(e.message + `${(_a2 = e.response) == null ? void 0 : _a2.status} ${(_b = e.response) == null ? void 0 : _b.data}`);
374
+ }
375
+ });
376
+ }
377
+ var _a;
378
+ var konversiAPI = {
379
+ setToken: setAuthToken,
380
+ setCompanyId,
381
+ setBaseUrl,
382
+ getAllCustomObjects,
383
+ getCustomObjectById,
384
+ updateCustomObject,
385
+ deleteCustomObject,
386
+ createCustomObject,
387
+ getAllObjects,
388
+ getObjectById,
389
+ updateObject,
390
+ createObject,
391
+ deleteObject,
392
+ runScript,
393
+ call,
394
+ baseUrl: axiosAPI_default.defaults.baseURL,
395
+ token: ((_a = axiosAPI_default.defaults.headers.common["Authorization"]) == null ? void 0 : _a.toString().split(" ")[1]) || "",
396
+ companyId: axiosAPI_default.defaults.headers.common["Company"]
397
+ };
398
+ var index_default = konversiAPI;
399
+ var Entity = crudEndpoints_exports;
400
+ export {
401
+ Entity,
402
+ index_default as default,
403
+ runScript
404
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konversi/konversi-client",
3
- "version": "1.4.6",
3
+ "version": "1.4.7",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -20,5 +20,6 @@
20
20
  "devDependencies": {
21
21
  "tsup": "^8.2.4",
22
22
  "typescript": "^5.4.5"
23
- }
23
+ },
24
+ "packageManager": "pnpm@10.6.5+sha512.cdf928fca20832cd59ec53826492b7dc25dc524d4370b6b4adbf65803d32efaa6c1c88147c0ae4e8d579a6c9eec715757b50d4fa35eea179d868eada4ed043af"
24
25
  }