@supatype/client 0.8.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-test.log +73 -69
  3. package/.turbo/turbo-typecheck.log +1 -1
  4. package/CHANGELOG.md +110 -0
  5. package/bin/supatype-prepare.js +68 -0
  6. package/dist/auth.d.ts +50 -6
  7. package/dist/auth.d.ts.map +1 -1
  8. package/dist/auth.js +132 -40
  9. package/dist/auth.js.map +1 -1
  10. package/dist/bindings.d.ts +4 -1
  11. package/dist/bindings.d.ts.map +1 -1
  12. package/dist/bindings.js +2 -0
  13. package/dist/bindings.js.map +1 -1
  14. package/dist/error-codes-doc.d.ts +1 -1
  15. package/dist/error-codes-doc.d.ts.map +1 -1
  16. package/dist/error-codes-doc.js +7 -0
  17. package/dist/error-codes-doc.js.map +1 -1
  18. package/dist/errors.d.ts +81 -21
  19. package/dist/errors.d.ts.map +1 -1
  20. package/dist/errors.js +133 -46
  21. package/dist/errors.js.map +1 -1
  22. package/dist/graphql-transport.d.ts +10 -3
  23. package/dist/graphql-transport.d.ts.map +1 -1
  24. package/dist/graphql-transport.js +5 -5
  25. package/dist/graphql-transport.js.map +1 -1
  26. package/dist/index.d.ts +23 -16
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +66 -48
  29. package/dist/index.js.map +1 -1
  30. package/dist/latest-rows.d.ts +29 -0
  31. package/dist/latest-rows.d.ts.map +1 -0
  32. package/dist/latest-rows.js +51 -0
  33. package/dist/latest-rows.js.map +1 -0
  34. package/dist/mutation-request.d.ts +19 -5
  35. package/dist/mutation-request.d.ts.map +1 -1
  36. package/dist/mutation-request.js +18 -15
  37. package/dist/mutation-request.js.map +1 -1
  38. package/dist/page-env-script.d.ts +12 -0
  39. package/dist/page-env-script.d.ts.map +1 -0
  40. package/dist/page-env-script.js +30 -0
  41. package/dist/page-env-script.js.map +1 -0
  42. package/dist/preview.d.ts +2 -1
  43. package/dist/preview.d.ts.map +1 -1
  44. package/dist/preview.js +7 -3
  45. package/dist/preview.js.map +1 -1
  46. package/dist/query.d.ts +49 -19
  47. package/dist/query.d.ts.map +1 -1
  48. package/dist/query.js +102 -33
  49. package/dist/query.js.map +1 -1
  50. package/dist/realtime.d.ts +5 -2
  51. package/dist/realtime.d.ts.map +1 -1
  52. package/dist/realtime.js +13 -6
  53. package/dist/realtime.js.map +1 -1
  54. package/dist/runtime-env.d.ts +59 -0
  55. package/dist/runtime-env.d.ts.map +1 -0
  56. package/dist/runtime-env.js +167 -0
  57. package/dist/runtime-env.js.map +1 -0
  58. package/dist/setup-fault.d.ts +13 -0
  59. package/dist/setup-fault.d.ts.map +1 -0
  60. package/dist/setup-fault.js +17 -0
  61. package/dist/setup-fault.js.map +1 -0
  62. package/dist/storage.d.ts +10 -5
  63. package/dist/storage.d.ts.map +1 -1
  64. package/dist/storage.js +22 -13
  65. package/dist/storage.js.map +1 -1
  66. package/dist/table-subscription.d.ts +1 -1
  67. package/dist/table-subscription.d.ts.map +1 -1
  68. package/dist/table-subscription.js +3 -2
  69. package/dist/table-subscription.js.map +1 -1
  70. package/dist/thrown-error.d.ts +16 -0
  71. package/dist/thrown-error.d.ts.map +1 -0
  72. package/dist/thrown-error.js +31 -0
  73. package/dist/thrown-error.js.map +1 -0
  74. package/dist/types.d.ts +59 -15
  75. package/dist/types.d.ts.map +1 -1
  76. package/dist/types.js.map +1 -1
  77. package/package.json +6 -2
  78. package/src/auth.ts +135 -44
  79. package/src/bindings.ts +4 -1
  80. package/src/error-codes-doc.ts +9 -1
  81. package/src/errors.ts +155 -57
  82. package/src/graphql-transport.ts +7 -8
  83. package/src/index.ts +82 -60
  84. package/src/latest-rows.ts +78 -0
  85. package/src/mutation-request.ts +34 -19
  86. package/src/page-env-script.ts +27 -0
  87. package/src/preview.ts +8 -4
  88. package/src/query.ts +128 -52
  89. package/src/realtime.ts +15 -6
  90. package/src/runtime-env.ts +220 -0
  91. package/src/setup-fault.ts +18 -0
  92. package/src/storage.ts +26 -16
  93. package/src/table-subscription.ts +3 -3
  94. package/src/thrown-error.ts +31 -0
  95. package/src/types.ts +65 -14
  96. package/tests/auth-errors.test.ts +3 -3
  97. package/tests/auth-events.test.ts +3 -7
  98. package/tests/auth-sso.test.ts +260 -0
  99. package/tests/auth-url-session.test.ts +6 -25
  100. package/tests/data-plane-auth.test.ts +1 -6
  101. package/tests/draft-insert.test.ts +9 -9
  102. package/tests/draft-update.test.ts +5 -5
  103. package/tests/entry-points.test.ts +9 -0
  104. package/tests/error-family.test.ts +79 -0
  105. package/tests/helpers/auth-unmount-binding.ts +63 -0
  106. package/tests/helpers/oauth-binding.ts +4 -3
  107. package/tests/helpers/stale-read-binding.ts +113 -0
  108. package/tests/helpers/thrown-error-binding.ts +127 -0
  109. package/tests/minimal-writes.test.ts +118 -0
  110. package/tests/postgrest-error-codes.test.ts +5 -5
  111. package/tests/query.test.ts +3 -3
  112. package/tests/rate-limit-integration.test.ts +1 -1
  113. package/tests/realtime-session-auth.test.ts +1 -4
  114. package/tests/result-error-class.test.ts +107 -0
  115. package/tests/retry-policy.test.ts +1 -1
  116. package/tests/rpc-resend.test.ts +33 -8
  117. package/tests/runtime-env-bundle.test.ts +121 -0
  118. package/tests/runtime-env-page-script.test.ts +174 -0
  119. package/tests/runtime-env.test.ts +224 -0
  120. package/tests/server-bodies.test.ts +3 -3
  121. package/tests/supatype-prepare.test.ts +139 -0
  122. package/tests/support/browser.ts +28 -0
  123. package/tests/support/jwt.ts +9 -0
  124. package/tests/thrown-error.test.ts +59 -0
  125. package/tests/unauthorized-resend.test.ts +107 -0
  126. package/tsconfig.tsbuildinfo +1 -1
