@leavepulse/control-sdk 0.3.31
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 +2 -0
- package/auth-types.ts +5296 -0
- package/client.ts +320 -0
- package/index.ts +110 -0
- package/models.ts +232 -0
- package/package.json +28 -0
- package/procedures.ts +451 -0
- package/resources/ControlAgentRelease.ts +40 -0
- package/resources/ControlAlert.ts +39 -0
- package/resources/ControlCfAccount.ts +82 -0
- package/resources/ControlDcimAcceptance.ts +126 -0
- package/resources/ControlDcimCable.ts +70 -0
- package/resources/ControlDcimComponent.ts +62 -0
- package/resources/ControlDcimDevice.ts +71 -0
- package/resources/ControlDcimFeed.ts +61 -0
- package/resources/ControlDcimLocation.ts +55 -0
- package/resources/ControlDcimOutlet.ts +61 -0
- package/resources/ControlDcimPdu.ts +58 -0
- package/resources/ControlDcimPort.ts +61 -0
- package/resources/ControlDcimPowerLink.ts +34 -0
- package/resources/ControlDcimRack.ts +61 -0
- package/resources/ControlEdge.ts +43 -0
- package/resources/ControlEnrollToken.ts +45 -0
- package/resources/ControlEnvGroup.ts +60 -0
- package/resources/ControlHost.ts +184 -0
- package/resources/ControlNode.ts +48 -0
- package/resources/ControlProject.ts +36 -0
- package/resources/ControlRule.ts +56 -0
- package/resources/ControlSchedule.ts +56 -0
- package/resources/ControlService.ts +101 -0
- package/runtime/cache-policy.ts +371 -0
- package/runtime/cache.ts +129 -0
- package/runtime/credentials.ts +139 -0
- package/runtime/device.ts +199 -0
- package/runtime/errors.ts +225 -0
- package/runtime/etag-store.ts +252 -0
- package/runtime/json.ts +25 -0
- package/runtime/oauth2.ts +150 -0
- package/runtime/page.ts +81 -0
- package/runtime/realtime-client.ts +339 -0
- package/runtime/realtime.ts +257 -0
- package/runtime/realtime_pb/leavepulse/realtime/v1/ws_pb.ts +464 -0
- package/runtime/resource.ts +84 -0
- package/runtime/snowflake.ts +7 -0
- package/runtime/transport.ts +404 -0
- package/types.ts +7279 -0
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@leavepulse/control-sdk",
|
|
3
|
+
"version": "0.3.31",
|
|
4
|
+
"description": "Generated resource SDK (@leavepulse/control-sdk).",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"module": "index.ts",
|
|
7
|
+
"types": "index.ts",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/LeavePulse/leavepulse-sdk-control-ts.git"
|
|
11
|
+
},
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"registry": "https://registry.npmjs.org",
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": "./index.ts",
|
|
18
|
+
"./types": "./types.ts",
|
|
19
|
+
"./models": "./models.ts",
|
|
20
|
+
"./auth-types": "./auth-types.ts"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"lossless-json": "^4.0.0",
|
|
24
|
+
"@bufbuild/protobuf": "^2.2.0"
|
|
25
|
+
},
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"license": "UNLICENSED"
|
|
28
|
+
}
|
package/procedures.ts
ADDED
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
// Generated from the LeavePulse contract. Do not edit.
|
|
2
|
+
import type { ClientContext } from "./client";
|
|
3
|
+
import { fetchCachedOrThrow } from "./runtime/etag-store";
|
|
4
|
+
import type * as models from "./models";
|
|
5
|
+
|
|
6
|
+
/** auth.oauth procedures. */
|
|
7
|
+
export class AuthOauthNs {
|
|
8
|
+
constructor(private readonly ctx: ClientContext) {}
|
|
9
|
+
|
|
10
|
+
/** auth.oauth.captcha_confirm */
|
|
11
|
+
async captchaConfirm(
|
|
12
|
+
body: models.OAuthCaptchaConfirmRequest,
|
|
13
|
+
): Promise<models.LoginResponse | models.OAuthTotpChallengeResponse> {
|
|
14
|
+
return this.ctx.transport.request<
|
|
15
|
+
models.LoginResponse | models.OAuthTotpChallengeResponse
|
|
16
|
+
>({
|
|
17
|
+
method: "POST",
|
|
18
|
+
path: `/auth/oauth/captcha/confirm`,
|
|
19
|
+
body,
|
|
20
|
+
channel: "auth",
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** auth.oauth.totp_confirm */
|
|
25
|
+
async totpConfirm(
|
|
26
|
+
body: models.OAuthTotpConfirmRequest,
|
|
27
|
+
): Promise<models.LoginResponse> {
|
|
28
|
+
return this.ctx.transport.request<models.LoginResponse>({
|
|
29
|
+
method: "POST",
|
|
30
|
+
path: `/auth/oauth/totp/confirm`,
|
|
31
|
+
body,
|
|
32
|
+
channel: "auth",
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** auth.oauth.callback */
|
|
37
|
+
async callback(
|
|
38
|
+
provider: string,
|
|
39
|
+
body: models.OAuthCallbackRequest,
|
|
40
|
+
): Promise<
|
|
41
|
+
| models.LoginResponse
|
|
42
|
+
| models.OAuthCaptchaChallengeResponse
|
|
43
|
+
| models.OAuthTotpChallengeResponse
|
|
44
|
+
| models.StatusResponse
|
|
45
|
+
| models.MinecraftAccountLinkResponse
|
|
46
|
+
> {
|
|
47
|
+
return this.ctx.transport.request<
|
|
48
|
+
| models.LoginResponse
|
|
49
|
+
| models.OAuthCaptchaChallengeResponse
|
|
50
|
+
| models.OAuthTotpChallengeResponse
|
|
51
|
+
| models.StatusResponse
|
|
52
|
+
| models.MinecraftAccountLinkResponse
|
|
53
|
+
>({
|
|
54
|
+
method: "POST",
|
|
55
|
+
path: `/auth/oauth/${provider}/callback`,
|
|
56
|
+
body,
|
|
57
|
+
channel: "auth",
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** auth.oauth.start */
|
|
62
|
+
async start(
|
|
63
|
+
provider: string,
|
|
64
|
+
params?: { audience?: string },
|
|
65
|
+
): Promise<models.OAuthStartResponse> {
|
|
66
|
+
return fetchCachedOrThrow<models.OAuthStartResponse>(
|
|
67
|
+
this.ctx.transport,
|
|
68
|
+
this.ctx.etagStore,
|
|
69
|
+
{
|
|
70
|
+
method: "GET",
|
|
71
|
+
path: `/auth/oauth/${provider}/start`,
|
|
72
|
+
query: { audience: params?.audience },
|
|
73
|
+
channel: "auth",
|
|
74
|
+
},
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** auth.oauth2 procedures. */
|
|
80
|
+
export class AuthOauth2Ns {
|
|
81
|
+
constructor(private readonly ctx: ClientContext) {}
|
|
82
|
+
|
|
83
|
+
/** auth.oauth2.authorize */
|
|
84
|
+
async authorize(params?: {
|
|
85
|
+
responseType?: string;
|
|
86
|
+
clientId?: string;
|
|
87
|
+
codeChallenge?: string;
|
|
88
|
+
redirectUri?: string;
|
|
89
|
+
scope?: string;
|
|
90
|
+
state?: string;
|
|
91
|
+
codeChallengeMethod?: string;
|
|
92
|
+
}): Promise<unknown> {
|
|
93
|
+
return fetchCachedOrThrow<unknown>(this.ctx.transport, this.ctx.etagStore, {
|
|
94
|
+
method: "GET",
|
|
95
|
+
path: `/auth/oauth/authorize`,
|
|
96
|
+
query: {
|
|
97
|
+
response_type: params?.responseType,
|
|
98
|
+
client_id: params?.clientId,
|
|
99
|
+
code_challenge: params?.codeChallenge,
|
|
100
|
+
redirect_uri: params?.redirectUri,
|
|
101
|
+
scope: params?.scope,
|
|
102
|
+
state: params?.state,
|
|
103
|
+
code_challenge_method: params?.codeChallengeMethod,
|
|
104
|
+
},
|
|
105
|
+
channel: "auth",
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** auth.oauth2.token */
|
|
110
|
+
async token(): Promise<models.OAuthAuthorizationTokenResponse> {
|
|
111
|
+
return this.ctx.transport.request<models.OAuthAuthorizationTokenResponse>({
|
|
112
|
+
method: "POST",
|
|
113
|
+
path: `/auth/oauth/token`,
|
|
114
|
+
channel: "auth",
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** auth.tokens procedures. */
|
|
120
|
+
export class AuthTokensNs {
|
|
121
|
+
constructor(private readonly ctx: ClientContext) {}
|
|
122
|
+
|
|
123
|
+
/** auth.tokens.list */
|
|
124
|
+
async list(): Promise<models.PersonalAccessTokenListResponse> {
|
|
125
|
+
return fetchCachedOrThrow<models.PersonalAccessTokenListResponse>(
|
|
126
|
+
this.ctx.transport,
|
|
127
|
+
this.ctx.etagStore,
|
|
128
|
+
{ method: "GET", path: `/auth/pat-tokens`, channel: "auth" },
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** auth.tokens.create */
|
|
133
|
+
async create(
|
|
134
|
+
body: models.PersonalAccessTokenCreateRequest,
|
|
135
|
+
): Promise<models.PersonalAccessTokenCreateResponse> {
|
|
136
|
+
return this.ctx.transport.request<models.PersonalAccessTokenCreateResponse>(
|
|
137
|
+
{ method: "POST", path: `/auth/pat-tokens`, body, channel: "auth" },
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** auth.tokens.revoke */
|
|
142
|
+
async revoke(tokenId: number): Promise<models.StatusResponse> {
|
|
143
|
+
return this.ctx.transport.request<models.StatusResponse>({
|
|
144
|
+
method: "DELETE",
|
|
145
|
+
path: `/auth/pat-tokens/${tokenId}`,
|
|
146
|
+
channel: "auth",
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** auth.* procedures. */
|
|
152
|
+
export class AuthNs {
|
|
153
|
+
readonly oauth: AuthOauthNs;
|
|
154
|
+
readonly oauth2: AuthOauth2Ns;
|
|
155
|
+
readonly tokens: AuthTokensNs;
|
|
156
|
+
constructor(private readonly ctx: ClientContext) {
|
|
157
|
+
this.oauth = new AuthOauthNs(ctx);
|
|
158
|
+
this.oauth2 = new AuthOauth2Ns(ctx);
|
|
159
|
+
this.tokens = new AuthTokensNs(ctx);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** auth.login */
|
|
163
|
+
async login(body: models.UserLogin): Promise<models.LoginResponse> {
|
|
164
|
+
return this.ctx.transport.request<models.LoginResponse>({
|
|
165
|
+
method: "POST",
|
|
166
|
+
path: `/auth/login`,
|
|
167
|
+
body,
|
|
168
|
+
channel: "auth",
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** auth.logout */
|
|
173
|
+
async logout(): Promise<models.LogoutResponse> {
|
|
174
|
+
return this.ctx.transport.request<models.LogoutResponse>({
|
|
175
|
+
method: "POST",
|
|
176
|
+
path: `/auth/logout`,
|
|
177
|
+
channel: "auth",
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/** auth.refresh */
|
|
182
|
+
async refresh(
|
|
183
|
+
body: models.RefreshTokenRequest,
|
|
184
|
+
): Promise<models.LoginResponse> {
|
|
185
|
+
return this.ctx.transport.request<models.LoginResponse>({
|
|
186
|
+
method: "POST",
|
|
187
|
+
path: `/auth/refresh`,
|
|
188
|
+
body,
|
|
189
|
+
channel: "auth",
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** auth.register */
|
|
194
|
+
async register(body: models.UserRegister): Promise<models.UserPublic> {
|
|
195
|
+
return this.ctx.transport.request<models.UserPublic>({
|
|
196
|
+
method: "POST",
|
|
197
|
+
path: `/auth/register`,
|
|
198
|
+
body,
|
|
199
|
+
channel: "auth",
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/** auth.session */
|
|
204
|
+
async session(): Promise<models.LoginResponse> {
|
|
205
|
+
return this.ctx.transport.request<models.LoginResponse>({
|
|
206
|
+
method: "POST",
|
|
207
|
+
path: `/auth/session`,
|
|
208
|
+
channel: "auth",
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** control.cf.accounts procedures. */
|
|
214
|
+
export class ControlCfAccountsNs {
|
|
215
|
+
constructor(private readonly ctx: ClientContext) {}
|
|
216
|
+
|
|
217
|
+
/** control.cf.accounts.dns_list */
|
|
218
|
+
async dnsList(
|
|
219
|
+
accountId: string,
|
|
220
|
+
params?: { zoneId?: string },
|
|
221
|
+
): Promise<models.DnsRecordListResponse> {
|
|
222
|
+
return fetchCachedOrThrow<models.DnsRecordListResponse>(
|
|
223
|
+
this.ctx.transport,
|
|
224
|
+
this.ctx.etagStore,
|
|
225
|
+
{
|
|
226
|
+
method: "GET",
|
|
227
|
+
path: `/v1/control/cf/accounts/${accountId}/dns`,
|
|
228
|
+
query: { zone_id: params?.zoneId },
|
|
229
|
+
},
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/** control.cf.accounts.zones */
|
|
234
|
+
async zones(accountId: string): Promise<models.ZoneListResponse> {
|
|
235
|
+
return fetchCachedOrThrow<models.ZoneListResponse>(
|
|
236
|
+
this.ctx.transport,
|
|
237
|
+
this.ctx.etagStore,
|
|
238
|
+
{ method: "GET", path: `/v1/control/cf/accounts/${accountId}/zones` },
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/** control.cf.accounts.dns_create */
|
|
243
|
+
async dnsCreate(
|
|
244
|
+
accountId: string,
|
|
245
|
+
zoneId: string,
|
|
246
|
+
body: models.UpsertDnsRecordRequest,
|
|
247
|
+
): Promise<models.DnsRecordDTO> {
|
|
248
|
+
return this.ctx.transport.request<models.DnsRecordDTO>({
|
|
249
|
+
method: "POST",
|
|
250
|
+
path: `/v1/control/cf/accounts/${accountId}/zones/${zoneId}/dns`,
|
|
251
|
+
body,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/** control.cf.accounts.dns_delete */
|
|
256
|
+
async dnsDelete(
|
|
257
|
+
accountId: string,
|
|
258
|
+
zoneId: string,
|
|
259
|
+
recordId: string,
|
|
260
|
+
): Promise<unknown> {
|
|
261
|
+
return this.ctx.transport.request<unknown>({
|
|
262
|
+
method: "DELETE",
|
|
263
|
+
path: `/v1/control/cf/accounts/${accountId}/zones/${zoneId}/dns/${recordId}`,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/** control.cf.accounts.dns_update */
|
|
268
|
+
async dnsUpdate(
|
|
269
|
+
accountId: string,
|
|
270
|
+
zoneId: string,
|
|
271
|
+
recordId: string,
|
|
272
|
+
body: models.UpsertDnsRecordRequest,
|
|
273
|
+
): Promise<models.DnsRecordDTO> {
|
|
274
|
+
return this.ctx.transport.request<models.DnsRecordDTO>({
|
|
275
|
+
method: "PATCH",
|
|
276
|
+
path: `/v1/control/cf/accounts/${accountId}/zones/${zoneId}/dns/${recordId}`,
|
|
277
|
+
body,
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/** control.dcim procedures. */
|
|
283
|
+
export class ControlDcimNs {
|
|
284
|
+
constructor(private readonly ctx: ClientContext) {}
|
|
285
|
+
|
|
286
|
+
/** control.dcim.trace */
|
|
287
|
+
async trace(params?: {
|
|
288
|
+
cable?: string;
|
|
289
|
+
port?: string;
|
|
290
|
+
}): Promise<models.TracePathDTO> {
|
|
291
|
+
return fetchCachedOrThrow<models.TracePathDTO>(
|
|
292
|
+
this.ctx.transport,
|
|
293
|
+
this.ctx.etagStore,
|
|
294
|
+
{
|
|
295
|
+
method: "GET",
|
|
296
|
+
path: `/v1/control/dcim/power/trace`,
|
|
297
|
+
query: { cable: params?.cable, port: params?.port },
|
|
298
|
+
},
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/** control.dcim.assets procedures. */
|
|
304
|
+
export class ControlDcimAssetsNs {
|
|
305
|
+
constructor(private readonly ctx: ClientContext) {}
|
|
306
|
+
|
|
307
|
+
/** control.dcim.assets.history */
|
|
308
|
+
async history(params?: {
|
|
309
|
+
kind?: string;
|
|
310
|
+
assetId?: string;
|
|
311
|
+
}): Promise<models.OwnershipEventListResponse> {
|
|
312
|
+
return fetchCachedOrThrow<models.OwnershipEventListResponse>(
|
|
313
|
+
this.ctx.transport,
|
|
314
|
+
this.ctx.etagStore,
|
|
315
|
+
{
|
|
316
|
+
method: "GET",
|
|
317
|
+
path: `/v1/control/dcim/assets/history`,
|
|
318
|
+
query: { kind: params?.kind, asset_id: params?.assetId },
|
|
319
|
+
},
|
|
320
|
+
);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/** control.dcim.assets.resolve */
|
|
324
|
+
async resolve(params?: {
|
|
325
|
+
scanned?: string;
|
|
326
|
+
id?: string;
|
|
327
|
+
assetTag?: string;
|
|
328
|
+
}): Promise<models.ResolvedAssetDTO> {
|
|
329
|
+
return fetchCachedOrThrow<models.ResolvedAssetDTO>(
|
|
330
|
+
this.ctx.transport,
|
|
331
|
+
this.ctx.etagStore,
|
|
332
|
+
{
|
|
333
|
+
method: "GET",
|
|
334
|
+
path: `/v1/control/dcim/assets/resolve`,
|
|
335
|
+
query: {
|
|
336
|
+
scanned: params?.scanned,
|
|
337
|
+
id: params?.id,
|
|
338
|
+
asset_tag: params?.assetTag,
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/** control.dcim.assets.transfer */
|
|
345
|
+
async transfer(
|
|
346
|
+
body: models.TransferAssetRequest,
|
|
347
|
+
): Promise<models.OwnershipEventDTO> {
|
|
348
|
+
return this.ctx.transport.request<models.OwnershipEventDTO>({
|
|
349
|
+
method: "POST",
|
|
350
|
+
path: `/v1/control/dcim/assets/transfer`,
|
|
351
|
+
body,
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/** control.dcim.power procedures. */
|
|
357
|
+
export class ControlDcimPowerNs {
|
|
358
|
+
constructor(private readonly ctx: ClientContext) {}
|
|
359
|
+
|
|
360
|
+
/** control.dcim.power.impact */
|
|
361
|
+
async impact(params?: {
|
|
362
|
+
feed?: string;
|
|
363
|
+
pdu?: string;
|
|
364
|
+
outlet?: string;
|
|
365
|
+
}): Promise<models.PowerImpactDTO> {
|
|
366
|
+
return fetchCachedOrThrow<models.PowerImpactDTO>(
|
|
367
|
+
this.ctx.transport,
|
|
368
|
+
this.ctx.etagStore,
|
|
369
|
+
{
|
|
370
|
+
method: "GET",
|
|
371
|
+
path: `/v1/control/dcim/power/impact`,
|
|
372
|
+
query: { feed: params?.feed, pdu: params?.pdu, outlet: params?.outlet },
|
|
373
|
+
},
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/** control.dcim.power.sources */
|
|
378
|
+
async sources(params?: { device?: string }): Promise<models.PowerSourcesDTO> {
|
|
379
|
+
return fetchCachedOrThrow<models.PowerSourcesDTO>(
|
|
380
|
+
this.ctx.transport,
|
|
381
|
+
this.ctx.etagStore,
|
|
382
|
+
{
|
|
383
|
+
method: "GET",
|
|
384
|
+
path: `/v1/control/dcim/power/sources`,
|
|
385
|
+
query: { device: params?.device },
|
|
386
|
+
},
|
|
387
|
+
);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/** control.graph procedures. */
|
|
392
|
+
export class ControlGraphNs {
|
|
393
|
+
constructor(private readonly ctx: ClientContext) {}
|
|
394
|
+
|
|
395
|
+
/** control.graph.topology */
|
|
396
|
+
async topology(params?: {
|
|
397
|
+
project?: string;
|
|
398
|
+
include?: string;
|
|
399
|
+
}): Promise<models.TopologyResponse> {
|
|
400
|
+
return fetchCachedOrThrow<models.TopologyResponse>(
|
|
401
|
+
this.ctx.transport,
|
|
402
|
+
this.ctx.etagStore,
|
|
403
|
+
{
|
|
404
|
+
method: "GET",
|
|
405
|
+
path: `/v1/control/graph/topology`,
|
|
406
|
+
query: { project: params?.project, include: params?.include },
|
|
407
|
+
},
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/** control.graph.canvas_view procedures. */
|
|
413
|
+
export class ControlGraphCanvasViewNs {
|
|
414
|
+
constructor(private readonly ctx: ClientContext) {}
|
|
415
|
+
|
|
416
|
+
/** control.graph.canvas_view.get */
|
|
417
|
+
async get(): Promise<models.CanvasViewDTO> {
|
|
418
|
+
return fetchCachedOrThrow<models.CanvasViewDTO>(
|
|
419
|
+
this.ctx.transport,
|
|
420
|
+
this.ctx.etagStore,
|
|
421
|
+
{ method: "GET", path: `/v1/control/graph/canvas-view` },
|
|
422
|
+
);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/** control.graph.canvas_view.set */
|
|
426
|
+
async set(body: models.SetCanvasViewRequest): Promise<models.CanvasViewDTO> {
|
|
427
|
+
return this.ctx.transport.request<models.CanvasViewDTO>({
|
|
428
|
+
method: "POST",
|
|
429
|
+
path: `/v1/control/graph/canvas-view`,
|
|
430
|
+
body,
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/** control.* procedures. */
|
|
436
|
+
export class ControlNs {
|
|
437
|
+
readonly cfAccounts: ControlCfAccountsNs;
|
|
438
|
+
readonly dcim: ControlDcimNs;
|
|
439
|
+
readonly dcimAssets: ControlDcimAssetsNs;
|
|
440
|
+
readonly dcimPower: ControlDcimPowerNs;
|
|
441
|
+
readonly graph: ControlGraphNs;
|
|
442
|
+
readonly graphCanvasView: ControlGraphCanvasViewNs;
|
|
443
|
+
constructor(ctx: ClientContext) {
|
|
444
|
+
this.cfAccounts = new ControlCfAccountsNs(ctx);
|
|
445
|
+
this.dcim = new ControlDcimNs(ctx);
|
|
446
|
+
this.dcimAssets = new ControlDcimAssetsNs(ctx);
|
|
447
|
+
this.dcimPower = new ControlDcimPowerNs(ctx);
|
|
448
|
+
this.graph = new ControlGraphNs(ctx);
|
|
449
|
+
this.graphCanvasView = new ControlGraphCanvasViewNs(ctx);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Generated from the LeavePulse contract. Do not edit.
|
|
2
|
+
import { Resource, extractId } from "../runtime/resource";
|
|
3
|
+
import { fetchCachedOrThrow } from "../runtime/etag-store";
|
|
4
|
+
import type { components } from "../types";
|
|
5
|
+
import type * as models from "../models";
|
|
6
|
+
import type { ClientContext } from "../client";
|
|
7
|
+
|
|
8
|
+
type Data = components["schemas"]["AgentReleaseDTO"];
|
|
9
|
+
|
|
10
|
+
export class ControlAgentRelease extends Resource<Data> {
|
|
11
|
+
constructor(
|
|
12
|
+
data: Data,
|
|
13
|
+
private readonly ctx: ClientContext,
|
|
14
|
+
) {
|
|
15
|
+
super(data);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Re-fetch this ControlAgentRelease and hydrate in place. */
|
|
19
|
+
async refresh(): Promise<this> {
|
|
20
|
+
const data = await fetchCachedOrThrow(
|
|
21
|
+
this.ctx.transport,
|
|
22
|
+
this.ctx.etagStore,
|
|
23
|
+
{ method: "GET", path: `/v1/control/agent-release` },
|
|
24
|
+
);
|
|
25
|
+
let hydrated = data as Record<string, unknown>;
|
|
26
|
+
const id = extractId(hydrated);
|
|
27
|
+
return this.ctx.cache.upsertAlias(
|
|
28
|
+
"ControlAgentRelease",
|
|
29
|
+
this.id,
|
|
30
|
+
id,
|
|
31
|
+
hydrated,
|
|
32
|
+
() => this,
|
|
33
|
+
) as this;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Load this ControlAgentRelease's data (alias of refresh). */
|
|
37
|
+
fetch(): Promise<this> {
|
|
38
|
+
return this.refresh();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Generated from the LeavePulse contract. Do not edit.
|
|
2
|
+
import { Resource } from "../runtime/resource";
|
|
3
|
+
import { TopicSubscription } from "../runtime/realtime";
|
|
4
|
+
import { fetchCachedOrThrow } from "../runtime/etag-store";
|
|
5
|
+
import type * as models from "../models";
|
|
6
|
+
import type { ClientContext } from "../client";
|
|
7
|
+
|
|
8
|
+
type Data = { id: string | number } & Record<string, unknown>;
|
|
9
|
+
|
|
10
|
+
export class ControlAlert extends Resource<Data> {
|
|
11
|
+
constructor(
|
|
12
|
+
data: Data,
|
|
13
|
+
private readonly ctx: ClientContext,
|
|
14
|
+
) {
|
|
15
|
+
super(data);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** control.alerts.list */
|
|
19
|
+
async controlAlertsList(): Promise<models.AlertListResponse> {
|
|
20
|
+
return fetchCachedOrThrow<models.AlertListResponse>(
|
|
21
|
+
this.ctx.transport,
|
|
22
|
+
this.ctx.etagStore,
|
|
23
|
+
{ method: "GET", path: `/v1/control/alerts` },
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** control.alerts.acknowledge */
|
|
28
|
+
async alertsAcknowledge(): Promise<models.AlertListResponse> {
|
|
29
|
+
return this.ctx.transport.request<models.AlertListResponse>({
|
|
30
|
+
method: "POST",
|
|
31
|
+
path: `/v1/control/alerts/acknowledge`,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Subscribe to `control.alerts` (private realtime). */
|
|
36
|
+
onAlerts(): TopicSubscription {
|
|
37
|
+
return new TopicSubscription(this.ctx.realtime, "control.alerts");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Generated from the LeavePulse contract. Do not edit.
|
|
2
|
+
import { Resource } from "../runtime/resource";
|
|
3
|
+
import { TopicSubscription } from "../runtime/realtime";
|
|
4
|
+
import { fetchCachedOrThrow } from "../runtime/etag-store";
|
|
5
|
+
import type * as models from "../models";
|
|
6
|
+
import type { ClientContext } from "../client";
|
|
7
|
+
|
|
8
|
+
type Data = { id: string | number } & Record<string, unknown>;
|
|
9
|
+
|
|
10
|
+
export class ControlCfAccount extends Resource<Data> {
|
|
11
|
+
constructor(
|
|
12
|
+
data: Data,
|
|
13
|
+
private readonly ctx: ClientContext,
|
|
14
|
+
) {
|
|
15
|
+
super(data);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** control.cf.accounts.list */
|
|
19
|
+
async controlCfAccountsList(): Promise<models.CfAccountListResponse> {
|
|
20
|
+
return fetchCachedOrThrow<models.CfAccountListResponse>(
|
|
21
|
+
this.ctx.transport,
|
|
22
|
+
this.ctx.etagStore,
|
|
23
|
+
{ method: "GET", path: `/v1/control/cf/accounts` },
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** control.cf.accounts.get */
|
|
28
|
+
async controlCfAccountsGet(): Promise<models.CfAccountDTO> {
|
|
29
|
+
return fetchCachedOrThrow<models.CfAccountDTO>(
|
|
30
|
+
this.ctx.transport,
|
|
31
|
+
this.ctx.etagStore,
|
|
32
|
+
{ method: "GET", path: `/v1/control/cf/accounts/${this.id}` },
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** control.cf.accounts.create */
|
|
37
|
+
async cfAccountsCreate(
|
|
38
|
+
body: models.CreateCfAccountRequest,
|
|
39
|
+
): Promise<models.CfAccountDTO> {
|
|
40
|
+
return this.ctx.transport.request<models.CfAccountDTO>({
|
|
41
|
+
method: "POST",
|
|
42
|
+
path: `/v1/control/cf/accounts`,
|
|
43
|
+
body,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** control.cf.accounts.delete */
|
|
48
|
+
async cfAccountsDelete(): Promise<this> {
|
|
49
|
+
await this.ctx.transport.request({
|
|
50
|
+
method: "DELETE",
|
|
51
|
+
path: `/v1/control/cf/accounts/${this.id}`,
|
|
52
|
+
});
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** control.cf.accounts.update */
|
|
57
|
+
async cfAccountsUpdate(
|
|
58
|
+
body: models.UpdateCfAccountRequest,
|
|
59
|
+
): Promise<models.CfAccountDTO> {
|
|
60
|
+
return this.ctx.transport.request<models.CfAccountDTO>({
|
|
61
|
+
method: "PATCH",
|
|
62
|
+
path: `/v1/control/cf/accounts/${this.id}`,
|
|
63
|
+
body,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** control.cf.accounts.login */
|
|
68
|
+
async cfAccountsLogin(params?: {
|
|
69
|
+
force?: boolean;
|
|
70
|
+
}): Promise<models.CfAccountDTO> {
|
|
71
|
+
return this.ctx.transport.request<models.CfAccountDTO>({
|
|
72
|
+
method: "POST",
|
|
73
|
+
path: `/v1/control/cf/accounts/${this.id}/login`,
|
|
74
|
+
query: { force: params?.force },
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Subscribe to `control.cf.accounts` (private realtime). */
|
|
79
|
+
onAccounts(): TopicSubscription {
|
|
80
|
+
return new TopicSubscription(this.ctx.realtime, "control.cf.accounts");
|
|
81
|
+
}
|
|
82
|
+
}
|