@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 +1092 -26
- package/dist/index.esm.js +1092 -26
- package/dist/index.iife.js +1092 -26
- package/dist/package.json +1 -1
- package/dist/types/api/componentUtils.d.ts +4 -2
- package/dist/types/api/integrations/dms.d.ts +65 -15
- package/dist/types/api/integrations/minimax.d.ts +289 -0
- package/dist/types/api/integrations/payments.d.ts +37 -4
- package/dist/types/api/integrations.d.ts +2 -0
- package/dist/types/api/ratchet.d.ts +193 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types/component.d.ts +35 -1
- package/dist/types/types/integrations.d.ts +171 -0
- package/dist/types/types/ratchet.d.ts +38 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -531,12 +531,210 @@ class Thunder extends PlatformBaseClient {
|
|
|
531
531
|
}
|
|
532
532
|
|
|
533
533
|
class Ratchet extends PlatformBaseClient {
|
|
534
|
+
/**
|
|
535
|
+
* Get all database connections for the current project
|
|
536
|
+
*
|
|
537
|
+
* @returns List of all configured ratchet connections
|
|
538
|
+
*
|
|
539
|
+
* @example
|
|
540
|
+
* ```typescript
|
|
541
|
+
* const ratchet = new Ratchet();
|
|
542
|
+
* const connections = await ratchet.getConnections();
|
|
543
|
+
* console.log(connections.data); // Array of connections
|
|
544
|
+
* ```
|
|
545
|
+
*/
|
|
546
|
+
async getConnections() {
|
|
547
|
+
return await this.client.get("/v1/ratchet/connection");
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Get a specific database connection by ID
|
|
551
|
+
*
|
|
552
|
+
* @param id - Connection ID
|
|
553
|
+
* @returns Connection details including queries
|
|
554
|
+
*
|
|
555
|
+
* @example
|
|
556
|
+
* ```typescript
|
|
557
|
+
* const ratchet = new Ratchet();
|
|
558
|
+
* const connection = await ratchet.getConnection('users_db');
|
|
559
|
+
* console.log(connection.data.queries); // Available queries for this connection
|
|
560
|
+
* ```
|
|
561
|
+
*/
|
|
562
|
+
async getConnection(id) {
|
|
563
|
+
return await this.client.get(`/v1/ratchet/connection/${id}`);
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Create a new database connection
|
|
567
|
+
*
|
|
568
|
+
* Supports multiple database types:
|
|
569
|
+
* - MySQL: Use credentials with host, dbname, user, password
|
|
570
|
+
* - PostgreSQL: Use credentials with host, dbname, user, password
|
|
571
|
+
* - MongoDB: Use DSN connection string
|
|
572
|
+
* - BigQuery: Use service_account_json and project_id
|
|
573
|
+
*
|
|
574
|
+
* @param connection - Connection configuration
|
|
575
|
+
* @returns Created connection details
|
|
576
|
+
*
|
|
577
|
+
* @example
|
|
578
|
+
* ```typescript
|
|
579
|
+
* const ratchet = new Ratchet();
|
|
580
|
+
*
|
|
581
|
+
* // MySQL/PostgreSQL connection
|
|
582
|
+
* await ratchet.createConnection({
|
|
583
|
+
* id: 'users_db',
|
|
584
|
+
* type: 'MySQL',
|
|
585
|
+
* credentials: {
|
|
586
|
+
* type: 'Credentials',
|
|
587
|
+
* host: 'localhost',
|
|
588
|
+
* dbname: 'users',
|
|
589
|
+
* user: 'admin',
|
|
590
|
+
* password: 'secret'
|
|
591
|
+
* }
|
|
592
|
+
* });
|
|
593
|
+
*
|
|
594
|
+
* // MongoDB connection
|
|
595
|
+
* await ratchet.createConnection({
|
|
596
|
+
* id: 'mongo_db',
|
|
597
|
+
* type: 'MongoDB',
|
|
598
|
+
* credentials: {
|
|
599
|
+
* type: 'DSN',
|
|
600
|
+
* dsn: 'mongodb://localhost:27017/mydb'
|
|
601
|
+
* }
|
|
602
|
+
* });
|
|
603
|
+
*
|
|
604
|
+
* // BigQuery connection
|
|
605
|
+
* await ratchet.createConnection({
|
|
606
|
+
* id: 'analytics_bq',
|
|
607
|
+
* type: 'BigQuery',
|
|
608
|
+
* credentials: {
|
|
609
|
+
* type: 'ServiceAccount',
|
|
610
|
+
* service_account_json: '{"type":"service_account",...}',
|
|
611
|
+
* project_id: 'my-project-id'
|
|
612
|
+
* }
|
|
613
|
+
* });
|
|
614
|
+
* ```
|
|
615
|
+
*/
|
|
616
|
+
async createConnection(connection) {
|
|
617
|
+
return await this.client.post("/v1/ratchet/connection", connection);
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Update an existing database connection
|
|
621
|
+
*
|
|
622
|
+
* @param connection - Updated connection configuration
|
|
623
|
+
* @returns Success status
|
|
624
|
+
*
|
|
625
|
+
* @example
|
|
626
|
+
* ```typescript
|
|
627
|
+
* const ratchet = new Ratchet();
|
|
628
|
+
* await ratchet.updateConnection({
|
|
629
|
+
* id: 'users_db',
|
|
630
|
+
* type: 'postgres',
|
|
631
|
+
* credentials: {
|
|
632
|
+
* type: 'postgres',
|
|
633
|
+
* host: 'localhost',
|
|
634
|
+
* dbname: 'users',
|
|
635
|
+
* user: 'admin',
|
|
636
|
+
* password: 'new_secret'
|
|
637
|
+
* },
|
|
638
|
+
* queries: [
|
|
639
|
+
* { id: 'get_user', expression: 'SELECT * FROM users WHERE id = $1' }
|
|
640
|
+
* ]
|
|
641
|
+
* });
|
|
642
|
+
* ```
|
|
643
|
+
*/
|
|
644
|
+
async updateConnection(connection) {
|
|
645
|
+
return await this.client.put("/v1/ratchet/connection", connection);
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Delete a database connection
|
|
649
|
+
*
|
|
650
|
+
* @param id - Connection ID to delete
|
|
651
|
+
* @returns Success status
|
|
652
|
+
*
|
|
653
|
+
* @example
|
|
654
|
+
* ```typescript
|
|
655
|
+
* const ratchet = new Ratchet();
|
|
656
|
+
* await ratchet.deleteConnection('users_db');
|
|
657
|
+
* ```
|
|
658
|
+
*/
|
|
659
|
+
async deleteConnection(id) {
|
|
660
|
+
return await this.client.delete(`/v1/ratchet/connection/${id}`);
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Test a database connection without saving it
|
|
664
|
+
*
|
|
665
|
+
* @param connection - Connection configuration to test
|
|
666
|
+
* @returns Success status if connection is valid
|
|
667
|
+
*
|
|
668
|
+
* @example
|
|
669
|
+
* ```typescript
|
|
670
|
+
* const ratchet = new Ratchet();
|
|
671
|
+
* const isValid = await ratchet.testConnection({
|
|
672
|
+
* id: 'test_db',
|
|
673
|
+
* type: 'postgres',
|
|
674
|
+
* credentials: {
|
|
675
|
+
* type: 'postgres',
|
|
676
|
+
* host: 'localhost',
|
|
677
|
+
* dbname: 'test',
|
|
678
|
+
* user: 'admin',
|
|
679
|
+
* password: 'secret'
|
|
680
|
+
* }
|
|
681
|
+
* });
|
|
682
|
+
* ```
|
|
683
|
+
*/
|
|
684
|
+
async testConnection(connection) {
|
|
685
|
+
return await this.client.post("/v1/ratchet/test/connection", connection);
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* Execute a predefined database query
|
|
689
|
+
*
|
|
690
|
+
* Runs a query that has been previously configured in a ratchet connection.
|
|
691
|
+
* The query is identified by a qualified name in the format: `connectionId.queryId`
|
|
692
|
+
*
|
|
693
|
+
* @param name - Qualified name of the query (format: `connectionId.queryId`)
|
|
694
|
+
* @param params - Array of parameters to pass to the query
|
|
695
|
+
* @returns Query execution results
|
|
696
|
+
*
|
|
697
|
+
* @example
|
|
698
|
+
* ```typescript
|
|
699
|
+
* const ratchet = new Ratchet();
|
|
700
|
+
*
|
|
701
|
+
* // Execute a query with parameters
|
|
702
|
+
* const result = await ratchet.query('users_db.get_user_by_id', [123]);
|
|
703
|
+
*
|
|
704
|
+
* // Execute a query without parameters
|
|
705
|
+
* const allUsers = await ratchet.query('users_db.get_all_users', []);
|
|
706
|
+
* ```
|
|
707
|
+
*/
|
|
534
708
|
async query(name, params) {
|
|
535
|
-
return await this.client.post(
|
|
709
|
+
return await this.client.post("/v1/ratchet/query", {
|
|
536
710
|
name: name,
|
|
537
|
-
params: params
|
|
711
|
+
params: params,
|
|
538
712
|
});
|
|
539
713
|
}
|
|
714
|
+
/**
|
|
715
|
+
* Inspect and execute a custom query without saving it
|
|
716
|
+
*
|
|
717
|
+
* This allows you to test queries before saving them to a connection.
|
|
718
|
+
*
|
|
719
|
+
* @param request - Query inspection request with connection name, query, and params
|
|
720
|
+
* @returns Query execution results
|
|
721
|
+
*
|
|
722
|
+
* @example
|
|
723
|
+
* ```typescript
|
|
724
|
+
* const ratchet = new Ratchet();
|
|
725
|
+
* const result = await ratchet.inspectQuery({
|
|
726
|
+
* name: 'users_db.test_query',
|
|
727
|
+
* query: {
|
|
728
|
+
* id: 'test_query',
|
|
729
|
+
* expression: 'SELECT * FROM users WHERE email = $1'
|
|
730
|
+
* },
|
|
731
|
+
* params: ['user@example.com']
|
|
732
|
+
* });
|
|
733
|
+
* ```
|
|
734
|
+
*/
|
|
735
|
+
async inspectQuery(request) {
|
|
736
|
+
return await this.client.post("/v1/ratchet/query/inspect", request);
|
|
737
|
+
}
|
|
540
738
|
}
|
|
541
739
|
|
|
542
740
|
class Sandbox extends PlatformBaseClient {
|
|
@@ -996,6 +1194,23 @@ class DMS extends IntegrationsBaseClient {
|
|
|
996
1194
|
async libraries() {
|
|
997
1195
|
return await this.requestv1("GET", "media/library/list");
|
|
998
1196
|
}
|
|
1197
|
+
/**
|
|
1198
|
+
* Upload files using multipart form data
|
|
1199
|
+
*
|
|
1200
|
+
* @param payload - Upload configuration with files, directory, and options
|
|
1201
|
+
* @returns Upload response from the server
|
|
1202
|
+
*
|
|
1203
|
+
* @example
|
|
1204
|
+
* ```typescript
|
|
1205
|
+
* const result = await dms.upload({
|
|
1206
|
+
* files: [file1, file2],
|
|
1207
|
+
* uploadDir: '/documents/invoices',
|
|
1208
|
+
* public: true,
|
|
1209
|
+
* replace: true,
|
|
1210
|
+
* metadata: { category: 'finance' }
|
|
1211
|
+
* });
|
|
1212
|
+
* ```
|
|
1213
|
+
*/
|
|
999
1214
|
async upload(payload) {
|
|
1000
1215
|
let files = payload.files;
|
|
1001
1216
|
let formData = new FormData();
|
|
@@ -1012,9 +1227,12 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1012
1227
|
if (payload.public) {
|
|
1013
1228
|
formData.append('is_public', "true");
|
|
1014
1229
|
}
|
|
1230
|
+
if (payload.replace) {
|
|
1231
|
+
formData.append('replace', "true");
|
|
1232
|
+
}
|
|
1015
1233
|
if (payload.expiresAt)
|
|
1016
1234
|
formData.append('expiresAt', new Date(payload.expiresAt).toISOString());
|
|
1017
|
-
if (Object.keys(payload.metadata).length > 0)
|
|
1235
|
+
if (payload.metadata && Object.keys(payload.metadata).length > 0)
|
|
1018
1236
|
formData.append('metadata', JSON.stringify(payload.metadata));
|
|
1019
1237
|
return await this.request("POST", "media/upload", {
|
|
1020
1238
|
data: formData,
|
|
@@ -1027,6 +1245,28 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1027
1245
|
async delete(data) {
|
|
1028
1246
|
return this.request('POST', 'media/delete', data);
|
|
1029
1247
|
}
|
|
1248
|
+
/**
|
|
1249
|
+
* Upload files using base64-encoded content
|
|
1250
|
+
*
|
|
1251
|
+
* @param data - Upload payload with base64-encoded files
|
|
1252
|
+
* @returns Upload response from the server
|
|
1253
|
+
*
|
|
1254
|
+
* @example
|
|
1255
|
+
* ```typescript
|
|
1256
|
+
* const result = await dms.uploadBase64({
|
|
1257
|
+
* path: '/documents/reports',
|
|
1258
|
+
* is_public: false,
|
|
1259
|
+
* replace: true,
|
|
1260
|
+
* files: [
|
|
1261
|
+
* {
|
|
1262
|
+
* name: 'report.pdf',
|
|
1263
|
+
* content_type: 'application/pdf',
|
|
1264
|
+
* data: 'base64EncodedContent...'
|
|
1265
|
+
* }
|
|
1266
|
+
* ]
|
|
1267
|
+
* });
|
|
1268
|
+
* ```
|
|
1269
|
+
*/
|
|
1030
1270
|
async uploadBase64(data) {
|
|
1031
1271
|
return this.request('POST', `media/upload`, {
|
|
1032
1272
|
data,
|
|
@@ -1035,7 +1275,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1035
1275
|
}
|
|
1036
1276
|
});
|
|
1037
1277
|
}
|
|
1038
|
-
async getMedia(
|
|
1278
|
+
async getMedia(key, encoding) {
|
|
1039
1279
|
return this.request('GET', `media/get/${key}`, {
|
|
1040
1280
|
params: {
|
|
1041
1281
|
encoding
|
|
@@ -1043,7 +1283,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1043
1283
|
responseType: (!encoding) ? 'blob' : null
|
|
1044
1284
|
});
|
|
1045
1285
|
}
|
|
1046
|
-
async download(
|
|
1286
|
+
async download(key) {
|
|
1047
1287
|
return this.request('POST', `media/download`, {
|
|
1048
1288
|
data: {
|
|
1049
1289
|
key
|
|
@@ -1055,7 +1295,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1055
1295
|
return this.request('GET', `media/exif/${key}`);
|
|
1056
1296
|
}
|
|
1057
1297
|
async html2pdf(data) {
|
|
1058
|
-
const { output_pdf = false, input_path, input_html, output_path, output_file_name, output_type, data: templateData } = data;
|
|
1298
|
+
const { output_pdf = false, input_path, input_html, output_path, output_file_name, output_type, data: templateData, replace, } = data;
|
|
1059
1299
|
const type = output_pdf ? 'arraybuffer' : 'json';
|
|
1060
1300
|
const contentType = output_pdf ? 'application/pdf' : 'application/json';
|
|
1061
1301
|
return this.request('POST', `media/pdf/html2pdf`, {
|
|
@@ -1066,7 +1306,27 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1066
1306
|
input_html,
|
|
1067
1307
|
output_file_name,
|
|
1068
1308
|
output_type,
|
|
1069
|
-
data: templateData
|
|
1309
|
+
data: templateData,
|
|
1310
|
+
replace,
|
|
1311
|
+
},
|
|
1312
|
+
headers: {
|
|
1313
|
+
'Content-Type': contentType
|
|
1314
|
+
},
|
|
1315
|
+
responseType: type
|
|
1316
|
+
});
|
|
1317
|
+
}
|
|
1318
|
+
async pdf2html(data) {
|
|
1319
|
+
const { output_html = false, input_path, input_pdf, output_path, output_file_name, replace, } = data;
|
|
1320
|
+
const type = output_html ? 'arraybuffer' : 'json';
|
|
1321
|
+
const contentType = output_html ? 'text/html' : 'application/json';
|
|
1322
|
+
return this.request('POST', `media/pdf/pdf2html`, {
|
|
1323
|
+
data: {
|
|
1324
|
+
output_html,
|
|
1325
|
+
input_path,
|
|
1326
|
+
output_path,
|
|
1327
|
+
input_pdf,
|
|
1328
|
+
output_file_name,
|
|
1329
|
+
replace,
|
|
1070
1330
|
},
|
|
1071
1331
|
headers: {
|
|
1072
1332
|
'Content-Type': contentType
|
|
@@ -1083,8 +1343,40 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1083
1343
|
async dirs(data) {
|
|
1084
1344
|
return await this.request("POST", `media/library/dirs`, { data });
|
|
1085
1345
|
}
|
|
1086
|
-
|
|
1087
|
-
|
|
1346
|
+
// ===================================================================
|
|
1347
|
+
// Document Methods
|
|
1348
|
+
// ===================================================================
|
|
1349
|
+
async createDocument(payload) {
|
|
1350
|
+
return this.requestv2('POST', 'documents/document', { data: payload });
|
|
1351
|
+
}
|
|
1352
|
+
async getDocument(path) {
|
|
1353
|
+
return this.requestv2('GET', `documents/document/${path}`);
|
|
1354
|
+
}
|
|
1355
|
+
async getDocumentRaw(path) {
|
|
1356
|
+
return this.requestv2('GET', `documents/document/${path}`, {
|
|
1357
|
+
headers: { Accept: 'application/pdoc' }
|
|
1358
|
+
});
|
|
1359
|
+
}
|
|
1360
|
+
async updateDocument(payload) {
|
|
1361
|
+
return this.requestv2('PATCH', 'documents/document', { data: payload });
|
|
1362
|
+
}
|
|
1363
|
+
async deleteDocument(path) {
|
|
1364
|
+
return this.requestv2('DELETE', `documents/document/${path}`);
|
|
1365
|
+
}
|
|
1366
|
+
async listDocuments(params) {
|
|
1367
|
+
return this.requestv2('GET', 'documents/list', { params });
|
|
1368
|
+
}
|
|
1369
|
+
async listDeletedDocuments(params) {
|
|
1370
|
+
return this.requestv2('GET', 'documents/list/__deleted__', { params });
|
|
1371
|
+
}
|
|
1372
|
+
async restoreDocument(payload) {
|
|
1373
|
+
return this.requestv2('POST', 'documents/restore', { data: payload });
|
|
1374
|
+
}
|
|
1375
|
+
async createDocumentComment(payload) {
|
|
1376
|
+
return this.requestv2('POST', 'documents/document/comment', { data: payload });
|
|
1377
|
+
}
|
|
1378
|
+
async fillPdf(data) {
|
|
1379
|
+
const { input_path, output_path, output_pdf = false, output_type, output_file_name, replace, form_data, forms } = data;
|
|
1088
1380
|
const responseType = output_pdf ? 'arraybuffer' : 'json';
|
|
1089
1381
|
const contentType = output_pdf ? 'application/pdf' : 'application/json';
|
|
1090
1382
|
return this.request('POST', `media/pdf/fill`, {
|
|
@@ -1095,6 +1387,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1095
1387
|
output_type,
|
|
1096
1388
|
output_file_name,
|
|
1097
1389
|
form_data,
|
|
1390
|
+
replace,
|
|
1098
1391
|
forms
|
|
1099
1392
|
},
|
|
1100
1393
|
headers: {
|
|
@@ -1172,7 +1465,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1172
1465
|
* // excelResult.data is a Blob
|
|
1173
1466
|
* ```
|
|
1174
1467
|
*/
|
|
1175
|
-
async convertData(
|
|
1468
|
+
async convertData(data, params) {
|
|
1176
1469
|
const { from, to, sheet_name, include_header, include_footer, header_as_comment, footer_as_comment, separator_rows, field_order, } = params;
|
|
1177
1470
|
const queryParams = { from, to };
|
|
1178
1471
|
// Add optional parameters if provided
|
|
@@ -1239,7 +1532,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1239
1532
|
* // }
|
|
1240
1533
|
* ```
|
|
1241
1534
|
*/
|
|
1242
|
-
async getDataInfo(
|
|
1535
|
+
async getDataInfo(data, params) {
|
|
1243
1536
|
const { format } = params;
|
|
1244
1537
|
return this.request('POST', `media/convert/info`, {
|
|
1245
1538
|
data,
|
|
@@ -1283,7 +1576,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1283
1576
|
* }
|
|
1284
1577
|
* ```
|
|
1285
1578
|
*/
|
|
1286
|
-
async validateData(
|
|
1579
|
+
async validateData(data, params) {
|
|
1287
1580
|
const { format } = params;
|
|
1288
1581
|
return this.request('POST', `media/convert/validate`, {
|
|
1289
1582
|
data,
|
|
@@ -1331,7 +1624,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1331
1624
|
* // Auto-detects header, items, and footer sections
|
|
1332
1625
|
* ```
|
|
1333
1626
|
*/
|
|
1334
|
-
async jsonToCsv(
|
|
1627
|
+
async jsonToCsv(jsonData, options) {
|
|
1335
1628
|
let params = {};
|
|
1336
1629
|
if (options === null || options === void 0 ? void 0 : options.field_order) {
|
|
1337
1630
|
params.field_order = options.field_order.join(',');
|
|
@@ -1390,7 +1683,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1390
1683
|
* link.click();
|
|
1391
1684
|
* ```
|
|
1392
1685
|
*/
|
|
1393
|
-
async jsonToExcel(
|
|
1686
|
+
async jsonToExcel(jsonData, options) {
|
|
1394
1687
|
const params = {};
|
|
1395
1688
|
if (options === null || options === void 0 ? void 0 : options.sheet_name) {
|
|
1396
1689
|
params.sheet_name = options.sheet_name;
|
|
@@ -1429,7 +1722,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1429
1722
|
* // ]
|
|
1430
1723
|
* ```
|
|
1431
1724
|
*/
|
|
1432
|
-
async csvToJson(
|
|
1725
|
+
async csvToJson(csvData) {
|
|
1433
1726
|
return this.request('POST', `media/convert/csv-to-json`, {
|
|
1434
1727
|
data: csvData,
|
|
1435
1728
|
responseType: 'json',
|
|
@@ -1462,7 +1755,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1462
1755
|
* // Use url for download or further processing
|
|
1463
1756
|
* ```
|
|
1464
1757
|
*/
|
|
1465
|
-
async csvToExcel(
|
|
1758
|
+
async csvToExcel(csvData, options) {
|
|
1466
1759
|
const params = {};
|
|
1467
1760
|
if (options === null || options === void 0 ? void 0 : options.sheet_name) {
|
|
1468
1761
|
params.sheet_name = options.sheet_name;
|
|
@@ -1502,7 +1795,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1502
1795
|
* const jsonFromBuffer = await dms.excelToJson(libraryRef, arrayBuffer);
|
|
1503
1796
|
* ```
|
|
1504
1797
|
*/
|
|
1505
|
-
async excelToJson(
|
|
1798
|
+
async excelToJson(excelData, options) {
|
|
1506
1799
|
const params = {};
|
|
1507
1800
|
if (options === null || options === void 0 ? void 0 : options.sheet_name) {
|
|
1508
1801
|
params.sheet_name = options.sheet_name;
|
|
@@ -1546,7 +1839,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1546
1839
|
* link.click();
|
|
1547
1840
|
* ```
|
|
1548
1841
|
*/
|
|
1549
|
-
async excelToCsv(
|
|
1842
|
+
async excelToCsv(excelData, options) {
|
|
1550
1843
|
const params = {};
|
|
1551
1844
|
if (options === null || options === void 0 ? void 0 : options.sheet_name) {
|
|
1552
1845
|
params.sheet_name = options.sheet_name;
|
|
@@ -1567,6 +1860,13 @@ class DMS extends IntegrationsBaseClient {
|
|
|
1567
1860
|
...params
|
|
1568
1861
|
});
|
|
1569
1862
|
}
|
|
1863
|
+
async requestv2(method, endpoint, params) {
|
|
1864
|
+
return await this.client.request({
|
|
1865
|
+
method,
|
|
1866
|
+
url: `/v2/dms/${endpoint}`,
|
|
1867
|
+
...params
|
|
1868
|
+
});
|
|
1869
|
+
}
|
|
1570
1870
|
async requestv1(method, endpoint, params) {
|
|
1571
1871
|
return await this.client.request({
|
|
1572
1872
|
method: method,
|
|
@@ -1614,19 +1914,781 @@ class VPFR extends IntegrationsBaseClient {
|
|
|
1614
1914
|
}
|
|
1615
1915
|
|
|
1616
1916
|
class Payments extends IntegrationsBaseClient {
|
|
1617
|
-
async getTransactions(
|
|
1618
|
-
return await this.client.get(`/karadjordje/v1/payment/${
|
|
1917
|
+
async getTransactions(userId, params) {
|
|
1918
|
+
return await this.client.get(`/karadjordje/v1/payment/${userId}/list`, {
|
|
1919
|
+
params,
|
|
1920
|
+
});
|
|
1921
|
+
}
|
|
1922
|
+
async getTransaction(provider, userId, transactionId) {
|
|
1923
|
+
return await this.client.get(`/karadjordje/v1/payment/${provider}/${userId}/getTransaction`, {
|
|
1924
|
+
params: { transactionId },
|
|
1925
|
+
});
|
|
1619
1926
|
}
|
|
1620
1927
|
async settings(provider) {
|
|
1621
1928
|
return await this.client.get(`/karadjordje/v1/payment/${provider}/settings`);
|
|
1622
1929
|
}
|
|
1930
|
+
async deactivatePaymentLink(provider, user, transactionId) {
|
|
1931
|
+
return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/deactivate/${transactionId}`);
|
|
1932
|
+
}
|
|
1933
|
+
async voidTransaction(provider, user, transactionId) {
|
|
1934
|
+
return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/void/${transactionId}`);
|
|
1935
|
+
}
|
|
1936
|
+
async refund(provider, user, transactionId) {
|
|
1937
|
+
return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/refund/${transactionId}`);
|
|
1938
|
+
}
|
|
1623
1939
|
async getPaymentLink(provider, user, options) {
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1940
|
+
return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/getPaymentLink`, options);
|
|
1941
|
+
}
|
|
1942
|
+
async getTokenRequestLink(provider, user, options) {
|
|
1943
|
+
return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/getTokenRequestLink`, options);
|
|
1944
|
+
}
|
|
1945
|
+
async directPayUsingToken(provider, user, options) {
|
|
1946
|
+
return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/directPayUsingToken`, options);
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
class Minimax extends IntegrationsBaseClient {
|
|
1951
|
+
async settings() {
|
|
1952
|
+
return await this.client.get(`/karadjordje/v1/minimax/settings`);
|
|
1953
|
+
}
|
|
1954
|
+
async getAccounts(userId, organisationId, params) {
|
|
1955
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts`;
|
|
1956
|
+
return await this.client.get(path, { params });
|
|
1957
|
+
}
|
|
1958
|
+
async getAccount(userId, organisationId, accountId) {
|
|
1959
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts/${accountId}`;
|
|
1960
|
+
return await this.client.get(path);
|
|
1961
|
+
}
|
|
1962
|
+
async getAccountByCode(userId, organisationId, code) {
|
|
1963
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts/code(${code})`;
|
|
1964
|
+
return await this.client.get(path);
|
|
1965
|
+
}
|
|
1966
|
+
async getAccountByContent(userId, organisationId, content) {
|
|
1967
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts/content(${content})`;
|
|
1968
|
+
return await this.client.get(path);
|
|
1969
|
+
}
|
|
1970
|
+
async getAccountsForSync(userId, organisationId, params) {
|
|
1971
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts/synccandidates`;
|
|
1972
|
+
return await this.client.get(path, { params });
|
|
1973
|
+
}
|
|
1974
|
+
/** ADDRESSES */
|
|
1975
|
+
async getAddresses(userId, organisationId, customerId, params) {
|
|
1976
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses`;
|
|
1977
|
+
return await this.client.get(path, { params });
|
|
1978
|
+
}
|
|
1979
|
+
async newAddress(userId, organisationId, customerId, address) {
|
|
1980
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses`;
|
|
1981
|
+
return await this.client.post(path, address);
|
|
1982
|
+
}
|
|
1983
|
+
async deleteAddress(userId, organisationId, customerId, addressId) {
|
|
1984
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${addressId}`;
|
|
1985
|
+
return await this.client.delete(path);
|
|
1986
|
+
}
|
|
1987
|
+
async getAddress(userId, organisationId, customerId, addressId) {
|
|
1988
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${addressId}`;
|
|
1989
|
+
return await this.client.get(path);
|
|
1990
|
+
}
|
|
1991
|
+
async updateAddress(userId, organisationId, customerId, address) {
|
|
1992
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${address.AddressId}`;
|
|
1993
|
+
return await this.client.put(path, address);
|
|
1994
|
+
}
|
|
1995
|
+
async getAddressesForSync(userId, organisationId, customerId, params) {
|
|
1996
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/synccandidates`;
|
|
1997
|
+
return await this.client.get(path, { params });
|
|
1998
|
+
}
|
|
1999
|
+
/** ANALYTICS */
|
|
2000
|
+
async getAnalytics(userId, organisationId, params) {
|
|
2001
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics`;
|
|
2002
|
+
return await this.client.get(path, { params });
|
|
2003
|
+
}
|
|
2004
|
+
async newAnalytic(userId, organisationId, analytic) {
|
|
2005
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics`;
|
|
2006
|
+
return await this.client.post(path, analytic);
|
|
2007
|
+
}
|
|
2008
|
+
async deleteAnalytic(userId, organisationId, analyticId) {
|
|
2009
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics/${analyticId}`;
|
|
2010
|
+
return await this.client.delete(path);
|
|
2011
|
+
}
|
|
2012
|
+
async getAnalytic(userId, organisationId, analyticId) {
|
|
2013
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics/${analyticId}`;
|
|
2014
|
+
return await this.client.get(path);
|
|
2015
|
+
}
|
|
2016
|
+
async updateAnalytic(userId, organisationId, analytic) {
|
|
2017
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics/${analytic.AnalyticId}`;
|
|
2018
|
+
return await this.client.put(path, analytic);
|
|
2019
|
+
}
|
|
2020
|
+
async getAnalyticsForSync(userId, organisationId, params) {
|
|
2021
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics/synccandidates`;
|
|
2022
|
+
return await this.client.get(path, { params });
|
|
2023
|
+
}
|
|
2024
|
+
/** BANK ACCOUNTS */
|
|
2025
|
+
async getBankAccounts(userId, organisationId, customerId, params) {
|
|
2026
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts`;
|
|
2027
|
+
return await this.client.get(path, { params });
|
|
2028
|
+
}
|
|
2029
|
+
async newBankAccount(userId, organisationId, customerId, bankAccount) {
|
|
2030
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts`;
|
|
2031
|
+
return await this.client.post(path, bankAccount);
|
|
2032
|
+
}
|
|
2033
|
+
async deleteBankAccount(userId, organisationId, customerId, bankAccountId) {
|
|
2034
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts/${bankAccountId}`;
|
|
2035
|
+
return await this.client.delete(path);
|
|
2036
|
+
}
|
|
2037
|
+
async getBankAccount(userId, organisationId, customerId, bankAccountId) {
|
|
2038
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts/${bankAccountId}`;
|
|
2039
|
+
return await this.client.get(path);
|
|
2040
|
+
}
|
|
2041
|
+
async updateBankAccount(userId, organisationId, customerId, bankAccount) {
|
|
2042
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${bankAccount.BankAccountId}`;
|
|
2043
|
+
return await this.client.put(path, bankAccount);
|
|
2044
|
+
}
|
|
2045
|
+
async getBankAccountsForSync(userId, organisationId, customerId, params) {
|
|
2046
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts/synccandidates`;
|
|
2047
|
+
return await this.client.get(path, { params });
|
|
2048
|
+
}
|
|
2049
|
+
/** CONTACTS */
|
|
2050
|
+
async getCustomerContacts(userId, organisationId, customerId, params) {
|
|
2051
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts`;
|
|
2052
|
+
return await this.client.get(path, { params });
|
|
2053
|
+
}
|
|
2054
|
+
async newContact(userId, organisationId, customerId, contact) {
|
|
2055
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts`;
|
|
2056
|
+
return await this.client.post(path, contact);
|
|
2057
|
+
}
|
|
2058
|
+
async deleteContact(userId, organisationId, customerId, contactId) {
|
|
2059
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts/${contactId}`;
|
|
2060
|
+
return await this.client.delete(path);
|
|
2061
|
+
}
|
|
2062
|
+
async getContact(userId, organisationId, customerId, contactId) {
|
|
2063
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts/${contactId}`;
|
|
2064
|
+
return await this.client.get(path);
|
|
2065
|
+
}
|
|
2066
|
+
async updateContact(userId, organisationId, customerId, contact) {
|
|
2067
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${contact.ContactId}`;
|
|
2068
|
+
return await this.client.put(path, contact);
|
|
2069
|
+
}
|
|
2070
|
+
async getContacts(userId, organisationId, params) {
|
|
2071
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/contacts`;
|
|
2072
|
+
return await this.client.get(path, { params });
|
|
2073
|
+
}
|
|
2074
|
+
async getContactForSync(userId, organisationId, customerId, params) {
|
|
2075
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts/synccandidates`;
|
|
2076
|
+
return await this.client.get(path, { params });
|
|
2077
|
+
}
|
|
2078
|
+
/** COUNTRIES */
|
|
2079
|
+
async getCountries(userId, organisationId, params) {
|
|
2080
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/countries`;
|
|
2081
|
+
return await this.client.get(path, { params });
|
|
2082
|
+
}
|
|
2083
|
+
async getCountry(userId, organisationId, countryId) {
|
|
2084
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/countries/${countryId}`;
|
|
2085
|
+
return await this.client.get(path);
|
|
2086
|
+
}
|
|
2087
|
+
async getCountryByCode(userId, organisationId, code) {
|
|
2088
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/countries/code(${code})`;
|
|
2089
|
+
return await this.client.get(path);
|
|
2090
|
+
}
|
|
2091
|
+
async getCountriesForSync(userId, organisationId, params) {
|
|
2092
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/countries/synccandidates`;
|
|
2093
|
+
return await this.client.get(path, { params });
|
|
2094
|
+
}
|
|
2095
|
+
/** CURRENCIES */
|
|
2096
|
+
async getCurrencies(userId, organisationId, params) {
|
|
2097
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies`;
|
|
2098
|
+
return await this.client.get(path, { params });
|
|
2099
|
+
}
|
|
2100
|
+
async getCurrency(userId, organisationId, currencyId) {
|
|
2101
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies/${currencyId}`;
|
|
2102
|
+
return await this.client.get(path);
|
|
2103
|
+
}
|
|
2104
|
+
async getCurrencyByDate(userId, organisationId, date) {
|
|
2105
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies/date(${date.toISOString()})`;
|
|
2106
|
+
return await this.client.get(path);
|
|
2107
|
+
}
|
|
2108
|
+
async getCurrencyByCode(userId, organisationId, code) {
|
|
2109
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies/code(${code})`;
|
|
2110
|
+
return await this.client.get(path);
|
|
2111
|
+
}
|
|
2112
|
+
async getCurrenciesForSync(userId, organisationId, params) {
|
|
2113
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies/synccandidates`;
|
|
2114
|
+
return await this.client.get(path, { params });
|
|
2115
|
+
}
|
|
2116
|
+
/** CUSTOMERS */
|
|
2117
|
+
async getCustomers(userId, organisationId, params) {
|
|
2118
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers`;
|
|
2119
|
+
return await this.client.get(path, { params });
|
|
2120
|
+
}
|
|
2121
|
+
async newCustomer(userId, organisationId, customer) {
|
|
2122
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers`;
|
|
2123
|
+
return await this.client.post(path, customer);
|
|
2124
|
+
}
|
|
2125
|
+
async deleteCusomter(userId, organisationId, customerId) {
|
|
2126
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}`;
|
|
2127
|
+
return await this.client.delete(path);
|
|
2128
|
+
}
|
|
2129
|
+
async getCustomer(userId, organisationId, customerId) {
|
|
2130
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}`;
|
|
2131
|
+
return await this.client.get(path);
|
|
2132
|
+
}
|
|
2133
|
+
async updateCustomer(userId, organisationId, customer) {
|
|
2134
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customer.CustomerId}`;
|
|
2135
|
+
return await this.client.put(path, customer);
|
|
2136
|
+
}
|
|
2137
|
+
async getCustomerByCode(userId, organisationId, code) {
|
|
2138
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/code(${code})`;
|
|
2139
|
+
return await this.client.get(path);
|
|
2140
|
+
}
|
|
2141
|
+
async newCustomerByTaxNumber(userId, organisationId, taxNumber) {
|
|
2142
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/addbytaxnumber(${taxNumber})`;
|
|
2143
|
+
return await this.client.post(path, {});
|
|
2144
|
+
}
|
|
2145
|
+
async getCustomersForSync(userId, organisationId, params) {
|
|
2146
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/synccandidates`;
|
|
2147
|
+
return await this.client.get(path, { params });
|
|
2148
|
+
}
|
|
2149
|
+
/** DASHBOARDS */
|
|
2150
|
+
async getDashboardsData(userId, organisationId) {
|
|
2151
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/dashboards`;
|
|
2152
|
+
return await this.client.get(path);
|
|
2153
|
+
}
|
|
2154
|
+
/** DOCUMENTS */
|
|
2155
|
+
async getDocuments(userId, organisationId, params) {
|
|
2156
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents`;
|
|
2157
|
+
return await this.client.get(path, { params });
|
|
2158
|
+
}
|
|
2159
|
+
async newDocument(userId, organisationId, document) {
|
|
2160
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents`;
|
|
2161
|
+
return await this.client.post(path, document);
|
|
2162
|
+
}
|
|
2163
|
+
async deleteDocument(userId, organisationId, documentId) {
|
|
2164
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}`;
|
|
2165
|
+
return await this.client.delete(path);
|
|
2166
|
+
}
|
|
2167
|
+
async getDocument(userId, organisationId, documentId) {
|
|
2168
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}`;
|
|
2169
|
+
return await this.client.get(path);
|
|
2170
|
+
}
|
|
2171
|
+
async updateDocument(userId, organisationId, document) {
|
|
2172
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${document.DocumentId}`;
|
|
2173
|
+
return await this.client.put(path, document);
|
|
2174
|
+
}
|
|
2175
|
+
async deleteDocumentAttachment(userId, organisationId, documentId, documentAttachmentId) {
|
|
2176
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}/attachments/${documentAttachmentId}`;
|
|
2177
|
+
return await this.client.delete(path);
|
|
2178
|
+
}
|
|
2179
|
+
async getDocumentAttachment(userId, organisationId, documentId, documentAttachmentId) {
|
|
2180
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}/attachments/${documentAttachmentId}`;
|
|
2181
|
+
return await this.client.get(path);
|
|
2182
|
+
}
|
|
2183
|
+
async updateDocumentAttachment(userId, organisationId, documentId, documentAttachment) {
|
|
2184
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}/attachments/${documentAttachment.DocumentAttachmentId}`;
|
|
2185
|
+
return await this.client.put(path, documentAttachment);
|
|
2186
|
+
}
|
|
2187
|
+
async newDocumentAttachment(userId, organisationId, documentId, documentAttachment) {
|
|
2188
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}/attachments`;
|
|
2189
|
+
return await this.client.post(path, documentAttachment);
|
|
2190
|
+
}
|
|
2191
|
+
async getDocumentsForSync(userId, organisationId, params) {
|
|
2192
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/synccandidates`;
|
|
2193
|
+
return await this.client.get(path, { params });
|
|
2194
|
+
}
|
|
2195
|
+
/** DOCUMENT NUMBERINGS */
|
|
2196
|
+
async getDocumentNumberings(userId, organisationId, params) {
|
|
2197
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/document-numbering`;
|
|
2198
|
+
return await this.client.get(path, { params });
|
|
2199
|
+
}
|
|
2200
|
+
async getDocumentNumbering(userId, organisationId, documentNumberingId) {
|
|
2201
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/document-numbering/${documentNumberingId}`;
|
|
2202
|
+
return await this.client.get(path);
|
|
2203
|
+
}
|
|
2204
|
+
/** EFAKTURA */
|
|
2205
|
+
async getEFakturaList(userId, params) {
|
|
2206
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/efaktura/list`;
|
|
2207
|
+
return await this.client.get(path, { params });
|
|
2208
|
+
}
|
|
2209
|
+
/** EMPLOYEES */
|
|
2210
|
+
async getEmployees(userId, organisationId, params) {
|
|
2211
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees`;
|
|
2212
|
+
return await this.client.get(path, { params });
|
|
2213
|
+
}
|
|
2214
|
+
async newEmployee(userId, organisationId, employee) {
|
|
2215
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees`;
|
|
2216
|
+
return await this.client.post(path, employee);
|
|
2217
|
+
}
|
|
2218
|
+
async deleteEmployee(userId, organisationId, employeeId) {
|
|
2219
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees/${employeeId}`;
|
|
2220
|
+
return await this.client.delete(path);
|
|
2221
|
+
}
|
|
2222
|
+
async getEmployee(userId, organisationId, employeeId) {
|
|
2223
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees/${employeeId}`;
|
|
2224
|
+
return await this.client.get(path);
|
|
2225
|
+
}
|
|
2226
|
+
async updateEmployee(userId, organisationId, employee) {
|
|
2227
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees/${employee.EmployeeId}`;
|
|
2228
|
+
return await this.client.put(path, employee);
|
|
2229
|
+
}
|
|
2230
|
+
async getEmployeesForSync(userId, organisationId, params) {
|
|
2231
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees/synccandidates`;
|
|
2232
|
+
return await this.client.get(path, { params });
|
|
2233
|
+
}
|
|
2234
|
+
/** EXCHANGE RATES */
|
|
2235
|
+
async getExchangeRate(userId, organisationId, currencyId) {
|
|
2236
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/exchange-rates/${currencyId}`;
|
|
2237
|
+
return await this.client.get(path);
|
|
2238
|
+
}
|
|
2239
|
+
async getExchangeRateByCode(userId, organisationId, currencyCode) {
|
|
2240
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/exchange-rates/code(${currencyCode})`;
|
|
2241
|
+
return await this.client.get(path);
|
|
2242
|
+
}
|
|
2243
|
+
/** INBOX */
|
|
2244
|
+
async getInboxes(userId, organisationId, params) {
|
|
2245
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox`;
|
|
2246
|
+
return await this.client.get(path, { params });
|
|
2247
|
+
}
|
|
2248
|
+
async newInbox(userId, organisationId, inbox) {
|
|
2249
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox`;
|
|
2250
|
+
return await this.client.post(path, inbox);
|
|
2251
|
+
}
|
|
2252
|
+
async deleteInbox(userId, organisationId, inboxId) {
|
|
2253
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}`;
|
|
2254
|
+
return await this.client.delete(path);
|
|
2255
|
+
}
|
|
2256
|
+
async getInbox(userId, organisationId, inboxId) {
|
|
2257
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}`;
|
|
2258
|
+
return await this.client.get(path);
|
|
2259
|
+
}
|
|
2260
|
+
async newInboxAttachment(userId, organisationId, inboxId, inboxAttachment) {
|
|
2261
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}`;
|
|
2262
|
+
return await this.client.post(path, inboxAttachment);
|
|
2263
|
+
}
|
|
2264
|
+
async deleteInboxAttachment(userId, organisationId, inboxId, inboxAttachmentId) {
|
|
2265
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}/attachments/${inboxAttachmentId}`;
|
|
2266
|
+
return await this.client.delete(path);
|
|
2267
|
+
}
|
|
2268
|
+
async actionOnInbox(userId, organisationId, inboxId, action) {
|
|
2269
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}/actions/${action}`;
|
|
2270
|
+
return await this.client.put(path, {});
|
|
2271
|
+
}
|
|
2272
|
+
/** ISSUED INVOICE */
|
|
2273
|
+
async getIssuedInvoices(userId, organisationId, params) {
|
|
2274
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices`;
|
|
2275
|
+
return await this.client.get(path, { params });
|
|
2276
|
+
}
|
|
2277
|
+
async newIssuedInvoice(userId, organisationId, issuedInvoice) {
|
|
2278
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices`;
|
|
2279
|
+
return await this.client.post(path, issuedInvoice);
|
|
2280
|
+
}
|
|
2281
|
+
async deleteIssuedInvoice(userId, organisationId, issuedInvoiceId) {
|
|
2282
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/${issuedInvoiceId}`;
|
|
2283
|
+
return await this.client.delete(path);
|
|
2284
|
+
}
|
|
2285
|
+
async getIssuedInvoice(userId, organisationId, issuedInvoiceId) {
|
|
2286
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/${issuedInvoiceId}`;
|
|
2287
|
+
return await this.client.get(path);
|
|
2288
|
+
}
|
|
2289
|
+
async updateIssuedInvoice(userId, organisationId, issuedInvoice) {
|
|
2290
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/${issuedInvoice.IssuedInvoiceId}`;
|
|
2291
|
+
return await this.client.put(path, issuedInvoice);
|
|
2292
|
+
}
|
|
2293
|
+
async actionOnIssuedInvoice(userId, organisationId, issuedInvoiceId, action) {
|
|
2294
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/${issuedInvoiceId}/actions/${action}`;
|
|
2295
|
+
return await this.client.put(path, {});
|
|
2296
|
+
}
|
|
2297
|
+
async getIssuedInvoicesForSync(userId, organisationId, params) {
|
|
2298
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/synccandidates`;
|
|
2299
|
+
return await this.client.get(path, { params });
|
|
2300
|
+
}
|
|
2301
|
+
async getPaymentMethodsOnIssuedInvoices(userId, organisationId, params) {
|
|
2302
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/paymentmethods`;
|
|
2303
|
+
return await this.client.get(path, { params });
|
|
2304
|
+
}
|
|
2305
|
+
/** ISSUED INVOICE POSTING */
|
|
2306
|
+
async getIssuedInvoicePostings(userId, organisationId, params) {
|
|
2307
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings`;
|
|
2308
|
+
return await this.client.get(path, { params });
|
|
2309
|
+
}
|
|
2310
|
+
async newIssuedInvoicePosting(userId, organisationId, issuedInvoicePosting) {
|
|
2311
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings`;
|
|
2312
|
+
return await this.client.post(path, issuedInvoicePosting);
|
|
2313
|
+
}
|
|
2314
|
+
async deleteIssuedInvoicePosting(userId, organisationId, issuedInvoicePostingId) {
|
|
2315
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings/${issuedInvoicePostingId}`;
|
|
2316
|
+
return await this.client.delete(path);
|
|
2317
|
+
}
|
|
2318
|
+
async getIssuedInvoicePosting(userId, organisationId, issuedInvoicePostingId) {
|
|
2319
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings/${issuedInvoicePostingId}`;
|
|
2320
|
+
return await this.client.get(path);
|
|
2321
|
+
}
|
|
2322
|
+
async getPaymentMethodsOnIssuedInvoicePostings(userId, organisationId, params) {
|
|
2323
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings/paymentmethods`;
|
|
2324
|
+
return await this.client.get(path, { params });
|
|
2325
|
+
}
|
|
2326
|
+
async actionOnIssuedInvoicePosting(userId, organisationId, issuedInvoicePostingId, action) {
|
|
2327
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings/${issuedInvoicePostingId}/actions/${action}`;
|
|
2328
|
+
return await this.client.put(path, {});
|
|
2329
|
+
}
|
|
2330
|
+
/** ITEMS */
|
|
2331
|
+
async getItems(userId, organisationId, params) {
|
|
2332
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items`;
|
|
2333
|
+
return await this.client.get(path, { params });
|
|
2334
|
+
}
|
|
2335
|
+
async newItem(userId, organisationId, item) {
|
|
2336
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items`;
|
|
2337
|
+
return await this.client.post(path, item);
|
|
2338
|
+
}
|
|
2339
|
+
async deleteItem(userId, organisationId, itemId) {
|
|
2340
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/${itemId}`;
|
|
2341
|
+
return await this.client.delete(path);
|
|
2342
|
+
}
|
|
2343
|
+
async getItem(userId, organisationId, itemId) {
|
|
2344
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/${itemId}`;
|
|
2345
|
+
return await this.client.get(path);
|
|
2346
|
+
}
|
|
2347
|
+
async updateItem(userId, organisationId, item) {
|
|
2348
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/${item.ItemId}`;
|
|
2349
|
+
return await this.client.put(path, item);
|
|
2350
|
+
}
|
|
2351
|
+
async getItemByCode(userId, organisationId, code) {
|
|
2352
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/code(${code})`;
|
|
2353
|
+
return await this.client.get(path);
|
|
2354
|
+
}
|
|
2355
|
+
async getItemSettings(userId, organisationId, code) {
|
|
2356
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/settings`;
|
|
2357
|
+
return await this.client.get(path);
|
|
2358
|
+
}
|
|
2359
|
+
async getItemData(userId, organisationId, params) {
|
|
2360
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/itemsdata`;
|
|
2361
|
+
return await this.client.get(path, { params });
|
|
2362
|
+
}
|
|
2363
|
+
async getItemPricelist(userId, organisationId, params) {
|
|
2364
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/pricelists`;
|
|
2365
|
+
return await this.client.get(path, { params });
|
|
2366
|
+
}
|
|
2367
|
+
async getItemsForSync(userId, organisationId, params) {
|
|
2368
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/synccandidates`;
|
|
2369
|
+
return await this.client.get(path, { params });
|
|
2370
|
+
}
|
|
2371
|
+
/** JOURNALS */
|
|
2372
|
+
async getJournals(userId, organisationId, params) {
|
|
2373
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals`;
|
|
2374
|
+
return await this.client.get(path, { params });
|
|
2375
|
+
}
|
|
2376
|
+
async newJournal(userId, organisationId, journal) {
|
|
2377
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals`;
|
|
2378
|
+
return await this.client.post(path, journal);
|
|
2379
|
+
}
|
|
2380
|
+
async deleteJournal(userId, organisationId, journalId) {
|
|
2381
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}`;
|
|
2382
|
+
return await this.client.delete(path);
|
|
2383
|
+
}
|
|
2384
|
+
async getJournal(userId, organisationId, journalId) {
|
|
2385
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}`;
|
|
2386
|
+
return await this.client.get(path);
|
|
2387
|
+
}
|
|
2388
|
+
async updateJournal(userId, organisationId, journal) {
|
|
2389
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journal.JournalId}`;
|
|
2390
|
+
return await this.client.put(path, journal);
|
|
2391
|
+
}
|
|
2392
|
+
async deleteJournalVatEntry(userId, organisationId, journalId, vatId) {
|
|
2393
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}/vat/${vatId}`;
|
|
2394
|
+
return await this.client.delete(path);
|
|
2395
|
+
}
|
|
2396
|
+
async getJournalVatEntry(userId, organisationId, journalId, vatId) {
|
|
2397
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}/vat/${vatId}`;
|
|
2398
|
+
return await this.client.get(path);
|
|
2399
|
+
}
|
|
2400
|
+
async updateJournalVatEntry(userId, organisationId, journalId, vatEntry) {
|
|
2401
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}/vat/${vatEntry.VatEntryId}`;
|
|
2402
|
+
return await this.client.put(path, vatEntry);
|
|
2403
|
+
}
|
|
2404
|
+
async newJournalVatEntry(userId, organisationId, journalId, vatEntry) {
|
|
2405
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}/vat`;
|
|
2406
|
+
return await this.client.post(path, vatEntry);
|
|
2407
|
+
}
|
|
2408
|
+
async getJournalsForSync(userId, organisationId, params) {
|
|
2409
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/synccandidates`;
|
|
2410
|
+
return await this.client.get(path, { params });
|
|
2411
|
+
}
|
|
2412
|
+
async getJournalsInVODStandard(userId, organisationId, params) {
|
|
2413
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/vodstandard`;
|
|
2414
|
+
return await this.client.get(path, { params });
|
|
2415
|
+
}
|
|
2416
|
+
async getJournalEntries(userId, organisationId, params) {
|
|
2417
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/journal-entries`;
|
|
2418
|
+
return await this.client.get(path, { params });
|
|
2419
|
+
}
|
|
2420
|
+
/** JOURNAL TYPES */
|
|
2421
|
+
async getJournalTypes(userId, organisationId, params) {
|
|
2422
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journaltypes`;
|
|
2423
|
+
return await this.client.get(path, { params });
|
|
2424
|
+
}
|
|
2425
|
+
async getJournalType(userId, organisationId, journalTypeId) {
|
|
2426
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journaltypes/${journalTypeId}`;
|
|
2427
|
+
return await this.client.get(path);
|
|
2428
|
+
}
|
|
2429
|
+
async getJournalTypeByCode(userId, organisationId, code) {
|
|
2430
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journaltypes/code(${code})`;
|
|
2431
|
+
return await this.client.get(path);
|
|
2432
|
+
}
|
|
2433
|
+
async getJournalTypesForSync(userId, organisationId, params) {
|
|
2434
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journaltypes/synccandidates`;
|
|
2435
|
+
return await this.client.get(path, { params });
|
|
2436
|
+
}
|
|
2437
|
+
/** ORDERS */
|
|
2438
|
+
async getOrders(userId, organisationId, params) {
|
|
2439
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders`;
|
|
2440
|
+
return await this.client.get(path, { params });
|
|
2441
|
+
}
|
|
2442
|
+
async newOrder(userId, organisationId, order) {
|
|
2443
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders`;
|
|
2444
|
+
return await this.client.post(path, order);
|
|
2445
|
+
}
|
|
2446
|
+
async deleteOrder(userId, organisationId, orderId) {
|
|
2447
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${orderId}`;
|
|
2448
|
+
return await this.client.delete(path);
|
|
2449
|
+
}
|
|
2450
|
+
async getOrder(userId, organisationId, orderId) {
|
|
2451
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${orderId}`;
|
|
2452
|
+
return await this.client.get(path);
|
|
2453
|
+
}
|
|
2454
|
+
async updateOrder(userId, organisationId, order) {
|
|
2455
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${order.OrderId}`;
|
|
2456
|
+
return await this.client.put(path, order);
|
|
2457
|
+
}
|
|
2458
|
+
async actionGetOnOrder(userId, organisationId, orderId, action, params) {
|
|
2459
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${orderId}/actions/${action}`;
|
|
2460
|
+
return await this.client.get(path, { params });
|
|
2461
|
+
}
|
|
2462
|
+
async actionPutOnOrder(userId, organisationId, orderId, action, params) {
|
|
2463
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${orderId}/actions/${action}`;
|
|
2464
|
+
return await this.client.put(path, {}, { params });
|
|
2465
|
+
}
|
|
2466
|
+
async getOrdersForSync(userId, organisationId, params) {
|
|
2467
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/synccandidates`;
|
|
2468
|
+
return await this.client.get(path, { params });
|
|
2469
|
+
}
|
|
2470
|
+
/** ORGANISATIONS */
|
|
2471
|
+
async getOrganisation(userId, organisationId) {
|
|
2472
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}`;
|
|
2473
|
+
return await this.client.get(path);
|
|
2474
|
+
}
|
|
2475
|
+
async getAllOrganisations(userId, params) {
|
|
2476
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/allOrgs`;
|
|
2477
|
+
return await this.client.get(path, { params });
|
|
2478
|
+
}
|
|
2479
|
+
/** OUTBOX */
|
|
2480
|
+
async getAllOuboxes(userId, organisationId, params) {
|
|
2481
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/outbox`;
|
|
2482
|
+
return await this.client.get(path, { params });
|
|
2483
|
+
}
|
|
2484
|
+
async getOutbox(userId, organisationId, outboxId) {
|
|
2485
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/outbox/${outboxId}`;
|
|
2486
|
+
return await this.client.get(path);
|
|
2487
|
+
}
|
|
2488
|
+
/** PAYMENT METHODS */
|
|
2489
|
+
async getPaymentMethods(userId, organisationId, params) {
|
|
2490
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/paymentmethods`;
|
|
2491
|
+
return await this.client.get(path, { params });
|
|
2492
|
+
}
|
|
2493
|
+
/** PAYROLL SETTINGS */
|
|
2494
|
+
async getPayrollSettingsByCode(userId, code) {
|
|
2495
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/payrollsettings/${code}`;
|
|
2496
|
+
return await this.client.get(path);
|
|
2497
|
+
}
|
|
2498
|
+
/** POSTAL CODE */
|
|
2499
|
+
async getPostalCodesByCountry(userId, organisationId, countryId, params) {
|
|
2500
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/postalcodes/countries/${countryId}`;
|
|
2501
|
+
return await this.client.get(path, { params });
|
|
2502
|
+
}
|
|
2503
|
+
async getPostalCode(userId, organisationId, postalCodeId) {
|
|
2504
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/postalcodes/${postalCodeId}`;
|
|
2505
|
+
return await this.client.get(path);
|
|
2506
|
+
}
|
|
2507
|
+
async getPostalCodesForSync(userId, organisationId, params) {
|
|
2508
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/postalcodes/synccandidates`;
|
|
2509
|
+
return await this.client.get(path, { params });
|
|
2510
|
+
}
|
|
2511
|
+
/** PRODUCT GROUPS */
|
|
2512
|
+
async getProductGroups(userId, organisationId, params) {
|
|
2513
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups`;
|
|
2514
|
+
return await this.client.get(path, { params });
|
|
2515
|
+
}
|
|
2516
|
+
async newProductGroup(userId, organisationId, productGroup) {
|
|
2517
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups`;
|
|
2518
|
+
return await this.client.post(path, productGroup);
|
|
2519
|
+
}
|
|
2520
|
+
async deleteProductGroup(userId, organisationId, productGroupId) {
|
|
2521
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups/${productGroupId}`;
|
|
2522
|
+
return await this.client.delete(path);
|
|
2523
|
+
}
|
|
2524
|
+
async getProductGroup(userId, organisationId, productGroupId) {
|
|
2525
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups/${productGroupId}`;
|
|
2526
|
+
return await this.client.get(path);
|
|
2527
|
+
}
|
|
2528
|
+
async updateProductGroup(userId, organisationId, productGroup) {
|
|
2529
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups/${productGroup.ProductGroupId}`;
|
|
2530
|
+
return await this.client.put(path, productGroup);
|
|
2531
|
+
}
|
|
2532
|
+
async getProductGroupsForSync(userId, organisationId, params) {
|
|
2533
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups/synccandidates`;
|
|
2534
|
+
return await this.client.get(path, { params });
|
|
2535
|
+
}
|
|
2536
|
+
/** PURPOSE CODE */
|
|
2537
|
+
async getPurposeCodes(userId, organisationId, params) {
|
|
2538
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/purpose-codes`;
|
|
2539
|
+
return await this.client.get(path, { params });
|
|
2540
|
+
}
|
|
2541
|
+
async getPurposeCode(userId, organisationId, purposeCodeId) {
|
|
2542
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/purpose-codes/${purposeCodeId}`;
|
|
2543
|
+
return await this.client.get(path);
|
|
2544
|
+
}
|
|
2545
|
+
async getPurposeCodeByCode(userId, organisationId, code) {
|
|
2546
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/purpose-codes/code(${code})`;
|
|
2547
|
+
return await this.client.get(path);
|
|
2548
|
+
}
|
|
2549
|
+
async getPurposeCodesForSync(userId, organisationId, params) {
|
|
2550
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/purpose-codes/synccandidates`;
|
|
2551
|
+
return await this.client.get(path, { params });
|
|
2552
|
+
}
|
|
2553
|
+
/** RECEIVED INVOICES */
|
|
2554
|
+
async deleteReceivedInvoice(userId, organisationId, receivedInvoiceId) {
|
|
2555
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoiceId}`;
|
|
2556
|
+
return await this.client.delete(path);
|
|
2557
|
+
}
|
|
2558
|
+
async getReceivedInvoice(userId, organisationId, receivedInvoiceId) {
|
|
2559
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoiceId}`;
|
|
2560
|
+
return await this.client.get(path);
|
|
2561
|
+
}
|
|
2562
|
+
async updateReceivedInvoice(userId, organisationId, receivedInvoice) {
|
|
2563
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoice.ReceivedInvoiceId}`;
|
|
2564
|
+
return await this.client.put(path, receivedInvoice);
|
|
2565
|
+
}
|
|
2566
|
+
async getReceivedInvoices(userId, organisationId, params) {
|
|
2567
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices`;
|
|
2568
|
+
return await this.client.get(path, { params });
|
|
2569
|
+
}
|
|
2570
|
+
async newReceivedInvoice(userId, organisationId, receivedInvoice) {
|
|
2571
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices`;
|
|
2572
|
+
return await this.client.post(path, receivedInvoice);
|
|
2573
|
+
}
|
|
2574
|
+
async getReceivedInvoicesAttachments(userId, organisationId, receivedInvoiceId, params) {
|
|
2575
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoiceId}/attachments`;
|
|
2576
|
+
return await this.client.get(path, { params });
|
|
2577
|
+
}
|
|
2578
|
+
async newReceivedInvoiceAttachment(userId, organisationId, receivedInvoiceId, attachment) {
|
|
2579
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoiceId}/attachments`;
|
|
2580
|
+
return await this.client.post(path, attachment);
|
|
2581
|
+
}
|
|
2582
|
+
/** REPORT TEMPLATES */
|
|
2583
|
+
async getReportTemplates(userId, organisationId, params) {
|
|
2584
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/report-templates`;
|
|
2585
|
+
return await this.client.get(path, { params });
|
|
2586
|
+
}
|
|
2587
|
+
async getReportTemplate(userId, organisationId, reportTemplateId) {
|
|
2588
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/report-templates/${reportTemplateId}`;
|
|
2589
|
+
return await this.client.get(path);
|
|
2590
|
+
}
|
|
2591
|
+
async getReportTemplatesForSync(userId, organisationId, params) {
|
|
2592
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/report-templates/synccandidates`;
|
|
2593
|
+
return await this.client.get(path, { params });
|
|
2594
|
+
}
|
|
2595
|
+
/** STOCK */
|
|
2596
|
+
async getStock(userId, organisationId, params) {
|
|
2597
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stocks`;
|
|
2598
|
+
return await this.client.get(path, { params });
|
|
2599
|
+
}
|
|
2600
|
+
async getStockForItem(userId, organisationId, itemId) {
|
|
2601
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stocks/${itemId}`;
|
|
2602
|
+
return await this.client.get(path);
|
|
2603
|
+
}
|
|
2604
|
+
/** STOCK ENTRIES */
|
|
2605
|
+
async getStockEntries(userId, organisationId, params) {
|
|
2606
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry`;
|
|
2607
|
+
return await this.client.get(path, { params });
|
|
2608
|
+
}
|
|
2609
|
+
async newStockEntry(userId, organisationId, stockEntry) {
|
|
2610
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry`;
|
|
2611
|
+
return await this.client.post(path, stockEntry);
|
|
2612
|
+
}
|
|
2613
|
+
async deleteStockEntry(userId, organisationId, stockEntryId) {
|
|
2614
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntryId}`;
|
|
2615
|
+
return await this.client.delete(path);
|
|
2616
|
+
}
|
|
2617
|
+
async getStockEntry(userId, organisationId, stockEntryId) {
|
|
2618
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntryId}`;
|
|
2619
|
+
return await this.client.get(path);
|
|
2620
|
+
}
|
|
2621
|
+
async updateStockEntry(userId, organisationId, stockEntry) {
|
|
2622
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntry.StockEntryId}`;
|
|
2623
|
+
return await this.client.post(path, stockEntry);
|
|
2624
|
+
}
|
|
2625
|
+
async actionGetOnStockEntry(userId, organisationId, stockEntryId, action, params) {
|
|
2626
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntryId}/actions/${action}`;
|
|
2627
|
+
return await this.client.get(path, { params });
|
|
2628
|
+
}
|
|
2629
|
+
async actionPutOnStockEntry(userId, organisationId, stockEntryId, action, params) {
|
|
2630
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntryId}/actions/${action}`;
|
|
2631
|
+
return await this.client.put(path, {}, { params });
|
|
2632
|
+
}
|
|
2633
|
+
/** USERS */
|
|
2634
|
+
async getCurrentUser(userId) {
|
|
2635
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/currentuser/profile`;
|
|
2636
|
+
return await this.client.get(path);
|
|
2637
|
+
}
|
|
2638
|
+
async getCurrentUserOrgs(userId) {
|
|
2639
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/currentuser/orgs`;
|
|
2640
|
+
return await this.client.get(path);
|
|
2641
|
+
}
|
|
2642
|
+
/** VAT ACCOUNTING TYPES */
|
|
2643
|
+
async getVatAccountingTypes(userId, organisationId, params) {
|
|
2644
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vataccountingtypes`;
|
|
2645
|
+
return await this.client.get(path, { params });
|
|
2646
|
+
}
|
|
2647
|
+
async getVatAccountingTypesForSync(userId, organisationId, params) {
|
|
2648
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vataccountingtypes/synccandidates`;
|
|
2649
|
+
return await this.client.get(path, { params });
|
|
2650
|
+
}
|
|
2651
|
+
/** VAT RATES */
|
|
2652
|
+
async getVatRates(userId, organisationId, params) {
|
|
2653
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vatrates`;
|
|
2654
|
+
return await this.client.get(path, { params });
|
|
2655
|
+
}
|
|
2656
|
+
async getVatRate(userId, organisationId, vatRateId) {
|
|
2657
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vatrates/${vatRateId}`;
|
|
2658
|
+
return await this.client.get(path);
|
|
2659
|
+
}
|
|
2660
|
+
async getVatRateByCode(userId, organisationId, code) {
|
|
2661
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vatrates/code(${code})`;
|
|
2662
|
+
return await this.client.get(path);
|
|
2663
|
+
}
|
|
2664
|
+
async getVatRatesForSync(userId, organisationId, params) {
|
|
2665
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vatrates/synccandidates`;
|
|
2666
|
+
return await this.client.get(path, { params });
|
|
2667
|
+
}
|
|
2668
|
+
/** WAREHOUSES */
|
|
2669
|
+
async getWarehouses(userId, organisationId, params) {
|
|
2670
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses`;
|
|
2671
|
+
return await this.client.get(path, { params });
|
|
2672
|
+
}
|
|
2673
|
+
async newWarehouse(userId, organisationId, warehouse) {
|
|
2674
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses`;
|
|
2675
|
+
return await this.client.post(path, warehouse);
|
|
2676
|
+
}
|
|
2677
|
+
async deleteWarehouse(userId, organisationId, warehouseId) {
|
|
2678
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses/${warehouseId}`;
|
|
2679
|
+
return await this.client.delete(path);
|
|
2680
|
+
}
|
|
2681
|
+
async getWarehouse(userId, organisationId, warehouseId) {
|
|
2682
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses/${warehouseId}`;
|
|
2683
|
+
return await this.client.get(path);
|
|
2684
|
+
}
|
|
2685
|
+
async updateWarehouse(userId, organisationId, warehouse) {
|
|
2686
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses/${warehouse.WarehouseId}`;
|
|
2687
|
+
return await this.client.put(path, warehouse);
|
|
2688
|
+
}
|
|
2689
|
+
async getWarehousesForSync(userId, organisationId, params) {
|
|
2690
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses/synccandidates`;
|
|
2691
|
+
return await this.client.get(path, { params });
|
|
1630
2692
|
}
|
|
1631
2693
|
}
|
|
1632
2694
|
|
|
@@ -1640,6 +2702,7 @@ class Integrations extends IntegrationsBaseClient {
|
|
|
1640
2702
|
'protokol-dms': new DMS().setClient(this.client),
|
|
1641
2703
|
'serbia-utilities': new SerbiaUtil().setClient(this.client),
|
|
1642
2704
|
'protokol-payments': new Payments().setClient(this.client),
|
|
2705
|
+
'protokol-minimax': new Minimax().setClient(this.client),
|
|
1643
2706
|
};
|
|
1644
2707
|
}
|
|
1645
2708
|
getSerbiaUtilities() {
|
|
@@ -1657,6 +2720,9 @@ class Integrations extends IntegrationsBaseClient {
|
|
|
1657
2720
|
getPayments() {
|
|
1658
2721
|
return this.getInterfaceOf('protokol-payments');
|
|
1659
2722
|
}
|
|
2723
|
+
getMinimax() {
|
|
2724
|
+
return this.getInterfaceOf('protokol-minimax');
|
|
2725
|
+
}
|
|
1660
2726
|
async isInstalled(id) {
|
|
1661
2727
|
const { data } = await this.client.get("/v1/integrations");
|
|
1662
2728
|
return data.find((i) => i.id == id) !== undefined;
|