jazz-run 0.7.35 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,8 @@
1
1
 
2
- > jazz-run@0.7.34 build /Users/anselm/jazz/jazz/packages/jazz-run
2
+ > jazz-run@0.7.35-guest-auth.5 build /Users/anselm/jazz/jazz/packages/jazz-run
3
3
  > npm run lint && rm -rf ./dist && tsc --sourceMap --outDir dist
4
4
 
5
5
 
6
- > jazz-run@0.7.34 lint
6
+ > jazz-run@0.7.35-guest-auth.5 lint
7
7
  > eslint . --ext ts,tsx
8
8
 
@@ -0,0 +1,4 @@
1
+
2
+ > jazz-run@0.7.35-guest-auth.5 lint /Users/anselm/jazz/jazz/packages/jazz-run
3
+ > eslint . --ext ts,tsx
4
+
package/CHANGELOG.md CHANGED
@@ -1,4 +1,26 @@
1
- # jazz-autosub
1
+ # jazz-run
2
+
3
+ ## 0.8.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [6a147c2]
8
+ - Updated dependencies [ad40b88]
9
+ - Updated dependencies [23369dc]
10
+ - Updated dependencies [c2b62a0]
11
+ - Updated dependencies [1a979b6]
12
+ - Updated dependencies [bcec3be]
13
+ - cojson@0.8.0
14
+ - jazz-tools@0.8.0
15
+ - cojson-storage-sqlite@0.8.0
16
+ - cojson-transport-ws@0.8.0
17
+
18
+ ## 0.7.35-guest-auth.6
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+ - jazz-tools@0.7.35-guest-auth.6
2
24
 
3
25
  ## 0.7.35
4
26
 
package/dist/index.js CHANGED
@@ -5,7 +5,8 @@ import { NodeContext, NodeRuntime } from "@effect/platform-node";
5
5
  import { Console, Effect } from "effect";
6
6
  import { createWebSocketPeer } from "cojson-transport-ws";
7
7
  import { WebSocket } from "ws";
8
- import { Account, WasmCrypto, cojsonInternals, isControlledAccount, } from "jazz-tools";
8
+ import { Account, WasmCrypto, createJazzContext, isControlledAccount, } from "jazz-tools";
9
+ import { fixedCredentialsAuth, randomSessionProvider } from "jazz-tools/src/internal";
9
10
  import { startSync } from "./startSync.js";
10
11
  const jazzTools = Command.make("jazz-tools");
11
12
  const name = Options.text("name").pipe(Options.withAlias("n"));
