@konversi/konversi-client 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # Konversi Client
2
+
3
+ ## Automations Examples
4
+
5
+ ### Basic Automation Example
6
+ ```ts
7
+ import K from '@konversi/konversi-client';
8
+
9
+ export async function execute(input) {
10
+ console.log(input);
11
+ }
12
+ ```
13
+
14
+ ### Base Objects CRUD
15
+
16
+ ```ts
17
+ import K, { Entity } from '@konversi/konversi-client';
18
+
19
+ async function execute(input) {
20
+ let result = await k.createObject(Entity.SALES_ORDER, {})
21
+ console.log(result);
22
+
23
+ result = await k.getAllObjects(Entity.SALES_ORDER)
24
+ console.log(result);
25
+
26
+ result = await k.updateObject(Entity.SALES_ORDER, result[0].id, { memo: 'New memo' })
27
+ console.log(result);
28
+ }
29
+ ```
30
+
31
+ ### Custom Objects CRUD
32
+
33
+ ```ts
34
+ import K, { Entity } from '@konversi/konversi-client';
35
+
36
+ async function execute(input) {
37
+ let createdObject = await K.createCustomObject('ticket', {numEntries: 100, amount: 500000, code: "TICKET-123456"})
38
+ console.log(`created object`, createdObject);
39
+
40
+ let allObjects = await K.getAllCustomObjects('ticket');
41
+
42
+ console.log(`all objects`, allObjects);
43
+
44
+ let updateResult = await K.updateCustomObject('ticket', createdObject.id, {numEntries: 200});
45
+ console.log(`updated object`, updateResult);
46
+ }
47
+ ```
package/axiosAPI.ts CHANGED
@@ -1,23 +1,23 @@
1
- import axios from 'axios';
2
-
3
- const baseURL = 'https://us.api.konversi.net/api'
4
- const timeout = 30000
5
-
6
- const instance = axios.create({
7
- baseURL,
8
- timeout
9
- })
10
-
11
- export const setAuthToken = (token: string) => {
12
- instance.defaults.headers.common.authorization = `Bearer ${token}`
13
- }
14
-
15
- export const setCompanyId = (companyId: string) => {
16
- instance.defaults.headers.common['Company'] = companyId;
17
- }
18
-
19
- export const clearAuthToken = () => {
20
- instance.defaults.headers.common.authorization = ''
21
- }
22
-
1
+ import axios from 'axios';
2
+
3
+ const baseURL = 'https://us.api.konversi.net/api'
4
+ const timeout = 30000
5
+
6
+ const instance = axios.create({
7
+ baseURL,
8
+ timeout
9
+ })
10
+
11
+ export const setAuthToken = (token: string) => {
12
+ instance.defaults.headers.common.authorization = `Bearer ${token}`
13
+ }
14
+
15
+ export const setCompanyId = (companyId: string) => {
16
+ instance.defaults.headers.common['Company'] = companyId;
17
+ }
18
+
19
+ export const clearAuthToken = () => {
20
+ instance.defaults.headers.common.authorization = ''
21
+ }
22
+
23
23
  export default instance;
