@konversi/konversi-client 1.4.1 → 1.4.3

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,14 @@
1
+ import { isAxiosError } from "axios";
2
+
3
+ export default class KonversiError extends Error {
4
+ constructor(error: Error) {
5
+ if (isAxiosError(error)) {
6
+ super(`Konversi API Error ${error.response?.status || 'unknown'}: ${error.response?.data || error.message}`);
7
+ } else {
8
+ super(`Konversi Error: ${error.message}`);
9
+ }
10
+
11
+ // Set the prototype explicitly.
12
+ Object.setPrototypeOf(this, KonversiError.prototype);
13
+ }
14
+ }
package/crudEndpoints.ts CHANGED
@@ -1,5 +1,10 @@
1
1
  export const NOTIFICATION = 'notification';
2
2
 
3
+ export const USER_PERSONA = 'user/user-persona';
4
+ export const USER_PERSONA_CUSTOM_SCHEMA_PERMISSION = 'user/user-persona-custom-schema-permission';
5
+ export const USER_PERSONA_ENTITY_PERMISSION = 'user/user-persona-entity-permission';
6
+ export const USER_PERSONA_ENTITY_ACCESS_STATUS = 'user/user-persona-entity-access-status';
7
+
3
8
  export const COMPANY_PERMISSION = 'company-permission';
4
9
  export const COMPANY_OPTION = 'company-option';
5
10
  export const INVITATION = 'user/invitation';
@@ -9,6 +14,7 @@ export const CUSTOMER = 'contact/customer';
9
14
  export const PRODUCT = 'product'
10
15
  export const PRODUCT_ITEM = 'product/product-item'
11
16
  export const PRODUCT_GROUP = 'product-group'
17
+ export const PRODUCT_SUPPLIER = 'product/product-supplier'
12
18
 
13
19
  export const PURCHASE_ORDER = 'order/purchase-order'
14
20
  export const PURCHASE_ORDER_LINE = 'order/purchase-order-line'
@@ -56,11 +62,15 @@ export const BOM_COMPONENT = 'manufacturing/bom-component'
56
62
  export const BOM_OPERATION = 'manufacturing/bom-operation'
57
63
  export const PRODUCTION_ORDER = 'manufacturing/production-order'
58
64
  export const PRODUCTION_ORDER_LINE = 'manufacturing/production-order-line'
65
+ export const JOB_CARD = 'manufacturing/job-card'
66
+ export const WORKSTATION = 'manufacturing/workstation'
59
67
 
60
68
  export const SUBSIDIARY = 'subsidiary'
61
69
 
62
70
  // HR
63
71
  export const EMPLOYEE = 'human-resources/employee'
72
+ export const GEOFENCE = 'geofence'
73
+ export const SHIFT = 'human-resources/employee/shift'
64
74
  export const ATTENDANCE = 'human-resources/attendance'
65
75
 
66
76
  // Fleet Management
@@ -71,6 +81,8 @@ export const DELIVERY_JOB = 'fleet/delivery-job'
71
81
  export const CUSTOM_ENTITY_SCHEMA = 'custom-entity/schema'
72
82
  export const CUSTOM_ENTITY_OBJECT = 'custom-entity'; // Need to add schemaName after this
73
83
  export const CUSTOM_ENTITY_FIELD = 'custom-entity/field'; // Need to add schemaName after this
84
+ export const FORM = 'form';
85
+ export const CUSTOM_REPORT = 'report/custom-report';
74
86
 
75
87
  // Automation
76
88
  export const AUTOMATION_JOB = 'automation/job'
@@ -100,6 +112,9 @@ export const PRINT_JOB = 'thermal-printer/print-job'
100
112
  export const WORK_ORDER = 'order/sales-order?type=WORK_ORDER';
101
113
 
102
114
  export const SERVICE_ORDER = 'order/sales-order?type=SERVICE_ORDER';
115
+ export const IDENTIFIER_GROUP = 'identifier/identifier-group';
116
+ export const IDENTIFIER_TOKEN = 'identifier/identifier-token';
117
+
103
118
 
104
119
  // TODO: Deprecate
105
120
  export const INCOMING_SHIPMENT = 'shipment/incoming-shipment'
package/dist/index.d.mts CHANGED
@@ -2,6 +2,10 @@ import * as axios from 'axios';
2
2
  import { AxiosRequestConfig } from 'axios';
3
3
 
4
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";
5
9
  declare const COMPANY_PERMISSION = "company-permission";
6
10
  declare const COMPANY_OPTION = "company-option";
7
11
  declare const INVITATION = "user/invitation";
@@ -9,6 +13,7 @@ declare const CUSTOMER = "contact/customer";
9
13
  declare const PRODUCT = "product";
10
14
  declare const PRODUCT_ITEM = "product/product-item";
11
15
  declare const PRODUCT_GROUP = "product-group";
16
+ declare const PRODUCT_SUPPLIER = "product/product-supplier";
12
17
  declare const PURCHASE_ORDER = "order/purchase-order";
13
18
  declare const PURCHASE_ORDER_LINE = "order/purchase-order-line";
14
19
  declare const QUOTE = "order/quote";
@@ -45,14 +50,20 @@ declare const BOM_COMPONENT = "manufacturing/bom-component";
45
50
  declare const BOM_OPERATION = "manufacturing/bom-operation";
46
51
  declare const PRODUCTION_ORDER = "manufacturing/production-order";
47
52
  declare const PRODUCTION_ORDER_LINE = "manufacturing/production-order-line";
53
+ declare const JOB_CARD = "manufacturing/job-card";
54
+ declare const WORKSTATION = "manufacturing/workstation";
48
55
  declare const SUBSIDIARY = "subsidiary";
49
56
  declare const EMPLOYEE = "human-resources/employee";
57
+ declare const GEOFENCE = "geofence";
58
+ declare const SHIFT = "human-resources/employee/shift";
50
59
  declare const ATTENDANCE = "human-resources/attendance";
51
60
  declare const VEHICLE = "fleet/vehicle";
52
61
  declare const DELIVERY_JOB = "fleet/delivery-job";
53
62
  declare const CUSTOM_ENTITY_SCHEMA = "custom-entity/schema";
54
63
  declare const CUSTOM_ENTITY_OBJECT = "custom-entity";
55
64
  declare const CUSTOM_ENTITY_FIELD = "custom-entity/field";
65
+ declare const FORM = "form";
66
+ declare const CUSTOM_REPORT = "report/custom-report";
56
67
  declare const AUTOMATION_JOB = "automation/job";
57
68
  declare const AUTOMATION_SCRIPT = "automation/script";
58
69
  declare const USER_ACTION = "automation/user-action";
@@ -68,6 +79,8 @@ declare const COMPANY_ALIAS = "company-alias";
68
79
  declare const PRINT_JOB = "thermal-printer/print-job";
