@ptkl/sdk 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +305 -315
- package/dist/index.esm.js +294 -305
- package/dist/index.umd.js +305 -315
- package/dist/types/api/apiUser.d.ts +3 -3
- package/dist/types/api/apps.d.ts +3 -3
- package/dist/types/api/baseClient.d.ts +1 -0
- package/dist/types/api/component.d.ts +30 -18
- package/dist/types/api/componentUtils.d.ts +5 -0
- package/dist/types/api/forge.d.ts +2 -3
- package/dist/types/api/functions.d.ts +2 -2
- package/dist/types/api/integrations/invoicing.d.ts +2 -2
- package/dist/types/api/integrations/media.d.ts +2 -2
- package/dist/types/api/integrations/serbiaUtil.d.ts +2 -2
- package/dist/types/api/integrations/vpfr.d.ts +2 -2
- package/dist/types/api/integrations.d.ts +7 -4
- package/dist/types/api/integrationsBaseClient.d.ts +8 -0
- package/dist/types/api/platform.d.ts +4 -12
- package/dist/types/api/platformBaseClient.d.ts +27 -0
- package/dist/types/api/ratchet.d.ts +2 -2
- package/dist/types/api/roles.d.ts +2 -2
- package/dist/types/api/sandbox.d.ts +2 -2
- package/dist/types/api/system.d.ts +2 -2
- package/dist/types/api/thunder.d.ts +2 -2
- package/dist/types/api/users.d.ts +2 -2
- package/dist/types/api/workflow.d.ts +2 -2
- package/dist/types/index.d.ts +12 -11
- package/dist/types/types/component.d.ts +4 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class APIUser extends
|
|
3
|
-
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class APIUser extends PlatformBaseClient {
|
|
3
|
+
auth(username: string, password: string, project: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
4
|
newSecret(uuid: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
5
|
revokeSecret(uuid: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
6
6
|
edit(uuid: string, roles: string[]): Promise<import("axios").AxiosResponse<any, any>>;
|
package/dist/types/api/apps.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class Apps extends
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class Apps extends PlatformBaseClient {
|
|
3
3
|
private appType;
|
|
4
|
-
constructor(
|
|
4
|
+
constructor(appType?: string);
|
|
5
5
|
updateSettings(updateValues: any, ref: string): Promise<any>;
|
|
6
6
|
download(ref: string, version: string): Promise<any>;
|
|
7
7
|
upload(formData: FormData): Promise<any>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model } from "src/types/component";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
export default class Component extends BaseClient {
|
|
1
|
+
import { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions } from "src/types/component";
|
|
2
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
3
|
+
export default class Component extends PlatformBaseClient {
|
|
5
4
|
private ref;
|
|
6
|
-
constructor(
|
|
7
|
-
new(ref: string): this;
|
|
5
|
+
constructor(ref?: string | null);
|
|
8
6
|
/**
|
|
9
7
|
* Find method to search for models
|
|
10
8
|
*
|
|
@@ -55,17 +53,31 @@ export default class Component extends BaseClient {
|
|
|
55
53
|
* @param data
|
|
56
54
|
* @returns
|
|
57
55
|
*/
|
|
58
|
-
update(uuid: string, data: Record<string, any
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
56
|
+
update(uuid: string, data: Record<string, any>, options: UpdateOptions): Promise<any>;
|
|
57
|
+
/**
|
|
58
|
+
* Update many models
|
|
59
|
+
*
|
|
60
|
+
* @param data
|
|
61
|
+
* @param options
|
|
62
|
+
* @returns
|
|
63
|
+
*/
|
|
64
|
+
updateMany(data: Record<string, any>[], options: UpdateOptions): Promise<any>;
|
|
65
|
+
/**
|
|
66
|
+
* Concurrent update model by uuid
|
|
67
|
+
*
|
|
68
|
+
* @param uuid string - The uuid of the model
|
|
69
|
+
* @param version number - The version of the model
|
|
70
|
+
* @param data
|
|
71
|
+
* @returns
|
|
72
|
+
*/
|
|
73
|
+
concurrentUpdate(uuid: string, version: number, data: Record<string, any>, options: UpdateOptions): Promise<any>;
|
|
74
|
+
create(model: Record<string, any>): Promise<any>;
|
|
75
|
+
delete(uuid: string): Promise<any>;
|
|
76
|
+
aggregate(pipeline: FindAggregateParams): Promise<any>;
|
|
77
|
+
settings(): Promise<any>;
|
|
78
|
+
saveSettings(settings: any, version: string): Promise<any>;
|
|
65
79
|
saveTemplatesDist(version: string, sdkVersion: string, engine: string, dist: Record<string, string>): Promise<any>;
|
|
66
|
-
workflow(event: string, input: any): Promise<
|
|
67
|
-
function(name: string, input: any): Promise<
|
|
68
|
-
all(): Promise<any>;
|
|
69
|
-
setup(data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
80
|
+
workflow(event: string, input: any): Promise<any>;
|
|
81
|
+
function(name: string, input: any): Promise<any>;
|
|
70
82
|
}
|
|
71
|
-
export { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model };
|
|
83
|
+
export { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class Forge extends
|
|
3
|
-
constructor(client: any);
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class Forge extends PlatformBaseClient {
|
|
4
3
|
bundleUpload(buffer: Buffer): Promise<any>;
|
|
5
4
|
getWorkspaceApps(): Promise<any>;
|
|
6
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class Functions extends
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class Functions extends PlatformBaseClient {
|
|
3
3
|
list(): Promise<any>;
|
|
4
4
|
get(ref: string): Promise<any>;
|
|
5
5
|
update(uuid: string, update: any): Promise<any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class Invoicing extends
|
|
1
|
+
import PlatformBaseClient from "../platformBaseClient";
|
|
2
|
+
export default class Invoicing extends PlatformBaseClient {
|
|
3
3
|
getSalesInvoices(provider: string, page: number): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
4
|
acceptPurchaseInvoice(provider: string, id: string, comment: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
5
|
request(method: string, endpoint: string, params: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class Media extends
|
|
1
|
+
import IntegrationsBaseClient from "../integrationsBaseClient";
|
|
2
|
+
export default class Media extends IntegrationsBaseClient {
|
|
3
3
|
list(data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
4
|
libraries(): Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
5
|
upload(payload: any): Promise<import("axios").AxiosResponse<any, any> | undefined>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class SerbiaUtil extends
|
|
1
|
+
import IntegrationsBaseClient from "../integrationsBaseClient";
|
|
2
|
+
export default class SerbiaUtil extends IntegrationsBaseClient {
|
|
3
3
|
nsbSearch(params: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
4
|
getReceiptFromUrl(url: string, source: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
5
|
getContoList(): Promise<import("axios").AxiosResponse<any, any>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class VPFR extends
|
|
1
|
+
import IntegrationsBaseClient from "../integrationsBaseClient";
|
|
2
|
+
export default class VPFR extends IntegrationsBaseClient {
|
|
3
3
|
request(method: string, endpoint: string, params?: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
4
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export default class Integrations extends BaseClient {
|
|
1
|
+
import IntegrationsBaseClient from "./integrationsBaseClient";
|
|
2
|
+
export default class Integrations extends IntegrationsBaseClient {
|
|
4
3
|
private integrations;
|
|
5
|
-
constructor(
|
|
4
|
+
constructor(options?: {
|
|
5
|
+
env?: string;
|
|
6
|
+
token?: string;
|
|
7
|
+
host?: string;
|
|
8
|
+
});
|
|
6
9
|
getSerbiaUtilities(): any;
|
|
7
10
|
getMedia(): any;
|
|
8
11
|
getVPFR(): any;
|
|
@@ -5,22 +5,14 @@ import APIUser from "./apiUser";
|
|
|
5
5
|
import Users from "./users";
|
|
6
6
|
import Apps from "./apps";
|
|
7
7
|
import Component from "./component";
|
|
8
|
-
import
|
|
8
|
+
import ComponentUtils from "./componentUtils";
|
|
9
9
|
import Ratchet from "./ratchet";
|
|
10
10
|
import Sandbox from "./sandbox";
|
|
11
11
|
import System from "./system";
|
|
12
12
|
import Workflow from "./workflow";
|
|
13
13
|
import Forge from "./forge";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
private integrationsClient;
|
|
17
|
-
constructor(options: {
|
|
18
|
-
env?: string;
|
|
19
|
-
token?: string;
|
|
20
|
-
host?: string;
|
|
21
|
-
integrationHost?: string;
|
|
22
|
-
});
|
|
23
|
-
setPlatformClient(client: AxiosInstance): void;
|
|
14
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
15
|
+
export default class Platform extends PlatformBaseClient {
|
|
24
16
|
getPlatformClient(): AxiosInstance;
|
|
25
17
|
getPlatformBaseURL(): string;
|
|
26
18
|
apiUser(): APIUser;
|
|
@@ -30,7 +22,7 @@ export default class Platform {
|
|
|
30
22
|
app(appType: string): Apps;
|
|
31
23
|
forge(): Forge;
|
|
32
24
|
component(ref: string): Component;
|
|
33
|
-
|
|
25
|
+
componentUtils(): ComponentUtils;
|
|
34
26
|
ratchet(): Ratchet;
|
|
35
27
|
sandbox(): Sandbox;
|
|
36
28
|
system(): System;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import BaseClient from "./baseClient";
|
|
2
|
+
/**
|
|
3
|
+
* Base client for the platform API
|
|
4
|
+
* Classes that extend PlatformBaseClient have intentins of only working in platform context
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* @class PlatformBaseClient
|
|
8
|
+
* @extends BaseClient
|
|
9
|
+
* @constructor
|
|
10
|
+
* @param {AxiosInstance} [client] - The axios instance to use for the client
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* // if sdk is used in the forge app that is running in the platform context
|
|
14
|
+
* const utils = new ComponentUtils()
|
|
15
|
+
* // this won't work outside of platform context because client needs authtorization to communicate with the API.
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
export default class PlatformBaseClient extends BaseClient {
|
|
19
|
+
protected env: string | null;
|
|
20
|
+
protected token: string | null;
|
|
21
|
+
protected host: string | null;
|
|
22
|
+
constructor(options?: {
|
|
23
|
+
env?: string;
|
|
24
|
+
token?: string;
|
|
25
|
+
host?: string;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class Roles extends
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class Roles extends PlatformBaseClient {
|
|
3
3
|
create(role: any): Promise<any>;
|
|
4
4
|
delete(uuid: string): Promise<any>;
|
|
5
5
|
list(): Promise<any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class Sandbox extends
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class Sandbox extends PlatformBaseClient {
|
|
3
3
|
/**
|
|
4
4
|
* Call the sandbox service to execute a serverless function
|
|
5
5
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class System extends
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class System extends PlatformBaseClient {
|
|
3
3
|
resourceResolver(ref: string, resourceName: string, format?: string): Promise<any>;
|
|
4
4
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class Thunder extends
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class Thunder extends PlatformBaseClient {
|
|
3
3
|
read(type: string, filters: any, flag: string, options?: any): Promise<any>;
|
|
4
4
|
write(type: string, filters: any, d: any, flag: any): Promise<any>;
|
|
5
5
|
operation(name: string, filters: any, data: any): Promise<any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class Users extends
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class Users extends PlatformBaseClient {
|
|
3
3
|
invite(email: string, roles: string[]): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
4
|
delete(uuid: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
5
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export default class Workflow extends
|
|
1
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
2
|
+
export default class Workflow extends PlatformBaseClient {
|
|
3
3
|
trigger(id: string, event: string, data: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
4
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import Platform from './api/platform';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
2
|
+
export { default as Component } from './api/component';
|
|
3
|
+
export { default as Integration } from './api/integrations';
|
|
4
|
+
export { default as Ratchet } from './api/ratchet';
|
|
5
|
+
export { default as Sandbox } from './api/sandbox';
|
|
6
|
+
export { default as System } from './api/system';
|
|
7
|
+
export { default as Users } from './api/users';
|
|
8
|
+
export { default as Functions } from './api/functions';
|
|
9
|
+
export { default as APIUser } from './api/apiUser';
|
|
10
|
+
export { default as Roles } from './api/roles';
|
|
11
|
+
export { default as Apps } from './api/apps';
|
|
12
|
+
export { default as Workflow } from './api/workflow';
|
|
13
|
+
export { default as ComponentUtils } from './api/componentUtils';
|
|
13
14
|
export default Platform;
|
|
@@ -41,4 +41,7 @@ type Model = {
|
|
|
41
41
|
deleted_by: string;
|
|
42
42
|
[key: string]: any;
|
|
43
43
|
};
|
|
44
|
-
|
|
44
|
+
type UpdateOptions = {
|
|
45
|
+
force_update_protected_fields: boolean;
|
|
46
|
+
};
|
|
47
|
+
export { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions };
|