@toshicloud/sdk 0.5.1 → 0.7.0
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 +39 -455
- package/dist/client.d.ts +76 -6
- package/dist/client.js +20 -4
- package/dist/gen/toshi/permission_pb.d.ts +12 -0
- package/dist/gen/toshi/permission_pb.js +14 -2
- package/dist/gen/toshi/workspace/v1/connections_pb.d.ts +358 -29
- package/dist/gen/toshi/workspace/v1/connections_pb.js +112 -24
- package/dist/gen/toshi/workspace/v1/domains_pb.d.ts +26 -26
- package/dist/gen/toshi/workspace/v1/domains_pb.js +4 -4
- package/dist/gen/toshi/workspace/v1/{channels_pb.d.ts → endpoints_pb.d.ts} +945 -822
- package/dist/gen/toshi/workspace/v1/endpoints_pb.js +488 -0
- package/dist/gen/toshi/workspace/v1/grants_pb.d.ts +10 -10
- package/dist/gen/toshi/workspace/v1/grants_pb.js +3 -3
- package/dist/gen/toshi/workspace/v1/hostjobs_pb.d.ts +62 -24
- package/dist/gen/toshi/workspace/v1/hostjobs_pb.js +1 -1
- package/dist/gen/toshi/workspace/v1/hosts_pb.d.ts +110 -36
- package/dist/gen/toshi/workspace/v1/hosts_pb.js +1 -1
- package/dist/gen/toshi/workspace/v1/model_credentials_pb.d.ts +654 -0
- package/dist/gen/toshi/workspace/v1/model_credentials_pb.js +110 -0
- package/dist/gen/toshi/workspace/v1/recordings_pb.d.ts +21 -2
- package/dist/gen/toshi/workspace/v1/recordings_pb.js +1 -1
- package/dist/gen/toshi/workspace/v1/roles_pb.d.ts +1 -1
- package/dist/gen/toshi/workspace/v1/roles_pb.js +1 -1
- package/dist/gen/toshi/workspace/v1/secrets_pb.d.ts +19 -2
- package/dist/gen/toshi/workspace/v1/secrets_pb.js +1 -1
- package/dist/gen/toshi/workspace/v1/triggers_pb.d.ts +28 -28
- package/dist/gen/toshi/workspace/v1/triggers_pb.js +6 -6
- package/dist/gen/toshi/workspace/v1/webhook_pb.d.ts +202 -202
- package/dist/gen/toshi/workspace/v1/webhook_pb.js +46 -46
- package/dist/gen/toshi/workspace/v1/workloads_pb.d.ts +579 -30
- package/dist/gen/toshi/workspace/v1/workloads_pb.js +85 -55
- package/dist/gen/toshi/workspace/v1/workspace_pb.d.ts +991 -123
- package/dist/gen/toshi/workspace/v1/workspace_pb.js +294 -102
- package/dist/gen/toshi/workspace/v1/workspace_service_pb.d.ts +390 -8
- package/dist/gen/toshi/workspace/v1/workspace_service_pb.js +75 -50
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/retry.js +38 -22
- package/dist/test/alarms.d.ts +29 -0
- package/dist/test/alarms.js +144 -0
- package/dist/test/fake.js +31 -0
- package/dist/test/index.d.ts +12 -2
- package/dist/test/index.js +12 -2
- package/dist/test/procedures.js +40 -34
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/gen/toshi/workspace/v1/channels_pb.js +0 -483
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { clone, create } from "@bufbuild/protobuf";
|
|
2
|
+
import { DurationSchema, TimestampSchema } from "@bufbuild/protobuf/wkt";
|
|
3
|
+
import { Code, ConnectError } from "@connectrpc/connect";
|
|
4
|
+
import { DeleteServiceAlarmResponseSchema, GetServiceAlarmResponseSchema, ListServiceAlarmsResponseSchema, PauseServiceAlarmResponseSchema, ResumeServiceAlarmResponseSchema, RunServiceAlarmNowResponseSchema, ServiceAlarmMisfire, ServiceAlarmOccurrenceSchema, ServiceAlarmSchema, SetServiceAlarmResponseSchema, } from "../gen/toshi/workspace/v1/workloads_pb.js";
|
|
5
|
+
/** How late a missed instant may be published when SetServiceAlarm names no deadline. */
|
|
6
|
+
const defaultStartingDeadline = create(DurationSchema, { seconds: 600n });
|
|
7
|
+
/** How many occurrences GetServiceAlarm returns. */
|
|
8
|
+
const maxOccurrences = 20;
|
|
9
|
+
/**
|
|
10
|
+
* The alarms the fake keeps for any service ID: the fake holds no services. It
|
|
11
|
+
* has no clock, so an alarm publishes nothing on its own and a cron alarm has
|
|
12
|
+
* no next instant.
|
|
13
|
+
*/
|
|
14
|
+
export class AlarmStore {
|
|
15
|
+
alarms = new Map();
|
|
16
|
+
runs = new Map();
|
|
17
|
+
/** Creates the alarm at generation 1, or replaces it at the next generation, resumed. */
|
|
18
|
+
set(request) {
|
|
19
|
+
const alarm = create(ServiceAlarmSchema, {
|
|
20
|
+
name: request.name,
|
|
21
|
+
timezone: request.timezone,
|
|
22
|
+
endpoint: request.endpoint,
|
|
23
|
+
event: request.event,
|
|
24
|
+
data: request.data.slice(),
|
|
25
|
+
misfire: request.misfire,
|
|
26
|
+
startingDeadline: clone(DurationSchema, request.startingDeadline ?? defaultStartingDeadline),
|
|
27
|
+
generation: 1n,
|
|
28
|
+
});
|
|
29
|
+
switch (request.schedule.case) {
|
|
30
|
+
case "cron":
|
|
31
|
+
alarm.schedule = { case: "cron", value: request.schedule.value };
|
|
32
|
+
break;
|
|
33
|
+
case "at":
|
|
34
|
+
alarm.schedule = { case: "at", value: clone(TimestampSchema, request.schedule.value) };
|
|
35
|
+
alarm.nextAt = clone(TimestampSchema, request.schedule.value);
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
if (alarm.misfire === ServiceAlarmMisfire.UNSPECIFIED) {
|
|
39
|
+
alarm.misfire = ServiceAlarmMisfire.COALESCE;
|
|
40
|
+
}
|
|
41
|
+
const key = alarmKey(request.serviceId, request.name);
|
|
42
|
+
const held = this.alarms.get(key);
|
|
43
|
+
if (held === undefined) {
|
|
44
|
+
this.alarms.set(key, {
|
|
45
|
+
serviceId: request.serviceId,
|
|
46
|
+
name: request.name,
|
|
47
|
+
alarm,
|
|
48
|
+
occurrences: [],
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
alarm.generation = held.alarm.generation + 1n;
|
|
53
|
+
held.alarm = alarm;
|
|
54
|
+
}
|
|
55
|
+
return create(SetServiceAlarmResponseSchema, { alarm: clone(ServiceAlarmSchema, alarm) });
|
|
56
|
+
}
|
|
57
|
+
/** Returns the alarm and its most recent occurrences, newest first. */
|
|
58
|
+
get(request) {
|
|
59
|
+
const record = this.alarm(request.serviceId, request.name);
|
|
60
|
+
return create(GetServiceAlarmResponseSchema, {
|
|
61
|
+
alarm: clone(ServiceAlarmSchema, record.alarm),
|
|
62
|
+
occurrences: record.occurrences
|
|
63
|
+
.slice(0, maxOccurrences)
|
|
64
|
+
.map((occurrence) => clone(ServiceAlarmOccurrenceSchema, occurrence)),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/** Returns every alarm of the service, by name. */
|
|
68
|
+
list(request) {
|
|
69
|
+
const alarms = [];
|
|
70
|
+
for (const record of this.alarms.values()) {
|
|
71
|
+
if (record.serviceId === request.serviceId) {
|
|
72
|
+
alarms.push(clone(ServiceAlarmSchema, record.alarm));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
alarms.sort((a, b) => compareNames(a.name, b.name));
|
|
76
|
+
return create(ListServiceAlarmsResponseSchema, { alarms });
|
|
77
|
+
}
|
|
78
|
+
/** Removes an alarm and its occurrences. */
|
|
79
|
+
delete(request) {
|
|
80
|
+
this.alarm(request.serviceId, request.name);
|
|
81
|
+
this.alarms.delete(alarmKey(request.serviceId, request.name));
|
|
82
|
+
return create(DeleteServiceAlarmResponseSchema, {});
|
|
83
|
+
}
|
|
84
|
+
/** Pauses an alarm; pausing a paused alarm changes nothing. */
|
|
85
|
+
pause(request) {
|
|
86
|
+
const record = this.alarm(request.serviceId, request.name);
|
|
87
|
+
record.alarm.paused = true;
|
|
88
|
+
return create(PauseServiceAlarmResponseSchema, { alarm: clone(ServiceAlarmSchema, record.alarm) });
|
|
89
|
+
}
|
|
90
|
+
/** Resumes an alarm; resuming a running alarm changes nothing. */
|
|
91
|
+
resume(request) {
|
|
92
|
+
const record = this.alarm(request.serviceId, request.name);
|
|
93
|
+
record.alarm.paused = false;
|
|
94
|
+
return create(ResumeServiceAlarmResponseSchema, { alarm: clone(ServiceAlarmSchema, record.alarm) });
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Records a manual occurrence at the alarm's generation. A request key the
|
|
98
|
+
* fake has already answered returns the same occurrence.
|
|
99
|
+
*/
|
|
100
|
+
runNow(request) {
|
|
101
|
+
if (request.requestKey !== "") {
|
|
102
|
+
const answered = this.runs.get(request.requestKey);
|
|
103
|
+
if (answered !== undefined) {
|
|
104
|
+
return create(RunServiceAlarmNowResponseSchema, {
|
|
105
|
+
occurrence: clone(ServiceAlarmOccurrenceSchema, answered),
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const record = this.alarm(request.serviceId, request.name);
|
|
110
|
+
const occurrence = create(ServiceAlarmOccurrenceSchema, {
|
|
111
|
+
generation: record.alarm.generation,
|
|
112
|
+
manual: true,
|
|
113
|
+
});
|
|
114
|
+
record.occurrences.unshift(occurrence);
|
|
115
|
+
if (request.requestKey !== "") {
|
|
116
|
+
this.runs.set(request.requestKey, occurrence);
|
|
117
|
+
}
|
|
118
|
+
return create(RunServiceAlarmNowResponseSchema, { occurrence: clone(ServiceAlarmOccurrenceSchema, occurrence) });
|
|
119
|
+
}
|
|
120
|
+
/** Returns the alarm of a service with this name. */
|
|
121
|
+
alarm(serviceId, name) {
|
|
122
|
+
const record = this.alarms.get(alarmKey(serviceId, name));
|
|
123
|
+
if (record === undefined) {
|
|
124
|
+
throw new ConnectError(`toshi: no alarm "${serviceId}/${name}"`, Code.NotFound);
|
|
125
|
+
}
|
|
126
|
+
return record;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/** The map key of one alarm: its service and its name. */
|
|
130
|
+
function alarmKey(serviceId, name) {
|
|
131
|
+
return JSON.stringify([serviceId, name]);
|
|
132
|
+
}
|
|
133
|
+
/** Compares two names by the bytes of their UTF-8 encoding, as Go's strings.Compare does. */
|
|
134
|
+
function compareNames(a, b) {
|
|
135
|
+
const left = new TextEncoder().encode(a);
|
|
136
|
+
const right = new TextEncoder().encode(b);
|
|
137
|
+
const shared = Math.min(left.length, right.length);
|
|
138
|
+
for (let index = 0; index < shared; index += 1) {
|
|
139
|
+
if (left[index] !== right[index]) {
|
|
140
|
+
return left[index] < right[index] ? -1 : 1;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return left.length - right.length;
|
|
144
|
+
}
|
package/dist/test/fake.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Code, ConnectError, createRouterTransport } from "@connectrpc/connect";
|
|
|
3
3
|
import { createToshiClient } from "../client.js";
|
|
4
4
|
import { CancelJobResponseSchema, CreateJobResponseSchema, CreateSandboxResponseSchema, GetJobResponseSchema, GetSandboxResponseSchema, ListJobsResponseSchema, ListSandboxesResponseSchema, WaitJobResponseSchema, WaitSandboxResponseSchema, WatchJobsResponseSchema, WatchSandboxesResponseSchema, WorkloadService, } from "../gen/toshi/workspace/v1/workloads_pb.js";
|
|
5
5
|
import { EndReason, EventType, ExecuteResponseSchema, ExecutionExitSchema, ExecutionStartedSchema, JobSchema, JobState, JobStatusSchema, OutputEndSchema, RecordingPolicy, SandboxSchema, SandboxState, SandboxStatusSchema, WatchOutputResponseSchema, } from "../gen/toshi/workspace/v1/workspace_pb.js";
|
|
6
|
+
import { AlarmStore } from "./alarms.js";
|
|
6
7
|
import { apiMethods, apiPackage, hookOnly as hookOnlyMethods, isApiMethod, procedurePath } from "./procedures.js";
|
|
7
8
|
/** The token `client` sends. */
|
|
8
9
|
export const testToken = "test-token";
|
|
@@ -93,6 +94,34 @@ const builtinTable = [
|
|
|
93
94
|
run: (requests) => fake.executeAnswer(requests),
|
|
94
95
|
}),
|
|
95
96
|
],
|
|
97
|
+
[
|
|
98
|
+
workloadMethod("setServiceAlarm"),
|
|
99
|
+
(fake) => ({ kind: "unary", run: (request) => fake.alarms.set(request) }),
|
|
100
|
+
],
|
|
101
|
+
[
|
|
102
|
+
workloadMethod("getServiceAlarm"),
|
|
103
|
+
(fake) => ({ kind: "unary", run: (request) => fake.alarms.get(request) }),
|
|
104
|
+
],
|
|
105
|
+
[
|
|
106
|
+
workloadMethod("listServiceAlarms"),
|
|
107
|
+
(fake) => ({ kind: "unary", run: (request) => fake.alarms.list(request) }),
|
|
108
|
+
],
|
|
109
|
+
[
|
|
110
|
+
workloadMethod("deleteServiceAlarm"),
|
|
111
|
+
(fake) => ({ kind: "unary", run: (request) => fake.alarms.delete(request) }),
|
|
112
|
+
],
|
|
113
|
+
[
|
|
114
|
+
workloadMethod("pauseServiceAlarm"),
|
|
115
|
+
(fake) => ({ kind: "unary", run: (request) => fake.alarms.pause(request) }),
|
|
116
|
+
],
|
|
117
|
+
[
|
|
118
|
+
workloadMethod("resumeServiceAlarm"),
|
|
119
|
+
(fake) => ({ kind: "unary", run: (request) => fake.alarms.resume(request) }),
|
|
120
|
+
],
|
|
121
|
+
[
|
|
122
|
+
workloadMethod("runServiceAlarmNow"),
|
|
123
|
+
(fake) => ({ kind: "unary", run: (request) => fake.alarms.runNow(request) }),
|
|
124
|
+
],
|
|
96
125
|
];
|
|
97
126
|
/** The procedures the state machine answers. The coverage test holds it against the API. */
|
|
98
127
|
export const answeredProcedures = builtinTable.map(([method]) => method);
|
|
@@ -122,6 +151,8 @@ class FakeToshi {
|
|
|
122
151
|
nextSandbox = 0;
|
|
123
152
|
executions = new Map();
|
|
124
153
|
nextExecution = 0;
|
|
154
|
+
/** The service alarms the fake holds; `builtinTable` answers from it. */
|
|
155
|
+
alarms = new AlarmStore();
|
|
125
156
|
constructor() {
|
|
126
157
|
for (const [method, make] of builtinTable) {
|
|
127
158
|
this.builtin.set(procedurePath(method), make(this));
|
package/dist/test/index.d.ts
CHANGED
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
* # What the fake answers
|
|
20
20
|
*
|
|
21
21
|
* The fake holds one workspace and has no clock: every call answers at once
|
|
22
|
-
* with what the test set. It knows the job and the sandbox lifecycle and
|
|
23
|
-
* nothing else.
|
|
22
|
+
* with what the test set. It knows the job and the sandbox lifecycle and a
|
|
23
|
+
* service's alarms, and nothing else.
|
|
24
24
|
*
|
|
25
25
|
* - `job`, `sandbox` and `execute` set what the fake answers: a job's or a
|
|
26
26
|
* sandbox's state, and the standard output, the standard error and the exit
|
|
@@ -46,6 +46,16 @@
|
|
|
46
46
|
* - Execute answers the start message with an execution id, the standard
|
|
47
47
|
* output, the standard error and the exit code the test set for the sandbox.
|
|
48
48
|
* It does not read standard input.
|
|
49
|
+
* - SetServiceAlarm, GetServiceAlarm, ListServiceAlarms, DeleteServiceAlarm,
|
|
50
|
+
* PauseServiceAlarm, ResumeServiceAlarm and RunServiceAlarmNow keep alarms
|
|
51
|
+
* for any service ID: the fake holds no services. A set creates an alarm at
|
|
52
|
+
* generation 1, or replaces it at the next generation and resumes it.
|
|
53
|
+
* RunServiceAlarmNow records a manual occurrence, which GetServiceAlarm
|
|
54
|
+
* returns newest first; a run whose request key the fake has already
|
|
55
|
+
* answered returns the same occurrence. With no clock an alarm publishes
|
|
56
|
+
* nothing on its own, a cron alarm has no next instant, and the fake sets no
|
|
57
|
+
* time of its own: an alarm set at an instant has that instant as its next
|
|
58
|
+
* one. An unknown alarm is NOT_FOUND.
|
|
49
59
|
*
|
|
50
60
|
* Every other procedure is hook-only. An unhooked procedure the state machine
|
|
51
61
|
* does not cover answers UNIMPLEMENTED, naming the procedure and the `on` call
|
package/dist/test/index.js
CHANGED
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
* # What the fake answers
|
|
20
20
|
*
|
|
21
21
|
* The fake holds one workspace and has no clock: every call answers at once
|
|
22
|
-
* with what the test set. It knows the job and the sandbox lifecycle and
|
|
23
|
-
* nothing else.
|
|
22
|
+
* with what the test set. It knows the job and the sandbox lifecycle and a
|
|
23
|
+
* service's alarms, and nothing else.
|
|
24
24
|
*
|
|
25
25
|
* - `job`, `sandbox` and `execute` set what the fake answers: a job's or a
|
|
26
26
|
* sandbox's state, and the standard output, the standard error and the exit
|
|
@@ -46,6 +46,16 @@
|
|
|
46
46
|
* - Execute answers the start message with an execution id, the standard
|
|
47
47
|
* output, the standard error and the exit code the test set for the sandbox.
|
|
48
48
|
* It does not read standard input.
|
|
49
|
+
* - SetServiceAlarm, GetServiceAlarm, ListServiceAlarms, DeleteServiceAlarm,
|
|
50
|
+
* PauseServiceAlarm, ResumeServiceAlarm and RunServiceAlarmNow keep alarms
|
|
51
|
+
* for any service ID: the fake holds no services. A set creates an alarm at
|
|
52
|
+
* generation 1, or replaces it at the next generation and resumes it.
|
|
53
|
+
* RunServiceAlarmNow records a manual occurrence, which GetServiceAlarm
|
|
54
|
+
* returns newest first; a run whose request key the fake has already
|
|
55
|
+
* answered returns the same occurrence. With no clock an alarm publishes
|
|
56
|
+
* nothing on its own, a cron alarm has no next instant, and the fake sets no
|
|
57
|
+
* time of its own: an alarm set at an instant has that instant as its next
|
|
58
|
+
* one. An unknown alarm is NOT_FOUND.
|
|
49
59
|
*
|
|
50
60
|
* Every other procedure is hook-only. An unhooked procedure the state machine
|
|
51
61
|
* does not cover answers UNIMPLEMENTED, naming the procedure and the `on` call
|
package/dist/test/procedures.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AccountService } from "../gen/toshi/workspace/v1/account_pb.js";
|
|
2
2
|
import { ArtifactService, ArtifactUploadService } from "../gen/toshi/workspace/v1/artifacts_pb.js";
|
|
3
3
|
import { AuditEventService } from "../gen/toshi/workspace/v1/audit_events_pb.js";
|
|
4
|
-
import {
|
|
4
|
+
import { EndpointService } from "../gen/toshi/workspace/v1/endpoints_pb.js";
|
|
5
5
|
import { DisplayService } from "../gen/toshi/workspace/v1/display_pb.js";
|
|
6
6
|
import { DomainService } from "../gen/toshi/workspace/v1/domains_pb.js";
|
|
7
7
|
import { FillerService } from "../gen/toshi/workspace/v1/fillers_pb.js";
|
|
@@ -9,6 +9,7 @@ import { GrantService } from "../gen/toshi/workspace/v1/grants_pb.js";
|
|
|
9
9
|
import { HostJobService } from "../gen/toshi/workspace/v1/hostjobs_pb.js";
|
|
10
10
|
import { HostService } from "../gen/toshi/workspace/v1/hosts_pb.js";
|
|
11
11
|
import { ImageService } from "../gen/toshi/workspace/v1/images_pb.js";
|
|
12
|
+
import { ModelCredentialService } from "../gen/toshi/workspace/v1/model_credentials_pb.js";
|
|
12
13
|
import { ProductService } from "../gen/toshi/workspace/v1/products_pb.js";
|
|
13
14
|
import { ProjectService } from "../gen/toshi/workspace/v1/projects_pb.js";
|
|
14
15
|
import { RecordingService } from "../gen/toshi/workspace/v1/recordings_pb.js";
|
|
@@ -28,7 +29,7 @@ export const apiServices = [
|
|
|
28
29
|
ProjectService,
|
|
29
30
|
WebhookService,
|
|
30
31
|
DisplayService,
|
|
31
|
-
|
|
32
|
+
EndpointService,
|
|
32
33
|
RecordingService,
|
|
33
34
|
VolumeService,
|
|
34
35
|
ArtifactService,
|
|
@@ -45,6 +46,7 @@ export const apiServices = [
|
|
|
45
46
|
ImageService,
|
|
46
47
|
ProductService,
|
|
47
48
|
DomainService,
|
|
49
|
+
ModelCredentialService,
|
|
48
50
|
];
|
|
49
51
|
/** The path a client calls a method by, for example `/toshi.workspace.v1.WorkloadService/CreateJob`. */
|
|
50
52
|
export function procedurePath(method) {
|
|
@@ -87,6 +89,8 @@ export const hookOnly = [
|
|
|
87
89
|
ProductService.method.listProducts,
|
|
88
90
|
ProductService.method.updateProduct,
|
|
89
91
|
// WorkloadService
|
|
92
|
+
WorkloadService.method.getWorkloadUsage,
|
|
93
|
+
WorkloadService.method.listWorkloadUsages,
|
|
90
94
|
WorkloadService.method.updateJob,
|
|
91
95
|
WorkloadService.method.deleteJob,
|
|
92
96
|
WorkloadService.method.updateSandbox,
|
|
@@ -116,6 +120,9 @@ export const hookOnly = [
|
|
|
116
120
|
WorkloadService.method.stopService,
|
|
117
121
|
WorkloadService.method.setServiceMode,
|
|
118
122
|
WorkloadService.method.wakeService,
|
|
123
|
+
// The fake holds no workloads: the operator's holds are answered by hooks.
|
|
124
|
+
WorkloadService.method.holdWorkload,
|
|
125
|
+
WorkloadService.method.releaseWorkload,
|
|
119
126
|
WorkloadService.method.holdService,
|
|
120
127
|
WorkloadService.method.releaseService,
|
|
121
128
|
WorkloadService.method.listServiceRevisions,
|
|
@@ -127,15 +134,7 @@ export const hookOnly = [
|
|
|
127
134
|
WorkloadService.method.watchEvents,
|
|
128
135
|
WorkloadService.method.getOperation,
|
|
129
136
|
WorkloadService.method.waitOperation,
|
|
130
|
-
// The fake holds no services: their
|
|
131
|
-
// hooks.
|
|
132
|
-
WorkloadService.method.setServiceAlarm,
|
|
133
|
-
WorkloadService.method.getServiceAlarm,
|
|
134
|
-
WorkloadService.method.listServiceAlarms,
|
|
135
|
-
WorkloadService.method.deleteServiceAlarm,
|
|
136
|
-
WorkloadService.method.pauseServiceAlarm,
|
|
137
|
-
WorkloadService.method.resumeServiceAlarm,
|
|
138
|
-
WorkloadService.method.runServiceAlarmNow,
|
|
137
|
+
// The fake holds no services: their sign-ins are answered by hooks.
|
|
139
138
|
WorkloadService.method.startServiceSignIn,
|
|
140
139
|
WorkloadService.method.answerServiceSignIn,
|
|
141
140
|
WorkloadService.method.cancelServiceSignIn,
|
|
@@ -180,12 +179,12 @@ export const hookOnly = [
|
|
|
180
179
|
ProjectService.method.setEnvironmentRetention,
|
|
181
180
|
ProjectService.method.setEnvironmentVolumes,
|
|
182
181
|
// WebhookService
|
|
183
|
-
WebhookService.method.
|
|
184
|
-
WebhookService.method.
|
|
185
|
-
WebhookService.method.
|
|
186
|
-
WebhookService.method.
|
|
187
|
-
WebhookService.method.
|
|
188
|
-
WebhookService.method.
|
|
182
|
+
WebhookService.method.createWebhook,
|
|
183
|
+
WebhookService.method.getWebhook,
|
|
184
|
+
WebhookService.method.listWebhooks,
|
|
185
|
+
WebhookService.method.updateWebhook,
|
|
186
|
+
WebhookService.method.deleteWebhook,
|
|
187
|
+
WebhookService.method.rotateWebhookSecret,
|
|
189
188
|
WebhookService.method.listWebhookDeliveries,
|
|
190
189
|
WebhookService.method.replayWebhookEvents,
|
|
191
190
|
// DisplayService
|
|
@@ -197,23 +196,23 @@ export const hookOnly = [
|
|
|
197
196
|
DisplayService.method.sendDisplayPointer,
|
|
198
197
|
DisplayService.method.setDisplayClipboard,
|
|
199
198
|
DisplayService.method.takeDisplayScreenshot,
|
|
200
|
-
//
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
199
|
+
// EndpointService
|
|
200
|
+
EndpointService.method.createEndpoint,
|
|
201
|
+
EndpointService.method.listEndpoints,
|
|
202
|
+
EndpointService.method.getEndpoint,
|
|
203
|
+
EndpointService.method.getEndpointPolicy,
|
|
204
|
+
EndpointService.method.setEndpointPolicy,
|
|
205
|
+
EndpointService.method.listEndpointRequests,
|
|
206
|
+
EndpointService.method.getEndpointRequest,
|
|
207
|
+
EndpointService.method.exportEndpointLog,
|
|
208
|
+
EndpointService.method.createEndpointConnectToken,
|
|
209
|
+
EndpointService.method.revokeEndpointConnectToken,
|
|
210
|
+
EndpointService.method.deleteEndpoint,
|
|
211
|
+
EndpointService.method.listForwards,
|
|
212
|
+
EndpointService.method.getTunnel,
|
|
213
|
+
EndpointService.method.sendEndpointMessage,
|
|
214
|
+
EndpointService.method.tailEndpointMessages,
|
|
215
|
+
EndpointService.method.replayEndpointMessage,
|
|
217
216
|
// RecordingService
|
|
218
217
|
RecordingService.method.listRecordings,
|
|
219
218
|
RecordingService.method.getRecording,
|
|
@@ -290,6 +289,7 @@ export const hookOnly = [
|
|
|
290
289
|
WorkspaceService.method.listWorkspaces,
|
|
291
290
|
WorkspaceService.method.getWorkspaceBilling,
|
|
292
291
|
WorkspaceService.method.getWorkspaceStatement,
|
|
292
|
+
WorkspaceService.method.getWorkspaceUpcomingInvoice,
|
|
293
293
|
WorkspaceService.method.listEgressIPs,
|
|
294
294
|
WorkspaceService.method.getUsage,
|
|
295
295
|
WorkspaceService.method.getQueueTimes,
|
|
@@ -311,4 +311,10 @@ export const hookOnly = [
|
|
|
311
311
|
DomainService.method.verifyDomain,
|
|
312
312
|
DomainService.method.issueDomain,
|
|
313
313
|
DomainService.method.deleteDomain,
|
|
314
|
+
// ModelCredentialService
|
|
315
|
+
ModelCredentialService.method.createModelCredential,
|
|
316
|
+
ModelCredentialService.method.getModelCredential,
|
|
317
|
+
ModelCredentialService.method.listModelCredentials,
|
|
318
|
+
ModelCredentialService.method.updateModelCredential,
|
|
319
|
+
ModelCredentialService.method.deleteModelCredential,
|
|
314
320
|
];
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The package version; test/node.test.ts keeps it equal to package.json. */
|
|
2
|
-
export declare const VERSION = "0.
|
|
2
|
+
export declare const VERSION = "0.7.0";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The package version; test/node.test.ts keeps it equal to package.json. */
|
|
2
|
-
export const VERSION = "0.
|
|
2
|
+
export const VERSION = "0.7.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toshicloud/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "TypeScript client for the Toshi Workspace API",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"packageManager": "pnpm@12.15.0+sha512.b3951d6d6ff4a9f13dc7cf56cd28d2b8eb37dbcc9c68e52e1e1191873ea9f82a017287ab50baadc5ccc494f036c67c0e47eb13608c2fa36f47711b61ea128e61",
|