@dxos/react-client 2.16.17 → 2.17.3
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/.rush/temp/package-deps_build:test.json +11 -12
- package/.rush/temp/shrinkwrap-deps.json +3 -5
- package/dist/src/components/ErrorBoundary.js +1 -1
- package/dist/src/components/ErrorBoundary.js.map +1 -1
- package/dist/src/containers/ClientInitializer.js +4 -4
- package/dist/src/containers/ClientInitializer.js.map +1 -1
- package/dist/src/containers/ClientProvider.js +1 -1
- package/dist/src/containers/ClientProvider.js.map +1 -1
- package/dist/src/containers/ClientProvider.test.js +6 -6
- package/dist/src/containers/ClientProvider.test.js.map +1 -1
- package/dist/src/containers/ProfileInitializer.js +3 -3
- package/dist/src/containers/ProfileInitializer.js.map +1 -1
- package/dist/src/hooks/client/client.test.js +7 -7
- package/dist/src/hooks/client/client.test.js.map +1 -1
- package/dist/src/hooks/client/config.test.js +10 -10
- package/dist/src/hooks/client/config.test.js.map +1 -1
- package/dist/src/hooks/client/context.js +1 -1
- package/dist/src/hooks/client/context.js.map +1 -1
- package/dist/src/hooks/client/useClient.d.ts.map +1 -1
- package/dist/src/hooks/client/useClient.js +1 -2
- package/dist/src/hooks/client/useClient.js.map +1 -1
- package/dist/src/hooks/client/useConfig.js +1 -1
- package/dist/src/hooks/client/useConfig.js.map +1 -1
- package/dist/src/hooks/client/useProfile.js +3 -3
- package/dist/src/hooks/client/useProfile.js.map +1 -1
- package/dist/src/hooks/echo-queries/useContacts.js +3 -3
- package/dist/src/hooks/echo-queries/useContacts.js.map +1 -1
- package/dist/src/hooks/echo-queries/useMembers.js +2 -2
- package/dist/src/hooks/echo-queries/useMembers.js.map +1 -1
- package/dist/src/hooks/echo-queries/useParties.js +5 -5
- package/dist/src/hooks/echo-queries/useParties.js.map +1 -1
- package/dist/src/hooks/echo-selections/useSelection.js +2 -2
- package/dist/src/hooks/echo-selections/useSelection.js.map +1 -1
- package/dist/src/hooks/invitations/index.d.ts +0 -1
- package/dist/src/hooks/invitations/index.d.ts.map +1 -1
- package/dist/src/hooks/invitations/index.js +0 -1
- package/dist/src/hooks/invitations/index.js.map +1 -1
- package/dist/src/hooks/invitations/useSecretGenerator.js +2 -2
- package/dist/src/hooks/invitations/useSecretGenerator.js.map +1 -1
- package/dist/src/hooks/invitations/useSecretProvider.js +1 -1
- package/dist/src/hooks/invitations/useSecretProvider.js.map +1 -1
- package/dist/src/hooks/util/useResultSet.js +1 -1
- package/dist/src/hooks/util/useResultSet.js.map +1 -1
- package/dist/src/hooks/wns/registryBotFactories.js +4 -4
- package/dist/src/hooks/wns/registryBotFactories.js.map +1 -1
- package/dist/src/hooks/wns/registryBots.js +4 -4
- package/dist/src/hooks/wns/registryBots.js.map +1 -1
- package/dist/stories/client.stories.js +2 -2
- package/dist/stories/client.stories.js.map +1 -1
- package/dist/stories/halo-invitations.stories.js +12 -11
- package/dist/stories/halo-invitations.stories.js.map +1 -1
- package/dist/stories/helpers/Container.js +1 -1
- package/dist/stories/helpers/Container.js.map +1 -1
- package/dist/stories/helpers/PartyJoinPanel.js +3 -3
- package/dist/stories/helpers/PartyJoinPanel.js.map +1 -1
- package/dist/stories/helpers/ThemeProvider.js +1 -1
- package/dist/stories/helpers/ThemeProvider.js.map +1 -1
- package/dist/stories/party-invitations.stories.d.ts.map +1 -1
- package/dist/stories/party-invitations.stories.js +15 -14
- package/dist/stories/party-invitations.stories.js.map +1 -1
- package/dist/tests/config.test.js +3 -3
- package/dist/tests/config.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -11
- package/react-client.build.log +5 -5
- package/src/hooks/client/client.test.tsx +1 -1
- package/src/hooks/client/config.test.tsx +1 -1
- package/src/hooks/client/useClient.ts +1 -2
- package/src/hooks/client/useConfig.ts +1 -1
- package/src/hooks/invitations/index.ts +0 -1
- package/src/hooks/wns/registryBotFactories.ts +1 -1
- package/src/hooks/wns/registryBots.ts +1 -1
- package/stories/halo-invitations.stories.tsx +3 -3
- package/stories/party-invitations.stories.tsx +2 -3
- package/dist/src/hooks/invitations/utils.d.ts +0 -5
- package/dist/src/hooks/invitations/utils.d.ts.map +0 -1
- package/dist/src/hooks/invitations/utils.js +0 -27
- package/dist/src/hooks/invitations/utils.js.map +0 -1
- package/src/hooks/invitations/utils.ts +0 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.3",
|
|
4
4
|
"description": "React client API",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "AGPL-3.0",
|
|
@@ -14,17 +14,16 @@
|
|
|
14
14
|
"test": "toolchain test"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@dxos/async": "2.
|
|
18
|
-
"@dxos/client": "2.
|
|
19
|
-
"@dxos/config": "2.
|
|
20
|
-
"@dxos/credentials": "2.
|
|
21
|
-
"@dxos/crypto": "2.
|
|
22
|
-
"@dxos/debug": "2.
|
|
23
|
-
"@dxos/echo-db": "2.
|
|
24
|
-
"@dxos/util": "2.
|
|
17
|
+
"@dxos/async": "2.17.3",
|
|
18
|
+
"@dxos/client": "2.17.3",
|
|
19
|
+
"@dxos/config": "2.17.3",
|
|
20
|
+
"@dxos/credentials": "2.17.3",
|
|
21
|
+
"@dxos/crypto": "2.17.3",
|
|
22
|
+
"@dxos/debug": "2.17.3",
|
|
23
|
+
"@dxos/echo-db": "2.17.3",
|
|
24
|
+
"@dxos/util": "2.17.3",
|
|
25
25
|
"@types/debug": "^4.1.1",
|
|
26
26
|
"assert": "^2.0.0",
|
|
27
|
-
"base-x": "~3.0.9",
|
|
28
27
|
"debug": "^4.1.1",
|
|
29
28
|
"react-display-name": "^0.2.5",
|
|
30
29
|
"use-subscription": "^1.4.1"
|
|
@@ -47,7 +46,7 @@
|
|
|
47
46
|
"react-docgen-typescript-loader": "^3.7.2",
|
|
48
47
|
"react-dom": "^17.0.2",
|
|
49
48
|
"react-test-renderer": "^17.0.2",
|
|
50
|
-
"typescript": "^4.
|
|
49
|
+
"typescript": "^4.5.2",
|
|
51
50
|
"webpack": "4.44.2"
|
|
52
51
|
},
|
|
53
52
|
"peerDependencies": {
|
package/react-client.build.log
CHANGED
|
@@ -2,10 +2,10 @@ Invoking: toolchain build:test
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
typescript
|
|
5
|
-
OK in
|
|
5
|
+
OK in 5662 ms
|
|
6
6
|
|
|
7
7
|
eslint
|
|
8
|
-
OK in
|
|
8
|
+
OK in 5244 ms
|
|
9
9
|
|
|
10
10
|
mocha
|
|
11
11
|
This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills
|
|
@@ -26,8 +26,8 @@ This browser doesn't support cancelAnimationFrame. Make sure that you load a pol
|
|
|
26
26
|
✓ should return custom client config when used properly in a context
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
7 passing (
|
|
29
|
+
7 passing (203ms)
|
|
30
30
|
|
|
31
|
-
OK in
|
|
31
|
+
OK in 7076 ms
|
|
32
32
|
|
|
33
|
-
CHECK COMPLETE in
|
|
33
|
+
CHECK COMPLETE in 17987 ms
|
|
@@ -9,8 +9,8 @@ import React from 'react';
|
|
|
9
9
|
import { Client } from '@dxos/client';
|
|
10
10
|
import { defs } from '@dxos/config';
|
|
11
11
|
|
|
12
|
-
import { useClient } from '.';
|
|
13
12
|
import { ClientProvider } from '../../containers';
|
|
13
|
+
import { useClient } from './useClient';
|
|
14
14
|
|
|
15
15
|
describe('Client hook', () => {
|
|
16
16
|
const render = () => useClient();
|
|
@@ -9,8 +9,8 @@ import React from 'react';
|
|
|
9
9
|
import { Client } from '@dxos/client';
|
|
10
10
|
import { ConfigObject } from '@dxos/config';
|
|
11
11
|
|
|
12
|
-
import { useConfig } from '.';
|
|
13
12
|
import { ClientProvider } from '../../containers';
|
|
13
|
+
import { useConfig } from './useConfig';
|
|
14
14
|
|
|
15
15
|
describe('Config hook', () => {
|
|
16
16
|
const render = () => useConfig();
|
|
@@ -13,6 +13,5 @@ import { ClientContext } from './context';
|
|
|
13
13
|
* To be used with `ClientProvider` or `ClientInitializer` component wrapper.
|
|
14
14
|
*/
|
|
15
15
|
export const useClient = () => {
|
|
16
|
-
|
|
17
|
-
return client;
|
|
16
|
+
return useContext(ClientContext) ?? raise(new Error('ClientContext no set.'));
|
|
18
17
|
};
|
|
@@ -13,6 +13,6 @@ import { ClientContext } from './context';
|
|
|
13
13
|
* To be used with `ClientProvider` or `ClientInitializer` component wrapper.
|
|
14
14
|
*/
|
|
15
15
|
export const useConfig = () => {
|
|
16
|
-
const { config } = useContext(ClientContext) ?? raise(new Error('
|
|
16
|
+
const { config } = useContext(ClientContext) ?? raise(new Error('ClientContext no set.'));
|
|
17
17
|
return config;
|
|
18
18
|
};
|
|
@@ -34,7 +34,7 @@ export const useRegistryBotFactories = () => {
|
|
|
34
34
|
let factoriesResult: QueryRecord[];
|
|
35
35
|
try {
|
|
36
36
|
factoriesResult = await registry.queryRecords({ type: WRN_TYPE_BOT_FACTORY });
|
|
37
|
-
} catch (e) {
|
|
37
|
+
} catch (e: any) {
|
|
38
38
|
log('Querying bot factories unsuccessful.');
|
|
39
39
|
log(e);
|
|
40
40
|
return;
|
|
@@ -42,7 +42,7 @@ export const useRegistryBots = (props: UseRegistryBotsProps = {}) => {
|
|
|
42
42
|
let botsResult: QueryRecord[];
|
|
43
43
|
try {
|
|
44
44
|
botsResult = await registry.queryRecords({ type: WRN_TYPE_BOT });
|
|
45
|
-
} catch (e) {
|
|
45
|
+
} catch (e: any) {
|
|
46
46
|
log('Querying bots unsuccessful.');
|
|
47
47
|
log(e);
|
|
48
48
|
return;
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
Box, Button, Divider, Paper, TextField, Toolbar
|
|
9
9
|
} from '@mui/material';
|
|
10
10
|
|
|
11
|
+
import { encodeInvitation, decodeInvitation } from '@dxos/client';
|
|
12
|
+
|
|
11
13
|
import {
|
|
12
14
|
ClientInitializer,
|
|
13
|
-
decodeInvitation,
|
|
14
|
-
encodeInvitation,
|
|
15
15
|
ProfileInitializer,
|
|
16
16
|
useClient,
|
|
17
17
|
useParties,
|
|
@@ -106,7 +106,7 @@ const HaloAuthenticationContainer = () => {
|
|
|
106
106
|
await client.echo.halo.join(invitation, secretProvider);
|
|
107
107
|
setStatus({ identity: invitation.identityKey.toString() });
|
|
108
108
|
}
|
|
109
|
-
} catch (err) {
|
|
109
|
+
} catch (err: any) {
|
|
110
110
|
// TODO(burdon): Doesn't support retry. Provide hint (eg, should retry/cancel).
|
|
111
111
|
setStatus({ error: err });
|
|
112
112
|
}
|
|
@@ -8,13 +8,12 @@ import {
|
|
|
8
8
|
Box, Button, Divider, Paper, TextField, Toolbar
|
|
9
9
|
} from '@mui/material';
|
|
10
10
|
|
|
11
|
+
import { encodeInvitation, decodeInvitation } from '@dxos/client';
|
|
11
12
|
import { PublicKey } from '@dxos/crypto';
|
|
12
13
|
import { InvitationDescriptorType } from '@dxos/echo-db';
|
|
13
14
|
|
|
14
15
|
import {
|
|
15
16
|
ClientInitializer,
|
|
16
|
-
decodeInvitation,
|
|
17
|
-
encodeInvitation,
|
|
18
17
|
ProfileInitializer,
|
|
19
18
|
useClient,
|
|
20
19
|
useContacts,
|
|
@@ -143,7 +142,7 @@ const PartyJoinContainer = () => {
|
|
|
143
142
|
await party.open();
|
|
144
143
|
|
|
145
144
|
setStatus({ party: party.key.toHex() });
|
|
146
|
-
} catch (error) {
|
|
145
|
+
} catch (error: any) {
|
|
147
146
|
setStatus({ error });
|
|
148
147
|
}
|
|
149
148
|
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { InvitationDescriptor } from '@dxos/echo-db';
|
|
2
|
-
export declare const encodeInvitation: (invitation: InvitationDescriptor) => string;
|
|
3
|
-
export declare const decodeInvitation: (code: string) => InvitationDescriptor;
|
|
4
|
-
export declare const noOp: () => null;
|
|
5
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/hooks/invitations/utils.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAKrD,eAAO,MAAM,gBAAgB,eAAgB,oBAAoB,WAGhE,CAAC;AAEF,eAAO,MAAM,gBAAgB,SAAU,MAAM,yBAG5C,CAAC;AAGF,eAAO,MAAM,IAAI,YAAa,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//
|
|
3
|
-
// Copyright 2020 DXOS.org
|
|
4
|
-
//
|
|
5
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.noOp = exports.decodeInvitation = exports.encodeInvitation = void 0;
|
|
10
|
-
const base_x_1 = __importDefault(require("base-x"));
|
|
11
|
-
const echo_db_1 = require("@dxos/echo-db");
|
|
12
|
-
// Encode with only alpha-numberic characters.
|
|
13
|
-
const base62 = base_x_1.default('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');
|
|
14
|
-
const encodeInvitation = (invitation) => {
|
|
15
|
-
const buffer = Buffer.from(JSON.stringify(invitation.toQueryParameters()));
|
|
16
|
-
return base62.encode(buffer);
|
|
17
|
-
};
|
|
18
|
-
exports.encodeInvitation = encodeInvitation;
|
|
19
|
-
const decodeInvitation = (code) => {
|
|
20
|
-
const json = base62.decode(code).toString();
|
|
21
|
-
return echo_db_1.InvitationDescriptor.fromQueryParameters(JSON.parse(json));
|
|
22
|
-
};
|
|
23
|
-
exports.decodeInvitation = decodeInvitation;
|
|
24
|
-
// TODO(burdon): Factor out.
|
|
25
|
-
const noOp = () => null;
|
|
26
|
-
exports.noOp = noOp;
|
|
27
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/hooks/invitations/utils.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,oDAA0B;AAE1B,2CAAqD;AAErD,8CAA8C;AAC9C,MAAM,MAAM,GAAG,gBAAI,CAAC,gEAAgE,CAAC,CAAC;AAE/E,MAAM,gBAAgB,GAAG,CAAC,UAAgC,EAAE,EAAE;IACnE,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC;IAC3E,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AAHW,QAAA,gBAAgB,oBAG3B;AAEK,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,EAAE;IAC/C,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC5C,OAAO,8BAAoB,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACpE,CAAC,CAAC;AAHW,QAAA,gBAAgB,oBAG3B;AAEF,4BAA4B;AACrB,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;AAAlB,QAAA,IAAI,QAAc"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2020 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import base from 'base-x';
|
|
6
|
-
|
|
7
|
-
import { InvitationDescriptor } from '@dxos/echo-db';
|
|
8
|
-
|
|
9
|
-
// Encode with only alpha-numberic characters.
|
|
10
|
-
const base62 = base('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');
|
|
11
|
-
|
|
12
|
-
export const encodeInvitation = (invitation: InvitationDescriptor) => {
|
|
13
|
-
const buffer = Buffer.from(JSON.stringify(invitation.toQueryParameters()));
|
|
14
|
-
return base62.encode(buffer);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const decodeInvitation = (code: string) => {
|
|
18
|
-
const json = base62.decode(code).toString();
|
|
19
|
-
return InvitationDescriptor.fromQueryParameters(JSON.parse(json));
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
// TODO(burdon): Factor out.
|
|
23
|
-
export const noOp = () => null;
|