@@ -37,12 +38,14 @@ const accountCreate = Command.make("create", { name, peer }, ({ name, peer: peer
37
38
  websocket: new WebSocket(peerAddr),
38
39
  role: "server",
39
40
  });
40
- yield* Effect.promise(async () => Account.become({
41
- accountID: account.id,
42
- accountSecret: account._raw.agentSecret,
43
- sessionID: cojsonInternals.newRandomSessionID(account.id),
41
+ yield* Effect.promise(async () => createJazzContext({
42
+ auth: fixedCredentialsAuth({
43
+ accountID: account.id,
44
+ secret: account._raw.agentSecret,
45
+ }),
46
+ sessionProvider: randomSessionProvider,
44
47
  peersToLoadFrom: [peer2],
45
- crypto,
48
+ crypto
46
49
  }));
47
50
  yield* Console.log(`# Credentials for Jazz account "${name}":
48
51
  JAZZ_WORKER_ACCOUNT=${account.id}
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,qBAAqB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,EACH,OAAO,EACP,UAAU,EACV,eAAe,EACf,mBAAmB,GACtB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAE7C,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,I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;AAEH,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CACxC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,EACjC,WAAW,CAAC,OAAO,CACtB,CAAC"}
package/dist/startSync.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /* istanbul ignore file -- @preserve */
2
2
  import { Command, Options } from "@effect/cli";
3
- import { ControlledAgent, LocalNode, WasmCrypto, cojsonInternals, } from "cojson";
3
+ import { ControlledAgent, LocalNode, WasmCrypto, } from "cojson";
4
4
  import { WebSocketServer } from "ws";
5
5
  import { createWebSocketPeer } from "cojson-transport-ws";
6
6
  import { Effect } from "effect";
@@ -22,7 +22,7 @@ export const startSync = Command.make("sync", { port, inMemory, db }, ({ port, i
22
22
  console.log("COJSON sync server listening on port " + wss.options.port);
23
23
  const agentSecret = crypto.newRandomAgentSecret();
24
24
  const agentID = crypto.getAgentID(agentSecret);
25
- const localNode = new LocalNode(new ControlledAgent(agentSecret, crypto), cojsonInternals.newRandomSessionID(agentID), crypto);
25
+ const localNode = new LocalNode(new ControlledAgent(agentSecret, crypto), crypto.newRandomSessionID(agentID), crypto);
26
26
  if (!inMemory) {
27
27
  yield* Effect.promise(() => mkdir(dirname(db), { recursive: true }));
28
28
  const storage = yield* Effect.promise(() => SQLiteStorage.asPeer({ filename: db }));
@@ -1 +1 @@
1
- {"version":3,"file":"startSync.js","sourceRoot":"","sources":["../src/startSync.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACH,eAAe,EACf,SAAS,EACT,UAAU,EACV,eAAe,GAClB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAErC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,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,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC;YAE7C,MAAM,QAAQ,GAAG,aAAa,GAAG,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YAEhE,SAAS,CAAC,WAAW,CAAC,OAAO,CACzB,mBAAmB,CAAC;gBAChB,EAAE,EAAE,QAAQ;gBACZ,IAAI,EAAE,QAAQ;gBACd,8DAA8D;gBAC9D,SAAS,EAAE,EAAS,EAAE,kBAAkB;gBACxC,WAAW,EAAE,KAAK;aACrB,CAAC,CACL,CAAC;YAEF,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CACjB,OAAO,CAAC,KAAK,CAAC,uBAAuB,QAAQ,GAAG,EAAE,CAAC,CAAC,CACvD,CAAC;QACN,CAAC,CAAC,CAAC;QAEH,qBAAqB;QACrB,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;IACxB,CAAC,CAAC,CAAC;AACP,CAAC,CACJ,CAAC"}
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.7.35",
6
+ "version": "0.8.0",
7
7
  "dependencies": {
8
8
  "@effect/cli": "^0.41.2",
9
9
  "@effect/platform-node": "^0.57.2",
@@ -11,12 +11,12 @@
11
11
  "@effect/printer-ansi": "^0.34.5",
12
12
  "@effect/schema": "^0.71.1",
13
13
  "@effect/typeclass": "^0.25.5",
14
+ "cojson": "0.8.0",
15
+ "cojson-storage-sqlite": "0.8.0",
16
+ "cojson-transport-ws": "0.8.0",
14
17
  "effect": "^3.6.5",
15
- "ws": "^8.14.2",
16
- "cojson": "0.7.35",
17
- "cojson-storage-sqlite": "0.7.35",
18
- "cojson-transport-ws": "0.7.35",
19
- "jazz-tools": "0.7.35"
18
+ "jazz-tools": "0.8.0",
19
+ "ws": "^8.14.2"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/ws": "^8.5.5",
package/src/index.ts CHANGED
@@ -8,10 +8,10 @@ import { WebSocket } from "ws";
8
8
  import {
9
9
  Account,
10
10
  WasmCrypto,
11
- cojsonInternals,
11
+ createJazzContext,
12
12
  isControlledAccount,
13
13
  } from "jazz-tools";
14
- import type { AccountID } from "cojson";
14
+ import { fixedCredentialsAuth, randomSessionProvider } from "jazz-tools/src/internal";
15
15
  import { startSync } from "./startSync.js";
16
16
 
17
17
  const jazzTools = Command.make("jazz-tools");
@@ -65,14 +65,14 @@ const accountCreate = Command.make(
65
65
  });
66
66
 
67
67
  yield* Effect.promise(async () =>
68
- Account.become({
69
- accountID: account.id,
70
- accountSecret: account._raw.agentSecret,
71
- sessionID: cojsonInternals.newRandomSessionID(
72
- account.id as unknown as AccountID,
73
- ),
68
+ createJazzContext({
69
+ auth: fixedCredentialsAuth({
70
+ accountID: account.id,
71
+ secret: account._raw.agentSecret,
72
+ }),
73
+ sessionProvider: randomSessionProvider,
74
74
  peersToLoadFrom: [peer2],
75
- crypto,
75
+ crypto
76
76
  }),
77
77
  );
78
78
 
package/src/startSync.ts CHANGED
@@ -4,7 +4,6 @@ import {
4
4
  ControlledAgent,
5
5
  LocalNode,
6
6
  WasmCrypto,
7
- cojsonInternals,
8
7
  } from "cojson";
9
8
  import { WebSocketServer } from "ws";
10
9
 
@@ -53,7 +52,7 @@ export const startSync = Command.make(
53
52
 
54
53
  const localNode = new LocalNode(
55
54
  new ControlledAgent(agentSecret, crypto),
56
- cojsonInternals.newRandomSessionID(agentID),
55
+ crypto.newRandomSessionID(agentID),
57
56
  crypto,
58
57
  );
59
58