@chift/chift-nodejs 1.0.25 → 1.0.27
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/dist/src/modules/accounting.d.ts +11 -5
- package/dist/src/modules/accounting.js +67 -21
- package/dist/src/modules/api.d.ts +3729 -583
- package/dist/src/modules/api.js +2 -0
- package/dist/src/modules/banking.d.ts +3 -1
- package/dist/src/modules/banking.js +10 -2
- package/dist/src/modules/consumer.d.ts +722 -113
- package/dist/src/modules/consumer.js +5 -0
- package/dist/src/modules/consumers.d.ts +3657 -597
- package/dist/src/modules/ecommerce.d.ts +2 -2
- package/dist/src/modules/integrations.d.ts +6 -0
- package/dist/src/modules/internalApi.d.ts +4 -4
- package/dist/src/modules/invoicing.d.ts +7 -2
- package/dist/src/modules/invoicing.js +24 -0
- package/dist/src/modules/issues.d.ts +68 -0
- package/dist/src/modules/issues.js +33 -0
- package/dist/src/modules/pms.d.ts +3 -0
- package/dist/src/modules/pms.js +15 -0
- package/dist/src/modules/pos.d.ts +1 -0
- package/dist/src/modules/pos.js +8 -0
- package/dist/src/modules/sync.d.ts +2930 -482
- package/dist/src/modules/syncs.d.ts +0 -1
- package/dist/src/modules/syncs.js +0 -5
- package/dist/src/types/public-api/mappings.d.ts +21 -3
- package/dist/src/types/public-api/schema.d.ts +5593 -1670
- package/dist/test/modules/accounting.test.js +1 -29
- package/dist/test/modules/banking.test.js +3 -1
- package/dist/test/modules/consumer.test.js +1 -1
- package/dist/test/modules/raw-data.test.js +6 -4
- package/package.json +2 -3
- package/src/types/public-api/schema.d.ts +5593 -1670
|
@@ -10,9 +10,9 @@ type GetProductsParams = AutoPaginatedParams<operations['ecommerce_get_products'
|
|
|
10
10
|
type GetLocationsParams = AutoPaginatedParams<operations['ecommerce_get_locations']['parameters']['query']>;
|
|
11
11
|
declare const ecommerceFactory: {
|
|
12
12
|
getCustomers(params?: GetCustomersParams, options?: RawDataOption): RequestData<components['schemas']['CommerceCustomerItem'][]>;
|
|
13
|
-
getProducts(params?: GetProductsParams, options?: RawDataOption): RequestData<components['schemas']['
|
|
13
|
+
getProducts(params?: GetProductsParams, options?: RawDataOption): RequestData<components['schemas']['backbone_common__models__commerce__common__ProductItem'][]>;
|
|
14
14
|
getCustomer(customerId: string, options?: RawDataOption): RequestData<components['schemas']['CommerceCustomerItem']>;
|
|
15
|
-
getProduct(productId: string, options?: RawDataOption): RequestData<components['schemas']['
|
|
15
|
+
getProduct(productId: string, options?: RawDataOption): RequestData<components['schemas']['backbone_common__models__commerce__common__ProductItem']>;
|
|
16
16
|
getProductVariantById(variantId: string, options?: RawDataOption): RequestData<components['schemas']['VariantItem']>;
|
|
17
17
|
updateAvailableQuantity(variantId: string, inventoryDetails: components['schemas']['InventoryDetailsUpdate'], options?: ClientRequestOption): RequestData<components['schemas']['InventoryDetailsItem']>;
|
|
18
18
|
getLocations(params?: GetLocationsParams, options?: RawDataOption): RequestData<components['schemas']['CommerceLocationItemOut'][]>;
|
|
@@ -5,6 +5,7 @@ declare const Integrations: (internalApi: InternalAPI) => {
|
|
|
5
5
|
getIntegrations: (params?: operations[chiftOperations['getIntegrations']]['parameters']['query']) => Promise<{
|
|
6
6
|
integrationid: number;
|
|
7
7
|
name: string;
|
|
8
|
+
description?: string | null | undefined;
|
|
8
9
|
status: "active" | "inactive";
|
|
9
10
|
api: "Payment" | "Point of Sale" | "eCommerce" | "Accounting" | "Invoicing" | "Communication" | "Banking" | "Custom" | "Property Management System";
|
|
10
11
|
logo_url: string;
|
|
@@ -15,11 +16,16 @@ declare const Integrations: (internalApi: InternalAPI) => {
|
|
|
15
16
|
optional: boolean;
|
|
16
17
|
resource: string;
|
|
17
18
|
}[] | null;
|
|
19
|
+
operations_coverage: {
|
|
20
|
+
operation: string;
|
|
21
|
+
status: "SUPPORTED" | "NOT_IMPLEMENTED" | "NOT_SUPPORTED" | "UNDER_ANALYSIS";
|
|
22
|
+
}[] | null;
|
|
18
23
|
credentials: {
|
|
19
24
|
name: string;
|
|
20
25
|
optional: boolean;
|
|
21
26
|
}[] | null;
|
|
22
27
|
supported_countries?: string[] | null | undefined;
|
|
28
|
+
local_agent: boolean;
|
|
23
29
|
}[]>;
|
|
24
30
|
getIntegrationLogo: (integrationId: number, imageType: components['schemas']['ImageType']) => Promise<any>;
|
|
25
31
|
};
|
|
@@ -8,10 +8,10 @@ declare class InternalAPI {
|
|
|
8
8
|
relatedChainExecutionId?: string;
|
|
9
9
|
connectionId?: string;
|
|
10
10
|
integrationId?: string;
|
|
11
|
-
get: <T = any, R = import("axios").AxiosResponse<T, any>, D = any>(url: string, config?: import("axios").AxiosRequestConfig<D> | undefined) => Promise<R>;
|
|
12
|
-
post: <T = any, R = import("axios").AxiosResponse<T, any>, D = any>(url: string, data?: D | undefined, config?: import("axios").AxiosRequestConfig<D> | undefined) => Promise<R>;
|
|
13
|
-
patch: <T = any, R = import("axios").AxiosResponse<T, any>, D = any>(url: string, data?: D | undefined, config?: import("axios").AxiosRequestConfig<D> | undefined) => Promise<R>;
|
|
14
|
-
delete: <T = any, R = import("axios").AxiosResponse<T, any>, D = any>(url: string, config?: import("axios").AxiosRequestConfig<D> | undefined) => Promise<R>;
|
|
11
|
+
get: <T = any, R = import("axios").AxiosResponse<T, any, {}>, D = any>(url: string, config?: import("axios").AxiosRequestConfig<D> | undefined) => Promise<R>;
|
|
12
|
+
post: <T = any, R = import("axios").AxiosResponse<T, any, {}>, D = any>(url: string, data?: D | undefined, config?: import("axios").AxiosRequestConfig<D> | undefined) => Promise<R>;
|
|
13
|
+
patch: <T = any, R = import("axios").AxiosResponse<T, any, {}>, D = any>(url: string, data?: D | undefined, config?: import("axios").AxiosRequestConfig<D> | undefined) => Promise<R>;
|
|
14
|
+
delete: <T = any, R = import("axios").AxiosResponse<T, any, {}>, D = any>(url: string, config?: import("axios").AxiosRequestConfig<D> | undefined) => Promise<R>;
|
|
15
15
|
constructor(auth: AuthType);
|
|
16
16
|
getToken: () => Promise<void>;
|
|
17
17
|
getPaginationParams: (currPage: number) => {
|
|
@@ -2,13 +2,15 @@ import { components, operations } from '../types/public-api/schema';
|
|
|
2
2
|
import { AutoPaginatedParams, RequestData, RawDataOption, ClientRequestOption } from '../types/api';
|
|
3
3
|
type GetInvoicesParams = AutoPaginatedParams<operations['invoicing_get_invoices']['parameters']['query']>;
|
|
4
4
|
type GetContactsParams = AutoPaginatedParams<operations['invoicing_get_contacts']['parameters']['query']>;
|
|
5
|
+
type GetBankAccountsParams = AutoPaginatedParams<operations['invoicing_get_bank_accounts']['parameters']['query']>;
|
|
6
|
+
type GetBankTransactionsParams = AutoPaginatedParams<operations['invoicing_get_bank_transactions']['parameters']['query']>;
|
|
5
7
|
declare const invoicingFactory: {
|
|
6
8
|
getInvoices(params?: GetInvoicesParams, options?: RawDataOption): RequestData<components['schemas']['InvoiceItemOut'][]>;
|
|
7
9
|
getInvoiceById(invoiceId: string, params?: operations['invoicing_get_invoice']['parameters']['query'], options?: RawDataOption): RequestData<components['schemas']['InvoiceItemOutSingle']>;
|
|
8
|
-
createInvoice(invoice: components['schemas']['
|
|
10
|
+
createInvoice(invoice: components['schemas']['backbone_common__models__invoicing__common__InvoiceItem'], options?: ClientRequestOption): RequestData<components['schemas']['InvoiceItemOut']>;
|
|
9
11
|
getProducts(options?: RawDataOption): RequestData<components['schemas']['ProductItemOut'][]>;
|
|
10
12
|
getProductById(productId: string, options?: RawDataOption): RequestData<components['schemas']['ProductItemOut']>;
|
|
11
|
-
createProduct(product: components['schemas']['
|
|
13
|
+
createProduct(product: components['schemas']['backbone_common__models__invoicing__common__ProductItem'], options?: ClientRequestOption): RequestData<components['schemas']['ProductItemOut']>;
|
|
12
14
|
getTaxes(options?: RawDataOption): RequestData<components['schemas']['InvoicingVatCode'][]>;
|
|
13
15
|
getTaxById(taxId: string, options?: RawDataOption): RequestData<components['schemas']['InvoicingVatCode']>;
|
|
14
16
|
getOpportunities(options?: RawDataOption): RequestData<components['schemas']['OpportunityItem'][]>;
|
|
@@ -18,5 +20,8 @@ declare const invoicingFactory: {
|
|
|
18
20
|
createContact(contact: components['schemas']['ContactItemIn'], options?: ClientRequestOption): RequestData<components['schemas']['ContactItemOut']>;
|
|
19
21
|
getPayments(options?: RawDataOption): RequestData<components['schemas']['InvoicingPaymentItem'][]>;
|
|
20
22
|
getPaymentMethods(options?: RawDataOption): RequestData<components['schemas']['InvoicingPaymentMethodItem'][]>;
|
|
23
|
+
getBankAccounts(params?: GetBankAccountsParams, options?: RawDataOption): RequestData<components['schemas']['ChiftPage_InvoicingBankAccountItem_']>;
|
|
24
|
+
getBankTransactions(params: GetBankTransactionsParams, options?: RawDataOption): RequestData<components['schemas']['ChiftPage_InvoicingBankTransactionItem_']>;
|
|
25
|
+
uploadDocument(document: components['schemas']['AttachmentItemIn'], options?: ClientRequestOption): RequestData<components['schemas']['UploadDocumentItemOut']>;
|
|
21
26
|
};
|
|
22
27
|
export { invoicingFactory };
|
|
@@ -113,5 +113,29 @@ const invoicingFactory = {
|
|
|
113
113
|
rawData: options === null || options === void 0 ? void 0 : options.rawData,
|
|
114
114
|
};
|
|
115
115
|
},
|
|
116
|
+
getBankAccounts(params, options) {
|
|
117
|
+
return {
|
|
118
|
+
method: 'get',
|
|
119
|
+
url: `/consumers/{consumer_id}/invoicing/bank-accounts`,
|
|
120
|
+
params: params,
|
|
121
|
+
rawData: options === null || options === void 0 ? void 0 : options.rawData,
|
|
122
|
+
};
|
|
123
|
+
},
|
|
124
|
+
getBankTransactions(params, options) {
|
|
125
|
+
return {
|
|
126
|
+
method: 'get',
|
|
127
|
+
url: `/consumers/{consumer_id}/invoicing/bank-transactions`,
|
|
128
|
+
params: params,
|
|
129
|
+
rawData: options === null || options === void 0 ? void 0 : options.rawData,
|
|
130
|
+
};
|
|
131
|
+
},
|
|
132
|
+
uploadDocument(document, options) {
|
|
133
|
+
return {
|
|
134
|
+
method: 'post',
|
|
135
|
+
url: `/consumers/{consumer_id}/invoicing/upload-document`,
|
|
136
|
+
body: document,
|
|
137
|
+
clientRequestId: options === null || options === void 0 ? void 0 : options.clientRequestId,
|
|
138
|
+
};
|
|
139
|
+
},
|
|
116
140
|
};
|
|
117
141
|
exports.invoicingFactory = invoicingFactory;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { operations } from '../types/public-api/schema';
|
|
2
|
+
import { InternalAPI } from './internalApi';
|
|
3
|
+
declare const Issues: (internalApi: InternalAPI) => {
|
|
4
|
+
getIssues: (params?: operations['issues_get_issues']['parameters']['query']) => Promise<{
|
|
5
|
+
id: string;
|
|
6
|
+
consumer_id: string;
|
|
7
|
+
connection_id: string;
|
|
8
|
+
integration_id: number;
|
|
9
|
+
integration_name: string;
|
|
10
|
+
created_on: string;
|
|
11
|
+
updated_on: string;
|
|
12
|
+
last_seen: string;
|
|
13
|
+
error: {
|
|
14
|
+
error_code: string;
|
|
15
|
+
status: string;
|
|
16
|
+
title: string;
|
|
17
|
+
description?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
occurrences: number;
|
|
20
|
+
level: "error" | "warning";
|
|
21
|
+
}[]>;
|
|
22
|
+
getIssuesByConsumerId: (consumerId: string, params?: operations['issues_get_issues_by_consumer_id']['parameters']['query']) => Promise<{
|
|
23
|
+
id: string;
|
|
24
|
+
consumer_id: string;
|
|
25
|
+
connection_id: string;
|
|
26
|
+
integration_id: number;
|
|
27
|
+
integration_name: string;
|
|
28
|
+
created_on: string;
|
|
29
|
+
updated_on: string;
|
|
30
|
+
last_seen: string;
|
|
31
|
+
error: {
|
|
32
|
+
error_code: string;
|
|
33
|
+
status: string;
|
|
34
|
+
title: string;
|
|
35
|
+
description?: string | undefined;
|
|
36
|
+
};
|
|
37
|
+
occurrences: number;
|
|
38
|
+
level: "error" | "warning";
|
|
39
|
+
}[]>;
|
|
40
|
+
getIssue: (issueId: string, params?: operations['issues_get_issue']['parameters']['query']) => Promise<{
|
|
41
|
+
id: string;
|
|
42
|
+
consumer_id: string;
|
|
43
|
+
connection_id: string;
|
|
44
|
+
integration_id: number;
|
|
45
|
+
integration_name: string;
|
|
46
|
+
created_on: string;
|
|
47
|
+
updated_on: string;
|
|
48
|
+
last_seen: string;
|
|
49
|
+
error: {
|
|
50
|
+
error_code: string;
|
|
51
|
+
status: string;
|
|
52
|
+
title: string;
|
|
53
|
+
description?: string | undefined;
|
|
54
|
+
};
|
|
55
|
+
occurrences: number;
|
|
56
|
+
level: "error" | "warning";
|
|
57
|
+
events: {
|
|
58
|
+
id: string;
|
|
59
|
+
execution_id: string;
|
|
60
|
+
created_on: string;
|
|
61
|
+
context?: {
|
|
62
|
+
[key: string]: unknown;
|
|
63
|
+
} | null | undefined;
|
|
64
|
+
message?: string | null | undefined;
|
|
65
|
+
}[];
|
|
66
|
+
}>;
|
|
67
|
+
};
|
|
68
|
+
export { Issues };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Issues = void 0;
|
|
13
|
+
const Issues = (internalApi) => {
|
|
14
|
+
const _internalApi = internalApi;
|
|
15
|
+
const getIssues = (params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
const { data, } = yield _internalApi.get('/issues', { params });
|
|
17
|
+
return data;
|
|
18
|
+
});
|
|
19
|
+
const getIssuesByConsumerId = (consumerId, params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
+
const { data, } = yield _internalApi.get(`/consumers/${consumerId}/issues`, { params });
|
|
21
|
+
return data;
|
|
22
|
+
});
|
|
23
|
+
const getIssue = (issueId, params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
+
const { data, } = yield _internalApi.get(`/issues/${issueId}`, { params });
|
|
25
|
+
return data;
|
|
26
|
+
});
|
|
27
|
+
return {
|
|
28
|
+
getIssues,
|
|
29
|
+
getIssuesByConsumerId,
|
|
30
|
+
getIssue,
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
exports.Issues = Issues;
|
|
@@ -6,6 +6,7 @@ type GetAccountingCategoriesParams = AutoPaginatedParams<operations['pms_get_acc
|
|
|
6
6
|
type GetOrdersParams = AutoPaginatedParams<operations['pms_get_orders']['parameters']['query']>;
|
|
7
7
|
type GetCustomersParams = AutoPaginatedParams<operations['pms_get_customers']['parameters']['query']>;
|
|
8
8
|
type GetInvoicesParams = AutoPaginatedParams<operations['pms_get_invoices']['parameters']['query']>;
|
|
9
|
+
type GetTaxesParams = AutoPaginatedParams<operations['pms_get_taxes']['parameters']['query']>;
|
|
9
10
|
declare const pmsFactory: {
|
|
10
11
|
getLocations(rawData?: boolean): RequestData<components['schemas']['PMSLocationItem'][]>;
|
|
11
12
|
getOrders(params: GetOrdersParams, rawData?: boolean): RequestData<components['schemas']['PMSOrderItem'][]>;
|
|
@@ -14,6 +15,8 @@ declare const pmsFactory: {
|
|
|
14
15
|
getPayments(params: GetPaymentsParams, rawData?: boolean): RequestData<components['schemas']['PMSPaymentItem'][]>;
|
|
15
16
|
getAccountingCategories(params?: GetAccountingCategoriesParams, rawData?: boolean): RequestData<components['schemas']['PMSAccountingCategoryItem'][]>;
|
|
16
17
|
getCustomers(params?: GetCustomersParams, rawData?: boolean): RequestData<components['schemas']['PMSCustomerItem'][]>;
|
|
18
|
+
getCustomer(customerId: string, rawData?: boolean): RequestData<components['schemas']['PMSCustomerItem']>;
|
|
17
19
|
getInvoices(params?: GetInvoicesParams, rawData?: boolean): RequestData<components['schemas']['PMSInvoiceFullItem'][]>;
|
|
20
|
+
getTaxes(params?: GetTaxesParams, rawData?: boolean): RequestData<components['schemas']['ChiftPage_PMSTaxRateItem_']>;
|
|
18
21
|
};
|
|
19
22
|
export { pmsFactory };
|
package/dist/src/modules/pms.js
CHANGED
|
@@ -57,6 +57,13 @@ const pmsFactory = {
|
|
|
57
57
|
rawData,
|
|
58
58
|
};
|
|
59
59
|
},
|
|
60
|
+
getCustomer(customerId, rawData) {
|
|
61
|
+
return {
|
|
62
|
+
method: 'get',
|
|
63
|
+
url: `/consumers/{consumer_id}/pms/customers/${customerId}`,
|
|
64
|
+
rawData,
|
|
65
|
+
};
|
|
66
|
+
},
|
|
60
67
|
getInvoices(params, rawData) {
|
|
61
68
|
return {
|
|
62
69
|
params,
|
|
@@ -65,5 +72,13 @@ const pmsFactory = {
|
|
|
65
72
|
rawData,
|
|
66
73
|
};
|
|
67
74
|
},
|
|
75
|
+
getTaxes(params, rawData) {
|
|
76
|
+
return {
|
|
77
|
+
params,
|
|
78
|
+
method: 'get',
|
|
79
|
+
url: '/consumers/{consumer_id}/pms/taxes',
|
|
80
|
+
rawData,
|
|
81
|
+
};
|
|
82
|
+
},
|
|
68
83
|
};
|
|
69
84
|
exports.pmsFactory = pmsFactory;
|
|
@@ -22,5 +22,6 @@ declare const posFactory: {
|
|
|
22
22
|
getPayments(params: GetPaymentsParams, options?: RawDataOption): RequestData<components['schemas']['POSPaymentItem'][]>;
|
|
23
23
|
updateOrder(orderId: string, order: components['schemas']['UpdateOrderItem'], options?: ClientRequestOption): RequestData<components['schemas']['POSOrderItem']>;
|
|
24
24
|
getAccountingCategories(params?: GetAccountingCategoriesParams, options?: RawDataOption): RequestData<components['schemas']['AccountingCategoryItem'][]>;
|
|
25
|
+
getObjectives(params: operations['pos_get_objectives']['parameters']['query'], options?: RawDataOption): RequestData<components['schemas']['ChiftPage_ObjectivesItem_']>;
|
|
25
26
|
};
|
|
26
27
|
export { posFactory };
|
package/dist/src/modules/pos.js
CHANGED
|
@@ -111,5 +111,13 @@ const posFactory = {
|
|
|
111
111
|
rawData: options === null || options === void 0 ? void 0 : options.rawData,
|
|
112
112
|
};
|
|
113
113
|
},
|
|
114
|
+
getObjectives(params, options) {
|
|
115
|
+
return {
|
|
116
|
+
params,
|
|
117
|
+
method: 'get',
|
|
118
|
+
url: `/consumers/{consumer_id}/pos/objectives`,
|
|
119
|
+
rawData: options === null || options === void 0 ? void 0 : options.rawData,
|
|
120
|
+
};
|
|
121
|
+
},
|
|
114
122
|
};
|
|
115
123
|
exports.posFactory = posFactory;
|