69
80
  declare const WORK_ORDER = "order/sales-order?type=WORK_ORDER";
70
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";
71
84
  declare const INCOMING_SHIPMENT = "shipment/incoming-shipment";
72
85
  declare const OUTGOING_SHIPMENT = "shipment/outgoing-shipment";
73
86
 
@@ -88,11 +101,16 @@ declare const crudEndpoints_CUSTOM_ENTITY_FIELD: typeof CUSTOM_ENTITY_FIELD;
88
101
  declare const crudEndpoints_CUSTOM_ENTITY_OBJECT: typeof CUSTOM_ENTITY_OBJECT;
89
102
  declare const crudEndpoints_CUSTOM_ENTITY_SCHEMA: typeof CUSTOM_ENTITY_SCHEMA;
90
103
  declare const crudEndpoints_CUSTOM_FIELD: typeof CUSTOM_FIELD;
104
+ declare const crudEndpoints_CUSTOM_REPORT: typeof CUSTOM_REPORT;
91
105
  declare const crudEndpoints_DELIVERY_JOB: typeof DELIVERY_JOB;
92
106
  declare const crudEndpoints_EMPLOYEE: typeof EMPLOYEE;
93
107
  declare const crudEndpoints_EXPENSE: typeof EXPENSE;
94
108
  declare const crudEndpoints_EXPENSE_LINE: typeof EXPENSE_LINE;
95
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;
96
114
  declare const crudEndpoints_INCOMING_DELIVERY: typeof INCOMING_DELIVERY;
97
115
  declare const crudEndpoints_INCOMING_DELIVERY_LINE: typeof INCOMING_DELIVERY_LINE;
98
116
  declare const crudEndpoints_INCOMING_PAYMENT_METHOD: typeof INCOMING_PAYMENT_METHOD;
@@ -104,6 +122,7 @@ declare const crudEndpoints_INVOICE: typeof INVOICE;
104
122
  declare const crudEndpoints_INVOICE_LINE: typeof INVOICE_LINE;
105
123
  declare const crudEndpoints_IOT_DEVICE: typeof IOT_DEVICE;
106
124
  declare const crudEndpoints_IOT_JOB: typeof IOT_JOB;
125
+ declare const crudEndpoints_JOB_CARD: typeof JOB_CARD;
107
126
  declare const crudEndpoints_JOURNAL_ENTRY: typeof JOURNAL_ENTRY;
108
127
  declare const crudEndpoints_JOURNAL_ENTRY_LINE: typeof JOURNAL_ENTRY_LINE;
109
128
  declare const crudEndpoints_NOTIFICATION: typeof NOTIFICATION;
@@ -117,6 +136,7 @@ declare const crudEndpoints_PRODUCTION_ORDER: typeof PRODUCTION_ORDER;
117
136
  declare const crudEndpoints_PRODUCTION_ORDER_LINE: typeof PRODUCTION_ORDER_LINE;
118
137
  declare const crudEndpoints_PRODUCT_GROUP: typeof PRODUCT_GROUP;
119
138
  declare const crudEndpoints_PRODUCT_ITEM: typeof PRODUCT_ITEM;
139
+ declare const crudEndpoints_PRODUCT_SUPPLIER: typeof PRODUCT_SUPPLIER;
120
140
  declare const crudEndpoints_PURCHASE_ORDER: typeof PURCHASE_ORDER;
121
141
  declare const crudEndpoints_PURCHASE_ORDER_APPROVER: typeof PURCHASE_ORDER_APPROVER;
122
142
  declare const crudEndpoints_PURCHASE_ORDER_LINE: typeof PURCHASE_ORDER_LINE;
@@ -128,6 +148,7 @@ declare const crudEndpoints_SALES_ORDER: typeof SALES_ORDER;
128
148
  declare const crudEndpoints_SALES_ORDER_APPROVER: typeof SALES_ORDER_APPROVER;
129
149
  declare const crudEndpoints_SALES_ORDER_LINE: typeof SALES_ORDER_LINE;
130
150
  declare const crudEndpoints_SERVICE_ORDER: typeof SERVICE_ORDER;
151
+ declare const crudEndpoints_SHIFT: typeof SHIFT;
131
152
  declare const crudEndpoints_STOCK_ADJUSTMENT: typeof STOCK_ADJUSTMENT;
132
153
  declare const crudEndpoints_STORE: typeof STORE;
133
154
  declare const crudEndpoints_STORE_PRODUCT: typeof STORE_PRODUCT;
@@ -137,11 +158,16 @@ declare const crudEndpoints_STORE_PRODUCT_GROUP: typeof STORE_PRODUCT_GROUP;
137
158
  declare const crudEndpoints_SUBSIDIARY: typeof SUBSIDIARY;
138
159
  declare const crudEndpoints_SUPPLIER: typeof SUPPLIER;
139
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;
140
165
  declare const crudEndpoints_VEHICLE: typeof VEHICLE;
141
166
  declare const crudEndpoints_WAREHOUSE: typeof WAREHOUSE;
167
+ declare const crudEndpoints_WORKSTATION: typeof WORKSTATION;
142
168
  declare const crudEndpoints_WORK_ORDER: typeof WORK_ORDER;
143
169
  declare namespace crudEndpoints {
144
- 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_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_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_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_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_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_VEHICLE as VEHICLE, crudEndpoints_WAREHOUSE as WAREHOUSE, crudEndpoints_WORK_ORDER as WORK_ORDER };
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 };
145
171
  }
146
172
 
147
173
  declare function call(axiosRequest: AxiosRequestConfig): Promise<axios.AxiosResponse<any, any>>;
package/dist/index.d.ts CHANGED
@@ -2,6 +2,10 @@ import * as axios from 'axios';
2
2
  import { AxiosRequestConfig } from 'axios';
3
3
 
4
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";
5
9
  declare const COMPANY_PERMISSION = "company-permission";
6
10
  declare const COMPANY_OPTION = "company-option";
7
11
  declare const INVITATION = "user/invitation";
@@ -9,6 +13,7 @@ declare const CUSTOMER = "contact/customer";
9
13
  declare const PRODUCT = "product";
10
14
  declare const PRODUCT_ITEM = "product/product-item";
11
15
  declare const PRODUCT_GROUP = "product-group";
16
+ declare const PRODUCT_SUPPLIER = "product/product-supplier";
12
17
  declare const PURCHASE_ORDER = "order/purchase-order";
13
18
  declare const PURCHASE_ORDER_LINE = "order/purchase-order-line";
14
19
  declare const QUOTE = "order/quote";
@@ -45,14 +50,20 @@ declare const BOM_COMPONENT = "manufacturing/bom-component";
45
50
  declare const BOM_OPERATION = "manufacturing/bom-operation";
46
51
  declare const PRODUCTION_ORDER = "manufacturing/production-order";
