@substrate/playground-client
Advanced tools
Comparing version 1.8.6 to 1.8.7
@@ -1,7 +0,5 @@ | ||
import { Playground, Pool, Workspace, WorkspaceConfiguration, WorkspaceUpdateConfiguration, User, UserConfiguration, UserUpdateConfiguration, Repository, RepositoryConfiguration, RepositoryUpdateConfiguration, RepositoryVersion, RepositoryVersionConfiguration, SessionConfiguration, Session, SessionUpdateConfiguration, Template, SessionExecutionConfiguration, SessionExecution } from './types'; | ||
import { Playground, Pool, User, UserConfiguration, UserUpdateConfiguration, Repository, RepositoryConfiguration, RepositoryUpdateConfiguration, RepositoryVersion, RepositoryVersionConfiguration, SessionConfiguration, Session, SessionUpdateConfiguration, Template, SessionExecutionConfiguration, SessionExecution } from './types'; | ||
export declare class Client { | ||
static userResource: string; | ||
static usersResource: string; | ||
static workspaceResource: string; | ||
static workspacesResource: string; | ||
static sessionResource: string; | ||
@@ -28,11 +26,2 @@ static sessionsResource: string; | ||
deleteUser(id: User['id'], timeout?: number, init?: RequestInit): Promise<void>; | ||
getCurrentWorkspace(timeout?: number, init?: RequestInit): Promise<Workspace | null>; | ||
createCurrentWorkspace(conf: WorkspaceConfiguration, timeout?: number, init?: RequestInit): Promise<void>; | ||
updateCurrentWorkspace(conf: WorkspaceUpdateConfiguration, timeout?: number, init?: RequestInit): Promise<void>; | ||
deleteCurrentWorkspace(timeout?: number, init?: RequestInit): Promise<void>; | ||
getWorkspace(id: Workspace['id'], timeout?: number, init?: RequestInit): Promise<Workspace | null>; | ||
listWorkspaces(timeout?: number, init?: RequestInit): Promise<Workspace[]>; | ||
createWorkspace(id: Workspace['id'], conf: WorkspaceConfiguration, timeout?: number, init?: RequestInit): Promise<void>; | ||
updateWorkspace(id: Workspace['id'], conf: WorkspaceUpdateConfiguration, timeout?: number, init?: RequestInit): Promise<void>; | ||
deleteWorkspace(id: Workspace['id'], timeout?: number, init?: RequestInit): Promise<void>; | ||
getCurrentSession(timeout?: number, init?: RequestInit): Promise<Session | null>; | ||
@@ -63,4 +52,4 @@ createCurrentSession(conf: SessionConfiguration, timeout?: number, init?: RequestInit): Promise<void>; | ||
export * from "./rpc"; | ||
export * from "./workspace"; | ||
export * from "./session"; | ||
export * from "./types"; | ||
export * from "./utils"; |
@@ -82,49 +82,2 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
// Current Workspace | ||
getCurrentWorkspace(timeout = this.defaultTimeout, init = this.defaultInit) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return rpc(this.path(Client.workspaceResource), init, timeout); | ||
}); | ||
} | ||
createCurrentWorkspace(conf, timeout = this.defaultTimeout, init = this.defaultInit) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return rpc(this.path(Client.workspaceResource), Object.assign({ method: 'PUT', body: JSON.stringify(conf) }, init), timeout); | ||
}); | ||
} | ||
updateCurrentWorkspace(conf, timeout = this.defaultTimeout, init = this.defaultInit) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return rpc(this.path(Client.workspaceResource), Object.assign({ method: 'PATCH', body: JSON.stringify(conf) }, init), timeout); | ||
}); | ||
} | ||
deleteCurrentWorkspace(timeout = this.defaultTimeout, init = this.defaultInit) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return rpc(this.path(Client.workspaceResource), Object.assign({ method: 'DELETE' }, init), timeout); | ||
}); | ||
} | ||
// Workspaces | ||
getWorkspace(id, timeout = this.defaultTimeout, init = this.defaultInit) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return rpc(this.path(Client.workspacesResource, id), init, timeout); | ||
}); | ||
} | ||
listWorkspaces(timeout = this.defaultTimeout, init = this.defaultInit) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return rpc(this.path(Client.workspacesResource), init, timeout); | ||
}); | ||
} | ||
createWorkspace(id, conf, timeout = this.defaultTimeout, init = this.defaultInit) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return rpc(this.path(Client.workspacesResource, id), Object.assign({ method: 'PUT', body: JSON.stringify(conf) }, init), timeout); | ||
}); | ||
} | ||
updateWorkspace(id, conf, timeout = this.defaultTimeout, init = this.defaultInit) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return rpc(this.path(Client.workspacesResource, id), Object.assign({ method: 'PATCH', body: JSON.stringify(conf) }, init), timeout); | ||
}); | ||
} | ||
deleteWorkspace(id, timeout = this.defaultTimeout, init = this.defaultInit) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return rpc(this.path(Client.workspacesResource, id), Object.assign({ method: 'DELETE' }, init), timeout); | ||
}); | ||
} | ||
// Current Session | ||
@@ -249,4 +202,2 @@ getCurrentSession(timeout = this.defaultTimeout, init = this.defaultInit) { | ||
Client.usersResource = 'users'; | ||
Client.workspaceResource = 'workspace'; | ||
Client.workspacesResource = 'workspaces'; | ||
Client.sessionResource = 'session'; | ||
@@ -260,4 +211,4 @@ Client.sessionsResource = 'sessions'; | ||
export * from "./rpc"; | ||
export * from "./workspace"; | ||
export * from "./session"; | ||
export * from "./types"; | ||
export * from "./utils"; |
@@ -13,5 +13,5 @@ export interface IdentifiedResource { | ||
githubClientId: string; | ||
workspace: WorkspaceDefaults; | ||
session: SessionDefaults; | ||
} | ||
export interface WorkspaceDefaults { | ||
export interface SessionDefaults { | ||
baseImage: string; | ||
@@ -21,34 +21,7 @@ duration: number; | ||
poolAffinity: string; | ||
maxWorkspacesPerPod: string; | ||
maxSessionsPerPod: string; | ||
} | ||
export interface Workspace extends IdentifiedResource, OwnedResource { | ||
repositoryDetails: RepositoryDetails; | ||
state: WorkspaceState; | ||
maxDuration: number; | ||
} | ||
export interface RepositoryDetails extends IdentifiedResource { | ||
reference: string; | ||
} | ||
export declare type WorkspaceState = { | ||
tag: "Deploying"; | ||
} | { | ||
tag: "Running"; | ||
startTime: number; | ||
node: Node; | ||
runtime: RepositoryRuntimeConfiguration; | ||
} | { | ||
tag: "Paused"; | ||
} | { | ||
tag: "Failed"; | ||
message: string; | ||
reason: string; | ||
}; | ||
export interface WorkspaceConfiguration { | ||
repositoryDetails: RepositoryDetails; | ||
duration?: number; | ||
poolAffinity?: string; | ||
} | ||
export interface WorkspaceUpdateConfiguration { | ||
duration?: number; | ||
} | ||
export interface User extends IdentifiedResource { | ||
@@ -55,0 +28,0 @@ admin: boolean; |
@@ -1,7 +0,5 @@ | ||
import { Playground, Pool, Workspace, WorkspaceConfiguration, WorkspaceUpdateConfiguration, User, UserConfiguration, UserUpdateConfiguration, Repository, RepositoryConfiguration, RepositoryUpdateConfiguration, RepositoryVersion, RepositoryVersionConfiguration, SessionConfiguration, Session, SessionUpdateConfiguration, Template, SessionExecutionConfiguration, SessionExecution } from './types'; | ||
import { Playground, Pool, User, UserConfiguration, UserUpdateConfiguration, Repository, RepositoryConfiguration, RepositoryUpdateConfiguration, RepositoryVersion, RepositoryVersionConfiguration, SessionConfiguration, Session, SessionUpdateConfiguration, Template, SessionExecutionConfiguration, SessionExecution } from './types'; | ||
export declare class Client { | ||
static userResource: string; | ||
static usersResource: string; | ||
static workspaceResource: string; | ||
static workspacesResource: string; | ||
static sessionResource: string; | ||
@@ -28,11 +26,2 @@ static sessionsResource: string; | ||
deleteUser(id: User['id'], timeout?: number, init?: RequestInit): Promise<void>; | ||
getCurrentWorkspace(timeout?: number, init?: RequestInit): Promise<Workspace | null>; | ||
createCurrentWorkspace(conf: WorkspaceConfiguration, timeout?: number, init?: RequestInit): Promise<void>; | ||
updateCurrentWorkspace(conf: WorkspaceUpdateConfiguration, timeout?: number, init?: RequestInit): Promise<void>; | ||
deleteCurrentWorkspace(timeout?: number, init?: RequestInit): Promise<void>; | ||
getWorkspace(id: Workspace['id'], timeout?: number, init?: RequestInit): Promise<Workspace | null>; | ||
listWorkspaces(timeout?: number, init?: RequestInit): Promise<Workspace[]>; | ||
createWorkspace(id: Workspace['id'], conf: WorkspaceConfiguration, timeout?: number, init?: RequestInit): Promise<void>; | ||
updateWorkspace(id: Workspace['id'], conf: WorkspaceUpdateConfiguration, timeout?: number, init?: RequestInit): Promise<void>; | ||
deleteWorkspace(id: Workspace['id'], timeout?: number, init?: RequestInit): Promise<void>; | ||
getCurrentSession(timeout?: number, init?: RequestInit): Promise<Session | null>; | ||
@@ -63,4 +52,4 @@ createCurrentSession(conf: SessionConfiguration, timeout?: number, init?: RequestInit): Promise<void>; | ||
export * from "./rpc"; | ||
export * from "./workspace"; | ||
export * from "./session"; | ||
export * from "./types"; | ||
export * from "./utils"; |
@@ -201,85 +201,2 @@ "use strict"; | ||
}; | ||
// Current Workspace | ||
Client.prototype.getCurrentWorkspace = function (timeout, init) { | ||
if (timeout === void 0) { timeout = this.defaultTimeout; } | ||
if (init === void 0) { init = this.defaultInit; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, (0, rpc_1.rpc)(this.path(Client.workspaceResource), init, timeout)]; | ||
}); | ||
}); | ||
}; | ||
Client.prototype.createCurrentWorkspace = function (conf, timeout, init) { | ||
if (timeout === void 0) { timeout = this.defaultTimeout; } | ||
if (init === void 0) { init = this.defaultInit; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, (0, rpc_1.rpc)(this.path(Client.workspaceResource), __assign({ method: 'PUT', body: JSON.stringify(conf) }, init), timeout)]; | ||
}); | ||
}); | ||
}; | ||
Client.prototype.updateCurrentWorkspace = function (conf, timeout, init) { | ||
if (timeout === void 0) { timeout = this.defaultTimeout; } | ||
if (init === void 0) { init = this.defaultInit; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, (0, rpc_1.rpc)(this.path(Client.workspaceResource), __assign({ method: 'PATCH', body: JSON.stringify(conf) }, init), timeout)]; | ||
}); | ||
}); | ||
}; | ||
Client.prototype.deleteCurrentWorkspace = function (timeout, init) { | ||
if (timeout === void 0) { timeout = this.defaultTimeout; } | ||
if (init === void 0) { init = this.defaultInit; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, (0, rpc_1.rpc)(this.path(Client.workspaceResource), __assign({ method: 'DELETE' }, init), timeout)]; | ||
}); | ||
}); | ||
}; | ||
// Workspaces | ||
Client.prototype.getWorkspace = function (id, timeout, init) { | ||
if (timeout === void 0) { timeout = this.defaultTimeout; } | ||
if (init === void 0) { init = this.defaultInit; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, (0, rpc_1.rpc)(this.path(Client.workspacesResource, id), init, timeout)]; | ||
}); | ||
}); | ||
}; | ||
Client.prototype.listWorkspaces = function (timeout, init) { | ||
if (timeout === void 0) { timeout = this.defaultTimeout; } | ||
if (init === void 0) { init = this.defaultInit; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, (0, rpc_1.rpc)(this.path(Client.workspacesResource), init, timeout)]; | ||
}); | ||
}); | ||
}; | ||
Client.prototype.createWorkspace = function (id, conf, timeout, init) { | ||
if (timeout === void 0) { timeout = this.defaultTimeout; } | ||
if (init === void 0) { init = this.defaultInit; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, (0, rpc_1.rpc)(this.path(Client.workspacesResource, id), __assign({ method: 'PUT', body: JSON.stringify(conf) }, init), timeout)]; | ||
}); | ||
}); | ||
}; | ||
Client.prototype.updateWorkspace = function (id, conf, timeout, init) { | ||
if (timeout === void 0) { timeout = this.defaultTimeout; } | ||
if (init === void 0) { init = this.defaultInit; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, (0, rpc_1.rpc)(this.path(Client.workspacesResource, id), __assign({ method: 'PATCH', body: JSON.stringify(conf) }, init), timeout)]; | ||
}); | ||
}); | ||
}; | ||
Client.prototype.deleteWorkspace = function (id, timeout, init) { | ||
if (timeout === void 0) { timeout = this.defaultTimeout; } | ||
if (init === void 0) { init = this.defaultInit; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, (0, rpc_1.rpc)(this.path(Client.workspacesResource, id), __assign({ method: 'DELETE' }, init), timeout)]; | ||
}); | ||
}); | ||
}; | ||
// Current Session | ||
@@ -491,4 +408,2 @@ Client.prototype.getCurrentSession = function (timeout, init) { | ||
Client.usersResource = 'users'; | ||
Client.workspaceResource = 'workspace'; | ||
Client.workspacesResource = 'workspaces'; | ||
Client.sessionResource = 'session'; | ||
@@ -505,4 +420,4 @@ Client.sessionsResource = 'sessions'; | ||
__exportStar(require("./rpc"), exports); | ||
__exportStar(require("./workspace"), exports); | ||
__exportStar(require("./session"), exports); | ||
__exportStar(require("./types"), exports); | ||
__exportStar(require("./utils"), exports); |
@@ -13,5 +13,5 @@ export interface IdentifiedResource { | ||
githubClientId: string; | ||
workspace: WorkspaceDefaults; | ||
session: SessionDefaults; | ||
} | ||
export interface WorkspaceDefaults { | ||
export interface SessionDefaults { | ||
baseImage: string; | ||
@@ -21,34 +21,7 @@ duration: number; | ||
poolAffinity: string; | ||
maxWorkspacesPerPod: string; | ||
maxSessionsPerPod: string; | ||
} | ||
export interface Workspace extends IdentifiedResource, OwnedResource { | ||
repositoryDetails: RepositoryDetails; | ||
state: WorkspaceState; | ||
maxDuration: number; | ||
} | ||
export interface RepositoryDetails extends IdentifiedResource { | ||
reference: string; | ||
} | ||
export declare type WorkspaceState = { | ||
tag: "Deploying"; | ||
} | { | ||
tag: "Running"; | ||
startTime: number; | ||
node: Node; | ||
runtime: RepositoryRuntimeConfiguration; | ||
} | { | ||
tag: "Paused"; | ||
} | { | ||
tag: "Failed"; | ||
message: string; | ||
reason: string; | ||
}; | ||
export interface WorkspaceConfiguration { | ||
repositoryDetails: RepositoryDetails; | ||
duration?: number; | ||
poolAffinity?: string; | ||
} | ||
export interface WorkspaceUpdateConfiguration { | ||
duration?: number; | ||
} | ||
export interface User extends IdentifiedResource { | ||
@@ -55,0 +28,0 @@ admin: boolean; |
{ | ||
"name": "@substrate/playground-client", | ||
"version": "1.8.6", | ||
"version": "1.8.7", | ||
"description": "An isomorphic client for Substrate Playground", | ||
@@ -5,0 +5,0 @@ "main": "dist/main/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85612
1792