@session-foundation/qa-seeder 0.1.22 → 0.1.24

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.js CHANGED
@@ -96,7 +96,7 @@ var GetSnodesFromSeed = class {
96
96
  };
97
97
 
98
98
  // src/sessionTools/index.ts
99
- var import_libsession_wasm = __toESM(require("@session-foundation/libsession-wasm/"));
99
+ var import_libsession_wasm = __toESM(require("@session-foundation/libsession-wasm"));
100
100
  async function loadSessionTools() {
101
101
  const loaded = await (0, import_libsession_wasm.default)();
102
102
  return loaded;
@@ -375,17 +375,20 @@ var SessionUser = class {
375
375
  constructor({ sessionTools, sodium }) {
376
376
  const mnemonic = generateMnemonic({ sodium });
377
377
  const seed = mnemonicToRawSeed(mnemonic, sodium);
378
- const userKeys = sessionGenerateKeyPair({ seed, sodium });
378
+ const userKeys = sessionGenerateKeyPair({
379
+ seed: seed.buffer,
380
+ sodium
381
+ });
379
382
  const userProfile = new sessionTools.UserProfileW(
380
- userKeys.ed25519KeyPair.privateKey,
383
+ sodium.to_hex(userKeys.ed25519KeyPair.privateKey),
381
384
  void 0
382
385
  );
383
386
  const contacts = new sessionTools.ContactsW(
384
- userKeys.ed25519KeyPair.privateKey,
387
+ sodium.to_hex(userKeys.ed25519KeyPair.privateKey),
385
388
  void 0
386
389
  );
387
390
  const userGroups = new sessionTools.UserGroupsW(
388
- userKeys.ed25519KeyPair.privateKey,
391
+ sodium.to_hex(userKeys.ed25519KeyPair.privateKey),
389
392
  void 0
390
393
  );
391
394
  const wrappers = [userProfile, contacts, userGroups];
@@ -550,9 +553,9 @@ var SessionGroup = class {
550
553
  newGroup.joinedAtSeconds = BigInt(Math.floor(Date.now() / 1e3));
551
554
  this.groupSecretKey = sodium.from_hex(newGroup.adminSecretKey.toString());
552
555
  this.metagroupW = new sessionTools.MetaGroupW(
553
- creator.ed25519Sk,
554
- sodium.from_hex(newGroup.groupPk.toString().slice(2)).buffer,
555
- this.groupSecretKey,
556
+ sodium.to_hex(creator.ed25519Sk),
557
+ newGroup.groupPk.toString().slice(2),
558
+ sodium.to_hex(this.groupSecretKey),
556
559
  void 0
557
560
  );
558
561
  [creator, ...otherMembers].forEach((member) => {
@@ -567,9 +570,9 @@ var SessionGroup = class {
567
570
  );
568
571
  groupForUser.name = newGroup.name;
569
572
  groupForUser.joinedAtSeconds = newGroup.joinedAtSeconds;
570
- groupForUser.invited = false;
573
+ groupForUser.invitePending = false;
571
574
  groupForUser.priority = 0;
572
- groupForUser.authData = sodium.from_hex(authDataHex);
575
+ groupForUser.authData = authDataHex;
573
576
  member.userGroups.setGroup(groupForUser);
574
577
  } else {
575
578
  member.userGroups.setGroup(newGroup);
@@ -874,6 +877,7 @@ function prepareUsers({
874
877
  sessionTools
875
878
  });
876
879
  assignNamesToUsers(users);
880
+ console.warn("assignNamesToUsers", assignNamesToUsers, assignNamesToUsers);
877
881
  return users;
878
882
  }
879
883
  function prepareFriends({
package/dist/index.mjs CHANGED
@@ -60,9 +60,9 @@ var GetSnodesFromSeed = class {
60
60
  };
61
61
 
62
62
  // src/sessionTools/index.ts
63
- import sessionToolsPromise from "@session-foundation/libsession-wasm/";
63
+ import MainModuleFactory from "@session-foundation/libsession-wasm";
64
64
  async function loadSessionTools() {
65
- const loaded = await sessionToolsPromise();
65
+ const loaded = await MainModuleFactory();
66
66
  return loaded;
67
67
  }
68
68
 
@@ -341,17 +341,20 @@ var SessionUser = class {
341
341
  constructor({ sessionTools, sodium }) {
342
342
  const mnemonic = generateMnemonic({ sodium });
343
343
  const seed = mnemonicToRawSeed(mnemonic, sodium);
344
- const userKeys = sessionGenerateKeyPair({ seed, sodium });
344
+ const userKeys = sessionGenerateKeyPair({
345
+ seed: seed.buffer,
346
+ sodium
347
+ });
345
348
  const userProfile = new sessionTools.UserProfileW(
346
- userKeys.ed25519KeyPair.privateKey,
349
+ sodium.to_hex(userKeys.ed25519KeyPair.privateKey),
347
350
  void 0
348
351
  );
349
352
  const contacts = new sessionTools.ContactsW(
350
- userKeys.ed25519KeyPair.privateKey,
353
+ sodium.to_hex(userKeys.ed25519KeyPair.privateKey),
351
354
  void 0
352
355
  );
353
356
  const userGroups = new sessionTools.UserGroupsW(
354
- userKeys.ed25519KeyPair.privateKey,
357
+ sodium.to_hex(userKeys.ed25519KeyPair.privateKey),
355
358
  void 0
356
359
  );
357
360
  const wrappers = [userProfile, contacts, userGroups];
@@ -518,9 +521,9 @@ var SessionGroup = class {
518
521
  newGroup.joinedAtSeconds = BigInt(Math.floor(Date.now() / 1e3));
519
522
  this.groupSecretKey = sodium.from_hex(newGroup.adminSecretKey.toString());
520
523
  this.metagroupW = new sessionTools.MetaGroupW(
521
- creator.ed25519Sk,
522
- sodium.from_hex(newGroup.groupPk.toString().slice(2)).buffer,
523
- this.groupSecretKey,
524
+ sodium.to_hex(creator.ed25519Sk),
525
+ newGroup.groupPk.toString().slice(2),
526
+ sodium.to_hex(this.groupSecretKey),
524
527
  void 0
525
528
  );
526
529
  [creator, ...otherMembers].forEach((member) => {
@@ -535,9 +538,9 @@ var SessionGroup = class {
535
538
  );
536
539
  groupForUser.name = newGroup.name;
537
540
  groupForUser.joinedAtSeconds = newGroup.joinedAtSeconds;
538
- groupForUser.invited = false;
541
+ groupForUser.invitePending = false;
539
542
  groupForUser.priority = 0;
540
- groupForUser.authData = sodium.from_hex(authDataHex);
543
+ groupForUser.authData = authDataHex;
541
544
  member.userGroups.setGroup(groupForUser);
542
545
  } else {
543
546
  member.userGroups.setGroup(newGroup);
@@ -844,6 +847,7 @@ function prepareUsers({
844
847
  sessionTools
845
848
  });
846
849
  assignNamesToUsers(users);
850
+ console.warn("assignNamesToUsers", assignNamesToUsers, assignNamesToUsers);
847
851
  return users;
848
852
  }
849
853
  function prepareFriends({
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@session-foundation/qa-seeder",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
7
7
  "dependencies": {
8
8
  "lodash": "^4.17.21",
9
+ "@session-foundation/mnemonic": "^0.0.8",
10
+ "@session-foundation/libsession-wasm": "^0.0.9",
9
11
  "@session-foundation/sodium": "^0.0.6",
10
- "@session-foundation/basic-types": "^0.0.6",
11
- "@session-foundation/libsession-wasm": "^0.0.6",
12
- "@session-foundation/mnemonic": "^0.0.8"
12
+ "@session-foundation/basic-types": "^0.0.6"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@turbo/gen": "^2.4.4",