@ptkl/sdk 0.10.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/{index.iife.js → index.0.10.js} +1206 -238
  2. package/dist/index.0.9.js +2849 -0
  3. package/dist/package.json +12 -7
  4. package/dist/v0.10/api/component.d.ts +128 -0
  5. package/dist/v0.10/api/componentUtils.d.ts +7 -0
  6. package/dist/v0.10/api/index.d.ts +22 -0
  7. package/dist/v0.10/api/integrations/dms.d.ts +469 -0
  8. package/dist/v0.10/api/integrations/minimax.d.ts +289 -0
  9. package/dist/v0.10/api/integrations/payments.d.ts +40 -0
  10. package/dist/{types → v0.10}/api/integrations.d.ts +2 -0
  11. package/dist/{types → v0.10}/api/integrationsBaseClient.d.ts +3 -0
  12. package/dist/{types → v0.10}/api/platform.d.ts +2 -2
  13. package/dist/v0.10/apiUser.d.ts +9 -0
  14. package/dist/v0.10/apps.d.ts +8 -0
  15. package/dist/v0.10/baseClient.d.ts +6 -0
  16. package/dist/{types/api → v0.10}/component.d.ts +39 -4
  17. package/dist/v0.10/componentUtils.d.ts +7 -0
  18. package/dist/v0.10/config.d.ts +14 -0
  19. package/dist/v0.10/forge.d.ts +7 -0
  20. package/dist/v0.10/functions.d.ts +23 -0
  21. package/dist/{index.cjs.js → v0.10/index.cjs.js} +1206 -238
  22. package/dist/v0.10/index.d.ts +21 -0
  23. package/dist/{index.esm.js → v0.10/index.esm.js} +1205 -235
  24. package/dist/{types/api → v0.10}/integrations/dms.d.ts +11 -1
  25. package/dist/v0.10/integrations/invoicing.d.ts +6 -0
  26. package/dist/v0.10/integrations/minimax.d.ts +289 -0
  27. package/dist/v0.10/integrations/payments.d.ts +40 -0
  28. package/dist/v0.10/integrations/serbiaUtil.d.ts +10 -0
  29. package/dist/v0.10/integrations/vpfr.d.ts +4 -0
  30. package/dist/v0.10/integrations.d.ts +22 -0
  31. package/dist/v0.10/integrationsBaseClient.d.ts +11 -0
  32. package/dist/v0.10/platform.d.ts +34 -0
  33. package/dist/v0.10/platformBaseClient.d.ts +27 -0
  34. package/dist/v0.10/project.d.ts +146 -0
  35. package/dist/v0.10/ratchet.d.ts +196 -0
  36. package/dist/v0.10/sandbox.d.ts +14 -0
  37. package/dist/v0.10/system.d.ts +4 -0
  38. package/dist/v0.10/thunder.d.ts +13 -0
  39. package/dist/v0.10/types/component.d.ts +110 -0
  40. package/dist/{types → v0.10}/types/integrations.d.ts +114 -1
  41. package/dist/v0.10/users.d.ts +69 -0
  42. package/dist/v0.10/workflow.d.ts +5 -0
  43. package/dist/v0.9/api/apiUser.d.ts +9 -0
  44. package/dist/v0.9/api/apps.d.ts +8 -0
  45. package/dist/v0.9/api/baseClient.d.ts +6 -0
  46. package/dist/v0.9/api/component.d.ts +136 -0
  47. package/dist/v0.9/api/componentUtils.d.ts +7 -0
  48. package/dist/v0.9/api/config.d.ts +14 -0
  49. package/dist/v0.9/api/forge.d.ts +7 -0
  50. package/dist/v0.9/api/functions.d.ts +23 -0
  51. package/dist/v0.9/api/index.d.ts +24 -0
  52. package/dist/v0.9/api/integrations/dms.d.ts +419 -0
  53. package/dist/v0.9/api/integrations/invoicing.d.ts +6 -0
  54. package/dist/v0.9/api/integrations/minimax.d.ts +289 -0
  55. package/dist/v0.9/api/integrations/payments.d.ts +40 -0
  56. package/dist/v0.9/api/integrations/serbiaUtil.d.ts +10 -0
  57. package/dist/v0.9/api/integrations/vpfr.d.ts +4 -0
  58. package/dist/v0.9/api/integrations.d.ts +22 -0
  59. package/dist/v0.9/api/integrationsBaseClient.d.ts +11 -0
  60. package/dist/v0.9/api/platform.d.ts +34 -0
  61. package/dist/v0.9/api/platformBaseClient.d.ts +27 -0
  62. package/dist/v0.9/api/project.d.ts +146 -0
  63. package/dist/v0.9/api/ratchet.d.ts +196 -0
  64. package/dist/v0.9/api/sandbox.d.ts +14 -0
  65. package/dist/v0.9/api/system.d.ts +4 -0
  66. package/dist/v0.9/api/thunder.d.ts +13 -0
  67. package/dist/v0.9/api/users.d.ts +69 -0
  68. package/dist/v0.9/api/workflow.d.ts +5 -0
  69. package/dist/v0.9/apiUser.d.ts +9 -0
  70. package/dist/v0.9/apps.d.ts +8 -0
  71. package/dist/v0.9/baseClient.d.ts +6 -0
  72. package/dist/v0.9/component.d.ts +128 -0
  73. package/dist/v0.9/componentUtils.d.ts +7 -0
  74. package/dist/v0.9/config.d.ts +14 -0
  75. package/dist/v0.9/forge.d.ts +7 -0
  76. package/dist/v0.9/functions.d.ts +23 -0
  77. package/dist/v0.9/index.cjs.js +21811 -0
  78. package/dist/v0.9/index.d.ts +21 -0
  79. package/dist/v0.9/index.esm.js +2820 -0
  80. package/dist/v0.9/integrations/dms.d.ts +469 -0
  81. package/dist/v0.9/integrations/invoicing.d.ts +6 -0
  82. package/dist/v0.9/integrations/minimax.d.ts +289 -0
  83. package/dist/v0.9/integrations/payments.d.ts +40 -0
  84. package/dist/v0.9/integrations/serbiaUtil.d.ts +10 -0
  85. package/dist/v0.9/integrations/vpfr.d.ts +4 -0
  86. package/dist/v0.9/integrations.d.ts +22 -0
  87. package/dist/v0.9/integrationsBaseClient.d.ts +11 -0
  88. package/dist/v0.9/platform.d.ts +34 -0
  89. package/dist/v0.9/platformBaseClient.d.ts +27 -0
  90. package/dist/v0.9/project.d.ts +146 -0
  91. package/dist/v0.9/ratchet.d.ts +196 -0
  92. package/dist/v0.9/sandbox.d.ts +14 -0
  93. package/dist/v0.9/system.d.ts +4 -0
  94. package/dist/v0.9/thunder.d.ts +13 -0
  95. package/dist/v0.9/types/component.d.ts +116 -0
  96. package/dist/v0.9/types/config.d.ts +11 -0
  97. package/dist/v0.9/types/integrations.d.ts +321 -0
  98. package/dist/v0.9/types/project.d.ts +64 -0
  99. package/dist/v0.9/types/ratchet.d.ts +38 -0
  100. package/dist/v0.9/types/users.d.ts +66 -0
  101. package/dist/v0.9/users.d.ts +69 -0
  102. package/dist/v0.9/util/detectEnv.d.ts +4 -0
  103. package/dist/v0.9/workflow.d.ts +5 -0
  104. package/package.json +12 -7
  105. package/dist/monaco.d.ts +0 -887
  106. package/dist/types/api/componentUtils.d.ts +0 -5
  107. package/dist/types/api/index.d.ts +0 -13
  108. package/dist/types/api/integrations/media.d.ts +0 -17
  109. package/dist/types/api/integrations/payments.d.ts +0 -7
  110. package/dist/types/api/roles.d.ts +0 -9
  111. package/dist/types/index.d.ts +0 -29
  112. package/dist/types/types/component.d.ts +0 -50
  113. package/dist/types/types/media.d.ts +0 -103
  114. /package/dist/{types → v0.10}/api/apiUser.d.ts +0 -0
  115. /package/dist/{types → v0.10}/api/apps.d.ts +0 -0
  116. /package/dist/{types → v0.10}/api/baseClient.d.ts +0 -0
  117. /package/dist/{types → v0.10}/api/config.d.ts +0 -0
  118. /package/dist/{types → v0.10}/api/forge.d.ts +0 -0
  119. /package/dist/{types → v0.10}/api/functions.d.ts +0 -0
  120. /package/dist/{types → v0.10}/api/integrations/invoicing.d.ts +0 -0
  121. /package/dist/{types → v0.10}/api/integrations/serbiaUtil.d.ts +0 -0
  122. /package/dist/{types → v0.10}/api/integrations/vpfr.d.ts +0 -0
  123. /package/dist/{types → v0.10}/api/platformBaseClient.d.ts +0 -0
  124. /package/dist/{types → v0.10}/api/project.d.ts +0 -0
  125. /package/dist/{types → v0.10}/api/ratchet.d.ts +0 -0
  126. /package/dist/{types → v0.10}/api/sandbox.d.ts +0 -0
  127. /package/dist/{types → v0.10}/api/system.d.ts +0 -0
  128. /package/dist/{types → v0.10}/api/thunder.d.ts +0 -0
  129. /package/dist/{types → v0.10}/api/users.d.ts +0 -0
  130. /package/dist/{types → v0.10}/api/workflow.d.ts +0 -0
  131. /package/dist/{types → v0.10}/types/config.d.ts +0 -0
  132. /package/dist/{types → v0.10}/types/project.d.ts +0 -0
  133. /package/dist/{types → v0.10}/types/ratchet.d.ts +0 -0
  134. /package/dist/{types → v0.10}/types/users.d.ts +0 -0
  135. /package/dist/{types → v0.10}/util/detectEnv.d.ts +0 -0
