@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.
- package/README.md +10 -8
- package/dist/Client.d.ts +0 -0
- package/dist/Client.js +0 -0
- package/dist/Client.js.map +0 -0
- package/dist/Emitter.d.ts +0 -0
- package/dist/Emitter.js +0 -0
- package/dist/Emitter.js.map +0 -0
- package/dist/auth.d.ts +0 -0
- package/dist/auth.js +0 -0
- package/dist/auth.js.map +0 -0
- package/dist/createError.d.ts +0 -0
- package/dist/createError.js +0 -0
- package/dist/createError.js.map +0 -0
- package/dist/debug.d.ts +0 -0
- package/dist/debug.js +0 -0
- package/dist/debug.js.map +0 -0
- package/dist/file/fetch.d.ts +0 -0
- package/dist/file/fetch.js +0 -0
- package/dist/file/fetch.js.map +0 -0
- package/dist/file/getUrl.d.ts +0 -0
- package/dist/file/getUrl.js +0 -0
- package/dist/file/getUrl.js.map +0 -0
- package/dist/file/index.d.ts +0 -0
- package/dist/file/index.js +0 -0
- package/dist/file/index.js.map +0 -0
- package/dist/file/stream/browser.d.ts +0 -0
- package/dist/file/stream/browser.js +0 -0
- package/dist/file/stream/browser.js.map +0 -0
- package/dist/file/stream/index.d.ts +0 -0
- package/dist/file/stream/index.js +0 -0
- package/dist/file/stream/index.js.map +0 -0
- package/dist/file/uploadFileBrowser.d.ts +0 -0
- package/dist/file/uploadFileBrowser.js +0 -0
- package/dist/file/uploadFileBrowser.js.map +0 -0
- package/dist/findPrefix.d.ts +0 -0
- package/dist/findPrefix.js +0 -0
- package/dist/findPrefix.js.map +0 -0
- package/dist/idleTimeout.d.ts +0 -0
- package/dist/idleTimeout.js +0 -0
- package/dist/idleTimeout.js.map +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -0
- package/dist/index.js.map +0 -0
- package/dist/observable/index.d.ts +0 -0
- package/dist/observable/index.js +0 -0
- package/dist/observable/index.js.map +0 -0
- package/dist/printBasedObject.d.ts +0 -0
- package/dist/printBasedObject.js +0 -0
- package/dist/printBasedObject.js.map +0 -0
- package/dist/queue.d.ts +0 -0
- package/dist/queue.js +0 -0
- package/dist/queue.js.map +0 -0
- package/dist/request.d.ts +0 -0
- package/dist/request.js +0 -0
- package/dist/request.js.map +0 -0
- package/dist/selvaTypes/get.d.ts +0 -0
- package/dist/selvaTypes/get.js +0 -0
- package/dist/selvaTypes/get.js.map +0 -0
- package/dist/selvaTypes/schema.d.ts +0 -0
- package/dist/selvaTypes/schema.js +0 -0
- package/dist/selvaTypes/schema.js.map +0 -0
- package/dist/selvaTypes/set.d.ts +0 -0
- package/dist/selvaTypes/set.js +0 -0
- package/dist/selvaTypes/set.js.map +0 -0
- package/dist/subscriptions/addGetSubscriber.d.ts +0 -0
- package/dist/subscriptions/addGetSubscriber.js +0 -0
- package/dist/subscriptions/addGetSubscriber.js.map +0 -0
- package/dist/subscriptions/addSubscriber.d.ts +0 -0
- package/dist/subscriptions/addSubscriber.js +0 -0
- package/dist/subscriptions/addSubscriber.js.map +0 -0
- package/dist/subscriptions/generateId.d.ts +0 -0
- package/dist/subscriptions/generateId.js +0 -0
- package/dist/subscriptions/generateId.js.map +0 -0
- package/dist/subscriptions/incomingSubscription.d.ts +0 -0
- package/dist/subscriptions/incomingSubscription.js +0 -0
- package/dist/subscriptions/incomingSubscription.js.map +0 -0
- package/dist/subscriptions/incomingSubscriptionDiff.d.ts +0 -0
- package/dist/subscriptions/incomingSubscriptionDiff.js +0 -0
- package/dist/subscriptions/incomingSubscriptionDiff.js.map +0 -0
- package/dist/subscriptions/index.d.ts +0 -0
- package/dist/subscriptions/index.js +0 -0
- package/dist/subscriptions/index.js.map +0 -0
- package/dist/subscriptions/logoutSubscriptions.d.ts +0 -0
- package/dist/subscriptions/logoutSubscriptions.js +0 -0
- package/dist/subscriptions/logoutSubscriptions.js.map +0 -0
- package/dist/subscriptions/removeSendSubscriptionDataFromQueue.d.ts +0 -0
- package/dist/subscriptions/removeSendSubscriptionDataFromQueue.js +0 -0
- package/dist/subscriptions/removeSendSubscriptionDataFromQueue.js.map +0 -0
- package/dist/subscriptions/removeSubscriber.d.ts +0 -0
- package/dist/subscriptions/removeSubscriber.js +0 -0
- package/dist/subscriptions/removeSubscriber.js.map +0 -0
- package/dist/subscriptions/removeUnsubscribesFromQueue.d.ts +0 -0
- package/dist/subscriptions/removeUnsubscribesFromQueue.js +0 -0
- package/dist/subscriptions/removeUnsubscribesFromQueue.js.map +0 -0
- package/dist/subscriptions/sendAllSubscriptions.d.ts +0 -0
- package/dist/subscriptions/sendAllSubscriptions.js +0 -0
- package/dist/subscriptions/sendAllSubscriptions.js.map +0 -0
- package/dist/token.d.ts +0 -0
- package/dist/token.js +0 -0
- package/dist/token.js.map +0 -0
- package/dist/track.d.ts +0 -0
- package/dist/track.js +0 -0
- package/dist/track.js.map +0 -0
- package/dist/websocket/index.d.ts +0 -0
- package/dist/websocket/index.js +0 -0
- package/dist/websocket/index.js.map +0 -0
- package/dist/websocket/types.d.ts +0 -0
- package/dist/websocket/types.js +0 -0
- package/dist/websocket/types.js.map +0 -0
- package/dist/websocket/urlLoader.d.ts +0 -0
- package/dist/websocket/urlLoader.js +0 -0
- package/dist/websocket/urlLoader.js.map +0 -0
- package/docs/auth.md +4 -4
- 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
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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
|
package/dist/Client.js.map
CHANGED
|
File without changes
|
package/dist/Emitter.d.ts
CHANGED
|
File without changes
|
package/dist/Emitter.js
CHANGED
|
File without changes
|
package/dist/Emitter.js.map
CHANGED
|
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
|
package/dist/createError.d.ts
CHANGED
|
File without changes
|
package/dist/createError.js
CHANGED
|
File without changes
|
package/dist/createError.js.map
CHANGED
|
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
|
package/dist/file/fetch.d.ts
CHANGED
|
File without changes
|
package/dist/file/fetch.js
CHANGED
|
File without changes
|
package/dist/file/fetch.js.map
CHANGED
|
File without changes
|
package/dist/file/getUrl.d.ts
CHANGED
|
File without changes
|
package/dist/file/getUrl.js
CHANGED
|
File without changes
|
package/dist/file/getUrl.js.map
CHANGED
|
File without changes
|
package/dist/file/index.d.ts
CHANGED
|
File without changes
|
package/dist/file/index.js
CHANGED
|
File without changes
|
package/dist/file/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/findPrefix.d.ts
CHANGED
|
File without changes
|
package/dist/findPrefix.js
CHANGED
|
File without changes
|
package/dist/findPrefix.js.map
CHANGED
|
File without changes
|
package/dist/idleTimeout.d.ts
CHANGED
|
File without changes
|
package/dist/idleTimeout.js
CHANGED
|
File without changes
|
package/dist/idleTimeout.js.map
CHANGED
|
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
|
package/dist/observable/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/printBasedObject.js
CHANGED
|
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
|
package/dist/request.js.map
CHANGED
|
File without changes
|
package/dist/selvaTypes/get.d.ts
CHANGED
|
File without changes
|
package/dist/selvaTypes/get.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/selvaTypes/set.d.ts
CHANGED
|
File without changes
|
package/dist/selvaTypes/set.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
|
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
|
package/dist/websocket/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/websocket/types.js
CHANGED
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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.
|
|
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": "^
|
|
46
|
-
"@saulx/selva-server": "^
|
|
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",
|