@@ -1,4 +1,4 @@
1
1
 
2
- > @supatype/client@0.8.0 build /home/runner/work/supatype/supatype/packages/client
2
+ > @supatype/client@0.9.1 build /home/runner/work/supatype/supatype/packages/client
3
3
  > tsc --project tsconfig.json
4
4
 
@@ -1,78 +1,82 @@
1
1
 
2
- > @supatype/client@0.8.0 test /home/runner/work/supatype/supatype/packages/client
3
- > vitest run
2
+ > @supatype/client@0.9.1 test /home/runner/work/supatype/supatype/packages/client
3
+ > vitest run --maxWorkers=50%
4
4
 
5
5
 
6
6
   RUN  v4.0.18 /home/runner/work/supatype/supatype/packages/client
7
7
 
8
- ✓ tests/auth.test.ts (46 tests) 1095ms
9
- ✓ sends POST to /signup  400ms
10
- ✓ tests/query.test.ts (36 tests) 770ms
11
- ✓ sends request to base + path with no params  422ms
12
- ✓ tests/types.test.ts (30 tests) 494ms
13
- ✓ .single() resolves to QueryResult<Row>  364ms
14
- ✓ tests/mfa-totp-integration.test.ts (12 tests) 715ms
15
- ✓ calls POST /factors with factor_type=totp  558ms
16
- ✓ tests/draft-profile.test.ts (18 tests) 619ms
17
- ✓ is sent as Accept-Profile when the query asks for it  326ms
18
- ✓ tests/table-subscribe.test.ts (12 tests) 584ms
19
- ✓ tests/realtime-multi-tenant-integration.test.ts (7 tests) 574ms
20
- ✓ receives INSERT events on the subscribed channel  391ms
21
- ✓ tests/graphql-json.test.ts (12 tests) 663ms
22
- ✓ decodes a rich text field  315ms
23
- ✓ tests/draft-insert.test.ts (18 tests) 1090ms
24
- ✓ creates the record through supatype.create_record  445ms
25
- ✓ tests/realtime-shared-channel.test.ts (8 tests) 275ms
26
- ✓ tests/draft-update.test.ts (11 tests) 552ms
27
- ✓ reads the keys of the records its filters match, as the caller reads the table  318ms
28
- ✓ tests/auth-url-session.test.ts (10 tests) 483ms
29
- ✓ signs in from implicit-grant tokens in the fragment and cleans the URL  321ms
30
- ✓ tests/server-bodies.test.ts (20 tests) 305ms
31
- ✓ tests/exact-values.test.ts (24 tests) 155ms
32
- ✓ tests/retry-integration.test.ts (12 tests) 745ms
33
- ✓ succeeds immediately on 200 with no retries  451ms
34
- ✓ tests/storage-quota-integration.test.ts (10 tests) 499ms
35
- ✓ returns 507 Insufficient Storage with clear message  340ms
36
- ✓ tests/rate-limit-integration.test.ts (8 tests) 695ms
37
- ✓ waits Retry-After seconds then retries on 429  427ms
38
- ✓ tests/storage-upload-limit-integration.test.ts (11 tests) 339ms
39
- ✓ tests/realtime-session-auth.test.ts (7 tests) 237ms
40
- ✓ tests/retry-policy.test.ts (17 tests) 1825ms
41
- ✓ tests/realtime-exact-values.test.ts (8 tests) 512ms
8
+ ✓ tests/query.test.ts (36 tests) 418ms
9
+ ✓ tests/auth.test.ts (46 tests) 649ms
10
+ ✓ tests/mfa-totp-integration.test.ts (12 tests) 291ms
11
+ ✓ tests/types.test.ts (30 tests) 364ms
12
+ ✓ tests/draft-profile.test.ts (18 tests) 500ms
13
+ ✓ tests/table-subscribe.test.ts (12 tests) 335ms
14
+ ✓ tests/realtime-multi-tenant-integration.test.ts (7 tests) 310ms
15
+ ✓ tests/auth-sso.test.ts (16 tests) 279ms
16
+ ✓ tests/draft-insert.test.ts (18 tests) 719ms
17
+ ✓ creates the record through supatype.create_record  358ms
18
+ ✓ tests/runtime-env.test.ts (27 tests) 87ms
19
+ ✓ tests/graphql-json.test.ts (12 tests) 266ms
20
+ ✓ tests/realtime-shared-channel.test.ts (8 tests) 207ms
21
+ ✓ tests/draft-update.test.ts (11 tests) 556ms
22
+ ✓ reads the keys of the records its filters match, as the caller reads the table  381ms
23
+ ✓ tests/server-bodies.test.ts (20 tests) 400ms
24
+ ✓ tests/retry-integration.test.ts (12 tests) 127ms
25
+ ✓ tests/auth-url-session.test.ts (10 tests) 214ms
26
+ ✓ tests/runtime-env-page-script.test.ts (16 tests) 148ms
27
+ ✓ tests/exact-values.test.ts (24 tests) 35ms
28
+ ✓ tests/storage-quota-integration.test.ts (10 tests) 98ms
29
+ ✓ tests/rate-limit-integration.test.ts (8 tests) 209ms
30
+ ✓ tests/storage-upload-limit-integration.test.ts (11 tests) 201ms
31
+ ✓ tests/realtime-exact-values.test.ts (8 tests) 310ms
32
+ ✓ tests/retry-policy.test.ts (17 tests) 1839ms
33
+ ✓ tests/realtime-session-auth.test.ts (7 tests) 219ms
42
34
  ↓ tests/draft-update.integration.test.ts (3 tests | 3 skipped)
