jazz-run 0.7.34 → 0.7.35-new-auth.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-neverthrow.7 build /Users/anselm/jazz/jazz/packages/jazz-run
2
+ > jazz-run@0.7.35-new-auth.0 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-neverthrow.7 lint
6
+ > jazz-run@0.7.35-new-auth.0 lint
7
7
  > eslint . --ext ts,tsx
8
8
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # jazz-autosub
2
2
 
3
+ ## 0.7.35-new-auth.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - jazz-tools@0.7.35-new-auth.0
9
+
3
10
  ## 0.7.34
4
11
 
5
12
  ### Patch Changes
package/dist/index.js CHANGED
@@ -4,7 +4,8 @@ import { NodeContext, NodeRuntime } from "@effect/platform-node";
4
4
  import { Console, Effect } from "effect";
5
5
  import { createWebSocketPeer } from "cojson-transport-ws";
6
6
  import { WebSocket } from "ws";
7
- import { Account, WasmCrypto, cojsonInternals, isControlledAccount, } from "jazz-tools";
7
+ import { Account, WasmCrypto, createJazzContext, isControlledAccount, } from "jazz-tools";
8
+ import { fixedCredentialsAuth, randomSessionProvider } from "jazz-tools/src/internal";
8
9
  const jazzTools = Command.make("jazz-tools");
9
10
  const name = Options.text("name").pipe(Options.withAlias("n"));
10
11
  const peer = Options.text("peer")
@@ -35,12 +36,14 @@ const accountCreate = Command.make("create", { name, peer }, ({ name, peer: peer
35
36
  websocket: new WebSocket(peerAddr),
36
37
  role: "server",
37
38
  });
38
- yield* Effect.promise(async () => Account.become({
39
- accountID: account.id,
40
- accountSecret: account._raw.agentSecret,
41
- sessionID: cojsonInternals.newRandomSessionID(account.id),
39
+ yield* Effect.promise(async () => createJazzContext({
40
+ auth: fixedCredentialsAuth({
41
+ accountID: account.id,
42
+ secret: account._raw.agentSecret,
43
+ }),
44
+ sessionProvider: randomSessionProvider,
42
45
  peersToLoadFrom: [peer2],
43
- crypto,
46
+ crypto
44
47
  }));
45
48
  yield* Console.log(`# Credentials for Jazz account "${name}":
46
49
  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,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;AAGpB,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAE7C,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;KAC5B,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;KAC5B,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC,CAAC;AACxD,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAC9B,QAAQ,EACR,EAAE,IAAI,EAAE,IAAI,EAAE,EACd,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IACzB,OAAO,MAAM,CAAC,GAAG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AAC;YACF,eAAe,EAAE,qBAAqB;YACtC,eAAe,EAAE,CAAC,KAAK,CAAC;YACxB,MAAM;SACT,CAAC,CACL,CAAC;QAEF,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,mCAAmC,IAAI;sBAChD,OAAO,CAAC,EAAE;qBACX,OAAO,CAAC,IAAI,CAAC,WAAW;CAC5C,CAAC,CAAC;IACK,CAAC,CAAC,CAAC;AACP,CAAC,CACJ,CAAC;AAEF,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAE5C,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AAE3E,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAEnE,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE;IAC7B,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,QAAQ;CACpB,CAAC,CAAC;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/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.34",
6
+ "version": "0.7.35-new-auth.0",
7
7
  "dependencies": {
8
8
  "effect": "^3.6.5",
9
9
  "@effect/cli": "^0.41.2",
@@ -14,8 +14,8 @@
14
14
  "@effect/typeclass": "^0.25.5",
15
15
  "ws": "^8.14.2",
16
16
  "cojson": "0.7.34",
17
- "cojson-transport-ws": "0.7.34",
18
- "jazz-tools": "0.7.34"
17
+ "jazz-tools": "0.7.35-new-auth.0",
18
+ "cojson-transport-ws": "0.7.34"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/ws": "^8.5.5",
package/src/index.ts CHANGED
@@ -7,10 +7,10 @@ import { WebSocket } from "ws";
7
7
  import {
8
8
  Account,
9
9
  WasmCrypto,
10
- cojsonInternals,
10
+ createJazzContext,
11
11
  isControlledAccount,
12
12
  } from "jazz-tools";
13
- import type { AccountID } from "cojson";
13
+ import { fixedCredentialsAuth, randomSessionProvider } from "jazz-tools/src/internal";
14
14
 
15
15
  const jazzTools = Command.make("jazz-tools");
16
16
 
@@ -63,14 +63,14 @@ const accountCreate = Command.make(
63
63
  });
64
64
 
65
65
  yield* Effect.promise(async () =>
66
- Account.become({
67
- accountID: account.id,
68
- accountSecret: account._raw.agentSecret,
69
- sessionID: cojsonInternals.newRandomSessionID(
70
- account.id as unknown as AccountID,
71
- ),
66
+ createJazzContext({
67
+ auth: fixedCredentialsAuth({
68
+ accountID: account.id,
69
+ secret: account._raw.agentSecret,
70
+ }),
71
+ sessionProvider: randomSessionProvider,
72
72
  peersToLoadFrom: [peer2],
73
- crypto,
73
+ crypto
74
74
  }),
75
75
  );
76
76