package/crudEndpoints.ts CHANGED
@@ -1,96 +1,96 @@
1
- export const COMPANY_PERMISSION = 'company-permission';
2
- export const COMPANY_OPTION = 'company-option';
3
- export const INVITATION = 'user/invitation';
4
-
5
- export const CUSTOMER = 'contact/customer';
6
-
7
- export const PRODUCT = 'product'
8
- export const PRODUCT_ITEM = 'product/product-item'
9
- export const PRODUCT_GROUP = 'product-group'
10
-
11
- export const PURCHASE_ORDER = 'order/purchase-order'
12
- export const PURCHASE_ORDER_LINE = 'order/purchase-order-line'
13
- export const QUOTE = 'order/quote'
14
- export const QUOTE_LINE = 'order/quote-line'
15
- export const SALES_ORDER = 'order/sales-order'
16
- export const SALES_ORDER_LINE = 'order/sales-order-line'
17
- export const RENTAL_ORDER = 'order/rental-order'
18
- export const RENTAL_ORDER_LINE = 'order/rental-order-line'
19
- export const SUPPLIER = 'contact/supplier'
20
- export const WAREHOUSE = 'warehouse'
21
-
22
- // Deliveries
23
- export const INCOMING_DELIVERY = 'delivery/incoming-delivery'
24
- export const INCOMING_DELIVERY_LINE = 'delivery/incoming-delivery-line'
25
- export const OUTGOING_DELIVERY = 'delivery/outgoing-delivery'
26
- export const OUTGOING_DELIVERY_LINE = 'delivery/outgoing-delivery-line'
27
- export const INTERNAL_DELIVERY = 'delivery/internal-delivery'
28
- export const INTERNAL_DELIVERY_LINE = 'delivery/internal-delivery-line'
29
-
30
- // Finance
31
- export const INVOICE = 'invoice'
32
- export const INVOICE_LINE = 'invoice/invoice-line'
33
- export const EXPENSE = 'expense'
34
- export const EXPENSE_LINE = 'expense/expense-line'
35
- export const PAYMENT = 'accounting/payment'
36
- export const INCOMING_PAYMENT_METHOD = 'accounting/incoming-payment-method'
37
- export const FIXED_ASSET = 'fixed-asset'
38
-
39
- // ECommerce
40
- export const STORE = 'store'
41
- export const STORE_PRODUCT = 'store/store-product'
42
- export const STORE_PRODUCT_GROUP = 'store/store-product-group'
43
-
44
- // Accounting
45
- export const ACCOUNT = 'accounting/account';
46
- export const JOURNAL_ENTRY = 'accounting/journal-entry';
47
- export const JOURNAL_ENTRY_LINE = 'accounting/journal-entry-line';
48
-
49
- // Manufacturing
50
- export const BILL_OF_MATERIALS = 'manufacturing/bill-of-materials'
51
- export const BOM_COMPONENT = 'manufacturing/bom-component'
52
- export const BOM_OPERATION = 'manufacturing/bom-operation'
53
- export const PRODUCTION_ORDER = 'manufacturing/production-order'
54
- export const PRODUCTION_ORDER_LINE = 'manufacturing/production-order-line'
55
-
56
- export const SUBSIDIARY = 'subsidiary'
57
-
58
- // HR
59
- export const EMPLOYEE = 'human-resources/employee'
60
- export const ATTENDANCE = 'human-resources/attendance'
61
-
62
- // Fleet Management
63
- export const VEHICLE = 'fleet/vehicle'
64
- export const DELIVERY_JOB = 'fleet/delivery-job'
65
-
66
- // Custom Objects
67
- export const CUSTOM_ENTITY_SCHEMA = 'custom-entity/schema'
68
- export const CUSTOM_ENTITY_OBJECT = 'custom-entity'; // Need to add schemaName after this
69
- export const CUSTOM_ENTITY_FIELD = 'custom-entity/field'; // Need to add schemaName after this
70
-
71
- // Automation
72
- export const AUTOMATION_JOB = 'automation/job'
73
- export const AUTOMATION_SCRIPT = 'automation/script'
74
-
75
- export const STOCK_ADJUSTMENT = 'stock-adjustment'
76
-
77
- export const PURCHASE_ORDER_APPROVER = 'approval/approver/purchase-order'
78
- export const SALES_ORDER_APPROVER = 'approval/approver/sales-order'
79
-
80
- // Document Generation
81
- export const CUSTOM_DOCUMENT = 'document-generator/custom-document';
82
-
83
- export const CUSTOM_FIELD = 'custom-field'
84
-
85
- export const AUDIT_LOG = 'audit-log'
86
-
87
- export const COMPANY_ALIAS = 'company-alias'
88
-
89
- export const PRINT_JOB = 'thermal-printer/print-job'
90
-
91
- export const WORK_ORDER = 'order/sales-order?type=WORK_ORDER';
92
-
93
- // TODO: Deprecate
94
- export const INCOMING_SHIPMENT = 'shipment/incoming-shipment'
95
- export const OUTGOING_SHIPMENT = 'shipment/outgoing-shipment'
1
+ export const COMPANY_PERMISSION = 'company-permission';
2
+ export const COMPANY_OPTION = 'company-option';
3
+ export const INVITATION = 'user/invitation';
4
+
5
+ export const CUSTOMER = 'contact/customer';
6
+
7
+ export const PRODUCT = 'product'
8
+ export const PRODUCT_ITEM = 'product/product-item'
9
+ export const PRODUCT_GROUP = 'product-group'
10
+
11
+ export const PURCHASE_ORDER = 'order/purchase-order'
12
+ export const PURCHASE_ORDER_LINE = 'order/purchase-order-line'
13
+ export const QUOTE = 'order/quote'
14
+ export const QUOTE_LINE = 'order/quote-line'
15
+ export const SALES_ORDER = 'order/sales-order'
16
+ export const SALES_ORDER_LINE = 'order/sales-order-line'
17
+ export const RENTAL_ORDER = 'order/rental-order'
18
+ export const RENTAL_ORDER_LINE = 'order/rental-order-line'
19
+ export const SUPPLIER = 'contact/supplier'
20
+ export const WAREHOUSE = 'warehouse'
21
+
22
+ // Deliveries
23
+ export const INCOMING_DELIVERY = 'delivery/incoming-delivery'
24
+ export const INCOMING_DELIVERY_LINE = 'delivery/incoming-delivery-line'
25
+ export const OUTGOING_DELIVERY = 'delivery/outgoing-delivery'
26
+ export const OUTGOING_DELIVERY_LINE = 'delivery/outgoing-delivery-line'
27
+ export const INTERNAL_DELIVERY = 'delivery/internal-delivery'
28
+ export const INTERNAL_DELIVERY_LINE = 'delivery/internal-delivery-line'
29
+
30
+ // Finance
31
+ export const INVOICE = 'invoice'
32
+ export const INVOICE_LINE = 'invoice/invoice-line'
33
+ export const EXPENSE = 'expense'
34
+ export const EXPENSE_LINE = 'expense/expense-line'
35
+ export const PAYMENT = 'accounting/payment'
36
+ export const INCOMING_PAYMENT_METHOD = 'accounting/incoming-payment-method'
37
+ export const FIXED_ASSET = 'fixed-asset'
38
+
39
+ // ECommerce
40
+ export const STORE = 'store'
41
+ export const STORE_PRODUCT = 'store/store-product'
42
+ export const STORE_PRODUCT_GROUP = 'store/store-product-group'
43
+
44
+ // Accounting
45
+ export const ACCOUNT = 'accounting/account';
46
+ export const JOURNAL_ENTRY = 'accounting/journal-entry';
47
+ export const JOURNAL_ENTRY_LINE = 'accounting/journal-entry-line';
48
+
49
+ // Manufacturing
50
+ export const BILL_OF_MATERIALS = 'manufacturing/bill-of-materials'
51
+ export const BOM_COMPONENT = 'manufacturing/bom-component'
52
+ export const BOM_OPERATION = 'manufacturing/bom-operation'
53
+ export const PRODUCTION_ORDER = 'manufacturing/production-order'
54
+ export const PRODUCTION_ORDER_LINE = 'manufacturing/production-order-line'
55
+
56
+ export const SUBSIDIARY = 'subsidiary'
57
+
58
+ // HR
59
+ export const EMPLOYEE = 'human-resources/employee'
60
+ export const ATTENDANCE = 'human-resources/attendance'
61
+
62
+ // Fleet Management
63
+ export const VEHICLE = 'fleet/vehicle'
64
+ export const DELIVERY_JOB = 'fleet/delivery-job'
65
+
66
+ // Custom Objects
67
+ export const CUSTOM_ENTITY_SCHEMA = 'custom-entity/schema'
68
+ export const CUSTOM_ENTITY_OBJECT = 'custom-entity'; // Need to add schemaName after this
69
+ export const CUSTOM_ENTITY_FIELD = 'custom-entity/field'; // Need to add schemaName after this
70
+
71
+ // Automation
72
+ export const AUTOMATION_JOB = 'automation/job'
73
+ export const AUTOMATION_SCRIPT = 'automation/script'
74
+
75
+ export const STOCK_ADJUSTMENT = 'stock-adjustment'
76
+
77
+ export const PURCHASE_ORDER_APPROVER = 'approval/approver/purchase-order'
78
+ export const SALES_ORDER_APPROVER = 'approval/approver/sales-order'
79
+
80
+ // Document Generation
81
+ export const CUSTOM_DOCUMENT = 'document-generator/custom-document';
82
+
83
+ export const CUSTOM_FIELD = 'custom-field'
84
+
85
+ export const AUDIT_LOG = 'audit-log'
86
+
87
+ export const COMPANY_ALIAS = 'company-alias'
88
+
89
+ export const PRINT_JOB = 'thermal-printer/print-job'
90
+
91
+ export const WORK_ORDER = 'order/sales-order?type=WORK_ORDER';
92
+
93
+ // TODO: Deprecate
94
+ export const INCOMING_SHIPMENT = 'shipment/incoming-shipment'
95
+ export const OUTGOING_SHIPMENT = 'shipment/outgoing-shipment'
96
96
  ///
