@chift/chift-nodejs 1.0.13 → 1.0.14
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 +59 -49
- package/dist/src/modules/api.d.ts +485 -395
- package/dist/src/modules/consumer.d.ts +97 -79
- package/dist/src/modules/consumer.js +8 -0
- package/dist/src/modules/consumers.d.ts +485 -395
- package/dist/src/modules/ecommerce.d.ts +11 -11
- 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/pos.d.ts +16 -16
- package/dist/src/modules/sync.d.ts +388 -316
- package/dist/src/types/api.d.ts +1 -0
- package/dist/src/types/public-api/schema.d.ts +1007 -1007
- package/package.json +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,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
|
};
|
|
@@ -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
|
|
12
|
+
getOrders(params: GetOrdersParams): RequestData<components['schemas']['OrderItem'][]>;
|
|
13
|
+
getCustomers(params?: GetCustomersParams): RequestData<components['schemas']['POSCustomerItem'][]>;
|
|
14
14
|
getOrder(orderId: string): RequestData<components['schemas']['OrderItem']>;
|
|
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:
|
|
21
|
+
getClosure(date: string, params?: operations['pos_get_closure']['parameters']['query']): RequestData<components['schemas']['ClosureItem']>;
|
|
22
|
+
getPayments(params: GetPaymentsParams): RequestData<components['schemas']['PaymentItem'][]>;
|
|
23
23
|
updateOrder(orderId: string, order: components['schemas']['UpdateOrderItem']): RequestData<components['schemas']['OrderItem']>;
|
|
24
|
-
getAccountingCategories(params
|
|
24
|
+
getAccountingCategories(params?: GetAccountingCategoriesParams): RequestData<components['schemas']['AccountingCategoryItem'][]>;
|
|
25
25
|
};
|
|
26
26
|
export { posFactory };
|