@konversi/konversi-client 1.0.13 → 1.1.1

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,79 @@
1
+ declare const COMPANY_PERMISSION = "company-permission";
2
+ declare const COMPANY_OPTION = "company-option";
3
+ declare const INVITATION = "user/invitation";
4
+ declare const CUSTOMER = "contact/customer";
5
+ declare const PRODUCT = "product";
6
+ declare const PRODUCT_ITEM = "product/product-item";
7
+ declare const PRODUCT_GROUP = "product-group";
8
+ declare const PURCHASE_ORDER = "order/purchase-order";
9
+ declare const PURCHASE_ORDER_LINE = "order/purchase-order-line";
10
+ declare const QUOTE = "order/quote";
11
+ declare const QUOTE_LINE = "order/quote-line";
12
+ declare const SALES_ORDER = "order/sales-order";
13
+ declare const SALES_ORDER_LINE = "order/sales-order-line";
14
+ declare const RENTAL_ORDER = "order/rental-order";
15
+ declare const RENTAL_ORDER_LINE = "order/rental-order-line";
16
+ declare const SUPPLIER = "contact/supplier";
17
+ declare const WAREHOUSE = "warehouse";
18
+ declare const INCOMING_DELIVERY = "delivery/incoming-delivery";
19
+ declare const INCOMING_DELIVERY_LINE = "delivery/incoming-delivery-line";
20
+ declare const OUTGOING_DELIVERY = "delivery/outgoing-delivery";
21
+ declare const OUTGOING_DELIVERY_LINE = "delivery/outgoing-delivery-line";
22
+ declare const INTERNAL_DELIVERY = "delivery/internal-delivery";
23
+ declare const INTERNAL_DELIVERY_LINE = "delivery/internal-delivery-line";
24
+ declare const INVOICE = "invoice";
25
+ declare const INVOICE_LINE = "invoice/invoice-line";
26
+ declare const EXPENSE = "expense";
27
+ declare const EXPENSE_LINE = "expense/expense-line";
28
+ declare const PAYMENT = "accounting/payment";
29
+ declare const INCOMING_PAYMENT_METHOD = "accounting/incoming-payment-method";
30
+ declare const FIXED_ASSET = "fixed-asset";
31
+ declare const STORE = "store";
32
+ declare const STORE_PRODUCT = "store/store-product";
33
+ declare const STORE_PRODUCT_GROUP = "store/store-product-group";
34
+ declare const ACCOUNT = "accounting/account";
35
+ declare const JOURNAL_ENTRY = "accounting/journal-entry";
36
+ declare const JOURNAL_ENTRY_LINE = "accounting/journal-entry-line";
37
+ declare const BILL_OF_MATERIALS = "manufacturing/bill-of-materials";
38
+ declare const BOM_COMPONENT = "manufacturing/bom-component";
39
+ declare const BOM_OPERATION = "manufacturing/bom-operation";
40
+ declare const PRODUCTION_ORDER = "manufacturing/production-order";
41
+ declare const PRODUCTION_ORDER_LINE = "manufacturing/production-order-line";
42
+ declare const SUBSIDIARY = "subsidiary";
43
+ declare const EMPLOYEE = "human-resources/employee";
44
+ declare const ATTENDANCE = "human-resources/attendance";
45
+ declare const VEHICLE = "fleet/vehicle";
46
+ declare const DELIVERY_JOB = "fleet/delivery-job";
47
+ declare const CUSTOM_ENTITY_SCHEMA = "custom-entity/schema";
48
+ declare const CUSTOM_ENTITY_OBJECT = "custom-entity";
49
+ declare const CUSTOM_ENTITY_FIELD = "custom-entity/field";
50
+ declare const AUTOMATION_JOB = "automation/job";
51
+ declare const AUTOMATION_SCRIPT = "automation/script";
52
+ declare const STOCK_ADJUSTMENT = "stock-adjustment";
53
+ declare const PURCHASE_ORDER_APPROVER = "approval/approver/purchase-order";
54
+ declare const SALES_ORDER_APPROVER = "approval/approver/sales-order";
55
+ declare const CUSTOM_DOCUMENT = "document-generator/custom-document";
56
+ declare const CUSTOM_FIELD = "custom-field";
57
+ declare const AUDIT_LOG = "audit-log";
58
+ declare const COMPANY_ALIAS = "company-alias";
59
+ declare const PRINT_JOB = "thermal-printer/print-job";
60
+ declare const WORK_ORDER = "order/sales-order?type=WORK_ORDER";
61
+ declare const INCOMING_SHIPMENT = "shipment/incoming-shipment";
62
+ declare const OUTGOING_SHIPMENT = "shipment/outgoing-shipment";
63
+
64
+ declare function getAllObjects(entity: any, queryParams?: any): Promise<any>;
65
+ declare function getObjectById(entity: any, id: string): Promise<any>;
66
+ declare function updateObject(entity: any, id: string, newData: any): Promise<any>;
67
+ declare function createObject(entity: any, data: any): Promise<any>;
68
+ declare function deleteObject(entity: any, id: string): Promise<any>;
69
+ declare const konversiAPI: {
70
+ setToken: (token: string) => void;
71
+ setCompanyId: (companyId: string) => void;
72
+ getAllObjects: typeof getAllObjects;
73
+ getObjectById: typeof getObjectById;
74
+ updateObject: typeof updateObject;
75
+ createObject: typeof createObject;
76
+ deleteObject: typeof deleteObject;
77
+ };
78
+
79
+ export { ACCOUNT, ATTENDANCE, AUDIT_LOG, AUTOMATION_JOB, AUTOMATION_SCRIPT, BILL_OF_MATERIALS, BOM_COMPONENT, BOM_OPERATION, COMPANY_ALIAS, COMPANY_OPTION, COMPANY_PERMISSION, CUSTOMER, CUSTOM_DOCUMENT, CUSTOM_ENTITY_FIELD, CUSTOM_ENTITY_OBJECT, CUSTOM_ENTITY_SCHEMA, CUSTOM_FIELD, DELIVERY_JOB, EMPLOYEE, EXPENSE, EXPENSE_LINE, FIXED_ASSET, INCOMING_DELIVERY, INCOMING_DELIVERY_LINE, INCOMING_PAYMENT_METHOD, INCOMING_SHIPMENT, INTERNAL_DELIVERY, INTERNAL_DELIVERY_LINE, INVITATION, INVOICE, INVOICE_LINE, JOURNAL_ENTRY, JOURNAL_ENTRY_LINE, OUTGOING_DELIVERY, OUTGOING_DELIVERY_LINE, OUTGOING_SHIPMENT, PAYMENT, PRINT_JOB, PRODUCT, PRODUCTION_ORDER, PRODUCTION_ORDER_LINE, PRODUCT_GROUP, PRODUCT_ITEM, PURCHASE_ORDER, PURCHASE_ORDER_APPROVER, PURCHASE_ORDER_LINE, QUOTE, QUOTE_LINE, RENTAL_ORDER, RENTAL_ORDER_LINE, SALES_ORDER, SALES_ORDER_APPROVER, SALES_ORDER_LINE, STOCK_ADJUSTMENT, STORE, STORE_PRODUCT, STORE_PRODUCT_GROUP, SUBSIDIARY, SUPPLIER, VEHICLE, WAREHOUSE, WORK_ORDER, konversiAPI as default };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,66 @@
1
+ declare const COMPANY_PERMISSION = "company-permission";
2
+ declare const COMPANY_OPTION = "company-option";
3
+ declare const INVITATION = "user/invitation";
4
+ declare const CUSTOMER = "contact/customer";
5
+ declare const PRODUCT = "product";
6
+ declare const PRODUCT_ITEM = "product/product-item";
7
+ declare const PRODUCT_GROUP = "product-group";
8
+ declare const PURCHASE_ORDER = "order/purchase-order";
9
+ declare const PURCHASE_ORDER_LINE = "order/purchase-order-line";
10
+ declare const QUOTE = "order/quote";
11
+ declare const QUOTE_LINE = "order/quote-line";
12
+ declare const SALES_ORDER = "order/sales-order";
13
+ declare const SALES_ORDER_LINE = "order/sales-order-line";
14
+ declare const RENTAL_ORDER = "order/rental-order";
15
+ declare const RENTAL_ORDER_LINE = "order/rental-order-line";
16
+ declare const SUPPLIER = "contact/supplier";
17
+ declare const WAREHOUSE = "warehouse";
18
+ declare const INCOMING_DELIVERY = "delivery/incoming-delivery";
19
+ declare const INCOMING_DELIVERY_LINE = "delivery/incoming-delivery-line";
20
+ declare const OUTGOING_DELIVERY = "delivery/outgoing-delivery";
21
+ declare const OUTGOING_DELIVERY_LINE = "delivery/outgoing-delivery-line";
22
+ declare const INTERNAL_DELIVERY = "delivery/internal-delivery";
23
+ declare const INTERNAL_DELIVERY_LINE = "delivery/internal-delivery-line";
24
+ declare const INVOICE = "invoice";
25
+ declare const INVOICE_LINE = "invoice/invoice-line";
26
+ declare const EXPENSE = "expense";
27
+ declare const EXPENSE_LINE = "expense/expense-line";
28
+ declare const PAYMENT = "accounting/payment";
29
+ declare const INCOMING_PAYMENT_METHOD = "accounting/incoming-payment-method";
30
+ declare const FIXED_ASSET = "fixed-asset";
31
+ declare const STORE = "store";
32
+ declare const STORE_PRODUCT = "store/store-product";
33
+ declare const STORE_PRODUCT_GROUP = "store/store-product-group";
34
+ declare const ACCOUNT = "accounting/account";
35
+ declare const JOURNAL_ENTRY = "accounting/journal-entry";
36
+ declare const JOURNAL_ENTRY_LINE = "accounting/journal-entry-line";
37
+ declare const BILL_OF_MATERIALS = "manufacturing/bill-of-materials";
38
+ declare const BOM_COMPONENT = "manufacturing/bom-component";
39
+ declare const BOM_OPERATION = "manufacturing/bom-operation";
40
+ declare const PRODUCTION_ORDER = "manufacturing/production-order";
41
+ declare const PRODUCTION_ORDER_LINE = "manufacturing/production-order-line";
42
+ declare const SUBSIDIARY = "subsidiary";
43
+ declare const EMPLOYEE = "human-resources/employee";
44
+ declare const ATTENDANCE = "human-resources/attendance";
45
+ declare const VEHICLE = "fleet/vehicle";
46
+ declare const DELIVERY_JOB = "fleet/delivery-job";
47
+ declare const CUSTOM_ENTITY_SCHEMA = "custom-entity/schema";
48
+ declare const CUSTOM_ENTITY_OBJECT = "custom-entity";
49
+ declare const CUSTOM_ENTITY_FIELD = "custom-entity/field";
50
+ declare const AUTOMATION_JOB = "automation/job";
51
+ declare const AUTOMATION_SCRIPT = "automation/script";
52
+ declare const STOCK_ADJUSTMENT = "stock-adjustment";
53
+ declare const PURCHASE_ORDER_APPROVER = "approval/approver/purchase-order";
54
+ declare const SALES_ORDER_APPROVER = "approval/approver/sales-order";
55
+ declare const CUSTOM_DOCUMENT = "document-generator/custom-document";
56
+ declare const CUSTOM_FIELD = "custom-field";
57
+ declare const AUDIT_LOG = "audit-log";
58
+ declare const COMPANY_ALIAS = "company-alias";
59
+ declare const PRINT_JOB = "thermal-printer/print-job";
60
+ declare const WORK_ORDER = "order/sales-order?type=WORK_ORDER";
61
+ declare const INCOMING_SHIPMENT = "shipment/incoming-shipment";
62
+ declare const OUTGOING_SHIPMENT = "shipment/outgoing-shipment";
63
+
1
64
  declare function getAllObjects(entity: any, queryParams?: any): Promise<any>;
