@session-foundation/qa-seeder 0.1.21
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/dist/index.d.mts +45 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +1043 -0
- package/dist/index.mjs +1012 -0
- package/package.json +34 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { PubkeyType, GroupPubkeyType } from '@session-foundation/basic-types';
|
|
2
|
+
|
|
3
|
+
type SeedNodeURL = `http${string}`;
|
|
4
|
+
|
|
5
|
+
type StateUser = {
|
|
6
|
+
seed: Uint8Array;
|
|
7
|
+
seedPhrase: string;
|
|
8
|
+
sessionId: PubkeyType;
|
|
9
|
+
userName: UserNameType;
|
|
10
|
+
};
|
|
11
|
+
type StateGroup = {
|
|
12
|
+
groupPk: GroupPubkeyType;
|
|
13
|
+
groupName: string;
|
|
14
|
+
adminSecretKey: Uint8Array;
|
|
15
|
+
};
|
|
16
|
+
type WithStateGroup = {
|
|
17
|
+
group: StateGroup;
|
|
18
|
+
};
|
|
19
|
+
type WithUsers = {
|
|
20
|
+
users: Array<StateUser>;
|
|
21
|
+
};
|
|
22
|
+
declare const inGroup = "InGroup";
|
|
23
|
+
type PrebuiltState = {
|
|
24
|
+
none: WithUsers;
|
|
25
|
+
'1user': WithUsers;
|
|
26
|
+
'2users': WithUsers;
|
|
27
|
+
'3users': WithUsers;
|
|
28
|
+
'2friends': WithUsers;
|
|
29
|
+
'2friendsInGroup': WithUsers & WithStateGroup;
|
|
30
|
+
'3friends': WithUsers;
|
|
31
|
+
'3friendsInGroup': WithUsers & WithStateGroup;
|
|
32
|
+
};
|
|
33
|
+
type PrebuiltStateKey = keyof PrebuiltState;
|
|
34
|
+
type WithGroupStateKey = Extract<keyof PrebuiltState, `${string}${typeof inGroup}${string}`>;
|
|
35
|
+
declare const usernames: readonly ["Alice", "Bob", "Charlie", "Dracula"];
|
|
36
|
+
type UserNameType = (typeof usernames)[number];
|
|
37
|
+
declare const USERNAME: {
|
|
38
|
+
readonly ALICE: "Alice";
|
|
39
|
+
readonly BOB: "Bob";
|
|
40
|
+
readonly CHARLIE: "Charlie";
|
|
41
|
+
readonly DRACULA: "Dracula";
|
|
42
|
+
};
|
|
43
|
+
declare function buildStateForTest<K extends PrebuiltStateKey>(stateToBuild: K, groupName: K extends WithGroupStateKey ? string : undefined, network: 'mainnet' | 'testnet' | SeedNodeURL): Promise<PrebuiltState[K]>;
|
|
44
|
+
|
|
45
|
+
export { type PrebuiltState, type PrebuiltStateKey, type StateGroup, type StateUser, USERNAME, type UserNameType, type WithGroupStateKey, buildStateForTest, usernames };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { PubkeyType, GroupPubkeyType } from '@session-foundation/basic-types';
|
|
2
|
+
|
|
3
|
+
type SeedNodeURL = `http${string}`;
|
|
4
|
+
|
|
5
|
+
type StateUser = {
|
|
6
|
+
seed: Uint8Array;
|
|
7
|
+
seedPhrase: string;
|
|
8
|
+
sessionId: PubkeyType;
|
|
9
|
+
userName: UserNameType;
|
|
10
|
+
};
|
|
11
|
+
type StateGroup = {
|
|
12
|
+
groupPk: GroupPubkeyType;
|
|
13
|
+
groupName: string;
|
|
14
|
+
adminSecretKey: Uint8Array;
|
|
15
|
+
};
|
|
16
|
+
type WithStateGroup = {
|
|
17
|
+
group: StateGroup;
|
|
18
|
+
};
|
|
19
|
+
type WithUsers = {
|
|
20
|
+
users: Array<StateUser>;
|
|
21
|
+
};
|
|
22
|
+
declare const inGroup = "InGroup";
|
|
23
|
+
type PrebuiltState = {
|
|
24
|
+
none: WithUsers;
|
|
25
|
+
'1user': WithUsers;
|
|
26
|
+
'2users': WithUsers;
|
|
27
|
+
'3users': WithUsers;
|
|
28
|
+
'2friends': WithUsers;
|
|
29
|
+
'2friendsInGroup': WithUsers & WithStateGroup;
|
|
30
|
+
'3friends': WithUsers;
|
|
31
|
+
'3friendsInGroup': WithUsers & WithStateGroup;
|
|
32
|
+
};
|
|
33
|
+
type PrebuiltStateKey = keyof PrebuiltState;
|
|
34
|
+
type WithGroupStateKey = Extract<keyof PrebuiltState, `${string}${typeof inGroup}${string}`>;
|
|
35
|
+
declare const usernames: readonly ["Alice", "Bob", "Charlie", "Dracula"];
|
|
36
|
+
type UserNameType = (typeof usernames)[number];
|
|
37
|
+
declare const USERNAME: {
|
|
38
|
+
readonly ALICE: "Alice";
|
|
39
|
+
readonly BOB: "Bob";
|
|
40
|
+
readonly CHARLIE: "Charlie";
|
|
41
|
+
readonly DRACULA: "Dracula";
|
|
42
|
+
};
|
|
43
|
+
declare function buildStateForTest<K extends PrebuiltStateKey>(stateToBuild: K, groupName: K extends WithGroupStateKey ? string : undefined, network: 'mainnet' | 'testnet' | SeedNodeURL): Promise<PrebuiltState[K]>;
|
|
44
|
+
|
|
45
|
+
export { type PrebuiltState, type PrebuiltStateKey, type StateGroup, type StateUser, USERNAME, type UserNameType, type WithGroupStateKey, buildStateForTest, usernames };
|