43
- ✓ tests/subscribe-frame.test.ts (6 tests) 360ms
35
+ ✓ tests/subscribe-frame.test.ts (6 tests) 210ms
36
+ ✓ tests/minimal-writes.test.ts (8 tests) 279ms
44
37
  ↓ tests/draft-insert.integration.test.ts (4 tests | 4 skipped)
45
- ✓ tests/filters.test.ts (11 tests) 399ms
46
- ✓ tests/storage-object-shape.test.ts (8 tests) 270ms
47
- ✓ tests/realtime-ack-ref.test.ts (4 tests) 302ms
48
- ✓ tests/postgrest-error-codes.test.ts (28 tests) 58ms
49
- ✓ tests/auth-events.test.ts (6 tests) 323ms
50
- ✓ tests/data-plane-auth.test.ts (2 tests) 220ms
51
- ✓ tests/serverless.test.ts (9 tests) 71ms
52
- ✓ tests/exact-response.test.ts (8 tests) 43ms
53
- ✓ tests/query-cache.test.ts (8 tests) 228ms
54
- ✓ tests/auth-errors.test.ts (14 tests) 275ms
55
- ✓ tests/identity-change.test.ts (6 tests) 30ms
56
- ✓ tests/table-subscription.test.ts (8 tests) 231ms
57
- ✓ tests/table-transport.test.ts (8 tests) 511ms
58
- ✓ tests/storage-upload-browser.test.ts (3 tests) 123ms
59
- ✓ tests/signed-url-absolute.test.ts (5 tests) 177ms
60
- ✓ tests/field-kinds-registry.test.ts (7 tests) 21ms
61
- ✓ tests/realtime-presence.test.ts (3 tests) 177ms
62
- ✓ tests/storage-reference-url.test.ts (5 tests) 19ms
63
- ✓ tests/auth-error-codes.test.ts (26 tests) 48ms
64
- ✓ tests/masked-fields.test.ts (6 tests) 13ms
65
- ✓ tests/realtime-swap-status.test.ts (4 tests) 168ms
66
- ✓ tests/count.test.ts (11 tests) 36ms
67
- ✓ tests/storage-url-encoding.test.ts (4 tests) 97ms
68
- ✓ tests/dynamic-headers.test.ts (2 tests) 136ms
69
- ✓ tests/entry-points.test.ts (3 tests) 18ms
70
- ✓ tests/pkce.test.ts (4 tests) 15ms
71
- ✓ tests/sha256-hex.test.ts (1 test) 11ms
72
- ✓ tests/rpc-resend.test.ts (1 test) 47ms
38
+ ✓ tests/supatype-prepare.test.ts (12 tests) 3574ms
39
+ ✓ runs supatype generate where the CLI is installed, its bin named  435ms
40
+ ✓ runs supatype generate where the CLI is installed, its bin given as a string  328ms
41
+ ✓ finds a CLI hoisted into a parent directory  465ms
42
+ ✓ runs the nearest CLI  364ms
43
+ ✓ fails the install when generate fails  369ms
44
+ ✓ tests/realtime-ack-ref.test.ts (4 tests) 148ms
45
+ ✓ tests/filters.test.ts (11 tests) 108ms
46
+ ✓ tests/unauthorized-resend.test.ts (5 tests) 143ms
47
+ ✓ tests/storage-object-shape.test.ts (8 tests) 227ms
48
+ ✓ tests/result-error-class.test.ts (12 tests) 107ms
49
+ ✓ tests/postgrest-error-codes.test.ts (28 tests) 139ms
50
+ ✓ tests/auth-events.test.ts (6 tests) 106ms
51
+ ✓ tests/data-plane-auth.test.ts (2 tests) 157ms
52
+ ✓ tests/serverless.test.ts (9 tests) 22ms
53
+ ✓ tests/exact-response.test.ts (8 tests) 16ms
54
+ ✓ tests/runtime-env-bundle.test.ts (3 tests) 1791ms
55
+ ✓ tests/query-cache.test.ts (8 tests) 52ms
56
+ ✓ tests/auth-errors.test.ts (14 tests) 98ms
57
+ ✓ tests/table-subscription.test.ts (8 tests) 54ms
58
+ ✓ tests/identity-change.test.ts (6 tests) 9ms
59
+ ✓ tests/signed-url-absolute.test.ts (5 tests) 45ms
60
+ ✓ tests/table-transport.test.ts (8 tests) 462ms
61
+ ✓ tests/error-family.test.ts (10 tests) 9ms
62
+ ✓ tests/storage-upload-browser.test.ts (3 tests) 39ms
63
+ ✓ tests/field-kinds-registry.test.ts (7 tests) 5ms
64
+ ✓ tests/realtime-presence.test.ts (3 tests) 83ms
65
+ ✓ tests/thrown-error.test.ts (6 tests) 15ms
66
+ ✓ tests/storage-reference-url.test.ts (5 tests) 4ms
67
+ ✓ tests/auth-error-codes.test.ts (26 tests) 14ms
68
+ ✓ tests/realtime-swap-status.test.ts (4 tests) 115ms
69
+ ✓ tests/rpc-resend.test.ts (1 test) 50ms
70
+ ✓ tests/masked-fields.test.ts (6 tests) 11ms
71
+ ✓ tests/count.test.ts (11 tests) 10ms
72
+ ✓ tests/storage-url-encoding.test.ts (4 tests) 45ms
73
+ ✓ tests/entry-points.test.ts (4 tests) 6ms
74
+ ✓ tests/pkce.test.ts (4 tests) 14ms
75
+ ✓ tests/dynamic-headers.test.ts (2 tests) 54ms
76
+ ✓ tests/sha256-hex.test.ts (1 test) 3ms
73
77
 