2
65
  declare function getObjectById(entity: any, id: string): Promise<any>;
3
66
  declare function updateObject(entity: any, id: string, newData: any): Promise<any>;
@@ -12,4 +75,5 @@ declare const konversiAPI: {
12
75
  createObject: typeof createObject;
13
76
  deleteObject: typeof deleteObject;
14
77
  };
15
- export default konversiAPI;
78
+
79
+ export { ACCOUNT, ATTENDANCE, AUDIT_LOG, AUTOMATION_JOB, AUTOMATION_SCRIPT, BILL_OF_MATERIALS, BOM_COMPONENT, BOM_OPERATION, COMPANY_ALIAS, COMPANY_OPTION, COMPANY_PERMISSION, CUSTOMER, CUSTOM_DOCUMENT, CUSTOM_ENTITY_FIELD, CUSTOM_ENTITY_OBJECT, CUSTOM_ENTITY_SCHEMA, CUSTOM_FIELD, DELIVERY_JOB, EMPLOYEE, EXPENSE, EXPENSE_LINE, FIXED_ASSET, INCOMING_DELIVERY, INCOMING_DELIVERY_LINE, INCOMING_PAYMENT_METHOD, INCOMING_SHIPMENT, INTERNAL_DELIVERY, INTERNAL_DELIVERY_LINE, INVITATION, INVOICE, INVOICE_LINE, JOURNAL_ENTRY, JOURNAL_ENTRY_LINE, OUTGOING_DELIVERY, OUTGOING_DELIVERY_LINE, OUTGOING_SHIPMENT, PAYMENT, PRINT_JOB, PRODUCT, PRODUCTION_ORDER, PRODUCTION_ORDER_LINE, PRODUCT_GROUP, PRODUCT_ITEM, PURCHASE_ORDER, PURCHASE_ORDER_APPROVER, PURCHASE_ORDER_LINE, QUOTE, QUOTE_LINE, RENTAL_ORDER, RENTAL_ORDER_LINE, SALES_ORDER, SALES_ORDER_APPROVER, SALES_ORDER_LINE, STOCK_ADJUSTMENT, STORE, STORE_PRODUCT, STORE_PRODUCT_GROUP, SUBSIDIARY, SUPPLIER, VEHICLE, WAREHOUSE, WORK_ORDER, konversiAPI as default };
package/dist/index.js CHANGED
@@ -1,140 +1,306 @@
1
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;
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
24
11
  };
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
- });
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var __async = (__this, __arguments, generator) => {
30
+ return new Promise((resolve, reject) => {
31
+ var fulfilled = (value) => {
32
+ try {
33
+ step(generator.next(value));
34
+ } catch (e) {
35
+ reject(e);
36
+ }
37
+ };
38
+ var rejected = (value) => {
39
+ try {
40
+ step(generator.throw(value));
41
+ } catch (e) {
42
+ reject(e);
43
+ }
44
+ };
45
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
46
+ step((generator = generator.apply(__this, __arguments)).next());
47
+ });
48
+ };
49
+
50
+ // index.ts
51
+ var konversi_client_exports = {};
52
+ __export(konversi_client_exports, {
53
+ ACCOUNT: () => ACCOUNT,
54
+ ATTENDANCE: () => ATTENDANCE,
55
+ AUDIT_LOG: () => AUDIT_LOG,
56
+ AUTOMATION_JOB: () => AUTOMATION_JOB,
57
+ AUTOMATION_SCRIPT: () => AUTOMATION_SCRIPT,
58
+ BILL_OF_MATERIALS: () => BILL_OF_MATERIALS,
59
+ BOM_COMPONENT: () => BOM_COMPONENT,
60
+ BOM_OPERATION: () => BOM_OPERATION,
61
+ COMPANY_ALIAS: () => COMPANY_ALIAS,
62
+ COMPANY_OPTION: () => COMPANY_OPTION,
63
+ COMPANY_PERMISSION: () => COMPANY_PERMISSION,
64
+ CUSTOMER: () => CUSTOMER,
65
+ CUSTOM_DOCUMENT: () => CUSTOM_DOCUMENT,
66
+ CUSTOM_ENTITY_FIELD: () => CUSTOM_ENTITY_FIELD,
67
+ CUSTOM_ENTITY_OBJECT: () => CUSTOM_ENTITY_OBJECT,
68
+ CUSTOM_ENTITY_SCHEMA: () => CUSTOM_ENTITY_SCHEMA,
69
+ CUSTOM_FIELD: () => CUSTOM_FIELD,
70
+ DELIVERY_JOB: () => DELIVERY_JOB,
71
+ EMPLOYEE: () => EMPLOYEE,
72
+ EXPENSE: () => EXPENSE,
73
+ EXPENSE_LINE: () => EXPENSE_LINE,
74
+ FIXED_ASSET: () => FIXED_ASSET,
75
+ INCOMING_DELIVERY: () => INCOMING_DELIVERY,
76
+ INCOMING_DELIVERY_LINE: () => INCOMING_DELIVERY_LINE,
77
+ INCOMING_PAYMENT_METHOD: () => INCOMING_PAYMENT_METHOD,
78
+ INCOMING_SHIPMENT: () => INCOMING_SHIPMENT,
79
+ INTERNAL_DELIVERY: () => INTERNAL_DELIVERY,
80
+ INTERNAL_DELIVERY_LINE: () => INTERNAL_DELIVERY_LINE,
81
+ INVITATION: () => INVITATION,
82
+ INVOICE: () => INVOICE,
83
+ INVOICE_LINE: () => INVOICE_LINE,
84
+ JOURNAL_ENTRY: () => JOURNAL_ENTRY,
85
+ JOURNAL_ENTRY_LINE: () => JOURNAL_ENTRY_LINE,
86
+ OUTGOING_DELIVERY: () => OUTGOING_DELIVERY,
87
+ OUTGOING_DELIVERY_LINE: () => OUTGOING_DELIVERY_LINE,
88
+ OUTGOING_SHIPMENT: () => OUTGOING_SHIPMENT,
89
+ PAYMENT: () => PAYMENT,
90
+ PRINT_JOB: () => PRINT_JOB,
91
+ PRODUCT: () => PRODUCT,
92
+ PRODUCTION_ORDER: () => PRODUCTION_ORDER,
93
+ PRODUCTION_ORDER_LINE: () => PRODUCTION_ORDER_LINE,
94
+ PRODUCT_GROUP: () => PRODUCT_GROUP,
95
+ PRODUCT_ITEM: () => PRODUCT_ITEM,
96
+ PURCHASE_ORDER: () => PURCHASE_ORDER,
97
+ PURCHASE_ORDER_APPROVER: () => PURCHASE_ORDER_APPROVER,
98
+ PURCHASE_ORDER_LINE: () => PURCHASE_ORDER_LINE,
99
+ QUOTE: () => QUOTE,
100
+ QUOTE_LINE: () => QUOTE_LINE,
101
+ RENTAL_ORDER: () => RENTAL_ORDER,
102
+ RENTAL_ORDER_LINE: () => RENTAL_ORDER_LINE,
103
+ SALES_ORDER: () => SALES_ORDER,
104
+ SALES_ORDER_APPROVER: () => SALES_ORDER_APPROVER,
105
+ SALES_ORDER_LINE: () => SALES_ORDER_LINE,
106
+ STOCK_ADJUSTMENT: () => STOCK_ADJUSTMENT,
107
+ STORE: () => STORE,
108
+ STORE_PRODUCT: () => STORE_PRODUCT,
109
+ STORE_PRODUCT_GROUP: () => STORE_PRODUCT_GROUP,
110
+ SUBSIDIARY: () => SUBSIDIARY,
111
+ SUPPLIER: () => SUPPLIER,
112
+ VEHICLE: () => VEHICLE,
113
+ WAREHOUSE: () => WAREHOUSE,
114
+ WORK_ORDER: () => WORK_ORDER,
115
+ default: () => konversi_client_default
116
+ });
117
+ module.exports = __toCommonJS(konversi_client_exports);
118
+
119
+ // axiosAPI.ts
120
+ var import_axios = __toESM(require("axios"));
121
+ var baseURL = "https://us.api.konversi.net/api";
122
+ var timeout = 3e4;
123
+ var instance = import_axios.default.create({
124
+ baseURL,
125
+ timeout
126
+ });
127
+ var setAuthToken = (token) => {
128
+ instance.defaults.headers.common.authorization = `Bearer ${token}`;
33
129
  };
