@chift/chift-nodejs 1.0.23 → 1.0.25

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.
Files changed (42) hide show
  1. package/README.md +37 -0
  2. package/dist/src/modules/accounting.d.ts +45 -43
  3. package/dist/src/modules/accounting.js +102 -42
  4. package/dist/src/modules/api.d.ts +13247 -11010
  5. package/dist/src/modules/banking.d.ts +13 -0
  6. package/dist/src/modules/banking.js +38 -0
  7. package/dist/src/modules/consumer.d.ts +2594 -2163
  8. package/dist/src/modules/consumer.js +3 -0
  9. package/dist/src/modules/consumers.d.ts +13205 -10980
  10. package/dist/src/modules/custom.d.ts +4 -4
  11. package/dist/src/modules/custom.js +6 -3
  12. package/dist/src/modules/datastores.d.ts +12 -6
  13. package/dist/src/modules/ecommerce.d.ts +18 -15
  14. package/dist/src/modules/ecommerce.js +32 -14
  15. package/dist/src/modules/flow.d.ts +2 -2
  16. package/dist/src/modules/integrations.d.ts +4 -2
  17. package/dist/src/modules/internalApi.js +11 -0
  18. package/dist/src/modules/invoicing.d.ts +16 -16
  19. package/dist/src/modules/invoicing.js +33 -18
  20. package/dist/src/modules/payment.d.ts +6 -6
  21. package/dist/src/modules/payment.js +10 -5
  22. package/dist/src/modules/pms.d.ts +8 -8
  23. package/dist/src/modules/pms.js +16 -8
  24. package/dist/src/modules/pos.d.ts +15 -15
  25. package/dist/src/modules/pos.js +29 -15
  26. package/dist/src/modules/sync.d.ts +10553 -8771
  27. package/dist/src/modules/webhooks.d.ts +12 -12
  28. package/dist/src/types/api.d.ts +9 -0
  29. package/dist/src/types/public-api/mappings.d.ts +128 -1
  30. package/dist/src/types/public-api/schema.d.ts +3856 -2132
  31. package/dist/src/types/public-api/schema.js +6 -0
  32. package/dist/test/modules/banking.test.d.ts +1 -0
  33. package/dist/test/modules/banking.test.js +94 -0
  34. package/dist/test/modules/client-request-id.test.d.ts +1 -0
  35. package/dist/test/modules/client-request-id.test.js +135 -0
  36. package/dist/test/modules/ecommerce.test.js +2 -1
  37. package/dist/test/modules/invoicing-pdf.test.d.ts +1 -0
  38. package/dist/test/modules/invoicing-pdf.test.js +34 -0
  39. package/dist/test/modules/raw-data.test.d.ts +1 -0
  40. package/dist/test/modules/raw-data.test.js +55 -0
  41. package/package.json +1 -1
  42. package/src/types/public-api/schema.d.ts +3856 -2132
