@typeship-ax/cli 0.8.0 → 0.9.1
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/AGENTS.md +31 -0
- package/README.md +26 -9
- package/api.json +1875 -684
- package/api.md +352 -500
- package/dist/api-identity.d.ts +40 -0
- package/dist/api-identity.d.ts.map +1 -0
- package/dist/api-identity.js +128 -0
- package/dist/auth-profiles.d.ts +30 -0
- package/dist/auth-profiles.d.ts.map +1 -0
- package/dist/auth-profiles.js +138 -0
- package/dist/cli.js +522 -355
- package/dist/console-login-check.d.ts +21 -0
- package/dist/console-login-check.d.ts.map +1 -0
- package/dist/console-login-check.js +107 -0
- package/dist/console-login-contract.d.ts +45 -0
- package/dist/console-login-contract.d.ts.map +1 -0
- package/dist/console-login-contract.js +40 -0
- package/dist/core/http.d.ts +17 -2
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +78 -17
- package/dist/credential-storage.d.ts +24 -0
- package/dist/credential-storage.d.ts.map +1 -0
- package/dist/credential-storage.js +207 -0
- package/dist/docs.d.ts +25 -0
- package/dist/docs.d.ts.map +1 -1
- package/dist/docs.js +144 -0
- package/dist/errors.d.ts +18 -10
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +24 -14
- package/dist/index.d.ts +10 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -4
- package/dist/named-credentials.d.ts +21 -0
- package/dist/named-credentials.d.ts.map +1 -0
- package/dist/named-credentials.js +86 -0
- package/dist/oauth-login.d.ts +39 -0
- package/dist/oauth-login.d.ts.map +1 -0
- package/dist/oauth-login.js +171 -0
- package/dist/oauth-request.d.ts +21 -0
- package/dist/oauth-request.d.ts.map +1 -0
- package/dist/oauth-request.js +119 -0
- package/dist/oauth-session.d.ts +106 -0
- package/dist/oauth-session.d.ts.map +1 -0
- package/dist/oauth-session.js +244 -0
- package/dist/ops.d.ts +14 -1
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +30 -30
- package/dist/polling-login.d.ts +57 -0
- package/dist/polling-login.d.ts.map +1 -0
- package/dist/polling-login.js +204 -0
- package/dist/resources/account.d.ts +2 -2
- package/dist/resources/account.d.ts.map +1 -1
- package/dist/resources/account.js +1 -0
- package/dist/resources/api-keys.d.ts +3 -3
- package/dist/resources/api-keys.d.ts.map +1 -1
- package/dist/resources/api-keys.js +2 -0
- package/dist/resources/definition-revisions.d.ts +5 -5
- package/dist/resources/definition-revisions.d.ts.map +1 -1
- package/dist/resources/definition-revisions.js +4 -0
- package/dist/resources/definitions.d.ts +15 -4
- package/dist/resources/definitions.d.ts.map +1 -1
- package/dist/resources/definitions.js +11 -2
- package/dist/resources/generate.d.ts +14 -3
- package/dist/resources/generate.d.ts.map +1 -1
- package/dist/resources/generate.js +10 -2
- package/dist/resources/generations.d.ts +3 -3
- package/dist/resources/generations.d.ts.map +1 -1
- package/dist/resources/generations.js +2 -0
- package/dist/resources/projects.d.ts +56 -20
- package/dist/resources/projects.d.ts.map +1 -1
- package/dist/resources/projects.js +40 -4
- package/dist/resources/targets.d.ts +20 -9
- package/dist/resources/targets.d.ts.map +1 -1
- package/dist/resources/targets.js +14 -1
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +38 -22
- package/dist/types.d.ts +385 -119
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +11 -0
- package/package.json +2 -1
- package/src/api-identity.ts +98 -0
- package/src/auth-profiles.ts +114 -0
- package/src/cli.ts +444 -332
- package/src/console-login-check.ts +88 -0
- package/src/console-login-contract.ts +65 -0
- package/src/core/http.ts +88 -19
- package/src/credential-storage.ts +183 -0
- package/src/docs.ts +138 -0
- package/src/errors.ts +26 -15
- package/src/index.ts +29 -4
- package/src/named-credentials.ts +74 -0
- package/src/oauth-login.ts +184 -0
- package/src/oauth-request.ts +90 -0
- package/src/oauth-session.ts +258 -0
- package/src/ops.ts +44 -31
- package/src/polling-login.ts +165 -0
- package/src/resources/account.ts +3 -0
- package/src/resources/api-keys.ts +5 -0
- package/src/resources/definition-revisions.ts +9 -0
- package/src/resources/definitions.ts +25 -0
- package/src/resources/generate.ts +23 -0
- package/src/resources/generations.ts +5 -0
- package/src/resources/projects.ts +95 -7
- package/src/resources/targets.ts +32 -0
- package/src/schemas.ts +38 -22
- package/src/types.ts +404 -119
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare class LoginPollingError extends Error {
|
|
2
|
+
readonly code: "cancelled" | "expired" | "denied" | "invalid_response" | "request_failed";
|
|
3
|
+
constructor(code: "cancelled" | "expired" | "denied" | "invalid_response" | "request_failed");
|
|
4
|
+
}
|
|
5
|
+
export declare function loginEndpoint(value: string): URL;
|
|
6
|
+
export interface DeviceLoginConfig {
|
|
7
|
+
clientId: string;
|
|
8
|
+
issuer?: string | null;
|
|
9
|
+
discoveryUrls: string[];
|
|
10
|
+
deviceUrl?: string | null;
|
|
11
|
+
tokenUrl?: string | null;
|
|
12
|
+
scopes: string[];
|
|
13
|
+
audience?: string;
|
|
14
|
+
resource?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface DeviceLoginSession {
|
|
17
|
+
accessToken: string;
|
|
18
|
+
refreshToken?: string;
|
|
19
|
+
expiresAt?: number;
|
|
20
|
+
tokenUrl: string;
|
|
21
|
+
issuer?: string;
|
|
22
|
+
clientId: string;
|
|
23
|
+
revocationUrl?: string;
|
|
24
|
+
scopes?: string[];
|
|
25
|
+
}
|
|
26
|
+
/** RFC 8628: pending and slow_down are the only responses that keep polling.
|
|
27
|
+
* All deadlines include response bodies; cancellation also interrupts waits. */
|
|
28
|
+
export declare function oauthDeviceLogin(config: DeviceLoginConfig, interaction: {
|
|
29
|
+
authorize(value: {
|
|
30
|
+
verificationUri: string;
|
|
31
|
+
userCode: string;
|
|
32
|
+
expiresIn: number;
|
|
33
|
+
}): void;
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
timeoutMs?: number;
|
|
36
|
+
}): Promise<DeviceLoginSession>;
|
|
37
|
+
export interface ApprovedCredential {
|
|
38
|
+
api_key: string;
|
|
39
|
+
key_name: string;
|
|
40
|
+
org_id?: string;
|
|
41
|
+
revocationUrl: string;
|
|
42
|
+
}
|
|
43
|
+
/** This is the owner's custom approval contract, not an OAuth grant. A failed
|
|
44
|
+
* poll is not replayed: its one-use credential may already have been consumed. */
|
|
45
|
+
export declare function customBrowserApproval(config: {
|
|
46
|
+
authUrl: string;
|
|
47
|
+
name: string;
|
|
48
|
+
source: "agent" | "cli";
|
|
49
|
+
}, interaction: {
|
|
50
|
+
authorize(value: {
|
|
51
|
+
verificationUrl: string;
|
|
52
|
+
expiresIn: number;
|
|
53
|
+
}): void;
|
|
54
|
+
signal?: AbortSignal;
|
|
55
|
+
timeoutMs?: number;
|
|
56
|
+
}): Promise<ApprovedCredential>;
|
|
57
|
+
//# sourceMappingURL=polling-login.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polling-login.d.ts","sourceRoot":"","sources":["../src/polling-login.ts"],"names":[],"mappings":"AAGA,qBAAa,iBAAkB,SAAQ,KAAK;IAC9B,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,kBAAkB,GAAG,gBAAgB;gBAAhF,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,kBAAkB,GAAG,gBAAgB;CAItG;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAQhD;AAkCD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAC;IAClE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpD,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACxD;AACD,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC/D,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CAChG;AAED;gFACgF;AAChF,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE;IAC7E,SAAS,CAAC,KAAK,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACzF,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC1C,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAsD9B;AAED,MAAM,WAAW,kBAAkB;IAAG,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE;AAEjH;kFACkF;AAClF,wBAAsB,qBAAqB,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,GAAG,KAAK,CAAA;CAAE,EAAE,WAAW,EAAE;IAC3H,SAAS,CAAC,KAAK,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACvE,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC1C,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAkC9B"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
2
|
+
import { oauthJsonRequest, oauthDeviceRequest, OAuthResponseError } from "./oauth-request.js";
|
|
3
|
+
export class LoginPollingError extends Error {
|
|
4
|
+
code;
|
|
5
|
+
constructor(code) {
|
|
6
|
+
super({ cancelled: "Login was cancelled.", expired: "Login expired. Run login again and approve the new request.", denied: "Login was denied. Run login again if you want to retry.", invalid_response: "The login service returned an invalid response. Check its configuration.", request_failed: "The login request failed. Check the service and start a new login." }[code]);
|
|
7
|
+
this.code = code;
|
|
8
|
+
this.name = "LoginPollingError";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export function loginEndpoint(value) {
|
|
12
|
+
try {
|
|
13
|
+
if (typeof value !== "string" || /[\x00-\x20\x7f]/.test(value))
|
|
14
|
+
throw new Error();
|
|
15
|
+
const url = new URL(value);
|
|
16
|
+
const local = ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname);
|
|
17
|
+
if ((url.protocol !== "https:" && !(url.protocol === "http:" && local)) || url.username || url.password || url.hash)
|
|
18
|
+
throw new Error();
|
|
19
|
+
return url;
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
throw new LoginPollingError("invalid_response");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function text(value, limit = 65_536) {
|
|
26
|
+
return typeof value === "string" && value.trim().length > 0 && value.length <= limit && !/[\x00-\x1f\x7f]/.test(value);
|
|
27
|
+
}
|
|
28
|
+
function seconds(value) {
|
|
29
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0 && Number.isSafeInteger(Math.ceil(value * 1000));
|
|
30
|
+
}
|
|
31
|
+
function interval(value, fallback) {
|
|
32
|
+
if (value === undefined)
|
|
33
|
+
return fallback * 1000;
|
|
34
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value < 0 || !Number.isSafeInteger(Math.ceil(value * 1000)))
|
|
35
|
+
throw new LoginPollingError("invalid_response");
|
|
36
|
+
return Math.max(1, value) * 1000;
|
|
37
|
+
}
|
|
38
|
+
function lifetime(signal, timeoutMs, maximum) {
|
|
39
|
+
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0 || timeoutMs > maximum)
|
|
40
|
+
throw new LoginPollingError("invalid_response");
|
|
41
|
+
const controller = new AbortController();
|
|
42
|
+
let expired = false;
|
|
43
|
+
const cancel = () => controller.abort();
|
|
44
|
+
const timer = setTimeout(() => { expired = true; controller.abort(); }, timeoutMs);
|
|
45
|
+
signal?.addEventListener("abort", cancel, { once: true });
|
|
46
|
+
if (signal?.aborted)
|
|
47
|
+
cancel();
|
|
48
|
+
const check = () => { if (controller.signal.aborted)
|
|
49
|
+
throw new LoginPollingError(expired ? "expired" : "cancelled"); };
|
|
50
|
+
return { signal: controller.signal, check, close() { clearTimeout(timer); signal?.removeEventListener("abort", cancel); } };
|
|
51
|
+
}
|
|
52
|
+
async function pause(ms, signal) {
|
|
53
|
+
if (signal.aborted)
|
|
54
|
+
throw new LoginPollingError("cancelled");
|
|
55
|
+
await new Promise((resolve, reject) => {
|
|
56
|
+
const done = () => { clearTimeout(timer); signal.removeEventListener("abort", abort); resolve(); };
|
|
57
|
+
const abort = () => { clearTimeout(timer); signal.removeEventListener("abort", abort); reject(new LoginPollingError("cancelled")); };
|
|
58
|
+
const timer = setTimeout(done, Math.min(ms, 2_147_483_647));
|
|
59
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
const form = (params, signal) => ({ method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json" }, body: new URLSearchParams(params), signal });
|
|
63
|
+
/** RFC 8628: pending and slow_down are the only responses that keep polling.
|
|
64
|
+
* All deadlines include response bodies; cancellation also interrupts waits. */
|
|
65
|
+
export async function oauthDeviceLogin(config, interaction) {
|
|
66
|
+
const flow = lifetime(interaction.signal, interaction.timeoutMs ?? 900_000, 900_000);
|
|
67
|
+
try {
|
|
68
|
+
flow.check();
|
|
69
|
+
if (!text(config.clientId))
|
|
70
|
+
throw new LoginPollingError("invalid_response");
|
|
71
|
+
if (config.issuer && loginEndpoint(config.issuer).search)
|
|
72
|
+
throw new LoginPollingError("invalid_response");
|
|
73
|
+
let deviceUrl = config.deviceUrl ? loginEndpoint(config.deviceUrl).href : undefined;
|
|
74
|
+
let tokenUrl = config.tokenUrl ? loginEndpoint(config.tokenUrl).href : undefined;
|
|
75
|
+
let revocationUrl;
|
|
76
|
+
for (const url of config.discoveryUrls) {
|
|
77
|
+
if (deviceUrl && tokenUrl)
|
|
78
|
+
break;
|
|
79
|
+
const response = await oauthJsonRequest(loginEndpoint(url), { headers: { Accept: "application/json" }, signal: flow.signal }, 10_000);
|
|
80
|
+
if (response.status !== 200)
|
|
81
|
+
continue;
|
|
82
|
+
const data = response.data;
|
|
83
|
+
if (config.issuer && data.issuer !== config.issuer)
|
|
84
|
+
throw new LoginPollingError("invalid_response");
|
|
85
|
+
if (!deviceUrl && typeof data.device_authorization_endpoint === "string")
|
|
86
|
+
deviceUrl = loginEndpoint(data.device_authorization_endpoint).href;
|
|
87
|
+
if (!tokenUrl && typeof data.token_endpoint === "string")
|
|
88
|
+
tokenUrl = loginEndpoint(data.token_endpoint).href;
|
|
89
|
+
if (data.revocation_endpoint !== undefined)
|
|
90
|
+
revocationUrl = loginEndpoint(data.revocation_endpoint).href;
|
|
91
|
+
}
|
|
92
|
+
if (!deviceUrl || !tokenUrl)
|
|
93
|
+
throw new LoginPollingError("invalid_response");
|
|
94
|
+
const params = { ...(config.audience ? { audience: config.audience } : {}), ...(config.resource ? { resource: config.resource } : {}) };
|
|
95
|
+
const start = await oauthJsonRequest(deviceUrl, form({ client_id: config.clientId, ...(config.scopes.length ? { scope: config.scopes.join(" ") } : {}), ...params }, flow.signal));
|
|
96
|
+
const data = start.data;
|
|
97
|
+
if (start.status !== 200)
|
|
98
|
+
throw new LoginPollingError("request_failed");
|
|
99
|
+
if (!data || !text(data.device_code) || !text(data.user_code, 512) || !text(data.verification_uri, 8192) || !seconds(data.expires_in))
|
|
100
|
+
throw new LoginPollingError("invalid_response");
|
|
101
|
+
loginEndpoint(data.verification_uri);
|
|
102
|
+
const verificationUri = loginEndpoint((data.verification_uri_complete ?? data.verification_uri)).href;
|
|
103
|
+
let intervalMs = interval(data.interval, 5);
|
|
104
|
+
const expiresIn = Math.min(data.expires_in, 900), deadline = Date.now() + expiresIn * 1000;
|
|
105
|
+
interaction.authorize({ verificationUri, userCode: data.user_code, expiresIn });
|
|
106
|
+
while (true) {
|
|
107
|
+
await pause(Math.min(intervalMs, Math.max(0, deadline - Date.now())), flow.signal);
|
|
108
|
+
flow.check();
|
|
109
|
+
if (Date.now() >= deadline)
|
|
110
|
+
throw new LoginPollingError("expired");
|
|
111
|
+
let response;
|
|
112
|
+
try {
|
|
113
|
+
response = await oauthDeviceRequest(tokenUrl, form({ ...params, grant_type: "urn:ietf:params:oauth:grant-type:device_code", device_code: data.device_code, client_id: config.clientId }, flow.signal), Math.min(30_000, deadline - Date.now()));
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
flow.check();
|
|
117
|
+
if (error instanceof OAuthResponseError && error.code === "timed_out") {
|
|
118
|
+
intervalMs *= 2;
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
throw error;
|
|
122
|
+
}
|
|
123
|
+
flow.check();
|
|
124
|
+
if (Date.now() >= deadline)
|
|
125
|
+
throw new LoginPollingError("expired");
|
|
126
|
+
if (response.status === 400 && response.error === "authorization_pending")
|
|
127
|
+
continue;
|
|
128
|
+
if (response.status === 400 && response.error === "slow_down") {
|
|
129
|
+
intervalMs += 5000;
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (response.status === 400 && response.error === "access_denied")
|
|
133
|
+
throw new LoginPollingError("denied");
|
|
134
|
+
if (response.status === 400 && response.error === "expired_token")
|
|
135
|
+
throw new LoginPollingError("expired");
|
|
136
|
+
if (response.status !== 200)
|
|
137
|
+
throw new LoginPollingError("request_failed");
|
|
138
|
+
const token = response.data;
|
|
139
|
+
if (!text(token.access_token) || typeof token.token_type !== "string" || token.token_type.toLowerCase() !== "bearer" || token.error !== undefined || token.refresh_token !== undefined && !text(token.refresh_token) || token.expires_in !== undefined && !seconds(token.expires_in) || token.scope !== undefined && typeof token.scope !== "string")
|
|
140
|
+
throw new LoginPollingError("invalid_response");
|
|
141
|
+
return { accessToken: token.access_token, ...(typeof token.refresh_token === "string" ? { refreshToken: token.refresh_token } : {}), ...(typeof token.expires_in === "number" ? { expiresAt: Date.now() + token.expires_in * 1000 } : {}), clientId: config.clientId, tokenUrl, ...(config.issuer ? { issuer: config.issuer } : {}), ...(revocationUrl ? { revocationUrl } : {}), ...(typeof token.scope === "string" ? { scopes: token.scope.split(/\s+/).filter(Boolean) } : {}) };
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
flow.check();
|
|
146
|
+
throw error;
|
|
147
|
+
}
|
|
148
|
+
finally {
|
|
149
|
+
flow.close();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/** This is the owner's custom approval contract, not an OAuth grant. A failed
|
|
153
|
+
* poll is not replayed: its one-use credential may already have been consumed. */
|
|
154
|
+
export async function customBrowserApproval(config, interaction) {
|
|
155
|
+
const flow = lifetime(interaction.signal, interaction.timeoutMs ?? 600_000, 600_000);
|
|
156
|
+
try {
|
|
157
|
+
flow.check();
|
|
158
|
+
const base = loginEndpoint(config.authUrl);
|
|
159
|
+
if (base.search)
|
|
160
|
+
throw new LoginPollingError("invalid_response");
|
|
161
|
+
const url = base.href.replace(/\/$/, "");
|
|
162
|
+
const verifier = randomBytes(32).toString("base64url"), challenge = createHash("sha256").update(verifier).digest("base64url");
|
|
163
|
+
const post = (body) => ({ method: "POST", headers: { "Content-Type": "application/json", Accept: "application/json" }, body: JSON.stringify(body), signal: flow.signal });
|
|
164
|
+
const response = await oauthJsonRequest(url + "/start", post({ code_challenge: challenge, name: config.name, source: config.source }), 15_000);
|
|
165
|
+
if (response.status !== 200)
|
|
166
|
+
throw new LoginPollingError("request_failed");
|
|
167
|
+
const start = response.data;
|
|
168
|
+
if (!text(start.session) || !text(start.verification_url, 8192) || start.expires_in !== undefined && !seconds(start.expires_in))
|
|
169
|
+
throw new LoginPollingError("invalid_response");
|
|
170
|
+
const verificationUrl = loginEndpoint(start.verification_url).href;
|
|
171
|
+
const expiresIn = Math.min(typeof start.expires_in === "number" ? start.expires_in : 600, 600);
|
|
172
|
+
const intervalMs = interval(start.interval, 3), deadline = Date.now() + expiresIn * 1000;
|
|
173
|
+
interaction.authorize({ verificationUrl, expiresIn });
|
|
174
|
+
while (true) {
|
|
175
|
+
await pause(Math.min(intervalMs, Math.max(0, deadline - Date.now())), flow.signal);
|
|
176
|
+
flow.check();
|
|
177
|
+
if (Date.now() >= deadline)
|
|
178
|
+
throw new LoginPollingError("expired");
|
|
179
|
+
const result = await oauthJsonRequest(url + "/status", post({ session: start.session, code_verifier: verifier }), Math.min(15_000, deadline - Date.now()));
|
|
180
|
+
flow.check();
|
|
181
|
+
if (Date.now() >= deadline)
|
|
182
|
+
throw new LoginPollingError("expired");
|
|
183
|
+
if (result.status !== 200)
|
|
184
|
+
throw new LoginPollingError("request_failed");
|
|
185
|
+
const poll = result.data;
|
|
186
|
+
if (poll.status === "pending")
|
|
187
|
+
continue;
|
|
188
|
+
if (poll.status === "denied")
|
|
189
|
+
throw new LoginPollingError("denied");
|
|
190
|
+
if (poll.status === "expired")
|
|
191
|
+
throw new LoginPollingError("expired");
|
|
192
|
+
if (poll.status !== "complete" || !text(poll.api_key) || poll.key_name !== undefined && !text(poll.key_name, 1024) || poll.org_id !== undefined && !text(poll.org_id, 1024))
|
|
193
|
+
throw new LoginPollingError("invalid_response");
|
|
194
|
+
return { api_key: poll.api_key, key_name: typeof poll.key_name === "string" ? poll.key_name : config.name, ...(typeof poll.org_id === "string" ? { org_id: poll.org_id } : {}), revocationUrl: url + "/revoke" };
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
flow.check();
|
|
199
|
+
throw error;
|
|
200
|
+
}
|
|
201
|
+
finally {
|
|
202
|
+
flow.close();
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
|
|
2
|
-
import { TransportError, UnexpectedApiError, ValidationError, ForbiddenError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
2
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, ForbiddenError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
3
3
|
import type { AccountRead } from "../types.js";
|
|
4
4
|
export declare class AccountResource {
|
|
5
5
|
private readonly _core;
|
|
@@ -14,5 +14,5 @@ export declare class AccountResource {
|
|
|
14
14
|
retrieve(options?: RequestOptions): Promise<ApiResult<AccountRead, AccountRetrieveError>>;
|
|
15
15
|
}
|
|
16
16
|
/** Every error `retrieve` can produce, as a discriminated union. */
|
|
17
|
-
export type AccountRetrieveError = UnauthorizedError | ForbiddenError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
|
|
17
|
+
export type AccountRetrieveError = UnauthorizedError | ForbiddenError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
18
18
|
//# sourceMappingURL=account.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/resources/account.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAW,WAAW,EAAE,MAAM,aAAa,CAAC;AAExD,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;OAMG;IACG,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/resources/account.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAW,WAAW,EAAE,MAAM,aAAa,CAAC;AAExD,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;OAMG;IACG,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAC;CAWhG;AAED,oEAAoE;AACpE,MAAM,MAAM,oBAAoB,GAC5B,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
|
|
@@ -17,6 +17,7 @@ export class AccountResource {
|
|
|
17
17
|
return this._core.request({
|
|
18
18
|
method: "GET",
|
|
19
19
|
path: "/me",
|
|
20
|
+
security: [{ "apiKey": [] }],
|
|
20
21
|
errors: { "401": UnauthorizedError, "403": ForbiddenError, "429": RateLimitedError },
|
|
21
22
|
idempotent: true,
|
|
22
23
|
schemaKey: "account.retrieve",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
|
|
2
2
|
import { PagePromise } from "../core/pagination.js";
|
|
3
|
-
import { TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
3
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
4
4
|
import type { ApiKeyRead, ApiKeyResponseRead } from "../types.js";
|
|
5
5
|
export declare class ApiKeysResource {
|
|
6
6
|
private readonly _core;
|
|
@@ -36,7 +36,7 @@ export interface ApiKeysListParams {
|
|
|
36
36
|
cursor?: string;
|
|
37
37
|
}
|
|
38
38
|
/** Every error `list` can produce, as a discriminated union. */
|
|
39
|
-
export type ApiKeysListError = BadRequestError | UnauthorizedError | ForbiddenError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
|
|
39
|
+
export type ApiKeysListError = BadRequestError | UnauthorizedError | ForbiddenError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
40
40
|
/** Every error `revoke` can produce, as a discriminated union. */
|
|
41
|
-
export type ApiKeysRevokeError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
|
|
41
|
+
export type ApiKeysRevokeError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
42
42
|
//# sourceMappingURL=api-keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../src/resources/api-keys.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAY,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAIV,UAAU,EAEV,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAErB,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;;;OAQG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,UAAU,EAAE,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../src/resources/api-keys.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAY,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAIV,UAAU,EAEV,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAErB,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;;;OAQG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,UAAU,EAAE,gBAAgB,CAAC;IA4BrG;;;;;;;;OAQG;IACG,MAAM,CACV,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;CAgB9D;AAED,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,gEAAgE;AAChE,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,kEAAkE;AAClE,MAAM,MAAM,kBAAkB,GAC1B,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
|
|
@@ -20,6 +20,7 @@ export class ApiKeysResource {
|
|
|
20
20
|
return paginate(this._core, {
|
|
21
21
|
method: "GET",
|
|
22
22
|
path: "/api_keys",
|
|
23
|
+
security: [{ "apiKey": [] }],
|
|
23
24
|
query: {
|
|
24
25
|
limit: params?.limit,
|
|
25
26
|
cursor: params?.cursor,
|
|
@@ -55,6 +56,7 @@ export class ApiKeysResource {
|
|
|
55
56
|
return this._core.request({
|
|
56
57
|
method: "DELETE",
|
|
57
58
|
path: `/api_keys/${encodeURIComponent(String(apiKeyId))}`,
|
|
59
|
+
security: [{ "apiKey": [] }],
|
|
58
60
|
errors: {
|
|
59
61
|
"401": UnauthorizedError,
|
|
60
62
|
"403": ForbiddenError,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
|
|
2
2
|
import { PagePromise } from "../core/pagination.js";
|
|
3
|
-
import { TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
3
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
4
4
|
import type { DefinitionDocumentId, DefinitionId, DefinitionRevisionId, DefinitionRevisionRead, DefinitionRevisionResponseRead } from "../types.js";
|
|
5
5
|
export declare class DefinitionRevisionsResource {
|
|
6
6
|
private readonly _core;
|
|
@@ -48,11 +48,11 @@ export interface DefinitionRevisionsListParams {
|
|
|
48
48
|
cursor?: string;
|
|
49
49
|
}
|
|
50
50
|
/** Every error `list` can produce, as a discriminated union. */
|
|
51
|
-
export type DefinitionRevisionsListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
|
|
51
|
+
export type DefinitionRevisionsListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
52
52
|
/** Every error `retrieve` can produce, as a discriminated union. */
|
|
53
|
-
export type DefinitionRevisionsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
|
|
53
|
+
export type DefinitionRevisionsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
54
54
|
/** Every error `retrieveContent` can produce, as a discriminated union. */
|
|
55
|
-
export type DefinitionRevisionsRetrieveContentError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
|
|
55
|
+
export type DefinitionRevisionsRetrieveContentError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
56
56
|
/** Every error `retrieveDocumentContent` can produce, as a discriminated union. */
|
|
57
|
-
export type DefinitionRevisionsRetrieveDocumentContentError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
|
|
57
|
+
export type DefinitionRevisionsRetrieveDocumentContentError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
58
58
|
//# sourceMappingURL=definition-revisions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition-revisions.d.ts","sourceRoot":"","sources":["../../src/resources/definition-revisions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAY,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,oBAAoB,EACpB,YAAY,EAEZ,oBAAoB,EAGpB,sBAAsB,EAEtB,8BAA8B,EAC/B,MAAM,aAAa,CAAC;AAErB,qBAAa,2BAA2B;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;;;;OASG;IACH,IAAI,CACF,YAAY,EAAE,YAAY,EAC1B,MAAM,CAAC,EAAE,6BAA6B,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,sBAAsB,EAAE,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"definition-revisions.d.ts","sourceRoot":"","sources":["../../src/resources/definition-revisions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAY,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,oBAAoB,EACpB,YAAY,EAEZ,oBAAoB,EAGpB,sBAAsB,EAEtB,8BAA8B,EAC/B,MAAM,aAAa,CAAC;AAErB,qBAAa,2BAA2B;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;;;;OASG;IACH,IAAI,CACF,YAAY,EAAE,YAAY,EAC1B,MAAM,CAAC,EAAE,6BAA6B,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,sBAAsB,EAAE,4BAA4B,CAAC;IA6BpE;;;;;;OAMG;IACG,QAAQ,CACZ,oBAAoB,EAAE,oBAAoB,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,8BAA8B,EAAE,gCAAgC,CAAC,CAAC;IAiBvF;;;;;;OAMG;IACG,eAAe,CACnB,oBAAoB,EAAE,oBAAoB,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,uCAAuC,CAAC,CAAC;IAiBtE;;;OAGG;IACG,uBAAuB,CAC3B,oBAAoB,EAAE,oBAAoB,EAC1C,UAAU,EAAE,oBAAoB,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,+CAA+C,CAAC,CAAC;CAgB/E;AAED,MAAM,WAAW,6BAA6B;IAC5C,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,gEAAgE;AAChE,MAAM,MAAM,4BAA4B,GACpC,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,oEAAoE;AACpE,MAAM,MAAM,gCAAgC,GACxC,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,2EAA2E;AAC3E,MAAM,MAAM,uCAAuC,GAC/C,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,mFAAmF;AACnF,MAAM,MAAM,+CAA+C,GACvD,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
|
|
@@ -21,6 +21,7 @@ export class DefinitionRevisionsResource {
|
|
|
21
21
|
return paginate(this._core, {
|
|
22
22
|
method: "GET",
|
|
23
23
|
path: `/definitions/${encodeURIComponent(String(definitionId))}/revisions`,
|
|
24
|
+
security: [{ "apiKey": [] }],
|
|
24
25
|
query: {
|
|
25
26
|
limit: params?.limit,
|
|
26
27
|
cursor: params?.cursor,
|
|
@@ -55,6 +56,7 @@ export class DefinitionRevisionsResource {
|
|
|
55
56
|
return this._core.request({
|
|
56
57
|
method: "GET",
|
|
57
58
|
path: `/definition_revisions/${encodeURIComponent(String(definitionRevisionId))}`,
|
|
59
|
+
security: [{ "apiKey": [] }],
|
|
58
60
|
errors: {
|
|
59
61
|
"401": UnauthorizedError,
|
|
60
62
|
"403": ForbiddenError,
|
|
@@ -77,6 +79,7 @@ export class DefinitionRevisionsResource {
|
|
|
77
79
|
return this._core.request({
|
|
78
80
|
method: "GET",
|
|
79
81
|
path: `/definition_revisions/${encodeURIComponent(String(definitionRevisionId))}/content`,
|
|
82
|
+
security: [{ "apiKey": [] }],
|
|
80
83
|
errors: {
|
|
81
84
|
"401": UnauthorizedError,
|
|
82
85
|
"403": ForbiddenError,
|
|
@@ -96,6 +99,7 @@ export class DefinitionRevisionsResource {
|
|
|
96
99
|
return this._core.request({
|
|
97
100
|
method: "GET",
|
|
98
101
|
path: `/definition_revisions/${encodeURIComponent(String(definitionRevisionId))}/documents/${encodeURIComponent(String(documentId))}/content`,
|
|
102
|
+
security: [{ "apiKey": [] }],
|
|
99
103
|
errors: {
|
|
100
104
|
"401": UnauthorizedError,
|
|
101
105
|
"403": ForbiddenError,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
|
|
2
|
-
import { TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
|
|
2
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ConflictError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
|
|
3
3
|
import type { DefinitionId, DefinitionRead, DefinitionUpdateRequest } from "../types.js";
|
|
4
4
|
export declare class DefinitionsResource {
|
|
5
5
|
private readonly _core;
|
|
@@ -13,12 +13,23 @@ export declare class DefinitionsResource {
|
|
|
13
13
|
* Update and resolve a Definition
|
|
14
14
|
*
|
|
15
15
|
* Resolves the complete document graph and records a new immutable revision before saving.
|
|
16
|
+
*
|
|
17
|
+
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
16
18
|
* `PATCH /definitions/{definition_id}`
|
|
17
19
|
*/
|
|
18
|
-
update(definitionId: DefinitionId, body: DefinitionUpdateRequest, options?: RequestOptions): Promise<ApiResult<DefinitionRead, DefinitionsUpdateError>>;
|
|
20
|
+
update(definitionId: DefinitionId, body: DefinitionUpdateRequest, params?: DefinitionsUpdateParams, options?: RequestOptions): Promise<ApiResult<DefinitionRead, DefinitionsUpdateError>>;
|
|
19
21
|
}
|
|
20
22
|
/** Every error `retrieve` can produce, as a discriminated union. */
|
|
21
|
-
export type DefinitionsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
|
|
23
|
+
export type DefinitionsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
24
|
+
export interface DefinitionsUpdateParams {
|
|
25
|
+
/**
|
|
26
|
+
* Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
|
|
27
|
+
* operation; account-less generation uses a hashed network identity. Retrying the same method,
|
|
28
|
+
* path, query, and JSON body replays the original response. Reusing the key with changed intent
|
|
29
|
+
* returns 409. After expiry the key starts a new write.
|
|
30
|
+
*/
|
|
31
|
+
idempotencyKey?: string;
|
|
32
|
+
}
|
|
22
33
|
/** Every error `update` can produce, as a discriminated union. */
|
|
23
|
-
export type DefinitionsUpdateError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | UnprocessableEntityError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
|
|
34
|
+
export type DefinitionsUpdateError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | UnprocessableEntityError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
24
35
|
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/resources/definitions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAEV,YAAY,EACZ,cAAc,EACd,uBAAuB,EACxB,MAAM,aAAa,CAAC;AAErB,qBAAa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;OAGG;IACG,QAAQ,CACZ,YAAY,EAAE,YAAY,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,cAAc,EAAE,wBAAwB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/resources/definitions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAEV,YAAY,EACZ,cAAc,EACd,uBAAuB,EACxB,MAAM,aAAa,CAAC;AAErB,qBAAa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;OAGG;IACG,QAAQ,CACZ,YAAY,EAAE,YAAY,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,cAAc,EAAE,wBAAwB,CAAC,CAAC;IAiB/D;;;;;;;OAOG;IACG,MAAM,CACV,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,uBAAuB,EAC7B,MAAM,CAAC,EAAE,uBAAuB,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAAC;CAuB9D;AAED,oEAAoE;AACpE,MAAM,MAAM,wBAAwB,GAChC,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,uBAAuB;IACtC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,kEAAkE;AAClE,MAAM,MAAM,sBAAsB,GAC9B,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,aAAa,GACb,wBAAwB,GACxB,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// typeship — definitions resource.
|
|
2
2
|
// Generated by typeship — https://typeship.dev — do not edit by hand.
|
|
3
|
-
import { BadRequestError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
|
|
3
|
+
import { BadRequestError, ConflictError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
|
|
4
4
|
export class DefinitionsResource {
|
|
5
5
|
_core;
|
|
6
6
|
constructor(_core) {
|
|
@@ -14,6 +14,7 @@ export class DefinitionsResource {
|
|
|
14
14
|
return this._core.request({
|
|
15
15
|
method: "GET",
|
|
16
16
|
path: `/definitions/${encodeURIComponent(String(definitionId))}`,
|
|
17
|
+
security: [{ "apiKey": [] }],
|
|
17
18
|
errors: {
|
|
18
19
|
"401": UnauthorizedError,
|
|
19
20
|
"403": ForbiddenError,
|
|
@@ -29,21 +30,29 @@ export class DefinitionsResource {
|
|
|
29
30
|
* Update and resolve a Definition
|
|
30
31
|
*
|
|
31
32
|
* Resolves the complete document graph and records a new immutable revision before saving.
|
|
33
|
+
*
|
|
34
|
+
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
32
35
|
* `PATCH /definitions/{definition_id}`
|
|
33
36
|
*/
|
|
34
|
-
async update(definitionId, body, options) {
|
|
37
|
+
async update(definitionId, body, params, options) {
|
|
35
38
|
return this._core.request({
|
|
36
39
|
method: "PATCH",
|
|
37
40
|
path: `/definitions/${encodeURIComponent(String(definitionId))}`,
|
|
41
|
+
security: [{ "apiKey": [] }],
|
|
42
|
+
headers: {
|
|
43
|
+
"Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
|
|
44
|
+
},
|
|
38
45
|
body,
|
|
39
46
|
errors: {
|
|
40
47
|
"400": BadRequestError,
|
|
41
48
|
"401": UnauthorizedError,
|
|
42
49
|
"403": ForbiddenError,
|
|
43
50
|
"404": NotFoundError,
|
|
51
|
+
"409": ConflictError,
|
|
44
52
|
"422": UnprocessableEntityError,
|
|
45
53
|
"429": RateLimitedError,
|
|
46
54
|
},
|
|
55
|
+
idempotencyKey: "Idempotency-Key",
|
|
47
56
|
schemaKey: "definitions.update",
|
|
48
57
|
options,
|
|
49
58
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
|
|
2
|
-
import { TransportError, UnexpectedApiError, ValidationError, ApiResponseError, BadRequestError, ForbiddenError, PayloadTooLargeError, RateLimitedError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
|
|
2
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, ApiResponseError, BadRequestError, ConflictError, ForbiddenError, PayloadTooLargeError, RateLimitedError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
|
|
3
3
|
import type { GenerateRequest, GenerationResultRead } from "../types.js";
|
|
4
4
|
export declare class GenerateResource {
|
|
5
5
|
private readonly _core;
|
|
@@ -16,10 +16,21 @@ export declare class GenerateResource {
|
|
|
16
16
|
* the first 25 operations and
|
|
17
17
|
* paid plans generate the complete Definition. A present but invalid key is a
|
|
18
18
|
* 401, not a downgrade to anonymous.
|
|
19
|
+
*
|
|
20
|
+
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
19
21
|
* `POST /generate`
|
|
20
22
|
*/
|
|
21
|
-
run(body: GenerateRequest, options?: RequestOptions): Promise<ApiResult<GenerationResultRead, GenerateRunError>>;
|
|
23
|
+
run(body: GenerateRequest, params?: GenerateRunParams, options?: RequestOptions): Promise<ApiResult<GenerationResultRead, GenerateRunError>>;
|
|
24
|
+
}
|
|
25
|
+
export interface GenerateRunParams {
|
|
26
|
+
/**
|
|
27
|
+
* Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
|
|
28
|
+
* operation; account-less generation uses a hashed network identity. Retrying the same method,
|
|
29
|
+
* path, query, and JSON body replays the original response. Reusing the key with changed intent
|
|
30
|
+
* returns 409. After expiry the key starts a new write.
|
|
31
|
+
*/
|
|
32
|
+
idempotencyKey?: string;
|
|
22
33
|
}
|
|
23
34
|
/** Every error `run` can produce, as a discriminated union. */
|
|
24
|
-
export type GenerateRunError = BadRequestError | UnauthorizedError | ForbiddenError | PayloadTooLargeError | UnprocessableEntityError | RateLimitedError | ApiResponseError | UnexpectedApiError | TransportError | ValidationError;
|
|
35
|
+
export type GenerateRunError = BadRequestError | UnauthorizedError | ForbiddenError | ConflictError | PayloadTooLargeError | UnprocessableEntityError | RateLimitedError | ApiResponseError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
25
36
|
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/resources/generate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,eAAe,EAAoB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE3F,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/resources/generate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,eAAe,EAAoB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE3F,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;;;;;;;;;;OAeG;IACG,GAAG,CACP,IAAI,EAAE,eAAe,EACrB,MAAM,CAAC,EAAE,iBAAiB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,CAAC;CAwB9D;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,+DAA+D;AAC/D,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,oBAAoB,GACpB,wBAAwB,GACxB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// typeship — generate resource.
|
|
2
2
|
// Generated by typeship — https://typeship.dev — do not edit by hand.
|
|
3
|
-
import { ApiResponseError, BadRequestError, ForbiddenError, PayloadTooLargeError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
|
|
3
|
+
import { ApiResponseError, BadRequestError, ConflictError, ForbiddenError, PayloadTooLargeError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
|
|
4
4
|
export class GenerateResource {
|
|
5
5
|
_core;
|
|
6
6
|
constructor(_core) {
|
|
@@ -18,22 +18,30 @@ export class GenerateResource {
|
|
|
18
18
|
* the first 25 operations and
|
|
19
19
|
* paid plans generate the complete Definition. A present but invalid key is a
|
|
20
20
|
* 401, not a downgrade to anonymous.
|
|
21
|
+
*
|
|
22
|
+
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
21
23
|
* `POST /generate`
|
|
22
24
|
*/
|
|
23
|
-
async run(body, options) {
|
|
25
|
+
async run(body, params, options) {
|
|
24
26
|
return this._core.request({
|
|
25
27
|
method: "POST",
|
|
26
28
|
path: "/generate",
|
|
29
|
+
security: [{}, { "apiKey": [] }],
|
|
30
|
+
headers: {
|
|
31
|
+
"Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
|
|
32
|
+
},
|
|
27
33
|
body,
|
|
28
34
|
errors: {
|
|
29
35
|
"400": BadRequestError,
|
|
30
36
|
"401": UnauthorizedError,
|
|
31
37
|
"403": ForbiddenError,
|
|
38
|
+
"409": ConflictError,
|
|
32
39
|
"413": PayloadTooLargeError,
|
|
33
40
|
"422": UnprocessableEntityError,
|
|
34
41
|
"429": RateLimitedError,
|
|
35
42
|
default: ApiResponseError,
|
|
36
43
|
},
|
|
44
|
+
idempotencyKey: "Idempotency-Key",
|
|
37
45
|
schemaKey: "generate.run",
|
|
38
46
|
options,
|
|
39
47
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
|
|
2
|
-
import { TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
2
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
3
3
|
import type { GenerationId, GenerationResponseRead } from "../types.js";
|
|
4
4
|
export declare class GenerationsResource {
|
|
5
5
|
private readonly _core;
|
|
@@ -21,11 +21,11 @@ export declare class GenerationsResource {
|
|
|
21
21
|
retrieveFile(generationId: GenerationId, params: GenerationsRetrieveFileParams, options?: RequestOptions): Promise<ApiResult<string, GenerationsRetrieveFileError>>;
|
|
22
22
|
}
|
|
23
23
|
/** Every error `retrieve` can produce, as a discriminated union. */
|
|
24
|
-
export type GenerationsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
|
|
24
|
+
export type GenerationsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
25
25
|
export interface GenerationsRetrieveFileParams {
|
|
26
26
|
/** Repo-relative path inside the generated package. */
|
|
27
27
|
path: string;
|
|
28
28
|
}
|
|
29
29
|
/** Every error `retrieveFile` can produce, as a discriminated union. */
|
|
30
|
-
export type GenerationsRetrieveFileError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
|
|
30
|
+
export type GenerationsRetrieveFileError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
31
31
|
//# sourceMappingURL=generations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generations.d.ts","sourceRoot":"","sources":["../../src/resources/generations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,YAAY,EAAsB,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE5F,qBAAa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;OAKG;IACG,QAAQ,CACZ,YAAY,EAAE,YAAY,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,sBAAsB,EAAE,wBAAwB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"generations.d.ts","sourceRoot":"","sources":["../../src/resources/generations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,YAAY,EAAsB,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE5F,qBAAa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;OAKG;IACG,QAAQ,CACZ,YAAY,EAAE,YAAY,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,sBAAsB,EAAE,wBAAwB,CAAC,CAAC;IAiBvE;;;;;;OAMG;IACG,YAAY,CAChB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,6BAA6B,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC;CAoB5D;AAED,oEAAoE;AACpE,MAAM,MAAM,wBAAwB,GAChC,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,6BAA6B;IAC5C,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wEAAwE;AACxE,MAAM,MAAM,4BAA4B,GACpC,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
|
|
@@ -16,6 +16,7 @@ export class GenerationsResource {
|
|
|
16
16
|
return this._core.request({
|
|
17
17
|
method: "GET",
|
|
18
18
|
path: `/generations/${encodeURIComponent(String(generationId))}`,
|
|
19
|
+
security: [{ "apiKey": [] }],
|
|
19
20
|
errors: {
|
|
20
21
|
"401": UnauthorizedError,
|
|
21
22
|
"403": ForbiddenError,
|
|
@@ -38,6 +39,7 @@ export class GenerationsResource {
|
|
|
38
39
|
return this._core.request({
|
|
39
40
|
method: "GET",
|
|
40
41
|
path: `/generations/${encodeURIComponent(String(generationId))}/file`,
|
|
42
|
+
security: [{ "apiKey": [] }],
|
|
41
43
|
query: {
|
|
42
44
|
path: params.path,
|
|
43
45
|
},
|