@based/client 3.2.2 → 3.3.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 (114) hide show
  1. package/README.md +10 -8
  2. package/dist/Client.d.ts +0 -0
  3. package/dist/Client.js +0 -0
  4. package/dist/Client.js.map +0 -0
  5. package/dist/Emitter.d.ts +0 -0
  6. package/dist/Emitter.js +0 -0
  7. package/dist/Emitter.js.map +0 -0
  8. package/dist/auth.d.ts +0 -0
  9. package/dist/auth.js +0 -0
  10. package/dist/auth.js.map +0 -0
  11. package/dist/createError.d.ts +0 -0
  12. package/dist/createError.js +0 -0
  13. package/dist/createError.js.map +0 -0
  14. package/dist/debug.d.ts +0 -0
  15. package/dist/debug.js +0 -0
  16. package/dist/debug.js.map +0 -0
  17. package/dist/file/fetch.d.ts +0 -0
  18. package/dist/file/fetch.js +0 -0
  19. package/dist/file/fetch.js.map +0 -0
  20. package/dist/file/getUrl.d.ts +0 -0
  21. package/dist/file/getUrl.js +0 -0
  22. package/dist/file/getUrl.js.map +0 -0
  23. package/dist/file/index.d.ts +0 -0
  24. package/dist/file/index.js +0 -0
  25. package/dist/file/index.js.map +0 -0
  26. package/dist/file/stream/browser.d.ts +0 -0
  27. package/dist/file/stream/browser.js +0 -0
  28. package/dist/file/stream/browser.js.map +0 -0
  29. package/dist/file/stream/index.d.ts +0 -0
  30. package/dist/file/stream/index.js +0 -0
  31. package/dist/file/stream/index.js.map +0 -0
  32. package/dist/file/uploadFileBrowser.d.ts +0 -0
  33. package/dist/file/uploadFileBrowser.js +0 -0
  34. package/dist/file/uploadFileBrowser.js.map +0 -0
  35. package/dist/findPrefix.d.ts +0 -0
  36. package/dist/findPrefix.js +0 -0
  37. package/dist/findPrefix.js.map +0 -0
  38. package/dist/idleTimeout.d.ts +0 -0
  39. package/dist/idleTimeout.js +0 -0
  40. package/dist/idleTimeout.js.map +0 -0
  41. package/dist/index.d.ts +0 -0
  42. package/dist/index.js +0 -0
  43. package/dist/index.js.map +0 -0
  44. package/dist/observable/index.d.ts +0 -0
  45. package/dist/observable/index.js +0 -0
  46. package/dist/observable/index.js.map +0 -0
  47. package/dist/printBasedObject.d.ts +0 -0
  48. package/dist/printBasedObject.js +0 -0
  49. package/dist/printBasedObject.js.map +0 -0
  50. package/dist/queue.d.ts +0 -0
  51. package/dist/queue.js +0 -0
  52. package/dist/queue.js.map +0 -0
  53. package/dist/request.d.ts +0 -0
  54. package/dist/request.js +0 -0
  55. package/dist/request.js.map +0 -0
  56. package/dist/selvaTypes/get.d.ts +0 -0
  57. package/dist/selvaTypes/get.js +0 -0
  58. package/dist/selvaTypes/get.js.map +0 -0
  59. package/dist/selvaTypes/schema.d.ts +0 -0
  60. package/dist/selvaTypes/schema.js +0 -0
  61. package/dist/selvaTypes/schema.js.map +0 -0
  62. package/dist/selvaTypes/set.d.ts +0 -0
  63. package/dist/selvaTypes/set.js +0 -0
  64. package/dist/selvaTypes/set.js.map +0 -0
  65. package/dist/subscriptions/addGetSubscriber.d.ts +0 -0
  66. package/dist/subscriptions/addGetSubscriber.js +0 -0
  67. package/dist/subscriptions/addGetSubscriber.js.map +0 -0
  68. package/dist/subscriptions/addSubscriber.d.ts +0 -0
  69. package/dist/subscriptions/addSubscriber.js +0 -0
  70. package/dist/subscriptions/addSubscriber.js.map +0 -0
  71. package/dist/subscriptions/generateId.d.ts +0 -0
  72. package/dist/subscriptions/generateId.js +0 -0
  73. package/dist/subscriptions/generateId.js.map +0 -0
  74. package/dist/subscriptions/incomingSubscription.d.ts +0 -0
  75. package/dist/subscriptions/incomingSubscription.js +0 -0
  76. package/dist/subscriptions/incomingSubscription.js.map +0 -0
  77. package/dist/subscriptions/incomingSubscriptionDiff.d.ts +0 -0
  78. package/dist/subscriptions/incomingSubscriptionDiff.js +0 -0
  79. package/dist/subscriptions/incomingSubscriptionDiff.js.map +0 -0
  80. package/dist/subscriptions/index.d.ts +0 -0
  81. package/dist/subscriptions/index.js +0 -0
  82. package/dist/subscriptions/index.js.map +0 -0
  83. package/dist/subscriptions/logoutSubscriptions.d.ts +0 -0
  84. package/dist/subscriptions/logoutSubscriptions.js +0 -0
  85. package/dist/subscriptions/logoutSubscriptions.js.map +0 -0
  86. package/dist/subscriptions/removeSendSubscriptionDataFromQueue.d.ts +0 -0
  87. package/dist/subscriptions/removeSendSubscriptionDataFromQueue.js +0 -0
  88. package/dist/subscriptions/removeSendSubscriptionDataFromQueue.js.map +0 -0
  89. package/dist/subscriptions/removeSubscriber.d.ts +0 -0
  90. package/dist/subscriptions/removeSubscriber.js +0 -0
  91. package/dist/subscriptions/removeSubscriber.js.map +0 -0
  92. package/dist/subscriptions/removeUnsubscribesFromQueue.d.ts +0 -0
  93. package/dist/subscriptions/removeUnsubscribesFromQueue.js +0 -0
  94. package/dist/subscriptions/removeUnsubscribesFromQueue.js.map +0 -0
  95. package/dist/subscriptions/sendAllSubscriptions.d.ts +0 -0
  96. package/dist/subscriptions/sendAllSubscriptions.js +0 -0
  97. package/dist/subscriptions/sendAllSubscriptions.js.map +0 -0
  98. package/dist/token.d.ts +0 -0
  99. package/dist/token.js +0 -0
  100. package/dist/token.js.map +0 -0
  101. package/dist/track.d.ts +0 -0
  102. package/dist/track.js +0 -0
  103. package/dist/track.js.map +0 -0
  104. package/dist/websocket/index.d.ts +0 -0
  105. package/dist/websocket/index.js +0 -0
  106. package/dist/websocket/index.js.map +0 -0
  107. package/dist/websocket/types.d.ts +0 -0
  108. package/dist/websocket/types.js +0 -0
  109. package/dist/websocket/types.js.map +0 -0
  110. package/dist/websocket/urlLoader.d.ts +0 -0
  111. package/dist/websocket/urlLoader.js +0 -0
  112. package/dist/websocket/urlLoader.js.map +0 -0
  113. package/docs/auth.md +4 -4
  114. package/package.json +3 -3
