@prisme.ai/sdk 1.0.0 → 1.0.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/Readme.md +3 -1
- package/dist/_virtual/_tslib.js +17 -8
- package/dist/lib/ImportProcessing.d.ts +19 -0
- package/dist/lib/WorkspacesEndpoint.d.ts +10 -0
- package/dist/lib/api.d.ts +88 -29
- package/dist/lib/endpoints/users.d.ts +13 -0
- package/dist/lib/endpoints/workspaces.d.ts +16 -0
- package/dist/lib/endpoints/workspacesVersions.d.ts +2 -2
- package/dist/lib/events.d.ts +5 -1
- package/dist/lib/fetch.d.ts +2 -0
- package/dist/lib/fetcher.d.ts +11 -3
- package/dist/lib/interpolate.d.ts +2 -0
- package/dist/lib/interpolate.test.d.ts +1 -0
- package/dist/lib/interpolateVars.d.ts +2 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/sdk/lib/ImportProcessing.js +17 -0
- package/dist/sdk/lib/WorkspacesEndpoint.js +19 -0
- package/dist/sdk/lib/api.js +248 -62
- package/dist/sdk/lib/endpoints/users.js +94 -0
- package/dist/sdk/lib/endpoints/workspaces.js +121 -0
- package/dist/sdk/lib/endpoints/workspacesVersions.js +4 -4
- package/dist/sdk/lib/events.js +51 -13
- package/dist/sdk/lib/fetch.js +12 -0
- package/dist/sdk/lib/fetcher.js +98 -42
- package/dist/sdk/lib/interpolate.js +26 -0
- package/dist/sdk/lib/interpolateVars.js +26 -0
- package/dist/sdk/lib/utils.js +48 -1
- package/lib/ImportProcessing.ts +22 -0
- package/lib/api.test.ts +90 -60
- package/lib/api.ts +318 -79
- package/lib/endpoints/users.ts +58 -0
- package/lib/endpoints/workspaces.ts +103 -0
- package/lib/endpoints/workspacesVersions.ts +13 -9
- package/lib/events.test.ts +2 -2
- package/lib/events.ts +60 -14
- package/lib/fetcher.ts +77 -12
- package/lib/utils.ts +39 -0
- package/package.json +3 -1
package/Readme.md
CHANGED
|
@@ -16,7 +16,9 @@ You can set a different host by instantiating the Api class:
|
|
|
16
16
|
|
|
17
17
|
```
|
|
18
18
|
import { Api } from '@prisme.ai/sdk';
|
|
19
|
-
const api = new Api(
|
|
19
|
+
const api = new Api({
|
|
20
|
+
host: 'https://my.custom.host'
|
|
21
|
+
})
|
|
20
22
|
```
|
|
21
23
|
|
|
22
24
|
You are able to call un authentified methods like signin or signup, but you'll need a valid token to call the other. Just set its property:
|
package/dist/_virtual/_tslib.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/******************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation.
|
|
7
7
|
|
|
8
8
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -16,7 +16,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
16
16
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
17
17
|
PERFORMANCE OF THIS SOFTWARE.
|
|
18
18
|
***************************************************************************** */
|
|
19
|
-
/* global Reflect, Promise */
|
|
19
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
20
20
|
|
|
21
21
|
var extendStatics = function(d, b) {
|
|
22
22
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -72,7 +72,7 @@ function __generator(thisArg, body) {
|
|
|
72
72
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
73
73
|
function step(op) {
|
|
74
74
|
if (f) throw new TypeError("Generator is already executing.");
|
|
75
|
-
while (_) try {
|
|
75
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
76
76
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
77
77
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
78
78
|
switch (op[0]) {
|
|
@@ -94,11 +94,20 @@ function __generator(thisArg, body) {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
function __spreadArray(to, from) {
|
|
98
|
-
for (var i = 0,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
function __spreadArray(to, from, pack) {
|
|
98
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
99
|
+
if (ar || !(i in from)) {
|
|
100
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
101
|
+
ar[i] = from[i];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
108
|
+
var e = new Error(message);
|
|
109
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
110
|
+
};
|
|
102
111
|
|
|
103
112
|
exports.__awaiter = __awaiter;
|
|
104
113
|
exports.__extends = __extends;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type ImportProcessing = {
|
|
2
|
+
processing?: boolean;
|
|
3
|
+
message?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare class ImportProcessingError extends Error {
|
|
6
|
+
error: ImportProcessing;
|
|
7
|
+
constructor(error: ImportProcessing);
|
|
8
|
+
}
|
|
9
|
+
export type ImportSuccess = {
|
|
10
|
+
createdWorkspaceIds?: string[];
|
|
11
|
+
updatedWorkspaceIds?: string[];
|
|
12
|
+
imported: string[];
|
|
13
|
+
errors?: {
|
|
14
|
+
[name: string]: any;
|
|
15
|
+
}[];
|
|
16
|
+
workspace?: Prismeai.DSULReadOnly;
|
|
17
|
+
publishedApps?: Prismeai.App[];
|
|
18
|
+
deleted?: string[];
|
|
19
|
+
};
|
package/dist/lib/api.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import Fetcher from './fetcher';
|
|
1
|
+
import Fetcher, { Fetched } from './fetcher';
|
|
2
2
|
import { Event, Workspace } from './types';
|
|
3
3
|
import { Events } from './events';
|
|
4
4
|
import WorkspacesEndpoint from './endpoints/workspaces';
|
|
5
|
+
import UsersEndpoint from './endpoints/users';
|
|
6
|
+
import { ImportSuccess } from './ImportProcessing';
|
|
5
7
|
export type UserPermissions = {
|
|
6
8
|
permissions: Prismeai.UserPermissions['permissions'];
|
|
7
9
|
target: {
|
|
@@ -12,21 +14,60 @@ export type UserPermissions = {
|
|
|
12
14
|
displayName?: string;
|
|
13
15
|
};
|
|
14
16
|
};
|
|
17
|
+
export interface ApiOptions {
|
|
18
|
+
host: string;
|
|
19
|
+
oidc?: {
|
|
20
|
+
url: string;
|
|
21
|
+
clientId: string;
|
|
22
|
+
clientIdHeader?: string;
|
|
23
|
+
redirectUri: string;
|
|
24
|
+
};
|
|
25
|
+
websockets?: {
|
|
26
|
+
transports?: string[];
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface AccessToken {
|
|
30
|
+
access_token: string;
|
|
31
|
+
id_token: string;
|
|
32
|
+
scope: string;
|
|
33
|
+
expiresIn: number;
|
|
34
|
+
token_type: 'Bearer';
|
|
35
|
+
}
|
|
36
|
+
export interface InteractiveSignin {
|
|
37
|
+
interaction: string;
|
|
38
|
+
login: string;
|
|
39
|
+
password: string;
|
|
40
|
+
remember?: boolean;
|
|
41
|
+
}
|
|
15
42
|
export declare class Api extends Fetcher {
|
|
43
|
+
opts: Required<ApiOptions>;
|
|
16
44
|
private sessionId?;
|
|
17
45
|
private _user?;
|
|
18
|
-
|
|
46
|
+
constructor(opts: ApiOptions);
|
|
47
|
+
get user(): (Prismeai.User & {
|
|
48
|
+
sessionId?: string | undefined;
|
|
49
|
+
}) | undefined;
|
|
19
50
|
me(): Promise<any>;
|
|
20
|
-
|
|
21
|
-
|
|
51
|
+
clientId(): string;
|
|
52
|
+
getAuthorizationURL(overrideRedirectUri?: string, authParams?: {
|
|
53
|
+
max_age?: string;
|
|
54
|
+
acr_values?: string;
|
|
55
|
+
}, locale?: string | undefined): Promise<{
|
|
56
|
+
url: string;
|
|
57
|
+
codeVerifier: string;
|
|
58
|
+
clientId: string;
|
|
59
|
+
}>;
|
|
60
|
+
signin(body: InteractiveSignin): Promise<{
|
|
61
|
+
redirectTo: string;
|
|
22
62
|
}>;
|
|
63
|
+
getToken(authorizationCode: string, codeVerifier: string, overrideRedirectUri?: string): Promise<AccessToken>;
|
|
23
64
|
createAnonymousSession(): Promise<Prismeai.User & {
|
|
24
65
|
token: string;
|
|
25
66
|
}>;
|
|
26
67
|
signup(email: string, password: string, firstName: string, lastName: string, language: string): Promise<Prismeai.User & {
|
|
27
68
|
token: string;
|
|
28
69
|
}>;
|
|
29
|
-
|
|
70
|
+
getSignoutURL(redirectUri?: string): string;
|
|
30
71
|
sendValidationMail(email: string, language: string): Promise<unknown>;
|
|
31
72
|
validateMail(token: string): Promise<unknown>;
|
|
32
73
|
sendPasswordResetMail(email: string, language: string): Promise<unknown>;
|
|
@@ -34,30 +75,33 @@ export declare class Api extends Fetcher {
|
|
|
34
75
|
getWorkspaces(): Promise<Workspace[]>;
|
|
35
76
|
getWorkspace(id: string): Promise<PrismeaiAPI.GetWorkspace.Responses.$200>;
|
|
36
77
|
getWorkspaceSecurity(id: string): Promise<PrismeaiAPI.GetSecurity.Responses.$200>;
|
|
37
|
-
updateWorkspaceSecurity(workspaceId: string, security: Prismeai.WorkspaceSecurity): Promise<PrismeaiAPI.UpdateSecurity.Responses.$200
|
|
38
|
-
getWorkspaceRoles(id: string): Promise<PrismeaiAPI.GetRoles.Responses.$200
|
|
39
|
-
|
|
78
|
+
updateWorkspaceSecurity(workspaceId: string, security: Prismeai.WorkspaceSecurity): Promise<Fetched<PrismeaiAPI.UpdateSecurity.Responses.$200>>;
|
|
79
|
+
getWorkspaceRoles(id: string): Promise<Fetched<PrismeaiAPI.GetRoles.Responses.$200>>;
|
|
80
|
+
getWorkspaceSecrets(id: string): Promise<Fetched<PrismeaiAPI.GetWorkspaceSecrets.Responses.$200>>;
|
|
81
|
+
updateWorkspaceSecrets(id: string, newSecrets: any): Promise<Workspace>;
|
|
82
|
+
deleteWorkspaceSecrets(id: string, secretName: string): Promise<Workspace>;
|
|
83
|
+
createWorkspace(newWorkspace: Partial<Prismeai.Workspace>): Promise<Workspace>;
|
|
40
84
|
duplicateWorkspace({ id }: {
|
|
41
85
|
id: string;
|
|
42
86
|
}): Promise<Workspace | null>;
|
|
43
|
-
updateWorkspace(workspace: Prismeai.DSULPatch): Promise<PrismeaiAPI.UpdateWorkspace.Responses.$200 | null>;
|
|
87
|
+
updateWorkspace(workspace: Prismeai.DSULPatch): Promise<Fetched<PrismeaiAPI.UpdateWorkspace.Responses.$200> | null>;
|
|
44
88
|
deleteWorkspace(workspaceId: Workspace['id']): Promise<Workspace>;
|
|
45
89
|
generateApiKey(workspaceId: Workspace['id'], events: string[], uploads?: string[]): Promise<string>;
|
|
46
90
|
updateApiKey(workspaceId: Workspace['id'], apiKey: string, events: string[], uploads?: string[]): Promise<string>;
|
|
47
|
-
getAutomation(workspaceId: string, automationSlug: string): Promise<PrismeaiAPI.GetAutomation.Responses.$200
|
|
48
|
-
createAutomation(workspaceId: Workspace['id'], automation: Prismeai.Automation): Promise<Prismeai.Automation & {
|
|
91
|
+
getAutomation(workspaceId: string, automationSlug: string): Promise<Fetched<PrismeaiAPI.GetAutomation.Responses.$200>>;
|
|
92
|
+
createAutomation(workspaceId: Workspace['id'], automation: Prismeai.Automation): Promise<Fetched<Prismeai.Automation & {
|
|
49
93
|
slug: string;
|
|
50
|
-
}
|
|
51
|
-
updateAutomation(workspaceId: string, slug: string, automation: Prismeai.Automation): Promise<Prismeai.Automation & {
|
|
94
|
+
}>>;
|
|
95
|
+
updateAutomation(workspaceId: string, slug: string, automation: Prismeai.Automation): Promise<Fetched<Prismeai.Automation & {
|
|
52
96
|
slug: string;
|
|
53
|
-
}
|
|
97
|
+
}>>;
|
|
54
98
|
deleteAutomation(workspaceId: string, slug: string): Promise<string>;
|
|
55
99
|
getPages(workspaceId: NonNullable<Workspace['id']>): Promise<Prismeai.Page[]>;
|
|
56
|
-
getPage(workspaceId: PrismeaiAPI.GetPage.Parameters.WorkspaceId, pageSlug: PrismeaiAPI.GetPage.Parameters.Slug): Promise<Prismeai.DetailedPage
|
|
57
|
-
getPageBySlug(workspaceSlug: PrismeaiAPI.GetPageBySlug.Parameters.WorkspaceSlug, pageSlug: PrismeaiAPI.GetPageBySlug.Parameters.PageSlug): Promise<Prismeai.DetailedPage
|
|
100
|
+
getPage(workspaceId: PrismeaiAPI.GetPage.Parameters.WorkspaceId, pageSlug: PrismeaiAPI.GetPage.Parameters.Slug): Promise<Fetched<Prismeai.DetailedPage>>;
|
|
101
|
+
getPageBySlug(workspaceSlug: PrismeaiAPI.GetPageBySlug.Parameters.WorkspaceSlug, pageSlug: PrismeaiAPI.GetPageBySlug.Parameters.PageSlug): Promise<Fetched<Prismeai.DetailedPage>>;
|
|
58
102
|
createPage(workspaceId: PrismeaiAPI.CreatePage.Parameters.WorkspaceId, page: PrismeaiAPI.CreatePage.RequestBody): Promise<Prismeai.Page>;
|
|
59
103
|
updatePage(workspaceId: PrismeaiAPI.UpdatePage.Parameters.WorkspaceId, page: PrismeaiAPI.UpdatePage.RequestBody, prevSlug?: PrismeaiAPI.DeletePage.Parameters.Slug): Promise<Prismeai.Page>;
|
|
60
|
-
deletePage(workspaceId: PrismeaiAPI.DeletePage.Parameters.WorkspaceId, pageSlug: PrismeaiAPI.DeletePage.Parameters.Slug): Promise<PrismeaiAPI.DeletePage.Responses.$200
|
|
104
|
+
deletePage(workspaceId: PrismeaiAPI.DeletePage.Parameters.WorkspaceId, pageSlug: PrismeaiAPI.DeletePage.Parameters.Slug): Promise<Fetched<PrismeaiAPI.DeletePage.Responses.$200>>;
|
|
61
105
|
streamEvents(workspaceId: string, filters?: Record<string, any>): Promise<Events>;
|
|
62
106
|
getEvents(workspaceId: string, options?: Record<string, any>): Promise<Event<Date>[]>;
|
|
63
107
|
postEvents(workspaceId: PrismeaiAPI.SendWorkspaceEvent.Parameters.WorkspaceId, events: PrismeaiAPI.SendWorkspaceEvent.RequestBody['events']): Promise<boolean>;
|
|
@@ -66,30 +110,45 @@ export declare class Api extends Fetcher {
|
|
|
66
110
|
result: UserPermissions[];
|
|
67
111
|
}>;
|
|
68
112
|
addPermissions(subjectType: PrismeaiAPI.GetPermissions.Parameters.SubjectType, subjectId: string, permissions: UserPermissions): Promise<UserPermissions>;
|
|
69
|
-
deletePermissions(subjectType: PrismeaiAPI.GetPermissions.Parameters.SubjectType, subjectId: string, id: string): Promise<PrismeaiAPI.RevokePermissions.Responses.$200
|
|
113
|
+
deletePermissions(subjectType: PrismeaiAPI.GetPermissions.Parameters.SubjectType, subjectId: string, id: string): Promise<Fetched<PrismeaiAPI.RevokePermissions.Responses.$200>>;
|
|
70
114
|
getApps({ query, page, limit, workspaceId, }: {
|
|
71
115
|
query?: PrismeaiAPI.SearchApps.QueryParameters['text'];
|
|
72
116
|
page?: PrismeaiAPI.SearchApps.QueryParameters['page'];
|
|
73
117
|
limit?: PrismeaiAPI.SearchApps.QueryParameters['limit'];
|
|
74
118
|
workspaceId?: PrismeaiAPI.SearchApps.QueryParameters['workspaceId'];
|
|
75
|
-
}): Promise<PrismeaiAPI.SearchApps.Responses.$200
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
119
|
+
}): Promise<Fetched<PrismeaiAPI.SearchApps.Responses.$200>>;
|
|
120
|
+
getApp({ slug, }: {
|
|
121
|
+
slug?: PrismeaiAPI.GetApp.PathParameters['appSlug'];
|
|
122
|
+
}): Promise<Fetched<PrismeaiAPI.GetApp.Responses.$200>>;
|
|
123
|
+
installApp(workspaceId: PrismeaiAPI.InstallAppInstance.PathParameters['workspaceId'], body: PrismeaiAPI.InstallAppInstance.RequestBody): Promise<Fetched<PrismeaiAPI.InstallAppInstance.Responses.$200>>;
|
|
124
|
+
updateApp(workspaceId: PrismeaiAPI.ConfigureAppInstance.PathParameters['workspaceId'], slug: PrismeaiAPI.ConfigureAppInstance.PathParameters['slug'], body: PrismeaiAPI.ConfigureAppInstance.RequestBody): Promise<Fetched<PrismeaiAPI.ConfigureAppInstance.Responses.$200>>;
|
|
125
|
+
uninstallApp(workspaceId: PrismeaiAPI.UninstallAppInstance.PathParameters['workspaceId'], slug: PrismeaiAPI.ConfigureAppInstance.PathParameters['slug']): Promise<Fetched<PrismeaiAPI.UninstallAppInstance.Responses.$200>>;
|
|
126
|
+
publishApp(body: PrismeaiAPI.PublishApp.RequestBody): Promise<Fetched<PrismeaiAPI.PublishApp.Responses.$200>>;
|
|
127
|
+
listAppInstances(workspaceId: PrismeaiAPI.ListAppInstances.PathParameters['workspaceId']): Promise<Fetched<PrismeaiAPI.ListAppInstances.Responses.$200>>;
|
|
81
128
|
getAppConfig<T>(workspaceId: PrismeaiAPI.GetAppInstanceConfig.Parameters.WorkspaceId, slug: PrismeaiAPI.GetAppInstanceConfig.Parameters.Slug): Promise<T>;
|
|
82
129
|
updateAppConfig(workspaceId: PrismeaiAPI.UpdateAppInstanceConfig.Parameters.WorkspaceId, slug: PrismeaiAPI.UpdateAppInstanceConfig.Parameters.Slug, config: any): Promise<PrismeaiAPI.UpdateAppInstanceConfig.Responses.$200['config']>;
|
|
83
|
-
getAppInstance(workspaceId: string, slug: string): Promise<PrismeaiAPI.GetAppInstance.Responses.$200
|
|
84
|
-
saveAppInstance(workspaceId: PrismeaiAPI.ConfigureAppInstance.Parameters.WorkspaceId, slug: PrismeaiAPI.ConfigureAppInstance.Parameters.Slug, appInstance: PrismeaiAPI.ConfigureAppInstance.RequestBody): Promise<PrismeaiAPI.ConfigureAppInstance.Responses.$200
|
|
85
|
-
uploadFiles(files: string | string[], workspaceId: string
|
|
130
|
+
getAppInstance(workspaceId: string, slug: string): Promise<Fetched<PrismeaiAPI.GetAppInstance.Responses.$200>>;
|
|
131
|
+
saveAppInstance(workspaceId: PrismeaiAPI.ConfigureAppInstance.Parameters.WorkspaceId, slug: PrismeaiAPI.ConfigureAppInstance.Parameters.Slug, appInstance: PrismeaiAPI.ConfigureAppInstance.RequestBody): Promise<Fetched<PrismeaiAPI.ConfigureAppInstance.Responses.$200>>;
|
|
132
|
+
uploadFiles(files: string | string[], workspaceId: string, opts?: {
|
|
133
|
+
expiresAfter?: number;
|
|
134
|
+
public?: boolean;
|
|
135
|
+
shareToken?: boolean;
|
|
136
|
+
}): Promise<PrismeaiAPI.UploadFile.Responses.$200>;
|
|
86
137
|
replaceAllImagesData(original: any, workspaceId: string): Promise<any>;
|
|
87
|
-
|
|
138
|
+
getAutomationFromUrl(workspaceId: string, url: string): string | false;
|
|
139
|
+
callAutomation(workspaceId: string, automation: string, params?: any): Promise<Fetched<any>>;
|
|
140
|
+
testAutomation({ workspaceId, automation, payload, }: {
|
|
141
|
+
workspaceId: string;
|
|
142
|
+
automation: string;
|
|
143
|
+
payload?: Record<string, any>;
|
|
144
|
+
}): Promise<Fetched<any>>;
|
|
88
145
|
getWorkspaceUsage(workspaceId: PrismeaiAPI.WorkspaceUsage.Parameters.WorkspaceId, { afterDate, beforeDate, details, }?: {
|
|
89
146
|
afterDate?: PrismeaiAPI.WorkspaceUsage.Parameters.AfterDate;
|
|
90
147
|
beforeDate?: PrismeaiAPI.WorkspaceUsage.Parameters.BeforeDate;
|
|
91
148
|
details?: PrismeaiAPI.WorkspaceUsage.Parameters.Details;
|
|
92
|
-
}): Promise<PrismeaiAPI.WorkspaceUsage.Responses.$200
|
|
149
|
+
}): Promise<Fetched<PrismeaiAPI.WorkspaceUsage.Responses.$200>>;
|
|
150
|
+
importArchive(archive: File): Promise<ImportSuccess>;
|
|
151
|
+
users(id?: string): UsersEndpoint;
|
|
93
152
|
workspaces(id: string): WorkspacesEndpoint;
|
|
94
153
|
}
|
|
95
154
|
declare const _default: Api;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Api } from '../api';
|
|
2
|
+
export declare class UsersEndpoint {
|
|
3
|
+
private id;
|
|
4
|
+
private api;
|
|
5
|
+
constructor(id: string, api: Api);
|
|
6
|
+
update(data: Partial<Prismeai.User>): Promise<PrismeaiAPI.PatchUser.Responses.$200>;
|
|
7
|
+
updatePhoto(photo: string): Promise<PrismeaiAPI.PostUserPhoto.Responses.$200>;
|
|
8
|
+
setMeta(k: string, v: any): Promise<PrismeaiAPI.SetMeta.Responses.$200>;
|
|
9
|
+
deleteMeta(k: string): Promise<PrismeaiAPI.DeleteMeta.Responses.$200>;
|
|
10
|
+
sendDeleteValidation(): Promise<unknown>;
|
|
11
|
+
delete(token?: string): Promise<unknown>;
|
|
12
|
+
}
|
|
13
|
+
export default UsersEndpoint;
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
import { Api } from '../api';
|
|
2
|
+
import { Fetched } from '../fetcher';
|
|
3
|
+
import { ImportSuccess } from '../ImportProcessing';
|
|
2
4
|
import WorkspacesVersionsEndpoint from './workspacesVersions';
|
|
3
5
|
export declare class WorkspacesEndpoint {
|
|
4
6
|
private id;
|
|
5
7
|
private api;
|
|
6
8
|
constructor(id: string, api: Api);
|
|
7
9
|
get versions(): WorkspacesVersionsEndpoint;
|
|
10
|
+
update(workspace: Prismeai.DSULPatch): Promise<Fetched<PrismeaiAPI.UpdateWorkspace.Responses.$200> | null>;
|
|
11
|
+
delete(): Promise<PrismeaiAPI.DeleteWorkspace.Responses.$200>;
|
|
12
|
+
uploadFiles(files: string | string[], opts?: {
|
|
13
|
+
expiresAfter?: number;
|
|
14
|
+
public?: boolean;
|
|
15
|
+
shareToken?: boolean;
|
|
16
|
+
}): Promise<PrismeaiAPI.UploadFile.Responses.$200>;
|
|
17
|
+
listAppInstances(): Promise<Fetched<PrismeaiAPI.ListAppInstances.Responses.$200>>;
|
|
18
|
+
getUsage({ afterDate, beforeDate, details, }?: {
|
|
19
|
+
afterDate?: PrismeaiAPI.WorkspaceUsage.Parameters.AfterDate;
|
|
20
|
+
beforeDate?: PrismeaiAPI.WorkspaceUsage.Parameters.BeforeDate;
|
|
21
|
+
details?: PrismeaiAPI.WorkspaceUsage.Parameters.Details;
|
|
22
|
+
}): Promise<Fetched<PrismeaiAPI.WorkspaceUsage.Responses.$200>>;
|
|
23
|
+
importArchive(archive: File): Promise<ImportSuccess>;
|
|
8
24
|
}
|
|
9
25
|
export default WorkspacesEndpoint;
|
|
@@ -3,8 +3,8 @@ export declare class WorkspacesVersionsEndpoint {
|
|
|
3
3
|
private workspaceId;
|
|
4
4
|
private api;
|
|
5
5
|
constructor(workspaceId: string, api: Api);
|
|
6
|
-
create(version?: PrismeaiAPI.PublishWorkspaceVersion.RequestBody):
|
|
7
|
-
rollback(versionId: PrismeaiAPI.
|
|
6
|
+
create(version?: PrismeaiAPI.PublishWorkspaceVersion.RequestBody): Promise<unknown>;
|
|
7
|
+
rollback(versionId: PrismeaiAPI.PullWorkspaceVersion.PathParameters['versionId'], opts?: PrismeaiAPI.PullWorkspaceVersion.RequestBody): Promise<unknown>;
|
|
8
8
|
export(version?: PrismeaiAPI.ExportWorkspaceVersion.Parameters.VersionId): Promise<Blob>;
|
|
9
9
|
}
|
|
10
10
|
export default WorkspacesVersionsEndpoint;
|
package/dist/lib/events.d.ts
CHANGED
|
@@ -12,13 +12,17 @@ export declare class Events {
|
|
|
12
12
|
private filters;
|
|
13
13
|
private listenedUserTopics;
|
|
14
14
|
private listeners;
|
|
15
|
-
|
|
15
|
+
private lastReceivedEventDate;
|
|
16
|
+
private socketId?;
|
|
17
|
+
constructor({ workspaceId, token, legacyToken, apiKey, apiHost, filters, api, transports, }: {
|
|
16
18
|
workspaceId: string;
|
|
17
19
|
token: string;
|
|
20
|
+
legacyToken?: string;
|
|
18
21
|
apiKey?: string;
|
|
19
22
|
apiHost?: string;
|
|
20
23
|
filters?: Record<string, any>;
|
|
21
24
|
api: Api;
|
|
25
|
+
transports?: string[];
|
|
22
26
|
});
|
|
23
27
|
get socket(): Socket<import("@socket.io/component-emitter").DefaultEventsMap, import("@socket.io/component-emitter").DefaultEventsMap>;
|
|
24
28
|
destroy(): void;
|
package/dist/lib/fetcher.d.ts
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
|
+
export type Fetched<T> = T & {
|
|
2
|
+
headers?: Record<string, any>;
|
|
3
|
+
};
|
|
1
4
|
export declare class Fetcher {
|
|
2
5
|
host: string;
|
|
3
6
|
token: string | null;
|
|
7
|
+
legacyToken: string | null;
|
|
8
|
+
overwriteClientId?: string;
|
|
9
|
+
private clientIdHeader?;
|
|
4
10
|
protected _apiKey: string | null;
|
|
11
|
+
protected _csrfToken: string | null;
|
|
5
12
|
language: string | undefined;
|
|
6
|
-
|
|
13
|
+
lastReceivedHeaders?: Record<string, any>;
|
|
14
|
+
constructor(host: string, clientIdHeader?: string);
|
|
7
15
|
set apiKey(apiKey: string);
|
|
8
16
|
prepareRequest(url: string, options?: RequestInit): Promise<Response>;
|
|
9
|
-
protected _fetch<T>(url: string, options?: RequestInit): Promise<T>;
|
|
17
|
+
protected _fetch<T>(url: string, options?: RequestInit, maxRetries?: number): Promise<T>;
|
|
10
18
|
get<T = any>(url: string): Promise<T>;
|
|
11
|
-
post<T>(url: string, body?: Record<string, any
|
|
19
|
+
post<T>(url: string, body?: Record<string, any>, opts?: RequestInit): Promise<T>;
|
|
12
20
|
put<T>(url: string, body: Record<string, any>): Promise<T>;
|
|
13
21
|
patch<T>(url: string, body: Record<string, any>): Promise<T>;
|
|
14
22
|
delete<T>(url: string): Promise<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
1
|
export declare const removedUndefinedProperties: (obj: any, removeEmptyStrings?: boolean) => any;
|
|
2
|
+
export declare function dataURItoBlob(dataURI: string): [Blob, string];
|
|
3
|
+
export declare function isDataURL(file: any): file is string;
|
|
4
|
+
export declare function wait(delay?: number): Promise<unknown>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _tslib = require('../../_virtual/_tslib.js');
|
|
6
|
+
|
|
7
|
+
var ImportProcessingError = /** @class */ (function (_super) {
|
|
8
|
+
_tslib.__extends(ImportProcessingError, _super);
|
|
9
|
+
function ImportProcessingError(error) {
|
|
10
|
+
var _this = _super.call(this) || this;
|
|
11
|
+
_this.error = error;
|
|
12
|
+
return _this;
|
|
13
|
+
}
|
|
14
|
+
return ImportProcessingError;
|
|
15
|
+
}(Error));
|
|
16
|
+
|
|
17
|
+
exports.ImportProcessingError = ImportProcessingError;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var WorkspacesEndpoint = /** @class */ (function () {
|
|
6
|
+
function WorkspacesEndpoint(id, api) {
|
|
7
|
+
this.versions = {
|
|
8
|
+
create: this.versionCreate.bind(this),
|
|
9
|
+
};
|
|
10
|
+
this.id = id;
|
|
11
|
+
this.api = api;
|
|
12
|
+
}
|
|
13
|
+
WorkspacesEndpoint.prototype.versionCreate = function () {
|
|
14
|
+
console.log('créer version pour', this.id, this.api);
|
|
15
|
+
};
|
|
16
|
+
return WorkspacesEndpoint;
|
|
17
|
+
}());
|
|
18
|
+
|
|
19
|
+
exports.WorkspacesEndpoint = WorkspacesEndpoint;
|