sandbox0 0.1.2 → 0.1.3
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/apispec/src/models/PoolStrategy.d.ts +0 -6
- package/dist/apispec/src/models/PoolStrategy.d.ts.map +1 -1
- package/dist/apispec/src/models/PoolStrategy.js +0 -4
- package/dist/apispec/src/models/RegistryCredentials.d.ts +7 -1
- package/dist/apispec/src/models/RegistryCredentials.d.ts.map +1 -1
- package/dist/apispec/src/models/RegistryCredentials.js +7 -3
- package/dist/apispec/src/models/SandboxTemplateStatus.d.ts +1 -1
- package/dist/apispec/src/models/SandboxTemplateStatus.d.ts.map +1 -1
- package/dist/apispec/src/models/Template.d.ts +7 -0
- package/dist/apispec/src/models/Template.d.ts.map +1 -1
- package/dist/apispec/src/models/Template.js +3 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +3 -0
- package/dist/resources/templates.d.ts +13 -0
- package/dist/resources/templates.d.ts.map +1 -0
- package/dist/resources/templates.js +38 -0
- package/package.json +1 -1
|
@@ -27,12 +27,6 @@ export interface PoolStrategy {
|
|
|
27
27
|
* @memberof PoolStrategy
|
|
28
28
|
*/
|
|
29
29
|
maxIdle: number;
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* @type {boolean}
|
|
33
|
-
* @memberof PoolStrategy
|
|
34
|
-
*/
|
|
35
|
-
autoScale: boolean;
|
|
36
30
|
}
|
|
37
31
|
/**
|
|
38
32
|
* Check if a given object implements the PoolStrategy interface.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PoolStrategy.d.ts","sourceRoot":"","sources":["../../../../src/apispec/src/models/PoolStrategy.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH;;;;GAIG;AACH,MAAM,WAAW,YAAY;IACzB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"PoolStrategy.d.ts","sourceRoot":"","sources":["../../../../src/apispec/src/models/PoolStrategy.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH;;;;GAIG;AACH,MAAM,WAAW,YAAY;IACzB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,YAAY,CAI3E;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,GAAG,GAAG,YAAY,CAE5D;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,GAAG,EAAE,mBAAmB,EAAE,OAAO,GAAG,YAAY,CAS/F;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,GAAG,YAAY,CAE1D;AAED,wBAAgB,uBAAuB,CAAC,KAAK,CAAC,EAAE,YAAY,GAAG,IAAI,EAAE,mBAAmB,GAAE,OAAe,GAAG,GAAG,CAU9G"}
|
|
@@ -19,8 +19,6 @@ export function instanceOfPoolStrategy(value) {
|
|
|
19
19
|
return false;
|
|
20
20
|
if (!('maxIdle' in value) || value['maxIdle'] === undefined)
|
|
21
21
|
return false;
|
|
22
|
-
if (!('autoScale' in value) || value['autoScale'] === undefined)
|
|
23
|
-
return false;
|
|
24
22
|
return true;
|
|
25
23
|
}
|
|
26
24
|
export function PoolStrategyFromJSON(json) {
|
|
@@ -33,7 +31,6 @@ export function PoolStrategyFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
33
31
|
return {
|
|
34
32
|
'minIdle': json['minIdle'],
|
|
35
33
|
'maxIdle': json['maxIdle'],
|
|
36
|
-
'autoScale': json['autoScale'],
|
|
37
34
|
};
|
|
38
35
|
}
|
|
39
36
|
export function PoolStrategyToJSON(json) {
|
|
@@ -46,6 +43,5 @@ export function PoolStrategyToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
46
43
|
return {
|
|
47
44
|
'minIdle': value['minIdle'],
|
|
48
45
|
'maxIdle': value['maxIdle'],
|
|
49
|
-
'autoScale': value['autoScale'],
|
|
50
46
|
};
|
|
51
47
|
}
|
|
@@ -26,7 +26,13 @@ export interface RegistryCredentials {
|
|
|
26
26
|
* @type {string}
|
|
27
27
|
* @memberof RegistryCredentials
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
pushRegistry: string;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof RegistryCredentials
|
|
34
|
+
*/
|
|
35
|
+
pullRegistry: string;
|
|
30
36
|
/**
|
|
31
37
|
*
|
|
32
38
|
* @type {string}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegistryCredentials.d.ts","sourceRoot":"","sources":["../../../../src/apispec/src/models/RegistryCredentials.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAChC;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,
|
|
1
|
+
{"version":3,"file":"RegistryCredentials.d.ts","sourceRoot":"","sources":["../../../../src/apispec/src/models/RegistryCredentials.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAChC;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,mBAAmB,CAOzF;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,GAAG,GAAG,mBAAmB,CAE1E;AAED,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,GAAG,EAAE,mBAAmB,EAAE,OAAO,GAAG,mBAAmB,CAa7G;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,GAAG,GAAG,mBAAmB,CAExE;AAED,wBAAgB,8BAA8B,CAAC,KAAK,CAAC,EAAE,mBAAmB,GAAG,IAAI,EAAE,mBAAmB,GAAE,OAAe,GAAG,GAAG,CAc5H"}
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
export function instanceOfRegistryCredentials(value) {
|
|
18
18
|
if (!('provider' in value) || value['provider'] === undefined)
|
|
19
19
|
return false;
|
|
20
|
-
if (!('
|
|
20
|
+
if (!('pushRegistry' in value) || value['pushRegistry'] === undefined)
|
|
21
|
+
return false;
|
|
22
|
+
if (!('pullRegistry' in value) || value['pullRegistry'] === undefined)
|
|
21
23
|
return false;
|
|
22
24
|
if (!('username' in value) || value['username'] === undefined)
|
|
23
25
|
return false;
|
|
@@ -34,7 +36,8 @@ export function RegistryCredentialsFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
34
36
|
}
|
|
35
37
|
return {
|
|
36
38
|
'provider': json['provider'],
|
|
37
|
-
'
|
|
39
|
+
'pushRegistry': json['pushRegistry'],
|
|
40
|
+
'pullRegistry': json['pullRegistry'],
|
|
38
41
|
'username': json['username'],
|
|
39
42
|
'password': json['password'],
|
|
40
43
|
'expiresAt': json['expiresAt'] == null ? undefined : (new Date(json['expiresAt'])),
|
|
@@ -49,7 +52,8 @@ export function RegistryCredentialsToJSONTyped(value, ignoreDiscriminator = fals
|
|
|
49
52
|
}
|
|
50
53
|
return {
|
|
51
54
|
'provider': value['provider'],
|
|
52
|
-
'
|
|
55
|
+
'pushRegistry': value['pushRegistry'],
|
|
56
|
+
'pullRegistry': value['pullRegistry'],
|
|
53
57
|
'username': value['username'],
|
|
54
58
|
'password': value['password'],
|
|
55
59
|
'expiresAt': value['expiresAt'] == null ? value['expiresAt'] : value['expiresAt'].toISOString(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxTemplateStatus.d.ts","sourceRoot":"","sources":["../../../../src/apispec/src/models/SandboxTemplateStatus.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAQ3E;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IAClC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC7C;;;;OAIG;IACH,cAAc,CAAC,EAAE,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"SandboxTemplateStatus.d.ts","sourceRoot":"","sources":["../../../../src/apispec/src/models/SandboxTemplateStatus.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAQ3E;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IAClC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC7C;;;;OAIG;IACH,cAAc,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CAChC;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,qBAAqB,CAE7F;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,GAAG,GAAG,qBAAqB,CAE9E;AAED,wBAAgB,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,mBAAmB,EAAE,OAAO,GAAG,qBAAqB,CAWjH;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,GAAG,GAAG,qBAAqB,CAE5E;AAED,wBAAgB,gCAAgC,CAAC,KAAK,CAAC,EAAE,qBAAqB,GAAG,IAAI,EAAE,mBAAmB,GAAE,OAAe,GAAG,GAAG,CAYhI"}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import type { SandboxTemplateSpec } from './SandboxTemplateSpec';
|
|
13
|
+
import type { SandboxTemplateStatus } from './SandboxTemplateStatus';
|
|
13
14
|
/**
|
|
14
15
|
*
|
|
15
16
|
* @export
|
|
@@ -46,6 +47,12 @@ export interface Template {
|
|
|
46
47
|
* @memberof Template
|
|
47
48
|
*/
|
|
48
49
|
spec: SandboxTemplateSpec;
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @type {SandboxTemplateStatus}
|
|
53
|
+
* @memberof Template
|
|
54
|
+
*/
|
|
55
|
+
status?: SandboxTemplateStatus;
|
|
49
56
|
/**
|
|
50
57
|
*
|
|
51
58
|
* @type {Date}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Template.d.ts","sourceRoot":"","sources":["../../../../src/apispec/src/models/Template.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"Template.d.ts","sourceRoot":"","sources":["../../../../src/apispec/src/models/Template.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAOjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAQrE;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACrB;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,IAAI,EAAE,mBAAmB,CAAC;IAC1B;;;;OAIG;IACH,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B;;;;OAIG;IACH,SAAS,EAAE,IAAI,CAAC;IAChB;;;;OAIG;IACH,SAAS,EAAE,IAAI,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,QAAQ,CAOnE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAG,GAAG,QAAQ,CAEpD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,GAAG,EAAE,mBAAmB,EAAE,OAAO,GAAG,QAAQ,CAevF;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,GAAG,GAAG,QAAQ,CAElD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,EAAE,QAAQ,GAAG,IAAI,EAAE,mBAAmB,GAAE,OAAe,GAAG,GAAG,CAgBtG"}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
import { SandboxTemplateSpecFromJSON, SandboxTemplateSpecToJSON, } from './SandboxTemplateSpec';
|
|
15
|
+
import { SandboxTemplateStatusFromJSON, SandboxTemplateStatusToJSON, } from './SandboxTemplateStatus';
|
|
15
16
|
/**
|
|
16
17
|
* Check if a given object implements the Template interface.
|
|
17
18
|
*/
|
|
@@ -41,6 +42,7 @@ export function TemplateFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
41
42
|
'teamId': json['team_id'] == null ? undefined : json['team_id'],
|
|
42
43
|
'userId': json['user_id'] == null ? undefined : json['user_id'],
|
|
43
44
|
'spec': SandboxTemplateSpecFromJSON(json['spec']),
|
|
45
|
+
'status': json['status'] == null ? undefined : SandboxTemplateStatusFromJSON(json['status']),
|
|
44
46
|
'createdAt': (new Date(json['created_at'])),
|
|
45
47
|
'updatedAt': (new Date(json['updated_at'])),
|
|
46
48
|
};
|
|
@@ -58,6 +60,7 @@ export function TemplateToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
58
60
|
'team_id': value['teamId'],
|
|
59
61
|
'user_id': value['userId'],
|
|
60
62
|
'spec': SandboxTemplateSpecToJSON(value['spec']),
|
|
63
|
+
'status': SandboxTemplateStatusToJSON(value['status']),
|
|
61
64
|
'created_at': value['createdAt'].toISOString(),
|
|
62
65
|
'updated_at': value['updatedAt'].toISOString(),
|
|
63
66
|
};
|
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type * as runtimeTypes from "./apispec/src/runtime";
|
|
2
2
|
import type * as apisTypes from "./apispec/src/apis/index";
|
|
3
3
|
import { Sandboxes } from "./resources/sandboxes";
|
|
4
|
+
import { Templates } from "./resources/templates";
|
|
4
5
|
import { Volumes } from "./resources/volumes";
|
|
5
6
|
import { Sandbox } from "./sandbox";
|
|
6
7
|
export declare const DEFAULT_BASE_URL = "https://api.sandbox0.ai";
|
|
@@ -26,6 +27,7 @@ export declare class Client {
|
|
|
26
27
|
templates: apisTypes.TemplatesApi;
|
|
27
28
|
};
|
|
28
29
|
readonly sandboxes: Sandboxes;
|
|
30
|
+
readonly templates: Templates;
|
|
29
31
|
readonly volumes: Volumes;
|
|
30
32
|
constructor(options: ClientOptions);
|
|
31
33
|
sandbox(id: string): Sandbox;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,YAAY,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,KAAK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CAAC;KACnC,CAAC;IAEF,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;gBAEd,OAAO,EAAE,aAAa;IAgClC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAI5B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAc5B,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAUnD"}
|
package/dist/client.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { apis, runtime } from "./apispec_compat";
|
|
2
2
|
import { normalizeNullMapMiddleware } from "./response_normalize";
|
|
3
3
|
import { Sandboxes } from "./resources/sandboxes";
|
|
4
|
+
import { Templates } from "./resources/templates";
|
|
4
5
|
import { Volumes } from "./resources/volumes";
|
|
5
6
|
import { Sandbox } from "./sandbox";
|
|
6
7
|
export const DEFAULT_BASE_URL = "https://api.sandbox0.ai";
|
|
@@ -19,6 +20,7 @@ export class Client {
|
|
|
19
20
|
baseUrl;
|
|
20
21
|
apispec;
|
|
21
22
|
sandboxes;
|
|
23
|
+
templates;
|
|
22
24
|
volumes;
|
|
23
25
|
constructor(options) {
|
|
24
26
|
const headers = {
|
|
@@ -45,6 +47,7 @@ export class Client {
|
|
|
45
47
|
templates: new apis.TemplatesApi(this.configuration),
|
|
46
48
|
};
|
|
47
49
|
this.sandboxes = new Sandboxes(this);
|
|
50
|
+
this.templates = new Templates(this);
|
|
48
51
|
this.volumes = new Volumes(this);
|
|
49
52
|
}
|
|
50
53
|
sandbox(id) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Template, TemplateCreateRequest, TemplateUpdateRequest, SuccessMessageResponse } from "../apispec/src/models/index";
|
|
2
|
+
import type { Client } from "../client";
|
|
3
|
+
export declare class Templates {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: Client);
|
|
6
|
+
list(): Promise<Template[]>;
|
|
7
|
+
listTemplate(): Promise<Template[]>;
|
|
8
|
+
get(templateId: string): Promise<Template>;
|
|
9
|
+
create(request: TemplateCreateRequest): Promise<Template>;
|
|
10
|
+
update(templateId: string, request: TemplateUpdateRequest): Promise<Template>;
|
|
11
|
+
delete(templateId: string): Promise<SuccessMessageResponse>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/resources/templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,qBAAa,SAAS;IACR,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAErC,IAAI,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAS3B,YAAY,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAInC,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAO1C,MAAM,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC;IASzD,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAU7E,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAMlE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ensureData, ensureModel } from "../response";
|
|
2
|
+
import { wrapApiCall } from "../errors";
|
|
3
|
+
export class Templates {
|
|
4
|
+
client;
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
async list() {
|
|
9
|
+
const response = await wrapApiCall(() => this.client.apispec.templates.apiV1TemplatesGet());
|
|
10
|
+
const data = ensureData(response, "list templates returned empty response");
|
|
11
|
+
return data.templates ?? [];
|
|
12
|
+
}
|
|
13
|
+
// Backward-compatible alias.
|
|
14
|
+
async listTemplate() {
|
|
15
|
+
return this.list();
|
|
16
|
+
}
|
|
17
|
+
async get(templateId) {
|
|
18
|
+
const response = await wrapApiCall(() => this.client.apispec.templates.apiV1TemplatesIdGet({ id: templateId }));
|
|
19
|
+
return ensureData(response, "get template returned empty response");
|
|
20
|
+
}
|
|
21
|
+
async create(request) {
|
|
22
|
+
const response = await wrapApiCall(() => this.client.apispec.templates.apiV1TemplatesPost({
|
|
23
|
+
templateCreateRequest: request,
|
|
24
|
+
}));
|
|
25
|
+
return ensureData(response, "create template returned empty response");
|
|
26
|
+
}
|
|
27
|
+
async update(templateId, request) {
|
|
28
|
+
const response = await wrapApiCall(() => this.client.apispec.templates.apiV1TemplatesIdPut({
|
|
29
|
+
id: templateId,
|
|
30
|
+
templateUpdateRequest: request,
|
|
31
|
+
}));
|
|
32
|
+
return ensureData(response, "update template returned empty response");
|
|
33
|
+
}
|
|
34
|
+
async delete(templateId) {
|
|
35
|
+
const response = await wrapApiCall(() => this.client.apispec.templates.apiV1TemplatesIdDelete({ id: templateId }));
|
|
36
|
+
return ensureModel(response, "delete template returned empty response");
|
|
37
|
+
}
|
|
38
|
+
}
|