@specific.dev/spectest 0.39.0 → 0.41.0

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 (100) hide show
  1. package/dist/components/supabase.d.ts +87 -27
  2. package/dist/components/supabase.js +352 -69
  3. package/dist/daemon.d.ts +38 -0
  4. package/dist/daemon.js +388 -941
  5. package/dist/harness/build-context.d.ts +82 -0
  6. package/dist/harness/build-context.js +113 -0
  7. package/dist/harness/buildkit-progress.d.ts +37 -0
  8. package/dist/harness/buildkit-progress.js +66 -0
  9. package/dist/harness/container-run.d.ts +89 -0
  10. package/dist/harness/container-run.js +118 -0
  11. package/dist/harness/file-mounts.d.ts +91 -0
  12. package/dist/harness/file-mounts.js +119 -0
  13. package/dist/harness/hostmatch.d.ts +65 -0
  14. package/dist/harness/hostmatch.js +108 -0
  15. package/dist/harness/http-proxy.d.ts +62 -0
  16. package/dist/harness/http-proxy.js +104 -0
  17. package/dist/harness/ingress-table.d.ts +148 -0
  18. package/dist/harness/ingress-table.js +129 -0
  19. package/dist/harness/log-delta.d.ts +54 -0
  20. package/dist/harness/log-delta.js +83 -0
  21. package/dist/harness/main.d.ts +47 -0
  22. package/dist/harness/main.js +164 -0
  23. package/dist/harness/methods.d.ts +54 -0
  24. package/dist/harness/methods.js +65 -0
  25. package/dist/harness/names-registry.d.ts +63 -0
  26. package/dist/harness/names-registry.js +90 -0
  27. package/dist/harness/protocol.d.ts +88 -0
  28. package/dist/harness/protocol.js +96 -0
  29. package/dist/harness/ready-poll.d.ts +47 -0
  30. package/dist/harness/ready-poll.js +67 -0
  31. package/dist/harness/service-graph.d.ts +29 -0
  32. package/dist/harness/service-graph.js +92 -0
  33. package/dist/harness/volume-paths.d.ts +70 -0
  34. package/dist/harness/volume-paths.js +81 -0
  35. package/dist/index.d.ts +3 -3
  36. package/dist/ingress.d.ts +1 -1
  37. package/dist/resolver.js +5 -8
  38. package/dist/vendor/rrweb-plugin-console-record.umd.js +521 -0
  39. package/dist/vendor/rrweb-record.min.js +5061 -0
  40. package/package.json +7 -1
  41. package/src/aws-sigv4.ts +218 -0
  42. package/src/browser.ts +2040 -0
  43. package/src/components/aws.ts +554 -0
  44. package/src/components/email.ts +398 -0
  45. package/src/components/expo.ts +167 -0
  46. package/src/components/index.ts +81 -0
  47. package/src/components/k3s.ts +2061 -0
  48. package/src/components/postgres.ts +132 -0
  49. package/src/components/replayFake.ts +1015 -0
  50. package/src/components/s3.ts +132 -0
  51. package/src/components/supabase.ts +1699 -0
  52. package/src/daemon.ts +5489 -0
  53. package/src/harness/build-context.test.ts +0 -0
  54. package/src/harness/build-context.ts +146 -0
  55. package/src/harness/buildkit-progress.test.ts +98 -0
  56. package/src/harness/buildkit-progress.ts +74 -0
  57. package/src/harness/container-run.test.ts +209 -0
  58. package/src/harness/container-run.ts +158 -0
  59. package/src/harness/file-mounts.test.ts +185 -0
  60. package/src/harness/file-mounts.ts +145 -0
  61. package/src/harness/hostmatch.test.ts +148 -0
  62. package/src/harness/hostmatch.ts +109 -0
  63. package/src/harness/http-proxy.test.ts +156 -0
  64. package/src/harness/http-proxy.ts +119 -0
  65. package/src/harness/ingress-rebind.test.ts +125 -0
  66. package/src/harness/ingress-table.test.ts +172 -0
  67. package/src/harness/ingress-table.ts +186 -0
  68. package/src/harness/log-delta.test.ts +125 -0
  69. package/src/harness/log-delta.ts +100 -0
  70. package/src/harness/main.test.ts +211 -0
  71. package/src/harness/main.ts +196 -0
  72. package/src/harness/methods.test.ts +63 -0
  73. package/src/harness/methods.ts +92 -0
  74. package/src/harness/names-registry.test.ts +137 -0
  75. package/src/harness/names-registry.ts +108 -0
  76. package/src/harness/protocol.test.ts +148 -0
  77. package/src/harness/protocol.ts +163 -0
  78. package/src/harness/ready-poll.test.ts +172 -0
  79. package/src/harness/ready-poll.ts +93 -0
  80. package/src/harness/service-graph.test.ts +97 -0
  81. package/src/harness/service-graph.ts +97 -0
  82. package/src/harness/volume-paths.test.ts +102 -0
  83. package/src/harness/volume-paths.ts +112 -0
  84. package/src/ids.ts +89 -0
  85. package/src/index.ts +2725 -0
  86. package/src/ingress.ts +305 -0
  87. package/src/inspect.ts +739 -0
  88. package/src/locator.ts +716 -0
  89. package/src/mobile.ts +133 -0
  90. package/src/record-secrets.ts +41 -0
  91. package/src/recorder.ts +846 -0
  92. package/src/redis.ts +202 -0
  93. package/src/replay-bundle.ts +108 -0
  94. package/src/resolver.ts +348 -0
  95. package/src/s3.ts +333 -0
  96. package/src/sql.ts +243 -0
  97. package/src/terminal.ts +740 -0
  98. package/src/url-match.ts +67 -0
  99. package/src/vendor/rrweb-plugin-console-record.umd.js +521 -0
  100. package/src/vendor/rrweb-record.min.js +5061 -0