47
52
  declare const PRODUCTION_ORDER_LINE = "manufacturing/production-order-line";
53
+ declare const JOB_CARD = "manufacturing/job-card";
54
+ declare const WORKSTATION = "manufacturing/workstation";
48
55
  declare const SUBSIDIARY = "subsidiary";
49
56
  declare const EMPLOYEE = "human-resources/employee";
57
+ declare const GEOFENCE = "geofence";
58
+ declare const SHIFT = "human-resources/employee/shift";
50
59
  declare const ATTENDANCE = "human-resources/attendance";
51
60
  declare const VEHICLE = "fleet/vehicle";
52
61
  declare const DELIVERY_JOB = "fleet/delivery-job";
53
62
  declare const CUSTOM_ENTITY_SCHEMA = "custom-entity/schema";
54
63
  declare const CUSTOM_ENTITY_OBJECT = "custom-entity";
55
64
  declare const CUSTOM_ENTITY_FIELD = "custom-entity/field";
65
+ declare const FORM = "form";
66
+ declare const CUSTOM_REPORT = "report/custom-report";
56
67
  declare const AUTOMATION_JOB = "automation/job";
57
68
  declare const AUTOMATION_SCRIPT = "automation/script";
58
69
  declare const USER_ACTION = "automation/user-action";
@@ -68,6 +79,8 @@ declare const COMPANY_ALIAS = "company-alias";
68
79
  declare const PRINT_JOB = "thermal-printer/print-job";
69
80
  declare const WORK_ORDER = "order/sales-order?type=WORK_ORDER";
70
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";
71
84
  declare const INCOMING_SHIPMENT = "shipment/incoming-shipment";
72
85
  declare const OUTGOING_SHIPMENT = "shipment/outgoing-shipment";
73
86
 
@@ -88,11 +101,16 @@ declare const crudEndpoints_CUSTOM_ENTITY_FIELD: typeof CUSTOM_ENTITY_FIELD;
88
101
  declare const crudEndpoints_CUSTOM_ENTITY_OBJECT: typeof CUSTOM_ENTITY_OBJECT;
89
102
  declare const crudEndpoints_CUSTOM_ENTITY_SCHEMA: typeof CUSTOM_ENTITY_SCHEMA;
90
103
  declare const crudEndpoints_CUSTOM_FIELD: typeof CUSTOM_FIELD;
104
+ declare const crudEndpoints_CUSTOM_REPORT: typeof CUSTOM_REPORT;
91
105
  declare const crudEndpoints_DELIVERY_JOB: typeof DELIVERY_JOB;
92
106
  declare const crudEndpoints_EMPLOYEE: typeof EMPLOYEE;
93
107
  declare const crudEndpoints_EXPENSE: typeof EXPENSE;
94
108
  declare const crudEndpoints_EXPENSE_LINE: typeof EXPENSE_LINE;
95
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;
96
114
  declare const crudEndpoints_INCOMING_DELIVERY: typeof INCOMING_DELIVERY;
97
115
  declare const crudEndpoints_INCOMING_DELIVERY_LINE: typeof INCOMING_DELIVERY_LINE;
98
116
  declare const crudEndpoints_INCOMING_PAYMENT_METHOD: typeof INCOMING_PAYMENT_METHOD;
@@ -104,6 +122,7 @@ declare const crudEndpoints_INVOICE: typeof INVOICE;
104
122
  declare const crudEndpoints_INVOICE_LINE: typeof INVOICE_LINE;
105
123
  declare const crudEndpoints_IOT_DEVICE: typeof IOT_DEVICE;
106
124
  declare const crudEndpoints_IOT_JOB: typeof IOT_JOB;
125
+ declare const crudEndpoints_JOB_CARD: typeof JOB_CARD;
107
126
  declare const crudEndpoints_JOURNAL_ENTRY: typeof JOURNAL_ENTRY;
108
127
  declare const crudEndpoints_JOURNAL_ENTRY_LINE: typeof JOURNAL_ENTRY_LINE;
109
128
  declare const crudEndpoints_NOTIFICATION: typeof NOTIFICATION;
@@ -117,6 +136,7 @@ declare const crudEndpoints_PRODUCTION_ORDER: typeof PRODUCTION_ORDER;
117
136
  declare const crudEndpoints_PRODUCTION_ORDER_LINE: typeof PRODUCTION_ORDER_LINE;
118
137
  declare const crudEndpoints_PRODUCT_GROUP: typeof PRODUCT_GROUP;
119
138
  declare const crudEndpoints_PRODUCT_ITEM: typeof PRODUCT_ITEM;
139
+ declare const crudEndpoints_PRODUCT_SUPPLIER: typeof PRODUCT_SUPPLIER;
120
140
  declare const crudEndpoints_PURCHASE_ORDER: typeof PURCHASE_ORDER;
121
141
  declare const crudEndpoints_PURCHASE_ORDER_APPROVER: typeof PURCHASE_ORDER_APPROVER;
122
142
  declare const crudEndpoints_PURCHASE_ORDER_LINE: typeof PURCHASE_ORDER_LINE;
@@ -128,6 +148,7 @@ declare const crudEndpoints_SALES_ORDER: typeof SALES_ORDER;
128
148
  declare const crudEndpoints_SALES_ORDER_APPROVER: typeof SALES_ORDER_APPROVER;
129
149
  declare const crudEndpoints_SALES_ORDER_LINE: typeof SALES_ORDER_LINE;
130
150
  declare const crudEndpoints_SERVICE_ORDER: typeof SERVICE_ORDER;
151
+ declare const crudEndpoints_SHIFT: typeof SHIFT;
131
152
  declare const crudEndpoints_STOCK_ADJUSTMENT: typeof STOCK_ADJUSTMENT;
132
153
  declare const crudEndpoints_STORE: typeof STORE;
133
154
  declare const crudEndpoints_STORE_PRODUCT: typeof STORE_PRODUCT;
@@ -137,11 +158,16 @@ declare const crudEndpoints_STORE_PRODUCT_GROUP: typeof STORE_PRODUCT_GROUP;
137
158
  declare const crudEndpoints_SUBSIDIARY: typeof SUBSIDIARY;
138
159
  declare const crudEndpoints_SUPPLIER: typeof SUPPLIER;
139
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;
140
165
  declare const crudEndpoints_VEHICLE: typeof VEHICLE;
141
166
  declare const crudEndpoints_WAREHOUSE: typeof WAREHOUSE;
167
+ declare const crudEndpoints_WORKSTATION: typeof WORKSTATION;
142
168
  declare const crudEndpoints_WORK_ORDER: typeof WORK_ORDER;
143
169
  declare namespace crudEndpoints {
144
- 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_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_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_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_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_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_VEHICLE as VEHICLE, crudEndpoints_WAREHOUSE as WAREHOUSE, crudEndpoints_WORK_ORDER as WORK_ORDER };
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 };
145
171
  }
