@vercel/sandbox 1.8.1 → 1.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.
Files changed (190) hide show
  1. package/README.md +8 -0
  2. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  3. package/dist/api-client/api-client.cjs +375 -0
  4. package/dist/api-client/api-client.cjs.map +1 -0
  5. package/dist/api-client/api-client.d.cts +403 -0
  6. package/dist/api-client/api-client.d.ts +397 -391
  7. package/dist/api-client/api-client.js +365 -404
  8. package/dist/api-client/api-client.js.map +1 -1
  9. package/dist/api-client/api-error.cjs +31 -0
  10. package/dist/api-client/api-error.cjs.map +1 -0
  11. package/dist/api-client/api-error.d.cts +27 -0
  12. package/dist/api-client/api-error.d.ts +19 -16
  13. package/dist/api-client/api-error.js +27 -32
  14. package/dist/api-client/api-error.js.map +1 -1
  15. package/dist/api-client/base-client.cjs +113 -0
  16. package/dist/api-client/base-client.cjs.map +1 -0
  17. package/dist/api-client/base-client.d.cts +38 -0
  18. package/dist/api-client/base-client.d.ts +31 -36
  19. package/dist/api-client/base-client.js +101 -118
  20. package/dist/api-client/base-client.js.map +1 -1
  21. package/dist/api-client/file-writer.cjs +62 -0
  22. package/dist/api-client/file-writer.cjs.map +1 -0
  23. package/dist/api-client/file-writer.d.cts +66 -0
  24. package/dist/api-client/file-writer.d.ts +56 -42
  25. package/dist/api-client/file-writer.js +57 -61
  26. package/dist/api-client/file-writer.js.map +1 -1
  27. package/dist/api-client/index.cjs +2 -0
  28. package/dist/api-client/index.d.ts +2 -2
  29. package/dist/api-client/index.js +4 -21
  30. package/dist/api-client/validators.cjs +149 -0
  31. package/dist/api-client/validators.cjs.map +1 -0
  32. package/dist/api-client/validators.d.cts +1677 -0
  33. package/dist/api-client/validators.d.ts +1501 -2412
  34. package/dist/api-client/validators.js +124 -154
  35. package/dist/api-client/validators.js.map +1 -1
  36. package/dist/api-client/with-retry.cjs +89 -0
  37. package/dist/api-client/with-retry.cjs.map +1 -0
  38. package/dist/api-client/with-retry.d.cts +10 -0
  39. package/dist/api-client/with-retry.d.ts +9 -13
  40. package/dist/api-client/with-retry.js +81 -102
  41. package/dist/api-client/with-retry.js.map +1 -1
  42. package/dist/auth/api.cjs +29 -0
  43. package/dist/auth/api.cjs.map +1 -0
  44. package/dist/auth/api.js +26 -25
  45. package/dist/auth/api.js.map +1 -1
  46. package/dist/auth/error.cjs +13 -0
  47. package/dist/auth/error.cjs.map +1 -0
  48. package/dist/auth/error.js +11 -11
  49. package/dist/auth/error.js.map +1 -1
  50. package/dist/auth/file.cjs +64 -0
  51. package/dist/auth/file.cjs.map +1 -0
  52. package/dist/auth/file.d.cts +26 -0
  53. package/dist/auth/file.d.ts +19 -15
  54. package/dist/auth/file.js +49 -64
  55. package/dist/auth/file.js.map +1 -1
  56. package/dist/auth/index.cjs +12 -0
  57. package/dist/auth/index.d.cts +5 -0
  58. package/dist/auth/index.d.ts +5 -6
  59. package/dist/auth/index.js +6 -27
  60. package/dist/auth/linked-project.cjs +38 -0
  61. package/dist/auth/linked-project.cjs.map +1 -0
  62. package/dist/auth/linked-project.js +30 -64
  63. package/dist/auth/linked-project.js.map +1 -1
  64. package/dist/auth/oauth.cjs +205 -0
  65. package/dist/auth/oauth.cjs.map +1 -0
  66. package/dist/auth/oauth.d.cts +135 -0
  67. package/dist/auth/oauth.d.ts +113 -109
  68. package/dist/auth/oauth.js +185 -252
  69. package/dist/auth/oauth.js.map +1 -1
  70. package/dist/auth/poll-for-token.cjs +82 -0
  71. package/dist/auth/poll-for-token.cjs.map +1 -0
  72. package/dist/auth/poll-for-token.d.cts +28 -0
  73. package/dist/auth/poll-for-token.d.ts +23 -15
  74. package/dist/auth/poll-for-token.js +79 -64
  75. package/dist/auth/poll-for-token.js.map +1 -1
  76. package/dist/auth/project.cjs +80 -0
  77. package/dist/auth/project.cjs.map +1 -0
  78. package/dist/auth/project.d.cts +44 -0
  79. package/dist/auth/project.d.ts +12 -8
  80. package/dist/auth/project.js +70 -72
  81. package/dist/auth/project.js.map +1 -1
  82. package/dist/auth/zod.cjs +22 -0
  83. package/dist/auth/zod.cjs.map +1 -0
  84. package/dist/auth/zod.js +18 -17
  85. package/dist/auth/zod.js.map +1 -1
  86. package/dist/command.cjs +326 -0
  87. package/dist/command.cjs.map +1 -0
  88. package/dist/command.d.cts +289 -0
  89. package/dist/command.d.ts +265 -171
  90. package/dist/command.js +321 -226
  91. package/dist/command.js.map +1 -1
  92. package/dist/constants.d.cts +5 -0
  93. package/dist/constants.d.ts +5 -1
  94. package/dist/index.cjs +11 -0
  95. package/dist/index.d.cts +6 -0
  96. package/dist/index.d.ts +6 -5
  97. package/dist/index.js +6 -15
  98. package/dist/network-policy.d.cts +100 -0
  99. package/dist/network-policy.d.ts +32 -28
  100. package/dist/sandbox.cjs +543 -0
  101. package/dist/sandbox.cjs.map +1 -0
  102. package/dist/sandbox.d.cts +538 -0
  103. package/dist/sandbox.d.ts +521 -472
  104. package/dist/sandbox.js +539 -506
  105. package/dist/sandbox.js.map +1 -1
  106. package/dist/snapshot.cjs +116 -0
  107. package/dist/snapshot.cjs.map +1 -0
  108. package/dist/snapshot.d.cts +109 -0
  109. package/dist/snapshot.d.ts +100 -92
  110. package/dist/snapshot.js +114 -114
  111. package/dist/snapshot.js.map +1 -1
  112. package/dist/utils/array.cjs +17 -0
  113. package/dist/utils/array.cjs.map +1 -0
  114. package/dist/utils/array.js +12 -15
  115. package/dist/utils/array.js.map +1 -1
  116. package/dist/utils/consume-readable.cjs +18 -0
  117. package/dist/utils/consume-readable.cjs.map +1 -0
  118. package/dist/utils/consume-readable.js +13 -12
  119. package/dist/utils/consume-readable.js.map +1 -1
  120. package/dist/utils/decode-base64-url.cjs +15 -0
  121. package/dist/utils/decode-base64-url.cjs.map +1 -0
  122. package/dist/utils/decode-base64-url.js +10 -9
  123. package/dist/utils/decode-base64-url.js.map +1 -1
  124. package/dist/utils/dev-credentials.cjs +142 -0
  125. package/dist/utils/dev-credentials.cjs.map +1 -0
  126. package/dist/utils/dev-credentials.js +126 -184
  127. package/dist/utils/dev-credentials.js.map +1 -1
  128. package/dist/utils/get-credentials.cjs +123 -0
  129. package/dist/utils/get-credentials.cjs.map +1 -0
  130. package/dist/utils/get-credentials.d.cts +21 -0
  131. package/dist/utils/get-credentials.d.ts +19 -61
  132. package/dist/utils/get-credentials.js +106 -140
  133. package/dist/utils/get-credentials.js.map +1 -1
  134. package/dist/utils/log.cjs +25 -0
  135. package/dist/utils/log.cjs.map +1 -0
  136. package/dist/utils/log.js +15 -17
  137. package/dist/utils/log.js.map +1 -1
  138. package/dist/utils/network-policy.cjs +65 -0
  139. package/dist/utils/network-policy.cjs.map +1 -0
  140. package/dist/utils/network-policy.js +58 -77
  141. package/dist/utils/network-policy.js.map +1 -1
  142. package/dist/utils/normalizePath.cjs +27 -0
  143. package/dist/utils/normalizePath.cjs.map +1 -0
  144. package/dist/utils/normalizePath.js +21 -28
  145. package/dist/utils/normalizePath.js.map +1 -1
  146. package/dist/utils/resolveSignal.cjs +20 -0
  147. package/dist/utils/resolveSignal.cjs.map +1 -0
  148. package/dist/utils/resolveSignal.d.cts +15 -0
  149. package/dist/utils/resolveSignal.d.ts +12 -10
  150. package/dist/utils/resolveSignal.js +14 -17
  151. package/dist/utils/resolveSignal.js.map +1 -1
  152. package/dist/utils/sandbox-snapshot.cjs +14 -0
  153. package/dist/utils/sandbox-snapshot.cjs.map +1 -0
  154. package/dist/utils/sandbox-snapshot.d.cts +10 -0
  155. package/dist/utils/sandbox-snapshot.d.ts +11 -0
  156. package/dist/utils/sandbox-snapshot.js +14 -0
  157. package/dist/utils/sandbox-snapshot.js.map +1 -0
  158. package/dist/utils/types.cjs +13 -0
  159. package/dist/utils/types.cjs.map +1 -0
  160. package/dist/utils/types.d.cts +11 -0
  161. package/dist/utils/types.d.ts +5 -7
  162. package/dist/utils/types.js +8 -8
  163. package/dist/utils/types.js.map +1 -1
  164. package/dist/version.cjs +7 -0
  165. package/dist/version.cjs.map +1 -0
  166. package/dist/version.js +5 -5
  167. package/dist/version.js.map +1 -1
  168. package/package.json +23 -3
  169. package/dist/api-client/index.js.map +0 -1
  170. package/dist/auth/api.d.ts +0 -6
  171. package/dist/auth/error.d.ts +0 -11
  172. package/dist/auth/index.js.map +0 -1
  173. package/dist/auth/linked-project.d.ts +0 -10
  174. package/dist/auth/zod.d.ts +0 -5
  175. package/dist/constants.js +0 -3
  176. package/dist/constants.js.map +0 -1
  177. package/dist/index.js.map +0 -1
  178. package/dist/network-policy.js +0 -3
  179. package/dist/network-policy.js.map +0 -1
  180. package/dist/utils/array.d.ts +0 -9
  181. package/dist/utils/consume-readable.d.ts +0 -5
  182. package/dist/utils/convert-sandbox.d.ts +0 -6
  183. package/dist/utils/convert-sandbox.js +0 -14
  184. package/dist/utils/convert-sandbox.js.map +0 -1
  185. package/dist/utils/decode-base64-url.d.ts +0 -7
  186. package/dist/utils/dev-credentials.d.ts +0 -37
  187. package/dist/utils/log.d.ts +0 -2
  188. package/dist/utils/network-policy.d.ts +0 -7
  189. package/dist/utils/normalizePath.d.ts +0 -17
  190. 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
