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