@konversi/konversi-client 1.0.9 → 1.0.11
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/axiosAPI.ts +22 -22
- package/crudEndpoints.ts +95 -95
- package/dist/axiosAPI.d.ts +5 -0
- package/dist/axiosAPI.js +26 -0
- package/dist/crudEndpoints.d.ts +48 -0
- package/dist/crudEndpoints.js +59 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +77 -0
- package/index.ts +41 -41
- package/package.json +21 -20
- package/test/getCustomer.ts +5 -0
- package/tsconfig.json +14 -14
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/axiosAPI.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.clearAuthToken = exports.setCompanyId = exports.setAuthToken = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const baseURL = 'https://us.api.konversi.net/api';
|
|
9
|
+
const timeout = 30000;
|
|
10
|
+
const instance = axios_1.default.create({
|
|
11
|
+
baseURL,
|
|
12
|
+
timeout
|
|
13
|
+
});
|
|
14
|
+
const setAuthToken = (token) => {
|
|
15
|
+
instance.defaults.headers.common.authorization = `Bearer ${token}`;
|
|
16
|
+
};
|
|
17
|
+
exports.setAuthToken = setAuthToken;
|
|
18
|
+
const setCompanyId = (companyId) => {
|
|
19
|
+
instance.defaults.headers.common['Company'] = companyId;
|
|
20
|
+
};
|
|
21
|
+
exports.setCompanyId = setCompanyId;
|
|
22
|
+
const clearAuthToken = () => {
|
|
23
|
+
instance.defaults.headers.common.authorization = '';
|
|
24
|
+
};
|
|
25
|
+
exports.clearAuthToken = clearAuthToken;
|
|
26
|
+
exports.default = instance;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export declare const COMPANY_PERMISSION = "company-permission";
|
|
2
|
+
export declare const COMPANY_OPTION = "company-option";
|
|
3
|
+
export declare const INVITATION = "user/invitation";
|
|
4
|
+
export declare const CUSTOMER = "contact/customer";
|
|
5
|
+
export declare const PRODUCT = "product";
|
|
6
|
+
export declare const PRODUCT_ITEM = "product/product-item";
|
|
7
|
+
export declare const PRODUCT_GROUP = "product-group";
|
|
8
|
+
export declare const PURCHASE_ORDER = "order/purchase-order";
|
|
9
|
+
export declare const PURCHASE_ORDER_LINE = "order/purchase-order-line";
|
|
10
|
+
export declare const QUOTE = "order/quote";
|
|
11
|
+
export declare const QUOTE_LINE = "order/quote-line";
|
|
12
|
+
export declare const SALES_ORDER = "order/sales-order";
|
|
13
|
+
export declare const SALES_ORDER_LINE = "order/sales-order-line";
|
|
14
|
+
export declare const RENTAL_ORDER = "order/rental-order";
|
|
15
|
+
export declare const RENTAL_ORDER_LINE = "order/rental-order-line";
|
|
16
|
+
export declare const SUPPLIER = "contact/supplier";
|
|
17
|
+
export declare const WAREHOUSE = "warehouse";
|
|
18
|
+
export declare const INCOMING_DELIVERY = "delivery/incoming-delivery";
|
|
19
|
+
export declare const INCOMING_DELIVERY_LINE = "delivery/incoming-delivery-line";
|
|
20
|
+
export declare const OUTGOING_DELIVERY = "delivery/outgoing-delivery";
|
|
21
|
+
export declare const OUTGOING_DELIVERY_LINE = "delivery/outgoing-delivery-line";
|
|
22
|
+
export declare const INTERNAL_DELIVERY = "delivery/internal-delivery";
|
|
23
|
+
export declare const INTERNAL_DELIVERY_LINE = "delivery/internal-delivery-line";
|
|
24
|
+
export declare const INVOICE = "invoice";
|
|
25
|
+
export declare const INVOICE_LINE = "invoice/invoice-line";
|
|
26
|
+
export declare const PAYMENT = "accounting/payment";
|
|
27
|
+
export declare const INCOMING_PAYMENT_METHOD = "accounting/incoming-payment-method";
|
|
28
|
+
export declare const FIXED_ASSET = "fixed-asset";
|
|
29
|
+
export declare const STORE = "store";
|
|
30
|
+
export declare const STORE_PRODUCT = "store/store-product";
|
|
31
|
+
export declare const STORE_PRODUCT_GROUP = "store/store-product-group";
|
|
32
|
+
export declare const ACCOUNT = "accounting/account";
|
|
33
|
+
export declare const JOURNAL_ENTRY = "accounting/journal-entry";
|
|
34
|
+
export declare const JOURNAL_ENTRY_LINE = "accounting/journal-entry-line";
|
|
35
|
+
export declare const BILL_OF_MATERIALS = "manufacturing/bill-of-materials";
|
|
36
|
+
export declare const BOM_COMPONENT = "manufacturing/bom-component";
|
|
37
|
+
export declare const PRODUCTION_ORDER = "manufacturing/production-order";
|
|
38
|
+
export declare const PRODUCTION_ORDER_LINE = "manufacturing/production-order-line";
|
|
39
|
+
export declare const SUBSIDIARY = "subsidiary";
|
|
40
|
+
export declare const EMPLOYEE = "human-resources/employee";
|
|
41
|
+
export declare const ATTENDANCE = "human-resources/attendance";
|
|
42
|
+
export declare const INCOMING_SHIPMENT = "shipment/incoming-shipment";
|
|
43
|
+
export declare const OUTGOING_SHIPMENT = "shipment/outgoing-shipment";
|
|
44
|
+
export declare const STOCK_ADJUSTMENT = "stock-adjustment";
|
|
45
|
+
export declare const PURCHASE_ORDER_APPROVER = "approval/approver/purchase-order";
|
|
46
|
+
export declare const SALES_ORDER_APPROVER = "approval/approver/sales-order";
|
|
47
|
+
export declare const CUSTOM_FIELD = "custom-field";
|
|
48
|
+
export declare const AUDIT_LOG = "audit-log";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AUDIT_LOG = exports.CUSTOM_FIELD = exports.SALES_ORDER_APPROVER = exports.PURCHASE_ORDER_APPROVER = exports.STOCK_ADJUSTMENT = exports.OUTGOING_SHIPMENT = exports.INCOMING_SHIPMENT = exports.ATTENDANCE = exports.EMPLOYEE = exports.SUBSIDIARY = exports.PRODUCTION_ORDER_LINE = exports.PRODUCTION_ORDER = exports.BOM_COMPONENT = exports.BILL_OF_MATERIALS = exports.JOURNAL_ENTRY_LINE = exports.JOURNAL_ENTRY = exports.ACCOUNT = exports.STORE_PRODUCT_GROUP = exports.STORE_PRODUCT = exports.STORE = exports.FIXED_ASSET = exports.INCOMING_PAYMENT_METHOD = exports.PAYMENT = exports.INVOICE_LINE = exports.INVOICE = exports.INTERNAL_DELIVERY_LINE = exports.INTERNAL_DELIVERY = exports.OUTGOING_DELIVERY_LINE = exports.OUTGOING_DELIVERY = exports.INCOMING_DELIVERY_LINE = exports.INCOMING_DELIVERY = exports.WAREHOUSE = exports.SUPPLIER = exports.RENTAL_ORDER_LINE = exports.RENTAL_ORDER = exports.SALES_ORDER_LINE = exports.SALES_ORDER = exports.QUOTE_LINE = exports.QUOTE = exports.PURCHASE_ORDER_LINE = exports.PURCHASE_ORDER = exports.PRODUCT_GROUP = exports.PRODUCT_ITEM = exports.PRODUCT = exports.CUSTOMER = exports.INVITATION = exports.COMPANY_OPTION = exports.COMPANY_PERMISSION = void 0;
|
|
4
|
+
exports.COMPANY_PERMISSION = 'company-permission';
|
|
5
|
+
exports.COMPANY_OPTION = 'company-option';
|
|
6
|
+
exports.INVITATION = 'user/invitation';
|
|
7
|
+
exports.CUSTOMER = 'contact/customer';
|
|
8
|
+
exports.PRODUCT = 'product';
|
|
9
|
+
exports.PRODUCT_ITEM = 'product/product-item';
|
|
10
|
+
exports.PRODUCT_GROUP = 'product-group';
|
|
11
|
+
exports.PURCHASE_ORDER = 'order/purchase-order';
|
|
12
|
+
exports.PURCHASE_ORDER_LINE = 'order/purchase-order-line';
|
|
13
|
+
exports.QUOTE = 'order/quote';
|
|
14
|
+
exports.QUOTE_LINE = 'order/quote-line';
|
|
15
|
+
exports.SALES_ORDER = 'order/sales-order';
|
|
16
|
+
exports.SALES_ORDER_LINE = 'order/sales-order-line';
|
|
17
|
+
exports.RENTAL_ORDER = 'order/rental-order';
|
|
18
|
+
exports.RENTAL_ORDER_LINE = 'order/rental-order-line';
|
|
19
|
+
exports.SUPPLIER = 'contact/supplier';
|
|
20
|
+
exports.WAREHOUSE = 'warehouse';
|
|
21
|
+
// Deliveries
|
|
22
|
+
exports.INCOMING_DELIVERY = 'delivery/incoming-delivery';
|
|
23
|
+
exports.INCOMING_DELIVERY_LINE = 'delivery/incoming-delivery-line';
|
|
24
|
+
exports.OUTGOING_DELIVERY = 'delivery/outgoing-delivery';
|
|
25
|
+
exports.OUTGOING_DELIVERY_LINE = 'delivery/outgoing-delivery-line';
|
|
26
|
+
exports.INTERNAL_DELIVERY = 'delivery/internal-delivery';
|
|
27
|
+
exports.INTERNAL_DELIVERY_LINE = 'delivery/internal-delivery-line';
|
|
28
|
+
// Finance
|
|
29
|
+
exports.INVOICE = 'invoice';
|
|
30
|
+
exports.INVOICE_LINE = 'invoice/invoice-line';
|
|
31
|
+
exports.PAYMENT = 'accounting/payment';
|
|
32
|
+
exports.INCOMING_PAYMENT_METHOD = 'accounting/incoming-payment-method';
|
|
33
|
+
exports.FIXED_ASSET = 'fixed-asset';
|
|
34
|
+
// ECommerce
|
|
35
|
+
exports.STORE = 'store';
|
|
36
|
+
exports.STORE_PRODUCT = 'store/store-product';
|
|
37
|
+
exports.STORE_PRODUCT_GROUP = 'store/store-product-group';
|
|
38
|
+
// Accounting
|
|
39
|
+
exports.ACCOUNT = 'accounting/account';
|
|
40
|
+
exports.JOURNAL_ENTRY = 'accounting/journal-entry';
|
|
41
|
+
exports.JOURNAL_ENTRY_LINE = 'accounting/journal-entry-line';
|
|
42
|
+
// Manufacturing
|
|
43
|
+
exports.BILL_OF_MATERIALS = 'manufacturing/bill-of-materials';
|
|
44
|
+
exports.BOM_COMPONENT = 'manufacturing/bom-component';
|
|
45
|
+
exports.PRODUCTION_ORDER = 'manufacturing/production-order';
|
|
46
|
+
exports.PRODUCTION_ORDER_LINE = 'manufacturing/production-order-line';
|
|
47
|
+
exports.SUBSIDIARY = 'subsidiary';
|
|
48
|
+
// HR
|
|
49
|
+
exports.EMPLOYEE = 'human-resources/employee';
|
|
50
|
+
exports.ATTENDANCE = 'human-resources/attendance';
|
|
51
|
+
// TODO: Deprecate
|
|
52
|
+
exports.INCOMING_SHIPMENT = 'shipment/incoming-shipment';
|
|
53
|
+
exports.OUTGOING_SHIPMENT = 'shipment/outgoing-shipment';
|
|
54
|
+
///
|
|
55
|
+
exports.STOCK_ADJUSTMENT = 'stock-adjustment';
|
|
56
|
+
exports.PURCHASE_ORDER_APPROVER = 'approval/approver/purchase-order';
|
|
57
|
+
exports.SALES_ORDER_APPROVER = 'approval/approver/sales-order';
|
|
58
|
+
exports.CUSTOM_FIELD = 'custom-field';
|
|
59
|
+
exports.AUDIT_LOG = 'audit-log';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare function getAllObjects(entity: any, queryParams?: any): Promise<any>;
|
|
2
|
+
declare function getObjectById(entity: any, id: string): Promise<any>;
|
|
3
|
+
declare function updateObject(entity: any, id: string, newData: any): Promise<any>;
|
|
4
|
+
declare function createObject(entity: any, data: any): Promise<any>;
|
|
5
|
+
declare function deleteObject(entity: any, id: string): Promise<any>;
|
|
6
|
+
declare const konversiAPI: {
|
|
7
|
+
setToken: (token: string) => void;
|
|
8
|
+
setCompanyId: (companyId: string) => void;
|
|
9
|
+
getAllObjects: typeof getAllObjects;
|
|
10
|
+
getObjectById: typeof getObjectById;
|
|
11
|
+
updateObject: typeof updateObject;
|
|
12
|
+
createObject: typeof createObject;
|
|
13
|
+
deleteObject: typeof deleteObject;
|
|
14
|
+
};
|
|
15
|
+
export default konversiAPI;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
const axiosAPI_1 = __importStar(require("./axiosAPI"));
|
|
36
|
+
function getAllObjects(entity_1) {
|
|
37
|
+
return __awaiter(this, arguments, void 0, function* (entity, queryParams = {}) {
|
|
38
|
+
const response = yield axiosAPI_1.default.get(`${entity}`, {
|
|
39
|
+
params: queryParams
|
|
40
|
+
});
|
|
41
|
+
return response.data;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function getObjectById(entity, id) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const response = yield axiosAPI_1.default.get(`${entity}/${id}`);
|
|
47
|
+
return response.data;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function updateObject(entity, id, newData) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const response = yield axiosAPI_1.default.put(`${entity}/${id}`, newData);
|
|
53
|
+
return response.data;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function createObject(entity, data) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const response = yield axiosAPI_1.default.post(`${entity}`, data);
|
|
59
|
+
return response.data;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function deleteObject(entity, id) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const response = yield axiosAPI_1.default.delete(`${entity}/${id}`);
|
|
65
|
+
return response.data;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
const konversiAPI = {
|
|
69
|
+
setToken: axiosAPI_1.setAuthToken,
|
|
70
|
+
setCompanyId: axiosAPI_1.setCompanyId,
|
|
71
|
+
getAllObjects,
|
|
72
|
+
getObjectById,
|
|
73
|
+
updateObject,
|
|
74
|
+
createObject,
|
|
75
|
+
deleteObject
|
|
76
|
+
};
|
|
77
|
+
exports.default = konversiAPI;
|
package/index.ts
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import axiosAPI, { setAuthToken, setCompanyId } from "./axiosAPI";
|
|
2
|
-
|
|
3
|
-
async function getAllObjects(entity: any, queryParams: any = {}) {
|
|
4
|
-
const response = await axiosAPI.get(`${entity}`, {
|
|
5
|
-
params: queryParams
|
|
6
|
-
})
|
|
7
|
-
return response.data;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
async function getObjectById(entity: any, id: string) {
|
|
11
|
-
const response = await axiosAPI.get(`${entity}/${id}`)
|
|
12
|
-
return response.data;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
async function updateObject(entity: any, id: string, newData: any) {
|
|
16
|
-
const response = await axiosAPI.put(`${entity}/${id}`, newData)
|
|
17
|
-
return response.data;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async function createObject(entity: any, data: any) {
|
|
21
|
-
const response = await axiosAPI.post(`${entity}`, data)
|
|
22
|
-
|
|
23
|
-
return response.data;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
async function deleteObject(entity: any, id: string) {
|
|
27
|
-
const response = await axiosAPI.delete(`${entity}/${id}`)
|
|
28
|
-
|
|
29
|
-
return response.data;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const konversiAPI = {
|
|
33
|
-
setToken: setAuthToken,
|
|
34
|
-
setCompanyId,
|
|
35
|
-
getAllObjects,
|
|
36
|
-
getObjectById,
|
|
37
|
-
updateObject,
|
|
38
|
-
createObject,
|
|
39
|
-
deleteObject
|
|
40
|
-
}
|
|
41
|
-
|
|
1
|
+
import axiosAPI, { setAuthToken, setCompanyId } from "./axiosAPI";
|
|
2
|
+
|
|
3
|
+
async function getAllObjects(entity: any, queryParams: any = {}) {
|
|
4
|
+
const response = await axiosAPI.get(`${entity}`, {
|
|
5
|
+
params: queryParams
|
|
6
|
+
})
|
|
7
|
+
return response.data;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async function getObjectById(entity: any, id: string) {
|
|
11
|
+
const response = await axiosAPI.get(`${entity}/${id}`)
|
|
12
|
+
return response.data;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async function updateObject(entity: any, id: string, newData: any) {
|
|
16
|
+
const response = await axiosAPI.put(`${entity}/${id}`, newData)
|
|
17
|
+
return response.data;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async function createObject(entity: any, data: any) {
|
|
21
|
+
const response = await axiosAPI.post(`${entity}`, data)
|
|
22
|
+
|
|
23
|
+
return response.data;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function deleteObject(entity: any, id: string) {
|
|
27
|
+
const response = await axiosAPI.delete(`${entity}/${id}`)
|
|
28
|
+
|
|
29
|
+
return response.data;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const konversiAPI = {
|
|
33
|
+
setToken: setAuthToken,
|
|
34
|
+
setCompanyId,
|
|
35
|
+
getAllObjects,
|
|
36
|
+
getObjectById,
|
|
37
|
+
updateObject,
|
|
38
|
+
createObject,
|
|
39
|
+
deleteObject
|
|
40
|
+
}
|
|
41
|
+
|
|
42
42
|
export default konversiAPI;
|
package/package.json
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@konversi/konversi-client",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"main": "dist/index.js",
|
|
5
|
-
"types": "dist/index.d.ts",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
-
"build": "tsc",
|
|
10
|
-
"prepublish": "tsc"
|
|
11
|
-
},
|
|
12
|
-
"keywords": [],
|
|
13
|
-
"author": "",
|
|
14
|
-
"license": "ISC",
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"axios": "^1.6.8",
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@konversi/konversi-client",
|
|
3
|
+
"version": "1.0.11",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"prepublish": "tsc"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [],
|
|
13
|
+
"author": "",
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"axios": "^1.6.8",
|
|
17
|
+
"ts-node": "^10.9.2",
|
|
18
|
+
"typescript": "^5.4.5"
|
|
19
|
+
},
|
|
20
|
+
"description": ""
|
|
21
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es5",
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"lib": ["es2017", "es7", "es6", "dom"],
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"outDir": "dist",
|
|
8
|
-
"strict": true,
|
|
9
|
-
"esModuleInterop": true
|
|
10
|
-
},
|
|
11
|
-
"exclude": [
|
|
12
|
-
"node_modules",
|
|
13
|
-
"dist"
|
|
14
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es5",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"lib": ["es2017", "es7", "es6", "dom"],
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"outDir": "dist",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": true
|
|
10
|
+
},
|
|
11
|
+
"exclude": [
|
|
12
|
+
"node_modules",
|
|
13
|
+
"dist"
|
|
14
|
+
]
|
|
15
15
|
}
|