package/dist/index.d.mts CHANGED
@@ -1,3 +1,5 @@
1
+ import * as axios from 'axios';
2
+
1
3
  declare const COMPANY_PERMISSION = "company-permission";
2
4
  declare const COMPANY_OPTION = "company-option";
3
5
  declare const INVITATION = "user/invitation";
@@ -127,6 +129,11 @@ declare namespace crudEndpoints {
127
129
  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_JOURNAL_ENTRY as JOURNAL_ENTRY, crudEndpoints_JOURNAL_ENTRY_LINE as JOURNAL_ENTRY_LINE, 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_STOCK_ADJUSTMENT as STOCK_ADJUSTMENT, crudEndpoints_STORE as STORE, crudEndpoints_STORE_PRODUCT as STORE_PRODUCT, crudEndpoints_STORE_PRODUCT_GROUP as STORE_PRODUCT_GROUP, crudEndpoints_SUBSIDIARY as SUBSIDIARY, crudEndpoints_SUPPLIER as SUPPLIER, crudEndpoints_VEHICLE as VEHICLE, crudEndpoints_WAREHOUSE as WAREHOUSE, crudEndpoints_WORK_ORDER as WORK_ORDER };
128
130
  }
129
131
 
132
+ declare function getAllCustomObjects(schemaName: string, queryParams?: any): Promise<any>;
133
+ declare function getCustomObjectById(schemaName: string, id: string): Promise<any>;
134
+ declare function updateCustomObject(schemaName: string, id: string, newData: any): Promise<any>;
135
+ declare function createCustomObject(schemaName: string, data: any): Promise<any>;
136
+ declare function deleteCustomObject(schemaName: string, id: string): Promise<any>;
130
137
  declare function getAllObjects(entity: any, queryParams?: any): Promise<any>;
