@flipstream/sdk 0.12.0 → 0.14.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 (87) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +128 -30
  3. package/dist/api/backend.d.ts +18 -3
  4. package/dist/api/backend.js +33 -6
  5. package/dist/api/backend.js.map +1 -1
  6. package/dist/api/credentials.js +4 -4
  7. package/dist/api/credentials.js.map +1 -1
  8. package/dist/api/datasets.js +30 -50
  9. package/dist/api/datasets.js.map +1 -1
  10. package/dist/api/handoff.d.ts +1 -1
  11. package/dist/api/handoff.js +7 -0
  12. package/dist/api/handoff.js.map +1 -1
  13. package/dist/api/log.d.ts +4 -4
  14. package/dist/api/log.js +23 -42
  15. package/dist/api/log.js.map +1 -1
  16. package/dist/api/me.d.ts +5 -3
  17. package/dist/api/me.js +5 -4
  18. package/dist/api/me.js.map +1 -1
  19. package/dist/api/members.d.ts +40 -17
  20. package/dist/api/members.js +66 -29
  21. package/dist/api/members.js.map +1 -1
  22. package/dist/api/ownRecord.d.ts +46 -0
  23. package/dist/api/ownRecord.js +57 -0
  24. package/dist/api/ownRecord.js.map +1 -0
  25. package/dist/api/refusal.d.ts +14 -0
  26. package/dist/api/refusal.js +23 -0
  27. package/dist/api/refusal.js.map +1 -0
  28. package/dist/api/wallet.d.ts +2 -1
  29. package/dist/api/wallet.js +18 -21
  30. package/dist/api/wallet.js.map +1 -1
  31. package/dist/api/workspaces.d.ts +14 -9
  32. package/dist/api/workspaces.js +21 -15
  33. package/dist/api/workspaces.js.map +1 -1
  34. package/dist/auth/discovery.js +3 -1
  35. package/dist/auth/discovery.js.map +1 -1
  36. package/dist/core/call.d.ts +12 -2
  37. package/dist/core/call.js +5 -2
  38. package/dist/core/call.js.map +1 -1
  39. package/dist/core/identify.d.ts +65 -14
  40. package/dist/core/identify.js +69 -27
  41. package/dist/core/identify.js.map +1 -1
  42. package/dist/core/inPlaceOf.d.ts +6 -0
  43. package/dist/core/inPlaceOf.js +17 -0
  44. package/dist/core/inPlaceOf.js.map +1 -0
  45. package/dist/core/invalid.d.ts +32 -6
  46. package/dist/core/invalid.js +36 -17
  47. package/dist/core/invalid.js.map +1 -1
  48. package/dist/core/notFound.d.ts +2 -2
  49. package/dist/core/notFound.js.map +1 -1
  50. package/dist/core/read.d.ts +6 -3
  51. package/dist/core/read.js +5 -6
  52. package/dist/core/read.js.map +1 -1
  53. package/dist/core/result.d.ts +16 -8
  54. package/dist/core/result.js +1 -0
  55. package/dist/core/result.js.map +1 -1
  56. package/dist/core/shared.d.ts +43 -0
  57. package/dist/core/shared.js +178 -0
  58. package/dist/core/shared.js.map +1 -0
  59. package/dist/core/signal.d.ts +12 -0
  60. package/dist/core/signal.js +25 -0
  61. package/dist/core/signal.js.map +1 -0
  62. package/dist/flipstream.d.ts +160 -22
  63. package/dist/flipstream.js +207 -81
  64. package/dist/flipstream.js.map +1 -1
  65. package/dist/index.d.ts +2 -2
  66. package/dist/index.js +3 -2
  67. package/dist/index.js.map +1 -1
  68. package/dist/node/clientSecret.js +2 -1
  69. package/dist/node/clientSecret.js.map +1 -1
  70. package/dist/node/keychainChild.js +60 -25
  71. package/dist/node/keychainChild.js.map +1 -1
  72. package/dist/node/keychainError.d.ts +4 -1
  73. package/dist/node/keychainError.js.map +1 -1
  74. package/dist/node/keychainStore.js +42 -8
  75. package/dist/node/keychainStore.js.map +1 -1
  76. package/dist/node/loopback.d.ts +5 -2
  77. package/dist/node/loopback.js +28 -3
  78. package/dist/node/loopback.js.map +1 -1
  79. package/dist/node/session.js +11 -5
  80. package/dist/node/session.js.map +1 -1
  81. package/dist/query/query.d.ts +52 -8
  82. package/dist/query/query.js +133 -19
  83. package/dist/query/query.js.map +1 -1
  84. package/dist/version.gen.js +1 -1
  85. package/docs/admin.md +108 -4
  86. package/docs/node-sign-in.md +11 -5
  87. package/package.json +1 -1
