@ptkl/sdk 0.10.0 → 0.10.2

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/index.cjs.js CHANGED
@@ -19500,12 +19500,210 @@ class Thunder extends PlatformBaseClient {
19500
19500
  }
19501
19501
 
19502
19502
  class Ratchet extends PlatformBaseClient {
19503
+ /**
19504
+ * Get all database connections for the current project
19505
+ *
19506
+ * @returns List of all configured ratchet connections
19507
+ *
19508
+ * @example
19509
+ * ```typescript
19510
+ * const ratchet = new Ratchet();
19511
+ * const connections = await ratchet.getConnections();
19512
+ * console.log(connections.data); // Array of connections
19513
+ * ```
19514
+ */
19515
+ async getConnections() {
19516
+ return await this.client.get("/v1/ratchet/connection");
19517
+ }
19518
+ /**
19519
+ * Get a specific database connection by ID
19520
+ *
19521
+ * @param id - Connection ID
19522
+ * @returns Connection details including queries
19523
+ *
19524
+ * @example
19525
+ * ```typescript
19526
+ * const ratchet = new Ratchet();
19527
+ * const connection = await ratchet.getConnection('users_db');
19528
+ * console.log(connection.data.queries); // Available queries for this connection
19529
+ * ```
19530
+ */
19531
+ async getConnection(id) {
19532
+ return await this.client.get(`/v1/ratchet/connection/${id}`);
19533
+ }
19534
+ /**
19535
+ * Create a new database connection
19536
+ *
19537
+ * Supports multiple database types:
19538
+ * - MySQL: Use credentials with host, dbname, user, password
19539
+ * - PostgreSQL: Use credentials with host, dbname, user, password
19540
+ * - MongoDB: Use DSN connection string
19541
+ * - BigQuery: Use service_account_json and project_id
19542
+ *
19543
+ * @param connection - Connection configuration
19544
+ * @returns Created connection details
19545
+ *
19546
+ * @example
19547
+ * ```typescript
19548
+ * const ratchet = new Ratchet();
19549
+ *
19550
+ * // MySQL/PostgreSQL connection
19551
+ * await ratchet.createConnection({
19552
+ * id: 'users_db',
19553
+ * type: 'MySQL',
19554
+ * credentials: {
19555
+ * type: 'Credentials',
19556
+ * host: 'localhost',
19557
+ * dbname: 'users',
19558
+ * user: 'admin',
19559
+ * password: 'secret'
19560
+ * }
19561
+ * });
19562
+ *
19563
+ * // MongoDB connection
19564
+ * await ratchet.createConnection({
19565
+ * id: 'mongo_db',
19566
+ * type: 'MongoDB',
19567
+ * credentials: {
19568
+ * type: 'DSN',
19569
+ * dsn: 'mongodb://localhost:27017/mydb'
19570
+ * }
19571
+ * });
19572
+ *
19573
+ * // BigQuery connection
19574
+ * await ratchet.createConnection({
19575
+ * id: 'analytics_bq',
19576
+ * type: 'BigQuery',
19577
+ * credentials: {
19578
+ * type: 'ServiceAccount',
19579
+ * service_account_json: '{"type":"service_account",...}',
19580
+ * project_id: 'my-project-id'
19581
+ * }
19582
+ * });
19583
+ * ```
19584
+ */
19585
+ async createConnection(connection) {
19586
+ return await this.client.post("/v1/ratchet/connection", connection);
19587
+ }
19588
+ /**
19589
+ * Update an existing database connection
19590
+ *
19591
+ * @param connection - Updated connection configuration
19592
+ * @returns Success status
19593
+ *
19594
+ * @example
19595
+ * ```typescript
19596
+ * const ratchet = new Ratchet();
19597
+ * await ratchet.updateConnection({
19598
+ * id: 'users_db',
19599
+ * type: 'postgres',
19600
+ * credentials: {
19601
+ * type: 'postgres',
19602
+ * host: 'localhost',
19603
+ * dbname: 'users',
19604
+ * user: 'admin',
19605
+ * password: 'new_secret'
19606
+ * },
19607
+ * queries: [
19608
+ * { id: 'get_user', expression: 'SELECT * FROM users WHERE id = $1' }
19609
+ * ]
19610
+ * });
19611
+ * ```
19612
+ */
19613
+ async updateConnection(connection) {
19614
+ return await this.client.put("/v1/ratchet/connection", connection);
19615
+ }
19616
+ /**
19617
+ * Delete a database connection
19618
+ *
19619
+ * @param id - Connection ID to delete
19620
+ * @returns Success status
19621
+ *
19622
+ * @example
19623
+ * ```typescript
19624
+ * const ratchet = new Ratchet();
19625
+ * await ratchet.deleteConnection('users_db');
19626
+ * ```
19627
+ */
19628
+ async deleteConnection(id) {
19629
+ return await this.client.delete(`/v1/ratchet/connection/${id}`);
19630
+ }
19631
+ /**
19632
+ * Test a database connection without saving it
19633
+ *
19634
+ * @param connection - Connection configuration to test
19635
+ * @returns Success status if connection is valid
19636
+ *
19637
+ * @example
19638
+ * ```typescript
19639
+ * const ratchet = new Ratchet();
19640
+ * const isValid = await ratchet.testConnection({
19641
+ * id: 'test_db',
19642
+ * type: 'postgres',
19643
+ * credentials: {
19644
+ * type: 'postgres',
19645
+ * host: 'localhost',
19646
+ * dbname: 'test',
19647
+ * user: 'admin',
19648
+ * password: 'secret'
19649
+ * }
19650
+ * });
19651
+ * ```
19652
+ */
19653
+ async testConnection(connection) {
19654
+ return await this.client.post("/v1/ratchet/test/connection", connection);
19655
+ }
19656
+ /**
19657
+ * Execute a predefined database query
19658
+ *
19659
+ * Runs a query that has been previously configured in a ratchet connection.
19660
+ * The query is identified by a qualified name in the format: `connectionId.queryId`
19661
+ *
19662
+ * @param name - Qualified name of the query (format: `connectionId.queryId`)
19663
+ * @param params - Array of parameters to pass to the query
19664
+ * @returns Query execution results
19665
+ *
19666
+ * @example
19667
+ * ```typescript
19668
+ * const ratchet = new Ratchet();
19669
+ *
19670
+ * // Execute a query with parameters
19671
+ * const result = await ratchet.query('users_db.get_user_by_id', [123]);
19672
+ *
19673
+ * // Execute a query without parameters
19674
+ * const allUsers = await ratchet.query('users_db.get_all_users', []);
19675
+ * ```
19676
+ */
19503
19677
  async query(name, params) {
19504
- return await this.client.post('/v1/ratchet/query', {
19678
+ return await this.client.post("/v1/ratchet/query", {
19505
19679
  name: name,
19506
- params: params
19680
+ params: params,
19507
19681
  });
19508
19682
  }
19683
+ /**
19684
+ * Inspect and execute a custom query without saving it
19685
+ *
19686
+ * This allows you to test queries before saving them to a connection.
19687
+ *
19688
+ * @param request - Query inspection request with connection name, query, and params
19689
+ * @returns Query execution results
19690
+ *
19691
+ * @example
19692
+ * ```typescript
19693
+ * const ratchet = new Ratchet();
19694
+ * const result = await ratchet.inspectQuery({
19695
+ * name: 'users_db.test_query',
19696
+ * query: {
19697
+ * id: 'test_query',
19698
+ * expression: 'SELECT * FROM users WHERE email = $1'
19699
+ * },
19700
+ * params: ['user@example.com']
19701
+ * });
19702
+ * ```
19703
+ */
19704
+ async inspectQuery(request) {
19705
+ return await this.client.post("/v1/ratchet/query/inspect", request);
19706
+ }
19509
19707
  }
19510
19708
 
19511
19709
  class Sandbox extends PlatformBaseClient {
@@ -19965,6 +20163,23 @@ class DMS extends IntegrationsBaseClient {
19965
20163
  async libraries() {
19966
20164
  return await this.requestv1("GET", "media/library/list");
19967
20165
  }
20166
+ /**
20167
+ * Upload files using multipart form data
20168
+ *
20169
+ * @param payload - Upload configuration with files, directory, and options
20170
+ * @returns Upload response from the server
20171
+ *
20172
+ * @example
20173
+ * ```typescript
20174
+ * const result = await dms.upload({
20175
+ * files: [file1, file2],
20176
+ * uploadDir: '/documents/invoices',
20177
+ * public: true,
20178
+ * replace: true,
20179
+ * metadata: { category: 'finance' }
20180
+ * });
20181
+ * ```
20182
+ */
19968
20183
  async upload(payload) {
19969
20184
  let files = payload.files;
19970
20185
  let formData = new FormData();
@@ -19981,9 +20196,12 @@ class DMS extends IntegrationsBaseClient {
19981
20196
  if (payload.public) {
19982
20197
  formData.append('is_public', "true");
19983
20198
  }
20199
+ if (payload.replace) {
20200
+ formData.append('replace', "true");
20201
+ }
19984
20202
  if (payload.expiresAt)
19985
20203
  formData.append('expiresAt', new Date(payload.expiresAt).toISOString());
19986
- if (Object.keys(payload.metadata).length > 0)
20204
+ if (payload.metadata && Object.keys(payload.metadata).length > 0)
19987
20205
  formData.append('metadata', JSON.stringify(payload.metadata));
19988
20206
  return await this.request("POST", "media/upload", {
19989
20207
  data: formData,
@@ -19996,6 +20214,28 @@ class DMS extends IntegrationsBaseClient {
19996
20214
  async delete(data) {
19997
20215
  return this.request('POST', 'media/delete', data);
19998
20216
  }
20217
+ /**
20218
+ * Upload files using base64-encoded content
20219
+ *
20220
+ * @param data - Upload payload with base64-encoded files
20221
+ * @returns Upload response from the server
20222
+ *
20223
+ * @example
20224
+ * ```typescript
20225
+ * const result = await dms.uploadBase64({
20226
+ * path: '/documents/reports',
20227
+ * is_public: false,
20228
+ * replace: true,
20229
+ * files: [
20230
+ * {
20231
+ * name: 'report.pdf',
20232
+ * content_type: 'application/pdf',
20233
+ * data: 'base64EncodedContent...'
20234
+ * }
20235
+ * ]
20236
+ * });
20237
+ * ```
20238
+ */
19999
20239
  async uploadBase64(data) {
20000
20240
  return this.request('POST', `media/upload`, {
20001
20241
  data,
@@ -20004,7 +20244,7 @@ class DMS extends IntegrationsBaseClient {
20004
20244
  }
20005
20245
  });
20006
20246
  }
20007
- async getMedia(lib, key, encoding) {
20247
+ async getMedia(key, encoding) {
20008
20248
  return this.request('GET', `media/get/${key}`, {
20009
20249
  params: {
20010
20250
  encoding
@@ -20012,7 +20252,7 @@ class DMS extends IntegrationsBaseClient {
20012
20252
  responseType: (!encoding) ? 'blob' : null
20013
20253
  });
20014
20254
  }
20015
- async download(lib, key) {
20255
+ async download(key) {
20016
20256
  return this.request('POST', `media/download`, {
20017
20257
  data: {
20018
20258
  key
@@ -20024,7 +20264,7 @@ class DMS extends IntegrationsBaseClient {
20024
20264
  return this.request('GET', `media/exif/${key}`);
20025
20265
  }
20026
20266
  async html2pdf(data) {
20027
- const { output_pdf = false, input_path, input_html, output_path, output_file_name, output_type, data: templateData } = data;
20267
+ const { output_pdf = false, input_path, input_html, output_path, output_file_name, output_type, data: templateData, replace, } = data;
20028
20268
  const type = output_pdf ? 'arraybuffer' : 'json';
20029
20269
  const contentType = output_pdf ? 'application/pdf' : 'application/json';
20030
20270
  return this.request('POST', `media/pdf/html2pdf`, {
@@ -20035,7 +20275,27 @@ class DMS extends IntegrationsBaseClient {
20035
20275
  input_html,
20036
20276
  output_file_name,
20037
20277
  output_type,
20038
- data: templateData
20278
+ data: templateData,
20279
+ replace,
20280
+ },
20281
+ headers: {
20282
+ 'Content-Type': contentType
20283
+ },
20284
+ responseType: type
20285
+ });
20286
+ }
20287
+ async pdf2html(data) {
20288
+ const { output_html = false, input_path, input_pdf, output_path, output_file_name, replace, } = data;
20289
+ const type = output_html ? 'arraybuffer' : 'json';
20290
+ const contentType = output_html ? 'text/html' : 'application/json';
20291
+ return this.request('POST', `media/pdf/pdf2html`, {
20292
+ data: {
20293
+ output_html,
20294
+ input_path,
20295
+ output_path,
20296
+ input_pdf,
20297
+ output_file_name,
20298
+ replace,
20039
20299
  },
20040
20300
  headers: {
20041
20301
  'Content-Type': contentType
@@ -20052,8 +20312,40 @@ class DMS extends IntegrationsBaseClient {
20052
20312
  async dirs(data) {
20053
20313
  return await this.request("POST", `media/library/dirs`, { data });
20054
20314
  }
20055
- async fillPdf(lib, data) {
20056
- const { input_path, output_path, output_pdf = false, output_type, output_file_name, form_data, forms } = data;
20315
+ // ===================================================================
20316
+ // Document Methods
20317
+ // ===================================================================
20318
+ async createDocument(payload) {
20319
+ return this.requestv2('POST', 'documents/document', { data: payload });
20320
+ }
20321
+ async getDocument(path) {
20322
+ return this.requestv2('GET', `documents/document/${path}`);
20323
+ }
20324
+ async getDocumentRaw(path) {
20325
+ return this.requestv2('GET', `documents/document/${path}`, {
20326
+ headers: { Accept: 'application/pdoc' }
20327
+ });
20328
+ }
20329
+ async updateDocument(payload) {
20330
+ return this.requestv2('PATCH', 'documents/document', { data: payload });
20331
+ }
20332
+ async deleteDocument(path) {
20333
+ return this.requestv2('DELETE', `documents/document/${path}`);
20334
+ }
20335
+ async listDocuments(params) {
20336
+ return this.requestv2('GET', 'documents/list', { params });
20337
+ }
20338
+ async listDeletedDocuments(params) {
20339
+ return this.requestv2('GET', 'documents/list/__deleted__', { params });
20340
+ }
20341
+ async restoreDocument(payload) {
20342
+ return this.requestv2('POST', 'documents/restore', { data: payload });
20343
+ }
20344
+ async createDocumentComment(payload) {
20345
+ return this.requestv2('POST', 'documents/document/comment', { data: payload });
20346
+ }
20347
+ async fillPdf(data) {
20348
+ const { input_path, output_path, output_pdf = false, output_type, output_file_name, replace, form_data, forms } = data;
20057
20349
  const responseType = output_pdf ? 'arraybuffer' : 'json';
20058
20350
  const contentType = output_pdf ? 'application/pdf' : 'application/json';
20059
20351
  return this.request('POST', `media/pdf/fill`, {
@@ -20064,6 +20356,7 @@ class DMS extends IntegrationsBaseClient {
20064
20356
  output_type,
20065
20357
  output_file_name,
20066
20358
  form_data,
20359
+ replace,
20067
20360
  forms
20068
20361
  },
20069
20362
  headers: {
@@ -20141,7 +20434,7 @@ class DMS extends IntegrationsBaseClient {
20141
20434
  * // excelResult.data is a Blob
20142
20435
  * ```
20143
20436
  */
20144
- async convertData(lib, data, params) {
20437
+ async convertData(data, params) {
20145
20438
  const { from, to, sheet_name, include_header, include_footer, header_as_comment, footer_as_comment, separator_rows, field_order, } = params;
20146
20439
  const queryParams = { from, to };
20147
20440
  // Add optional parameters if provided
@@ -20208,7 +20501,7 @@ class DMS extends IntegrationsBaseClient {
20208
20501
  * // }
20209
20502
  * ```
20210
20503
  */
20211
- async getDataInfo(lib, data, params) {
20504
+ async getDataInfo(data, params) {
20212
20505
  const { format } = params;
20213
20506
  return this.request('POST', `media/convert/info`, {
20214
20507
  data,
@@ -20252,7 +20545,7 @@ class DMS extends IntegrationsBaseClient {
20252
20545
  * }
20253
20546
  * ```
20254
20547
  */
20255
- async validateData(lib, data, params) {
20548
+ async validateData(data, params) {
20256
20549
  const { format } = params;
20257
20550
  return this.request('POST', `media/convert/validate`, {
20258
20551
  data,
@@ -20300,7 +20593,7 @@ class DMS extends IntegrationsBaseClient {
20300
20593
  * // Auto-detects header, items, and footer sections
20301
20594
  * ```
20302
20595
  */
20303
- async jsonToCsv(lib, jsonData, options) {
20596
+ async jsonToCsv(jsonData, options) {
20304
20597
  let params = {};
20305
20598
  if (options === null || options === void 0 ? void 0 : options.field_order) {
20306
20599
  params.field_order = options.field_order.join(',');
@@ -20359,7 +20652,7 @@ class DMS extends IntegrationsBaseClient {
20359
20652
  * link.click();
20360
20653
  * ```
20361
20654
  */
20362
- async jsonToExcel(lib, jsonData, options) {
20655
+ async jsonToExcel(jsonData, options) {
20363
20656
  const params = {};
20364
20657
  if (options === null || options === void 0 ? void 0 : options.sheet_name) {
20365
20658
  params.sheet_name = options.sheet_name;
@@ -20398,7 +20691,7 @@ class DMS extends IntegrationsBaseClient {
20398
20691
  * // ]
20399
20692
  * ```
20400
20693
  */
20401
- async csvToJson(lib, csvData) {
20694
+ async csvToJson(csvData) {
20402
20695
  return this.request('POST', `media/convert/csv-to-json`, {
20403
20696
  data: csvData,
20404
20697
  responseType: 'json',
@@ -20431,7 +20724,7 @@ class DMS extends IntegrationsBaseClient {
20431
20724
  * // Use url for download or further processing
20432
20725
  * ```
20433
20726
  */
20434
- async csvToExcel(lib, csvData, options) {
20727
+ async csvToExcel(csvData, options) {
20435
20728
  const params = {};
20436
20729
  if (options === null || options === void 0 ? void 0 : options.sheet_name) {
20437
20730
  params.sheet_name = options.sheet_name;
@@ -20471,7 +20764,7 @@ class DMS extends IntegrationsBaseClient {
20471
20764
  * const jsonFromBuffer = await dms.excelToJson(libraryRef, arrayBuffer);
20472
20765
  * ```
20473
20766
  */
20474
- async excelToJson(lib, excelData, options) {
20767
+ async excelToJson(excelData, options) {
20475
20768
  const params = {};
20476
20769
  if (options === null || options === void 0 ? void 0 : options.sheet_name) {
20477
20770
  params.sheet_name = options.sheet_name;
@@ -20515,7 +20808,7 @@ class DMS extends IntegrationsBaseClient {
20515
20808
  * link.click();
20516
20809
  * ```
20517
20810
  */
20518
- async excelToCsv(lib, excelData, options) {
20811
+ async excelToCsv(excelData, options) {
20519
20812
  const params = {};
20520
20813
  if (options === null || options === void 0 ? void 0 : options.sheet_name) {
20521
20814
  params.sheet_name = options.sheet_name;
@@ -20536,6 +20829,13 @@ class DMS extends IntegrationsBaseClient {
20536
20829
  ...params
20537
20830
  });
20538
20831
  }
20832
+ async requestv2(method, endpoint, params) {
20833
+ return await this.client.request({
20834
+ method,
20835
+ url: `/v2/dms/${endpoint}`,
20836
+ ...params
20837
+ });
20838
+ }
20539
20839
  async requestv1(method, endpoint, params) {
20540
20840
  return await this.client.request({
20541
20841
  method: method,
@@ -20583,19 +20883,781 @@ class VPFR extends IntegrationsBaseClient {
20583
20883
  }
20584
20884
 
20585
20885
  class Payments extends IntegrationsBaseClient {
20586
- async getTransactions(user) {
20587
- return await this.client.get(`/karadjordje/v1/payment/${user}/list`);
20886
+ async getTransactions(userId, params) {
20887
+ return await this.client.get(`/karadjordje/v1/payment/${userId}/list`, {
20888
+ params,
20889
+ });
20890
+ }
20891
+ async getTransaction(provider, userId, transactionId) {
20892
+ return await this.client.get(`/karadjordje/v1/payment/${provider}/${userId}/getTransaction`, {
20893
+ params: { transactionId },
20894
+ });
20588
20895
  }
20589
20896
  async settings(provider) {
20590
20897
  return await this.client.get(`/karadjordje/v1/payment/${provider}/settings`);
20591
20898
  }
20899
+ async deactivatePaymentLink(provider, user, transactionId) {
20900
+ return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/deactivate/${transactionId}`);
20901
+ }
20902
+ async voidTransaction(provider, user, transactionId) {
20903
+ return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/void/${transactionId}`);
20904
+ }
20905
+ async refund(provider, user, transactionId) {
20906
+ return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/refund/${transactionId}`);
20907
+ }
20592
20908
  async getPaymentLink(provider, user, options) {
20593
- var _a;
20594
- return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/getPaymentLink`, {
20595
- totalAmount: options.totalAmount.toString(),
20596
- description: options.description,
20597
- redirectUrl: (_a = options.redirectUrl) !== null && _a !== void 0 ? _a : null,
20598
- });
20909
+ return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/getPaymentLink`, options);
20910
+ }
20911
+ async getTokenRequestLink(provider, user, options) {
20912
+ return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/getTokenRequestLink`, options);
20913
+ }
20914
+ async directPayUsingToken(provider, user, options) {
20915
+ return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/directPayUsingToken`, options);
20916
+ }
20917
+ }
20918
+
20919
+ class Minimax extends IntegrationsBaseClient {
20920
+ async settings() {
20921
+ return await this.client.get(`/karadjordje/v1/minimax/settings`);
20922
+ }
20923
+ async getAccounts(userId, organisationId, params) {
20924
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts`;
20925
+ return await this.client.get(path, { params });
20926
+ }
20927
+ async getAccount(userId, organisationId, accountId) {
20928
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts/${accountId}`;
20929
+ return await this.client.get(path);
20930
+ }
20931
+ async getAccountByCode(userId, organisationId, code) {
20932
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts/code(${code})`;
20933
+ return await this.client.get(path);
20934
+ }
20935
+ async getAccountByContent(userId, organisationId, content) {
20936
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts/content(${content})`;
20937
+ return await this.client.get(path);
20938
+ }
20939
+ async getAccountsForSync(userId, organisationId, params) {
20940
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts/synccandidates`;
20941
+ return await this.client.get(path, { params });
20942
+ }
20943
+ /** ADDRESSES */
20944
+ async getAddresses(userId, organisationId, customerId, params) {
20945
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses`;
20946
+ return await this.client.get(path, { params });
20947
+ }
20948
+ async newAddress(userId, organisationId, customerId, address) {
20949
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses`;
20950
+ return await this.client.post(path, address);
20951
+ }
20952
+ async deleteAddress(userId, organisationId, customerId, addressId) {
20953
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${addressId}`;
20954
+ return await this.client.delete(path);
20955
+ }
20956
+ async getAddress(userId, organisationId, customerId, addressId) {
20957
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${addressId}`;
20958
+ return await this.client.get(path);
20959
+ }
20960
+ async updateAddress(userId, organisationId, customerId, address) {
20961
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${address.AddressId}`;
20962
+ return await this.client.put(path, address);
20963
+ }
20964
+ async getAddressesForSync(userId, organisationId, customerId, params) {
20965
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/synccandidates`;
20966
+ return await this.client.get(path, { params });
20967
+ }
20968
+ /** ANALYTICS */
20969
+ async getAnalytics(userId, organisationId, params) {
20970
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics`;
20971
+ return await this.client.get(path, { params });
20972
+ }
20973
+ async newAnalytic(userId, organisationId, analytic) {
20974
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics`;
20975
+ return await this.client.post(path, analytic);
20976
+ }
20977
+ async deleteAnalytic(userId, organisationId, analyticId) {
20978
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics/${analyticId}`;
20979
+ return await this.client.delete(path);
20980
+ }
20981
+ async getAnalytic(userId, organisationId, analyticId) {
20982
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics/${analyticId}`;
20983
+ return await this.client.get(path);
20984
+ }
20985
+ async updateAnalytic(userId, organisationId, analytic) {
20986
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics/${analytic.AnalyticId}`;
20987
+ return await this.client.put(path, analytic);
20988
+ }
20989
+ async getAnalyticsForSync(userId, organisationId, params) {
20990
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics/synccandidates`;
20991
+ return await this.client.get(path, { params });
20992
+ }
20993
+ /** BANK ACCOUNTS */
20994
+ async getBankAccounts(userId, organisationId, customerId, params) {
20995
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts`;
20996
+ return await this.client.get(path, { params });
20997
+ }
20998
+ async newBankAccount(userId, organisationId, customerId, bankAccount) {
20999
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts`;
21000
+ return await this.client.post(path, bankAccount);
21001
+ }
21002
+ async deleteBankAccount(userId, organisationId, customerId, bankAccountId) {
21003
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts/${bankAccountId}`;
21004
+ return await this.client.delete(path);
21005
+ }
21006
+ async getBankAccount(userId, organisationId, customerId, bankAccountId) {
21007
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts/${bankAccountId}`;
21008
+ return await this.client.get(path);
21009
+ }
21010
+ async updateBankAccount(userId, organisationId, customerId, bankAccount) {
21011
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${bankAccount.BankAccountId}`;
21012
+ return await this.client.put(path, bankAccount);
21013
+ }
21014
+ async getBankAccountsForSync(userId, organisationId, customerId, params) {
21015
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts/synccandidates`;
21016
+ return await this.client.get(path, { params });
21017
+ }
21018
+ /** CONTACTS */
21019
+ async getCustomerContacts(userId, organisationId, customerId, params) {
21020
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts`;
21021
+ return await this.client.get(path, { params });
21022
+ }
21023
+ async newContact(userId, organisationId, customerId, contact) {
21024
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts`;
21025
+ return await this.client.post(path, contact);
21026
+ }
21027
+ async deleteContact(userId, organisationId, customerId, contactId) {
21028
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts/${contactId}`;
21029
+ return await this.client.delete(path);
21030
+ }
21031
+ async getContact(userId, organisationId, customerId, contactId) {
21032
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts/${contactId}`;
21033
+ return await this.client.get(path);
21034
+ }
21035
+ async updateContact(userId, organisationId, customerId, contact) {
21036
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${contact.ContactId}`;
21037
+ return await this.client.put(path, contact);
21038
+ }
21039
+ async getContacts(userId, organisationId, params) {
21040
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/contacts`;
21041
+ return await this.client.get(path, { params });
21042
+ }
21043
+ async getContactForSync(userId, organisationId, customerId, params) {
21044
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts/synccandidates`;
21045
+ return await this.client.get(path, { params });
21046
+ }
21047
+ /** COUNTRIES */
21048
+ async getCountries(userId, organisationId, params) {
21049
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/countries`;
21050
+ return await this.client.get(path, { params });
21051
+ }
21052
+ async getCountry(userId, organisationId, countryId) {
21053
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/countries/${countryId}`;
21054
+ return await this.client.get(path);
21055
+ }
21056
+ async getCountryByCode(userId, organisationId, code) {
21057
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/countries/code(${code})`;
21058
+ return await this.client.get(path);
21059
+ }
21060
+ async getCountriesForSync(userId, organisationId, params) {
21061
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/countries/synccandidates`;
21062
+ return await this.client.get(path, { params });
21063
+ }
21064
+ /** CURRENCIES */
21065
+ async getCurrencies(userId, organisationId, params) {
21066
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies`;
21067
+ return await this.client.get(path, { params });
21068
+ }
21069
+ async getCurrency(userId, organisationId, currencyId) {
21070
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies/${currencyId}`;
21071
+ return await this.client.get(path);
21072
+ }
21073
+ async getCurrencyByDate(userId, organisationId, date) {
21074
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies/date(${date.toISOString()})`;
21075
+ return await this.client.get(path);
21076
+ }
21077
+ async getCurrencyByCode(userId, organisationId, code) {
21078
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies/code(${code})`;
21079
+ return await this.client.get(path);
21080
+ }
21081
+ async getCurrenciesForSync(userId, organisationId, params) {
21082
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies/synccandidates`;
21083
+ return await this.client.get(path, { params });
21084
+ }
21085
+ /** CUSTOMERS */
21086
+ async getCustomers(userId, organisationId, params) {
21087
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers`;
21088
+ return await this.client.get(path, { params });
21089
+ }
21090
+ async newCustomer(userId, organisationId, customer) {
21091
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers`;
21092
+ return await this.client.post(path, customer);
21093
+ }
21094
+ async deleteCusomter(userId, organisationId, customerId) {
21095
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}`;
21096
+ return await this.client.delete(path);
21097
+ }
21098
+ async getCustomer(userId, organisationId, customerId) {
21099
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}`;
21100
+ return await this.client.get(path);
21101
+ }
21102
+ async updateCustomer(userId, organisationId, customer) {
21103
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customer.CustomerId}`;
21104
+ return await this.client.put(path, customer);
21105
+ }
21106
+ async getCustomerByCode(userId, organisationId, code) {
21107
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/code(${code})`;
21108
+ return await this.client.get(path);
21109
+ }
21110
+ async newCustomerByTaxNumber(userId, organisationId, taxNumber) {
21111
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/addbytaxnumber(${taxNumber})`;
21112
+ return await this.client.post(path, {});
21113
+ }
21114
+ async getCustomersForSync(userId, organisationId, params) {
21115
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/synccandidates`;
21116
+ return await this.client.get(path, { params });
21117
+ }
21118
+ /** DASHBOARDS */
21119
+ async getDashboardsData(userId, organisationId) {
21120
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/dashboards`;
21121
+ return await this.client.get(path);
21122
+ }
21123
+ /** DOCUMENTS */
21124
+ async getDocuments(userId, organisationId, params) {
21125
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents`;
21126
+ return await this.client.get(path, { params });
21127
+ }
21128
+ async newDocument(userId, organisationId, document) {
21129
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents`;
21130
+ return await this.client.post(path, document);
21131
+ }
21132
+ async deleteDocument(userId, organisationId, documentId) {
21133
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}`;
21134
+ return await this.client.delete(path);
21135
+ }
21136
+ async getDocument(userId, organisationId, documentId) {
21137
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}`;
21138
+ return await this.client.get(path);
21139
+ }
21140
+ async updateDocument(userId, organisationId, document) {
21141
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${document.DocumentId}`;
21142
+ return await this.client.put(path, document);
21143
+ }
21144
+ async deleteDocumentAttachment(userId, organisationId, documentId, documentAttachmentId) {
21145
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}/attachments/${documentAttachmentId}`;
21146
+ return await this.client.delete(path);
21147
+ }
21148
+ async getDocumentAttachment(userId, organisationId, documentId, documentAttachmentId) {
21149
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}/attachments/${documentAttachmentId}`;
21150
+ return await this.client.get(path);
21151
+ }
21152
+ async updateDocumentAttachment(userId, organisationId, documentId, documentAttachment) {
21153
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}/attachments/${documentAttachment.DocumentAttachmentId}`;
21154
+ return await this.client.put(path, documentAttachment);
21155
+ }
21156
+ async newDocumentAttachment(userId, organisationId, documentId, documentAttachment) {
21157
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}/attachments`;
21158
+ return await this.client.post(path, documentAttachment);
21159
+ }
21160
+ async getDocumentsForSync(userId, organisationId, params) {
21161
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/synccandidates`;
21162
+ return await this.client.get(path, { params });
21163
+ }
21164
+ /** DOCUMENT NUMBERINGS */
21165
+ async getDocumentNumberings(userId, organisationId, params) {
21166
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/document-numbering`;
21167
+ return await this.client.get(path, { params });
21168
+ }
21169
+ async getDocumentNumbering(userId, organisationId, documentNumberingId) {
21170
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/document-numbering/${documentNumberingId}`;
21171
+ return await this.client.get(path);
21172
+ }
21173
+ /** EFAKTURA */
21174
+ async getEFakturaList(userId, params) {
21175
+ const path = `/karadjordje/v1/minimax/${userId}/api/efaktura/list`;
21176
+ return await this.client.get(path, { params });
21177
+ }
21178
+ /** EMPLOYEES */
21179
+ async getEmployees(userId, organisationId, params) {
21180
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees`;
21181
+ return await this.client.get(path, { params });
21182
+ }
21183
+ async newEmployee(userId, organisationId, employee) {
21184
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees`;
21185
+ return await this.client.post(path, employee);
21186
+ }
21187
+ async deleteEmployee(userId, organisationId, employeeId) {
21188
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees/${employeeId}`;
21189
+ return await this.client.delete(path);
21190
+ }
21191
+ async getEmployee(userId, organisationId, employeeId) {
21192
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees/${employeeId}`;
21193
+ return await this.client.get(path);
21194
+ }
21195
+ async updateEmployee(userId, organisationId, employee) {
21196
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees/${employee.EmployeeId}`;
21197
+ return await this.client.put(path, employee);
21198
+ }
21199
+ async getEmployeesForSync(userId, organisationId, params) {
21200
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees/synccandidates`;
21201
+ return await this.client.get(path, { params });
21202
+ }
21203
+ /** EXCHANGE RATES */
21204
+ async getExchangeRate(userId, organisationId, currencyId) {
21205
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/exchange-rates/${currencyId}`;
21206
+ return await this.client.get(path);
21207
+ }
21208
+ async getExchangeRateByCode(userId, organisationId, currencyCode) {
21209
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/exchange-rates/code(${currencyCode})`;
21210
+ return await this.client.get(path);
21211
+ }
21212
+ /** INBOX */
21213
+ async getInboxes(userId, organisationId, params) {
21214
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox`;
21215
+ return await this.client.get(path, { params });
21216
+ }
21217
+ async newInbox(userId, organisationId, inbox) {
21218
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox`;
21219
+ return await this.client.post(path, inbox);
21220
+ }
21221
+ async deleteInbox(userId, organisationId, inboxId) {
21222
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}`;
21223
+ return await this.client.delete(path);
21224
+ }
21225
+ async getInbox(userId, organisationId, inboxId) {
21226
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}`;
21227
+ return await this.client.get(path);
21228
+ }
21229
+ async newInboxAttachment(userId, organisationId, inboxId, inboxAttachment) {
21230
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}`;
21231
+ return await this.client.post(path, inboxAttachment);
21232
+ }
21233
+ async deleteInboxAttachment(userId, organisationId, inboxId, inboxAttachmentId) {
21234
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}/attachments/${inboxAttachmentId}`;
21235
+ return await this.client.delete(path);
21236
+ }
21237
+ async actionOnInbox(userId, organisationId, inboxId, action) {
21238
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}/actions/${action}`;
21239
+ return await this.client.put(path, {});
21240
+ }
21241
+ /** ISSUED INVOICE */
21242
+ async getIssuedInvoices(userId, organisationId, params) {
21243
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices`;
21244
+ return await this.client.get(path, { params });
21245
+ }
21246
+ async newIssuedInvoice(userId, organisationId, issuedInvoice) {
21247
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices`;
21248
+ return await this.client.post(path, issuedInvoice);
21249
+ }
21250
+ async deleteIssuedInvoice(userId, organisationId, issuedInvoiceId) {
21251
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/${issuedInvoiceId}`;
21252
+ return await this.client.delete(path);
21253
+ }
21254
+ async getIssuedInvoice(userId, organisationId, issuedInvoiceId) {
21255
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/${issuedInvoiceId}`;
21256
+ return await this.client.get(path);
21257
+ }
21258
+ async updateIssuedInvoice(userId, organisationId, issuedInvoice) {
21259
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/${issuedInvoice.IssuedInvoiceId}`;
21260
+ return await this.client.put(path, issuedInvoice);
21261
+ }
21262
+ async actionOnIssuedInvoice(userId, organisationId, issuedInvoiceId, action) {
21263
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/${issuedInvoiceId}/actions/${action}`;
21264
+ return await this.client.put(path, {});
21265
+ }
21266
+ async getIssuedInvoicesForSync(userId, organisationId, params) {
21267
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/synccandidates`;
21268
+ return await this.client.get(path, { params });
21269
+ }
21270
+ async getPaymentMethodsOnIssuedInvoices(userId, organisationId, params) {
21271
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/paymentmethods`;
21272
+ return await this.client.get(path, { params });
21273
+ }
21274
+ /** ISSUED INVOICE POSTING */
21275
+ async getIssuedInvoicePostings(userId, organisationId, params) {
21276
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings`;
21277
+ return await this.client.get(path, { params });
21278
+ }
21279
+ async newIssuedInvoicePosting(userId, organisationId, issuedInvoicePosting) {
21280
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings`;
21281
+ return await this.client.post(path, issuedInvoicePosting);
21282
+ }
21283
+ async deleteIssuedInvoicePosting(userId, organisationId, issuedInvoicePostingId) {
21284
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings/${issuedInvoicePostingId}`;
21285
+ return await this.client.delete(path);
21286
+ }
21287
+ async getIssuedInvoicePosting(userId, organisationId, issuedInvoicePostingId) {
21288
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings/${issuedInvoicePostingId}`;
21289
+ return await this.client.get(path);
21290
+ }
21291
+ async getPaymentMethodsOnIssuedInvoicePostings(userId, organisationId, params) {
21292
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings/paymentmethods`;
21293
+ return await this.client.get(path, { params });
21294
+ }
21295
+ async actionOnIssuedInvoicePosting(userId, organisationId, issuedInvoicePostingId, action) {
21296
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings/${issuedInvoicePostingId}/actions/${action}`;
21297
+ return await this.client.put(path, {});
21298
+ }
21299
+ /** ITEMS */
21300
+ async getItems(userId, organisationId, params) {
21301
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items`;
21302
+ return await this.client.get(path, { params });
21303
+ }
21304
+ async newItem(userId, organisationId, item) {
21305
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items`;
21306
+ return await this.client.post(path, item);
21307
+ }
21308
+ async deleteItem(userId, organisationId, itemId) {
21309
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/${itemId}`;
21310
+ return await this.client.delete(path);
21311
+ }
21312
+ async getItem(userId, organisationId, itemId) {
21313
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/${itemId}`;
21314
+ return await this.client.get(path);
21315
+ }
21316
+ async updateItem(userId, organisationId, item) {
21317
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/${item.ItemId}`;
21318
+ return await this.client.put(path, item);
21319
+ }
21320
+ async getItemByCode(userId, organisationId, code) {
21321
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/code(${code})`;
21322
+ return await this.client.get(path);
21323
+ }
21324
+ async getItemSettings(userId, organisationId, code) {
21325
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/settings`;
21326
+ return await this.client.get(path);
21327
+ }
21328
+ async getItemData(userId, organisationId, params) {
21329
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/itemsdata`;
21330
+ return await this.client.get(path, { params });
21331
+ }
21332
+ async getItemPricelist(userId, organisationId, params) {
21333
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/pricelists`;
21334
+ return await this.client.get(path, { params });
21335
+ }
21336
+ async getItemsForSync(userId, organisationId, params) {
21337
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/synccandidates`;
21338
+ return await this.client.get(path, { params });
21339
+ }
21340
+ /** JOURNALS */
21341
+ async getJournals(userId, organisationId, params) {
21342
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals`;
21343
+ return await this.client.get(path, { params });
21344
+ }
21345
+ async newJournal(userId, organisationId, journal) {
21346
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals`;
21347
+ return await this.client.post(path, journal);
21348
+ }
21349
+ async deleteJournal(userId, organisationId, journalId) {
21350
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}`;
21351
+ return await this.client.delete(path);
21352
+ }
21353
+ async getJournal(userId, organisationId, journalId) {
21354
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}`;
21355
+ return await this.client.get(path);
21356
+ }
21357
+ async updateJournal(userId, organisationId, journal) {
21358
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journal.JournalId}`;
21359
+ return await this.client.put(path, journal);
21360
+ }
21361
+ async deleteJournalVatEntry(userId, organisationId, journalId, vatId) {
21362
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}/vat/${vatId}`;
21363
+ return await this.client.delete(path);
21364
+ }
21365
+ async getJournalVatEntry(userId, organisationId, journalId, vatId) {
21366
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}/vat/${vatId}`;
21367
+ return await this.client.get(path);
21368
+ }
21369
+ async updateJournalVatEntry(userId, organisationId, journalId, vatEntry) {
21370
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}/vat/${vatEntry.VatEntryId}`;
21371
+ return await this.client.put(path, vatEntry);
21372
+ }
21373
+ async newJournalVatEntry(userId, organisationId, journalId, vatEntry) {
21374
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}/vat`;
21375
+ return await this.client.post(path, vatEntry);
21376
+ }
21377
+ async getJournalsForSync(userId, organisationId, params) {
21378
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/synccandidates`;
21379
+ return await this.client.get(path, { params });
21380
+ }
21381
+ async getJournalsInVODStandard(userId, organisationId, params) {
21382
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/vodstandard`;
21383
+ return await this.client.get(path, { params });
21384
+ }
21385
+ async getJournalEntries(userId, organisationId, params) {
21386
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/journal-entries`;
21387
+ return await this.client.get(path, { params });
21388
+ }
21389
+ /** JOURNAL TYPES */
21390
+ async getJournalTypes(userId, organisationId, params) {
21391
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journaltypes`;
21392
+ return await this.client.get(path, { params });
21393
+ }
21394
+ async getJournalType(userId, organisationId, journalTypeId) {
21395
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journaltypes/${journalTypeId}`;
21396
+ return await this.client.get(path);
21397
+ }
21398
+ async getJournalTypeByCode(userId, organisationId, code) {
21399
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journaltypes/code(${code})`;
21400
+ return await this.client.get(path);
21401
+ }
21402
+ async getJournalTypesForSync(userId, organisationId, params) {
21403
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journaltypes/synccandidates`;
21404
+ return await this.client.get(path, { params });
21405
+ }
21406
+ /** ORDERS */
21407
+ async getOrders(userId, organisationId, params) {
21408
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders`;
21409
+ return await this.client.get(path, { params });
21410
+ }
21411
+ async newOrder(userId, organisationId, order) {
21412
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders`;
21413
+ return await this.client.post(path, order);
21414
+ }
21415
+ async deleteOrder(userId, organisationId, orderId) {
21416
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${orderId}`;
21417
+ return await this.client.delete(path);
21418
+ }
21419
+ async getOrder(userId, organisationId, orderId) {
21420
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${orderId}`;
21421
+ return await this.client.get(path);
21422
+ }
21423
+ async updateOrder(userId, organisationId, order) {
21424
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${order.OrderId}`;
21425
+ return await this.client.put(path, order);
21426
+ }
21427
+ async actionGetOnOrder(userId, organisationId, orderId, action, params) {
21428
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${orderId}/actions/${action}`;
21429
+ return await this.client.get(path, { params });
21430
+ }
21431
+ async actionPutOnOrder(userId, organisationId, orderId, action, params) {
21432
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${orderId}/actions/${action}`;
21433
+ return await this.client.put(path, {}, { params });
21434
+ }
21435
+ async getOrdersForSync(userId, organisationId, params) {
21436
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/synccandidates`;
21437
+ return await this.client.get(path, { params });
21438
+ }
21439
+ /** ORGANISATIONS */
21440
+ async getOrganisation(userId, organisationId) {
21441
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}`;
21442
+ return await this.client.get(path);
21443
+ }
21444
+ async getAllOrganisations(userId, params) {
21445
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/allOrgs`;
21446
+ return await this.client.get(path, { params });
21447
+ }
21448
+ /** OUTBOX */
21449
+ async getAllOuboxes(userId, organisationId, params) {
21450
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/outbox`;
21451
+ return await this.client.get(path, { params });
21452
+ }
21453
+ async getOutbox(userId, organisationId, outboxId) {
21454
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/outbox/${outboxId}`;
21455
+ return await this.client.get(path);
21456
+ }
21457
+ /** PAYMENT METHODS */
21458
+ async getPaymentMethods(userId, organisationId, params) {
21459
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/paymentmethods`;
21460
+ return await this.client.get(path, { params });
21461
+ }
21462
+ /** PAYROLL SETTINGS */
21463
+ async getPayrollSettingsByCode(userId, code) {
21464
+ const path = `/karadjordje/v1/minimax/${userId}/api/payrollsettings/${code}`;
21465
+ return await this.client.get(path);
21466
+ }
21467
+ /** POSTAL CODE */
21468
+ async getPostalCodesByCountry(userId, organisationId, countryId, params) {
21469
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/postalcodes/countries/${countryId}`;
21470
+ return await this.client.get(path, { params });
21471
+ }
21472
+ async getPostalCode(userId, organisationId, postalCodeId) {
21473
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/postalcodes/${postalCodeId}`;
21474
+ return await this.client.get(path);
21475
+ }
21476
+ async getPostalCodesForSync(userId, organisationId, params) {
21477
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/postalcodes/synccandidates`;
21478
+ return await this.client.get(path, { params });
21479
+ }
21480
+ /** PRODUCT GROUPS */
21481
+ async getProductGroups(userId, organisationId, params) {
21482
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups`;
21483
+ return await this.client.get(path, { params });
21484
+ }
21485
+ async newProductGroup(userId, organisationId, productGroup) {
21486
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups`;
21487
+ return await this.client.post(path, productGroup);
21488
+ }
21489
+ async deleteProductGroup(userId, organisationId, productGroupId) {
21490
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups/${productGroupId}`;
21491
+ return await this.client.delete(path);
21492
+ }
21493
+ async getProductGroup(userId, organisationId, productGroupId) {
21494
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups/${productGroupId}`;
21495
+ return await this.client.get(path);
21496
+ }
21497
+ async updateProductGroup(userId, organisationId, productGroup) {
21498
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups/${productGroup.ProductGroupId}`;
21499
+ return await this.client.put(path, productGroup);
21500
+ }
21501
+ async getProductGroupsForSync(userId, organisationId, params) {
21502
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups/synccandidates`;
21503
+ return await this.client.get(path, { params });
21504
+ }
21505
+ /** PURPOSE CODE */
21506
+ async getPurposeCodes(userId, organisationId, params) {
21507
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/purpose-codes`;
21508
+ return await this.client.get(path, { params });
21509
+ }
21510
+ async getPurposeCode(userId, organisationId, purposeCodeId) {
21511
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/purpose-codes/${purposeCodeId}`;
21512
+ return await this.client.get(path);
21513
+ }
21514
+ async getPurposeCodeByCode(userId, organisationId, code) {
21515
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/purpose-codes/code(${code})`;
21516
+ return await this.client.get(path);
21517
+ }
21518
+ async getPurposeCodesForSync(userId, organisationId, params) {
21519
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/purpose-codes/synccandidates`;
21520
+ return await this.client.get(path, { params });
21521
+ }
21522
+ /** RECEIVED INVOICES */
21523
+ async deleteReceivedInvoice(userId, organisationId, receivedInvoiceId) {
21524
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoiceId}`;
21525
+ return await this.client.delete(path);
21526
+ }
21527
+ async getReceivedInvoice(userId, organisationId, receivedInvoiceId) {
21528
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoiceId}`;
21529
+ return await this.client.get(path);
21530
+ }
21531
+ async updateReceivedInvoice(userId, organisationId, receivedInvoice) {
21532
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoice.ReceivedInvoiceId}`;
21533
+ return await this.client.put(path, receivedInvoice);
21534
+ }
21535
+ async getReceivedInvoices(userId, organisationId, params) {
21536
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices`;
21537
+ return await this.client.get(path, { params });
21538
+ }
21539
+ async newReceivedInvoice(userId, organisationId, receivedInvoice) {
21540
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices`;
21541
+ return await this.client.post(path, receivedInvoice);
21542
+ }
21543
+ async getReceivedInvoicesAttachments(userId, organisationId, receivedInvoiceId, params) {
21544
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoiceId}/attachments`;
21545
+ return await this.client.get(path, { params });
21546
+ }
21547
+ async newReceivedInvoiceAttachment(userId, organisationId, receivedInvoiceId, attachment) {
21548
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoiceId}/attachments`;
21549
+ return await this.client.post(path, attachment);
21550
+ }
21551
+ /** REPORT TEMPLATES */
21552
+ async getReportTemplates(userId, organisationId, params) {
21553
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/report-templates`;
21554
+ return await this.client.get(path, { params });
21555
+ }
21556
+ async getReportTemplate(userId, organisationId, reportTemplateId) {
21557
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/report-templates/${reportTemplateId}`;
21558
+ return await this.client.get(path);
21559
+ }
21560
+ async getReportTemplatesForSync(userId, organisationId, params) {
21561
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/report-templates/synccandidates`;
21562
+ return await this.client.get(path, { params });
21563
+ }
21564
+ /** STOCK */
21565
+ async getStock(userId, organisationId, params) {
21566
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stocks`;
21567
+ return await this.client.get(path, { params });
21568
+ }
21569
+ async getStockForItem(userId, organisationId, itemId) {
21570
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stocks/${itemId}`;
21571
+ return await this.client.get(path);
21572
+ }
21573
+ /** STOCK ENTRIES */
21574
+ async getStockEntries(userId, organisationId, params) {
21575
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry`;
21576
+ return await this.client.get(path, { params });
21577
+ }
21578
+ async newStockEntry(userId, organisationId, stockEntry) {
21579
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry`;
21580
+ return await this.client.post(path, stockEntry);
21581
+ }
21582
+ async deleteStockEntry(userId, organisationId, stockEntryId) {
21583
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntryId}`;
21584
+ return await this.client.delete(path);
21585
+ }
21586
+ async getStockEntry(userId, organisationId, stockEntryId) {
21587
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntryId}`;
21588
+ return await this.client.get(path);
21589
+ }
21590
+ async updateStockEntry(userId, organisationId, stockEntry) {
21591
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntry.StockEntryId}`;
21592
+ return await this.client.post(path, stockEntry);
21593
+ }
21594
+ async actionGetOnStockEntry(userId, organisationId, stockEntryId, action, params) {
21595
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntryId}/actions/${action}`;
21596
+ return await this.client.get(path, { params });
21597
+ }
21598
+ async actionPutOnStockEntry(userId, organisationId, stockEntryId, action, params) {
21599
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntryId}/actions/${action}`;
21600
+ return await this.client.put(path, {}, { params });
21601
+ }
21602
+ /** USERS */
21603
+ async getCurrentUser(userId) {
21604
+ const path = `/karadjordje/v1/minimax/${userId}/api/currentuser/profile`;
21605
+ return await this.client.get(path);
21606
+ }
21607
+ async getCurrentUserOrgs(userId) {
21608
+ const path = `/karadjordje/v1/minimax/${userId}/api/currentuser/orgs`;
21609
+ return await this.client.get(path);
21610
+ }
21611
+ /** VAT ACCOUNTING TYPES */
21612
+ async getVatAccountingTypes(userId, organisationId, params) {
21613
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vataccountingtypes`;
21614
+ return await this.client.get(path, { params });
21615
+ }
21616
+ async getVatAccountingTypesForSync(userId, organisationId, params) {
21617
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vataccountingtypes/synccandidates`;
21618
+ return await this.client.get(path, { params });
21619
+ }
21620
+ /** VAT RATES */
21621
+ async getVatRates(userId, organisationId, params) {
21622
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vatrates`;
21623
+ return await this.client.get(path, { params });
21624
+ }
21625
+ async getVatRate(userId, organisationId, vatRateId) {
21626
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vatrates/${vatRateId}`;
21627
+ return await this.client.get(path);
21628
+ }
21629
+ async getVatRateByCode(userId, organisationId, code) {
21630
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vatrates/code(${code})`;
21631
+ return await this.client.get(path);
21632
+ }
21633
+ async getVatRatesForSync(userId, organisationId, params) {
21634
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vatrates/synccandidates`;
21635
+ return await this.client.get(path, { params });
21636
+ }
21637
+ /** WAREHOUSES */
21638
+ async getWarehouses(userId, organisationId, params) {
21639
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses`;
21640
+ return await this.client.get(path, { params });
21641
+ }
21642
+ async newWarehouse(userId, organisationId, warehouse) {
21643
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses`;
21644
+ return await this.client.post(path, warehouse);
21645
+ }
21646
+ async deleteWarehouse(userId, organisationId, warehouseId) {
21647
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses/${warehouseId}`;
21648
+ return await this.client.delete(path);
21649
+ }
21650
+ async getWarehouse(userId, organisationId, warehouseId) {
21651
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses/${warehouseId}`;
21652
+ return await this.client.get(path);
21653
+ }
21654
+ async updateWarehouse(userId, organisationId, warehouse) {
21655
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses/${warehouse.WarehouseId}`;
21656
+ return await this.client.put(path, warehouse);
21657
+ }
21658
+ async getWarehousesForSync(userId, organisationId, params) {
21659
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses/synccandidates`;
21660
+ return await this.client.get(path, { params });
20599
21661
  }
20600
21662
  }
20601
21663
 
@@ -20609,6 +21671,7 @@ class Integrations extends IntegrationsBaseClient {
20609
21671
  'protokol-dms': new DMS().setClient(this.client),
20610
21672
  'serbia-utilities': new SerbiaUtil().setClient(this.client),
20611
21673
  'protokol-payments': new Payments().setClient(this.client),
21674
+ 'protokol-minimax': new Minimax().setClient(this.client),
20612
21675
  };
20613
21676
  }
20614
21677
  getSerbiaUtilities() {
@@ -20626,6 +21689,9 @@ class Integrations extends IntegrationsBaseClient {
20626
21689
  getPayments() {
20627
21690
  return this.getInterfaceOf('protokol-payments');
20628
21691
  }
21692
+ getMinimax() {
21693
+ return this.getInterfaceOf('protokol-minimax');
21694
+ }
20629
21695
  async isInstalled(id) {
20630
21696
  const { data } = await this.client.get("/v1/integrations");
20631
21697
  return data.find((i) => i.id == id) !== undefined;