74
-  Test Files  50 passed | 2 skipped (52)
75
-  Tests  548 passed | 7 skipped (555)
76
-  Start at  21:33:34
77
-  Duration  34.85s (transform 10.82s, setup 0ms, import 28.16s, tests 17.65s, environment 45ms)
78
+  Test Files  60 passed | 2 skipped (62)
79
+  Tests  664 passed | 7 skipped (671)
80
+  Start at  09:14:16
81
+  Duration  35.31s (transform 6.69s, setup 0ms, import 18.89s, tests 17.01s, environment 44ms)
78
82
 
@@ -1,4 +1,4 @@
1
1
 
2
- > @supatype/client@0.8.0 typecheck /home/runner/work/supatype/supatype/packages/client
2
+ > @supatype/client@0.9.1 typecheck /home/runner/work/supatype/supatype/packages/client
3
3
  > tsc --project tests/tsconfig.json --noEmit
4
4
 
package/CHANGELOG.md ADDED
@@ -0,0 +1,110 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ### Breaking Changes
6
+
7
+ * **errors:** one error family. `SupatypeError` is a class, exported as a value and a type, and
8
+ every error a result carries is one: `message` and, when known, `code`, `status`, `field`,
9
+ `hint` and `details`, its JSON and spread exactly those fields. It replaces the `SupatypeError`
10
+ interface. The SDK's thrown errors are its subclass `SupatypeCodedError` (the class that used to
11
+ be called `SupatypeError`), keeping a required `code` and `helpUrl`: `AuthError`,
12
+ `PostgrestError`, `StorageError`, `RealtimeError`, `NetworkError`, `RateLimitError` and now
13
+ `MissingClientValuesError` (code `MISSING_CLIENT_VALUES`), so `instanceof SupatypeError` holds for
14
+ all of them. Their `statusCode` is renamed `status`, the one name for it. `PostgrestError`'s
15
+ `details` and `hint` are absent rather than `null` when the server gave none, and an rpc refusal
16
+ is the `PostgrestError` itself. `AuthRedirectError` is a class too, with `provider` as one more
17
+ own field. `SupatypeErrorFields` is the fields' type, as the constructor takes them.
18
+ * **query:** `insert`, `update`, `upsert` and `delete` ask for no rows back and resolve to
19
+ `data: null`, as postgrest-js does. Chain `.select()` (or `.select(columns)`) to get the written
20
+ rows. Returning a row needs the right to read it, so a table whose rules let a caller create but
21
+ not read (an anon order form, say) refused every insert with 401 `42501`. A plain `delete()`
22
+ resolves to `null` rather than `[]`. On a model that keeps drafts, the drafts are read back only
23
+ after `.select()`.
24
+ * **query:** `.single()` and `.maybeSingle()` on a write are a type error until `.select()` is
25
+ chained. Called without it from untyped code, they answer an error and send nothing.
26
+ * **query:** `fetchWithOptional401Retry`'s `onUnauthorized` (and `GraphqlTransport.onUnauthorized`)
27
+ is an `UnauthorizedHandler`: `(refusedToken: string) => Promise<boolean>`, answering whether the
28
+ session now holds a different token. It was `() => Promise<void>`.
29
+ * **bindings:** `runMutation(client, table, operation, data, request)` takes one `MutationRequest`
30
+ (`filter`, `publish`, `select`) in place of the positional `filter` and update options, and returns
31
+ rows only when `request.select` asks for them (`true`, or the columns as `.select()` takes them).
32
+
33
+ ### Features
34
+
35
+ * **auth:** `auth.signInWithSSO({ domain })` or `auth.signInWithSSO({ providerId })` signs in
36
+ through a SAML identity provider registered on the project. It asks `POST /auth/v1/sso` for the
37
+ identity provider's URL, returns it as `data.url`, and sends the browser there unless
38
+ `options.skipBrowserRedirect` is set. `options` also takes `redirectTo`, `captchaToken` and
39
+ `flowType`. SSO is PKCE by default, unlike `signInWithOAuth`: the S256 challenge goes with the
40
+ request and the sign-in comes back as a `?code=` this browser exchanges, so no tokens are put in
41
+ the URL; `flowType: "implicit"` opts out. A sign-in the identity provider starts comes back with
42
+ tokens in the fragment, and the client signs in from them even while a PKCE sign-in it started is
43
+ still waiting. A refusal (`sso_provider_not_found`, `sso_provider_disabled`) is the returned
44
+ `SupatypeError`, and the page stays put. The argument's type is `SignInWithSSOCredentials`, and
45
+ passing both a domain and a provider ID is a type error. A refusal the auth
46
+ server sends back in the URL after an SSO sign-in is an `AuthRedirectError` whose `provider` is
47
+ the exported `SSO_PROVIDER` (`"sso"`).
48
+ * **client:** `createClient`'s `url` and `anonKey` are optional. One left out, or empty as a bundler
49
+ leaves an unset name, is read from `window.__SUPATYPE_ENV__` when the first request is made. The
50
+ page sets it with `<script src="/supatype-env.js">`, which a Supatype server answers, and which a
51
+ Next.js app serves from the route `@supatype/ssr/next` exports, so one build works on every
52
+ deployment that serves it. Read at the first request rather than at `createClient`, so a script
53
+ that loads after the module creating the client still counts. A value given always wins, and no
54
+ address is ever guessed from the page's own origin. `client.url` is the address as found so far,
55
+ empty until there is one.
56
+ * **client:** `AuthClient`, `StorageClient`, `BucketClient`, `RealtimeClient`, `QueryBuilder` and
57
+ `MutationBuilder` take their address (and `AuthClient` its headers) as a value or as a function
58
+ read for each request. A plain string works as before.
59
+
60
+ ### Bug Fixes
61
+
62
+ * **client:** `MissingClientValuesError` gives the script tag as
63
+ `<script src="/supatype-env.js" vite-ignore></script>`, the form `vite build` leaves alone. The
64
+ tag it gave made every `vite build` warn that it could not bundle the script.
65
+ * **client:** the first request a client makes with no address or no anon key throws
66
+ `MissingClientValuesError`, naming what is missing, every frontend name to set (`VITE_`, `PUBLIC_`,
67
+ `NEXT_PUBLIC_`, `EXPO_PUBLIC_`), `supatype build`, the `/supatype-env.js` script tag, and for
68
+ Next.js the route file `app/supatype-env.js/route.ts` and the server's `SUPATYPE_URL` and
69
+ `SUPATYPE_ANON_KEY`. REST, rpc, auth, storage, functions, GraphQL and a realtime subscribe all
70
+ throw it, and none turns it into `{ data: null, error }`. Requests used to go out with
71
+ `apikey: undefined`, every one was refused, and a production build was a blank page with nothing
72
+ saying why. `createClient` itself never throws for either value, so `next build` prerenders a page
73
+ that creates a client at module scope without them. The check reads the page at run time, so a
74
+ bundler that replaced both names with `undefined` cannot fold it away. On a server, where there
75
+ is no page, the error names `SUPATYPE_URL` and `SUPATYPE_ANON_KEY` as the server's variables to
76
+ set first, then the build-time names, rather than a `window.__SUPATYPE_ENV__` no server has.
77
+ `MissingClientValuesError` is exported for an app to catch.
78
+ * **client:** a page whose `/supatype-env.js` gave it no values is told why on its first call. A
79
+ misconfigured server now answers the script 200 with `window.__SUPATYPE_ENV__ = {"error":"..."}`,
80
+ since a browser runs no script answered with an error status and tells the page nothing of why,
81
+ and every first call (table reads and writes, rpc, functions, GraphQL, auth, realtime and storage)
82
+ throws `MissingClientValuesError` quoting that reason, with no request of its own. A page that has
83
+ the script element but no `window.__SUPATYPE_ENV__` at all is no longer told to add the tag: the
84
+ error says the script did not run (blocked, failed to load, ran after the app's own script, or
85
+ from a server too old to serve it) and to open it in the browser. A page with no element is told
86
+ to add it, as before.
87
+
88
+ * **auth:** a request refused with 401 is sent again only when the server said the token was
89
+ expired or invalid (`PGRST301`, `PGRST303`, or "JWT expired"), a session was there to refresh, and
90
+ the refresh produced a different token. Every 401 used to be sent twice, an anon write a row rule
91
+ refused among them. The refresh now runs even when the local clock still calls the token valid,
92
+ since the server has said otherwise.
93
+ * **bindings:** `reportThrown(where, thrown)` turns a request that threw instead of answering
94
+ `{ data, error }` into the binding's `error`, and logs it once with `console.error`. A thrown
95
+ `Error` is kept as it is, so `instanceof` still names it; the SDK's own error classes get the shape
96
+ a failed request answers with. Every framework binding uses it, so none can leave `loading` set
97
+ for good when a request throws.
98
+ * **bindings:** `latestRowsReader(client, table, where, view)` is the read the Vue, Svelte and
99
+ Solid queries share, where only the newest request may change what the binding shows. An older
100
+ read that lands last is dropped, rows, returned error or throw alike; a throw is still logged.
101
+ * **client:** the `error` of every `{ data, error }` result is now an `Error`, a `SupatypeError`,
102
+ rather than a plain object. A network failure used to resolve `{ message: "fetch failed", code }`,
103
+ so `error instanceof Error` was false and `String(error)` printed "[object Object]", which is what
104
+ a page rendering the error showed for an unreachable server or a CORS refusal. It is now the
105
+ `NetworkError` the transport threw, reading `NetworkError: fetch failed` with a stack. Its JSON is
106
+ the same `message`, `code`, `status`, `field`, `hint` and `details` as before; a test comparing
107
+ the error with `toEqual` against a plain object needs `{ ...error }`, since Vitest tells an Error
108
+ from one. Server refusals, client-side refusals (`Not authenticated`) and `reportThrown` follow
109
+ suit: `reportThrown` keeps an SDK error as it is and holds any other thrown value as the `cause`
110
+ of a `SupatypeError`.
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from "node:child_process"
3
+ import { lstatSync, readFileSync } from "node:fs"
4
+ import { basename, dirname, join } from "node:path"
5
+
6
+ // A Supatype project's `prepare`: `supatype generate` where the CLI is installed, and nothing where
7
+ // it is not.
8
+ //
9
+ // The generated files are gitignored, so a fresh clone has to produce them before anything can
10
+ // import them. A production install leaves out development dependencies, the CLI among them, but
11
+ // npm still runs `prepare`, and a bare `supatype generate` failed it with `supatype: not found`.
12
+ // Nothing needs generating there: the build that imports the files ran with everything installed.
13
+ // Prisma's client skips its generate the same way when the Prisma CLI is not installed.
14
+ //
15
+ // It ships here, in a package a project installs for production too, rather than as a script
16
+ // written into each project's package.json, so a fix to it reaches every project with an upgrade.
17
+ // Yarn 2 and later do not run a project's own `prepare` on install, so there `supatype generate`
18
+ // is run by hand.
19
+
20
+ /**
21
+ * The node_modules folders Node looks in for a package from `dir`, nearest first: beside it and in
22
+ * each folder above it, where a workspace hoists the CLI. Not NODE_PATH or the global folders,
23
+ * which belong to no project.
24
+ */
25
+ function nodeModulesFolders(dir) {
26
+ const folders = []
27
+ for (let p = dir; ; p = dirname(p)) {
28
+ if (basename(p) !== "node_modules") folders.push(join(p, "node_modules"))
29
+ if (dirname(p) === p) return folders
30
+ }
31
+ }
32
+
33
+ /** A folder that cannot be looked at is passed over, as Node passes it over. */
34
+ function exists(path) {
35
+ try {
36
+ lstatSync(path)
37
+ return true
38
+ } catch {
39
+ return false
40
+ }
41
+ }
42
+
43
+ /** The `supatype` bin the CLI's own package.json names. Throws when the CLI cannot be read. */
44
+ function cliBin(cli) {
45
+ const { bin } = JSON.parse(readFileSync(join(cli, "package.json"), "utf8"))
46
+ const entry = typeof bin === "string" ? bin : bin?.supatype
47
+ if (typeof entry !== "string") throw new Error("its package.json names no supatype bin")
48
+ return join(cli, entry)
49
+ }
50
+
51
+ const cli = nodeModulesFolders(process.cwd())
52
+ .map((folder) => join(folder, "@supatype", "cli"))
53
+ .find(exists)
54
+ if (cli === undefined) process.exit(0)
55
+
56
+ // A CLI folder that is there but broken, such as a link into a pruned pnpm store, fails the
57
+ // install: skipping it would pass the install and fail the build later, on files never generated.
58
+ let bin
59
+ try {
60
+ bin = cliBin(cli)
61
+ } catch (e) {
62
+ console.error(`supatype-prepare: cannot read the Supatype CLI at ${cli}: ${e.message}`)
63
+ process.exit(1)
64
+ }
65
+ const result = spawnSync(process.execPath, [bin, "generate"], { stdio: "inherit" })
66
+ if (result.error) console.error(`supatype-prepare: ${result.error.message}`)
67
+ if (result.signal) console.error(`supatype-prepare: supatype generate was stopped by ${result.signal}`)
68
+ process.exit(result.status ?? 1)
package/dist/auth.d.ts CHANGED
@@ -1,5 +1,7 @@
1
- import type { AuthChangeEvent, AuthFlowType, AuthRedirectError, AuthMFAChallengeResponse, AuthMFAEnrollResponse, AuthMFAListFactorsResponse, AuthStorage, OtpType, Session, SupatypeError, User } from "./types.js";
1
+ import type { AuthChangeEvent, AuthFlowType, AuthMFAChallengeResponse, AuthMFAEnrollResponse, AuthMFAListFactorsResponse, AuthStorage, OtpType, Session, SignInWithSSOCredentials, SignInWithSSOResult, User } from "./types.js";
2
2
  import { type RequestTransport } from "./fetch-with-retry.js";
