@substrate/playground-client
Advanced tools
Comparing version 1.5.1 to 1.5.2
@@ -7,2 +7,3 @@ import { Playground, Pool, Session, SessionConfiguration, SessionUpdateConfiguration, User, UserConfiguration, UserUpdateConfiguration } from './types'; | ||
static sessionsResource: string; | ||
static templatesResource: string; | ||
static poolsResource: string; | ||
@@ -26,2 +27,3 @@ private readonly base; | ||
deleteCurrentSession(init?: RequestInit): Promise<void>; | ||
getSession(id: string, init?: RequestInit): Promise<Session | null>; | ||
listSessions(init?: RequestInit): Promise<Record<string, Session>>; | ||
@@ -31,2 +33,3 @@ createSession(id: string, conf: SessionConfiguration, init?: RequestInit): Promise<void>; | ||
deleteSession(id: string, init?: RequestInit): Promise<void>; | ||
listTemplates(init?: RequestInit): Promise<Record<string, Session>>; | ||
getPool(id: string, init?: RequestInit): Promise<Pool | null>; | ||
@@ -33,0 +36,0 @@ listPools(init?: RequestInit): Promise<Record<string, Pool>>; |
@@ -82,2 +82,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
// Sessions | ||
getSession(id, init = this.defaultInit) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return rpc(this.path(Client.sessionsResource, id), init, this.timeout); | ||
}); | ||
} | ||
listSessions(init = this.defaultInit) { | ||
@@ -103,2 +108,8 @@ return __awaiter(this, void 0, void 0, function* () { | ||
} | ||
// Templates | ||
listTemplates(init = this.defaultInit) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return rpc(this.path(Client.templatesResource), init, this.timeout); | ||
}); | ||
} | ||
// Pools | ||
@@ -131,2 +142,3 @@ getPool(id, init = this.defaultInit) { | ||
Client.sessionsResource = 'sessions'; | ||
Client.templatesResource = 'templates'; | ||
Client.poolsResource = 'pools'; | ||
@@ -133,0 +145,0 @@ export * from "./login"; |
@@ -7,2 +7,3 @@ import { Playground, Pool, Session, SessionConfiguration, SessionUpdateConfiguration, User, UserConfiguration, UserUpdateConfiguration } from './types'; | ||
static sessionsResource: string; | ||
static templatesResource: string; | ||
static poolsResource: string; | ||
@@ -26,2 +27,3 @@ private readonly base; | ||
deleteCurrentSession(init?: RequestInit): Promise<void>; | ||
getSession(id: string, init?: RequestInit): Promise<Session | null>; | ||
listSessions(init?: RequestInit): Promise<Record<string, Session>>; | ||
@@ -31,2 +33,3 @@ createSession(id: string, conf: SessionConfiguration, init?: RequestInit): Promise<void>; | ||
deleteSession(id: string, init?: RequestInit): Promise<void>; | ||
listTemplates(init?: RequestInit): Promise<Record<string, Session>>; | ||
getPool(id: string, init?: RequestInit): Promise<Pool | null>; | ||
@@ -33,0 +36,0 @@ listPools(init?: RequestInit): Promise<Record<string, Pool>>; |
@@ -177,2 +177,10 @@ "use strict"; | ||
// Sessions | ||
Client.prototype.getSession = function (id, init) { | ||
if (init === void 0) { init = this.defaultInit; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, rpc_1.rpc(this.path(Client.sessionsResource, id), init, this.timeout)]; | ||
}); | ||
}); | ||
}; | ||
Client.prototype.listSessions = function (init) { | ||
@@ -210,2 +218,11 @@ if (init === void 0) { init = this.defaultInit; } | ||
}; | ||
// Templates | ||
Client.prototype.listTemplates = function (init) { | ||
if (init === void 0) { init = this.defaultInit; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, rpc_1.rpc(this.path(Client.templatesResource), init, this.timeout)]; | ||
}); | ||
}); | ||
}; | ||
// Pools | ||
@@ -249,2 +266,3 @@ Client.prototype.getPool = function (id, init) { | ||
Client.sessionsResource = 'sessions'; | ||
Client.templatesResource = 'templates'; | ||
Client.poolsResource = 'pools'; | ||
@@ -251,0 +269,0 @@ return Client; |
{ | ||
"name": "@substrate/playground-client", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"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
53793
1187