131
138
  declare function getObjectById(entity: any, id: string): Promise<any>;
132
139
  declare function updateObject(entity: any, id: string, newData: any): Promise<any>;
@@ -135,11 +142,19 @@ declare function deleteObject(entity: any, id: string): Promise<any>;
135
142
  declare const konversiAPI: {
136
143
  setToken: (token: string) => void;
137
144
  setCompanyId: (companyId: string) => void;
145
+ getAllCustomObjects: typeof getAllCustomObjects;
146
+ getCustomObjectById: typeof getCustomObjectById;
147
+ updateCustomObject: typeof updateCustomObject;
148
+ deleteCustomObject: typeof deleteCustomObject;
149
+ createCustomObject: typeof createCustomObject;
138
150
  getAllObjects: typeof getAllObjects;
139
151
  getObjectById: typeof getObjectById;
140
152
  updateObject: typeof updateObject;
141
153
  createObject: typeof createObject;
142
154
  deleteObject: typeof deleteObject;
155
+ baseUrl: string | undefined;
156
+ token: string;
157
+ companyId: axios.AxiosHeaderValue | undefined;
143
158
  };
144
159
 
145
160
  declare const Entity: typeof crudEndpoints;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import * as axios from 'axios';
2
+
1
3
  declare const COMPANY_PERMISSION = "company-permission";
2
4
  declare const COMPANY_OPTION = "company-option";
3
5
  declare const INVITATION = "user/invitation";
@@ -127,6 +129,11 @@ declare namespace crudEndpoints {
127
129
  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_JOURNAL_ENTRY as JOURNAL_ENTRY, crudEndpoints_JOURNAL_ENTRY_LINE as JOURNAL_ENTRY_LINE, 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_STOCK_ADJUSTMENT as STOCK_ADJUSTMENT, crudEndpoints_STORE as STORE, crudEndpoints_STORE_PRODUCT as STORE_PRODUCT, crudEndpoints_STORE_PRODUCT_GROUP as STORE_PRODUCT_GROUP, crudEndpoints_SUBSIDIARY as SUBSIDIARY, crudEndpoints_SUPPLIER as SUPPLIER, crudEndpoints_VEHICLE as VEHICLE, crudEndpoints_WAREHOUSE as WAREHOUSE, crudEndpoints_WORK_ORDER as WORK_ORDER };
128
130
  }
129
131
 
132
+ declare function getAllCustomObjects(schemaName: string, queryParams?: any): Promise<any>;
133
+ declare function getCustomObjectById(schemaName: string, id: string): Promise<any>;
134
+ declare function updateCustomObject(schemaName: string, id: string, newData: any): Promise<any>;
135
+ declare function createCustomObject(schemaName: string, data: any): Promise<any>;
136
+ declare function deleteCustomObject(schemaName: string, id: string): Promise<any>;
130
137
  declare function getAllObjects(entity: any, queryParams?: any): Promise<any>;
131
138
  declare function getObjectById(entity: any, id: string): Promise<any>;
132
139
  declare function updateObject(entity: any, id: string, newData: any): Promise<any>;
