@ptkl/sdk 1.11.0 → 1.12.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.0.10.js +26 -0
- package/dist/index.0.9.js +57 -0
- package/dist/package.json +1 -1
- package/dist/v0.10/api/forge.d.ts +9 -0
- package/dist/v0.10/index.cjs.js +26 -0
- package/dist/v0.10/index.esm.js +26 -0
- package/dist/v0.9/api/forge.d.ts +3 -0
- package/dist/v0.9/api/index.d.ts +2 -0
- package/dist/v0.9/api/integrations/timber.d.ts +22 -0
- package/dist/v0.9/api/integrations.d.ts +2 -0
- package/dist/v0.9/index.cjs.js +57 -0
- package/dist/v0.9/index.esm.js +57 -1
- package/dist/v0.9/types/integrations/timber.d.ts +77 -0
- package/package.json +1 -1
package/dist/index.0.10.js
CHANGED
|
@@ -1289,6 +1289,7 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
1289
1289
|
}
|
|
1290
1290
|
|
|
1291
1291
|
class Forge extends PlatformBaseClient {
|
|
1292
|
+
// --- Management (appservice) ---
|
|
1292
1293
|
async bundleUpload(buffer) {
|
|
1293
1294
|
return await this.client.post(`/luma/appservice/v1/forge/upload`, buffer, {
|
|
1294
1295
|
headers: {
|
|
@@ -1306,6 +1307,31 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
1306
1307
|
async list() {
|
|
1307
1308
|
return await this.client.get(`/luma/appservice/v1/forge`);
|
|
1308
1309
|
}
|
|
1310
|
+
async listServices(ref) {
|
|
1311
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/services`);
|
|
1312
|
+
}
|
|
1313
|
+
// --- Variables ---
|
|
1314
|
+
async getVariables(ref) {
|
|
1315
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
1316
|
+
}
|
|
1317
|
+
async updateVariables(ref, variables) {
|
|
1318
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, variables);
|
|
1319
|
+
}
|
|
1320
|
+
async addVariable(ref, key, value) {
|
|
1321
|
+
var _a;
|
|
1322
|
+
const resp = await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
1323
|
+
const current = (_a = resp.data) !== null && _a !== void 0 ? _a : {};
|
|
1324
|
+
current[key] = value;
|
|
1325
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, current);
|
|
1326
|
+
}
|
|
1327
|
+
// --- Service execution (forge-runtime) ---
|
|
1328
|
+
async callService(appUuid, serviceName, options) {
|
|
1329
|
+
var _a;
|
|
1330
|
+
const queryString = (options === null || options === void 0 ? void 0 : options.query)
|
|
1331
|
+
? '?' + new URLSearchParams(options.query).toString()
|
|
1332
|
+
: '';
|
|
1333
|
+
return await this.client.post(`/luma/forge-runtime/api/services/${appUuid}/${serviceName}${queryString}`, (_a = options === null || options === void 0 ? void 0 : options.body) !== null && _a !== void 0 ? _a : {}, (options === null || options === void 0 ? void 0 : options.headers) ? { headers: options.headers } : undefined);
|
|
1334
|
+
}
|
|
1309
1335
|
}
|
|
1310
1336
|
|
|
1311
1337
|
const BASE = '/luma/kortex/v1';
|
package/dist/index.0.9.js
CHANGED
|
@@ -984,6 +984,19 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
984
984
|
async list() {
|
|
985
985
|
return await this.client.get(`/luma/appservice/v1/forge`);
|
|
986
986
|
}
|
|
987
|
+
async getVariables(ref) {
|
|
988
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
989
|
+
}
|
|
990
|
+
async updateVariables(ref, variables) {
|
|
991
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, variables);
|
|
992
|
+
}
|
|
993
|
+
async addVariable(ref, key, value) {
|
|
994
|
+
var _a;
|
|
995
|
+
const resp = await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
996
|
+
const current = (_a = resp.data) !== null && _a !== void 0 ? _a : {};
|
|
997
|
+
current[key] = value;
|
|
998
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, current);
|
|
999
|
+
}
|
|
987
1000
|
}
|
|
988
1001
|
|
|
989
1002
|
class Project extends PlatformBaseClient {
|
|
@@ -2970,6 +2983,45 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
2970
2983
|
}
|
|
2971
2984
|
}
|
|
2972
2985
|
|
|
2986
|
+
class Timber extends IntegrationsBaseClient {
|
|
2987
|
+
async query(params = {}) {
|
|
2988
|
+
const { data } = await this.client.get("/v1/timber/logs", {
|
|
2989
|
+
params: this.normalizeParams(params),
|
|
2990
|
+
});
|
|
2991
|
+
return data;
|
|
2992
|
+
}
|
|
2993
|
+
async write(payload) {
|
|
2994
|
+
const { data } = await this.client.post("/v1/timber/logs", payload);
|
|
2995
|
+
return data;
|
|
2996
|
+
}
|
|
2997
|
+
async usage() {
|
|
2998
|
+
const { data } = await this.client.get("/v1/timber/usage");
|
|
2999
|
+
return data;
|
|
3000
|
+
}
|
|
3001
|
+
async debug(message, payload) {
|
|
3002
|
+
return this.write({ ...payload, message, level: 'debug' });
|
|
3003
|
+
}
|
|
3004
|
+
async info(message, payload) {
|
|
3005
|
+
return this.write({ ...payload, message, level: 'info' });
|
|
3006
|
+
}
|
|
3007
|
+
async warn(message, payload) {
|
|
3008
|
+
return this.write({ ...payload, message, level: 'warn' });
|
|
3009
|
+
}
|
|
3010
|
+
async error(message, payload) {
|
|
3011
|
+
return this.write({ ...payload, message, level: 'error' });
|
|
3012
|
+
}
|
|
3013
|
+
normalizeParams(params) {
|
|
3014
|
+
const normalized = { ...params };
|
|
3015
|
+
if (params.from instanceof Date) {
|
|
3016
|
+
normalized.from = params.from.toISOString();
|
|
3017
|
+
}
|
|
3018
|
+
if (params.to instanceof Date) {
|
|
3019
|
+
normalized.to = params.to.toISOString();
|
|
3020
|
+
}
|
|
3021
|
+
return normalized;
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
3024
|
+
|
|
2973
3025
|
// import integrations
|
|
2974
3026
|
class Integrations extends IntegrationsBaseClient {
|
|
2975
3027
|
constructor(options) {
|
|
@@ -2983,6 +3035,7 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
2983
3035
|
'protokol-payments': new Payments().setClient(this.client),
|
|
2984
3036
|
'protokol-minimax': new Minimax().setClient(this.client),
|
|
2985
3037
|
'protokol-ecommerce': new Ecommerce().setClient(this.client),
|
|
3038
|
+
'protokol-timber': new Timber().setClient(this.client),
|
|
2986
3039
|
};
|
|
2987
3040
|
}
|
|
2988
3041
|
getSerbiaUtilities() {
|
|
@@ -3009,6 +3062,9 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
3009
3062
|
getEcommerce() {
|
|
3010
3063
|
return this.getInterfaceOf('protokol-ecommerce');
|
|
3011
3064
|
}
|
|
3065
|
+
getTimber() {
|
|
3066
|
+
return this.getInterfaceOf('protokol-timber');
|
|
3067
|
+
}
|
|
3012
3068
|
async list() {
|
|
3013
3069
|
const { data } = await this.client.get("/v1/integrations");
|
|
3014
3070
|
return data;
|
|
@@ -3184,6 +3240,7 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
3184
3240
|
exports.SerbiaUtil = SerbiaUtil;
|
|
3185
3241
|
exports.System = System;
|
|
3186
3242
|
exports.Thunder = Thunder;
|
|
3243
|
+
exports.Timber = Timber;
|
|
3187
3244
|
exports.Users = Users;
|
|
3188
3245
|
exports.VPFR = VPFR;
|
|
3189
3246
|
exports.Workflow = Workflow;
|
package/dist/package.json
CHANGED
|
@@ -4,4 +4,13 @@ export default class Forge extends PlatformBaseClient {
|
|
|
4
4
|
getWorkspaceApps(): Promise<any>;
|
|
5
5
|
removeVersion(ref: string, version: string): Promise<any>;
|
|
6
6
|
list(): Promise<any>;
|
|
7
|
+
listServices(ref: string): Promise<any>;
|
|
8
|
+
getVariables(ref: string): Promise<any>;
|
|
9
|
+
updateVariables(ref: string, variables: Record<string, any>): Promise<any>;
|
|
10
|
+
addVariable(ref: string, key: string, value: any): Promise<any>;
|
|
11
|
+
callService(appUuid: string, serviceName: string, options?: {
|
|
12
|
+
body?: any;
|
|
13
|
+
query?: Record<string, string>;
|
|
14
|
+
headers?: Record<string, string>;
|
|
15
|
+
}): Promise<any>;
|
|
7
16
|
}
|
package/dist/v0.10/index.cjs.js
CHANGED
|
@@ -20255,6 +20255,7 @@ class Workflow extends PlatformBaseClient {
|
|
|
20255
20255
|
}
|
|
20256
20256
|
|
|
20257
20257
|
class Forge extends PlatformBaseClient {
|
|
20258
|
+
// --- Management (appservice) ---
|
|
20258
20259
|
async bundleUpload(buffer) {
|
|
20259
20260
|
return await this.client.post(`/luma/appservice/v1/forge/upload`, buffer, {
|
|
20260
20261
|
headers: {
|
|
@@ -20272,6 +20273,31 @@ class Forge extends PlatformBaseClient {
|
|
|
20272
20273
|
async list() {
|
|
20273
20274
|
return await this.client.get(`/luma/appservice/v1/forge`);
|
|
20274
20275
|
}
|
|
20276
|
+
async listServices(ref) {
|
|
20277
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/services`);
|
|
20278
|
+
}
|
|
20279
|
+
// --- Variables ---
|
|
20280
|
+
async getVariables(ref) {
|
|
20281
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
20282
|
+
}
|
|
20283
|
+
async updateVariables(ref, variables) {
|
|
20284
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, variables);
|
|
20285
|
+
}
|
|
20286
|
+
async addVariable(ref, key, value) {
|
|
20287
|
+
var _a;
|
|
20288
|
+
const resp = await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
20289
|
+
const current = (_a = resp.data) !== null && _a !== void 0 ? _a : {};
|
|
20290
|
+
current[key] = value;
|
|
20291
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, current);
|
|
20292
|
+
}
|
|
20293
|
+
// --- Service execution (forge-runtime) ---
|
|
20294
|
+
async callService(appUuid, serviceName, options) {
|
|
20295
|
+
var _a;
|
|
20296
|
+
const queryString = (options === null || options === void 0 ? void 0 : options.query)
|
|
20297
|
+
? '?' + new URLSearchParams(options.query).toString()
|
|
20298
|
+
: '';
|
|
20299
|
+
return await this.client.post(`/luma/forge-runtime/api/services/${appUuid}/${serviceName}${queryString}`, (_a = options === null || options === void 0 ? void 0 : options.body) !== null && _a !== void 0 ? _a : {}, (options === null || options === void 0 ? void 0 : options.headers) ? { headers: options.headers } : undefined);
|
|
20300
|
+
}
|
|
20275
20301
|
}
|
|
20276
20302
|
|
|
20277
20303
|
const BASE = '/luma/kortex/v1';
|
package/dist/v0.10/index.esm.js
CHANGED
|
@@ -1288,6 +1288,7 @@ class Workflow extends PlatformBaseClient {
|
|
|
1288
1288
|
}
|
|
1289
1289
|
|
|
1290
1290
|
class Forge extends PlatformBaseClient {
|
|
1291
|
+
// --- Management (appservice) ---
|
|
1291
1292
|
async bundleUpload(buffer) {
|
|
1292
1293
|
return await this.client.post(`/luma/appservice/v1/forge/upload`, buffer, {
|
|
1293
1294
|
headers: {
|
|
@@ -1305,6 +1306,31 @@ class Forge extends PlatformBaseClient {
|
|
|
1305
1306
|
async list() {
|
|
1306
1307
|
return await this.client.get(`/luma/appservice/v1/forge`);
|
|
1307
1308
|
}
|
|
1309
|
+
async listServices(ref) {
|
|
1310
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/services`);
|
|
1311
|
+
}
|
|
1312
|
+
// --- Variables ---
|
|
1313
|
+
async getVariables(ref) {
|
|
1314
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
1315
|
+
}
|
|
1316
|
+
async updateVariables(ref, variables) {
|
|
1317
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, variables);
|
|
1318
|
+
}
|
|
1319
|
+
async addVariable(ref, key, value) {
|
|
1320
|
+
var _a;
|
|
1321
|
+
const resp = await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
1322
|
+
const current = (_a = resp.data) !== null && _a !== void 0 ? _a : {};
|
|
1323
|
+
current[key] = value;
|
|
1324
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, current);
|
|
1325
|
+
}
|
|
1326
|
+
// --- Service execution (forge-runtime) ---
|
|
1327
|
+
async callService(appUuid, serviceName, options) {
|
|
1328
|
+
var _a;
|
|
1329
|
+
const queryString = (options === null || options === void 0 ? void 0 : options.query)
|
|
1330
|
+
? '?' + new URLSearchParams(options.query).toString()
|
|
1331
|
+
: '';
|
|
1332
|
+
return await this.client.post(`/luma/forge-runtime/api/services/${appUuid}/${serviceName}${queryString}`, (_a = options === null || options === void 0 ? void 0 : options.body) !== null && _a !== void 0 ? _a : {}, (options === null || options === void 0 ? void 0 : options.headers) ? { headers: options.headers } : undefined);
|
|
1333
|
+
}
|
|
1308
1334
|
}
|
|
1309
1335
|
|
|
1310
1336
|
const BASE = '/luma/kortex/v1';
|
package/dist/v0.9/api/forge.d.ts
CHANGED
|
@@ -4,4 +4,7 @@ export default class Forge extends PlatformBaseClient {
|
|
|
4
4
|
getWorkspaceApps(): Promise<any>;
|
|
5
5
|
removeVersion(ref: string, version: string): Promise<any>;
|
|
6
6
|
list(): Promise<any>;
|
|
7
|
+
getVariables(ref: string): Promise<any>;
|
|
8
|
+
updateVariables(ref: string, variables: Record<string, any>): Promise<any>;
|
|
9
|
+
addVariable(ref: string, key: string, value: any): Promise<any>;
|
|
7
10
|
}
|
package/dist/v0.9/api/index.d.ts
CHANGED
|
@@ -26,5 +26,7 @@ export { default as SerbiaUtil } from './integrations/serbiaUtil';
|
|
|
26
26
|
export { default as VPFR } from './integrations/vpfr';
|
|
27
27
|
export { default as Mail } from './integrations/mail';
|
|
28
28
|
export { default as Ecommerce } from './integrations/ecommerce';
|
|
29
|
+
export { default as Timber } from './integrations/timber';
|
|
30
|
+
export type { TimberQueryParams, TimberQueryResponse, TimberWritePayload, TimberLogPayload, TimberUsage, TimberEntry, } from '../types/integrations/timber';
|
|
29
31
|
import Platfrom from './platform';
|
|
30
32
|
export default Platfrom;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import IntegrationsBaseClient from "../integrationsBaseClient";
|
|
2
|
+
import { TimberLogPayload, TimberQueryParams, TimberQueryResponse, TimberUsage, TimberWritePayload } from "../../types/integrations/timber";
|
|
3
|
+
export default class Timber extends IntegrationsBaseClient {
|
|
4
|
+
query(params?: TimberQueryParams): Promise<TimberQueryResponse>;
|
|
5
|
+
write(payload: TimberWritePayload): Promise<{
|
|
6
|
+
accepted: boolean;
|
|
7
|
+
}>;
|
|
8
|
+
usage(): Promise<TimberUsage>;
|
|
9
|
+
debug(message: string, payload?: TimberLogPayload): Promise<{
|
|
10
|
+
accepted: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
info(message: string, payload?: TimberLogPayload): Promise<{
|
|
13
|
+
accepted: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
warn(message: string, payload?: TimberLogPayload): Promise<{
|
|
16
|
+
accepted: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
error(message: string, payload?: TimberLogPayload): Promise<{
|
|
19
|
+
accepted: boolean;
|
|
20
|
+
}>;
|
|
21
|
+
private normalizeParams;
|
|
22
|
+
}
|
|
@@ -6,6 +6,7 @@ import IntegrationsBaseClient from "./integrationsBaseClient";
|
|
|
6
6
|
import Payments from "./integrations/payments";
|
|
7
7
|
import Minimax from "./integrations/minimax";
|
|
8
8
|
import Ecommerce from "./integrations/ecommerce";
|
|
9
|
+
import Timber from "./integrations/timber";
|
|
9
10
|
export default class Integrations extends IntegrationsBaseClient {
|
|
10
11
|
private integrations;
|
|
11
12
|
constructor(options?: {
|
|
@@ -21,6 +22,7 @@ export default class Integrations extends IntegrationsBaseClient {
|
|
|
21
22
|
getPayments(): Payments;
|
|
22
23
|
getMinimax(): Minimax;
|
|
23
24
|
getEcommerce(): Ecommerce;
|
|
25
|
+
getTimber(): Timber;
|
|
24
26
|
list(): Promise<any>;
|
|
25
27
|
isInstalled(id: string): Promise<boolean>;
|
|
26
28
|
isActive(id: string): Promise<boolean>;
|
package/dist/v0.9/index.cjs.js
CHANGED
|
@@ -19952,6 +19952,19 @@ class Forge extends PlatformBaseClient {
|
|
|
19952
19952
|
async list() {
|
|
19953
19953
|
return await this.client.get(`/luma/appservice/v1/forge`);
|
|
19954
19954
|
}
|
|
19955
|
+
async getVariables(ref) {
|
|
19956
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
19957
|
+
}
|
|
19958
|
+
async updateVariables(ref, variables) {
|
|
19959
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, variables);
|
|
19960
|
+
}
|
|
19961
|
+
async addVariable(ref, key, value) {
|
|
19962
|
+
var _a;
|
|
19963
|
+
const resp = await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
19964
|
+
const current = (_a = resp.data) !== null && _a !== void 0 ? _a : {};
|
|
19965
|
+
current[key] = value;
|
|
19966
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, current);
|
|
19967
|
+
}
|
|
19955
19968
|
}
|
|
19956
19969
|
|
|
19957
19970
|
class Project extends PlatformBaseClient {
|
|
@@ -21938,6 +21951,45 @@ class Ecommerce extends IntegrationsBaseClient {
|
|
|
21938
21951
|
}
|
|
21939
21952
|
}
|
|
21940
21953
|
|
|
21954
|
+
class Timber extends IntegrationsBaseClient {
|
|
21955
|
+
async query(params = {}) {
|
|
21956
|
+
const { data } = await this.client.get("/v1/timber/logs", {
|
|
21957
|
+
params: this.normalizeParams(params),
|
|
21958
|
+
});
|
|
21959
|
+
return data;
|
|
21960
|
+
}
|
|
21961
|
+
async write(payload) {
|
|
21962
|
+
const { data } = await this.client.post("/v1/timber/logs", payload);
|
|
21963
|
+
return data;
|
|
21964
|
+
}
|
|
21965
|
+
async usage() {
|
|
21966
|
+
const { data } = await this.client.get("/v1/timber/usage");
|
|
21967
|
+
return data;
|
|
21968
|
+
}
|
|
21969
|
+
async debug(message, payload) {
|
|
21970
|
+
return this.write({ ...payload, message, level: 'debug' });
|
|
21971
|
+
}
|
|
21972
|
+
async info(message, payload) {
|
|
21973
|
+
return this.write({ ...payload, message, level: 'info' });
|
|
21974
|
+
}
|
|
21975
|
+
async warn(message, payload) {
|
|
21976
|
+
return this.write({ ...payload, message, level: 'warn' });
|
|
21977
|
+
}
|
|
21978
|
+
async error(message, payload) {
|
|
21979
|
+
return this.write({ ...payload, message, level: 'error' });
|
|
21980
|
+
}
|
|
21981
|
+
normalizeParams(params) {
|
|
21982
|
+
const normalized = { ...params };
|
|
21983
|
+
if (params.from instanceof Date) {
|
|
21984
|
+
normalized.from = params.from.toISOString();
|
|
21985
|
+
}
|
|
21986
|
+
if (params.to instanceof Date) {
|
|
21987
|
+
normalized.to = params.to.toISOString();
|
|
21988
|
+
}
|
|
21989
|
+
return normalized;
|
|
21990
|
+
}
|
|
21991
|
+
}
|
|
21992
|
+
|
|
21941
21993
|
// import integrations
|
|
21942
21994
|
class Integrations extends IntegrationsBaseClient {
|
|
21943
21995
|
constructor(options) {
|
|
@@ -21951,6 +22003,7 @@ class Integrations extends IntegrationsBaseClient {
|
|
|
21951
22003
|
'protokol-payments': new Payments().setClient(this.client),
|
|
21952
22004
|
'protokol-minimax': new Minimax().setClient(this.client),
|
|
21953
22005
|
'protokol-ecommerce': new Ecommerce().setClient(this.client),
|
|
22006
|
+
'protokol-timber': new Timber().setClient(this.client),
|
|
21954
22007
|
};
|
|
21955
22008
|
}
|
|
21956
22009
|
getSerbiaUtilities() {
|
|
@@ -21977,6 +22030,9 @@ class Integrations extends IntegrationsBaseClient {
|
|
|
21977
22030
|
getEcommerce() {
|
|
21978
22031
|
return this.getInterfaceOf('protokol-ecommerce');
|
|
21979
22032
|
}
|
|
22033
|
+
getTimber() {
|
|
22034
|
+
return this.getInterfaceOf('protokol-timber');
|
|
22035
|
+
}
|
|
21980
22036
|
async list() {
|
|
21981
22037
|
const { data } = await this.client.get("/v1/integrations");
|
|
21982
22038
|
return data;
|
|
@@ -22152,6 +22208,7 @@ exports.Sandbox = Sandbox;
|
|
|
22152
22208
|
exports.SerbiaUtil = SerbiaUtil;
|
|
22153
22209
|
exports.System = System;
|
|
22154
22210
|
exports.Thunder = Thunder;
|
|
22211
|
+
exports.Timber = Timber;
|
|
22155
22212
|
exports.Users = Users;
|
|
22156
22213
|
exports.VPFR = VPFR;
|
|
22157
22214
|
exports.Workflow = Workflow;
|
package/dist/v0.9/index.esm.js
CHANGED
|
@@ -983,6 +983,19 @@ class Forge extends PlatformBaseClient {
|
|
|
983
983
|
async list() {
|
|
984
984
|
return await this.client.get(`/luma/appservice/v1/forge`);
|
|
985
985
|
}
|
|
986
|
+
async getVariables(ref) {
|
|
987
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
988
|
+
}
|
|
989
|
+
async updateVariables(ref, variables) {
|
|
990
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, variables);
|
|
991
|
+
}
|
|
992
|
+
async addVariable(ref, key, value) {
|
|
993
|
+
var _a;
|
|
994
|
+
const resp = await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
995
|
+
const current = (_a = resp.data) !== null && _a !== void 0 ? _a : {};
|
|
996
|
+
current[key] = value;
|
|
997
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, current);
|
|
998
|
+
}
|
|
986
999
|
}
|
|
987
1000
|
|
|
988
1001
|
class Project extends PlatformBaseClient {
|
|
@@ -2969,6 +2982,45 @@ class Ecommerce extends IntegrationsBaseClient {
|
|
|
2969
2982
|
}
|
|
2970
2983
|
}
|
|
2971
2984
|
|
|
2985
|
+
class Timber extends IntegrationsBaseClient {
|
|
2986
|
+
async query(params = {}) {
|
|
2987
|
+
const { data } = await this.client.get("/v1/timber/logs", {
|
|
2988
|
+
params: this.normalizeParams(params),
|
|
2989
|
+
});
|
|
2990
|
+
return data;
|
|
2991
|
+
}
|
|
2992
|
+
async write(payload) {
|
|
2993
|
+
const { data } = await this.client.post("/v1/timber/logs", payload);
|
|
2994
|
+
return data;
|
|
2995
|
+
}
|
|
2996
|
+
async usage() {
|
|
2997
|
+
const { data } = await this.client.get("/v1/timber/usage");
|
|
2998
|
+
return data;
|
|
2999
|
+
}
|
|
3000
|
+
async debug(message, payload) {
|
|
3001
|
+
return this.write({ ...payload, message, level: 'debug' });
|
|
3002
|
+
}
|
|
3003
|
+
async info(message, payload) {
|
|
3004
|
+
return this.write({ ...payload, message, level: 'info' });
|
|
3005
|
+
}
|
|
3006
|
+
async warn(message, payload) {
|
|
3007
|
+
return this.write({ ...payload, message, level: 'warn' });
|
|
3008
|
+
}
|
|
3009
|
+
async error(message, payload) {
|
|
3010
|
+
return this.write({ ...payload, message, level: 'error' });
|
|
3011
|
+
}
|
|
3012
|
+
normalizeParams(params) {
|
|
3013
|
+
const normalized = { ...params };
|
|
3014
|
+
if (params.from instanceof Date) {
|
|
3015
|
+
normalized.from = params.from.toISOString();
|
|
3016
|
+
}
|
|
3017
|
+
if (params.to instanceof Date) {
|
|
3018
|
+
normalized.to = params.to.toISOString();
|
|
3019
|
+
}
|
|
3020
|
+
return normalized;
|
|
3021
|
+
}
|
|
3022
|
+
}
|
|
3023
|
+
|
|
2972
3024
|
// import integrations
|
|
2973
3025
|
class Integrations extends IntegrationsBaseClient {
|
|
2974
3026
|
constructor(options) {
|
|
@@ -2982,6 +3034,7 @@ class Integrations extends IntegrationsBaseClient {
|
|
|
2982
3034
|
'protokol-payments': new Payments().setClient(this.client),
|
|
2983
3035
|
'protokol-minimax': new Minimax().setClient(this.client),
|
|
2984
3036
|
'protokol-ecommerce': new Ecommerce().setClient(this.client),
|
|
3037
|
+
'protokol-timber': new Timber().setClient(this.client),
|
|
2985
3038
|
};
|
|
2986
3039
|
}
|
|
2987
3040
|
getSerbiaUtilities() {
|
|
@@ -3008,6 +3061,9 @@ class Integrations extends IntegrationsBaseClient {
|
|
|
3008
3061
|
getEcommerce() {
|
|
3009
3062
|
return this.getInterfaceOf('protokol-ecommerce');
|
|
3010
3063
|
}
|
|
3064
|
+
getTimber() {
|
|
3065
|
+
return this.getInterfaceOf('protokol-timber');
|
|
3066
|
+
}
|
|
3011
3067
|
async list() {
|
|
3012
3068
|
const { data } = await this.client.get("/v1/integrations");
|
|
3013
3069
|
return data;
|
|
@@ -3161,4 +3217,4 @@ function parsePRN(s) {
|
|
|
3161
3217
|
// Export all API modules for version 0.9
|
|
3162
3218
|
// This version has specific method signatures and behaviors for v0.9
|
|
3163
3219
|
|
|
3164
|
-
export { APIUser, Apps, Component, ComponentUtils, Config, DMS, Ecommerce, Forge, Functions, Integrations as Integration, Integrations, Invoicing, Mail, PRN, Payments, Platform, Project, Ratchet, Sandbox, SerbiaUtil, System, Thunder, Users, VPFR, Workflow, Platform as default, parsePRN };
|
|
3220
|
+
export { APIUser, Apps, Component, ComponentUtils, Config, DMS, Ecommerce, Forge, Functions, Integrations as Integration, Integrations, Invoicing, Mail, PRN, Payments, Platform, Project, Ratchet, Sandbox, SerbiaUtil, System, Thunder, Timber, Users, VPFR, Workflow, Platform as default, parsePRN };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export type TimberSource = 'system' | 'user';
|
|
2
|
+
export type TimberLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
3
|
+
export type TimberActorType = 'user' | 'api_key' | 'service' | 'system';
|
|
4
|
+
export interface TimberActor {
|
|
5
|
+
type: TimberActorType;
|
|
6
|
+
id: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
ip?: string;
|
|
9
|
+
user_agent?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface TimberChanges {
|
|
12
|
+
before?: Record<string, any>;
|
|
13
|
+
after?: Record<string, any>;
|
|
14
|
+
}
|
|
15
|
+
export interface TimberEntry {
|
|
16
|
+
id: string;
|
|
17
|
+
timestamp: string;
|
|
18
|
+
source: TimberSource;
|
|
19
|
+
level: TimberLevel;
|
|
20
|
+
service: string;
|
|
21
|
+
project_uuid: string;
|
|
22
|
+
actor: TimberActor;
|
|
23
|
+
action?: string;
|
|
24
|
+
resource_type?: string;
|
|
25
|
+
resource_id?: string;
|
|
26
|
+
resource_name?: string;
|
|
27
|
+
message?: string;
|
|
28
|
+
changes?: TimberChanges;
|
|
29
|
+
attributes?: Record<string, any>;
|
|
30
|
+
trace_id?: string;
|
|
31
|
+
span_id?: string;
|
|
32
|
+
request_id?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface TimberQueryParams {
|
|
35
|
+
limit?: number;
|
|
36
|
+
cursor?: string;
|
|
37
|
+
source?: TimberSource;
|
|
38
|
+
level?: TimberLevel;
|
|
39
|
+
from?: string | Date;
|
|
40
|
+
to?: string | Date;
|
|
41
|
+
actor_id?: string;
|
|
42
|
+
actor_name?: string;
|
|
43
|
+
actor_type?: TimberActorType;
|
|
44
|
+
action?: string;
|
|
45
|
+
resource_type?: string;
|
|
46
|
+
resource_id?: string;
|
|
47
|
+
request_uuid?: string;
|
|
48
|
+
search?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface TimberQueryResponse {
|
|
51
|
+
data: TimberEntry[];
|
|
52
|
+
meta: {
|
|
53
|
+
limit: number;
|
|
54
|
+
has_more: boolean;
|
|
55
|
+
next_cursor?: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export interface TimberWritePayload {
|
|
59
|
+
level?: TimberLevel;
|
|
60
|
+
message: string;
|
|
61
|
+
service?: string;
|
|
62
|
+
resource_type?: string;
|
|
63
|
+
resource_id?: string;
|
|
64
|
+
resource_name?: string;
|
|
65
|
+
attributes?: Record<string, any>;
|
|
66
|
+
trace_id?: string;
|
|
67
|
+
span_id?: string;
|
|
68
|
+
request_id?: string;
|
|
69
|
+
}
|
|
70
|
+
export type TimberLogPayload = Omit<TimberWritePayload, 'level'>;
|
|
71
|
+
export interface TimberUsage {
|
|
72
|
+
tier: 'free' | 'pro' | string;
|
|
73
|
+
period?: string;
|
|
74
|
+
bytes_ingested?: number;
|
|
75
|
+
gb_ingested?: number;
|
|
76
|
+
[key: string]: any;
|
|
77
|
+
}
|