@@ -50,17 +50,19 @@ export interface SupabaseOptions {
50
50
  */
51
51
  hostname?: string;
52
52
  /**
53
- * Capture GoTrue's outgoing mail (magic links, OTPs, password recovery,
54
- * invites — and signup confirmations with `autoconfirm: false`) with the
55
- * standard `email()` component. **On by default**: the stack includes the
56
- * capture server (`<name>-mail`) with GoTrue's SMTP wired at it, and tests
57
- * read the mailbox through the typed helpers at `ctx.svc.<name>.mail`
58
- * (`lastEmail` / `emails` / `clear`), each captured message rendering
59
- * mail-client-style on the dashboard timeline.
53
+ * Capture GoTrue's outgoing mail (signup confirmations, magic links, OTPs,
54
+ * password recovery, invites) with the standard `email()` component. **On
55
+ * by default**: the stack includes the capture server (`<name>-mail`) with
56
+ * GoTrue's SMTP wired at it, and tests read the mailbox through the typed
57
+ * helpers at `ctx.svc.<name>.mail` (`lastEmail` / `emails` / `clear`), each
58
+ * captured message rendering mail-client-style on the dashboard timeline.
60
59
  *
61
- * Signups stay one-step by default (`autoconfirm: true`) so the mailbox is
62
- * purely additive; pass `{ autoconfirm: false }` to test real
63
- * email-confirmation flows. Pass `{ service: "<key>" }` to point GoTrue at
60
+ * Signups complete in **one step** by default (`autoconfirm: true`), so
61
+ * the mailbox is purely additive and a suite that just needs accounts
62
+ * writes nothing extra. Pass `{ autoconfirm: false }` to run the real
63
+ * confirmation flow instead — the signup then issues no session until a
64
+ * test follows the emailed link out of the mailbox. Pass
65
+ * `{ service: "<key>" }` to point GoTrue at
64
66
  * an `email()` service the environment already declares — keep a single
65
67
  * mailbox per environment rather than one per component: if the app under
66
68
  * test also sends mail, share one `email()` between it and Supabase
@@ -81,24 +83,75 @@ export interface SupabaseOptions {
81
83
  serviceRole?: string[];
82
84
  };
83
85
  /**
84
- * Auto-apply SQL migrations found in the project before any dependent service
85
- * starts. `true` (default) applies every `*.sql` under `supabase/migrations/`
86
- * (sorted, the Supabase convention), then `supabase/seed.sql` if present — a
87
- * no-op when the directory is absent. Pass a string to point at a different
88
- * directory (relative to the project root or absolute), or `false` to skip.
89
- * An *explicitly configured* path that doesn't resolve is an error at env
90
- * start (a silent no-op there surfaces much later as a confusing
91
- * `relation … does not exist`).
86
+ * Where the project's SQL migrations live, e.g. `"supabase/migrations"`
87
+ * (relative to the project root, or absolute). **Nothing is applied unless
88
+ * you set this** — there is no assumed path, so a project whose schema
89
+ * arrives some other way (an app that migrates itself at boot, a dump
90
+ * restored in `setup`) never gets a second, surprising source of DDL.
91
+ *
92
+ * Every `*.sql` directly in the directory is applied in sorted filename
93
+ * order, then — the standard Supabase layout — the **`seed.sql` beside
94
+ * that directory**, if there is one:
95
+ *
96
+ * ```
97
+ * supabase/
98
+ * migrations/0001_init.sql ← applied, sorted
99
+ * migrations/0002_todos.sql
100
+ * seed.sql ← applied last
101
+ * ```
102
+ *
103
+ * It all runs **once the whole stack is up** — the same point `supabase db
104
+ * reset` applies migrations — so your SQL may use schema the services
105
+ * create when they boot (`storage.buckets`, the modern `auth.*` tables).
106
+ * PostgREST's schema cache is reloaded afterwards.
107
+ *
108
+ * A path that doesn't resolve is an error at env start; a silent no-op
109
+ * there surfaces much later as a confusing `relation … does not exist`.
92
110
  * Because `supabase/**` is project content, editing a migration correctly
93
111
  * forces a cold rebuild and re-apply (unlike `spectest/tests/**`).
94
112
  */
95
- migrations?: boolean | string;
113
+ migrations?: string;
96
114
  /**
97
- * Seed SQL applied after migrations. `true` (default) applies
98
- * `supabase/seed.sql` if it exists; a string overrides the path; `false`
99
- * skips it.
115
+ * Where the project's **edge functions** live, e.g.
116
+ * `"supabase/functions"` — one subdirectory per function, each with an
117
+ * entrypoint the runtime can serve (`supabase/functions/hello/index.ts`).
118
+ *
119
+ * **Nothing runs unless you set this.** Point at the directory and every
120
+ * function in it is served on the real Supabase edge runtime at
121
+ * `<url>/functions/v1/<name>` through the gateway — the same path
122
+ * `supabase.functions.invoke(...)` derives, so the app under test needs no
123
+ * override. Leave it unset and the runtime is left out of the stack
124
+ * entirely, along with the gateway's `/functions/v1` route.
125
+ *
126
+ * Function code is read straight from the repo — nothing is copied or
127
+ * bundled — so editing a function is an ordinary project edit.
128
+ *
129
+ * Pass an object instead of a path to turn JWT verification off, or to set
130
+ * the function secrets your code reads with `Deno.env.get(...)`.
100
131
  */
101
- seed?: boolean | string;
132
+ functions?: string | SupabaseFunctionsOptions;
133
+ }
134
+ /** Tuning for `SupabaseOptions.functions`. */
135
+ export interface SupabaseFunctionsOptions {
136
+ /**
137
+ * Directory holding one subdirectory per function, relative to the project
138
+ * root (or absolute). Required — there is no assumed location.
139
+ */
140
+ dir: string;
141
+ /**
142
+ * Reject a call that carries no valid JWT, exactly as hosted Supabase
143
+ * does. Default `true` — so a test that forgets the `Authorization`
144
+ * header fails here instead of in production. Set `false` for the
145
+ * `--no-verify-jwt` behaviour (webhooks, public endpoints).
146
+ */
147
+ verifyJwt?: boolean;
148
+ /**
149
+ * Extra environment variables the functions read (`Deno.env.get("…")`) —
150
+ * the local stand-in for function secrets. `SUPABASE_URL`,
151
+ * `SUPABASE_ANON_KEY`, `SUPABASE_SERVICE_ROLE_KEY`, `SUPABASE_DB_URL` and
152
+ * `JWT_SECRET` are already set for you.
153
+ */
154
+ env?: Record<string, string>;
102
155
  }