@@ -135,11 +142,19 @@ declare function deleteObject(entity: any, id: string): Promise<any>;
135
142
  declare const konversiAPI: {
136
143
  setToken: (token: string) => void;
137
144
  setCompanyId: (companyId: string) => void;
145
+ getAllCustomObjects: typeof getAllCustomObjects;
146
+ getCustomObjectById: typeof getCustomObjectById;
147
+ updateCustomObject: typeof updateCustomObject;
148
+ deleteCustomObject: typeof deleteCustomObject;
149
+ createCustomObject: typeof createCustomObject;
138
150
  getAllObjects: typeof getAllObjects;
139
151
  getObjectById: typeof getObjectById;
140
152
  updateObject: typeof updateObject;
141
153
  createObject: typeof createObject;
142
154
  deleteObject: typeof deleteObject;
155
+ baseUrl: string | undefined;
156
+ token: string;
157
+ companyId: axios.AxiosHeaderValue | undefined;
143
158
  };
144
159
 
145
160
  declare const Entity: typeof crudEndpoints;
package/dist/index.js CHANGED
@@ -201,6 +201,54 @@ var INCOMING_SHIPMENT = "shipment/incoming-shipment";
201
201
  var OUTGOING_SHIPMENT = "shipment/outgoing-shipment";
202
202
 
203
203
  // index.ts
