@connextar/house 0.23.1 → 0.23.3

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 (180) hide show
  1. package/README.md +22 -3
  2. package/dist/analytics/browser.d.ts +1 -0
  3. package/dist/analytics/browser.d.ts.map +1 -1
  4. package/dist/analytics/browser.js +20 -3
  5. package/dist/analytics/browser.js.map +1 -1
  6. package/dist/analytics/config.d.ts +5 -0
  7. package/dist/analytics/config.d.ts.map +1 -1
  8. package/dist/analytics/config.js +4 -1
  9. package/dist/analytics/config.js.map +1 -1
  10. package/dist/analytics/react.d.ts.map +1 -1
  11. package/dist/analytics/react.js +4 -2
  12. package/dist/analytics/react.js.map +1 -1
  13. package/dist/analytics/redact.d.ts.map +1 -1
  14. package/dist/analytics/redact.js +6 -1
  15. package/dist/analytics/redact.js.map +1 -1
  16. package/package.json +5 -2
  17. package/src/account/data-contract.ts +112 -0
  18. package/src/account/index.ts +11 -0
  19. package/src/admin/access.ts +267 -0
  20. package/src/admin/audit.ts +238 -0
  21. package/src/admin/bootstrap.ts +220 -0
  22. package/src/admin/client-index.ts +19 -0
  23. package/src/admin/client.tsx +187 -0
  24. package/src/admin/index.ts +91 -0
  25. package/src/admin/proof.ts +155 -0
  26. package/src/admin/second-factor-index.ts +16 -0
  27. package/src/admin/second-factor.ts +403 -0
  28. package/src/admin/testing-index.ts +13 -0
  29. package/src/admin/testing.ts +299 -0
  30. package/src/admin/view-as.ts +511 -0
  31. package/src/ai/config-index.ts +40 -0
  32. package/src/ai/config.ts +176 -0
  33. package/src/ai/images.ts +18 -0
  34. package/src/ai/index.ts +21 -0
  35. package/src/ai/pricing.ts +107 -0
  36. package/src/ai/provider.ts +403 -0
  37. package/src/analytics/browser.ts +400 -0
  38. package/src/analytics/client-index.ts +12 -0
  39. package/src/analytics/config.ts +89 -0
  40. package/src/analytics/index.ts +17 -0
  41. package/src/analytics/ingest.ts +81 -0
  42. package/src/analytics/react-index.ts +16 -0
  43. package/src/analytics/react.tsx +241 -0
  44. package/src/analytics/redact.ts +146 -0
  45. package/src/analytics/server-index.ts +17 -0
  46. package/src/analytics/server.ts +277 -0
  47. package/src/auth/index.ts +30 -0
  48. package/src/auth/second-factor-index.ts +16 -0
  49. package/src/auth/second-factor-next.ts +136 -0
  50. package/src/auth/second-factor-routes.ts +40 -0
  51. package/src/auth/second-factor.ts +226 -0
  52. package/src/auth/step-up-client-index.ts +13 -0
  53. package/src/auth/step-up-client.ts +23 -0
  54. package/src/auth/step-up-index.ts +19 -0
  55. package/src/auth/step-up-routes.ts +99 -0
  56. package/src/auth/step-up.ts +432 -0
  57. package/src/auth/two-factor-policy.ts +112 -0
  58. package/src/changelog/changelog.tsx +367 -0
  59. package/src/changelog/index.ts +12 -0
  60. package/src/editor/block-handle.tsx +312 -0
  61. package/src/editor/blocks.ts +169 -0
  62. package/src/editor/bubble-toolbar.tsx +208 -0
  63. package/src/editor/collapsible.ts +159 -0
  64. package/src/editor/content-index.ts +1 -0
  65. package/src/editor/content.tsx +343 -0
  66. package/src/editor/editor.tsx +333 -0
  67. package/src/editor/emoji-index.ts +1 -0
  68. package/src/editor/emoji-picker.tsx +114 -0
  69. package/src/editor/emoji.ts +436 -0
  70. package/src/editor/index.ts +6 -0
  71. package/src/editor/sections.ts +83 -0
  72. package/src/editor/suggestion-popup.tsx +136 -0
  73. package/src/editor/suggestions.ts +309 -0
  74. package/src/editor/ui.tsx +171 -0
  75. package/src/errors/error-shell.tsx +72 -0
  76. package/src/errors/global-error-shell.tsx +116 -0
  77. package/src/errors/index.ts +2 -0
  78. package/src/grid/columns.ts +48 -0
  79. package/src/grid/compare.ts +35 -0
  80. package/src/grid/hidden-columns.ts +95 -0
  81. package/src/grid/index.ts +27 -0
  82. package/src/grid/use-grid.ts +282 -0
  83. package/src/grid/views.ts +70 -0
  84. package/src/guides/guide-article.tsx +92 -0
  85. package/src/guides/guide-figure-zoom.tsx +533 -0
  86. package/src/guides/guide-figure.tsx +68 -0
  87. package/src/guides/guide-toc.tsx +133 -0
  88. package/src/guides/guides-landing.tsx +57 -0
  89. package/src/guides/guides-search.tsx +160 -0
  90. package/src/guides/guides-shell.tsx +60 -0
  91. package/src/guides/guides-sidebar.tsx +93 -0
  92. package/src/guides/index.ts +28 -0
  93. package/src/guides/library.ts +165 -0
  94. package/src/health/health.ts +115 -0
  95. package/src/health/index.ts +11 -0
  96. package/src/internal/cx.ts +4 -0
  97. package/src/internal/next-link.ts +23 -0
  98. package/src/jobs/counts.ts +151 -0
  99. package/src/jobs/cron-auth.ts +60 -0
  100. package/src/jobs/health.ts +315 -0
  101. package/src/jobs/idle.ts +86 -0
  102. package/src/jobs/index.ts +120 -0
  103. package/src/jobs/job-health-list.tsx +316 -0
  104. package/src/jobs/next-index.ts +4 -0
  105. package/src/jobs/next.ts +65 -0
  106. package/src/jobs/prisma-index.ts +12 -0
  107. package/src/jobs/prisma.ts +170 -0
  108. package/src/jobs/prune.ts +79 -0
  109. package/src/jobs/react-index.ts +35 -0
  110. package/src/jobs/registry.ts +189 -0
  111. package/src/jobs/scheduler.ts +437 -0
  112. package/src/jobs/store.ts +212 -0
  113. package/src/jobs/windows.ts +157 -0
  114. package/src/maintenance/core.ts +270 -0
  115. package/src/maintenance/gate.ts +171 -0
  116. package/src/maintenance/index.ts +40 -0
  117. package/src/maintenance/page.ts +76 -0
  118. package/src/maintenance/proxy.ts +88 -0
  119. package/src/maintenance/react-index.ts +7 -0
  120. package/src/maintenance/react.tsx +190 -0
  121. package/src/maintenance/route.ts +82 -0
  122. package/src/maintenance/unavailable.ts +61 -0
  123. package/src/markdown/figure.tsx +132 -0
  124. package/src/markdown/figures.ts +237 -0
  125. package/src/markdown/guide.tsx +536 -0
  126. package/src/markdown/index.ts +53 -0
  127. package/src/markdown/table-view.tsx +74 -0
  128. package/src/markdown/table.ts +90 -0
  129. package/src/password/common.ts +58 -0
  130. package/src/password/estimate-index.ts +18 -0
  131. package/src/password/estimate.ts +715 -0
  132. package/src/password/index.ts +40 -0
  133. package/src/password/password-input.tsx +116 -0
  134. package/src/password/password-strength.tsx +157 -0
  135. package/src/password/reveal.ts +151 -0
  136. package/src/rate-limit/better-auth.ts +94 -0
  137. package/src/rate-limit/index.ts +32 -0
  138. package/src/rate-limit/keys.ts +110 -0
  139. package/src/rate-limit/limiter.ts +276 -0
  140. package/src/rate-limit/prisma-index.ts +12 -0
  141. package/src/rate-limit/prisma.ts +157 -0
  142. package/src/rate-limit/store.ts +47 -0
  143. package/src/release/changelog.ts +364 -0
  144. package/src/release/index.ts +32 -0
  145. package/src/release/version.ts +64 -0
  146. package/src/setup-guide/bits.tsx +420 -0
  147. package/src/setup-guide/card.tsx +358 -0
  148. package/src/setup-guide/class-names.ts +144 -0
  149. package/src/setup-guide/context.tsx +239 -0
  150. package/src/setup-guide/guide.ts +271 -0
  151. package/src/setup-guide/index.ts +76 -0
  152. package/src/setup-guide/launcher.tsx +207 -0
  153. package/src/setup-guide/strip.tsx +127 -0
  154. package/src/styles/house.css +384 -0
  155. package/src/trail/index.ts +12 -0
  156. package/src/trail/rules.ts +84 -0
  157. package/src/trail/trail.tsx +367 -0
  158. package/src/ux/errors.ts +32 -0
  159. package/src/ux/feedback.tsx +41 -0
  160. package/src/ux/index.ts +44 -0
  161. package/src/ux/navigation-index.ts +16 -0
  162. package/src/ux/navigation-progress.tsx +270 -0
  163. package/src/ux/optimistic.ts +415 -0
  164. package/src/ux/use-action.ts +155 -0
  165. package/src/ux/use-optimistic-list.ts +227 -0
  166. package/src/ux/use-optimistic-value.ts +136 -0
  167. package/src/web-search/index.ts +13 -0
  168. package/src/web-search/providers.ts +177 -0
  169. package/src/web-search/types.ts +98 -0
  170. package/src/whats-new/body.tsx +190 -0
  171. package/src/whats-new/index.ts +43 -0
  172. package/src/whats-new/seen.ts +40 -0
  173. package/src/whats-new/select.ts +230 -0
  174. package/src/whats-new/use-whats-new.ts +109 -0
  175. package/src/wizard/index.ts +61 -0
  176. package/src/wizard/invalid.ts +152 -0
  177. package/src/wizard/react-hook-form-index.ts +11 -0
  178. package/src/wizard/rhf-adapter.ts +67 -0
  179. package/src/wizard/rules.ts +137 -0
  180. package/src/wizard/wizard.tsx +442 -0
