@voidhash/mimic-effect 0.0.9 → 1.0.0-beta.2
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/.turbo/turbo-build.log +136 -90
- package/README.md +385 -0
- package/dist/ColdStorage.cjs +60 -0
- package/dist/ColdStorage.d.cts +53 -0
- package/dist/ColdStorage.d.cts.map +1 -0
- package/dist/ColdStorage.d.mts +53 -0
- package/dist/ColdStorage.d.mts.map +1 -0
- package/dist/ColdStorage.mjs +60 -0
- package/dist/ColdStorage.mjs.map +1 -0
- package/dist/DocumentManager.cjs +263 -82
- package/dist/DocumentManager.d.cts +44 -22
- package/dist/DocumentManager.d.cts.map +1 -1
- package/dist/DocumentManager.d.mts +44 -22
- package/dist/DocumentManager.d.mts.map +1 -1
- package/dist/DocumentManager.mjs +259 -67
- package/dist/DocumentManager.mjs.map +1 -1
- package/dist/Errors.cjs +54 -0
- package/dist/Errors.d.cts +96 -0
- package/dist/Errors.d.cts.map +1 -0
- package/dist/Errors.d.mts +96 -0
- package/dist/Errors.d.mts.map +1 -0
- package/dist/Errors.mjs +48 -0
- package/dist/Errors.mjs.map +1 -0
- package/dist/HotStorage.cjs +100 -0
- package/dist/HotStorage.d.cts +70 -0
- package/dist/HotStorage.d.cts.map +1 -0
- package/dist/HotStorage.d.mts +70 -0
- package/dist/HotStorage.d.mts.map +1 -0
- package/dist/HotStorage.mjs +100 -0
- package/dist/HotStorage.mjs.map +1 -0
- package/dist/Metrics.cjs +143 -0
- package/dist/Metrics.d.cts +31 -0
- package/dist/Metrics.d.cts.map +1 -0
- package/dist/Metrics.d.mts +31 -0
- package/dist/Metrics.d.mts.map +1 -0
- package/dist/Metrics.mjs +126 -0
- package/dist/Metrics.mjs.map +1 -0
- package/dist/MimicAuthService.cjs +61 -45
- package/dist/MimicAuthService.d.cts +61 -48
- package/dist/MimicAuthService.d.cts.map +1 -1
- package/dist/MimicAuthService.d.mts +61 -48
- package/dist/MimicAuthService.d.mts.map +1 -1
- package/dist/MimicAuthService.mjs +60 -36
- package/dist/MimicAuthService.mjs.map +1 -1
- package/dist/MimicClusterServerEngine.cjs +521 -0
- package/dist/MimicClusterServerEngine.d.cts +17 -0
- package/dist/MimicClusterServerEngine.d.cts.map +1 -0
- package/dist/MimicClusterServerEngine.d.mts +17 -0
- package/dist/MimicClusterServerEngine.d.mts.map +1 -0
- package/dist/MimicClusterServerEngine.mjs +523 -0
- package/dist/MimicClusterServerEngine.mjs.map +1 -0
- package/dist/MimicServer.cjs +205 -96
- package/dist/MimicServer.d.cts +9 -110
- package/dist/MimicServer.d.cts.map +1 -1
- package/dist/MimicServer.d.mts +9 -110
- package/dist/MimicServer.d.mts.map +1 -1
- package/dist/MimicServer.mjs +206 -90
- package/dist/MimicServer.mjs.map +1 -1
- package/dist/MimicServerEngine.cjs +97 -0
- package/dist/MimicServerEngine.d.cts +78 -0
- package/dist/MimicServerEngine.d.cts.map +1 -0
- package/dist/MimicServerEngine.d.mts +78 -0
- package/dist/MimicServerEngine.d.mts.map +1 -0
- package/dist/MimicServerEngine.mjs +97 -0
- package/dist/MimicServerEngine.mjs.map +1 -0
- package/dist/PresenceManager.cjs +75 -91
- package/dist/PresenceManager.d.cts +17 -66
- package/dist/PresenceManager.d.cts.map +1 -1
- package/dist/PresenceManager.d.mts +17 -66
- package/dist/PresenceManager.d.mts.map +1 -1
- package/dist/PresenceManager.mjs +74 -78
- package/dist/PresenceManager.mjs.map +1 -1
- package/dist/Protocol.cjs +146 -0
- package/dist/Protocol.d.cts +203 -0
- package/dist/Protocol.d.cts.map +1 -0
- package/dist/Protocol.d.mts +203 -0
- package/dist/Protocol.d.mts.map +1 -0
- package/dist/Protocol.mjs +132 -0
- package/dist/Protocol.mjs.map +1 -0
- package/dist/Types.d.cts +172 -0
- package/dist/Types.d.cts.map +1 -0
- package/dist/Types.d.mts +172 -0
- package/dist/Types.d.mts.map +1 -0
- package/dist/_virtual/rolldown_runtime.cjs +1 -25
- package/dist/_virtual/rolldown_runtime.mjs +4 -1
- package/dist/index.cjs +37 -75
- package/dist/index.d.cts +13 -12
- package/dist/index.d.mts +13 -12
- package/dist/index.mjs +12 -12
- package/dist/testing/ColdStorageTestSuite.cjs +508 -0
- package/dist/testing/ColdStorageTestSuite.d.cts +36 -0
- package/dist/testing/ColdStorageTestSuite.d.cts.map +1 -0
- package/dist/testing/ColdStorageTestSuite.d.mts +36 -0
- package/dist/testing/ColdStorageTestSuite.d.mts.map +1 -0
- package/dist/testing/ColdStorageTestSuite.mjs +508 -0
- package/dist/testing/ColdStorageTestSuite.mjs.map +1 -0
- package/dist/testing/FailingStorage.cjs +135 -0
- package/dist/testing/FailingStorage.d.cts +43 -0
- package/dist/testing/FailingStorage.d.cts.map +1 -0
- package/dist/testing/FailingStorage.d.mts +43 -0
- package/dist/testing/FailingStorage.d.mts.map +1 -0
- package/dist/testing/FailingStorage.mjs +136 -0
- package/dist/testing/FailingStorage.mjs.map +1 -0
- package/dist/testing/HotStorageTestSuite.cjs +585 -0
- package/dist/testing/HotStorageTestSuite.d.cts +40 -0
- package/dist/testing/HotStorageTestSuite.d.cts.map +1 -0
- package/dist/testing/HotStorageTestSuite.d.mts +40 -0
- package/dist/testing/HotStorageTestSuite.d.mts.map +1 -0
- package/dist/testing/HotStorageTestSuite.mjs +585 -0
- package/dist/testing/HotStorageTestSuite.mjs.map +1 -0
- package/dist/testing/StorageIntegrationTestSuite.cjs +349 -0
- package/dist/testing/StorageIntegrationTestSuite.d.cts +35 -0
- package/dist/testing/StorageIntegrationTestSuite.d.cts.map +1 -0
- package/dist/testing/StorageIntegrationTestSuite.d.mts +35 -0
- package/dist/testing/StorageIntegrationTestSuite.d.mts.map +1 -0
- package/dist/testing/StorageIntegrationTestSuite.mjs +349 -0
- package/dist/testing/StorageIntegrationTestSuite.mjs.map +1 -0
- package/dist/testing/assertions.cjs +114 -0
- package/dist/testing/assertions.mjs +109 -0
- package/dist/testing/assertions.mjs.map +1 -0
- package/dist/testing/index.cjs +14 -0
- package/dist/testing/index.d.cts +6 -0
- package/dist/testing/index.d.mts +6 -0
- package/dist/testing/index.mjs +7 -0
- package/dist/testing/types.cjs +15 -0
- package/dist/testing/types.d.cts +90 -0
- package/dist/testing/types.d.cts.map +1 -0
- package/dist/testing/types.d.mts +90 -0
- package/dist/testing/types.d.mts.map +1 -0
- package/dist/testing/types.mjs +16 -0
- package/dist/testing/types.mjs.map +1 -0
- package/package.json +18 -3
- package/src/ColdStorage.ts +136 -0
- package/src/DocumentManager.ts +550 -190
- package/src/Errors.ts +114 -0
- package/src/HotStorage.ts +239 -0
- package/src/Metrics.ts +187 -0
- package/src/MimicAuthService.ts +126 -64
- package/src/MimicClusterServerEngine.ts +946 -0
- package/src/MimicServer.ts +448 -195
- package/src/MimicServerEngine.ts +276 -0
- package/src/PresenceManager.ts +169 -240
- package/src/Protocol.ts +350 -0
- package/src/Types.ts +231 -0
- package/src/index.ts +57 -23
- package/src/testing/ColdStorageTestSuite.ts +589 -0
- package/src/testing/FailingStorage.ts +286 -0
- package/src/testing/HotStorageTestSuite.ts +762 -0
- package/src/testing/StorageIntegrationTestSuite.ts +504 -0
- package/src/testing/assertions.ts +181 -0
- package/src/testing/index.ts +83 -0
- package/src/testing/types.ts +100 -0
- package/tests/ColdStorage.test.ts +24 -0
- package/tests/DocumentManager.test.ts +158 -287
- package/tests/HotStorage.test.ts +24 -0
- package/tests/MimicAuthService.test.ts +102 -134
- package/tests/MimicClusterServerEngine.test.ts +587 -0
- package/tests/MimicServer.test.ts +90 -226
- package/tests/MimicServerEngine.test.ts +521 -0
- package/tests/PresenceManager.test.ts +22 -63
- package/tests/Protocol.test.ts +190 -0
- package/tests/StorageIntegration.test.ts +259 -0
- package/tsconfig.json +1 -1
- package/tsdown.config.ts +1 -1
- package/dist/DocumentProtocol.cjs +0 -94
- package/dist/DocumentProtocol.d.cts +0 -113
- package/dist/DocumentProtocol.d.cts.map +0 -1
- package/dist/DocumentProtocol.d.mts +0 -113
- package/dist/DocumentProtocol.d.mts.map +0 -1
- package/dist/DocumentProtocol.mjs +0 -89
- package/dist/DocumentProtocol.mjs.map +0 -1
- package/dist/MimicConfig.cjs +0 -60
- package/dist/MimicConfig.d.cts +0 -141
- package/dist/MimicConfig.d.cts.map +0 -1
- package/dist/MimicConfig.d.mts +0 -141
- package/dist/MimicConfig.d.mts.map +0 -1
- package/dist/MimicConfig.mjs +0 -50
- package/dist/MimicConfig.mjs.map +0 -1
- package/dist/MimicDataStorage.cjs +0 -83
- package/dist/MimicDataStorage.d.cts +0 -113
- package/dist/MimicDataStorage.d.cts.map +0 -1
- package/dist/MimicDataStorage.d.mts +0 -113
- package/dist/MimicDataStorage.d.mts.map +0 -1
- package/dist/MimicDataStorage.mjs +0 -74
- package/dist/MimicDataStorage.mjs.map +0 -1
- package/dist/WebSocketHandler.cjs +0 -365
- package/dist/WebSocketHandler.d.cts +0 -34
- package/dist/WebSocketHandler.d.cts.map +0 -1
- package/dist/WebSocketHandler.d.mts +0 -34
- package/dist/WebSocketHandler.d.mts.map +0 -1
- package/dist/WebSocketHandler.mjs +0 -355
- package/dist/WebSocketHandler.mjs.map +0 -1
- package/dist/auth/NoAuth.cjs +0 -43
- package/dist/auth/NoAuth.d.cts +0 -22
- package/dist/auth/NoAuth.d.cts.map +0 -1
- package/dist/auth/NoAuth.d.mts +0 -22
- package/dist/auth/NoAuth.d.mts.map +0 -1
- package/dist/auth/NoAuth.mjs +0 -36
- package/dist/auth/NoAuth.mjs.map +0 -1
- package/dist/errors.cjs +0 -74
- package/dist/errors.d.cts +0 -89
- package/dist/errors.d.cts.map +0 -1
- package/dist/errors.d.mts +0 -89
- package/dist/errors.d.mts.map +0 -1
- package/dist/errors.mjs +0 -67
- package/dist/errors.mjs.map +0 -1
- package/dist/storage/InMemoryDataStorage.cjs +0 -57
- package/dist/storage/InMemoryDataStorage.d.cts +0 -19
- package/dist/storage/InMemoryDataStorage.d.cts.map +0 -1
- package/dist/storage/InMemoryDataStorage.d.mts +0 -19
- package/dist/storage/InMemoryDataStorage.d.mts.map +0 -1
- package/dist/storage/InMemoryDataStorage.mjs +0 -48
- package/dist/storage/InMemoryDataStorage.mjs.map +0 -1
- package/src/DocumentProtocol.ts +0 -112
- package/src/MimicConfig.ts +0 -211
- package/src/MimicDataStorage.ts +0 -157
- package/src/WebSocketHandler.ts +0 -735
- package/src/auth/NoAuth.ts +0 -46
- package/src/errors.ts +0 -113
- package/src/storage/InMemoryDataStorage.ts +0 -66
- package/tests/DocumentProtocol.test.ts +0 -113
- package/tests/InMemoryDataStorage.test.ts +0 -190
- package/tests/MimicConfig.test.ts +0 -290
- package/tests/MimicDataStorage.test.ts +0 -190
- package/tests/NoAuth.test.ts +0 -94
- package/tests/WebSocketHandler.test.ts +0 -321
- package/tests/errors.test.ts +0 -77
package/dist/Types.d.mts
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { Duration, Effect } from "effect";
|
|
2
|
+
import { Presence, Primitive, Transaction } from "@voidhash/mimic";
|
|
3
|
+
|
|
4
|
+
//#region src/Types.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Permission level for document access
|
|
8
|
+
* - "read": Can subscribe, receive transactions, get snapshots
|
|
9
|
+
* - "write": All of the above, plus can submit transactions and set presence
|
|
10
|
+
*/
|
|
11
|
+
type Permission = "read" | "write";
|
|
12
|
+
/**
|
|
13
|
+
* Authentication context returned after successful authentication
|
|
14
|
+
*/
|
|
15
|
+
interface AuthContext {
|
|
16
|
+
readonly userId: string;
|
|
17
|
+
readonly permission: Permission;
|
|
18
|
+
readonly metadata?: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Document state stored in ColdStorage (snapshots)
|
|
22
|
+
*/
|
|
23
|
+
interface StoredDocument {
|
|
24
|
+
/** Document state */
|
|
25
|
+
readonly state: unknown;
|
|
26
|
+
/** Current version number */
|
|
27
|
+
readonly version: number;
|
|
28
|
+
/** Schema version for future migration support */
|
|
29
|
+
readonly schemaVersion: number;
|
|
30
|
+
/** Unix timestamp (ms) when saved */
|
|
31
|
+
readonly savedAt: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* WAL entry stored in HotStorage
|
|
35
|
+
*/
|
|
36
|
+
interface WalEntry {
|
|
37
|
+
/** The transaction data */
|
|
38
|
+
readonly transaction: Transaction.Transaction;
|
|
39
|
+
/** Version after this transaction */
|
|
40
|
+
readonly version: number;
|
|
41
|
+
/** Unix timestamp (ms) */
|
|
42
|
+
readonly timestamp: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Presence entry for a connection
|
|
46
|
+
*/
|
|
47
|
+
interface PresenceEntry {
|
|
48
|
+
/** Presence data (schema-validated) */
|
|
49
|
+
readonly data: unknown;
|
|
50
|
+
/** User ID from authentication (optional) */
|
|
51
|
+
readonly userId?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Snapshot of all presences for a document
|
|
55
|
+
*/
|
|
56
|
+
interface PresenceSnapshot {
|
|
57
|
+
readonly presences: Record<string, PresenceEntry>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Presence update event
|
|
61
|
+
*/
|
|
62
|
+
interface PresenceUpdateEvent {
|
|
63
|
+
readonly type: "presence_update";
|
|
64
|
+
readonly id: string;
|
|
65
|
+
readonly data: unknown;
|
|
66
|
+
readonly userId?: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Presence remove event
|
|
70
|
+
*/
|
|
71
|
+
interface PresenceRemoveEvent {
|
|
72
|
+
readonly type: "presence_remove";
|
|
73
|
+
readonly id: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Union of presence events
|
|
77
|
+
*/
|
|
78
|
+
type PresenceEvent = PresenceUpdateEvent | PresenceRemoveEvent;
|
|
79
|
+
/**
|
|
80
|
+
* Duration input type - matches Effect's DurationInput
|
|
81
|
+
*/
|
|
82
|
+
type DurationInput = Duration.DurationInput;
|
|
83
|
+
/**
|
|
84
|
+
* Snapshot configuration
|
|
85
|
+
*/
|
|
86
|
+
interface SnapshotConfig {
|
|
87
|
+
/** Time-based snapshot interval */
|
|
88
|
+
readonly interval: DurationInput;
|
|
89
|
+
/** Transaction count threshold for snapshots */
|
|
90
|
+
readonly transactionThreshold: number;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Context passed to initial state function
|
|
94
|
+
*/
|
|
95
|
+
interface InitialContext {
|
|
96
|
+
readonly documentId: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Initial state function type
|
|
100
|
+
*/
|
|
101
|
+
type InitialFn<TSchema extends Primitive.AnyPrimitive> = (context: InitialContext) => Effect.Effect<Primitive.InferSetInput<TSchema>>;
|
|
102
|
+
/**
|
|
103
|
+
* Initial state - either a static value or a function
|
|
104
|
+
*/
|
|
105
|
+
type Initial<TSchema extends Primitive.AnyPrimitive> = Primitive.InferSetInput<TSchema> | InitialFn<TSchema>;
|
|
106
|
+
/**
|
|
107
|
+
* MimicServerEngine configuration
|
|
108
|
+
*/
|
|
109
|
+
interface MimicServerEngineConfig<TSchema extends Primitive.AnyPrimitive> {
|
|
110
|
+
/** Document schema (required) */
|
|
111
|
+
readonly schema: TSchema;
|
|
112
|
+
/** Initial state for new documents (optional) */
|
|
113
|
+
readonly initial?: Initial<TSchema>;
|
|
114
|
+
/** Presence schema (optional) */
|
|
115
|
+
readonly presence?: Presence.AnyPresence;
|
|
116
|
+
/** Document idle timeout before GC (default: 5 minutes) */
|
|
117
|
+
readonly maxIdleTime?: DurationInput;
|
|
118
|
+
/** Maximum transaction history for deduplication (default: 1000) */
|
|
119
|
+
readonly maxTransactionHistory?: number;
|
|
120
|
+
/** Snapshot configuration */
|
|
121
|
+
readonly snapshot?: SnapshotConfig;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* MimicClusterServerEngine configuration (extends MimicServerEngineConfig)
|
|
125
|
+
*/
|
|
126
|
+
interface MimicClusterServerEngineConfig<TSchema extends Primitive.AnyPrimitive> extends MimicServerEngineConfig<TSchema> {
|
|
127
|
+
/** Shard group name for cluster distribution (default: "mimic-documents") */
|
|
128
|
+
readonly shardGroup?: string;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* MimicServer route configuration
|
|
132
|
+
*/
|
|
133
|
+
interface MimicServerRouteConfig {
|
|
134
|
+
/** WebSocket route path prefix (default: "/mimic") */
|
|
135
|
+
readonly path?: `/${string}`;
|
|
136
|
+
/** Heartbeat ping interval (default: 30 seconds) */
|
|
137
|
+
readonly heartbeatInterval?: DurationInput;
|
|
138
|
+
/** Heartbeat timeout - disconnect if no activity (default: 10 seconds) */
|
|
139
|
+
readonly heartbeatTimeout?: DurationInput;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Resolved engine configuration with all defaults applied
|
|
143
|
+
*/
|
|
144
|
+
interface ResolvedConfig<TSchema extends Primitive.AnyPrimitive> {
|
|
145
|
+
readonly schema: TSchema;
|
|
146
|
+
readonly initial: Initial<TSchema> | undefined;
|
|
147
|
+
readonly presence: Presence.AnyPresence | undefined;
|
|
148
|
+
readonly maxIdleTime: Duration.Duration;
|
|
149
|
+
readonly maxTransactionHistory: number;
|
|
150
|
+
readonly snapshot: {
|
|
151
|
+
readonly interval: Duration.Duration;
|
|
152
|
+
readonly transactionThreshold: number;
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Resolved route configuration with all defaults applied
|
|
157
|
+
*/
|
|
158
|
+
interface ResolvedRouteConfig {
|
|
159
|
+
readonly path: string;
|
|
160
|
+
readonly heartbeatInterval: Duration.Duration;
|
|
161
|
+
readonly heartbeatTimeout: Duration.Duration;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Resolved cluster engine configuration with all defaults applied
|
|
165
|
+
*/
|
|
166
|
+
interface ResolvedClusterConfig<TSchema extends Primitive.AnyPrimitive> extends ResolvedConfig<TSchema> {
|
|
167
|
+
/** Shard group name for cluster distribution */
|
|
168
|
+
readonly shardGroup: string;
|
|
169
|
+
}
|
|
170
|
+
//#endregion
|
|
171
|
+
export { AuthContext, DurationInput, Initial, InitialContext, InitialFn, MimicClusterServerEngineConfig, MimicServerEngineConfig, MimicServerRouteConfig, Permission, PresenceEntry, PresenceEvent, PresenceRemoveEvent, PresenceSnapshot, PresenceUpdateEvent, ResolvedClusterConfig, ResolvedConfig, ResolvedRouteConfig, SnapshotConfig, StoredDocument, WalEntry };
|
|
172
|
+
//# sourceMappingURL=Types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Types.d.mts","names":[],"sources":["../src/Types.ts"],"sourcesContent":[],"mappings":";;;;;AAiDA;AAgBA;AAUA;AAOA;AAUA;AAQY,KAnFA,UAAA,GAmFa,MAAA,GAAG,OAAA;AAS5B;AAKA;AAUA;AAOY,UA7GK,WAAA,CA6GI;EAAiB,SAAU,MAAA,EAAA,MAAA;EACrC,SAAA,UAAA,EA5GY,UA4GZ;EACgC,SAAA,QAAA,CAAA,EA5GrB,MA4GqB,CAAA,MAAA,EAAA,OAAA,CAAA;;;;AAK3C;AAAoC,UAvGnB,cAAA,CAuG6B;EAClB;EAAxB,SAAU,KAAA,EAAA,OAAA;EACA;EAAV,SAAA,OAAA,EAAA,MAAA;EAAS;EAKI,SAAA,aAAA,EAAA,MAAuB;EACtB;EAGC,SAAA,OAAA,EAAA,MAAA;;;;;AAeG,UAnHL,QAAA,CAmHK;EAAc;EAMnB,SAAA,WAAA,EAvHO,WAAA,CAAY,WAuHW;EAC7B;EACgB,SAAA,OAAA,EAAA,MAAA;EAAxB;EAAuB,SAAA,SAAA,EAAA,MAAA;AAYjC;AAkBA;;;AAE4B,UA3IX,aAAA,CA2IW;EAAR;EACC,SAAS,IAAA,EAAA,OAAA;EACN;EAGD,SAAS,MAAA,CAAA,EAAA,MAAA;;AAQhC;AASA;;AACyB,UAxJR,gBAAA,CAwJQ;EAAf,SAAA,SAAA,EAvJY,MAuJZ,CAAA,MAAA,EAvJ2B,aAuJ3B,CAAA;;;;;UAjJO,mBAAA;;;;;;;;;UAUA,mBAAA;;;;;;;KAQL,aAAA,GAAgB,sBAAsB;;;;KAStC,aAAA,GAAgB,QAAA,CAAS;;;;UAKpB,cAAA;;qBAEI;;;;;;;UAQJ,cAAA;;;;;;KAOL,0BAA0B,SAAA,CAAU,0BACrC,mBACN,MAAA,CAAO,OAAO,SAAA,CAAU,cAAc;;;;KAK/B,wBAAwB,SAAA,CAAU,gBAC1C,SAAA,CAAU,cAAc,WACxB,UAAU;;;;UAKG,wCACC,SAAA,CAAU;;mBAGT;;qBAGE,QAAQ;;sBAGP,QAAA,CAAS;;yBAGN;;;;sBAMH;;;;;UAML,+CACC,SAAA,CAAU,sBAClB,wBAAwB;;;;;;;UAYjB,sBAAA;;;;+BAKc;;8BAGD;;;;;UAUb,+BAA+B,SAAA,CAAU;mBACvC;oBACC,QAAQ;qBACP,QAAA,CAAS;wBACN,QAAA,CAAS;;;uBAGV,QAAA,CAAS;;;;;;;UAQf,mBAAA;;8BAEa,QAAA,CAAS;6BACV,QAAA,CAAS;;;;;UAMrB,sCAAsC,SAAA,CAAU,sBACvD,eAAe"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
//#region rolldown:runtime
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
3
|
var __export = (all, symbols) => {
|
|
9
4
|
let target = {};
|
|
10
5
|
for (var name in all) {
|
|
@@ -18,26 +13,7 @@ var __export = (all, symbols) => {
|
|
|
18
13
|
}
|
|
19
14
|
return target;
|
|
20
15
|
};
|
|
21
|
-
var __copyProps = (to, from, except, desc) => {
|
|
22
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
24
|
-
key = keys[i];
|
|
25
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
26
|
-
__defProp(to, key, {
|
|
27
|
-
get: ((k) => from[k]).bind(null, key),
|
|
28
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return to;
|
|
34
|
-
};
|
|
35
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
36
|
-
value: mod,
|
|
37
|
-
enumerable: true
|
|
38
|
-
}) : target, mod));
|
|
39
16
|
|
|
40
17
|
//#endregion
|
|
41
18
|
|
|
42
|
-
exports.__export = __export;
|
|
43
|
-
exports.__toESM = __toESM;
|
|
19
|
+
exports.__export = __export;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
|
|
1
3
|
//#region rolldown:runtime
|
|
2
4
|
var __defProp = Object.defineProperty;
|
|
3
5
|
var __export = (all, symbols) => {
|
|
@@ -13,6 +15,7 @@ var __export = (all, symbols) => {
|
|
|
13
15
|
}
|
|
14
16
|
return target;
|
|
15
17
|
};
|
|
18
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
16
19
|
|
|
17
20
|
//#endregion
|
|
18
|
-
export { __export };
|
|
21
|
+
export { __export, __require };
|
package/dist/index.cjs
CHANGED
|
@@ -1,79 +1,41 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
1
|
+
const require_ColdStorage = require('./ColdStorage.cjs');
|
|
2
|
+
const require_Errors = require('./Errors.cjs');
|
|
3
|
+
const require_HotStorage = require('./HotStorage.cjs');
|
|
4
|
+
const require_Metrics = require('./Metrics.cjs');
|
|
3
5
|
const require_DocumentManager = require('./DocumentManager.cjs');
|
|
4
|
-
const require_MimicAuthService = require('./MimicAuthService.cjs');
|
|
5
6
|
const require_PresenceManager = require('./PresenceManager.cjs');
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
7
|
+
const require_MimicServerEngine = require('./MimicServerEngine.cjs');
|
|
8
|
+
const require_MimicClusterServerEngine = require('./MimicClusterServerEngine.cjs');
|
|
9
|
+
const require_Protocol = require('./Protocol.cjs');
|
|
10
|
+
const require_MimicAuthService = require('./MimicAuthService.cjs');
|
|
10
11
|
const require_MimicServer = require('./MimicServer.cjs');
|
|
11
|
-
const require_DocumentProtocol = require('./DocumentProtocol.cjs');
|
|
12
12
|
|
|
13
|
-
exports.AuthenticationError =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
exports.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Object.defineProperty(exports, 'MimicDataStorage', {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () {
|
|
45
|
-
return require_MimicDataStorage.MimicDataStorage_exports;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, 'MimicInMemoryDataStorage', {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return require_InMemoryDataStorage.InMemoryDataStorage_exports;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
Object.defineProperty(exports, 'MimicNoAuth', {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return require_NoAuth.NoAuth_exports;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
Object.defineProperty(exports, 'MimicServer', {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function () {
|
|
63
|
-
return require_MimicServer.MimicServer_exports;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
exports.MissingDocumentIdError = require_errors.MissingDocumentIdError;
|
|
67
|
-
Object.defineProperty(exports, 'PresenceManager', {
|
|
68
|
-
enumerable: true,
|
|
69
|
-
get: function () {
|
|
70
|
-
return require_PresenceManager.PresenceManager_exports;
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
exports.TransactionRejectedError = require_errors.TransactionRejectedError;
|
|
74
|
-
Object.defineProperty(exports, 'WebSocketHandler', {
|
|
75
|
-
enumerable: true,
|
|
76
|
-
get: function () {
|
|
77
|
-
return require_WebSocketHandler.WebSocketHandler_exports;
|
|
78
|
-
}
|
|
79
|
-
});
|
|
13
|
+
exports.AuthenticationError = require_Errors.AuthenticationError;
|
|
14
|
+
exports.AuthorizationError = require_Errors.AuthorizationError;
|
|
15
|
+
exports.ColdStorage = require_ColdStorage.ColdStorage;
|
|
16
|
+
exports.ColdStorageError = require_Errors.ColdStorageError;
|
|
17
|
+
exports.ColdStorageTag = require_ColdStorage.ColdStorageTag;
|
|
18
|
+
exports.DocumentManager = require_DocumentManager.DocumentManager;
|
|
19
|
+
exports.DocumentManagerConfigTag = require_DocumentManager.DocumentManagerConfigTag;
|
|
20
|
+
exports.DocumentManagerTag = require_DocumentManager.DocumentManagerTag;
|
|
21
|
+
exports.HotStorage = require_HotStorage.HotStorage;
|
|
22
|
+
exports.HotStorageError = require_Errors.HotStorageError;
|
|
23
|
+
exports.HotStorageTag = require_HotStorage.HotStorageTag;
|
|
24
|
+
exports.MessageParseError = require_Errors.MessageParseError;
|
|
25
|
+
exports.MimicAuthService = require_MimicAuthService.MimicAuthService;
|
|
26
|
+
exports.MimicAuthServiceTag = require_MimicAuthService.MimicAuthServiceTag;
|
|
27
|
+
exports.MimicClusterServerEngine = require_MimicClusterServerEngine.MimicClusterServerEngine;
|
|
28
|
+
exports.MimicMetrics = require_Metrics.MimicMetrics;
|
|
29
|
+
exports.MimicServer = require_MimicServer.MimicServer;
|
|
30
|
+
exports.MimicServerEngine = require_MimicServerEngine.MimicServerEngine;
|
|
31
|
+
exports.MimicServerEngineTag = require_MimicServerEngine.MimicServerEngineTag;
|
|
32
|
+
exports.MissingDocumentIdError = require_Errors.MissingDocumentIdError;
|
|
33
|
+
exports.PresenceManager = require_PresenceManager.PresenceManager;
|
|
34
|
+
exports.PresenceManagerTag = require_PresenceManager.PresenceManagerTag;
|
|
35
|
+
Object.defineProperty(exports, 'Protocol', {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () {
|
|
38
|
+
return require_Protocol.Protocol_exports;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
exports.TransactionRejectedError = require_Errors.TransactionRejectedError;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
1
|
+
import { AuthContext, DurationInput, Initial, InitialContext, InitialFn, MimicClusterServerEngineConfig, MimicServerEngineConfig, MimicServerRouteConfig, Permission, PresenceEntry, PresenceEvent, PresenceRemoveEvent, PresenceSnapshot, PresenceUpdateEvent, ResolvedClusterConfig, ResolvedConfig, ResolvedRouteConfig, SnapshotConfig, StoredDocument, WalEntry } from "./Types.cjs";
|
|
2
|
+
import { AuthenticationError, AuthorizationError, ColdStorageError, HotStorageError, MessageParseError, MimicError, MissingDocumentIdError, TransactionRejectedError } from "./Errors.cjs";
|
|
3
|
+
import { Protocol_d_exports } from "./Protocol.cjs";
|
|
4
|
+
import { ColdStorage, ColdStorageTag } from "./ColdStorage.cjs";
|
|
5
|
+
import { HotStorage, HotStorageTag } from "./HotStorage.cjs";
|
|
6
|
+
import { MimicAuthService, MimicAuthServiceTag } from "./MimicAuthService.cjs";
|
|
7
|
+
import { DocumentManager, DocumentManagerConfigTag, DocumentManagerTag, SubmitResult } from "./DocumentManager.cjs";
|
|
8
|
+
import { MimicServerEngine, MimicServerEngineTag } from "./MimicServerEngine.cjs";
|
|
9
|
+
import { MimicClusterServerEngine } from "./MimicClusterServerEngine.cjs";
|
|
10
|
+
import { MimicServer } from "./MimicServer.cjs";
|
|
11
|
+
import { MimicMetrics } from "./Metrics.cjs";
|
|
12
|
+
import { PresenceManager, PresenceManagerTag } from "./PresenceManager.cjs";
|
|
13
|
+
export { type AuthContext, AuthenticationError, AuthorizationError, ColdStorage, ColdStorageError, ColdStorageTag, DocumentManager, DocumentManagerConfigTag, DocumentManagerTag, type DurationInput, HotStorage, HotStorageError, HotStorageTag, type Initial, type InitialContext, type InitialFn, MessageParseError, MimicAuthService, MimicAuthServiceTag, MimicClusterServerEngine, type MimicClusterServerEngineConfig, type MimicError, MimicMetrics, MimicServer, MimicServerEngine, type MimicServerEngineConfig, MimicServerEngineTag, type MimicServerRouteConfig, MissingDocumentIdError, type Permission, type PresenceEntry, type PresenceEvent, PresenceManager, PresenceManagerTag, type PresenceRemoveEvent, type PresenceSnapshot, type PresenceUpdateEvent, Protocol_d_exports as Protocol, type ResolvedClusterConfig, type ResolvedConfig, type ResolvedRouteConfig, type SnapshotConfig, type StoredDocument, type SubmitResult, TransactionRejectedError, type WalEntry };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
1
|
+
import { AuthContext, DurationInput, Initial, InitialContext, InitialFn, MimicClusterServerEngineConfig, MimicServerEngineConfig, MimicServerRouteConfig, Permission, PresenceEntry, PresenceEvent, PresenceRemoveEvent, PresenceSnapshot, PresenceUpdateEvent, ResolvedClusterConfig, ResolvedConfig, ResolvedRouteConfig, SnapshotConfig, StoredDocument, WalEntry } from "./Types.mjs";
|
|
2
|
+
import { AuthenticationError, AuthorizationError, ColdStorageError, HotStorageError, MessageParseError, MimicError, MissingDocumentIdError, TransactionRejectedError } from "./Errors.mjs";
|
|
3
|
+
import { Protocol_d_exports } from "./Protocol.mjs";
|
|
4
|
+
import { ColdStorage, ColdStorageTag } from "./ColdStorage.mjs";
|
|
5
|
+
import { HotStorage, HotStorageTag } from "./HotStorage.mjs";
|
|
6
|
+
import { MimicAuthService, MimicAuthServiceTag } from "./MimicAuthService.mjs";
|
|
7
|
+
import { DocumentManager, DocumentManagerConfigTag, DocumentManagerTag, SubmitResult } from "./DocumentManager.mjs";
|
|
8
|
+
import { MimicServerEngine, MimicServerEngineTag } from "./MimicServerEngine.mjs";
|
|
9
|
+
import { MimicClusterServerEngine } from "./MimicClusterServerEngine.mjs";
|
|
10
|
+
import { MimicServer } from "./MimicServer.mjs";
|
|
11
|
+
import { MimicMetrics } from "./Metrics.mjs";
|
|
12
|
+
import { PresenceManager, PresenceManagerTag } from "./PresenceManager.mjs";
|
|
13
|
+
export { type AuthContext, AuthenticationError, AuthorizationError, ColdStorage, ColdStorageError, ColdStorageTag, DocumentManager, DocumentManagerConfigTag, DocumentManagerTag, type DurationInput, HotStorage, HotStorageError, HotStorageTag, type Initial, type InitialContext, type InitialFn, MessageParseError, MimicAuthService, MimicAuthServiceTag, MimicClusterServerEngine, type MimicClusterServerEngineConfig, type MimicError, MimicMetrics, MimicServer, MimicServerEngine, type MimicServerEngineConfig, MimicServerEngineTag, type MimicServerRouteConfig, MissingDocumentIdError, type Permission, type PresenceEntry, type PresenceEvent, PresenceManager, PresenceManagerTag, type PresenceRemoveEvent, type PresenceSnapshot, type PresenceUpdateEvent, Protocol_d_exports as Protocol, type ResolvedClusterConfig, type ResolvedConfig, type ResolvedRouteConfig, type SnapshotConfig, type StoredDocument, type SubmitResult, TransactionRejectedError, type WalEntry };
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { ColdStorage, ColdStorageTag } from "./ColdStorage.mjs";
|
|
2
|
+
import { AuthenticationError, AuthorizationError, ColdStorageError, HotStorageError, MessageParseError, MissingDocumentIdError, TransactionRejectedError } from "./Errors.mjs";
|
|
3
|
+
import { HotStorage, HotStorageTag } from "./HotStorage.mjs";
|
|
4
|
+
import { MimicMetrics } from "./Metrics.mjs";
|
|
5
|
+
import { DocumentManager, DocumentManagerConfigTag, DocumentManagerTag } from "./DocumentManager.mjs";
|
|
6
|
+
import { PresenceManager, PresenceManagerTag } from "./PresenceManager.mjs";
|
|
7
|
+
import { MimicServerEngine, MimicServerEngineTag } from "./MimicServerEngine.mjs";
|
|
8
|
+
import { MimicClusterServerEngine } from "./MimicClusterServerEngine.mjs";
|
|
9
|
+
import { Protocol_exports } from "./Protocol.mjs";
|
|
10
|
+
import { MimicAuthService, MimicAuthServiceTag } from "./MimicAuthService.mjs";
|
|
11
|
+
import { MimicServer } from "./MimicServer.mjs";
|
|
12
12
|
|
|
13
|
-
export { AuthenticationError,
|
|
13
|
+
export { AuthenticationError, AuthorizationError, ColdStorage, ColdStorageError, ColdStorageTag, DocumentManager, DocumentManagerConfigTag, DocumentManagerTag, HotStorage, HotStorageError, HotStorageTag, MessageParseError, MimicAuthService, MimicAuthServiceTag, MimicClusterServerEngine, MimicMetrics, MimicServer, MimicServerEngine, MimicServerEngineTag, MissingDocumentIdError, PresenceManager, PresenceManagerTag, Protocol_exports as Protocol, TransactionRejectedError };
|