@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.
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test.log +73 -69
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +110 -0
- package/bin/supatype-prepare.js +68 -0
- package/dist/auth.d.ts +50 -6
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +132 -40
- package/dist/auth.js.map +1 -1
- package/dist/bindings.d.ts +4 -1
- package/dist/bindings.d.ts.map +1 -1
- package/dist/bindings.js +2 -0
- package/dist/bindings.js.map +1 -1
- package/dist/error-codes-doc.d.ts +1 -1
- package/dist/error-codes-doc.d.ts.map +1 -1
- package/dist/error-codes-doc.js +7 -0
- package/dist/error-codes-doc.js.map +1 -1
- package/dist/errors.d.ts +81 -21
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +133 -46
- package/dist/errors.js.map +1 -1
- package/dist/graphql-transport.d.ts +10 -3
- package/dist/graphql-transport.d.ts.map +1 -1
- package/dist/graphql-transport.js +5 -5
- package/dist/graphql-transport.js.map +1 -1
- package/dist/index.d.ts +23 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +66 -48
- package/dist/index.js.map +1 -1
- package/dist/latest-rows.d.ts +29 -0
- package/dist/latest-rows.d.ts.map +1 -0
- package/dist/latest-rows.js +51 -0
- package/dist/latest-rows.js.map +1 -0
- package/dist/mutation-request.d.ts +19 -5
- package/dist/mutation-request.d.ts.map +1 -1
- package/dist/mutation-request.js +18 -15
- package/dist/mutation-request.js.map +1 -1
- package/dist/page-env-script.d.ts +12 -0
- package/dist/page-env-script.d.ts.map +1 -0
- package/dist/page-env-script.js +30 -0
- package/dist/page-env-script.js.map +1 -0
- package/dist/preview.d.ts +2 -1
- package/dist/preview.d.ts.map +1 -1
- package/dist/preview.js +7 -3
- package/dist/preview.js.map +1 -1
- package/dist/query.d.ts +49 -19
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +102 -33
- package/dist/query.js.map +1 -1
- package/dist/realtime.d.ts +5 -2
- package/dist/realtime.d.ts.map +1 -1
- package/dist/realtime.js +13 -6
- package/dist/realtime.js.map +1 -1
- package/dist/runtime-env.d.ts +59 -0
- package/dist/runtime-env.d.ts.map +1 -0
- package/dist/runtime-env.js +167 -0
- package/dist/runtime-env.js.map +1 -0
- package/dist/setup-fault.d.ts +13 -0
- package/dist/setup-fault.d.ts.map +1 -0
- package/dist/setup-fault.js +17 -0
- package/dist/setup-fault.js.map +1 -0
- package/dist/storage.d.ts +10 -5
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +22 -13
- package/dist/storage.js.map +1 -1
- package/dist/table-subscription.d.ts +1 -1
- package/dist/table-subscription.d.ts.map +1 -1
- package/dist/table-subscription.js +3 -2
- package/dist/table-subscription.js.map +1 -1
- package/dist/thrown-error.d.ts +16 -0
- package/dist/thrown-error.d.ts.map +1 -0
- package/dist/thrown-error.js +31 -0
- package/dist/thrown-error.js.map +1 -0
- package/dist/types.d.ts +59 -15
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +6 -2
- package/src/auth.ts +135 -44
- package/src/bindings.ts +4 -1
- package/src/error-codes-doc.ts +9 -1
- package/src/errors.ts +155 -57
- package/src/graphql-transport.ts +7 -8
- package/src/index.ts +82 -60
- package/src/latest-rows.ts +78 -0
- package/src/mutation-request.ts +34 -19
- package/src/page-env-script.ts +27 -0
- package/src/preview.ts +8 -4
- package/src/query.ts +128 -52
- package/src/realtime.ts +15 -6
- package/src/runtime-env.ts +220 -0
- package/src/setup-fault.ts +18 -0
- package/src/storage.ts +26 -16
- package/src/table-subscription.ts +3 -3
- package/src/thrown-error.ts +31 -0
- package/src/types.ts +65 -14
- package/tests/auth-errors.test.ts +3 -3
- package/tests/auth-events.test.ts +3 -7
- package/tests/auth-sso.test.ts +260 -0
- package/tests/auth-url-session.test.ts +6 -25
- package/tests/data-plane-auth.test.ts +1 -6
- package/tests/draft-insert.test.ts +9 -9
- package/tests/draft-update.test.ts +5 -5
- package/tests/entry-points.test.ts +9 -0
- package/tests/error-family.test.ts +79 -0
- package/tests/helpers/auth-unmount-binding.ts +63 -0
- package/tests/helpers/oauth-binding.ts +4 -3
- package/tests/helpers/stale-read-binding.ts +113 -0
- package/tests/helpers/thrown-error-binding.ts +127 -0
- package/tests/minimal-writes.test.ts +118 -0
- package/tests/postgrest-error-codes.test.ts +5 -5
- package/tests/query.test.ts +3 -3
- package/tests/rate-limit-integration.test.ts +1 -1
- package/tests/realtime-session-auth.test.ts +1 -4
- package/tests/result-error-class.test.ts +107 -0
- package/tests/retry-policy.test.ts +1 -1
- package/tests/rpc-resend.test.ts +33 -8
- package/tests/runtime-env-bundle.test.ts +121 -0
- package/tests/runtime-env-page-script.test.ts +174 -0
- package/tests/runtime-env.test.ts +224 -0
- package/tests/server-bodies.test.ts +3 -3
- package/tests/supatype-prepare.test.ts +139 -0
- package/tests/support/browser.ts +28 -0
- package/tests/support/jwt.ts +9 -0
- package/tests/thrown-error.test.ts +59 -0
- package/tests/unauthorized-resend.test.ts +107 -0
- package/tsconfig.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,78 +1,82 @@
|
|
|
1
1
|
|
|
2
|
-
> @supatype/client@0.
|
|
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
|
[1m[46m RUN [49m[22m [36mv4.0.18 [39m[90m/home/runner/work/supatype/supatype/packages/client[39m
|
|
7
7
|
|
|
8
|
-
[32m✓[39m tests/
|
|
9
|
-
|
|
10
|
-
[32m✓[39m tests/
|
|
11
|
-
|
|
12
|
-
[32m✓[39m tests/
|
|
13
|
-
|
|
14
|
-
[32m✓[39m tests/
|
|
15
|
-
|
|
16
|
-
[32m✓[39m tests/draft-
|
|
17
|
-
[33m[2m✓[22m[39m
|
|
18
|
-
[32m✓[39m tests/
|
|
19
|
-
[32m✓[39m tests/
|
|
20
|
-
|
|
21
|
-
[32m✓[39m tests/
|
|
22
|
-
[33m[2m✓[22m[39m
|
|
23
|
-
[32m✓[39m tests/
|
|
24
|
-
|
|
25
|
-
[32m✓[39m tests/
|
|
26
|
-
[32m✓[39m tests/
|
|
27
|
-
|
|
28
|
-
[32m✓[39m tests/
|
|
29
|
-
|
|
30
|
-
[32m✓[39m tests/
|
|
31
|
-
[32m✓[39m tests/exact-values.test.ts [2m([22m[
|
|
32
|
-
[32m✓[39m tests/retry-
|
|
33
|
-
|
|
34
|
-
[32m✓[39m tests/storage-quota-integration.test.ts [2m([22m[2m10 tests[22m[2m)[22m[33m 499[2mms[22m[39m
|
|
35
|
-
[33m[2m✓[22m[39m returns 507 Insufficient Storage with clear message [33m 340[2mms[22m[39m
|
|
36
|
-
[32m✓[39m tests/rate-limit-integration.test.ts [2m([22m[2m8 tests[22m[2m)[22m[33m 695[2mms[22m[39m
|
|
37
|
-
[33m[2m✓[22m[39m waits Retry-After seconds then retries on 429 [33m 427[2mms[22m[39m
|
|
38
|
-
[32m✓[39m tests/storage-upload-limit-integration.test.ts [2m([22m[2m11 tests[22m[2m)[22m[33m 339[2mms[22m[39m
|
|
39
|
-
[32m✓[39m tests/realtime-session-auth.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 237[2mms[22m[39m
|
|
40
|
-
[32m✓[39m tests/retry-policy.test.ts [2m([22m[2m17 tests[22m[2m)[22m[33m 1825[2mms[22m[39m
|
|
41
|
-
[32m✓[39m tests/realtime-exact-values.test.ts [2m([22m[2m8 tests[22m[2m)[22m[33m 512[2mms[22m[39m
|
|
8
|
+
[32m✓[39m tests/query.test.ts [2m([22m[2m36 tests[22m[2m)[22m[33m 418[2mms[22m[39m
|
|
9
|
+
[32m✓[39m tests/auth.test.ts [2m([22m[2m46 tests[22m[2m)[22m[33m 649[2mms[22m[39m
|
|
10
|
+
[32m✓[39m tests/mfa-totp-integration.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 291[2mms[22m[39m
|
|
11
|
+
[32m✓[39m tests/types.test.ts [2m([22m[2m30 tests[22m[2m)[22m[33m 364[2mms[22m[39m
|
|
12
|
+
[32m✓[39m tests/draft-profile.test.ts [2m([22m[2m18 tests[22m[2m)[22m[33m 500[2mms[22m[39m
|
|
13
|
+
[32m✓[39m tests/table-subscribe.test.ts [2m([22m[2m12 tests[22m[2m)[22m[33m 335[2mms[22m[39m
|
|
14
|
+
[32m✓[39m tests/realtime-multi-tenant-integration.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 310[2mms[22m[39m
|
|
15
|
+
[32m✓[39m tests/auth-sso.test.ts [2m([22m[2m16 tests[22m[2m)[22m[32m 279[2mms[22m[39m
|
|
16
|
+
[32m✓[39m tests/draft-insert.test.ts [2m([22m[2m18 tests[22m[2m)[22m[33m 719[2mms[22m[39m
|
|
17
|
+
[33m[2m✓[22m[39m creates the record through supatype.create_record [33m 358[2mms[22m[39m
|
|
18
|
+
[32m✓[39m tests/runtime-env.test.ts [2m([22m[2m27 tests[22m[2m)[22m[32m 87[2mms[22m[39m
|
|
19
|
+
[32m✓[39m tests/graphql-json.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 266[2mms[22m[39m
|
|
20
|
+
[32m✓[39m tests/realtime-shared-channel.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 207[2mms[22m[39m
|
|
21
|
+
[32m✓[39m tests/draft-update.test.ts [2m([22m[2m11 tests[22m[2m)[22m[33m 556[2mms[22m[39m
|
|
22
|
+
[33m[2m✓[22m[39m reads the keys of the records its filters match, as the caller reads the table [33m 381[2mms[22m[39m
|
|
23
|
+
[32m✓[39m tests/server-bodies.test.ts [2m([22m[2m20 tests[22m[2m)[22m[33m 400[2mms[22m[39m
|
|
24
|
+
[32m✓[39m tests/retry-integration.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 127[2mms[22m[39m
|
|
25
|
+
[32m✓[39m tests/auth-url-session.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 214[2mms[22m[39m
|
|
26
|
+
[32m✓[39m tests/runtime-env-page-script.test.ts [2m([22m[2m16 tests[22m[2m)[22m[32m 148[2mms[22m[39m
|
|
27
|
+
[32m✓[39m tests/exact-values.test.ts [2m([22m[2m24 tests[22m[2m)[22m[32m 35[2mms[22m[39m
|
|
28
|
+
[32m✓[39m tests/storage-quota-integration.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 98[2mms[22m[39m
|
|
29
|
+
[32m✓[39m tests/rate-limit-integration.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 209[2mms[22m[39m
|
|
30
|
+
[32m✓[39m tests/storage-upload-limit-integration.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 201[2mms[22m[39m
|
|
31
|
+
[32m✓[39m tests/realtime-exact-values.test.ts [2m([22m[2m8 tests[22m[2m)[22m[33m 310[2mms[22m[39m
|
|
32
|
+
[32m✓[39m tests/retry-policy.test.ts [2m([22m[2m17 tests[22m[2m)[22m[33m 1839[2mms[22m[39m
|
|
33
|
+
[32m✓[39m tests/realtime-session-auth.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 219[2mms[22m[39m
|
|
42
34
|
[2m[90m↓[39m[22m tests/draft-update.integration.test.ts [2m([22m[2m3 tests[22m[2m | [22m[33m3 skipped[39m[2m)[22m
|
|
43
|
-
[32m✓[39m tests/subscribe-frame.test.ts [2m([22m[2m6 tests[22m[2m)[22m[
|
|
35
|
+
[32m✓[39m tests/subscribe-frame.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 210[2mms[22m[39m
|
|
36
|
+
[32m✓[39m tests/minimal-writes.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 279[2mms[22m[39m
|
|
44
37
|
[2m[90m↓[39m[22m tests/draft-insert.integration.test.ts [2m([22m[2m4 tests[22m[2m | [22m[33m4 skipped[39m[2m)[22m
|
|
45
|
-
[32m✓[39m tests/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
[32m✓[39m tests/
|
|
52
|
-
[32m✓[39m tests/
|
|
53
|
-
[32m✓[39m tests/
|
|
54
|
-
[32m✓[39m tests/
|
|
55
|
-
[32m✓[39m tests/
|
|
56
|
-
[32m✓[39m tests/
|
|
57
|
-
[32m✓[39m tests/
|
|
58
|
-
[32m✓[39m tests/
|
|
59
|
-
[32m✓[39m tests/
|
|
60
|
-
[32m✓[39m tests/
|
|
61
|
-
[32m✓[39m tests/
|
|
62
|
-
[32m✓[39m tests/
|
|
63
|
-
[32m✓[39m tests/auth-
|
|
64
|
-
[32m✓[39m tests/
|
|
65
|
-
[32m✓[39m tests/
|
|
66
|
-
[32m✓[39m tests/
|
|
67
|
-
[32m✓[39m tests/
|
|
68
|
-
[32m✓[39m tests/
|
|
69
|
-
[32m✓[39m tests/
|
|
70
|
-
[32m✓[39m tests/
|
|
71
|
-
[32m✓[39m tests/
|
|
72
|
-
[32m✓[39m tests/
|
|
38
|
+
[32m✓[39m tests/supatype-prepare.test.ts [2m([22m[2m12 tests[22m[2m)[22m[33m 3574[2mms[22m[39m
|
|
39
|
+
[33m[2m✓[22m[39m runs supatype generate where the CLI is installed, its bin named [33m 435[2mms[22m[39m
|
|
40
|
+
[33m[2m✓[22m[39m runs supatype generate where the CLI is installed, its bin given as a string [33m 328[2mms[22m[39m
|
|
41
|
+
[33m[2m✓[22m[39m finds a CLI hoisted into a parent directory [33m 465[2mms[22m[39m
|
|
42
|
+
[33m[2m✓[22m[39m runs the nearest CLI [33m 364[2mms[22m[39m
|
|
43
|
+
[33m[2m✓[22m[39m fails the install when generate fails [33m 369[2mms[22m[39m
|
|
44
|
+
[32m✓[39m tests/realtime-ack-ref.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 148[2mms[22m[39m
|
|
45
|
+
[32m✓[39m tests/filters.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 108[2mms[22m[39m
|
|
46
|
+
[32m✓[39m tests/unauthorized-resend.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 143[2mms[22m[39m
|
|
47
|
+
[32m✓[39m tests/storage-object-shape.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 227[2mms[22m[39m
|
|
48
|
+
[32m✓[39m tests/result-error-class.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 107[2mms[22m[39m
|
|
49
|
+
[32m✓[39m tests/postgrest-error-codes.test.ts [2m([22m[2m28 tests[22m[2m)[22m[32m 139[2mms[22m[39m
|
|
50
|
+
[32m✓[39m tests/auth-events.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 106[2mms[22m[39m
|
|
51
|
+
[32m✓[39m tests/data-plane-auth.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 157[2mms[22m[39m
|
|
52
|
+
[32m✓[39m tests/serverless.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 22[2mms[22m[39m
|
|
53
|
+
[32m✓[39m tests/exact-response.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 16[2mms[22m[39m
|
|
54
|
+
[32m✓[39m tests/runtime-env-bundle.test.ts [2m([22m[2m3 tests[22m[2m)[22m[33m 1791[2mms[22m[39m
|
|
55
|
+
[32m✓[39m tests/query-cache.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 52[2mms[22m[39m
|
|
56
|
+
[32m✓[39m tests/auth-errors.test.ts [2m([22m[2m14 tests[22m[2m)[22m[32m 98[2mms[22m[39m
|
|
57
|
+
[32m✓[39m tests/table-subscription.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 54[2mms[22m[39m
|
|
58
|
+
[32m✓[39m tests/identity-change.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
59
|
+
[32m✓[39m tests/signed-url-absolute.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 45[2mms[22m[39m
|
|
60
|
+
[32m✓[39m tests/table-transport.test.ts [2m([22m[2m8 tests[22m[2m)[22m[33m 462[2mms[22m[39m
|
|
61
|
+
[32m✓[39m tests/error-family.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
62
|
+
[32m✓[39m tests/storage-upload-browser.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 39[2mms[22m[39m
|
|
63
|
+
[32m✓[39m tests/field-kinds-registry.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
64
|
+
[32m✓[39m tests/realtime-presence.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 83[2mms[22m[39m
|
|
65
|
+
[32m✓[39m tests/thrown-error.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 15[2mms[22m[39m
|
|
66
|
+
[32m✓[39m tests/storage-reference-url.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
67
|
+
[32m✓[39m tests/auth-error-codes.test.ts [2m([22m[2m26 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
68
|
+
[32m✓[39m tests/realtime-swap-status.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 115[2mms[22m[39m
|
|
69
|
+
[32m✓[39m tests/rpc-resend.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 50[2mms[22m[39m
|
|
70
|
+
[32m✓[39m tests/masked-fields.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
71
|
+
[32m✓[39m tests/count.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
72
|
+
[32m✓[39m tests/storage-url-encoding.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 45[2mms[22m[39m
|
|
73
|
+
[32m✓[39m tests/entry-points.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
74
|
+
[32m✓[39m tests/pkce.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
75
|
+
[32m✓[39m tests/dynamic-headers.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 54[2mms[22m[39m
|
|
76
|
+
[32m✓[39m tests/sha256-hex.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
73
77
|
|
|
74
|
-
[2m Test Files [22m [1m[
|
|
75
|
-
[2m Tests [22m [1m[
|
|
76
|
-
[2m Start at [22m
|
|
77
|
-
[2m Duration [22m
|
|
78
|
+
[2m Test Files [22m [1m[32m60 passed[39m[22m[2m | [22m[33m2 skipped[39m[90m (62)[39m
|
|
79
|
+
[2m Tests [22m [1m[32m664 passed[39m[22m[2m | [22m[33m7 skipped[39m[90m (671)[39m
|
|
80
|
+
[2m Start at [22m 09:14:16
|
|
81
|
+
[2m Duration [22m 35.31s[2m (transform 6.69s, setup 0ms, import 18.89s, tests 17.01s, environment 44ms)[22m
|
|
78
82
|
|
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,
|
|
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
|
|
22
|
-
private readonly
|
|
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
|
-
|
|
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
|
|
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;
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,EAC1B,WAAW,EAEX,OAAO,EACP,OAAO,EACP,wBAAwB,EAExB,mBAAmB,EACnB,IAAI,EAEL,MAAM,YAAY,CAAA;AAMnB,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAqBzE,OAAO,EAAU,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE9D,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO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