@chift/chift-nodejs 1.0.26 → 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 +8 -0
- package/dist/src/modules/accounting.js +41 -0
- package/dist/src/modules/api.d.ts +2133 -83
- 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 +405 -15
- package/dist/src/modules/consumer.js +5 -0
- package/dist/src/modules/consumers.d.ts +2049 -84
- package/dist/src/modules/ecommerce.d.ts +2 -2
- package/dist/src/modules/integrations.d.ts +5 -0
- package/dist/src/modules/internalApi.d.ts +4 -4
- package/dist/src/modules/invoicing.d.ts +2 -2
- 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/sync.d.ts +1639 -67
- 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 +2682 -1001
- 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 -2
- package/src/types/public-api/schema.d.ts +2682 -1001
|
@@ -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,6 +16,10 @@ 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;
|
|
@@ -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) => {
|
|
@@ -7,10 +7,10 @@ type GetBankTransactionsParams = AutoPaginatedParams<operations['invoicing_get_b
|
|
|
7
7
|
declare const invoicingFactory: {
|
|
8
8
|
getInvoices(params?: GetInvoicesParams, options?: RawDataOption): RequestData<components['schemas']['InvoiceItemOut'][]>;
|
|
9
9
|
getInvoiceById(invoiceId: string, params?: operations['invoicing_get_invoice']['parameters']['query'], options?: RawDataOption): RequestData<components['schemas']['InvoiceItemOutSingle']>;
|
|
10
|
-
createInvoice(invoice: components['schemas']['
|
|
10
|
+
createInvoice(invoice: components['schemas']['backbone_common__models__invoicing__common__InvoiceItem'], options?: ClientRequestOption): RequestData<components['schemas']['InvoiceItemOut']>;
|
|
11
11
|
getProducts(options?: RawDataOption): RequestData<components['schemas']['ProductItemOut'][]>;
|
|
12
12
|
getProductById(productId: string, options?: RawDataOption): RequestData<components['schemas']['ProductItemOut']>;
|
|
13
|
-
createProduct(product: components['schemas']['
|
|
13
|
+
createProduct(product: components['schemas']['backbone_common__models__invoicing__common__ProductItem'], options?: ClientRequestOption): RequestData<components['schemas']['ProductItemOut']>;
|
|
14
14
|
getTaxes(options?: RawDataOption): RequestData<components['schemas']['InvoicingVatCode'][]>;
|
|
15
15
|
getTaxById(taxId: string, options?: RawDataOption): RequestData<components['schemas']['InvoicingVatCode']>;
|
|
16
16
|
getOpportunities(options?: RawDataOption): RequestData<components['schemas']['OpportunityItem'][]>;
|
|
@@ -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;
|