@@ -0,0 +1,90 @@
1
+ /**
2
+ * GitHub-flavoured Markdown tables, for the hand-rolled guide renderers.
3
+ *
4
+ * The in-app help centres render their guides with small, dependency-free
5
+ * Markdown parsers. Each grew the same blind spot: a table rendered as one
6
+ * paragraph of pipes, so every troubleshooting section ("Problem | What to try")
7
+ * and every plan comparison showed raw markup on a public page. This is the
8
+ * parsing half, shared; `./table.tsx` draws it.
9
+ */
10
+
11
+ export type TableAlign = "left" | "center" | "right";
12
+
13
+ export interface MarkdownTable {
14
+ header: string[];
15
+ aligns: TableAlign[];
16
+ /** Body rows. A short row is padded to the header's width; a long one is cut to it. */
17
+ rows: string[][];
18
+ }
19
+
20
+ /** A line that is a table row: starts and ends with a pipe. */
21
+ export function isTableRow(line: string): boolean {
22
+ const trimmed = line.trim();
23
+ return trimmed.length > 1 && trimmed.startsWith("|") && trimmed.endsWith("|");
24
+ }
25
+
26
+ /** Cells of a table row, with `\|` kept as a literal pipe. */
27
+ export function splitTableRow(line: string): string[] {
28
+ const inner = line.trim().slice(1, -1);
29
+ const cells: string[] = [];
30
+ let current = "";
31
+ for (let i = 0; i < inner.length; i++) {
32
+ const ch = inner[i];
33
+ if (ch === "\\" && inner[i + 1] === "|") {
34
+ current += "|";
35
+ i++;
36
+ } else if (ch === "|") {
37
+ cells.push(current.trim());
38
+ current = "";
39
+ } else {
40
+ current += ch;
41
+ }
42
+ }
43
+ cells.push(current.trim());
44
+ return cells;
45
+ }
46
+
47
+ /** The row under a header: `| --- | :-: | --: |`, nothing but dashes and colons. */
48
+ export function isTableSeparator(line: string): boolean {
49
+ return isTableRow(line) && splitTableRow(line).every((cell) => /^:?-+:?$/.test(cell));
50
+ }
51
+
52
+ /** A row followed by a separator row — a lone `| a | b |` line is prose, not a table. */
53
+ export function isTableStart(lines: readonly string[], i: number): boolean {
54
+ const line = lines[i];
55
+ const next = lines[i + 1];
56
+ return line !== undefined && next !== undefined && isTableRow(line) && isTableSeparator(next);
57
+ }
58
+
59
+ export function alignmentOf(separatorCell: string): TableAlign {
60
+ const left = separatorCell.startsWith(":");
61
+ const right = separatorCell.endsWith(":");
62
+ if (left && right) return "center";
63
+ if (right) return "right";
64
+ return "left";
65
+ }
66
+
67
+ /**
68
+ * Read the table that starts at `lines[i]`, or null when none does. Returns the
69
+ * index of the first line after it, so a renderer's block loop carries on from
70
+ * there.
71
+ */
72
+ export function readTable(lines: readonly string[], i: number): { table: MarkdownTable; next: number } | null {
73
+ if (!isTableStart(lines, i)) return null;
74
+ const header = splitTableRow(lines[i] ?? "");
75
+ const aligns = splitTableRow(lines[i + 1] ?? "").map(alignmentOf);
76
+ const width = header.length;
77
+
78
+ let next = i + 2;
79
+ const rows: string[][] = [];
80
+ while (next < lines.length && isTableRow(lines[next] ?? "")) {
81
+ const cells = splitTableRow(lines[next] ?? "");
82
+ rows.push(Array.from({ length: width }, (_, col) => cells[col] ?? ""));
83
+ next++;
84
+ }
85
+
86
+ return {
87
+ table: { header, aligns: Array.from({ length: width }, (_, col) => aligns[col] ?? "left"), rows },
88
+ next,
89
+ };
90
+ }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * The words people build passwords out of, most guessed first.
3
+ *
4
+ * The head is the top of the leaked-password lists every attacker starts with;
5
+ * the tail is the words those passwords are made of — pets, teams, seasons,
6
+ * months, feelings, keyboard rows — so "Sunshine2024!" is read as a common word
7
+ * dressed up rather than as twelve unknown characters. Kept to a few kilobytes
8
+ * on purpose: a full frequency list is what makes zxcvbn several hundred
9
+ * kilobytes, and the patterns (sequences, repeats, keyboard walks, dates) do
10
+ * most of the work a list would.
11
+ *
12
+ * A word's rank is its position, and its rank is roughly how many guesses an
13
+ * attacker spends before trying it. Lower case, three letters or more.
14
+ */
15
+ const WORDS = `
16
+ password 123456 123456789 12345678 12345 qwerty 1234567 111111 1234567890 123123
17
+ abc123 1234 password1 iloveyou 000000 qwerty123 dragon monkey letmein 654321
18
+ football baseball welcome admin login master sunshine princess shadow superman
19
+ starwars trustno1 passw0rd whatever qazwsx michael charlie freedom hello secret
20
+ ashley bailey jordan jennifer hunter thomas batman soccer hockey killer george
21
+ andrew michelle jessica pepper daniel access mustang ginger joshua cheese amanda
22
+ summer love buster tigger robert matthew yankees dallas austin thunder taylor
23
+ harley hannah heather maggie orange computer internet flower silver golden
24
+ cookie chelsea arsenal liverpool manchester united london england google
25
+ apple banana chocolate coffee purple yellow blue green black white red pink
26
+ winter spring autumn january february march april june july august september
27
+ october november december monday tuesday wednesday thursday friday saturday
28
+ sunday family friends forever angel angels baby babygirl lovely loveme lover
29
+ pass pass123 password123 admin123 root toor test test123 guest user default
30
+ changeme temp temporary qwertyuiop asdfgh asdfghjkl zxcvbn zxcvbnm azerty
31
+ qwertz 1q2w3e4r 1qaz2wsx zaq12wsx q1w2e3r4 abcdef abcd1234 aaaaaa 121212
32
+ 112233 123321 666666 696969 777777 888888 999999 987654321 159753 147258
33
+ myspace facebook twitter instagram linkedin microsoft windows samsung iphone
34
+ nintendo pokemon minecraft fortnite matrix hello123 welcome1 letmein1 football1
35
+ princess1 monkey1 dragon1 sunshine1 iloveyou1 qwerty1 charlie1 lovely1 secret1
36
+ tiger lion bear wolf eagle falcon dolphin horse puppy kitty kitten doggie
37
+ snoopy scooter buddy lucky oliver jack harry sophie emily olivia jacob william
38
+ james john david richard joseph charles mark paul steven kevin brian edward
39
+ mary patricia linda barbara elizabeth susan margaret sarah karen nancy lisa
40
+ anna maria laura helen emma grace chloe lucy ella mia amelia isla ava lily
41
+ alexander benjamin samuel henry oscar leo noah arthur alfie theo archie freddie
42
+ jesus christ god heaven blessed faith hope peace happy smile sweet honey sugar
43
+ magic dream star stars moon sun sky ocean river mountain forest fire water
44
+ earth storm rain snow ice money cash rich gold diamond king queen prince
45
+ princesa boss legend ninja pirate zombie monster devil demon ghost hunter1
46
+ music guitar piano rock metal jazz dance party fun cool awesome super power
47
+ player gamer game games soccer1 rugby cricket tennis golf boxing racing
48
+ chicken pizza burger pasta cherry lemon mango peach strawberry
49
+ college school student teacher doctor nurse office company business work
50
+ home house garden city country world england1 scotland wales ireland
51
+ britain america canada australia france germany spain italy india china japan
52
+ spurs everton leeds celtic rangers chelsea1 barcelona madrid juventus
53
+ batman1 spiderman ironman wonder marvel hulk thor loki yoda jedi sith vader
54
+ secret123 mypassword yourpassword nopassword letme letmein123 iloveu
55
+ sexy hottie babe darling sweetheart kiss hugs cuddles
56
+ `;
57
+
58
+ export const COMMON_WORDS: readonly string[] = [...new Set(WORDS.trim().split(/\s+/))];
@@ -0,0 +1,18 @@
1
+ /**
2
+ * `@connextar/house/password/estimate` — the strength estimator alone, for the
3
+ * server.
4
+ *
5
+ * It imports nothing at all, so a route handler that refuses the weakest
6
+ * passwords with the same judgement the meter showed pulls in neither React nor
7
+ * an icon set. `src/password/entry-points.test.ts` holds it to that.
8
+ */
9
+ export {
10
+ estimatePasswordStrength,
11
+ MAX_ANALYSED_LENGTH,
12
+ PASSWORD_STRENGTH_MESSAGES,
13
+ type EstimatePasswordStrengthOptions,
14
+ type PasswordScore,
15
+ type PasswordStrengthEstimate,
16
+ type PasswordStrengthMessages,
17
+ type PasswordWeakness,
18
+ } from "./estimate.js";