package/README.md CHANGED
@@ -264,14 +264,16 @@ One of the first things a Based user will have to do is set a schema for its dat
264
264
 
265
265
  ```js
266
266
  await client.updateSchema({
267
- types: {
268
- thing: {
269
- fields: {
270
- name: { type: 'string' },
271
- nested: {
272
- type: 'object',
273
- properties: {
274
- something: { type: 'string' },
267
+ schema: {
268
+ types: {
269
+ thing: {
270
+ fields: {
271
+ name: { type: 'string' },
272
+ nested: {
273
+ type: 'object',
274
+ properties: {
275
+ something: { type: 'string' },
276
+ },
275
277
  },
276
278
  },
277
279
  },
package/dist/Client.d.ts CHANGED
File without changes
package/dist/Client.js CHANGED
File without changes
File without changes
package/dist/Emitter.d.ts CHANGED
File without changes
package/dist/Emitter.js CHANGED
File without changes
File without changes
package/dist/auth.d.ts CHANGED
File without changes
package/dist/auth.js CHANGED
File without changes
package/dist/auth.js.map CHANGED
File without changes
File without changes
File without changes
File without changes
package/dist/debug.d.ts CHANGED
File without changes
package/dist/debug.js CHANGED
File without changes
package/dist/debug.js.map CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/index.d.ts CHANGED
File without changes
package/dist/index.js CHANGED
File without changes
package/dist/index.js.map CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/queue.d.ts CHANGED
File without changes
package/dist/queue.js CHANGED
File without changes
package/dist/queue.js.map CHANGED
File without changes
package/dist/request.d.ts CHANGED
File without changes
package/dist/request.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/token.d.ts CHANGED
File without changes
package/dist/token.js CHANGED
File without changes
package/dist/token.js.map CHANGED
File without changes
package/dist/track.d.ts CHANGED
File without changes
package/dist/track.js CHANGED
File without changes
package/dist/track.js.map CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/docs/auth.md CHANGED
@@ -18,27 +18,27 @@ This data function runs every time the based client tries to call, get, modify o
18
18
  It approves or denies the request depending on its context. See [`authorize`](https://github.com/atelier-saulx/based/blob/main/packages/client/docs/authorize.md)
19
19
  Returns boolean value allowing or disallowing the connection.
20
20
 
21
- Example: see [here](https://github.com/atelier-saulx/based/blob/main/packages/auth-templates/jwt/authorize/authorize.ts)
21
+ Example: see [here](https://github.com/atelier-saulx/based/blob/main/packages/templates/jwtAuth/functions/authorize/index.ts)
22
22
 
23
23
  ### `login`
24
24
 
25
25
  Called then the client [login()]() method is called. It should authenticate the user and generate the tokens. Authentication flow is up to the user.
26
26
  For example, in a JWT flow, this function will validate the user in the data, sign a token and refreshToken returning them to the client.
27
27
 
28
- Example: see [here](https://github.com/atelier-saulx/based/blob/main/packages/auth-templates/jwt/login/login.ts)
28
+ Example: see [here](https://github.com/atelier-saulx/based/blob/main/packages/templates/jwtAuth/functions/login/index.ts)
29
29
 
30
30
  ### `logout`
31
31
 
32
32
  When your app logs out a user, it should call the `client.logout()` method. This method calls this data function if it exists. It is meant to have token invalidation and any cleanup that should happen when a user logs out.
33
33
 
34
- Example: see [here](https://github.com/atelier-saulx/based/blob/main/packages/auth-templates/jwt/logout/logout.ts)
34
+ Example: see [here](https://github.com/atelier-saulx/based/blob/main/packages/templates/jwtAuth/functions/logout/index.ts)
35
35
 
36
36
  ### `renewToken`
37
37
 
38
38
  For auth flows that rely on token renewal. This data function runs when a specific error is triggered in the `authorize` function.
39
39
  The result is returned to the client using the `renewToken` client event.
40
40
 
41
- Example: see [here](https://github.com/atelier-saulx/based/blob/main/packages/auth-templates/jwt/renewToken/renewToken.ts)
41
+ Example: see [here](https://github.com/atelier-saulx/based/blob/main/packages/templates/jwtAuth/functions/renewToken/index.ts)
42
42
 
43
43
  ## Based client methods
44
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@based/client",
3
- "version": "3.2.2",
3
+ "version": "3.3.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "browser": {
@@ -42,8 +42,8 @@
42
42
  "@based/types": "^2.8.0",
43
43
  "@saulx/aristotle": "^4.0.14",
44
44
  "@saulx/hash": "^1.1.0",
45
- "@saulx/selva": "^14.0.0",
46
- "@saulx/selva-server": "^14.0.0",
45
+ "@saulx/selva": "^19.0.0",
46
+ "@saulx/selva-server": "^19.0.0",
47
47
  "@types/jsonwebtoken": "^8.5.6",
48
48
  "@types/node": "^17.0.23",
49
49
  "@types/ws": "^7.4.6",