@dxos/react-client 0.7.5-labs.ea4b4c2 → 0.7.5-labs.f400bbc

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 (37) hide show
  1. package/dist/lib/browser/echo/index.mjs +7 -6
  2. package/dist/lib/browser/echo/index.mjs.map +3 -3
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node/echo/index.cjs +6 -5
  5. package/dist/lib/node/echo/index.cjs.map +3 -3
  6. package/dist/lib/node/meta.json +1 -1
  7. package/dist/lib/node-esm/echo/index.mjs +7 -6
  8. package/dist/lib/node-esm/echo/index.mjs.map +3 -3
  9. package/dist/lib/node-esm/meta.json +1 -1
  10. package/dist/types/src/client/AgentHostingProvider.d.ts +1 -1
  11. package/dist/types/src/client/AgentHostingProvider.d.ts.map +1 -1
  12. package/dist/types/src/client/useClient.d.ts +1 -1
  13. package/dist/types/src/client/useClient.d.ts.map +1 -1
  14. package/dist/types/src/client/useConfig.d.ts +1 -1
  15. package/dist/types/src/client/useConfig.d.ts.map +1 -1
  16. package/dist/types/src/echo/useQuery.d.ts +1 -1
  17. package/dist/types/src/echo/useQuery.d.ts.map +1 -1
  18. package/dist/types/src/halo/Passkey.stories.d.ts +2 -3
  19. package/dist/types/src/halo/Passkey.stories.d.ts.map +1 -1
  20. package/dist/types/src/playwright/{playwright.config.d.ts → playwright.config.d.cts} +1 -1
  21. package/dist/types/src/playwright/playwright.config.d.cts.map +1 -0
  22. package/dist/types/src/testing/ClientRepeater.d.ts +2 -2
  23. package/dist/types/src/testing/ClientRepeater.d.ts.map +1 -1
  24. package/dist/types/src/testing/ClientRepeater.stories.d.ts +3 -4
  25. package/dist/types/src/testing/ClientRepeater.stories.d.ts.map +1 -1
  26. package/dist/types/src/testing/util.d.ts +2 -3
  27. package/dist/types/src/testing/util.d.ts.map +1 -1
  28. package/dist/types/src/testing/withClientProvider.stories.d.ts +3 -4
  29. package/dist/types/src/testing/withClientProvider.stories.d.ts.map +1 -1
  30. package/package.json +24 -23
  31. package/project.json +1 -0
  32. package/src/echo/useQuery.ts +8 -7
  33. package/src/halo/Passkey.stories.tsx +7 -5
  34. package/tsconfig.json +1 -7
  35. package/dist/types/src/playwright/playwright.config.d.ts.map +0 -1
  36. /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
  37. /package/src/playwright/{playwright.config.ts → playwright.config.cts} +0 -0
@@ -1,11 +1,10 @@
1
1
  import '@dxos-theme';
2
- import React from 'react';
3
2
  declare const _default: {
4
3
  title: string;
5
- render: () => React.JSX.Element;
4
+ render: () => import("react/jsx-runtime").JSX.Element;
6
5
  };
7
6
  export default _default;
8
7
  export declare const Default: {
9
- decorators: import("@storybook/react/*").Decorator[];
8
+ decorators: import("@storybook/react").Decorator[];
10
9
  };
11
10
  //# sourceMappingURL=Passkey.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Passkey.stories.d.ts","sourceRoot":"","sources":["../../../../src/halo/Passkey.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAsB,MAAM,OAAO,CAAC;;;;;AAqH3C,wBAGE;AAsBF,eAAO,MAAM,OAAO;;CAEnB,CAAC"}