34
- var __generator = (this && this.__generator) || function (thisArg, body) {
35
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
36
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
37
- function verb(n) { return function (v) { return step([n, v]); }; }
38
- function step(op) {
39
- if (f) throw new TypeError("Generator is already executing.");
40
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
41
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
42
- if (y = 0, t) op = [op[0] & 2, t.value];
43
- switch (op[0]) {
44
- case 0: case 1: t = op; break;
45
- case 4: _.label++; return { value: op[1], done: false };
46
- case 5: _.label++; y = op[1]; op = [0]; continue;
47
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
48
- default:
49
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
50
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
51
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
52
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
53
- if (t[2]) _.ops.pop();
54
- _.trys.pop(); continue;
55
- }
56
- op = body.call(thisArg, _);
57
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
58
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
59
- }
130
+ var setCompanyId = (companyId) => {
131
+ instance.defaults.headers.common["Company"] = companyId;
60
132
  };
61
- Object.defineProperty(exports, "__esModule", { value: true });
62
- var axiosAPI_1 = __importStar(require("./axiosAPI"));
63
- function getAllObjects(entity_1) {
64
- return __awaiter(this, arguments, void 0, function (entity, queryParams) {
65
- var response;
66
- if (queryParams === void 0) { queryParams = {}; }
67
- return __generator(this, function (_a) {
68
- switch (_a.label) {
69
- case 0: return [4 /*yield*/, axiosAPI_1.default.get("".concat(entity), {
70
- params: queryParams
71
- })];
72
- case 1:
73
- response = _a.sent();
74
- return [2 /*return*/, response.data];
75
- }
76
- });
133
+ var axiosAPI_default = instance;
134
+
135
+ // crudEndpoints.ts
136
+ var COMPANY_PERMISSION = "company-permission";
137
+ var COMPANY_OPTION = "company-option";
138
+ var INVITATION = "user/invitation";
139
+ var CUSTOMER = "contact/customer";
140
+ var PRODUCT = "product";
141
+ var PRODUCT_ITEM = "product/product-item";
142
+ var PRODUCT_GROUP = "product-group";
143
+ var PURCHASE_ORDER = "order/purchase-order";
144
+ var PURCHASE_ORDER_LINE = "order/purchase-order-line";
145
+ var QUOTE = "order/quote";
146
+ var QUOTE_LINE = "order/quote-line";
147
+ var SALES_ORDER = "order/sales-order";
148
+ var SALES_ORDER_LINE = "order/sales-order-line";
149
+ var RENTAL_ORDER = "order/rental-order";
150
+ var RENTAL_ORDER_LINE = "order/rental-order-line";
151
+ var SUPPLIER = "contact/supplier";
152
+ var WAREHOUSE = "warehouse";
153
+ var INCOMING_DELIVERY = "delivery/incoming-delivery";
154
+ var INCOMING_DELIVERY_LINE = "delivery/incoming-delivery-line";
155
+ var OUTGOING_DELIVERY = "delivery/outgoing-delivery";
156
+ var OUTGOING_DELIVERY_LINE = "delivery/outgoing-delivery-line";
157
+ var INTERNAL_DELIVERY = "delivery/internal-delivery";
158
+ var INTERNAL_DELIVERY_LINE = "delivery/internal-delivery-line";
159
+ var INVOICE = "invoice";
160
+ var INVOICE_LINE = "invoice/invoice-line";
161
+ var EXPENSE = "expense";
162
+ var EXPENSE_LINE = "expense/expense-line";
163
+ var PAYMENT = "accounting/payment";
164
+ var INCOMING_PAYMENT_METHOD = "accounting/incoming-payment-method";
165
+ var FIXED_ASSET = "fixed-asset";
166
+ var STORE = "store";
167
+ var STORE_PRODUCT = "store/store-product";
168
+ var STORE_PRODUCT_GROUP = "store/store-product-group";
169
+ var ACCOUNT = "accounting/account";
170
+ var JOURNAL_ENTRY = "accounting/journal-entry";
171
+ var JOURNAL_ENTRY_LINE = "accounting/journal-entry-line";
172
+ var BILL_OF_MATERIALS = "manufacturing/bill-of-materials";
173
+ var BOM_COMPONENT = "manufacturing/bom-component";
174
+ var BOM_OPERATION = "manufacturing/bom-operation";
175
+ var PRODUCTION_ORDER = "manufacturing/production-order";
176
+ var PRODUCTION_ORDER_LINE = "manufacturing/production-order-line";
177
+ var SUBSIDIARY = "subsidiary";
178
+ var EMPLOYEE = "human-resources/employee";
179
+ var ATTENDANCE = "human-resources/attendance";
180
+ var VEHICLE = "fleet/vehicle";
181
+ var DELIVERY_JOB = "fleet/delivery-job";
182
+ var CUSTOM_ENTITY_SCHEMA = "custom-entity/schema";
183
+ var CUSTOM_ENTITY_OBJECT = "custom-entity";
184
+ var CUSTOM_ENTITY_FIELD = "custom-entity/field";
185
+ var AUTOMATION_JOB = "automation/job";
186
+ var AUTOMATION_SCRIPT = "automation/script";
187
+ var STOCK_ADJUSTMENT = "stock-adjustment";
188
+ var PURCHASE_ORDER_APPROVER = "approval/approver/purchase-order";
189
+ var SALES_ORDER_APPROVER = "approval/approver/sales-order";
190
+ var CUSTOM_DOCUMENT = "document-generator/custom-document";
191
+ var CUSTOM_FIELD = "custom-field";
192
+ var AUDIT_LOG = "audit-log";
193
+ var COMPANY_ALIAS = "company-alias";
194
+ var PRINT_JOB = "thermal-printer/print-job";
195
+ var WORK_ORDER = "order/sales-order?type=WORK_ORDER";
196
+ var INCOMING_SHIPMENT = "shipment/incoming-shipment";
197
+ var OUTGOING_SHIPMENT = "shipment/outgoing-shipment";
198
+
199
+ // index.ts
200
+ function getAllObjects(_0) {
201
+ return __async(this, arguments, function* (entity, queryParams = {}) {
202
+ const response = yield axiosAPI_default.get(`${entity}`, {
203
+ params: queryParams
77
204
  });
205
+ return response.data;
206
+ });
78
207
  }
79
208
  function getObjectById(entity, id) {
80
- return __awaiter(this, void 0, void 0, function () {
81
- var response;
82
- return __generator(this, function (_a) {
83
- switch (_a.label) {
84
- case 0: return [4 /*yield*/, axiosAPI_1.default.get("".concat(entity, "/").concat(id))];
85
- case 1:
86
- response = _a.sent();
87
- return [2 /*return*/, response.data];
88
- }
89
- });
90
- });
209
+ return __async(this, null, function* () {
210
+ const response = yield axiosAPI_default.get(`${entity}/${id}`);
211
+ return response.data;
212
+ });
91
213
  }
92
214
  function updateObject(entity, id, newData) {
93
- return __awaiter(this, void 0, void 0, function () {
94
- var response;
95
- return __generator(this, function (_a) {
96
- switch (_a.label) {
97
- case 0: return [4 /*yield*/, axiosAPI_1.default.put("".concat(entity, "/").concat(id), newData)];
98
- case 1:
99
- response = _a.sent();
100
- return [2 /*return*/, response.data];
101
- }
102
- });
103
- });
215
+ return __async(this, null, function* () {
216
+ const response = yield axiosAPI_default.put(`${entity}/${id}`, newData);
217
+ return response.data;
218
+ });
104
219
  }
105
220
  function createObject(entity, data) {
106
- return __awaiter(this, void 0, void 0, function () {
107
- var response;
108
- return __generator(this, function (_a) {
109
- switch (_a.label) {
110
- case 0: return [4 /*yield*/, axiosAPI_1.default.post("".concat(entity), data)];
111
- case 1:
112
- response = _a.sent();
113
- return [2 /*return*/, response.data];
114
- }
115
- });
116
- });
221
+ return __async(this, null, function* () {
222
+ const response = yield axiosAPI_default.post(`${entity}`, data);
223
+ return response.data;
224
+ });
117
225
  }
118
226
  function deleteObject(entity, id) {
119
- return __awaiter(this, void 0, void 0, function () {
120
- var response;
121
- return __generator(this, function (_a) {
122
- switch (_a.label) {
123
- case 0: return [4 /*yield*/, axiosAPI_1.default.delete("".concat(entity, "/").concat(id))];
124
- case 1:
125
- response = _a.sent();
126
- return [2 /*return*/, response.data];
127
- }
128
- });
129
- });
227
+ return __async(this, null, function* () {
228
+ const response = yield axiosAPI_default.delete(`${entity}/${id}`);
229
+ return response.data;
230
+ });
130
231
  }
131
232
  var konversiAPI = {
132
- setToken: axiosAPI_1.setAuthToken,
133
- setCompanyId: axiosAPI_1.setCompanyId,
134
- getAllObjects: getAllObjects,
135
- getObjectById: getObjectById,
136
- updateObject: updateObject,
137
- createObject: createObject,
138
- deleteObject: deleteObject
233
+ setToken: setAuthToken,
234
+ setCompanyId,
235
+ getAllObjects,
236
+ getObjectById,
237
+ updateObject,
238
+ createObject,
239
+ deleteObject
139
240
  };
140
- exports.default = konversiAPI;
241
+ var konversi_client_default = konversiAPI;
242
+ // Annotate the CommonJS export names for ESM import in node:
243
+ 0 && (module.exports = {
244
+ ACCOUNT,
245
+ ATTENDANCE,
246
+ AUDIT_LOG,
247
+ AUTOMATION_JOB,
248
+ AUTOMATION_SCRIPT,
249
+ BILL_OF_MATERIALS,
250
+ BOM_COMPONENT,
251
+ BOM_OPERATION,
252
+ COMPANY_ALIAS,
253
+ COMPANY_OPTION,
254
+ COMPANY_PERMISSION,
255
+ CUSTOMER,
256
+ CUSTOM_DOCUMENT,
257
+ CUSTOM_ENTITY_FIELD,
258
+ CUSTOM_ENTITY_OBJECT,
259
+ CUSTOM_ENTITY_SCHEMA,
260
+ CUSTOM_FIELD,
261
+ DELIVERY_JOB,
262
+ EMPLOYEE,
263
+ EXPENSE,
264
+ EXPENSE_LINE,
265
+ FIXED_ASSET,
266
+ INCOMING_DELIVERY,
267
+ INCOMING_DELIVERY_LINE,
268
+ INCOMING_PAYMENT_METHOD,
269
+ INCOMING_SHIPMENT,
270
+ INTERNAL_DELIVERY,
271
+ INTERNAL_DELIVERY_LINE,
272
+ INVITATION,
273
+ INVOICE,
274
+ INVOICE_LINE,
275
+ JOURNAL_ENTRY,
276
+ JOURNAL_ENTRY_LINE,
277
+ OUTGOING_DELIVERY,
278
+ OUTGOING_DELIVERY_LINE,
279
+ OUTGOING_SHIPMENT,
280
+ PAYMENT,
281
+ PRINT_JOB,
282
+ PRODUCT,
283
+ PRODUCTION_ORDER,
284
+ PRODUCTION_ORDER_LINE,
285
+ PRODUCT_GROUP,
286
+ PRODUCT_ITEM,
287
+ PURCHASE_ORDER,
288
+ PURCHASE_ORDER_APPROVER,
289
+ PURCHASE_ORDER_LINE,
290
+ QUOTE,
291
+ QUOTE_LINE,
292
+ RENTAL_ORDER,
293
+ RENTAL_ORDER_LINE,
294
+ SALES_ORDER,
295
+ SALES_ORDER_APPROVER,
296
+ SALES_ORDER_LINE,
297
+ STOCK_ADJUSTMENT,
298
+ STORE,
299
+ STORE_PRODUCT,
300
+ STORE_PRODUCT_GROUP,
301
+ SUBSIDIARY,
302
+ SUPPLIER,
303
+ VEHICLE,
304
+ WAREHOUSE,
305
+ WORK_ORDER
306
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,209 @@
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+
22
+ // axiosAPI.ts
23
+ import axios from "axios";
24
+ var baseURL = "https://us.api.konversi.net/api";
25
+ var timeout = 3e4;
26
+ var instance = axios.create({
27
+ baseURL,
28
+ timeout
29
+ });
30
+ var setAuthToken = (token) => {
31
+ instance.defaults.headers.common.authorization = `Bearer ${token}`;
32
+ };
33
+ var setCompanyId = (companyId) => {
34
+ instance.defaults.headers.common["Company"] = companyId;
35
+ };
36
+ var axiosAPI_default = instance;
37
+
38
+ // crudEndpoints.ts
39
+ var COMPANY_PERMISSION = "company-permission";
40
+ var COMPANY_OPTION = "company-option";
41
+ var INVITATION = "user/invitation";
42
+ var CUSTOMER = "contact/customer";
43
+ var PRODUCT = "product";
44
+ var PRODUCT_ITEM = "product/product-item";
45
+ var PRODUCT_GROUP = "product-group";
46
+ var PURCHASE_ORDER = "order/purchase-order";
47
+ var PURCHASE_ORDER_LINE = "order/purchase-order-line";
48
+ var QUOTE = "order/quote";
49
+ var QUOTE_LINE = "order/quote-line";
50
+ var SALES_ORDER = "order/sales-order";
51
+ var SALES_ORDER_LINE = "order/sales-order-line";
52
+ var RENTAL_ORDER = "order/rental-order";
53
+ var RENTAL_ORDER_LINE = "order/rental-order-line";
54
+ var SUPPLIER = "contact/supplier";
55
+ var WAREHOUSE = "warehouse";
56
+ var INCOMING_DELIVERY = "delivery/incoming-delivery";
57
+ var INCOMING_DELIVERY_LINE = "delivery/incoming-delivery-line";
58
+ var OUTGOING_DELIVERY = "delivery/outgoing-delivery";
59
+ var OUTGOING_DELIVERY_LINE = "delivery/outgoing-delivery-line";
60
+ var INTERNAL_DELIVERY = "delivery/internal-delivery";
61
+ var INTERNAL_DELIVERY_LINE = "delivery/internal-delivery-line";
62
+ var INVOICE = "invoice";
63
+ var INVOICE_LINE = "invoice/invoice-line";
64
+ var EXPENSE = "expense";
65
+ var EXPENSE_LINE = "expense/expense-line";
66
+ var PAYMENT = "accounting/payment";
67
+ var INCOMING_PAYMENT_METHOD = "accounting/incoming-payment-method";
68
+ var FIXED_ASSET = "fixed-asset";
69
+ var STORE = "store";
70
+ var STORE_PRODUCT = "store/store-product";
71
+ var STORE_PRODUCT_GROUP = "store/store-product-group";
72
+ var ACCOUNT = "accounting/account";
73
+ var JOURNAL_ENTRY = "accounting/journal-entry";
74
+ var JOURNAL_ENTRY_LINE = "accounting/journal-entry-line";
75
+ var BILL_OF_MATERIALS = "manufacturing/bill-of-materials";
76
+ var BOM_COMPONENT = "manufacturing/bom-component";
77
+ var BOM_OPERATION = "manufacturing/bom-operation";
78
+ var PRODUCTION_ORDER = "manufacturing/production-order";
79
+ var PRODUCTION_ORDER_LINE = "manufacturing/production-order-line";
80
+ var SUBSIDIARY = "subsidiary";
81
+ var EMPLOYEE = "human-resources/employee";
82
+ var ATTENDANCE = "human-resources/attendance";
83
+ var VEHICLE = "fleet/vehicle";
84
+ var DELIVERY_JOB = "fleet/delivery-job";
85
+ var CUSTOM_ENTITY_SCHEMA = "custom-entity/schema";
86
+ var CUSTOM_ENTITY_OBJECT = "custom-entity";
87
+ var CUSTOM_ENTITY_FIELD = "custom-entity/field";
88
+ var AUTOMATION_JOB = "automation/job";
89
+ var AUTOMATION_SCRIPT = "automation/script";
90
+ var STOCK_ADJUSTMENT = "stock-adjustment";
91
+ var PURCHASE_ORDER_APPROVER = "approval/approver/purchase-order";
92
+ var SALES_ORDER_APPROVER = "approval/approver/sales-order";
93
+ var CUSTOM_DOCUMENT = "document-generator/custom-document";
94
+ var CUSTOM_FIELD = "custom-field";
95
+ var AUDIT_LOG = "audit-log";
96
+ var COMPANY_ALIAS = "company-alias";
97
+ var PRINT_JOB = "thermal-printer/print-job";
98
+ var WORK_ORDER = "order/sales-order?type=WORK_ORDER";
99
+ var INCOMING_SHIPMENT = "shipment/incoming-shipment";
100
+ var OUTGOING_SHIPMENT = "shipment/outgoing-shipment";
101
+
102
+ // index.ts
103
+ function getAllObjects(_0) {
104
+ return __async(this, arguments, function* (entity, queryParams = {}) {
105
+ const response = yield axiosAPI_default.get(`${entity}`, {
106
+ params: queryParams
107
+ });
108
+ return response.data;
109
+ });
110
+ }
111
+ function getObjectById(entity, id) {
112
+ return __async(this, null, function* () {
113
+ const response = yield axiosAPI_default.get(`${entity}/${id}`);
114
+ return response.data;
115
+ });
116
+ }
117
+ function updateObject(entity, id, newData) {
118
+ return __async(this, null, function* () {
119
+ const response = yield axiosAPI_default.put(`${entity}/${id}`, newData);
120
+ return response.data;
121
+ });
122
+ }
123
+ function createObject(entity, data) {
124
+ return __async(this, null, function* () {
125
+ const response = yield axiosAPI_default.post(`${entity}`, data);
126
+ return response.data;
127
+ });
128
+ }
129
+ function deleteObject(entity, id) {
130
+ return __async(this, null, function* () {
131
+ const response = yield axiosAPI_default.delete(`${entity}/${id}`);
132
+ return response.data;
133
+ });
134
+ }
135
+ var konversiAPI = {
136
+ setToken: setAuthToken,
137
+ setCompanyId,
138
+ getAllObjects,
139
+ getObjectById,
140
+ updateObject,
141
+ createObject,
142
+ deleteObject
143
+ };
144
+ var konversi_client_default = konversiAPI;
145
+ export {
146
+ ACCOUNT,
147
+ ATTENDANCE,
148
+ AUDIT_LOG,
149
+ AUTOMATION_JOB,
150
+ AUTOMATION_SCRIPT,
151
+ BILL_OF_MATERIALS,
152
+ BOM_COMPONENT,
153
+ BOM_OPERATION,
154
+ COMPANY_ALIAS,
155
+ COMPANY_OPTION,
156
+ COMPANY_PERMISSION,
157
+ CUSTOMER,
158
+ CUSTOM_DOCUMENT,
159
+ CUSTOM_ENTITY_FIELD,
160
+ CUSTOM_ENTITY_OBJECT,
161
+ CUSTOM_ENTITY_SCHEMA,
162
+ CUSTOM_FIELD,
163
+ DELIVERY_JOB,
164
+ EMPLOYEE,
165
+ EXPENSE,
166
+ EXPENSE_LINE,
167
+ FIXED_ASSET,
168
+ INCOMING_DELIVERY,
169
+ INCOMING_DELIVERY_LINE,
170
+ INCOMING_PAYMENT_METHOD,
171
+ INCOMING_SHIPMENT,
172
+ INTERNAL_DELIVERY,
173
+ INTERNAL_DELIVERY_LINE,
174
+ INVITATION,
175
+ INVOICE,
176
+ INVOICE_LINE,
177
+ JOURNAL_ENTRY,
178
+ JOURNAL_ENTRY_LINE,
179
+ OUTGOING_DELIVERY,
180
+ OUTGOING_DELIVERY_LINE,
181
+ OUTGOING_SHIPMENT,
182
+ PAYMENT,
183
+ PRINT_JOB,
184
+ PRODUCT,
185
+ PRODUCTION_ORDER,
186
+ PRODUCTION_ORDER_LINE,
187
+ PRODUCT_GROUP,
188
+ PRODUCT_ITEM,
189
+ PURCHASE_ORDER,
190
+ PURCHASE_ORDER_APPROVER,
191
+ PURCHASE_ORDER_LINE,
192
+ QUOTE,
193
+ QUOTE_LINE,
194
+ RENTAL_ORDER,
195
+ RENTAL_ORDER_LINE,
196
+ SALES_ORDER,
197
+ SALES_ORDER_APPROVER,
198
+ SALES_ORDER_LINE,
199
+ STOCK_ADJUSTMENT,
200
+ STORE,
201
+ STORE_PRODUCT,
202
+ STORE_PRODUCT_GROUP,
203
+ SUBSIDIARY,
204
+ SUPPLIER,
205
+ VEHICLE,
206
+ WAREHOUSE,
207
+ WORK_ORDER,
208
+ konversi_client_default as default
209
+ };
package/index.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import axiosAPI, { setAuthToken, setCompanyId } from "./axiosAPI";
2
2
 
3
+ export * from "./crudEndpoints";
4
+
3
5
  async function getAllObjects(entity: any, queryParams: any = {}) {
4
6
  const response = await axiosAPI.get(`${entity}`, {
5
7
  params: queryParams
package/package.json CHANGED
@@ -1,21 +1,24 @@
1
1
  {
2
2
  "name": "@konversi/konversi-client",
3
- "version": "1.0.13",
3
+ "version": "1.1.1",
4
4
  "main": "dist/index.js",
5
+ "module": "dist/index.mjs",
5
6
  "types": "dist/index.d.ts",
6
- "type": "module",
7
7
  "scripts": {
8
8
  "test": "echo \"Error: no test specified\" && exit 1",
9
- "build": "tsc",
10
- "prepublish": "tsc"
9
+ "build": "tsup index.ts --format cjs,esm --dts",
10
+ "lint": "tsc"
11
11
  },
12
12
  "keywords": [],
13
13
  "author": "",
14
14
  "license": "ISC",
15
15
  "dependencies": {
16
16
  "axios": "^1.6.8",
17
- "ts-node": "^10.9.2",
18
- "typescript": "^5.4.5"
17
+ "ts-node": "^10.9.2"
19
18
  },
20
- "description": ""
19
+ "description": "",
20
+ "devDependencies": {
21
+ "tsup": "^8.2.4",
22
+ "typescript": "^5.4.5"
23
+ }
21
24
  }
package/tsconfig.json CHANGED
@@ -1,15 +1,109 @@
1
1
  {
2
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
- }
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,5 +0,0 @@
1
- declare const instance: import("axios").AxiosInstance;
2
- export declare const setAuthToken: (token: string) => void;
3
- export declare const setCompanyId: (companyId: string) => void;
4
- export declare const clearAuthToken: () => void;
5
- export default instance;
package/dist/axiosAPI.js DELETED
@@ -1,26 +0,0 @@
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
- var axios_1 = __importDefault(require("axios"));
8
- var baseURL = 'https://us.api.konversi.net/api';
9
- var timeout = 30000;
10
- var instance = axios_1.default.create({
11
- baseURL: baseURL,
12
- timeout: timeout
13
- });
14
- var setAuthToken = function (token) {
15
- instance.defaults.headers.common.authorization = "Bearer ".concat(token);
16
- };
17
- exports.setAuthToken = setAuthToken;
18
- var setCompanyId = function (companyId) {
19
- instance.defaults.headers.common['Company'] = companyId;
20
- };
21
- exports.setCompanyId = setCompanyId;
22
- var clearAuthToken = function () {
23
- instance.defaults.headers.common.authorization = '';
24
- };
25
- exports.clearAuthToken = clearAuthToken;
26
- exports.default = instance;
@@ -1,62 +0,0 @@
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 EXPENSE = "expense";
27
- export declare const EXPENSE_LINE = "expense/expense-line";
28
- export declare const PAYMENT = "accounting/payment";
29
- export declare const INCOMING_PAYMENT_METHOD = "accounting/incoming-payment-method";
30
- export declare const FIXED_ASSET = "fixed-asset";
31
- export declare const STORE = "store";
32
- export declare const STORE_PRODUCT = "store/store-product";
33
- export declare const STORE_PRODUCT_GROUP = "store/store-product-group";
34
- export declare const ACCOUNT = "accounting/account";
35
- export declare const JOURNAL_ENTRY = "accounting/journal-entry";
36
- export declare const JOURNAL_ENTRY_LINE = "accounting/journal-entry-line";
37
- export declare const BILL_OF_MATERIALS = "manufacturing/bill-of-materials";
38
- export declare const BOM_COMPONENT = "manufacturing/bom-component";
39
- export declare const BOM_OPERATION = "manufacturing/bom-operation";
40
- export declare const PRODUCTION_ORDER = "manufacturing/production-order";
41
- export declare const PRODUCTION_ORDER_LINE = "manufacturing/production-order-line";
42
- export declare const SUBSIDIARY = "subsidiary";
43
- export declare const EMPLOYEE = "human-resources/employee";
44
- export declare const ATTENDANCE = "human-resources/attendance";
45
- export declare const VEHICLE = "fleet/vehicle";
46
- export declare const DELIVERY_JOB = "fleet/delivery-job";
47
- export declare const CUSTOM_ENTITY_SCHEMA = "custom-entity/schema";
48
- export declare const CUSTOM_ENTITY_OBJECT = "custom-entity";
49
- export declare const CUSTOM_ENTITY_FIELD = "custom-entity/field";
50
- export declare const AUTOMATION_JOB = "automation/job";
51
- export declare const AUTOMATION_SCRIPT = "automation/script";
52
- export declare const STOCK_ADJUSTMENT = "stock-adjustment";
53
- export declare const PURCHASE_ORDER_APPROVER = "approval/approver/purchase-order";
54
- export declare const SALES_ORDER_APPROVER = "approval/approver/sales-order";
55
- export declare const CUSTOM_DOCUMENT = "document-generator/custom-document";
56
- export declare const CUSTOM_FIELD = "custom-field";
57
- export declare const AUDIT_LOG = "audit-log";
58
- export declare const COMPANY_ALIAS = "company-alias";
59
- export declare const PRINT_JOB = "thermal-printer/print-job";
60
- export declare const WORK_ORDER = "order/sales-order?type=WORK_ORDER";
61
- export declare const INCOMING_SHIPMENT = "shipment/incoming-shipment";
62
- export declare const OUTGOING_SHIPMENT = "shipment/outgoing-shipment";
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AUTOMATION_JOB = exports.CUSTOM_ENTITY_FIELD = exports.CUSTOM_ENTITY_OBJECT = exports.CUSTOM_ENTITY_SCHEMA = exports.DELIVERY_JOB = exports.VEHICLE = exports.ATTENDANCE = exports.EMPLOYEE = exports.SUBSIDIARY = exports.PRODUCTION_ORDER_LINE = exports.PRODUCTION_ORDER = exports.BOM_OPERATION = 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.EXPENSE_LINE = exports.EXPENSE = 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.OUTGOING_SHIPMENT = exports.INCOMING_SHIPMENT = exports.WORK_ORDER = exports.PRINT_JOB = exports.COMPANY_ALIAS = exports.AUDIT_LOG = exports.CUSTOM_FIELD = exports.CUSTOM_DOCUMENT = exports.SALES_ORDER_APPROVER = exports.PURCHASE_ORDER_APPROVER = exports.STOCK_ADJUSTMENT = exports.AUTOMATION_SCRIPT = void 0;
5
- exports.COMPANY_PERMISSION = 'company-permission';
6
- exports.COMPANY_OPTION = 'company-option';
7
- exports.INVITATION = 'user/invitation';
8
- exports.CUSTOMER = 'contact/customer';
9
- exports.PRODUCT = 'product';
10
- exports.PRODUCT_ITEM = 'product/product-item';
11
- exports.PRODUCT_GROUP = 'product-group';
12
- exports.PURCHASE_ORDER = 'order/purchase-order';
13
- exports.PURCHASE_ORDER_LINE = 'order/purchase-order-line';
14
- exports.QUOTE = 'order/quote';
15
- exports.QUOTE_LINE = 'order/quote-line';
16
- exports.SALES_ORDER = 'order/sales-order';
17
- exports.SALES_ORDER_LINE = 'order/sales-order-line';
18
- exports.RENTAL_ORDER = 'order/rental-order';
19
- exports.RENTAL_ORDER_LINE = 'order/rental-order-line';
20
- exports.SUPPLIER = 'contact/supplier';
21
- exports.WAREHOUSE = 'warehouse';
22
- // Deliveries
23
- exports.INCOMING_DELIVERY = 'delivery/incoming-delivery';
24
- exports.INCOMING_DELIVERY_LINE = 'delivery/incoming-delivery-line';
25
- exports.OUTGOING_DELIVERY = 'delivery/outgoing-delivery';
26
- exports.OUTGOING_DELIVERY_LINE = 'delivery/outgoing-delivery-line';
27
- exports.INTERNAL_DELIVERY = 'delivery/internal-delivery';
28
- exports.INTERNAL_DELIVERY_LINE = 'delivery/internal-delivery-line';
29
- // Finance
30
- exports.INVOICE = 'invoice';
31
- exports.INVOICE_LINE = 'invoice/invoice-line';
32
- exports.EXPENSE = 'expense';
33
- exports.EXPENSE_LINE = 'expense/expense-line';
34
- exports.PAYMENT = 'accounting/payment';
35
- exports.INCOMING_PAYMENT_METHOD = 'accounting/incoming-payment-method';
36
- exports.FIXED_ASSET = 'fixed-asset';
37
- // ECommerce
38
- exports.STORE = 'store';
39
- exports.STORE_PRODUCT = 'store/store-product';
40
- exports.STORE_PRODUCT_GROUP = 'store/store-product-group';
41
- // Accounting
42
- exports.ACCOUNT = 'accounting/account';
43
- exports.JOURNAL_ENTRY = 'accounting/journal-entry';
44
- exports.JOURNAL_ENTRY_LINE = 'accounting/journal-entry-line';
45
- // Manufacturing
46
- exports.BILL_OF_MATERIALS = 'manufacturing/bill-of-materials';
47
- exports.BOM_COMPONENT = 'manufacturing/bom-component';
48
- exports.BOM_OPERATION = 'manufacturing/bom-operation';
49
- exports.PRODUCTION_ORDER = 'manufacturing/production-order';
50
- exports.PRODUCTION_ORDER_LINE = 'manufacturing/production-order-line';
51
- exports.SUBSIDIARY = 'subsidiary';
52
- // HR
53
- exports.EMPLOYEE = 'human-resources/employee';
54
- exports.ATTENDANCE = 'human-resources/attendance';
55
- // Fleet Management
56
- exports.VEHICLE = 'fleet/vehicle';
57
- exports.DELIVERY_JOB = 'fleet/delivery-job';
58
- // Custom Objects
59
- exports.CUSTOM_ENTITY_SCHEMA = 'custom-entity/schema';
60
- exports.CUSTOM_ENTITY_OBJECT = 'custom-entity'; // Need to add schemaName after this
61
- exports.CUSTOM_ENTITY_FIELD = 'custom-entity/field'; // Need to add schemaName after this
62
- // Automation
63
- exports.AUTOMATION_JOB = 'automation/job';
64
- exports.AUTOMATION_SCRIPT = 'automation/script';
65
- exports.STOCK_ADJUSTMENT = 'stock-adjustment';
66
- exports.PURCHASE_ORDER_APPROVER = 'approval/approver/purchase-order';
67
- exports.SALES_ORDER_APPROVER = 'approval/approver/sales-order';
68
- // Document Generation
69
- exports.CUSTOM_DOCUMENT = 'document-generator/custom-document';
70
- exports.CUSTOM_FIELD = 'custom-field';
71
- exports.AUDIT_LOG = 'audit-log';
72
- exports.COMPANY_ALIAS = 'company-alias';
73
- exports.PRINT_JOB = 'thermal-printer/print-job';
74
- exports.WORK_ORDER = 'order/sales-order?type=WORK_ORDER';
75
- // TODO: Deprecate
76
- exports.INCOMING_SHIPMENT = 'shipment/incoming-shipment';
77
- exports.OUTGOING_SHIPMENT = 'shipment/outgoing-shipment';
78
- ///
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
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
- var crudEndpoints_1 = require("../crudEndpoints");
7
- var index_1 = __importDefault(require("../index"));
8
- index_1.default.createObject(crudEndpoints_1.CUSTOMER, {});