3
+ import { type Deferred } from "./runtime-env.js";
4
+ import { AuthRedirectError, SupatypeError } from "./errors.js";
3
5
  export type AuthListener = (event: AuthChangeEvent, session: Session | null) => void;
4
6
  interface AuthClientOptions {
5
7
  initialSession?: Session | undefined;
@@ -17,9 +19,14 @@ interface AuthClientOptions {
17
19
  /** Finish a sign-in carried by the page's URL on start (browser only). Default: true. */
18
20
  detectSessionInUrl?: boolean | undefined;
19
21
  }
22
+ /**
23
+ * What a SAML sign-in is remembered as: the `provider` of an `AuthRedirectError` the auth server
24
+ * sent back in the URL for a sign-in `signInWithSSO` started.
25
+ */
26
+ export declare const SSO_PROVIDER = "sso";
20
27
  export declare class AuthClient {
21
- private readonly url;
22
- private readonly baseHeaders;
28
+ private readonly urlSource;
29
+ private readonly baseHeadersSource;
23
30
  private currentSession;
24
31
  private readonly listeners;
25
32
  private listenerIdCounter;
@@ -45,7 +52,15 @@ export declare class AuthClient {
45
52
  private refreshInFlight;
46
53
  /** In-memory PKCE code_verifier for the in-flight OAuth / OTP redirect. */
47
54
  private codeVerifier;
48
- constructor(url: string, baseHeaders: Record<string, string>, opts?: AuthClientOptions);
55
+ /**
56
+ * `url` and `baseHeaders` may be functions, read for each request. `createClient` passes
57
+ * functions, so a client made before the page has said where the API is fails only at a request.
58
+ */
59
+ constructor(url: Deferred<string>, baseHeaders: Deferred<Record<string, string>>, opts?: AuthClientOptions);
60
+ /** The auth address, read now. */
61
+ private get url();
62
+ /** The anon headers every auth request starts from, read now. */
63
+ private get baseHeaders();
49
64
  /** The session the client starts with: the one passed in, else the persisted one. */
50
65
  private loadInitialSession;
51
66
  /** Resolves when the client has its starting session (storage hydrated, any URL sign-in done). */
@@ -80,6 +95,15 @@ export declare class AuthClient {
80
95
  */
81
96
  ensureValidSession(): Promise<void>;
82
97
  private ensureValidSessionInternal;
98
+ /**
99
+ * Refresh after the server refused `refusedToken` as expired or invalid, whatever the local clock
100
+ * says of it. True when the session now holds a different token, so a request refused with that
101
+ * one is worth sending again; false when signed out, when the refresh failed or handed back the
102
+ * same token, or when this client leaves expired sessions for the server to refuse.
103
+ */
104
+ refreshRefusedSession(refusedToken: string): Promise<boolean>;
105
+ /** One refresh at a time: a second caller waits for the one already in flight. */
106
+ private refreshOnce;
83
107
  /** Schedule a token refresh ~60s before the current session expires. */
84
108
  private scheduleAutoRefresh;
85
109
  signUp(credentials: {
@@ -143,6 +167,22 @@ export declare class AuthClient {
143
167
  };
144
168
  error: SupatypeError | null;
145
169
  }>;
170
+ /**
171
+ * Sign in with SAML single sign-on, through the identity provider registered for the user's email
172
+ * domain, or one named by its ID.
173
+ *
174
+ * Asks `POST /sso` for the identity provider's URL and sends the browser there, unless
175
+ * `skipBrowserRedirect` is set or there is no browser. The identity provider returns the user to
176
+ * the auth server, which sends them on to `redirectTo`; the client finishes the sign-in on start,
177
+ * as it does for OAuth. A refusal (no provider for the domain, a disabled one) is returned and the
178
+ * page stays put.
179
+ *
180
+ * PKCE by default (`flowType`), unlike `signInWithOAuth`: the sign-in comes back as a `?code=`
181
+ * this browser exchanges with its stored verifier.
182
+ */
183
+ signInWithSSO(params: SignInWithSSOCredentials): Promise<SignInWithSSOResult>;
184
+ /** The `/sso` body: the domain or the provider's ID, the caller's options, and any PKCE challenge. */
185
+ private ssoRequestBody;
146
186
  /**
147
187
  * True only when the server's `/settings` list the provider as off. A provider they do not list
148
188
  * (a `custom:` one) or settings that cannot be read leave the decision to `/authorize`. Looked up
@@ -165,8 +205,8 @@ export declare class AuthClient {
165
205
  }>;
166
206
  /**
167
207
  * Exchange a PKCE auth code for a session (`POST /token?grant_type=pkce`).
168
- * Requires a prior `signInWithOAuth({ options: { flowType: "pkce" } })` (or OTP with PKCE)
169
- * so the matching `code_verifier` is available in memory / storage.
208
+ * Requires a prior PKCE sign-in in this browser (`signInWithSSO`, or `signInWithOAuth` or OTP with
209
+ * `flowType: "pkce"`), so the matching `code_verifier` is available in memory / storage.
170
210
  */
171
211
  exchangeCodeForSession(authCode: string): Promise<{
172
212
  data: {
@@ -405,6 +445,10 @@ export declare class AuthClient {
405
445
  private removeFlowItem;
406
446
  /** Read a flow value once: the redirect it was kept for has now arrived. */
407
447
  private takeFlowItem;
448
+ /**
449
+ * Start a PKCE flow: a fresh verifier, kept for the redirect, and the challenge parameters the
450
+ * auth server takes with it (as `/authorize` query parameters or `/sso` body fields).
451
+ */
408
452
  private beginPkce;
409
453
  private readCodeVerifier;
410
454
  private clearCodeVerifier;
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,WAAW,EAEX,OAAO,EACP,OAAO,EACP,aAAa,EACb,IAAI,EAEL,MAAM,YAAY,CAAA;AAMnB,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAqBzE,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;AAEpF,UAAU,iBAAiB;IACzB,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACpC,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACpC,sGAAsG;IACtG,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACtC,8FAA8F;IAC9F,mBAAmB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACzC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,6EAA6E;IAC7E,OAAO,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;IACjC,uGAAuG;IACvG,SAAS,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAA;IACxC,yFAAyF;IACzF,kBAAkB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CACzC;AA8ED,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAwB;IACpD,OAAO,CAAC,cAAc,CAAuB;IAC7C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