146
172
 
147
173
  declare function call(axiosRequest: AxiosRequestConfig): Promise<axios.AxiosResponse<any, any>>;
package/dist/index.js CHANGED
@@ -95,11 +95,16 @@ __export(crudEndpoints_exports, {
95
95
  CUSTOM_ENTITY_OBJECT: () => CUSTOM_ENTITY_OBJECT,
96
96
  CUSTOM_ENTITY_SCHEMA: () => CUSTOM_ENTITY_SCHEMA,
97
97
  CUSTOM_FIELD: () => CUSTOM_FIELD,
98
+ CUSTOM_REPORT: () => CUSTOM_REPORT,
98
99
  DELIVERY_JOB: () => DELIVERY_JOB,
99
100
  EMPLOYEE: () => EMPLOYEE,
100
101
  EXPENSE: () => EXPENSE,
101
102
  EXPENSE_LINE: () => EXPENSE_LINE,
102
103
  FIXED_ASSET: () => FIXED_ASSET,
104
+ FORM: () => FORM,
105
+ GEOFENCE: () => GEOFENCE,
106
+ IDENTIFIER_GROUP: () => IDENTIFIER_GROUP,
107
+ IDENTIFIER_TOKEN: () => IDENTIFIER_TOKEN,
103
108
  INCOMING_DELIVERY: () => INCOMING_DELIVERY,
104
109
  INCOMING_DELIVERY_LINE: () => INCOMING_DELIVERY_LINE,
105
110
  INCOMING_PAYMENT_METHOD: () => INCOMING_PAYMENT_METHOD,
@@ -111,6 +116,7 @@ __export(crudEndpoints_exports, {
111
116
  INVOICE_LINE: () => INVOICE_LINE,
112
117
  IOT_DEVICE: () => IOT_DEVICE,
113
118
  IOT_JOB: () => IOT_JOB,
119
+ JOB_CARD: () => JOB_CARD,
114
120
  JOURNAL_ENTRY: () => JOURNAL_ENTRY,
115
121
  JOURNAL_ENTRY_LINE: () => JOURNAL_ENTRY_LINE,
116
122
  NOTIFICATION: () => NOTIFICATION,
@@ -124,6 +130,7 @@ __export(crudEndpoints_exports, {
124
130
  PRODUCTION_ORDER_LINE: () => PRODUCTION_ORDER_LINE,
125
131
  PRODUCT_GROUP: () => PRODUCT_GROUP,
126
132
  PRODUCT_ITEM: () => PRODUCT_ITEM,
133
+ PRODUCT_SUPPLIER: () => PRODUCT_SUPPLIER,
127
134
  PURCHASE_ORDER: () => PURCHASE_ORDER,
128
135
  PURCHASE_ORDER_APPROVER: () => PURCHASE_ORDER_APPROVER,
129
136
  PURCHASE_ORDER_LINE: () => PURCHASE_ORDER_LINE,
@@ -135,6 +142,7 @@ __export(crudEndpoints_exports, {
135
142
  SALES_ORDER_APPROVER: () => SALES_ORDER_APPROVER,
136
143
  SALES_ORDER_LINE: () => SALES_ORDER_LINE,
137
144
  SERVICE_ORDER: () => SERVICE_ORDER,
145
+ SHIFT: () => SHIFT,
138
146
  STOCK_ADJUSTMENT: () => STOCK_ADJUSTMENT,
139
147
  STORE: () => STORE,
140
148
  STORE_PRODUCT: () => STORE_PRODUCT,
@@ -144,11 +152,20 @@ __export(crudEndpoints_exports, {
144
152
  SUBSIDIARY: () => SUBSIDIARY,
145
153
  SUPPLIER: () => SUPPLIER,
146
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,
147
159
  VEHICLE: () => VEHICLE,
148
160
  WAREHOUSE: () => WAREHOUSE,
161
+ WORKSTATION: () => WORKSTATION,
149
162
  WORK_ORDER: () => WORK_ORDER
150
163
  });
151
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";
152
169
  var COMPANY_PERMISSION = "company-permission";
153
170
  var COMPANY_OPTION = "company-option";
154
171
  var INVITATION = "user/invitation";
@@ -156,6 +173,7 @@ var CUSTOMER = "contact/customer";
156
173
  var PRODUCT = "product";
157
174
  var PRODUCT_ITEM = "product/product-item";
158
175
  var PRODUCT_GROUP = "product-group";
176
+ var PRODUCT_SUPPLIER = "product/product-supplier";
159
177
  var PURCHASE_ORDER = "order/purchase-order";
160
178
  var PURCHASE_ORDER_LINE = "order/purchase-order-line";
161
179
  var QUOTE = "order/quote";
@@ -192,14 +210,20 @@ var BOM_COMPONENT = "manufacturing/bom-component";
192
210
  var BOM_OPERATION = "manufacturing/bom-operation";
193
211
  var PRODUCTION_ORDER = "manufacturing/production-order";
194
212
  var PRODUCTION_ORDER_LINE = "manufacturing/production-order-line";
213
+ var JOB_CARD = "manufacturing/job-card";
214
+ var WORKSTATION = "manufacturing/workstation";
195
215
  var SUBSIDIARY = "subsidiary";
196
216
  var EMPLOYEE = "human-resources/employee";
217
+ var GEOFENCE = "geofence";
218
+ var SHIFT = "human-resources/employee/shift";
197
219
  var ATTENDANCE = "human-resources/attendance";
198
220
  var VEHICLE = "fleet/vehicle";
199
221
  var DELIVERY_JOB = "fleet/delivery-job";
200
222
  var CUSTOM_ENTITY_SCHEMA = "custom-entity/schema";
201
223
  var CUSTOM_ENTITY_OBJECT = "custom-entity";
202
224
  var CUSTOM_ENTITY_FIELD = "custom-entity/field";
225
+ var FORM = "form";
226
+ var CUSTOM_REPORT = "report/custom-report";
203
227
  var AUTOMATION_JOB = "automation/job";
204
228
  var AUTOMATION_SCRIPT = "automation/script";
205
229
  var USER_ACTION = "automation/user-action";
@@ -215,9 +239,25 @@ var COMPANY_ALIAS = "company-alias";
215
239
  var PRINT_JOB = "thermal-printer/print-job";
216
240
  var WORK_ORDER = "order/sales-order?type=WORK_ORDER";
217
241
  var SERVICE_ORDER = "order/sales-order?type=SERVICE_ORDER";
242
+ var IDENTIFIER_GROUP = "identifier/identifier-group";
243
+ var IDENTIFIER_TOKEN = "identifier/identifier-token";
218
244
  var INCOMING_SHIPMENT = "shipment/incoming-shipment";
219
245
  var OUTGOING_SHIPMENT = "shipment/outgoing-shipment";
220
246
 
247
+ // KonversiError.ts
248
+ var import_axios2 = require("axios");
249
+ var KonversiError = class _KonversiError extends Error {
250
+ constructor(error) {
251
+ var _a2, _b;
252
+ if ((0, import_axios2.isAxiosError)(error)) {
253
+ super(`Konversi API Error ${((_a2 = error.response) == null ? void 0 : _a2.status) || "unknown"}: ${((_b = error.response) == null ? void 0 : _b.data) || error.message}`);
254
+ } else {
255
+ super(`Konversi Error: ${error.message}`);
256
+ }
257
+ Object.setPrototypeOf(this, _KonversiError.prototype);
258
+ }
259
+ };
260
+
221
261
  // index.ts
222
262
  function call(axiosRequest) {
223
263
  return __async(this, null, function* () {
@@ -226,96 +266,140 @@ function call(axiosRequest) {
226
266
  }
227
267
  function getAllCustomObjects(_0) {
228
268
  return __async(this, arguments, function* (schemaName, queryParams = {}) {
229
- const response = yield axiosAPI_default.request({
230
- method: "get",
231
- url: `custom-entity/${schemaName}`,
232
- params: queryParams
233
- });
234
- return response.data;
269
+ try {
270
+ const response = yield axiosAPI_default.request({
271
+ method: "get",
272
+ url: `custom-entity/${schemaName}`,
273
+ params: queryParams
274
+ });
275
+ return response.data;
276
+ } catch (e) {
277
+ throw new KonversiError(e);
278
+ }
235
279
  });
236
280
  }
237
281
  function getCustomObjectById(schemaName, id) {
238
282
  return __async(this, null, function* () {
239
- const response = yield axiosAPI_default.request({
240
- method: "get",
241
- url: `custom-entity/${schemaName}/${id}`
242
- });
243
- return response.data;
283
+ try {
284
+ const response = yield axiosAPI_default.request({
285
+ method: "get",
286
+ url: `custom-entity/${schemaName}/${id}`
287
+ });
288
+ return response.data;
289
+ } catch (e) {
290
+ throw new KonversiError(e);
291
+ }
244
292
  });
245
293
  }
246
294
  function updateCustomObject(schemaName, id, newData) {
247
295
  return __async(this, null, function* () {
248
- const response = yield axiosAPI_default.request({
249
- method: "put",
250
- url: `custom-entity/${schemaName}/${id}`,
251
- headers: {
252
- "Content-Type": "application/json"
253
- },
254
- data: JSON.stringify(newData)
255
- });
256
- return response.data;
296
+ try {
297
+ const response = yield axiosAPI_default.request({
298
+ method: "put",
299
+ url: `custom-entity/${schemaName}/${id}`,
300
+ headers: {
301
+ "Content-Type": "application/json"
302
+ },
303
+ data: JSON.stringify(newData)
304
+ });
305
+ return response.data;
306
+ } catch (e) {
307
+ throw new KonversiError(e);
308
+ }
257
309
  });
258
310
  }
259
311
  function createCustomObject(schemaName, data) {
260
312
  return __async(this, null, function* () {
261
- const response = yield axiosAPI_default.request({
262
- method: "post",
263
- url: `custom-entity/${schemaName}`,
264
- data
265
- });
266
- return response.data;
313
+ try {
314
+ const response = yield axiosAPI_default.request({
315
+ method: "post",
316
+ url: `custom-entity/${schemaName}`,
317
+ data
318
+ });
319
+ return response.data;
320
+ } catch (e) {
321
+ throw new KonversiError(e);
322
+ }
267
323
  });
268
324
  }
269
325
  function deleteCustomObject(schemaName, id) {
270
326
  return __async(this, null, function* () {
271
- const response = yield axiosAPI_default.request({
272
- method: "delete",
273
- maxBodyLength: Infinity,
274
- url: `custom-entity/${schemaName}/${id}`
275
- });
276
- return response.data;
327
+ try {
328
+ const response = yield axiosAPI_default.request({
329
+ method: "delete",
330
+ maxBodyLength: Infinity,
331
+ url: `custom-entity/${schemaName}/${id}`
332
+ });
333
+ return response.data;
334
+ } catch (e) {
335
+ throw new KonversiError(e);
336
+ }
277
337
  });
278
338
  }
279
339
  function getAllObjects(_0) {
280
340
  return __async(this, arguments, function* (entity, queryParams = {}) {
281
- const response = yield axiosAPI_default.get(`${entity}`, {
282
- params: queryParams
283
- });
284
- return response.data;
341
+ try {
342
+ const response = yield axiosAPI_default.get(`${entity}`, {
343
+ params: queryParams
344
+ });
345
+ return response.data;
346
+ } catch (e) {
347
+ throw new KonversiError(e);
348
+ }
285
349
  });
286
350
  }
287
351
  function getObjectById(entity, id) {
288
352
  return __async(this, null, function* () {
289
- const response = yield axiosAPI_default.get(`${entity}/${id}`);
290
- return response.data;
353
+ try {
354
+ const response = yield axiosAPI_default.get(`${entity}/${id}`);
355
+ return response.data;
356
+ } catch (e) {
357
+ throw new KonversiError(e);
358
+ }
291
359
  });
292
360
  }
293
361
  function updateObject(entity, id, newData) {
294
362
  return __async(this, null, function* () {
295
- const response = yield axiosAPI_default.put(`${entity}/${id}`, newData);
296
- return response.data;
363
+ try {
364
+ const response = yield axiosAPI_default.put(`${entity}/${id}`, newData);
365
+ return response.data;
366
+ } catch (e) {
367
+ throw new KonversiError(e);
368
+ }
297
369
  });
298
370
  }
299
371
  function createObject(entity, data) {
300
372
  return __async(this, null, function* () {
301
- const response = yield axiosAPI_default.post(`${entity}`, data);
302
- return response.data;
373
+ try {
374
+ const response = yield axiosAPI_default.post(`${entity}`, data);
375
+ return response.data;
376
+ } catch (e) {
377
+ throw new KonversiError(e);
378
+ }
303
379
  });
304
380
  }
305
381
  function deleteObject(entity, id) {
306
382
  return __async(this, null, function* () {
307
- const response = yield axiosAPI_default.delete(`${entity}/${id}`);
308
- return response.data;
383
+ try {
384
+ const response = yield axiosAPI_default.delete(`${entity}/${id}`);
385
+ return response.data;
386
+ } catch (e) {
387
+ throw new KonversiError(e);
388
+ }
309
389
  });
310
390
  }
311
391
  function runScript(scriptNameOrId, input, sync = false) {
312
392
  return __async(this, null, function* () {
313
- if (sync) {
314
- const response2 = yield axiosAPI_default.post(`/automation/script/${scriptNameOrId}/run?mode=sync`, { input });
315
- return response2.data;
393
+ try {
394
+ if (sync) {
395
+ const response2 = yield axiosAPI_default.post(`/automation/script/${scriptNameOrId}/run?mode=sync`, { input });
396
+ return response2.data;
397
+ }
398
+ const response = yield axiosAPI_default.post(`/automation/script/${scriptNameOrId}/run`, { input });
399
+ return response.data;
400
+ } catch (e) {
401
+ throw new KonversiError(e);
316
402
  }
317
- const response = yield axiosAPI_default.post(`/automation/script/${scriptNameOrId}/run`, { input });
318
- return response.data;
319
403
  });
320
404
  }
321
405
  var _a;
package/dist/index.mjs CHANGED
@@ -63,11 +63,16 @@ __export(crudEndpoints_exports, {
63
63
  CUSTOM_ENTITY_OBJECT: () => CUSTOM_ENTITY_OBJECT,
64
64
  CUSTOM_ENTITY_SCHEMA: () => CUSTOM_ENTITY_SCHEMA,
65
65
  CUSTOM_FIELD: () => CUSTOM_FIELD,
66
+ CUSTOM_REPORT: () => CUSTOM_REPORT,
66
67
  DELIVERY_JOB: () => DELIVERY_JOB,
67
68
  EMPLOYEE: () => EMPLOYEE,
68
69
  EXPENSE: () => EXPENSE,
69
70
  EXPENSE_LINE: () => EXPENSE_LINE,
70
71
  FIXED_ASSET: () => FIXED_ASSET,
72
+ FORM: () => FORM,
73
+ GEOFENCE: () => GEOFENCE,
74
+ IDENTIFIER_GROUP: () => IDENTIFIER_GROUP,
75
+ IDENTIFIER_TOKEN: () => IDENTIFIER_TOKEN,
71
76
  INCOMING_DELIVERY: () => INCOMING_DELIVERY,
72
77
  INCOMING_DELIVERY_LINE: () => INCOMING_DELIVERY_LINE,
73
78
  INCOMING_PAYMENT_METHOD: () => INCOMING_PAYMENT_METHOD,
@@ -79,6 +84,7 @@ __export(crudEndpoints_exports, {
79
84
  INVOICE_LINE: () => INVOICE_LINE,
80
85
  IOT_DEVICE: () => IOT_DEVICE,
81
86
  IOT_JOB: () => IOT_JOB,
87
+ JOB_CARD: () => JOB_CARD,
82
88
  JOURNAL_ENTRY: () => JOURNAL_ENTRY,
83
89
  JOURNAL_ENTRY_LINE: () => JOURNAL_ENTRY_LINE,
84
90
  NOTIFICATION: () => NOTIFICATION,
@@ -92,6 +98,7 @@ __export(crudEndpoints_exports, {
92
98
  PRODUCTION_ORDER_LINE: () => PRODUCTION_ORDER_LINE,
93
99
  PRODUCT_GROUP: () => PRODUCT_GROUP,
94
100
  PRODUCT_ITEM: () => PRODUCT_ITEM,
101
+ PRODUCT_SUPPLIER: () => PRODUCT_SUPPLIER,
95
102
  PURCHASE_ORDER: () => PURCHASE_ORDER,
96
103
  PURCHASE_ORDER_APPROVER: () => PURCHASE_ORDER_APPROVER,
97
104
  PURCHASE_ORDER_LINE: () => PURCHASE_ORDER_LINE,
@@ -103,6 +110,7 @@ __export(crudEndpoints_exports, {
103
110
  SALES_ORDER_APPROVER: () => SALES_ORDER_APPROVER,
104
111
  SALES_ORDER_LINE: () => SALES_ORDER_LINE,
105
112
  SERVICE_ORDER: () => SERVICE_ORDER,
113
+ SHIFT: () => SHIFT,
106
114
  STOCK_ADJUSTMENT: () => STOCK_ADJUSTMENT,
107
115
  STORE: () => STORE,
108
116
  STORE_PRODUCT: () => STORE_PRODUCT,
@@ -112,11 +120,20 @@ __export(crudEndpoints_exports, {
112
120
  SUBSIDIARY: () => SUBSIDIARY,
113
121
  SUPPLIER: () => SUPPLIER,
114
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,
115
127
  VEHICLE: () => VEHICLE,
116
128
  WAREHOUSE: () => WAREHOUSE,
129
+ WORKSTATION: () => WORKSTATION,
117
130
  WORK_ORDER: () => WORK_ORDER
118
131
  });
119
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";
120
137
  var COMPANY_PERMISSION = "company-permission";
121
138
  var COMPANY_OPTION = "company-option";
122
139
  var INVITATION = "user/invitation";
@@ -124,6 +141,7 @@ var CUSTOMER = "contact/customer";
124
141
  var PRODUCT = "product";
125
142
  var PRODUCT_ITEM = "product/product-item";
126
143
  var PRODUCT_GROUP = "product-group";
144
+ var PRODUCT_SUPPLIER = "product/product-supplier";
127
145
  var PURCHASE_ORDER = "order/purchase-order";
128
146
  var PURCHASE_ORDER_LINE = "order/purchase-order-line";
129
147
  var QUOTE = "order/quote";
@@ -160,14 +178,20 @@ var BOM_COMPONENT = "manufacturing/bom-component";
160
178
  var BOM_OPERATION = "manufacturing/bom-operation";
161
179
  var PRODUCTION_ORDER = "manufacturing/production-order";
162
180
  var PRODUCTION_ORDER_LINE = "manufacturing/production-order-line";
181
+ var JOB_CARD = "manufacturing/job-card";
182
+ var WORKSTATION = "manufacturing/workstation";
163
183
  var SUBSIDIARY = "subsidiary";
164
184
  var EMPLOYEE = "human-resources/employee";
185
+ var GEOFENCE = "geofence";
186
+ var SHIFT = "human-resources/employee/shift";
165
187
  var ATTENDANCE = "human-resources/attendance";
166
188
  var VEHICLE = "fleet/vehicle";
167
189
  var DELIVERY_JOB = "fleet/delivery-job";
168
190
  var CUSTOM_ENTITY_SCHEMA = "custom-entity/schema";
169
191
  var CUSTOM_ENTITY_OBJECT = "custom-entity";
170
192
  var CUSTOM_ENTITY_FIELD = "custom-entity/field";
193
+ var FORM = "form";
194
+ var CUSTOM_REPORT = "report/custom-report";
171
195
  var AUTOMATION_JOB = "automation/job";
172
196
  var AUTOMATION_SCRIPT = "automation/script";
173
197
  var USER_ACTION = "automation/user-action";
@@ -183,9 +207,25 @@ var COMPANY_ALIAS = "company-alias";
183
207
  var PRINT_JOB = "thermal-printer/print-job";
184
208
  var WORK_ORDER = "order/sales-order?type=WORK_ORDER";
185
209
  var SERVICE_ORDER = "order/sales-order?type=SERVICE_ORDER";
210
+ var IDENTIFIER_GROUP = "identifier/identifier-group";
211
+ var IDENTIFIER_TOKEN = "identifier/identifier-token";
186
212
  var INCOMING_SHIPMENT = "shipment/incoming-shipment";
187
213
  var OUTGOING_SHIPMENT = "shipment/outgoing-shipment";
188
214
 
215
+ // KonversiError.ts
216
+ import { isAxiosError } from "axios";
217
+ var KonversiError = class _KonversiError extends Error {
218
+ constructor(error) {
219
+ var _a2, _b;
220
+ if (isAxiosError(error)) {
221
+ super(`Konversi API Error ${((_a2 = error.response) == null ? void 0 : _a2.status) || "unknown"}: ${((_b = error.response) == null ? void 0 : _b.data) || error.message}`);
222
+ } else {
223
+ super(`Konversi Error: ${error.message}`);
224
+ }
225
+ Object.setPrototypeOf(this, _KonversiError.prototype);
226
+ }
227
+ };
228
+
189
229
  // index.ts
190
230
  function call(axiosRequest) {
191
231
  return __async(this, null, function* () {
@@ -194,96 +234,140 @@ function call(axiosRequest) {
194
234
  }
195
235
  function getAllCustomObjects(_0) {
196
236
  return __async(this, arguments, function* (schemaName, queryParams = {}) {
197
- const response = yield axiosAPI_default.request({
198
- method: "get",
199
- url: `custom-entity/${schemaName}`,
200
- params: queryParams
201
- });
202
- return response.data;
237
+ try {
238
+ const response = yield axiosAPI_default.request({
239
+ method: "get",
240
+ url: `custom-entity/${schemaName}`,
241
+ params: queryParams
242
+ });
243
+ return response.data;
244
+ } catch (e) {
245
+ throw new KonversiError(e);
246
+ }
203
247
  });
204
248
  }
205
249
  function getCustomObjectById(schemaName, id) {
206
250
  return __async(this, null, function* () {
207
- const response = yield axiosAPI_default.request({
208
- method: "get",
209
- url: `custom-entity/${schemaName}/${id}`
210
- });
211
- return response.data;
251
+ try {
252
+ const response = yield axiosAPI_default.request({
253
+ method: "get",
254
+ url: `custom-entity/${schemaName}/${id}`
255
+ });
256
+ return response.data;
257
+ } catch (e) {
258
+ throw new KonversiError(e);
259
+ }
212
260
  });
213
261
  }
214
262
  function updateCustomObject(schemaName, id, newData) {
215
263
  return __async(this, null, function* () {
216
- const response = yield axiosAPI_default.request({
217
- method: "put",
218
- url: `custom-entity/${schemaName}/${id}`,
219
- headers: {
220
- "Content-Type": "application/json"
221
- },
222
- data: JSON.stringify(newData)
223
- });
224
- return response.data;
264
+ try {
265
+ const response = yield axiosAPI_default.request({
266
+ method: "put",
267
+ url: `custom-entity/${schemaName}/${id}`,
268
+ headers: {
269
+ "Content-Type": "application/json"
270
+ },
271
+ data: JSON.stringify(newData)
272
+ });
273
+ return response.data;
274
+ } catch (e) {
275
+ throw new KonversiError(e);
276
+ }
225
277
  });
226
278
  }
227
279
  function createCustomObject(schemaName, data) {
228
280
  return __async(this, null, function* () {
229
- const response = yield axiosAPI_default.request({
230
- method: "post",
231
- url: `custom-entity/${schemaName}`,
232
- data
233
- });
234
- return response.data;
281
+ try {
282
+ const response = yield axiosAPI_default.request({
283
+ method: "post",
284
+ url: `custom-entity/${schemaName}`,
285
+ data
286
+ });
287
+ return response.data;
288
+ } catch (e) {
289
+ throw new KonversiError(e);
290
+ }
235
291
  });
236
292
  }
237
293
  function deleteCustomObject(schemaName, id) {
238
294
  return __async(this, null, function* () {
239
- const response = yield axiosAPI_default.request({
240
- method: "delete",
241
- maxBodyLength: Infinity,
242
- url: `custom-entity/${schemaName}/${id}`
243
- });
244
- return response.data;
295
+ try {
296
+ const response = yield axiosAPI_default.request({
297
+ method: "delete",
298
+ maxBodyLength: Infinity,
299
+ url: `custom-entity/${schemaName}/${id}`
300
+ });
301
+ return response.data;
302
+ } catch (e) {
303
+ throw new KonversiError(e);
304
+ }
245
305
  });
246
306
  }
247
307
  function getAllObjects(_0) {
248
308
  return __async(this, arguments, function* (entity, queryParams = {}) {
249
- const response = yield axiosAPI_default.get(`${entity}`, {
250
- params: queryParams
251
- });
252
- return response.data;
309
+ try {
310
+ const response = yield axiosAPI_default.get(`${entity}`, {
311
+ params: queryParams
312
+ });
313
+ return response.data;
314
+ } catch (e) {
315
+ throw new KonversiError(e);
316
+ }
253
317
  });
254
318
  }
255
319
  function getObjectById(entity, id) {
256
320
  return __async(this, null, function* () {
257
- const response = yield axiosAPI_default.get(`${entity}/${id}`);
258
- return response.data;
321
+ try {
322
+ const response = yield axiosAPI_default.get(`${entity}/${id}`);
323
+ return response.data;
324
+ } catch (e) {
325
+ throw new KonversiError(e);
326
+ }
259
327
  });
260
328
  }
261
329
  function updateObject(entity, id, newData) {
262
330
  return __async(this, null, function* () {
263
- const response = yield axiosAPI_default.put(`${entity}/${id}`, newData);
264
- return response.data;
331
+ try {
332
+ const response = yield axiosAPI_default.put(`${entity}/${id}`, newData);
333
+ return response.data;
334
+ } catch (e) {
335
+ throw new KonversiError(e);
336
+ }
265
337
  });
266
338
  }
267
339
  function createObject(entity, data) {
268
340
  return __async(this, null, function* () {
269
- const response = yield axiosAPI_default.post(`${entity}`, data);
270
- return response.data;
341
+ try {
342
+ const response = yield axiosAPI_default.post(`${entity}`, data);
343
+ return response.data;
344
+ } catch (e) {
345
+ throw new KonversiError(e);
346
+ }
271
347
  });
272
348
  }
273
349
  function deleteObject(entity, id) {
274
350
  return __async(this, null, function* () {
275
- const response = yield axiosAPI_default.delete(`${entity}/${id}`);
276
- return response.data;
351
+ try {
352
+ const response = yield axiosAPI_default.delete(`${entity}/${id}`);
353
+ return response.data;
354
+ } catch (e) {
355
+ throw new KonversiError(e);
356
+ }
277
357
  });
278
358
  }
279
359
  function runScript(scriptNameOrId, input, sync = false) {
280
360
  return __async(this, null, function* () {
281
- if (sync) {
282
- const response2 = yield axiosAPI_default.post(`/automation/script/${scriptNameOrId}/run?mode=sync`, { input });
283
- return response2.data;
361
+ try {
362
+ if (sync) {
363
+ const response2 = yield axiosAPI_default.post(`/automation/script/${scriptNameOrId}/run?mode=sync`, { input });
364
+ return response2.data;
365
+ }
366
+ const response = yield axiosAPI_default.post(`/automation/script/${scriptNameOrId}/run`, { input });
367
+ return response.data;
368
+ } catch (e) {
369
+ throw new KonversiError(e);
284
370
  }
285
- const response = yield axiosAPI_default.post(`/automation/script/${scriptNameOrId}/run`, { input });
286
- return response.data;
287
371
  });
288
372
  }
289
373
  var _a;
package/index.ts CHANGED
@@ -2,29 +2,39 @@ import { Axios, AxiosRequestConfig } from "axios";
2
2
  import axiosAPI, { setAuthToken, setBaseUrl, setCompanyId } from "./axiosAPI";
3
3
 
4
4
  import * as crudEndpoints from "./crudEndpoints";
5
+ import KonversiError from "./KonversiError";
5
6
 
6
7
  async function call(axiosRequest: AxiosRequestConfig) {
7
8
  return await axiosAPI.request(axiosRequest);
8
9
  }
9
10
 
10
11
  async function getAllCustomObjects(schemaName: string, queryParams: any = {}) {
12
+ try {
11
13
  const response = await axiosAPI.request({
12
14
  method: 'get',
13
15
  url: `custom-entity/${schemaName}`,
14
16
  params: queryParams
15
17
  })
16
18
  return response.data;
19
+ } catch (e: any) {
20
+ throw new KonversiError(e);
21
+ }
17
22
  }
18
23
 
19
24
  async function getCustomObjectById(schemaName: string, id: string) {
25
+ try {
20
26
  const response = await axiosAPI.request({
21
27
  method: 'get',
22
28
  url: `custom-entity/${schemaName}/${id}`,
23
29
  })
24
30
  return response.data;
31
+ } catch (e: any) {
32
+ throw new KonversiError(e);
33
+ }
25
34
  }
26
35
 
27
36
  async function updateCustomObject(schemaName: string, id: string, newData: any) {
37
+ try {
28
38
  const response = await axiosAPI.request({
29
39
  method: 'put',
30
40
  url: `custom-entity/${schemaName}/${id}`,
@@ -34,9 +44,13 @@ async function updateCustomObject(schemaName: string, id: string, newData: any)
34
44
  data: JSON.stringify(newData)
35
45
  })
36
46
  return response.data;
47
+ } catch (e: any) {
48
+ throw new KonversiError(e);
49
+ }
37
50
  }
38
51
 
39
52
  async function createCustomObject(schemaName: string, data: any) {
53
+ try {
40
54
  const response = await axiosAPI.request({
41
55
  method: 'post',
42
56
  url: `custom-entity/${schemaName}`,
@@ -44,50 +58,78 @@ async function createCustomObject(schemaName: string, data: any) {
44
58
  });
45
59
 
46
60
  return response.data;
61
+ } catch (e: any) {
62
+ throw new KonversiError(e);
63
+ }
47
64
  }
48
65
 
49
66
  async function deleteCustomObject(schemaName: string, id: string) {
67
+ try {
50
68
  const response = await axiosAPI.request({
51
69
  method: 'delete',
52
70
  maxBodyLength: Infinity,
53
71
  url: `custom-entity/${schemaName}/${id}`,
54
72
  })
55
73
  return response.data;
74
+ } catch (e: any) {
75
+ throw new KonversiError(e);
76
+ }
56
77
  }
57
78
 
58
79
 
59
80
  // CRUD Base Objects
60
81
  async function getAllObjects(entity: any, queryParams: any = {}) {
82
+ try {
61
83
  const response = await axiosAPI.get(`${entity}`, {
62
84
  params: queryParams
63
85
  })
64
86
  return response.data;
87
+ } catch (e: any) {
88
+ throw new KonversiError(e);
89
+ }
65
90
  }
66
91
 
67
92
  async function getObjectById(entity: any, id: string) {
93
+ try {
68
94
  const response = await axiosAPI.get(`${entity}/${id}`)
69
95
  return response.data;
96
+ } catch (e: any) {
97
+ throw new KonversiError(e);
98
+ }
70
99
  }
71
100
 
72
101
  async function updateObject(entity: any, id: string, newData: any) {
102
+ try {
73
103
  const response = await axiosAPI.put(`${entity}/${id}`, newData)
74
104
  return response.data;
105
+ } catch (e: any) {
106
+ throw new KonversiError(e);
107
+ }
75
108
  }
76
109
 
77
110
  async function createObject(entity: any, data: any) {
111
+ try {
78
112
  const response = await axiosAPI.post(`${entity}`, data)
79
113
 
80
114
  return response.data;
115
+ } catch (e: any) {
116
+ throw new KonversiError(e);
117
+ }
81
118
  }
82
119
 
83
120
  async function deleteObject(entity: any, id: string) {
121
+ try {
84
122
  const response = await axiosAPI.delete(`${entity}/${id}`)
85
123
 
86
124
  return response.data;
125
+ } catch (e: any) {
126
+ throw new KonversiError(e);
127
+ }
87
128
  }
88
129
 
89
130
 
90
131
  export async function runScript(scriptNameOrId: string, input: any, sync= false) {
132
+ try {
91
133
  if (sync) {
92
134
  const response = await axiosAPI.post(`/automation/script/${scriptNameOrId}/run?mode=sync`, {input})
93
135
  return response.data;
@@ -95,6 +137,9 @@ export async function runScript(scriptNameOrId: string, input: any, sync= false)
95
137
  const response = await axiosAPI.post(`/automation/script/${scriptNameOrId}/run`, {input})
96
138
 
97
139
  return response.data;
140
+ } catch (e: any) {
141
+ throw new KonversiError(e);
142
+ }
98
143
  }
99
144
 
100
145
  const konversiAPI = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konversi/konversi-client",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -1,6 +1,7 @@
1
1
  import K from '../index';
2
2
 
3
3
  async function main() {
4
+ console.log('Starting test...')
4
5
  let createdObject = await K.createCustomObject('ticket', {numEntries: 100, amount: 500000, code: "TICKET-123456"})
5
6
  console.log(`created object`, createdObject);
6
7