1
+ {"version":3,"file":"Passkey.stories.d.ts","sourceRoot":"","sources":["../../../../src/halo/Passkey.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;;;;;AAyHrB,wBAGE;AAsBF,eAAO,MAAM,OAAO;;CAEnB,CAAC"}
@@ -1,3 +1,3 @@
1
1
  declare const _default: import("@playwright/test").PlaywrightTestConfig<{}, {}>;
2
2
  export default _default;
3
- //# sourceMappingURL=playwright.config.d.ts.map
3
+ //# sourceMappingURL=playwright.config.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playwright.config.d.cts","sourceRoot":"","sources":["../../../../src/playwright/playwright.config.cts"],"names":[],"mappings":";AASA,wBAQG"}
@@ -1,4 +1,4 @@
1
- import React, { type FC } from 'react';
1
+ import { type FC } from 'react';
2
2
  import { Client, type PublicKey } from '@dxos/client';
3
3
  import { type TypedObject } from '@dxos/echo-schema';
4
4
  import { type WithClientProviderProps } from './withClientProvider';
@@ -24,5 +24,5 @@ export type ClientRepeaterProps<P extends ClientRepeatedComponentProps> = {
24
24
  * The `Component` property is rendered n times, once for each peer.
25
25
  * @deprecated use `withClientProvider`.
26
26
  */
27
- export declare const ClientRepeater: <P extends ClientRepeatedComponentProps>(props: ClientRepeaterProps<P>) => React.JSX.Element | null;
27
+ export declare const ClientRepeater: <P extends ClientRepeatedComponentProps>(props: ClientRepeaterProps<P>) => import("react/jsx-runtime").JSX.Element | null;
28
28
  //# sourceMappingURL=ClientRepeater.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClientRepeater.d.ts","sourceRoot":"","sources":["../../../../src/testing/ClientRepeater.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAY,KAAK,EAAE,EAAqB,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAGpE,MAAM,MAAM,4BAA4B,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;AAE/F,MAAM,MAAM,2BAA2B,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAGhE,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,4BAA4B,IAAI;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,EAAE,CAAC,4BAA4B,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,EAAE,CAAC,2BAA2B,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,CAAC;CAChC,GAAG,IAAI,CAAC,uBAAuB,EAAE,gBAAgB,GAAG,aAAa,GAAG,gBAAgB,CAAC,CAAC;AAEvF;;;;GAIG;AAMH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,4BAA4B,SAAS,mBAAmB,CAAC,CAAC,CAAC,6BA2DnG,CAAC"}
1
+ {"version":3,"file":"ClientRepeater.d.ts","sourceRoot":"","sources":["../../../../src/testing/ClientRepeater.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAY,KAAK,EAAE,EAAqB,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAGpE,MAAM,MAAM,4BAA4B,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;AAE/F,MAAM,MAAM,2BAA2B,GAAG;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAGhE,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,4BAA4B,IAAI;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,EAAE,CAAC,4BAA4B,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,EAAE,CAAC,2BAA2B,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,CAAC;CAChC,GAAG,IAAI,CAAC,uBAAuB,EAAE,gBAAgB,GAAG,aAAa,GAAG,gBAAgB,CAAC,CAAC;AAEvF;;;;GAIG;AAMH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,4BAA4B,SAAS,mBAAmB,CAAC,CAAC,CAAC,mDA2DnG,CAAC"}
@@ -1,14 +1,13 @@
1
1
  import '@dxos-theme';
2
- import React from 'react';
3
2
  declare const _default: {
4
3
  title: string;
5
- decorators: import("@storybook/react/*").Decorator[];
4
+ decorators: import("@storybook/react").Decorator[];
6
5
  };
7
6
  export default _default;
8
7
  export declare const Default: {
9
- render: () => React.JSX.Element;
8
+ render: () => import("react/jsx-runtime").JSX.Element;
10
9
  };
11
10
  export declare const Space: {
12
- render: () => React.JSX.Element;
11
+ render: () => import("react/jsx-runtime").JSX.Element;
13
12
  };
14
13
  //# sourceMappingURL=ClientRepeater.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClientRepeater.stories.d.ts","sourceRoot":"","sources":["../../../../src/testing/ClientRepeater.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;AAU1B,wBAGE;AAgCF,eAAO,MAAM,OAAO;;CAEnB,CAAC;AAEF,eAAO,MAAM,KAAK;;CAEjB,CAAC"}
1
+ {"version":3,"file":"ClientRepeater.stories.d.ts","sourceRoot":"","sources":["../../../../src/testing/ClientRepeater.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;;;;;AAYrB,wBAGE;AAgCF,eAAO,MAAM,OAAO;;CAEnB,CAAC;AAEF,eAAO,MAAM,KAAK;;CAEjB,CAAC"}
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { Client, type Config } from '@dxos/client';
3
2
  import { type Space } from '@dxos/client/echo';
4
3
  export declare const createClient: ({ config, createIdentity, createSpace, }?: {
@@ -9,6 +8,6 @@ export declare const createClient: ({ config, createIdentity, createSpace, }?: {
9
8
  client: Client;
10
9
  space: Space | undefined;
11
10
  }>;
12
- export declare const createClientContextProvider: (client: Client) => Promise<({ children }: any) => React.JSX.Element>;
13
- export declare const createClientProvider: (client: Client) => Promise<({ children }: any) => React.JSX.Element>;
11
+ export declare const createClientContextProvider: (client: Client) => Promise<({ children }: any) => import("react/jsx-runtime").JSX.Element>;
12
+ export declare const createClientProvider: (client: Client) => Promise<({ children }: any) => import("react/jsx-runtime").JSX.Element>;
14
13
  //# sourceMappingURL=util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/testing/util.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAY,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAK/C,eAAO,MAAM,YAAY,8CAItB;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE;;;EActE,CAAC;AAEF,eAAO,MAAM,2BAA2B,WAAkB,MAAM,4BACxC,GAAG,uBAC1B,CAAC;AAEF,eAAO,MAAM,oBAAoB,WAAkB,MAAM,4BACjC,GAAG,uBAC1B,CAAC"}
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/testing/util.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAY,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAK/C,eAAO,MAAM,YAAY,8CAItB;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE;;;EActE,CAAC;AAEF,eAAO,MAAM,2BAA2B,WAAkB,MAAM,4BACxC,GAAG,6CAC1B,CAAC;AAEF,eAAO,MAAM,oBAAoB,WAAkB,MAAM,4BACjC,GAAG,6CAC1B,CAAC"}
@@ -1,14 +1,13 @@
1
1
  import '@dxos-theme';
2
- import React from 'react';
3
2
  declare const _default: {
4
3
  title: string;
5
- render: () => React.JSX.Element | null;
4
+ render: () => import("react/jsx-runtime").JSX.Element | null;
6
5
  };
7
6
  export default _default;
8
7
  export declare const Default: {
9
- decorators: import("@storybook/react/*").Decorator[];
8
+ decorators: import("@storybook/react").Decorator[];
10
9
  };
11
10
  export declare const Multiple: {
12
- decorators: import("@storybook/react/*").Decorator[];
11
+ decorators: import("@storybook/react").Decorator[];
13
12
  };
14
13
  //# sourceMappingURL=withClientProvider.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"withClientProvider.stories.d.ts","sourceRoot":"","sources":["../../../../src/testing/withClientProvider.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;AAgC1B,wBAGE;AAaF,eAAO,MAAM,OAAO;;CAEnB,CAAC;AAEF,eAAO,MAAM,QAAQ;;CAMpB,CAAC"}
1
+ {"version":3,"file":"withClientProvider.stories.d.ts","sourceRoot":"","sources":["../../../../src/testing/withClientProvider.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;;;;;AAkCrB,wBAGE;AAaF,eAAO,MAAM,OAAO;;CAEnB,CAAC;AAEF,eAAO,MAAM,QAAQ;;CAMpB,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@dxos/react-client",
3
- "version": "0.7.5-labs.ea4b4c2",
3
+ "version": "0.7.5-labs.f400bbc",
4
4
  "description": "React client API",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
7
  "license": "MIT",
8
8
  "author": "DXOS.org",
9
9
  "sideEffects": true,
10
+ "type": "module",
10
11
  "exports": {
11
12
  "./devtools": {
12
13
  "types": "./dist/types/src/devtools/index.d.ts",
@@ -77,40 +78,40 @@
77
78
  },
78
79
  "dependencies": {
79
80
  "react-error-boundary": "^4.0.13",
80
- "@dxos/async": "0.7.5-labs.ea4b4c2",
81
- "@dxos/client": "0.7.5-labs.ea4b4c2",
82
- "@dxos/codec-protobuf": "0.7.5-labs.ea4b4c2",
83
- "@dxos/config": "0.7.5-labs.ea4b4c2",
84
- "@dxos/debug": "0.7.5-labs.ea4b4c2",
85
- "@dxos/echo-schema": "0.7.5-labs.ea4b4c2",
86
- "@dxos/invariant": "0.7.5-labs.ea4b4c2",
87
- "@dxos/log": "0.7.5-labs.ea4b4c2",
88
- "@dxos/echo-signals": "0.7.5-labs.ea4b4c2",
89
- "@dxos/react-hooks": "0.7.5-labs.ea4b4c2",
90
- "@dxos/node-std": "0.7.5-labs.ea4b4c2",
91
- "@dxos/protocols": "0.7.5-labs.ea4b4c2",
92
- "@dxos/util": "0.7.5-labs.ea4b4c2"
81
+ "@dxos/async": "0.7.5-labs.f400bbc",
82
+ "@dxos/client": "0.7.5-labs.f400bbc",
83
+ "@dxos/codec-protobuf": "0.7.5-labs.f400bbc",
84
+ "@dxos/config": "0.7.5-labs.f400bbc",
85
+ "@dxos/debug": "0.7.5-labs.f400bbc",
86
+ "@dxos/invariant": "0.7.5-labs.f400bbc",
87
+ "@dxos/echo-signals": "0.7.5-labs.f400bbc",
88
+ "@dxos/log": "0.7.5-labs.f400bbc",
89
+ "@dxos/node-std": "0.7.5-labs.f400bbc",
90
+ "@dxos/protocols": "0.7.5-labs.f400bbc",
91
+ "@dxos/echo-schema": "0.7.5-labs.f400bbc",
92
+ "@dxos/react-hooks": "0.7.5-labs.f400bbc",
93
+ "@dxos/util": "0.7.5-labs.f400bbc"
93
94
  },
94
95
  "devDependencies": {
95
96
  "@types/react": "~18.2.0",
96
97
  "@types/react-dom": "~18.2.0",
97
98
  "react": "~18.2.0",
98
99
  "react-dom": "~18.2.0",
99
- "@dxos/random": "0.7.5-labs.ea4b4c2",
100
- "@dxos/react-ui-syntax-highlighter": "0.7.5-labs.ea4b4c2",
101
- "@dxos/react-ui-theme": "0.7.5-labs.ea4b4c2",
102
- "@dxos/react-ui": "0.7.5-labs.ea4b4c2",
103
- "@dxos/storybook-utils": "0.7.5-labs.ea4b4c2",
104
- "@dxos/test-utils": "0.7.5-labs.ea4b4c2"
100
+ "@dxos/random": "0.7.5-labs.f400bbc",
101
+ "@dxos/react-ui": "0.7.5-labs.f400bbc",
102
+ "@dxos/react-ui-syntax-highlighter": "0.7.5-labs.f400bbc",
103
+ "@dxos/storybook-utils": "0.7.5-labs.f400bbc",
104
+ "@dxos/react-ui-theme": "0.7.5-labs.f400bbc",
105
+ "@dxos/test-utils": "0.7.5-labs.f400bbc"
105
106
  },
106
107
  "peerDependencies": {
107
108
  "react": "~18.2.0",
108
109
  "react-dom": "~18.2.0"
109
110
  },
110
111
  "optionalDependencies": {
111
- "@dxos/random": "0.7.5-labs.ea4b4c2",
112
- "@dxos/react-ui": "0.7.5-labs.ea4b4c2",
113
- "@dxos/react-ui-theme": "0.7.5-labs.ea4b4c2"
112
+ "@dxos/random": "0.7.5-labs.f400bbc",
113
+ "@dxos/react-ui": "0.7.5-labs.f400bbc",
114
+ "@dxos/react-ui-theme": "0.7.5-labs.f400bbc"
114
115
  },
115
116
  "publishConfig": {
116
117
  "access": "public"
package/project.json CHANGED
@@ -29,6 +29,7 @@
29
29
  ]
30
30
  },
31
31
  "lint": {},
32
+ "pack": {},
32
33
  "test": {}
33
34
  },
34
35
  "implicitDependencies": [
@@ -5,11 +5,11 @@
5
5
  import { useMemo, useSyncExternalStore } from 'react';
6
6
 
7
7
  import {
8
- Filter,
9
8
  isSpace,
10
9
  type Echo,
11
- type ReactiveEchoObject,
12
10
  type FilterSource,
11
+ Filter,
12
+ type ReactiveEchoObject,
13
13
  type Query,
14
14
  type QueryOptions,
15
15
  type Space,
@@ -25,13 +25,14 @@ export const useQuery = <T extends ReactiveEchoObject<any>>(
25
25
  options?: QueryOptions,
26
26
  deps?: any[],
27
27
  ): T[] => {
28
- const { subscribe, getObjects } = useMemo(() => {
28
+ const { getObjects, subscribe } = useMemo(() => {
29
+ let subscribed = false;
29
30
  const query = isSpace(spaceOrEcho)
30
31
  ? spaceOrEcho.db.query(filter, options)
31
32
  : (spaceOrEcho?.query(filter, options) as Query<T> | undefined);
32
- let subscribed = false;
33
33
 
34
34
  return {
35
+ getObjects: () => (subscribed && query ? query.objects : EMPTY_ARRAY),
35
36
  subscribe: (cb: () => void) => {
36
37
  subscribed = true;
37
38
  const unsubscribe = query?.subscribe(cb) ?? noop;
@@ -40,13 +41,13 @@ export const useQuery = <T extends ReactiveEchoObject<any>>(
40
41
  subscribed = false;
41
42
  };
42
43
  },
43
- getObjects: () => (subscribed && query ? query.objects : EMPTY_ARRAY),
44
44
  };
45
45
  }, [spaceOrEcho, ...filterToDepsArray(filter), ...(deps ?? [])]);
46
46
 
47
47
  // https://beta.reactjs.org/reference/react/useSyncExternalStore
48
- // NOTE: This hook will resubscribe whenever the callback passed to the first argument changes -- make sure it is stable.
49
- return useSyncExternalStore<T[] | undefined>(subscribe, getObjects) ?? [];
48
+ // NOTE: This hook will resubscribe whenever the callback passed to the first argument changes; make sure it is stable.
49
+ const objects = useSyncExternalStore<T[] | undefined>(subscribe, getObjects);
50
+ return objects ?? [];
50
51
  };
51
52
 
52
53
  const filterToDepsArray = (filter?: FilterSource<any>) => [JSON.stringify(Filter.from(filter).toProto())];
@@ -35,6 +35,7 @@ const Test = () => {
35
35
  const handleCreatePassKey = useCallback(async () => {
36
36
  invariant(identity, 'Identity not available');
37
37
  const challenge = getNewChallenge();
38
+ const lookupKey = PublicKey.random();
38
39
  // https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredentialCreationOptions
39
40
  const credential = await navigator.credentials
40
41
  .create({
@@ -42,7 +43,7 @@ const Test = () => {
42
43
  challenge: new TextEncoder().encode(challenge),
43
44
  rp: { id: location.hostname, name: 'Test' },
44
45
  user: {
45
- id: new TextEncoder().encode(identity.did),
46
+ id: lookupKey.asUint8Array(),
46
47
  name: identity.did,
47
48
  displayName: identity.profile?.displayName ?? '',
48
49
  },
@@ -68,6 +69,7 @@ const Test = () => {
68
69
  await client.services.services.IdentityService.createRecoveryCredential({
69
70
  recoveryKey,
70
71
  algorithm,
72
+ lookupKey,
71
73
  });
72
74
  }, [client, identity]);
73
75
 
@@ -86,10 +88,10 @@ const Test = () => {
86
88
  },
87
89
  })
88
90
  .catch(log.error);
89
- const identityDid = new TextDecoder().decode((credential as any).response.userHandle);
91
+ const lookupKey = PublicKey.from(new Uint8Array((credential as any).response.userHandle));
90
92
  await client.services.services.IdentityService.recoverIdentity({
91
93
  external: {
92
- identityDid,
94
+ lookupKey,
93
95
  deviceKey,
94
96
  controlFeedKey,
95
97
  signature: Buffer.from((credential as any).response.signature),
@@ -138,8 +140,8 @@ const config = new Config({
138
140
  },
139
141
  services: {
140
142
  edge: {
141
- // url: 'wss://edge.dxos.workers.dev/',
142
- url: 'ws://localhost:8787',
143
+ url: 'wss://edge-main.dxos.workers.dev/',
144
+ // url: 'ws://localhost:8787',
143
145
  },
144
146
  iceProviders: [{ urls: 'https://edge-production.dxos.workers.dev/ice' }],
145
147
  },
package/tsconfig.json CHANGED
@@ -1,13 +1,7 @@
1
1
  {
2
2
  "extends": "../../../tsconfig.base.json",
3
3
  "compilerOptions": {
4
- "jsx": "react",
5
- "lib": [
6
- "DOM",
7
- "ESNext"
8
- ],
9
- "module": "ESNext",
10
- "outDir": "./dist/types"
4
+ "module": "ESNext"
11
5
  },
12
6
  "include": [
13
7
  "playwright",
@@ -1 +0,0 @@
1
- {"version":3,"file":"playwright.config.d.ts","sourceRoot":"","sources":["../../../../src/playwright/playwright.config.ts"],"names":[],"mappings":";AASA,wBAQG"}
File without changes