jazz-tools 0.10.4 → 0.10.6

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > jazz-tools@0.10.4 build /home/runner/_work/jazz/jazz/packages/jazz-tools
2
+ > jazz-tools@0.10.6 build /home/runner/_work/jazz/jazz/packages/jazz-tools
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
@@ -11,8 +11,8 @@
11
11
  ESM Build start
12
12
  ESM dist/index.js 1.50 KB
13
13
  ESM dist/testing.js 6.18 KB
14
- ESM dist/chunk-XRX3CCYY.js 111.67 KB
14
+ ESM dist/chunk-DPW23T6J.js 112.71 KB
15
15
  ESM dist/index.js.map 259.00 B
16
16
  ESM dist/testing.js.map 12.19 KB
17
- ESM dist/chunk-XRX3CCYY.js.map 269.16 KB
18
- ESM ⚡️ Build success in 33ms
17
+ ESM dist/chunk-DPW23T6J.js.map 270.82 KB
18
+ ESM ⚡️ Build success in 47ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # jazz-tools
2
2
 
3
+ ## 0.10.6
4
+
5
+ ### Patch Changes
6
+
7
+ - ada802b: Fix Clerk credentials migration
8
+ - Updated dependencies [5c76e37]
9
+ - cojson@0.10.6
10
+
11
+ ## 0.10.5
12
+
13
+ ### Patch Changes
14
+
15
+ - 59ff77e: Critical fix: move the Account migration code execution in the right place to ensure that the changes applied to the right Jazz node.
16
+
3
17
  ## 0.10.4
4
18
 
5
19
  ### Patch Changes
@@ -447,11 +447,17 @@ async function createJazzContextFromExistingCredentials({
447
447
  accountSecret: credentials.secret,
448
448
  sessionID,
449
449
  peersToLoadFrom,
450
- crypto
450
+ crypto,
451
+ migration: async (rawAccount, _node, creationProps) => {
452
+ const account2 = new CurrentAccountSchema({
453
+ fromRaw: rawAccount
454
+ });
455
+ activeAccountContext.set(account2);
456
+ await account2.applyMigration(creationProps);
457
+ }
451
458
  });
452
459
  const account = CurrentAccountSchema.fromNode(node);
453
460
  activeAccountContext.set(account);
454
- await account.applyMigration();
455
461
  return {
456
462
  node,
457
463
  account,
@@ -3439,15 +3445,46 @@ var AuthSecretStorage = class {
3439
3445
  if (!await kvStore.get(STORAGE_KEY)) {
3440
3446
  const demoAuthSecret = await kvStore.get("demo-auth-logged-in-secret");
3441
3447
  if (demoAuthSecret) {
3442
- await kvStore.set(STORAGE_KEY, demoAuthSecret);
3448
+ const parsed = JSON.parse(demoAuthSecret);
3449
+ await kvStore.set(
3450
+ STORAGE_KEY,
3451
+ JSON.stringify({
3452
+ accountID: parsed.accountID,
3453
+ accountSecret: parsed.accountSecret,
3454
+ provider: "demo"
3455
+ })
3456
+ );
3443
3457
  await kvStore.delete("demo-auth-logged-in-secret");
3444
3458
  }
3445
3459
  const clerkAuthSecret = await kvStore.get("jazz-clerk-auth");
3446
3460
  if (clerkAuthSecret) {
3447
- await kvStore.set(STORAGE_KEY, clerkAuthSecret);
3461
+ const parsed = JSON.parse(clerkAuthSecret);
3462
+ await kvStore.set(
3463
+ STORAGE_KEY,
3464
+ JSON.stringify({
3465
+ accountID: parsed.accountID,
3466
+ accountSecret: parsed.secret,
3467
+ provider: "clerk"
3468
+ })
3469
+ );
3448
3470
  await kvStore.delete("jazz-clerk-auth");
3449
3471
  }
3450
3472
  }
3473
+ const value = await kvStore.get(STORAGE_KEY);
3474
+ if (value) {
3475
+ const parsed = JSON.parse(value);
3476
+ if ("secret" in parsed) {
3477
+ await kvStore.set(
3478
+ STORAGE_KEY,
3479
+ JSON.stringify({
3480
+ accountID: parsed.accountID,
3481
+ secretSeed: parsed.secretSeed,
3482
+ accountSecret: parsed.secret,
3483
+ provider: parsed.provider
3484
+ })
3485
+ );
3486
+ }
3487
+ }
3451
3488
  }
3452
3489
  async get() {
3453
3490
  const kvStore = KvStoreContext_default.getInstance().getStorage();
@@ -3919,4 +3956,4 @@ export {
3919
3956
  consumeInviteLink
3920
3957
  };
3921
3958
  /* istanbul ignore file -- @preserve */
3922
- //# sourceMappingURL=chunk-XRX3CCYY.js.map
3959
+ //# sourceMappingURL=chunk-DPW23T6J.js.map