@cboxdk/id-js 0.17.0 → 0.18.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 +218 -2
- package/dist/{chunk-WYTGLCMF.js → chunk-2E25IPBA.js} +4 -3
- package/dist/chunk-2E25IPBA.js.map +1 -0
- package/dist/{chunk-G3CD7X4U.js → chunk-CXGKOJRJ.js} +57 -4
- package/dist/chunk-CXGKOJRJ.js.map +1 -0
- package/dist/chunk-QQW63PGU.js +25 -0
- package/dist/chunk-QQW63PGU.js.map +1 -0
- package/dist/{chunk-ASOQN47M.js → chunk-SEUD4TE4.js} +3 -23
- package/dist/chunk-SEUD4TE4.js.map +1 -0
- package/dist/{client-CdwdigzG.d.ts → client-BSZASrMo.d.ts} +29 -1
- package/dist/{client-CEXddiCR.d.cts → client-BxUHm5hX.d.cts} +29 -1
- package/dist/errors-D61xljZE.d.cts +87 -0
- package/dist/errors-D61xljZE.d.ts +87 -0
- package/dist/index.cjs +56 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -88
- package/dist/index.d.ts +3 -88
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/management.cjs +4372 -0
- package/dist/management.cjs.map +1 -0
- package/dist/management.d.cts +10923 -0
- package/dist/management.d.ts +10923 -0
- package/dist/management.js +4335 -0
- package/dist/management.js.map +1 -0
- package/dist/nextjs.cjs.map +1 -1
- package/dist/nextjs.d.cts +1 -1
- package/dist/nextjs.d.ts +1 -1
- package/dist/nextjs.js +4 -3
- package/dist/nextjs.js.map +1 -1
- package/dist/server.js +3 -2
- package/package.json +9 -2
- package/dist/chunk-ASOQN47M.js.map +0 -1
- package/dist/chunk-G3CD7X4U.js.map +0 -1
- package/dist/chunk-WYTGLCMF.js.map +0 -1
|
@@ -0,0 +1,4372 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/errors.ts
|
|
4
|
+
var CboxIdError = class extends Error {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = new.target.name;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var ConfigurationError = class extends CboxIdError {
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// src/management/errors.ts
|
|
14
|
+
var CboxIdApiError = class extends CboxIdError {
|
|
15
|
+
/** HTTP status. */
|
|
16
|
+
status;
|
|
17
|
+
/** The stable machine code, e.g. `validation_failed`, `slug_taken`, `not_found`. */
|
|
18
|
+
error;
|
|
19
|
+
/**
|
|
20
|
+
* On `validation_failed` only: the offending request fields, each mapped to its messages
|
|
21
|
+
* (`{ name: ['The name field is required.'] }`). Empty otherwise.
|
|
22
|
+
*/
|
|
23
|
+
errors;
|
|
24
|
+
/** The id the server served the request under (`request_id`, else `X-Request-Id`). Quote it when reporting a problem. */
|
|
25
|
+
requestId;
|
|
26
|
+
/** Seconds to wait, off `Retry-After` — set on a `429` the client gave up retrying. */
|
|
27
|
+
retryAfter;
|
|
28
|
+
constructor(init) {
|
|
29
|
+
super(init.message);
|
|
30
|
+
this.status = init.status;
|
|
31
|
+
this.error = init.error;
|
|
32
|
+
this.errors = init.errors ?? {};
|
|
33
|
+
this.requestId = init.requestId ?? null;
|
|
34
|
+
this.retryAfter = init.retryAfter;
|
|
35
|
+
}
|
|
36
|
+
/** Whether this is a `422 validation_failed` with field errors. */
|
|
37
|
+
get isValidationError() {
|
|
38
|
+
return this.error === "validation_failed";
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var ManagementNetworkError = class extends CboxIdError {
|
|
42
|
+
constructor(message, idempotencyKey, options) {
|
|
43
|
+
super(message);
|
|
44
|
+
this.idempotencyKey = idempotencyKey;
|
|
45
|
+
if (options && "cause" in options) {
|
|
46
|
+
this.cause = options.cause;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
idempotencyKey;
|
|
50
|
+
};
|
|
51
|
+
var ApprovalError = class extends CboxIdError {
|
|
52
|
+
constructor(message, reason, approval) {
|
|
53
|
+
super(message);
|
|
54
|
+
this.reason = reason;
|
|
55
|
+
this.approval = approval;
|
|
56
|
+
}
|
|
57
|
+
reason;
|
|
58
|
+
approval;
|
|
59
|
+
};
|
|
60
|
+
var ApprovalDeniedError = class extends ApprovalError {
|
|
61
|
+
constructor(approval) {
|
|
62
|
+
super(`Approval ${approval.id} was denied.`, "denied", approval);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var ApprovalExpiredError = class extends ApprovalError {
|
|
66
|
+
constructor(approval) {
|
|
67
|
+
super(`Approval ${approval.id} expired before it was approved.`, "expired", approval);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// src/management/transport.ts
|
|
72
|
+
var KEY_PREFIX = {
|
|
73
|
+
environment: "cbid_env_",
|
|
74
|
+
workspace: "cbid_ws_",
|
|
75
|
+
platform: null,
|
|
76
|
+
account: null
|
|
77
|
+
};
|
|
78
|
+
var APPROVAL_MOUNT = {
|
|
79
|
+
environment: "",
|
|
80
|
+
workspace: "/workspace",
|
|
81
|
+
platform: "/platform",
|
|
82
|
+
account: "/me"
|
|
83
|
+
};
|
|
84
|
+
var WRITE_METHODS = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
|
|
85
|
+
var MAX_APPROVAL_ROUNDS = 3;
|
|
86
|
+
function isRecord(value) {
|
|
87
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
88
|
+
}
|
|
89
|
+
function uuid() {
|
|
90
|
+
if (typeof crypto.randomUUID === "function") {
|
|
91
|
+
return crypto.randomUUID();
|
|
92
|
+
}
|
|
93
|
+
const bytes = crypto.getRandomValues(new Uint8Array(16));
|
|
94
|
+
bytes[6] = bytes[6] & 15 | 64;
|
|
95
|
+
bytes[8] = bytes[8] & 63 | 128;
|
|
96
|
+
const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
|
|
97
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
98
|
+
}
|
|
99
|
+
function retryAfterMs(headers) {
|
|
100
|
+
const raw = headers.get("retry-after")?.trim();
|
|
101
|
+
if (raw === void 0 || raw === "") {
|
|
102
|
+
return void 0;
|
|
103
|
+
}
|
|
104
|
+
if (/^\d+$/.test(raw)) {
|
|
105
|
+
return Number(raw) * 1e3;
|
|
106
|
+
}
|
|
107
|
+
const date = Date.parse(raw);
|
|
108
|
+
return Number.isNaN(date) ? void 0 : Math.max(0, date - Date.now());
|
|
109
|
+
}
|
|
110
|
+
function sleep(ms, signal) {
|
|
111
|
+
if (ms <= 0) {
|
|
112
|
+
return signal?.aborted ? Promise.reject(signal.reason) : Promise.resolve();
|
|
113
|
+
}
|
|
114
|
+
return new Promise((resolve, reject) => {
|
|
115
|
+
if (signal?.aborted) {
|
|
116
|
+
reject(signal.reason);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const timer = setTimeout(() => {
|
|
120
|
+
signal?.removeEventListener("abort", onAbort);
|
|
121
|
+
resolve();
|
|
122
|
+
}, ms);
|
|
123
|
+
const onAbort = () => {
|
|
124
|
+
clearTimeout(timer);
|
|
125
|
+
reject(signal?.reason);
|
|
126
|
+
};
|
|
127
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function normalizeBaseUrl(raw) {
|
|
131
|
+
let url;
|
|
132
|
+
try {
|
|
133
|
+
url = new URL(raw);
|
|
134
|
+
} catch {
|
|
135
|
+
throw new ConfigurationError("Management client `baseUrl` is not a valid URL.");
|
|
136
|
+
}
|
|
137
|
+
const loopback = ["localhost", "127.0.0.1", "[::1]", "::1"].includes(url.hostname);
|
|
138
|
+
if (url.protocol !== "https:" && !(url.protocol === "http:" && loopback)) {
|
|
139
|
+
throw new ConfigurationError(`Management client \`baseUrl\` must be https (got ${url.protocol}//${url.hostname}).`);
|
|
140
|
+
}
|
|
141
|
+
const path = url.pathname.replace(/\/+$/, "");
|
|
142
|
+
return `${url.origin}${path.endsWith("/api/v1") ? path : `${path}/api/v1`}`;
|
|
143
|
+
}
|
|
144
|
+
function appendQuery(params, key, value) {
|
|
145
|
+
if (value === void 0 || value === null) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (Array.isArray(value)) {
|
|
149
|
+
for (const item of value) {
|
|
150
|
+
appendQuery(params, `${key}[]`, item);
|
|
151
|
+
}
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (typeof value === "boolean") {
|
|
155
|
+
params.append(key, value ? "1" : "0");
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
params.append(key, typeof value === "object" ? JSON.stringify(value) : String(value));
|
|
159
|
+
}
|
|
160
|
+
async function readJson(response) {
|
|
161
|
+
const text = await response.text();
|
|
162
|
+
if (text === "") {
|
|
163
|
+
return void 0;
|
|
164
|
+
}
|
|
165
|
+
try {
|
|
166
|
+
return JSON.parse(text);
|
|
167
|
+
} catch {
|
|
168
|
+
return void 0;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
var ManagementTransport = class {
|
|
172
|
+
plane;
|
|
173
|
+
baseUrl;
|
|
174
|
+
#options;
|
|
175
|
+
#fetch;
|
|
176
|
+
#maxRetries;
|
|
177
|
+
#baseDelayMs;
|
|
178
|
+
#maxDelayMs;
|
|
179
|
+
#dpopNonce;
|
|
180
|
+
constructor(plane, options, defaultBaseUrl) {
|
|
181
|
+
const baseUrl = options.baseUrl ?? defaultBaseUrl;
|
|
182
|
+
if (baseUrl === void 0 || baseUrl === "") {
|
|
183
|
+
throw new ConfigurationError(`The ${plane} management client needs a \`baseUrl\` (the environment's own host).`);
|
|
184
|
+
}
|
|
185
|
+
const hasKey = options.apiKey !== void 0;
|
|
186
|
+
const hasToken = options.accessToken !== void 0;
|
|
187
|
+
if (hasKey === hasToken) {
|
|
188
|
+
throw new ConfigurationError("Pass exactly one of `apiKey` and `accessToken` to a management client.");
|
|
189
|
+
}
|
|
190
|
+
if (hasKey) {
|
|
191
|
+
const key = options.apiKey ?? "";
|
|
192
|
+
const expected = KEY_PREFIX[plane];
|
|
193
|
+
if (key === "") {
|
|
194
|
+
throw new ConfigurationError("Management client `apiKey` is empty.");
|
|
195
|
+
}
|
|
196
|
+
if (expected === null) {
|
|
197
|
+
throw new ConfigurationError(
|
|
198
|
+
`The ${plane} plane accepts no management key \u2014 only an access token a person delegated (\`accessToken\`).`
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
const wrong = Object.values(KEY_PREFIX).find((prefix) => prefix !== null && prefix !== expected && key.startsWith(prefix));
|
|
202
|
+
if (wrong !== void 0) {
|
|
203
|
+
throw new ConfigurationError(`A \`${wrong}\u2026\` key cannot call the ${plane} plane; it takes \`${expected}\u2026\` keys.`);
|
|
204
|
+
}
|
|
205
|
+
if (options.dpop !== void 0) {
|
|
206
|
+
throw new ConfigurationError("`dpop` applies to an `accessToken`, not a management key.");
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (options.environment !== void 0) {
|
|
210
|
+
if (plane !== "environment") {
|
|
211
|
+
throw new ConfigurationError(`\`environment\` applies to the environment plane, not the ${plane} plane.`);
|
|
212
|
+
}
|
|
213
|
+
if (options.environment === "") {
|
|
214
|
+
throw new ConfigurationError("Management client `environment` is empty.");
|
|
215
|
+
}
|
|
216
|
+
if (hasKey) {
|
|
217
|
+
throw new ConfigurationError(
|
|
218
|
+
"`environment` names the environment for a root access token. A `cbid_env_\u2026` key is bound to its own environment's host: use that host as `baseUrl` instead."
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
this.plane = plane;
|
|
223
|
+
this.baseUrl = normalizeBaseUrl(baseUrl);
|
|
224
|
+
this.#options = options;
|
|
225
|
+
this.#fetch = options.fetch ?? ((input, init) => fetch(input, init));
|
|
226
|
+
this.#maxRetries = Math.max(0, options.retry?.maxRetries ?? 3);
|
|
227
|
+
this.#baseDelayMs = Math.max(0, options.retry?.baseDelayMs ?? 500);
|
|
228
|
+
this.#maxDelayMs = Math.max(0, options.retry?.maxDelayMs ?? 3e4);
|
|
229
|
+
}
|
|
230
|
+
/** Run one operation. Generated methods call this; so can you, with an operation spec. */
|
|
231
|
+
async call(op, pathArgs, input, options) {
|
|
232
|
+
const url = this.#url(op, pathArgs, op.body ? void 0 : input);
|
|
233
|
+
const payload = op.body ? input : void 0;
|
|
234
|
+
const idempotencyKey = WRITE_METHODS.has(op.method) ? options?.idempotencyKey ?? uuid() : void 0;
|
|
235
|
+
const send = {
|
|
236
|
+
idempotencyKey,
|
|
237
|
+
approvalId: options?.approvalId,
|
|
238
|
+
signal: options?.signal,
|
|
239
|
+
headers: options?.headers
|
|
240
|
+
};
|
|
241
|
+
const context = { action: op.action, danger: op.danger, method: op.method, path: op.path };
|
|
242
|
+
const response = await this.#send(op.method, url, payload, send);
|
|
243
|
+
const held = await this.#heldApproval(response);
|
|
244
|
+
if (held !== null && options?.approval === "return") {
|
|
245
|
+
const result = {
|
|
246
|
+
pending: true,
|
|
247
|
+
status: 202,
|
|
248
|
+
approval: held.approval,
|
|
249
|
+
idempotencyKey,
|
|
250
|
+
action: op.action,
|
|
251
|
+
resume: (resumeOptions) => this.#approveAndRepeat(op.method, url, payload, { ...send, signal: resumeOptions?.signal ?? send.signal }, held, context, false)
|
|
252
|
+
};
|
|
253
|
+
return result;
|
|
254
|
+
}
|
|
255
|
+
if (held !== null) {
|
|
256
|
+
return await this.#approveAndRepeat(op.method, url, payload, send, held, context, true);
|
|
257
|
+
}
|
|
258
|
+
return await this.#result(response, idempotencyKey);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Every item of a paged list, fetching pages as the iteration reaches them. Works for both
|
|
262
|
+
* cursor (`after` / `meta.next_cursor`) and numbered (`page` / `meta.next_page`) lists.
|
|
263
|
+
*/
|
|
264
|
+
async *paginate(op, pathArgs, input, options) {
|
|
265
|
+
let query = { ...input ?? {} };
|
|
266
|
+
for (; ; ) {
|
|
267
|
+
const page = await this.call(op, pathArgs, query, {
|
|
268
|
+
...options,
|
|
269
|
+
approval: "wait"
|
|
270
|
+
});
|
|
271
|
+
const items = Array.isArray(page.data) ? page.data : [];
|
|
272
|
+
yield* items;
|
|
273
|
+
const meta = page.meta;
|
|
274
|
+
if (items.length === 0 || meta?.has_more !== true) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
if (op.pagination === "page") {
|
|
278
|
+
const current = typeof query.page === "number" ? query.page : Number(query.page ?? 1);
|
|
279
|
+
query = { ...query, page: meta.next_page ?? current + 1 };
|
|
280
|
+
} else {
|
|
281
|
+
if (typeof meta.next_cursor !== "string" || meta.next_cursor === "") {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
query = { ...query, after: meta.next_cursor };
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* An escape hatch for a route the generated surface does not cover. `path` is relative to
|
|
290
|
+
* `/api/v1`. Writes get an `Idempotency-Key` and the approval loop like any operation.
|
|
291
|
+
*/
|
|
292
|
+
request(method, path, input, options) {
|
|
293
|
+
const op = {
|
|
294
|
+
action: null,
|
|
295
|
+
operationId: null,
|
|
296
|
+
method,
|
|
297
|
+
path,
|
|
298
|
+
pathParams: [],
|
|
299
|
+
scope: null,
|
|
300
|
+
danger: null,
|
|
301
|
+
approval: true,
|
|
302
|
+
body: input?.body !== void 0,
|
|
303
|
+
pagination: null
|
|
304
|
+
};
|
|
305
|
+
return this.call(op, [], input?.body ?? input?.query, options);
|
|
306
|
+
}
|
|
307
|
+
#url(op, pathArgs, query) {
|
|
308
|
+
let index = 0;
|
|
309
|
+
const path = op.path.replace(/\{([^}]+)\}/g, (_, name) => {
|
|
310
|
+
const value = pathArgs[index++];
|
|
311
|
+
if (value === void 0 || value === "") {
|
|
312
|
+
throw new TypeError(`${op.action ?? op.path}: missing path parameter \`${name}\`.`);
|
|
313
|
+
}
|
|
314
|
+
return encodeURIComponent(value);
|
|
315
|
+
});
|
|
316
|
+
const url = new URL(`${this.baseUrl}${path}`);
|
|
317
|
+
if (isRecord(query)) {
|
|
318
|
+
for (const [key, value] of Object.entries(query)) {
|
|
319
|
+
appendQuery(url.searchParams, key, value);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
return url.toString();
|
|
323
|
+
}
|
|
324
|
+
async #headers(method, url, send, hasBody) {
|
|
325
|
+
const headers = new Headers({ ...this.#options.headers, ...send.headers });
|
|
326
|
+
headers.set("accept", "application/json");
|
|
327
|
+
if (hasBody) {
|
|
328
|
+
headers.set("content-type", "application/json");
|
|
329
|
+
}
|
|
330
|
+
if (send.idempotencyKey !== void 0) {
|
|
331
|
+
headers.set("idempotency-key", send.idempotencyKey);
|
|
332
|
+
}
|
|
333
|
+
if (send.approvalId !== void 0) {
|
|
334
|
+
headers.set("cbox-approval", send.approvalId);
|
|
335
|
+
}
|
|
336
|
+
if (this.#options.environment !== void 0) {
|
|
337
|
+
headers.set("cbox-environment", this.#options.environment);
|
|
338
|
+
}
|
|
339
|
+
if (this.#options.apiKey !== void 0) {
|
|
340
|
+
headers.set("authorization", `Bearer ${this.#options.apiKey}`);
|
|
341
|
+
return headers;
|
|
342
|
+
}
|
|
343
|
+
const source = this.#options.accessToken;
|
|
344
|
+
const token = typeof source === "function" ? await source() : source;
|
|
345
|
+
if (typeof token !== "string" || token === "") {
|
|
346
|
+
throw new ConfigurationError("The management client `accessToken` provider returned no token.");
|
|
347
|
+
}
|
|
348
|
+
const dpop = this.#options.dpop;
|
|
349
|
+
if (dpop === void 0) {
|
|
350
|
+
headers.set("authorization", `Bearer ${token}`);
|
|
351
|
+
return headers;
|
|
352
|
+
}
|
|
353
|
+
headers.set("authorization", `DPoP ${token}`);
|
|
354
|
+
headers.set(
|
|
355
|
+
"dpop",
|
|
356
|
+
await dpop.proof({
|
|
357
|
+
method,
|
|
358
|
+
url,
|
|
359
|
+
accessToken: token,
|
|
360
|
+
...this.#dpopNonce !== void 0 ? { nonce: this.#dpopNonce } : {}
|
|
361
|
+
})
|
|
362
|
+
);
|
|
363
|
+
return headers;
|
|
364
|
+
}
|
|
365
|
+
/** One HTTP exchange, plus the single DPoP-nonce challenge retry RFC 9449 §8 describes. */
|
|
366
|
+
async #exchange(method, url, payload, send) {
|
|
367
|
+
for (let nonceRetry = 0; ; nonceRetry++) {
|
|
368
|
+
const headers = await this.#headers(method, url, send, payload !== void 0);
|
|
369
|
+
const timeout = AbortSignal.timeout(this.#options.timeoutMs ?? 3e4);
|
|
370
|
+
const signal = send.signal ? AbortSignal.any([send.signal, timeout]) : timeout;
|
|
371
|
+
const init = { method, headers, signal };
|
|
372
|
+
if (payload !== void 0) {
|
|
373
|
+
init.body = JSON.stringify(payload);
|
|
374
|
+
}
|
|
375
|
+
const response = await this.#fetch(url, init);
|
|
376
|
+
const nonce = response.headers.get("dpop-nonce");
|
|
377
|
+
if (nonce !== null && this.#options.dpop !== void 0) {
|
|
378
|
+
const challenged = response.status === 401 && nonce !== this.#dpopNonce && nonceRetry === 0;
|
|
379
|
+
this.#dpopNonce = nonce;
|
|
380
|
+
if (challenged) {
|
|
381
|
+
await response.body?.cancel();
|
|
382
|
+
continue;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return response;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
async #shouldRetry(response) {
|
|
389
|
+
if (response.status >= 500 || response.status === 429) {
|
|
390
|
+
return true;
|
|
391
|
+
}
|
|
392
|
+
if (response.status === 409) {
|
|
393
|
+
const body = await readJson(response.clone());
|
|
394
|
+
return isRecord(body) && body.error === "idempotency_in_progress";
|
|
395
|
+
}
|
|
396
|
+
return false;
|
|
397
|
+
}
|
|
398
|
+
#backoff(attempt) {
|
|
399
|
+
const exponential = this.#baseDelayMs * 2 ** attempt;
|
|
400
|
+
return Math.min(this.#maxDelayMs, exponential / 2 + Math.random() * (exponential / 2));
|
|
401
|
+
}
|
|
402
|
+
/** Send with retries. Every attempt carries the SAME Idempotency-Key, so a write lands once. */
|
|
403
|
+
async #send(method, url, payload, send) {
|
|
404
|
+
for (let attempt = 0; ; attempt++) {
|
|
405
|
+
let response;
|
|
406
|
+
try {
|
|
407
|
+
response = await this.#exchange(method, url, payload, send);
|
|
408
|
+
} catch (error) {
|
|
409
|
+
if (send.signal?.aborted) {
|
|
410
|
+
throw send.signal.reason ?? error;
|
|
411
|
+
}
|
|
412
|
+
if (error instanceof CboxIdError || attempt >= this.#maxRetries) {
|
|
413
|
+
if (error instanceof CboxIdError) {
|
|
414
|
+
throw error;
|
|
415
|
+
}
|
|
416
|
+
throw new ManagementNetworkError(
|
|
417
|
+
`${method} ${new URL(url).pathname} failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
418
|
+
send.idempotencyKey,
|
|
419
|
+
{ cause: error }
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
await sleep(this.#backoff(attempt), send.signal);
|
|
423
|
+
continue;
|
|
424
|
+
}
|
|
425
|
+
if (attempt >= this.#maxRetries || !await this.#shouldRetry(response)) {
|
|
426
|
+
return response;
|
|
427
|
+
}
|
|
428
|
+
const delay = retryAfterMs(response.headers) ?? this.#backoff(attempt);
|
|
429
|
+
if (delay > this.#maxDelayMs) {
|
|
430
|
+
return response;
|
|
431
|
+
}
|
|
432
|
+
await response.body?.cancel();
|
|
433
|
+
await sleep(delay, send.signal);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
async #heldApproval(response) {
|
|
437
|
+
if (response.status !== 202) {
|
|
438
|
+
return null;
|
|
439
|
+
}
|
|
440
|
+
const body = await readJson(response.clone());
|
|
441
|
+
if (!isRecord(body) || body.error !== "approval_required" || !isRecord(body.approval)) {
|
|
442
|
+
return null;
|
|
443
|
+
}
|
|
444
|
+
const approval = body.approval;
|
|
445
|
+
if (typeof approval.id !== "string" || approval.id === "") {
|
|
446
|
+
return null;
|
|
447
|
+
}
|
|
448
|
+
return {
|
|
449
|
+
approval: {
|
|
450
|
+
id: approval.id,
|
|
451
|
+
status: typeof approval.status === "string" ? approval.status : "pending",
|
|
452
|
+
binding_code: typeof approval.binding_code === "string" ? approval.binding_code : "",
|
|
453
|
+
expires_at: typeof approval.expires_at === "string" ? approval.expires_at : "",
|
|
454
|
+
poll_url: typeof approval.poll_url === "string" ? approval.poll_url : `${this.baseUrl}${APPROVAL_MOUNT[this.plane]}/action-approvals/${encodeURIComponent(approval.id)}`
|
|
455
|
+
},
|
|
456
|
+
retryAfter: retryAfterMs(response.headers)
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
async #approveAndRepeat(method, url, payload, send, first, context, notify) {
|
|
460
|
+
let held = first;
|
|
461
|
+
for (let round = 1; ; round++) {
|
|
462
|
+
if (notify || round > 1) {
|
|
463
|
+
await this.#options.onApprovalRequired?.(held.approval, context);
|
|
464
|
+
}
|
|
465
|
+
await this.#awaitApproval(held.approval, held.retryAfter, send.signal);
|
|
466
|
+
const response = await this.#send(method, url, payload, { ...send, approvalId: held.approval.id });
|
|
467
|
+
const again = await this.#heldApproval(response);
|
|
468
|
+
if (again === null) {
|
|
469
|
+
return this.#result(response, send.idempotencyKey);
|
|
470
|
+
}
|
|
471
|
+
if (round >= MAX_APPROVAL_ROUNDS) {
|
|
472
|
+
throw new ApprovalError(
|
|
473
|
+
`The request was held for approval ${round} times; giving up.`,
|
|
474
|
+
"consumed",
|
|
475
|
+
again.approval
|
|
476
|
+
);
|
|
477
|
+
}
|
|
478
|
+
held = again;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
/** Poll an approval until the person decides. Resolves on `approved`; throws otherwise. */
|
|
482
|
+
async #awaitApproval(approval, initialDelay, signal) {
|
|
483
|
+
const pollUrl = new URL(approval.poll_url, this.baseUrl);
|
|
484
|
+
if (pollUrl.origin !== new URL(this.baseUrl).origin) {
|
|
485
|
+
throw new CboxIdError(`Refusing to poll approval ${approval.id} at another origin (${pollUrl.origin}).`);
|
|
486
|
+
}
|
|
487
|
+
const fallback = Math.max(0, this.#options.approvalPollIntervalMs ?? 2e3);
|
|
488
|
+
const expiresAt = Date.parse(approval.expires_at);
|
|
489
|
+
let delay = initialDelay ?? fallback;
|
|
490
|
+
for (; ; ) {
|
|
491
|
+
await sleep(Math.min(delay, 6e4), signal);
|
|
492
|
+
const response = await this.#send("GET", pollUrl.toString(), void 0, { signal });
|
|
493
|
+
if (!response.ok) {
|
|
494
|
+
throw await this.#error(response);
|
|
495
|
+
}
|
|
496
|
+
const body = await readJson(response);
|
|
497
|
+
const data = isRecord(body) && isRecord(body.data) ? body.data : {};
|
|
498
|
+
const status = typeof data.status === "string" ? data.status : "pending";
|
|
499
|
+
switch (status) {
|
|
500
|
+
case "approved":
|
|
501
|
+
return;
|
|
502
|
+
case "denied":
|
|
503
|
+
throw new ApprovalDeniedError(approval);
|
|
504
|
+
case "expired":
|
|
505
|
+
throw new ApprovalExpiredError(approval);
|
|
506
|
+
case "consumed":
|
|
507
|
+
throw new ApprovalError(`Approval ${approval.id} was already used by another request.`, "consumed", approval);
|
|
508
|
+
}
|
|
509
|
+
if (!Number.isNaN(expiresAt) && Date.now() > expiresAt + 3e4) {
|
|
510
|
+
throw new ApprovalExpiredError(approval);
|
|
511
|
+
}
|
|
512
|
+
delay = retryAfterMs(response.headers) ?? fallback;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
async #result(response, idempotencyKey) {
|
|
516
|
+
if (!response.ok) {
|
|
517
|
+
throw await this.#error(response);
|
|
518
|
+
}
|
|
519
|
+
const body = response.status === 204 ? void 0 : await readJson(response);
|
|
520
|
+
const envelope = isRecord(body) && "data" in body;
|
|
521
|
+
return {
|
|
522
|
+
pending: false,
|
|
523
|
+
status: response.status,
|
|
524
|
+
data: envelope ? body.data : body,
|
|
525
|
+
meta: envelope ? body.meta : void 0,
|
|
526
|
+
body,
|
|
527
|
+
replayed: response.headers.get("idempotent-replayed")?.toLowerCase() === "true",
|
|
528
|
+
idempotencyKey,
|
|
529
|
+
requestId: response.headers.get("x-request-id"),
|
|
530
|
+
headers: response.headers
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
async #error(response) {
|
|
534
|
+
const body = await readJson(response);
|
|
535
|
+
const fields = isRecord(body) ? body : {};
|
|
536
|
+
const code = typeof fields.error === "string" ? fields.error : `http_${response.status}`;
|
|
537
|
+
const message = typeof fields.message === "string" ? fields.message : typeof fields.error_description === "string" ? fields.error_description : `HTTP ${response.status}`;
|
|
538
|
+
const errors = {};
|
|
539
|
+
if (isRecord(fields.errors)) {
|
|
540
|
+
for (const [field, messages] of Object.entries(fields.errors)) {
|
|
541
|
+
errors[field] = Array.isArray(messages) ? messages.map(String) : [String(messages)];
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
const retryAfter = retryAfterMs(response.headers);
|
|
545
|
+
const requestId = typeof fields.request_id === "string" && fields.request_id !== "" ? fields.request_id : response.headers.get("x-request-id");
|
|
546
|
+
return new CboxIdApiError({
|
|
547
|
+
status: response.status,
|
|
548
|
+
error: code,
|
|
549
|
+
message,
|
|
550
|
+
errors,
|
|
551
|
+
requestId,
|
|
552
|
+
retryAfter: retryAfter === void 0 ? void 0 : Math.ceil(retryAfter / 1e3)
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
// src/management/generated/environment.ts
|
|
558
|
+
var environmentOperations = {
|
|
559
|
+
"access_reviews.close": { action: "access_reviews.close", operationId: "access_reviews_close", method: "POST", path: "/access-reviews/{id}/close", pathParams: ["id"], scope: "governance:write", danger: "destructive", approval: true, body: true, pagination: null },
|
|
560
|
+
"access_reviews.create": { action: "access_reviews.create", operationId: "access_reviews_create", method: "POST", path: "/access-reviews", pathParams: [], scope: "governance:write", danger: "write", approval: true, body: true, pagination: null },
|
|
561
|
+
"access_reviews.get": { action: "access_reviews.get", operationId: "access_reviews_get", method: "GET", path: "/access-reviews/{id}", pathParams: ["id"], scope: "governance:read", danger: "read", approval: true, body: false, pagination: null },
|
|
562
|
+
"access_reviews.items.decide": { action: "access_reviews.items.decide", operationId: "access_reviews_items_decide", method: "POST", path: "/access-reviews/{id}/items/{item_id}", pathParams: ["id", "item_id"], scope: "governance:write", danger: "write", approval: true, body: true, pagination: null },
|
|
563
|
+
"access_reviews.items.list": { action: "access_reviews.items.list", operationId: "access_reviews_items_list", method: "GET", path: "/access-reviews/{id}/items", pathParams: ["id"], scope: "governance:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
564
|
+
"access_reviews.list": { action: "access_reviews.list", operationId: "access_reviews_list", method: "GET", path: "/access-reviews", pathParams: [], scope: "governance:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
565
|
+
"action_approvals.get": { action: null, operationId: null, method: "GET", path: "/action-approvals/{id}", pathParams: ["id"], scope: null, danger: null, approval: false, body: false, pagination: null },
|
|
566
|
+
"api_keys.list": { action: "api_keys.list", operationId: "api_keys_list", method: "GET", path: "/organizations/{organization_id}/api-keys", pathParams: ["organization_id"], scope: "api_keys:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
567
|
+
"api_keys.revoke": { action: "api_keys.revoke", operationId: "api_keys_revoke", method: "DELETE", path: "/api-keys/{id}", pathParams: ["id"], scope: "api_keys:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
568
|
+
"apis.create": { action: "apis.create", operationId: null, method: "POST", path: "/apis", pathParams: [], scope: "apis:write", danger: "write", approval: true, body: true, pagination: null },
|
|
569
|
+
"apis.delete": { action: "apis.delete", operationId: null, method: "DELETE", path: "/apis/{id}", pathParams: ["id"], scope: "apis:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
570
|
+
"apis.get": { action: "apis.get", operationId: null, method: "GET", path: "/apis/{id}", pathParams: ["id"], scope: "apis:read", danger: "read", approval: true, body: false, pagination: null },
|
|
571
|
+
"apis.list": { action: "apis.list", operationId: null, method: "GET", path: "/apis", pathParams: [], scope: "apis:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
572
|
+
"apis.scopes.define": { action: "apis.scopes.define", operationId: "apis_scopes_define", method: "PUT", path: "/apis/{id}/scopes/{key}", pathParams: ["id", "key"], scope: "apis:write", danger: "write", approval: true, body: true, pagination: null },
|
|
573
|
+
"apis.scopes.remove": { action: "apis.scopes.remove", operationId: "apis_scopes_remove", method: "DELETE", path: "/apis/{id}/scopes/{key}", pathParams: ["id", "key"], scope: "apis:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
574
|
+
"apis.update": { action: "apis.update", operationId: null, method: "PATCH", path: "/apis/{id}", pathParams: ["id"], scope: "apis:write", danger: "write", approval: true, body: true, pagination: null },
|
|
575
|
+
"approvals.deny": { action: "approvals.deny", operationId: "approvals_deny", method: "POST", path: "/agent-requests/{request_id}/deny", pathParams: ["request_id"], scope: "approvals:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
576
|
+
"approvals.list": { action: "approvals.list", operationId: "approvals_list", method: "GET", path: "/agent-requests", pathParams: [], scope: "approvals:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
577
|
+
"apps.blueprint": { action: "apps.blueprint", operationId: "apps_blueprint", method: "GET", path: "/apps/{id}/blueprint", pathParams: ["id"], scope: "apps:read", danger: "read", approval: true, body: false, pagination: null },
|
|
578
|
+
"apps.copy": { action: "apps.copy", operationId: "apps_copy", method: "POST", path: "/apps/{id}/copy", pathParams: ["id"], scope: "apps:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
579
|
+
"apps.create": { action: "apps.create", operationId: "apps_create", method: "POST", path: "/apps", pathParams: [], scope: "apps:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
580
|
+
"apps.delete": { action: "apps.delete", operationId: "apps_delete", method: "DELETE", path: "/apps/{id}", pathParams: ["id"], scope: "apps:write", danger: "critical", approval: true, body: false, pagination: null },
|
|
581
|
+
"apps.get": { action: "apps.get", operationId: "apps_get", method: "GET", path: "/apps/{id}", pathParams: ["id"], scope: "apps:read", danger: "read", approval: true, body: false, pagination: null },
|
|
582
|
+
"apps.list": { action: "apps.list", operationId: "apps_list", method: "GET", path: "/apps", pathParams: [], scope: "apps:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
583
|
+
"apps.manifest.set": { action: "apps.manifest.set", operationId: "apps_manifest_set", method: "PUT", path: "/apps/{id}/manifest", pathParams: ["id"], scope: "apps:write", danger: "write", approval: true, body: true, pagination: null },
|
|
584
|
+
"apps.manifest.sync": { action: "apps.manifest.sync", operationId: "apps_manifest_sync", method: "POST", path: "/apps/{id}/manifest/sync", pathParams: ["id"], scope: "apps:write", danger: "write", approval: true, body: false, pagination: null },
|
|
585
|
+
"apps.scopes.set": { action: "apps.scopes.set", operationId: "apps_scopes_set", method: "PUT", path: "/apps/{id}/scopes", pathParams: ["id"], scope: "apps:write", danger: "write", approval: true, body: true, pagination: null },
|
|
586
|
+
"apps.secrets.list": { action: "apps.secrets.list", operationId: "apps_secrets_list", method: "GET", path: "/apps/{id}/secrets", pathParams: ["id"], scope: "apps:read", danger: "read", approval: true, body: false, pagination: null },
|
|
587
|
+
"apps.secrets.revoke": { action: "apps.secrets.revoke", operationId: "apps_secrets_revoke", method: "DELETE", path: "/apps/{id}/secrets/{secret_id}", pathParams: ["id", "secret_id"], scope: "apps:write", danger: "critical", approval: true, body: false, pagination: null },
|
|
588
|
+
"apps.secrets.rotate": { action: "apps.secrets.rotate", operationId: "apps_secrets_rotate", method: "POST", path: "/apps/{id}/secrets", pathParams: ["id"], scope: "apps:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
589
|
+
"apps.settings.api_key_prefix": { action: "apps.settings.api_key_prefix", operationId: "apps_settings_api_key_prefix", method: "PUT", path: "/apps/{id}/settings/api-key-prefix", pathParams: ["id"], scope: "apps:write", danger: "write", approval: true, body: true, pagination: null },
|
|
590
|
+
"apps.settings.backchannel_logout": { action: "apps.settings.backchannel_logout", operationId: "apps_settings_backchannel_logout", method: "PUT", path: "/apps/{id}/settings/backchannel-logout", pathParams: ["id"], scope: "apps:write", danger: "write", approval: true, body: true, pagination: null },
|
|
591
|
+
"apps.settings.token_exchange": { action: "apps.settings.token_exchange", operationId: "apps_settings_token_exchange", method: "PUT", path: "/apps/{id}/settings/token-exchange", pathParams: ["id"], scope: "apps:write", danger: "write", approval: true, body: true, pagination: null },
|
|
592
|
+
"apps.settings.token_lifetime": { action: "apps.settings.token_lifetime", operationId: "apps_settings_token_lifetime", method: "PUT", path: "/apps/{id}/settings/token-lifetime", pathParams: ["id"], scope: "apps:write", danger: "write", approval: true, body: true, pagination: null },
|
|
593
|
+
"apps.update": { action: "apps.update", operationId: "apps_update", method: "PATCH", path: "/apps/{id}", pathParams: ["id"], scope: "apps:write", danger: "write", approval: true, body: true, pagination: null },
|
|
594
|
+
"audit_logs.events.create": { action: "audit_logs.events.create", operationId: "audit_logs_events_create", method: "POST", path: "/audit-logs/events", pathParams: [], scope: "audit_logs:write", danger: "write", approval: true, body: true, pagination: null },
|
|
595
|
+
"audit_logs.events.list": { action: "audit_logs.events.list", operationId: "audit_logs_events_list", method: "GET", path: "/audit-logs/events", pathParams: [], scope: "audit_logs:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
596
|
+
"audit_logs.exports.create": { action: "audit_logs.exports.create", operationId: "audit_logs_exports_create", method: "POST", path: "/audit-logs/exports", pathParams: [], scope: "audit_logs:export", danger: "write", approval: true, body: true, pagination: null },
|
|
597
|
+
"audit_logs.exports.get": { action: "audit_logs.exports.get", operationId: "audit_logs_exports_get", method: "GET", path: "/audit-logs/exports/{id}", pathParams: ["id"], scope: "audit_logs:read", danger: "read", approval: true, body: false, pagination: null },
|
|
598
|
+
"audit_logs.schemas.create": { action: "audit_logs.schemas.create", operationId: "audit_logs_schemas_create", method: "POST", path: "/audit-logs/schemas", pathParams: [], scope: "audit_logs:manage", danger: "write", approval: true, body: true, pagination: null },
|
|
599
|
+
"audit_logs.schemas.delete": { action: "audit_logs.schemas.delete", operationId: "audit_logs_schemas_delete", method: "DELETE", path: "/audit-logs/schemas/{action}", pathParams: ["action"], scope: "audit_logs:manage", danger: "destructive", approval: true, body: false, pagination: null },
|
|
600
|
+
"audit_logs.schemas.get": { action: "audit_logs.schemas.get", operationId: "audit_logs_schemas_get", method: "GET", path: "/audit-logs/schemas/{action}", pathParams: ["action"], scope: "audit_logs:read", danger: "read", approval: true, body: false, pagination: null },
|
|
601
|
+
"audit_logs.schemas.list": { action: "audit_logs.schemas.list", operationId: "audit_logs_schemas_list", method: "GET", path: "/audit-logs/schemas", pathParams: [], scope: "audit_logs:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
602
|
+
"audit_logs.schemas.update": { action: "audit_logs.schemas.update", operationId: "audit_logs_schemas_update", method: "PUT", path: "/audit-logs/schemas/{action}", pathParams: ["action"], scope: "audit_logs:manage", danger: "write", approval: true, body: true, pagination: null },
|
|
603
|
+
"audit_logs.settings.get": { action: "audit_logs.settings.get", operationId: "audit_logs_settings_get", method: "GET", path: "/audit-logs/settings", pathParams: [], scope: "audit_logs:read", danger: "read", approval: true, body: false, pagination: null },
|
|
604
|
+
"audit_logs.settings.update": { action: "audit_logs.settings.update", operationId: "audit_logs_settings_update", method: "PATCH", path: "/audit-logs/settings", pathParams: [], scope: "audit_logs:manage", danger: "destructive", approval: true, body: true, pagination: null },
|
|
605
|
+
"audit_logs.verify": { action: "audit_logs.verify", operationId: "audit_logs_verify", method: "GET", path: "/audit-logs/verify", pathParams: [], scope: "audit_logs:read", danger: "read", approval: true, body: false, pagination: null },
|
|
606
|
+
"audit.list": { action: "audit.list", operationId: "audit_list", method: "GET", path: "/audit-log", pathParams: [], scope: "audit:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
607
|
+
"branding.appearance.get": { action: "branding.appearance.get", operationId: "branding_appearance_get", method: "GET", path: "/branding/appearance", pathParams: [], scope: "branding:read", danger: "read", approval: true, body: false, pagination: null },
|
|
608
|
+
"branding.appearance.set": { action: "branding.appearance.set", operationId: "branding_appearance_set", method: "PUT", path: "/branding/appearance", pathParams: [], scope: "branding:write", danger: "write", approval: true, body: true, pagination: null },
|
|
609
|
+
"branding.whitelabel.get": { action: "branding.whitelabel.get", operationId: "branding_whitelabel_get", method: "GET", path: "/branding/whitelabel", pathParams: [], scope: "branding:read", danger: "read", approval: true, body: false, pagination: null },
|
|
610
|
+
"branding.whitelabel.set": { action: "branding.whitelabel.set", operationId: "branding_whitelabel_set", method: "PUT", path: "/branding/whitelabel", pathParams: [], scope: "branding:write", danger: "write", approval: true, body: true, pagination: null },
|
|
611
|
+
"directories.connect": { action: "directories.connect", operationId: "directories_connect", method: "POST", path: "/directories/connect", pathParams: [], scope: "directory_sync:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
612
|
+
"directories.create": { action: "directories.create", operationId: "directories_create", method: "POST", path: "/directories", pathParams: [], scope: "directory_sync:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
613
|
+
"directories.delete": { action: "directories.delete", operationId: "directories_delete", method: "DELETE", path: "/directories/{id}", pathParams: ["id"], scope: "directory_sync:write", danger: "destructive", approval: true, body: true, pagination: null },
|
|
614
|
+
"directories.get": { action: "directories.get", operationId: "directories_get", method: "GET", path: "/directories/{id}", pathParams: ["id"], scope: "directory_sync:read", danger: "read", approval: true, body: false, pagination: null },
|
|
615
|
+
"directories.groups.list": { action: "directories.groups.list", operationId: "directories_groups_list", method: "GET", path: "/directories/{id}/groups", pathParams: ["id"], scope: "directory_sync:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
616
|
+
"directories.groups.map": { action: "directories.groups.map", operationId: "directories_groups_map", method: "POST", path: "/directories/{id}/group-roles", pathParams: ["id"], scope: "directory_sync:write", danger: "write", approval: true, body: true, pagination: null },
|
|
617
|
+
"directories.list": { action: "directories.list", operationId: "directories_list", method: "GET", path: "/directories", pathParams: [], scope: "directory_sync:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
618
|
+
"directories.status.set": { action: "directories.status.set", operationId: "directories_status_set", method: "POST", path: "/directories/{id}/status", pathParams: ["id"], scope: "directory_sync:write", danger: "write", approval: true, body: true, pagination: null },
|
|
619
|
+
"directories.token.rotate": { action: "directories.token.rotate", operationId: "directories_token_rotate", method: "POST", path: "/directories/{id}/rotate", pathParams: ["id"], scope: "directory_sync:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
620
|
+
"directories.update": { action: "directories.update", operationId: "directories_update", method: "PATCH", path: "/directories/{id}", pathParams: ["id"], scope: "directory_sync:write", danger: "write", approval: true, body: true, pagination: null },
|
|
621
|
+
"domains.add": { action: "domains.add", operationId: "domains_add", method: "POST", path: "/domains", pathParams: [], scope: "domains:write", danger: "write", approval: true, body: true, pagination: null },
|
|
622
|
+
"domains.get": { action: "domains.get", operationId: "domains_get", method: "GET", path: "/domains", pathParams: [], scope: "domains:read", danger: "read", approval: true, body: false, pagination: null },
|
|
623
|
+
"domains.remove": { action: "domains.remove", operationId: "domains_remove", method: "DELETE", path: "/domains", pathParams: [], scope: "domains:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
624
|
+
"domains.verify": { action: "domains.verify", operationId: "domains_verify", method: "POST", path: "/domains/verify", pathParams: [], scope: "domains:write", danger: "write", approval: true, body: false, pagination: null },
|
|
625
|
+
"events.list": { action: "events.list", operationId: "events_list", method: "GET", path: "/events", pathParams: [], scope: "events:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
626
|
+
"frontend_keys.create": { action: "frontend_keys.create", operationId: "frontend_keys_create", method: "POST", path: "/frontend-keys", pathParams: [], scope: "frontend_keys:write", danger: "write", approval: true, body: true, pagination: null },
|
|
627
|
+
"frontend_keys.list": { action: "frontend_keys.list", operationId: "frontend_keys_list", method: "GET", path: "/frontend-keys", pathParams: [], scope: "frontend_keys:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
628
|
+
"frontend_keys.revoke": { action: "frontend_keys.revoke", operationId: "frontend_keys_revoke", method: "DELETE", path: "/frontend-keys/{id}", pathParams: ["id"], scope: "frontend_keys:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
629
|
+
"frontend_keys.set_origins": { action: "frontend_keys.set_origins", operationId: "frontend_keys_set_origins", method: "PUT", path: "/frontend-keys/{id}/origins", pathParams: ["id"], scope: "frontend_keys:write", danger: "write", approval: true, body: true, pagination: null },
|
|
630
|
+
"hooks.create": { action: "hooks.create", operationId: "hooks_create", method: "POST", path: "/hooks", pathParams: [], scope: "hooks:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
631
|
+
"hooks.delete": { action: "hooks.delete", operationId: "hooks_delete", method: "DELETE", path: "/hooks/{id}", pathParams: ["id"], scope: "hooks:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
632
|
+
"hooks.get": { action: "hooks.get", operationId: "hooks_get", method: "GET", path: "/hooks/{id}", pathParams: ["id"], scope: "hooks:read", danger: "read", approval: true, body: false, pagination: null },
|
|
633
|
+
"hooks.list": { action: "hooks.list", operationId: "hooks_list", method: "GET", path: "/hooks", pathParams: [], scope: "hooks:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
634
|
+
"hooks.update": { action: "hooks.update", operationId: "hooks_update", method: "PATCH", path: "/hooks/{id}", pathParams: ["id"], scope: "hooks:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
635
|
+
"invitations.list": { action: "invitations.list", operationId: "invitations_list", method: "GET", path: "/organizations/{organization_id}/invitations", pathParams: ["organization_id"], scope: "invitations:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
636
|
+
"invitations.resend": { action: "invitations.resend", operationId: "invitations_resend", method: "POST", path: "/organizations/{organization_id}/invitations/{invitation_id}/resend", pathParams: ["organization_id", "invitation_id"], scope: "invitations:write", danger: "write", approval: true, body: false, pagination: null },
|
|
637
|
+
"invitations.revoke": { action: "invitations.revoke", operationId: "invitations_revoke", method: "DELETE", path: "/organizations/{organization_id}/invitations/{invitation_id}", pathParams: ["organization_id", "invitation_id"], scope: "invitations:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
638
|
+
"invitations.send": { action: "invitations.send", operationId: "invitations_send", method: "POST", path: "/organizations/{organization_id}/invitations", pathParams: ["organization_id"], scope: "invitations:write", danger: "write", approval: true, body: true, pagination: null },
|
|
639
|
+
"keys.create": { action: "keys.create", operationId: "keys_create", method: "POST", path: "/keys", pathParams: [], scope: "keys:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
640
|
+
"keys.list": { action: "keys.list", operationId: "keys_list", method: "GET", path: "/keys", pathParams: [], scope: "keys:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
641
|
+
"keys.revoke": { action: "keys.revoke", operationId: "keys_revoke", method: "DELETE", path: "/keys/{id}", pathParams: ["id"], scope: "keys:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
642
|
+
"keys.rotate": { action: "keys.rotate", operationId: "keys_rotate", method: "POST", path: "/keys/{id}/rotate", pathParams: ["id"], scope: "keys:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
643
|
+
"legacy_login.approve": { action: "legacy_login.approve", operationId: "legacy_login_approve", method: "POST", path: "/legacy-login/approve", pathParams: [], scope: "signin:write", danger: "critical", approval: true, body: false, pagination: null },
|
|
644
|
+
"legacy_login.get": { action: "legacy_login.get", operationId: "legacy_login_get", method: "GET", path: "/legacy-login", pathParams: [], scope: "signin:read", danger: "read", approval: true, body: false, pagination: null },
|
|
645
|
+
"legacy_login.probe": { action: "legacy_login.probe", operationId: "legacy_login_probe", method: "POST", path: "/legacy-login/probe", pathParams: [], scope: "signin:write", danger: "write", approval: true, body: true, pagination: null },
|
|
646
|
+
"legacy_login.revoke": { action: "legacy_login.revoke", operationId: "legacy_login_revoke", method: "POST", path: "/legacy-login/revoke", pathParams: [], scope: "signin:write", danger: "critical", approval: true, body: false, pagination: null },
|
|
647
|
+
"log_streams.create": { action: "log_streams.create", operationId: "log_streams_create", method: "POST", path: "/log-streams", pathParams: [], scope: "log_streams:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
648
|
+
"log_streams.delete": { action: "log_streams.delete", operationId: "log_streams_delete", method: "DELETE", path: "/log-streams/{id}", pathParams: ["id"], scope: "log_streams:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
649
|
+
"log_streams.get": { action: "log_streams.get", operationId: "log_streams_get", method: "GET", path: "/log-streams/{id}", pathParams: ["id"], scope: "log_streams:read", danger: "read", approval: true, body: false, pagination: null },
|
|
650
|
+
"log_streams.list": { action: "log_streams.list", operationId: "log_streams_list", method: "GET", path: "/log-streams", pathParams: [], scope: "log_streams:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
651
|
+
"log_streams.test": { action: "log_streams.test", operationId: "log_streams_test", method: "POST", path: "/log-streams/{id}/test", pathParams: ["id"], scope: "log_streams:write", danger: "write", approval: true, body: false, pagination: null },
|
|
652
|
+
"log_streams.update": { action: "log_streams.update", operationId: "log_streams_update", method: "PATCH", path: "/log-streams/{id}", pathParams: ["id"], scope: "log_streams:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
653
|
+
"members.add": { action: "members.add", operationId: "members_add", method: "POST", path: "/organizations/{organization_id}/members", pathParams: ["organization_id"], scope: "members:write", danger: "write", approval: true, body: true, pagination: null },
|
|
654
|
+
"members.list": { action: "members.list", operationId: "members_list", method: "GET", path: "/organizations/{organization_id}/members", pathParams: ["organization_id"], scope: "members:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
655
|
+
"members.remove": { action: "members.remove", operationId: "members_remove", method: "DELETE", path: "/organizations/{organization_id}/members/{user_id}", pathParams: ["organization_id", "user_id"], scope: "members:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
656
|
+
"members.roles.grant": { action: "members.roles.grant", operationId: "members_roles_grant", method: "PUT", path: "/organizations/{organization_id}/members/{user_id}/roles/{role_id}", pathParams: ["organization_id", "user_id", "role_id"], scope: "roles:write", danger: "write", approval: true, body: false, pagination: null },
|
|
657
|
+
"members.roles.list": { action: "members.roles.list", operationId: "members_roles_list", method: "GET", path: "/organizations/{organization_id}/members/{user_id}/roles", pathParams: ["organization_id", "user_id"], scope: "roles:read", danger: "read", approval: true, body: false, pagination: null },
|
|
658
|
+
"members.roles.revoke": { action: "members.roles.revoke", operationId: "members_roles_revoke", method: "DELETE", path: "/organizations/{organization_id}/members/{user_id}/roles/{role_id}", pathParams: ["organization_id", "user_id", "role_id"], scope: "roles:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
659
|
+
"members.update": { action: "members.update", operationId: "members_update", method: "PATCH", path: "/organizations/{organization_id}/members/{user_id}", pathParams: ["organization_id", "user_id"], scope: "members:write", danger: "write", approval: true, body: true, pagination: null },
|
|
660
|
+
"organizations.create": { action: "organizations.create", operationId: "organizations_create", method: "POST", path: "/organizations", pathParams: [], scope: "organizations:write", danger: "write", approval: true, body: true, pagination: null },
|
|
661
|
+
"organizations.delete": { action: "organizations.delete", operationId: "organizations_delete", method: "DELETE", path: "/organizations/{id}", pathParams: ["id"], scope: "organizations:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
662
|
+
"organizations.domains.add": { action: "organizations.domains.add", operationId: "organizations_domains_add", method: "POST", path: "/organizations/{organization_id}/domains", pathParams: ["organization_id"], scope: "organizations:write", danger: "write", approval: true, body: true, pagination: null },
|
|
663
|
+
"organizations.domains.capture": { action: "organizations.domains.capture", operationId: "organizations_domains_capture", method: "PUT", path: "/organizations/{organization_id}/domains/{domain_id}/capture", pathParams: ["organization_id", "domain_id"], scope: "organizations:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
664
|
+
"organizations.domains.list": { action: "organizations.domains.list", operationId: "organizations_domains_list", method: "GET", path: "/organizations/{organization_id}/domains", pathParams: ["organization_id"], scope: "organizations:read", danger: "read", approval: true, body: false, pagination: null },
|
|
665
|
+
"organizations.domains.remove": { action: "organizations.domains.remove", operationId: "organizations_domains_remove", method: "DELETE", path: "/organizations/{organization_id}/domains/{domain_id}", pathParams: ["organization_id", "domain_id"], scope: "organizations:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
666
|
+
"organizations.domains.verify": { action: "organizations.domains.verify", operationId: "organizations_domains_verify", method: "POST", path: "/organizations/{organization_id}/domains/{domain_id}/verify", pathParams: ["organization_id", "domain_id"], scope: "organizations:write", danger: "write", approval: true, body: false, pagination: null },
|
|
667
|
+
"organizations.get": { action: "organizations.get", operationId: "organizations_get", method: "GET", path: "/organizations/{id}", pathParams: ["id"], scope: "organizations:read", danger: "read", approval: true, body: false, pagination: null },
|
|
668
|
+
"organizations.list": { action: "organizations.list", operationId: "organizations_list", method: "GET", path: "/organizations", pathParams: [], scope: "organizations:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
669
|
+
"organizations.portal_links.create": { action: "organizations.portal_links.create", operationId: "organizations_portal_links_create", method: "POST", path: "/organizations/{organization_id}/portal-links", pathParams: ["organization_id"], scope: "portal_links:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
670
|
+
"organizations.portal_links.list": { action: "organizations.portal_links.list", operationId: "organizations_portal_links_list", method: "GET", path: "/organizations/{organization_id}/portal-links", pathParams: ["organization_id"], scope: "portal_links:read", danger: "read", approval: true, body: false, pagination: null },
|
|
671
|
+
"organizations.portal_links.revoke": { action: "organizations.portal_links.revoke", operationId: "organizations_portal_links_revoke", method: "DELETE", path: "/organizations/{organization_id}/portal-links/{id}", pathParams: ["organization_id", "id"], scope: "portal_links:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
672
|
+
"organizations.reactivate": { action: "organizations.reactivate", operationId: "organizations_reactivate", method: "POST", path: "/organizations/{id}/reactivate", pathParams: ["id"], scope: "organizations:write", danger: "write", approval: true, body: false, pagination: null },
|
|
673
|
+
"organizations.suspend": { action: "organizations.suspend", operationId: "organizations_suspend", method: "POST", path: "/organizations/{id}/suspend", pathParams: ["id"], scope: "organizations:write", danger: "write", approval: true, body: false, pagination: null },
|
|
674
|
+
"organizations.transfer_ownership": { action: "organizations.transfer_ownership", operationId: "organizations_transfer_ownership", method: "POST", path: "/organizations/{id}/transfer-ownership", pathParams: ["id"], scope: "organizations:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
675
|
+
"organizations.update": { action: "organizations.update", operationId: "organizations_update", method: "PATCH", path: "/organizations/{id}", pathParams: ["id"], scope: "organizations:write", danger: "write", approval: true, body: true, pagination: null },
|
|
676
|
+
"permissions.create": { action: "permissions.create", operationId: "permissions_create", method: "POST", path: "/permissions", pathParams: [], scope: "role_definitions:write", danger: "write", approval: true, body: true, pagination: null },
|
|
677
|
+
"permissions.delete": { action: "permissions.delete", operationId: "permissions_delete", method: "DELETE", path: "/permissions/{id}", pathParams: ["id"], scope: "role_definitions:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
678
|
+
"permissions.list": { action: "permissions.list", operationId: "permissions_list", method: "GET", path: "/permissions", pathParams: [], scope: "roles:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
679
|
+
"permissions.update": { action: "permissions.update", operationId: "permissions_update", method: "PATCH", path: "/permissions/{id}", pathParams: ["id"], scope: "role_definitions:write", danger: "write", approval: true, body: true, pagination: null },
|
|
680
|
+
"provisioning.targets.create": { action: "provisioning.targets.create", operationId: "provisioning_targets_create", method: "POST", path: "/provisioning-targets", pathParams: [], scope: "provisioning:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
681
|
+
"provisioning.targets.delete": { action: "provisioning.targets.delete", operationId: "provisioning_targets_delete", method: "DELETE", path: "/provisioning-targets/{id}", pathParams: ["id"], scope: "provisioning:write", danger: "destructive", approval: true, body: true, pagination: null },
|
|
682
|
+
"provisioning.targets.get": { action: "provisioning.targets.get", operationId: "provisioning_targets_get", method: "GET", path: "/provisioning-targets/{id}", pathParams: ["id"], scope: "provisioning:read", danger: "read", approval: true, body: false, pagination: null },
|
|
683
|
+
"provisioning.targets.list": { action: "provisioning.targets.list", operationId: "provisioning_targets_list", method: "GET", path: "/provisioning-targets", pathParams: [], scope: "provisioning:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
684
|
+
"provisioning.targets.status.set": { action: "provisioning.targets.status.set", operationId: "provisioning_targets_status_set", method: "POST", path: "/provisioning-targets/{id}/status", pathParams: ["id"], scope: "provisioning:write", danger: "write", approval: true, body: true, pagination: null },
|
|
685
|
+
"roles.create": { action: "roles.create", operationId: "roles_create", method: "POST", path: "/roles", pathParams: [], scope: "role_definitions:write", danger: "write", approval: true, body: true, pagination: null },
|
|
686
|
+
"roles.delete": { action: "roles.delete", operationId: "roles_delete", method: "DELETE", path: "/roles/{id}", pathParams: ["id"], scope: "role_definitions:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
687
|
+
"roles.get": { action: "roles.get", operationId: "roles_get", method: "GET", path: "/roles/{id}", pathParams: ["id"], scope: "roles:read", danger: "read", approval: true, body: false, pagination: null },
|
|
688
|
+
"roles.list": { action: "roles.list", operationId: "roles_list", method: "GET", path: "/roles", pathParams: [], scope: "roles:read", danger: "read", approval: true, body: false, pagination: null },
|
|
689
|
+
"roles.permissions.grant": { action: "roles.permissions.grant", operationId: "roles_permissions_grant", method: "PUT", path: "/roles/{id}/permissions/{permission_id}", pathParams: ["id", "permission_id"], scope: "role_definitions:write", danger: "write", approval: true, body: false, pagination: null },
|
|
690
|
+
"roles.permissions.revoke": { action: "roles.permissions.revoke", operationId: "roles_permissions_revoke", method: "DELETE", path: "/roles/{id}/permissions/{permission_id}", pathParams: ["id", "permission_id"], scope: "role_definitions:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
691
|
+
"roles.update": { action: "roles.update", operationId: "roles_update", method: "PATCH", path: "/roles/{id}", pathParams: ["id"], scope: "role_definitions:write", danger: "write", approval: true, body: true, pagination: null },
|
|
692
|
+
"saml_apps.create": { action: "saml_apps.create", operationId: "saml_apps_create", method: "POST", path: "/saml-apps", pathParams: [], scope: "saml_apps:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
693
|
+
"saml_apps.delete": { action: "saml_apps.delete", operationId: "saml_apps_delete", method: "DELETE", path: "/saml-apps/{id}", pathParams: ["id"], scope: "saml_apps:write", danger: "critical", approval: true, body: false, pagination: null },
|
|
694
|
+
"saml_apps.get": { action: "saml_apps.get", operationId: "saml_apps_get", method: "GET", path: "/saml-apps/{id}", pathParams: ["id"], scope: "saml_apps:read", danger: "read", approval: true, body: false, pagination: null },
|
|
695
|
+
"saml_apps.list": { action: "saml_apps.list", operationId: "saml_apps_list", method: "GET", path: "/saml-apps", pathParams: [], scope: "saml_apps:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
696
|
+
"saml_apps.update": { action: "saml_apps.update", operationId: "saml_apps_update", method: "PATCH", path: "/saml-apps/{id}", pathParams: ["id"], scope: "saml_apps:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
697
|
+
"signin.policy.get": { action: "signin.policy.get", operationId: "signin_policy_get", method: "GET", path: "/sign-in/policy", pathParams: [], scope: "signin:read", danger: "read", approval: true, body: false, pagination: null },
|
|
698
|
+
"signin.policy.inherit": { action: "signin.policy.inherit", operationId: "signin_policy_inherit", method: "DELETE", path: "/sign-in/policy/organizations/{organization_id}", pathParams: ["organization_id"], scope: "signin:write", danger: "critical", approval: true, body: false, pagination: null },
|
|
699
|
+
"signin.policy.update": { action: "signin.policy.update", operationId: "signin_policy_update", method: "PATCH", path: "/sign-in/policy", pathParams: [], scope: "signin:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
700
|
+
"signin.self_service_signup.set": { action: "signin.self_service_signup.set", operationId: "signin_self_service_signup_set", method: "PUT", path: "/sign-in/self-service-signup", pathParams: [], scope: "signin:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
701
|
+
"signin.social.delete": { action: "signin.social.delete", operationId: "signin_social_delete", method: "DELETE", path: "/sign-in/social-providers/{id}", pathParams: ["id"], scope: "signin:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
702
|
+
"signin.social.list": { action: "signin.social.list", operationId: "signin_social_list", method: "GET", path: "/sign-in/social-providers", pathParams: [], scope: "signin:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
703
|
+
"signin.social.set": { action: "signin.social.set", operationId: "signin_social_set", method: "POST", path: "/sign-in/social-providers", pathParams: [], scope: "signin:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
704
|
+
"sod_policies.create": { action: "sod_policies.create", operationId: "sod_policies_create", method: "POST", path: "/sod-policies", pathParams: [], scope: "governance:write", danger: "write", approval: true, body: true, pagination: null },
|
|
705
|
+
"sod_policies.delete": { action: "sod_policies.delete", operationId: "sod_policies_delete", method: "DELETE", path: "/sod-policies/{id}", pathParams: ["id"], scope: "governance:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
706
|
+
"sod_policies.get": { action: "sod_policies.get", operationId: "sod_policies_get", method: "GET", path: "/sod-policies/{id}", pathParams: ["id"], scope: "governance:read", danger: "read", approval: true, body: false, pagination: null },
|
|
707
|
+
"sod_policies.list": { action: "sod_policies.list", operationId: "sod_policies_list", method: "GET", path: "/sod-policies", pathParams: [], scope: "governance:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
708
|
+
"sod_policies.status.set": { action: "sod_policies.status.set", operationId: "sod_policies_status_set", method: "POST", path: "/sod-policies/{id}/status", pathParams: ["id"], scope: "governance:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
709
|
+
"sso.connections.activate": { action: "sso.connections.activate", operationId: "sso_connections_activate", method: "POST", path: "/sso/connections/{id}/activate", pathParams: ["id"], scope: "sso:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
710
|
+
"sso.connections.certificates.activate": { action: "sso.connections.certificates.activate", operationId: "sso_connections_certificates_activate", method: "POST", path: "/sso/connections/{id}/certificates/activate", pathParams: ["id"], scope: "sso:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
711
|
+
"sso.connections.certificates.list": { action: "sso.connections.certificates.list", operationId: "sso_connections_certificates_list", method: "GET", path: "/sso/connections/{id}/certificates", pathParams: ["id"], scope: "sso:read", danger: "read", approval: true, body: false, pagination: null },
|
|
712
|
+
"sso.connections.certificates.stage": { action: "sso.connections.certificates.stage", operationId: "sso_connections_certificates_stage", method: "POST", path: "/sso/connections/{id}/certificates", pathParams: ["id"], scope: "sso:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
713
|
+
"sso.connections.create": { action: "sso.connections.create", operationId: "sso_connections_create", method: "POST", path: "/sso/connections", pathParams: [], scope: "sso:write", danger: "write", approval: true, body: true, pagination: null },
|
|
714
|
+
"sso.connections.delete": { action: "sso.connections.delete", operationId: "sso_connections_delete", method: "DELETE", path: "/sso/connections/{id}", pathParams: ["id"], scope: "sso:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
715
|
+
"sso.connections.disable": { action: "sso.connections.disable", operationId: "sso_connections_disable", method: "POST", path: "/sso/connections/{id}/disable", pathParams: ["id"], scope: "sso:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
716
|
+
"sso.connections.get": { action: "sso.connections.get", operationId: "sso_connections_get", method: "GET", path: "/sso/connections/{id}", pathParams: ["id"], scope: "sso:read", danger: "read", approval: true, body: false, pagination: null },
|
|
717
|
+
"sso.connections.list": { action: "sso.connections.list", operationId: "sso_connections_list", method: "GET", path: "/sso/connections", pathParams: [], scope: "sso:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
718
|
+
"sso.connections.require_sso": { action: "sso.connections.require_sso", operationId: "sso_connections_require_sso", method: "POST", path: "/sso/connections/{id}/require-sso", pathParams: ["id"], scope: "sso:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
719
|
+
"sso.connections.update": { action: "sso.connections.update", operationId: "sso_connections_update", method: "PATCH", path: "/sso/connections/{id}", pathParams: ["id"], scope: "sso:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
720
|
+
"sso.domains.capture": { action: "sso.domains.capture", operationId: "sso_domains_capture", method: "POST", path: "/sso/domains/{id}/capture", pathParams: ["id"], scope: "sso:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
721
|
+
"sso.domains.create": { action: "sso.domains.create", operationId: "sso_domains_create", method: "POST", path: "/sso/domains", pathParams: [], scope: "sso:write", danger: "write", approval: true, body: true, pagination: null },
|
|
722
|
+
"sso.domains.delete": { action: "sso.domains.delete", operationId: "sso_domains_delete", method: "DELETE", path: "/sso/domains/{id}", pathParams: ["id"], scope: "sso:write", danger: "destructive", approval: true, body: true, pagination: null },
|
|
723
|
+
"sso.domains.list": { action: "sso.domains.list", operationId: "sso_domains_list", method: "GET", path: "/sso/domains", pathParams: [], scope: "sso:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
724
|
+
"sso.domains.verify": { action: "sso.domains.verify", operationId: "sso_domains_verify", method: "POST", path: "/sso/domains/{id}/verify", pathParams: ["id"], scope: "sso:write", danger: "write", approval: true, body: true, pagination: null },
|
|
725
|
+
"sso.saml_metadata.import": { action: "sso.saml_metadata.import", operationId: "sso_saml_metadata_import", method: "POST", path: "/sso/saml-metadata", pathParams: [], scope: "sso:write", danger: "write", approval: true, body: true, pagination: null },
|
|
726
|
+
"support_sessions.end": { action: "support_sessions.end", operationId: "support_sessions_end", method: "DELETE", path: "/support-sessions/{id}", pathParams: ["id"], scope: "support:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
727
|
+
"support_sessions.start": { action: "support_sessions.start", operationId: "support_sessions_start", method: "POST", path: "/support-sessions", pathParams: [], scope: "support:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
728
|
+
"token_vault.grants.create": { action: "token_vault.grants.create", operationId: "token_vault_grants_create", method: "POST", path: "/token-vault/secrets/{id}/grants", pathParams: ["id"], scope: "token_vault:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
729
|
+
"token_vault.grants.delete": { action: "token_vault.grants.delete", operationId: "token_vault_grants_delete", method: "DELETE", path: "/token-vault/secrets/{id}/grants/{client_id}", pathParams: ["id", "client_id"], scope: "token_vault:write", danger: "destructive", approval: true, body: true, pagination: null },
|
|
730
|
+
"token_vault.secrets.create": { action: "token_vault.secrets.create", operationId: "token_vault_secrets_create", method: "POST", path: "/token-vault/secrets", pathParams: [], scope: "token_vault:write", danger: "write", approval: true, body: true, pagination: null },
|
|
731
|
+
"token_vault.secrets.get": { action: "token_vault.secrets.get", operationId: "token_vault_secrets_get", method: "GET", path: "/token-vault/secrets/{id}", pathParams: ["id"], scope: "token_vault:read", danger: "read", approval: true, body: false, pagination: null },
|
|
732
|
+
"token_vault.secrets.list": { action: "token_vault.secrets.list", operationId: "token_vault_secrets_list", method: "GET", path: "/token-vault/secrets", pathParams: [], scope: "token_vault:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
733
|
+
"token_vault.secrets.revoke": { action: "token_vault.secrets.revoke", operationId: "token_vault_secrets_revoke", method: "POST", path: "/token-vault/secrets/{id}/revoke", pathParams: ["id"], scope: "token_vault:write", danger: "destructive", approval: true, body: true, pagination: null },
|
|
734
|
+
"token_vault.secrets.rotate": { action: "token_vault.secrets.rotate", operationId: "token_vault_secrets_rotate", method: "POST", path: "/token-vault/secrets/{id}/rotate", pathParams: ["id"], scope: "token_vault:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
735
|
+
"users.create": { action: "users.create", operationId: "users_create", method: "POST", path: "/users", pathParams: [], scope: "users:write", danger: "write", approval: true, body: true, pagination: null },
|
|
736
|
+
"users.deactivate": { action: "users.deactivate", operationId: "users_deactivate", method: "DELETE", path: "/users/{id}", pathParams: ["id"], scope: "users:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
737
|
+
"users.environment_roles.get": { action: "users.environment_roles.get", operationId: "users_environment_roles_get", method: "GET", path: "/users/{id}/environment-roles/{role_id}", pathParams: ["id", "role_id"], scope: "roles:read", danger: "read", approval: true, body: false, pagination: null },
|
|
738
|
+
"users.environment_roles.grant": { action: "users.environment_roles.grant", operationId: "users_environment_roles_grant", method: "PUT", path: "/users/{id}/environment-roles/{role_id}", pathParams: ["id", "role_id"], scope: "roles:write", danger: "critical", approval: true, body: false, pagination: null },
|
|
739
|
+
"users.environment_roles.list": { action: "users.environment_roles.list", operationId: "users_environment_roles_list", method: "GET", path: "/users/{id}/environment-roles", pathParams: ["id"], scope: "roles:read", danger: "read", approval: true, body: false, pagination: null },
|
|
740
|
+
"users.environment_roles.revoke": { action: "users.environment_roles.revoke", operationId: "users_environment_roles_revoke", method: "DELETE", path: "/users/{id}/environment-roles/{role_id}", pathParams: ["id", "role_id"], scope: "roles:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
741
|
+
"users.erase": { action: "users.erase", operationId: "users_erase", method: "POST", path: "/users/{id}/erase", pathParams: ["id"], scope: "users:erase", danger: "critical", approval: true, body: false, pagination: null },
|
|
742
|
+
"users.get": { action: "users.get", operationId: "users_get", method: "GET", path: "/users/{id}", pathParams: ["id"], scope: "users:read", danger: "read", approval: true, body: false, pagination: null },
|
|
743
|
+
"users.list": { action: "users.list", operationId: "users_list", method: "GET", path: "/users", pathParams: [], scope: "users:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
744
|
+
"users.mfa.reset": { action: "users.mfa.reset", operationId: "users_mfa_reset", method: "DELETE", path: "/users/{id}/mfa", pathParams: ["id"], scope: "users:write", danger: "critical", approval: true, body: false, pagination: null },
|
|
745
|
+
"users.password_reset.send": { action: "users.password_reset.send", operationId: "users_password_reset_send", method: "POST", path: "/users/{id}/password-reset", pathParams: ["id"], scope: "users:write", danger: "write", approval: true, body: false, pagination: null },
|
|
746
|
+
"users.password.set": { action: "users.password.set", operationId: "users_password_set", method: "POST", path: "/users/{id}/password", pathParams: ["id"], scope: "users:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
747
|
+
"users.reactivate": { action: "users.reactivate", operationId: "users_reactivate", method: "POST", path: "/users/{id}/reactivate", pathParams: ["id"], scope: "users:write", danger: "write", approval: true, body: false, pagination: null },
|
|
748
|
+
"users.sessions.list": { action: "users.sessions.list", operationId: "users_sessions_list", method: "GET", path: "/users/{id}/sessions", pathParams: ["id"], scope: "users:read", danger: "read", approval: true, body: false, pagination: null },
|
|
749
|
+
"users.sessions.revoke": { action: "users.sessions.revoke", operationId: "users_sessions_revoke", method: "DELETE", path: "/users/{id}/sessions/{session_id}", pathParams: ["id", "session_id"], scope: "users:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
750
|
+
"users.sessions.revoke_all": { action: "users.sessions.revoke_all", operationId: "users_sessions_revoke_all", method: "DELETE", path: "/users/{id}/sessions", pathParams: ["id"], scope: "users:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
751
|
+
"users.update": { action: "users.update", operationId: "users_update", method: "PATCH", path: "/users/{id}", pathParams: ["id"], scope: "users:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
752
|
+
"users.verification.send": { action: "users.verification.send", operationId: "users_verification_send", method: "POST", path: "/users/{id}/verification", pathParams: ["id"], scope: "users:write", danger: "write", approval: true, body: false, pagination: null },
|
|
753
|
+
"users.verify": { action: "users.verify", operationId: "users_verify", method: "POST", path: "/users/{id}/verify", pathParams: ["id"], scope: "users:write", danger: "critical", approval: true, body: false, pagination: null },
|
|
754
|
+
"webhooks.create": { action: "webhooks.create", operationId: "webhooks_create", method: "POST", path: "/webhooks", pathParams: [], scope: "webhooks:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
755
|
+
"webhooks.delete": { action: "webhooks.delete", operationId: "webhooks_delete", method: "DELETE", path: "/webhooks/{id}", pathParams: ["id"], scope: "webhooks:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
756
|
+
"webhooks.get": { action: "webhooks.get", operationId: "webhooks_get", method: "GET", path: "/webhooks/{id}", pathParams: ["id"], scope: "webhooks:read", danger: "read", approval: true, body: false, pagination: null },
|
|
757
|
+
"webhooks.list": { action: "webhooks.list", operationId: "webhooks_list", method: "GET", path: "/webhooks", pathParams: [], scope: "webhooks:read", danger: "read", approval: true, body: false, pagination: "cursor" },
|
|
758
|
+
"webhooks.pause": { action: "webhooks.pause", operationId: "webhooks_pause", method: "POST", path: "/webhooks/{id}/pause", pathParams: ["id"], scope: "webhooks:write", danger: "write", approval: true, body: false, pagination: null },
|
|
759
|
+
"webhooks.resume": { action: "webhooks.resume", operationId: "webhooks_resume", method: "POST", path: "/webhooks/{id}/resume", pathParams: ["id"], scope: "webhooks:write", danger: "write", approval: true, body: false, pagination: null },
|
|
760
|
+
"webhooks.secret.rotate": { action: "webhooks.secret.rotate", operationId: "webhooks_secret_rotate", method: "POST", path: "/webhooks/{id}/rotate", pathParams: ["id"], scope: "webhooks:write", danger: "critical", approval: true, body: false, pagination: null },
|
|
761
|
+
"webhooks.signature_scheme.change": { action: "webhooks.signature_scheme.change", operationId: "webhooks_signature_scheme_change", method: "POST", path: "/webhooks/{id}/signature-scheme", pathParams: ["id"], scope: "webhooks:write", danger: "destructive", approval: true, body: true, pagination: null },
|
|
762
|
+
"webhooks.update": { action: "webhooks.update", operationId: "webhooks_update", method: "PATCH", path: "/webhooks/{id}", pathParams: ["id"], scope: "webhooks:write", danger: "write", approval: true, body: true, pagination: null }
|
|
763
|
+
};
|
|
764
|
+
var EnvironmentClient = class {
|
|
765
|
+
/** The transport every method runs on — authentication, retries, approvals. */
|
|
766
|
+
transport;
|
|
767
|
+
constructor(options) {
|
|
768
|
+
this.transport = new ManagementTransport("environment", options);
|
|
769
|
+
}
|
|
770
|
+
/** Call a route by method and path (relative to `/api/v1`) — for anything not generated. */
|
|
771
|
+
request(method, path, input, options) {
|
|
772
|
+
return this.transport.request(method, path, input, options);
|
|
773
|
+
}
|
|
774
|
+
accessReviews = {
|
|
775
|
+
/**
|
|
776
|
+
* Close an access review and apply it: every revoke is carried out, and undecided items get the review's pending policy (revoke by default).
|
|
777
|
+
*
|
|
778
|
+
* Requires scope `governance:write`. Danger: destructive.
|
|
779
|
+
*
|
|
780
|
+
* `POST /access-reviews/{id}/close` · action `access_reviews.close`
|
|
781
|
+
* @scope `governance:write`
|
|
782
|
+
* @danger destructive
|
|
783
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
784
|
+
*/
|
|
785
|
+
close: (id, body, options) => this.transport.call(environmentOperations["access_reviews.close"], [id], body, options),
|
|
786
|
+
/**
|
|
787
|
+
* Open an access review of one organization's roles and memberships — or of staff roles — for someone to certify or revoke.
|
|
788
|
+
*
|
|
789
|
+
* Requires scope `governance:write`. Danger: write.
|
|
790
|
+
*
|
|
791
|
+
* `POST /access-reviews` · action `access_reviews.create`
|
|
792
|
+
* @scope `governance:write`
|
|
793
|
+
* @danger write
|
|
794
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
795
|
+
*/
|
|
796
|
+
create: (body, options) => this.transport.call(environmentOperations["access_reviews.create"], [], body, options),
|
|
797
|
+
/**
|
|
798
|
+
* Read one access review: its status, due date, pending-item policy and item count.
|
|
799
|
+
*
|
|
800
|
+
* Requires scope `governance:read`. Danger: read.
|
|
801
|
+
*
|
|
802
|
+
* `GET /access-reviews/{id}` · action `access_reviews.get`
|
|
803
|
+
* @scope `governance:read`
|
|
804
|
+
* @danger read
|
|
805
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
806
|
+
*/
|
|
807
|
+
get: (id, query, options) => this.transport.call(environmentOperations["access_reviews.get"], [id], query, options),
|
|
808
|
+
/**
|
|
809
|
+
* List access reviews (certification campaigns), open and closed, optionally those covering one organization.
|
|
810
|
+
*
|
|
811
|
+
* Requires scope `governance:read`. Danger: read.
|
|
812
|
+
*
|
|
813
|
+
* `GET /access-reviews` · action `access_reviews.list`
|
|
814
|
+
* @scope `governance:read`
|
|
815
|
+
* @danger read
|
|
816
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
817
|
+
*/
|
|
818
|
+
list: (query, options) => this.transport.call(environmentOperations["access_reviews.list"], [], query, options),
|
|
819
|
+
/** Every item of `access_reviews.list`, fetching pages as the iteration reaches them. */
|
|
820
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["access_reviews.list"], [], query, options),
|
|
821
|
+
items: {
|
|
822
|
+
/**
|
|
823
|
+
* Certify or revoke one item of an open access review. Revokes are applied when the review closes.
|
|
824
|
+
*
|
|
825
|
+
* Requires scope `governance:write`. Danger: write.
|
|
826
|
+
*
|
|
827
|
+
* `POST /access-reviews/{id}/items/{item_id}` · action `access_reviews.items.decide`
|
|
828
|
+
* @scope `governance:write`
|
|
829
|
+
* @danger write
|
|
830
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
831
|
+
*/
|
|
832
|
+
decide: (id, itemId, body, options) => this.transport.call(environmentOperations["access_reviews.items.decide"], [id, itemId], body, options),
|
|
833
|
+
/**
|
|
834
|
+
* List the items an access review asks someone to certify or revoke: who holds what, and the decision on each.
|
|
835
|
+
*
|
|
836
|
+
* Requires scope `governance:read`. Danger: read.
|
|
837
|
+
*
|
|
838
|
+
* `GET /access-reviews/{id}/items` · action `access_reviews.items.list`
|
|
839
|
+
* @scope `governance:read`
|
|
840
|
+
* @danger read
|
|
841
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
842
|
+
*/
|
|
843
|
+
list: (id, query, options) => this.transport.call(environmentOperations["access_reviews.items.list"], [id], query, options),
|
|
844
|
+
/** Every item of `access_reviews.items.list`, fetching pages as the iteration reaches them. */
|
|
845
|
+
listAll: (id, query, options) => this.transport.paginate(environmentOperations["access_reviews.items.list"], [id], query, options)
|
|
846
|
+
}
|
|
847
|
+
};
|
|
848
|
+
actionApprovals = {
|
|
849
|
+
/**
|
|
850
|
+
* Where an approval this key asked for stands
|
|
851
|
+
*
|
|
852
|
+
* Any key may poll the approvals it raised, and only those: another key's id is a 404.
|
|
853
|
+
* `status` is `pending`, `approved`, `denied`, `expired` or `consumed`.
|
|
854
|
+
*
|
|
855
|
+
* `GET /action-approvals/{id}`
|
|
856
|
+
*/
|
|
857
|
+
get: (id, options) => this.transport.call(environmentOperations["action_approvals.get"], [id], void 0, options)
|
|
858
|
+
};
|
|
859
|
+
apiKeys = {
|
|
860
|
+
/**
|
|
861
|
+
* List the API keys an organization's members created for your apps
|
|
862
|
+
*
|
|
863
|
+
* Requires scope `api_keys:read`. Revoked and expired keys are included, marked by
|
|
864
|
+
* `status`. Never the key itself. Narrow to one app with `?client_id=`.
|
|
865
|
+
*
|
|
866
|
+
* `GET /organizations/{organization_id}/api-keys` · action `api_keys.list`
|
|
867
|
+
* @scope `api_keys:read`
|
|
868
|
+
* @danger read
|
|
869
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
870
|
+
*/
|
|
871
|
+
list: (organizationId, query, options) => this.transport.call(environmentOperations["api_keys.list"], [organizationId], query, options),
|
|
872
|
+
/** Every item of `api_keys.list`, fetching pages as the iteration reaches them. */
|
|
873
|
+
listAll: (organizationId, query, options) => this.transport.paginate(environmentOperations["api_keys.list"], [organizationId], query, options),
|
|
874
|
+
/**
|
|
875
|
+
* Revoke a member API key
|
|
876
|
+
*
|
|
877
|
+
* Requires scope `api_keys:write`. The key stops verifying at once. Idempotent — an
|
|
878
|
+
* already-revoked key is a 204 too. Recorded as `api_key.revoked`, with this
|
|
879
|
+
* management key as the actor.
|
|
880
|
+
*
|
|
881
|
+
* `DELETE /api-keys/{id}` · action `api_keys.revoke`
|
|
882
|
+
* @scope `api_keys:write`
|
|
883
|
+
* @danger destructive
|
|
884
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
885
|
+
*/
|
|
886
|
+
revoke: (id, options) => this.transport.call(environmentOperations["api_keys.revoke"], [id], void 0, options)
|
|
887
|
+
};
|
|
888
|
+
apis = {
|
|
889
|
+
/**
|
|
890
|
+
* Register an API and its scopes
|
|
891
|
+
*
|
|
892
|
+
* Requires scope `apis:write`. Registering an API is the environment's act; no tenant
|
|
893
|
+
* surface can. `identifier` is an absolute URI (RFC 8707) and becomes the token's
|
|
894
|
+
* `aud`. Scope keys are unique across the environment. `client_id` links the app whose
|
|
895
|
+
* roles and permissions the API enforces, and must have the API's owner.
|
|
896
|
+
* `organization_id` makes the API one organization's; left out, the environment owns
|
|
897
|
+
* it. Refusals are `422 invalid_api` with the reason.
|
|
898
|
+
*
|
|
899
|
+
* `POST /apis` · action `apis.create`
|
|
900
|
+
* @scope `apis:write`
|
|
901
|
+
* @danger write
|
|
902
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
903
|
+
*/
|
|
904
|
+
create: (body, options) => this.transport.call(environmentOperations["apis.create"], [], body, options),
|
|
905
|
+
/**
|
|
906
|
+
* Delete an API and its scopes
|
|
907
|
+
*
|
|
908
|
+
* Requires scope `apis:write`. Tokens already minted for it keep their `aud` until they
|
|
909
|
+
* expire; apps holding its scope keys keep them as plain scopes.
|
|
910
|
+
*
|
|
911
|
+
* `DELETE /apis/{id}` · action `apis.delete`
|
|
912
|
+
* @scope `apis:write`
|
|
913
|
+
* @danger destructive
|
|
914
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
915
|
+
*/
|
|
916
|
+
delete: (id, options) => this.transport.call(environmentOperations["apis.delete"], [id], void 0, options),
|
|
917
|
+
/**
|
|
918
|
+
* Get an API
|
|
919
|
+
*
|
|
920
|
+
* Requires scope `apis:read`.
|
|
921
|
+
*
|
|
922
|
+
* `GET /apis/{id}` · action `apis.get`
|
|
923
|
+
* @scope `apis:read`
|
|
924
|
+
* @danger read
|
|
925
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
926
|
+
*/
|
|
927
|
+
get: (id, options) => this.transport.call(environmentOperations["apis.get"], [id], void 0, options),
|
|
928
|
+
/**
|
|
929
|
+
* List registered APIs
|
|
930
|
+
*
|
|
931
|
+
* Requires scope `apis:read`.
|
|
932
|
+
*
|
|
933
|
+
* `GET /apis` · action `apis.list`
|
|
934
|
+
* @scope `apis:read`
|
|
935
|
+
* @danger read
|
|
936
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
937
|
+
*/
|
|
938
|
+
list: (query, options) => this.transport.call(environmentOperations["apis.list"], [], query, options),
|
|
939
|
+
/** Every item of `apis.list`, fetching pages as the iteration reaches them. */
|
|
940
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["apis.list"], [], query, options),
|
|
941
|
+
/**
|
|
942
|
+
* Change an API
|
|
943
|
+
*
|
|
944
|
+
* Requires scope `apis:write`. Any of: `name`; `client_id` (null unlinks the app);
|
|
945
|
+
* `scopes`, which is the **complete** set afterwards — scopes named are added or
|
|
946
|
+
* updated, scopes left out are removed. All or nothing. The identifier never changes:
|
|
947
|
+
* register a new API instead.
|
|
948
|
+
*
|
|
949
|
+
* `PATCH /apis/{id}` · action `apis.update`
|
|
950
|
+
* @scope `apis:write`
|
|
951
|
+
* @danger write
|
|
952
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
953
|
+
*/
|
|
954
|
+
update: (id, body, options) => this.transport.call(environmentOperations["apis.update"], [id], body, options),
|
|
955
|
+
scopes: {
|
|
956
|
+
/**
|
|
957
|
+
* Add a scope to an API, or change the description or tenant access of one it owns.
|
|
958
|
+
*
|
|
959
|
+
* Requires scope `apis:write`. Danger: write.
|
|
960
|
+
*
|
|
961
|
+
* `PUT /apis/{id}/scopes/{key}` · action `apis.scopes.define`
|
|
962
|
+
* @scope `apis:write`
|
|
963
|
+
* @danger write
|
|
964
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
965
|
+
*/
|
|
966
|
+
define: (id, key, body, options) => this.transport.call(environmentOperations["apis.scopes.define"], [id, key], body, options),
|
|
967
|
+
/**
|
|
968
|
+
* Remove a scope from an API. Apps holding it keep it as a plain scope that no longer reaches the API.
|
|
969
|
+
*
|
|
970
|
+
* Requires scope `apis:write`. Danger: destructive.
|
|
971
|
+
*
|
|
972
|
+
* `DELETE /apis/{id}/scopes/{key}` · action `apis.scopes.remove`
|
|
973
|
+
* @scope `apis:write`
|
|
974
|
+
* @danger destructive
|
|
975
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
976
|
+
*/
|
|
977
|
+
remove: (id, key, options) => this.transport.call(environmentOperations["apis.scopes.remove"], [id, key], void 0, options)
|
|
978
|
+
}
|
|
979
|
+
};
|
|
980
|
+
approvals = {
|
|
981
|
+
/**
|
|
982
|
+
* Deny a pending approval request (CIBA) for the person it was raised for: the agent gets access_denied and no token.
|
|
983
|
+
*
|
|
984
|
+
* Requires scope `approvals:write`. Danger: destructive.
|
|
985
|
+
*
|
|
986
|
+
* `POST /agent-requests/{request_id}/deny` · action `approvals.deny`
|
|
987
|
+
* @scope `approvals:write`
|
|
988
|
+
* @danger destructive
|
|
989
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
990
|
+
*/
|
|
991
|
+
deny: (requestId, options) => this.transport.call(environmentOperations["approvals.deny"], [requestId], void 0, options),
|
|
992
|
+
/**
|
|
993
|
+
* List the pending requests from agents to act as one of this environment's people (CIBA): which app, for whom, and what it asks.
|
|
994
|
+
*
|
|
995
|
+
* Requires scope `approvals:read`. Danger: read.
|
|
996
|
+
*
|
|
997
|
+
* `GET /agent-requests` · action `approvals.list`
|
|
998
|
+
* @scope `approvals:read`
|
|
999
|
+
* @danger read
|
|
1000
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1001
|
+
*/
|
|
1002
|
+
list: (query, options) => this.transport.call(environmentOperations["approvals.list"], [], query, options),
|
|
1003
|
+
/** Every item of `approvals.list`, fetching pages as the iteration reaches them. */
|
|
1004
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["approvals.list"], [], query, options)
|
|
1005
|
+
};
|
|
1006
|
+
apps = {
|
|
1007
|
+
/**
|
|
1008
|
+
* Export an app's configuration as a blueprint
|
|
1009
|
+
*
|
|
1010
|
+
* Requires scope `apps:read`. `{id}` is the app's id or its `client_id`. The document
|
|
1011
|
+
* carries the app's settings and none of its identity or credentials: no client id,
|
|
1012
|
+
* no secret, no key set, no owning organization. `POST /apps` with it as `blueprint`
|
|
1013
|
+
* creates the same app in another environment.
|
|
1014
|
+
*
|
|
1015
|
+
* `GET /apps/{id}/blueprint` · action `apps.blueprint`
|
|
1016
|
+
* @scope `apps:read`
|
|
1017
|
+
* @danger read
|
|
1018
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1019
|
+
*/
|
|
1020
|
+
blueprint: (id, options) => this.transport.call(environmentOperations["apps.blueprint"], [id], void 0, options),
|
|
1021
|
+
/**
|
|
1022
|
+
* Copy an app into another environment of this project, with a new client id and secret there. A person on the environment console only; a key exports the blueprint instead.
|
|
1023
|
+
*
|
|
1024
|
+
* Requires scope `apps:write`. Danger: critical.
|
|
1025
|
+
*
|
|
1026
|
+
* `POST /apps/{id}/copy` · action `apps.copy`
|
|
1027
|
+
* @scope `apps:write`
|
|
1028
|
+
* @danger critical
|
|
1029
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1030
|
+
*/
|
|
1031
|
+
copy: (id, body, options) => this.transport.call(environmentOperations["apps.copy"], [id], body, options),
|
|
1032
|
+
/**
|
|
1033
|
+
* Register an app
|
|
1034
|
+
*
|
|
1035
|
+
* Requires scope `apps:write`. Two ways to describe it:
|
|
1036
|
+
*
|
|
1037
|
+
* - **From a blueprint** — send `GET /apps/{id}/blueprint`'s document from another
|
|
1038
|
+
* environment as `blueprint` (promote staging to production). `name`,
|
|
1039
|
+
* `redirect_uris` and `post_logout_redirect_uris` beside it replace the
|
|
1040
|
+
* blueprint's own, since those usually name the environment it came from. A
|
|
1041
|
+
* `private_key_jwt` blueprint needs `jwks`.
|
|
1042
|
+
* - **Short form** — `name` and `type` (`web`, `spa`, `cli`, `service`, `agent`; default
|
|
1043
|
+
* `web`), which decide the client type, grants and default scopes as the console's
|
|
1044
|
+
* "Create app" does. `advanced` takes `client_type` and `grant_types`.
|
|
1045
|
+
*
|
|
1046
|
+
* The response carries `client_secret` for an app that authenticates with one —
|
|
1047
|
+
* **once**. Only its hash is kept, and an idempotent replay returns `client_secret: null`.
|
|
1048
|
+
*
|
|
1049
|
+
* A platform scope reserved for the console (`vault.manage`, `decisions:read`) is
|
|
1050
|
+
* refused (`scope_not_grantable`), as is a registered API's scope this app's owner may
|
|
1051
|
+
* not hold. Danger: critical — it mints a credential.
|
|
1052
|
+
*
|
|
1053
|
+
* `POST /apps` · action `apps.create`
|
|
1054
|
+
* @scope `apps:write`
|
|
1055
|
+
* @danger critical
|
|
1056
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1057
|
+
*/
|
|
1058
|
+
create: (body, options) => this.transport.call(environmentOperations["apps.create"], [], body, options),
|
|
1059
|
+
/**
|
|
1060
|
+
* Delete an app and every secret it holds. Anything signing in as it stops working immediately.
|
|
1061
|
+
*
|
|
1062
|
+
* Requires scope `apps:write`. Danger: critical.
|
|
1063
|
+
*
|
|
1064
|
+
* `DELETE /apps/{id}` · action `apps.delete`
|
|
1065
|
+
* @scope `apps:write`
|
|
1066
|
+
* @danger critical
|
|
1067
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1068
|
+
*/
|
|
1069
|
+
delete: (id, options) => this.transport.call(environmentOperations["apps.delete"], [id], void 0, options),
|
|
1070
|
+
/**
|
|
1071
|
+
* Get one app (OAuth client) by its id or its client_id: its kind, grants, redirect URIs, scopes and settings. Never a secret.
|
|
1072
|
+
*
|
|
1073
|
+
* Requires scope `apps:read`. Danger: read.
|
|
1074
|
+
*
|
|
1075
|
+
* `GET /apps/{id}` · action `apps.get`
|
|
1076
|
+
* @scope `apps:read`
|
|
1077
|
+
* @danger read
|
|
1078
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1079
|
+
*/
|
|
1080
|
+
get: (id, options) => this.transport.call(environmentOperations["apps.get"], [id], void 0, options),
|
|
1081
|
+
/**
|
|
1082
|
+
* List apps
|
|
1083
|
+
*
|
|
1084
|
+
* Requires scope `apps:read`. Never a secret.
|
|
1085
|
+
*
|
|
1086
|
+
* `GET /apps` · action `apps.list`
|
|
1087
|
+
* @scope `apps:read`
|
|
1088
|
+
* @danger read
|
|
1089
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1090
|
+
*/
|
|
1091
|
+
list: (query, options) => this.transport.call(environmentOperations["apps.list"], [], query, options),
|
|
1092
|
+
/** Every item of `apps.list`, fetching pages as the iteration reaches them. */
|
|
1093
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["apps.list"], [], query, options),
|
|
1094
|
+
/**
|
|
1095
|
+
* Rename an app and replace its redirect URIs or sign-out redirect URIs. Fields left out are unchanged.
|
|
1096
|
+
*
|
|
1097
|
+
* Requires scope `apps:write`. Danger: write.
|
|
1098
|
+
*
|
|
1099
|
+
* `PATCH /apps/{id}` · action `apps.update`
|
|
1100
|
+
* @scope `apps:write`
|
|
1101
|
+
* @danger write
|
|
1102
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1103
|
+
*/
|
|
1104
|
+
update: (id, body, options) => this.transport.call(environmentOperations["apps.update"], [id], body, options),
|
|
1105
|
+
manifest: {
|
|
1106
|
+
/**
|
|
1107
|
+
* Set or clear the URL an app publishes its roles-and-permissions manifest at. Does not fetch it; apps.manifest.sync does.
|
|
1108
|
+
*
|
|
1109
|
+
* Requires scope `apps:write`. Danger: write.
|
|
1110
|
+
*
|
|
1111
|
+
* `PUT /apps/{id}/manifest` · action `apps.manifest.set`
|
|
1112
|
+
* @scope `apps:write`
|
|
1113
|
+
* @danger write
|
|
1114
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1115
|
+
*/
|
|
1116
|
+
set: (id, body, options) => this.transport.call(environmentOperations["apps.manifest.set"], [id], body, options),
|
|
1117
|
+
/**
|
|
1118
|
+
* Fetch an app's published manifest now and sync the roles and permissions it declares.
|
|
1119
|
+
*
|
|
1120
|
+
* Requires scope `apps:write`. Danger: write.
|
|
1121
|
+
*
|
|
1122
|
+
* `POST /apps/{id}/manifest/sync` · action `apps.manifest.sync`
|
|
1123
|
+
* @scope `apps:write`
|
|
1124
|
+
* @danger write
|
|
1125
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1126
|
+
*/
|
|
1127
|
+
sync: (id, options) => this.transport.call(environmentOperations["apps.manifest.sync"], [id], void 0, options)
|
|
1128
|
+
},
|
|
1129
|
+
scopes: {
|
|
1130
|
+
/**
|
|
1131
|
+
* Replace an app's complete scope set — the ceiling of what it may request, applied from its next token.
|
|
1132
|
+
*
|
|
1133
|
+
* Requires scope `apps:write`. Danger: write.
|
|
1134
|
+
*
|
|
1135
|
+
* `PUT /apps/{id}/scopes` · action `apps.scopes.set`
|
|
1136
|
+
* @scope `apps:write`
|
|
1137
|
+
* @danger write
|
|
1138
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1139
|
+
*/
|
|
1140
|
+
set: (id, body, options) => this.transport.call(environmentOperations["apps.scopes.set"], [id], body, options)
|
|
1141
|
+
},
|
|
1142
|
+
secrets: {
|
|
1143
|
+
/**
|
|
1144
|
+
* List an app's live client secrets
|
|
1145
|
+
*
|
|
1146
|
+
* Requires scope `apps:read`. Every live secret, newest first: its id (what
|
|
1147
|
+
* `DELETE /apps/{id}/secrets/{secret_id}` names), the characters it ends in, and its
|
|
1148
|
+
* dates — never a secret. `expires_at` is set on one a rotation replaced, still working
|
|
1149
|
+
* through its overlap. An app holds a handful at most, so there is no page to turn.
|
|
1150
|
+
*
|
|
1151
|
+
* `GET /apps/{id}/secrets` · action `apps.secrets.list`
|
|
1152
|
+
* @scope `apps:read`
|
|
1153
|
+
* @danger read
|
|
1154
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1155
|
+
*/
|
|
1156
|
+
list: (id, options) => this.transport.call(environmentOperations["apps.secrets.list"], [id], void 0, options),
|
|
1157
|
+
/**
|
|
1158
|
+
* Revoke one of an app's client secrets immediately. Never its last live secret — rotate that instead.
|
|
1159
|
+
*
|
|
1160
|
+
* Requires scope `apps:write`. Danger: critical.
|
|
1161
|
+
*
|
|
1162
|
+
* `DELETE /apps/{id}/secrets/{secret_id}` · action `apps.secrets.revoke`
|
|
1163
|
+
* @scope `apps:write`
|
|
1164
|
+
* @danger critical
|
|
1165
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1166
|
+
*/
|
|
1167
|
+
revoke: (id, secretId, options) => this.transport.call(environmentOperations["apps.secrets.revoke"], [id, secretId], void 0, options),
|
|
1168
|
+
/**
|
|
1169
|
+
* Mint a new client secret for an app and retire the current ones after grace_seconds (0 = at once). The new secret is returned once.
|
|
1170
|
+
*
|
|
1171
|
+
* Requires scope `apps:write`. Danger: critical.
|
|
1172
|
+
*
|
|
1173
|
+
* `POST /apps/{id}/secrets` · action `apps.secrets.rotate`
|
|
1174
|
+
* @scope `apps:write`
|
|
1175
|
+
* @danger critical
|
|
1176
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1177
|
+
*/
|
|
1178
|
+
rotate: (id, body, options) => this.transport.call(environmentOperations["apps.secrets.rotate"], [id], body, options)
|
|
1179
|
+
},
|
|
1180
|
+
settings: {
|
|
1181
|
+
/**
|
|
1182
|
+
* Set the prefix of an app's customer API keys (acme_live), which lets its users create keys for it, or null to stop new keys.
|
|
1183
|
+
*
|
|
1184
|
+
* Requires scope `apps:write`. Danger: write.
|
|
1185
|
+
*
|
|
1186
|
+
* `PUT /apps/{id}/settings/api-key-prefix` · action `apps.settings.api_key_prefix`
|
|
1187
|
+
* @scope `apps:write`
|
|
1188
|
+
* @danger write
|
|
1189
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1190
|
+
*/
|
|
1191
|
+
apiKeyPrefix: (id, body, options) => this.transport.call(environmentOperations["apps.settings.api_key_prefix"], [id], body, options),
|
|
1192
|
+
/**
|
|
1193
|
+
* Set or clear the URI an app is sent a logout token at when somebody signs out (OIDC Back-Channel Logout).
|
|
1194
|
+
*
|
|
1195
|
+
* Requires scope `apps:write`. Danger: write.
|
|
1196
|
+
*
|
|
1197
|
+
* `PUT /apps/{id}/settings/backchannel-logout` · action `apps.settings.backchannel_logout`
|
|
1198
|
+
* @scope `apps:write`
|
|
1199
|
+
* @danger write
|
|
1200
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1201
|
+
*/
|
|
1202
|
+
backchannelLogout: (id, body, options) => this.transport.call(environmentOperations["apps.settings.backchannel_logout"], [id], body, options),
|
|
1203
|
+
/**
|
|
1204
|
+
* Turn token exchange (RFC 8693) on or off for a confidential app.
|
|
1205
|
+
*
|
|
1206
|
+
* Requires scope `apps:write`. Danger: write.
|
|
1207
|
+
*
|
|
1208
|
+
* `PUT /apps/{id}/settings/token-exchange` · action `apps.settings.token_exchange`
|
|
1209
|
+
* @scope `apps:write`
|
|
1210
|
+
* @danger write
|
|
1211
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1212
|
+
*/
|
|
1213
|
+
tokenExchange: (id, body, options) => this.transport.call(environmentOperations["apps.settings.token_exchange"], [id], body, options),
|
|
1214
|
+
/**
|
|
1215
|
+
* Set how long an app's access tokens live, in seconds, or null for the install's default.
|
|
1216
|
+
*
|
|
1217
|
+
* Requires scope `apps:write`. Danger: write.
|
|
1218
|
+
*
|
|
1219
|
+
* `PUT /apps/{id}/settings/token-lifetime` · action `apps.settings.token_lifetime`
|
|
1220
|
+
* @scope `apps:write`
|
|
1221
|
+
* @danger write
|
|
1222
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1223
|
+
*/
|
|
1224
|
+
tokenLifetime: (id, body, options) => this.transport.call(environmentOperations["apps.settings.token_lifetime"], [id], body, options)
|
|
1225
|
+
}
|
|
1226
|
+
};
|
|
1227
|
+
auditLogs = {
|
|
1228
|
+
/**
|
|
1229
|
+
* Re-hash one organization's audit-event chain (from the oldest event retention kept, or from_sequence) and report whether every event is unchanged and in place.
|
|
1230
|
+
*
|
|
1231
|
+
* Requires scope `audit_logs:read`. Danger: read.
|
|
1232
|
+
*
|
|
1233
|
+
* `GET /audit-logs/verify` · action `audit_logs.verify`
|
|
1234
|
+
* @scope `audit_logs:read`
|
|
1235
|
+
* @danger read
|
|
1236
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1237
|
+
*/
|
|
1238
|
+
verify: (query, options) => this.transport.call(environmentOperations["audit_logs.verify"], [], query, options),
|
|
1239
|
+
events: {
|
|
1240
|
+
/**
|
|
1241
|
+
* Record 1–100 audit events your app's users caused, each for one of your organizations (customers); checked against the action's schema when it has one and appended to that organization's tamper-evident chain. Send an Idempotency-Key.
|
|
1242
|
+
*
|
|
1243
|
+
* Requires scope `audit_logs:write`. Danger: write.
|
|
1244
|
+
*
|
|
1245
|
+
* `POST /audit-logs/events` · action `audit_logs.events.create`
|
|
1246
|
+
* @scope `audit_logs:write`
|
|
1247
|
+
* @danger write
|
|
1248
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1249
|
+
*/
|
|
1250
|
+
create: (body, options) => this.transport.call(environmentOperations["audit_logs.events.create"], [], body, options),
|
|
1251
|
+
/**
|
|
1252
|
+
* Read audit events newest first, for one organization or the whole environment, filtered by action, actor, target and time range; pass `next_cursor` as `after` to page.
|
|
1253
|
+
*
|
|
1254
|
+
* Requires scope `audit_logs:read`. Danger: read.
|
|
1255
|
+
*
|
|
1256
|
+
* `GET /audit-logs/events` · action `audit_logs.events.list`
|
|
1257
|
+
* @scope `audit_logs:read`
|
|
1258
|
+
* @danger read
|
|
1259
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1260
|
+
*/
|
|
1261
|
+
list: (query, options) => this.transport.call(environmentOperations["audit_logs.events.list"], [], query, options),
|
|
1262
|
+
/** Every item of `audit_logs.events.list`, fetching pages as the iteration reaches them. */
|
|
1263
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["audit_logs.events.list"], [], query, options)
|
|
1264
|
+
},
|
|
1265
|
+
exports: {
|
|
1266
|
+
/**
|
|
1267
|
+
* Start a CSV export of audit events (same filters as the list). It is written on the queue: poll audit_logs.exports.get until state is ready, then download from its short-lived url.
|
|
1268
|
+
*
|
|
1269
|
+
* Requires scope `audit_logs:export`. Danger: write.
|
|
1270
|
+
*
|
|
1271
|
+
* `POST /audit-logs/exports` · action `audit_logs.exports.create`
|
|
1272
|
+
* @scope `audit_logs:export`
|
|
1273
|
+
* @danger write
|
|
1274
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1275
|
+
*/
|
|
1276
|
+
create: (body, options) => this.transport.call(environmentOperations["audit_logs.exports.create"], [], body, options),
|
|
1277
|
+
/**
|
|
1278
|
+
* Read an audit-log export's state; once ready it carries a signed download url valid for a few minutes (read it again for a fresh one).
|
|
1279
|
+
*
|
|
1280
|
+
* Requires scope `audit_logs:read`. Danger: read.
|
|
1281
|
+
*
|
|
1282
|
+
* `GET /audit-logs/exports/{id}` · action `audit_logs.exports.get`
|
|
1283
|
+
* @scope `audit_logs:read`
|
|
1284
|
+
* @danger read
|
|
1285
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1286
|
+
*/
|
|
1287
|
+
get: (id, options) => this.transport.call(environmentOperations["audit_logs.exports.get"], [id], void 0, options)
|
|
1288
|
+
},
|
|
1289
|
+
schemas: {
|
|
1290
|
+
/**
|
|
1291
|
+
* Define the schema one audit-log action's events must match — allowed target types and metadata schemas (a subset of JSON Schema). Events of that action are then validated on arrival.
|
|
1292
|
+
*
|
|
1293
|
+
* Requires scope `audit_logs:manage`. Danger: write.
|
|
1294
|
+
*
|
|
1295
|
+
* `POST /audit-logs/schemas` · action `audit_logs.schemas.create`
|
|
1296
|
+
* @scope `audit_logs:manage`
|
|
1297
|
+
* @danger write
|
|
1298
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1299
|
+
*/
|
|
1300
|
+
create: (body, options) => this.transport.call(environmentOperations["audit_logs.schemas.create"], [], body, options),
|
|
1301
|
+
/**
|
|
1302
|
+
* Delete an audit-log action's schema. Its events are then accepted unchecked — or refused, if the environment is in strict mode.
|
|
1303
|
+
*
|
|
1304
|
+
* Requires scope `audit_logs:manage`. Danger: destructive.
|
|
1305
|
+
*
|
|
1306
|
+
* `DELETE /audit-logs/schemas/{action}` · action `audit_logs.schemas.delete`
|
|
1307
|
+
* @scope `audit_logs:manage`
|
|
1308
|
+
* @danger destructive
|
|
1309
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1310
|
+
*/
|
|
1311
|
+
delete: (action, options) => this.transport.call(environmentOperations["audit_logs.schemas.delete"], [action], void 0, options),
|
|
1312
|
+
/**
|
|
1313
|
+
* Read the schema one audit-log action's events are validated against.
|
|
1314
|
+
*
|
|
1315
|
+
* Requires scope `audit_logs:read`. Danger: read.
|
|
1316
|
+
*
|
|
1317
|
+
* `GET /audit-logs/schemas/{action}` · action `audit_logs.schemas.get`
|
|
1318
|
+
* @scope `audit_logs:read`
|
|
1319
|
+
* @danger read
|
|
1320
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1321
|
+
*/
|
|
1322
|
+
get: (action, options) => this.transport.call(environmentOperations["audit_logs.schemas.get"], [action], void 0, options),
|
|
1323
|
+
/**
|
|
1324
|
+
* List the audit-log schemas this environment validates events against, one per action.
|
|
1325
|
+
*
|
|
1326
|
+
* Requires scope `audit_logs:read`. Danger: read.
|
|
1327
|
+
*
|
|
1328
|
+
* `GET /audit-logs/schemas` · action `audit_logs.schemas.list`
|
|
1329
|
+
* @scope `audit_logs:read`
|
|
1330
|
+
* @danger read
|
|
1331
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1332
|
+
*/
|
|
1333
|
+
list: (query, options) => this.transport.call(environmentOperations["audit_logs.schemas.list"], [], query, options),
|
|
1334
|
+
/** Every item of `audit_logs.schemas.list`, fetching pages as the iteration reaches them. */
|
|
1335
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["audit_logs.schemas.list"], [], query, options),
|
|
1336
|
+
/**
|
|
1337
|
+
* Replace an audit-log action's schema with a new version (omitted parts are removed). Recorded events keep the version they were checked against.
|
|
1338
|
+
*
|
|
1339
|
+
* Requires scope `audit_logs:manage`. Danger: write.
|
|
1340
|
+
*
|
|
1341
|
+
* `PUT /audit-logs/schemas/{action}` · action `audit_logs.schemas.update`
|
|
1342
|
+
* @scope `audit_logs:manage`
|
|
1343
|
+
* @danger write
|
|
1344
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1345
|
+
*/
|
|
1346
|
+
update: (action, body, options) => this.transport.call(environmentOperations["audit_logs.schemas.update"], [action], body, options)
|
|
1347
|
+
},
|
|
1348
|
+
settings: {
|
|
1349
|
+
/**
|
|
1350
|
+
* Read this environment's audit-log settings: retention in days and whether strict schemas are on.
|
|
1351
|
+
*
|
|
1352
|
+
* Requires scope `audit_logs:read`. Danger: read.
|
|
1353
|
+
*
|
|
1354
|
+
* `GET /audit-logs/settings` · action `audit_logs.settings.get`
|
|
1355
|
+
* @scope `audit_logs:read`
|
|
1356
|
+
* @danger read
|
|
1357
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1358
|
+
*/
|
|
1359
|
+
get: (options) => this.transport.call(environmentOperations["audit_logs.settings.get"], [], void 0, options),
|
|
1360
|
+
/**
|
|
1361
|
+
* Change this environment's audit-log retention (days, 1–3650) and strict mode. Shortening retention deletes older events at the next daily prune — irreversibly.
|
|
1362
|
+
*
|
|
1363
|
+
* Requires scope `audit_logs:manage`. Danger: destructive.
|
|
1364
|
+
*
|
|
1365
|
+
* `PATCH /audit-logs/settings` · action `audit_logs.settings.update`
|
|
1366
|
+
* @scope `audit_logs:manage`
|
|
1367
|
+
* @danger destructive
|
|
1368
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1369
|
+
*/
|
|
1370
|
+
update: (body, options) => this.transport.call(environmentOperations["audit_logs.settings.update"], [], body, options)
|
|
1371
|
+
}
|
|
1372
|
+
};
|
|
1373
|
+
audit = {
|
|
1374
|
+
/**
|
|
1375
|
+
* Read this environment's audit trail oldest first, optionally narrowed by action, actor type or organization; pass the last id as `after` to page.
|
|
1376
|
+
*
|
|
1377
|
+
* Requires scope `audit:read`. Danger: read.
|
|
1378
|
+
*
|
|
1379
|
+
* `GET /audit-log` · action `audit.list`
|
|
1380
|
+
* @scope `audit:read`
|
|
1381
|
+
* @danger read
|
|
1382
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1383
|
+
*/
|
|
1384
|
+
list: (query, options) => this.transport.call(environmentOperations["audit.list"], [], query, options),
|
|
1385
|
+
/** Every item of `audit.list`, fetching pages as the iteration reaches them. */
|
|
1386
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["audit.list"], [], query, options)
|
|
1387
|
+
};
|
|
1388
|
+
branding = {
|
|
1389
|
+
appearance: {
|
|
1390
|
+
/**
|
|
1391
|
+
* Read the hosted sign-in theme: the environment default, or one organization's own.
|
|
1392
|
+
*
|
|
1393
|
+
* Requires scope `branding:read`. Danger: read.
|
|
1394
|
+
*
|
|
1395
|
+
* `GET /branding/appearance` · action `branding.appearance.get`
|
|
1396
|
+
* @scope `branding:read`
|
|
1397
|
+
* @danger read
|
|
1398
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1399
|
+
*/
|
|
1400
|
+
get: (query, options) => this.transport.call(environmentOperations["branding.appearance.get"], [], query, options),
|
|
1401
|
+
/**
|
|
1402
|
+
* Set the hosted sign-in theme (preset, colours, corners, type, logo) for the environment default or one organization.
|
|
1403
|
+
*
|
|
1404
|
+
* Requires scope `branding:write`. Danger: write.
|
|
1405
|
+
*
|
|
1406
|
+
* `PUT /branding/appearance` · action `branding.appearance.set`
|
|
1407
|
+
* @scope `branding:write`
|
|
1408
|
+
* @danger write
|
|
1409
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1410
|
+
*/
|
|
1411
|
+
set: (body, options) => this.transport.call(environmentOperations["branding.appearance.set"], [], body, options)
|
|
1412
|
+
},
|
|
1413
|
+
whitelabel: {
|
|
1414
|
+
/**
|
|
1415
|
+
* Read the white-label branding (palette, app name, email sender, logo) of the environment default or one organization.
|
|
1416
|
+
*
|
|
1417
|
+
* Requires scope `branding:read`. Danger: read.
|
|
1418
|
+
*
|
|
1419
|
+
* `GET /branding/whitelabel` · action `branding.whitelabel.get`
|
|
1420
|
+
* @scope `branding:read`
|
|
1421
|
+
* @danger read
|
|
1422
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1423
|
+
*/
|
|
1424
|
+
get: (query, options) => this.transport.call(environmentOperations["branding.whitelabel.get"], [], query, options),
|
|
1425
|
+
/**
|
|
1426
|
+
* Save the white-label branding (palette, app name, email sender, welcome email) of the environment default or one organization.
|
|
1427
|
+
*
|
|
1428
|
+
* Requires scope `branding:write`. Danger: write.
|
|
1429
|
+
*
|
|
1430
|
+
* `PUT /branding/whitelabel` · action `branding.whitelabel.set`
|
|
1431
|
+
* @scope `branding:write`
|
|
1432
|
+
* @danger write
|
|
1433
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1434
|
+
*/
|
|
1435
|
+
set: (body, options) => this.transport.call(environmentOperations["branding.whitelabel.set"], [], body, options)
|
|
1436
|
+
}
|
|
1437
|
+
};
|
|
1438
|
+
directories = {
|
|
1439
|
+
/**
|
|
1440
|
+
* Connect a Google Workspace or Microsoft Entra directory to sync an organization's people from, verifying the credentials first. Runs the first sync.
|
|
1441
|
+
*
|
|
1442
|
+
* Requires scope `directory_sync:write`. Danger: critical.
|
|
1443
|
+
*
|
|
1444
|
+
* `POST /directories/connect` · action `directories.connect`
|
|
1445
|
+
* @scope `directory_sync:write`
|
|
1446
|
+
* @danger critical
|
|
1447
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1448
|
+
*/
|
|
1449
|
+
connect: (body, options) => this.transport.call(environmentOperations["directories.connect"], [], body, options),
|
|
1450
|
+
/**
|
|
1451
|
+
* Register a SCIM directory for an organization. Answers the SCIM base URL and a bearer token, shown once.
|
|
1452
|
+
*
|
|
1453
|
+
* Requires scope `directory_sync:write`. Danger: critical.
|
|
1454
|
+
*
|
|
1455
|
+
* `POST /directories` · action `directories.create`
|
|
1456
|
+
* @scope `directory_sync:write`
|
|
1457
|
+
* @danger critical
|
|
1458
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1459
|
+
*/
|
|
1460
|
+
create: (body, options) => this.transport.call(environmentOperations["directories.create"], [], body, options),
|
|
1461
|
+
/**
|
|
1462
|
+
* Delete an inbound directory. Its token stops working; the people it provisioned keep their accounts.
|
|
1463
|
+
*
|
|
1464
|
+
* Requires scope `directory_sync:write`. Danger: destructive.
|
|
1465
|
+
*
|
|
1466
|
+
* `DELETE /directories/{id}` · action `directories.delete`
|
|
1467
|
+
* @scope `directory_sync:write`
|
|
1468
|
+
* @danger destructive
|
|
1469
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1470
|
+
*/
|
|
1471
|
+
delete: (id, body, options) => this.transport.call(environmentOperations["directories.delete"], [id], body, options),
|
|
1472
|
+
/**
|
|
1473
|
+
* Read one inbound directory: its provider, status, SCIM base URL and last sync error. Never its token or credentials.
|
|
1474
|
+
*
|
|
1475
|
+
* Requires scope `directory_sync:read`. Danger: read.
|
|
1476
|
+
*
|
|
1477
|
+
* `GET /directories/{id}` · action `directories.get`
|
|
1478
|
+
* @scope `directory_sync:read`
|
|
1479
|
+
* @danger read
|
|
1480
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1481
|
+
*/
|
|
1482
|
+
get: (id, query, options) => this.transport.call(environmentOperations["directories.get"], [id], query, options),
|
|
1483
|
+
/**
|
|
1484
|
+
* List the directories (SCIM, Google Workspace, Microsoft Entra) syncing people in, optionally for one organization, with their last sync error.
|
|
1485
|
+
*
|
|
1486
|
+
* Requires scope `directory_sync:read`. Danger: read.
|
|
1487
|
+
*
|
|
1488
|
+
* `GET /directories` · action `directories.list`
|
|
1489
|
+
* @scope `directory_sync:read`
|
|
1490
|
+
* @danger read
|
|
1491
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1492
|
+
*/
|
|
1493
|
+
list: (query, options) => this.transport.call(environmentOperations["directories.list"], [], query, options),
|
|
1494
|
+
/** Every item of `directories.list`, fetching pages as the iteration reaches them. */
|
|
1495
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["directories.list"], [], query, options),
|
|
1496
|
+
/**
|
|
1497
|
+
* Rename an inbound directory.
|
|
1498
|
+
*
|
|
1499
|
+
* Requires scope `directory_sync:write`. Danger: write.
|
|
1500
|
+
*
|
|
1501
|
+
* `PATCH /directories/{id}` · action `directories.update`
|
|
1502
|
+
* @scope `directory_sync:write`
|
|
1503
|
+
* @danger write
|
|
1504
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1505
|
+
*/
|
|
1506
|
+
update: (id, body, options) => this.transport.call(environmentOperations["directories.update"], [id], body, options),
|
|
1507
|
+
groups: {
|
|
1508
|
+
/**
|
|
1509
|
+
* List the groups a directory has synced, with the role ids each group is mapped onto.
|
|
1510
|
+
*
|
|
1511
|
+
* Requires scope `directory_sync:read`. Danger: read.
|
|
1512
|
+
*
|
|
1513
|
+
* `GET /directories/{id}/groups` · action `directories.groups.list`
|
|
1514
|
+
* @scope `directory_sync:read`
|
|
1515
|
+
* @danger read
|
|
1516
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1517
|
+
*/
|
|
1518
|
+
list: (id, query, options) => this.transport.call(environmentOperations["directories.groups.list"], [id], query, options),
|
|
1519
|
+
/** Every item of `directories.groups.list`, fetching pages as the iteration reaches them. */
|
|
1520
|
+
listAll: (id, query, options) => this.transport.paginate(environmentOperations["directories.groups.list"], [id], query, options),
|
|
1521
|
+
/**
|
|
1522
|
+
* Map a directory group onto a role (everyone in the group holds it as membership syncs), or unmap it.
|
|
1523
|
+
*
|
|
1524
|
+
* Requires scope `directory_sync:write`. Danger: write.
|
|
1525
|
+
*
|
|
1526
|
+
* `POST /directories/{id}/group-roles` · action `directories.groups.map`
|
|
1527
|
+
* @scope `directory_sync:write`
|
|
1528
|
+
* @danger write
|
|
1529
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1530
|
+
*/
|
|
1531
|
+
map: (id, body, options) => this.transport.call(environmentOperations["directories.groups.map"], [id], body, options)
|
|
1532
|
+
},
|
|
1533
|
+
status: {
|
|
1534
|
+
/**
|
|
1535
|
+
* Pause or resume an inbound directory's provisioning.
|
|
1536
|
+
*
|
|
1537
|
+
* Requires scope `directory_sync:write`. Danger: write.
|
|
1538
|
+
*
|
|
1539
|
+
* `POST /directories/{id}/status` · action `directories.status.set`
|
|
1540
|
+
* @scope `directory_sync:write`
|
|
1541
|
+
* @danger write
|
|
1542
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1543
|
+
*/
|
|
1544
|
+
set: (id, body, options) => this.transport.call(environmentOperations["directories.status.set"], [id], body, options)
|
|
1545
|
+
},
|
|
1546
|
+
token: {
|
|
1547
|
+
/**
|
|
1548
|
+
* Issue a new bearer token for a SCIM directory, returned once. The old token stops working immediately.
|
|
1549
|
+
*
|
|
1550
|
+
* Requires scope `directory_sync:write`. Danger: critical.
|
|
1551
|
+
*
|
|
1552
|
+
* `POST /directories/{id}/rotate` · action `directories.token.rotate`
|
|
1553
|
+
* @scope `directory_sync:write`
|
|
1554
|
+
* @danger critical
|
|
1555
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1556
|
+
*/
|
|
1557
|
+
rotate: (id, body, options) => this.transport.call(environmentOperations["directories.token.rotate"], [id], body, options)
|
|
1558
|
+
}
|
|
1559
|
+
};
|
|
1560
|
+
domains = {
|
|
1561
|
+
/**
|
|
1562
|
+
* Start serving this environment on a custom domain: returns the DNS TXT record that proves you control it.
|
|
1563
|
+
*
|
|
1564
|
+
* Requires scope `domains:write`. Danger: write.
|
|
1565
|
+
*
|
|
1566
|
+
* `POST /domains` · action `domains.add`
|
|
1567
|
+
* @scope `domains:write`
|
|
1568
|
+
* @danger write
|
|
1569
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1570
|
+
*/
|
|
1571
|
+
add: (body, options) => this.transport.call(environmentOperations["domains.add"], [], body, options),
|
|
1572
|
+
/**
|
|
1573
|
+
* Read this environment's custom domain, and the DNS TXT record that proves a pending one.
|
|
1574
|
+
*
|
|
1575
|
+
* Requires scope `domains:read`. Danger: read.
|
|
1576
|
+
*
|
|
1577
|
+
* `GET /domains` · action `domains.get`
|
|
1578
|
+
* @scope `domains:read`
|
|
1579
|
+
* @danger read
|
|
1580
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1581
|
+
*/
|
|
1582
|
+
get: (options) => this.transport.call(environmentOperations["domains.get"], [], void 0, options),
|
|
1583
|
+
/**
|
|
1584
|
+
* Stop serving this environment on its custom domain. Anything using that domain stops reaching the environment.
|
|
1585
|
+
*
|
|
1586
|
+
* Requires scope `domains:write`. Danger: destructive.
|
|
1587
|
+
*
|
|
1588
|
+
* `DELETE /domains` · action `domains.remove`
|
|
1589
|
+
* @scope `domains:write`
|
|
1590
|
+
* @danger destructive
|
|
1591
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1592
|
+
*/
|
|
1593
|
+
remove: (options) => this.transport.call(environmentOperations["domains.remove"], [], void 0, options),
|
|
1594
|
+
/**
|
|
1595
|
+
* Look for the pending domain's DNS TXT record and, once it is visible, serve this environment on that domain.
|
|
1596
|
+
*
|
|
1597
|
+
* Requires scope `domains:write`. Danger: write.
|
|
1598
|
+
*
|
|
1599
|
+
* `POST /domains/verify` · action `domains.verify`
|
|
1600
|
+
* @scope `domains:write`
|
|
1601
|
+
* @danger write
|
|
1602
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1603
|
+
*/
|
|
1604
|
+
verify: (options) => this.transport.call(environmentOperations["domains.verify"], [], void 0, options)
|
|
1605
|
+
};
|
|
1606
|
+
events = {
|
|
1607
|
+
/**
|
|
1608
|
+
* Read this environment's domain events (the facts webhooks deliver) oldest first; pass the last id as `after` to poll for new ones.
|
|
1609
|
+
*
|
|
1610
|
+
* Requires scope `events:read`. Danger: read.
|
|
1611
|
+
*
|
|
1612
|
+
* `GET /events` · action `events.list`
|
|
1613
|
+
* @scope `events:read`
|
|
1614
|
+
* @danger read
|
|
1615
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1616
|
+
*/
|
|
1617
|
+
list: (query, options) => this.transport.call(environmentOperations["events.list"], [], query, options),
|
|
1618
|
+
/** Every item of `events.list`, fetching pages as the iteration reaches them. */
|
|
1619
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["events.list"], [], query, options)
|
|
1620
|
+
};
|
|
1621
|
+
frontendKeys = {
|
|
1622
|
+
/**
|
|
1623
|
+
* Create a publishable frontend key for a browser app, usable only from the origins listed. The key is public by design.
|
|
1624
|
+
*
|
|
1625
|
+
* Requires scope `frontend_keys:write`. Danger: write.
|
|
1626
|
+
*
|
|
1627
|
+
* `POST /frontend-keys` · action `frontend_keys.create`
|
|
1628
|
+
* @scope `frontend_keys:write`
|
|
1629
|
+
* @danger write
|
|
1630
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1631
|
+
*/
|
|
1632
|
+
create: (body, options) => this.transport.call(environmentOperations["frontend_keys.create"], [], body, options),
|
|
1633
|
+
/**
|
|
1634
|
+
* List the publishable frontend keys browser apps present to the Frontend API, in full, with their allowed origins.
|
|
1635
|
+
*
|
|
1636
|
+
* Requires scope `frontend_keys:read`. Danger: read.
|
|
1637
|
+
*
|
|
1638
|
+
* `GET /frontend-keys` · action `frontend_keys.list`
|
|
1639
|
+
* @scope `frontend_keys:read`
|
|
1640
|
+
* @danger read
|
|
1641
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1642
|
+
*/
|
|
1643
|
+
list: (query, options) => this.transport.call(environmentOperations["frontend_keys.list"], [], query, options),
|
|
1644
|
+
/** Every item of `frontend_keys.list`, fetching pages as the iteration reaches them. */
|
|
1645
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["frontend_keys.list"], [], query, options),
|
|
1646
|
+
/**
|
|
1647
|
+
* Revoke a publishable frontend key. Pages still holding it stop working immediately.
|
|
1648
|
+
*
|
|
1649
|
+
* Requires scope `frontend_keys:write`. Danger: destructive.
|
|
1650
|
+
*
|
|
1651
|
+
* `DELETE /frontend-keys/{id}` · action `frontend_keys.revoke`
|
|
1652
|
+
* @scope `frontend_keys:write`
|
|
1653
|
+
* @danger destructive
|
|
1654
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1655
|
+
*/
|
|
1656
|
+
revoke: (id, options) => this.transport.call(environmentOperations["frontend_keys.revoke"], [id], void 0, options),
|
|
1657
|
+
/**
|
|
1658
|
+
* Replace the exact list of origins allowed to present a publishable frontend key. Live on the next request.
|
|
1659
|
+
*
|
|
1660
|
+
* Requires scope `frontend_keys:write`. Danger: write.
|
|
1661
|
+
*
|
|
1662
|
+
* `PUT /frontend-keys/{id}/origins` · action `frontend_keys.set_origins`
|
|
1663
|
+
* @scope `frontend_keys:write`
|
|
1664
|
+
* @danger write
|
|
1665
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1666
|
+
*/
|
|
1667
|
+
setOrigins: (id, body, options) => this.transport.call(environmentOperations["frontend_keys.set_origins"], [id], body, options)
|
|
1668
|
+
};
|
|
1669
|
+
hooks = {
|
|
1670
|
+
/**
|
|
1671
|
+
* Register a hook at a hook point (token minting, login, registration, password change). Returns its signing secret once.
|
|
1672
|
+
*
|
|
1673
|
+
* Requires scope `hooks:write`. Danger: critical.
|
|
1674
|
+
*
|
|
1675
|
+
* `POST /hooks` · action `hooks.create`
|
|
1676
|
+
* @scope `hooks:write`
|
|
1677
|
+
* @danger critical
|
|
1678
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1679
|
+
*/
|
|
1680
|
+
create: (body, options) => this.transport.call(environmentOperations["hooks.create"], [], body, options),
|
|
1681
|
+
/**
|
|
1682
|
+
* Remove a hook. It is no longer called at its hook point.
|
|
1683
|
+
*
|
|
1684
|
+
* Requires scope `hooks:write`. Danger: destructive.
|
|
1685
|
+
*
|
|
1686
|
+
* `DELETE /hooks/{id}` · action `hooks.delete`
|
|
1687
|
+
* @scope `hooks:write`
|
|
1688
|
+
* @danger destructive
|
|
1689
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1690
|
+
*/
|
|
1691
|
+
delete: (id, options) => this.transport.call(environmentOperations["hooks.delete"], [id], void 0, options),
|
|
1692
|
+
/**
|
|
1693
|
+
* Get one hook: its URL, hook point, owner and whether it is active. Never its signing secret.
|
|
1694
|
+
*
|
|
1695
|
+
* Requires scope `hooks:read`. Danger: read.
|
|
1696
|
+
*
|
|
1697
|
+
* `GET /hooks/{id}` · action `hooks.get`
|
|
1698
|
+
* @scope `hooks:read`
|
|
1699
|
+
* @danger read
|
|
1700
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1701
|
+
*/
|
|
1702
|
+
get: (id, options) => this.transport.call(environmentOperations["hooks.get"], [id], void 0, options),
|
|
1703
|
+
/**
|
|
1704
|
+
* List the hooks — endpoints called during sign-in and token issuance — with their hook point, owner and whether each is active.
|
|
1705
|
+
*
|
|
1706
|
+
* Requires scope `hooks:read`. Danger: read.
|
|
1707
|
+
*
|
|
1708
|
+
* `GET /hooks` · action `hooks.list`
|
|
1709
|
+
* @scope `hooks:read`
|
|
1710
|
+
* @danger read
|
|
1711
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1712
|
+
*/
|
|
1713
|
+
list: (query, options) => this.transport.call(environmentOperations["hooks.list"], [], query, options),
|
|
1714
|
+
/** Every item of `hooks.list`, fetching pages as the iteration reaches them. */
|
|
1715
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["hooks.list"], [], query, options),
|
|
1716
|
+
/**
|
|
1717
|
+
* Pause (active: false) or activate (active: true) a hook.
|
|
1718
|
+
*
|
|
1719
|
+
* Requires scope `hooks:write`. Danger: critical.
|
|
1720
|
+
*
|
|
1721
|
+
* `PATCH /hooks/{id}` · action `hooks.update`
|
|
1722
|
+
* @scope `hooks:write`
|
|
1723
|
+
* @danger critical
|
|
1724
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1725
|
+
*/
|
|
1726
|
+
update: (id, body, options) => this.transport.call(environmentOperations["hooks.update"], [id], body, options)
|
|
1727
|
+
};
|
|
1728
|
+
invitations = {
|
|
1729
|
+
/**
|
|
1730
|
+
* List an organization's pending invitations
|
|
1731
|
+
*
|
|
1732
|
+
* Requires scope `invitations:read`. Pending and unexpired only.
|
|
1733
|
+
*
|
|
1734
|
+
* `GET /organizations/{organization_id}/invitations` · action `invitations.list`
|
|
1735
|
+
* @scope `invitations:read`
|
|
1736
|
+
* @danger read
|
|
1737
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1738
|
+
*/
|
|
1739
|
+
list: (organizationId, query, options) => this.transport.call(environmentOperations["invitations.list"], [organizationId], query, options),
|
|
1740
|
+
/** Every item of `invitations.list`, fetching pages as the iteration reaches them. */
|
|
1741
|
+
listAll: (organizationId, query, options) => this.transport.paginate(environmentOperations["invitations.list"], [organizationId], query, options),
|
|
1742
|
+
/**
|
|
1743
|
+
* Mail a pending invitation again
|
|
1744
|
+
*
|
|
1745
|
+
* Requires scope `invitations:write`. On a **fresh link**: only a hash of the old one is
|
|
1746
|
+
* kept, so it cannot be re-sent, and the reason people ask is usually that it expired.
|
|
1747
|
+
* The response is the NEW invitation — its `id` replaces the old one, which stops
|
|
1748
|
+
* working. Its roles and app context move with it.
|
|
1749
|
+
*
|
|
1750
|
+
* One re-send per address per minute (`429 too_soon`); `409 not_pending` for one that
|
|
1751
|
+
* was accepted, withdrawn or has expired; `503 mail_failed` keeps the invitation.
|
|
1752
|
+
*
|
|
1753
|
+
* `POST /organizations/{organization_id}/invitations/{invitation_id}/resend` · action `invitations.resend`
|
|
1754
|
+
* @scope `invitations:write`
|
|
1755
|
+
* @danger write
|
|
1756
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1757
|
+
*/
|
|
1758
|
+
resend: (organizationId, invitationId, options) => this.transport.call(environmentOperations["invitations.resend"], [organizationId, invitationId], void 0, options),
|
|
1759
|
+
/**
|
|
1760
|
+
* Withdraw a pending invitation
|
|
1761
|
+
*
|
|
1762
|
+
* Requires scope `invitations:write`. The link stops working, and the roles parked
|
|
1763
|
+
* for it go with it. `409 not_pending` for one already accepted, withdrawn or expired.
|
|
1764
|
+
*
|
|
1765
|
+
* `DELETE /organizations/{organization_id}/invitations/{invitation_id}` · action `invitations.revoke`
|
|
1766
|
+
* @scope `invitations:write`
|
|
1767
|
+
* @danger destructive
|
|
1768
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1769
|
+
*/
|
|
1770
|
+
revoke: (organizationId, invitationId, options) => this.transport.call(environmentOperations["invitations.revoke"], [organizationId, invitationId], void 0, options),
|
|
1771
|
+
/**
|
|
1772
|
+
* Invite someone to the organization
|
|
1773
|
+
*
|
|
1774
|
+
* Requires scope `invitations:write`. Mails a link; the person joins when they open it
|
|
1775
|
+
* and confirm. Inviting an address again replaces its earlier pending invitation.
|
|
1776
|
+
*
|
|
1777
|
+
* - `role` — `admin` or `member` (default `member`). Never `owner`.
|
|
1778
|
+
* - `roles` — access roles granted when the invitation is accepted: role ids, or your
|
|
1779
|
+
* app's manifest **keys** when `client_id` names the app that declared them. Only
|
|
1780
|
+
* roles the organization's own administrators could grant are accepted: a **staff
|
|
1781
|
+
* role** is refused (`422 role_not_assignable`) — grant it after they join, with
|
|
1782
|
+
* `PUT …/members/{user_id}/roles/{role_id}`.
|
|
1783
|
+
* - `client_id` + `return_to` — after accepting, the person is sent to `return_to`,
|
|
1784
|
+
* which must be on one of that app's registered redirect-URI origins (checked again
|
|
1785
|
+
* when the invitation is accepted).
|
|
1786
|
+
* - `inviter_name` — who the mail says it is from. Defaults to the app's name, or the
|
|
1787
|
+
* environment's.
|
|
1788
|
+
*
|
|
1789
|
+
* Refusals: `409 already_member`, `409 access_role_conflict` (segregation of duties),
|
|
1790
|
+
* `422 unknown_role`, `422 role_not_assignable`, `422 unknown_app`,
|
|
1791
|
+
* `422 return_without_app`, `422 return_to_malformed`, `422 return_to_not_registered`,
|
|
1792
|
+
* `503 mail_failed` (nothing was created — retry).
|
|
1793
|
+
*
|
|
1794
|
+
* `POST /organizations/{organization_id}/invitations` · action `invitations.send`
|
|
1795
|
+
* @scope `invitations:write`
|
|
1796
|
+
* @danger write
|
|
1797
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1798
|
+
*/
|
|
1799
|
+
send: (organizationId, body, options) => this.transport.call(environmentOperations["invitations.send"], [organizationId], body, options)
|
|
1800
|
+
};
|
|
1801
|
+
keys = {
|
|
1802
|
+
/**
|
|
1803
|
+
* Mint a management key for this environment, at most as wide as the caller. The value is returned once, as `token`.
|
|
1804
|
+
*
|
|
1805
|
+
* Requires scope `keys:write`. Danger: critical.
|
|
1806
|
+
*
|
|
1807
|
+
* `POST /keys` · action `keys.create`
|
|
1808
|
+
* @scope `keys:write`
|
|
1809
|
+
* @danger critical
|
|
1810
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1811
|
+
*/
|
|
1812
|
+
create: (body, options) => this.transport.call(environmentOperations["keys.create"], [], body, options),
|
|
1813
|
+
/**
|
|
1814
|
+
* List this environment's management keys (names, scopes, parents, expiry, last use — never their values).
|
|
1815
|
+
*
|
|
1816
|
+
* Requires scope `keys:read`. Danger: read.
|
|
1817
|
+
*
|
|
1818
|
+
* `GET /keys` · action `keys.list`
|
|
1819
|
+
* @scope `keys:read`
|
|
1820
|
+
* @danger read
|
|
1821
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1822
|
+
*/
|
|
1823
|
+
list: (query, options) => this.transport.call(environmentOperations["keys.list"], [], query, options),
|
|
1824
|
+
/** Every item of `keys.list`, fetching pages as the iteration reaches them. */
|
|
1825
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["keys.list"], [], query, options),
|
|
1826
|
+
/**
|
|
1827
|
+
* Revoke a management key and every key it minted, immediately.
|
|
1828
|
+
*
|
|
1829
|
+
* Requires scope `keys:write`. Danger: destructive.
|
|
1830
|
+
*
|
|
1831
|
+
* `DELETE /keys/{id}` · action `keys.revoke`
|
|
1832
|
+
* @scope `keys:write`
|
|
1833
|
+
* @danger destructive
|
|
1834
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1835
|
+
*/
|
|
1836
|
+
revoke: (id, options) => this.transport.call(environmentOperations["keys.revoke"], [id], void 0, options),
|
|
1837
|
+
/**
|
|
1838
|
+
* Rotate a management key: mint a successor with the same scopes and retire the old one after a grace period.
|
|
1839
|
+
*
|
|
1840
|
+
* Requires scope `keys:write`. Danger: critical.
|
|
1841
|
+
*
|
|
1842
|
+
* `POST /keys/{id}/rotate` · action `keys.rotate`
|
|
1843
|
+
* @scope `keys:write`
|
|
1844
|
+
* @danger critical
|
|
1845
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1846
|
+
*/
|
|
1847
|
+
rotate: (id, body, options) => this.transport.call(environmentOperations["keys.rotate"], [id], body, options)
|
|
1848
|
+
};
|
|
1849
|
+
legacyLogin = {
|
|
1850
|
+
/**
|
|
1851
|
+
* Approve the declared legacy login endpoint: sign-ins for people not yet migrated, with their passwords, go to that URL.
|
|
1852
|
+
*
|
|
1853
|
+
* Requires scope `signin:write`. Danger: critical.
|
|
1854
|
+
*
|
|
1855
|
+
* `POST /legacy-login/approve` · action `legacy_login.approve`
|
|
1856
|
+
* @scope `signin:write`
|
|
1857
|
+
* @danger critical
|
|
1858
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1859
|
+
*/
|
|
1860
|
+
approve: (options) => this.transport.call(environmentOperations["legacy_login.approve"], [], void 0, options),
|
|
1861
|
+
/**
|
|
1862
|
+
* Read the legacy login endpoint an app declared for migration, and whether it is approved to receive sign-ins.
|
|
1863
|
+
*
|
|
1864
|
+
* Requires scope `signin:read`. Danger: read.
|
|
1865
|
+
*
|
|
1866
|
+
* `GET /legacy-login` · action `legacy_login.get`
|
|
1867
|
+
* @scope `signin:read`
|
|
1868
|
+
* @danger read
|
|
1869
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1870
|
+
*/
|
|
1871
|
+
get: (options) => this.transport.call(environmentOperations["legacy_login.get"], [], void 0, options),
|
|
1872
|
+
/**
|
|
1873
|
+
* Ask the declared legacy login endpoint whether it knows an address — your own — to test it before approving. Sends no password.
|
|
1874
|
+
*
|
|
1875
|
+
* Requires scope `signin:write`. Danger: write.
|
|
1876
|
+
*
|
|
1877
|
+
* `POST /legacy-login/probe` · action `legacy_login.probe`
|
|
1878
|
+
* @scope `signin:write`
|
|
1879
|
+
* @danger write
|
|
1880
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1881
|
+
*/
|
|
1882
|
+
probe: (body, options) => this.transport.call(environmentOperations["legacy_login.probe"], [], body, options),
|
|
1883
|
+
/**
|
|
1884
|
+
* Withdraw the legacy login approval. People not yet migrated can no longer sign in; the declaration stays on file.
|
|
1885
|
+
*
|
|
1886
|
+
* Requires scope `signin:write`. Danger: critical.
|
|
1887
|
+
*
|
|
1888
|
+
* `POST /legacy-login/revoke` · action `legacy_login.revoke`
|
|
1889
|
+
* @scope `signin:write`
|
|
1890
|
+
* @danger critical
|
|
1891
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1892
|
+
*/
|
|
1893
|
+
revoke: (options) => this.transport.call(environmentOperations["legacy_login.revoke"], [], void 0, options)
|
|
1894
|
+
};
|
|
1895
|
+
logStreams = {
|
|
1896
|
+
/**
|
|
1897
|
+
* Stream the audit trail to a SIEM (Splunk, Elastic, Graylog, CEF, JSON), Datadog, or an S3 or GCS bucket. A generated HMAC key is returned once.
|
|
1898
|
+
*
|
|
1899
|
+
* Requires scope `log_streams:write`. Danger: critical.
|
|
1900
|
+
*
|
|
1901
|
+
* `POST /log-streams` · action `log_streams.create`
|
|
1902
|
+
* @scope `log_streams:write`
|
|
1903
|
+
* @danger critical
|
|
1904
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1905
|
+
*/
|
|
1906
|
+
create: (body, options) => this.transport.call(environmentOperations["log_streams.create"], [], body, options),
|
|
1907
|
+
/**
|
|
1908
|
+
* Delete an audit log stream. Nothing more is delivered to its endpoint.
|
|
1909
|
+
*
|
|
1910
|
+
* Requires scope `log_streams:write`. Danger: destructive.
|
|
1911
|
+
*
|
|
1912
|
+
* `DELETE /log-streams/{id}` · action `log_streams.delete`
|
|
1913
|
+
* @scope `log_streams:write`
|
|
1914
|
+
* @danger destructive
|
|
1915
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1916
|
+
*/
|
|
1917
|
+
delete: (id, options) => this.transport.call(environmentOperations["log_streams.delete"], [id], void 0, options),
|
|
1918
|
+
/**
|
|
1919
|
+
* Get one audit log stream: destination, endpoint, auth scheme, owner and health. Never its secret.
|
|
1920
|
+
*
|
|
1921
|
+
* Requires scope `log_streams:read`. Danger: read.
|
|
1922
|
+
*
|
|
1923
|
+
* `GET /log-streams/{id}` · action `log_streams.get`
|
|
1924
|
+
* @scope `log_streams:read`
|
|
1925
|
+
* @danger read
|
|
1926
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1927
|
+
*/
|
|
1928
|
+
get: (id, options) => this.transport.call(environmentOperations["log_streams.get"], [id], void 0, options),
|
|
1929
|
+
/**
|
|
1930
|
+
* List the SIEM destinations this environment's audit trail is streamed to, and whether each is enabled. Never a secret.
|
|
1931
|
+
*
|
|
1932
|
+
* Requires scope `log_streams:read`. Danger: read.
|
|
1933
|
+
*
|
|
1934
|
+
* `GET /log-streams` · action `log_streams.list`
|
|
1935
|
+
* @scope `log_streams:read`
|
|
1936
|
+
* @danger read
|
|
1937
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1938
|
+
*/
|
|
1939
|
+
list: (query, options) => this.transport.call(environmentOperations["log_streams.list"], [], query, options),
|
|
1940
|
+
/** Every item of `log_streams.list`, fetching pages as the iteration reaches them. */
|
|
1941
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["log_streams.list"], [], query, options),
|
|
1942
|
+
/**
|
|
1943
|
+
* Send one test event to a log stream now and report whether the destination accepted it, and if not, why.
|
|
1944
|
+
*
|
|
1945
|
+
* Requires scope `log_streams:write`. Danger: write.
|
|
1946
|
+
*
|
|
1947
|
+
* `POST /log-streams/{id}/test` · action `log_streams.test`
|
|
1948
|
+
* @scope `log_streams:write`
|
|
1949
|
+
* @danger write
|
|
1950
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1951
|
+
*/
|
|
1952
|
+
test: (id, options) => this.transport.call(environmentOperations["log_streams.test"], [id], void 0, options),
|
|
1953
|
+
/**
|
|
1954
|
+
* Change an audit log stream's name, destination, endpoint, options or credential (re-validated; resets its circuit breaker), or disable (enabled: false) / resume (enabled: true) it.
|
|
1955
|
+
*
|
|
1956
|
+
* Requires scope `log_streams:write`. Danger: critical.
|
|
1957
|
+
*
|
|
1958
|
+
* `PATCH /log-streams/{id}` · action `log_streams.update`
|
|
1959
|
+
* @scope `log_streams:write`
|
|
1960
|
+
* @danger critical
|
|
1961
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1962
|
+
*/
|
|
1963
|
+
update: (id, body, options) => this.transport.call(environmentOperations["log_streams.update"], [id], body, options)
|
|
1964
|
+
};
|
|
1965
|
+
members = {
|
|
1966
|
+
/**
|
|
1967
|
+
* Add an existing user as a member
|
|
1968
|
+
*
|
|
1969
|
+
* Requires scope `members:write`. Straight in — no invitation, no mail. Name the user by
|
|
1970
|
+
* `user_id` or by `email`; they must exist in this environment (`422 user_not_found`).
|
|
1971
|
+
* A suspended or archived organization takes no new members (`409 organization_inactive`).
|
|
1972
|
+
*
|
|
1973
|
+
* `roles` grants access roles at the same time — ids, or your app's manifest keys with
|
|
1974
|
+
* `client_id` — with the environment's authority (staff roles included). One the
|
|
1975
|
+
* organization cannot hold is `422 role_not_assignable`; a segregation-of-duties
|
|
1976
|
+
* conflict is `409 role_conflict`, and nothing is added.
|
|
1977
|
+
*
|
|
1978
|
+
* `role` is `admin` or `member` (default `member`). `owner` is never assignable:
|
|
1979
|
+
* ownership moves with `transfer-ownership`.
|
|
1980
|
+
*
|
|
1981
|
+
* **Idempotent for the same role**: repeating the request answers `200` with the
|
|
1982
|
+
* existing membership. A member on a *different* role is `409 already_member` — change
|
|
1983
|
+
* the role with `PATCH`.
|
|
1984
|
+
*
|
|
1985
|
+
* `POST /organizations/{organization_id}/members` · action `members.add`
|
|
1986
|
+
* @scope `members:write`
|
|
1987
|
+
* @danger write
|
|
1988
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
1989
|
+
*/
|
|
1990
|
+
add: (organizationId, body, options) => this.transport.call(environmentOperations["members.add"], [organizationId], body, options),
|
|
1991
|
+
/**
|
|
1992
|
+
* List an organization's members
|
|
1993
|
+
*
|
|
1994
|
+
* Requires scope `members:read`. Every membership, whatever its status, oldest first.
|
|
1995
|
+
*
|
|
1996
|
+
* `GET /organizations/{organization_id}/members` · action `members.list`
|
|
1997
|
+
* @scope `members:read`
|
|
1998
|
+
* @danger read
|
|
1999
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2000
|
+
*/
|
|
2001
|
+
list: (organizationId, query, options) => this.transport.call(environmentOperations["members.list"], [organizationId], query, options),
|
|
2002
|
+
/** Every item of `members.list`, fetching pages as the iteration reaches them. */
|
|
2003
|
+
listAll: (organizationId, query, options) => this.transport.paginate(environmentOperations["members.list"], [organizationId], query, options),
|
|
2004
|
+
/**
|
|
2005
|
+
* Remove a member
|
|
2006
|
+
*
|
|
2007
|
+
* Requires scope `members:write`. The member's roles in the organization go with the
|
|
2008
|
+
* membership. Removing the only owner is refused with `409 last_owner`.
|
|
2009
|
+
*
|
|
2010
|
+
* `DELETE /organizations/{organization_id}/members/{user_id}` · action `members.remove`
|
|
2011
|
+
* @scope `members:write`
|
|
2012
|
+
* @danger destructive
|
|
2013
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2014
|
+
*/
|
|
2015
|
+
remove: (organizationId, userId, options) => this.transport.call(environmentOperations["members.remove"], [organizationId, userId], void 0, options),
|
|
2016
|
+
/**
|
|
2017
|
+
* Change a member's role
|
|
2018
|
+
*
|
|
2019
|
+
* Requires scope `members:write`. `role` is `admin` or `member`. Demoting the only
|
|
2020
|
+
* owner is refused with `409 last_owner` — transfer ownership first.
|
|
2021
|
+
*
|
|
2022
|
+
* `PATCH /organizations/{organization_id}/members/{user_id}` · action `members.update`
|
|
2023
|
+
* @scope `members:write`
|
|
2024
|
+
* @danger write
|
|
2025
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2026
|
+
*/
|
|
2027
|
+
update: (organizationId, userId, body, options) => this.transport.call(environmentOperations["members.update"], [organizationId, userId], body, options),
|
|
2028
|
+
roles: {
|
|
2029
|
+
/**
|
|
2030
|
+
* Grant a member a role in the organization
|
|
2031
|
+
*
|
|
2032
|
+
* Requires scope `roles:write`. Idempotent.
|
|
2033
|
+
*
|
|
2034
|
+
* **This API grants with the environment's authority.** It is your backend, so it may
|
|
2035
|
+
* grant any role the organization can hold — including a **staff role**
|
|
2036
|
+
* (`tenant_assignable: false`), such as your support lead's "Support" role at one
|
|
2037
|
+
* customer. An organization's own administrators still cannot: their console, their
|
|
2038
|
+
* invitations and their directory mappings refuse staff roles, and nothing here
|
|
2039
|
+
* changes that.
|
|
2040
|
+
*
|
|
2041
|
+
* Refusals: `422 role_not_assignable` (another organization's role, or one from an app
|
|
2042
|
+
* this organization cannot use), `409 role_conflict` (segregation of duties).
|
|
2043
|
+
*
|
|
2044
|
+
* `PUT /organizations/{organization_id}/members/{user_id}/roles/{role_id}` · action `members.roles.grant`
|
|
2045
|
+
* @scope `roles:write`
|
|
2046
|
+
* @danger write
|
|
2047
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2048
|
+
*/
|
|
2049
|
+
grant: (organizationId, userId, roleId, query, options) => this.transport.call(environmentOperations["members.roles.grant"], [organizationId, userId, roleId], query, options),
|
|
2050
|
+
/**
|
|
2051
|
+
* List the roles a member holds in the organization
|
|
2052
|
+
*
|
|
2053
|
+
* Requires scope `roles:read`. Roles granted AT this organization. Roles a person holds
|
|
2054
|
+
* everywhere in the environment (staff) are listed under
|
|
2055
|
+
* `/users/{id}/environment-roles`.
|
|
2056
|
+
*
|
|
2057
|
+
* `GET /organizations/{organization_id}/members/{user_id}/roles` · action `members.roles.list`
|
|
2058
|
+
* @scope `roles:read`
|
|
2059
|
+
* @danger read
|
|
2060
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2061
|
+
*/
|
|
2062
|
+
list: (organizationId, userId, options) => this.transport.call(environmentOperations["members.roles.list"], [organizationId, userId], void 0, options),
|
|
2063
|
+
/**
|
|
2064
|
+
* Take a role back from a member
|
|
2065
|
+
*
|
|
2066
|
+
* Requires scope `roles:write`. Idempotent — a role the member does not hold is a 204 too.
|
|
2067
|
+
*
|
|
2068
|
+
* `DELETE /organizations/{organization_id}/members/{user_id}/roles/{role_id}` · action `members.roles.revoke`
|
|
2069
|
+
* @scope `roles:write`
|
|
2070
|
+
* @danger destructive
|
|
2071
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2072
|
+
*/
|
|
2073
|
+
revoke: (organizationId, userId, roleId, query, options) => this.transport.call(environmentOperations["members.roles.revoke"], [organizationId, userId, roleId], query, options)
|
|
2074
|
+
}
|
|
2075
|
+
};
|
|
2076
|
+
organizations = {
|
|
2077
|
+
/**
|
|
2078
|
+
* Create an organization, optionally with its owner
|
|
2079
|
+
*
|
|
2080
|
+
* Requires scope `organizations:write`.
|
|
2081
|
+
*
|
|
2082
|
+
* `POST /organizations` · action `organizations.create`
|
|
2083
|
+
* @scope `organizations:write`
|
|
2084
|
+
* @danger write
|
|
2085
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2086
|
+
*/
|
|
2087
|
+
create: (body, options) => this.transport.call(environmentOperations["organizations.create"], [], body, options),
|
|
2088
|
+
/**
|
|
2089
|
+
* Archive an organization
|
|
2090
|
+
*
|
|
2091
|
+
* Requires scope `organizations:write`. **Archives** rather than erases: the status
|
|
2092
|
+
* becomes `deleted`, every member loses access from their next request, the rows stay
|
|
2093
|
+
* for the audit trail, and `organization.deleted` is announced. Idempotent — archiving
|
|
2094
|
+
* an archived organization answers with it unchanged.
|
|
2095
|
+
*
|
|
2096
|
+
* Refused with `409 owns_products` for an organization that owns identity-provider
|
|
2097
|
+
* projects on this platform (a platform customer, not a tenant of your app).
|
|
2098
|
+
*
|
|
2099
|
+
* `DELETE /organizations/{id}` · action `organizations.delete`
|
|
2100
|
+
* @scope `organizations:write`
|
|
2101
|
+
* @danger destructive
|
|
2102
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2103
|
+
*/
|
|
2104
|
+
delete: (id, options) => this.transport.call(environmentOperations["organizations.delete"], [id], void 0, options),
|
|
2105
|
+
/**
|
|
2106
|
+
* Get an organization
|
|
2107
|
+
*
|
|
2108
|
+
* Requires scope `organizations:read`.
|
|
2109
|
+
*
|
|
2110
|
+
* `GET /organizations/{id}` · action `organizations.get`
|
|
2111
|
+
* @scope `organizations:read`
|
|
2112
|
+
* @danger read
|
|
2113
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2114
|
+
*/
|
|
2115
|
+
get: (id, options) => this.transport.call(environmentOperations["organizations.get"], [id], void 0, options),
|
|
2116
|
+
/**
|
|
2117
|
+
* List organizations
|
|
2118
|
+
*
|
|
2119
|
+
* Requires scope `organizations:read`. A page at a time, archived ones included. Narrow
|
|
2120
|
+
* with `q` (a fragment of the name or slug) or `status`.
|
|
2121
|
+
*
|
|
2122
|
+
* `GET /organizations` · action `organizations.list`
|
|
2123
|
+
* @scope `organizations:read`
|
|
2124
|
+
* @danger read
|
|
2125
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2126
|
+
*/
|
|
2127
|
+
list: (query, options) => this.transport.call(environmentOperations["organizations.list"], [], query, options),
|
|
2128
|
+
/** Every item of `organizations.list`, fetching pages as the iteration reaches them. */
|
|
2129
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["organizations.list"], [], query, options),
|
|
2130
|
+
/**
|
|
2131
|
+
* Lift an organization's suspension so its members can sign in again.
|
|
2132
|
+
*
|
|
2133
|
+
* Requires scope `organizations:write`. Danger: write.
|
|
2134
|
+
*
|
|
2135
|
+
* `POST /organizations/{id}/reactivate` · action `organizations.reactivate`
|
|
2136
|
+
* @scope `organizations:write`
|
|
2137
|
+
* @danger write
|
|
2138
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2139
|
+
*/
|
|
2140
|
+
reactivate: (id, options) => this.transport.call(environmentOperations["organizations.reactivate"], [id], void 0, options),
|
|
2141
|
+
/**
|
|
2142
|
+
* Suspend an organization: its members cannot sign in to it until it is reactivated.
|
|
2143
|
+
*
|
|
2144
|
+
* Requires scope `organizations:write`. Danger: write.
|
|
2145
|
+
*
|
|
2146
|
+
* `POST /organizations/{id}/suspend` · action `organizations.suspend`
|
|
2147
|
+
* @scope `organizations:write`
|
|
2148
|
+
* @danger write
|
|
2149
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2150
|
+
*/
|
|
2151
|
+
suspend: (id, options) => this.transport.call(environmentOperations["organizations.suspend"], [id], void 0, options),
|
|
2152
|
+
/**
|
|
2153
|
+
* Make a member the organization's owner
|
|
2154
|
+
*
|
|
2155
|
+
* Requires scope `organizations:write`. The new owner must be an **active** member.
|
|
2156
|
+
* With one current owner this is a hand-over: the previous owner stays on as `admin`.
|
|
2157
|
+
* An organization with no owner (created without `owner_user_id`) gets its first; one
|
|
2158
|
+
* with several (from before ownership was transfer-only) ends with exactly one, the
|
|
2159
|
+
* others stepping down to `admin`.
|
|
2160
|
+
*
|
|
2161
|
+
* Refusals: `422 not_a_member`, `409 not_active`, `409 already_owner`.
|
|
2162
|
+
*
|
|
2163
|
+
* `POST /organizations/{id}/transfer-ownership` · action `organizations.transfer_ownership`
|
|
2164
|
+
* @scope `organizations:write`
|
|
2165
|
+
* @danger critical
|
|
2166
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2167
|
+
*/
|
|
2168
|
+
transferOwnership: (id, body, options) => this.transport.call(environmentOperations["organizations.transfer_ownership"], [id], body, options),
|
|
2169
|
+
/**
|
|
2170
|
+
* Rename an organization, change its slug, or replace its metadata
|
|
2171
|
+
*
|
|
2172
|
+
* Requires scope `organizations:write`. A field left out is left alone; a request
|
|
2173
|
+
* that changes nothing answers with the organization as it is and records nothing.
|
|
2174
|
+
* A change is announced as the `organization.updated` webhook and recorded on the
|
|
2175
|
+
* organization's trail as `organization.renamed`, with the values before and after.
|
|
2176
|
+
*
|
|
2177
|
+
* `PATCH /organizations/{id}` · action `organizations.update`
|
|
2178
|
+
* @scope `organizations:write`
|
|
2179
|
+
* @danger write
|
|
2180
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2181
|
+
*/
|
|
2182
|
+
update: (id, body, options) => this.transport.call(environmentOperations["organizations.update"], [id], body, options),
|
|
2183
|
+
domains: {
|
|
2184
|
+
/**
|
|
2185
|
+
* Claim an email domain (acme.com) for an organization. Returns the DNS TXT record to publish before verifying it.
|
|
2186
|
+
*
|
|
2187
|
+
* Requires scope `organizations:write`. Danger: write.
|
|
2188
|
+
*
|
|
2189
|
+
* `POST /organizations/{organization_id}/domains` · action `organizations.domains.add`
|
|
2190
|
+
* @scope `organizations:write`
|
|
2191
|
+
* @danger write
|
|
2192
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2193
|
+
*/
|
|
2194
|
+
add: (organizationId, body, options) => this.transport.call(environmentOperations["organizations.domains.add"], [organizationId], body, options),
|
|
2195
|
+
/**
|
|
2196
|
+
* Turn capture on or off for a verified domain: with it on, everyone with an address there signs in through the organization's SSO.
|
|
2197
|
+
*
|
|
2198
|
+
* Requires scope `organizations:write`. Danger: critical.
|
|
2199
|
+
*
|
|
2200
|
+
* `PUT /organizations/{organization_id}/domains/{domain_id}/capture` · action `organizations.domains.capture`
|
|
2201
|
+
* @scope `organizations:write`
|
|
2202
|
+
* @danger critical
|
|
2203
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2204
|
+
*/
|
|
2205
|
+
capture: (organizationId, domainId, body, options) => this.transport.call(environmentOperations["organizations.domains.capture"], [organizationId, domainId], body, options),
|
|
2206
|
+
/**
|
|
2207
|
+
* List the email domains an organization claims
|
|
2208
|
+
*
|
|
2209
|
+
* Requires scope `organizations:read`. Verified or not, each with the DNS TXT record
|
|
2210
|
+
* that proves it (`record_name`, `record_value`). A handful at most; not paged.
|
|
2211
|
+
*
|
|
2212
|
+
* `GET /organizations/{organization_id}/domains` · action `organizations.domains.list`
|
|
2213
|
+
* @scope `organizations:read`
|
|
2214
|
+
* @danger read
|
|
2215
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2216
|
+
*/
|
|
2217
|
+
list: (organizationId, options) => this.transport.call(environmentOperations["organizations.domains.list"], [organizationId], void 0, options),
|
|
2218
|
+
/**
|
|
2219
|
+
* Remove a claimed email domain from an organization. Capture on it ends.
|
|
2220
|
+
*
|
|
2221
|
+
* Requires scope `organizations:write`. Danger: destructive.
|
|
2222
|
+
*
|
|
2223
|
+
* `DELETE /organizations/{organization_id}/domains/{domain_id}` · action `organizations.domains.remove`
|
|
2224
|
+
* @scope `organizations:write`
|
|
2225
|
+
* @danger destructive
|
|
2226
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2227
|
+
*/
|
|
2228
|
+
remove: (organizationId, domainId, options) => this.transport.call(environmentOperations["organizations.domains.remove"], [organizationId, domainId], void 0, options),
|
|
2229
|
+
/**
|
|
2230
|
+
* Check a claimed domain's DNS TXT record and mark the domain verified if it is published.
|
|
2231
|
+
*
|
|
2232
|
+
* Requires scope `organizations:write`. Danger: write.
|
|
2233
|
+
*
|
|
2234
|
+
* `POST /organizations/{organization_id}/domains/{domain_id}/verify` · action `organizations.domains.verify`
|
|
2235
|
+
* @scope `organizations:write`
|
|
2236
|
+
* @danger write
|
|
2237
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2238
|
+
*/
|
|
2239
|
+
verify: (organizationId, domainId, options) => this.transport.call(environmentOperations["organizations.domains.verify"], [organizationId, domainId], void 0, options)
|
|
2240
|
+
},
|
|
2241
|
+
portalLinks: {
|
|
2242
|
+
/**
|
|
2243
|
+
* Create a one-time Admin Portal link an organization's IT administrator uses to set up SSO, directory sync, domain verification, log streams or SAML certificate renewal, or to read its audit logs, without an account. The URL is shown once.
|
|
2244
|
+
*
|
|
2245
|
+
* Requires scope `portal_links:write`. Danger: critical.
|
|
2246
|
+
*
|
|
2247
|
+
* `POST /organizations/{organization_id}/portal-links` · action `organizations.portal_links.create`
|
|
2248
|
+
* @scope `portal_links:write`
|
|
2249
|
+
* @danger critical
|
|
2250
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2251
|
+
*/
|
|
2252
|
+
create: (organizationId, body, options) => this.transport.call(environmentOperations["organizations.portal_links.create"], [organizationId], body, options),
|
|
2253
|
+
/**
|
|
2254
|
+
* List an organization's Admin Portal links
|
|
2255
|
+
*
|
|
2256
|
+
* Requires scope `portal_links:read`. Danger: read. The links minted in the last 30
|
|
2257
|
+
* days, newest first — every link that can still be opened is among them, since a link
|
|
2258
|
+
* waits a week at most. Each says what it opens, who minted it, whom it was mailed to
|
|
2259
|
+
* and where it stands (`status`). Never the link itself: it was shown once, when it was
|
|
2260
|
+
* minted, and only its hash is kept. Not paged.
|
|
2261
|
+
*
|
|
2262
|
+
* `GET /organizations/{organization_id}/portal-links` · action `organizations.portal_links.list`
|
|
2263
|
+
* @scope `portal_links:read`
|
|
2264
|
+
* @danger read
|
|
2265
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2266
|
+
*/
|
|
2267
|
+
list: (organizationId, options) => this.transport.call(environmentOperations["organizations.portal_links.list"], [organizationId], void 0, options),
|
|
2268
|
+
/**
|
|
2269
|
+
* Withdraw an Admin Portal link: it can no longer be opened, and a setup session it already opened ends on its next request. What was already set up through it stays.
|
|
2270
|
+
*
|
|
2271
|
+
* Requires scope `portal_links:write`. Danger: destructive.
|
|
2272
|
+
*
|
|
2273
|
+
* `DELETE /organizations/{organization_id}/portal-links/{id}` · action `organizations.portal_links.revoke`
|
|
2274
|
+
* @scope `portal_links:write`
|
|
2275
|
+
* @danger destructive
|
|
2276
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2277
|
+
*/
|
|
2278
|
+
revoke: (organizationId, id, options) => this.transport.call(environmentOperations["organizations.portal_links.revoke"], [organizationId, id], void 0, options)
|
|
2279
|
+
}
|
|
2280
|
+
};
|
|
2281
|
+
permissions = {
|
|
2282
|
+
/**
|
|
2283
|
+
* Author a manual `feature:action` permission, shared with the environment (organization_id null) or one organization's own.
|
|
2284
|
+
*
|
|
2285
|
+
* Requires scope `role_definitions:write`. Danger: write.
|
|
2286
|
+
*
|
|
2287
|
+
* `POST /permissions` · action `permissions.create`
|
|
2288
|
+
* @scope `role_definitions:write`
|
|
2289
|
+
* @danger write
|
|
2290
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2291
|
+
*/
|
|
2292
|
+
create: (body, options) => this.transport.call(environmentOperations["permissions.create"], [], body, options),
|
|
2293
|
+
/**
|
|
2294
|
+
* Delete a manual permission: every role carrying it loses it first.
|
|
2295
|
+
*
|
|
2296
|
+
* Requires scope `role_definitions:write`. Danger: destructive.
|
|
2297
|
+
*
|
|
2298
|
+
* `DELETE /permissions/{id}` · action `permissions.delete`
|
|
2299
|
+
* @scope `role_definitions:write`
|
|
2300
|
+
* @danger destructive
|
|
2301
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2302
|
+
*/
|
|
2303
|
+
delete: (id, options) => this.transport.call(environmentOperations["permissions.delete"], [id], void 0, options),
|
|
2304
|
+
/**
|
|
2305
|
+
* List the permission catalogue roles are composed from, a page at a time. Narrow by `client_id` (one app's), `organization_id` (what it can see) or a `q` fragment.
|
|
2306
|
+
*
|
|
2307
|
+
* Requires scope `roles:read`. Danger: read.
|
|
2308
|
+
*
|
|
2309
|
+
* `GET /permissions` · action `permissions.list`
|
|
2310
|
+
* @scope `roles:read`
|
|
2311
|
+
* @danger read
|
|
2312
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2313
|
+
*/
|
|
2314
|
+
list: (query, options) => this.transport.call(environmentOperations["permissions.list"], [], query, options),
|
|
2315
|
+
/** Every item of `permissions.list`, fetching pages as the iteration reaches them. */
|
|
2316
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["permissions.list"], [], query, options),
|
|
2317
|
+
/**
|
|
2318
|
+
* Change a manual permission's description, and on the shared tier whether organizations may use it. The key itself never changes.
|
|
2319
|
+
*
|
|
2320
|
+
* Requires scope `role_definitions:write`. Danger: write.
|
|
2321
|
+
*
|
|
2322
|
+
* `PATCH /permissions/{id}` · action `permissions.update`
|
|
2323
|
+
* @scope `role_definitions:write`
|
|
2324
|
+
* @danger write
|
|
2325
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2326
|
+
*/
|
|
2327
|
+
update: (id, body, options) => this.transport.call(environmentOperations["permissions.update"], [id], body, options)
|
|
2328
|
+
};
|
|
2329
|
+
provisioning = {
|
|
2330
|
+
targets: {
|
|
2331
|
+
/**
|
|
2332
|
+
* Register a downstream app this platform pushes an organization's people to over SCIM, or every organization's with environment_wide.
|
|
2333
|
+
*
|
|
2334
|
+
* Requires scope `provisioning:write`. Danger: critical.
|
|
2335
|
+
*
|
|
2336
|
+
* `POST /provisioning-targets` · action `provisioning.targets.create`
|
|
2337
|
+
* @scope `provisioning:write`
|
|
2338
|
+
* @danger critical
|
|
2339
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2340
|
+
*/
|
|
2341
|
+
create: (body, options) => this.transport.call(environmentOperations["provisioning.targets.create"], [], body, options),
|
|
2342
|
+
/**
|
|
2343
|
+
* Delete a downstream SCIM target. Nothing more is pushed to it.
|
|
2344
|
+
*
|
|
2345
|
+
* Requires scope `provisioning:write`. Danger: destructive.
|
|
2346
|
+
*
|
|
2347
|
+
* `DELETE /provisioning-targets/{id}` · action `provisioning.targets.delete`
|
|
2348
|
+
* @scope `provisioning:write`
|
|
2349
|
+
* @danger destructive
|
|
2350
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2351
|
+
*/
|
|
2352
|
+
delete: (id, body, options) => this.transport.call(environmentOperations["provisioning.targets.delete"], [id], body, options),
|
|
2353
|
+
/**
|
|
2354
|
+
* Read one downstream SCIM target: its URL, auth scheme, status and last error. Never its credential.
|
|
2355
|
+
*
|
|
2356
|
+
* Requires scope `provisioning:read`. Danger: read.
|
|
2357
|
+
*
|
|
2358
|
+
* `GET /provisioning-targets/{id}` · action `provisioning.targets.get`
|
|
2359
|
+
* @scope `provisioning:read`
|
|
2360
|
+
* @danger read
|
|
2361
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2362
|
+
*/
|
|
2363
|
+
get: (id, query, options) => this.transport.call(environmentOperations["provisioning.targets.get"], [id], query, options),
|
|
2364
|
+
/**
|
|
2365
|
+
* List the downstream SCIM targets people are provisioned to, optionally for one organization, with their failures. Never their credentials.
|
|
2366
|
+
*
|
|
2367
|
+
* Requires scope `provisioning:read`. Danger: read.
|
|
2368
|
+
*
|
|
2369
|
+
* `GET /provisioning-targets` · action `provisioning.targets.list`
|
|
2370
|
+
* @scope `provisioning:read`
|
|
2371
|
+
* @danger read
|
|
2372
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2373
|
+
*/
|
|
2374
|
+
list: (query, options) => this.transport.call(environmentOperations["provisioning.targets.list"], [], query, options),
|
|
2375
|
+
/** Every item of `provisioning.targets.list`, fetching pages as the iteration reaches them. */
|
|
2376
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["provisioning.targets.list"], [], query, options),
|
|
2377
|
+
status: {
|
|
2378
|
+
/**
|
|
2379
|
+
* Pause or resume pushing people to a downstream SCIM target.
|
|
2380
|
+
*
|
|
2381
|
+
* Requires scope `provisioning:write`. Danger: write.
|
|
2382
|
+
*
|
|
2383
|
+
* `POST /provisioning-targets/{id}/status` · action `provisioning.targets.status.set`
|
|
2384
|
+
* @scope `provisioning:write`
|
|
2385
|
+
* @danger write
|
|
2386
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2387
|
+
*/
|
|
2388
|
+
set: (id, body, options) => this.transport.call(environmentOperations["provisioning.targets.status.set"], [id], body, options)
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
};
|
|
2392
|
+
roles = {
|
|
2393
|
+
/**
|
|
2394
|
+
* Define a role for one organization, or (organization_id null) for the whole environment, optionally scoped to one app, with its opening permissions.
|
|
2395
|
+
*
|
|
2396
|
+
* Requires scope `role_definitions:write`. Danger: write.
|
|
2397
|
+
*
|
|
2398
|
+
* `POST /roles` · action `roles.create`
|
|
2399
|
+
* @scope `role_definitions:write`
|
|
2400
|
+
* @danger write
|
|
2401
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2402
|
+
*/
|
|
2403
|
+
create: (body, options) => this.transport.call(environmentOperations["roles.create"], [], body, options),
|
|
2404
|
+
/**
|
|
2405
|
+
* Delete a role: everyone who holds it loses it. An app-declared role is removed from the app's manifest instead.
|
|
2406
|
+
*
|
|
2407
|
+
* Requires scope `role_definitions:write`. Danger: destructive.
|
|
2408
|
+
*
|
|
2409
|
+
* `DELETE /roles/{id}` · action `roles.delete`
|
|
2410
|
+
* @scope `role_definitions:write`
|
|
2411
|
+
* @danger destructive
|
|
2412
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2413
|
+
*/
|
|
2414
|
+
delete: (id, options) => this.transport.call(environmentOperations["roles.delete"], [id], void 0, options),
|
|
2415
|
+
/**
|
|
2416
|
+
* Get one role and the permissions it carries. Name it by id, or by manifest `key` with `client_id`.
|
|
2417
|
+
*
|
|
2418
|
+
* Requires scope `roles:read`. Danger: read.
|
|
2419
|
+
*
|
|
2420
|
+
* `GET /roles/{id}` · action `roles.get`
|
|
2421
|
+
* @scope `roles:read`
|
|
2422
|
+
* @danger read
|
|
2423
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2424
|
+
*/
|
|
2425
|
+
get: (id, query, options) => this.transport.call(environmentOperations["roles.get"], [id], query, options),
|
|
2426
|
+
/**
|
|
2427
|
+
* List roles
|
|
2428
|
+
*
|
|
2429
|
+
* Requires scope `roles:read`. Every role that can still be granted, ordered by name,
|
|
2430
|
+
* with the permissions each carries. Not paginated. `?client_id=` narrows to one
|
|
2431
|
+
* app's roles; `?organization_id=` to what can be granted in that organization.
|
|
2432
|
+
*
|
|
2433
|
+
* `GET /roles` · action `roles.list`
|
|
2434
|
+
* @scope `roles:read`
|
|
2435
|
+
* @danger read
|
|
2436
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2437
|
+
*/
|
|
2438
|
+
list: (query, options) => this.transport.call(environmentOperations["roles.list"], [], query, options),
|
|
2439
|
+
/**
|
|
2440
|
+
* Rename a role or change its description. An app-declared role is changed in the app's manifest instead.
|
|
2441
|
+
*
|
|
2442
|
+
* Requires scope `role_definitions:write`. Danger: write.
|
|
2443
|
+
*
|
|
2444
|
+
* `PATCH /roles/{id}` · action `roles.update`
|
|
2445
|
+
* @scope `role_definitions:write`
|
|
2446
|
+
* @danger write
|
|
2447
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2448
|
+
*/
|
|
2449
|
+
update: (id, body, options) => this.transport.call(environmentOperations["roles.update"], [id], body, options),
|
|
2450
|
+
permissions: {
|
|
2451
|
+
/**
|
|
2452
|
+
* Add a permission to a role: everyone holding the role gains it. The permission must be unscoped or declared by the role's own app.
|
|
2453
|
+
*
|
|
2454
|
+
* Requires scope `role_definitions:write`. Danger: write.
|
|
2455
|
+
*
|
|
2456
|
+
* `PUT /roles/{id}/permissions/{permission_id}` · action `roles.permissions.grant`
|
|
2457
|
+
* @scope `role_definitions:write`
|
|
2458
|
+
* @danger write
|
|
2459
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2460
|
+
*/
|
|
2461
|
+
grant: (id, permissionId, options) => this.transport.call(environmentOperations["roles.permissions.grant"], [id, permissionId], void 0, options),
|
|
2462
|
+
/**
|
|
2463
|
+
* Remove a permission from a role: everyone holding the role loses it.
|
|
2464
|
+
*
|
|
2465
|
+
* Requires scope `role_definitions:write`. Danger: destructive.
|
|
2466
|
+
*
|
|
2467
|
+
* `DELETE /roles/{id}/permissions/{permission_id}` · action `roles.permissions.revoke`
|
|
2468
|
+
* @scope `role_definitions:write`
|
|
2469
|
+
* @danger destructive
|
|
2470
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2471
|
+
*/
|
|
2472
|
+
revoke: (id, permissionId, options) => this.transport.call(environmentOperations["roles.permissions.revoke"], [id, permissionId], void 0, options)
|
|
2473
|
+
}
|
|
2474
|
+
};
|
|
2475
|
+
samlApps = {
|
|
2476
|
+
/**
|
|
2477
|
+
* Register a SAML app that signs people in with their account here. Decides where assertions — and their attributes — are sent.
|
|
2478
|
+
*
|
|
2479
|
+
* Requires scope `saml_apps:write`. Danger: critical.
|
|
2480
|
+
*
|
|
2481
|
+
* `POST /saml-apps` · action `saml_apps.create`
|
|
2482
|
+
* @scope `saml_apps:write`
|
|
2483
|
+
* @danger critical
|
|
2484
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2485
|
+
*/
|
|
2486
|
+
create: (body, options) => this.transport.call(environmentOperations["saml_apps.create"], [], body, options),
|
|
2487
|
+
/**
|
|
2488
|
+
* Remove a SAML app. People can no longer sign in to it with their account here.
|
|
2489
|
+
*
|
|
2490
|
+
* Requires scope `saml_apps:write`. Danger: critical.
|
|
2491
|
+
*
|
|
2492
|
+
* `DELETE /saml-apps/{id}` · action `saml_apps.delete`
|
|
2493
|
+
* @scope `saml_apps:write`
|
|
2494
|
+
* @danger critical
|
|
2495
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2496
|
+
*/
|
|
2497
|
+
delete: (id, options) => this.transport.call(environmentOperations["saml_apps.delete"], [id], void 0, options),
|
|
2498
|
+
/**
|
|
2499
|
+
* Read one SAML app: its entity id, ACS URL, NameID and attribute mappings. Never its certificate.
|
|
2500
|
+
*
|
|
2501
|
+
* Requires scope `saml_apps:read`. Danger: read.
|
|
2502
|
+
*
|
|
2503
|
+
* `GET /saml-apps/{id}` · action `saml_apps.get`
|
|
2504
|
+
* @scope `saml_apps:read`
|
|
2505
|
+
* @danger read
|
|
2506
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2507
|
+
*/
|
|
2508
|
+
get: (id, options) => this.transport.call(environmentOperations["saml_apps.get"], [id], void 0, options),
|
|
2509
|
+
/**
|
|
2510
|
+
* List the SAML apps that trust this environment as their identity provider.
|
|
2511
|
+
*
|
|
2512
|
+
* Requires scope `saml_apps:read`. Danger: read.
|
|
2513
|
+
*
|
|
2514
|
+
* `GET /saml-apps` · action `saml_apps.list`
|
|
2515
|
+
* @scope `saml_apps:read`
|
|
2516
|
+
* @danger read
|
|
2517
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2518
|
+
*/
|
|
2519
|
+
list: (query, options) => this.transport.call(environmentOperations["saml_apps.list"], [], query, options),
|
|
2520
|
+
/** Every item of `saml_apps.list`, fetching pages as the iteration reaches them. */
|
|
2521
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["saml_apps.list"], [], query, options),
|
|
2522
|
+
/**
|
|
2523
|
+
* Change a SAML app's entity id, ACS URL, NameID, attribute mappings, signing certificate or owning organization.
|
|
2524
|
+
*
|
|
2525
|
+
* Requires scope `saml_apps:write`. Danger: critical.
|
|
2526
|
+
*
|
|
2527
|
+
* `PATCH /saml-apps/{id}` · action `saml_apps.update`
|
|
2528
|
+
* @scope `saml_apps:write`
|
|
2529
|
+
* @danger critical
|
|
2530
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2531
|
+
*/
|
|
2532
|
+
update: (id, body, options) => this.transport.call(environmentOperations["saml_apps.update"], [id], body, options)
|
|
2533
|
+
};
|
|
2534
|
+
signin = {
|
|
2535
|
+
policy: {
|
|
2536
|
+
/**
|
|
2537
|
+
* Read the authentication policy (password, MFA, SSO, lockout): the environment baseline, or one organization's effective rules and override.
|
|
2538
|
+
*
|
|
2539
|
+
* Requires scope `signin:read`. Danger: read.
|
|
2540
|
+
*
|
|
2541
|
+
* `GET /sign-in/policy` · action `signin.policy.get`
|
|
2542
|
+
* @scope `signin:read`
|
|
2543
|
+
* @danger read
|
|
2544
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2545
|
+
*/
|
|
2546
|
+
get: (query, options) => this.transport.call(environmentOperations["signin.policy.get"], [], query, options),
|
|
2547
|
+
/**
|
|
2548
|
+
* Drop one organization's authentication policy override, so it inherits the environment baseline again.
|
|
2549
|
+
*
|
|
2550
|
+
* Requires scope `signin:write`. Danger: critical.
|
|
2551
|
+
*
|
|
2552
|
+
* `DELETE /sign-in/policy/organizations/{organization_id}` · action `signin.policy.inherit`
|
|
2553
|
+
* @scope `signin:write`
|
|
2554
|
+
* @danger critical
|
|
2555
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2556
|
+
*/
|
|
2557
|
+
inherit: (organizationId, options) => this.transport.call(environmentOperations["signin.policy.inherit"], [organizationId], void 0, options),
|
|
2558
|
+
/**
|
|
2559
|
+
* Change the authentication policy of the environment baseline, or tighten one organization's override. Requiring SSO signs out password sessions.
|
|
2560
|
+
*
|
|
2561
|
+
* Requires scope `signin:write`. Danger: critical.
|
|
2562
|
+
*
|
|
2563
|
+
* `PATCH /sign-in/policy` · action `signin.policy.update`
|
|
2564
|
+
* @scope `signin:write`
|
|
2565
|
+
* @danger critical
|
|
2566
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2567
|
+
*/
|
|
2568
|
+
update: (body, options) => this.transport.call(environmentOperations["signin.policy.update"], [], body, options)
|
|
2569
|
+
},
|
|
2570
|
+
selfServiceSignup: {
|
|
2571
|
+
/**
|
|
2572
|
+
* Switch self-service sign-up on or off: whether people can create an account and their own organization in this environment.
|
|
2573
|
+
*
|
|
2574
|
+
* Requires scope `signin:write`. Danger: critical.
|
|
2575
|
+
*
|
|
2576
|
+
* `PUT /sign-in/self-service-signup` · action `signin.self_service_signup.set`
|
|
2577
|
+
* @scope `signin:write`
|
|
2578
|
+
* @danger critical
|
|
2579
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2580
|
+
*/
|
|
2581
|
+
set: (body, options) => this.transport.call(environmentOperations["signin.self_service_signup.set"], [], body, options)
|
|
2582
|
+
},
|
|
2583
|
+
social: {
|
|
2584
|
+
/**
|
|
2585
|
+
* Stop offering a social login provider. People who used it keep their accounts.
|
|
2586
|
+
*
|
|
2587
|
+
* Requires scope `signin:write`. Danger: critical.
|
|
2588
|
+
*
|
|
2589
|
+
* `DELETE /sign-in/social-providers/{id}` · action `signin.social.delete`
|
|
2590
|
+
* @scope `signin:write`
|
|
2591
|
+
* @danger critical
|
|
2592
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2593
|
+
*/
|
|
2594
|
+
delete: (id, body, options) => this.transport.call(environmentOperations["signin.social.delete"], [id], body, options),
|
|
2595
|
+
/**
|
|
2596
|
+
* List the social login providers (Google, GitHub, Apple…) enabled in this environment, optionally for one organization.
|
|
2597
|
+
*
|
|
2598
|
+
* Requires scope `signin:read`. Danger: read.
|
|
2599
|
+
*
|
|
2600
|
+
* `GET /sign-in/social-providers` · action `signin.social.list`
|
|
2601
|
+
* @scope `signin:read`
|
|
2602
|
+
* @danger read
|
|
2603
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2604
|
+
*/
|
|
2605
|
+
list: (query, options) => this.transport.call(environmentOperations["signin.social.list"], [], query, options),
|
|
2606
|
+
/** Every item of `signin.social.list`, fetching pages as the iteration reaches them. */
|
|
2607
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["signin.social.list"], [], query, options),
|
|
2608
|
+
/**
|
|
2609
|
+
* Enable a social login provider (Google, GitHub, Apple…) for one organization with its client credentials. The secret is never returned.
|
|
2610
|
+
*
|
|
2611
|
+
* Requires scope `signin:write`. Danger: critical.
|
|
2612
|
+
*
|
|
2613
|
+
* `POST /sign-in/social-providers` · action `signin.social.set`
|
|
2614
|
+
* @scope `signin:write`
|
|
2615
|
+
* @danger critical
|
|
2616
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2617
|
+
*/
|
|
2618
|
+
set: (body, options) => this.transport.call(environmentOperations["signin.social.set"], [], body, options)
|
|
2619
|
+
}
|
|
2620
|
+
};
|
|
2621
|
+
sodPolicies = {
|
|
2622
|
+
/**
|
|
2623
|
+
* Define a role-conflict rule: two or more roles no one person may hold together. Enforced on every grant from now on.
|
|
2624
|
+
*
|
|
2625
|
+
* Requires scope `governance:write`. Danger: write.
|
|
2626
|
+
*
|
|
2627
|
+
* `POST /sod-policies` · action `sod_policies.create`
|
|
2628
|
+
* @scope `governance:write`
|
|
2629
|
+
* @danger write
|
|
2630
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2631
|
+
*/
|
|
2632
|
+
create: (body, options) => this.transport.call(environmentOperations["sod_policies.create"], [], body, options),
|
|
2633
|
+
/**
|
|
2634
|
+
* Remove a role-conflict rule. Grants it refused are allowed from then on.
|
|
2635
|
+
*
|
|
2636
|
+
* Requires scope `governance:write`. Danger: critical.
|
|
2637
|
+
*
|
|
2638
|
+
* `DELETE /sod-policies/{id}` · action `sod_policies.delete`
|
|
2639
|
+
* @scope `governance:write`
|
|
2640
|
+
* @danger critical
|
|
2641
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2642
|
+
*/
|
|
2643
|
+
delete: (id, body, options) => this.transport.call(environmentOperations["sod_policies.delete"], [id], body, options),
|
|
2644
|
+
/**
|
|
2645
|
+
* Read one role-conflict rule: the roles no one person may hold together, and whether it is enforced.
|
|
2646
|
+
*
|
|
2647
|
+
* Requires scope `governance:read`. Danger: read.
|
|
2648
|
+
*
|
|
2649
|
+
* `GET /sod-policies/{id}` · action `sod_policies.get`
|
|
2650
|
+
* @scope `governance:read`
|
|
2651
|
+
* @danger read
|
|
2652
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2653
|
+
*/
|
|
2654
|
+
get: (id, query, options) => this.transport.call(environmentOperations["sod_policies.get"], [id], query, options),
|
|
2655
|
+
/**
|
|
2656
|
+
* List role-conflict (segregation of duties) rules: sets of roles no one person may hold together. Optionally those binding one organization.
|
|
2657
|
+
*
|
|
2658
|
+
* Requires scope `governance:read`. Danger: read.
|
|
2659
|
+
*
|
|
2660
|
+
* `GET /sod-policies` · action `sod_policies.list`
|
|
2661
|
+
* @scope `governance:read`
|
|
2662
|
+
* @danger read
|
|
2663
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2664
|
+
*/
|
|
2665
|
+
list: (query, options) => this.transport.call(environmentOperations["sod_policies.list"], [], query, options),
|
|
2666
|
+
/** Every item of `sod_policies.list`, fetching pages as the iteration reaches them. */
|
|
2667
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["sod_policies.list"], [], query, options),
|
|
2668
|
+
status: {
|
|
2669
|
+
/**
|
|
2670
|
+
* Enforce a role-conflict rule, or stop enforcing it — switched off, grants that break it are allowed again.
|
|
2671
|
+
*
|
|
2672
|
+
* Requires scope `governance:write`. Danger: critical.
|
|
2673
|
+
*
|
|
2674
|
+
* `POST /sod-policies/{id}/status` · action `sod_policies.status.set`
|
|
2675
|
+
* @scope `governance:write`
|
|
2676
|
+
* @danger critical
|
|
2677
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2678
|
+
*/
|
|
2679
|
+
set: (id, body, options) => this.transport.call(environmentOperations["sod_policies.status.set"], [id], body, options)
|
|
2680
|
+
}
|
|
2681
|
+
};
|
|
2682
|
+
sso = {
|
|
2683
|
+
connections: {
|
|
2684
|
+
/**
|
|
2685
|
+
* Activate an SSO connection: people whose email domain routes to it start signing in through it.
|
|
2686
|
+
*
|
|
2687
|
+
* Requires scope `sso:write`. Danger: critical.
|
|
2688
|
+
*
|
|
2689
|
+
* `POST /sso/connections/{id}/activate` · action `sso.connections.activate`
|
|
2690
|
+
* @scope `sso:write`
|
|
2691
|
+
* @danger critical
|
|
2692
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2693
|
+
*/
|
|
2694
|
+
activate: (id, body, options) => this.transport.call(environmentOperations["sso.connections.activate"], [id], body, options),
|
|
2695
|
+
/**
|
|
2696
|
+
* Connect an organization's SAML or OIDC identity provider as a draft. Activate it to start signing people in through it.
|
|
2697
|
+
*
|
|
2698
|
+
* Requires scope `sso:write`. Danger: write.
|
|
2699
|
+
*
|
|
2700
|
+
* `POST /sso/connections` · action `sso.connections.create`
|
|
2701
|
+
* @scope `sso:write`
|
|
2702
|
+
* @danger write
|
|
2703
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2704
|
+
*/
|
|
2705
|
+
create: (body, options) => this.transport.call(environmentOperations["sso.connections.create"], [], body, options),
|
|
2706
|
+
/**
|
|
2707
|
+
* Delete an SSO connection and its settings. Where SSO is required, its people cannot sign in until another is activated.
|
|
2708
|
+
*
|
|
2709
|
+
* Requires scope `sso:write`. Danger: critical.
|
|
2710
|
+
*
|
|
2711
|
+
* `DELETE /sso/connections/{id}` · action `sso.connections.delete`
|
|
2712
|
+
* @scope `sso:write`
|
|
2713
|
+
* @danger critical
|
|
2714
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2715
|
+
*/
|
|
2716
|
+
delete: (id, body, options) => this.transport.call(environmentOperations["sso.connections.delete"], [id], body, options),
|
|
2717
|
+
/**
|
|
2718
|
+
* Disable an SSO connection without deleting it. Where SSO is required, its people cannot sign in until it is re-activated.
|
|
2719
|
+
*
|
|
2720
|
+
* Requires scope `sso:write`. Danger: critical.
|
|
2721
|
+
*
|
|
2722
|
+
* `POST /sso/connections/{id}/disable` · action `sso.connections.disable`
|
|
2723
|
+
* @scope `sso:write`
|
|
2724
|
+
* @danger critical
|
|
2725
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2726
|
+
*/
|
|
2727
|
+
disable: (id, body, options) => this.transport.call(environmentOperations["sso.connections.disable"], [id], body, options),
|
|
2728
|
+
/**
|
|
2729
|
+
* Read one SSO connection: its type, status, entity ids, URLs, issuer and client id. Never a certificate or secret.
|
|
2730
|
+
*
|
|
2731
|
+
* Requires scope `sso:read`. Danger: read.
|
|
2732
|
+
*
|
|
2733
|
+
* `GET /sso/connections/{id}` · action `sso.connections.get`
|
|
2734
|
+
* @scope `sso:read`
|
|
2735
|
+
* @danger read
|
|
2736
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2737
|
+
*/
|
|
2738
|
+
get: (id, query, options) => this.transport.call(environmentOperations["sso.connections.get"], [id], query, options),
|
|
2739
|
+
/**
|
|
2740
|
+
* List the SAML and OIDC connections organizations sign in through, optionally for one organization. Never a certificate or secret.
|
|
2741
|
+
*
|
|
2742
|
+
* Requires scope `sso:read`. Danger: read.
|
|
2743
|
+
*
|
|
2744
|
+
* `GET /sso/connections` · action `sso.connections.list`
|
|
2745
|
+
* @scope `sso:read`
|
|
2746
|
+
* @danger read
|
|
2747
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2748
|
+
*/
|
|
2749
|
+
list: (query, options) => this.transport.call(environmentOperations["sso.connections.list"], [], query, options),
|
|
2750
|
+
/** Every item of `sso.connections.list`, fetching pages as the iteration reaches them. */
|
|
2751
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["sso.connections.list"], [], query, options),
|
|
2752
|
+
/**
|
|
2753
|
+
* Require single sign-on for the organization an SSO connection belongs to. Ends every password session there.
|
|
2754
|
+
*
|
|
2755
|
+
* Requires scope `sso:write`. Danger: critical.
|
|
2756
|
+
*
|
|
2757
|
+
* `POST /sso/connections/{id}/require-sso` · action `sso.connections.require_sso`
|
|
2758
|
+
* @scope `sso:write`
|
|
2759
|
+
* @danger critical
|
|
2760
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2761
|
+
*/
|
|
2762
|
+
requireSso: (id, body, options) => this.transport.call(environmentOperations["sso.connections.require_sso"], [id], body, options),
|
|
2763
|
+
/**
|
|
2764
|
+
* Change an SSO connection's name or identity-provider settings. Secrets left out keep the ones on file.
|
|
2765
|
+
*
|
|
2766
|
+
* Requires scope `sso:write`. Danger: critical.
|
|
2767
|
+
*
|
|
2768
|
+
* `PATCH /sso/connections/{id}` · action `sso.connections.update`
|
|
2769
|
+
* @scope `sso:write`
|
|
2770
|
+
* @danger critical
|
|
2771
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2772
|
+
*/
|
|
2773
|
+
update: (id, body, options) => this.transport.call(environmentOperations["sso.connections.update"], [id], body, options),
|
|
2774
|
+
certificates: {
|
|
2775
|
+
/**
|
|
2776
|
+
* Make a staged SAML signing certificate the connection's primary. The certificate it replaces stops being trusted.
|
|
2777
|
+
*
|
|
2778
|
+
* Requires scope `sso:write`. Danger: critical.
|
|
2779
|
+
*
|
|
2780
|
+
* `POST /sso/connections/{id}/certificates/activate` · action `sso.connections.certificates.activate`
|
|
2781
|
+
* @scope `sso:write`
|
|
2782
|
+
* @danger critical
|
|
2783
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2784
|
+
*/
|
|
2785
|
+
activate: (id, body, options) => this.transport.call(environmentOperations["sso.connections.certificates.activate"], [id], body, options),
|
|
2786
|
+
/**
|
|
2787
|
+
* List a SAML connection's signing certificates — primary and staged — with each one's fingerprint and expiry.
|
|
2788
|
+
*
|
|
2789
|
+
* Requires scope `sso:read`. Danger: read.
|
|
2790
|
+
*
|
|
2791
|
+
* `GET /sso/connections/{id}/certificates` · action `sso.connections.certificates.list`
|
|
2792
|
+
* @scope `sso:read`
|
|
2793
|
+
* @danger read
|
|
2794
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2795
|
+
*/
|
|
2796
|
+
list: (id, query, options) => this.transport.call(environmentOperations["sso.connections.certificates.list"], [id], query, options),
|
|
2797
|
+
/**
|
|
2798
|
+
* Stage a SAML connection's new IdP signing certificate (PEM or IdP metadata) beside the current one, so a renewal has no outage. Activate it once the IdP signs with it.
|
|
2799
|
+
*
|
|
2800
|
+
* Requires scope `sso:write`. Danger: critical.
|
|
2801
|
+
*
|
|
2802
|
+
* `POST /sso/connections/{id}/certificates` · action `sso.connections.certificates.stage`
|
|
2803
|
+
* @scope `sso:write`
|
|
2804
|
+
* @danger critical
|
|
2805
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2806
|
+
*/
|
|
2807
|
+
stage: (id, body, options) => this.transport.call(environmentOperations["sso.connections.certificates.stage"], [id], body, options)
|
|
2808
|
+
}
|
|
2809
|
+
},
|
|
2810
|
+
domains: {
|
|
2811
|
+
/**
|
|
2812
|
+
* Turn capture on or off for a verified domain: captured, everyone with an address at it must sign in through the organization's SSO.
|
|
2813
|
+
*
|
|
2814
|
+
* Requires scope `sso:write`. Danger: critical.
|
|
2815
|
+
*
|
|
2816
|
+
* `POST /sso/domains/{id}/capture` · action `sso.domains.capture`
|
|
2817
|
+
* @scope `sso:write`
|
|
2818
|
+
* @danger critical
|
|
2819
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2820
|
+
*/
|
|
2821
|
+
capture: (id, body, options) => this.transport.call(environmentOperations["sso.domains.capture"], [id], body, options),
|
|
2822
|
+
/**
|
|
2823
|
+
* Claim an email domain for an organization's single sign-on, and get the DNS TXT record to publish to prove it.
|
|
2824
|
+
*
|
|
2825
|
+
* Requires scope `sso:write`. Danger: write.
|
|
2826
|
+
*
|
|
2827
|
+
* `POST /sso/domains` · action `sso.domains.create`
|
|
2828
|
+
* @scope `sso:write`
|
|
2829
|
+
* @danger write
|
|
2830
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2831
|
+
*/
|
|
2832
|
+
create: (body, options) => this.transport.call(environmentOperations["sso.domains.create"], [], body, options),
|
|
2833
|
+
/**
|
|
2834
|
+
* Remove a claimed email domain. Its people stop being routed to the organization's SSO connection.
|
|
2835
|
+
*
|
|
2836
|
+
* Requires scope `sso:write`. Danger: destructive.
|
|
2837
|
+
*
|
|
2838
|
+
* `DELETE /sso/domains/{id}` · action `sso.domains.delete`
|
|
2839
|
+
* @scope `sso:write`
|
|
2840
|
+
* @danger destructive
|
|
2841
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2842
|
+
*/
|
|
2843
|
+
delete: (id, body, options) => this.transport.call(environmentOperations["sso.domains.delete"], [id], body, options),
|
|
2844
|
+
/**
|
|
2845
|
+
* List the email domains organizations claimed for single sign-on, whether each is verified and captured, and the DNS record that proves an unverified one.
|
|
2846
|
+
*
|
|
2847
|
+
* Requires scope `sso:read`. Danger: read.
|
|
2848
|
+
*
|
|
2849
|
+
* `GET /sso/domains` · action `sso.domains.list`
|
|
2850
|
+
* @scope `sso:read`
|
|
2851
|
+
* @danger read
|
|
2852
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2853
|
+
*/
|
|
2854
|
+
list: (query, options) => this.transport.call(environmentOperations["sso.domains.list"], [], query, options),
|
|
2855
|
+
/** Every item of `sso.domains.list`, fetching pages as the iteration reaches them. */
|
|
2856
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["sso.domains.list"], [], query, options),
|
|
2857
|
+
/**
|
|
2858
|
+
* Check a claimed domain's DNS TXT record now. Answers the domain, with verified true once the record is found.
|
|
2859
|
+
*
|
|
2860
|
+
* Requires scope `sso:write`. Danger: write.
|
|
2861
|
+
*
|
|
2862
|
+
* `POST /sso/domains/{id}/verify` · action `sso.domains.verify`
|
|
2863
|
+
* @scope `sso:write`
|
|
2864
|
+
* @danger write
|
|
2865
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2866
|
+
*/
|
|
2867
|
+
verify: (id, body, options) => this.transport.call(environmentOperations["sso.domains.verify"], [id], body, options)
|
|
2868
|
+
},
|
|
2869
|
+
samlMetadata: {
|
|
2870
|
+
/**
|
|
2871
|
+
* Parse an identity provider's SAML metadata (XML or a metadata URL) into the entity id, SSO URL and certificate a SAML connection needs. Stores nothing.
|
|
2872
|
+
*
|
|
2873
|
+
* Requires scope `sso:write`. Danger: write.
|
|
2874
|
+
*
|
|
2875
|
+
* `POST /sso/saml-metadata` · action `sso.saml_metadata.import`
|
|
2876
|
+
* @scope `sso:write`
|
|
2877
|
+
* @danger write
|
|
2878
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2879
|
+
*/
|
|
2880
|
+
import: (body, options) => this.transport.call(environmentOperations["sso.saml_metadata.import"], [], body, options)
|
|
2881
|
+
}
|
|
2882
|
+
};
|
|
2883
|
+
supportSessions = {
|
|
2884
|
+
/**
|
|
2885
|
+
* End a support session now: every token it issued is revoked.
|
|
2886
|
+
*
|
|
2887
|
+
* Requires scope `support:write`. Danger: destructive.
|
|
2888
|
+
*
|
|
2889
|
+
* `DELETE /support-sessions/{id}` · action `support_sessions.end`
|
|
2890
|
+
* @scope `support:write`
|
|
2891
|
+
* @danger destructive
|
|
2892
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2893
|
+
*/
|
|
2894
|
+
end: (id, options) => this.transport.call(environmentOperations["support_sessions.end"], [id], void 0, options),
|
|
2895
|
+
/**
|
|
2896
|
+
* Start a support session
|
|
2897
|
+
*
|
|
2898
|
+
* Requires scope `support:write`. A member of your staff (`actor_user_id`) signs in to
|
|
2899
|
+
* one of your apps (`client_id`) AS one of a customer's users (`user_id` in
|
|
2900
|
+
* `organization_id`), for a stated `reason`, for at most 60 minutes.
|
|
2901
|
+
*
|
|
2902
|
+
* The actor must hold your app's own `support:impersonate` permission through an
|
|
2903
|
+
* **environment-wide** grant (see `PUT /users/{id}/environment-roles/{role_id}`);
|
|
2904
|
+
* otherwise `403 not_permitted`. The app must be a first-party app the environment
|
|
2905
|
+
* owns that uses the authorization-code grant (`422 client_not_eligible`). The target
|
|
2906
|
+
* must be an active member (`422 target_not_member`) of an active organization
|
|
2907
|
+
* (`409 organization_inactive`).
|
|
2908
|
+
*
|
|
2909
|
+
* Send `redirect_uri` (registered for the app) and a PKCE S256 `code_challenge` to get
|
|
2910
|
+
* the first authorization `code` in the response. Your app redeems it at `/oauth/token`
|
|
2911
|
+
* with the verifier; every token carries `act: {"sub": actor_user_id}` and there is
|
|
2912
|
+
* never a refresh token. The session is audited on the customer's trail and the
|
|
2913
|
+
* environment's, and announced as the `support_session.started` webhook.
|
|
2914
|
+
*
|
|
2915
|
+
* `scopes` in the response are exactly what every token of the session carries: the
|
|
2916
|
+
* ones asked for (or, with none, the app's registration), never `offline_access`, and
|
|
2917
|
+
* audienced the way the token endpoint audiences them — once any of them belongs to a
|
|
2918
|
+
* registered API, the token is for that API and a scope no API registered (such as
|
|
2919
|
+
* `apps.manifest`) is left out. Scopes of two registered APIs cannot be audienced to
|
|
2920
|
+
* one token and are refused before the session starts (`422 invalid_target`).
|
|
2921
|
+
*
|
|
2922
|
+
* `POST /support-sessions` · action `support_sessions.start`
|
|
2923
|
+
* @scope `support:write`
|
|
2924
|
+
* @danger critical
|
|
2925
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2926
|
+
*/
|
|
2927
|
+
start: (body, options) => this.transport.call(environmentOperations["support_sessions.start"], [], body, options)
|
|
2928
|
+
};
|
|
2929
|
+
tokenVault = {
|
|
2930
|
+
grants: {
|
|
2931
|
+
/**
|
|
2932
|
+
* Grant an app (by OAuth client id) the right to lease a stored credential.
|
|
2933
|
+
*
|
|
2934
|
+
* Requires scope `token_vault:write`. Danger: critical.
|
|
2935
|
+
*
|
|
2936
|
+
* `POST /token-vault/secrets/{id}/grants` · action `token_vault.grants.create`
|
|
2937
|
+
* @scope `token_vault:write`
|
|
2938
|
+
* @danger critical
|
|
2939
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2940
|
+
*/
|
|
2941
|
+
create: (id, body, options) => this.transport.call(environmentOperations["token_vault.grants.create"], [id], body, options),
|
|
2942
|
+
/**
|
|
2943
|
+
* Withdraw an app's right to lease a stored credential.
|
|
2944
|
+
*
|
|
2945
|
+
* Requires scope `token_vault:write`. Danger: destructive.
|
|
2946
|
+
*
|
|
2947
|
+
* `DELETE /token-vault/secrets/{id}/grants/{client_id}` · action `token_vault.grants.delete`
|
|
2948
|
+
* @scope `token_vault:write`
|
|
2949
|
+
* @danger destructive
|
|
2950
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2951
|
+
*/
|
|
2952
|
+
delete: (id, clientId, body, options) => this.transport.call(environmentOperations["token_vault.grants.delete"], [id, clientId], body, options)
|
|
2953
|
+
},
|
|
2954
|
+
secrets: {
|
|
2955
|
+
/**
|
|
2956
|
+
* Store a downstream credential (a third-party API key) in an organization's token vault, or the environment's own. The value is sealed and never returned.
|
|
2957
|
+
*
|
|
2958
|
+
* Requires scope `token_vault:write`. Danger: write.
|
|
2959
|
+
*
|
|
2960
|
+
* `POST /token-vault/secrets` · action `token_vault.secrets.create`
|
|
2961
|
+
* @scope `token_vault:write`
|
|
2962
|
+
* @danger write
|
|
2963
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2964
|
+
*/
|
|
2965
|
+
create: (body, options) => this.transport.call(environmentOperations["token_vault.secrets.create"], [], body, options),
|
|
2966
|
+
/**
|
|
2967
|
+
* Read one stored credential and the client ids granted to lease it. Never its value.
|
|
2968
|
+
*
|
|
2969
|
+
* Requires scope `token_vault:read`. Danger: read.
|
|
2970
|
+
*
|
|
2971
|
+
* `GET /token-vault/secrets/{id}` · action `token_vault.secrets.get`
|
|
2972
|
+
* @scope `token_vault:read`
|
|
2973
|
+
* @danger read
|
|
2974
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2975
|
+
*/
|
|
2976
|
+
get: (id, query, options) => this.transport.call(environmentOperations["token_vault.secrets.get"], [id], query, options),
|
|
2977
|
+
/**
|
|
2978
|
+
* List the downstream credentials stored in an organization's token vault (or the environment's own): names, providers, status. Never a value.
|
|
2979
|
+
*
|
|
2980
|
+
* Requires scope `token_vault:read`. Danger: read.
|
|
2981
|
+
*
|
|
2982
|
+
* `GET /token-vault/secrets` · action `token_vault.secrets.list`
|
|
2983
|
+
* @scope `token_vault:read`
|
|
2984
|
+
* @danger read
|
|
2985
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2986
|
+
*/
|
|
2987
|
+
list: (query, options) => this.transport.call(environmentOperations["token_vault.secrets.list"], [], query, options),
|
|
2988
|
+
/** Every item of `token_vault.secrets.list`, fetching pages as the iteration reaches them. */
|
|
2989
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["token_vault.secrets.list"], [], query, options),
|
|
2990
|
+
/**
|
|
2991
|
+
* Revoke a stored credential permanently. No app can lease it again.
|
|
2992
|
+
*
|
|
2993
|
+
* Requires scope `token_vault:write`. Danger: destructive.
|
|
2994
|
+
*
|
|
2995
|
+
* `POST /token-vault/secrets/{id}/revoke` · action `token_vault.secrets.revoke`
|
|
2996
|
+
* @scope `token_vault:write`
|
|
2997
|
+
* @danger destructive
|
|
2998
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
2999
|
+
*/
|
|
3000
|
+
revoke: (id, body, options) => this.transport.call(environmentOperations["token_vault.secrets.revoke"], [id], body, options),
|
|
3001
|
+
/**
|
|
3002
|
+
* Replace a stored credential's value. Every later lease hands out the new one. The value is never returned.
|
|
3003
|
+
*
|
|
3004
|
+
* Requires scope `token_vault:write`. Danger: critical.
|
|
3005
|
+
*
|
|
3006
|
+
* `POST /token-vault/secrets/{id}/rotate` · action `token_vault.secrets.rotate`
|
|
3007
|
+
* @scope `token_vault:write`
|
|
3008
|
+
* @danger critical
|
|
3009
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3010
|
+
*/
|
|
3011
|
+
rotate: (id, body, options) => this.transport.call(environmentOperations["token_vault.secrets.rotate"], [id], body, options)
|
|
3012
|
+
}
|
|
3013
|
+
};
|
|
3014
|
+
users = {
|
|
3015
|
+
/**
|
|
3016
|
+
* Create a user
|
|
3017
|
+
*
|
|
3018
|
+
* Requires scope `users:write`. Password is optional — omit it to create a passwordless identity the user completes via an invite/magic-link.
|
|
3019
|
+
*
|
|
3020
|
+
* `POST /users` · action `users.create`
|
|
3021
|
+
* @scope `users:write`
|
|
3022
|
+
* @danger write
|
|
3023
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3024
|
+
*/
|
|
3025
|
+
create: (body, options) => this.transport.call(environmentOperations["users.create"], [], body, options),
|
|
3026
|
+
/**
|
|
3027
|
+
* Deactivate a user
|
|
3028
|
+
*
|
|
3029
|
+
* Requires scope `users:write`. A **soft disable** — the identity can no longer
|
|
3030
|
+
* authenticate, but is never hard-deleted — and every OAuth grant they hold is
|
|
3031
|
+
* revoked, which reactivating them does not bring back. Returns the user in its new
|
|
3032
|
+
* `disabled` state. Idempotent. The console's "Deactivate" is this action.
|
|
3033
|
+
*
|
|
3034
|
+
* `DELETE /users/{id}` · action `users.deactivate`
|
|
3035
|
+
* @scope `users:write`
|
|
3036
|
+
* @danger destructive
|
|
3037
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3038
|
+
*/
|
|
3039
|
+
deactivate: (id, options) => this.transport.call(environmentOperations["users.deactivate"], [id], void 0, options),
|
|
3040
|
+
/**
|
|
3041
|
+
* Erase a person (GDPR Art. 17): revoke their sessions and tokens, delete their credentials, memberships and personal data, and pseudonymise their account. Cannot be undone.
|
|
3042
|
+
*
|
|
3043
|
+
* Requires scope `users:erase`. Danger: critical.
|
|
3044
|
+
*
|
|
3045
|
+
* `POST /users/{id}/erase` · action `users.erase`
|
|
3046
|
+
* @scope `users:erase`
|
|
3047
|
+
* @danger critical
|
|
3048
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3049
|
+
*/
|
|
3050
|
+
erase: (id, options) => this.transport.call(environmentOperations["users.erase"], [id], void 0, options),
|
|
3051
|
+
/**
|
|
3052
|
+
* Get a user
|
|
3053
|
+
*
|
|
3054
|
+
* Requires scope `users:read`.
|
|
3055
|
+
*
|
|
3056
|
+
* `GET /users/{id}` · action `users.get`
|
|
3057
|
+
* @scope `users:read`
|
|
3058
|
+
* @danger read
|
|
3059
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3060
|
+
*/
|
|
3061
|
+
get: (id, options) => this.transport.call(environmentOperations["users.get"], [id], void 0, options),
|
|
3062
|
+
/**
|
|
3063
|
+
* List users
|
|
3064
|
+
*
|
|
3065
|
+
* Requires scope `users:read`. A page at a time, in id order. Narrow it the ways you
|
|
3066
|
+
* look for somebody: `email` (exactly that address, case-insensitive), `q` (a fragment
|
|
3067
|
+
* of the address or the name) and `status`. Filters combine.
|
|
3068
|
+
*
|
|
3069
|
+
* `GET /users` · action `users.list`
|
|
3070
|
+
* @scope `users:read`
|
|
3071
|
+
* @danger read
|
|
3072
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3073
|
+
*/
|
|
3074
|
+
list: (query, options) => this.transport.call(environmentOperations["users.list"], [], query, options),
|
|
3075
|
+
/** Every item of `users.list`, fetching pages as the iteration reaches them. */
|
|
3076
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["users.list"], [], query, options),
|
|
3077
|
+
/**
|
|
3078
|
+
* Reactivate a deactivated user so they can sign in again. Grants revoked on deactivation stay revoked.
|
|
3079
|
+
*
|
|
3080
|
+
* Requires scope `users:write`. Danger: write.
|
|
3081
|
+
*
|
|
3082
|
+
* `POST /users/{id}/reactivate` · action `users.reactivate`
|
|
3083
|
+
* @scope `users:write`
|
|
3084
|
+
* @danger write
|
|
3085
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3086
|
+
*/
|
|
3087
|
+
reactivate: (id, options) => this.transport.call(environmentOperations["users.reactivate"], [id], void 0, options),
|
|
3088
|
+
/**
|
|
3089
|
+
* Change a user's name and/or email address. A changed address must be verified again.
|
|
3090
|
+
*
|
|
3091
|
+
* Requires scope `users:write`. Danger: critical.
|
|
3092
|
+
*
|
|
3093
|
+
* `PATCH /users/{id}` · action `users.update`
|
|
3094
|
+
* @scope `users:write`
|
|
3095
|
+
* @danger critical
|
|
3096
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3097
|
+
*/
|
|
3098
|
+
update: (id, body, options) => this.transport.call(environmentOperations["users.update"], [id], body, options),
|
|
3099
|
+
/**
|
|
3100
|
+
* Mark a user's email address verified without the emailed link. It can then be used to recover the account.
|
|
3101
|
+
*
|
|
3102
|
+
* Requires scope `users:write`. Danger: critical.
|
|
3103
|
+
*
|
|
3104
|
+
* `POST /users/{id}/verify` · action `users.verify`
|
|
3105
|
+
* @scope `users:write`
|
|
3106
|
+
* @danger critical
|
|
3107
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3108
|
+
*/
|
|
3109
|
+
verify: (id, options) => this.transport.call(environmentOperations["users.verify"], [id], void 0, options),
|
|
3110
|
+
environmentRoles: {
|
|
3111
|
+
/**
|
|
3112
|
+
* Whether a user holds a role everywhere
|
|
3113
|
+
*
|
|
3114
|
+
* Requires scope `roles:read`. `200` with the grant, or `404` when it is not held.
|
|
3115
|
+
*
|
|
3116
|
+
* `GET /users/{id}/environment-roles/{role_id}` · action `users.environment_roles.get`
|
|
3117
|
+
* @scope `roles:read`
|
|
3118
|
+
* @danger read
|
|
3119
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3120
|
+
*/
|
|
3121
|
+
get: (id, roleId, query, options) => this.transport.call(environmentOperations["users.environment_roles.get"], [id, roleId], query, options),
|
|
3122
|
+
/**
|
|
3123
|
+
* Grant a role everywhere in the environment (staff)
|
|
3124
|
+
*
|
|
3125
|
+
* Requires scope `roles:write`. Idempotent. For your own people who act across every
|
|
3126
|
+
* customer. Any role that belongs to no organization may be granted this way: an
|
|
3127
|
+
* app-agnostic one reaches every app's tokens, one your app declared reaches only
|
|
3128
|
+
* your app's. An organization's own role is refused with `422 role_not_assignable`; a
|
|
3129
|
+
* grant that would form a segregation-of-duties conflict in any organization the
|
|
3130
|
+
* person belongs to with `409 role_conflict`.
|
|
3131
|
+
*
|
|
3132
|
+
* `PUT /users/{id}/environment-roles/{role_id}` · action `users.environment_roles.grant`
|
|
3133
|
+
* @scope `roles:write`
|
|
3134
|
+
* @danger critical
|
|
3135
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3136
|
+
*/
|
|
3137
|
+
grant: (id, roleId, query, options) => this.transport.call(environmentOperations["users.environment_roles.grant"], [id, roleId], query, options),
|
|
3138
|
+
/**
|
|
3139
|
+
* List the roles a user holds everywhere (staff)
|
|
3140
|
+
*
|
|
3141
|
+
* Requires scope `roles:read`.
|
|
3142
|
+
*
|
|
3143
|
+
* `GET /users/{id}/environment-roles` · action `users.environment_roles.list`
|
|
3144
|
+
* @scope `roles:read`
|
|
3145
|
+
* @danger read
|
|
3146
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3147
|
+
*/
|
|
3148
|
+
list: (id, options) => this.transport.call(environmentOperations["users.environment_roles.list"], [id], void 0, options),
|
|
3149
|
+
/**
|
|
3150
|
+
* Take back an environment-wide grant
|
|
3151
|
+
*
|
|
3152
|
+
* Requires scope `roles:write`. Idempotent.
|
|
3153
|
+
*
|
|
3154
|
+
* `DELETE /users/{id}/environment-roles/{role_id}` · action `users.environment_roles.revoke`
|
|
3155
|
+
* @scope `roles:write`
|
|
3156
|
+
* @danger destructive
|
|
3157
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3158
|
+
*/
|
|
3159
|
+
revoke: (id, roleId, query, options) => this.transport.call(environmentOperations["users.environment_roles.revoke"], [id, roleId], query, options)
|
|
3160
|
+
},
|
|
3161
|
+
mfa: {
|
|
3162
|
+
/**
|
|
3163
|
+
* Reset a user's two-factor authentication: their authenticator and recovery codes are removed and they must enrol again.
|
|
3164
|
+
*
|
|
3165
|
+
* Requires scope `users:write`. Danger: critical.
|
|
3166
|
+
*
|
|
3167
|
+
* `DELETE /users/{id}/mfa` · action `users.mfa.reset`
|
|
3168
|
+
* @scope `users:write`
|
|
3169
|
+
* @danger critical
|
|
3170
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3171
|
+
*/
|
|
3172
|
+
reset: (id, options) => this.transport.call(environmentOperations["users.mfa.reset"], [id], void 0, options)
|
|
3173
|
+
},
|
|
3174
|
+
passwordReset: {
|
|
3175
|
+
/**
|
|
3176
|
+
* Mail a user a password-reset link at their own address.
|
|
3177
|
+
*
|
|
3178
|
+
* Requires scope `users:write`. Danger: write.
|
|
3179
|
+
*
|
|
3180
|
+
* `POST /users/{id}/password-reset` · action `users.password_reset.send`
|
|
3181
|
+
* @scope `users:write`
|
|
3182
|
+
* @danger write
|
|
3183
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3184
|
+
*/
|
|
3185
|
+
send: (id, options) => this.transport.call(environmentOperations["users.password_reset.send"], [id], void 0, options)
|
|
3186
|
+
},
|
|
3187
|
+
password: {
|
|
3188
|
+
/**
|
|
3189
|
+
* Set a user's password, temporary by default, and mail it to them unless told not to. Signs them out according to `revoke`.
|
|
3190
|
+
*
|
|
3191
|
+
* Requires scope `users:write`. Danger: critical.
|
|
3192
|
+
*
|
|
3193
|
+
* `POST /users/{id}/password` · action `users.password.set`
|
|
3194
|
+
* @scope `users:write`
|
|
3195
|
+
* @danger critical
|
|
3196
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3197
|
+
*/
|
|
3198
|
+
set: (id, body, options) => this.transport.call(environmentOperations["users.password.set"], [id], body, options)
|
|
3199
|
+
},
|
|
3200
|
+
sessions: {
|
|
3201
|
+
/**
|
|
3202
|
+
* List a user's live sign-in sessions
|
|
3203
|
+
*
|
|
3204
|
+
* Requires scope `users:read`. The fifty most recently active, newest first — enough to
|
|
3205
|
+
* recognise a device and end one (`DELETE /users/{id}/sessions/{session_id}`), not a log.
|
|
3206
|
+
* `impersonation` marks a session somebody else opened as this person.
|
|
3207
|
+
*
|
|
3208
|
+
* `GET /users/{id}/sessions` · action `users.sessions.list`
|
|
3209
|
+
* @scope `users:read`
|
|
3210
|
+
* @danger read
|
|
3211
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3212
|
+
*/
|
|
3213
|
+
list: (id, options) => this.transport.call(environmentOperations["users.sessions.list"], [id], void 0, options),
|
|
3214
|
+
/**
|
|
3215
|
+
* End one of a user's sign-in sessions.
|
|
3216
|
+
*
|
|
3217
|
+
* Requires scope `users:write`. Danger: destructive.
|
|
3218
|
+
*
|
|
3219
|
+
* `DELETE /users/{id}/sessions/{session_id}` · action `users.sessions.revoke`
|
|
3220
|
+
* @scope `users:write`
|
|
3221
|
+
* @danger destructive
|
|
3222
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3223
|
+
*/
|
|
3224
|
+
revoke: (id, sessionId, options) => this.transport.call(environmentOperations["users.sessions.revoke"], [id, sessionId], void 0, options),
|
|
3225
|
+
/**
|
|
3226
|
+
* Sign a user out everywhere: end every session and revoke every OAuth grant they hold.
|
|
3227
|
+
*
|
|
3228
|
+
* Requires scope `users:write`. Danger: destructive.
|
|
3229
|
+
*
|
|
3230
|
+
* `DELETE /users/{id}/sessions` · action `users.sessions.revoke_all`
|
|
3231
|
+
* @scope `users:write`
|
|
3232
|
+
* @danger destructive
|
|
3233
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3234
|
+
*/
|
|
3235
|
+
revokeAll: (id, options) => this.transport.call(environmentOperations["users.sessions.revoke_all"], [id], void 0, options)
|
|
3236
|
+
},
|
|
3237
|
+
verification: {
|
|
3238
|
+
/**
|
|
3239
|
+
* Mail a user the link that verifies their email address. Does nothing for an address already verified.
|
|
3240
|
+
*
|
|
3241
|
+
* Requires scope `users:write`. Danger: write.
|
|
3242
|
+
*
|
|
3243
|
+
* `POST /users/{id}/verification` · action `users.verification.send`
|
|
3244
|
+
* @scope `users:write`
|
|
3245
|
+
* @danger write
|
|
3246
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3247
|
+
*/
|
|
3248
|
+
send: (id, options) => this.transport.call(environmentOperations["users.verification.send"], [id], void 0, options)
|
|
3249
|
+
}
|
|
3250
|
+
};
|
|
3251
|
+
webhooks = {
|
|
3252
|
+
/**
|
|
3253
|
+
* Register a webhook endpoint for one organization or the whole environment. Returns its signing secret once.
|
|
3254
|
+
*
|
|
3255
|
+
* Requires scope `webhooks:write`. Danger: critical.
|
|
3256
|
+
*
|
|
3257
|
+
* `POST /webhooks` · action `webhooks.create`
|
|
3258
|
+
* @scope `webhooks:write`
|
|
3259
|
+
* @danger critical
|
|
3260
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3261
|
+
*/
|
|
3262
|
+
create: (body, options) => this.transport.call(environmentOperations["webhooks.create"], [], body, options),
|
|
3263
|
+
/**
|
|
3264
|
+
* Delete a webhook endpoint. It stops receiving events at once.
|
|
3265
|
+
*
|
|
3266
|
+
* Requires scope `webhooks:write`. Danger: destructive.
|
|
3267
|
+
*
|
|
3268
|
+
* `DELETE /webhooks/{id}` · action `webhooks.delete`
|
|
3269
|
+
* @scope `webhooks:write`
|
|
3270
|
+
* @danger destructive
|
|
3271
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3272
|
+
*/
|
|
3273
|
+
delete: (id, options) => this.transport.call(environmentOperations["webhooks.delete"], [id], void 0, options),
|
|
3274
|
+
/**
|
|
3275
|
+
* Get one webhook endpoint: URL, owner, subscribed events, health. Never its signing secret.
|
|
3276
|
+
*
|
|
3277
|
+
* Requires scope `webhooks:read`. Danger: read.
|
|
3278
|
+
*
|
|
3279
|
+
* `GET /webhooks/{id}` · action `webhooks.get`
|
|
3280
|
+
* @scope `webhooks:read`
|
|
3281
|
+
* @danger read
|
|
3282
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3283
|
+
*/
|
|
3284
|
+
get: (id, options) => this.transport.call(environmentOperations["webhooks.get"], [id], void 0, options),
|
|
3285
|
+
/**
|
|
3286
|
+
* List the webhook endpoints registered in this environment: URL, owner, subscribed events and whether each is active.
|
|
3287
|
+
*
|
|
3288
|
+
* Requires scope `webhooks:read`. Danger: read.
|
|
3289
|
+
*
|
|
3290
|
+
* `GET /webhooks` · action `webhooks.list`
|
|
3291
|
+
* @scope `webhooks:read`
|
|
3292
|
+
* @danger read
|
|
3293
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3294
|
+
*/
|
|
3295
|
+
list: (query, options) => this.transport.call(environmentOperations["webhooks.list"], [], query, options),
|
|
3296
|
+
/** Every item of `webhooks.list`, fetching pages as the iteration reaches them. */
|
|
3297
|
+
listAll: (query, options) => this.transport.paginate(environmentOperations["webhooks.list"], [], query, options),
|
|
3298
|
+
/**
|
|
3299
|
+
* Pause a webhook endpoint: it stops receiving events until resumed.
|
|
3300
|
+
*
|
|
3301
|
+
* Requires scope `webhooks:write`. Danger: write.
|
|
3302
|
+
*
|
|
3303
|
+
* `POST /webhooks/{id}/pause` · action `webhooks.pause`
|
|
3304
|
+
* @scope `webhooks:write`
|
|
3305
|
+
* @danger write
|
|
3306
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3307
|
+
*/
|
|
3308
|
+
pause: (id, options) => this.transport.call(environmentOperations["webhooks.pause"], [id], void 0, options),
|
|
3309
|
+
/**
|
|
3310
|
+
* Resume a paused webhook endpoint: it receives events again.
|
|
3311
|
+
*
|
|
3312
|
+
* Requires scope `webhooks:write`. Danger: write.
|
|
3313
|
+
*
|
|
3314
|
+
* `POST /webhooks/{id}/resume` · action `webhooks.resume`
|
|
3315
|
+
* @scope `webhooks:write`
|
|
3316
|
+
* @danger write
|
|
3317
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3318
|
+
*/
|
|
3319
|
+
resume: (id, options) => this.transport.call(environmentOperations["webhooks.resume"], [id], void 0, options),
|
|
3320
|
+
/**
|
|
3321
|
+
* Change a webhook endpoint's URL and/or the events it subscribes to.
|
|
3322
|
+
*
|
|
3323
|
+
* Requires scope `webhooks:write`. Danger: write.
|
|
3324
|
+
*
|
|
3325
|
+
* `PATCH /webhooks/{id}` · action `webhooks.update`
|
|
3326
|
+
* @scope `webhooks:write`
|
|
3327
|
+
* @danger write
|
|
3328
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3329
|
+
*/
|
|
3330
|
+
update: (id, body, options) => this.transport.call(environmentOperations["webhooks.update"], [id], body, options),
|
|
3331
|
+
secret: {
|
|
3332
|
+
/**
|
|
3333
|
+
* Issue a new signing secret for a webhook endpoint, returned once. The old secret stops verifying immediately.
|
|
3334
|
+
*
|
|
3335
|
+
* Requires scope `webhooks:write`. Danger: critical.
|
|
3336
|
+
*
|
|
3337
|
+
* `POST /webhooks/{id}/rotate` · action `webhooks.secret.rotate`
|
|
3338
|
+
* @scope `webhooks:write`
|
|
3339
|
+
* @danger critical
|
|
3340
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3341
|
+
*/
|
|
3342
|
+
rotate: (id, options) => this.transport.call(environmentOperations["webhooks.secret.rotate"], [id], void 0, options)
|
|
3343
|
+
},
|
|
3344
|
+
signatureScheme: {
|
|
3345
|
+
/**
|
|
3346
|
+
* Change how a webhook endpoint's deliveries are signed (cbox or standard_webhooks). No new secret is issued: a hex secret is used as whsec_ + base64 of itself. Update the receiver first.
|
|
3347
|
+
*
|
|
3348
|
+
* Requires scope `webhooks:write`. Danger: destructive.
|
|
3349
|
+
*
|
|
3350
|
+
* `POST /webhooks/{id}/signature-scheme` · action `webhooks.signature_scheme.change`
|
|
3351
|
+
* @scope `webhooks:write`
|
|
3352
|
+
* @danger destructive
|
|
3353
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3354
|
+
*/
|
|
3355
|
+
change: (id, body, options) => this.transport.call(environmentOperations["webhooks.signature_scheme.change"], [id], body, options)
|
|
3356
|
+
}
|
|
3357
|
+
};
|
|
3358
|
+
};
|
|
3359
|
+
|
|
3360
|
+
// src/management/generated/workspace.ts
|
|
3361
|
+
var workspaceOperations = {
|
|
3362
|
+
"action_approvals.get": { action: null, operationId: null, method: "GET", path: "/workspace/action-approvals/{id}", pathParams: ["id"], scope: null, danger: null, approval: false, body: false, pagination: null },
|
|
3363
|
+
"environments.create": { action: "environments.create", operationId: "environments_create", method: "POST", path: "/workspace/environments", pathParams: [], scope: "environments:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
3364
|
+
"environments.domain.remove": { action: "environments.domain.remove", operationId: "environments_domain_remove", method: "DELETE", path: "/workspace/environments/{environment_id}/domain", pathParams: ["environment_id"], scope: "environments:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
3365
|
+
"environments.domain.request": { action: "environments.domain.request", operationId: "environments_domain_request", method: "POST", path: "/workspace/environments/{environment_id}/domain", pathParams: ["environment_id"], scope: "environments:write", danger: "write", approval: true, body: true, pagination: null },
|
|
3366
|
+
"environments.domain.verify": { action: "environments.domain.verify", operationId: "environments_domain_verify", method: "POST", path: "/workspace/environments/{environment_id}/domain/verify", pathParams: ["environment_id"], scope: "environments:write", danger: "write", approval: true, body: false, pagination: null },
|
|
3367
|
+
"environments.list": { action: "environments.list", operationId: "environments_list", method: "GET", path: "/workspace/environments", pathParams: [], scope: "workspace:read", danger: "read", approval: true, body: false, pagination: "page" },
|
|
3368
|
+
"keys.environment.create": { action: "keys.environment.create", operationId: "keys_environment_create", method: "POST", path: "/workspace/environments/{environment_id}/keys", pathParams: ["environment_id"], scope: "keys:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
3369
|
+
"keys.environment.revoke": { action: "keys.environment.revoke", operationId: "keys_environment_revoke", method: "DELETE", path: "/workspace/environments/{environment_id}/keys/{id}", pathParams: ["environment_id", "id"], scope: "keys:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
3370
|
+
"keys.workspace.create": { action: "keys.workspace.create", operationId: "keys_workspace_create", method: "POST", path: "/workspace/keys", pathParams: [], scope: "keys:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
3371
|
+
"keys.workspace.list": { action: "keys.workspace.list", operationId: "keys_workspace_list", method: "GET", path: "/workspace/keys", pathParams: [], scope: "workspace:read", danger: "read", approval: true, body: false, pagination: "page" },
|
|
3372
|
+
"keys.workspace.revoke": { action: "keys.workspace.revoke", operationId: "keys_workspace_revoke", method: "DELETE", path: "/workspace/keys/{id}", pathParams: ["id"], scope: "keys:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
3373
|
+
"projects.create": { action: "projects.create", operationId: "projects_create", method: "POST", path: "/workspace/projects", pathParams: [], scope: "projects:write", danger: "write", approval: true, body: true, pagination: null },
|
|
3374
|
+
"projects.list": { action: "projects.list", operationId: "projects_list", method: "GET", path: "/workspace/projects", pathParams: [], scope: "workspace:read", danger: "read", approval: true, body: false, pagination: null },
|
|
3375
|
+
"projects.reactivate": { action: "projects.reactivate", operationId: "projects_reactivate", method: "POST", path: "/workspace/projects/{id}/reactivate", pathParams: ["id"], scope: "projects:write", danger: "write", approval: true, body: false, pagination: null },
|
|
3376
|
+
"projects.rename": { action: "projects.rename", operationId: "projects_rename", method: "PATCH", path: "/workspace/projects/{id}", pathParams: ["id"], scope: "projects:write", danger: "write", approval: true, body: true, pagination: null },
|
|
3377
|
+
"projects.suspend": { action: "projects.suspend", operationId: "projects_suspend", method: "POST", path: "/workspace/projects/{id}/suspend", pathParams: ["id"], scope: "projects:write", danger: "write", approval: true, body: false, pagination: null },
|
|
3378
|
+
"projects.verification.resend": { action: "projects.verification.resend", operationId: "projects_verification_resend", method: "POST", path: "/workspace/projects/verification/resend", pathParams: [], scope: "projects:write", danger: "write", approval: true, body: false, pagination: null },
|
|
3379
|
+
"team.environment_access": { action: "team.environment_access", operationId: "team_environment_access", method: "PUT", path: "/workspace/members/{id}/access", pathParams: ["id"], scope: "team:write", danger: "write", approval: true, body: true, pagination: null },
|
|
3380
|
+
"team.invitations.list": { action: "team.invitations.list", operationId: "team_invitations_list", method: "GET", path: "/workspace/invitations", pathParams: [], scope: "team:read", danger: "read", approval: true, body: false, pagination: null },
|
|
3381
|
+
"team.invitations.resend": { action: "team.invitations.resend", operationId: "team_invitations_resend", method: "POST", path: "/workspace/invitations/{id}/resend", pathParams: ["id"], scope: "team:write", danger: "write", approval: true, body: false, pagination: null },
|
|
3382
|
+
"team.invitations.revoke": { action: "team.invitations.revoke", operationId: "team_invitations_revoke", method: "DELETE", path: "/workspace/invitations/{id}", pathParams: ["id"], scope: "team:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
3383
|
+
"team.invite": { action: "team.invite", operationId: "team_invite", method: "POST", path: "/workspace/members", pathParams: [], scope: "team:write", danger: "write", approval: true, body: true, pagination: null },
|
|
3384
|
+
"team.list": { action: "team.list", operationId: "team_list", method: "GET", path: "/workspace/members", pathParams: [], scope: "team:read", danger: "read", approval: true, body: false, pagination: "page" },
|
|
3385
|
+
"team.remove": { action: "team.remove", operationId: "team_remove", method: "DELETE", path: "/workspace/members/{id}", pathParams: ["id"], scope: "team:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
3386
|
+
"team.role": { action: "team.role", operationId: "team_role", method: "PATCH", path: "/workspace/members/{id}/role", pathParams: ["id"], scope: "team:write", danger: "write", approval: true, body: true, pagination: null },
|
|
3387
|
+
"team.transfer_ownership": { action: "team.transfer_ownership", operationId: "team_transfer_ownership", method: "POST", path: "/workspace/members/{id}/transfer-ownership", pathParams: ["id"], scope: "team:write", danger: "critical", approval: true, body: false, pagination: null },
|
|
3388
|
+
"workspace.get": { action: "workspace.get", operationId: "workspace_get", method: "GET", path: "/workspace", pathParams: [], scope: "workspace:read", danger: "read", approval: true, body: false, pagination: null },
|
|
3389
|
+
"workspace.settings.update": { action: "workspace.settings.update", operationId: "workspace_settings_update", method: "PATCH", path: "/workspace", pathParams: [], scope: "settings:write", danger: "write", approval: true, body: true, pagination: null }
|
|
3390
|
+
};
|
|
3391
|
+
var WorkspaceClient = class {
|
|
3392
|
+
/** The transport every method runs on — authentication, retries, approvals. */
|
|
3393
|
+
transport;
|
|
3394
|
+
constructor(options) {
|
|
3395
|
+
this.transport = new ManagementTransport("workspace", options, "https://api.cboxid.com");
|
|
3396
|
+
}
|
|
3397
|
+
/** Call a route by method and path (relative to `/api/v1`) — for anything not generated. */
|
|
3398
|
+
request(method, path, input, options) {
|
|
3399
|
+
return this.transport.request(method, path, input, options);
|
|
3400
|
+
}
|
|
3401
|
+
actionApprovals = {
|
|
3402
|
+
/**
|
|
3403
|
+
* Where an approval this key asked for stands
|
|
3404
|
+
*
|
|
3405
|
+
* Any workspace key — or a member's token — may poll the approvals it raised, and only
|
|
3406
|
+
* those: another credential's id is a 404. `status` is `pending`, `approved`, `denied`, `expired` or `consumed`.
|
|
3407
|
+
*
|
|
3408
|
+
* `GET /workspace/action-approvals/{id}`
|
|
3409
|
+
*/
|
|
3410
|
+
get: (id, options) => this.transport.call(workspaceOperations["action_approvals.get"], [id], void 0, options)
|
|
3411
|
+
};
|
|
3412
|
+
environments = {
|
|
3413
|
+
/**
|
|
3414
|
+
* Create an environment
|
|
3415
|
+
*
|
|
3416
|
+
* Requires scope `environments:write` and the `manage-environments` capability
|
|
3417
|
+
* (owner/admin/developer). Danger: critical — with `initial_key` it mints a credential.
|
|
3418
|
+
*
|
|
3419
|
+
* With `initial_key`, the environment's first management key is minted in the same
|
|
3420
|
+
* call and returned once as `initial_key.token` — enough for an agent holding one
|
|
3421
|
+
* workspace key to stand an environment up and start configuring it on the
|
|
3422
|
+
* environment's own host. An idempotent replay returns `initial_key.token: null`.
|
|
3423
|
+
*
|
|
3424
|
+
* `POST /workspace/environments` · action `environments.create`
|
|
3425
|
+
* @scope `environments:write`
|
|
3426
|
+
* @danger critical
|
|
3427
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3428
|
+
*/
|
|
3429
|
+
create: (body, options) => this.transport.call(workspaceOperations["environments.create"], [], body, options),
|
|
3430
|
+
/**
|
|
3431
|
+
* List environments
|
|
3432
|
+
*
|
|
3433
|
+
* Requires scope `workspace:read` (any role).
|
|
3434
|
+
*
|
|
3435
|
+
* `GET /workspace/environments` · action `environments.list`
|
|
3436
|
+
* @scope `workspace:read`
|
|
3437
|
+
* @danger read
|
|
3438
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3439
|
+
*/
|
|
3440
|
+
list: (query, options) => this.transport.call(workspaceOperations["environments.list"], [], query, options),
|
|
3441
|
+
/** Every item of `environments.list`, fetching pages as the iteration reaches them. */
|
|
3442
|
+
listAll: (query, options) => this.transport.paginate(workspaceOperations["environments.list"], [], query, options),
|
|
3443
|
+
domain: {
|
|
3444
|
+
/**
|
|
3445
|
+
* Stop serving one of the workspace's environments on its custom domain. Anything using that domain stops reaching it.
|
|
3446
|
+
*
|
|
3447
|
+
* Requires scope `environments:write` and a role that may `manage-environments`. Danger: destructive.
|
|
3448
|
+
*
|
|
3449
|
+
* `DELETE /workspace/environments/{environment_id}/domain` · action `environments.domain.remove`
|
|
3450
|
+
* @scope `environments:write`
|
|
3451
|
+
* @danger destructive
|
|
3452
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3453
|
+
*/
|
|
3454
|
+
remove: (environmentId, options) => this.transport.call(workspaceOperations["environments.domain.remove"], [environmentId], void 0, options),
|
|
3455
|
+
/**
|
|
3456
|
+
* Start serving one of the workspace's environments on a custom domain: returns the DNS TXT record that proves you control it.
|
|
3457
|
+
*
|
|
3458
|
+
* Requires scope `environments:write` and a role that may `manage-environments`. Danger: write.
|
|
3459
|
+
*
|
|
3460
|
+
* `POST /workspace/environments/{environment_id}/domain` · action `environments.domain.request`
|
|
3461
|
+
* @scope `environments:write`
|
|
3462
|
+
* @danger write
|
|
3463
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3464
|
+
*/
|
|
3465
|
+
request: (environmentId, body, options) => this.transport.call(workspaceOperations["environments.domain.request"], [environmentId], body, options),
|
|
3466
|
+
/**
|
|
3467
|
+
* Look for the pending domain's DNS TXT record and, once it is visible, serve the environment on that domain.
|
|
3468
|
+
*
|
|
3469
|
+
* Requires scope `environments:write` and a role that may `manage-environments`. Danger: write.
|
|
3470
|
+
*
|
|
3471
|
+
* `POST /workspace/environments/{environment_id}/domain/verify` · action `environments.domain.verify`
|
|
3472
|
+
* @scope `environments:write`
|
|
3473
|
+
* @danger write
|
|
3474
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3475
|
+
*/
|
|
3476
|
+
verify: (environmentId, options) => this.transport.call(workspaceOperations["environments.domain.verify"], [environmentId], void 0, options)
|
|
3477
|
+
}
|
|
3478
|
+
};
|
|
3479
|
+
keys = {
|
|
3480
|
+
environment: {
|
|
3481
|
+
/**
|
|
3482
|
+
* Mint a management key for one of the workspace's environments, with the scopes it needs. The value is returned once, as `token`.
|
|
3483
|
+
*
|
|
3484
|
+
* Requires scope `keys:write` and a role that may `manage-environments`. Danger: critical.
|
|
3485
|
+
*
|
|
3486
|
+
* `POST /workspace/environments/{environment_id}/keys` · action `keys.environment.create`
|
|
3487
|
+
* @scope `keys:write`
|
|
3488
|
+
* @danger critical
|
|
3489
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3490
|
+
*/
|
|
3491
|
+
create: (environmentId, body, options) => this.transport.call(workspaceOperations["keys.environment.create"], [environmentId], body, options),
|
|
3492
|
+
/**
|
|
3493
|
+
* Revoke one of an environment's management keys; whatever uses it stops immediately.
|
|
3494
|
+
*
|
|
3495
|
+
* Requires scope `keys:write` and a role that may `manage-environments`. Danger: destructive.
|
|
3496
|
+
*
|
|
3497
|
+
* `DELETE /workspace/environments/{environment_id}/keys/{id}` · action `keys.environment.revoke`
|
|
3498
|
+
* @scope `keys:write`
|
|
3499
|
+
* @danger destructive
|
|
3500
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3501
|
+
*/
|
|
3502
|
+
revoke: (environmentId, id, options) => this.transport.call(workspaceOperations["keys.environment.revoke"], [environmentId, id], void 0, options)
|
|
3503
|
+
},
|
|
3504
|
+
workspace: {
|
|
3505
|
+
/**
|
|
3506
|
+
* Mint a workspace key with a role and optional scopes, never wider than the caller. The value is returned once, as `token`.
|
|
3507
|
+
*
|
|
3508
|
+
* Requires scope `keys:write` and a role that may `manage-environments` and `manage-members`. Danger: critical.
|
|
3509
|
+
*
|
|
3510
|
+
* `POST /workspace/keys` · action `keys.workspace.create`
|
|
3511
|
+
* @scope `keys:write`
|
|
3512
|
+
* @danger critical
|
|
3513
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3514
|
+
*/
|
|
3515
|
+
create: (body, options) => this.transport.call(workspaceOperations["keys.workspace.create"], [], body, options),
|
|
3516
|
+
/**
|
|
3517
|
+
* List the workspace's keys, newest first, revoked ones included — names, roles, scopes and expiry, never their values.
|
|
3518
|
+
*
|
|
3519
|
+
* Requires scope `workspace:read` and a role that may `manage-members`. Danger: read.
|
|
3520
|
+
*
|
|
3521
|
+
* `GET /workspace/keys` · action `keys.workspace.list`
|
|
3522
|
+
* @scope `workspace:read`
|
|
3523
|
+
* @danger read
|
|
3524
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3525
|
+
*/
|
|
3526
|
+
list: (query, options) => this.transport.call(workspaceOperations["keys.workspace.list"], [], query, options),
|
|
3527
|
+
/** Every item of `keys.workspace.list`, fetching pages as the iteration reaches them. */
|
|
3528
|
+
listAll: (query, options) => this.transport.paginate(workspaceOperations["keys.workspace.list"], [], query, options),
|
|
3529
|
+
/**
|
|
3530
|
+
* Revoke a workspace key, and every key it minted on either plane (workspace keys and environment management keys, all the way down); whatever uses them stops immediately.
|
|
3531
|
+
*
|
|
3532
|
+
* Requires scope `keys:write` and a role that may `manage-environments` and `manage-members`. Danger: destructive.
|
|
3533
|
+
*
|
|
3534
|
+
* `DELETE /workspace/keys/{id}` · action `keys.workspace.revoke`
|
|
3535
|
+
* @scope `keys:write`
|
|
3536
|
+
* @danger destructive
|
|
3537
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3538
|
+
*/
|
|
3539
|
+
revoke: (id, options) => this.transport.call(workspaceOperations["keys.workspace.revoke"], [id], void 0, options)
|
|
3540
|
+
}
|
|
3541
|
+
};
|
|
3542
|
+
projects = {
|
|
3543
|
+
/**
|
|
3544
|
+
* Create a project
|
|
3545
|
+
*
|
|
3546
|
+
* Stand up another independently-billed IdP product. Requires scope `projects:write` and the `manage-environments` capability (owner/admin/developer).
|
|
3547
|
+
*
|
|
3548
|
+
* `POST /workspace/projects` · action `projects.create`
|
|
3549
|
+
* @scope `projects:write`
|
|
3550
|
+
* @danger write
|
|
3551
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3552
|
+
*/
|
|
3553
|
+
create: (body, options) => this.transport.call(workspaceOperations["projects.create"], [], body, options),
|
|
3554
|
+
/**
|
|
3555
|
+
* List projects
|
|
3556
|
+
*
|
|
3557
|
+
* Requires scope `workspace:read` (any role). The workspace's projects (IdP products). Each carries its own plan and environment allowance.
|
|
3558
|
+
*
|
|
3559
|
+
* `GET /workspace/projects` · action `projects.list`
|
|
3560
|
+
* @scope `workspace:read`
|
|
3561
|
+
* @danger read
|
|
3562
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3563
|
+
*/
|
|
3564
|
+
list: (options) => this.transport.call(workspaceOperations["projects.list"], [], void 0, options),
|
|
3565
|
+
/**
|
|
3566
|
+
* Reactivate a suspended project, so environments can be added to it again.
|
|
3567
|
+
*
|
|
3568
|
+
* Requires scope `projects:write` and a role that may `manage-environments`. Danger: write.
|
|
3569
|
+
*
|
|
3570
|
+
* `POST /workspace/projects/{id}/reactivate` · action `projects.reactivate`
|
|
3571
|
+
* @scope `projects:write`
|
|
3572
|
+
* @danger write
|
|
3573
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3574
|
+
*/
|
|
3575
|
+
reactivate: (id, options) => this.transport.call(workspaceOperations["projects.reactivate"], [id], void 0, options),
|
|
3576
|
+
/**
|
|
3577
|
+
* Rename a project.
|
|
3578
|
+
*
|
|
3579
|
+
* Requires scope `projects:write` and a role that may `manage-environments`. Danger: write.
|
|
3580
|
+
*
|
|
3581
|
+
* `PATCH /workspace/projects/{id}` · action `projects.rename`
|
|
3582
|
+
* @scope `projects:write`
|
|
3583
|
+
* @danger write
|
|
3584
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3585
|
+
*/
|
|
3586
|
+
rename: (id, body, options) => this.transport.call(workspaceOperations["projects.rename"], [id], body, options),
|
|
3587
|
+
/**
|
|
3588
|
+
* Suspend a project: its environments stay live, but no new ones can be added until it is reactivated.
|
|
3589
|
+
*
|
|
3590
|
+
* Requires scope `projects:write` and a role that may `manage-environments`. Danger: write.
|
|
3591
|
+
*
|
|
3592
|
+
* `POST /workspace/projects/{id}/suspend` · action `projects.suspend`
|
|
3593
|
+
* @scope `projects:write`
|
|
3594
|
+
* @danger write
|
|
3595
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3596
|
+
*/
|
|
3597
|
+
suspend: (id, options) => this.transport.call(workspaceOperations["projects.suspend"], [id], void 0, options),
|
|
3598
|
+
verification: {
|
|
3599
|
+
/**
|
|
3600
|
+
* Re-send the signup confirmation the workspace's first environment is waiting on, to the owner's address on file.
|
|
3601
|
+
*
|
|
3602
|
+
* Requires scope `projects:write` and a role that may `manage-environments`. Danger: write.
|
|
3603
|
+
*
|
|
3604
|
+
* `POST /workspace/projects/verification/resend` · action `projects.verification.resend`
|
|
3605
|
+
* @scope `projects:write`
|
|
3606
|
+
* @danger write
|
|
3607
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3608
|
+
*/
|
|
3609
|
+
resend: (options) => this.transport.call(workspaceOperations["projects.verification.resend"], [], void 0, options)
|
|
3610
|
+
}
|
|
3611
|
+
};
|
|
3612
|
+
team = {
|
|
3613
|
+
/**
|
|
3614
|
+
* Set which of the workspace's environments a team member reaches: all of them, or the listed ones.
|
|
3615
|
+
*
|
|
3616
|
+
* Requires scope `team:write` and a role that may `manage-members`. Danger: write.
|
|
3617
|
+
*
|
|
3618
|
+
* `PUT /workspace/members/{id}/access` · action `team.environment_access`
|
|
3619
|
+
* @scope `team:write`
|
|
3620
|
+
* @danger write
|
|
3621
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3622
|
+
*/
|
|
3623
|
+
environmentAccess: (id, body, options) => this.transport.call(workspaceOperations["team.environment_access"], [id], body, options),
|
|
3624
|
+
/**
|
|
3625
|
+
* Invite a member
|
|
3626
|
+
*
|
|
3627
|
+
* Requires scope `team:write` and the `manage-members` capability (owner/admin). Invites the address onto the
|
|
3628
|
+
* workspace's team — the same invitation the console's Team page sends: a mail naming
|
|
3629
|
+
* this key as the inviter and the role, with a signed link on which the invitee sets a
|
|
3630
|
+
* password and is signed in. Owner is never invited; ownership is transferred. An
|
|
3631
|
+
* earlier pending invitation for the same address is superseded. List, re-send and
|
|
3632
|
+
* withdraw it under `/workspace/invitations`.
|
|
3633
|
+
*
|
|
3634
|
+
* `POST /workspace/members` · action `team.invite`
|
|
3635
|
+
* @scope `team:write`
|
|
3636
|
+
* @danger write
|
|
3637
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3638
|
+
*/
|
|
3639
|
+
invite: (body, options) => this.transport.call(workspaceOperations["team.invite"], [], body, options),
|
|
3640
|
+
/**
|
|
3641
|
+
* List members
|
|
3642
|
+
*
|
|
3643
|
+
* Requires scope `team:read` and the `read-members` capability (owner/admin/viewer). The roster is PII — a developer key is refused.
|
|
3644
|
+
*
|
|
3645
|
+
* `GET /workspace/members` · action `team.list`
|
|
3646
|
+
* @scope `team:read`
|
|
3647
|
+
* @danger read
|
|
3648
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3649
|
+
*/
|
|
3650
|
+
list: (query, options) => this.transport.call(workspaceOperations["team.list"], [], query, options),
|
|
3651
|
+
/** Every item of `team.list`, fetching pages as the iteration reaches them. */
|
|
3652
|
+
listAll: (query, options) => this.transport.paginate(workspaceOperations["team.list"], [], query, options),
|
|
3653
|
+
/**
|
|
3654
|
+
* Remove a member from the workspace's team. The owner is never removed; transfer ownership first.
|
|
3655
|
+
*
|
|
3656
|
+
* Requires scope `team:write` and a role that may `manage-members`. Danger: destructive.
|
|
3657
|
+
*
|
|
3658
|
+
* `DELETE /workspace/members/{id}` · action `team.remove`
|
|
3659
|
+
* @scope `team:write`
|
|
3660
|
+
* @danger destructive
|
|
3661
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3662
|
+
*/
|
|
3663
|
+
remove: (id, options) => this.transport.call(workspaceOperations["team.remove"], [id], void 0, options),
|
|
3664
|
+
/**
|
|
3665
|
+
* Change a team member's role (admin, developer, member or viewer). The owner's role changes only by transferring ownership.
|
|
3666
|
+
*
|
|
3667
|
+
* Requires scope `team:write` and a role that may `manage-members`. Danger: write.
|
|
3668
|
+
*
|
|
3669
|
+
* `PATCH /workspace/members/{id}/role` · action `team.role`
|
|
3670
|
+
* @scope `team:write`
|
|
3671
|
+
* @danger write
|
|
3672
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3673
|
+
*/
|
|
3674
|
+
role: (id, body, options) => this.transport.call(workspaceOperations["team.role"], [id], body, options),
|
|
3675
|
+
/**
|
|
3676
|
+
* Make another member the workspace's owner; the current owner stays on as an admin. Only the owner, signed in, may do this.
|
|
3677
|
+
*
|
|
3678
|
+
* Requires scope `team:write` and a role that may `manage-members`. Danger: critical.
|
|
3679
|
+
*
|
|
3680
|
+
* `POST /workspace/members/{id}/transfer-ownership` · action `team.transfer_ownership`
|
|
3681
|
+
* @scope `team:write`
|
|
3682
|
+
* @danger critical
|
|
3683
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3684
|
+
*/
|
|
3685
|
+
transferOwnership: (id, options) => this.transport.call(workspaceOperations["team.transfer_ownership"], [id], void 0, options),
|
|
3686
|
+
invitations: {
|
|
3687
|
+
/**
|
|
3688
|
+
* List pending invitations
|
|
3689
|
+
*
|
|
3690
|
+
* Requires scope `team:read` and the `read-members` capability. The team's invitations nobody has accepted yet, newest first (at most 100).
|
|
3691
|
+
*
|
|
3692
|
+
* `GET /workspace/invitations` · action `team.invitations.list`
|
|
3693
|
+
* @scope `team:read`
|
|
3694
|
+
* @danger read
|
|
3695
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3696
|
+
*/
|
|
3697
|
+
list: (options) => this.transport.call(workspaceOperations["team.invitations.list"], [], void 0, options),
|
|
3698
|
+
/**
|
|
3699
|
+
* Re-send an invitation
|
|
3700
|
+
*
|
|
3701
|
+
* Requires scope `team:write` and the `manage-members` capability. Mails a fresh link; the earlier link stops
|
|
3702
|
+
* working and the invitation gets a new `id`. At most once a minute per address
|
|
3703
|
+
* (`429`, `too_soon`). If the mail server refuses, the earlier invitation is kept (`503`).
|
|
3704
|
+
*
|
|
3705
|
+
* `POST /workspace/invitations/{id}/resend` · action `team.invitations.resend`
|
|
3706
|
+
* @scope `team:write`
|
|
3707
|
+
* @danger write
|
|
3708
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3709
|
+
*/
|
|
3710
|
+
resend: (id, options) => this.transport.call(workspaceOperations["team.invitations.resend"], [id], void 0, options),
|
|
3711
|
+
/**
|
|
3712
|
+
* Withdraw an invitation
|
|
3713
|
+
*
|
|
3714
|
+
* Requires scope `team:write` and the `manage-members` capability. The link stops working. An invitation that is not pending in this workspace is a `404`.
|
|
3715
|
+
*
|
|
3716
|
+
* `DELETE /workspace/invitations/{id}` · action `team.invitations.revoke`
|
|
3717
|
+
* @scope `team:write`
|
|
3718
|
+
* @danger destructive
|
|
3719
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3720
|
+
*/
|
|
3721
|
+
revoke: (id, options) => this.transport.call(workspaceOperations["team.invitations.revoke"], [id], void 0, options)
|
|
3722
|
+
}
|
|
3723
|
+
};
|
|
3724
|
+
workspace = {
|
|
3725
|
+
/**
|
|
3726
|
+
* Get the workspace
|
|
3727
|
+
*
|
|
3728
|
+
* Requires scope `workspace:read` (any role). Returns the workspace's identity. The `projects` block (each project's plan/allowance) is included only for keys whose role can read billing (owner/admin/viewer — not developer).
|
|
3729
|
+
*
|
|
3730
|
+
* `GET /workspace` · action `workspace.get`
|
|
3731
|
+
* @scope `workspace:read`
|
|
3732
|
+
* @danger read
|
|
3733
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3734
|
+
*/
|
|
3735
|
+
get: (options) => this.transport.call(workspaceOperations["workspace.get"], [], void 0, options),
|
|
3736
|
+
settings: {
|
|
3737
|
+
/**
|
|
3738
|
+
* Rename the workspace.
|
|
3739
|
+
*
|
|
3740
|
+
* Requires scope `settings:write` and a role that may `manage-members`. Danger: write.
|
|
3741
|
+
*
|
|
3742
|
+
* `PATCH /workspace` · action `workspace.settings.update`
|
|
3743
|
+
* @scope `settings:write`
|
|
3744
|
+
* @danger write
|
|
3745
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3746
|
+
*/
|
|
3747
|
+
update: (body, options) => this.transport.call(workspaceOperations["workspace.settings.update"], [], body, options)
|
|
3748
|
+
}
|
|
3749
|
+
};
|
|
3750
|
+
};
|
|
3751
|
+
|
|
3752
|
+
// src/management/generated/platform.ts
|
|
3753
|
+
var platformOperations = {
|
|
3754
|
+
"action_approvals.get": { action: null, operationId: null, method: "GET", path: "/platform/action-approvals/{id}", pathParams: ["id"], scope: null, danger: null, approval: false, body: false, pagination: null },
|
|
3755
|
+
"platform.environments.create": { action: "platform.environments.create", operationId: "platform_environments_create", method: "POST", path: "/platform/environments", pathParams: [], scope: "operator:environments:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
3756
|
+
"platform.environments.provision": { action: "platform.environments.provision", operationId: "platform_environments_provision", method: "POST", path: "/platform/environments/{environment_id}/provision", pathParams: ["environment_id"], scope: "operator:environments:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
3757
|
+
"platform.operators.create": { action: "platform.operators.create", operationId: "platform_operators_create", method: "POST", path: "/platform/operators", pathParams: [], scope: "operator:operators:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
3758
|
+
"platform.operators.set_status": { action: "platform.operators.set_status", operationId: "platform_operators_set_status", method: "PUT", path: "/platform/operators/{operator_id}/status", pathParams: ["operator_id"], scope: "operator:operators:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
3759
|
+
"platform.organizations.create": { action: "platform.organizations.create", operationId: "platform_organizations_create", method: "POST", path: "/platform/environments/{environment_id}/organizations", pathParams: ["environment_id"], scope: "operator:organizations:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
3760
|
+
"platform.organizations.move": { action: "platform.organizations.move", operationId: "platform_organizations_move", method: "PUT", path: "/platform/environments/{environment_id}/organizations/{organization_id}/parent", pathParams: ["environment_id", "organization_id"], scope: "operator:organizations:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
3761
|
+
"platform.organizations.set_status": { action: "platform.organizations.set_status", operationId: "platform_organizations_set_status", method: "PUT", path: "/platform/environments/{environment_id}/organizations/{organization_id}/status", pathParams: ["environment_id", "organization_id"], scope: "operator:organizations:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
3762
|
+
"platform.workspaces.create": { action: "platform.workspaces.create", operationId: "platform_workspaces_create", method: "POST", path: "/platform/workspaces", pathParams: [], scope: "operator:workspaces:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
3763
|
+
"platform.workspaces.set_status": { action: "platform.workspaces.set_status", operationId: "platform_workspaces_set_status", method: "PUT", path: "/platform/workspaces/{workspace_id}/status", pathParams: ["workspace_id"], scope: "operator:workspaces:write", danger: "critical", approval: true, body: true, pagination: null }
|
|
3764
|
+
};
|
|
3765
|
+
var PlatformClient = class {
|
|
3766
|
+
/** The transport every method runs on — authentication, retries, approvals. */
|
|
3767
|
+
transport;
|
|
3768
|
+
constructor(options) {
|
|
3769
|
+
this.transport = new ManagementTransport("platform", options, "https://api.cboxid.com");
|
|
3770
|
+
}
|
|
3771
|
+
/** Call a route by method and path (relative to `/api/v1`) — for anything not generated. */
|
|
3772
|
+
request(method, path, input, options) {
|
|
3773
|
+
return this.transport.request(method, path, input, options);
|
|
3774
|
+
}
|
|
3775
|
+
actionApprovals = {
|
|
3776
|
+
/**
|
|
3777
|
+
* Where an approval you asked for stands
|
|
3778
|
+
*
|
|
3779
|
+
* The `poll_url` of a `202 approval_required`: an approval this token raised, and only those — another token's id is a 404. `status` is `pending`, `approved`, `denied`, `expired` or `consumed`.
|
|
3780
|
+
*
|
|
3781
|
+
* `GET /platform/action-approvals/{id}`
|
|
3782
|
+
*/
|
|
3783
|
+
get: (id, options) => this.transport.call(platformOperations["action_approvals.get"], [id], void 0, options)
|
|
3784
|
+
};
|
|
3785
|
+
environments = {
|
|
3786
|
+
/**
|
|
3787
|
+
* Create an environment on the deployment, with its own signing key. A domain is verified separately, by DNS.
|
|
3788
|
+
*
|
|
3789
|
+
* Requires scope `operator:environments:write` on an access token delegated by an active platform operator. No management key is accepted. Danger: critical.
|
|
3790
|
+
*
|
|
3791
|
+
* `POST /platform/environments` · action `platform.environments.create`
|
|
3792
|
+
* @scope `operator:environments:write`
|
|
3793
|
+
* @danger critical
|
|
3794
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3795
|
+
*/
|
|
3796
|
+
create: (body, options) => this.transport.call(platformOperations["platform.environments.create"], [], body, options),
|
|
3797
|
+
/**
|
|
3798
|
+
* Bootstrap an environment with its first organization and an owner administrator, so people can sign in to it.
|
|
3799
|
+
*
|
|
3800
|
+
* Requires scope `operator:environments:write` on an access token delegated by an active platform operator. No management key is accepted. Danger: critical.
|
|
3801
|
+
*
|
|
3802
|
+
* `POST /platform/environments/{environment_id}/provision` · action `platform.environments.provision`
|
|
3803
|
+
* @scope `operator:environments:write`
|
|
3804
|
+
* @danger critical
|
|
3805
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3806
|
+
*/
|
|
3807
|
+
provision: (environmentId, body, options) => this.transport.call(platformOperations["platform.environments.provision"], [environmentId], body, options)
|
|
3808
|
+
};
|
|
3809
|
+
operators = {
|
|
3810
|
+
/**
|
|
3811
|
+
* Add a platform operator: a person with authority over the whole deployment.
|
|
3812
|
+
*
|
|
3813
|
+
* Requires scope `operator:operators:write` on an access token delegated by an active platform operator. No management key is accepted. Danger: critical.
|
|
3814
|
+
*
|
|
3815
|
+
* `POST /platform/operators` · action `platform.operators.create`
|
|
3816
|
+
* @scope `operator:operators:write`
|
|
3817
|
+
* @danger critical
|
|
3818
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3819
|
+
*/
|
|
3820
|
+
create: (body, options) => this.transport.call(platformOperations["platform.operators.create"], [], body, options),
|
|
3821
|
+
/**
|
|
3822
|
+
* Suspend a platform operator, or reactivate one. Never yourself, and never the last active operator.
|
|
3823
|
+
*
|
|
3824
|
+
* Requires scope `operator:operators:write` on an access token delegated by an active platform operator. No management key is accepted. Danger: critical.
|
|
3825
|
+
*
|
|
3826
|
+
* `PUT /platform/operators/{operator_id}/status` · action `platform.operators.set_status`
|
|
3827
|
+
* @scope `operator:operators:write`
|
|
3828
|
+
* @danger critical
|
|
3829
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3830
|
+
*/
|
|
3831
|
+
setStatus: (operatorId, body, options) => this.transport.call(platformOperations["platform.operators.set_status"], [operatorId], body, options)
|
|
3832
|
+
};
|
|
3833
|
+
organizations = {
|
|
3834
|
+
/**
|
|
3835
|
+
* Create an organization inside an environment, optionally under a parent organization of the same environment.
|
|
3836
|
+
*
|
|
3837
|
+
* Requires scope `operator:organizations:write` on an access token delegated by an active platform operator. No management key is accepted. Danger: critical.
|
|
3838
|
+
*
|
|
3839
|
+
* `POST /platform/environments/{environment_id}/organizations` · action `platform.organizations.create`
|
|
3840
|
+
* @scope `operator:organizations:write`
|
|
3841
|
+
* @danger critical
|
|
3842
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3843
|
+
*/
|
|
3844
|
+
create: (environmentId, body, options) => this.transport.call(platformOperations["platform.organizations.create"], [environmentId], body, options),
|
|
3845
|
+
/**
|
|
3846
|
+
* Move an organization under another organization of the same environment, or to the top of its hierarchy.
|
|
3847
|
+
*
|
|
3848
|
+
* Requires scope `operator:organizations:write` on an access token delegated by an active platform operator. No management key is accepted. Danger: critical.
|
|
3849
|
+
*
|
|
3850
|
+
* `PUT /platform/environments/{environment_id}/organizations/{organization_id}/parent` · action `platform.organizations.move`
|
|
3851
|
+
* @scope `operator:organizations:write`
|
|
3852
|
+
* @danger critical
|
|
3853
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3854
|
+
*/
|
|
3855
|
+
move: (environmentId, organizationId, body, options) => this.transport.call(platformOperations["platform.organizations.move"], [environmentId, organizationId], body, options),
|
|
3856
|
+
/**
|
|
3857
|
+
* Suspend an organization inside an environment (its members can no longer sign in to it) or reactivate it.
|
|
3858
|
+
*
|
|
3859
|
+
* Requires scope `operator:organizations:write` on an access token delegated by an active platform operator. No management key is accepted. Danger: critical.
|
|
3860
|
+
*
|
|
3861
|
+
* `PUT /platform/environments/{environment_id}/organizations/{organization_id}/status` · action `platform.organizations.set_status`
|
|
3862
|
+
* @scope `operator:organizations:write`
|
|
3863
|
+
* @danger critical
|
|
3864
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3865
|
+
*/
|
|
3866
|
+
setStatus: (environmentId, organizationId, body, options) => this.transport.call(platformOperations["platform.organizations.set_status"], [environmentId, organizationId], body, options)
|
|
3867
|
+
};
|
|
3868
|
+
workspaces = {
|
|
3869
|
+
/**
|
|
3870
|
+
* Create a workspace with its owner, first project and first environment; the owner is emailed a link to set their password.
|
|
3871
|
+
*
|
|
3872
|
+
* Requires scope `operator:workspaces:write` on an access token delegated by an active platform operator. No management key is accepted. Danger: critical.
|
|
3873
|
+
*
|
|
3874
|
+
* `POST /platform/workspaces` · action `platform.workspaces.create`
|
|
3875
|
+
* @scope `operator:workspaces:write`
|
|
3876
|
+
* @danger critical
|
|
3877
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3878
|
+
*/
|
|
3879
|
+
create: (body, options) => this.transport.call(platformOperations["platform.workspaces.create"], [], body, options),
|
|
3880
|
+
/**
|
|
3881
|
+
* Suspend a workspace (its people can no longer sign in, its environments stop serving) or reactivate it.
|
|
3882
|
+
*
|
|
3883
|
+
* Requires scope `operator:workspaces:write` on an access token delegated by an active platform operator. No management key is accepted. Danger: critical.
|
|
3884
|
+
*
|
|
3885
|
+
* `PUT /platform/workspaces/{workspace_id}/status` · action `platform.workspaces.set_status`
|
|
3886
|
+
* @scope `operator:workspaces:write`
|
|
3887
|
+
* @danger critical
|
|
3888
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3889
|
+
*/
|
|
3890
|
+
setStatus: (workspaceId, body, options) => this.transport.call(platformOperations["platform.workspaces.set_status"], [workspaceId], body, options)
|
|
3891
|
+
};
|
|
3892
|
+
};
|
|
3893
|
+
|
|
3894
|
+
// src/management/generated/account.ts
|
|
3895
|
+
var accountOperations = {
|
|
3896
|
+
"action_approvals.get": { action: null, operationId: null, method: "GET", path: "/me/action-approvals/{id}", pathParams: ["id"], scope: null, danger: null, approval: false, body: false, pagination: null },
|
|
3897
|
+
"account.api_keys.create": { action: "account.api_keys.create", operationId: "account_api_keys_create", method: "POST", path: "/me/organizations/{organization_id}/api-keys", pathParams: ["organization_id"], scope: "account:api_keys:write", danger: "critical", approval: true, body: true, pagination: null },
|
|
3898
|
+
"account.api_keys.revoke": { action: "account.api_keys.revoke", operationId: "account_api_keys_revoke", method: "DELETE", path: "/me/organizations/{organization_id}/api-keys/{key_id}", pathParams: ["organization_id", "key_id"], scope: "account:api_keys:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
3899
|
+
"account.applications.revoke": { action: "account.applications.revoke", operationId: "account_applications_revoke", method: "DELETE", path: "/me/applications/{client_id}", pathParams: ["client_id"], scope: "account:applications:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
3900
|
+
"account.devices.remove": { action: "account.devices.remove", operationId: "account_devices_remove", method: "DELETE", path: "/me/devices/{device_id}", pathParams: ["device_id"], scope: "account:devices:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
3901
|
+
"account.organizations.leave": { action: "account.organizations.leave", operationId: "account_organizations_leave", method: "POST", path: "/me/organizations/{organization_id}/leave", pathParams: ["organization_id"], scope: "account:organizations:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
3902
|
+
"account.passkeys.remove": { action: "account.passkeys.remove", operationId: "account_passkeys_remove", method: "DELETE", path: "/me/passkeys/{passkey_id}", pathParams: ["passkey_id"], scope: "account:sign_in:write", danger: "critical", approval: true, body: false, pagination: null },
|
|
3903
|
+
"account.profile.update": { action: "account.profile.update", operationId: "account_profile_update", method: "PATCH", path: "/me/profile", pathParams: [], scope: "account:profile:write", danger: "write", approval: true, body: true, pagination: null },
|
|
3904
|
+
"account.sessions.revoke": { action: "account.sessions.revoke", operationId: "account_sessions_revoke", method: "DELETE", path: "/me/sessions/{session_id}", pathParams: ["session_id"], scope: "account:sessions:write", danger: "destructive", approval: true, body: false, pagination: null },
|
|
3905
|
+
"account.sessions.revoke_others": { action: "account.sessions.revoke_others", operationId: "account_sessions_revoke_others", method: "POST", path: "/me/sessions/revoke-others", pathParams: [], scope: "account:sessions:write", danger: "critical", approval: true, body: false, pagination: null },
|
|
3906
|
+
"account.social.unlink": { action: "account.social.unlink", operationId: "account_social_unlink", method: "DELETE", path: "/me/social/{provider}", pathParams: ["provider"], scope: "account:sign_in:write", danger: "critical", approval: true, body: false, pagination: null }
|
|
3907
|
+
};
|
|
3908
|
+
var AccountClient = class {
|
|
3909
|
+
/** The transport every method runs on — authentication, retries, approvals. */
|
|
3910
|
+
transport;
|
|
3911
|
+
constructor(options) {
|
|
3912
|
+
this.transport = new ManagementTransport("account", options);
|
|
3913
|
+
}
|
|
3914
|
+
/** Call a route by method and path (relative to `/api/v1`) — for anything not generated. */
|
|
3915
|
+
request(method, path, input, options) {
|
|
3916
|
+
return this.transport.request(method, path, input, options);
|
|
3917
|
+
}
|
|
3918
|
+
actionApprovals = {
|
|
3919
|
+
/**
|
|
3920
|
+
* Where an approval you asked for stands
|
|
3921
|
+
*
|
|
3922
|
+
* The `poll_url` of a `202 approval_required`: an approval this token raised, and only those — another token's id is a 404. `status` is `pending`, `approved`, `denied`, `expired` or `consumed`.
|
|
3923
|
+
*
|
|
3924
|
+
* `GET /me/action-approvals/{id}`
|
|
3925
|
+
*/
|
|
3926
|
+
get: (id, options) => this.transport.call(accountOperations["action_approvals.get"], [id], void 0, options)
|
|
3927
|
+
};
|
|
3928
|
+
apiKeys = {
|
|
3929
|
+
/**
|
|
3930
|
+
* Create an API key of your own for one of this environment's apps, in an organization you belong to. The value is returned once, as `token`.
|
|
3931
|
+
*
|
|
3932
|
+
* Requires scope `account:api_keys:write` on an access token you delegated; it acts on your own account only. No management key is accepted. Danger: critical.
|
|
3933
|
+
*
|
|
3934
|
+
* `POST /me/organizations/{organization_id}/api-keys` · action `account.api_keys.create`
|
|
3935
|
+
* @scope `account:api_keys:write`
|
|
3936
|
+
* @danger critical
|
|
3937
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3938
|
+
*/
|
|
3939
|
+
create: (organizationId, body, options) => this.transport.call(accountOperations["account.api_keys.create"], [organizationId], body, options),
|
|
3940
|
+
/**
|
|
3941
|
+
* Revoke one of your own API keys.
|
|
3942
|
+
*
|
|
3943
|
+
* Requires scope `account:api_keys:write` on an access token you delegated; it acts on your own account only. No management key is accepted. Danger: destructive.
|
|
3944
|
+
*
|
|
3945
|
+
* `DELETE /me/organizations/{organization_id}/api-keys/{key_id}` · action `account.api_keys.revoke`
|
|
3946
|
+
* @scope `account:api_keys:write`
|
|
3947
|
+
* @danger destructive
|
|
3948
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3949
|
+
*/
|
|
3950
|
+
revoke: (organizationId, keyId, options) => this.transport.call(accountOperations["account.api_keys.revoke"], [organizationId, keyId], void 0, options)
|
|
3951
|
+
};
|
|
3952
|
+
applications = {
|
|
3953
|
+
/**
|
|
3954
|
+
* Withdraw an application's access to your account; it must ask you again to act as you.
|
|
3955
|
+
*
|
|
3956
|
+
* Requires scope `account:applications:write` on an access token you delegated; it acts on your own account only. No management key is accepted. Danger: destructive.
|
|
3957
|
+
*
|
|
3958
|
+
* `DELETE /me/applications/{client_id}` · action `account.applications.revoke`
|
|
3959
|
+
* @scope `account:applications:write`
|
|
3960
|
+
* @danger destructive
|
|
3961
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3962
|
+
*/
|
|
3963
|
+
revoke: (clientId, options) => this.transport.call(accountOperations["account.applications.revoke"], [clientId], void 0, options)
|
|
3964
|
+
};
|
|
3965
|
+
devices = {
|
|
3966
|
+
/**
|
|
3967
|
+
* Remove one of your trusted devices; it is no longer asked to approve anything.
|
|
3968
|
+
*
|
|
3969
|
+
* Requires scope `account:devices:write` on an access token you delegated; it acts on your own account only. No management key is accepted. Danger: destructive.
|
|
3970
|
+
*
|
|
3971
|
+
* `DELETE /me/devices/{device_id}` · action `account.devices.remove`
|
|
3972
|
+
* @scope `account:devices:write`
|
|
3973
|
+
* @danger destructive
|
|
3974
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3975
|
+
*/
|
|
3976
|
+
remove: (deviceId, options) => this.transport.call(accountOperations["account.devices.remove"], [deviceId], void 0, options)
|
|
3977
|
+
};
|
|
3978
|
+
organizations = {
|
|
3979
|
+
/**
|
|
3980
|
+
* Leave one of your own organizations. The last owner cannot leave — transfer ownership first.
|
|
3981
|
+
*
|
|
3982
|
+
* Requires scope `account:organizations:write` on an access token you delegated; it acts on your own account only. No management key is accepted. Danger: destructive.
|
|
3983
|
+
*
|
|
3984
|
+
* `POST /me/organizations/{organization_id}/leave` · action `account.organizations.leave`
|
|
3985
|
+
* @scope `account:organizations:write`
|
|
3986
|
+
* @danger destructive
|
|
3987
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
3988
|
+
*/
|
|
3989
|
+
leave: (organizationId, options) => this.transport.call(accountOperations["account.organizations.leave"], [organizationId], void 0, options)
|
|
3990
|
+
};
|
|
3991
|
+
passkeys = {
|
|
3992
|
+
/**
|
|
3993
|
+
* Remove one of your passkeys.
|
|
3994
|
+
*
|
|
3995
|
+
* Requires scope `account:sign_in:write` on an access token you delegated; it acts on your own account only. No management key is accepted. Danger: critical.
|
|
3996
|
+
*
|
|
3997
|
+
* `DELETE /me/passkeys/{passkey_id}` · action `account.passkeys.remove`
|
|
3998
|
+
* @scope `account:sign_in:write`
|
|
3999
|
+
* @danger critical
|
|
4000
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
4001
|
+
*/
|
|
4002
|
+
remove: (passkeyId, options) => this.transport.call(accountOperations["account.passkeys.remove"], [passkeyId], void 0, options)
|
|
4003
|
+
};
|
|
4004
|
+
profile = {
|
|
4005
|
+
/**
|
|
4006
|
+
* Change the display name on your own account.
|
|
4007
|
+
*
|
|
4008
|
+
* Requires scope `account:profile:write` on an access token you delegated; it acts on your own account only. No management key is accepted. Danger: write.
|
|
4009
|
+
*
|
|
4010
|
+
* `PATCH /me/profile` · action `account.profile.update`
|
|
4011
|
+
* @scope `account:profile:write`
|
|
4012
|
+
* @danger write
|
|
4013
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
4014
|
+
*/
|
|
4015
|
+
update: (body, options) => this.transport.call(accountOperations["account.profile.update"], [], body, options)
|
|
4016
|
+
};
|
|
4017
|
+
sessions = {
|
|
4018
|
+
/**
|
|
4019
|
+
* Sign out one of your own sessions.
|
|
4020
|
+
*
|
|
4021
|
+
* Requires scope `account:sessions:write` on an access token you delegated; it acts on your own account only. No management key is accepted. Danger: destructive.
|
|
4022
|
+
*
|
|
4023
|
+
* `DELETE /me/sessions/{session_id}` · action `account.sessions.revoke`
|
|
4024
|
+
* @scope `account:sessions:write`
|
|
4025
|
+
* @danger destructive
|
|
4026
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
4027
|
+
*/
|
|
4028
|
+
revoke: (sessionId, options) => this.transport.call(accountOperations["account.sessions.revoke"], [sessionId], void 0, options),
|
|
4029
|
+
/**
|
|
4030
|
+
* Sign out every one of your sessions except the one you are using.
|
|
4031
|
+
*
|
|
4032
|
+
* Requires scope `account:sessions:write` on an access token you delegated; it acts on your own account only. No management key is accepted. Danger: critical.
|
|
4033
|
+
*
|
|
4034
|
+
* `POST /me/sessions/revoke-others` · action `account.sessions.revoke_others`
|
|
4035
|
+
* @scope `account:sessions:write`
|
|
4036
|
+
* @danger critical
|
|
4037
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
4038
|
+
*/
|
|
4039
|
+
revokeOthers: (options) => this.transport.call(accountOperations["account.sessions.revoke_others"], [], void 0, options)
|
|
4040
|
+
};
|
|
4041
|
+
social = {
|
|
4042
|
+
/**
|
|
4043
|
+
* Disconnect a social account from yours — never the last way you can sign in.
|
|
4044
|
+
*
|
|
4045
|
+
* Requires scope `account:sign_in:write` on an access token you delegated; it acts on your own account only. No management key is accepted. Danger: critical.
|
|
4046
|
+
*
|
|
4047
|
+
* `DELETE /me/social/{provider}` · action `account.social.unlink`
|
|
4048
|
+
* @scope `account:sign_in:write`
|
|
4049
|
+
* @danger critical
|
|
4050
|
+
* May be held for approval (`202 approval_required`); waited on unless `approval: 'return'`.
|
|
4051
|
+
*/
|
|
4052
|
+
unlink: (provider, options) => this.transport.call(accountOperations["account.social.unlink"], [provider], void 0, options)
|
|
4053
|
+
};
|
|
4054
|
+
};
|
|
4055
|
+
|
|
4056
|
+
// src/management/dpop.ts
|
|
4057
|
+
var encoder = new TextEncoder();
|
|
4058
|
+
function base64url(bytes) {
|
|
4059
|
+
const view = bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes);
|
|
4060
|
+
let binary = "";
|
|
4061
|
+
for (const byte of view) {
|
|
4062
|
+
binary += String.fromCharCode(byte);
|
|
4063
|
+
}
|
|
4064
|
+
return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
4065
|
+
}
|
|
4066
|
+
async function sha256(input) {
|
|
4067
|
+
return base64url(await crypto.subtle.digest("SHA-256", encoder.encode(input)));
|
|
4068
|
+
}
|
|
4069
|
+
async function generateDPoPKeyPair() {
|
|
4070
|
+
return crypto.subtle.generateKey({ name: "ECDSA", namedCurve: "P-256" }, false, ["sign", "verify"]);
|
|
4071
|
+
}
|
|
4072
|
+
async function createDPoPSigner(keyPair) {
|
|
4073
|
+
const exported = await crypto.subtle.exportKey("jwk", keyPair.publicKey);
|
|
4074
|
+
const { crv, x, y } = exported;
|
|
4075
|
+
if (exported.kty !== "EC" || crv !== "P-256" || typeof x !== "string" || typeof y !== "string") {
|
|
4076
|
+
throw new TypeError("A DPoP key must be an ECDSA P-256 key pair.");
|
|
4077
|
+
}
|
|
4078
|
+
const jwk = { crv, kty: "EC", x, y };
|
|
4079
|
+
const jkt = await sha256(JSON.stringify(jwk));
|
|
4080
|
+
return {
|
|
4081
|
+
jkt,
|
|
4082
|
+
async proof({ method, url, accessToken, nonce }) {
|
|
4083
|
+
const target = new URL(url);
|
|
4084
|
+
const header = { typ: "dpop+jwt", alg: "ES256", jwk };
|
|
4085
|
+
const payload = {
|
|
4086
|
+
jti: crypto.randomUUID(),
|
|
4087
|
+
htm: method.toUpperCase(),
|
|
4088
|
+
// RFC 9449 §4.2: the URI without query and fragment.
|
|
4089
|
+
htu: `${target.origin}${target.pathname}`,
|
|
4090
|
+
iat: Math.floor(Date.now() / 1e3),
|
|
4091
|
+
ath: await sha256(accessToken)
|
|
4092
|
+
};
|
|
4093
|
+
if (nonce !== void 0) {
|
|
4094
|
+
payload.nonce = nonce;
|
|
4095
|
+
}
|
|
4096
|
+
const signingInput = `${base64url(encoder.encode(JSON.stringify(header)))}.${base64url(encoder.encode(JSON.stringify(payload)))}`;
|
|
4097
|
+
const signature = await crypto.subtle.sign(
|
|
4098
|
+
{ name: "ECDSA", hash: "SHA-256" },
|
|
4099
|
+
keyPair.privateKey,
|
|
4100
|
+
encoder.encode(signingInput)
|
|
4101
|
+
);
|
|
4102
|
+
return `${signingInput}.${base64url(signature)}`;
|
|
4103
|
+
}
|
|
4104
|
+
};
|
|
4105
|
+
}
|
|
4106
|
+
|
|
4107
|
+
// src/management/audit-logs.ts
|
|
4108
|
+
var MAX_AUDIT_BATCH = 100;
|
|
4109
|
+
var AUDIT_CHAIN_GENESIS = "0".repeat(64);
|
|
4110
|
+
function uuid2() {
|
|
4111
|
+
return crypto.randomUUID();
|
|
4112
|
+
}
|
|
4113
|
+
var AuditLogger = class {
|
|
4114
|
+
#client;
|
|
4115
|
+
#batchSize;
|
|
4116
|
+
#onError;
|
|
4117
|
+
#buffer = [];
|
|
4118
|
+
#queue = [];
|
|
4119
|
+
#sending = Promise.resolve();
|
|
4120
|
+
#timer;
|
|
4121
|
+
#closed = false;
|
|
4122
|
+
constructor(client, options = {}) {
|
|
4123
|
+
const batchSize = options.batchSize ?? MAX_AUDIT_BATCH;
|
|
4124
|
+
if (!Number.isInteger(batchSize) || batchSize < 1 || batchSize > MAX_AUDIT_BATCH) {
|
|
4125
|
+
throw new RangeError(`batchSize must be 1\u2013${MAX_AUDIT_BATCH}.`);
|
|
4126
|
+
}
|
|
4127
|
+
this.#client = client;
|
|
4128
|
+
this.#batchSize = batchSize;
|
|
4129
|
+
this.#onError = options.onError;
|
|
4130
|
+
const interval = options.flushIntervalMs ?? 5e3;
|
|
4131
|
+
if (interval > 0) {
|
|
4132
|
+
this.#timer = setInterval(() => this.#background(), interval);
|
|
4133
|
+
this.#timer.unref?.();
|
|
4134
|
+
}
|
|
4135
|
+
}
|
|
4136
|
+
/** Events buffered or queued, not yet acknowledged by the server. */
|
|
4137
|
+
get pending() {
|
|
4138
|
+
return this.#buffer.length + this.#queue.reduce((n, batch) => n + batch.events.length, 0);
|
|
4139
|
+
}
|
|
4140
|
+
/** Buffer one event. A full batch is sent in the background. */
|
|
4141
|
+
record(event) {
|
|
4142
|
+
if (this.#closed) {
|
|
4143
|
+
throw new CboxIdError("This AuditLogger is closed.");
|
|
4144
|
+
}
|
|
4145
|
+
this.#buffer.push({ ...event, occurred_at: event.occurred_at ?? (/* @__PURE__ */ new Date()).toISOString() });
|
|
4146
|
+
if (this.#buffer.length >= this.#batchSize) {
|
|
4147
|
+
this.#background();
|
|
4148
|
+
}
|
|
4149
|
+
}
|
|
4150
|
+
/** Send everything buffered, and resolve once the server has it. Throws if a batch fails. */
|
|
4151
|
+
flush() {
|
|
4152
|
+
this.#cut();
|
|
4153
|
+
const run = this.#sending.catch(() => void 0).then(() => this.#drain());
|
|
4154
|
+
this.#sending = run;
|
|
4155
|
+
return run;
|
|
4156
|
+
}
|
|
4157
|
+
/** Stop the interval and flush. */
|
|
4158
|
+
async close() {
|
|
4159
|
+
this.#closed = true;
|
|
4160
|
+
if (this.#timer !== void 0) {
|
|
4161
|
+
clearInterval(this.#timer);
|
|
4162
|
+
this.#timer = void 0;
|
|
4163
|
+
}
|
|
4164
|
+
await this.flush();
|
|
4165
|
+
}
|
|
4166
|
+
#background() {
|
|
4167
|
+
this.flush().catch((error) => {
|
|
4168
|
+
this.#onError?.(error, this.#queue[0]?.events ?? []);
|
|
4169
|
+
});
|
|
4170
|
+
}
|
|
4171
|
+
/** Move the buffer into batches, each with the key every resend of it will carry. */
|
|
4172
|
+
#cut() {
|
|
4173
|
+
while (this.#buffer.length > 0) {
|
|
4174
|
+
this.#queue.push({ events: this.#buffer.splice(0, this.#batchSize), idempotencyKey: uuid2() });
|
|
4175
|
+
}
|
|
4176
|
+
}
|
|
4177
|
+
async #drain() {
|
|
4178
|
+
while (this.#queue.length > 0) {
|
|
4179
|
+
const batch = this.#queue[0];
|
|
4180
|
+
await this.#client.auditLogs.events.create({ events: batch.events }, { idempotencyKey: batch.idempotencyKey });
|
|
4181
|
+
this.#queue.shift();
|
|
4182
|
+
}
|
|
4183
|
+
}
|
|
4184
|
+
};
|
|
4185
|
+
var AuditLogExportError = class extends CboxIdError {
|
|
4186
|
+
constructor(message, auditExport) {
|
|
4187
|
+
super(message);
|
|
4188
|
+
this.auditExport = auditExport;
|
|
4189
|
+
}
|
|
4190
|
+
auditExport;
|
|
4191
|
+
};
|
|
4192
|
+
function sleep2(ms, signal) {
|
|
4193
|
+
return new Promise((resolve, reject) => {
|
|
4194
|
+
if (signal?.aborted) {
|
|
4195
|
+
reject(signal.reason);
|
|
4196
|
+
return;
|
|
4197
|
+
}
|
|
4198
|
+
const timer = setTimeout(() => {
|
|
4199
|
+
signal?.removeEventListener("abort", onAbort);
|
|
4200
|
+
resolve();
|
|
4201
|
+
}, ms);
|
|
4202
|
+
const onAbort = () => {
|
|
4203
|
+
clearTimeout(timer);
|
|
4204
|
+
reject(signal?.reason);
|
|
4205
|
+
};
|
|
4206
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
4207
|
+
});
|
|
4208
|
+
}
|
|
4209
|
+
async function exportAuditLogs(client, filters = {}, options = {}) {
|
|
4210
|
+
const call = {
|
|
4211
|
+
...options.signal !== void 0 ? { signal: options.signal } : {}
|
|
4212
|
+
};
|
|
4213
|
+
const created = await client.auditLogs.exports.create(filters, {
|
|
4214
|
+
...call,
|
|
4215
|
+
...options.idempotencyKey !== void 0 ? { idempotencyKey: options.idempotencyKey } : {}
|
|
4216
|
+
});
|
|
4217
|
+
const deadline = Date.now() + (options.timeoutMs ?? 6e5);
|
|
4218
|
+
const interval = Math.max(0, options.pollIntervalMs ?? 2e3);
|
|
4219
|
+
let current = created.data;
|
|
4220
|
+
for (; ; ) {
|
|
4221
|
+
switch (current.state) {
|
|
4222
|
+
case "ready":
|
|
4223
|
+
return current;
|
|
4224
|
+
case "failed":
|
|
4225
|
+
case "expired":
|
|
4226
|
+
throw new AuditLogExportError(`Audit log export ${current.id} is ${current.state}.`, current);
|
|
4227
|
+
}
|
|
4228
|
+
if (Date.now() >= deadline) {
|
|
4229
|
+
throw new AuditLogExportError(`Audit log export ${current.id} was not ready in time.`, current);
|
|
4230
|
+
}
|
|
4231
|
+
await sleep2(interval, options.signal);
|
|
4232
|
+
current = (await client.auditLogs.exports.get(current.id, call)).data;
|
|
4233
|
+
}
|
|
4234
|
+
}
|
|
4235
|
+
var encoder2 = new TextEncoder();
|
|
4236
|
+
function compareBytes(a, b) {
|
|
4237
|
+
const x = encoder2.encode(a);
|
|
4238
|
+
const y = encoder2.encode(b);
|
|
4239
|
+
const n = Math.min(x.length, y.length);
|
|
4240
|
+
for (let i = 0; i < n; i++) {
|
|
4241
|
+
if (x[i] !== y[i]) return x[i] - y[i];
|
|
4242
|
+
}
|
|
4243
|
+
return x.length - y.length;
|
|
4244
|
+
}
|
|
4245
|
+
function phpFloat(value) {
|
|
4246
|
+
if (!Number.isFinite(value)) {
|
|
4247
|
+
throw new TypeError("Canonical JSON cannot encode NaN or Infinity.");
|
|
4248
|
+
}
|
|
4249
|
+
if (Object.is(value, -0)) return "-0";
|
|
4250
|
+
if (Number.isSafeInteger(value)) return String(value);
|
|
4251
|
+
const sign = value < 0 ? "-" : "";
|
|
4252
|
+
const [mantissa, exp] = Math.abs(value).toExponential().split("e");
|
|
4253
|
+
const digits = mantissa.replace(".", "");
|
|
4254
|
+
const exponent = Number(exp);
|
|
4255
|
+
const decpt = exponent + 1;
|
|
4256
|
+
if (decpt < -3 || decpt > 17) {
|
|
4257
|
+
return `${sign}${digits[0]}.${digits.slice(1) || "0"}e${exponent < 0 ? "-" : "+"}${Math.abs(exponent)}`;
|
|
4258
|
+
}
|
|
4259
|
+
if (decpt <= 0) return `${sign}0.${"0".repeat(-decpt)}${digits}`;
|
|
4260
|
+
if (decpt >= digits.length) return `${sign}${digits}${"0".repeat(decpt - digits.length)}`;
|
|
4261
|
+
return `${sign}${digits.slice(0, decpt)}.${digits.slice(decpt)}`;
|
|
4262
|
+
}
|
|
4263
|
+
function canonicalJson(value) {
|
|
4264
|
+
if (value === null || value === void 0) return "null";
|
|
4265
|
+
if (typeof value === "boolean") return value ? "true" : "false";
|
|
4266
|
+
if (typeof value === "number") return phpFloat(value);
|
|
4267
|
+
if (typeof value === "string") return JSON.stringify(value).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
4268
|
+
if (Array.isArray(value)) {
|
|
4269
|
+
return `[${value.map(canonicalJson).join(",")}]`;
|
|
4270
|
+
}
|
|
4271
|
+
if (typeof value === "object") {
|
|
4272
|
+
const entries = Object.entries(value).filter(([, v]) => v !== void 0).sort(([a], [b]) => compareBytes(a, b));
|
|
4273
|
+
if (entries.length === 0) return "[]";
|
|
4274
|
+
if (entries.every(([key], index) => key === String(index))) {
|
|
4275
|
+
return `[${entries.map(([, v]) => canonicalJson(v)).join(",")}]`;
|
|
4276
|
+
}
|
|
4277
|
+
return `{${entries.map(([k, v]) => `${canonicalJson(k)}:${canonicalJson(v)}`).join(",")}}`;
|
|
4278
|
+
}
|
|
4279
|
+
throw new TypeError(`Canonical JSON cannot encode a ${typeof value}.`);
|
|
4280
|
+
}
|
|
4281
|
+
function metadataOf(value) {
|
|
4282
|
+
if (Array.isArray(value)) return value.length > 0 ? value : null;
|
|
4283
|
+
if (typeof value === "object" && value !== null) return Object.keys(value).length > 0 ? value : null;
|
|
4284
|
+
return null;
|
|
4285
|
+
}
|
|
4286
|
+
function auditEventDocument(event) {
|
|
4287
|
+
const actor = event.actor ?? {};
|
|
4288
|
+
const context = event.context ?? {};
|
|
4289
|
+
return {
|
|
4290
|
+
id: event.id,
|
|
4291
|
+
organization_id: event.organization_id,
|
|
4292
|
+
sequence: event.sequence,
|
|
4293
|
+
action: event.action,
|
|
4294
|
+
occurred_at: event.occurred_at,
|
|
4295
|
+
actor: { id: actor.id ?? null, type: actor.type ?? null, name: actor.name ?? null, metadata: metadataOf(actor.metadata) },
|
|
4296
|
+
targets: (event.targets ?? []).map((target) => ({
|
|
4297
|
+
id: target.id ?? null,
|
|
4298
|
+
type: target.type ?? null,
|
|
4299
|
+
name: target.name ?? null,
|
|
4300
|
+
metadata: metadataOf(target.metadata)
|
|
4301
|
+
})),
|
|
4302
|
+
context: { location: context.location ?? null, user_agent: context.user_agent ?? null },
|
|
4303
|
+
metadata: metadataOf(event.metadata)
|
|
4304
|
+
};
|
|
4305
|
+
}
|
|
4306
|
+
async function auditEventHash(previousHash, event) {
|
|
4307
|
+
const digest = await crypto.subtle.digest("SHA-256", encoder2.encode(previousHash + canonicalJson(auditEventDocument(event))));
|
|
4308
|
+
return Array.from(new Uint8Array(digest), (b) => b.toString(16).padStart(2, "0")).join("");
|
|
4309
|
+
}
|
|
4310
|
+
async function verifyAuditChain(events, options = {}) {
|
|
4311
|
+
const all = [];
|
|
4312
|
+
for await (const event of events) {
|
|
4313
|
+
all.push(event);
|
|
4314
|
+
}
|
|
4315
|
+
all.sort((a, b) => a.sequence - b.sequence);
|
|
4316
|
+
const first = all[0];
|
|
4317
|
+
let previous = options.previousHash ?? (first === void 0 || first.sequence === 1 ? AUDIT_CHAIN_GENESIS : first.prev_hash);
|
|
4318
|
+
let expected = first?.sequence ?? 1;
|
|
4319
|
+
let verified = 0;
|
|
4320
|
+
const result = (reason) => ({
|
|
4321
|
+
valid: reason === null,
|
|
4322
|
+
verified_count: verified,
|
|
4323
|
+
first_sequence: verified === 0 ? null : first.sequence,
|
|
4324
|
+
last_sequence: verified === 0 ? null : expected - 1,
|
|
4325
|
+
broken_at_sequence: reason === null ? null : expected,
|
|
4326
|
+
reason
|
|
4327
|
+
});
|
|
4328
|
+
for (const event of all) {
|
|
4329
|
+
if (event.sequence !== expected) return result("missing");
|
|
4330
|
+
if (event.prev_hash !== previous) return result("link");
|
|
4331
|
+
if (await auditEventHash(previous, event) !== event.hash) return result("hash");
|
|
4332
|
+
previous = event.hash;
|
|
4333
|
+
expected++;
|
|
4334
|
+
verified++;
|
|
4335
|
+
}
|
|
4336
|
+
return result(null);
|
|
4337
|
+
}
|
|
4338
|
+
async function verifyAuditLogChain(client, query, options = {}) {
|
|
4339
|
+
return verifyAuditChain(client.auditLogs.events.listAll({ ...query, order: "asc" }), options);
|
|
4340
|
+
}
|
|
4341
|
+
|
|
4342
|
+
exports.AUDIT_CHAIN_GENESIS = AUDIT_CHAIN_GENESIS;
|
|
4343
|
+
exports.AccountClient = AccountClient;
|
|
4344
|
+
exports.ApprovalDeniedError = ApprovalDeniedError;
|
|
4345
|
+
exports.ApprovalError = ApprovalError;
|
|
4346
|
+
exports.ApprovalExpiredError = ApprovalExpiredError;
|
|
4347
|
+
exports.AuditLogExportError = AuditLogExportError;
|
|
4348
|
+
exports.AuditLogger = AuditLogger;
|
|
4349
|
+
exports.CboxIdApiError = CboxIdApiError;
|
|
4350
|
+
exports.CboxIdError = CboxIdError;
|
|
4351
|
+
exports.ConfigurationError = ConfigurationError;
|
|
4352
|
+
exports.EnvironmentClient = EnvironmentClient;
|
|
4353
|
+
exports.MAX_AUDIT_BATCH = MAX_AUDIT_BATCH;
|
|
4354
|
+
exports.ManagementNetworkError = ManagementNetworkError;
|
|
4355
|
+
exports.ManagementTransport = ManagementTransport;
|
|
4356
|
+
exports.PlatformClient = PlatformClient;
|
|
4357
|
+
exports.WorkspaceClient = WorkspaceClient;
|
|
4358
|
+
exports.accountOperations = accountOperations;
|
|
4359
|
+
exports.auditEventDocument = auditEventDocument;
|
|
4360
|
+
exports.auditEventHash = auditEventHash;
|
|
4361
|
+
exports.canonicalJson = canonicalJson;
|
|
4362
|
+
exports.createDPoPSigner = createDPoPSigner;
|
|
4363
|
+
exports.environmentOperations = environmentOperations;
|
|
4364
|
+
exports.exportAuditLogs = exportAuditLogs;
|
|
4365
|
+
exports.generateDPoPKeyPair = generateDPoPKeyPair;
|
|
4366
|
+
exports.platformOperations = platformOperations;
|
|
4367
|
+
exports.retryAfterMs = retryAfterMs;
|
|
4368
|
+
exports.verifyAuditChain = verifyAuditChain;
|
|
4369
|
+
exports.verifyAuditLogChain = verifyAuditLogChain;
|
|
4370
|
+
exports.workspaceOperations = workspaceOperations;
|
|
4371
|
+
//# sourceMappingURL=management.cjs.map
|
|
4372
|
+
//# sourceMappingURL=management.cjs.map
|