@vercel/sandbox 2.0.0-beta.11 → 2.0.0-beta.13
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 +8 -0
- package/dist/_virtual/rolldown_runtime.cjs +29 -0
- package/dist/api-client/api-client.cjs +456 -0
- package/dist/api-client/api-client.cjs.map +1 -0
- package/dist/api-client/api-client.d.cts +790 -0
- package/dist/api-client/api-client.d.ts +784 -777
- package/dist/api-client/api-client.js +445 -471
- package/dist/api-client/api-client.js.map +1 -1
- package/dist/api-client/api-error.cjs +32 -0
- package/dist/api-client/api-error.cjs.map +1 -0
- package/dist/api-client/api-error.d.cts +29 -0
- package/dist/api-client/api-error.d.ts +21 -18
- package/dist/api-client/api-error.js +28 -33
- package/dist/api-client/api-error.js.map +1 -1
- package/dist/api-client/base-client.cjs +125 -0
- package/dist/api-client/base-client.cjs.map +1 -0
- package/dist/api-client/base-client.d.cts +38 -0
- package/dist/api-client/base-client.d.ts +31 -36
- package/dist/api-client/base-client.js +110 -130
- package/dist/api-client/base-client.js.map +1 -1
- package/dist/api-client/file-writer.cjs +62 -0
- package/dist/api-client/file-writer.cjs.map +1 -0
- package/dist/api-client/file-writer.d.cts +66 -0
- package/dist/api-client/file-writer.d.ts +56 -52
- package/dist/api-client/file-writer.js +57 -61
- package/dist/api-client/file-writer.js.map +1 -1
- package/dist/api-client/index.cjs +2 -0
- package/dist/api-client/index.d.ts +2 -2
- package/dist/api-client/index.js +4 -21
- package/dist/api-client/validators.cjs +182 -0
- package/dist/api-client/validators.cjs.map +1 -0
- package/dist/api-client/validators.d.cts +1469 -0
- package/dist/api-client/validators.d.ts +1282 -3699
- package/dist/api-client/validators.js +155 -170
- package/dist/api-client/validators.js.map +1 -1
- package/dist/api-client/with-retry.cjs +89 -0
- package/dist/api-client/with-retry.cjs.map +1 -0
- package/dist/api-client/with-retry.d.cts +10 -0
- package/dist/api-client/with-retry.d.ts +9 -13
- package/dist/api-client/with-retry.js +81 -102
- package/dist/api-client/with-retry.js.map +1 -1
- package/dist/auth/api.cjs +29 -0
- package/dist/auth/api.cjs.map +1 -0
- package/dist/auth/api.js +26 -25
- package/dist/auth/api.js.map +1 -1
- package/dist/auth/error.cjs +13 -0
- package/dist/auth/error.cjs.map +1 -0
- package/dist/auth/error.js +11 -11
- package/dist/auth/error.js.map +1 -1
- package/dist/auth/file.cjs +64 -0
- package/dist/auth/file.cjs.map +1 -0
- package/dist/auth/file.d.cts +26 -0
- package/dist/auth/file.d.ts +19 -15
- package/dist/auth/file.js +49 -64
- package/dist/auth/file.js.map +1 -1
- package/dist/auth/index.cjs +12 -0
- package/dist/auth/index.d.cts +5 -0
- package/dist/auth/index.d.ts +5 -6
- package/dist/auth/index.js +6 -27
- package/dist/auth/linked-project.cjs +38 -0
- package/dist/auth/linked-project.cjs.map +1 -0
- package/dist/auth/linked-project.js +30 -64
- package/dist/auth/linked-project.js.map +1 -1
- package/dist/auth/oauth.cjs +205 -0
- package/dist/auth/oauth.cjs.map +1 -0
- package/dist/auth/oauth.d.cts +135 -0
- package/dist/auth/oauth.d.ts +113 -109
- package/dist/auth/oauth.js +185 -252
- package/dist/auth/oauth.js.map +1 -1
- package/dist/auth/poll-for-token.cjs +82 -0
- package/dist/auth/poll-for-token.cjs.map +1 -0
- package/dist/auth/poll-for-token.d.cts +28 -0
- package/dist/auth/poll-for-token.d.ts +23 -15
- package/dist/auth/poll-for-token.js +79 -64
- package/dist/auth/poll-for-token.js.map +1 -1
- package/dist/auth/project.cjs +80 -0
- package/dist/auth/project.cjs.map +1 -0
- package/dist/auth/project.d.cts +44 -0
- package/dist/auth/project.d.ts +12 -8
- package/dist/auth/project.js +70 -72
- package/dist/auth/project.js.map +1 -1
- package/dist/auth/zod.cjs +22 -0
- package/dist/auth/zod.cjs.map +1 -0
- package/dist/auth/zod.js +18 -17
- package/dist/auth/zod.js.map +1 -1
- package/dist/command.cjs +328 -0
- package/dist/command.cjs.map +1 -0
- package/dist/command.d.cts +289 -0
- package/dist/command.d.ts +265 -171
- package/dist/command.js +323 -226
- package/dist/command.js.map +1 -1
- package/dist/constants.d.cts +5 -0
- package/dist/constants.d.ts +5 -1
- package/dist/index.cjs +13 -0
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -6
- package/dist/index.js +7 -17
- package/dist/network-policy.d.cts +100 -0
- package/dist/network-policy.d.ts +32 -28
- package/dist/sandbox.cjs +694 -0
- package/dist/sandbox.cjs.map +1 -0
- package/dist/sandbox.d.cts +796 -0
- package/dist/sandbox.d.ts +783 -711
- package/dist/sandbox.js +684 -615
- package/dist/sandbox.js.map +1 -1
- package/dist/session.cjs +520 -0
- package/dist/session.cjs.map +1 -0
- package/dist/session.d.cts +406 -0
- package/dist/session.d.ts +398 -367
- package/dist/session.js +517 -505
- package/dist/session.js.map +1 -1
- package/dist/snapshot.cjs +116 -0
- package/dist/snapshot.cjs.map +1 -0
- package/dist/snapshot.d.cts +107 -0
- package/dist/snapshot.d.ts +98 -91
- package/dist/snapshot.js +114 -115
- package/dist/snapshot.js.map +1 -1
- package/dist/utils/array.cjs +17 -0
- package/dist/utils/array.cjs.map +1 -0
- package/dist/utils/array.js +12 -15
- package/dist/utils/array.js.map +1 -1
- package/dist/utils/consume-readable.cjs +18 -0
- package/dist/utils/consume-readable.cjs.map +1 -0
- package/dist/utils/consume-readable.js +13 -12
- package/dist/utils/consume-readable.js.map +1 -1
- package/dist/utils/decode-base64-url.cjs +15 -0
- package/dist/utils/decode-base64-url.cjs.map +1 -0
- package/dist/utils/decode-base64-url.js +10 -9
- package/dist/utils/decode-base64-url.js.map +1 -1
- package/dist/utils/dev-credentials.cjs +142 -0
- package/dist/utils/dev-credentials.cjs.map +1 -0
- package/dist/utils/dev-credentials.js +126 -184
- package/dist/utils/dev-credentials.js.map +1 -1
- package/dist/utils/get-credentials.cjs +123 -0
- package/dist/utils/get-credentials.cjs.map +1 -0
- package/dist/utils/get-credentials.d.cts +21 -0
- package/dist/utils/get-credentials.d.ts +19 -61
- package/dist/utils/get-credentials.js +106 -140
- package/dist/utils/get-credentials.js.map +1 -1
- package/dist/utils/log.cjs +25 -0
- package/dist/utils/log.cjs.map +1 -0
- package/dist/utils/log.js +15 -17
- package/dist/utils/log.js.map +1 -1
- package/dist/utils/network-policy.cjs +65 -0
- package/dist/utils/network-policy.cjs.map +1 -0
- package/dist/utils/network-policy.js +58 -77
- package/dist/utils/network-policy.js.map +1 -1
- package/dist/utils/normalizePath.cjs +27 -0
- package/dist/utils/normalizePath.cjs.map +1 -0
- package/dist/utils/normalizePath.js +21 -28
- package/dist/utils/normalizePath.js.map +1 -1
- package/dist/utils/resolveSignal.cjs +20 -0
- package/dist/utils/resolveSignal.cjs.map +1 -0
- package/dist/utils/resolveSignal.d.cts +15 -0
- package/dist/utils/resolveSignal.d.ts +12 -10
- package/dist/utils/resolveSignal.js +14 -17
- package/dist/utils/resolveSignal.js.map +1 -1
- package/dist/utils/sandbox-snapshot.cjs +14 -0
- package/dist/utils/sandbox-snapshot.cjs.map +1 -0
- package/dist/utils/sandbox-snapshot.d.cts +10 -0
- package/dist/utils/sandbox-snapshot.d.ts +11 -0
- package/dist/utils/sandbox-snapshot.js +14 -0
- package/dist/utils/sandbox-snapshot.js.map +1 -0
- package/dist/utils/types.cjs +13 -0
- package/dist/utils/types.cjs.map +1 -0
- package/dist/utils/types.d.cts +11 -0
- package/dist/utils/types.d.ts +5 -7
- package/dist/utils/types.js +8 -8
- package/dist/utils/types.js.map +1 -1
- package/dist/version.cjs +7 -0
- package/dist/version.cjs.map +1 -0
- package/dist/version.js +5 -5
- package/dist/version.js.map +1 -1
- package/package.json +23 -3
- package/dist/api-client/index.js.map +0 -1
- package/dist/auth/api.d.ts +0 -6
- package/dist/auth/error.d.ts +0 -11
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/linked-project.d.ts +0 -10
- package/dist/auth/zod.d.ts +0 -5
- package/dist/constants.js +0 -3
- package/dist/constants.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/network-policy.js +0 -3
- package/dist/network-policy.js.map +0 -1
- package/dist/utils/array.d.ts +0 -9
- package/dist/utils/consume-readable.d.ts +0 -5
- package/dist/utils/convert-sandbox.d.ts +0 -6
- package/dist/utils/convert-sandbox.js +0 -14
- package/dist/utils/convert-sandbox.js.map +0 -1
- package/dist/utils/decode-base64-url.d.ts +0 -7
- package/dist/utils/dev-credentials.d.ts +0 -37
- package/dist/utils/log.d.ts +0 -2
- package/dist/utils/network-policy.d.ts +0 -7
- package/dist/utils/normalizePath.d.ts +0 -17
- package/dist/version.d.ts +0 -1
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/auth/oauth.d.ts
|
|
4
|
+
declare const IntrospectionResponse: z.ZodUnion<[z.ZodObject<{
|
|
5
|
+
active: z.ZodLiteral<true>;
|
|
6
|
+
client_id: z.ZodString;
|
|
7
|
+
session_id: z.ZodString;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
active: true;
|
|
10
|
+
client_id: string;
|
|
11
|
+
session_id: string;
|
|
12
|
+
}, {
|
|
13
|
+
active: true;
|
|
14
|
+
client_id: string;
|
|
15
|
+
session_id: string;
|
|
16
|
+
}>, z.ZodObject<{
|
|
17
|
+
active: z.ZodLiteral<false>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
active: false;
|
|
20
|
+
}, {
|
|
21
|
+
active: false;
|
|
22
|
+
}>]>;
|
|
23
|
+
declare function OAuth(): Promise<{
|
|
24
|
+
/**
|
|
25
|
+
* Perform the Device Authorization Request
|
|
26
|
+
*
|
|
27
|
+
* @see https://datatracker.ietf.org/doc/html/rfc8628#section-3.1
|
|
28
|
+
* @see https://datatracker.ietf.org/doc/html/rfc8628#section-3.2
|
|
29
|
+
*/
|
|
30
|
+
deviceAuthorizationRequest(): Promise<DeviceAuthorizationRequest>;
|
|
31
|
+
/**
|
|
32
|
+
* Perform the Device Access Token Request
|
|
33
|
+
*
|
|
34
|
+
* @see https://datatracker.ietf.org/doc/html/rfc8628#section-3.4
|
|
35
|
+
*/
|
|
36
|
+
deviceAccessTokenRequest(device_code: string): Promise<[Error] | [null, Response]>;
|
|
37
|
+
/**
|
|
38
|
+
* Process the Token request Response
|
|
39
|
+
*
|
|
40
|
+
* @see https://datatracker.ietf.org/doc/html/rfc8628#section-3.5
|
|
41
|
+
*/
|
|
42
|
+
processTokenResponse(response: Response): Promise<[OAuthError] | [null, TokenSet]>;
|
|
43
|
+
/**
|
|
44
|
+
* Perform a Token Revocation Request.
|
|
45
|
+
*
|
|
46
|
+
* @see https://datatracker.ietf.org/doc/html/rfc7009#section-2.1
|
|
47
|
+
* @see https://datatracker.ietf.org/doc/html/rfc7009#section-2.2
|
|
48
|
+
*/
|
|
49
|
+
revokeToken(token: string): Promise<OAuthError | void>;
|
|
50
|
+
/**
|
|
51
|
+
* Perform Refresh Token Request.
|
|
52
|
+
*
|
|
53
|
+
* @see https://datatracker.ietf.org/doc/html/rfc6749#section-6
|
|
54
|
+
*/
|
|
55
|
+
refreshToken(token: string): Promise<TokenSet>;
|
|
56
|
+
/**
|
|
57
|
+
* Perform Token Introspection Request.
|
|
58
|
+
*
|
|
59
|
+
* @see https://datatracker.ietf.org/doc/html/rfc7662#section-2.1
|
|
60
|
+
*/
|
|
61
|
+
introspectToken(token: string): Promise<z.infer<typeof IntrospectionResponse>>;
|
|
62
|
+
}>;
|
|
63
|
+
type OAuth = Awaited<ReturnType<typeof OAuth>>;
|
|
64
|
+
declare const TokenSet: z.ZodObject<{
|
|
65
|
+
/** The access token issued by the authorization server. */
|
|
66
|
+
access_token: z.ZodString;
|
|
67
|
+
/** The type of the token issued */
|
|
68
|
+
token_type: z.ZodLiteral<"Bearer">;
|
|
69
|
+
/** The lifetime in seconds of the access token. */
|
|
70
|
+
expires_in: z.ZodNumber;
|
|
71
|
+
/** The refresh token, which can be used to obtain new access tokens. */
|
|
72
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
73
|
+
/** The scope of the access token. */
|
|
74
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
access_token: string;
|
|
77
|
+
token_type: "Bearer";
|
|
78
|
+
expires_in: number;
|
|
79
|
+
refresh_token?: string | undefined;
|
|
80
|
+
scope?: string | undefined;
|
|
81
|
+
}, {
|
|
82
|
+
access_token: string;
|
|
83
|
+
token_type: "Bearer";
|
|
84
|
+
expires_in: number;
|
|
85
|
+
refresh_token?: string | undefined;
|
|
86
|
+
scope?: string | undefined;
|
|
87
|
+
}>;
|
|
88
|
+
type TokenSet = z.infer<typeof TokenSet>;
|
|
89
|
+
declare const OAuthErrorResponse: z.ZodObject<{
|
|
90
|
+
error: z.ZodEnum<["invalid_request", "invalid_client", "invalid_grant", "unauthorized_client", "unsupported_grant_type", "invalid_scope", "server_error", "authorization_pending", "slow_down", "access_denied", "expired_token", "unsupported_token_type"]>;
|
|
91
|
+
error_description: z.ZodOptional<z.ZodString>;
|
|
92
|
+
error_uri: z.ZodOptional<z.ZodString>;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
error: "invalid_request" | "invalid_client" | "invalid_grant" | "unauthorized_client" | "unsupported_grant_type" | "invalid_scope" | "server_error" | "authorization_pending" | "slow_down" | "access_denied" | "expired_token" | "unsupported_token_type";
|
|
95
|
+
error_description?: string | undefined;
|
|
96
|
+
error_uri?: string | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
error: "invalid_request" | "invalid_client" | "invalid_grant" | "unauthorized_client" | "unsupported_grant_type" | "invalid_scope" | "server_error" | "authorization_pending" | "slow_down" | "access_denied" | "expired_token" | "unsupported_token_type";
|
|
99
|
+
error_description?: string | undefined;
|
|
100
|
+
error_uri?: string | undefined;
|
|
101
|
+
}>;
|
|
102
|
+
type OAuthErrorResponse = z.infer<typeof OAuthErrorResponse>;
|
|
103
|
+
declare class OAuthError extends Error {
|
|
104
|
+
name: string;
|
|
105
|
+
code: OAuthErrorResponse["error"];
|
|
106
|
+
cause: Error;
|
|
107
|
+
constructor(message: string, response: unknown);
|
|
108
|
+
}
|
|
109
|
+
declare function isOAuthError(error: unknown): error is OAuthError;
|
|
110
|
+
interface DeviceAuthorizationRequest {
|
|
111
|
+
/** The device verification code. */
|
|
112
|
+
device_code: string;
|
|
113
|
+
/** The end-user verification code. */
|
|
114
|
+
user_code: string;
|
|
115
|
+
/**
|
|
116
|
+
* The minimum amount of time in seconds that the client
|
|
117
|
+
* SHOULD wait between polling requests to the token endpoint.
|
|
118
|
+
*/
|
|
119
|
+
interval: number;
|
|
120
|
+
/** The end-user verification URI on the authorization server. */
|
|
121
|
+
verification_uri: string;
|
|
122
|
+
/**
|
|
123
|
+
* The end-user verification URI on the authorization server,
|
|
124
|
+
* including the `user_code`, without redirection.
|
|
125
|
+
*/
|
|
126
|
+
verification_uri_complete: string;
|
|
127
|
+
/**
|
|
128
|
+
* The absolute lifetime of the `device_code` and `user_code`.
|
|
129
|
+
* Calculated from `expires_in`.
|
|
130
|
+
*/
|
|
131
|
+
expiresAt: number;
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
134
|
+
export { DeviceAuthorizationRequest, OAuth, isOAuthError };
|
|
135
|
+
//# sourceMappingURL=oauth.d.cts.map
|
package/dist/auth/oauth.d.ts
CHANGED
|
@@ -1,131 +1,135 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/auth/oauth.d.ts
|
|
2
4
|
declare const IntrospectionResponse: z.ZodUnion<[z.ZodObject<{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
active: z.ZodLiteral<true>;
|
|
6
|
+
client_id: z.ZodString;
|
|
7
|
+
session_id: z.ZodString;
|
|
6
8
|
}, "strip", z.ZodTypeAny, {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
active: true;
|
|
10
|
+
client_id: string;
|
|
11
|
+
session_id: string;
|
|
10
12
|
}, {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
active: true;
|
|
14
|
+
client_id: string;
|
|
15
|
+
session_id: string;
|
|
14
16
|
}>, z.ZodObject<{
|
|
15
|
-
|
|
17
|
+
active: z.ZodLiteral<false>;
|
|
16
18
|
}, "strip", z.ZodTypeAny, {
|
|
17
|
-
|
|
19
|
+
active: false;
|
|
18
20
|
}, {
|
|
19
|
-
|
|
21
|
+
active: false;
|
|
20
22
|
}>]>;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
23
|
+
declare function OAuth(): Promise<{
|
|
24
|
+
/**
|
|
25
|
+
* Perform the Device Authorization Request
|
|
26
|
+
*
|
|
27
|
+
* @see https://datatracker.ietf.org/doc/html/rfc8628#section-3.1
|
|
28
|
+
* @see https://datatracker.ietf.org/doc/html/rfc8628#section-3.2
|
|
29
|
+
*/
|
|
30
|
+
deviceAuthorizationRequest(): Promise<DeviceAuthorizationRequest>;
|
|
31
|
+
/**
|
|
32
|
+
* Perform the Device Access Token Request
|
|
33
|
+
*
|
|
34
|
+
* @see https://datatracker.ietf.org/doc/html/rfc8628#section-3.4
|
|
35
|
+
*/
|
|
36
|
+
deviceAccessTokenRequest(device_code: string): Promise<[Error] | [null, Response]>;
|
|
37
|
+
/**
|
|
38
|
+
* Process the Token request Response
|
|
39
|
+
*
|
|
40
|
+
* @see https://datatracker.ietf.org/doc/html/rfc8628#section-3.5
|
|
41
|
+
*/
|
|
42
|
+
processTokenResponse(response: Response): Promise<[OAuthError] | [null, TokenSet]>;
|
|
43
|
+
/**
|
|
44
|
+
* Perform a Token Revocation Request.
|
|
45
|
+
*
|
|
46
|
+
* @see https://datatracker.ietf.org/doc/html/rfc7009#section-2.1
|
|
47
|
+
* @see https://datatracker.ietf.org/doc/html/rfc7009#section-2.2
|
|
48
|
+
*/
|
|
49
|
+
revokeToken(token: string): Promise<OAuthError | void>;
|
|
50
|
+
/**
|
|
51
|
+
* Perform Refresh Token Request.
|
|
52
|
+
*
|
|
53
|
+
* @see https://datatracker.ietf.org/doc/html/rfc6749#section-6
|
|
54
|
+
*/
|
|
55
|
+
refreshToken(token: string): Promise<TokenSet>;
|
|
56
|
+
/**
|
|
57
|
+
* Perform Token Introspection Request.
|
|
58
|
+
*
|
|
59
|
+
* @see https://datatracker.ietf.org/doc/html/rfc7662#section-2.1
|
|
60
|
+
*/
|
|
61
|
+
introspectToken(token: string): Promise<z.infer<typeof IntrospectionResponse>>;
|
|
60
62
|
}>;
|
|
61
|
-
|
|
63
|
+
type OAuth = Awaited<ReturnType<typeof OAuth>>;
|
|
62
64
|
declare const TokenSet: z.ZodObject<{
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
/** The access token issued by the authorization server. */
|
|
66
|
+
access_token: z.ZodString;
|
|
67
|
+
/** The type of the token issued */
|
|
68
|
+
token_type: z.ZodLiteral<"Bearer">;
|
|
69
|
+
/** The lifetime in seconds of the access token. */
|
|
70
|
+
expires_in: z.ZodNumber;
|
|
71
|
+
/** The refresh token, which can be used to obtain new access tokens. */
|
|
72
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
73
|
+
/** The scope of the access token. */
|
|
74
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
73
75
|
}, "strip", z.ZodTypeAny, {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
access_token: string;
|
|
77
|
+
token_type: "Bearer";
|
|
78
|
+
expires_in: number;
|
|
79
|
+
refresh_token?: string | undefined;
|
|
80
|
+
scope?: string | undefined;
|
|
79
81
|
}, {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
access_token: string;
|
|
83
|
+
token_type: "Bearer";
|
|
84
|
+
expires_in: number;
|
|
85
|
+
refresh_token?: string | undefined;
|
|
86
|
+
scope?: string | undefined;
|
|
85
87
|
}>;
|
|
86
88
|
type TokenSet = z.infer<typeof TokenSet>;
|
|
87
89
|
declare const OAuthErrorResponse: z.ZodObject<{
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
error: z.ZodEnum<["invalid_request", "invalid_client", "invalid_grant", "unauthorized_client", "unsupported_grant_type", "invalid_scope", "server_error", "authorization_pending", "slow_down", "access_denied", "expired_token", "unsupported_token_type"]>;
|
|
91
|
+
error_description: z.ZodOptional<z.ZodString>;
|
|
92
|
+
error_uri: z.ZodOptional<z.ZodString>;
|
|
91
93
|
}, "strip", z.ZodTypeAny, {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
error: "invalid_request" | "invalid_client" | "invalid_grant" | "unauthorized_client" | "unsupported_grant_type" | "invalid_scope" | "server_error" | "authorization_pending" | "slow_down" | "access_denied" | "expired_token" | "unsupported_token_type";
|
|
95
|
+
error_description?: string | undefined;
|
|
96
|
+
error_uri?: string | undefined;
|
|
95
97
|
}, {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
error: "invalid_request" | "invalid_client" | "invalid_grant" | "unauthorized_client" | "unsupported_grant_type" | "invalid_scope" | "server_error" | "authorization_pending" | "slow_down" | "access_denied" | "expired_token" | "unsupported_token_type";
|
|
99
|
+
error_description?: string | undefined;
|
|
100
|
+
error_uri?: string | undefined;
|
|
99
101
|
}>;
|
|
100
102
|
type OAuthErrorResponse = z.infer<typeof OAuthErrorResponse>;
|
|
101
103
|
declare class OAuthError extends Error {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
name: string;
|
|
105
|
+
code: OAuthErrorResponse["error"];
|
|
106
|
+
cause: Error;
|
|
107
|
+
constructor(message: string, response: unknown);
|
|
106
108
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
109
|
+
declare function isOAuthError(error: unknown): error is OAuthError;
|
|
110
|
+
interface DeviceAuthorizationRequest {
|
|
111
|
+
/** The device verification code. */
|
|
112
|
+
device_code: string;
|
|
113
|
+
/** The end-user verification code. */
|
|
114
|
+
user_code: string;
|
|
115
|
+
/**
|
|
116
|
+
* The minimum amount of time in seconds that the client
|
|
117
|
+
* SHOULD wait between polling requests to the token endpoint.
|
|
118
|
+
*/
|
|
119
|
+
interval: number;
|
|
120
|
+
/** The end-user verification URI on the authorization server. */
|
|
121
|
+
verification_uri: string;
|
|
122
|
+
/**
|
|
123
|
+
* The end-user verification URI on the authorization server,
|
|
124
|
+
* including the `user_code`, without redirection.
|
|
125
|
+
*/
|
|
126
|
+
verification_uri_complete: string;
|
|
127
|
+
/**
|
|
128
|
+
* The absolute lifetime of the `device_code` and `user_code`.
|
|
129
|
+
* Calculated from `expires_in`.
|
|
130
|
+
*/
|
|
131
|
+
expiresAt: number;
|
|
130
132
|
}
|
|
131
|
-
|
|
133
|
+
//#endregion
|
|
134
|
+
export { DeviceAuthorizationRequest, OAuth, isOAuthError };
|
|
135
|
+
//# sourceMappingURL=oauth.d.ts.map
|