jazz-run 0.8.44 → 0.8.45

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
1
 
2
- > jazz-run@0.8.44 build /home/runner/work/jazz/jazz/packages/jazz-run
2
+ > jazz-run@0.8.45 build /home/runner/work/jazz/jazz/packages/jazz-run
3
3
  > rm -rf ./dist && tsc --sourceMap --outDir dist && chmod +x ./dist/index.js
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # jazz-run
2
2
 
3
+ ## 0.8.45
4
+
5
+ ### Patch Changes
6
+
7
+ - 99e731d: Fix the --json option on the account create command
8
+ - Updated dependencies [6f0bd7f]
9
+ - Updated dependencies [fca6a0b]
10
+ - Updated dependencies [fa41f8e]
11
+ - Updated dependencies [88d7d9a]
12
+ - Updated dependencies [60e35ea]
13
+ - cojson@0.8.45
14
+ - jazz-tools@0.8.45
15
+ - cojson-storage-sqlite@0.8.45
16
+ - cojson-transport-ws@0.8.45
17
+
3
18
  ## 0.8.44
4
19
 
5
20
  ### Patch Changes
@@ -16,16 +16,9 @@ export const createWorkerAccount = async ({ name, peer: peerAddr, }) => {
16
16
  if (!isControlledAccount(account)) {
17
17
  throw new Error("account is not a controlled account");
18
18
  }
19
- const accountCoValue = account._raw.core;
20
- const accountProfileCoValue = account.profile._raw.core;
21
- const syncManager = account._raw.core.node.syncManager;
22
- await Promise.all([
23
- syncManager.syncCoValue(accountCoValue),
24
- syncManager.syncCoValue(accountProfileCoValue),
25
- ]);
26
19
  await account.waitForAllCoValuesSync({ timeout: 4000 });
27
20
  return {
28
- accountId: account.id,
21
+ accountID: account.id,
29
22
  agentSecret: account._raw.agentSecret,
30
23
  };
31
24
  };
