@chift/chift-nodejs 1.0.13 → 1.0.15
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/.eslintcache +1 -1
- package/CHANGELOG.md +7 -1
- package/dist/src/modules/accounting.d.ts +59 -49
- package/dist/src/modules/api.d.ts +1626 -691
- package/dist/src/modules/consumer.d.ts +318 -131
- package/dist/src/modules/consumer.js +11 -0
- package/dist/src/modules/consumers.d.ts +1625 -690
- package/dist/src/modules/ecommerce.d.ts +11 -11
- package/dist/src/modules/integrations.d.ts +1 -1
- package/dist/src/modules/internalApi.d.ts +2 -0
- package/dist/src/modules/internalApi.js +6 -0
- package/dist/src/modules/invoicing.d.ts +6 -4
- package/dist/src/modules/pms.d.ts +15 -0
- package/dist/src/modules/pms.js +47 -0
- package/dist/src/modules/pos.d.ts +18 -18
- package/dist/src/modules/sync.d.ts +1299 -551
- package/dist/src/types/api.d.ts +1 -0
- package/dist/src/types/public-api/schema.d.ts +1870 -1178
- package/package.json +1 -1
- package/src/modules/consumer.ts +3 -0
- package/src/modules/pms.ts +67 -0
- package/src/modules/pos.ts +4 -4
- package/src/types/public-api/schema.d.ts +12029 -0
- package/src/types/public-api/schema.ts +987 -288
- package/test/modules/pos.test.ts +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { operations, components } from '../types/public-api/schema';
|
|
2
|
-
import { RequestData } from '../types/api';
|
|
3
|
-
type
|
|
4
|
-
type
|
|
5
|
-
type
|
|
6
|
-
type
|
|
7
|
-
type
|
|
2
|
+
import { AutoPaginatedParams, RequestData } from '../types/api';
|
|
3
|
+
type GetOrdersParams = AutoPaginatedParams<operations['ecommerce_get_orders']['parameters']['query']>;
|
|
4
|
+
type GetPaymentMethodsParams = AutoPaginatedParams<operations['ecommerce_get_payments_methods']['parameters']['query']>;
|
|
5
|
+
type GetProductCategoriesParams = AutoPaginatedParams<operations['ecommerce_get_product_categories']['parameters']['query']>;
|
|
6
|
+
type GetTaxesParams = AutoPaginatedParams<operations['ecommerce_get_taxes']['parameters']['query']>;
|
|
7
|
+
type GetCountriesParams = AutoPaginatedParams<operations['ecommerce_get_countries']['parameters']['query']>;
|
|
8
8
|
declare const ecommerceFactory: {
|
|
9
9
|
getCustomers(): RequestData<components['schemas']['CommerceCustomerItem'][]>;
|
|
10
10
|
getProducts(): RequestData<components['schemas']['app__routers__commerce__ProductItem'][]>;
|
|
@@ -13,12 +13,12 @@ declare const ecommerceFactory: {
|
|
|
13
13
|
getProductVariantById(variantId: string): RequestData<components['schemas']['VariantItem']>;
|
|
14
14
|
updateAvailableQuantity(variantId: string, inventoryDetails: components['schemas']['InventoryDetailsUpdate']): RequestData<components['schemas']['InventoryDetailsItem']>;
|
|
15
15
|
getLocations(): RequestData<components['schemas']['CommerceLocationItem'][]>;
|
|
16
|
-
getOrders(params
|
|
16
|
+
getOrders(params?: GetOrdersParams): RequestData<components['schemas']['OrderItemOut'][]>;
|
|
17
17
|
createOrder(order: components['schemas']['OrderItemIn']): RequestData<components['schemas']['OrderItemOut']>;
|
|
18
18
|
getOrder(orderId: string): RequestData<components['schemas']['OrderItemOut']>;
|
|
19
|
-
getPaymentMethods(params
|
|
20
|
-
getProductCategories(params
|
|
21
|
-
getTaxes(params
|
|
22
|
-
getCountries(params
|
|
19
|
+
getPaymentMethods(params?: GetPaymentMethodsParams): RequestData<components['schemas']['PaymentMethodItem'][]>;
|
|
20
|
+
getProductCategories(params?: GetProductCategoriesParams): RequestData<components['schemas']['CategoryItem'][]>;
|
|
21
|
+
getTaxes(params?: GetTaxesParams): RequestData<components['schemas']['TaxRateItem'][]>;
|
|
22
|
+
getCountries(params?: GetCountriesParams): RequestData<components['schemas']['CountryItem'][]>;
|
|
23
23
|
};
|
|
24
24
|
export { ecommerceFactory };
|
|
@@ -6,7 +6,7 @@ declare const Integrations: (internalApi: InternalAPI) => {
|
|
|
6
6
|
integrationid: number;
|
|
7
7
|
name: string;
|
|
8
8
|
status: "active" | "inactive";
|
|
9
|
-
api: "Point of Sale" | "eCommerce" | "Accounting" | "Invoicing" | "Communication" | "Banking" | "Custom" | "Payment";
|
|
9
|
+
api: "Point of Sale" | "eCommerce" | "Accounting" | "Invoicing" | "Communication" | "Banking" | "Custom" | "Payment" | "Property Management System";
|
|
10
10
|
logo_url: string;
|
|
11
11
|
icon_url: string;
|
|
12
12
|
credentials?: {
|
|
@@ -6,6 +6,8 @@ declare class InternalAPI {
|
|
|
6
6
|
token?: TokenType;
|
|
7
7
|
debug: boolean;
|
|
8
8
|
relatedChainExecutionId?: string;
|
|
9
|
+
connectionId?: string;
|
|
10
|
+
integrationId?: string;
|
|
9
11
|
get: <T = any, R = import("axios").AxiosResponse<T, any>, D = any>(url: string, config?: import("axios").AxiosRequestConfig<D> | undefined) => Promise<R>;
|
|
10
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>;
|
|
11
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>;
|
|
@@ -59,6 +59,12 @@ class InternalAPI {
|
|
|
59
59
|
this.instance.interceptors.request.use((config) => {
|
|
60
60
|
return new Promise((resolve, reject) => {
|
|
61
61
|
var _a, _b;
|
|
62
|
+
if (this.connectionId) {
|
|
63
|
+
config.headers['X-Chift-ConnectionId'] = this.connectionId;
|
|
64
|
+
}
|
|
65
|
+
if (this.integrationId) {
|
|
66
|
+
config.headers['X-Chift-IntegrationId'] = this.integrationId;
|
|
67
|
+
}
|
|
62
68
|
if (this.relatedChainExecutionId) {
|
|
63
69
|
config.headers['X-Chift-RelatedChainExecutionId'] =
|
|
64
70
|
this.relatedChainExecutionId;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { components, operations } from '../types/public-api/schema';
|
|
2
|
-
import { RequestData } from '../types/api';
|
|
2
|
+
import { AutoPaginatedParams, RequestData } from '../types/api';
|
|
3
|
+
type GetInvoicesParams = AutoPaginatedParams<operations['invoicing_get_invoices']['parameters']['query']>;
|
|
4
|
+
type GetContactsParams = AutoPaginatedParams<operations['invoicing_get_contacts']['parameters']['query']>;
|
|
3
5
|
declare const invoicingFactory: {
|
|
4
|
-
getInvoices(params
|
|
5
|
-
getInvoiceById(invoiceId: string, params
|
|
6
|
+
getInvoices(params?: GetInvoicesParams): RequestData<components['schemas']['InvoiceItemOut'][]>;
|
|
7
|
+
getInvoiceById(invoiceId: string, params?: operations['invoicing_get_invoice']['parameters']['query']): RequestData<components['schemas']['InvoiceItemOut']>;
|
|
6
8
|
createInvoice(invoice: components['schemas']['InvoiceItem']): RequestData<components['schemas']['InvoiceItemOut']>;
|
|
7
9
|
getProducts(): RequestData<components['schemas']['ProductItemOut'][]>;
|
|
8
10
|
getProductById(productId: string): RequestData<components['schemas']['ProductItemOut']>;
|
|
@@ -11,7 +13,7 @@ declare const invoicingFactory: {
|
|
|
11
13
|
getTaxById(taxId: string): RequestData<components['schemas']['models__invoicing__VatCode']>;
|
|
12
14
|
getOpportunities(): RequestData<components['schemas']['OpportunityItem'][]>;
|
|
13
15
|
getOpportunitiesById(opportunityId: string): RequestData<components['schemas']['OpportunityItem']>;
|
|
14
|
-
getContacts(params?:
|
|
16
|
+
getContacts(params?: GetContactsParams): RequestData<components['schemas']['ContactItemOut'][]>;
|
|
15
17
|
getContactById(contactId: string): RequestData<components['schemas']['ContactItemOut']>;
|
|
16
18
|
createContact(contact: components['schemas']['ContactItemIn']): RequestData<components['schemas']['ContactItemOut']>;
|
|
17
19
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { operations, components } from '../types/public-api/schema';
|
|
2
|
+
import { AutoPaginatedParams, RequestData } from '../types/api';
|
|
3
|
+
type GetPaymentsParams = AutoPaginatedParams<operations['pms_get_payments']['parameters']['query']>;
|
|
4
|
+
type GetPaymentMethodsParams = AutoPaginatedParams<operations['pms_get_payments_methods']['parameters']['query']>;
|
|
5
|
+
type GetAccountingCategoriesParams = AutoPaginatedParams<operations['pms_get_accounting_categories']['parameters']['query']>;
|
|
6
|
+
type GetOrdersParams = AutoPaginatedParams<operations['pms_get_orders']['parameters']['query']>;
|
|
7
|
+
declare const pmsFactory: {
|
|
8
|
+
getLocations(): RequestData<components['schemas']['PMSLocationItem'][]>;
|
|
9
|
+
getOrders(params: GetOrdersParams): RequestData<components['schemas']['PMSOrderItem'][]>;
|
|
10
|
+
getPaymentMethods(params?: GetPaymentMethodsParams): RequestData<components['schemas']['PMSPaymentMethods'][]>;
|
|
11
|
+
getClosure(date: string, params?: operations['pms_get_closure']['parameters']['query']): RequestData<components['schemas']['PMSClosureItem']>;
|
|
12
|
+
getPayments(params: GetPaymentsParams): RequestData<components['schemas']['PMSPaymentItem'][]>;
|
|
13
|
+
getAccountingCategories(params?: GetAccountingCategoriesParams): RequestData<components['schemas']['PMSAccountingCategoryItem'][]>;
|
|
14
|
+
};
|
|
15
|
+
export { pmsFactory };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pmsFactory = void 0;
|
|
4
|
+
const pmsFactory = {
|
|
5
|
+
getLocations() {
|
|
6
|
+
return {
|
|
7
|
+
method: 'get',
|
|
8
|
+
url: '/consumers/{consumer_id}/pms/locations',
|
|
9
|
+
};
|
|
10
|
+
},
|
|
11
|
+
getOrders(params) {
|
|
12
|
+
return {
|
|
13
|
+
params,
|
|
14
|
+
method: 'get',
|
|
15
|
+
url: '/consumers/{consumer_id}/pms/orders',
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
getPaymentMethods(params) {
|
|
19
|
+
return {
|
|
20
|
+
params,
|
|
21
|
+
method: 'get',
|
|
22
|
+
url: `/consumers/{consumer_id}/pms/payment-methods`,
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
getClosure(date, params) {
|
|
26
|
+
return {
|
|
27
|
+
params,
|
|
28
|
+
method: 'get',
|
|
29
|
+
url: `/consumers/{consumer_id}/pms/closures/${date}`,
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
getPayments(params) {
|
|
33
|
+
return {
|
|
34
|
+
params,
|
|
35
|
+
method: 'get',
|
|
36
|
+
url: `/consumers/{consumer_id}/pms/payments`,
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
getAccountingCategories(params) {
|
|
40
|
+
return {
|
|
41
|
+
params,
|
|
42
|
+
method: 'get',
|
|
43
|
+
url: `/consumers/{consumer_id}/pms/accounting-categories`,
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
exports.pmsFactory = pmsFactory;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { operations, components } from '../types/public-api/schema';
|
|
2
|
-
import { RequestData } from '../types/api';
|
|
3
|
-
type
|
|
4
|
-
type
|
|
5
|
-
type
|
|
6
|
-
type
|
|
7
|
-
type
|
|
8
|
-
type
|
|
9
|
-
type
|
|
2
|
+
import { AutoPaginatedParams, RequestData } from '../types/api';
|
|
3
|
+
type GetPaymentsParams = AutoPaginatedParams<operations['pos_get_payments']['parameters']['query']>;
|
|
4
|
+
type GetPaymentMethodsParams = AutoPaginatedParams<operations['pos_get_payments_methods']['parameters']['query']>;
|
|
5
|
+
type GetProductCategoriesParams = AutoPaginatedParams<operations['pos_get_product_categories']['parameters']['query']>;
|
|
6
|
+
type GetProductsParams = AutoPaginatedParams<operations['pos_get_products']['parameters']['query']>;
|
|
7
|
+
type GetCustomersParams = AutoPaginatedParams<operations['pos_get_customers']['parameters']['query']>;
|
|
8
|
+
type GetAccountingCategoriesParams = AutoPaginatedParams<operations['pos_get_accounting_categories']['parameters']['query']>;
|
|
9
|
+
type GetOrdersParams = AutoPaginatedParams<operations['pos_get_orders']['parameters']['query']>;
|
|
10
10
|
declare const posFactory: {
|
|
11
11
|
getLocations(): RequestData<components['schemas']['POSLocationItem'][]>;
|
|
12
|
-
getOrders(params:
|
|
13
|
-
getCustomers(params
|
|
14
|
-
getOrder(orderId: string): RequestData<components['schemas']['
|
|
12
|
+
getOrders(params: GetOrdersParams): RequestData<components['schemas']['POSOrderItem'][]>;
|
|
13
|
+
getCustomers(params?: GetCustomersParams): RequestData<components['schemas']['POSCustomerItem'][]>;
|
|
14
|
+
getOrder(orderId: string): RequestData<components['schemas']['POSOrderItem']>;
|
|
15
15
|
getCustomer(customerId: string): RequestData<components['schemas']['POSCustomerItem']>;
|
|
16
16
|
createCustomer(customer: components['schemas']['POSCreateCustomerItem']): RequestData<components['schemas']['POSCustomerItem']>;
|
|
17
|
-
getPaymentMethods(params
|
|
18
|
-
getProductCategories(params
|
|
19
|
-
getProducts(params
|
|
17
|
+
getPaymentMethods(params?: GetPaymentMethodsParams): RequestData<components['schemas']['PaymentMethods'][]>;
|
|
18
|
+
getProductCategories(params?: GetProductCategoriesParams): RequestData<components['schemas']['CategoryItem'][]>;
|
|
19
|
+
getProducts(params?: GetProductsParams): RequestData<components['schemas']['POSProductItem'][]>;
|
|
20
20
|
getSales(params: operations['pos_get_sales']['parameters']['query']): RequestData<components['schemas']['SalesItem']>;
|
|
21
|
-
getClosure(date: string, params
|
|
22
|
-
getPayments(params:
|
|
23
|
-
updateOrder(orderId: string, order: components['schemas']['UpdateOrderItem']): RequestData<components['schemas']['
|
|
24
|
-
getAccountingCategories(params
|
|
21
|
+
getClosure(date: string, params?: operations['pos_get_closure']['parameters']['query']): RequestData<components['schemas']['ClosureItem']>;
|
|
22
|
+
getPayments(params: GetPaymentsParams): RequestData<components['schemas']['POSPaymentItem'][]>;
|
|
23
|
+
updateOrder(orderId: string, order: components['schemas']['UpdateOrderItem']): RequestData<components['schemas']['POSOrderItem']>;
|
|
24
|
+
getAccountingCategories(params?: GetAccountingCategoriesParams): RequestData<components['schemas']['AccountingCategoryItem'][]>;
|
|
25
25
|
};
|
|
26
26
|
export { posFactory };
|