@atproto/oauth-provider 0.5.0 → 0.5.2

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 (224) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/account/account-store.d.ts +6 -5
  3. package/dist/account/account-store.d.ts.map +1 -1
  4. package/dist/account/account-store.js +24 -8
  5. package/dist/account/account-store.js.map +1 -1
  6. package/dist/account/sign-up-data.d.ts +2 -2
  7. package/dist/assets/app/bundle-manifest.json +185 -185
  8. package/dist/assets/app/{index-ItwwtJ8r.js → index-DZHZ9kCP.js} +2 -2
  9. package/dist/assets/app/{index-ItwwtJ8r.js.map → index-DZHZ9kCP.js.map} +1 -1
  10. package/dist/assets/app/{main-CSatvmRR.js → main-Dr6y26KY.js} +48 -48
  11. package/dist/assets/app/{main-CSatvmRR.js.map → main-Dr6y26KY.js.map} +1 -1
  12. package/dist/assets/app/messages-6_mYuGzB.js +4 -0
  13. package/dist/assets/app/messages-6_mYuGzB.js.map +1 -0
  14. package/dist/assets/app/messages-7wdeBTpD.js +4 -0
  15. package/dist/assets/app/messages-7wdeBTpD.js.map +1 -0
  16. package/dist/assets/app/messages-B-YFoWKc.js +4 -0
  17. package/dist/assets/app/messages-B-YFoWKc.js.map +1 -0
  18. package/dist/assets/app/messages-B10DUOE-.js +4 -0
  19. package/dist/assets/app/messages-B10DUOE-.js.map +1 -0
  20. package/dist/assets/app/messages-B4AwFEeZ.js +4 -0
  21. package/dist/assets/app/messages-B4AwFEeZ.js.map +1 -0
  22. package/dist/assets/app/messages-BDP8MyEC.js +4 -0
  23. package/dist/assets/app/messages-BDP8MyEC.js.map +1 -0
  24. package/dist/assets/app/messages-BIS87lxQ.js +4 -0
  25. package/dist/assets/app/messages-BIS87lxQ.js.map +1 -0
  26. package/dist/assets/app/messages-BI_Wbjdt.js +4 -0
  27. package/dist/assets/app/messages-BI_Wbjdt.js.map +1 -0
  28. package/dist/assets/app/messages-BMAouhRx.js +4 -0
  29. package/dist/assets/app/messages-BMAouhRx.js.map +1 -0
  30. package/dist/assets/app/messages-BdckMnJj.js +4 -0
  31. package/dist/assets/app/messages-BdckMnJj.js.map +1 -0
  32. package/dist/assets/app/messages-BgBLzc46.js +4 -0
  33. package/dist/assets/app/messages-BgBLzc46.js.map +1 -0
  34. package/dist/assets/app/messages-BobD78yK.js +4 -0
  35. package/dist/assets/app/messages-BobD78yK.js.map +1 -0
  36. package/dist/assets/app/messages-BtThT9UZ.js +4 -0
  37. package/dist/assets/app/messages-BtThT9UZ.js.map +1 -0
  38. package/dist/assets/app/messages-BwKHkbeh.js +4 -0
  39. package/dist/assets/app/messages-BwKHkbeh.js.map +1 -0
  40. package/dist/assets/app/messages-C417YUvA.js +4 -0
  41. package/dist/assets/app/messages-C417YUvA.js.map +1 -0
  42. package/dist/assets/app/messages-C4CxO4bO.js +4 -0
  43. package/dist/assets/app/messages-C4CxO4bO.js.map +1 -0
  44. package/dist/assets/app/messages-C5vd04e6.js +4 -0
  45. package/dist/assets/app/messages-C5vd04e6.js.map +1 -0
  46. package/dist/assets/app/messages-CAri2Wnz.js +4 -0
  47. package/dist/assets/app/messages-CAri2Wnz.js.map +1 -0
  48. package/dist/assets/app/messages-CPtWTZeG.js +4 -0
  49. package/dist/assets/app/messages-CPtWTZeG.js.map +1 -0
  50. package/dist/assets/app/messages-CiaM5zm8.js +4 -0
  51. package/dist/assets/app/messages-CiaM5zm8.js.map +1 -0
  52. package/dist/assets/app/messages-CkL-L2R6.js +4 -0
  53. package/dist/assets/app/messages-CkL-L2R6.js.map +1 -0
  54. package/dist/assets/app/messages-Cy_4XLNe.js +4 -0
  55. package/dist/assets/app/messages-Cy_4XLNe.js.map +1 -0
  56. package/dist/assets/app/messages-D5_ad-Eo.js +4 -0
  57. package/dist/assets/app/messages-D5_ad-Eo.js.map +1 -0
  58. package/dist/assets/app/messages-DChMl9mT.js +4 -0
  59. package/dist/assets/app/messages-DChMl9mT.js.map +1 -0
  60. package/dist/assets/app/messages-DWX-DIfv.js +4 -0
  61. package/dist/assets/app/messages-DWX-DIfv.js.map +1 -0
  62. package/dist/assets/app/messages-DgfsOphe.js +4 -0
  63. package/dist/assets/app/messages-DgfsOphe.js.map +1 -0
  64. package/dist/assets/app/messages-Dj5B_DR6.js +4 -0
  65. package/dist/assets/app/messages-Dj5B_DR6.js.map +1 -0
  66. package/dist/assets/app/messages-Dwzqo4eA.js +4 -0
  67. package/dist/assets/app/messages-Dwzqo4eA.js.map +1 -0
  68. package/dist/assets/app/messages-ESCIXJR7.js +4 -0
  69. package/dist/assets/app/messages-ESCIXJR7.js.map +1 -0
  70. package/dist/assets/app/messages-dglB2edb.js +4 -0
  71. package/dist/assets/app/messages-dglB2edb.js.map +1 -0
  72. package/dist/assets/app/messages-e_ClRrWc.js +4 -0
  73. package/dist/assets/app/messages-e_ClRrWc.js.map +1 -0
  74. package/dist/assets/app/messages-evvDxmrP.js +4 -0
  75. package/dist/assets/app/messages-evvDxmrP.js.map +1 -0
  76. package/dist/assets/app/messages-pPbdLb5B.js +4 -0
  77. package/dist/assets/app/messages-pPbdLb5B.js.map +1 -0
  78. package/dist/assets/app/messages-tJv8gHL2.js +4 -0
  79. package/dist/assets/app/messages-tJv8gHL2.js.map +1 -0
  80. package/dist/assets/app/messages-vLRVEw96.js +4 -0
  81. package/dist/assets/app/messages-vLRVEw96.js.map +1 -0
  82. package/dist/errors/invalid-invite-code-error.d.ts +5 -0
  83. package/dist/errors/invalid-invite-code-error.d.ts.map +1 -0
  84. package/dist/errors/invalid-invite-code-error.js +11 -0
  85. package/dist/errors/invalid-invite-code-error.js.map +1 -0
  86. package/dist/errors/oauth-error.d.ts +2 -2
  87. package/dist/errors/oauth-error.js.map +1 -1
  88. package/dist/oauth-errors.d.ts +1 -0
  89. package/dist/oauth-errors.d.ts.map +1 -1
  90. package/dist/oauth-errors.js +3 -1
  91. package/dist/oauth-errors.js.map +1 -1
  92. package/dist/oauth-provider.d.ts +3 -3
  93. package/dist/oauth-provider.d.ts.map +1 -1
  94. package/dist/oauth-provider.js +24 -23
  95. package/dist/oauth-provider.js.map +1 -1
  96. package/dist/output/build-customization-data.d.ts +20 -11
  97. package/dist/output/build-customization-data.d.ts.map +1 -1
  98. package/dist/output/build-customization-data.js +72 -43
  99. package/dist/output/build-customization-data.js.map +1 -1
  100. package/package.json +4 -3
  101. package/src/account/account-store.ts +21 -6
  102. package/src/assets/app/components/forms/input-checkbox.tsx +12 -7
  103. package/src/assets/app/components/forms/input-email-address.tsx +2 -3
  104. package/src/assets/app/components/forms/input-password.tsx +2 -3
  105. package/src/assets/app/components/forms/input-text.tsx +6 -0
  106. package/src/assets/app/components/utils/error-message.tsx +30 -4
  107. package/src/assets/app/lib/api.ts +25 -3
  108. package/src/assets/app/locales/an/messages.po +51 -53
  109. package/src/assets/app/locales/ast/messages.po +51 -53
  110. package/src/assets/app/locales/ca/messages.po +51 -53
  111. package/src/assets/app/locales/da/messages.po +51 -53
  112. package/src/assets/app/locales/de/messages.po +51 -53
  113. package/src/assets/app/locales/el/messages.po +51 -53
  114. package/src/assets/app/locales/en/messages.po +51 -53
  115. package/src/assets/app/locales/en-GB/messages.po +51 -53
  116. package/src/assets/app/locales/es/messages.po +51 -53
  117. package/src/assets/app/locales/eu/messages.po +51 -53
  118. package/src/assets/app/locales/fi/messages.po +51 -53
  119. package/src/assets/app/locales/fr/messages.po +52 -54
  120. package/src/assets/app/locales/ga/messages.po +51 -53
  121. package/src/assets/app/locales/gl/messages.po +51 -53
  122. package/src/assets/app/locales/hi/messages.po +51 -53
  123. package/src/assets/app/locales/hu/messages.po +51 -53
  124. package/src/assets/app/locales/ia/messages.po +51 -53
  125. package/src/assets/app/locales/id/messages.po +51 -53
  126. package/src/assets/app/locales/it/messages.po +51 -53
  127. package/src/assets/app/locales/ja/messages.po +51 -53
  128. package/src/assets/app/locales/km/messages.po +51 -53
  129. package/src/assets/app/locales/ko/messages.po +51 -53
  130. package/src/assets/app/locales/ne/messages.po +51 -53
  131. package/src/assets/app/locales/nl/messages.po +51 -53
  132. package/src/assets/app/locales/pl/messages.po +51 -53
  133. package/src/assets/app/locales/pt-BR/messages.po +51 -53
  134. package/src/assets/app/locales/ro/messages.po +51 -53
  135. package/src/assets/app/locales/ru/messages.po +51 -53
  136. package/src/assets/app/locales/sv/messages.po +51 -53
  137. package/src/assets/app/locales/th/messages.po +51 -53
  138. package/src/assets/app/locales/tr/messages.po +51 -53
  139. package/src/assets/app/locales/uk/messages.po +51 -53
  140. package/src/assets/app/locales/vi/messages.po +51 -53
  141. package/src/assets/app/locales/zh-CN/messages.po +51 -53
  142. package/src/assets/app/locales/zh-HK/messages.po +51 -53
  143. package/src/assets/app/locales/zh-TW/messages.po +51 -53
  144. package/src/assets/app/views/authorize/reset-password/reset-password-confirm-form.tsx +1 -1
  145. package/src/assets/app/views/authorize/sign-in/sign-in-form.tsx +3 -5
  146. package/src/assets/app/views/authorize/sign-up/sign-up-account-form.tsx +7 -5
  147. package/src/assets/app/views/authorize/sign-up/sign-up-handle-form.tsx +0 -2
  148. package/src/errors/invalid-invite-code-error.ts +10 -0
  149. package/src/errors/oauth-error.ts +1 -1
  150. package/src/oauth-errors.ts +1 -0
  151. package/src/oauth-provider.ts +45 -35
  152. package/src/output/build-customization-data.ts +89 -50
  153. package/tsconfig.backend.tsbuildinfo +1 -1
  154. package/dist/assets/app/messages-BQeltXSF.js +0 -4
  155. package/dist/assets/app/messages-BQeltXSF.js.map +0 -1
  156. package/dist/assets/app/messages-BQkEhfjg.js +0 -4
  157. package/dist/assets/app/messages-BQkEhfjg.js.map +0 -1
  158. package/dist/assets/app/messages-BUjKj_UJ.js +0 -4
  159. package/dist/assets/app/messages-BUjKj_UJ.js.map +0 -1
  160. package/dist/assets/app/messages-BWIQa8fO.js +0 -4
  161. package/dist/assets/app/messages-BWIQa8fO.js.map +0 -1
  162. package/dist/assets/app/messages-BaNVb0bp.js +0 -4
  163. package/dist/assets/app/messages-BaNVb0bp.js.map +0 -1
  164. package/dist/assets/app/messages-BaizVXcF.js +0 -4
  165. package/dist/assets/app/messages-BaizVXcF.js.map +0 -1
  166. package/dist/assets/app/messages-BfoClA1Y.js +0 -4
  167. package/dist/assets/app/messages-BfoClA1Y.js.map +0 -1
  168. package/dist/assets/app/messages-BsKGDZnC.js +0 -4
  169. package/dist/assets/app/messages-BsKGDZnC.js.map +0 -1
  170. package/dist/assets/app/messages-Bu-TJhml.js +0 -4
  171. package/dist/assets/app/messages-Bu-TJhml.js.map +0 -1
  172. package/dist/assets/app/messages-BvOKnBQk.js +0 -4
  173. package/dist/assets/app/messages-BvOKnBQk.js.map +0 -1
  174. package/dist/assets/app/messages-BxDzCiWz.js +0 -4
  175. package/dist/assets/app/messages-BxDzCiWz.js.map +0 -1
  176. package/dist/assets/app/messages-CDgFOy4S.js +0 -4
  177. package/dist/assets/app/messages-CDgFOy4S.js.map +0 -1
  178. package/dist/assets/app/messages-CLbTz0o9.js +0 -4
  179. package/dist/assets/app/messages-CLbTz0o9.js.map +0 -1
  180. package/dist/assets/app/messages-CNwSh0t7.js +0 -4
  181. package/dist/assets/app/messages-CNwSh0t7.js.map +0 -1
  182. package/dist/assets/app/messages-CSMNJ6P8.js +0 -4
  183. package/dist/assets/app/messages-CSMNJ6P8.js.map +0 -1
  184. package/dist/assets/app/messages-CZQUw3mp.js +0 -4
  185. package/dist/assets/app/messages-CZQUw3mp.js.map +0 -1
  186. package/dist/assets/app/messages-CZT41oVp.js +0 -4
  187. package/dist/assets/app/messages-CZT41oVp.js.map +0 -1
  188. package/dist/assets/app/messages-C_b-d3t8.js +0 -4
  189. package/dist/assets/app/messages-C_b-d3t8.js.map +0 -1
  190. package/dist/assets/app/messages-C_u3MTc2.js +0 -4
  191. package/dist/assets/app/messages-C_u3MTc2.js.map +0 -1
  192. package/dist/assets/app/messages-Cn8nHZic.js +0 -4
  193. package/dist/assets/app/messages-Cn8nHZic.js.map +0 -1
  194. package/dist/assets/app/messages-CtDywJUm.js +0 -4
  195. package/dist/assets/app/messages-CtDywJUm.js.map +0 -1
  196. package/dist/assets/app/messages-CurtIjBF.js +0 -4
  197. package/dist/assets/app/messages-CurtIjBF.js.map +0 -1
  198. package/dist/assets/app/messages-Cv6zIbaP.js +0 -4
  199. package/dist/assets/app/messages-Cv6zIbaP.js.map +0 -1
  200. package/dist/assets/app/messages-D1eLQuPE.js +0 -4
  201. package/dist/assets/app/messages-D1eLQuPE.js.map +0 -1
  202. package/dist/assets/app/messages-D8vHEaYW.js +0 -4
  203. package/dist/assets/app/messages-D8vHEaYW.js.map +0 -1
  204. package/dist/assets/app/messages-DJ1Q4GeC.js +0 -4
  205. package/dist/assets/app/messages-DJ1Q4GeC.js.map +0 -1
  206. package/dist/assets/app/messages-DRL3exqd.js +0 -4
  207. package/dist/assets/app/messages-DRL3exqd.js.map +0 -1
  208. package/dist/assets/app/messages-DWLPQRTp.js +0 -4
  209. package/dist/assets/app/messages-DWLPQRTp.js.map +0 -1
  210. package/dist/assets/app/messages-DjVaE9YE.js +0 -4
  211. package/dist/assets/app/messages-DjVaE9YE.js.map +0 -1
  212. package/dist/assets/app/messages-DqpMfFJR.js +0 -4
  213. package/dist/assets/app/messages-DqpMfFJR.js.map +0 -1
  214. package/dist/assets/app/messages-ETjhJBEN.js +0 -4
  215. package/dist/assets/app/messages-ETjhJBEN.js.map +0 -1
  216. package/dist/assets/app/messages-EUKrgrGn.js +0 -4
  217. package/dist/assets/app/messages-EUKrgrGn.js.map +0 -1
  218. package/dist/assets/app/messages-QQrOUcPW.js +0 -4
  219. package/dist/assets/app/messages-QQrOUcPW.js.map +0 -1
  220. package/dist/assets/app/messages-e2QGqFL6.js +0 -4
  221. package/dist/assets/app/messages-e2QGqFL6.js.map +0 -1
  222. package/dist/assets/app/messages-p61py7gD.js +0 -4
  223. package/dist/assets/app/messages-p61py7gD.js.map +0 -1
  224. /package/dist/assets/app/{main-CSatvmRR.css → main-Dr6y26KY.css} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atproto/oauth-provider