204
+ function getAllCustomObjects(_0) {
205
+ return __async(this, arguments, function* (schemaName, queryParams = {}) {
206
+ const response = yield axiosAPI_default.request({
207
+ method: "get",
208
+ url: `custom-entity/${schemaName}`
209
+ });
210
+ return response.data;
211
+ });
212
+ }
213
+ function getCustomObjectById(schemaName, id) {
214
+ return __async(this, null, function* () {
215
+ const response = yield axiosAPI_default.request({
216
+ method: "get",
217
+ url: `custom-entity/${schemaName}/${id}`
218
+ });
219
+ return response.data;
220
+ });
221
+ }
222
+ function updateCustomObject(schemaName, id, newData) {
223
+ return __async(this, null, function* () {
224
+ const response = yield axiosAPI_default.request({
225
+ method: "put",
226
+ url: `custom-entity/${schemaName}/${id}`,
227
+ data: newData
228
+ });
229
+ return response.data;
230
+ });
231
+ }
232
+ function createCustomObject(schemaName, data) {
233
+ return __async(this, null, function* () {
234
+ const response = yield axiosAPI_default.request({
235
+ method: "post",
236
+ url: `custom-entity/${schemaName}`,
237
+ data
238
+ });
239
+ return response.data;
240
+ });
241
+ }
242
+ function deleteCustomObject(schemaName, id) {
243
+ return __async(this, null, function* () {
244
+ const response = yield axiosAPI_default.request({
245
+ method: "delete",
246
+ maxBodyLength: Infinity,
247
+ url: `custom-entity/${schemaName}/${id}`
248
+ });
249
+ return response.data;
250
+ });
251
+ }
204
252
  function getAllObjects(_0) {
205
253
  return __async(this, arguments, function* (entity, queryParams = {}) {
206
254
  const response = yield axiosAPI_default.get(`${entity}`, {
@@ -233,14 +281,23 @@ function deleteObject(entity, id) {
233
281
  return response.data;
234
282
  });
235
283
  }
284
+ var _a;
236
285
  var konversiAPI = {
237
286
  setToken: setAuthToken,
238
287
  setCompanyId,
288
+ getAllCustomObjects,
289
+ getCustomObjectById,
290
+ updateCustomObject,
291
+ deleteCustomObject,
292
+ createCustomObject,
239
293
  getAllObjects,
240
294
  getObjectById,
241
295
  updateObject,
242
296
  createObject,
243
- deleteObject
297
+ deleteObject,
298
+ baseUrl: axiosAPI_default.defaults.baseURL,
299
+ token: ((_a = axiosAPI_default.defaults.headers.common["Authorization"]) == null ? void 0 : _a.toString().split(" ")[1]) || "",
300
+ companyId: axiosAPI_default.defaults.headers.common["Company"]
244
301
  };
245
302
  var konversi_client_default = konversiAPI;
246
303
  var Entity = crudEndpoints_exports;
package/dist/index.mjs CHANGED
@@ -170,6 +170,54 @@ var INCOMING_SHIPMENT = "shipment/incoming-shipment";
170
170
  var OUTGOING_SHIPMENT = "shipment/outgoing-shipment";
171
171
 
172
172
  // index.ts
173
+ function getAllCustomObjects(_0) {
174
+ return __async(this, arguments, function* (schemaName, queryParams = {}) {
175
+ const response = yield axiosAPI_default.request({
176
+ method: "get",
177
+ url: `custom-entity/${schemaName}`
178
+ });
179
+ return response.data;
180
+ });
181
+ }
182
+ function getCustomObjectById(schemaName, id) {
183
+ return __async(this, null, function* () {
184
+ const response = yield axiosAPI_default.request({
185
+ method: "get",
186
+ url: `custom-entity/${schemaName}/${id}`
187
+ });
188
+ return response.data;
189
+ });
190
+ }
191
+ function updateCustomObject(schemaName, id, newData) {
192
+ return __async(this, null, function* () {
193
+ const response = yield axiosAPI_default.request({
194
+ method: "put",
195
+ url: `custom-entity/${schemaName}/${id}`,
196
+ data: newData
197
+ });
198
+ return response.data;
199
+ });
200
+ }
201
+ function createCustomObject(schemaName, data) {
202
+ return __async(this, null, function* () {
203
+ const response = yield axiosAPI_default.request({
204
+ method: "post",
205
+ url: `custom-entity/${schemaName}`,
206
+ data
207
+ });
208
+ return response.data;
209
+ });
210
+ }
211
+ function deleteCustomObject(schemaName, id) {
212
+ return __async(this, null, function* () {
213
+ const response = yield axiosAPI_default.request({
214
+ method: "delete",
215
+ maxBodyLength: Infinity,
216
+ url: `custom-entity/${schemaName}/${id}`
217
+ });
218
+ return response.data;
219
+ });
220
+ }
173
221
  function getAllObjects(_0) {
174
222
  return __async(this, arguments, function* (entity, queryParams = {}) {
175
223
  const response = yield axiosAPI_default.get(`${entity}`, {
@@ -202,14 +250,23 @@ function deleteObject(entity, id) {
202
250
  return response.data;
203
251
  });
204
252
  }
253
+ var _a;
205
254
  var konversiAPI = {
206
255
  setToken: setAuthToken,
207
256
  setCompanyId,
257
+ getAllCustomObjects,
258
+ getCustomObjectById,
259
+ updateCustomObject,
260
+ deleteCustomObject,
261
+ createCustomObject,
208
262
  getAllObjects,
209
263
  getObjectById,
210
264
  updateObject,
211
265
  createObject,
212
- deleteObject
266
+ deleteObject,
267
+ baseUrl: axiosAPI_default.defaults.baseURL,
268
+ token: ((_a = axiosAPI_default.defaults.headers.common["Authorization"]) == null ? void 0 : _a.toString().split(" ")[1]) || "",
269
+ companyId: axiosAPI_default.defaults.headers.common["Company"]
213
270
  };
214
271
  var konversi_client_default = konversiAPI;
215
272
  var Entity = crudEndpoints_exports;
package/index.ts CHANGED
@@ -1,46 +1,103 @@
1
- import axiosAPI, { setAuthToken, setCompanyId } from "./axiosAPI";
2
-
3
- import * as crudEndpoints from "./crudEndpoints";
4
-
5
- async function getAllObjects(entity: any, queryParams: any = {}) {
6
- const response = await axiosAPI.get(`${entity}`, {
7
- params: queryParams
8
- })
9
- return response.data;
10
- }
11
-
12
- async function getObjectById(entity: any, id: string) {
13
- const response = await axiosAPI.get(`${entity}/${id}`)
14
- return response.data;
15
- }
16
-
17
- async function updateObject(entity: any, id: string, newData: any) {
18
- const response = await axiosAPI.put(`${entity}/${id}`, newData)
19
- return response.data;
20
- }
21
-
22
- async function createObject(entity: any, data: any) {
23
- const response = await axiosAPI.post(`${entity}`, data)
24
-
25
- return response.data;
26
- }
27
-
28
- async function deleteObject(entity: any, id: string) {
29
- const response = await axiosAPI.delete(`${entity}/${id}`)
30
-
31
- return response.data;
32
- }
33
-
34
- const konversiAPI = {
35
- setToken: setAuthToken,
36
- setCompanyId,
37
- getAllObjects,
38
- getObjectById,
39
- updateObject,
40
- createObject,
41
- deleteObject
42
- }
43
-
44
- export default konversiAPI;
45
-
1
+ import axiosAPI, { setAuthToken, setCompanyId } from "./axiosAPI";
2
+
3
+ import * as crudEndpoints from "./crudEndpoints";
4
+
5
+ async function getAllCustomObjects(schemaName: string, queryParams: any = {}) {
6
+ const response = await axiosAPI.request({
7
+ method: 'get',
8
+ url: `custom-entity/${schemaName}`,
9
+ })
10
+ return response.data;
11
+ }
12
+
13
+ async function getCustomObjectById(schemaName: string, id: string) {
14
+ const response = await axiosAPI.request({
15
+ method: 'get',
16
+ url: `custom-entity/${schemaName}/${id}`,
17
+ })
18
+ return response.data;
19
+ }
20
+
21
+ async function updateCustomObject(schemaName: string, id: string, newData: any) {
22
+ const response = await axiosAPI.request({
23
+ method: 'put',
24
+ url: `custom-entity/${schemaName}/${id}`,
25
+ data: newData
26
+ })
27
+ return response.data;
28
+ }
29
+
30
+ async function createCustomObject(schemaName: string, data: any) {
31
+ const response = await axiosAPI.request({
32
+ method: 'post',
33
+ url: `custom-entity/${schemaName}`,
34
+ data: data
35
+ });
36
+
37
+ return response.data;
38
+ }
39
+
40
+ async function deleteCustomObject(schemaName: string, id: string) {
41
+ const response = await axiosAPI.request({
42
+ method: 'delete',
43
+ maxBodyLength: Infinity,
44
+ url: `custom-entity/${schemaName}/${id}`,
45
+ })
46
+ return response.data;
47
+ }
48
+
49
+
50
+ // CRUD Base Objects
51
+ async function getAllObjects(entity: any, queryParams: any = {}) {
52
+ const response = await axiosAPI.get(`${entity}`, {
53
+ params: queryParams
54
+ })
55
+ return response.data;
56
+ }
57
+
58
+ async function getObjectById(entity: any, id: string) {
59
+ const response = await axiosAPI.get(`${entity}/${id}`)
60
+ return response.data;
61
+ }
62
+
63
+ async function updateObject(entity: any, id: string, newData: any) {
64
+ const response = await axiosAPI.put(`${entity}/${id}`, newData)
65
+ return response.data;
66
+ }
67
+
68
+ async function createObject(entity: any, data: any) {
69
+ const response = await axiosAPI.post(`${entity}`, data)
70
+
71
+ return response.data;
72
+ }
73
+
74
+ async function deleteObject(entity: any, id: string) {
75
+ const response = await axiosAPI.delete(`${entity}/${id}`)
76
+
77
+ return response.data;
78
+ }
79
+
80
+ const konversiAPI = {
81
+ setToken: setAuthToken,
82
+ setCompanyId,
83
+
84
+ getAllCustomObjects,
85
+ getCustomObjectById,
86
+ updateCustomObject,
87
+ deleteCustomObject,
88
+ createCustomObject,
89
+
90
+ getAllObjects,
91
+ getObjectById,
92
+ updateObject,
93
+ createObject,
94
+ deleteObject,
95
+
96
+ baseUrl: axiosAPI.defaults.baseURL,
97
+ token: axiosAPI.defaults.headers.common['Authorization']?.toString().split(' ')[1] || '',
98
+ companyId: axiosAPI.defaults.headers.common['Company'],
99
+ }
100
+
101
+ export default konversiAPI;
102
+
46
103
  export const Entity = crudEndpoints;
package/package.json CHANGED
@@ -1,14 +1,9 @@
1
1
  {
2
2
  "name": "@konversi/konversi-client",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
7
- "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1",
9
- "build": "tsup index.ts --format cjs,esm --dts",
10
- "lint": "tsc"
11
- },
12
7
  "keywords": [],
13
8
  "author": "",
14
9
  "license": "ISC",
@@ -20,5 +15,10 @@
20
15
  "devDependencies": {
21
16
  "tsup": "^8.2.4",
22
17
  "typescript": "^5.4.5"
18
+ },
19
+ "scripts": {
20
+ "test": "echo \"Error: no test specified\" && exit 1",
21
+ "build": "tsup index.ts --format cjs,esm --dts",
22
+ "lint": "tsc"
23
23
  }
24
- }
24
+ }
@@ -0,0 +1,20 @@
1
+ import K from '../index';
2
+
3
+ async function main() {
4
+ let createdObject = await K.createCustomObject('ticket', {numEntries: 100, amount: 500000, code: "TICKET-123456"})
5
+ console.log(`created object`, createdObject);
6
+
7
+ let allObjects = await K.getAllCustomObjects('ticket');
8
+
9
+ console.log(`all objects`, allObjects);
10
+
11
+ let updateResult = await K.updateCustomObject('ticket', createdObject.id, {numEntries: 200});
12
+ console.log(`updated object`, updateResult);
13
+
14
+ // let deleteResult = await K.deleteCustomObject('ticket', createdObject.id);
15
+ // console.log(`deleted object`, deleteResult);
16
+ }
17
+
18
+
19
+
20
+ main();
@@ -1,5 +1,5 @@
1
- import { CUSTOMER } from "../crudEndpoints";
2
- import K from "../index";
3
-
4
-
1
+ import { CUSTOMER } from "../crudEndpoints";
2
+ import K from "../index";
3
+
4
+
5
5
  K.createObject(CUSTOMER, {});
package/tsconfig.json CHANGED
@@ -1,109 +1,109 @@
1
- {
2
- "compilerOptions": {
3
- /* Visit https://aka.ms/tsconfig to read more about this file */
4
-
5
- /* Projects */
6
- // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
- // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
- // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
- // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
- // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
- // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
-
13
- /* Language and Environment */
14
- "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
- // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
- // "jsx": "preserve", /* Specify what JSX code is generated. */
17
- // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
18
- // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
- // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20
- // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
- // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22
- // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23
- // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
- // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
- // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
-
27
- /* Modules */
28
- "module": "commonjs", /* Specify what module code is generated. */
29
- // "rootDir": "./", /* Specify the root folder within your source files. */
30
- // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
31
- // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
- // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
- // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
- // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
35
- // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
- // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38
- // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
39
- // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
40
- // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
41
- // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
42
- // "resolveJsonModule": true, /* Enable importing .json files. */
43
- // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
44
- // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
45
-
46
- /* JavaScript Support */
47
- // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
48
- // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
49
- // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
50
-
51
- /* Emit */
52
- // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
53
- // "declarationMap": true, /* Create sourcemaps for d.ts files. */
54
- // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
55
- // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
56
- // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
57
- // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
58
- // "outDir": "./", /* Specify an output folder for all emitted files. */
59
- // "removeComments": true, /* Disable emitting comments. */
60
- "noEmit": true, /* Disable emitting files from a compilation. */
61
- // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
62
- // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
63
- // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
64
- // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
65
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
66
- // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
67
- // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
68
- // "newLine": "crlf", /* Set the newline character for emitting files. */
69
- // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
70
- // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
71
- // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
72
- // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
73
- // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
74
- // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
75
-
76
- /* Interop Constraints */
77
- // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
78
- // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
79
- // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
80
- "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
81
- // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
82
- "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
83
-
84
- /* Type Checking */
85
- "strict": true, /* Enable all strict type-checking options. */
86
- // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
87
- // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
88
- // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
89
- // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
90
- // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
91
- // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
92
- // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
93
- // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
94
- // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
95
- // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
96
- // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
97
- // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
98
- // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
99
- "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
100
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
101
- // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
102
- // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
103
- // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
104
-
105
- /* Completeness */
106
- // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
107
- "skipLibCheck": true /* Skip type checking all .d.ts files. */
108
- }
109
- }
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig to read more about this file */
4
+
5
+ /* Projects */
6
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
+
13
+ /* Language and Environment */
14
+ "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
+ // "jsx": "preserve", /* Specify what JSX code is generated. */
17
+ // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
18
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
+
27
+ /* Modules */
28
+ "module": "commonjs", /* Specify what module code is generated. */
29
+ // "rootDir": "./", /* Specify the root folder within your source files. */
30
+ // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
31
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
35
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38
+ // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
39
+ // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
40
+ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
41
+ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
42
+ // "resolveJsonModule": true, /* Enable importing .json files. */
43
+ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
44
+ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
45
+
46
+ /* JavaScript Support */
47
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
48
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
49
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
50
+
51
+ /* Emit */
52
+ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
53
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
54
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
55
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
56
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
57
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
58
+ // "outDir": "./", /* Specify an output folder for all emitted files. */
59
+ // "removeComments": true, /* Disable emitting comments. */
60
+ "noEmit": true, /* Disable emitting files from a compilation. */
61
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
62
+ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
63
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
64
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
65
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
66
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
67
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
68
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
69
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
70
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
71
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
72
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
73
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
74
+ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
75
+
76
+ /* Interop Constraints */
77
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
78
+ // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
79
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
80
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
81
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
82
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
83
+
84
+ /* Type Checking */
85
+ "strict": true, /* Enable all strict type-checking options. */
86
+ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
87
+ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
88
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
89
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
90
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
91
+ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
92
+ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
93
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
94
+ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
95
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
96
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
97
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
98
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
99
+ "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
100
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
101
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
102
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
103
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
104
+
105
+ /* Completeness */
106
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
107
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
108
+ }
109
+ }