@@ -42,7 +42,9 @@ if (!signedIn.ok) throw new Error(`sign-in failed: ${signedIn.error.kind}`)
42
42
  sign-in's own address, then its state. A paste that fails ends the sign-in with its reason, such
43
43
  as `wrong_state`, and nothing is exchanged.
44
44
  - **A reader that rejects** ends the sign-in as `paste_failed`. `readPasted` is called once, just
45
- after `open`.
45
+ after `open`. One given that isn't a function is a `TypeError` naming it, before any port opens,
46
+ as is an `open` that isn't one or a `signal` with no `aborted` or no `addEventListener` method,
47
+ whatever `timeoutMs`.
46
48
  - **`timeoutMs` is the time from opening the browser until a redirect arrives,** on the port or
47
49
  pasted: 5 minutes when left out or `null`. Opening the port and the code's exchange (with its own
48
50
  deadline) aren't in it. It's taken in whole ms, rounded down, up to 2147483647, as a call's
@@ -205,7 +207,11 @@ if (signedOut.cleared === 'failed') {
205
207
  reboot;
206
208
  - `refused`: any other refusal, in the keychain's own words;
207
209
  - `timeout`: the step took longer than its `timeoutMs`;
208
- - `helper`: the helper process couldn't start, or ended before it answered (`exit` says how);
210
+ - `helper`: the helper process couldn't start, or ended before it answered (`exit` says how).
211
+ One that couldn't start for want of file descriptors (`EMFILE`, your process's own limit, or
212
+ `ENFILE`, the whole system's table) has the spawn's own error, with that `code`, as the
213
+ error's `cause`, when Node reports it in time: a hint for your logs, not a promise, so never
214
+ let your app depend on it;
209
215
  - `missing`: `@napi-rs/keyring` isn't installed, and the message names it;
210
216
  - `too-long`: the tokens are over 2,560 bytes, so nothing was saved.
211
217
 
@@ -240,9 +246,9 @@ if (signedOut.cleared === 'failed') {
240
246
  the same 30 s. The helper never keeps your app running. It's `process.execPath`, so it needs a
241
247
  Node that runs a script: not an Electron app (without `ELECTRON_RUN_AS_NODE`), a Node
242
248
  single-executable application, or a compiled Bun binary. A bundle must keep `keychainChild.js`
243
- beside the module, with `zod` and `@napi-rs/keyring` resolvable from there, and
244
- `import.meta.url` set. Where it doesn't (an esbuild CommonJS bundle, say), only the keychain's
245
- steps fail, as `store_failed`.
249
+ beside the module, with `@napi-rs/keyring` resolvable from there, and `import.meta.url` set.
250
+ Where it doesn't (an esbuild CommonJS bundle, say), only the keychain's steps fail, as
251
+ `store_failed`.
246
252
  - Through `session.token()`, a keychain read that takes longer than the caller's wait, 15 s
247
253
  unless you pass `createSession({ waitMs })`, is `unavailable`. On macOS a read can wait on
248
254
  an access dialog, every time, for an item another program saved: give `waitMs` as long as
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flipstream/sdk",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "TypeScript SDK for the Flipstream APIs: typed requests and checked answers, in Node and in browsers.",
5
5
  "keywords": [
6
6
  "flipstream",