@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.
- package/dist/{index.iife.js → index.0.10.js} +1206 -238
- package/dist/index.0.9.js +2849 -0
- package/dist/package.json +12 -7
- package/dist/v0.10/api/component.d.ts +128 -0
- package/dist/v0.10/api/componentUtils.d.ts +7 -0
- package/dist/v0.10/api/index.d.ts +22 -0
- package/dist/v0.10/api/integrations/dms.d.ts +469 -0
- package/dist/v0.10/api/integrations/minimax.d.ts +289 -0
- package/dist/v0.10/api/integrations/payments.d.ts +40 -0
- package/dist/{types → v0.10}/api/integrations.d.ts +2 -0
- package/dist/{types → v0.10}/api/integrationsBaseClient.d.ts +3 -0
- package/dist/{types → v0.10}/api/platform.d.ts +2 -2
- package/dist/v0.10/apiUser.d.ts +9 -0
- package/dist/v0.10/apps.d.ts +8 -0
- package/dist/v0.10/baseClient.d.ts +6 -0
- package/dist/{types/api → v0.10}/component.d.ts +39 -4
- package/dist/v0.10/componentUtils.d.ts +7 -0
- package/dist/v0.10/config.d.ts +14 -0
- package/dist/v0.10/forge.d.ts +7 -0
- package/dist/v0.10/functions.d.ts +23 -0
- package/dist/{index.cjs.js → v0.10/index.cjs.js} +1206 -238
- package/dist/v0.10/index.d.ts +21 -0
- package/dist/{index.esm.js → v0.10/index.esm.js} +1205 -235
- package/dist/{types/api → v0.10}/integrations/dms.d.ts +11 -1
- package/dist/v0.10/integrations/invoicing.d.ts +6 -0
- package/dist/v0.10/integrations/minimax.d.ts +289 -0
- package/dist/v0.10/integrations/payments.d.ts +40 -0
- package/dist/v0.10/integrations/serbiaUtil.d.ts +10 -0
- package/dist/v0.10/integrations/vpfr.d.ts +4 -0
- package/dist/v0.10/integrations.d.ts +22 -0
- package/dist/v0.10/integrationsBaseClient.d.ts +11 -0
- package/dist/v0.10/platform.d.ts +34 -0
- package/dist/v0.10/platformBaseClient.d.ts +27 -0
- package/dist/v0.10/project.d.ts +146 -0
- package/dist/v0.10/ratchet.d.ts +196 -0
- package/dist/v0.10/sandbox.d.ts +14 -0
- package/dist/v0.10/system.d.ts +4 -0
- package/dist/v0.10/thunder.d.ts +13 -0
- package/dist/v0.10/types/component.d.ts +110 -0
- package/dist/{types → v0.10}/types/integrations.d.ts +114 -1
- package/dist/v0.10/users.d.ts +69 -0
- package/dist/v0.10/workflow.d.ts +5 -0
- package/dist/v0.9/api/apiUser.d.ts +9 -0
- package/dist/v0.9/api/apps.d.ts +8 -0
- package/dist/v0.9/api/baseClient.d.ts +6 -0
- package/dist/v0.9/api/component.d.ts +136 -0
- package/dist/v0.9/api/componentUtils.d.ts +7 -0
- package/dist/v0.9/api/config.d.ts +14 -0
- package/dist/v0.9/api/forge.d.ts +7 -0
- package/dist/v0.9/api/functions.d.ts +23 -0
- package/dist/v0.9/api/index.d.ts +24 -0
- package/dist/v0.9/api/integrations/dms.d.ts +419 -0
- package/dist/v0.9/api/integrations/invoicing.d.ts +6 -0
- package/dist/v0.9/api/integrations/minimax.d.ts +289 -0
- package/dist/v0.9/api/integrations/payments.d.ts +40 -0
- package/dist/v0.9/api/integrations/serbiaUtil.d.ts +10 -0
- package/dist/v0.9/api/integrations/vpfr.d.ts +4 -0
- package/dist/v0.9/api/integrations.d.ts +22 -0
- package/dist/v0.9/api/integrationsBaseClient.d.ts +11 -0
- package/dist/v0.9/api/platform.d.ts +34 -0
- package/dist/v0.9/api/platformBaseClient.d.ts +27 -0
- package/dist/v0.9/api/project.d.ts +146 -0
- package/dist/v0.9/api/ratchet.d.ts +196 -0
- package/dist/v0.9/api/sandbox.d.ts +14 -0
- package/dist/v0.9/api/system.d.ts +4 -0
- package/dist/v0.9/api/thunder.d.ts +13 -0
- package/dist/v0.9/api/users.d.ts +69 -0
- package/dist/v0.9/api/workflow.d.ts +5 -0
- package/dist/v0.9/apiUser.d.ts +9 -0
- package/dist/v0.9/apps.d.ts +8 -0
- package/dist/v0.9/baseClient.d.ts +6 -0
- package/dist/v0.9/component.d.ts +128 -0
- package/dist/v0.9/componentUtils.d.ts +7 -0
- package/dist/v0.9/config.d.ts +14 -0
- package/dist/v0.9/forge.d.ts +7 -0
- package/dist/v0.9/functions.d.ts +23 -0
- package/dist/v0.9/index.cjs.js +21811 -0
- package/dist/v0.9/index.d.ts +21 -0
- package/dist/v0.9/index.esm.js +2820 -0
- package/dist/v0.9/integrations/dms.d.ts +469 -0
- package/dist/v0.9/integrations/invoicing.d.ts +6 -0
- package/dist/v0.9/integrations/minimax.d.ts +289 -0
- package/dist/v0.9/integrations/payments.d.ts +40 -0
- package/dist/v0.9/integrations/serbiaUtil.d.ts +10 -0
- package/dist/v0.9/integrations/vpfr.d.ts +4 -0
- package/dist/v0.9/integrations.d.ts +22 -0
- package/dist/v0.9/integrationsBaseClient.d.ts +11 -0
- package/dist/v0.9/platform.d.ts +34 -0
- package/dist/v0.9/platformBaseClient.d.ts +27 -0
- package/dist/v0.9/project.d.ts +146 -0
- package/dist/v0.9/ratchet.d.ts +196 -0
- package/dist/v0.9/sandbox.d.ts +14 -0
- package/dist/v0.9/system.d.ts +4 -0
- package/dist/v0.9/thunder.d.ts +13 -0
- package/dist/v0.9/types/component.d.ts +116 -0
- package/dist/v0.9/types/config.d.ts +11 -0
- package/dist/v0.9/types/integrations.d.ts +321 -0
- package/dist/v0.9/types/project.d.ts +64 -0
- package/dist/v0.9/types/ratchet.d.ts +38 -0
- package/dist/v0.9/types/users.d.ts +66 -0
- package/dist/v0.9/users.d.ts +69 -0
- package/dist/v0.9/util/detectEnv.d.ts +4 -0
- package/dist/v0.9/workflow.d.ts +5 -0
- package/package.json +12 -7
- package/dist/monaco.d.ts +0 -887
- package/dist/types/api/componentUtils.d.ts +0 -5
- package/dist/types/api/index.d.ts +0 -13
- package/dist/types/api/integrations/media.d.ts +0 -17
- package/dist/types/api/integrations/payments.d.ts +0 -7
- package/dist/types/api/roles.d.ts +0 -9
- package/dist/types/index.d.ts +0 -29
- package/dist/types/types/component.d.ts +0 -50
- package/dist/types/types/media.d.ts +0 -103
- /package/dist/{types → v0.10}/api/apiUser.d.ts +0 -0
- /package/dist/{types → v0.10}/api/apps.d.ts +0 -0
- /package/dist/{types → v0.10}/api/baseClient.d.ts +0 -0
- /package/dist/{types → v0.10}/api/config.d.ts +0 -0
- /package/dist/{types → v0.10}/api/forge.d.ts +0 -0
- /package/dist/{types → v0.10}/api/functions.d.ts +0 -0
- /package/dist/{types → v0.10}/api/integrations/invoicing.d.ts +0 -0
- /package/dist/{types → v0.10}/api/integrations/serbiaUtil.d.ts +0 -0
- /package/dist/{types → v0.10}/api/integrations/vpfr.d.ts +0 -0
- /package/dist/{types → v0.10}/api/platformBaseClient.d.ts +0 -0
- /package/dist/{types → v0.10}/api/project.d.ts +0 -0
- /package/dist/{types → v0.10}/api/ratchet.d.ts +0 -0
- /package/dist/{types → v0.10}/api/sandbox.d.ts +0 -0
- /package/dist/{types → v0.10}/api/system.d.ts +0 -0
- /package/dist/{types → v0.10}/api/thunder.d.ts +0 -0
- /package/dist/{types → v0.10}/api/users.d.ts +0 -0
- /package/dist/{types → v0.10}/api/workflow.d.ts +0 -0
- /package/dist/{types → v0.10}/types/config.d.ts +0 -0
- /package/dist/{types → v0.10}/types/project.d.ts +0 -0
- /package/dist/{types → v0.10}/types/ratchet.d.ts +0 -0
- /package/dist/{types → v0.10}/types/users.d.ts +0 -0
- /package/dist/{types → v0.10}/util/detectEnv.d.ts +0 -0
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var require$$1 = require('util');
|
|
6
4
|
var stream = require('stream');
|
|
7
5
|
var require$$1$1 = require('path');
|
|
@@ -19003,27 +19001,32 @@ const isBrowser = typeof window !== "undefined" &&
|
|
|
19003
19001
|
*/
|
|
19004
19002
|
class PlatformBaseClient extends BaseClient {
|
|
19005
19003
|
constructor(options) {
|
|
19006
|
-
var _a, _b, _c;
|
|
19004
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
19007
19005
|
let { env = null, token = null, host = null, } = options !== null && options !== void 0 ? options : {};
|
|
19008
19006
|
let headers = {};
|
|
19009
19007
|
var project_uuid = null;
|
|
19010
19008
|
if (isBrowser) {
|
|
19011
|
-
console.log("PlatformBaseClient: running in browser context");
|
|
19012
19009
|
if (sessionStorage.getItem('protokol_context') == "forge") {
|
|
19013
19010
|
headers['X-Project-Env'] = (_a = sessionStorage.getItem('forge_app_env')) !== null && _a !== void 0 ? _a : "dev";
|
|
19014
19011
|
}
|
|
19015
19012
|
else {
|
|
19016
19013
|
headers['X-Project-Env'] = (_b = localStorage.getItem('current_env')) !== null && _b !== void 0 ? _b : "dev";
|
|
19017
19014
|
}
|
|
19015
|
+
if (typeof window !== "undefined") {
|
|
19016
|
+
// @ts-ignore
|
|
19017
|
+
const __global_env__ = window === null || window === void 0 ? void 0 : window.__ENV_VARIABLES__;
|
|
19018
|
+
host = (_c = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.API_HOST) !== null && _c !== void 0 ? _c : host;
|
|
19019
|
+
// @ts-ignore
|
|
19020
|
+
env = env !== null && env !== void 0 ? env : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_ENV;
|
|
19021
|
+
token = token !== null && token !== void 0 ? token : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_API_TOKEN;
|
|
19022
|
+
project_uuid = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_UUID;
|
|
19023
|
+
}
|
|
19018
19024
|
}
|
|
19019
|
-
if (
|
|
19020
|
-
|
|
19021
|
-
|
|
19022
|
-
|
|
19023
|
-
|
|
19024
|
-
env = env !== null && env !== void 0 ? env : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_ENV;
|
|
19025
|
-
token = token !== null && token !== void 0 ? token : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_API_TOKEN;
|
|
19026
|
-
project_uuid = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_UUID;
|
|
19025
|
+
else if (process && process.env) {
|
|
19026
|
+
host = (_d = host !== null && host !== void 0 ? host : process.env.API_HOST) !== null && _d !== void 0 ? _d : null;
|
|
19027
|
+
env = (_e = env !== null && env !== void 0 ? env : process.env.PROJECT_ENV) !== null && _e !== void 0 ? _e : null;
|
|
19028
|
+
token = (_f = token !== null && token !== void 0 ? token : process.env.PROJECT_API_TOKEN) !== null && _f !== void 0 ? _f : null;
|
|
19029
|
+
project_uuid = (_g = process.env.PROJECT_UUID) !== null && _g !== void 0 ? _g : null;
|
|
19027
19030
|
}
|
|
19028
19031
|
if (token) {
|
|
19029
19032
|
headers['Authorization'] = `Bearer ${token}`;
|
|
@@ -19050,198 +19053,22 @@ class PlatformBaseClient extends BaseClient {
|
|
|
19050
19053
|
}
|
|
19051
19054
|
}
|
|
19052
19055
|
|
|
19053
|
-
class Functions extends PlatformBaseClient {
|
|
19054
|
-
async list() {
|
|
19055
|
-
return await this.client.get("/v1/system/function");
|
|
19056
|
-
}
|
|
19057
|
-
async get(ref) {
|
|
19058
|
-
return await this.client.get(`/v1/system/function/${ref}`);
|
|
19059
|
-
}
|
|
19060
|
-
async update(uuid, update) {
|
|
19061
|
-
return await this.client.patch(`/v1/system/function/${uuid}`, update);
|
|
19062
|
-
}
|
|
19063
|
-
/**
|
|
19064
|
-
* Run platform function
|
|
19065
|
-
*
|
|
19066
|
-
* @param id - Function ID
|
|
19067
|
-
* @param input - Input data
|
|
19068
|
-
* @param query - Query parameters
|
|
19069
|
-
* @returns - Function result
|
|
19070
|
-
*
|
|
19071
|
-
* @example
|
|
19072
|
-
* const result = await platform.function().run("myFunction", {input: { foo: "bar" }})
|
|
19073
|
-
*/
|
|
19074
|
-
async run(id, d) {
|
|
19075
|
-
const { data } = await this.client.post(`/v1/system/function/run/${id}`, d.input, {
|
|
19076
|
-
params: d.query,
|
|
19077
|
-
headers: d.headers
|
|
19078
|
-
});
|
|
19079
|
-
return data;
|
|
19080
|
-
}
|
|
19081
|
-
async generateSignature(ref, env) {
|
|
19082
|
-
return await this.client.get(`/v1/system/function/signature/${env}/${ref}`);
|
|
19083
|
-
}
|
|
19084
|
-
}
|
|
19085
|
-
|
|
19086
|
-
class APIUser extends PlatformBaseClient {
|
|
19087
|
-
async auth(username, password, project) {
|
|
19088
|
-
return this.client.post("/v1/user/api/auth", {
|
|
19089
|
-
username,
|
|
19090
|
-
password
|
|
19091
|
-
}, {
|
|
19092
|
-
headers: {
|
|
19093
|
-
"X-Project-Uuid": project
|
|
19094
|
-
}
|
|
19095
|
-
});
|
|
19096
|
-
}
|
|
19097
|
-
async newSecret(uuid) {
|
|
19098
|
-
return await this.client.post(`/v1/user/api-user/secret/${uuid}`, {});
|
|
19099
|
-
}
|
|
19100
|
-
async revokeSecret(uuid) {
|
|
19101
|
-
return await this.client.delete(`/v1/user/api-user/secret/${uuid}`);
|
|
19102
|
-
}
|
|
19103
|
-
async edit(uuid, roles) {
|
|
19104
|
-
return await this.client.patch(`/v1/user/api-user/${uuid}`, { roles });
|
|
19105
|
-
}
|
|
19106
|
-
async list() {
|
|
19107
|
-
return await this.client.get(`/v1/user/api-user`);
|
|
19108
|
-
}
|
|
19109
|
-
async get(uuid) {
|
|
19110
|
-
return await this.client.get(`/v1/user/api-user/${uuid}`);
|
|
19111
|
-
}
|
|
19112
|
-
}
|
|
19113
|
-
|
|
19114
|
-
class Users extends PlatformBaseClient {
|
|
19115
|
-
async auth(username, password, project) {
|
|
19116
|
-
return await this.client.post("/v1/user/login", {
|
|
19117
|
-
username,
|
|
19118
|
-
password,
|
|
19119
|
-
response_type: 'token',
|
|
19120
|
-
}, {
|
|
19121
|
-
headers: {
|
|
19122
|
-
'X-Project-Uuid': project
|
|
19123
|
-
}
|
|
19124
|
-
});
|
|
19125
|
-
}
|
|
19126
|
-
/**
|
|
19127
|
-
* Resend confirmation email
|
|
19128
|
-
* @param email User email
|
|
19129
|
-
*/
|
|
19130
|
-
async resendConfirmationEmail(email) {
|
|
19131
|
-
return await this.client.post("/v1/user/send/confirmation/email", {
|
|
19132
|
-
email,
|
|
19133
|
-
});
|
|
19134
|
-
}
|
|
19135
|
-
// Password Reset (Request Only)
|
|
19136
|
-
// Note: Only the REQUEST is exposed, not the password reset completion
|
|
19137
|
-
// The actual password reset should be done through the official web interface
|
|
19138
|
-
/**
|
|
19139
|
-
* Request password reset email
|
|
19140
|
-
* This only sends an email with a reset link, does not expose or change passwords
|
|
19141
|
-
* @param email User email
|
|
19142
|
-
*/
|
|
19143
|
-
async requestPasswordReset(email) {
|
|
19144
|
-
return await this.client.post("/v1/user/resetpassword", { email });
|
|
19145
|
-
}
|
|
19146
|
-
// User Profile & Management
|
|
19147
|
-
/**
|
|
19148
|
-
* Get current user's model
|
|
19149
|
-
*/
|
|
19150
|
-
async getUser() {
|
|
19151
|
-
return await this.client.get("/v1/user/model");
|
|
19152
|
-
}
|
|
19153
|
-
/**
|
|
19154
|
-
* Get current user's claims
|
|
19155
|
-
*/
|
|
19156
|
-
async getClaims() {
|
|
19157
|
-
return await this.client.get("/v1/user/claims");
|
|
19158
|
-
}
|
|
19159
|
-
/**
|
|
19160
|
-
* Edit user profile
|
|
19161
|
-
* @param data Profile update data
|
|
19162
|
-
*/
|
|
19163
|
-
async editProfile(data) {
|
|
19164
|
-
return await this.client.post("/v1/user/profile/edit", data);
|
|
19165
|
-
}
|
|
19166
|
-
// Permissions & Roles
|
|
19167
|
-
/**
|
|
19168
|
-
* Get user permissions
|
|
19169
|
-
*/
|
|
19170
|
-
async getPermissions() {
|
|
19171
|
-
return await this.client.get("/v1/user/role/permissions");
|
|
19172
|
-
}
|
|
19173
|
-
/**
|
|
19174
|
-
* Get list of available permissions
|
|
19175
|
-
*/
|
|
19176
|
-
async listPermissions() {
|
|
19177
|
-
return await this.client.get("/v1/user/permissions/list");
|
|
19178
|
-
}
|
|
19179
|
-
/**
|
|
19180
|
-
* Create a new role
|
|
19181
|
-
* @param role Role data including name, permissions, workspaces, and level
|
|
19182
|
-
*/
|
|
19183
|
-
async createRole(role) {
|
|
19184
|
-
return await this.client.post("/v1/user/role/create", role);
|
|
19185
|
-
}
|
|
19186
|
-
/**
|
|
19187
|
-
* Delete a role
|
|
19188
|
-
* @param uuid Role UUID
|
|
19189
|
-
*/
|
|
19190
|
-
async deleteRole(uuid) {
|
|
19191
|
-
return await this.client.delete(`/v1/user/role/delete/${uuid}`);
|
|
19192
|
-
}
|
|
19193
|
-
/**
|
|
19194
|
-
* List all roles
|
|
19195
|
-
*/
|
|
19196
|
-
async listRoles() {
|
|
19197
|
-
return await this.client.get(`/v1/user/role/list`);
|
|
19198
|
-
}
|
|
19199
|
-
/**
|
|
19200
|
-
* Get role details by UUID
|
|
19201
|
-
* @param uuid Role UUID
|
|
19202
|
-
*/
|
|
19203
|
-
async getRoleModel(uuid) {
|
|
19204
|
-
return await this.client.get(`/v1/user/role/edit/${uuid}`);
|
|
19205
|
-
}
|
|
19206
|
-
/**
|
|
19207
|
-
* Edit a role
|
|
19208
|
-
* @param uuid Role UUID
|
|
19209
|
-
* @param data Role update data including permissions, workspaces, and level
|
|
19210
|
-
*/
|
|
19211
|
-
async editRole(uuid, data) {
|
|
19212
|
-
return await this.client.post(`/v1/user/role/edit/${uuid}`, data);
|
|
19213
|
-
}
|
|
19214
|
-
/**
|
|
19215
|
-
* @deprecated Use getPermissions() instead
|
|
19216
|
-
*/
|
|
19217
|
-
async permissions() {
|
|
19218
|
-
return await this.client.get(`/v1/user/role/permissions`);
|
|
19219
|
-
}
|
|
19220
|
-
}
|
|
19221
|
-
|
|
19222
|
-
class Apps extends PlatformBaseClient {
|
|
19223
|
-
constructor(appType) {
|
|
19224
|
-
super();
|
|
19225
|
-
this.appType = appType;
|
|
19226
|
-
}
|
|
19227
|
-
async updateSettings(updateValues, ref) {
|
|
19228
|
-
const payload = { ...updateValues };
|
|
19229
|
-
return await this.client.put(`/v3/system/gateway/app-service/${this.appType}/${ref}/settings`, payload);
|
|
19230
|
-
}
|
|
19231
|
-
async download(ref, version) {
|
|
19232
|
-
return await this.client.post(`/v3/system/gateway/app-service/${this.appType}/download`, { version, uuid: ref }, { responseType: "arraybuffer" });
|
|
19233
|
-
}
|
|
19234
|
-
async upload(formData) {
|
|
19235
|
-
return await this.client.post(`/v3/system/gateway/app-service/${this.appType}/upload`, formData, {
|
|
19236
|
-
timeout: 60000
|
|
19237
|
-
});
|
|
19238
|
-
}
|
|
19239
|
-
}
|
|
19240
|
-
|
|
19241
19056
|
class Component extends PlatformBaseClient {
|
|
19242
|
-
constructor(ref = null) {
|
|
19057
|
+
constructor(ref = null, options) {
|
|
19058
|
+
var _a;
|
|
19243
19059
|
super();
|
|
19244
19060
|
this.ref = ref;
|
|
19061
|
+
this.version = (_a = options === null || options === void 0 ? void 0 : options.version) !== null && _a !== void 0 ? _a : null;
|
|
19062
|
+
}
|
|
19063
|
+
/**
|
|
19064
|
+
* Get the base path for component API calls
|
|
19065
|
+
* @private
|
|
19066
|
+
*/
|
|
19067
|
+
getComponentPath() {
|
|
19068
|
+
if (this.version) {
|
|
19069
|
+
return `/v3/system/component/${this.ref}/v/${this.version}`;
|
|
19070
|
+
}
|
|
19071
|
+
return `/v3/system/component/${this.ref}`;
|
|
19245
19072
|
}
|
|
19246
19073
|
/**
|
|
19247
19074
|
* Find method to search for models
|
|
@@ -19311,7 +19138,7 @@ class Component extends PlatformBaseClient {
|
|
|
19311
19138
|
params[`_opt_${k}`] = opts ? opts[k] : null;
|
|
19312
19139
|
});
|
|
19313
19140
|
}
|
|
19314
|
-
return await this.client.get(
|
|
19141
|
+
return await this.client.get(`${this.getComponentPath()}/models`, {
|
|
19315
19142
|
params: params,
|
|
19316
19143
|
headers: {
|
|
19317
19144
|
'X-Cache': cache,
|
|
@@ -19350,7 +19177,7 @@ class Component extends PlatformBaseClient {
|
|
|
19350
19177
|
* @returns (Promise<Model>)
|
|
19351
19178
|
*/
|
|
19352
19179
|
async get(uuid) {
|
|
19353
|
-
return await this.client.get(
|
|
19180
|
+
return await this.client.get(`${this.getComponentPath()}/model/${uuid}`);
|
|
19354
19181
|
}
|
|
19355
19182
|
/**
|
|
19356
19183
|
* Update model by uuid
|
|
@@ -19360,7 +19187,7 @@ class Component extends PlatformBaseClient {
|
|
|
19360
19187
|
* @returns
|
|
19361
19188
|
*/
|
|
19362
19189
|
async update(uuid, data, options) {
|
|
19363
|
-
return await this.client.post(
|
|
19190
|
+
return await this.client.post(`${this.getComponentPath()}/model/${uuid}`, {
|
|
19364
19191
|
data,
|
|
19365
19192
|
options,
|
|
19366
19193
|
});
|
|
@@ -19373,9 +19200,9 @@ class Component extends PlatformBaseClient {
|
|
|
19373
19200
|
* @returns
|
|
19374
19201
|
*/
|
|
19375
19202
|
async updateMany(data, options) {
|
|
19376
|
-
return await this.client.
|
|
19203
|
+
return await this.client.patch(`${this.getComponentPath()}/models/bulk`, {
|
|
19377
19204
|
data,
|
|
19378
|
-
options
|
|
19205
|
+
options
|
|
19379
19206
|
});
|
|
19380
19207
|
}
|
|
19381
19208
|
/**
|
|
@@ -19386,7 +19213,7 @@ class Component extends PlatformBaseClient {
|
|
|
19386
19213
|
* @returns
|
|
19387
19214
|
*/
|
|
19388
19215
|
async modify(filters, data, options) {
|
|
19389
|
-
return await this.client.patch(
|
|
19216
|
+
return await this.client.patch(`${this.getComponentPath()}/modify/model`, {
|
|
19390
19217
|
filters,
|
|
19391
19218
|
data,
|
|
19392
19219
|
options,
|
|
@@ -19401,20 +19228,84 @@ class Component extends PlatformBaseClient {
|
|
|
19401
19228
|
* @returns
|
|
19402
19229
|
*/
|
|
19403
19230
|
async concurrentUpdate(uuid, version, data, options) {
|
|
19404
|
-
return await this.client.post(
|
|
19231
|
+
return await this.client.post(`${this.getComponentPath()}/model/${uuid}`, {
|
|
19405
19232
|
version: version,
|
|
19406
19233
|
data,
|
|
19407
19234
|
options,
|
|
19408
19235
|
});
|
|
19409
19236
|
}
|
|
19410
19237
|
async create(model) {
|
|
19411
|
-
return await this.client.post(
|
|
19238
|
+
return await this.client.post(`${this.getComponentPath()}/model`, model);
|
|
19412
19239
|
}
|
|
19413
19240
|
async delete(uuid) {
|
|
19414
|
-
return await this.client.delete(
|
|
19241
|
+
return await this.client.delete(`${this.getComponentPath()}/model/${uuid}`);
|
|
19415
19242
|
}
|
|
19416
|
-
|
|
19417
|
-
|
|
19243
|
+
/**
|
|
19244
|
+
* Execute aggregate pipeline with optional streaming support
|
|
19245
|
+
*
|
|
19246
|
+
* Returns a chainable object that allows both buffered and streaming modes.
|
|
19247
|
+
* Call .onData() to enable streaming mode, or await directly for buffered mode.
|
|
19248
|
+
*
|
|
19249
|
+
* @param {FindAggregateParams} pipeline - MongoDB aggregation pipeline
|
|
19250
|
+
*
|
|
19251
|
+
* @returns {AggregateChainable} Chainable object with streaming methods and Promise interface
|
|
19252
|
+
*
|
|
19253
|
+
* @example
|
|
19254
|
+
* ```typescript
|
|
19255
|
+
* // Buffered response (default, up to 5K documents)
|
|
19256
|
+
* const result = await component.aggregate([{ $match: { status: 'active' } }]);
|
|
19257
|
+
* console.log(result.data); // All results at once
|
|
19258
|
+
*
|
|
19259
|
+
* // Streaming response (up to 25K documents)
|
|
19260
|
+
* await component.aggregate([{ $match: { status: 'active' } }])
|
|
19261
|
+
* .onData((doc) => console.log('Received:', doc))
|
|
19262
|
+
* .onError((err) => console.error('Error:', err))
|
|
19263
|
+
* .onEnd(() => console.log('Stream complete'));
|
|
19264
|
+
* ```
|
|
19265
|
+
*/
|
|
19266
|
+
aggregate(pipeline) {
|
|
19267
|
+
let onDataCallback = () => { };
|
|
19268
|
+
let onErrorCallback;
|
|
19269
|
+
let onEndCallback;
|
|
19270
|
+
let isStreaming = false;
|
|
19271
|
+
let streamPromise = null;
|
|
19272
|
+
const chainable = {
|
|
19273
|
+
onData: (callback) => {
|
|
19274
|
+
onDataCallback = callback;
|
|
19275
|
+
isStreaming = true;
|
|
19276
|
+
return chainable;
|
|
19277
|
+
},
|
|
19278
|
+
onError: (callback) => {
|
|
19279
|
+
onErrorCallback = callback;
|
|
19280
|
+
return chainable;
|
|
19281
|
+
},
|
|
19282
|
+
onEnd: (callback) => {
|
|
19283
|
+
onEndCallback = callback;
|
|
19284
|
+
return chainable;
|
|
19285
|
+
},
|
|
19286
|
+
then: (resolve, reject) => {
|
|
19287
|
+
if (isStreaming) {
|
|
19288
|
+
if (!streamPromise) {
|
|
19289
|
+
const handler = {
|
|
19290
|
+
onData: onDataCallback,
|
|
19291
|
+
onError: onErrorCallback,
|
|
19292
|
+
onEnd: onEndCallback
|
|
19293
|
+
};
|
|
19294
|
+
streamPromise = this._streamNDJSON(`${this.getComponentPath()}/aggregate`, {
|
|
19295
|
+
'Accept': 'application/x-ndjson',
|
|
19296
|
+
'Content-Type': 'application/json'
|
|
19297
|
+
}, handler, pipeline);
|
|
19298
|
+
}
|
|
19299
|
+
return streamPromise.then(resolve, reject);
|
|
19300
|
+
}
|
|
19301
|
+
return this.client.post(`${this.getComponentPath()}/aggregate`, pipeline)
|
|
19302
|
+
.then(resolve, reject);
|
|
19303
|
+
},
|
|
19304
|
+
catch: (reject) => {
|
|
19305
|
+
return chainable.then(undefined, reject);
|
|
19306
|
+
}
|
|
19307
|
+
};
|
|
19308
|
+
return chainable;
|
|
19418
19309
|
}
|
|
19419
19310
|
async settings() {
|
|
19420
19311
|
return await this.client.get(`/v3/system/component/settings/${this.ref}`);
|
|
@@ -19432,18 +19323,281 @@ class Component extends PlatformBaseClient {
|
|
|
19432
19323
|
});
|
|
19433
19324
|
}
|
|
19434
19325
|
async workflow(event, input) {
|
|
19435
|
-
return await this.client.post(
|
|
19326
|
+
return await this.client.post(`${this.getComponentPath()}/workflow/event`, {
|
|
19436
19327
|
event,
|
|
19437
19328
|
input
|
|
19438
19329
|
});
|
|
19439
19330
|
}
|
|
19440
19331
|
async function(name, input) {
|
|
19441
|
-
return await this.client.post(
|
|
19332
|
+
return await this.client.post(`${this.getComponentPath()}/function/${name}`, {
|
|
19442
19333
|
data: input
|
|
19443
19334
|
});
|
|
19444
19335
|
}
|
|
19445
19336
|
async revisions(uuid) {
|
|
19446
|
-
return await this.client.get(
|
|
19337
|
+
return await this.client.get(`${this.getComponentPath()}/model/${uuid}/revisions`);
|
|
19338
|
+
}
|
|
19339
|
+
/**
|
|
19340
|
+
* Internal method to handle NDJSON streaming responses
|
|
19341
|
+
*
|
|
19342
|
+
* @private
|
|
19343
|
+
*/
|
|
19344
|
+
async _streamNDJSON(url, headers, handler, body) {
|
|
19345
|
+
try {
|
|
19346
|
+
const config = {
|
|
19347
|
+
headers,
|
|
19348
|
+
responseType: 'stream'
|
|
19349
|
+
};
|
|
19350
|
+
const response = await this.client.post(url, body, config);
|
|
19351
|
+
const stream = response.data;
|
|
19352
|
+
let buffer = '';
|
|
19353
|
+
return new Promise((resolve, reject) => {
|
|
19354
|
+
stream.on('data', (chunk) => {
|
|
19355
|
+
buffer += chunk.toString();
|
|
19356
|
+
// Process complete lines (separated by newlines)
|
|
19357
|
+
const lines = buffer.split('\n');
|
|
19358
|
+
buffer = lines.pop() || ''; // Keep incomplete line in buffer
|
|
19359
|
+
for (const line of lines) {
|
|
19360
|
+
if (line.trim()) {
|
|
19361
|
+
try {
|
|
19362
|
+
const document = JSON.parse(line);
|
|
19363
|
+
const result = handler.onData(document);
|
|
19364
|
+
// Support async callbacks
|
|
19365
|
+
if (result instanceof Promise) {
|
|
19366
|
+
result.catch((err) => {
|
|
19367
|
+
if (handler.onError) {
|
|
19368
|
+
handler.onError(err);
|
|
19369
|
+
}
|
|
19370
|
+
});
|
|
19371
|
+
}
|
|
19372
|
+
}
|
|
19373
|
+
catch (err) {
|
|
19374
|
+
if (handler.onError) {
|
|
19375
|
+
handler.onError(err);
|
|
19376
|
+
}
|
|
19377
|
+
}
|
|
19378
|
+
}
|
|
19379
|
+
}
|
|
19380
|
+
});
|
|
19381
|
+
stream.on('end', () => {
|
|
19382
|
+
// Process any remaining data in buffer
|
|
19383
|
+
if (buffer.trim()) {
|
|
19384
|
+
try {
|
|
19385
|
+
const document = JSON.parse(buffer);
|
|
19386
|
+
handler.onData(document);
|
|
19387
|
+
}
|
|
19388
|
+
catch (err) {
|
|
19389
|
+
if (handler.onError) {
|
|
19390
|
+
handler.onError(err);
|
|
19391
|
+
}
|
|
19392
|
+
}
|
|
19393
|
+
}
|
|
19394
|
+
if (handler.onEnd) {
|
|
19395
|
+
handler.onEnd();
|
|
19396
|
+
}
|
|
19397
|
+
resolve();
|
|
19398
|
+
});
|
|
19399
|
+
stream.on('error', (err) => {
|
|
19400
|
+
if (handler.onError) {
|
|
19401
|
+
handler.onError(err);
|
|
19402
|
+
}
|
|
19403
|
+
reject(err);
|
|
19404
|
+
});
|
|
19405
|
+
});
|
|
19406
|
+
}
|
|
19407
|
+
catch (err) {
|
|
19408
|
+
if (handler.onError) {
|
|
19409
|
+
handler.onError(err);
|
|
19410
|
+
}
|
|
19411
|
+
throw err;
|
|
19412
|
+
}
|
|
19413
|
+
}
|
|
19414
|
+
}
|
|
19415
|
+
|
|
19416
|
+
class Functions extends PlatformBaseClient {
|
|
19417
|
+
async list() {
|
|
19418
|
+
return await this.client.get("/v1/system/function");
|
|
19419
|
+
}
|
|
19420
|
+
async get(ref) {
|
|
19421
|
+
return await this.client.get(`/v1/system/function/${ref}`);
|
|
19422
|
+
}
|
|
19423
|
+
async update(uuid, update) {
|
|
19424
|
+
return await this.client.patch(`/v1/system/function/${uuid}`, update);
|
|
19425
|
+
}
|
|
19426
|
+
/**
|
|
19427
|
+
* Run platform function
|
|
19428
|
+
*
|
|
19429
|
+
* @param id - Function ID
|
|
19430
|
+
* @param input - Input data
|
|
19431
|
+
* @param query - Query parameters
|
|
19432
|
+
* @returns - Function result
|
|
19433
|
+
*
|
|
19434
|
+
* @example
|
|
19435
|
+
* const result = await platform.function().run("myFunction", {input: { foo: "bar" }})
|
|
19436
|
+
*/
|
|
19437
|
+
async run(id, d) {
|
|
19438
|
+
const { data } = await this.client.post(`/v1/system/function/run/${id}`, d.input, {
|
|
19439
|
+
params: d.query,
|
|
19440
|
+
headers: d.headers
|
|
19441
|
+
});
|
|
19442
|
+
return data;
|
|
19443
|
+
}
|
|
19444
|
+
async generateSignature(ref, env) {
|
|
19445
|
+
return await this.client.get(`/v1/system/function/signature/${env}/${ref}`);
|
|
19446
|
+
}
|
|
19447
|
+
}
|
|
19448
|
+
|
|
19449
|
+
class APIUser extends PlatformBaseClient {
|
|
19450
|
+
async auth(username, password, project) {
|
|
19451
|
+
return this.client.post("/v1/user/api/auth", {
|
|
19452
|
+
username,
|
|
19453
|
+
password
|
|
19454
|
+
}, {
|
|
19455
|
+
headers: {
|
|
19456
|
+
"X-Project-Uuid": project
|
|
19457
|
+
}
|
|
19458
|
+
});
|
|
19459
|
+
}
|
|
19460
|
+
async newSecret(uuid) {
|
|
19461
|
+
return await this.client.post(`/v1/user/api-user/secret/${uuid}`, {});
|
|
19462
|
+
}
|
|
19463
|
+
async revokeSecret(uuid) {
|
|
19464
|
+
return await this.client.delete(`/v1/user/api-user/secret/${uuid}`);
|
|
19465
|
+
}
|
|
19466
|
+
async edit(uuid, roles) {
|
|
19467
|
+
return await this.client.patch(`/v1/user/api-user/${uuid}`, { roles });
|
|
19468
|
+
}
|
|
19469
|
+
async list() {
|
|
19470
|
+
return await this.client.get(`/v1/user/api-user`);
|
|
19471
|
+
}
|
|
19472
|
+
async get(uuid) {
|
|
19473
|
+
return await this.client.get(`/v1/user/api-user/${uuid}`);
|
|
19474
|
+
}
|
|
19475
|
+
}
|
|
19476
|
+
|
|
19477
|
+
class Users extends PlatformBaseClient {
|
|
19478
|
+
async auth(username, password, project) {
|
|
19479
|
+
return await this.client.post("/v1/user/login", {
|
|
19480
|
+
username,
|
|
19481
|
+
password,
|
|
19482
|
+
response_type: 'token',
|
|
19483
|
+
}, {
|
|
19484
|
+
headers: {
|
|
19485
|
+
'X-Project-Uuid': project
|
|
19486
|
+
}
|
|
19487
|
+
});
|
|
19488
|
+
}
|
|
19489
|
+
/**
|
|
19490
|
+
* Resend confirmation email
|
|
19491
|
+
* @param email User email
|
|
19492
|
+
*/
|
|
19493
|
+
async resendConfirmationEmail(email) {
|
|
19494
|
+
return await this.client.post("/v1/user/send/confirmation/email", {
|
|
19495
|
+
email,
|
|
19496
|
+
});
|
|
19497
|
+
}
|
|
19498
|
+
// Password Reset (Request Only)
|
|
19499
|
+
// Note: Only the REQUEST is exposed, not the password reset completion
|
|
19500
|
+
// The actual password reset should be done through the official web interface
|
|
19501
|
+
/**
|
|
19502
|
+
* Request password reset email
|
|
19503
|
+
* This only sends an email with a reset link, does not expose or change passwords
|
|
19504
|
+
* @param email User email
|
|
19505
|
+
*/
|
|
19506
|
+
async requestPasswordReset(email) {
|
|
19507
|
+
return await this.client.post("/v1/user/resetpassword", { email });
|
|
19508
|
+
}
|
|
19509
|
+
// User Profile & Management
|
|
19510
|
+
/**
|
|
19511
|
+
* Get current user's model
|
|
19512
|
+
*/
|
|
19513
|
+
async getUser() {
|
|
19514
|
+
return await this.client.get("/v1/user/model");
|
|
19515
|
+
}
|
|
19516
|
+
/**
|
|
19517
|
+
* Get current user's claims
|
|
19518
|
+
*/
|
|
19519
|
+
async getClaims() {
|
|
19520
|
+
return await this.client.get("/v1/user/claims");
|
|
19521
|
+
}
|
|
19522
|
+
/**
|
|
19523
|
+
* Edit user profile
|
|
19524
|
+
* @param data Profile update data
|
|
19525
|
+
*/
|
|
19526
|
+
async editProfile(data) {
|
|
19527
|
+
return await this.client.post("/v1/user/profile/edit", data);
|
|
19528
|
+
}
|
|
19529
|
+
// Permissions & Roles
|
|
19530
|
+
/**
|
|
19531
|
+
* Get user permissions
|
|
19532
|
+
*/
|
|
19533
|
+
async getPermissions() {
|
|
19534
|
+
return await this.client.get("/v1/user/role/permissions");
|
|
19535
|
+
}
|
|
19536
|
+
/**
|
|
19537
|
+
* Get list of available permissions
|
|
19538
|
+
*/
|
|
19539
|
+
async listPermissions() {
|
|
19540
|
+
return await this.client.get("/v1/user/permissions/list");
|
|
19541
|
+
}
|
|
19542
|
+
/**
|
|
19543
|
+
* Create a new role
|
|
19544
|
+
* @param role Role data including name, permissions, workspaces, and level
|
|
19545
|
+
*/
|
|
19546
|
+
async createRole(role) {
|
|
19547
|
+
return await this.client.post("/v1/user/role/create", role);
|
|
19548
|
+
}
|
|
19549
|
+
/**
|
|
19550
|
+
* Delete a role
|
|
19551
|
+
* @param uuid Role UUID
|
|
19552
|
+
*/
|
|
19553
|
+
async deleteRole(uuid) {
|
|
19554
|
+
return await this.client.delete(`/v1/user/role/delete/${uuid}`);
|
|
19555
|
+
}
|
|
19556
|
+
/**
|
|
19557
|
+
* List all roles
|
|
19558
|
+
*/
|
|
19559
|
+
async listRoles() {
|
|
19560
|
+
return await this.client.get(`/v1/user/role/list`);
|
|
19561
|
+
}
|
|
19562
|
+
/**
|
|
19563
|
+
* Get role details by UUID
|
|
19564
|
+
* @param uuid Role UUID
|
|
19565
|
+
*/
|
|
19566
|
+
async getRoleModel(uuid) {
|
|
19567
|
+
return await this.client.get(`/v1/user/role/edit/${uuid}`);
|
|
19568
|
+
}
|
|
19569
|
+
/**
|
|
19570
|
+
* Edit a role
|
|
19571
|
+
* @param uuid Role UUID
|
|
19572
|
+
* @param data Role update data including permissions, workspaces, and level
|
|
19573
|
+
*/
|
|
19574
|
+
async editRole(uuid, data) {
|
|
19575
|
+
return await this.client.post(`/v1/user/role/edit/${uuid}`, data);
|
|
19576
|
+
}
|
|
19577
|
+
/**
|
|
19578
|
+
* @deprecated Use getPermissions() instead
|
|
19579
|
+
*/
|
|
19580
|
+
async permissions() {
|
|
19581
|
+
return await this.client.get(`/v1/user/role/permissions`);
|
|
19582
|
+
}
|
|
19583
|
+
}
|
|
19584
|
+
|
|
19585
|
+
class Apps extends PlatformBaseClient {
|
|
19586
|
+
constructor(appType) {
|
|
19587
|
+
super();
|
|
19588
|
+
this.appType = appType;
|
|
19589
|
+
}
|
|
19590
|
+
async updateSettings(updateValues, ref) {
|
|
19591
|
+
const payload = { ...updateValues };
|
|
19592
|
+
return await this.client.put(`/v3/system/gateway/app-service/${this.appType}/${ref}/settings`, payload);
|
|
19593
|
+
}
|
|
19594
|
+
async download(ref, version) {
|
|
19595
|
+
return await this.client.post(`/v3/system/gateway/app-service/${this.appType}/download`, { version, uuid: ref }, { responseType: "arraybuffer" });
|
|
19596
|
+
}
|
|
19597
|
+
async upload(formData) {
|
|
19598
|
+
return await this.client.post(`/v3/system/gateway/app-service/${this.appType}/upload`, formData, {
|
|
19599
|
+
timeout: 60000
|
|
19600
|
+
});
|
|
19447
19601
|
}
|
|
19448
19602
|
}
|
|
19449
19603
|
|
|
@@ -19978,8 +20132,8 @@ class Platform extends PlatformBaseClient {
|
|
|
19978
20132
|
forge() {
|
|
19979
20133
|
return (new Forge()).setClient(this.client);
|
|
19980
20134
|
}
|
|
19981
|
-
component(ref) {
|
|
19982
|
-
return (new Component(ref)).setClient(this.client);
|
|
20135
|
+
component(ref, options) {
|
|
20136
|
+
return (new Component(ref, options)).setClient(this.client);
|
|
19983
20137
|
}
|
|
19984
20138
|
componentUtils() {
|
|
19985
20139
|
return (new ComponentUtils()).setClient(this.client);
|
|
@@ -20034,8 +20188,8 @@ class Invoicing extends PlatformBaseClient {
|
|
|
20034
20188
|
|
|
20035
20189
|
class IntegrationsBaseClient extends BaseClient {
|
|
20036
20190
|
constructor(options) {
|
|
20037
|
-
var _a, _b, _c;
|
|
20038
|
-
let { env = null, token, host, } = options !== null && options !== void 0 ? options : {};
|
|
20191
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
20192
|
+
let { env = null, token = null, host = null, } = options !== null && options !== void 0 ? options : {};
|
|
20039
20193
|
let headers = {};
|
|
20040
20194
|
var project_uuid = null;
|
|
20041
20195
|
if (isBrowser) {
|
|
@@ -20045,16 +20199,22 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
20045
20199
|
else {
|
|
20046
20200
|
headers['X-Project-Env'] = (_b = localStorage.getItem('current_env')) !== null && _b !== void 0 ? _b : "dev";
|
|
20047
20201
|
}
|
|
20202
|
+
if (typeof window !== "undefined") {
|
|
20203
|
+
// @ts-ignore
|
|
20204
|
+
const __global_env__ = window === null || window === void 0 ? void 0 : window.__ENV_VARIABLES__;
|
|
20205
|
+
host = (_c = __global_env__.INTEGRATION_API) !== null && _c !== void 0 ? _c : host;
|
|
20206
|
+
// @ts-ignore
|
|
20207
|
+
token = token !== null && token !== void 0 ? token : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_API_TOKEN;
|
|
20208
|
+
// @ts-ignore
|
|
20209
|
+
env = env !== null && env !== void 0 ? env : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_ENV;
|
|
20210
|
+
project_uuid = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_UUID;
|
|
20211
|
+
}
|
|
20048
20212
|
}
|
|
20049
|
-
if (
|
|
20050
|
-
|
|
20051
|
-
|
|
20052
|
-
|
|
20053
|
-
|
|
20054
|
-
token = token !== null && token !== void 0 ? token : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_API_TOKEN;
|
|
20055
|
-
// @ts-ignore
|
|
20056
|
-
env = env !== null && env !== void 0 ? env : __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_ENV;
|
|
20057
|
-
project_uuid = __global_env__ === null || __global_env__ === void 0 ? void 0 : __global_env__.PROJECT_UUID;
|
|
20213
|
+
else if (process && process.env) {
|
|
20214
|
+
host = (_d = host !== null && host !== void 0 ? host : process.env.API_HOST) !== null && _d !== void 0 ? _d : null;
|
|
20215
|
+
env = (_e = env !== null && env !== void 0 ? env : process.env.PROJECT_ENV) !== null && _e !== void 0 ? _e : null;
|
|
20216
|
+
token = (_f = token !== null && token !== void 0 ? token : process.env.PROJECT_API_TOKEN) !== null && _f !== void 0 ? _f : null;
|
|
20217
|
+
project_uuid = (_g = process.env.PROJECT_UUID) !== null && _g !== void 0 ? _g : null;
|
|
20058
20218
|
}
|
|
20059
20219
|
if (token) {
|
|
20060
20220
|
headers['Authorization'] = `Bearer ${token}`;
|
|
@@ -20074,6 +20234,9 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
20074
20234
|
withCredentials: true,
|
|
20075
20235
|
});
|
|
20076
20236
|
super(client);
|
|
20237
|
+
this.env = null;
|
|
20238
|
+
this.token = null;
|
|
20239
|
+
this.host = null;
|
|
20077
20240
|
}
|
|
20078
20241
|
}
|
|
20079
20242
|
|
|
@@ -20312,6 +20475,38 @@ class DMS extends IntegrationsBaseClient {
|
|
|
20312
20475
|
async dirs(data) {
|
|
20313
20476
|
return await this.request("POST", `media/library/dirs`, { data });
|
|
20314
20477
|
}
|
|
20478
|
+
// ===================================================================
|
|
20479
|
+
// Document Methods
|
|
20480
|
+
// ===================================================================
|
|
20481
|
+
async createDocument(payload) {
|
|
20482
|
+
return this.requestv2('POST', 'documents/document', { data: payload });
|
|
20483
|
+
}
|
|
20484
|
+
async getDocument(path) {
|
|
20485
|
+
return this.requestv2('GET', `documents/document/${path}`);
|
|
20486
|
+
}
|
|
20487
|
+
async getDocumentRaw(path) {
|
|
20488
|
+
return this.requestv2('GET', `documents/document/${path}`, {
|
|
20489
|
+
headers: { Accept: 'application/pdoc' }
|
|
20490
|
+
});
|
|
20491
|
+
}
|
|
20492
|
+
async updateDocument(payload) {
|
|
20493
|
+
return this.requestv2('PATCH', 'documents/document', { data: payload });
|
|
20494
|
+
}
|
|
20495
|
+
async deleteDocument(path) {
|
|
20496
|
+
return this.requestv2('DELETE', `documents/document/${path}`);
|
|
20497
|
+
}
|
|
20498
|
+
async listDocuments(params) {
|
|
20499
|
+
return this.requestv2('GET', 'documents/list', { params });
|
|
20500
|
+
}
|
|
20501
|
+
async listDeletedDocuments(params) {
|
|
20502
|
+
return this.requestv2('GET', 'documents/list/__deleted__', { params });
|
|
20503
|
+
}
|
|
20504
|
+
async restoreDocument(payload) {
|
|
20505
|
+
return this.requestv2('POST', 'documents/restore', { data: payload });
|
|
20506
|
+
}
|
|
20507
|
+
async createDocumentComment(payload) {
|
|
20508
|
+
return this.requestv2('POST', 'documents/document/comment', { data: payload });
|
|
20509
|
+
}
|
|
20315
20510
|
async fillPdf(data) {
|
|
20316
20511
|
const { input_path, output_path, output_pdf = false, output_type, output_file_name, replace, form_data, forms } = data;
|
|
20317
20512
|
const responseType = output_pdf ? 'arraybuffer' : 'json';
|
|
@@ -20797,6 +20992,13 @@ class DMS extends IntegrationsBaseClient {
|
|
|
20797
20992
|
...params
|
|
20798
20993
|
});
|
|
20799
20994
|
}
|
|
20995
|
+
async requestv2(method, endpoint, params) {
|
|
20996
|
+
return await this.client.request({
|
|
20997
|
+
method,
|
|
20998
|
+
url: `/v2/dms/${endpoint}`,
|
|
20999
|
+
...params
|
|
21000
|
+
});
|
|
21001
|
+
}
|
|
20800
21002
|
async requestv1(method, endpoint, params) {
|
|
20801
21003
|
return await this.client.request({
|
|
20802
21004
|
method: method,
|
|
@@ -20844,19 +21046,781 @@ class VPFR extends IntegrationsBaseClient {
|
|
|
20844
21046
|
}
|
|
20845
21047
|
|
|
20846
21048
|
class Payments extends IntegrationsBaseClient {
|
|
20847
|
-
async getTransactions(
|
|
20848
|
-
return await this.client.get(`/karadjordje/v1/payment/${
|
|
21049
|
+
async getTransactions(userId, params) {
|
|
21050
|
+
return await this.client.get(`/karadjordje/v1/payment/${userId}/list`, {
|
|
21051
|
+
params,
|
|
21052
|
+
});
|
|
21053
|
+
}
|
|
21054
|
+
async getTransaction(provider, userId, transactionId) {
|
|
21055
|
+
return await this.client.get(`/karadjordje/v1/payment/${provider}/${userId}/getTransaction`, {
|
|
21056
|
+
params: { transactionId },
|
|
21057
|
+
});
|
|
20849
21058
|
}
|
|
20850
21059
|
async settings(provider) {
|
|
20851
21060
|
return await this.client.get(`/karadjordje/v1/payment/${provider}/settings`);
|
|
20852
21061
|
}
|
|
21062
|
+
async deactivatePaymentLink(provider, user, transactionId) {
|
|
21063
|
+
return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/deactivate/${transactionId}`);
|
|
21064
|
+
}
|
|
21065
|
+
async voidTransaction(provider, user, transactionId) {
|
|
21066
|
+
return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/void/${transactionId}`);
|
|
21067
|
+
}
|
|
21068
|
+
async refund(provider, user, transactionId) {
|
|
21069
|
+
return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/refund/${transactionId}`);
|
|
21070
|
+
}
|
|
20853
21071
|
async getPaymentLink(provider, user, options) {
|
|
20854
|
-
|
|
20855
|
-
|
|
20856
|
-
|
|
20857
|
-
|
|
20858
|
-
|
|
20859
|
-
|
|
21072
|
+
return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/getPaymentLink`, options);
|
|
21073
|
+
}
|
|
21074
|
+
async getTokenRequestLink(provider, user, options) {
|
|
21075
|
+
return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/getTokenRequestLink`, options);
|
|
21076
|
+
}
|
|
21077
|
+
async directPayUsingToken(provider, user, options) {
|
|
21078
|
+
return await this.client.post(`/karadjordje/v1/payment/${provider}/${user}/directPayUsingToken`, options);
|
|
21079
|
+
}
|
|
21080
|
+
}
|
|
21081
|
+
|
|
21082
|
+
class Minimax extends IntegrationsBaseClient {
|
|
21083
|
+
async settings() {
|
|
21084
|
+
return await this.client.get(`/karadjordje/v1/minimax/settings`);
|
|
21085
|
+
}
|
|
21086
|
+
async getAccounts(userId, organisationId, params) {
|
|
21087
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts`;
|
|
21088
|
+
return await this.client.get(path, { params });
|
|
21089
|
+
}
|
|
21090
|
+
async getAccount(userId, organisationId, accountId) {
|
|
21091
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts/${accountId}`;
|
|
21092
|
+
return await this.client.get(path);
|
|
21093
|
+
}
|
|
21094
|
+
async getAccountByCode(userId, organisationId, code) {
|
|
21095
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts/code(${code})`;
|
|
21096
|
+
return await this.client.get(path);
|
|
21097
|
+
}
|
|
21098
|
+
async getAccountByContent(userId, organisationId, content) {
|
|
21099
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts/content(${content})`;
|
|
21100
|
+
return await this.client.get(path);
|
|
21101
|
+
}
|
|
21102
|
+
async getAccountsForSync(userId, organisationId, params) {
|
|
21103
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/accounts/synccandidates`;
|
|
21104
|
+
return await this.client.get(path, { params });
|
|
21105
|
+
}
|
|
21106
|
+
/** ADDRESSES */
|
|
21107
|
+
async getAddresses(userId, organisationId, customerId, params) {
|
|
21108
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses`;
|
|
21109
|
+
return await this.client.get(path, { params });
|
|
21110
|
+
}
|
|
21111
|
+
async newAddress(userId, organisationId, customerId, address) {
|
|
21112
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses`;
|
|
21113
|
+
return await this.client.post(path, address);
|
|
21114
|
+
}
|
|
21115
|
+
async deleteAddress(userId, organisationId, customerId, addressId) {
|
|
21116
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${addressId}`;
|
|
21117
|
+
return await this.client.delete(path);
|
|
21118
|
+
}
|
|
21119
|
+
async getAddress(userId, organisationId, customerId, addressId) {
|
|
21120
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${addressId}`;
|
|
21121
|
+
return await this.client.get(path);
|
|
21122
|
+
}
|
|
21123
|
+
async updateAddress(userId, organisationId, customerId, address) {
|
|
21124
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${address.AddressId}`;
|
|
21125
|
+
return await this.client.put(path, address);
|
|
21126
|
+
}
|
|
21127
|
+
async getAddressesForSync(userId, organisationId, customerId, params) {
|
|
21128
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/synccandidates`;
|
|
21129
|
+
return await this.client.get(path, { params });
|
|
21130
|
+
}
|
|
21131
|
+
/** ANALYTICS */
|
|
21132
|
+
async getAnalytics(userId, organisationId, params) {
|
|
21133
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics`;
|
|
21134
|
+
return await this.client.get(path, { params });
|
|
21135
|
+
}
|
|
21136
|
+
async newAnalytic(userId, organisationId, analytic) {
|
|
21137
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics`;
|
|
21138
|
+
return await this.client.post(path, analytic);
|
|
21139
|
+
}
|
|
21140
|
+
async deleteAnalytic(userId, organisationId, analyticId) {
|
|
21141
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics/${analyticId}`;
|
|
21142
|
+
return await this.client.delete(path);
|
|
21143
|
+
}
|
|
21144
|
+
async getAnalytic(userId, organisationId, analyticId) {
|
|
21145
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics/${analyticId}`;
|
|
21146
|
+
return await this.client.get(path);
|
|
21147
|
+
}
|
|
21148
|
+
async updateAnalytic(userId, organisationId, analytic) {
|
|
21149
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics/${analytic.AnalyticId}`;
|
|
21150
|
+
return await this.client.put(path, analytic);
|
|
21151
|
+
}
|
|
21152
|
+
async getAnalyticsForSync(userId, organisationId, params) {
|
|
21153
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/analytics/synccandidates`;
|
|
21154
|
+
return await this.client.get(path, { params });
|
|
21155
|
+
}
|
|
21156
|
+
/** BANK ACCOUNTS */
|
|
21157
|
+
async getBankAccounts(userId, organisationId, customerId, params) {
|
|
21158
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts`;
|
|
21159
|
+
return await this.client.get(path, { params });
|
|
21160
|
+
}
|
|
21161
|
+
async newBankAccount(userId, organisationId, customerId, bankAccount) {
|
|
21162
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts`;
|
|
21163
|
+
return await this.client.post(path, bankAccount);
|
|
21164
|
+
}
|
|
21165
|
+
async deleteBankAccount(userId, organisationId, customerId, bankAccountId) {
|
|
21166
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts/${bankAccountId}`;
|
|
21167
|
+
return await this.client.delete(path);
|
|
21168
|
+
}
|
|
21169
|
+
async getBankAccount(userId, organisationId, customerId, bankAccountId) {
|
|
21170
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts/${bankAccountId}`;
|
|
21171
|
+
return await this.client.get(path);
|
|
21172
|
+
}
|
|
21173
|
+
async updateBankAccount(userId, organisationId, customerId, bankAccount) {
|
|
21174
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${bankAccount.BankAccountId}`;
|
|
21175
|
+
return await this.client.put(path, bankAccount);
|
|
21176
|
+
}
|
|
21177
|
+
async getBankAccountsForSync(userId, organisationId, customerId, params) {
|
|
21178
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/bankAccounts/synccandidates`;
|
|
21179
|
+
return await this.client.get(path, { params });
|
|
21180
|
+
}
|
|
21181
|
+
/** CONTACTS */
|
|
21182
|
+
async getCustomerContacts(userId, organisationId, customerId, params) {
|
|
21183
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts`;
|
|
21184
|
+
return await this.client.get(path, { params });
|
|
21185
|
+
}
|
|
21186
|
+
async newContact(userId, organisationId, customerId, contact) {
|
|
21187
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts`;
|
|
21188
|
+
return await this.client.post(path, contact);
|
|
21189
|
+
}
|
|
21190
|
+
async deleteContact(userId, organisationId, customerId, contactId) {
|
|
21191
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts/${contactId}`;
|
|
21192
|
+
return await this.client.delete(path);
|
|
21193
|
+
}
|
|
21194
|
+
async getContact(userId, organisationId, customerId, contactId) {
|
|
21195
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts/${contactId}`;
|
|
21196
|
+
return await this.client.get(path);
|
|
21197
|
+
}
|
|
21198
|
+
async updateContact(userId, organisationId, customerId, contact) {
|
|
21199
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/addresses/${contact.ContactId}`;
|
|
21200
|
+
return await this.client.put(path, contact);
|
|
21201
|
+
}
|
|
21202
|
+
async getContacts(userId, organisationId, params) {
|
|
21203
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/contacts`;
|
|
21204
|
+
return await this.client.get(path, { params });
|
|
21205
|
+
}
|
|
21206
|
+
async getContactForSync(userId, organisationId, customerId, params) {
|
|
21207
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}/contacts/synccandidates`;
|
|
21208
|
+
return await this.client.get(path, { params });
|
|
21209
|
+
}
|
|
21210
|
+
/** COUNTRIES */
|
|
21211
|
+
async getCountries(userId, organisationId, params) {
|
|
21212
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/countries`;
|
|
21213
|
+
return await this.client.get(path, { params });
|
|
21214
|
+
}
|
|
21215
|
+
async getCountry(userId, organisationId, countryId) {
|
|
21216
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/countries/${countryId}`;
|
|
21217
|
+
return await this.client.get(path);
|
|
21218
|
+
}
|
|
21219
|
+
async getCountryByCode(userId, organisationId, code) {
|
|
21220
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/countries/code(${code})`;
|
|
21221
|
+
return await this.client.get(path);
|
|
21222
|
+
}
|
|
21223
|
+
async getCountriesForSync(userId, organisationId, params) {
|
|
21224
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/countries/synccandidates`;
|
|
21225
|
+
return await this.client.get(path, { params });
|
|
21226
|
+
}
|
|
21227
|
+
/** CURRENCIES */
|
|
21228
|
+
async getCurrencies(userId, organisationId, params) {
|
|
21229
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies`;
|
|
21230
|
+
return await this.client.get(path, { params });
|
|
21231
|
+
}
|
|
21232
|
+
async getCurrency(userId, organisationId, currencyId) {
|
|
21233
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies/${currencyId}`;
|
|
21234
|
+
return await this.client.get(path);
|
|
21235
|
+
}
|
|
21236
|
+
async getCurrencyByDate(userId, organisationId, date) {
|
|
21237
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies/date(${date.toISOString()})`;
|
|
21238
|
+
return await this.client.get(path);
|
|
21239
|
+
}
|
|
21240
|
+
async getCurrencyByCode(userId, organisationId, code) {
|
|
21241
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies/code(${code})`;
|
|
21242
|
+
return await this.client.get(path);
|
|
21243
|
+
}
|
|
21244
|
+
async getCurrenciesForSync(userId, organisationId, params) {
|
|
21245
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/currencies/synccandidates`;
|
|
21246
|
+
return await this.client.get(path, { params });
|
|
21247
|
+
}
|
|
21248
|
+
/** CUSTOMERS */
|
|
21249
|
+
async getCustomers(userId, organisationId, params) {
|
|
21250
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers`;
|
|
21251
|
+
return await this.client.get(path, { params });
|
|
21252
|
+
}
|
|
21253
|
+
async newCustomer(userId, organisationId, customer) {
|
|
21254
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers`;
|
|
21255
|
+
return await this.client.post(path, customer);
|
|
21256
|
+
}
|
|
21257
|
+
async deleteCusomter(userId, organisationId, customerId) {
|
|
21258
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}`;
|
|
21259
|
+
return await this.client.delete(path);
|
|
21260
|
+
}
|
|
21261
|
+
async getCustomer(userId, organisationId, customerId) {
|
|
21262
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customerId}`;
|
|
21263
|
+
return await this.client.get(path);
|
|
21264
|
+
}
|
|
21265
|
+
async updateCustomer(userId, organisationId, customer) {
|
|
21266
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/${customer.CustomerId}`;
|
|
21267
|
+
return await this.client.put(path, customer);
|
|
21268
|
+
}
|
|
21269
|
+
async getCustomerByCode(userId, organisationId, code) {
|
|
21270
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/code(${code})`;
|
|
21271
|
+
return await this.client.get(path);
|
|
21272
|
+
}
|
|
21273
|
+
async newCustomerByTaxNumber(userId, organisationId, taxNumber) {
|
|
21274
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/addbytaxnumber(${taxNumber})`;
|
|
21275
|
+
return await this.client.post(path, {});
|
|
21276
|
+
}
|
|
21277
|
+
async getCustomersForSync(userId, organisationId, params) {
|
|
21278
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/customers/synccandidates`;
|
|
21279
|
+
return await this.client.get(path, { params });
|
|
21280
|
+
}
|
|
21281
|
+
/** DASHBOARDS */
|
|
21282
|
+
async getDashboardsData(userId, organisationId) {
|
|
21283
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/dashboards`;
|
|
21284
|
+
return await this.client.get(path);
|
|
21285
|
+
}
|
|
21286
|
+
/** DOCUMENTS */
|
|
21287
|
+
async getDocuments(userId, organisationId, params) {
|
|
21288
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents`;
|
|
21289
|
+
return await this.client.get(path, { params });
|
|
21290
|
+
}
|
|
21291
|
+
async newDocument(userId, organisationId, document) {
|
|
21292
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents`;
|
|
21293
|
+
return await this.client.post(path, document);
|
|
21294
|
+
}
|
|
21295
|
+
async deleteDocument(userId, organisationId, documentId) {
|
|
21296
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}`;
|
|
21297
|
+
return await this.client.delete(path);
|
|
21298
|
+
}
|
|
21299
|
+
async getDocument(userId, organisationId, documentId) {
|
|
21300
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}`;
|
|
21301
|
+
return await this.client.get(path);
|
|
21302
|
+
}
|
|
21303
|
+
async updateDocument(userId, organisationId, document) {
|
|
21304
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${document.DocumentId}`;
|
|
21305
|
+
return await this.client.put(path, document);
|
|
21306
|
+
}
|
|
21307
|
+
async deleteDocumentAttachment(userId, organisationId, documentId, documentAttachmentId) {
|
|
21308
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}/attachments/${documentAttachmentId}`;
|
|
21309
|
+
return await this.client.delete(path);
|
|
21310
|
+
}
|
|
21311
|
+
async getDocumentAttachment(userId, organisationId, documentId, documentAttachmentId) {
|
|
21312
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}/attachments/${documentAttachmentId}`;
|
|
21313
|
+
return await this.client.get(path);
|
|
21314
|
+
}
|
|
21315
|
+
async updateDocumentAttachment(userId, organisationId, documentId, documentAttachment) {
|
|
21316
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}/attachments/${documentAttachment.DocumentAttachmentId}`;
|
|
21317
|
+
return await this.client.put(path, documentAttachment);
|
|
21318
|
+
}
|
|
21319
|
+
async newDocumentAttachment(userId, organisationId, documentId, documentAttachment) {
|
|
21320
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/${documentId}/attachments`;
|
|
21321
|
+
return await this.client.post(path, documentAttachment);
|
|
21322
|
+
}
|
|
21323
|
+
async getDocumentsForSync(userId, organisationId, params) {
|
|
21324
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/documents/synccandidates`;
|
|
21325
|
+
return await this.client.get(path, { params });
|
|
21326
|
+
}
|
|
21327
|
+
/** DOCUMENT NUMBERINGS */
|
|
21328
|
+
async getDocumentNumberings(userId, organisationId, params) {
|
|
21329
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/document-numbering`;
|
|
21330
|
+
return await this.client.get(path, { params });
|
|
21331
|
+
}
|
|
21332
|
+
async getDocumentNumbering(userId, organisationId, documentNumberingId) {
|
|
21333
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/document-numbering/${documentNumberingId}`;
|
|
21334
|
+
return await this.client.get(path);
|
|
21335
|
+
}
|
|
21336
|
+
/** EFAKTURA */
|
|
21337
|
+
async getEFakturaList(userId, params) {
|
|
21338
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/efaktura/list`;
|
|
21339
|
+
return await this.client.get(path, { params });
|
|
21340
|
+
}
|
|
21341
|
+
/** EMPLOYEES */
|
|
21342
|
+
async getEmployees(userId, organisationId, params) {
|
|
21343
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees`;
|
|
21344
|
+
return await this.client.get(path, { params });
|
|
21345
|
+
}
|
|
21346
|
+
async newEmployee(userId, organisationId, employee) {
|
|
21347
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees`;
|
|
21348
|
+
return await this.client.post(path, employee);
|
|
21349
|
+
}
|
|
21350
|
+
async deleteEmployee(userId, organisationId, employeeId) {
|
|
21351
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees/${employeeId}`;
|
|
21352
|
+
return await this.client.delete(path);
|
|
21353
|
+
}
|
|
21354
|
+
async getEmployee(userId, organisationId, employeeId) {
|
|
21355
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees/${employeeId}`;
|
|
21356
|
+
return await this.client.get(path);
|
|
21357
|
+
}
|
|
21358
|
+
async updateEmployee(userId, organisationId, employee) {
|
|
21359
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees/${employee.EmployeeId}`;
|
|
21360
|
+
return await this.client.put(path, employee);
|
|
21361
|
+
}
|
|
21362
|
+
async getEmployeesForSync(userId, organisationId, params) {
|
|
21363
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/employees/synccandidates`;
|
|
21364
|
+
return await this.client.get(path, { params });
|
|
21365
|
+
}
|
|
21366
|
+
/** EXCHANGE RATES */
|
|
21367
|
+
async getExchangeRate(userId, organisationId, currencyId) {
|
|
21368
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/exchange-rates/${currencyId}`;
|
|
21369
|
+
return await this.client.get(path);
|
|
21370
|
+
}
|
|
21371
|
+
async getExchangeRateByCode(userId, organisationId, currencyCode) {
|
|
21372
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/exchange-rates/code(${currencyCode})`;
|
|
21373
|
+
return await this.client.get(path);
|
|
21374
|
+
}
|
|
21375
|
+
/** INBOX */
|
|
21376
|
+
async getInboxes(userId, organisationId, params) {
|
|
21377
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox`;
|
|
21378
|
+
return await this.client.get(path, { params });
|
|
21379
|
+
}
|
|
21380
|
+
async newInbox(userId, organisationId, inbox) {
|
|
21381
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox`;
|
|
21382
|
+
return await this.client.post(path, inbox);
|
|
21383
|
+
}
|
|
21384
|
+
async deleteInbox(userId, organisationId, inboxId) {
|
|
21385
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}`;
|
|
21386
|
+
return await this.client.delete(path);
|
|
21387
|
+
}
|
|
21388
|
+
async getInbox(userId, organisationId, inboxId) {
|
|
21389
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}`;
|
|
21390
|
+
return await this.client.get(path);
|
|
21391
|
+
}
|
|
21392
|
+
async newInboxAttachment(userId, organisationId, inboxId, inboxAttachment) {
|
|
21393
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}`;
|
|
21394
|
+
return await this.client.post(path, inboxAttachment);
|
|
21395
|
+
}
|
|
21396
|
+
async deleteInboxAttachment(userId, organisationId, inboxId, inboxAttachmentId) {
|
|
21397
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}/attachments/${inboxAttachmentId}`;
|
|
21398
|
+
return await this.client.delete(path);
|
|
21399
|
+
}
|
|
21400
|
+
async actionOnInbox(userId, organisationId, inboxId, action) {
|
|
21401
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/inbox/${inboxId}/actions/${action}`;
|
|
21402
|
+
return await this.client.put(path, {});
|
|
21403
|
+
}
|
|
21404
|
+
/** ISSUED INVOICE */
|
|
21405
|
+
async getIssuedInvoices(userId, organisationId, params) {
|
|
21406
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices`;
|
|
21407
|
+
return await this.client.get(path, { params });
|
|
21408
|
+
}
|
|
21409
|
+
async newIssuedInvoice(userId, organisationId, issuedInvoice) {
|
|
21410
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices`;
|
|
21411
|
+
return await this.client.post(path, issuedInvoice);
|
|
21412
|
+
}
|
|
21413
|
+
async deleteIssuedInvoice(userId, organisationId, issuedInvoiceId) {
|
|
21414
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/${issuedInvoiceId}`;
|
|
21415
|
+
return await this.client.delete(path);
|
|
21416
|
+
}
|
|
21417
|
+
async getIssuedInvoice(userId, organisationId, issuedInvoiceId) {
|
|
21418
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/${issuedInvoiceId}`;
|
|
21419
|
+
return await this.client.get(path);
|
|
21420
|
+
}
|
|
21421
|
+
async updateIssuedInvoice(userId, organisationId, issuedInvoice) {
|
|
21422
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/${issuedInvoice.IssuedInvoiceId}`;
|
|
21423
|
+
return await this.client.put(path, issuedInvoice);
|
|
21424
|
+
}
|
|
21425
|
+
async actionOnIssuedInvoice(userId, organisationId, issuedInvoiceId, action) {
|
|
21426
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/${issuedInvoiceId}/actions/${action}`;
|
|
21427
|
+
return await this.client.put(path, {});
|
|
21428
|
+
}
|
|
21429
|
+
async getIssuedInvoicesForSync(userId, organisationId, params) {
|
|
21430
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/synccandidates`;
|
|
21431
|
+
return await this.client.get(path, { params });
|
|
21432
|
+
}
|
|
21433
|
+
async getPaymentMethodsOnIssuedInvoices(userId, organisationId, params) {
|
|
21434
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoices/paymentmethods`;
|
|
21435
|
+
return await this.client.get(path, { params });
|
|
21436
|
+
}
|
|
21437
|
+
/** ISSUED INVOICE POSTING */
|
|
21438
|
+
async getIssuedInvoicePostings(userId, organisationId, params) {
|
|
21439
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings`;
|
|
21440
|
+
return await this.client.get(path, { params });
|
|
21441
|
+
}
|
|
21442
|
+
async newIssuedInvoicePosting(userId, organisationId, issuedInvoicePosting) {
|
|
21443
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings`;
|
|
21444
|
+
return await this.client.post(path, issuedInvoicePosting);
|
|
21445
|
+
}
|
|
21446
|
+
async deleteIssuedInvoicePosting(userId, organisationId, issuedInvoicePostingId) {
|
|
21447
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings/${issuedInvoicePostingId}`;
|
|
21448
|
+
return await this.client.delete(path);
|
|
21449
|
+
}
|
|
21450
|
+
async getIssuedInvoicePosting(userId, organisationId, issuedInvoicePostingId) {
|
|
21451
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings/${issuedInvoicePostingId}`;
|
|
21452
|
+
return await this.client.get(path);
|
|
21453
|
+
}
|
|
21454
|
+
async getPaymentMethodsOnIssuedInvoicePostings(userId, organisationId, params) {
|
|
21455
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings/paymentmethods`;
|
|
21456
|
+
return await this.client.get(path, { params });
|
|
21457
|
+
}
|
|
21458
|
+
async actionOnIssuedInvoicePosting(userId, organisationId, issuedInvoicePostingId, action) {
|
|
21459
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/issuedinvoicepostings/${issuedInvoicePostingId}/actions/${action}`;
|
|
21460
|
+
return await this.client.put(path, {});
|
|
21461
|
+
}
|
|
21462
|
+
/** ITEMS */
|
|
21463
|
+
async getItems(userId, organisationId, params) {
|
|
21464
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items`;
|
|
21465
|
+
return await this.client.get(path, { params });
|
|
21466
|
+
}
|
|
21467
|
+
async newItem(userId, organisationId, item) {
|
|
21468
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items`;
|
|
21469
|
+
return await this.client.post(path, item);
|
|
21470
|
+
}
|
|
21471
|
+
async deleteItem(userId, organisationId, itemId) {
|
|
21472
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/${itemId}`;
|
|
21473
|
+
return await this.client.delete(path);
|
|
21474
|
+
}
|
|
21475
|
+
async getItem(userId, organisationId, itemId) {
|
|
21476
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/${itemId}`;
|
|
21477
|
+
return await this.client.get(path);
|
|
21478
|
+
}
|
|
21479
|
+
async updateItem(userId, organisationId, item) {
|
|
21480
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/${item.ItemId}`;
|
|
21481
|
+
return await this.client.put(path, item);
|
|
21482
|
+
}
|
|
21483
|
+
async getItemByCode(userId, organisationId, code) {
|
|
21484
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/code(${code})`;
|
|
21485
|
+
return await this.client.get(path);
|
|
21486
|
+
}
|
|
21487
|
+
async getItemSettings(userId, organisationId, code) {
|
|
21488
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/settings`;
|
|
21489
|
+
return await this.client.get(path);
|
|
21490
|
+
}
|
|
21491
|
+
async getItemData(userId, organisationId, params) {
|
|
21492
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/itemsdata`;
|
|
21493
|
+
return await this.client.get(path, { params });
|
|
21494
|
+
}
|
|
21495
|
+
async getItemPricelist(userId, organisationId, params) {
|
|
21496
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/pricelists`;
|
|
21497
|
+
return await this.client.get(path, { params });
|
|
21498
|
+
}
|
|
21499
|
+
async getItemsForSync(userId, organisationId, params) {
|
|
21500
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/items/synccandidates`;
|
|
21501
|
+
return await this.client.get(path, { params });
|
|
21502
|
+
}
|
|
21503
|
+
/** JOURNALS */
|
|
21504
|
+
async getJournals(userId, organisationId, params) {
|
|
21505
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals`;
|
|
21506
|
+
return await this.client.get(path, { params });
|
|
21507
|
+
}
|
|
21508
|
+
async newJournal(userId, organisationId, journal) {
|
|
21509
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals`;
|
|
21510
|
+
return await this.client.post(path, journal);
|
|
21511
|
+
}
|
|
21512
|
+
async deleteJournal(userId, organisationId, journalId) {
|
|
21513
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}`;
|
|
21514
|
+
return await this.client.delete(path);
|
|
21515
|
+
}
|
|
21516
|
+
async getJournal(userId, organisationId, journalId) {
|
|
21517
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}`;
|
|
21518
|
+
return await this.client.get(path);
|
|
21519
|
+
}
|
|
21520
|
+
async updateJournal(userId, organisationId, journal) {
|
|
21521
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journal.JournalId}`;
|
|
21522
|
+
return await this.client.put(path, journal);
|
|
21523
|
+
}
|
|
21524
|
+
async deleteJournalVatEntry(userId, organisationId, journalId, vatId) {
|
|
21525
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}/vat/${vatId}`;
|
|
21526
|
+
return await this.client.delete(path);
|
|
21527
|
+
}
|
|
21528
|
+
async getJournalVatEntry(userId, organisationId, journalId, vatId) {
|
|
21529
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}/vat/${vatId}`;
|
|
21530
|
+
return await this.client.get(path);
|
|
21531
|
+
}
|
|
21532
|
+
async updateJournalVatEntry(userId, organisationId, journalId, vatEntry) {
|
|
21533
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}/vat/${vatEntry.VatEntryId}`;
|
|
21534
|
+
return await this.client.put(path, vatEntry);
|
|
21535
|
+
}
|
|
21536
|
+
async newJournalVatEntry(userId, organisationId, journalId, vatEntry) {
|
|
21537
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/${journalId}/vat`;
|
|
21538
|
+
return await this.client.post(path, vatEntry);
|
|
21539
|
+
}
|
|
21540
|
+
async getJournalsForSync(userId, organisationId, params) {
|
|
21541
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/synccandidates`;
|
|
21542
|
+
return await this.client.get(path, { params });
|
|
21543
|
+
}
|
|
21544
|
+
async getJournalsInVODStandard(userId, organisationId, params) {
|
|
21545
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/vodstandard`;
|
|
21546
|
+
return await this.client.get(path, { params });
|
|
21547
|
+
}
|
|
21548
|
+
async getJournalEntries(userId, organisationId, params) {
|
|
21549
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journals/journal-entries`;
|
|
21550
|
+
return await this.client.get(path, { params });
|
|
21551
|
+
}
|
|
21552
|
+
/** JOURNAL TYPES */
|
|
21553
|
+
async getJournalTypes(userId, organisationId, params) {
|
|
21554
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journaltypes`;
|
|
21555
|
+
return await this.client.get(path, { params });
|
|
21556
|
+
}
|
|
21557
|
+
async getJournalType(userId, organisationId, journalTypeId) {
|
|
21558
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journaltypes/${journalTypeId}`;
|
|
21559
|
+
return await this.client.get(path);
|
|
21560
|
+
}
|
|
21561
|
+
async getJournalTypeByCode(userId, organisationId, code) {
|
|
21562
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journaltypes/code(${code})`;
|
|
21563
|
+
return await this.client.get(path);
|
|
21564
|
+
}
|
|
21565
|
+
async getJournalTypesForSync(userId, organisationId, params) {
|
|
21566
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/journaltypes/synccandidates`;
|
|
21567
|
+
return await this.client.get(path, { params });
|
|
21568
|
+
}
|
|
21569
|
+
/** ORDERS */
|
|
21570
|
+
async getOrders(userId, organisationId, params) {
|
|
21571
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders`;
|
|
21572
|
+
return await this.client.get(path, { params });
|
|
21573
|
+
}
|
|
21574
|
+
async newOrder(userId, organisationId, order) {
|
|
21575
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders`;
|
|
21576
|
+
return await this.client.post(path, order);
|
|
21577
|
+
}
|
|
21578
|
+
async deleteOrder(userId, organisationId, orderId) {
|
|
21579
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${orderId}`;
|
|
21580
|
+
return await this.client.delete(path);
|
|
21581
|
+
}
|
|
21582
|
+
async getOrder(userId, organisationId, orderId) {
|
|
21583
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${orderId}`;
|
|
21584
|
+
return await this.client.get(path);
|
|
21585
|
+
}
|
|
21586
|
+
async updateOrder(userId, organisationId, order) {
|
|
21587
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${order.OrderId}`;
|
|
21588
|
+
return await this.client.put(path, order);
|
|
21589
|
+
}
|
|
21590
|
+
async actionGetOnOrder(userId, organisationId, orderId, action, params) {
|
|
21591
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${orderId}/actions/${action}`;
|
|
21592
|
+
return await this.client.get(path, { params });
|
|
21593
|
+
}
|
|
21594
|
+
async actionPutOnOrder(userId, organisationId, orderId, action, params) {
|
|
21595
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/${orderId}/actions/${action}`;
|
|
21596
|
+
return await this.client.put(path, {}, { params });
|
|
21597
|
+
}
|
|
21598
|
+
async getOrdersForSync(userId, organisationId, params) {
|
|
21599
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/orders/synccandidates`;
|
|
21600
|
+
return await this.client.get(path, { params });
|
|
21601
|
+
}
|
|
21602
|
+
/** ORGANISATIONS */
|
|
21603
|
+
async getOrganisation(userId, organisationId) {
|
|
21604
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}`;
|
|
21605
|
+
return await this.client.get(path);
|
|
21606
|
+
}
|
|
21607
|
+
async getAllOrganisations(userId, params) {
|
|
21608
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/allOrgs`;
|
|
21609
|
+
return await this.client.get(path, { params });
|
|
21610
|
+
}
|
|
21611
|
+
/** OUTBOX */
|
|
21612
|
+
async getAllOuboxes(userId, organisationId, params) {
|
|
21613
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/outbox`;
|
|
21614
|
+
return await this.client.get(path, { params });
|
|
21615
|
+
}
|
|
21616
|
+
async getOutbox(userId, organisationId, outboxId) {
|
|
21617
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/outbox/${outboxId}`;
|
|
21618
|
+
return await this.client.get(path);
|
|
21619
|
+
}
|
|
21620
|
+
/** PAYMENT METHODS */
|
|
21621
|
+
async getPaymentMethods(userId, organisationId, params) {
|
|
21622
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/paymentmethods`;
|
|
21623
|
+
return await this.client.get(path, { params });
|
|
21624
|
+
}
|
|
21625
|
+
/** PAYROLL SETTINGS */
|
|
21626
|
+
async getPayrollSettingsByCode(userId, code) {
|
|
21627
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/payrollsettings/${code}`;
|
|
21628
|
+
return await this.client.get(path);
|
|
21629
|
+
}
|
|
21630
|
+
/** POSTAL CODE */
|
|
21631
|
+
async getPostalCodesByCountry(userId, organisationId, countryId, params) {
|
|
21632
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/postalcodes/countries/${countryId}`;
|
|
21633
|
+
return await this.client.get(path, { params });
|
|
21634
|
+
}
|
|
21635
|
+
async getPostalCode(userId, organisationId, postalCodeId) {
|
|
21636
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/postalcodes/${postalCodeId}`;
|
|
21637
|
+
return await this.client.get(path);
|
|
21638
|
+
}
|
|
21639
|
+
async getPostalCodesForSync(userId, organisationId, params) {
|
|
21640
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/postalcodes/synccandidates`;
|
|
21641
|
+
return await this.client.get(path, { params });
|
|
21642
|
+
}
|
|
21643
|
+
/** PRODUCT GROUPS */
|
|
21644
|
+
async getProductGroups(userId, organisationId, params) {
|
|
21645
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups`;
|
|
21646
|
+
return await this.client.get(path, { params });
|
|
21647
|
+
}
|
|
21648
|
+
async newProductGroup(userId, organisationId, productGroup) {
|
|
21649
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups`;
|
|
21650
|
+
return await this.client.post(path, productGroup);
|
|
21651
|
+
}
|
|
21652
|
+
async deleteProductGroup(userId, organisationId, productGroupId) {
|
|
21653
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups/${productGroupId}`;
|
|
21654
|
+
return await this.client.delete(path);
|
|
21655
|
+
}
|
|
21656
|
+
async getProductGroup(userId, organisationId, productGroupId) {
|
|
21657
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups/${productGroupId}`;
|
|
21658
|
+
return await this.client.get(path);
|
|
21659
|
+
}
|
|
21660
|
+
async updateProductGroup(userId, organisationId, productGroup) {
|
|
21661
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups/${productGroup.ProductGroupId}`;
|
|
21662
|
+
return await this.client.put(path, productGroup);
|
|
21663
|
+
}
|
|
21664
|
+
async getProductGroupsForSync(userId, organisationId, params) {
|
|
21665
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/productGroups/synccandidates`;
|
|
21666
|
+
return await this.client.get(path, { params });
|
|
21667
|
+
}
|
|
21668
|
+
/** PURPOSE CODE */
|
|
21669
|
+
async getPurposeCodes(userId, organisationId, params) {
|
|
21670
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/purpose-codes`;
|
|
21671
|
+
return await this.client.get(path, { params });
|
|
21672
|
+
}
|
|
21673
|
+
async getPurposeCode(userId, organisationId, purposeCodeId) {
|
|
21674
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/purpose-codes/${purposeCodeId}`;
|
|
21675
|
+
return await this.client.get(path);
|
|
21676
|
+
}
|
|
21677
|
+
async getPurposeCodeByCode(userId, organisationId, code) {
|
|
21678
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/purpose-codes/code(${code})`;
|
|
21679
|
+
return await this.client.get(path);
|
|
21680
|
+
}
|
|
21681
|
+
async getPurposeCodesForSync(userId, organisationId, params) {
|
|
21682
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/purpose-codes/synccandidates`;
|
|
21683
|
+
return await this.client.get(path, { params });
|
|
21684
|
+
}
|
|
21685
|
+
/** RECEIVED INVOICES */
|
|
21686
|
+
async deleteReceivedInvoice(userId, organisationId, receivedInvoiceId) {
|
|
21687
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoiceId}`;
|
|
21688
|
+
return await this.client.delete(path);
|
|
21689
|
+
}
|
|
21690
|
+
async getReceivedInvoice(userId, organisationId, receivedInvoiceId) {
|
|
21691
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoiceId}`;
|
|
21692
|
+
return await this.client.get(path);
|
|
21693
|
+
}
|
|
21694
|
+
async updateReceivedInvoice(userId, organisationId, receivedInvoice) {
|
|
21695
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoice.ReceivedInvoiceId}`;
|
|
21696
|
+
return await this.client.put(path, receivedInvoice);
|
|
21697
|
+
}
|
|
21698
|
+
async getReceivedInvoices(userId, organisationId, params) {
|
|
21699
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices`;
|
|
21700
|
+
return await this.client.get(path, { params });
|
|
21701
|
+
}
|
|
21702
|
+
async newReceivedInvoice(userId, organisationId, receivedInvoice) {
|
|
21703
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices`;
|
|
21704
|
+
return await this.client.post(path, receivedInvoice);
|
|
21705
|
+
}
|
|
21706
|
+
async getReceivedInvoicesAttachments(userId, organisationId, receivedInvoiceId, params) {
|
|
21707
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoiceId}/attachments`;
|
|
21708
|
+
return await this.client.get(path, { params });
|
|
21709
|
+
}
|
|
21710
|
+
async newReceivedInvoiceAttachment(userId, organisationId, receivedInvoiceId, attachment) {
|
|
21711
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/receivedinvoices/${receivedInvoiceId}/attachments`;
|
|
21712
|
+
return await this.client.post(path, attachment);
|
|
21713
|
+
}
|
|
21714
|
+
/** REPORT TEMPLATES */
|
|
21715
|
+
async getReportTemplates(userId, organisationId, params) {
|
|
21716
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/report-templates`;
|
|
21717
|
+
return await this.client.get(path, { params });
|
|
21718
|
+
}
|
|
21719
|
+
async getReportTemplate(userId, organisationId, reportTemplateId) {
|
|
21720
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/report-templates/${reportTemplateId}`;
|
|
21721
|
+
return await this.client.get(path);
|
|
21722
|
+
}
|
|
21723
|
+
async getReportTemplatesForSync(userId, organisationId, params) {
|
|
21724
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/report-templates/synccandidates`;
|
|
21725
|
+
return await this.client.get(path, { params });
|
|
21726
|
+
}
|
|
21727
|
+
/** STOCK */
|
|
21728
|
+
async getStock(userId, organisationId, params) {
|
|
21729
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stocks`;
|
|
21730
|
+
return await this.client.get(path, { params });
|
|
21731
|
+
}
|
|
21732
|
+
async getStockForItem(userId, organisationId, itemId) {
|
|
21733
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stocks/${itemId}`;
|
|
21734
|
+
return await this.client.get(path);
|
|
21735
|
+
}
|
|
21736
|
+
/** STOCK ENTRIES */
|
|
21737
|
+
async getStockEntries(userId, organisationId, params) {
|
|
21738
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry`;
|
|
21739
|
+
return await this.client.get(path, { params });
|
|
21740
|
+
}
|
|
21741
|
+
async newStockEntry(userId, organisationId, stockEntry) {
|
|
21742
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry`;
|
|
21743
|
+
return await this.client.post(path, stockEntry);
|
|
21744
|
+
}
|
|
21745
|
+
async deleteStockEntry(userId, organisationId, stockEntryId) {
|
|
21746
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntryId}`;
|
|
21747
|
+
return await this.client.delete(path);
|
|
21748
|
+
}
|
|
21749
|
+
async getStockEntry(userId, organisationId, stockEntryId) {
|
|
21750
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntryId}`;
|
|
21751
|
+
return await this.client.get(path);
|
|
21752
|
+
}
|
|
21753
|
+
async updateStockEntry(userId, organisationId, stockEntry) {
|
|
21754
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntry.StockEntryId}`;
|
|
21755
|
+
return await this.client.post(path, stockEntry);
|
|
21756
|
+
}
|
|
21757
|
+
async actionGetOnStockEntry(userId, organisationId, stockEntryId, action, params) {
|
|
21758
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntryId}/actions/${action}`;
|
|
21759
|
+
return await this.client.get(path, { params });
|
|
21760
|
+
}
|
|
21761
|
+
async actionPutOnStockEntry(userId, organisationId, stockEntryId, action, params) {
|
|
21762
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/stockentry/${stockEntryId}/actions/${action}`;
|
|
21763
|
+
return await this.client.put(path, {}, { params });
|
|
21764
|
+
}
|
|
21765
|
+
/** USERS */
|
|
21766
|
+
async getCurrentUser(userId) {
|
|
21767
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/currentuser/profile`;
|
|
21768
|
+
return await this.client.get(path);
|
|
21769
|
+
}
|
|
21770
|
+
async getCurrentUserOrgs(userId) {
|
|
21771
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/currentuser/orgs`;
|
|
21772
|
+
return await this.client.get(path);
|
|
21773
|
+
}
|
|
21774
|
+
/** VAT ACCOUNTING TYPES */
|
|
21775
|
+
async getVatAccountingTypes(userId, organisationId, params) {
|
|
21776
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vataccountingtypes`;
|
|
21777
|
+
return await this.client.get(path, { params });
|
|
21778
|
+
}
|
|
21779
|
+
async getVatAccountingTypesForSync(userId, organisationId, params) {
|
|
21780
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vataccountingtypes/synccandidates`;
|
|
21781
|
+
return await this.client.get(path, { params });
|
|
21782
|
+
}
|
|
21783
|
+
/** VAT RATES */
|
|
21784
|
+
async getVatRates(userId, organisationId, params) {
|
|
21785
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vatrates`;
|
|
21786
|
+
return await this.client.get(path, { params });
|
|
21787
|
+
}
|
|
21788
|
+
async getVatRate(userId, organisationId, vatRateId) {
|
|
21789
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vatrates/${vatRateId}`;
|
|
21790
|
+
return await this.client.get(path);
|
|
21791
|
+
}
|
|
21792
|
+
async getVatRateByCode(userId, organisationId, code) {
|
|
21793
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vatrates/code(${code})`;
|
|
21794
|
+
return await this.client.get(path);
|
|
21795
|
+
}
|
|
21796
|
+
async getVatRatesForSync(userId, organisationId, params) {
|
|
21797
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/vatrates/synccandidates`;
|
|
21798
|
+
return await this.client.get(path, { params });
|
|
21799
|
+
}
|
|
21800
|
+
/** WAREHOUSES */
|
|
21801
|
+
async getWarehouses(userId, organisationId, params) {
|
|
21802
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses`;
|
|
21803
|
+
return await this.client.get(path, { params });
|
|
21804
|
+
}
|
|
21805
|
+
async newWarehouse(userId, organisationId, warehouse) {
|
|
21806
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses`;
|
|
21807
|
+
return await this.client.post(path, warehouse);
|
|
21808
|
+
}
|
|
21809
|
+
async deleteWarehouse(userId, organisationId, warehouseId) {
|
|
21810
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses/${warehouseId}`;
|
|
21811
|
+
return await this.client.delete(path);
|
|
21812
|
+
}
|
|
21813
|
+
async getWarehouse(userId, organisationId, warehouseId) {
|
|
21814
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses/${warehouseId}`;
|
|
21815
|
+
return await this.client.get(path);
|
|
21816
|
+
}
|
|
21817
|
+
async updateWarehouse(userId, organisationId, warehouse) {
|
|
21818
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses/${warehouse.WarehouseId}`;
|
|
21819
|
+
return await this.client.put(path, warehouse);
|
|
21820
|
+
}
|
|
21821
|
+
async getWarehousesForSync(userId, organisationId, params) {
|
|
21822
|
+
const path = `/karadjordje/v1/minimax/${userId}/api/orgs/${organisationId}/warehouses/synccandidates`;
|
|
21823
|
+
return await this.client.get(path, { params });
|
|
20860
21824
|
}
|
|
20861
21825
|
}
|
|
20862
21826
|
|
|
@@ -20870,6 +21834,7 @@ class Integrations extends IntegrationsBaseClient {
|
|
|
20870
21834
|
'protokol-dms': new DMS().setClient(this.client),
|
|
20871
21835
|
'serbia-utilities': new SerbiaUtil().setClient(this.client),
|
|
20872
21836
|
'protokol-payments': new Payments().setClient(this.client),
|
|
21837
|
+
'protokol-minimax': new Minimax().setClient(this.client),
|
|
20873
21838
|
};
|
|
20874
21839
|
}
|
|
20875
21840
|
getSerbiaUtilities() {
|
|
@@ -20887,6 +21852,9 @@ class Integrations extends IntegrationsBaseClient {
|
|
|
20887
21852
|
getPayments() {
|
|
20888
21853
|
return this.getInterfaceOf('protokol-payments');
|
|
20889
21854
|
}
|
|
21855
|
+
getMinimax() {
|
|
21856
|
+
return this.getInterfaceOf('protokol-minimax');
|
|
21857
|
+
}
|
|
20890
21858
|
async isInstalled(id) {
|
|
20891
21859
|
const { data } = await this.client.get("/v1/integrations");
|
|
20892
21860
|
return data.find((i) => i.id == id) !== undefined;
|
|
@@ -20913,13 +21881,13 @@ exports.Integration = Integrations;
|
|
|
20913
21881
|
exports.Integrations = Integrations;
|
|
20914
21882
|
exports.Invoicing = Invoicing;
|
|
20915
21883
|
exports.Payments = Payments;
|
|
21884
|
+
exports.Platform = Platform;
|
|
20916
21885
|
exports.Project = Project;
|
|
20917
21886
|
exports.Ratchet = Ratchet;
|
|
20918
21887
|
exports.Sandbox = Sandbox;
|
|
20919
21888
|
exports.SerbiaUtil = SerbiaUtil;
|
|
20920
21889
|
exports.System = System;
|
|
20921
21890
|
exports.Thunder = Thunder;
|
|
20922
|
-
exports.
|
|
21891
|
+
exports.Users = Users;
|
|
20923
21892
|
exports.VPFR = VPFR;
|
|
20924
21893
|
exports.Workflow = Workflow;
|
|
20925
|
-
exports.default = Platform;
|