@@ -35,27 +35,32 @@ var ProtokolSDK010 = (function (exports, axios) {
35
35
  */
36
36
  class PlatformBaseClient extends BaseClient {
37
37
  constructor(options) {
38
- var _a, _b, _c;
38
+ var _a, _b, _c, _d, _e, _f, _g;
39
39
  let { env = null, token = null, host = null, } = options !== null && options !== void 0 ? options : {};
40
40
  let headers = {};
41
41
  var project_uuid = null;
42
42
  if (isBrowser) {
43
- console.log("PlatformBaseClient: running in browser context");
44
43
  if (sessionStorage.getItem('protokol_context') == "forge") {
45
44
  headers['X-Project-Env'] = (_a = sessionStorage.getItem('forge_app_env')) !== null && _a !== void 0 ? _a : "dev";
46
45
  }
47
46
  else {
48
47
  headers['X-Project-Env'] = (_b = localStorage.getItem('current_env')) !== null && _b !== void 0 ? _b : "dev";
49
48
  }
49
+ if (typeof window !== "undefined") {
50
+ // @ts-ignore
51
+ const __global_env__ = window === null || window === void 0 ? void 0 : window.__ENV_VARIABLES__;
52
+ host = (_c = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.API_HOST) !== null && _c !== void 0 ? _c : host;
53
+ // @ts-ignore
54
+ env = env !== null && env !== void 0 ? env : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_ENV;
55
+ token = token !== null && token !== void 0 ? token : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_API_TOKEN;
56
+ project_uuid = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_UUID;
57
+ }
50
58
  }
51
- if (typeof window !== "undefined") {
52
- // @ts-ignore
53
- const __global_env__ = window === null || window === void 0 ? void 0 : window.__ENV_VARIABLES__;
54
- host = (_c = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.API_HOST) !== null && _c !== void 0 ? _c : host;
55
- // @ts-ignore
56
- env = env !== null && env !== void 0 ? env : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_ENV;
57
- token = token !== null && token !== void 0 ? token : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_API_TOKEN;
58
- project_uuid = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_UUID;
59
+ else if (process && process.env) {
60
+ host = (_d = host !== null && host !== void 0 ? host : process.env.API_HOST) !== null && _d !== void 0 ? _d : null;
61
+ env = (_e = env !== null && env !== void 0 ? env : process.env.PROJECT_ENV) !== null && _e !== void 0 ? _e : null;
62
+ token = (_f = token !== null && token !== void 0 ? token : process.env.PROJECT_API_TOKEN) !== null && _f !== void 0 ? _f : null;
63
+ project_uuid = (_g = process.env.PROJECT_UUID) !== null && _g !== void 0 ? _g : null;
59
64
  }
60
65
  if (token) {
61
66
  headers['Authorization'] = `Bearer ${token}`;
@@ -82,198 +87,22 @@ var ProtokolSDK010 = (function (exports, axios) {
82
87
  }
83
88
  }
84
89
 
85
- class Functions extends PlatformBaseClient {
86
- async list() {
87
- return await this.client.get("/v1/system/function");
88
- }
89
- async get(ref) {
90
- return await this.client.get(`/v1/system/function/${ref}`);
91
- }
92
- async update(uuid, update) {
93
- return await this.client.patch(`/v1/system/function/${uuid}`, update);
94
- }
95
- /**
96
- * Run platform function
97
- *
98
- * @param id - Function ID
99
- * @param input - Input data
100
- * @param query - Query parameters
101
- * @returns - Function result
102
- *
103
- * @example
104
- * const result = await platform.function().run("myFunction", {input: { foo: "bar" }})
105
- */
106
- async run(id, d) {
107
- const { data } = await this.client.post(`/v1/system/function/run/${id}`, d.input, {
108
- params: d.query,
109
- headers: d.headers
110
- });
111
- return data;
112
- }
113
- async generateSignature(ref, env) {
114
- return await this.client.get(`/v1/system/function/signature/${env}/${ref}`);
115
- }
116
- }
117
-
118
- class APIUser extends PlatformBaseClient {
119
- async auth(username, password, project) {
120
- return this.client.post("/v1/user/api/auth", {
121
- username,
122
- password
123
- }, {
124
- headers: {
125
- "X-Project-Uuid": project
126
- }
127
- });
128
- }
129
- async newSecret(uuid) {
130
- return await this.client.post(`/v1/user/api-user/secret/${uuid}`, {});
131
- }
132
- async revokeSecret(uuid) {
133
- return await this.client.delete(`/v1/user/api-user/secret/${uuid}`);
134
- }
135
- async edit(uuid, roles) {
136
- return await this.client.patch(`/v1/user/api-user/${uuid}`, { roles });
137
- }
138
- async list() {
139
- return await this.client.get(`/v1/user/api-user`);
140
- }
141
- async get(uuid) {
142
- return await this.client.get(`/v1/user/api-user/${uuid}`);
143
- }
144
- }
145
-
146
- class Users extends PlatformBaseClient {
147
- async auth(username, password, project) {
148
- return await this.client.post("/v1/user/login", {
149
- username,
150
- password,
151
- response_type: 'token',
152
- }, {
153
- headers: {
154
- 'X-Project-Uuid': project
155
- }
156
- });
157
- }
158
- /**
159
- * Resend confirmation email
160
- * @param email User email
161
- */
162
- async resendConfirmationEmail(email) {
163
- return await this.client.post("/v1/user/send/confirmation/email", {
164
- email,
165
- });
166
- }
167
- // Password Reset (Request Only)
168
- // Note: Only the REQUEST is exposed, not the password reset completion
169
- // The actual password reset should be done through the official web interface
170
- /**
171
- * Request password reset email
172
- * This only sends an email with a reset link, does not expose or change passwords
173
- * @param email User email
174
- */
175
- async requestPasswordReset(email) {
176
- return await this.client.post("/v1/user/resetpassword", { email });
177
- }
178
- // User Profile & Management
179
- /**
180
- * Get current user's model
181
- */
182
- async getUser() {
183
- return await this.client.get("/v1/user/model");
184
- }
185
- /**
186
- * Get current user's claims
187
- */
188
- async getClaims() {
189
- return await this.client.get("/v1/user/claims");
190
- }
191
- /**
192
- * Edit user profile
193
- * @param data Profile update data
194
- */
195
- async editProfile(data) {
196
- return await this.client.post("/v1/user/profile/edit", data);
197
- }
198
- // Permissions & Roles
199
- /**
200
- * Get user permissions
201
- */
202
- async getPermissions() {
203
- return await this.client.get("/v1/user/role/permissions");
204
- }
205
- /**
206
- * Get list of available permissions
207
- */
208
- async listPermissions() {
209
- return await this.client.get("/v1/user/permissions/list");
210
- }
211
- /**
212
- * Create a new role
213
- * @param role Role data including name, permissions, workspaces, and level
214
- */
215
- async createRole(role) {
216
- return await this.client.post("/v1/user/role/create", role);
217
- }
218
- /**
219
- * Delete a role
220
- * @param uuid Role UUID
221
- */
222
- async deleteRole(uuid) {
223
- return await this.client.delete(`/v1/user/role/delete/${uuid}`);
224
- }
225
- /**
226
- * List all roles
227
- */
228
- async listRoles() {
229
- return await this.client.get(`/v1/user/role/list`);
230
- }
231
- /**
232
- * Get role details by UUID
233
- * @param uuid Role UUID
234
- */
235
- async getRoleModel(uuid) {
236
- return await this.client.get(`/v1/user/role/edit/${uuid}`);
237
- }
238
- /**
239
- * Edit a role
240
- * @param uuid Role UUID
241
- * @param data Role update data including permissions, workspaces, and level
242
- */
243
- async editRole(uuid, data) {
244
- return await this.client.post(`/v1/user/role/edit/${uuid}`, data);
245
- }
246
- /**
247
- * @deprecated Use getPermissions() instead
248
- */
249
- async permissions() {
250
- return await this.client.get(`/v1/user/role/permissions`);
251
- }
252
- }
253
-
254
- class Apps extends PlatformBaseClient {
255
- constructor(appType) {
256
- super();
257
- this.appType = appType;
258
- }
259
- async updateSettings(updateValues, ref) {
260
- const payload = { ...updateValues };
261
- return await this.client.put(`/v3/system/gateway/app-service/${this.appType}/${ref}/settings`, payload);
262
- }
263
- async download(ref, version) {
264
- return await this.client.post(`/v3/system/gateway/app-service/${this.appType}/download`, { version, uuid: ref }, { responseType: "arraybuffer" });
265
- }
266
- async upload(formData) {
267
- return await this.client.post(`/v3/system/gateway/app-service/${this.appType}/upload`, formData, {
268
- timeout: 60000
269
- });
270
- }
271
- }
272
-
273
90
  class Component extends PlatformBaseClient {
274
- constructor(ref = null) {
91
+ constructor(ref = null, options) {
92
+ var _a;
275
93
  super();
276
94
  this.ref = ref;
95
+ this.version = (_a = options === null || options === void 0 ? void 0 : options.version) !== null && _a !== void 0 ? _a : null;
96
+ }
97
+ /**
98
+ * Get the base path for component API calls
99
+ * @private
100
+ */
101
+ getComponentPath() {
102
+ if (this.version) {
103
+ return `/v3/system/component/${this.ref}/v/${this.version}`;
104
+ }
105
+ return `/v3/system/component/${this.ref}`;
277
106
  }
278
107
  /**
279
108
  * Find method to search for models
@@ -343,7 +172,7 @@ var ProtokolSDK010 = (function (exports, axios) {
343
172
  params[`_opt_${k}`] = opts ? opts[k] : null;
344
173
  });
345
174
  }
346
- return await this.client.get(`/v3/system/component/${this.ref}/models`, {
175
+ return await this.client.get(`${this.getComponentPath()}/models`, {
347
176
  params: params,
348
177
  headers: {
349
178
  'X-Cache': cache,
@@ -382,7 +211,7 @@ var ProtokolSDK010 = (function (exports, axios) {
382
211
  * @returns (Promise<Model>)
383
212
  */
384
213
  async get(uuid) {
385
- return await this.client.get(`/v3/system/component/${this.ref}/model/${uuid}`);
214
+ return await this.client.get(`${this.getComponentPath()}/model/${uuid}`);
386
215
  }
387
216
  /**
388
217
  * Update model by uuid
@@ -392,7 +221,7 @@ var ProtokolSDK010 = (function (exports, axios) {
392
221
  * @returns
393
222
  */
394
223
  async update(uuid, data, options) {
395
- return await this.client.post(`/v3/system/component/${this.ref}/model/${uuid}`, {
224
+ return await this.client.post(`${this.getComponentPath()}/model/${uuid}`, {
396
225
  data,
397
226
  options,
398
227
  });
@@ -405,9 +234,9 @@ var ProtokolSDK010 = (function (exports, axios) {
405
234
  * @returns
406
235
  */
407
236
  async updateMany(data, options) {
408
- return await this.client.post(`/v3/system/component/${this.ref}/models/bulk`, {
237
+ return await this.client.patch(`${this.getComponentPath()}/models/bulk`, {
409
238
  data,
410
- options,
239
+ options
411
240
  });
412
241
  }
413
242
  /**
@@ -418,7 +247,7 @@ var ProtokolSDK010 = (function (exports, axios) {
418
247
  * @returns
419
248
  */
420
249
  async modify(filters, data, options) {
421
- return await this.client.patch(`/v3/system/component/${this.ref}/modify/model`, {
250
+ return await this.client.patch(`${this.getComponentPath()}/modify/model`, {
422
251
  filters,
423
252
  data,
424
253
  options,
@@ -433,20 +262,84 @@ var ProtokolSDK010 = (function (exports, axios) {
433
262
  * @returns
434
263
  */
435
264
  async concurrentUpdate(uuid, version, data, options) {
436
- return await this.client.post(`/v3/system/component/${this.ref}/model/${uuid}`, {
265
+ return await this.client.post(`${this.getComponentPath()}/model/${uuid}`, {
437
266
  version: version,
438
267
  data,
439
268
  options,
440
269
  });
441
270
  }
442
271
  async create(model) {
443
- return await this.client.post(`/v3/system/component/${this.ref}/model`, model);
272
+ return await this.client.post(`${this.getComponentPath()}/model`, model);
444
273
  }
445
274
  async delete(uuid) {
446
- return await this.client.delete(`/v3/system/component/${this.ref}/model/${uuid}`);
275
+ return await this.client.delete(`${this.getComponentPath()}/model/${uuid}`);
447
276
  }
448
- async aggregate(pipeline) {
449
- return await this.client.post(`/v3/system/component/${this.ref}/aggregate`, pipeline);
277
+ /**
278
+ * Execute aggregate pipeline with optional streaming support
279
+ *
280
+ * Returns a chainable object that allows both buffered and streaming modes.
281
+ * Call .onData() to enable streaming mode, or await directly for buffered mode.
282
+ *
283
+ * @param {FindAggregateParams} pipeline - MongoDB aggregation pipeline
284
+ *
285
+ * @returns {AggregateChainable} Chainable object with streaming methods and Promise interface
286
+ *
287
+ * @example
288
+ * ```typescript
289
+ * // Buffered response (default, up to 5K documents)
290
+ * const result = await component.aggregate([{ $match: { status: 'active' } }]);
291
+ * console.log(result.data); // All results at once
292
+ *
293
+ * // Streaming response (up to 25K documents)
294
+ * await component.aggregate([{ $match: { status: 'active' } }])
295
+ * .onData((doc) => console.log('Received:', doc))
296
+ * .onError((err) => console.error('Error:', err))
297
+ * .onEnd(() => console.log('Stream complete'));
298
+ * ```
299
+ */
300
+ aggregate(pipeline) {
301
+ let onDataCallback = () => { };
302
+ let onErrorCallback;
303
+ let onEndCallback;
304
+ let isStreaming = false;
305
+ let streamPromise = null;
306
+ const chainable = {
307
+ onData: (callback) => {
308
+ onDataCallback = callback;
309
+ isStreaming = true;
310
+ return chainable;
311
+ },
312
+ onError: (callback) => {
313
+ onErrorCallback = callback;
314
+ return chainable;
315
+ },
316
+ onEnd: (callback) => {
317
+ onEndCallback = callback;
318
+ return chainable;
319
+ },
320
+ then: (resolve, reject) => {
321
+ if (isStreaming) {
322
+ if (!streamPromise) {
323
+ const handler = {
324
+ onData: onDataCallback,
325
+ onError: onErrorCallback,
326
+ onEnd: onEndCallback
327
+ };
328
+ streamPromise = this._streamNDJSON(`${this.getComponentPath()}/aggregate`, {
329
+ 'Accept': 'application/x-ndjson',
330
+ 'Content-Type': 'application/json'
331
+ }, handler, pipeline);
332
+ }
333
+ return streamPromise.then(resolve, reject);
334
+ }
335
+ return this.client.post(`${this.getComponentPath()}/aggregate`, pipeline)
336
+ .then(resolve, reject);
337
+ },
338
+ catch: (reject) => {
339
+ return chainable.then(undefined, reject);
340
+ }
341
+ };
342
+ return chainable;
450
343
  }
451
344
  async settings() {
452
345
  return await this.client.get(`/v3/system/component/settings/${this.ref}`);
@@ -464,18 +357,281 @@ var ProtokolSDK010 = (function (exports, axios) {
464
357
  });
465
358
  }
466
359
  async workflow(event, input) {
467
- return await this.client.post(`/v3/system/component/${this.ref}/workflow/event`, {
360
+ return await this.client.post(`${this.getComponentPath()}/workflow/event`, {
468
361
  event,
469
362
  input
470
363
  });
471
364
  }
472
365
  async function(name, input) {
473
- return await this.client.post(`/v3/system/component/${this.ref}/function/${name}`, {
366
+ return await this.client.post(`${this.getComponentPath()}/function/${name}`, {
474
367
  data: input
475
368
  });
476
369
  }
477
370
  async revisions(uuid) {
478
- return await this.client.get(`/v3/system/component/${this.ref}/model/${uuid}/revisions`);
371
+ return await this.client.get(`${this.getComponentPath()}/model/${uuid}/revisions`);
372
+ }
373
+ /**
374
+ * Internal method to handle NDJSON streaming responses
375
+ *
376
+ * @private
377
+ */
378
+ async _streamNDJSON(url, headers, handler, body) {
379
+ try {
380
+ const config = {
381
+ headers,
382
+ responseType: 'stream'
383
+ };
384
+ const response = await this.client.post(url, body, config);
385
+ const stream = response.data;
386
+ let buffer = '';
387
+ return new Promise((resolve, reject) => {
388
+ stream.on('data', (chunk) => {
389
+ buffer += chunk.toString();
390
+ // Process complete lines (separated by newlines)
391
+ const lines = buffer.split('\n');
392
+ buffer = lines.pop() || ''; // Keep incomplete line in buffer
393
+ for (const line of lines) {
394
+ if (line.trim()) {
395
+ try {
396
+ const document = JSON.parse(line);
397
+ const result = handler.onData(document);
398
+ // Support async callbacks
399
+ if (result instanceof Promise) {
400
+ result.catch((err) => {
401
+ if (handler.onError) {
402
+ handler.onError(err);
403
+ }
404
+ });
405
+ }
406
+ }
407
+ catch (err) {
408
+ if (handler.onError) {
409
+ handler.onError(err);
410
+ }
411
+ }
412
+ }
413
+ }
414
+ });
415
+ stream.on('end', () => {
416
+ // Process any remaining data in buffer
417
+ if (buffer.trim()) {
418
+ try {
419
+ const document = JSON.parse(buffer);
420
+ handler.onData(document);
421
+ }
422
+ catch (err) {
423
+ if (handler.onError) {
424
+ handler.onError(err);
425
+ }
426
+ }
427
+ }
428
+ if (handler.onEnd) {
429
+ handler.onEnd();
430
+ }
431
+ resolve();
432
+ });
433
+ stream.on('error', (err) => {
434
+ if (handler.onError) {
435
+ handler.onError(err);
436
+ }
437
+ reject(err);
438
+ });
439
+ });
440
+ }
441
+ catch (err) {
442
+ if (handler.onError) {
443
+ handler.onError(err);
444
+ }
445
+ throw err;
446
+ }
447
+ }
448
+ }
449
+
450
+ class Functions extends PlatformBaseClient {
451
+ async list() {
452
+ return await this.client.get("/v1/system/function");
453
+ }
454
+ async get(ref) {
455
+ return await this.client.get(`/v1/system/function/${ref}`);
456
+ }
457
+ async update(uuid, update) {
458
+ return await this.client.patch(`/v1/system/function/${uuid}`, update);
459
+ }
460
+ /**
461
+ * Run platform function
462
+ *
463
+ * @param id - Function ID
464
+ * @param input - Input data
465
+ * @param query - Query parameters
466
+ * @returns - Function result
467
+ *
468
+ * @example
469
+ * const result = await platform.function().run("myFunction", {input: { foo: "bar" }})
470
+ */
471
+ async run(id, d) {
472
+ const { data } = await this.client.post(`/v1/system/function/run/${id}`, d.input, {
473
+ params: d.query,
474
+ headers: d.headers
475
+ });
476
+ return data;
477
+ }
478
+ async generateSignature(ref, env) {
479
+ return await this.client.get(`/v1/system/function/signature/${env}/${ref}`);
480
+ }
481
+ }
482
+
483
+ class APIUser extends PlatformBaseClient {
484
+ async auth(username, password, project) {
485
+ return this.client.post("/v1/user/api/auth", {
486
+ username,
487
+ password
488
+ }, {
489
+ headers: {
490
+ "X-Project-Uuid": project
491
+ }
492
+ });
493
+ }
494
+ async newSecret(uuid) {
495
+ return await this.client.post(`/v1/user/api-user/secret/${uuid}`, {});
496
+ }
497
+ async revokeSecret(uuid) {
498
+ return await this.client.delete(`/v1/user/api-user/secret/${uuid}`);
499
+ }
500
+ async edit(uuid, roles) {
501
+ return await this.client.patch(`/v1/user/api-user/${uuid}`, { roles });
502
+ }
503
+ async list() {
504
+ return await this.client.get(`/v1/user/api-user`);
505
+ }
506
+ async get(uuid) {
507
+ return await this.client.get(`/v1/user/api-user/${uuid}`);
508
+ }
509
+ }
510
+
511
+ class Users extends PlatformBaseClient {
512
+ async auth(username, password, project) {
513
+ return await this.client.post("/v1/user/login", {
514
+ username,
515
+ password,
516
+ response_type: 'token',
517
+ }, {
518
+ headers: {
519
+ 'X-Project-Uuid': project
520
+ }
521
+ });
522
+ }
523
+ /**
524
+ * Resend confirmation email
525
+ * @param email User email
526
+ */
527
+ async resendConfirmationEmail(email) {
528
+ return await this.client.post("/v1/user/send/confirmation/email", {
529
+ email,
530
+ });
531
+ }
532
+ // Password Reset (Request Only)
533
+ // Note: Only the REQUEST is exposed, not the password reset completion
534
+ // The actual password reset should be done through the official web interface
535
+ /**
536
+ * Request password reset email
537
+ * This only sends an email with a reset link, does not expose or change passwords
538
+ * @param email User email
539
+ */
540
+ async requestPasswordReset(email) {
541
+ return await this.client.post("/v1/user/resetpassword", { email });
542
+ }
543
+ // User Profile & Management
544
+ /**
545
+ * Get current user's model
546
+ */
547
+ async getUser() {
548
+ return await this.client.get("/v1/user/model");
549
+ }
550
+ /**
551
+ * Get current user's claims
552
+ */
553
+ async getClaims() {
554
+ return await this.client.get("/v1/user/claims");
555
+ }
556
+ /**
557
+ * Edit user profile
558
+ * @param data Profile update data
559
+ */
560
+ async editProfile(data) {
561
+ return await this.client.post("/v1/user/profile/edit", data);
562
+ }
563
+ // Permissions & Roles
564
+ /**
565
+ * Get user permissions
566
+ */
567
+ async getPermissions() {
568
+ return await this.client.get("/v1/user/role/permissions");
569
+ }
570
+ /**
571
+ * Get list of available permissions
572
+ */
573
+ async listPermissions() {
574
+ return await this.client.get("/v1/user/permissions/list");
575
+ }
576
+ /**
577
+ * Create a new role
578
+ * @param role Role data including name, permissions, workspaces, and level
579
+ */
580
+ async createRole(role) {
581
+ return await this.client.post("/v1/user/role/create", role);
582
+ }
583
+ /**
584
+ * Delete a role
585
+ * @param uuid Role UUID
586
+ */
587
+ async deleteRole(uuid) {
588
+ return await this.client.delete(`/v1/user/role/delete/${uuid}`);
589
+ }
590
+ /**
591
+ * List all roles
592
+ */
593
+ async listRoles() {
594
+ return await this.client.get(`/v1/user/role/list`);
595
+ }
596
+ /**
597
+ * Get role details by UUID
598
+ * @param uuid Role UUID
599
+ */
600
+ async getRoleModel(uuid) {
601
+ return await this.client.get(`/v1/user/role/edit/${uuid}`);
602
+ }
603
+ /**
604
+ * Edit a role
605
+ * @param uuid Role UUID
606
+ * @param data Role update data including permissions, workspaces, and level
607
+ */
608
+ async editRole(uuid, data) {
609
+ return await this.client.post(`/v1/user/role/edit/${uuid}`, data);
610
+ }
611
+ /**
612
+ * @deprecated Use getPermissions() instead
613
+ */
614
+ async permissions() {
615
+ return await this.client.get(`/v1/user/role/permissions`);
616
+ }
617
+ }
618
+
619
+ class Apps extends PlatformBaseClient {
620
+ constructor(appType) {
621
+ super();
622
+ this.appType = appType;
623
+ }
624
+ async updateSettings(updateValues, ref) {
625
+ const payload = { ...updateValues };
626
+ return await this.client.put(`/v3/system/gateway/app-service/${this.appType}/${ref}/settings`, payload);
627
+ }
628
+ async download(ref, version) {
629
+ return await this.client.post(`/v3/system/gateway/app-service/${this.appType}/download`, { version, uuid: ref }, { responseType: "arraybuffer" });
630
+ }
631
+ async upload(formData) {
632
+ return await this.client.post(`/v3/system/gateway/app-service/${this.appType}/upload`, formData, {
633
+ timeout: 60000
634
+ });
479
635
  }
480
636
  }
481
637
 
@@ -1010,8 +1166,8 @@ var ProtokolSDK010 = (function (exports, axios) {
1010
1166
  forge() {
1011
1167
  return (new Forge()).setClient(this.client);
1012
1168
  }
1013
- component(ref) {
1014
- return (new Component(ref)).setClient(this.client);
1169
+ component(ref, options) {
1170
+ return (new Component(ref, options)).setClient(this.client);
1015
1171
  }
1016
1172
  componentUtils() {
1017
1173
  return (new ComponentUtils()).setClient(this.client);
@@ -1066,8 +1222,8 @@ var ProtokolSDK010 = (function (exports, axios) {
1066
1222
 
1067
1223
  class IntegrationsBaseClient extends BaseClient {
1068
1224
  constructor(options) {
1069
- var _a, _b, _c;
1070
- let { env = null, token, host, } = options !== null && options !== void 0 ? options : {};
1225
+ var _a, _b, _c, _d, _e, _f, _g;
1226
+ let { env = null, token = null, host = null, } = options !== null && options !== void 0 ? options : {};
1071
1227
  let headers = {};
1072
1228
  var project_uuid = null;
1073
1229
  if (isBrowser) {
@@ -1077,16 +1233,22 @@ var ProtokolSDK010 = (function (exports, axios) {
1077
1233
  else {
1078
1234
  headers['X-Project-Env'] = (_b = localStorage.getItem('current_env')) !== null && _b !== void 0 ? _b : "dev";
1079
1235
  }
1236
+ if (typeof window !== "undefined") {
1237
+ // @ts-ignore
1238
+ const __global_env__ = window === null || window === void 0 ? void 0 : window.__ENV_VARIABLES__;
1239
+ host = (_c = __global_env__.INTEGRATION_API) !== null && _c !== void 0 ? _c : host;
1240
+ // @ts-ignore
1241
+ token = token !== null && token !== void 0 ? token : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_API_TOKEN;
1242
+ // @ts-ignore
1243
+ env = env !== null && env !== void 0 ? env : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_ENV;
1244
+ project_uuid = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_UUID;
1245
+ }
1080
1246
  }
1081
- if (typeof window !== "undefined") {
1082
- // @ts-ignore
1083
- const __global_env__ = window === null || window === void 0 ? void 0 : window.__ENV_VARIABLES__;
1084
- host = (_c = __global_env__.INTEGRATION_API) !== null && _c !== void 0 ? _c : host;
1085
- // @ts-ignore
1086
- token = token !== null && token !== void 0 ? token : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_API_TOKEN;
1087
- // @ts-ignore
1088
- env = env !== null && env !== void 0 ? env : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_ENV;
1089
- project_uuid = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_UUID;
1247
+ else if (process && process.env) {
1248
+ host = (_d = host !== null && host !== void 0 ? host : process.env.API_HOST) !== null && _d !== void 0 ? _d : null;
1249
+ env = (_e = env !== null && env !== void 0 ? env : process.env.PROJECT_ENV) !== null && _e !== void 0 ? _e : null;
1250
+ token = (_f = token !== null && token !== void 0 ? token : process.env.PROJECT_API_TOKEN) !== null && _f !== void 0 ? _f : null;
1251
+ project_uuid = (_g = process.env.PROJECT_UUID) !== null && _g !== void 0 ? _g : null;
1090
1252
  }
1091
1253
  if (token) {
1092
1254
  headers['Authorization'] = `Bearer ${token}`;
@@ -1106,6 +1268,9 @@ var ProtokolSDK010 = (function (exports, axios) {
1106
1268
  withCredentials: true,
1107
1269
  });
1108
1270
  super(client);
1271
+ this.env = null;
1272
+ this.token = null;
1273
+ this.host = null;
1109
1274
  }
1110
1275
  }
1111
1276
 
@@ -1344,6 +1509,38 @@ var ProtokolSDK010 = (function (exports, axios) {
1344
1509
  async dirs(data) {
1345
1510
  return await this.request("POST", `media/library/dirs`, { data });
1346
1511
  }
1512
+ // ===================================================================
1513
+ // Document Methods
1514
+ // ===================================================================
1515
+ async createDocument(payload) {
1516
+ return this.requestv2('POST', 'documents/document', { data: payload });
1517
+ }
1518
+ async getDocument(path) {
1519
+ return this.requestv2('GET', `documents/document/${path}`);
1520
+ }
1521
+ async getDocumentRaw(path) {
1522
+ return this.requestv2('GET', `documents/document/${path}`, {
1523
+ headers: { Accept: 'application/pdoc' }
1524
+ });
1525
+ }
1526
+ async updateDocument(payload) {
1527
+ return this.requestv2('PATCH', 'documents/document', { data: payload });
1528
+ }
1529
+ async deleteDocument(path) {
1530
+ return this.requestv2('DELETE', `documents/document/${path}`);
1531
+ }
1532
+ async listDocuments(params) {
1533
+ return this.requestv2('GET', 'documents/list', { params });
1534
+ }
1535
+ async listDeletedDocuments(params) {
1536
+ return this.requestv2('GET', 'documents/list/__deleted__', { params });
1537
+ }
1538
+ async restoreDocument(payload) {
1539
+ return this.requestv2('POST', 'documents/restore', { data: payload });
1540
+ }
1541
+ async createDocumentComment(payload) {
1542
+ return this.requestv2('POST', 'documents/document/comment', { data: payload });
1543
+ }
1347
1544
  async fillPdf(data) {
1348
1545
  const { input_path, output_path, output_pdf = false, output_type, output_file_name, replace, form_data, forms } = data;
1349
1546
  const responseType = output_pdf ? 'arraybuffer' : 'json';
@@ -1829,6 +2026,13 @@ var ProtokolSDK010 = (function (exports, axios) {
1829
2026
  ...params
1830
2027
  });
1831
2028
  }
2029
+ async requestv2(method, endpoint, params) {
2030
+ return await this.client.request({
2031
+ method,
2032
+ url: `/v2/dms/${endpoint}`,
2033
+ ...params
2034
+ });
2035
+ }
1832
2036
  async requestv1(method, endpoint, params) {
1833
2037
  return await this.client.request({
1834
2038
  method: method,
@@ -1876,19 +2080,781 @@ var ProtokolSDK010 = (function (exports, axios) {
1876
2080
  }
1877
2081
 
1878
2082
  class Payments extends IntegrationsBaseClient {
1879
- async getTransactions(user) {
1880
- return await this.client.get(`/karadjordje/v1/payment/${user}/list`);
2083
+ async getTransactions(userId, params) {
2084
+ return await this.client.get(`/karadjordje/v1/payment/${userId}/list`, {
2085
+ params,
2086
+ });
2087
+ }
2088
+ async getTransaction(provider, userId, transactionId) {
2089
+ return await this.client.get(`/karadjordje/v1/payment/${provider}/${userId}/getTransaction`, {
2090
+ params: { transactionId },
2091
+ });
1881
2092
  }
1882
2093
  async settings(provider) {
1883
2094
  return await this.client.get(`/karadjordje/v1/payment/${provider}/settings`);
1884
2095
  }
2096
+ async deactivatePaymentLink(provider, user, transactionId) {
2097
+ return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/deactivate/${transactionId}`);
2098
+ }
2099
+ async voidTransaction(provider, user, transactionId) {
2100
+ return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/void/${transactionId}`);
2101
+ }
2102
+ async refund(provider, user, transactionId) {
2103
+ return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/refund/${transactionId}`);
2104
+ }
1885
2105
  async getPaymentLink(provider, user, options) {
1886
- var _a;
1887
- return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/getPaymentLink`, {
1888
- totalAmount: options.totalAmount.toString(),
1889
- description: options.description,
1890
- redirectUrl: (_a = options.redirectUrl) !== null && _a !== void 0 ? _a : null,
1891
- });
2106
+ return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/getPaymentLink`, options);
2107
+ }
2108
+ async getTokenRequestLink(provider, user, options) {
2109
+ return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/getTokenRequestLink`, options);
2110
+ }
2111
+ async directPayUsingToken(provider, user, options) {
2112
+ return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/directPayUsingToken`, options);
2113
+ }
2114
+ }
2115
+
2116
+ class Minimax extends IntegrationsBaseClient {
2117
+ async settings() {
2118
+ return await this.client.get(`/karadjordje/v1/minimax/settings`);
2119
+ }
2120
+ async getAccounts(userId, organisationId, params) {
2121
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts`;
2122
+ return await this.client.get(path, { params });
2123
+ }
2124
+ async getAccount(userId, organisationId, accountId) {
2125
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts/${accountId}`;
2126
+ return await this.client.get(path);
2127
+ }
2128
+ async getAccountByCode(userId, organisationId, code) {
2129
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts/code(${code})`;
2130
+ return await this.client.get(path);
2131
+ }
2132
+ async getAccountByContent(userId, organisationId, content) {
2133
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts/content(${content})`;
2134
+ return await this.client.get(path);
2135
+ }
2136
+ async getAccountsForSync(userId, organisationId, params) {
2137
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts/synccandidates`;
2138
+ return await this.client.get(path, { params });
2139
+ }
2140
+ /** ADDRESSES */
2141
+ async getAddresses(userId, organisationId, customerId, params) {
2142
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses`;
2143
+ return await this.client.get(path, { params });
2144
+ }
2145
+ async newAddress(userId, organisationId, customerId, address) {
2146
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses`;
2147
+ return await this.client.post(path, address);
2148
+ }
2149
+ async deleteAddress(userId, organisationId, customerId, addressId) {
2150
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${addressId}`;
2151
+ return await this.client.delete(path);
2152
+ }
2153
+ async getAddress(userId, organisationId, customerId, addressId) {
2154
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${addressId}`;
2155
+ return await this.client.get(path);
2156
+ }
2157
+ async updateAddress(userId, organisationId, customerId, address) {
2158
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${address.AddressId}`;
2159
+ return await this.client.put(path, address);
2160
+ }
2161
+ async getAddressesForSync(userId, organisationId, customerId, params) {
2162
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/synccandidates`;
2163
+ return await this.client.get(path, { params });
2164
+ }
2165
+ /** ANALYTICS */
2166
+ async getAnalytics(userId, organisationId, params) {
2167
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics`;
2168
+ return await this.client.get(path, { params });
2169
+ }
2170
+ async newAnalytic(userId, organisationId, analytic) {
2171
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics`;
2172
+ return await this.client.post(path, analytic);
2173
+ }
2174
+ async deleteAnalytic(userId, organisationId, analyticId) {
2175
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics/${analyticId}`;
2176
+ return await this.client.delete(path);
2177
+ }
2178
+ async getAnalytic(userId, organisationId, analyticId) {
2179
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics/${analyticId}`;
2180
+ return await this.client.get(path);
2181
+ }
2182
+ async updateAnalytic(userId, organisationId, analytic) {
2183
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics/${analytic.AnalyticId}`;
2184
+ return await this.client.put(path, analytic);
2185
+ }
2186
+ async getAnalyticsForSync(userId, organisationId, params) {
2187
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics/synccandidates`;
2188
+ return await this.client.get(path, { params });
2189
+ }
2190
+ /** BANK ACCOUNTS */
2191
+ async getBankAccounts(userId, organisationId, customerId, params) {
2192
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts`;
2193
+ return await this.client.get(path, { params });
2194
+ }
2195
+ async newBankAccount(userId, organisationId, customerId, bankAccount) {
2196
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts`;
2197
+ return await this.client.post(path, bankAccount);
2198
+ }
2199
+ async deleteBankAccount(userId, organisationId, customerId, bankAccountId) {
2200
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts/${bankAccountId}`;
2201
+ return await this.client.delete(path);
2202
+ }
2203
+ async getBankAccount(userId, organisationId, customerId, bankAccountId) {
2204
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts/${bankAccountId}`;
2205
+ return await this.client.get(path);
2206
+ }
2207
+ async updateBankAccount(userId, organisationId, customerId, bankAccount) {
2208
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${bankAccount.BankAccountId}`;
2209
+ return await this.client.put(path, bankAccount);
2210
+ }
2211
+ async getBankAccountsForSync(userId, organisationId, customerId, params) {
2212
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts/synccandidates`;
2213
+ return await this.client.get(path, { params });
2214
+ }
2215
+ /** CONTACTS */
2216
+ async getCustomerContacts(userId, organisationId, customerId, params) {
2217
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts`;
2218
+ return await this.client.get(path, { params });
2219
+ }
2220
+ async newContact(userId, organisationId, customerId, contact) {
2221
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts`;
2222
+ return await this.client.post(path, contact);
2223
+ }
2224
+ async deleteContact(userId, organisationId, customerId, contactId) {
2225
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts/${contactId}`;
2226
+ return await this.client.delete(path);
2227
+ }
2228
+ async getContact(userId, organisationId, customerId, contactId) {
2229
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts/${contactId}`;
2230
+ return await this.client.get(path);
2231
+ }
2232
+ async updateContact(userId, organisationId, customerId, contact) {
2233
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${contact.ContactId}`;
2234
+ return await this.client.put(path, contact);
2235
+ }
2236
+ async getContacts(userId, organisationId, params) {
2237
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/contacts`;
2238
+ return await this.client.get(path, { params });
2239
+ }
2240
+ async getContactForSync(userId, organisationId, customerId, params) {
2241
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts/synccandidates`;
2242
+ return await this.client.get(path, { params });
2243
+ }
2244
+ /** COUNTRIES */
2245
+ async getCountries(userId, organisationId, params) {
2246
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/countries`;
2247
+ return await this.client.get(path, { params });
2248
+ }
2249
+ async getCountry(userId, organisationId, countryId) {
2250
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/countries/${countryId}`;
2251
+ return await this.client.get(path);
2252
+ }
2253
+ async getCountryByCode(userId, organisationId, code) {
2254
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/countries/code(${code})`;
2255
+ return await this.client.get(path);
2256
+ }
2257
+ async getCountriesForSync(userId, organisationId, params) {
2258
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/countries/synccandidates`;
2259
+ return await this.client.get(path, { params });
2260
+ }
2261
+ /** CURRENCIES */
2262
+ async getCurrencies(userId, organisationId, params) {
2263
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies`;
2264
+ return await this.client.get(path, { params });
2265
+ }
2266
+ async getCurrency(userId, organisationId, currencyId) {
2267
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies/${currencyId}`;
2268
+ return await this.client.get(path);
2269
+ }
2270
+ async getCurrencyByDate(userId, organisationId, date) {
2271
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies/date(${date.toISOString()})`;
2272
+ return await this.client.get(path);
2273
+ }
2274
+ async getCurrencyByCode(userId, organisationId, code) {
2275
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies/code(${code})`;
2276
+ return await this.client.get(path);
2277
+ }
2278
+ async getCurrenciesForSync(userId, organisationId, params) {
2279
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies/synccandidates`;
2280
+ return await this.client.get(path, { params });
2281
+ }
2282
+ /** CUSTOMERS */
2283
+ async getCustomers(userId, organisationId, params) {
2284
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers`;
2285
+ return await this.client.get(path, { params });
2286
+ }
2287
+ async newCustomer(userId, organisationId, customer) {
2288
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers`;
2289
+ return await this.client.post(path, customer);
2290
+ }
2291
+ async deleteCusomter(userId, organisationId, customerId) {
2292
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}`;
2293
+ return await this.client.delete(path);
2294
+ }
2295
+ async getCustomer(userId, organisationId, customerId) {
2296
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}`;
2297
+ return await this.client.get(path);
2298
+ }
2299
+ async updateCustomer(userId, organisationId, customer) {
2300
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customer.CustomerId}`;
2301
+ return await this.client.put(path, customer);
2302
+ }
2303
+ async getCustomerByCode(userId, organisationId, code) {
2304
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/code(${code})`;
2305
+ return await this.client.get(path);
2306
+ }
2307
+ async newCustomerByTaxNumber(userId, organisationId, taxNumber) {
2308
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/addbytaxnumber(${taxNumber})`;
2309
+ return await this.client.post(path, {});
2310
+ }
2311
+ async getCustomersForSync(userId, organisationId, params) {
2312
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/synccandidates`;
2313
+ return await this.client.get(path, { params });
2314
+ }
2315
+ /** DASHBOARDS */
2316
+ async getDashboardsData(userId, organisationId) {
2317
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/dashboards`;
2318
+ return await this.client.get(path);
2319
+ }
2320
+ /** DOCUMENTS */
2321
+ async getDocuments(userId, organisationId, params) {
2322
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents`;
2323
+ return await this.client.get(path, { params });
2324
+ }
2325
+ async newDocument(userId, organisationId, document) {
2326
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents`;
2327
+ return await this.client.post(path, document);
2328
+ }
2329
+ async deleteDocument(userId, organisationId, documentId) {
2330
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}`;
2331
+ return await this.client.delete(path);
2332
+ }
2333
+ async getDocument(userId, organisationId, documentId) {
2334
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}`;
2335
+ return await this.client.get(path);
2336
+ }
2337
+ async updateDocument(userId, organisationId, document) {
2338
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${document.DocumentId}`;
2339
+ return await this.client.put(path, document);
2340
+ }
2341
+ async deleteDocumentAttachment(userId, organisationId, documentId, documentAttachmentId) {
2342
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}/attachments/${documentAttachmentId}`;
2343
+ return await this.client.delete(path);
2344
+ }
2345
+ async getDocumentAttachment(userId, organisationId, documentId, documentAttachmentId) {
2346
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}/attachments/${documentAttachmentId}`;
2347
+ return await this.client.get(path);
2348
+ }
2349
+ async updateDocumentAttachment(userId, organisationId, documentId, documentAttachment) {
2350
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}/attachments/${documentAttachment.DocumentAttachmentId}`;
2351
+ return await this.client.put(path, documentAttachment);
2352
+ }
2353
+ async newDocumentAttachment(userId, organisationId, documentId, documentAttachment) {
2354
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}/attachments`;
2355
+ return await this.client.post(path, documentAttachment);
2356
+ }
2357
+ async getDocumentsForSync(userId, organisationId, params) {
2358
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/synccandidates`;
2359
+ return await this.client.get(path, { params });
2360
+ }
2361
+ /** DOCUMENT NUMBERINGS */
2362
+ async getDocumentNumberings(userId, organisationId, params) {
2363
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/document-numbering`;
2364
+ return await this.client.get(path, { params });
2365
+ }
2366
+ async getDocumentNumbering(userId, organisationId, documentNumberingId) {
2367
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/document-numbering/${documentNumberingId}`;
2368
+ return await this.client.get(path);
2369
+ }
2370
+ /** EFAKTURA */
2371
+ async getEFakturaList(userId, params) {
2372
+ const path = `/karadjordje/v1/minimax/${userId}/api/efaktura/list`;
2373
+ return await this.client.get(path, { params });
2374
+ }
2375
+ /** EMPLOYEES */
2376
+ async getEmployees(userId, organisationId, params) {
2377
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees`;
2378
+ return await this.client.get(path, { params });
2379
+ }
2380
+ async newEmployee(userId, organisationId, employee) {
2381
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees`;
2382
+ return await this.client.post(path, employee);
2383
+ }
2384
+ async deleteEmployee(userId, organisationId, employeeId) {
2385
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees/${employeeId}`;
2386
+ return await this.client.delete(path);
2387
+ }
2388
+ async getEmployee(userId, organisationId, employeeId) {
2389
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees/${employeeId}`;
2390
+ return await this.client.get(path);
2391
+ }
2392
+ async updateEmployee(userId, organisationId, employee) {
2393
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees/${employee.EmployeeId}`;
2394
+ return await this.client.put(path, employee);
2395
+ }
2396
+ async getEmployeesForSync(userId, organisationId, params) {
2397
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees/synccandidates`;
2398
+ return await this.client.get(path, { params });
2399
+ }
2400
+ /** EXCHANGE RATES */
2401
+ async getExchangeRate(userId, organisationId, currencyId) {
2402
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/exchange-rates/${currencyId}`;
2403
+ return await this.client.get(path);
2404
+ }
2405
+ async getExchangeRateByCode(userId, organisationId, currencyCode) {
2406
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/exchange-rates/code(${currencyCode})`;
2407
+ return await this.client.get(path);
2408
+ }
2409
+ /** INBOX */
2410
+ async getInboxes(userId, organisationId, params) {
2411
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox`;
2412
+ return await this.client.get(path, { params });
2413
+ }
2414
+ async newInbox(userId, organisationId, inbox) {
2415
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox`;
2416
+ return await this.client.post(path, inbox);
2417
+ }
2418
+ async deleteInbox(userId, organisationId, inboxId) {
2419
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}`;
2420
+ return await this.client.delete(path);
2421
+ }
2422
+ async getInbox(userId, organisationId, inboxId) {
2423
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}`;
2424
+ return await this.client.get(path);
2425
+ }
2426
+ async newInboxAttachment(userId, organisationId, inboxId, inboxAttachment) {
2427
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}`;
2428
+ return await this.client.post(path, inboxAttachment);
2429
+ }
2430
+ async deleteInboxAttachment(userId, organisationId, inboxId, inboxAttachmentId) {
2431
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}/attachments/${inboxAttachmentId}`;
2432
+ return await this.client.delete(path);
2433
+ }
2434
+ async actionOnInbox(userId, organisationId, inboxId, action) {
2435
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}/actions/${action}`;
2436
+ return await this.client.put(path, {});
2437
+ }
2438
+ /** ISSUED INVOICE */
2439
+ async getIssuedInvoices(userId, organisationId, params) {
2440
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices`;
2441
+ return await this.client.get(path, { params });
2442
+ }
2443
+ async newIssuedInvoice(userId, organisationId, issuedInvoice) {
2444
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices`;
2445
+ return await this.client.post(path, issuedInvoice);
2446
+ }
2447
+ async deleteIssuedInvoice(userId, organisationId, issuedInvoiceId) {
2448
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/${issuedInvoiceId}`;
2449
+ return await this.client.delete(path);
2450
+ }
2451
+ async getIssuedInvoice(userId, organisationId, issuedInvoiceId) {
2452
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/${issuedInvoiceId}`;
2453
+ return await this.client.get(path);
2454
+ }
2455
+ async updateIssuedInvoice(userId, organisationId, issuedInvoice) {
2456
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/${issuedInvoice.IssuedInvoiceId}`;
2457
+ return await this.client.put(path, issuedInvoice);
2458
+ }
2459
+ async actionOnIssuedInvoice(userId, organisationId, issuedInvoiceId, action) {
2460
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/${issuedInvoiceId}/actions/${action}`;
2461
+ return await this.client.put(path, {});
2462
+ }
2463
+ async getIssuedInvoicesForSync(userId, organisationId, params) {
2464
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/synccandidates`;
2465
+ return await this.client.get(path, { params });
2466
+ }
2467
+ async getPaymentMethodsOnIssuedInvoices(userId, organisationId, params) {
2468
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/paymentmethods`;
2469
+ return await this.client.get(path, { params });
2470
+ }
2471
+ /** ISSUED INVOICE POSTING */
2472
+ async getIssuedInvoicePostings(userId, organisationId, params) {
2473
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings`;
2474
+ return await this.client.get(path, { params });
2475
+ }
2476
+ async newIssuedInvoicePosting(userId, organisationId, issuedInvoicePosting) {
2477
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings`;
2478
+ return await this.client.post(path, issuedInvoicePosting);
2479
+ }
2480
+ async deleteIssuedInvoicePosting(userId, organisationId, issuedInvoicePostingId) {
2481
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings/${issuedInvoicePostingId}`;
2482
+ return await this.client.delete(path);
2483
+ }
2484
+ async getIssuedInvoicePosting(userId, organisationId, issuedInvoicePostingId) {
2485
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings/${issuedInvoicePostingId}`;
2486
+ return await this.client.get(path);
2487
+ }
2488
+ async getPaymentMethodsOnIssuedInvoicePostings(userId, organisationId, params) {
2489
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings/paymentmethods`;
2490
+ return await this.client.get(path, { params });
2491
+ }
2492
+ async actionOnIssuedInvoicePosting(userId, organisationId, issuedInvoicePostingId, action) {
2493
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings/${issuedInvoicePostingId}/actions/${action}`;
2494
+ return await this.client.put(path, {});
2495
+ }
2496
+ /** ITEMS */
2497
+ async getItems(userId, organisationId, params) {
2498
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items`;
2499
+ return await this.client.get(path, { params });
2500
+ }
2501
+ async newItem(userId, organisationId, item) {
2502
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items`;
2503
+ return await this.client.post(path, item);
2504
+ }
2505
+ async deleteItem(userId, organisationId, itemId) {
2506
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/${itemId}`;
2507
+ return await this.client.delete(path);
2508
+ }
2509
+ async getItem(userId, organisationId, itemId) {
2510
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/${itemId}`;
2511
+ return await this.client.get(path);
2512
+ }
2513
+ async updateItem(userId, organisationId, item) {
2514
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/${item.ItemId}`;
2515
+ return await this.client.put(path, item);
2516
+ }
2517
+ async getItemByCode(userId, organisationId, code) {
2518
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/code(${code})`;
2519
+ return await this.client.get(path);
2520
+ }
2521
+ async getItemSettings(userId, organisationId, code) {
2522
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/settings`;
2523
+ return await this.client.get(path);
2524
+ }
2525
+ async getItemData(userId, organisationId, params) {
2526
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/itemsdata`;
2527
+ return await this.client.get(path, { params });
2528
+ }
2529
+ async getItemPricelist(userId, organisationId, params) {
2530
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/pricelists`;
2531
+ return await this.client.get(path, { params });
2532
+ }
2533
+ async getItemsForSync(userId, organisationId, params) {
2534
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/synccandidates`;
2535
+ return await this.client.get(path, { params });
2536
+ }
2537
+ /** JOURNALS */
2538
+ async getJournals(userId, organisationId, params) {
2539
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals`;
2540
+ return await this.client.get(path, { params });
2541
+ }
2542
+ async newJournal(userId, organisationId, journal) {
2543
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals`;
2544
+ return await this.client.post(path, journal);
2545
+ }
2546
+ async deleteJournal(userId, organisationId, journalId) {
2547
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}`;
2548
+ return await this.client.delete(path);
2549
+ }
2550
+ async getJournal(userId, organisationId, journalId) {
2551
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}`;
2552
+ return await this.client.get(path);
2553
+ }
2554
+ async updateJournal(userId, organisationId, journal) {
2555
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journal.JournalId}`;
2556
+ return await this.client.put(path, journal);
2557
+ }
2558
+ async deleteJournalVatEntry(userId, organisationId, journalId, vatId) {
2559
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}/vat/${vatId}`;
2560
+ return await this.client.delete(path);
2561
+ }
2562
+ async getJournalVatEntry(userId, organisationId, journalId, vatId) {
2563
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}/vat/${vatId}`;
2564
+ return await this.client.get(path);
2565
+ }
2566
+ async updateJournalVatEntry(userId, organisationId, journalId, vatEntry) {
2567
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}/vat/${vatEntry.VatEntryId}`;
2568
+ return await this.client.put(path, vatEntry);
2569
+ }
2570
+ async newJournalVatEntry(userId, organisationId, journalId, vatEntry) {
2571
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}/vat`;
2572
+ return await this.client.post(path, vatEntry);
2573
+ }
2574
+ async getJournalsForSync(userId, organisationId, params) {
2575
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/synccandidates`;
2576
+ return await this.client.get(path, { params });
2577
+ }
2578
+ async getJournalsInVODStandard(userId, organisationId, params) {
2579
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/vodstandard`;
2580
+ return await this.client.get(path, { params });
2581
+ }
2582
+ async getJournalEntries(userId, organisationId, params) {
2583
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/journal-entries`;
2584
+ return await this.client.get(path, { params });
2585
+ }
2586
+ /** JOURNAL TYPES */
2587
+ async getJournalTypes(userId, organisationId, params) {
2588
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journaltypes`;
2589
+ return await this.client.get(path, { params });
2590
+ }
2591
+ async getJournalType(userId, organisationId, journalTypeId) {
2592
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journaltypes/${journalTypeId}`;
2593
+ return await this.client.get(path);
2594
+ }
2595
+ async getJournalTypeByCode(userId, organisationId, code) {
2596
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journaltypes/code(${code})`;
2597
+ return await this.client.get(path);
2598
+ }
2599
+ async getJournalTypesForSync(userId, organisationId, params) {
2600
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journaltypes/synccandidates`;
2601
+ return await this.client.get(path, { params });
2602
+ }
2603
+ /** ORDERS */
2604
+ async getOrders(userId, organisationId, params) {
2605
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders`;
2606
+ return await this.client.get(path, { params });
2607
+ }
2608
+ async newOrder(userId, organisationId, order) {
2609
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders`;
2610
+ return await this.client.post(path, order);
2611
+ }
2612
+ async deleteOrder(userId, organisationId, orderId) {
2613
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${orderId}`;
2614
+ return await this.client.delete(path);
2615
+ }
2616
+ async getOrder(userId, organisationId, orderId) {
2617
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${orderId}`;
2618
+ return await this.client.get(path);
2619
+ }
2620
+ async updateOrder(userId, organisationId, order) {
2621
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${order.OrderId}`;
2622
+ return await this.client.put(path, order);
2623
+ }
2624
+ async actionGetOnOrder(userId, organisationId, orderId, action, params) {
2625
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${orderId}/actions/${action}`;
2626
+ return await this.client.get(path, { params });
2627
+ }
2628
+ async actionPutOnOrder(userId, organisationId, orderId, action, params) {
2629
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${orderId}/actions/${action}`;
2630
+ return await this.client.put(path, {}, { params });
2631
+ }
2632
+ async getOrdersForSync(userId, organisationId, params) {
2633
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/synccandidates`;
2634
+ return await this.client.get(path, { params });
2635
+ }
2636
+ /** ORGANISATIONS */
2637
+ async getOrganisation(userId, organisationId) {
2638
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}`;
2639
+ return await this.client.get(path);
2640
+ }
2641
+ async getAllOrganisations(userId, params) {
2642
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/allOrgs`;
2643
+ return await this.client.get(path, { params });
2644
+ }
2645
+ /** OUTBOX */
2646
+ async getAllOuboxes(userId, organisationId, params) {
2647
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/outbox`;
2648
+ return await this.client.get(path, { params });
2649
+ }
2650
+ async getOutbox(userId, organisationId, outboxId) {
2651
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/outbox/${outboxId}`;
2652
+ return await this.client.get(path);
2653
+ }
2654
+ /** PAYMENT METHODS */
2655
+ async getPaymentMethods(userId, organisationId, params) {
2656
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/paymentmethods`;
2657
+ return await this.client.get(path, { params });
2658
+ }
2659
+ /** PAYROLL SETTINGS */
2660
+ async getPayrollSettingsByCode(userId, code) {
2661
+ const path = `/karadjordje/v1/minimax/${userId}/api/payrollsettings/${code}`;
2662
+ return await this.client.get(path);
2663
+ }
2664
+ /** POSTAL CODE */
2665
+ async getPostalCodesByCountry(userId, organisationId, countryId, params) {
2666
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/postalcodes/countries/${countryId}`;
2667
+ return await this.client.get(path, { params });
2668
+ }
2669
+ async getPostalCode(userId, organisationId, postalCodeId) {
2670
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/postalcodes/${postalCodeId}`;
2671
+ return await this.client.get(path);
2672
+ }
2673
+ async getPostalCodesForSync(userId, organisationId, params) {
2674
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/postalcodes/synccandidates`;
2675
+ return await this.client.get(path, { params });
2676
+ }
2677
+ /** PRODUCT GROUPS */
2678
+ async getProductGroups(userId, organisationId, params) {
2679
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups`;
2680
+ return await this.client.get(path, { params });
2681
+ }
2682
+ async newProductGroup(userId, organisationId, productGroup) {
2683
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups`;
2684
+ return await this.client.post(path, productGroup);
2685
+ }
2686
+ async deleteProductGroup(userId, organisationId, productGroupId) {
2687
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups/${productGroupId}`;
2688
+ return await this.client.delete(path);
2689
+ }
2690
+ async getProductGroup(userId, organisationId, productGroupId) {
2691
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups/${productGroupId}`;
2692
+ return await this.client.get(path);
2693
+ }
2694
+ async updateProductGroup(userId, organisationId, productGroup) {
2695
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups/${productGroup.ProductGroupId}`;
2696
+ return await this.client.put(path, productGroup);
2697
+ }
2698
+ async getProductGroupsForSync(userId, organisationId, params) {
2699
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups/synccandidates`;
2700
+ return await this.client.get(path, { params });
2701
+ }
2702
+ /** PURPOSE CODE */
2703
+ async getPurposeCodes(userId, organisationId, params) {
2704
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/purpose-codes`;
2705
+ return await this.client.get(path, { params });
2706
+ }
2707
+ async getPurposeCode(userId, organisationId, purposeCodeId) {
2708
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/purpose-codes/${purposeCodeId}`;
2709
+ return await this.client.get(path);
2710
+ }
2711
+ async getPurposeCodeByCode(userId, organisationId, code) {
2712
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/purpose-codes/code(${code})`;
2713
+ return await this.client.get(path);
2714
+ }
2715
+ async getPurposeCodesForSync(userId, organisationId, params) {
2716
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/purpose-codes/synccandidates`;
2717
+ return await this.client.get(path, { params });
2718
+ }
2719
+ /** RECEIVED INVOICES */
2720
+ async deleteReceivedInvoice(userId, organisationId, receivedInvoiceId) {
2721
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoiceId}`;
2722
+ return await this.client.delete(path);
2723
+ }
2724
+ async getReceivedInvoice(userId, organisationId, receivedInvoiceId) {
2725
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoiceId}`;
2726
+ return await this.client.get(path);
2727
+ }
2728
+ async updateReceivedInvoice(userId, organisationId, receivedInvoice) {
2729
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoice.ReceivedInvoiceId}`;
2730
+ return await this.client.put(path, receivedInvoice);
2731
+ }
2732
+ async getReceivedInvoices(userId, organisationId, params) {
2733
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices`;
2734
+ return await this.client.get(path, { params });
2735
+ }
2736
+ async newReceivedInvoice(userId, organisationId, receivedInvoice) {
2737
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices`;
2738
+ return await this.client.post(path, receivedInvoice);
2739
+ }
2740
+ async getReceivedInvoicesAttachments(userId, organisationId, receivedInvoiceId, params) {
2741
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoiceId}/attachments`;
2742
+ return await this.client.get(path, { params });
2743
+ }
2744
+ async newReceivedInvoiceAttachment(userId, organisationId, receivedInvoiceId, attachment) {
2745
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoiceId}/attachments`;
2746
+ return await this.client.post(path, attachment);
2747
+ }
2748
+ /** REPORT TEMPLATES */
2749
+ async getReportTemplates(userId, organisationId, params) {
2750
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/report-templates`;
2751
+ return await this.client.get(path, { params });
2752
+ }
2753
+ async getReportTemplate(userId, organisationId, reportTemplateId) {
2754
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/report-templates/${reportTemplateId}`;
2755
+ return await this.client.get(path);
2756
+ }
2757
+ async getReportTemplatesForSync(userId, organisationId, params) {
2758
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/report-templates/synccandidates`;
2759
+ return await this.client.get(path, { params });
2760
+ }
2761
+ /** STOCK */
2762
+ async getStock(userId, organisationId, params) {
2763
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stocks`;
2764
+ return await this.client.get(path, { params });
2765
+ }
2766
+ async getStockForItem(userId, organisationId, itemId) {
2767
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stocks/${itemId}`;
2768
+ return await this.client.get(path);
2769
+ }
2770
+ /** STOCK ENTRIES */
2771
+ async getStockEntries(userId, organisationId, params) {
2772
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry`;
2773
+ return await this.client.get(path, { params });
2774
+ }
2775
+ async newStockEntry(userId, organisationId, stockEntry) {
2776
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry`;
2777
+ return await this.client.post(path, stockEntry);
2778
+ }
2779
+ async deleteStockEntry(userId, organisationId, stockEntryId) {
2780
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntryId}`;
2781
+ return await this.client.delete(path);
2782
+ }
2783
+ async getStockEntry(userId, organisationId, stockEntryId) {
2784
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntryId}`;
2785
+ return await this.client.get(path);
2786
+ }
2787
+ async updateStockEntry(userId, organisationId, stockEntry) {
2788
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntry.StockEntryId}`;
2789
+ return await this.client.post(path, stockEntry);
2790
+ }
2791
+ async actionGetOnStockEntry(userId, organisationId, stockEntryId, action, params) {
2792
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntryId}/actions/${action}`;
2793
+ return await this.client.get(path, { params });
2794
+ }
2795
+ async actionPutOnStockEntry(userId, organisationId, stockEntryId, action, params) {
2796
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntryId}/actions/${action}`;
2797
+ return await this.client.put(path, {}, { params });
2798
+ }
2799
+ /** USERS */
2800
+ async getCurrentUser(userId) {
2801
+ const path = `/karadjordje/v1/minimax/${userId}/api/currentuser/profile`;
2802
+ return await this.client.get(path);
2803
+ }
2804
+ async getCurrentUserOrgs(userId) {
2805
+ const path = `/karadjordje/v1/minimax/${userId}/api/currentuser/orgs`;
2806
+ return await this.client.get(path);
2807
+ }
2808
+ /** VAT ACCOUNTING TYPES */
2809
+ async getVatAccountingTypes(userId, organisationId, params) {
2810
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vataccountingtypes`;
2811
+ return await this.client.get(path, { params });
2812
+ }
2813
+ async getVatAccountingTypesForSync(userId, organisationId, params) {
2814
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vataccountingtypes/synccandidates`;
2815
+ return await this.client.get(path, { params });
2816
+ }
2817
+ /** VAT RATES */
2818
+ async getVatRates(userId, organisationId, params) {
2819
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vatrates`;
2820
+ return await this.client.get(path, { params });
2821
+ }
2822
+ async getVatRate(userId, organisationId, vatRateId) {
2823
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vatrates/${vatRateId}`;
2824
+ return await this.client.get(path);
2825
+ }
2826
+ async getVatRateByCode(userId, organisationId, code) {
2827
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vatrates/code(${code})`;
2828
+ return await this.client.get(path);
2829
+ }
2830
+ async getVatRatesForSync(userId, organisationId, params) {
2831
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vatrates/synccandidates`;
2832
+ return await this.client.get(path, { params });
2833
+ }
2834
+ /** WAREHOUSES */
2835
+ async getWarehouses(userId, organisationId, params) {
2836
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses`;
2837
+ return await this.client.get(path, { params });
2838
+ }
2839
+ async newWarehouse(userId, organisationId, warehouse) {
2840
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses`;
2841
+ return await this.client.post(path, warehouse);
2842
+ }
2843
+ async deleteWarehouse(userId, organisationId, warehouseId) {
2844
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses/${warehouseId}`;
2845
+ return await this.client.delete(path);
2846
+ }
2847
+ async getWarehouse(userId, organisationId, warehouseId) {
2848
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses/${warehouseId}`;
2849
+ return await this.client.get(path);
2850
+ }
2851
+ async updateWarehouse(userId, organisationId, warehouse) {
2852
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses/${warehouse.WarehouseId}`;
2853
+ return await this.client.put(path, warehouse);
2854
+ }
2855
+ async getWarehousesForSync(userId, organisationId, params) {
2856
+ const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses/synccandidates`;
2857
+ return await this.client.get(path, { params });
1892
2858
  }
1893
2859
  }
1894
2860
 
@@ -1902,6 +2868,7 @@ var ProtokolSDK010 = (function (exports, axios) {
1902
2868
  'protokol-dms': new DMS().setClient(this.client),
1903
2869
  'serbia-utilities': new SerbiaUtil().setClient(this.client),
1904
2870
  'protokol-payments': new Payments().setClient(this.client),
2871
+ 'protokol-minimax': new Minimax().setClient(this.client),
1905
2872
  };
1906
2873
  }
1907
2874
  getSerbiaUtilities() {
@@ -1919,6 +2886,9 @@ var ProtokolSDK010 = (function (exports, axios) {
1919
2886
  getPayments() {
1920
2887
  return this.getInterfaceOf('protokol-payments');
1921
2888
  }
2889
+ getMinimax() {
2890
+ return this.getInterfaceOf('protokol-minimax');
2891
+ }
1922
2892
  async isInstalled(id) {
1923
2893
  const { data } = await this.client.get("/v1/integrations");
1924
2894
  return data.find((i) => i.id == id) !== undefined;
@@ -1945,18 +2915,16 @@ var ProtokolSDK010 = (function (exports, axios) {
1945
2915
  exports.Integrations = Integrations;
1946
2916
  exports.Invoicing = Invoicing;
1947
2917
  exports.Payments = Payments;
2918
+ exports.Platform = Platform;
1948
2919
  exports.Project = Project;
1949
2920
  exports.Ratchet = Ratchet;
1950
2921
  exports.Sandbox = Sandbox;
1951
2922
  exports.SerbiaUtil = SerbiaUtil;
1952
2923
  exports.System = System;
1953
2924
  exports.Thunder = Thunder;
1954
- exports.User = Users;
2925
+ exports.Users = Users;
1955
2926
  exports.VPFR = VPFR;
1956
2927
  exports.Workflow = Workflow;
1957
- exports.default = Platform;
1958
-
1959
- Object.defineProperty(exports, '__esModule', { value: true });
1960
2928
 
1961
2929
  return exports;
1962
2930