@@ -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
- active: z.ZodLiteral<true>;
4
- client_id: z.ZodString;
5
- session_id: z.ZodString;
5
+ active: z.ZodLiteral<true>;
6
+ client_id: z.ZodString;
7
+ session_id: z.ZodString;
6
8
  }, "strip", z.ZodTypeAny, {
7
- active: true;
8
- client_id: string;
9
- session_id: string;
9
+ active: true;
10
+ client_id: string;
11
+ session_id: string;
10
12
  }, {
11
- active: true;
12
- client_id: string;
13
- session_id: string;
13
+ active: true;
14
+ client_id: string;
15
+ session_id: string;
14
16
  }>, z.ZodObject<{
15
- active: z.ZodLiteral<false>;
17
+ active: z.ZodLiteral<false>;
16
18
  }, "strip", z.ZodTypeAny, {
17
- active: false;
19
+ active: false;
18
20
  }, {
19
- active: false;
21
+ active: false;
20
22
  }>]>;
21
- export declare function OAuth(): Promise<{
22
- /**
23
- * Perform the Device Authorization Request
24
- *
25
- * @see https://datatracker.ietf.org/doc/html/rfc8628#section-3.1
26
- * @see https://datatracker.ietf.org/doc/html/rfc8628#section-3.2
27
- */
28
- deviceAuthorizationRequest(): Promise<DeviceAuthorizationRequest>;
29
- /**
30
- * Perform the Device Access Token Request
31
- *
32
- * @see https://datatracker.ietf.org/doc/html/rfc8628#section-3.4
33
- */
34
- deviceAccessTokenRequest(device_code: string): Promise<[Error] | [null, Response]>;
35
- /**
36
- * Process the Token request Response
37
- *
38
- * @see https://datatracker.ietf.org/doc/html/rfc8628#section-3.5
39
- */
40
- processTokenResponse(response: Response): Promise<[OAuthError] | [null, TokenSet]>;
41
- /**
42
- * Perform a Token Revocation Request.
43
- *
44
- * @see https://datatracker.ietf.org/doc/html/rfc7009#section-2.1
45
- * @see https://datatracker.ietf.org/doc/html/rfc7009#section-2.2
46
- */
47
- revokeToken(token: string): Promise<OAuthError | void>;
48
- /**
49
- * Perform Refresh Token Request.
50
- *
51
- * @see https://datatracker.ietf.org/doc/html/rfc6749#section-6
52
- */
53
- refreshToken(token: string): Promise<TokenSet>;
54
- /**
55
- * Perform Token Introspection Request.
56
- *
57
- * @see https://datatracker.ietf.org/doc/html/rfc7662#section-2.1
58
- */
59
- introspectToken(token: string): Promise<z.infer<typeof IntrospectionResponse>>;
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
- export type OAuth = Awaited<ReturnType<typeof OAuth>>;
63
+ type OAuth = Awaited<ReturnType<typeof OAuth>>;
62
64
  declare const TokenSet: z.ZodObject<{
63
- /** The access token issued by the authorization server. */
64
- access_token: z.ZodString;
65
- /** The type of the token issued */
66
- token_type: z.ZodLiteral<"Bearer">;
67
- /** The lifetime in seconds of the access token. */
68
- expires_in: z.ZodNumber;
69
- /** The refresh token, which can be used to obtain new access tokens. */
70
- refresh_token: z.ZodOptional<z.ZodString>;
71
- /** The scope of the access token. */
72
- scope: z.ZodOptional<z.ZodString>;
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
- expires_in: number;
75
- access_token: string;
76
- token_type: "Bearer";
77
- refresh_token?: string | undefined;
78
- scope?: string | undefined;
76
+ access_token: string;
77
+ token_type: "Bearer";
78
+ expires_in: number;
79
+ refresh_token?: string | undefined;
80
+ scope?: string | undefined;
79
81
  }, {
80
- expires_in: number;
81
- access_token: string;
82
- token_type: "Bearer";
83
- refresh_token?: string | undefined;
84
- scope?: string | undefined;
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
- 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"]>;
89
- error_description: z.ZodOptional<z.ZodString>;
90
- error_uri: z.ZodOptional<z.ZodString>;
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
- 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";
93
- error_description?: string | undefined;
94
- error_uri?: string | undefined;
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
- 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";
97
- error_description?: string | undefined;
98
- error_uri?: string | undefined;
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
- name: string;
103
- code: OAuthErrorResponse["error"];
104
- cause: Error;
105
- constructor(message: string, response: unknown);
104
+ name: string;
105
+ code: OAuthErrorResponse["error"];
106
+ cause: Error;
107
+ constructor(message: string, response: unknown);
106
108
  }
107
- export declare function isOAuthError(error: unknown): error is OAuthError;
108
- export interface DeviceAuthorizationRequest {
109
- /** The device verification code. */
110
- device_code: string;
111
- /** The end-user verification code. */
112
- user_code: string;
113
- /**
114
- * The minimum amount of time in seconds that the client
115
- * SHOULD wait between polling requests to the token endpoint.
116
- */
117
- interval: number;
118
- /** The end-user verification URI on the authorization server. */
119
- verification_uri: string;
120
- /**
121
- * The end-user verification URI on the authorization server,
122
- * including the `user_code`, without redirection.
123
- */
124
- verification_uri_complete: string;
125
- /**
126
- * The absolute lifetime of the `device_code` and `user_code`.
127
- * Calculated from `expires_in`.
128
- */
129
- expiresAt: number;
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
- export {};
133
+ //#endregion
134
+ export { DeviceAuthorizationRequest, OAuth, isOAuthError };
135
+ //# sourceMappingURL=oauth.d.ts.map