@atproto/oauth-types 0.0.0-spaces-alpha-20260910214032

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 (208) hide show
  1. package/CHANGELOG.md +346 -0
  2. package/LICENSE.txt +7 -0
  3. package/README.md +3 -0
  4. package/dist/atproto-loopback-client-id.d.ts +14 -0
  5. package/dist/atproto-loopback-client-id.d.ts.map +1 -0
  6. package/dist/atproto-loopback-client-id.js +39 -0
  7. package/dist/atproto-loopback-client-id.js.map +1 -0
  8. package/dist/atproto-loopback-client-metadata.d.ts +13 -0
  9. package/dist/atproto-loopback-client-metadata.d.ts.map +1 -0
  10. package/dist/atproto-loopback-client-metadata.js +23 -0
  11. package/dist/atproto-loopback-client-metadata.js.map +1 -0
  12. package/dist/atproto-loopback-client-redirect-uris.d.ts +2 -0
  13. package/dist/atproto-loopback-client-redirect-uris.d.ts.map +1 -0
  14. package/dist/atproto-loopback-client-redirect-uris.js +5 -0
  15. package/dist/atproto-loopback-client-redirect-uris.js.map +1 -0
  16. package/dist/atproto-oauth-scope.d.ts +12 -0
  17. package/dist/atproto-oauth-scope.d.ts.map +1 -0
  18. package/dist/atproto-oauth-scope.js +21 -0
  19. package/dist/atproto-oauth-scope.js.map +1 -0
  20. package/dist/atproto-oauth-token-response.d.ts +106 -0
  21. package/dist/atproto-oauth-token-response.d.ts.map +1 -0
  22. package/dist/atproto-oauth-token-response.js +12 -0
  23. package/dist/atproto-oauth-token-response.js.map +1 -0
  24. package/dist/constants.d.ts +2 -0
  25. package/dist/constants.d.ts.map +1 -0
  26. package/dist/constants.js +2 -0
  27. package/dist/constants.js.map +1 -0
  28. package/dist/index.d.ts +50 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +50 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/oauth-access-token.d.ts +4 -0
  33. package/dist/oauth-access-token.d.ts.map +1 -0
  34. package/dist/oauth-access-token.js +3 -0
  35. package/dist/oauth-access-token.js.map +1 -0
  36. package/dist/oauth-authorization-code-grant-token-request.d.ts +20 -0
  37. package/dist/oauth-authorization-code-grant-token-request.d.ts.map +1 -0
  38. package/dist/oauth-authorization-code-grant-token-request.js +15 -0
  39. package/dist/oauth-authorization-code-grant-token-request.js.map +1 -0
  40. package/dist/oauth-authorization-details.d.ts +92 -0
  41. package/dist/oauth-authorization-details.d.ts.map +1 -0
  42. package/dist/oauth-authorization-details.js +37 -0
  43. package/dist/oauth-authorization-details.js.map +1 -0
  44. package/dist/oauth-authorization-request-jar.d.ts +16 -0
  45. package/dist/oauth-authorization-request-jar.d.ts.map +1 -0
  46. package/dist/oauth-authorization-request-jar.js +12 -0
  47. package/dist/oauth-authorization-request-jar.js.map +1 -0
  48. package/dist/oauth-authorization-request-par.d.ts +122 -0
  49. package/dist/oauth-authorization-request-par.d.ts.map +1 -0
  50. package/dist/oauth-authorization-request-par.js +8 -0
  51. package/dist/oauth-authorization-request-par.js.map +1 -0
  52. package/dist/oauth-authorization-request-parameters.d.ts +125 -0
  53. package/dist/oauth-authorization-request-parameters.d.ts.map +1 -0
  54. package/dist/oauth-authorization-request-parameters.js +68 -0
  55. package/dist/oauth-authorization-request-parameters.js.map +1 -0
  56. package/dist/oauth-authorization-request-query.d.ts +134 -0
  57. package/dist/oauth-authorization-request-query.d.ts.map +1 -0
  58. package/dist/oauth-authorization-request-query.js +14 -0
  59. package/dist/oauth-authorization-request-query.js.map +1 -0
  60. package/dist/oauth-authorization-request-uri.d.ts +10 -0
  61. package/dist/oauth-authorization-request-uri.d.ts.map +1 -0
  62. package/dist/oauth-authorization-request-uri.js +6 -0
  63. package/dist/oauth-authorization-request-uri.js.map +1 -0
  64. package/dist/oauth-authorization-response-error.d.ts +7 -0
  65. package/dist/oauth-authorization-response-error.d.ts.map +1 -0
  66. package/dist/oauth-authorization-response-error.js +21 -0
  67. package/dist/oauth-authorization-response-error.js.map +1 -0
  68. package/dist/oauth-authorization-server-metadata.d.ts +467 -0
  69. package/dist/oauth-authorization-server-metadata.d.ts.map +1 -0
  70. package/dist/oauth-authorization-server-metadata.js +98 -0
  71. package/dist/oauth-authorization-server-metadata.js.map +1 -0
  72. package/dist/oauth-client-credentials-grant-token-request.d.ts +10 -0
  73. package/dist/oauth-client-credentials-grant-token-request.d.ts.map +1 -0
  74. package/dist/oauth-client-credentials-grant-token-request.js +5 -0
  75. package/dist/oauth-client-credentials-grant-token-request.js.map +1 -0
  76. package/dist/oauth-client-credentials.d.ts +82 -0
  77. package/dist/oauth-client-credentials.d.ts.map +1 -0
  78. package/dist/oauth-client-credentials.js +33 -0
  79. package/dist/oauth-client-credentials.js.map +1 -0
  80. package/dist/oauth-client-id-discoverable.d.ts +13 -0
  81. package/dist/oauth-client-id-discoverable.d.ts.map +1 -0
  82. package/dist/oauth-client-id-discoverable.js +96 -0
  83. package/dist/oauth-client-id-discoverable.js.map +1 -0
  84. package/dist/oauth-client-id-loopback.d.ts +28 -0
  85. package/dist/oauth-client-id-loopback.d.ts.map +1 -0
  86. package/dist/oauth-client-id-loopback.js +110 -0
  87. package/dist/oauth-client-id-loopback.js.map +1 -0
  88. package/dist/oauth-client-id.d.ts +4 -0
  89. package/dist/oauth-client-id.d.ts.map +1 -0
  90. package/dist/oauth-client-id.js +3 -0
  91. package/dist/oauth-client-id.js.map +1 -0
  92. package/dist/oauth-client-metadata.d.ts +440 -0
  93. package/dist/oauth-client-metadata.d.ts.map +1 -0
  94. package/dist/oauth-client-metadata.js +74 -0
  95. package/dist/oauth-client-metadata.js.map +1 -0
  96. package/dist/oauth-code-challenge-method.d.ts +3 -0
  97. package/dist/oauth-code-challenge-method.d.ts.map +1 -0
  98. package/dist/oauth-code-challenge-method.js +3 -0
  99. package/dist/oauth-code-challenge-method.js.map +1 -0
  100. package/dist/oauth-endpoint-auth-method.d.ts +4 -0
  101. package/dist/oauth-endpoint-auth-method.d.ts.map +1 -0
  102. package/dist/oauth-endpoint-auth-method.js +11 -0
  103. package/dist/oauth-endpoint-auth-method.js.map +1 -0
  104. package/dist/oauth-endpoint-name.d.ts +3 -0
  105. package/dist/oauth-endpoint-name.d.ts.map +1 -0
  106. package/dist/oauth-endpoint-name.js +7 -0
  107. package/dist/oauth-endpoint-name.js.map +1 -0
  108. package/dist/oauth-grant-type.d.ts +4 -0
  109. package/dist/oauth-grant-type.d.ts.map +1 -0
  110. package/dist/oauth-grant-type.js +11 -0
  111. package/dist/oauth-grant-type.js.map +1 -0
  112. package/dist/oauth-introspection-response.d.ts +20 -0
  113. package/dist/oauth-introspection-response.d.ts.map +1 -0
  114. package/dist/oauth-introspection-response.js +2 -0
  115. package/dist/oauth-introspection-response.js.map +1 -0
  116. package/dist/oauth-issuer-identifier.d.ts +4 -0
  117. package/dist/oauth-issuer-identifier.d.ts.map +1 -0
  118. package/dist/oauth-issuer-identifier.js +37 -0
  119. package/dist/oauth-issuer-identifier.js.map +1 -0
  120. package/dist/oauth-par-response.d.ts +13 -0
  121. package/dist/oauth-par-response.d.ts.map +1 -0
  122. package/dist/oauth-par-response.js +6 -0
  123. package/dist/oauth-par-response.js.map +1 -0
  124. package/dist/oauth-password-grant-token-request.d.ts +16 -0
  125. package/dist/oauth-password-grant-token-request.d.ts.map +1 -0
  126. package/dist/oauth-password-grant-token-request.js +7 -0
  127. package/dist/oauth-password-grant-token-request.js.map +1 -0
  128. package/dist/oauth-prompt-mode.d.ts +11 -0
  129. package/dist/oauth-prompt-mode.d.ts.map +1 -0
  130. package/dist/oauth-prompt-mode.js +16 -0
  131. package/dist/oauth-prompt-mode.js.map +1 -0
  132. package/dist/oauth-protected-resource-metadata.d.ts +93 -0
  133. package/dist/oauth-protected-resource-metadata.d.ts.map +1 -0
  134. package/dist/oauth-protected-resource-metadata.js +82 -0
  135. package/dist/oauth-protected-resource-metadata.js.map +1 -0
  136. package/dist/oauth-redirect-uri.d.ts +22 -0
  137. package/dist/oauth-redirect-uri.d.ts.map +1 -0
  138. package/dist/oauth-redirect-uri.js +57 -0
  139. package/dist/oauth-redirect-uri.js.map +1 -0
  140. package/dist/oauth-refresh-token-grant-token-request.d.ts +13 -0
  141. package/dist/oauth-refresh-token-grant-token-request.d.ts.map +1 -0
  142. package/dist/oauth-refresh-token-grant-token-request.js +7 -0
  143. package/dist/oauth-refresh-token-grant-token-request.js.map +1 -0
  144. package/dist/oauth-refresh-token.d.ts +4 -0
  145. package/dist/oauth-refresh-token.d.ts.map +1 -0
  146. package/dist/oauth-refresh-token.js +3 -0
  147. package/dist/oauth-refresh-token.js.map +1 -0
  148. package/dist/oauth-request-uri.d.ts +4 -0
  149. package/dist/oauth-request-uri.d.ts.map +1 -0
  150. package/dist/oauth-request-uri.js +3 -0
  151. package/dist/oauth-request-uri.js.map +1 -0
  152. package/dist/oauth-response-mode.d.ts +4 -0
  153. package/dist/oauth-response-mode.d.ts.map +1 -0
  154. package/dist/oauth-response-mode.js +7 -0
  155. package/dist/oauth-response-mode.js.map +1 -0
  156. package/dist/oauth-response-type.d.ts +4 -0
  157. package/dist/oauth-response-type.d.ts.map +1 -0
  158. package/dist/oauth-response-type.js +14 -0
  159. package/dist/oauth-response-type.js.map +1 -0
  160. package/dist/oauth-scope.d.ts +12 -0
  161. package/dist/oauth-scope.d.ts.map +1 -0
  162. package/dist/oauth-scope.js +15 -0
  163. package/dist/oauth-scope.js.map +1 -0
  164. package/dist/oauth-token-identification.d.ts +13 -0
  165. package/dist/oauth-token-identification.d.ts.map +1 -0
  166. package/dist/oauth-token-identification.js +8 -0
  167. package/dist/oauth-token-identification.js.map +1 -0
  168. package/dist/oauth-token-request.d.ts +46 -0
  169. package/dist/oauth-token-request.d.ts.map +1 -0
  170. package/dist/oauth-token-request.js +12 -0
  171. package/dist/oauth-token-request.js.map +1 -0
  172. package/dist/oauth-token-response.d.ts +97 -0
  173. package/dist/oauth-token-response.d.ts.map +1 -0
  174. package/dist/oauth-token-response.js +24 -0
  175. package/dist/oauth-token-response.js.map +1 -0
  176. package/dist/oauth-token-type.d.ts +4 -0
  177. package/dist/oauth-token-type.d.ts.map +1 -0
  178. package/dist/oauth-token-type.js +13 -0
  179. package/dist/oauth-token-type.js.map +1 -0
  180. package/dist/oidc-authorization-error-response.d.ts +7 -0
  181. package/dist/oidc-authorization-error-response.d.ts.map +1 -0
  182. package/dist/oidc-authorization-error-response.js +25 -0
  183. package/dist/oidc-authorization-error-response.js.map +1 -0
  184. package/dist/oidc-claims-parameter.d.ts +4 -0
  185. package/dist/oidc-claims-parameter.d.ts.map +1 -0
  186. package/dist/oidc-claims-parameter.js +33 -0
  187. package/dist/oidc-claims-parameter.js.map +1 -0
  188. package/dist/oidc-claims-properties.d.ts +16 -0
  189. package/dist/oidc-claims-properties.d.ts.map +1 -0
  190. package/dist/oidc-claims-properties.js +8 -0
  191. package/dist/oidc-claims-properties.js.map +1 -0
  192. package/dist/oidc-entity-type.d.ts +4 -0
  193. package/dist/oidc-entity-type.d.ts.map +1 -0
  194. package/dist/oidc-entity-type.js +3 -0
  195. package/dist/oidc-entity-type.js.map +1 -0
  196. package/dist/oidc-userinfo.d.ts +31 -0
  197. package/dist/oidc-userinfo.d.ts.map +1 -0
  198. package/dist/oidc-userinfo.js +12 -0
  199. package/dist/oidc-userinfo.js.map +1 -0
  200. package/dist/uri.d.ts +20 -0
  201. package/dist/uri.d.ts.map +1 -0
  202. package/dist/uri.js +164 -0
  203. package/dist/uri.js.map +1 -0
  204. package/dist/util.d.ts +19 -0
  205. package/dist/util.d.ts.map +1 -0
  206. package/dist/util.js +137 -0
  207. package/dist/util.js.map +1 -0
  208. package/package.json +41 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,346 @@
