@chift/chift-nodejs 1.0.20 → 1.0.22
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 +7 -4
- package/dist/src/modules/accounting.js +15 -0
- package/dist/src/modules/api.d.ts +2059 -169
- package/dist/src/modules/consumer.d.ts +387 -22
- package/dist/src/modules/consumer.js +10 -0
- package/dist/src/modules/consumers.d.ts +2028 -163
- package/dist/src/modules/datastores.d.ts +17 -0
- package/dist/src/modules/datastores.js +19 -0
- package/dist/src/modules/ecommerce.d.ts +2 -2
- package/dist/src/modules/flow.d.ts +6 -0
- package/dist/src/modules/flow.js +5 -0
- package/dist/src/modules/integrations.d.ts +2 -1
- package/dist/src/modules/integrations.js +5 -0
- package/dist/src/modules/invoicing.d.ts +6 -4
- package/dist/src/modules/invoicing.js +12 -0
- package/dist/src/modules/pms.d.ts +4 -0
- package/dist/src/modules/pms.js +14 -0
- package/dist/src/modules/sync.d.ts +1680 -143
- package/dist/src/modules/sync.js +15 -0
- package/dist/src/modules/syncs.d.ts +3 -0
- package/dist/src/modules/syncs.js +15 -0
- package/dist/src/modules/webhooks.d.ts +2 -0
- package/dist/src/types/public-api/schema.d.ts +1755 -779
- package/dist/src/types/public-api/schema.js +6 -0
- package/dist/test/modules/accounting.test.js +4 -0
- package/dist/test/modules/invoicing.test.js +15 -0
- package/dist/test/modules/pms.test.js +17 -0
- package/package.json +1 -1
- package/src/types/public-api/schema.d.ts +1755 -779
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { components } from '../types/public-api/schema';
|
|
1
2
|
import { InternalAPI } from './internalApi';
|
|
2
3
|
declare const DataStores: (internalApi: InternalAPI) => {
|
|
3
4
|
getDataStores: () => Promise<{
|
|
@@ -14,5 +15,21 @@ declare const DataStores: (internalApi: InternalAPI) => {
|
|
|
14
15
|
search_column?: string | undefined;
|
|
15
16
|
};
|
|
16
17
|
}[]>;
|
|
18
|
+
getConsumerDataStoreData: (consumerId: string, datastoreId: string) => Promise<{
|
|
19
|
+
data: Record<string, never>;
|
|
20
|
+
id: string;
|
|
21
|
+
created_on: string;
|
|
22
|
+
}[]>;
|
|
23
|
+
createConsumerDataStoreData: (consumerId: string, datastoreId: string, body: components['schemas']['DataItem']) => Promise<{
|
|
24
|
+
data: Record<string, never>;
|
|
25
|
+
id: string;
|
|
26
|
+
created_on: string;
|
|
27
|
+
}>;
|
|
28
|
+
updateConsumerDataStoreData: (consumerId: string, datastoreId: string, datastoreDataId: string, body: components['schemas']['DataItem']) => Promise<{
|
|
29
|
+
data: Record<string, never>;
|
|
30
|
+
id: string;
|
|
31
|
+
created_on: string;
|
|
32
|
+
}>;
|
|
33
|
+
deleteConsumerDataStoreData: (consumerId: string, datastoreId: string, datastoreDataId: string) => Promise<void>;
|
|
17
34
|
};
|
|
18
35
|
export { DataStores };
|
|
@@ -16,8 +16,27 @@ const DataStores = (internalApi) => {
|
|
|
16
16
|
const { data } = yield _internalApi.get('/datastores');
|
|
17
17
|
return data;
|
|
18
18
|
});
|
|
19
|
+
const getConsumerDataStoreData = (consumerId, datastoreId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
+
const { data } = yield _internalApi.get(`/consumers/${consumerId}/datastore/${datastoreId}/data`);
|
|
21
|
+
return data;
|
|
22
|
+
});
|
|
23
|
+
const createConsumerDataStoreData = (consumerId, datastoreId, body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
+
const { data } = yield _internalApi.post(`/consumers/${consumerId}/datastore/${datastoreId}/data`, body);
|
|
25
|
+
return data;
|
|
26
|
+
});
|
|
27
|
+
const updateConsumerDataStoreData = (consumerId, datastoreId, datastoreDataId, body) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
+
const { data } = yield _internalApi.patch(`/consumers/${consumerId}/datastore/${datastoreId}/data/${datastoreDataId}`, body);
|
|
29
|
+
return data;
|
|
30
|
+
});
|
|
31
|
+
const deleteConsumerDataStoreData = (consumerId, datastoreId, datastoreDataId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
+
yield _internalApi.delete(`/consumers/${consumerId}/datastore/${datastoreId}/data/${datastoreDataId}`);
|
|
33
|
+
});
|
|
19
34
|
return {
|
|
20
35
|
getDataStores,
|
|
36
|
+
getConsumerDataStoreData,
|
|
37
|
+
createConsumerDataStoreData,
|
|
38
|
+
updateConsumerDataStoreData,
|
|
39
|
+
deleteConsumerDataStoreData,
|
|
21
40
|
};
|
|
22
41
|
};
|
|
23
42
|
exports.DataStores = DataStores;
|
|
@@ -7,9 +7,9 @@ type GetTaxesParams = AutoPaginatedParams<operations['ecommerce_get_taxes']['par
|
|
|
7
7
|
type GetCountriesParams = AutoPaginatedParams<operations['ecommerce_get_countries']['parameters']['query']>;
|
|
8
8
|
declare const ecommerceFactory: {
|
|
9
9
|
getCustomers(): RequestData<components['schemas']['CommerceCustomerItem'][]>;
|
|
10
|
-
getProducts(): RequestData<components['schemas']['
|
|
10
|
+
getProducts(): RequestData<components['schemas']['backbone_common__models__commerce__common__ProductItem'][]>;
|
|
11
11
|
getCustomer(customerId: string): RequestData<components['schemas']['CommerceCustomerItem']>;
|
|
12
|
-
getProduct(productId: string): RequestData<components['schemas']['
|
|
12
|
+
getProduct(productId: string): RequestData<components['schemas']['backbone_common__models__commerce__common__ProductItem']>;
|
|
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'][]>;
|
|
@@ -8,6 +8,12 @@ declare const Flow: (internalApi: any, body: components['schemas']['ReadFlowItem
|
|
|
8
8
|
end?: string | undefined;
|
|
9
9
|
status: string;
|
|
10
10
|
}>;
|
|
11
|
+
getConsumerExecutions: (consumerId: string) => Promise<{
|
|
12
|
+
id: string;
|
|
13
|
+
start: string;
|
|
14
|
+
end?: string | undefined;
|
|
15
|
+
status: string;
|
|
16
|
+
}[]>;
|
|
11
17
|
executeLocal: (process: (consumer: typeof Consumer, context: any) => any, log?: boolean) => Promise<void>;
|
|
12
18
|
flowId: string;
|
|
13
19
|
name: string;
|
package/dist/src/modules/flow.js
CHANGED
|
@@ -25,6 +25,10 @@ const Flow = (internalApi, body, syncid, consumers, process) => {
|
|
|
25
25
|
const { data: response } = yield _internalApi.get(`/syncs/${_syncid}/flows/${data.id}/executions/${executionId}`);
|
|
26
26
|
return response;
|
|
27
27
|
});
|
|
28
|
+
const getConsumerExecutions = (consumerId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
+
const { data: response } = yield _internalApi.get(`/consumers/${consumerId}/syncs/${_syncid}/flows/${data.id}/executions`);
|
|
30
|
+
return response;
|
|
31
|
+
});
|
|
28
32
|
/**
|
|
29
33
|
* Internal use: Function used to execute a flow while testing locally or by calling the sendEvent function
|
|
30
34
|
*/
|
|
@@ -148,6 +152,7 @@ const Flow = (internalApi, body, syncid, consumers, process) => {
|
|
|
148
152
|
return {
|
|
149
153
|
execute,
|
|
150
154
|
getExecution,
|
|
155
|
+
getConsumerExecutions,
|
|
151
156
|
executeLocal,
|
|
152
157
|
flowId: data.id,
|
|
153
158
|
name: data.name,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { operations } from '../types/public-api/schema';
|
|
1
|
+
import { operations, components } from '../types/public-api/schema';
|
|
2
2
|
import { InternalAPI } from './internalApi';
|
|
3
3
|
import { chiftOperations } from '../types/public-api/mappings';
|
|
4
4
|
declare const Integrations: (internalApi: InternalAPI) => {
|
|
@@ -19,5 +19,6 @@ declare const Integrations: (internalApi: InternalAPI) => {
|
|
|
19
19
|
optional: boolean;
|
|
20
20
|
}[];
|
|
21
21
|
}[]>;
|
|
22
|
+
getIntegrationLogo: (integrationId: number, imageType: components['schemas']['ImageType']) => Promise<any>;
|
|
22
23
|
};
|
|
23
24
|
export { Integrations };
|
|
@@ -16,8 +16,13 @@ const Integrations = (internalApi) => {
|
|
|
16
16
|
const { data, } = yield _internalApi.get('/integrations', { params });
|
|
17
17
|
return data;
|
|
18
18
|
});
|
|
19
|
+
const getIntegrationLogo = (integrationId, imageType) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
+
const { data } = yield _internalApi.get(`/integrations/${integrationId}/${imageType}.json`);
|
|
21
|
+
return data;
|
|
22
|
+
});
|
|
19
23
|
return {
|
|
20
24
|
getIntegrations,
|
|
25
|
+
getIntegrationLogo,
|
|
21
26
|
};
|
|
22
27
|
};
|
|
23
28
|
exports.Integrations = Integrations;
|
|
@@ -5,16 +5,18 @@ type GetContactsParams = AutoPaginatedParams<operations['invoicing_get_contacts'
|
|
|
5
5
|
declare const invoicingFactory: {
|
|
6
6
|
getInvoices(params?: GetInvoicesParams): RequestData<components['schemas']['InvoiceItemOut'][]>;
|
|
7
7
|
getInvoiceById(invoiceId: string, params?: operations['invoicing_get_invoice']['parameters']['query']): RequestData<components['schemas']['InvoiceItemOut']>;
|
|
8
|
-
createInvoice(invoice: components['schemas']['
|
|
8
|
+
createInvoice(invoice: components['schemas']['backbone_common__models__invoicing__common__InvoiceItem']): RequestData<components['schemas']['InvoiceItemOut']>;
|
|
9
9
|
getProducts(): RequestData<components['schemas']['ProductItemOut'][]>;
|
|
10
10
|
getProductById(productId: string): RequestData<components['schemas']['ProductItemOut']>;
|
|
11
|
-
createProduct(product: components['schemas']['
|
|
12
|
-
getTaxes(): RequestData<components['schemas']['
|
|
13
|
-
getTaxById(taxId: string): RequestData<components['schemas']['
|
|
11
|
+
createProduct(product: components['schemas']['backbone_common__models__invoicing__common__ProductItem']): RequestData<components['schemas']['ProductItemOut']>;
|
|
12
|
+
getTaxes(): RequestData<components['schemas']['InvoicingVatCode'][]>;
|
|
13
|
+
getTaxById(taxId: string): RequestData<components['schemas']['InvoicingVatCode']>;
|
|
14
14
|
getOpportunities(): RequestData<components['schemas']['OpportunityItem'][]>;
|
|
15
15
|
getOpportunitiesById(opportunityId: string): RequestData<components['schemas']['OpportunityItem']>;
|
|
16
16
|
getContacts(params?: GetContactsParams): RequestData<components['schemas']['ContactItemOut'][]>;
|
|
17
17
|
getContactById(contactId: string): RequestData<components['schemas']['ContactItemOut']>;
|
|
18
18
|
createContact(contact: components['schemas']['ContactItemIn']): RequestData<components['schemas']['ContactItemOut']>;
|
|
19
|
+
getPayments(): RequestData<components['schemas']['InvoicingPaymentItem'][]>;
|
|
20
|
+
getPaymentMethods(): RequestData<components['schemas']['InvoicingPaymentMethodItem'][]>;
|
|
19
21
|
};
|
|
20
22
|
export { invoicingFactory };
|
|
@@ -86,5 +86,17 @@ const invoicingFactory = {
|
|
|
86
86
|
body: contact,
|
|
87
87
|
};
|
|
88
88
|
},
|
|
89
|
+
getPayments() {
|
|
90
|
+
return {
|
|
91
|
+
method: 'get',
|
|
92
|
+
url: `/consumers/{consumer_id}/invoicing/payments`,
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
getPaymentMethods() {
|
|
96
|
+
return {
|
|
97
|
+
method: 'get',
|
|
98
|
+
url: `/consumers/{consumer_id}/invoicing/payment-methods`,
|
|
99
|
+
};
|
|
100
|
+
},
|
|
89
101
|
};
|
|
90
102
|
exports.invoicingFactory = invoicingFactory;
|
|
@@ -4,6 +4,8 @@ type GetPaymentsParams = AutoPaginatedParams<operations['pms_get_payments']['par
|
|
|
4
4
|
type GetPaymentMethodsParams = AutoPaginatedParams<operations['pms_get_payments_methods']['parameters']['query']>;
|
|
5
5
|
type GetAccountingCategoriesParams = AutoPaginatedParams<operations['pms_get_accounting_categories']['parameters']['query']>;
|
|
6
6
|
type GetOrdersParams = AutoPaginatedParams<operations['pms_get_orders']['parameters']['query']>;
|
|
7
|
+
type GetCustomersParams = AutoPaginatedParams<operations['pms_get_customers']['parameters']['query']>;
|
|
8
|
+
type GetInvoicesParams = AutoPaginatedParams<operations['pms_get_invoices']['parameters']['query']>;
|
|
7
9
|
declare const pmsFactory: {
|
|
8
10
|
getLocations(): RequestData<components['schemas']['PMSLocationItem'][]>;
|
|
9
11
|
getOrders(params: GetOrdersParams): RequestData<components['schemas']['PMSOrderItem'][]>;
|
|
@@ -11,5 +13,7 @@ declare const pmsFactory: {
|
|
|
11
13
|
getClosure(date: string, params?: operations['pms_get_closure']['parameters']['query']): RequestData<components['schemas']['PMSClosureItem']>;
|
|
12
14
|
getPayments(params: GetPaymentsParams): RequestData<components['schemas']['PMSPaymentItem'][]>;
|
|
13
15
|
getAccountingCategories(params?: GetAccountingCategoriesParams): RequestData<components['schemas']['PMSAccountingCategoryItem'][]>;
|
|
16
|
+
getCustomers(params?: GetCustomersParams): RequestData<components['schemas']['PMSCustomerItem'][]>;
|
|
17
|
+
getInvoices(params?: GetInvoicesParams): RequestData<components['schemas']['PMSInvoiceFullItem'][]>;
|
|
14
18
|
};
|
|
15
19
|
export { pmsFactory };
|
package/dist/src/modules/pms.js
CHANGED
|
@@ -43,5 +43,19 @@ const pmsFactory = {
|
|
|
43
43
|
url: `/consumers/{consumer_id}/pms/accounting-categories`,
|
|
44
44
|
};
|
|
45
45
|
},
|
|
46
|
+
getCustomers(params) {
|
|
47
|
+
return {
|
|
48
|
+
params,
|
|
49
|
+
method: 'get',
|
|
50
|
+
url: '/consumers/{consumer_id}/pms/customers',
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
getInvoices(params) {
|
|
54
|
+
return {
|
|
55
|
+
params,
|
|
56
|
+
method: 'get',
|
|
57
|
+
url: '/consumers/{consumer_id}/pms/invoices',
|
|
58
|
+
};
|
|
59
|
+
},
|
|
46
60
|
};
|
|
47
61
|
exports.pmsFactory = pmsFactory;
|