effect 4.0.0-beta.44 → 4.0.0-beta.46
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/Equal.d.ts.map +1 -1
- package/dist/Equal.js +16 -0
- package/dist/Equal.js.map +1 -1
- package/dist/Hash.js +1 -1
- package/dist/Hash.js.map +1 -1
- package/dist/Semaphore.d.ts +1 -1
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +1 -3
- package/dist/Semaphore.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +24 -21
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +0 -6
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js +0 -5
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +0 -2
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +0 -2
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +22 -5
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +126 -67
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +88 -34
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +215 -141
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +9 -7
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +13 -15
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +228 -0
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -0
- package/dist/unstable/eventlog/EventLogMessage.js +214 -0
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -0
- package/dist/unstable/eventlog/EventLogRemote.d.ts +109 -194
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +165 -320
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +25 -47
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +127 -198
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +60 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +166 -0
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +183 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +461 -0
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -0
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +117 -0
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -0
- package/dist/unstable/eventlog/EventLogSessionAuth.js +284 -0
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -0
- package/dist/unstable/eventlog/{SqlEventLogJournal.d.ts → SqlEventJournal.d.ts} +2 -2
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -0
- package/dist/unstable/eventlog/{SqlEventLogJournal.js → SqlEventJournal.js} +20 -14
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -0
- package/dist/unstable/eventlog/{SqlEventLogServer.d.ts → SqlEventLogServerEncrypted.d.ts} +5 -5
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -0
- package/dist/unstable/eventlog/{SqlEventLogServer.js → SqlEventLogServerEncrypted.js} +65 -24
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +25 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +354 -0
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -0
- package/dist/unstable/eventlog/index.d.ts +22 -2
- package/dist/unstable/eventlog/index.d.ts.map +1 -1
- package/dist/unstable/eventlog/index.js +22 -2
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.d.ts +2 -0
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.d.ts.map +1 -0
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js +89 -0
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js.map +1 -0
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +1 -2
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +2 -2
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +1 -2
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +3 -3
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +25 -4
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +26 -0
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +3 -13
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +47 -23
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +2 -2
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +3 -2
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts +6 -0
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +44 -0
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +2 -2
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +2 -4
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +1 -12
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +1 -1
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +1 -1
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/package.json +1 -1
- package/src/Equal.ts +17 -0
- package/src/Hash.ts +2 -2
- package/src/Semaphore.ts +2 -4
- package/src/unstable/ai/McpServer.ts +24 -22
- package/src/unstable/eventlog/Event.ts +0 -8
- package/src/unstable/eventlog/EventGroup.ts +0 -4
- package/src/unstable/eventlog/EventJournal.ts +144 -76
- package/src/unstable/eventlog/EventLog.ts +342 -221
- package/src/unstable/eventlog/EventLogEncryption.ts +16 -30
- package/src/unstable/eventlog/EventLogMessage.ts +277 -0
- package/src/unstable/eventlog/EventLogRemote.ts +261 -408
- package/src/unstable/eventlog/EventLogServer.ts +182 -274
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +206 -0
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +749 -0
- package/src/unstable/eventlog/EventLogSessionAuth.ts +437 -0
- package/src/unstable/eventlog/{SqlEventLogJournal.ts → SqlEventJournal.ts} +26 -18
- package/src/unstable/eventlog/{SqlEventLogServer.ts → SqlEventLogServerEncrypted.ts} +102 -40
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +500 -0
- package/src/unstable/eventlog/index.ts +27 -2
- package/src/unstable/eventlog/internal/identityRootSecretDerivation.ts +153 -0
- package/src/unstable/reactivity/AtomHttpApi.ts +23 -8
- package/src/unstable/reactivity/AtomRpc.ts +16 -5
- package/src/unstable/rpc/Rpc.ts +42 -4
- package/src/unstable/rpc/RpcClient.ts +59 -24
- package/src/unstable/rpc/RpcGroup.ts +1 -1
- package/src/unstable/rpc/RpcMiddleware.ts +2 -2
- package/src/unstable/rpc/RpcServer.ts +5 -3
- package/src/unstable/rpc/Utils.ts +59 -0
- package/src/unstable/schema/Model.ts +4 -6
- package/src/unstable/schema/VariantSchema.ts +4 -17
- package/src/unstable/workers/Transferable.ts +9 -11
- package/dist/unstable/eventlog/SqlEventLogJournal.d.ts.map +0 -1
- package/dist/unstable/eventlog/SqlEventLogJournal.js.map +0 -1
- package/dist/unstable/eventlog/SqlEventLogServer.d.ts.map +0 -1
- package/dist/unstable/eventlog/SqlEventLogServer.js.map +0 -1
|
@@ -6,14 +6,16 @@ import * as Effect from "../../Effect.js";
|
|
|
6
6
|
import * as Layer from "../../Layer.js";
|
|
7
7
|
import * as Redacted from "../../Redacted.js";
|
|
8
8
|
import * as Schema from "../../Schema.js";
|
|
9
|
+
import * as Transferable from "../workers/Transferable.js";
|
|
9
10
|
import { Entry, EntryId, RemoteEntry } from "./EventJournal.js";
|
|
11
|
+
import { makeGetIdentityRootSecretMaterial } from "./internal/identityRootSecretDerivation.js";
|
|
10
12
|
/**
|
|
11
13
|
* @since 4.0.0
|
|
12
14
|
* @category models
|
|
13
15
|
*/
|
|
14
16
|
export const EncryptedEntry = /*#__PURE__*/Schema.Struct({
|
|
15
17
|
entryId: EntryId,
|
|
16
|
-
encryptedEntry:
|
|
18
|
+
encryptedEntry: Transferable.Uint8Array
|
|
17
19
|
});
|
|
18
20
|
/**
|
|
19
21
|
* @since 4.0.0
|
|
@@ -21,9 +23,9 @@ export const EncryptedEntry = /*#__PURE__*/Schema.Struct({
|
|
|
21
23
|
*/
|
|
22
24
|
export const EncryptedRemoteEntry = /*#__PURE__*/Schema.Struct({
|
|
23
25
|
sequence: Schema.Number,
|
|
24
|
-
iv:
|
|
26
|
+
iv: Transferable.Uint8Array,
|
|
25
27
|
entryId: EntryId,
|
|
26
|
-
encryptedEntry:
|
|
28
|
+
encryptedEntry: Transferable.Uint8Array
|
|
27
29
|
});
|
|
28
30
|
const toArrayBuffer = data => {
|
|
29
31
|
const buffer = new ArrayBuffer(data.byteLength);
|
|
@@ -41,19 +43,11 @@ export class EventLogEncryption extends /*#__PURE__*/Context.Service()("effect/e
|
|
|
41
43
|
* @category encryption
|
|
42
44
|
*/
|
|
43
45
|
export const makeEncryptionSubtle = crypto => Effect.sync(() => {
|
|
44
|
-
const
|
|
45
|
-
const getKey = identity => Effect.suspend(() => {
|
|
46
|
-
if (keyCache.has(identity)) {
|
|
47
|
-
return Effect.succeed(keyCache.get(identity));
|
|
48
|
-
}
|
|
49
|
-
return Effect.promise(() => crypto.subtle.importKey("raw", toArrayBuffer(Redacted.value(identity.privateKey)), "AES-GCM", true, ["encrypt", "decrypt"])).pipe(Effect.tap(key => Effect.sync(() => {
|
|
50
|
-
keyCache.set(identity, key);
|
|
51
|
-
})));
|
|
52
|
-
});
|
|
46
|
+
const getIdentityRootSecretMaterial = makeGetIdentityRootSecretMaterial(crypto);
|
|
53
47
|
return EventLogEncryption.of({
|
|
54
48
|
encrypt: Effect.fnUntraced(function* (identity, entries) {
|
|
55
49
|
const data = yield* Effect.orDie(Entry.encodeArray(entries));
|
|
56
|
-
const key = yield*
|
|
50
|
+
const key = (yield* getIdentityRootSecretMaterial(identity)).encryptionKey;
|
|
57
51
|
const iv = crypto.getRandomValues(new Uint8Array(12));
|
|
58
52
|
const encryptedEntries = yield* Effect.promise(() => Promise.all(data.map(entry => crypto.subtle.encrypt({
|
|
59
53
|
name: "AES-GCM",
|
|
@@ -66,7 +60,7 @@ export const makeEncryptionSubtle = crypto => Effect.sync(() => {
|
|
|
66
60
|
};
|
|
67
61
|
}),
|
|
68
62
|
decrypt: Effect.fnUntraced(function* (identity, entries) {
|
|
69
|
-
const key = yield*
|
|
63
|
+
const key = (yield* getIdentityRootSecretMaterial(identity)).encryptionKey;
|
|
70
64
|
const decryptedData = (yield* Effect.promise(() => Promise.all(entries.map(data => crypto.subtle.decrypt({
|
|
71
65
|
name: "AES-GCM",
|
|
72
66
|
iv: toBufferSource(data.iv),
|
|
@@ -83,7 +77,11 @@ export const makeEncryptionSubtle = crypto => Effect.sync(() => {
|
|
|
83
77
|
const hashArray = Array.from(new Uint8Array(hash));
|
|
84
78
|
const hashHex = hashArray.map(bytes => bytes.toString(16).padStart(2, "0")).join("");
|
|
85
79
|
return hashHex;
|
|
86
|
-
})
|
|
80
|
+
}),
|
|
81
|
+
generateIdentity: Effect.sync(() => ({
|
|
82
|
+
publicKey: crypto.randomUUID(),
|
|
83
|
+
privateKey: Redacted.make(crypto.getRandomValues(new Uint8Array(32)))
|
|
84
|
+
}))
|
|
87
85
|
});
|
|
88
86
|
});
|
|
89
87
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventLogEncryption.js","names":["Context","Effect","Layer","Redacted","Schema","Entry","EntryId","RemoteEntry","EncryptedEntry","Struct","entryId","encryptedEntry","Uint8Array","EncryptedRemoteEntry","sequence","Number","iv","toArrayBuffer","data","buffer","ArrayBuffer","byteLength","set","toBufferSource","EventLogEncryption","Service","makeEncryptionSubtle","crypto","sync","
|
|
1
|
+
{"version":3,"file":"EventLogEncryption.js","names":["Context","Effect","Layer","Redacted","Schema","Transferable","Entry","EntryId","RemoteEntry","makeGetIdentityRootSecretMaterial","EncryptedEntry","Struct","entryId","encryptedEntry","Uint8Array","EncryptedRemoteEntry","sequence","Number","iv","toArrayBuffer","data","buffer","ArrayBuffer","byteLength","set","toBufferSource","EventLogEncryption","Service","makeEncryptionSubtle","crypto","sync","getIdentityRootSecretMaterial","of","encrypt","fnUntraced","identity","entries","orDie","encodeArray","key","encryptionKey","getRandomValues","encryptedEntries","promise","Promise","all","map","entry","subtle","name","tagLength","decrypt","decryptedData","decoded","decodeArray","index","remoteSequence","sha256","digest","pipe","hash","sha256String","hashArray","Array","from","hashHex","bytes","toString","padStart","join","generateIdentity","publicKey","randomUUID","privateKey","make","layerSubtle","effect","globalThis"],"sources":["../../../src/unstable/eventlog/EventLogEncryption.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,OAAO,MAAM,kBAAkB;AAC3C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,KAAK,MAAM,gBAAgB;AACvC,OAAO,KAAKC,QAAQ,MAAM,mBAAmB;AAC7C,OAAO,KAAKC,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,YAAY,MAAM,4BAA4B;AAC1D,SAASC,KAAK,EAAEC,OAAO,EAAEC,WAAW,QAAQ,mBAAmB;AAE/D,SAASC,iCAAiC,QAAQ,4CAA4C;AAE9F;;;;AAIA,OAAO,MAAMC,cAAc,gBAAGN,MAAM,CAACO,MAAM,CAAC;EAC1CC,OAAO,EAAEL,OAAO;EAChBM,cAAc,EAAER,YAAY,CAACS;CAC9B,CAAC;AAQF;;;;AAIA,OAAO,MAAMC,oBAAoB,gBAAGX,MAAM,CAACO,MAAM,CAAC;EAChDK,QAAQ,EAAEZ,MAAM,CAACa,MAAM;EACvBC,EAAE,EAAEb,YAAY,CAACS,UAAU;EAC3BF,OAAO,EAAEL,OAAO;EAChBM,cAAc,EAAER,YAAY,CAACS;CAC9B,CAAC;AAEF,MAAMK,aAAa,GAAIC,IAAgB,IAAiB;EACtD,M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AAM,CAAC6C,GAAG,CAAEc,IAAI,IAAK,IAAI9C,UAAU,CAAC8C,IAAI,CAAC,CAAC,CAC3C;IACHC,YAAY,EAAGzC,IAAI,IACjBnB,MAAM,CAAC6C,GAAG,CACR7C,MAAM,CAAC0C,OAAO,CAAC,MAAMd,MAAM,CAACmB,MAAM,CAACU,MAAM,CAAC,SAAS,EAAEvC,aAAa,CAACC,IAAI,CAAC,CAAC,CAAC,EACzEwC,IAAI,IAAI;MACP,MAAME,SAAS,GAAGC,KAAK,CAACC,IAAI,CAAC,IAAIlD,UAAU,CAAC8C,IAAI,CAAC,CAAC;MAClD,MAAMK,OAAO,GAAGH,SAAS,CACtBhB,GAAG,CAAEoB,KAAK,IAAKA,KAAK,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CACnDC,IAAI,CAAC,EAAE,CAAC;MACX,OAAOJ,OAAO;IAChB,CAAC,CACF;IACHK,gBAAgB,EAAErE,MAAM,CAAC6B,IAAI,CAAC,OAAO;MACnCyC,SAAS,EAAE1C,MAAM,CAAC2C,UAAU,EAAE;MAC9BC,UAAU,EAAEtE,QAAQ,CAACuE,IAAI,CAAC7C,MAAM,CAACY,eAAe,CAAC,IAAI3B,UAAU,CAAC,EAAE,CAAC,CAAC;KACrE,CAAC;GACH,CAAC;AACJ,CAAC,CAAC;AAEJ;;;;AAIA,OAAO,MAAM6D,WAAW,gBAAoCzE,KAAK,CAAC0E,MAAM,CACtElD,kBAAkB,eAClBE,oBAAoB,CAACiD,UAAU,CAAChD,MAAM,CAAC,CACxC","ignoreList":[]}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 4.0.0
|
|
3
|
+
*/
|
|
4
|
+
import type { NonEmptyReadonlyArray } from "../../Array.ts";
|
|
5
|
+
import type { Brand } from "../../Brand.ts";
|
|
6
|
+
import * as Schema from "../../Schema.ts";
|
|
7
|
+
import * as Msgpack from "../encoding/Msgpack.ts";
|
|
8
|
+
import * as Rpc from "../rpc/Rpc.ts";
|
|
9
|
+
import * as RpcGroup from "../rpc/RpcGroup.ts";
|
|
10
|
+
import * as RpcMiddleware from "../rpc/RpcMiddleware.ts";
|
|
11
|
+
import * as Transferable from "../workers/Transferable.ts";
|
|
12
|
+
import { Entry, RemoteEntry } from "./EventJournal.ts";
|
|
13
|
+
import type { Identity } from "./EventLog.ts";
|
|
14
|
+
/**
|
|
15
|
+
* @since 4.0.0
|
|
16
|
+
* @category StoreId
|
|
17
|
+
*/
|
|
18
|
+
export type StoreIdTypeId = "effect/eventlog/EventLog/StoreId";
|
|
19
|
+
/**
|
|
20
|
+
* @since 4.0.0
|
|
21
|
+
* @category StoreId
|
|
22
|
+
*/
|
|
23
|
+
export declare const StoreIdTypeId: StoreIdTypeId;
|
|
24
|
+
/**
|
|
25
|
+
* @since 4.0.0
|
|
26
|
+
* @category StoreId
|
|
27
|
+
*/
|
|
28
|
+
export type StoreId = string & Brand<StoreIdTypeId>;
|
|
29
|
+
/**
|
|
30
|
+
* @since 4.0.0
|
|
31
|
+
* @category StoreId
|
|
32
|
+
*/
|
|
33
|
+
export declare const StoreId: Schema.brand<Schema.String, "effect/eventlog/EventLog/StoreId">;
|
|
34
|
+
declare const EventLogProtocolError_base: Schema.Class<EventLogProtocolError, Schema.TaggedStruct<"EventLogProtocolError", {
|
|
35
|
+
readonly requestTag: Schema.String;
|
|
36
|
+
readonly publicKey: Schema.optional<Schema.String>;
|
|
37
|
+
readonly storeId: Schema.optional<Schema.brand<Schema.String, "effect/eventlog/EventLog/StoreId">>;
|
|
38
|
+
readonly code: Schema.Literals<readonly ["Unauthorized", "Forbidden", "NotFound", "InvalidRequest", "InternalServerError"]>;
|
|
39
|
+
readonly message: Schema.String;
|
|
40
|
+
}>, import("../../Cause.ts").YieldableError>;
|
|
41
|
+
/**
|
|
42
|
+
* @since 4.0.0
|
|
43
|
+
* @category protocol
|
|
44
|
+
*/
|
|
45
|
+
export declare class EventLogProtocolError extends EventLogProtocolError_base {
|
|
46
|
+
}
|
|
47
|
+
declare const EventLogAuthentication_base: RpcMiddleware.ServiceClass<EventLogAuthentication, "effect/eventlog/EventLogMessage/EventLogAuthentication", Identity, typeof EventLogProtocolError, never, never, false>;
|
|
48
|
+
/**
|
|
49
|
+
* @since 4.0.0
|
|
50
|
+
* @category Middleware
|
|
51
|
+
*/
|
|
52
|
+
export declare class EventLogAuthentication extends EventLogAuthentication_base {
|
|
53
|
+
}
|
|
54
|
+
declare const HelloResponse_base: Schema.Class<HelloResponse, Schema.Struct<{
|
|
55
|
+
readonly remoteId: Schema.brand<Schema.Uint8Array, "effect/eventlog/EventJournal/RemoteId">;
|
|
56
|
+
readonly challenge: Transferable.Transferable<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
57
|
+
}>, {}>;
|
|
58
|
+
/**
|
|
59
|
+
* @since 4.0.0
|
|
60
|
+
* @category protocol
|
|
61
|
+
*/
|
|
62
|
+
export declare class HelloResponse extends HelloResponse_base {
|
|
63
|
+
}
|
|
64
|
+
declare const HelloRpc_base: Rpc.Rpc<"EventLog.Hello", Schema.Void, typeof HelloResponse, Schema.Never, never, never>;
|
|
65
|
+
/**
|
|
66
|
+
* @since 4.0.0
|
|
67
|
+
* @category protocol
|
|
68
|
+
*/
|
|
69
|
+
export declare class HelloRpc extends HelloRpc_base {
|
|
70
|
+
}
|
|
71
|
+
declare const Authenticate_base: Schema.Class<Authenticate, Schema.Struct<{
|
|
72
|
+
readonly publicKey: Schema.String;
|
|
73
|
+
readonly signingPublicKey: Transferable.Transferable<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
74
|
+
readonly signature: Transferable.Transferable<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
75
|
+
readonly algorithm: Schema.Literal<"Ed25519">;
|
|
76
|
+
}>, {}>;
|
|
77
|
+
/**
|
|
78
|
+
* @since 4.0.0
|
|
79
|
+
* @category protocol
|
|
80
|
+
*/
|
|
81
|
+
export declare class Authenticate extends Authenticate_base {
|
|
82
|
+
}
|
|
83
|
+
declare const AuthenticateRpc_base: Rpc.Rpc<"EventLog.Authenticate", typeof Authenticate, Schema.Void, typeof EventLogProtocolError, never, never>;
|
|
84
|
+
/**
|
|
85
|
+
* @since 4.0.0
|
|
86
|
+
* @category protocol
|
|
87
|
+
*/
|
|
88
|
+
export declare class AuthenticateRpc extends AuthenticateRpc_base {
|
|
89
|
+
}
|
|
90
|
+
declare const SingleMessage_base: Schema.Class<SingleMessage, Schema.TaggedStruct<"Single", {
|
|
91
|
+
readonly data: Transferable.Transferable<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
92
|
+
}>, {}>;
|
|
93
|
+
/**
|
|
94
|
+
* @since 4.0.0
|
|
95
|
+
* @category protocol
|
|
96
|
+
*/
|
|
97
|
+
export declare class SingleMessage extends SingleMessage_base {
|
|
98
|
+
}
|
|
99
|
+
declare const ChunkedMessage_base: Schema.Class<ChunkedMessage, Schema.TaggedStruct<"Chunked", {
|
|
100
|
+
readonly id: Schema.Number;
|
|
101
|
+
readonly part: Schema.Tuple<readonly [Schema.Number, Schema.Number]>;
|
|
102
|
+
readonly data: Transferable.Transferable<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
103
|
+
}>, {}>;
|
|
104
|
+
/**
|
|
105
|
+
* @since 4.0.0
|
|
106
|
+
* @category protocol
|
|
107
|
+
*/
|
|
108
|
+
export declare class ChunkedMessage extends ChunkedMessage_base {
|
|
109
|
+
static chunkSize: number;
|
|
110
|
+
static initialJoinState(): Map<number, {
|
|
111
|
+
readonly parts: Array<Uint8Array>;
|
|
112
|
+
count: number;
|
|
113
|
+
bytes: number;
|
|
114
|
+
}>;
|
|
115
|
+
/**
|
|
116
|
+
* @since 4.0.0
|
|
117
|
+
*/
|
|
118
|
+
static split(id: number, data: Uint8Array): NonEmptyReadonlyArray<ChunkedMessage>;
|
|
119
|
+
/**
|
|
120
|
+
* @since 4.0.0
|
|
121
|
+
*/
|
|
122
|
+
static join(map: Map<number, {
|
|
123
|
+
readonly parts: Array<Uint8Array>;
|
|
124
|
+
count: number;
|
|
125
|
+
bytes: number;
|
|
126
|
+
}>, part: ChunkedMessage): Uint8Array<ArrayBuffer> | undefined;
|
|
127
|
+
}
|
|
128
|
+
declare const WriteChunkedRpc_base: Rpc.Rpc<"EventLog.WriteChunked", typeof ChunkedMessage, Schema.Void, typeof EventLogProtocolError, typeof EventLogAuthentication, never>;
|
|
129
|
+
/**
|
|
130
|
+
* @since 4.0.0
|
|
131
|
+
* @category protocol
|
|
132
|
+
*/
|
|
133
|
+
export declare class WriteChunkedRpc extends WriteChunkedRpc_base {
|
|
134
|
+
}
|
|
135
|
+
declare const WriteEntries_base: Schema.Class<WriteEntries, Schema.Struct<{
|
|
136
|
+
readonly publicKey: Schema.String;
|
|
137
|
+
readonly storeId: Schema.brand<Schema.String, "effect/eventlog/EventLog/StoreId">;
|
|
138
|
+
readonly iv: Transferable.Transferable<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
139
|
+
readonly encryptedEntries: Schema.$Array<Schema.Struct<{
|
|
140
|
+
readonly entryId: Schema.brand<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, "effect/eventlog/EventJournal/EntryId">;
|
|
141
|
+
readonly encryptedEntry: Transferable.Transferable<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
142
|
+
}>>;
|
|
143
|
+
}>, {}>;
|
|
144
|
+
/**
|
|
145
|
+
* @since 4.0.0
|
|
146
|
+
* @category protocol
|
|
147
|
+
*/
|
|
148
|
+
export declare class WriteEntries extends WriteEntries_base {
|
|
149
|
+
static FromMsgpack: Msgpack.schema<typeof WriteEntries>;
|
|
150
|
+
static encode: (input: WriteEntries, options?: import("../../SchemaAST.ts").ParseOptions) => import("../../Effect.ts").Effect<Uint8Array<ArrayBuffer>, Schema.SchemaError, never>;
|
|
151
|
+
static decode: (input: Uint8Array<ArrayBuffer>, options?: import("../../SchemaAST.ts").ParseOptions) => import("../../Effect.ts").Effect<WriteEntries, Schema.SchemaError, never>;
|
|
152
|
+
get encoded(): import("../../Effect.ts").Effect<Uint8Array<ArrayBuffer>, Schema.SchemaError, never>;
|
|
153
|
+
}
|
|
154
|
+
declare const WriteEntriesUnencrypted_base: Schema.Class<WriteEntriesUnencrypted, Schema.Struct<{
|
|
155
|
+
readonly publicKey: Schema.String;
|
|
156
|
+
readonly storeId: Schema.brand<Schema.String, "effect/eventlog/EventLog/StoreId">;
|
|
157
|
+
readonly entries: Schema.$Array<typeof Entry>;
|
|
158
|
+
}>, {}>;
|
|
159
|
+
/**
|
|
160
|
+
* @since 4.0.0
|
|
161
|
+
* @category protocol
|
|
162
|
+
*/
|
|
163
|
+
export declare class WriteEntriesUnencrypted extends WriteEntriesUnencrypted_base {
|
|
164
|
+
static FromMsgpack: Msgpack.schema<typeof WriteEntriesUnencrypted>;
|
|
165
|
+
static encode: (input: WriteEntriesUnencrypted, options?: import("../../SchemaAST.ts").ParseOptions) => import("../../Effect.ts").Effect<Uint8Array<ArrayBuffer>, Schema.SchemaError, never>;
|
|
166
|
+
static decode: (input: Uint8Array<ArrayBuffer>, options?: import("../../SchemaAST.ts").ParseOptions) => import("../../Effect.ts").Effect<WriteEntriesUnencrypted, Schema.SchemaError, never>;
|
|
167
|
+
get encoded(): import("../../Effect.ts").Effect<Uint8Array<ArrayBuffer>, Schema.SchemaError, never>;
|
|
168
|
+
}
|
|
169
|
+
declare const WriteSingleRpc_base: Rpc.Rpc<"EventLog.WriteSingle", Schema.Struct<{
|
|
170
|
+
data: Transferable.Transferable<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
171
|
+
}>, Schema.Void, typeof EventLogProtocolError, typeof EventLogAuthentication, never>;
|
|
172
|
+
/**
|
|
173
|
+
* @since 4.0.0
|
|
174
|
+
* @category protocol
|
|
175
|
+
*/
|
|
176
|
+
export declare class WriteSingleRpc extends WriteSingleRpc_base {
|
|
177
|
+
}
|
|
178
|
+
declare const ChangesRpc_base: Rpc.Rpc<"EventLog.Changes", Schema.Struct<{
|
|
179
|
+
publicKey: Schema.String;
|
|
180
|
+
storeId: Schema.brand<Schema.String, "effect/eventlog/EventLog/StoreId">;
|
|
181
|
+
startSequence: Schema.Number;
|
|
182
|
+
}>, import("../rpc/RpcSchema.ts").Stream<Schema.Union<readonly [typeof SingleMessage, typeof ChunkedMessage]>, typeof EventLogProtocolError>, Schema.Never, typeof EventLogAuthentication, never>;
|
|
183
|
+
/**
|
|
184
|
+
* @since 4.0.0
|
|
185
|
+
* @category protocol
|
|
186
|
+
*/
|
|
187
|
+
export declare class ChangesRpc extends ChangesRpc_base {
|
|
188
|
+
static EncryptedFromMsgpack: Msgpack.schema<Schema.NonEmptyArray<Schema.Struct<{
|
|
189
|
+
readonly sequence: Schema.Number;
|
|
190
|
+
readonly iv: Transferable.Transferable<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
191
|
+
readonly entryId: Schema.brand<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, "effect/eventlog/EventJournal/EntryId">;
|
|
192
|
+
readonly encryptedEntry: Transferable.Transferable<Schema.instanceOf<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
193
|
+
}>>>;
|
|
194
|
+
static UnencryptedFromMsgpack: Msgpack.schema<Schema.NonEmptyArray<typeof RemoteEntry>>;
|
|
195
|
+
static encodeEncrypted: (input: readonly [{
|
|
196
|
+
readonly sequence: number;
|
|
197
|
+
readonly entryId: Uint8Array<ArrayBuffer> & Brand<"effect/eventlog/EventJournal/EntryId">;
|
|
198
|
+
readonly encryptedEntry: Uint8Array<ArrayBuffer>;
|
|
199
|
+
readonly iv: Uint8Array<ArrayBuffer>;
|
|
200
|
+
}, ...{
|
|
201
|
+
readonly sequence: number;
|
|
202
|
+
readonly entryId: Uint8Array<ArrayBuffer> & Brand<"effect/eventlog/EventJournal/EntryId">;
|
|
203
|
+
readonly encryptedEntry: Uint8Array<ArrayBuffer>;
|
|
204
|
+
readonly iv: Uint8Array<ArrayBuffer>;
|
|
205
|
+
}[]], options?: import("../../SchemaAST.ts").ParseOptions) => import("../../Effect.ts").Effect<Uint8Array<ArrayBuffer>, Schema.SchemaError, never>;
|
|
206
|
+
static decodeEncrypted: (input: Uint8Array<ArrayBuffer>, options?: import("../../SchemaAST.ts").ParseOptions) => import("../../Effect.ts").Effect<readonly [{
|
|
207
|
+
readonly sequence: number;
|
|
208
|
+
readonly entryId: Uint8Array<ArrayBuffer> & Brand<"effect/eventlog/EventJournal/EntryId">;
|
|
209
|
+
readonly encryptedEntry: Uint8Array<ArrayBuffer>;
|
|
210
|
+
readonly iv: Uint8Array<ArrayBuffer>;
|
|
211
|
+
}, ...{
|
|
212
|
+
readonly sequence: number;
|
|
213
|
+
readonly entryId: Uint8Array<ArrayBuffer> & Brand<"effect/eventlog/EventJournal/EntryId">;
|
|
214
|
+
readonly encryptedEntry: Uint8Array<ArrayBuffer>;
|
|
215
|
+
readonly iv: Uint8Array<ArrayBuffer>;
|
|
216
|
+
}[]], Schema.SchemaError, never>;
|
|
217
|
+
static encodeUnencrypted: (input: readonly [RemoteEntry, ...RemoteEntry[]], options?: import("../../SchemaAST.ts").ParseOptions) => import("../../Effect.ts").Effect<Uint8Array<ArrayBuffer>, Schema.SchemaError, never>;
|
|
218
|
+
static decodeUnencrypted: (input: Uint8Array<ArrayBuffer>, options?: import("../../SchemaAST.ts").ParseOptions) => import("../../Effect.ts").Effect<readonly [RemoteEntry, ...RemoteEntry[]], Schema.SchemaError, never>;
|
|
219
|
+
}
|
|
220
|
+
declare const EventLogRemoteRpcs_base: RpcGroup.RpcGroup<typeof HelloRpc | typeof AuthenticateRpc | typeof WriteChunkedRpc | typeof WriteSingleRpc | typeof ChangesRpc>;
|
|
221
|
+
/**
|
|
222
|
+
* @since 4.0.0
|
|
223
|
+
* @category protocol
|
|
224
|
+
*/
|
|
225
|
+
export declare class EventLogRemoteRpcs extends EventLogRemoteRpcs_base {
|
|
226
|
+
}
|
|
227
|
+
export {};
|
|
228
|
+
//# sourceMappingURL=EventLogMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventLogMessage.d.ts","sourceRoot":"","sources":["../../../src/unstable/eventlog/EventLogMessage.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAiB,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AACzC,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAA;AACjD,OAAO,KAAK,GAAG,MAAM,eAAe,CAAA;AACpC,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAC9C,OAAO,KAAK,aAAa,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,YAAY,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,KAAK,EAAE,WAAW,EAAY,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAG7C;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,kCAAkC,CAAA;AAE9D;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,aAAkD,CAAA;AAE9E;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,CAAA;AAEnD;;;GAGG;AACH,eAAO,MAAM,OAAO,iEAAkD,CAAA;;;;;;;;AAEtE;;;GAGG;AACH,qBAAa,qB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MAAM,CAAC,WAAW,iDAA0C;IAC5D,MAAM,CAAC,MAAM,gLAAwC;IACrD,MAAM,CAAC,MAAM,gLAAwC;IACrD,IAAI,OAAO,yFAEV;CACF;;;;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,mBAKC;CAAG;;;;;;AAExC;;;GAGG;AACH,qBAAa,UAAW,SAAQ,eASK;IACnC,MAAM,CAAC,oBAAoB;;;;;SAA6D;IACxF,MAAM,CAAC,sBAAsB,2DAAoD;IACjF,MAAM,CAAC,eAAe;;;;;;;;;;uJAAuD;IAC7E,MAAM,CAAC,eAAe;;;;;;;;;;qCAAuD;IAC7E,MAAM,CAAC,iBAAiB,iMAAyD;IACjF,MAAM,CAAC,iBAAiB,iMAAyD;CAClF;;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,uBAMvC;CAAG"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import * as Schema from "../../Schema.js";
|
|
2
|
+
import * as Msgpack from "../encoding/Msgpack.js";
|
|
3
|
+
import * as Rpc from "../rpc/Rpc.js";
|
|
4
|
+
import * as RpcGroup from "../rpc/RpcGroup.js";
|
|
5
|
+
import * as RpcMiddleware from "../rpc/RpcMiddleware.js";
|
|
6
|
+
import * as Transferable from "../workers/Transferable.js";
|
|
7
|
+
import { Entry, RemoteEntry, RemoteId } from "./EventJournal.js";
|
|
8
|
+
import { EncryptedEntry, EncryptedRemoteEntry } from "./EventLogEncryption.js";
|
|
9
|
+
/**
|
|
10
|
+
* @since 4.0.0
|
|
11
|
+
* @category StoreId
|
|
12
|
+
*/
|
|
13
|
+
export const StoreIdTypeId = "effect/eventlog/EventLog/StoreId";
|
|
14
|
+
/**
|
|
15
|
+
* @since 4.0.0
|
|
16
|
+
* @category StoreId
|
|
17
|
+
*/
|
|
18
|
+
export const StoreId = /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.brand(StoreIdTypeId));
|
|
19
|
+
/**
|
|
20
|
+
* @since 4.0.0
|
|
21
|
+
* @category protocol
|
|
22
|
+
*/
|
|
23
|
+
export class EventLogProtocolError extends /*#__PURE__*/Schema.TaggedErrorClass("effect/eventlog/EventLogRemote/ProtocolError")("EventLogProtocolError", {
|
|
24
|
+
requestTag: Schema.String,
|
|
25
|
+
publicKey: /*#__PURE__*/Schema.optional(Schema.String),
|
|
26
|
+
storeId: /*#__PURE__*/Schema.optional(StoreId),
|
|
27
|
+
code: /*#__PURE__*/Schema.Literals(["Unauthorized", "Forbidden", "NotFound", "InvalidRequest", "InternalServerError"]),
|
|
28
|
+
message: Schema.String
|
|
29
|
+
}) {}
|
|
30
|
+
/**
|
|
31
|
+
* @since 4.0.0
|
|
32
|
+
* @category Middleware
|
|
33
|
+
*/
|
|
34
|
+
export class EventLogAuthentication extends /*#__PURE__*/RpcMiddleware.Service()("effect/eventlog/EventLogMessage/EventLogAuthentication", {
|
|
35
|
+
error: EventLogProtocolError
|
|
36
|
+
}) {}
|
|
37
|
+
/**
|
|
38
|
+
* @since 4.0.0
|
|
39
|
+
* @category protocol
|
|
40
|
+
*/
|
|
41
|
+
export class HelloResponse extends /*#__PURE__*/Schema.Class("effect/eventlog/EventLogRemote/HelloResponse")({
|
|
42
|
+
remoteId: RemoteId,
|
|
43
|
+
challenge: Transferable.Uint8Array
|
|
44
|
+
}) {}
|
|
45
|
+
/**
|
|
46
|
+
* @since 4.0.0
|
|
47
|
+
* @category protocol
|
|
48
|
+
*/
|
|
49
|
+
export class HelloRpc extends /*#__PURE__*/Rpc.make("EventLog.Hello", {
|
|
50
|
+
success: HelloResponse
|
|
51
|
+
}) {}
|
|
52
|
+
/**
|
|
53
|
+
* @since 4.0.0
|
|
54
|
+
* @category protocol
|
|
55
|
+
*/
|
|
56
|
+
export class Authenticate extends /*#__PURE__*/Schema.Class("effect/eventlog/EventLogRemote/Authenticate")({
|
|
57
|
+
publicKey: Schema.String,
|
|
58
|
+
signingPublicKey: Transferable.Uint8Array,
|
|
59
|
+
signature: Transferable.Uint8Array,
|
|
60
|
+
algorithm: /*#__PURE__*/Schema.Literal("Ed25519")
|
|
61
|
+
}) {}
|
|
62
|
+
/**
|
|
63
|
+
* @since 4.0.0
|
|
64
|
+
* @category protocol
|
|
65
|
+
*/
|
|
66
|
+
export class AuthenticateRpc extends /*#__PURE__*/Rpc.make("EventLog.Authenticate", {
|
|
67
|
+
payload: Authenticate,
|
|
68
|
+
error: EventLogProtocolError
|
|
69
|
+
}) {}
|
|
70
|
+
/**
|
|
71
|
+
* @since 4.0.0
|
|
72
|
+
* @category protocol
|
|
73
|
+
*/
|
|
74
|
+
export class SingleMessage extends /*#__PURE__*/Schema.TaggedClass("effect/eventlog/EventLogRemote/SingleMessage")("Single", {
|
|
75
|
+
data: Transferable.Uint8Array
|
|
76
|
+
}) {}
|
|
77
|
+
/**
|
|
78
|
+
* @since 4.0.0
|
|
79
|
+
* @category protocol
|
|
80
|
+
*/
|
|
81
|
+
export class ChunkedMessage extends /*#__PURE__*/Schema.TaggedClass("effect/eventlog/EventLogRemote/ChunkedMessage")("Chunked", {
|
|
82
|
+
id: Schema.Number,
|
|
83
|
+
part: /*#__PURE__*/Schema.Tuple([Schema.Number, Schema.Number]),
|
|
84
|
+
data: Transferable.Uint8Array
|
|
85
|
+
}) {
|
|
86
|
+
static chunkSize = 512_000;
|
|
87
|
+
static initialJoinState() {
|
|
88
|
+
return new Map();
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* @since 4.0.0
|
|
92
|
+
*/
|
|
93
|
+
static split(id, data) {
|
|
94
|
+
const parts = Math.ceil(data.byteLength / ChunkedMessage.chunkSize);
|
|
95
|
+
const result = new Array(parts);
|
|
96
|
+
for (let i = 0; i < parts; i++) {
|
|
97
|
+
const start = i * ChunkedMessage.chunkSize;
|
|
98
|
+
const end = Math.min((i + 1) * ChunkedMessage.chunkSize, data.byteLength);
|
|
99
|
+
result[i] = new ChunkedMessage({
|
|
100
|
+
id,
|
|
101
|
+
part: [i, parts],
|
|
102
|
+
data: data.subarray(start, end)
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* @since 4.0.0
|
|
109
|
+
*/
|
|
110
|
+
static join(map, part) {
|
|
111
|
+
const [index, total] = part.part;
|
|
112
|
+
let entry = map.get(part.id);
|
|
113
|
+
if (!entry) {
|
|
114
|
+
entry = {
|
|
115
|
+
parts: new Array(total),
|
|
116
|
+
count: 0,
|
|
117
|
+
bytes: 0
|
|
118
|
+
};
|
|
119
|
+
map.set(part.id, entry);
|
|
120
|
+
}
|
|
121
|
+
entry.parts[index] = part.data;
|
|
122
|
+
entry.count++;
|
|
123
|
+
entry.bytes += part.data.byteLength;
|
|
124
|
+
if (entry.count !== total) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
const data = new Uint8Array(entry.bytes);
|
|
128
|
+
let offset = 0;
|
|
129
|
+
for (const part of entry.parts) {
|
|
130
|
+
data.set(part, offset);
|
|
131
|
+
offset += part.byteLength;
|
|
132
|
+
}
|
|
133
|
+
map.delete(part.id);
|
|
134
|
+
return data;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* @since 4.0.0
|
|
139
|
+
* @category protocol
|
|
140
|
+
*/
|
|
141
|
+
export class WriteChunkedRpc extends /*#__PURE__*/Rpc.make("EventLog.WriteChunked", {
|
|
142
|
+
payload: ChunkedMessage,
|
|
143
|
+
error: EventLogProtocolError
|
|
144
|
+
}).middleware(EventLogAuthentication) {}
|
|
145
|
+
/**
|
|
146
|
+
* @since 4.0.0
|
|
147
|
+
* @category protocol
|
|
148
|
+
*/
|
|
149
|
+
export class WriteEntries extends /*#__PURE__*/Schema.Class("effect/eventlog/EventLogRemote/WriteEntries")({
|
|
150
|
+
publicKey: Schema.String,
|
|
151
|
+
storeId: StoreId,
|
|
152
|
+
iv: Transferable.Uint8Array,
|
|
153
|
+
encryptedEntries: /*#__PURE__*/Schema.Array(EncryptedEntry)
|
|
154
|
+
}) {
|
|
155
|
+
static FromMsgpack = /*#__PURE__*/Msgpack.schema(WriteEntries);
|
|
156
|
+
static encode = /*#__PURE__*/Schema.encodeEffect(this.FromMsgpack);
|
|
157
|
+
static decode = /*#__PURE__*/Schema.decodeEffect(this.FromMsgpack);
|
|
158
|
+
get encoded() {
|
|
159
|
+
return WriteEntries.encode(this);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* @since 4.0.0
|
|
164
|
+
* @category protocol
|
|
165
|
+
*/
|
|
166
|
+
export class WriteEntriesUnencrypted extends /*#__PURE__*/Schema.Class("effect/eventlog/EventLogRemote/WriteEntriesUnencrypted")({
|
|
167
|
+
publicKey: Schema.String,
|
|
168
|
+
storeId: StoreId,
|
|
169
|
+
entries: /*#__PURE__*/Schema.Array(Entry)
|
|
170
|
+
}) {
|
|
171
|
+
static FromMsgpack = /*#__PURE__*/Msgpack.schema(WriteEntriesUnencrypted);
|
|
172
|
+
static encode = /*#__PURE__*/Schema.encodeEffect(this.FromMsgpack);
|
|
173
|
+
static decode = /*#__PURE__*/Schema.decodeEffect(this.FromMsgpack);
|
|
174
|
+
get encoded() {
|
|
175
|
+
return WriteEntriesUnencrypted.encode(this);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* @since 4.0.0
|
|
180
|
+
* @category protocol
|
|
181
|
+
*/
|
|
182
|
+
export class WriteSingleRpc extends /*#__PURE__*/Rpc.make("EventLog.WriteSingle", {
|
|
183
|
+
payload: {
|
|
184
|
+
data: Transferable.Uint8Array
|
|
185
|
+
},
|
|
186
|
+
error: EventLogProtocolError
|
|
187
|
+
}).middleware(EventLogAuthentication) {}
|
|
188
|
+
/**
|
|
189
|
+
* @since 4.0.0
|
|
190
|
+
* @category protocol
|
|
191
|
+
*/
|
|
192
|
+
export class ChangesRpc extends /*#__PURE__*/Rpc.make("EventLog.Changes", {
|
|
193
|
+
payload: {
|
|
194
|
+
publicKey: Schema.String,
|
|
195
|
+
storeId: StoreId,
|
|
196
|
+
startSequence: Schema.Number
|
|
197
|
+
},
|
|
198
|
+
success: Schema.Union([SingleMessage, ChunkedMessage]),
|
|
199
|
+
error: EventLogProtocolError,
|
|
200
|
+
stream: true
|
|
201
|
+
}).middleware(EventLogAuthentication) {
|
|
202
|
+
static EncryptedFromMsgpack = /*#__PURE__*/Msgpack.schema(/*#__PURE__*/Schema.NonEmptyArray(EncryptedRemoteEntry));
|
|
203
|
+
static UnencryptedFromMsgpack = /*#__PURE__*/Msgpack.schema(/*#__PURE__*/Schema.NonEmptyArray(RemoteEntry));
|
|
204
|
+
static encodeEncrypted = /*#__PURE__*/Schema.encodeEffect(ChangesRpc.EncryptedFromMsgpack);
|
|
205
|
+
static decodeEncrypted = /*#__PURE__*/Schema.decodeEffect(ChangesRpc.EncryptedFromMsgpack);
|
|
206
|
+
static encodeUnencrypted = /*#__PURE__*/Schema.encodeEffect(ChangesRpc.UnencryptedFromMsgpack);
|
|
207
|
+
static decodeUnencrypted = /*#__PURE__*/Schema.decodeEffect(ChangesRpc.UnencryptedFromMsgpack);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* @since 4.0.0
|
|
211
|
+
* @category protocol
|
|
212
|
+
*/
|
|
213
|
+
export class EventLogRemoteRpcs extends /*#__PURE__*/RpcGroup.make(HelloRpc, AuthenticateRpc, WriteChunkedRpc, WriteSingleRpc, ChangesRpc) {}
|
|
214
|
+
//# sourceMappingURL=EventLogMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventLogMessage.js","names":["Schema","Msgpack","Rpc","RpcGroup","RpcMiddleware","Transferable","Entry","RemoteEntry","RemoteId","EncryptedEntry","EncryptedRemoteEntry","StoreIdTypeId","StoreId","String","pipe","brand","EventLogProtocolError","TaggedErrorClass","requestTag","publicKey","optional","storeId","code","Literals","message","EventLogAuthentication","Service","error","HelloResponse","Class","remoteId","challenge","Uint8Array","HelloRpc","make","success","Authenticate","signingPublicKey","signature","algorithm","Literal","AuthenticateRpc","payload","SingleMessage","TaggedClass","data","ChunkedMessage","id","Number","part","Tuple","chunkSize","initialJoinState","Map","split","parts","Math","ceil","byteLength","result","Array","i","start","end","min","subarray","join","map","index","total","entry","get","count","bytes","set","offset","delete","WriteChunkedRpc","middleware","WriteEntries","iv","encryptedEntries","FromMsgpack","schema","encode","encodeEffect","decode","decodeEffect","encoded","WriteEntriesUnencrypted","entries","WriteSingleRpc","ChangesRpc","startSequence","Union","stream","EncryptedFromMsgpack","NonEmptyArray","UnencryptedFromMsgpack","encodeEncrypted","decodeEncrypted","encodeUnencrypted","decodeUnencrypted","EventLogRemoteRpcs"],"sources":["../../../src/unstable/eventlog/EventLogMessage.ts"],"sourcesContent":[null],"mappings":"AAKA,OAAO,KAAKA,MAAM,MAAM,iBAAiB;AACzC,OAAO,KAAKC,OAAO,MAAM,wBAAwB;AACjD,OAAO,KAAKC,GAAG,MAAM,eAAe;AACpC,OAAO,KAAKC,QAAQ,MAAM,oBAAoB;AAC9C,OAAO,KAAKC,aAAa,MAAM,yBAAyB;AACxD,OAAO,KAAKC,YAAY,MAAM,4BAA4B;AAC1D,SAASC,KAAK,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,mBAAmB;AAEhE,SAASC,cAAc,EAAEC,oBAAoB,QAAQ,yBAAyB;AAQ9E;;;;AAIA,OAAO,MAAMC,aAAa,GAAkB,kCAAkC;AAQ9E;;;;AAIA,OAAO,MAAMC,OAAO,gBAAGZ,MAAM,CAACa,MAAM,CAACC,IAAI,cAACd,MAAM,CAACe,KAAK,CAACJ,aAAa,CAAC,CAAC;AAEtE;;;;AAIA,OAAM,MAAOK,qBAAsB,sBAAQhB,MAAM,CAACiB,gBAAgB,CAChE,8CAA8C,CAC/C,CAAC,uBAAuB,EAAE;EACzBC,UAAU,EAAElB,MAAM,CAACa,MAAM;EACzBM,SAAS,eAAEnB,MAAM,CAACoB,QAAQ,CAACpB,MAAM,CAACa,MA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