@@ -4,31 +4,31 @@ import { chiftOperations } from '../types/public-api/mappings';
4
4
  declare const Webhooks: (internalApi: InternalAPI) => {
5
5
  getWebhookTypes: () => Promise<{
6
6
  event: string;
7
- api?: string | undefined;
7
+ api?: string | null | undefined;
8
8
  }[]>;
9
9
  registerWebhook: (body: operations[chiftOperations['registerWebhook']]['requestBody']['content']['application/json']) => Promise<{
10
10
  consumerid: string;
11
11
  name: string;
12
- email?: string | undefined;
13
- internal_reference?: string | undefined;
14
- redirect_url?: string | undefined;
12
+ email?: string | null | undefined;
13
+ internal_reference?: string | null | undefined;
14
+ redirect_url?: string | null | undefined;
15
15
  }>;
16
16
  getWebhookById: (webhookId: string) => Promise<{
17
17
  webhookid: string;
18
18
  accountid: string;
19
- createdby?: string | undefined;
19
+ createdby?: string | null | undefined;
20
20
  createdon: string;
21
21
  event: string;
22
22
  url: string;
23
23
  status: "active" | "inactive";
24
- integrationid?: number | undefined;
24
+ integrationid?: number | null | undefined;
25
25
  }>;
26
26
  updateWebhookById: (webhookId: string, body: operations[chiftOperations['updateWebhookById']]['requestBody']['content']['application/json']) => Promise<{
27
27
  consumerid: string;
28
28
  name: string;
29
- email?: string | undefined;
30
- internal_reference?: string | undefined;
31
- redirect_url?: string | undefined;
29
+ email?: string | null | undefined;
30
+ internal_reference?: string | null | undefined;
31
+ redirect_url?: string | null | undefined;
32
32
  }>;
33
33
  unRegisterWebhook: (webhookId: string) => Promise<{
34
34
  headers: {
@@ -44,17 +44,17 @@ declare const Webhooks: (internalApi: InternalAPI) => {
44
44
  accountid: string;
45
45
  createdon: string;
46
46
  httpstatus: number;
47
- integrationid?: number | undefined;
47
+ integrationid?: number | null | undefined;
48
48
  }[]>;
49
49
  getWebhooks: () => Promise<{
50
50
  webhookid: string;
51
51
  accountid: string;
52
- createdby?: string | undefined;
52
+ createdby?: string | null | undefined;
53
53
  createdon: string;
54
54
  event: string;
55
55
  url: string;
56
56
  status: "active" | "inactive";
57
- integrationid?: number | undefined;
57
+ integrationid?: number | null | undefined;
58
58
  }[]>;
59
59
  };
60
60
  export { Webhooks };
@@ -4,6 +4,7 @@ export interface AuthType {
4
4
  accountId: string;
5
5
  envId?: string;
6
6
  baseUrl?: string;
7
+ marketplaceId?: string;
7
8
  }
8
9
  export interface TokenType {
9
10
  access_token: string;
@@ -19,6 +20,8 @@ export type RequestData<TResponse> = {
19
20
  url: string;
20
21
  params?: unknown;
21
22
  body?: unknown;
23
+ rawData?: boolean;
24
+ clientRequestId?: string;
22
25
  };
23
26
  export type RequestFactory = {
24
27
  [key: string]: (...args: any) => RequestData<any>;
@@ -27,3 +30,9 @@ export type ApiFor<TFactory extends RequestFactory> = {
27
30
  [key in keyof TFactory]: TFactory[key] extends (...args: infer TArgs) => RequestData<infer TResponse> ? (...args: TArgs) => Promise<TResponse> : never;
28
31
  };
29
32
  export type AutoPaginatedParams<T> = Omit<Exclude<T, undefined>, 'page' | 'size'>;
33
+ export type RawDataOption = {
34
+ rawData?: boolean;
35
+ };
36
+ export type ClientRequestOption = {
37
+ clientRequestId?: string;
38
+ };
@@ -1,4 +1,5 @@
1
1
  export type chiftOperations = {
2
+ generateAccessToken: 'generate_access_token_token_post';
2
3
  getConsumers: 'consumers_get_consumers';
3
4
  createConsumer: 'consumers_create_consumer';
4
5
  getConsumerById: 'consumers_get_consumer';
@@ -8,8 +9,8 @@ export type chiftOperations = {
8
9
  createConnection: 'connections_create_connection';
9
10
  deleteConnectionById: 'connections_delete_connection';
10
11
  updateConnection: 'connections_update_connection';
11
- getSyncs: 'syncs_get_syncs';
12
12
  getIntegrations: 'integrations_get_integrations';
13
+ getIntegrationLogo: 'integrations_get_integration_logo_json';
13
14
  getWebhookTypes: 'webhooks_get_webhook_types';
14
15
  getWebhooks: 'webhooks_get_webhooks';
15
16
  registerWebhook: 'webhooks_create_webhook';
@@ -17,5 +18,131 @@ export type chiftOperations = {
17
18
  getWebhookById: 'webhooks_get_webhook';
18
19
  updateWebhookById: 'webhooks_update_webhook';
19
20
  getWebhookLogsByWebhookId: 'webhooks_get_webhook_logs';
21
+ getSyncs: 'syncs_get_syncs';
22
+ createSync: 'syncs_post_sync';
23
+ updateSync: 'syncs_update_sync';
20
24
  getSync: 'syncs_get_sync';
25
+ sendCustomEvent: 'syncs_send_custom_event';
26
+ getConsumerExecutions: 'syncs_get_consumer_executions';
27
+ getExecution: 'syncs_get_execution';
28
+ createSyncToConsumer: 'syncs_create_synctoconsumer';
29
+ getSyncConsumer: 'syncs_get_syncconsumer';
30
+ updateSyncToConsumer: 'syncs_update_synctoconsumer';
31
+ enableSyncConsumer: 'syncs_enable_syncconsumer';
32
+ updateFlowToConsumer: 'syncs_update_flowtoconsumer';
33
+ getDatastores: 'datastores_get_datastores';
34
+ getConsumerDatastoreData: 'datastores_get_consumer_and_datastoredata';
35
+ createConsumerDatastoreData: 'datastores_create_consumer_datastoredata';
36
+ deleteConsumerDatastoreData: 'datastores_delete_consumer_datastoredata';
37
+ updateConsumerDatastoreData: 'datastores_update_consumer_datastoredata';
38
+ getFolders: 'accounting_get_folders';
39
+ getBookyears: 'accounting_get_bookyears';
40
+ getAnalyticPlans: 'accounting_get_analytic_plans';
41
+ getClients: 'accounting_get_clients';
42
+ createClient: 'accounting_create_client';
43
+ getClient: 'accounting_get_client';
44
+ updateClient: 'accounting_update_client';
45
+ getSuppliers: 'accounting_get_suppliers';
46
+ createSupplier: 'accounting_create_supplier';
47
+ getSupplier: 'accounting_get_supplier';
48
+ updateSupplier: 'accounting_update_supplier';
49
+ createInvoice: 'accounting_create_invoice';
50
+ createInvoiceMultiplePlans: 'accounting_create_invoice_multiple_plans';
51
+ getInvoicesByType: 'accounting_get_invoices_by_type';
52
+ getInvoicesByTypeMultiPlans: 'accounting_get_invoices_by_type_multi_analytic_plans';
53
+ getInvoice: 'accounting_get_invoice';
54
+ getInvoiceMultiPlans: 'accounting_get_invoice_multi_analytic_plans';
55
+ createLedgerAccount: 'accounting_create_ledger_account';
56
+ createBankAccount: 'accounting_create_bank_account';
57
+ getAnalyticAccounts: 'accounting_get_analytic_accounts';
58
+ createAnalyticAccount: 'accounting_create_analytic_account';
59
+ createAnalyticAccountMultiPlans: 'accounting_create_analytic_account_multi_plans';
60
+ getAnalyticAccount: 'accounting_get_analytic_account';
61
+ updateAnalyticAccount: 'accounting_update_analytic_account';
62
+ getAnalyticAccountMultiPlans: 'accounting_get_analytic_account_multi_plans';
63
+ updateAnalyticAccountMultiPlans: 'accounting_update_analytic_account_multi_plans';
64
+ getAnalyticAccountsMultiPlans: 'accounting_get_analytic_accounts_multi_plans';
65
+ getJournalEntries: 'accounting_get_journal_entries';
66
+ createJournalEntry: 'accounting_create_journal_entry';
67
+ getJournalEntriesMultiPlan: 'accounting_get_journal_entries_multi_plan';
68
+ getJournalEntry: 'accounting_get_journal_entry';
69
+ createGenericJournalEntry: 'accounting_create_generic_journal_entry';
70
+ getPaymentsByInvoice: 'accounting_get_payments_by_invoice';
71
+ getJournals: 'accounting_get_journals';
72
+ createJournal: 'accounting_create_journal';
73
+ getVatCodes: 'accounting_get_vat_codes';
74
+ getMiscellaneousOperations: 'accounting_get_miscellaneous_operations';
75
+ createMiscellaneousOperation: 'accounting_create_miscellaneous_operation';
76
+ getMiscellaneousOperation: 'accounting_get_miscellaneous_operation';
77
+ matchEntries: 'accounting_match_entries';
78
+ matchEntriesMultiple: 'accounting_match_entries_multiple';
79
+ addAttachment: 'accounting_add_attachment';
80
+ getAttachments: 'accounting_get_attachments';
81
+ getChartOfAccounts: 'accounting_get_chart_of_accounts';
82
+ getAccountsBalances: 'accounting_get_accounts_balances';
83
+ getEmployees: 'accounting_get_employees';
84
+ createFinancialEntry: 'accounting_create_financial_entry';
85
+ createFinancialEntries: 'accounting_create_financial_entries';
86
+ getOutstandings: 'accounting_get_outstandings';
87
+ getOrders: 'pos_get_orders';
88
+ getOrder: 'pos_get_order';
89
+ updateOrder: 'pos_update_pos_customer';
90
+ getLocations: 'pos_get_locations';
91
+ getPayments: 'pos_get_payments';
92
+ getSales: 'pos_get_sales';
93
+ getPaymentMethods: 'pos_get_payments_methods';
94
+ getCustomers: 'pos_get_customers';
95
+ createCustomer: 'pos_create_pos_customer';
96
+ getCustomer: 'pos_get_customer';
97
+ getProductCategories: 'pos_get_product_categories';
98
+ getProducts: 'pos_get_products';
99
+ getAccountingCategories: 'pos_get_accounting_categories';
100
+ getClosure: 'pos_get_closure';
101
+ getCommerceCustomers: 'ecommerce_get_customers';
102
+ getCommerceCustomer: 'ecommerce_get_customer';
103
+ getCommerceProducts: 'ecommerce_get_products';
104
+ getCommerceProduct: 'ecommerce_get_product';
105
+ getVariant: 'ecommerce_get_variant';
106
+ updateVariantQuantity: 'ecommerce_update_variant_quantity';
107
+ getCommerceLocations: 'ecommerce_get_locations';
108
+ getCommerceOrders: 'ecommerce_get_orders';
109
+ createCommerceOrder: 'ecommerce_create_order';
110
+ getCommerceOrder: 'ecommerce_get_order';
111
+ getCommercePaymentMethods: 'ecommerce_get_payments_methods';
112
+ getCommerceProductCategories: 'ecommerce_get_product_categories';
113
+ getTaxes: 'ecommerce_get_taxes';
114
+ getCountries: 'ecommerce_get_countries';
115
+ getInvoicingInvoices: 'invoicing_get_invoices';
116
+ createInvoicingInvoice: 'invoicing_post_invoices';
117
+ getInvoicingInvoice: 'invoicing_get_invoice';
118
+ getInvoicingTaxes: 'invoicing_get_taxes';
119
+ getInvoicingTax: 'invoicing_get_tax';
120
+ getInvoicingProducts: 'invoicing_get_products';
121
+ createInvoicingProduct: 'invoicing_post_products';
122
+ getInvoicingProduct: 'invoicing_get_product';
123
+ getOpportunities: 'invoicing_get_opportunities';
124
+ getOpportunity: 'invoicing_get_opportunity';
125
+ getContacts: 'invoicing_get_contacts';
126
+ createContact: 'invoicing_post_contacts';
127
+ getContact: 'invoicing_get_contact';
128
+ getInvoicingPayments: 'invoicing_get_payments';
129
+ getInvoicingPaymentMethods: 'invoicing_get_payments_methods';
130
+ getFinancialInstitutions: 'banking_get_financial_institutions';
131
+ getBankingAccounts: 'banking_get_accounts';
132
+ getAccountTransactions: 'banking_get_account_transactions';
133
+ getAccountCounterparts: 'banking_get_account_counterparts';
134
+ getBalances: 'payment_get_balances';
135
+ getTransactions: 'payment_get_transaction';
136
+ getPaymentPayments: 'payment_get_payments';
137
+ getPayment: 'payment_get_payment';
138
+ getRefunds: 'payment_get_refunds';
139
+ getPMSOrders: 'pms_get_orders';
140
+ getPMSInvoices: 'pms_get_invoices';
141
+ getPMSCustomers: 'pms_get_customers';
142
+ getPMSCustomer: 'pms_get_customer';
143
+ getPMSLocations: 'pms_get_locations';
144
+ getPMSPayments: 'pms_get_payments';
145
+ getPMSPaymentMethods: 'pms_get_payments_methods';
146
+ getPMSAccountingCategories: 'pms_get_accounting_categories';
147
+ getPMSClosure: 'pms_get_closure';
21
148
  };