2
2
 
3
+ ## 0.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#3622](https://github.com/bluesky-social/atproto/pull/3622) [`9e3eace8f`](https://github.com/bluesky-social/atproto/commit/9e3eace8f9c22141e6da80b7696cd3b3e7c38779) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Properly validate handle syntax during sign-up
8
+
9
+ - [#3621](https://github.com/bluesky-social/atproto/pull/3621) [`5ada66ceb`](https://github.com/bluesky-social/atproto/commit/5ada66ceb9d5b2c64f112bb62da0edc421c765bf) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Allow invite codes in any format
10
+
11
+ ## 0.5.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#3611](https://github.com/bluesky-social/atproto/pull/3611) [`c01d7f5d1`](https://github.com/bluesky-social/atproto/commit/c01d7f5d155445d7741c09f91c84af64b31bdbed) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Make branding colors optional
16
+
17
+ - [#3614](https://github.com/bluesky-social/atproto/pull/3614) [`8827ff433`](https://github.com/bluesky-social/atproto/commit/8827ff433a211d2db80840cfc4ee146a7fb44849) Thanks [@matthieusieben](https://github.com/matthieusieben)! - Improve branding parsing
18
+
3
19
  ## 0.5.0
4
20
 
5
21
  ### Minor Changes
@@ -8,8 +8,9 @@ import { Account } from './account.js';
8
8
  export declare const oldPasswordSchema: z.ZodString;
9
9
  export declare const newPasswordSchema: z.ZodString;
10
10
  export declare const tokenSchema: z.ZodString;
11
- export declare const handleSchema: z.ZodString;
12
- export declare const emailSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
11
+ export declare const handleSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
12
+ export declare const emailSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
13
+ export declare const inviteCodeSchema: z.ZodString;
13
14
  export declare const authenticateAccountDataSchema: z.ZodObject<{
14
15
  locale: z.ZodString;
15
16
  username: z.ZodString;
@@ -29,8 +30,8 @@ export declare const authenticateAccountDataSchema: z.ZodObject<{
29
30
  export type AuthenticateAccountData = z.TypeOf<typeof authenticateAccountDataSchema>;
30
31
  export declare const createAccountDataSchema: z.ZodObject<{
31
32
  locale: z.ZodString;
32
- handle: z.ZodString;
33
- email: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
33
+ handle: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
34
+ email: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
34
35
  password: z.ZodIntersection<z.ZodString, z.ZodString>;
35
36
  inviteCode: z.ZodOptional<z.ZodString>;
36
37
  }, "strict", z.ZodTypeAny, {
@@ -49,7 +50,7 @@ export declare const createAccountDataSchema: z.ZodObject<{
49
50
  export type CreateAccountData = z.TypeOf<typeof createAccountDataSchema>;
50
51
  export declare const resetPasswordRequestDataSchema: z.ZodObject<{
51
52
  locale: z.ZodString;
52
- email: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
53
+ email: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
53
54
  }, "strict", z.ZodTypeAny, {
54
55
  email: string;
55
56
  locale: string;
@@ -1 +1 @@
1
- {"version":3,"file":"account-store.d.ts","sourceRoot":"","sources":["../../src/account/account-store.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAEjD,OAAO,EAAE,SAAS,EAAyB,MAAM,qBAAqB,CAAA;AACtE,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,uCAAuC,EACxC,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AACpC,OAAO,EAA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,EAAE,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;CAC1D;AAED,eAAO,MAAM,cAAc,yHAWzB,CAAA;AAEF,wBAAgB,cAAc,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,CAAC,GAAG,YAAY,CAKrE"}
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isAccountStore = exports.SecondAuthenticationFactorRequiredError = exports.InvalidRequestError = exports.HandleUnavailableError = exports.resetPasswordConfirmDataSchema = exports.resetPasswordRequestDataSchema = exports.createAccountDataSchema = exports.authenticateAccountDataSchema = exports.emailSchema = exports.handleSchema = exports.tokenSchema = exports.newPasswordSchema = exports.oldPasswordSchema = void 0;
3
+ exports.isAccountStore = exports.SecondAuthenticationFactorRequiredError = exports.InvalidRequestError = exports.HandleUnavailableError = exports.resetPasswordConfirmDataSchema = exports.resetPasswordRequestDataSchema = exports.createAccountDataSchema = exports.authenticateAccountDataSchema = exports.inviteCodeSchema = exports.emailSchema = exports.handleSchema = exports.tokenSchema = exports.newPasswordSchema = exports.oldPasswordSchema = void 0;
4
4
  exports.asAccountStore = asAccountStore;
5
5
  const address_1 = require("@hapi/address");
6
6
  const disposable_email_domains_js_1 = require("disposable-email-domains-js");
7
7
  const zod_1 = require("zod");
8
+ const syntax_1 = require("@atproto/syntax");
8
9
  const locale_js_1 = require("../lib/locale.js");
9
10
  const type_js_1 = require("../lib/util/type.js");
10
11
  const oauth_errors_js_1 = require("../oauth-errors.js");
@@ -14,12 +15,25 @@ Object.defineProperty(exports, "SecondAuthenticationFactorRequiredError", { enum
14
15
  // @NOTE Change the length here to force stronger passwords (through a reset)
15
16
  exports.oldPasswordSchema = zod_1.z.string().min(1);
16
17
  exports.newPasswordSchema = zod_1.z.string().min(8);
17
- exports.tokenSchema = zod_1.z.string().regex(/^[A-Z2-7]{5}-[A-Z2-7]{5}$/);
18
+ exports.tokenSchema = zod_1.z
19
+ .string()
20
+ .regex(/^[A-Z2-7]{5}-[A-Z2-7]{5}$/, 'Invalid token format');
18
21
  exports.handleSchema = zod_1.z
19
22
  .string()
20
- .min(3)
21
- .max(30)
22
- .regex(/^[a-z0-9][a-z0-9-]+[a-z0-9](?:\.[a-z0-9][a-z0-9-]+[a-z0-9])+$/);
23
+ // @NOTE: We only check against validity towards ATProto's syntax. Additional
24
+ // rules may be imposed by the store implementation.
25
+ .superRefine((value, ctx) => {
26
+ try {
27
+ (0, syntax_1.ensureValidHandle)(value);
28
+ }
29
+ catch (err) {
30
+ ctx.addIssue({
31
+ code: zod_1.z.ZodIssueCode.custom,
32
+ message: err instanceof Error ? err.message : 'Invalid handle',
33
+ });
34
+ }
35
+ })
36
+ .transform(syntax_1.normalizeHandle);
23
37
  exports.emailSchema = zod_1.z
24
38
  .string()
25
39
  .email()
@@ -31,13 +45,15 @@ exports.emailSchema = zod_1.z
31
45
  })
32
46
  .refine((email) => !(0, disposable_email_domains_js_1.isDisposableEmail)(email), {
33
47
  message: 'Disposable email addresses are not allowed',
34
- });
48
+ })
49
+ .transform((value) => value.toLowerCase());
50
+ exports.inviteCodeSchema = zod_1.z.string().min(1);
35
51
  exports.authenticateAccountDataSchema = zod_1.z
36
52
  .object({
37
53
  locale: locale_js_1.localeSchema,
38
54
  username: zod_1.z.string(),
39
55
  password: exports.oldPasswordSchema,
40
- emailOtp: zod_1.z.string().optional(),
56
+ emailOtp: exports.tokenSchema.optional(),
41
57
  })
42
58
  .strict();
43
59
  exports.createAccountDataSchema = zod_1.z
@@ -46,7 +62,7 @@ exports.createAccountDataSchema = zod_1.z
46
62
  handle: exports.handleSchema,
47
63
  email: exports.emailSchema,
48
64
  password: zod_1.z.intersection(exports.oldPasswordSchema, exports.newPasswordSchema),
49
- inviteCode: exports.tokenSchema.optional(),
65
+ inviteCode: exports.inviteCodeSchema.optional(),
50
66
  })
51
67
  .strict();
52
68
  exports.resetPasswordRequestDataSchema = zod_1.z
@@ -1 +1 @@
1
- {"version":3,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,CAAA;AAME,QAAA,uBAAuB,GAAG,OAAC;KACrC,MAAM,CAAC;IACN,MAAM,EAAE,wBAAY;IACpB,MAAM,EAAE,oBAAY;IACpB,KAAK,EAAE,mBAAW;IAClB,QAAQ,EAAE,OAAC,CAAC,YAAY,CAAC,yBAAiB,EAAE,yBAAiB,CAAC;IAC9D,UAAU,EAAE,mBAAW,CAAC,QAAQ,EAAE;CACnC,CAAC;KACD,MAAM,EAAE,CAAA;AAIE,QAAA,8BAA8B,GAAG,OAAC;KAC5C,MAAM,CAAC;IACN,MAAM,EAAE,wBAAY;IACpB,KAAK,EAAE,mBAAW;CACnB,CAAC;KACD,MAAM,EAAE,CAAA;AAME,QAAA,8BAA8B,GAAG,OAAC;KAC5C,MAAM,CAAC;IACN,KAAK,EAAE,mBAAW;IAClB,QAAQ,EAAE,OAAC,CAAC,YAAY,CAAC,yBAAiB,EAAE,yBAAiB,CAAC;CAC/D,CAAC;KACD,MAAM,EAAE,CAAA;AA6EE,QAAA,cAAc,GAAG,IAAA,+BAAqB,EAAe;IAChE,eAAe;IACf,qBAAqB;IACrB,qBAAqB;IACrB,kBAAkB;IAClB,kBAAkB;IAClB,qBAAqB;IACrB,oBAAoB;IACpB,sBAAsB;IACtB,sBAAsB;IACtB,0BAA0B;CAC3B,CAAC,CAAA;AAEF,SAAgB,cAAc,CAAI,cAAiB;IACjD,IAAI,CAAC,cAAc,IAAI,CAAC,IAAA,sBAAc,EAAC,cAAc,CAAC,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;IACxD,CAAC;IACD,OAAO,cAAc,CAAA;AACvB,CAAC"}
1
+ {"version":3,"file":"account-store.js","sourceRoot":"","sources":["../../src/account/account-store.ts"],"names":[],"mappings":";;;AAuLA,wCAKC;AA5LD,2CAA4C;AAC5C,6EAA+D;AAC/D,6BAAuB;AACvB,4CAAoE;AAGpE,gDAA+C;AAC/C,iDAAsE;AACtE,wDAI2B;AAiGzB,uGApGA,wC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AAC,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;IACxD,CAAC;IACD,OAAO,cAAc,CAAA;AACvB,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  export declare const signUpDataSchema: z.ZodObject<z.objectUtil.extendShape<{
3
3
  locale: z.ZodString;
4
- handle: z.ZodString;
5
- email: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
4
+ handle: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
5
+ email: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
6
6
  password: z.ZodIntersection<z.ZodString, z.ZodString>;
7
7
  inviteCode: z.ZodOptional<z.ZodString>;
8
8
  }, {