@dxos/credentials 0.6.13 → 0.6.14-main.2b6a0f3

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.
@@ -2,13 +2,12 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import { expect } from 'chai';
5
+ import { describe, expect, test } from 'vitest';
6
6
 
7
7
  import { randomBytes } from '@dxos/crypto';
8
8
  import { Keyring } from '@dxos/keyring';
9
9
  import { PublicKey } from '@dxos/keys';
10
10
  import { type Chain, SpaceMember } from '@dxos/protocols/proto/dxos/halo/credentials';
11
- import { describe, test } from '@dxos/test';
12
11
 
13
12
  import { signPresentation } from './presentation';
14
13
  import { verifyPresentation, verifyPresentationSignature } from './verifier';
package/src/seedphrase.ts CHANGED
@@ -8,21 +8,14 @@ import { createKeyPair } from '@dxos/crypto';
8
8
  import { invariant } from '@dxos/invariant';
9
9
  import { type KeyPair } from '@dxos/keys';
10
10
 
11
- // Util functions for Identity: export, import, create.
12
-
13
11
  /**
14
12
  * Generate bip39 seed phrase (aka mnemonic).
15
- *
16
- * @deprecated
17
13
  */
18
14
  export const generateSeedPhrase = (): string => generateMnemonic();
19
15
 
20
16
  /**
21
17
  * Generate key pair from seed phrase.
22
- *
23
- * @deprecated
24
18
  */
25
- // TODO(dmaretskyi): Use web-crypto.
26
19
  export const keyPairFromSeedPhrase = (seedPhrase: string): KeyPair => {
27
20
  invariant(seedPhrase);
28
21
  const seed = mnemonicToSeedSync(seedPhrase);
@@ -2,14 +2,13 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import { expect } from 'chai';
5
+ import { beforeEach, describe, expect, test } from 'vitest';
6
6
 
7
7
  import { Keyring } from '@dxos/keyring';
8
8
  import { PublicKey } from '@dxos/keys';
9
9
  import { Invitation } from '@dxos/protocols/proto/dxos/client/services';
10
10
  import { SpaceMember, type Credential } from '@dxos/protocols/proto/dxos/halo/credentials';
11
11
  import { type DelegateSpaceInvitation } from '@dxos/protocols/proto/dxos/halo/invitations';
12
- import { describe, test } from '@dxos/test';
13
12
  import { range } from '@dxos/util';
14
13
 
15
14
  import { InvitationStateMachine } from './invitation-state-machine';
@@ -30,6 +29,7 @@ describe('InvitationStateMachine', () => {
30
29
  authMethod: Invitation.AuthMethod.KNOWN_PUBLIC_KEY,
31
30
  multiUse: false,
32
31
  };
32
+
33
33
  beforeEach(async () => {
34
34
  space = await keyring.createKey();
35
35
  identity = await keyring.createKey();
@@ -1,12 +1,12 @@
1
1
  //
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
- import { expect } from 'chai';
4
+
5
+ import { beforeEach, describe, expect, test } from 'vitest';
5
6
 
6
7
  import { Keyring } from '@dxos/keyring';
7
8
  import { PublicKey } from '@dxos/keys';
8
9
  import { SpaceMember } from '@dxos/protocols/proto/dxos/halo/credentials';
9
- import { describe, test } from '@dxos/test';
10
10
  import { range } from '@dxos/util';
11
11
 
12
12
  import { MemberStateMachine } from './member-state-machine';
@@ -16,8 +16,8 @@ const keyring = new Keyring();
16
16
 
17
17
  describe('MemberStateMachine', () => {
18
18
  const genesisFeedKey: PublicKey = PublicKey.random();
19
-
20
19
  let spaceKey: PublicKey;
20
+
21
21
  beforeEach(async () => {
22
22
  spaceKey = await keyring.createKey();
23
23
  });
@@ -2,12 +2,11 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import expect from 'expect';
5
+ import { describe, expect, test } from 'vitest';
6
6
 
7
7
  import { Keyring } from '@dxos/keyring';
8
8
  import { type PublicKey } from '@dxos/keys';
9
9
  import { AdmittedFeed, type Chain, SpaceMember } from '@dxos/protocols/proto/dxos/halo/credentials';
10
- import { describe, test } from '@dxos/test';
11
10
 
12
11
  import { SpaceStateMachine } from './space-state-machine';
13
12
  import { createCredential, verifyCredential } from '../credentials';
package/tsconfig.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "extends": "../../../../tsconfig.json",
3
3
  "compilerOptions": {
4
- "outDir": "dist/types",
5
4
  "types": [
6
5
  "node"
7
6
  ]
@@ -9,51 +8,5 @@
9
8
  "include": [
10
9
  "src"
11
10
  ],
12
- "references": [
13
- {
14
- "path": "../../../common/async"
15
- },
16
- {
17
- "path": "../../../common/codec-protobuf"
18
- },
19
- {
20
- "path": "../../../common/context"
21
- },
22
- {
23
- "path": "../../../common/crypto"
24
- },
25
- {
26
- "path": "../../../common/debug"
27
- },
28
- {
29
- "path": "../../../common/feed-store"
30
- },
31
- {
32
- "path": "../../../common/invariant"
33
- },
34
- {
35
- "path": "../../../common/keys"
36
- },
37
- {
38
- "path": "../../../common/log"
39
- },
40
- {
41
- "path": "../../../common/node-std"
42
- },
43
- {
44
- "path": "../../../common/random-access-storage"
45
- },
46
- {
47
- "path": "../../../common/timeframe"
48
- },
49
- {
50
- "path": "../../../common/util"
51
- },
52
- {
53
- "path": "../../protocols"
54
- },
55
- {
56
- "path": "../keyring"
57
- }
58
- ]
11
+ "references": []
59
12
  }
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { defineConfig, mergeConfig } from 'vitest/config';
6
+
7
+ import { baseConfig } from '../../../../vitest.shared';
8
+
9
+ export default mergeConfig(baseConfig({ cwd: __dirname }), defineConfig({}));