103
156
  /** Tuning for `SupabaseOptions.mail`. */
104
157
  export interface SupabaseMailOptions {
@@ -110,10 +163,17 @@ export interface SupabaseMailOptions {
110
163
  */
111
164
  service?: string;
112
165
  /**
113
- * Whether GoTrue autoconfirms signups. `true` (default): signups complete
114
- * in one step and send no confirmation mail — recovery, magic-link and OTP
115
- * mail is still sent and captured. Set `false` to exercise real
116
- * email-confirmation flows (signups require the emailed verification).
166
+ * Whether GoTrue confirms a signup without the emailed verification.
167
+ * **`true` by default**: signups complete in one step and send no
168
+ * confirmation mail, which keeps account creation a single call in the
169
+ * suites where it is setup rather than the thing under test.
170
+ *
171
+ * Set `false` to run the flow a hosted project runs: the signup issues no
172
+ * session, and the test follows the emailed link out of the mailbox
173
+ * exactly as a user would (see `examples/supabase-app`). Recovery,
174
+ * magic-link, OTP and invite mail is sent either way. Forced `true` when
175
+ * the stack has no mailbox (`mail: false`), since the confirmation would
176
+ * go nowhere.
117
177
  */
118
178
  autoconfirm?: boolean;
119
179
  /** Sender address GoTrue mails from. Default `admin@example.com`. */