@miosa/sdk 1.2.5 → 1.2.6
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 +107 -59
- package/dist/index.d.ts +331 -202
- package/dist/index.js +572 -603
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
- package/src/client.ts +0 -293
- package/src/errors.ts +0 -136
- package/src/http.test.ts +0 -374
- package/src/http.ts +0 -390
- package/src/index.ts +0 -569
- package/src/resources/admin.ts +0 -348
- package/src/resources/analytics.ts +0 -60
- package/src/resources/api-keys.ts +0 -119
- package/src/resources/audit-log.ts +0 -64
- package/src/resources/benchmarks.ts +0 -104
- package/src/resources/builder-sessions.ts +0 -75
- package/src/resources/channels.ts +0 -143
- package/src/resources/checkpoints.ts +0 -225
- package/src/resources/command-center.ts +0 -73
- package/src/resources/community.ts +0 -103
- package/src/resources/completions.ts +0 -104
- package/src/resources/computer-auto-stop.ts +0 -43
- package/src/resources/computer-env.ts +0 -76
- package/src/resources/computer-logs.ts +0 -50
- package/src/resources/computer-osa.ts +0 -76
- package/src/resources/computer-ports.ts +0 -91
- package/src/resources/computer-terminal.ts +0 -61
- package/src/resources/computer-volumes.ts +0 -64
- package/src/resources/computer.ts +0 -551
- package/src/resources/computers.ts +0 -75
- package/src/resources/credits.ts +0 -43
- package/src/resources/cron-jobs.ts +0 -191
- package/src/resources/custom_domains.ts +0 -123
- package/src/resources/dashboard.ts +0 -49
- package/src/resources/databases.ts +0 -218
- package/src/resources/deployments.test.ts +0 -197
- package/src/resources/deployments.ts +0 -1208
- package/src/resources/desktop.ts +0 -134
- package/src/resources/devices.test.ts +0 -92
- package/src/resources/devices.ts +0 -291
- package/src/resources/egress.test.ts +0 -318
- package/src/resources/egressAudit.ts +0 -245
- package/src/resources/egressNetwork.ts +0 -450
- package/src/resources/egressSecrets.ts +0 -577
- package/src/resources/email.ts +0 -212
- package/src/resources/embeddings.ts +0 -36
- package/src/resources/events.ts +0 -296
- package/src/resources/exec.ts +0 -319
- package/src/resources/external-keys.ts +0 -79
- package/src/resources/files.test.ts +0 -339
- package/src/resources/files.ts +0 -220
- package/src/resources/flat-custom-domains.ts +0 -127
- package/src/resources/functions.ts +0 -178
- package/src/resources/health-checks.ts +0 -165
- package/src/resources/integrations.ts +0 -183
- package/src/resources/mcp.ts +0 -70
- package/src/resources/models.ts +0 -45
- package/src/resources/network_policy.ts +0 -73
- package/src/resources/open-computers/agents.ts +0 -91
- package/src/resources/open-computers/apps.ts +0 -102
- package/src/resources/open-computers/clusters.ts +0 -88
- package/src/resources/open-computers/desktop.ts +0 -34
- package/src/resources/open-computers/files.ts +0 -97
- package/src/resources/open-computers/hosts.ts +0 -85
- package/src/resources/open-computers/index.ts +0 -98
- package/src/resources/open-computers/jobs.ts +0 -75
- package/src/resources/open-computers/open_computers.test.ts +0 -288
- package/src/resources/open-computers/secrets.ts +0 -115
- package/src/resources/open-computers/terminal.ts +0 -33
- package/src/resources/open-computers/tunnels.ts +0 -87
- package/src/resources/open-computers/types.ts +0 -343
- package/src/resources/open-computers/workspaces.ts +0 -135
- package/src/resources/org-invites.ts +0 -189
- package/src/resources/project-auth.ts +0 -142
- package/src/resources/project-integrations.ts +0 -133
- package/src/resources/provider-defaults.ts +0 -89
- package/src/resources/regions.ts +0 -94
- package/src/resources/sandbox-templates.ts +0 -195
- package/src/resources/sandboxes.live.test.ts +0 -92
- package/src/resources/sandboxes.test.ts +0 -655
- package/src/resources/sandboxes.ts +0 -1437
- package/src/resources/settings.ts +0 -143
- package/src/resources/snapshots-standalone.ts +0 -51
- package/src/resources/storage.ts +0 -221
- package/src/resources/tenant.ts +0 -66
- package/src/resources/usage.ts +0 -85
- package/src/resources/volumes.ts +0 -117
- package/src/resources/webhooks.ts +0 -239
- package/src/resources/workspace-invites.ts +0 -188
- package/src/resources/workspace-members.test.ts +0 -121
- package/src/resources/workspace-members.ts +0 -143
- package/src/types.ts +0 -463
|
@@ -1,450 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Egress network — policies, allowlist, suggestions.
|
|
3
|
-
*
|
|
4
|
-
* Backed by:
|
|
5
|
-
* GET /api/v1/egress/policies
|
|
6
|
-
* POST /api/v1/egress/policies
|
|
7
|
-
* PATCH /api/v1/egress/policies/:id (or no id for tenant default)
|
|
8
|
-
*
|
|
9
|
-
* GET /api/v1/egress/allowlist
|
|
10
|
-
* POST /api/v1/egress/allowlist
|
|
11
|
-
* DELETE /api/v1/egress/allowlist/:id
|
|
12
|
-
*
|
|
13
|
-
* GET /api/v1/egress/audit/suggestions
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
import type { HttpClient } from "../http.js";
|
|
17
|
-
|
|
18
|
-
// ── Resource shapes ──────────────────────────────────────────────────────────
|
|
19
|
-
|
|
20
|
-
export type EgressPolicyMode = "enforce" | "audit_only";
|
|
21
|
-
export type EgressRuleEffect = "allow" | "deny";
|
|
22
|
-
|
|
23
|
-
export interface EgressAllowlistRule {
|
|
24
|
-
id: string;
|
|
25
|
-
host: string;
|
|
26
|
-
effect: EgressRuleEffect | string;
|
|
27
|
-
methods?: string[];
|
|
28
|
-
path_glob?: string | null;
|
|
29
|
-
policy_id?: string | null;
|
|
30
|
-
resource_id?: string | null;
|
|
31
|
-
resource_type?: string | null;
|
|
32
|
-
note?: string | null;
|
|
33
|
-
created_at?: string;
|
|
34
|
-
[key: string]: unknown;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface EgressPolicyData {
|
|
38
|
-
id: string;
|
|
39
|
-
name?: string;
|
|
40
|
-
mode: EgressPolicyMode | string;
|
|
41
|
-
default_effect: EgressRuleEffect | string;
|
|
42
|
-
description?: string | null;
|
|
43
|
-
resource_id?: string | null;
|
|
44
|
-
resource_type?: string | null;
|
|
45
|
-
rules?: EgressAllowlistRule[];
|
|
46
|
-
created_at?: string;
|
|
47
|
-
updated_at?: string;
|
|
48
|
-
[key: string]: unknown;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface EgressSuggestion {
|
|
52
|
-
host: string;
|
|
53
|
-
methods?: string[];
|
|
54
|
-
path_glob?: string | null;
|
|
55
|
-
count?: number;
|
|
56
|
-
first_seen?: string;
|
|
57
|
-
last_seen?: string;
|
|
58
|
-
resource_id?: string | null;
|
|
59
|
-
[key: string]: unknown;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// ── Request payloads ─────────────────────────────────────────────────────────
|
|
63
|
-
|
|
64
|
-
export interface AllowParams {
|
|
65
|
-
methods?: string[];
|
|
66
|
-
pathGlob?: string;
|
|
67
|
-
path_glob?: string;
|
|
68
|
-
policyId?: string;
|
|
69
|
-
policy_id?: string;
|
|
70
|
-
resourceId?: string;
|
|
71
|
-
resource_id?: string;
|
|
72
|
-
resourceType?: string;
|
|
73
|
-
resource_type?: string;
|
|
74
|
-
note?: string;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface PolicyCreateParams {
|
|
78
|
-
name: string;
|
|
79
|
-
mode?: EgressPolicyMode | string;
|
|
80
|
-
defaultEffect?: EgressRuleEffect | string;
|
|
81
|
-
default_effect?: EgressRuleEffect | string;
|
|
82
|
-
resourceId?: string;
|
|
83
|
-
resource_id?: string;
|
|
84
|
-
resourceType?: string;
|
|
85
|
-
resource_type?: string;
|
|
86
|
-
description?: string;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface PolicyUpdateParams {
|
|
90
|
-
mode?: EgressPolicyMode | string;
|
|
91
|
-
defaultEffect?: EgressRuleEffect | string;
|
|
92
|
-
default_effect?: EgressRuleEffect | string;
|
|
93
|
-
name?: string;
|
|
94
|
-
description?: string;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export interface ModeParams {
|
|
98
|
-
policyId?: string;
|
|
99
|
-
policy_id?: string;
|
|
100
|
-
resourceId?: string;
|
|
101
|
-
resource_id?: string;
|
|
102
|
-
resourceType?: string;
|
|
103
|
-
resource_type?: string;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export interface SuggestionsParams {
|
|
107
|
-
resourceId?: string;
|
|
108
|
-
resource_id?: string;
|
|
109
|
-
resourceType?: string;
|
|
110
|
-
resource_type?: string;
|
|
111
|
-
since?: string;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export interface PolicyListParams {
|
|
115
|
-
resourceId?: string;
|
|
116
|
-
resource_id?: string;
|
|
117
|
-
resourceType?: string;
|
|
118
|
-
resource_type?: string;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export interface RulesListParams {
|
|
122
|
-
policyId?: string;
|
|
123
|
-
policy_id?: string;
|
|
124
|
-
resourceId?: string;
|
|
125
|
-
resource_id?: string;
|
|
126
|
-
resourceType?: string;
|
|
127
|
-
resource_type?: string;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// ── Helpers ───────────────────────────────────────────────────────────────────
|
|
131
|
-
|
|
132
|
-
interface WireEnvelope<T> {
|
|
133
|
-
data?: T;
|
|
134
|
-
policy?: T;
|
|
135
|
-
rule?: T;
|
|
136
|
-
items?: T;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
function unwrap<T>(payload: unknown): T {
|
|
140
|
-
if (payload && typeof payload === "object") {
|
|
141
|
-
const p = payload as Record<string, unknown>;
|
|
142
|
-
for (const k of ["data", "policy", "rule", "items"]) {
|
|
143
|
-
if (k in p) return p[k] as T;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return payload as T;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function unwrapList<T>(payload: unknown): T[] {
|
|
150
|
-
if (Array.isArray(payload)) return payload as T[];
|
|
151
|
-
if (payload && typeof payload === "object") {
|
|
152
|
-
const p = payload as Record<string, unknown>;
|
|
153
|
-
for (const k of [
|
|
154
|
-
"data",
|
|
155
|
-
"policies",
|
|
156
|
-
"rules",
|
|
157
|
-
"allowlist",
|
|
158
|
-
"suggestions",
|
|
159
|
-
"items",
|
|
160
|
-
]) {
|
|
161
|
-
if (Array.isArray(p[k])) return p[k] as T[];
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
return [];
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function stripUndefined(
|
|
168
|
-
input: Record<string, unknown>,
|
|
169
|
-
): Record<string, unknown> {
|
|
170
|
-
return Object.fromEntries(
|
|
171
|
-
Object.entries(input).filter(([, v]) => v !== undefined),
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function pickFirst<T>(...values: Array<T | undefined>): T | undefined {
|
|
176
|
-
for (const v of values) if (v !== undefined) return v;
|
|
177
|
-
return undefined;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function ruleBody(
|
|
181
|
-
host: string,
|
|
182
|
-
params: AllowParams,
|
|
183
|
-
effect: EgressRuleEffect,
|
|
184
|
-
): Record<string, unknown> {
|
|
185
|
-
return stripUndefined({
|
|
186
|
-
host,
|
|
187
|
-
effect,
|
|
188
|
-
methods: params.methods,
|
|
189
|
-
path_glob: pickFirst(params.pathGlob, params.path_glob),
|
|
190
|
-
policy_id: pickFirst(params.policyId, params.policy_id),
|
|
191
|
-
resource_id: pickFirst(params.resourceId, params.resource_id),
|
|
192
|
-
resource_type: pickFirst(params.resourceType, params.resource_type),
|
|
193
|
-
note: params.note,
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// ── Main resource ─────────────────────────────────────────────────────────────
|
|
198
|
-
|
|
199
|
-
export class EgressNetwork {
|
|
200
|
-
constructor(protected readonly http: HttpClient) {}
|
|
201
|
-
|
|
202
|
-
// ── allowlist ─────────────────────────────────────────────────────────────
|
|
203
|
-
|
|
204
|
-
/** Add an `allow` rule for `host` to the allowlist. */
|
|
205
|
-
async allow(
|
|
206
|
-
host: string,
|
|
207
|
-
params: AllowParams = {},
|
|
208
|
-
): Promise<EgressAllowlistRule> {
|
|
209
|
-
const data = await this.http.post<WireEnvelope<EgressAllowlistRule>>(
|
|
210
|
-
"/egress/allowlist",
|
|
211
|
-
ruleBody(host, params, "allow"),
|
|
212
|
-
);
|
|
213
|
-
return unwrap<EgressAllowlistRule>(data);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/** Add a `deny` rule for `host` to the allowlist. */
|
|
217
|
-
async deny(
|
|
218
|
-
host: string,
|
|
219
|
-
params: AllowParams = {},
|
|
220
|
-
): Promise<EgressAllowlistRule> {
|
|
221
|
-
const data = await this.http.post<WireEnvelope<EgressAllowlistRule>>(
|
|
222
|
-
"/egress/allowlist",
|
|
223
|
-
ruleBody(host, params, "deny"),
|
|
224
|
-
);
|
|
225
|
-
return unwrap<EgressAllowlistRule>(data);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
/** List allowlist rules. */
|
|
229
|
-
async rules(params: RulesListParams = {}): Promise<EgressAllowlistRule[]> {
|
|
230
|
-
const query = stripUndefined({
|
|
231
|
-
policy_id: pickFirst(params.policyId, params.policy_id),
|
|
232
|
-
resource_id: pickFirst(params.resourceId, params.resource_id),
|
|
233
|
-
resource_type: pickFirst(params.resourceType, params.resource_type),
|
|
234
|
-
}) as Record<string, string | number | boolean | undefined>;
|
|
235
|
-
const data = await this.http.get<unknown>("/egress/allowlist", query);
|
|
236
|
-
return unwrapList<EgressAllowlistRule>(data);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/** Delete an allowlist rule by id. */
|
|
240
|
-
async removeRule(ruleId: string): Promise<void> {
|
|
241
|
-
await this.http.delete<unknown>(`/egress/allowlist/${ruleId}`);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
// ── policies ──────────────────────────────────────────────────────────────
|
|
245
|
-
|
|
246
|
-
/** List egress policies. */
|
|
247
|
-
async policies(params: PolicyListParams = {}): Promise<EgressPolicyData[]> {
|
|
248
|
-
const query = stripUndefined({
|
|
249
|
-
resource_id: pickFirst(params.resourceId, params.resource_id),
|
|
250
|
-
resource_type: pickFirst(params.resourceType, params.resource_type),
|
|
251
|
-
}) as Record<string, string | number | boolean | undefined>;
|
|
252
|
-
const data = await this.http.get<unknown>("/egress/policies", query);
|
|
253
|
-
return unwrapList<EgressPolicyData>(data);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
/** Create an egress policy. */
|
|
257
|
-
async createPolicy(params: PolicyCreateParams): Promise<EgressPolicyData> {
|
|
258
|
-
const body = stripUndefined({
|
|
259
|
-
name: params.name,
|
|
260
|
-
mode: params.mode ?? "enforce",
|
|
261
|
-
default_effect: pickFirst(
|
|
262
|
-
params.defaultEffect,
|
|
263
|
-
params.default_effect,
|
|
264
|
-
"deny" as EgressRuleEffect,
|
|
265
|
-
),
|
|
266
|
-
resource_id: pickFirst(params.resourceId, params.resource_id),
|
|
267
|
-
resource_type: pickFirst(params.resourceType, params.resource_type),
|
|
268
|
-
description: params.description,
|
|
269
|
-
});
|
|
270
|
-
const data = await this.http.post<WireEnvelope<EgressPolicyData>>(
|
|
271
|
-
"/egress/policies",
|
|
272
|
-
body,
|
|
273
|
-
);
|
|
274
|
-
return unwrap<EgressPolicyData>(data);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
/** Update an egress policy by id. */
|
|
278
|
-
async updatePolicy(
|
|
279
|
-
policyId: string,
|
|
280
|
-
params: PolicyUpdateParams,
|
|
281
|
-
): Promise<EgressPolicyData> {
|
|
282
|
-
const body = stripUndefined({
|
|
283
|
-
mode: params.mode,
|
|
284
|
-
default_effect: pickFirst(params.defaultEffect, params.default_effect),
|
|
285
|
-
name: params.name,
|
|
286
|
-
description: params.description,
|
|
287
|
-
});
|
|
288
|
-
const data = await this.http.patch<WireEnvelope<EgressPolicyData>>(
|
|
289
|
-
`/egress/policies/${policyId}`,
|
|
290
|
-
body,
|
|
291
|
-
);
|
|
292
|
-
return unwrap<EgressPolicyData>(data);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
// ── mode helpers ──────────────────────────────────────────────────────────
|
|
296
|
-
|
|
297
|
-
/** Set the policy to `mode="enforce"` — denied egress is blocked. */
|
|
298
|
-
async lockdown(params: ModeParams = {}): Promise<EgressPolicyData> {
|
|
299
|
-
return this.setMode("enforce", params);
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
/** Set the policy to `mode="audit_only"` — log but do not block. */
|
|
303
|
-
async observe(params: ModeParams = {}): Promise<EgressPolicyData> {
|
|
304
|
-
return this.setMode("audit_only", params);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
private async setMode(
|
|
308
|
-
mode: EgressPolicyMode,
|
|
309
|
-
params: ModeParams,
|
|
310
|
-
): Promise<EgressPolicyData> {
|
|
311
|
-
const policyId = pickFirst(params.policyId, params.policy_id);
|
|
312
|
-
const resourceId = pickFirst(params.resourceId, params.resource_id);
|
|
313
|
-
const resourceType = pickFirst(params.resourceType, params.resource_type);
|
|
314
|
-
|
|
315
|
-
if (policyId) {
|
|
316
|
-
return this.updatePolicy(policyId, { mode });
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
const body =
|
|
320
|
-
resourceId !== undefined && resourceType !== undefined
|
|
321
|
-
? stripUndefined({
|
|
322
|
-
mode,
|
|
323
|
-
resource_id: resourceId,
|
|
324
|
-
resource_type: resourceType,
|
|
325
|
-
})
|
|
326
|
-
: { mode };
|
|
327
|
-
const data = await this.http.patch<WireEnvelope<EgressPolicyData>>(
|
|
328
|
-
"/egress/policies",
|
|
329
|
-
body,
|
|
330
|
-
);
|
|
331
|
-
return unwrap<EgressPolicyData>(data);
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
// ── suggestions ───────────────────────────────────────────────────────────
|
|
335
|
-
|
|
336
|
-
/** AI-generated allowlist suggestions from recent denied egress. */
|
|
337
|
-
async suggestions(
|
|
338
|
-
params: SuggestionsParams = {},
|
|
339
|
-
): Promise<EgressSuggestion[]> {
|
|
340
|
-
const query = stripUndefined({
|
|
341
|
-
resource_id: pickFirst(params.resourceId, params.resource_id),
|
|
342
|
-
resource_type: pickFirst(params.resourceType, params.resource_type),
|
|
343
|
-
since: params.since ?? "7d",
|
|
344
|
-
}) as Record<string, string | number | boolean | undefined>;
|
|
345
|
-
const data = await this.http.get<unknown>(
|
|
346
|
-
"/egress/audit/suggestions",
|
|
347
|
-
query,
|
|
348
|
-
);
|
|
349
|
-
return unwrapList<EgressSuggestion>(data);
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
// ── Resource-scoped wrappers ─────────────────────────────────────────────────
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* Sandbox-bound view of {@link EgressNetwork}. Pre-scopes
|
|
357
|
-
* `resource_id` + `resource_type="sandbox"` on every call.
|
|
358
|
-
*/
|
|
359
|
-
export class SandboxNetwork {
|
|
360
|
-
protected readonly resourceType: string = "sandbox";
|
|
361
|
-
private readonly delegate: EgressNetwork;
|
|
362
|
-
|
|
363
|
-
constructor(
|
|
364
|
-
http: HttpClient,
|
|
365
|
-
protected readonly resourceId: string,
|
|
366
|
-
) {
|
|
367
|
-
this.delegate = new EgressNetwork(http);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
private resolvedResourceId(params: {
|
|
371
|
-
resourceId?: string;
|
|
372
|
-
resource_id?: string;
|
|
373
|
-
}): string {
|
|
374
|
-
return params.resourceId ?? params.resource_id ?? this.resourceId;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
private resolvedResourceType(params: {
|
|
378
|
-
resourceType?: string;
|
|
379
|
-
resource_type?: string;
|
|
380
|
-
}): string {
|
|
381
|
-
return params.resourceType ?? params.resource_type ?? this.resourceType;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
allow(host: string, params: AllowParams = {}): Promise<EgressAllowlistRule> {
|
|
385
|
-
return this.delegate.allow(host, {
|
|
386
|
-
...params,
|
|
387
|
-
resource_id: this.resolvedResourceId(params),
|
|
388
|
-
resource_type: this.resolvedResourceType(params),
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
deny(host: string, params: AllowParams = {}): Promise<EgressAllowlistRule> {
|
|
393
|
-
return this.delegate.deny(host, {
|
|
394
|
-
...params,
|
|
395
|
-
resource_id: this.resolvedResourceId(params),
|
|
396
|
-
resource_type: this.resolvedResourceType(params),
|
|
397
|
-
});
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
rules(params: RulesListParams = {}): Promise<EgressAllowlistRule[]> {
|
|
401
|
-
return this.delegate.rules({
|
|
402
|
-
...params,
|
|
403
|
-
resource_id: this.resolvedResourceId(params),
|
|
404
|
-
resource_type: this.resolvedResourceType(params),
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
removeRule(ruleId: string): Promise<void> {
|
|
409
|
-
return this.delegate.removeRule(ruleId);
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
lockdown(params: { policyId?: string } = {}): Promise<EgressPolicyData> {
|
|
413
|
-
const body: ModeParams = {
|
|
414
|
-
resource_id: this.resourceId,
|
|
415
|
-
resource_type: this.resourceType,
|
|
416
|
-
};
|
|
417
|
-
if (params.policyId !== undefined) body.policyId = params.policyId;
|
|
418
|
-
return this.delegate.lockdown(body);
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
observe(params: { policyId?: string } = {}): Promise<EgressPolicyData> {
|
|
422
|
-
const body: ModeParams = {
|
|
423
|
-
resource_id: this.resourceId,
|
|
424
|
-
resource_type: this.resourceType,
|
|
425
|
-
};
|
|
426
|
-
if (params.policyId !== undefined) body.policyId = params.policyId;
|
|
427
|
-
return this.delegate.observe(body);
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
suggestions(params: { since?: string } = {}): Promise<EgressSuggestion[]> {
|
|
431
|
-
const body: SuggestionsParams = {
|
|
432
|
-
resource_id: this.resourceId,
|
|
433
|
-
resource_type: this.resourceType,
|
|
434
|
-
};
|
|
435
|
-
if (params.since !== undefined) body.since = params.since;
|
|
436
|
-
return this.delegate.suggestions(body);
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
policies(): Promise<EgressPolicyData[]> {
|
|
440
|
-
return this.delegate.policies({
|
|
441
|
-
resource_id: this.resourceId,
|
|
442
|
-
resource_type: this.resourceType,
|
|
443
|
-
});
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
/** Computer-bound network — same surface, `resource_type="computer"`. */
|
|
448
|
-
export class ComputerNetwork extends SandboxNetwork {
|
|
449
|
-
protected readonly resourceType: string = "computer";
|
|
450
|
-
}
|