1
+ # @atproto/oauth-types
2
+
3
+ ## 0.0.0-spaces-alpha-20260910214032
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`fe4087e`](https://github.com/bluesky-social/atproto/commit/fe4087ecb7a7cc53c7081c9f97d49121e5251c36)]:
8
+ - @atproto/did@0.0.0-spaces-alpha-20260910214032
9
+
10
+ ## 0.7.5
11
+
12
+ ### Patch Changes
13
+
14
+ - [#5197](https://github.com/bluesky-social/atproto/pull/5197) [`a0c49d9`](https://github.com/bluesky-social/atproto/commit/a0c49d9e8bc685c5a747a8d3b2775c73c63fdb6f) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Rewrite import statements to be compatible with TypeScript's `verbatimModuleSyntax` config.
15
+
16
+ - Updated dependencies [[`a0c49d9`](https://github.com/bluesky-social/atproto/commit/a0c49d9e8bc685c5a747a8d3b2775c73c63fdb6f)]:
17
+ - @atproto/jwk@0.7.4
18
+ - @atproto/did@0.5.4
19
+
20
+ ## 0.7.4
21
+
22
+ ### Patch Changes
23
+
24
+ - [#5099](https://github.com/bluesky-social/atproto/pull/5099) [`b43ec31`](https://github.com/bluesky-social/atproto/commit/b43ec31f247f4461725b01226885f88bd430ca07) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Update TypeScript build to rely on references to composite internal projects
25
+
26
+ - [#5099](https://github.com/bluesky-social/atproto/pull/5099) [`b43ec31`](https://github.com/bluesky-social/atproto/commit/b43ec31f247f4461725b01226885f88bd430ca07) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Bundle only necessary files in the NPM tarball, including the `CHANGELOG.md` and `README.md` files (if present).
27
+
28
+ - [#5099](https://github.com/bluesky-social/atproto/pull/5099) [`b43ec31`](https://github.com/bluesky-social/atproto/commit/b43ec31f247f4461725b01226885f88bd430ca07) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Build with `noImplicitAny` enabled
29
+
30
+ - Updated dependencies [[`b43ec31`](https://github.com/bluesky-social/atproto/commit/b43ec31f247f4461725b01226885f88bd430ca07), [`b43ec31`](https://github.com/bluesky-social/atproto/commit/b43ec31f247f4461725b01226885f88bd430ca07), [`b43ec31`](https://github.com/bluesky-social/atproto/commit/b43ec31f247f4461725b01226885f88bd430ca07)]:
31
+ - @atproto/jwk@0.7.3
32
+ - @atproto/did@0.5.3
33
+
34
+ ## 0.7.3
35
+
36
+ ### Patch Changes
37
+
38
+ - [#5151](https://github.com/bluesky-social/atproto/pull/5151) [`a51c45d`](https://github.com/bluesky-social/atproto/commit/a51c45d38f6bd7b8765f640e564cf921d52162e7) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Update dependencies
39
+
40
+ - Updated dependencies [[`a51c45d`](https://github.com/bluesky-social/atproto/commit/a51c45d38f6bd7b8765f640e564cf921d52162e7)]:
41
+ - @atproto/did@0.5.2
42
+ - @atproto/jwk@0.7.2
43
+
44
+ ## 0.7.2
45
+
46
+ ### Patch Changes
47
+
48
+ - [#4967](https://github.com/bluesky-social/atproto/pull/4967) [`9fc720c`](https://github.com/bluesky-social/atproto/commit/9fc720ce75f3ee88a5e48a9be919b07c7647f6f5) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Use TypeScript 7 to build package
49
+
50
+ - Updated dependencies [[`9fc720c`](https://github.com/bluesky-social/atproto/commit/9fc720ce75f3ee88a5e48a9be919b07c7647f6f5)]:
51
+ - @atproto/jwk@0.7.1
52
+ - @atproto/did@0.5.1
53
+
54
+ ## 0.7.1
55
+
56
+ ### Patch Changes
57
+
58
+ - Updated dependencies [[`622d365`](https://github.com/bluesky-social/atproto/commit/622d365aeb240133f40763a3b1c43981112837fc)]:
59
+ - @atproto/did@0.5.0
60
+
61
+ ## 0.7.0
62
+
63
+ ### Minor Changes
64
+
65
+ - [#4929](https://github.com/bluesky-social/atproto/pull/4929) [`f01c59f`](https://github.com/bluesky-social/atproto/commit/f01c59f5bd3f75fb8b47a9eecd4858b84033fb7c) Thanks [@devinivy](https://github.com/devinivy)! - **BREAKING:** Drop support for Node.js 18 and 20. Node.js 22 is now the minimum supported version. Docker images now use Node.js 24.
66
+
67
+ - [#4943](https://github.com/bluesky-social/atproto/pull/4943) [`c459153`](https://github.com/bluesky-social/atproto/commit/c459153395a30ce89e050892c8fab7dc98e019b9) Thanks [@devinivy](https://github.com/devinivy)! - **BREAKING:** Convert to pure ESM. All packages now ship `"type": "module"` with ES module output and Node16 module resolution.
68
+
69
+ Node.js 22's `require()` compatibility layer can still load these packages in CommonJS code.
70
+
71
+ - [#4930](https://github.com/bluesky-social/atproto/pull/4930) [`908bece`](https://github.com/bluesky-social/atproto/commit/908bece169258bff5ad121e5eec157d6ded6f705) Thanks [@devinivy](https://github.com/devinivy)! - Build with TypeScript 6.0.
72
+
73
+ ### Patch Changes
74
+
75
+ - Updated dependencies [[`f01c59f`](https://github.com/bluesky-social/atproto/commit/f01c59f5bd3f75fb8b47a9eecd4858b84033fb7c), [`c459153`](https://github.com/bluesky-social/atproto/commit/c459153395a30ce89e050892c8fab7dc98e019b9), [`908bece`](https://github.com/bluesky-social/atproto/commit/908bece169258bff5ad121e5eec157d6ded6f705)]:
76
+ - @atproto/did@0.4.0
77
+ - @atproto/jwk@0.7.0
78
+
79
+ ## 0.6.3
80
+
81
+ ### Patch Changes
82
+
83
+ - [#4620](https://github.com/bluesky-social/atproto/pull/4620) [`fdbbff8`](https://github.com/bluesky-social/atproto/commit/fdbbff854363ed3518a4039ca43cd279e69600e0) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Ensure that `OAuthAuthorizationRequestQuery` always contains a `client_id`
84
+
85
+ - [#4620](https://github.com/bluesky-social/atproto/pull/4620) [`fdbbff8`](https://github.com/bluesky-social/atproto/commit/fdbbff854363ed3518a4039ca43cd279e69600e0) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Update `oauthRequestUriSchema` to require min length
86
+
87
+ ## 0.6.2
88
+
89
+ ### Patch Changes
90
+
91
+ - Updated dependencies [[`d54d707`](https://github.com/bluesky-social/atproto/commit/d54d7077eb32041e1f61c312efa1dd0d768c774e), [`d54d707`](https://github.com/bluesky-social/atproto/commit/d54d7077eb32041e1f61c312efa1dd0d768c774e)]:
92
+ - @atproto/did@0.3.0
93
+
94
+ ## 0.6.1
95
+
96
+ ### Patch Changes
97
+
98
+ - Updated dependencies [[`2f78893`](https://github.com/bluesky-social/atproto/commit/2f78893ace3bbf14d4bac36837820ddb46658c98)]:
99
+ - @atproto/did@0.2.4
100
+
101
+ ## 0.6.0
102
+
103
+ ### Minor Changes
104
+
105
+ - [#4461](https://github.com/bluesky-social/atproto/pull/4461) [`5d8e7a6`](https://github.com/bluesky-social/atproto/commit/5d8e7a6588fc9e57e15d83d47bb45103205e3e41) Thanks [@ThisIsMissEm](https://github.com/ThisIsMissEm)! - Add prompt_values_supported to Authorization Server Metadata
106
+
107
+ ### Patch Changes
108
+
109
+ - [#4465](https://github.com/bluesky-social/atproto/pull/4465) [`95ef3c2`](https://github.com/bluesky-social/atproto/commit/95ef3c24e8072e9d49412950b033cb8607764ee0) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Improve error message in case of invalid redirect uri
110
+
111
+ ## 0.5.2
112
+
113
+ ### Patch Changes
114
+
115
+ - Updated dependencies [[`8012627`](https://github.com/bluesky-social/atproto/commit/8012627a1226cb2f1c753385ad2497b6b43ffd2e), [`d396de0`](https://github.com/bluesky-social/atproto/commit/d396de016d1d55d08cfad1dabd3ffd9eaeea76ea)]:
116
+ - @atproto/did@0.2.3
117
+
118
+ ## 0.5.1
119
+
120
+ ### Patch Changes
121
+
122
+ - Updated dependencies [[`261968fd6`](https://github.com/bluesky-social/atproto/commit/261968fd65014ded613e2bf085d61a7864b8fba7)]:
123
+ - @atproto/did@0.2.2
124
+
125
+ ## 0.5.0
126
+
127
+ ### Minor Changes
128
+
129
+ - [#4289](https://github.com/bluesky-social/atproto/pull/4289) [`8ff5ec4ca`](https://github.com/bluesky-social/atproto/commit/8ff5ec4caa9a1f5c1e453a416ba2af22d1ee4f58) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Remove exported `oauthHttpsRedirectURISchema` and `oauthPrivateUseRedirectURISchema` in favor of `oauthRedirectUriSchema` and `oauthLoopbackClientRedirectUriSchema`, which provide semantically meaningful groupings of redirect URIs based on OAuth client types.
130
+
131
+ `oauthHttpsRedirectURISchema` can still be accessed using `httpsUriSchema`.
132
+ `oauthPrivateUseRedirectURISchema` can still be accessed using `privateUseUriSchema`.
133
+
134
+ - [#4289](https://github.com/bluesky-social/atproto/pull/4289) [`8ff5ec4ca`](https://github.com/bluesky-social/atproto/commit/8ff5ec4caa9a1f5c1e453a416ba2af22d1ee4f58) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Remove unused `isLoopbackUrl` utility
135
+
136
+ ### Patch Changes
137
+
138
+ - [#4289](https://github.com/bluesky-social/atproto/pull/4289) [`8ff5ec4ca`](https://github.com/bluesky-social/atproto/commit/8ff5ec4caa9a1f5c1e453a416ba2af22d1ee4f58) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Enforce stronger validation of `privateUseUriSchema`
139
+
140
+ ## 0.4.2
141
+
142
+ ### Patch Changes
143
+
144
+ - [#4216](https://github.com/bluesky-social/atproto/pull/4216) [`09439d7d6`](https://github.com/bluesky-social/atproto/commit/09439d7d688294ad1a0c78a74b901ba2f7c5f4c3) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Expose new utilities to build and work with atproto loopback client metadata
145
+
146
+ - [#4216](https://github.com/bluesky-social/atproto/pull/4216) [`09439d7d6`](https://github.com/bluesky-social/atproto/commit/09439d7d688294ad1a0c78a74b901ba2f7c5f4c3) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Improve validation of `AtprotoOAuthScope`
147
+
148
+ - [#4216](https://github.com/bluesky-social/atproto/pull/4216) [`09439d7d6`](https://github.com/bluesky-social/atproto/commit/09439d7d688294ad1a0c78a74b901ba2f7c5f4c3) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add `AtprotoOAuthTokenResponse` schema
149
+
150
+ - Updated dependencies [[`f560cf226`](https://github.com/bluesky-social/atproto/commit/f560cf2266715666ce5852ab095fcfb3876ae815), [`fefe70126`](https://github.com/bluesky-social/atproto/commit/fefe70126d0ea82507ac750f669b3478290f186b), [`f560cf226`](https://github.com/bluesky-social/atproto/commit/f560cf2266715666ce5852ab095fcfb3876ae815), [`f560cf226`](https://github.com/bluesky-social/atproto/commit/f560cf2266715666ce5852ab095fcfb3876ae815), [`f560cf226`](https://github.com/bluesky-social/atproto/commit/f560cf2266715666ce5852ab095fcfb3876ae815), [`09439d7d6`](https://github.com/bluesky-social/atproto/commit/09439d7d688294ad1a0c78a74b901ba2f7c5f4c3)]:
151
+ - @atproto/jwk@0.6.0
152
+ - @atproto/did@0.2.1
153
+
154
+ ## 0.4.1
155
+
156
+ ### Patch Changes
157
+
158
+ - Updated dependencies [[`8a88e2c15`](https://github.com/bluesky-social/atproto/commit/8a88e2c15451f5e8239400eeb277ad31d178b8e6), [`8a88e2c15`](https://github.com/bluesky-social/atproto/commit/8a88e2c15451f5e8239400eeb277ad31d178b8e6)]:
159
+ - @atproto/jwk@0.5.0
160
+
161
+ ## 0.4.0
162
+
163
+ ### Minor Changes
164
+
165
+ - [#3973](https://github.com/bluesky-social/atproto/pull/3973) [`3a1e010e1`](https://github.com/bluesky-social/atproto/commit/3a1e010e148476bfdc0028c37cafbce85a46605a) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Rename `OidcAuthenticationErrorResponse` to `OidcAuthorizationResponseError`
166
+
167
+ - [#3973](https://github.com/bluesky-social/atproto/pull/3973) [`3a1e010e1`](https://github.com/bluesky-social/atproto/commit/3a1e010e148476bfdc0028c37cafbce85a46605a) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Rename `OAuthAuthenticationErrorResponse` to `OAuthAuthorizationResponseError`
168
+
169
+ ## 0.3.1
170
+
171
+ ### Patch Changes
172
+
173
+ - Updated dependencies [[`90b4775fc`](https://github.com/bluesky-social/atproto/commit/90b4775fc9c6959171bc12b961ce9421cc14d6ee), [`90b4775fc`](https://github.com/bluesky-social/atproto/commit/90b4775fc9c6959171bc12b961ce9421cc14d6ee), [`90b4775fc`](https://github.com/bluesky-social/atproto/commit/90b4775fc9c6959171bc12b961ce9421cc14d6ee)]:
174
+ - @atproto/jwk@0.4.0
175
+
176
+ ## 0.3.0
177
+
178
+ ### Minor Changes
179
+
180
+ - [#3847](https://github.com/bluesky-social/atproto/pull/3847) [`349b59175`](https://github.com/bluesky-social/atproto/commit/349b59175e82ceb9500ae7c6a9a0b9b6aec9d1b6) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Change the default client authentication method in the client document metadata to "client_secret_basic" (as per spec)
181
+
182
+ ### Patch Changes
183
+
184
+ - [#3847](https://github.com/bluesky-social/atproto/pull/3847) [`349b59175`](https://github.com/bluesky-social/atproto/commit/349b59175e82ceb9500ae7c6a9a0b9b6aec9d1b6) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Remove invalid default for `code_challenge_method` authorization request parameter
185
+
186
+ - [#3847](https://github.com/bluesky-social/atproto/pull/3847) [`349b59175`](https://github.com/bluesky-social/atproto/commit/349b59175e82ceb9500ae7c6a9a0b9b6aec9d1b6) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Remove schema's `.optional()` modifier when a `.default()` is defined
187
+
188
+ - [#3847](https://github.com/bluesky-social/atproto/pull/3847) [`349b59175`](https://github.com/bluesky-social/atproto/commit/349b59175e82ceb9500ae7c6a9a0b9b6aec9d1b6) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Prevent using `none` as `token_endpoint_auth_signing_alg_values_supported` in authorization server metadata documents.
189
+
190
+ - Updated dependencies [[`349b59175`](https://github.com/bluesky-social/atproto/commit/349b59175e82ceb9500ae7c6a9a0b9b6aec9d1b6)]:
191
+ - @atproto/jwk@0.3.0
192
+
193
+ ## 0.2.8
194
+
195
+ ### Patch Changes
196
+
197
+ - [#3919](https://github.com/bluesky-social/atproto/pull/3919) [`a3b24ca77`](https://github.com/bluesky-social/atproto/commit/a3b24ca77ca24ac19b17cf9ee2a5ca9612ccf96c) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Parse JSON encoded Authorization Request Parameters
198
+
199
+ - Updated dependencies [[`3fa2ee3b6`](https://github.com/bluesky-social/atproto/commit/3fa2ee3b6a382709b10921da53e69a901bccbb05)]:
200
+ - @atproto/jwk@0.2.0
201
+
202
+ ## 0.2.7
203
+
204
+ ### Patch Changes
205
+
206
+ - [#3797](https://github.com/bluesky-social/atproto/pull/3797) [`a48b093f0`](https://github.com/bluesky-social/atproto/commit/a48b093f0ba3cf67b7abc50d309afcb336d8ead8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add `OidcUserinfo` type
207
+
208
+ ## 0.2.6
209
+
210
+ ### Patch Changes
211
+
212
+ - [#3764](https://github.com/bluesky-social/atproto/pull/3764) [`30f9b6690`](https://github.com/bluesky-social/atproto/commit/30f9b6690e0e2c5810772e94e631322b9d89c65a) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add definition for `ConventionalOAuthClientId`
213
+
214
+ - [#3764](https://github.com/bluesky-social/atproto/pull/3764) [`30f9b6690`](https://github.com/bluesky-social/atproto/commit/30f9b6690e0e2c5810772e94e631322b9d89c65a) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Remove hard coded `client_name` from loopback client metadata
215
+
216
+ ## 0.2.5
217
+
218
+ ### Patch Changes
219
+
220
+ - [#3659](https://github.com/bluesky-social/atproto/pull/3659) [`371e04aad`](https://github.com/bluesky-social/atproto/commit/371e04aad2a3e8ae3fe185ce15fc8eb051cab78e) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add `OAuthAuthenticationErrorResponse`
221
+
222
+ - Updated dependencies [[`26a077716`](https://github.com/bluesky-social/atproto/commit/26a07771673bf1090a61efb7c970235f0b2509fc)]:
223
+ - @atproto/jwk@0.1.5
224
+
225
+ ## 0.2.4
226
+
227
+ ### Patch Changes
228
+
229
+ - [#2945](https://github.com/bluesky-social/atproto/pull/2945) [`850e39843`](https://github.com/bluesky-social/atproto/commit/850e39843cb0ec9ea716675f7568c0c601f45e29) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Properly support locales with 3 chars (Asturian)
230
+
231
+ - Updated dependencies [[`850e39843`](https://github.com/bluesky-social/atproto/commit/850e39843cb0ec9ea716675f7568c0c601f45e29)]:
232
+ - @atproto/jwk@0.1.4
233
+
234
+ ## 0.2.3
235
+
236
+ ### Patch Changes
237
+
238
+ - [#3220](https://github.com/bluesky-social/atproto/pull/3220) [`61dc0d60e`](https://github.com/bluesky-social/atproto/commit/61dc0d60e19b88c6427a54c6d95a391b5f4da7bd) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Apply new linting rules regarding import order
239
+
240
+ - [#3220](https://github.com/bluesky-social/atproto/pull/3220) [`61dc0d60e`](https://github.com/bluesky-social/atproto/commit/61dc0d60e19b88c6427a54c6d95a391b5f4da7bd) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Support environments not providing URL.canParse
241
+
242
+ - Updated dependencies [[`61dc0d60e`](https://github.com/bluesky-social/atproto/commit/61dc0d60e19b88c6427a54c6d95a391b5f4da7bd)]:
243
+ - @atproto/jwk@0.1.3
244
+
245
+ ## 0.2.2
246
+
247
+ ### Patch Changes
248
+
249
+ - Updated dependencies [[`2889c7699`](https://github.com/bluesky-social/atproto/commit/2889c76995ce3c569f595ac3c678218e9ce659f0), [`2889c7699`](https://github.com/bluesky-social/atproto/commit/2889c76995ce3c569f595ac3c678218e9ce659f0), [`2889c7699`](https://github.com/bluesky-social/atproto/commit/2889c76995ce3c569f595ac3c678218e9ce659f0), [`2889c7699`](https://github.com/bluesky-social/atproto/commit/2889c76995ce3c569f595ac3c678218e9ce659f0)]:
250
+ - @atproto/jwk@0.1.2
251
+
252
+ ## 0.2.1
253
+
254
+ ### Patch Changes
255
+
256
+ - [#3066](https://github.com/bluesky-social/atproto/pull/3066) [`5ddd51235`](https://github.com/bluesky-social/atproto/commit/5ddd51235c7e064bddcad2dd218df05d144d18d3) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add oauthClientIdLoopbackSchema and oauthClientIdDiscoverableSchema schemas
257
+
258
+ - [#3066](https://github.com/bluesky-social/atproto/pull/3066) [`5ddd51235`](https://github.com/bluesky-social/atproto/commit/5ddd51235c7e064bddcad2dd218df05d144d18d3) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Enforce use of http and https url where applicable
259
+
260
+ - [#3066](https://github.com/bluesky-social/atproto/pull/3066) [`5ddd51235`](https://github.com/bluesky-social/atproto/commit/5ddd51235c7e064bddcad2dd218df05d144d18d3) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Strong validation or redirect_uri
261
+
262
+ ## 0.2.0
263
+
264
+ ### Minor Changes
265
+
266
+ - [#2874](https://github.com/bluesky-social/atproto/pull/2874) [`7f26b1765`](https://github.com/bluesky-social/atproto/commit/7f26b176526b9856a8f61faca6f065f0afd43abf) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Allow oauthIssuerIdentifier to be an "http:" url. Make sure to manually check for "http:" issuers if you don't allow them.
267
+
268
+ - [#2874](https://github.com/bluesky-social/atproto/pull/2874) [`7f26b1765`](https://github.com/bluesky-social/atproto/commit/7f26b176526b9856a8f61faca6f065f0afd43abf) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Remove ALLOW_UNSECURE_ORIGINS constant
269
+
270
+ - [#2871](https://github.com/bluesky-social/atproto/pull/2871) [`9d40ccbb6`](https://github.com/bluesky-social/atproto/commit/9d40ccbb69103fae9aae7e3cec31e9b3116f3ba2) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Remove invalid `issuer` property from OAuthTokenResponse
271
+
272
+ ### Patch Changes
273
+
274
+ - [#2871](https://github.com/bluesky-social/atproto/pull/2871) [`9d40ccbb6`](https://github.com/bluesky-social/atproto/commit/9d40ccbb69103fae9aae7e3cec31e9b3116f3ba2) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add missing "wap" display request parameter value
275
+
276
+ - [#2871](https://github.com/bluesky-social/atproto/pull/2871) [`9d40ccbb6`](https://github.com/bluesky-social/atproto/commit/9d40ccbb69103fae9aae7e3cec31e9b3116f3ba2) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Remove invalid `client_id` property from oauthRefreshTokenGrantTokenRequestSchema
277
+
278
+ - [#2874](https://github.com/bluesky-social/atproto/pull/2874) [`7f26b1765`](https://github.com/bluesky-social/atproto/commit/7f26b176526b9856a8f61faca6f065f0afd43abf) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Improve typing of oauthIssuerIdentifierSchema
279
+
280
+ ## 0.1.5
281
+
282
+ ### Patch Changes
283
+
284
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Properly validate client metadata scope
285
+
286
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Allow ClientID query params to end with a slash "/" char
287
+
288
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Expose OAuthScope
289
+
290
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - add assertion utils for client ids
291
+
292
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Allow loopback client ids to omit the (empty) path parameter
293
+
294
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Enforce ClientID URL path to be normalized
295
+
296
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Rename OAuthAuthenticationRequestParameters to OAuthAuthorizationRequestParameters
297
+
298
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Restrict the value used as code_challenge_methods_supported
299
+
300
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add missing "expires_in" property to OAuthParResponse type definition
301
+
302
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Allow loopback clients to define their scopes through the "scope" client_id query parameter.
303
+
304
+ - [#2755](https://github.com/bluesky-social/atproto/pull/2755) [`ed325d863`](https://github.com/bluesky-social/atproto/commit/ed325d863ce8ea5986c5a45c3188aaa35288b7a8) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Improve error description in case of invalid loopback client_id
305
+
306
+ ## 0.1.4
307
+
308
+ ### Patch Changes
309
+
310
+ - [#2734](https://github.com/bluesky-social/atproto/pull/2734) [`dee817b6e`](https://github.com/bluesky-social/atproto/commit/dee817b6e0fc02351d51ce310b5e65239b7c5ed7) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Validate scopes characters according to OAuth 2.1 spec
311
+
312
+ - [#2734](https://github.com/bluesky-social/atproto/pull/2734) [`dee817b6e`](https://github.com/bluesky-social/atproto/commit/dee817b6e0fc02351d51ce310b5e65239b7c5ed7) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Re-use code definition of oauthResponseTypeSchema
313
+
314
+ - [#2734](https://github.com/bluesky-social/atproto/pull/2734) [`dee817b6e`](https://github.com/bluesky-social/atproto/commit/dee817b6e0fc02351d51ce310b5e65239b7c5ed7) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Remove non-standard "sub" from OAuthTokenResponse
315
+
316
+ ## 0.1.3
317
+
318
+ ### Patch Changes
319
+
320
+ - [#2729](https://github.com/bluesky-social/atproto/pull/2729) [`35a126429`](https://github.com/bluesky-social/atproto/commit/35a1264297bc22acaa6e5ed3f4aed8c351be8bbb) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Avoid code duplication in the definition of OAuthEndpointName
321
+
322
+ ## 0.1.2
323
+
324
+ ### Patch Changes
325
+
326
+ - [#2483](https://github.com/bluesky-social/atproto/pull/2483) [`b934b396b`](https://github.com/bluesky-social/atproto/commit/b934b396b13ba32bf2bf7e75ecdf6871e5f310dd) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Better implement aptroto OAuth spec
327
+
328
+ ## 0.1.1
329
+
330
+ ### Patch Changes
331
+
332
+ - [#2633](https://github.com/bluesky-social/atproto/pull/2633) [`acc9093d2`](https://github.com/bluesky-social/atproto/commit/acc9093d2845eba02b68fb2f9db33e4f1b59bb10) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add client_id_metadata_document_supported in metadata
333
+
334
+ - Updated dependencies [[`acc9093d2`](https://github.com/bluesky-social/atproto/commit/acc9093d2845eba02b68fb2f9db33e4f1b59bb10)]:
335
+ - @atproto/jwk@0.1.1
336
+
337
+ ## 0.1.0
338
+
339
+ ### Minor Changes
340
+
341
+ - [#2482](https://github.com/bluesky-social/atproto/pull/2482) [`a8d6c1123`](https://github.com/bluesky-social/atproto/commit/a8d6c112359f5c4c0cfbe2df63443ed275f2a646) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Add OAuth provider capability & support for DPoP signed tokens
342
+
343
+ ### Patch Changes
344
+
345
+ - Updated dependencies [[`a8d6c1123`](https://github.com/bluesky-social/atproto/commit/a8d6c112359f5c4c0cfbe2df63443ed275f2a646)]:
346
+ - @atproto/jwk@0.1.0
package/LICENSE.txt ADDED
@@ -0,0 +1,7 @@
1
+ Dual MIT/Apache-2.0 License
2
+
3
+ Copyright (c) 2022-2026 Bluesky Social PBC, and Contributors
4
+
5
+ Except as otherwise noted in individual files, this software is licensed under the MIT license (<http://opensource.org/licenses/MIT>), or the Apache License, Version 2.0 (<http://www.apache.org/licenses/LICENSE-2.0>).
6
+
7
+ Downstream projects and end users may chose either license individually, or both together, at their discretion. The motivation for this dual-licensing is the additional software patent assurance provided by Apache 2.0.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @atproto/oauth-types
2
+
3
+ This library exposes utilities for typing and validating OAuth related data structures.
@@ -0,0 +1,14 @@
1
+ import { type AtprotoOAuthScope } from './atproto-oauth-scope.js';
2
+ import { type OAuthClientIdLoopback } from './oauth-client-id-loopback.js';
3
+ import { type OAuthLoopbackRedirectURI } from './oauth-redirect-uri.js';
4
+ export type OAuthLoopbackClientIdConfig = {
5
+ scope?: string;
6
+ redirect_uris?: Iterable<string>;
7
+ };
8
+ export declare function buildAtprotoLoopbackClientId(config?: OAuthLoopbackClientIdConfig): OAuthClientIdLoopback;
9
+ export type AtprotoLoopbackClientIdParams = {
10
+ scope: AtprotoOAuthScope;
11
+ redirect_uris: [OAuthLoopbackRedirectURI, ...OAuthLoopbackRedirectURI[]];
12
+ };
13
+ export declare function parseAtprotoLoopbackClientId(clientId: string): AtprotoLoopbackClientIdParams;
14
+ //# sourceMappingURL=atproto-loopback-client-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atproto-loopback-client-id.d.ts","sourceRoot":"","sources":["../src/atproto-loopback-client-id.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,iBAAiB,EAIvB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAEL,KAAK,qBAAqB,EAE3B,MAAM,+BAA+B,CAAA;AACtC,OAAO,EACL,KAAK,wBAAwB,EAE9B,MAAM,yBAAyB,CAAA;AAGhC,MAAM,MAAM,2BAA2B,GAAG;IACxC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;CACjC,CAAA;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,CAAC,EAAE,2BAA2B,GACnC,qBAAqB,CA+BvB;AAED,MAAM,MAAM,6BAA6B,GAAG;IAC1C,KAAK,EAAE,iBAAiB,CAAA;IACxB,aAAa,EAAE,CAAC,wBAAwB,EAAE,GAAG,wBAAwB,EAAE,CAAC,CAAA;CACzE,CAAA;AAED,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,GACf,6BAA6B,CAY/B"}
@@ -0,0 +1,39 @@
1
+ import { DEFAULT_LOOPBACK_CLIENT_REDIRECT_URIS } from './atproto-loopback-client-redirect-uris.js';
2
+ import { DEFAULT_ATPROTO_OAUTH_SCOPE, asAtprotoOAuthScope, isAtprotoOAuthScope, } from './atproto-oauth-scope.js';
3
+ import { LOOPBACK_CLIENT_ID_ORIGIN, parseOAuthLoopbackClientId, } from './oauth-client-id-loopback.js';
4
+ import { oauthLoopbackClientRedirectUriSchema, } from './oauth-redirect-uri.js';
5
+ import { arrayEquivalent, asArray } from './util.js';
6
+ export function buildAtprotoLoopbackClientId(config) {
7
+ if (config) {
8
+ const params = new URLSearchParams();
9
+ const { scope } = config;
10
+ if (scope != null && scope !== DEFAULT_ATPROTO_OAUTH_SCOPE) {
11
+ params.set('scope', asAtprotoOAuthScope(scope));
12
+ }
13
+ const redirectUris = asArray(config.redirect_uris);
14
+ if (redirectUris &&
15
+ !arrayEquivalent(redirectUris, DEFAULT_LOOPBACK_CLIENT_REDIRECT_URIS)) {
16
+ if (!redirectUris.length) {
17
+ throw new TypeError(`Unexpected empty "redirect_uris" config`);
18
+ }
19
+ for (const uri of redirectUris) {
20
+ params.append('redirect_uri', oauthLoopbackClientRedirectUriSchema.parse(uri));
21
+ }
22
+ }
23
+ if (params.size) {
24
+ return `${LOOPBACK_CLIENT_ID_ORIGIN}?${params.toString()}`;
25
+ }
26
+ }
27
+ return LOOPBACK_CLIENT_ID_ORIGIN;
28
+ }
29
+ export function parseAtprotoLoopbackClientId(clientId) {
30
+ const { scope = DEFAULT_ATPROTO_OAUTH_SCOPE, redirect_uris } = parseOAuthLoopbackClientId(clientId);
31
+ if (!isAtprotoOAuthScope(scope)) {
32
+ throw new TypeError('ATProto Loopback ClientID must include "atproto" scope');
33
+ }
34
+ return {
35
+ scope,
36
+ redirect_uris: redirect_uris ?? [...DEFAULT_LOOPBACK_CLIENT_REDIRECT_URIS],
37
+ };
38
+ }
39
+ //# sourceMappingURL=atproto-loopback-client-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atproto-loopback-client-id.js","sourceRoot":"","sources":["../src/atproto-loopback-client-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,4CAA4C,CAAA;AAClG,OAAO,EAEL,2BAA2B,EAC3B,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,yBAAyB,EAEzB,0BAA0B,GAC3B,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAEL,oCAAoC,GACrC,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAOpD,MAAM,UAAU,4BAA4B,CAC1C,MAAoC;IAEpC,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAA;QAEpC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;QACxB,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,2BAA2B,EAAE,CAAC;YAC3D,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAA;QACjD,CAAC;QAED,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;QAClD,IACE,YAAY;YACZ,CAAC,eAAe,CAAC,YAAY,EAAE,qCAAqC,CAAC,EACrE,CAAC;YACD,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;gBACzB,MAAM,IAAI,SAAS,CAAC,yCAAyC,CAAC,CAAA;YAChE,CAAC;YACD,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;gBAC/B,MAAM,CAAC,MAAM,CACX,cAAc,EACd,oCAAoC,CAAC,KAAK,CAAC,GAAG,CAAC,CAChD,CAAA;YACH,CAAC;QACH,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YAChB,OAAO,GAAG,yBAAyB,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAA;QAC5D,CAAC;IACH,CAAC;IAED,OAAO,yBAAyB,CAAA;AAClC,CAAC;AAOD,MAAM,UAAU,4BAA4B,CAC1C,QAAgB;IAEhB,MAAM,EAAE,KAAK,GAAG,2BAA2B,EAAE,aAAa,EAAE,GAC1D,0BAA0B,CAAC,QAAQ,CAAC,CAAA;IACtC,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CACjB,wDAAwD,CACzD,CAAA;IACH,CAAC;IACD,OAAO;QACL,KAAK;QACL,aAAa,EAAE,aAAa,IAAI,CAAC,GAAG,qCAAqC,CAAC;KAC3E,CAAA;AACH,CAAC","sourcesContent":["import { DEFAULT_LOOPBACK_CLIENT_REDIRECT_URIS } from './atproto-loopback-client-redirect-uris.js'\nimport {\n type AtprotoOAuthScope,\n DEFAULT_ATPROTO_OAUTH_SCOPE,\n asAtprotoOAuthScope,\n isAtprotoOAuthScope,\n} from './atproto-oauth-scope.js'\nimport {\n LOOPBACK_CLIENT_ID_ORIGIN,\n type OAuthClientIdLoopback,\n parseOAuthLoopbackClientId,\n} from './oauth-client-id-loopback.js'\nimport {\n type OAuthLoopbackRedirectURI,\n oauthLoopbackClientRedirectUriSchema,\n} from './oauth-redirect-uri.js'\nimport { arrayEquivalent, asArray } from './util.js'\n\nexport type OAuthLoopbackClientIdConfig = {\n scope?: string\n redirect_uris?: Iterable<string>\n}\n\nexport function buildAtprotoLoopbackClientId(\n config?: OAuthLoopbackClientIdConfig,\n): OAuthClientIdLoopback {\n if (config) {\n const params = new URLSearchParams()\n\n const { scope } = config\n if (scope != null && scope !== DEFAULT_ATPROTO_OAUTH_SCOPE) {\n params.set('scope', asAtprotoOAuthScope(scope))\n }\n\n const redirectUris = asArray(config.redirect_uris)\n if (\n redirectUris &&\n !arrayEquivalent(redirectUris, DEFAULT_LOOPBACK_CLIENT_REDIRECT_URIS)\n ) {\n if (!redirectUris.length) {\n throw new TypeError(`Unexpected empty \"redirect_uris\" config`)\n }\n for (const uri of redirectUris) {\n params.append(\n 'redirect_uri',\n oauthLoopbackClientRedirectUriSchema.parse(uri),\n )\n }\n }\n\n if (params.size) {\n return `${LOOPBACK_CLIENT_ID_ORIGIN}?${params.toString()}`\n }\n }\n\n return LOOPBACK_CLIENT_ID_ORIGIN\n}\n\nexport type AtprotoLoopbackClientIdParams = {\n scope: AtprotoOAuthScope\n redirect_uris: [OAuthLoopbackRedirectURI, ...OAuthLoopbackRedirectURI[]]\n}\n\nexport function parseAtprotoLoopbackClientId(\n clientId: string,\n): AtprotoLoopbackClientIdParams {\n const { scope = DEFAULT_ATPROTO_OAUTH_SCOPE, redirect_uris } =\n parseOAuthLoopbackClientId(clientId)\n if (!isAtprotoOAuthScope(scope)) {\n throw new TypeError(\n 'ATProto Loopback ClientID must include \"atproto\" scope',\n )\n }\n return {\n scope,\n redirect_uris: redirect_uris ?? [...DEFAULT_LOOPBACK_CLIENT_REDIRECT_URIS],\n }\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import { type OAuthLoopbackClientIdConfig } from './atproto-loopback-client-id.js';
2
+ import type { AtprotoOAuthScope } from './atproto-oauth-scope.js';
3
+ import type { OAuthClientIdLoopback } from './oauth-client-id-loopback.js';
4
+ import type { OAuthClientMetadataInput } from './oauth-client-metadata.js';
5
+ import type { OAuthLoopbackRedirectURI } from './oauth-redirect-uri.js';
6
+ export type AtprotoLoopbackClientMetadata = OAuthClientMetadataInput & {
7
+ client_id: OAuthClientIdLoopback;
8
+ scope: AtprotoOAuthScope;
9
+ redirect_uris: [OAuthLoopbackRedirectURI, ...OAuthLoopbackRedirectURI[]];
10
+ };
11
+ export declare function atprotoLoopbackClientMetadata(clientId: string): AtprotoLoopbackClientMetadata;
12
+ export declare function buildAtprotoLoopbackClientMetadata(config: OAuthLoopbackClientIdConfig): AtprotoLoopbackClientMetadata;
13
+ //# sourceMappingURL=atproto-loopback-client-metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atproto-loopback-client-metadata.d.ts","sourceRoot":"","sources":["../src/atproto-loopback-client-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,2BAA2B,EAGjC,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAEvE,MAAM,MAAM,6BAA6B,GAAG,wBAAwB,GAAG;IACrE,SAAS,EAAE,qBAAqB,CAAA;IAChC,KAAK,EAAE,iBAAiB,CAAA;IACxB,aAAa,EAAE,CAAC,wBAAwB,EAAE,GAAG,wBAAwB,EAAE,CAAC,CAAA;CACzE,CAAA;AAED,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,MAAM,GACf,6BAA6B,CAI/B;AAED,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,2BAA2B,GAClC,6BAA6B,CAG/B"}
@@ -0,0 +1,23 @@
1
+ import { buildAtprotoLoopbackClientId, parseAtprotoLoopbackClientId, } from './atproto-loopback-client-id.js';
2
+ export function atprotoLoopbackClientMetadata(clientId) {
3
+ const params = parseAtprotoLoopbackClientId(clientId);
4
+ // Safe to cast because parseAtprotoLoopbackClientId ensures it's a loopback ID
5
+ return buildMetadataInternal(clientId, params);
6
+ }
7
+ export function buildAtprotoLoopbackClientMetadata(config) {
8
+ const clientId = buildAtprotoLoopbackClientId(config);
9
+ return buildMetadataInternal(clientId, parseAtprotoLoopbackClientId(clientId));
10
+ }
11
+ function buildMetadataInternal(clientId, clientParams) {
12
+ return {
13
+ client_id: clientId,
14
+ scope: clientParams.scope,
15
+ redirect_uris: clientParams.redirect_uris,
16
+ response_types: ['code'],
17
+ grant_types: ['authorization_code', 'refresh_token'],
18
+ token_endpoint_auth_method: 'none',
19
+ application_type: 'native',
20
+ dpop_bound_access_tokens: true,
21
+ };
22
+ }
23
+ //# sourceMappingURL=atproto-loopback-client-metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atproto-loopback-client-metadata.js","sourceRoot":"","sources":["../src/atproto-loopback-client-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,iCAAiC,CAAA;AAYxC,MAAM,UAAU,6BAA6B,CAC3C,QAAgB;IAEhB,MAAM,MAAM,GAAG,4BAA4B,CAAC,QAAQ,CAAC,CAAA;IACrD,+EAA+E;IAC/E,OAAO,qBAAqB,CAAC,QAAiC,EAAE,MAAM,CAAC,CAAA;AACzE,CAAC;AAED,MAAM,UAAU,kCAAkC,CAChD,MAAmC;IAEnC,MAAM,QAAQ,GAAG,4BAA4B,CAAC,MAAM,CAAC,CAAA;IACrD,OAAO,qBAAqB,CAAC,QAAQ,EAAE,4BAA4B,CAAC,QAAQ,CAAC,CAAC,CAAA;AAChF,CAAC;AAED,SAAS,qBAAqB,CAC5B,QAA+B,EAC/B,YAA2C;IAE3C,OAAO;QACL,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,YAAY,CAAC,KAAK;QACzB,aAAa,EAAE,YAAY,CAAC,aAAa;QACzC,cAAc,EAAE,CAAC,MAAM,CAAC;QACxB,WAAW,EAAE,CAAC,oBAAoB,EAAE,eAAe,CAAC;QACpD,0BAA0B,EAAE,MAAM;QAClC,gBAAgB,EAAE,QAAQ;QAC1B,wBAAwB,EAAE,IAAI;KAC/B,CAAA;AACH,CAAC","sourcesContent":["import {\n type AtprotoLoopbackClientIdParams,\n type OAuthLoopbackClientIdConfig,\n buildAtprotoLoopbackClientId,\n parseAtprotoLoopbackClientId,\n} from './atproto-loopback-client-id.js'\nimport type { AtprotoOAuthScope } from './atproto-oauth-scope.js'\nimport type { OAuthClientIdLoopback } from './oauth-client-id-loopback.js'\nimport type { OAuthClientMetadataInput } from './oauth-client-metadata.js'\nimport type { OAuthLoopbackRedirectURI } from './oauth-redirect-uri.js'\n\nexport type AtprotoLoopbackClientMetadata = OAuthClientMetadataInput & {\n client_id: OAuthClientIdLoopback\n scope: AtprotoOAuthScope\n redirect_uris: [OAuthLoopbackRedirectURI, ...OAuthLoopbackRedirectURI[]]\n}\n\nexport function atprotoLoopbackClientMetadata(\n clientId: string,\n): AtprotoLoopbackClientMetadata {\n const params = parseAtprotoLoopbackClientId(clientId)\n // Safe to cast because parseAtprotoLoopbackClientId ensures it's a loopback ID\n return buildMetadataInternal(clientId as OAuthClientIdLoopback, params)\n}\n\nexport function buildAtprotoLoopbackClientMetadata(\n config: OAuthLoopbackClientIdConfig,\n): AtprotoLoopbackClientMetadata {\n const clientId = buildAtprotoLoopbackClientId(config)\n return buildMetadataInternal(clientId, parseAtprotoLoopbackClientId(clientId))\n}\n\nfunction buildMetadataInternal(\n clientId: OAuthClientIdLoopback,\n clientParams: AtprotoLoopbackClientIdParams,\n): AtprotoLoopbackClientMetadata {\n return {\n client_id: clientId,\n scope: clientParams.scope,\n redirect_uris: clientParams.redirect_uris,\n response_types: ['code'],\n grant_types: ['authorization_code', 'refresh_token'],\n token_endpoint_auth_method: 'none',\n application_type: 'native',\n dpop_bound_access_tokens: true,\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_LOOPBACK_CLIENT_REDIRECT_URIS: readonly ["http://127.0.0.1/", "http://[::1]/"];
2
+ //# sourceMappingURL=atproto-loopback-client-redirect-uris.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atproto-loopback-client-redirect-uris.d.ts","sourceRoot":"","sources":["../src/atproto-loopback-client-redirect-uris.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qCAAqC,iDAGvC,CAAA"}
@@ -0,0 +1,5 @@
1
+ export const DEFAULT_LOOPBACK_CLIENT_REDIRECT_URIS = Object.freeze([
2
+ `http://127.0.0.1/`,
3
+ `http://[::1]/`,
4
+ ]);
5
+ //# sourceMappingURL=atproto-loopback-client-redirect-uris.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atproto-loopback-client-redirect-uris.js","sourceRoot":"","sources":["../src/atproto-loopback-client-redirect-uris.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qCAAqC,GAAG,MAAM,CAAC,MAAM,CAAC;IACjE,mBAAmB;IACnB,eAAe;CACP,CAAC,CAAA","sourcesContent":["export const DEFAULT_LOOPBACK_CLIENT_REDIRECT_URIS = Object.freeze([\n `http://127.0.0.1/`,\n `http://[::1]/`,\n] as const)\n"]}
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ import { type OAuthScope } from './oauth-scope.js';
3
+ import { type SpaceSeparatedValue } from './util.js';
4
+ export declare const ATPROTO_SCOPE_VALUE = "atproto";
5
+ export type AtprotoScopeValue = typeof ATPROTO_SCOPE_VALUE;
6
+ export type AtprotoOAuthScope = OAuthScope & SpaceSeparatedValue<AtprotoScopeValue>;
7
+ export declare function isAtprotoOAuthScope(input: string): input is AtprotoOAuthScope;
8
+ export declare function asAtprotoOAuthScope<I extends string>(input: I): (I & "atproto") | (I & `${string} atproto`) | (I & `${string} atproto ${string}`) | (I & `atproto ${string}`);
9
+ export declare function assertAtprotoOAuthScope(input: string): asserts input is AtprotoOAuthScope;
10
+ export declare const atprotoOAuthScopeSchema: z.ZodEffects<z.ZodString, AtprotoOAuthScope, string>;
11
+ export declare const DEFAULT_ATPROTO_OAUTH_SCOPE = "atproto";
12
+ //# sourceMappingURL=atproto-oauth-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atproto-oauth-scope.d.ts","sourceRoot":"","sources":["../src/atproto-oauth-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,KAAK,UAAU,EAAgB,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,KAAK,mBAAmB,EAAyB,MAAM,WAAW,CAAA;AAE3E,eAAO,MAAM,mBAAmB,YAAY,CAAA;AAC5C,MAAM,MAAM,iBAAiB,GAAG,OAAO,mBAAmB,CAAA;AAE1D,MAAM,MAAM,iBAAiB,GAAG,UAAU,GACxC,mBAAmB,CAAC,iBAAiB,CAAC,CAAA;AAExC,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,iBAAiB,CAI7E;AAED,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,iHAG7D;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,KAAK,IAAI,iBAAiB,CAEpC;AAED,eAAO,MAAM,uBAAuB,sDAElC,CAAA;AAGF,eAAO,MAAM,2BAA2B,YACS,CAAA"}
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ import { isOAuthScope } from './oauth-scope.js';
3
+ import { isSpaceSeparatedValue } from './util.js';
4
+ export const ATPROTO_SCOPE_VALUE = 'atproto';
5
+ export function isAtprotoOAuthScope(input) {
6
+ return (isOAuthScope(input) && isSpaceSeparatedValue(ATPROTO_SCOPE_VALUE, input));
7
+ }
8
+ export function asAtprotoOAuthScope(input) {
9
+ if (isAtprotoOAuthScope(input))
10
+ return input;
11
+ throw new TypeError(`Value must contain "${ATPROTO_SCOPE_VALUE}" scope value`);
12
+ }
13
+ export function assertAtprotoOAuthScope(input) {
14
+ void asAtprotoOAuthScope(input);
15
+ }
16
+ export const atprotoOAuthScopeSchema = z.string().refine(isAtprotoOAuthScope, {
17
+ message: 'Invalid ATProto OAuth scope',
18
+ });
19
+ // Default scope is for reading identity (did) only
20
+ export const DEFAULT_ATPROTO_OAUTH_SCOPE = ATPROTO_SCOPE_VALUE;
21
+ //# sourceMappingURL=atproto-oauth-scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atproto-oauth-scope.js","sourceRoot":"","sources":["../src/atproto-oauth-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAmB,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAA4B,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAE3E,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAA;AAM5C,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,OAAO,CACL,YAAY,CAAC,KAAK,CAAC,IAAI,qBAAqB,CAAC,mBAAmB,EAAE,KAAK,CAAC,CACzE,CAAA;AACH,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAmB,KAAQ;IAC5D,IAAI,mBAAmB,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IAC5C,MAAM,IAAI,SAAS,CAAC,uBAAuB,mBAAmB,eAAe,CAAC,CAAA;AAChF,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,KAAa;IAEb,KAAK,mBAAmB,CAAC,KAAK,CAAC,CAAA;AACjC,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,mBAAmB,EAAE;IAC5E,OAAO,EAAE,6BAA6B;CACvC,CAAC,CAAA;AAEF,mDAAmD;AACnD,MAAM,CAAC,MAAM,2BAA2B,GACtC,mBAA+C,CAAA","sourcesContent":["import { z } from 'zod'\nimport { type OAuthScope, isOAuthScope } from './oauth-scope.js'\nimport { type SpaceSeparatedValue, isSpaceSeparatedValue } from './util.js'\n\nexport const ATPROTO_SCOPE_VALUE = 'atproto'\nexport type AtprotoScopeValue = typeof ATPROTO_SCOPE_VALUE\n\nexport type AtprotoOAuthScope = OAuthScope &\n SpaceSeparatedValue<AtprotoScopeValue>\n\nexport function isAtprotoOAuthScope(input: string): input is AtprotoOAuthScope {\n return (\n isOAuthScope(input) && isSpaceSeparatedValue(ATPROTO_SCOPE_VALUE, input)\n )\n}\n\nexport function asAtprotoOAuthScope<I extends string>(input: I) {\n if (isAtprotoOAuthScope(input)) return input\n throw new TypeError(`Value must contain \"${ATPROTO_SCOPE_VALUE}\" scope value`)\n}\n\nexport function assertAtprotoOAuthScope(\n input: string,\n): asserts input is AtprotoOAuthScope {\n void asAtprotoOAuthScope(input)\n}\n\nexport const atprotoOAuthScopeSchema = z.string().refine(isAtprotoOAuthScope, {\n message: 'Invalid ATProto OAuth scope',\n})\n\n// Default scope is for reading identity (did) only\nexport const DEFAULT_ATPROTO_OAUTH_SCOPE =\n ATPROTO_SCOPE_VALUE satisfies AtprotoOAuthScope\n"]}