@@ -1 +1 @@
1
- {"version":3,"file":"createWorkerAccount.js","sourceRoot":"","sources":["../src/createWorkerAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,mBAA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C,CAAC"}
1
+ {"version":3,"file":"createWorkerAccount.js","sourceRoot":"","sources":["../src/createWorkerAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE/B,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EAAE,EACxC,IAAI,EACJ,IAAI,EAAE,QAAQ,GAIf,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;IAEzC,MAAM,IAAI,GAAG,mBAAmB,CAAC;QAC/B,EAAE,EAAE,UAAU;QACd,SAAS,EAAE,IAAI,SAAS,CAAC,QAAQ,CAAC;QAClC,IAAI,EAAE,QAAQ;KACf,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC;QACnC,aAAa,EAAE,EAAE,IAAI,EAAE;QACvB,eAAe,EAAE,CAAC,IAAI,CAAC;QACvB,MAAM;KACP,CAAC,CAAC;IAEH,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,OAAO,CAAC,sBAAsB,CAAC,EAAE,OAAO,EAAE,IAAK,EAAE,CAAC,CAAC;IAEzD,OAAO;QACL,SAAS,EAAE,OAAO,CAAC,EAAE;QACrB,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;KACtC,CAAC;AACJ,CAAC,CAAC"}
package/dist/index.js CHANGED
@@ -13,13 +13,13 @@ const peerOption = Options.text("peer")
13
13
  .pipe(Options.withDefault("wss://cloud.jazz.tools"));
14
14
  const createAccountCommand = Command.make("create", { name: nameOption, peer: peerOption, json: jsonOption }, ({ name, peer, json }) => {
15
15
  return Effect.gen(function* () {
16
- const { accountId, agentSecret } = yield* Effect.promise(() => createWorkerAccount({ name, peer }));
16
+ const { accountID, agentSecret } = yield* Effect.promise(() => createWorkerAccount({ name, peer }));
17
17
  if (json) {
18
- Console.log(JSON.stringify({ accountId, agentSecret }));
18
+ yield* Console.log(JSON.stringify({ accountID, agentSecret }));
19
19
  }
20
20
  else {
21
21
  yield* Console.log(`# Credentials for Jazz account "${name}":
22
- JAZZ_WORKER_ACCOUNT=${accountId}
22
+ JAZZ_WORKER_ACCOUNT=${accountID}
23
23
  JAZZ_WORKER_SECRET=${agentSecret}
24
24
  `);
25
25
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAE7C,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AACrE,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3C,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;KACpC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;KAC5B,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,wBAAwB,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E,QAAQ,EAAE,EAC5D,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE;IACzB,OAAO,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACzB,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QAErE,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAChB,kDAAkD,IAAI,EAAE,CACzD,CAAC;QAEF,qBAAqB;QACrB,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC,CACF,CAAC;AAEF,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAC5B,OAAO,CAAC,eAAe,CAAC,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAAC,CAClE,CAAC;AAEF,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE;IAC/B,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,SAAS;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAC1C,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,EACjC,WAAW,CAAC,OAAO,CACpB,CAAC"}
@@ -20,11 +20,11 @@ describe("createWorkerAccount - integration tests", () => {
20
20
  if (typeof address !== "object" || address === null) {
21
21
  throw new Error("Server address is not an object");
22
22
  }
23
- const { accountId, agentSecret } = await createWorkerAccount({
23
+ const { accountID, agentSecret } = await createWorkerAccount({
24
24
  name: "test",
25
25
  peer: `ws://localhost:${address.port}`,
26
26
  });
27
- expect(accountId).toBeDefined();
27
+ expect(accountID).toBeDefined();
28
28
  expect(agentSecret).toBeDefined();
29
29
  const peer = createWebSocketPeer({
30
30
  id: "upstream",
@@ -37,14 +37,14 @@ describe("createWorkerAccount - integration tests", () => {
37
37
  peersToLoadFrom: [peer],
38
38
  crypto,
39
39
  });
40
- expect(await node.load(accountId)).not.toBe("unavailable");
40
+ expect(await node.load(accountID)).not.toBe("unavailable");
41
41
  });
42
42
  it("should create a worker account using the Jazz cloud", async () => {
43
- const { accountId, agentSecret } = await createWorkerAccount({
43
+ const { accountID, agentSecret } = await createWorkerAccount({
44
44
  name: "test",
45
45
  peer: `wss://cloud.jazz.tools`,
46
46
  });
47
- expect(accountId).toBeDefined();
47
+ expect(accountID).toBeDefined();
48
48
  expect(agentSecret).toBeDefined();
49
49
  const peer = createWebSocketPeer({
50
50
  id: "upstream",
@@ -57,7 +57,7 @@ describe("createWorkerAccount - integration tests", () => {
57
57
  peersToLoadFrom: [peer],
58
58
  crypto,
59
59
  });
60
- expect(await node.load(accountId)).not.toBe("unavailable");
60
+ expect(await node.load(accountID)).not.toBe("unavailable");
61
61
  });
62
62
  });
63
63
  //# sourceMappingURL=createWorkerAccount.test.js.map
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "bin": "./dist/index.js",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
- "version": "0.8.44",
6
+ "version": "0.8.45",
7
7
  "exports": {
8
8
  "./startSyncServer": {
9
9
  "import": "./dist/startSyncServer.js",
@@ -21,11 +21,11 @@
21
21
  "@effect/printer-ansi": "^0.34.5",
22
22
  "@effect/schema": "^0.71.1",
23
23
  "@effect/typeclass": "^0.25.5",
24
- "cojson": "0.8.44",
25
- "cojson-storage-sqlite": "0.8.44",
26
- "cojson-transport-ws": "0.8.44",
24
+ "cojson": "0.8.45",
25
+ "cojson-storage-sqlite": "0.8.45",
26
+ "cojson-transport-ws": "0.8.45",
27
27
  "effect": "^3.6.5",
28
- "jazz-tools": "0.8.44",
28
+ "jazz-tools": "0.8.45",
29
29
  "ws": "^8.14.2"
30
30
  },
31
31
  "devDependencies": {
@@ -27,19 +27,10 @@ export const createWorkerAccount = async ({
27
27
  throw new Error("account is not a controlled account");
28
28
  }
29
29
 
30
- const accountCoValue = account._raw.core;
31
- const accountProfileCoValue = account.profile!._raw.core;
32
- const syncManager = account._raw.core.node.syncManager;
33
-
34
- await Promise.all([
35
- syncManager.syncCoValue(accountCoValue),
36
- syncManager.syncCoValue(accountProfileCoValue),
37
- ]);
38
-
39
30
  await account.waitForAllCoValuesSync({ timeout: 4_000 });
40
31
 
41
32
  return {
42
- accountId: account.id,
33
+ accountID: account.id,
43
34
  agentSecret: account._raw.agentSecret,
44
35
  };
45
36
  };
package/src/index.ts CHANGED
@@ -19,15 +19,15 @@ const createAccountCommand = Command.make(
19
19
  { name: nameOption, peer: peerOption, json: jsonOption },
20
20
  ({ name, peer, json }) => {
21
21
  return Effect.gen(function* () {
22
- const { accountId, agentSecret } = yield* Effect.promise(() =>
22
+ const { accountID, agentSecret } = yield* Effect.promise(() =>
23
23
  createWorkerAccount({ name, peer }),
24
24
  );
25
25
 
26
26
  if (json) {
27
- Console.log(JSON.stringify({ accountId, agentSecret }));
27
+ yield* Console.log(JSON.stringify({ accountID, agentSecret }));
28
28
  } else {
29
29
  yield* Console.log(`# Credentials for Jazz account "${name}":
30
- JAZZ_WORKER_ACCOUNT=${accountId}
30
+ JAZZ_WORKER_ACCOUNT=${accountID}
31
31
  JAZZ_WORKER_SECRET=${agentSecret}
32
32
  `);
33
33
  }
@@ -25,12 +25,12 @@ describe("createWorkerAccount - integration tests", () => {
25
25
  throw new Error("Server address is not an object");
26
26
  }
27
27
 
28
- const { accountId, agentSecret } = await createWorkerAccount({
28
+ const { accountID, agentSecret } = await createWorkerAccount({
29
29
  name: "test",
30
30
  peer: `ws://localhost:${address.port}`,
31
31
  });
32
32
 
33
- expect(accountId).toBeDefined();
33
+ expect(accountID).toBeDefined();
34
34
  expect(agentSecret).toBeDefined();
35
35
 
36
36
  const peer = createWebSocketPeer({
@@ -46,16 +46,16 @@ describe("createWorkerAccount - integration tests", () => {
46
46
  crypto,
47
47
  });
48
48
 
49
- expect(await node.load(accountId as any)).not.toBe("unavailable");
49
+ expect(await node.load(accountID as any)).not.toBe("unavailable");
50
50
  });
51
51
 
52
52
  it("should create a worker account using the Jazz cloud", async () => {
53
- const { accountId, agentSecret } = await createWorkerAccount({
53
+ const { accountID, agentSecret } = await createWorkerAccount({
54
54
  name: "test",
55
55
  peer: `wss://cloud.jazz.tools`,
56
56
  });
57
57
 
58
- expect(accountId).toBeDefined();
58
+ expect(accountID).toBeDefined();
59
59
  expect(agentSecret).toBeDefined();
60
60
 
61
61
  const peer = createWebSocketPeer({
@@ -71,6 +71,6 @@ describe("createWorkerAccount - integration tests", () => {
71
71
  crypto,
72
72
  });
73
73
 
74
- expect(await node.load(accountId as any)).not.toBe("unavailable");
74
+ expect(await node.load(accountID as any)).not.toBe("unavailable");
75
75
  });
76
76
  });