@livestore/common 0.0.55-dev.0 → 0.0.55-dev.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/dist/.tsbuildinfo +1 -1
- package/dist/adapter-types.d.ts +1 -0
- package/dist/adapter-types.d.ts.map +1 -1
- package/dist/adapter-types.js +1 -0
- package/dist/adapter-types.js.map +1 -1
- package/dist/devtools/devtools-messages.d.ts +174 -30
- package/dist/devtools/devtools-messages.d.ts.map +1 -1
- package/dist/devtools/devtools-messages.js +82 -159
- package/dist/devtools/devtools-messages.js.map +1 -1
- package/dist/devtools/index.d.ts +4 -0
- package/dist/devtools/index.d.ts.map +1 -1
- package/dist/devtools/index.js +9 -0
- package/dist/devtools/index.js.map +1 -1
- package/dist/rehydrate-from-mutationlog.d.ts +2 -2
- package/dist/rehydrate-from-mutationlog.d.ts.map +1 -1
- package/dist/rehydrate-from-mutationlog.js +10 -11
- package/dist/rehydrate-from-mutationlog.js.map +1 -1
- package/package.json +3 -3
- package/src/adapter-types.ts +1 -0
- package/src/devtools/devtools-messages.ts +103 -170
- package/src/devtools/index.ts +11 -0
- package/src/rehydrate-from-mutationlog.ts +21 -11
|
@@ -7,149 +7,89 @@ import { liveStoreVersion as pkgVersion } from '../version.js';
|
|
|
7
7
|
const requestId = Schema.String;
|
|
8
8
|
const channelId = Schema.String;
|
|
9
9
|
const liveStoreVersion = Schema.Literal(pkgVersion);
|
|
10
|
-
|
|
10
|
+
const LSDMessage = (tag, fields) => Schema.TaggedStruct(tag, {
|
|
11
11
|
liveStoreVersion,
|
|
12
|
-
|
|
12
|
+
...fields,
|
|
13
|
+
}).annotations({ identifier: tag });
|
|
14
|
+
const LSDChannelMessage = (tag, fields) => LSDMessage(tag, {
|
|
13
15
|
channelId,
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
liveStoreVersion,
|
|
16
|
+
...fields,
|
|
17
|
+
});
|
|
18
|
+
const LSDReqResMessage = (tag, fields) => LSDChannelMessage(tag, {
|
|
18
19
|
requestId,
|
|
20
|
+
...fields,
|
|
21
|
+
});
|
|
22
|
+
export class SnapshotReq extends LSDReqResMessage('LSD.SnapshotReq', {}) {
|
|
23
|
+
}
|
|
24
|
+
export class SnapshotRes extends LSDReqResMessage('LSD.SnapshotRes', {
|
|
19
25
|
snapshot: Transferable.Uint8Array,
|
|
20
|
-
})
|
|
26
|
+
}) {
|
|
21
27
|
}
|
|
22
|
-
export class LoadDatabaseFileReq extends
|
|
23
|
-
liveStoreVersion,
|
|
24
|
-
requestId,
|
|
25
|
-
channelId,
|
|
28
|
+
export class LoadDatabaseFileReq extends LSDReqResMessage('LSD.LoadDatabaseFileReq', {
|
|
26
29
|
data: Transferable.Uint8Array,
|
|
27
|
-
})
|
|
30
|
+
}) {
|
|
28
31
|
}
|
|
29
|
-
export class LoadDatabaseFileRes extends
|
|
30
|
-
liveStoreVersion,
|
|
31
|
-
requestId,
|
|
32
|
+
export class LoadDatabaseFileRes extends LSDReqResMessage('LSD.LoadDatabaseFileRes', {
|
|
32
33
|
status: Schema.Literal('ok', 'unsupported-file', 'unsupported-database'),
|
|
33
|
-
})
|
|
34
|
+
}) {
|
|
34
35
|
}
|
|
35
|
-
export class DebugInfoReq extends
|
|
36
|
-
liveStoreVersion,
|
|
37
|
-
requestId,
|
|
38
|
-
channelId,
|
|
39
|
-
}).annotations({ identifier: 'LSD.DebugInfoReq' }) {
|
|
36
|
+
export class DebugInfoReq extends LSDReqResMessage('LSD.DebugInfoReq', {}) {
|
|
40
37
|
}
|
|
41
|
-
export class DebugInfoRes extends
|
|
42
|
-
liveStoreVersion,
|
|
43
|
-
requestId,
|
|
38
|
+
export class DebugInfoRes extends LSDReqResMessage('LSD.DebugInfoRes', {
|
|
44
39
|
debugInfo: DebugInfo,
|
|
45
|
-
})
|
|
40
|
+
}) {
|
|
46
41
|
}
|
|
47
|
-
export class DebugInfoHistorySubscribe extends
|
|
48
|
-
liveStoreVersion,
|
|
49
|
-
requestId,
|
|
50
|
-
channelId,
|
|
51
|
-
}).annotations({ identifier: 'LSD.DebugInfoHistorySubscribe' }) {
|
|
42
|
+
export class DebugInfoHistorySubscribe extends LSDReqResMessage('LSD.DebugInfoHistorySubscribe', {}) {
|
|
52
43
|
}
|
|
53
|
-
export class DebugInfoHistoryRes extends
|
|
54
|
-
liveStoreVersion,
|
|
55
|
-
requestId,
|
|
44
|
+
export class DebugInfoHistoryRes extends LSDReqResMessage('LSD.DebugInfoHistoryRes', {
|
|
56
45
|
debugInfoHistory: Schema.Array(DebugInfo),
|
|
57
|
-
})
|
|
46
|
+
}) {
|
|
58
47
|
}
|
|
59
|
-
export class DebugInfoHistoryUnsubscribe extends
|
|
60
|
-
liveStoreVersion,
|
|
61
|
-
requestId,
|
|
62
|
-
channelId,
|
|
63
|
-
}).annotations({ identifier: 'LSD.DebugInfoHistoryUnsubscribe' }) {
|
|
48
|
+
export class DebugInfoHistoryUnsubscribe extends LSDReqResMessage('LSD.DebugInfoHistoryUnsubscribe', {}) {
|
|
64
49
|
}
|
|
65
|
-
export class DebugInfoResetReq extends
|
|
66
|
-
liveStoreVersion,
|
|
67
|
-
requestId,
|
|
68
|
-
channelId,
|
|
69
|
-
}).annotations({ identifier: 'LSD.DebugInfoResetReq' }) {
|
|
50
|
+
export class DebugInfoResetReq extends LSDReqResMessage('LSD.DebugInfoResetReq', {}) {
|
|
70
51
|
}
|
|
71
|
-
export class DebugInfoResetRes extends
|
|
72
|
-
liveStoreVersion,
|
|
73
|
-
requestId,
|
|
74
|
-
}).annotations({ identifier: 'LSD.DebugInfoResetRes' }) {
|
|
52
|
+
export class DebugInfoResetRes extends LSDReqResMessage('LSD.DebugInfoResetRes', {}) {
|
|
75
53
|
}
|
|
76
|
-
export class DebugInfoRerunQueryReq extends
|
|
77
|
-
liveStoreVersion,
|
|
78
|
-
requestId,
|
|
79
|
-
channelId,
|
|
54
|
+
export class DebugInfoRerunQueryReq extends LSDReqResMessage('LSD.DebugInfoRerunQueryReq', {
|
|
80
55
|
queryStr: Schema.String,
|
|
81
56
|
bindValues: Schema.UndefinedOr(PreparedBindValues),
|
|
82
57
|
queriedTables: Schema.ReadonlySet(Schema.String),
|
|
83
|
-
})
|
|
58
|
+
}) {
|
|
84
59
|
}
|
|
85
|
-
export class DebugInfoRerunQueryRes extends
|
|
86
|
-
liveStoreVersion,
|
|
87
|
-
requestId,
|
|
88
|
-
}).annotations({ identifier: 'LSD.DebugInfoRerunQueryRes' }) {
|
|
60
|
+
export class DebugInfoRerunQueryRes extends LSDReqResMessage('LSD.DebugInfoRerunQueryRes', {}) {
|
|
89
61
|
}
|
|
90
|
-
export class MutationBroadcast extends
|
|
91
|
-
liveStoreVersion,
|
|
62
|
+
export class MutationBroadcast extends LSDMessage('LSD.MutationBroadcast', {
|
|
92
63
|
mutationEventEncoded: mutationEventSchemaEncodedAny,
|
|
93
64
|
persisted: Schema.Boolean,
|
|
94
|
-
})
|
|
65
|
+
}) {
|
|
95
66
|
}
|
|
96
|
-
export class RunMutationReq extends
|
|
97
|
-
liveStoreVersion,
|
|
98
|
-
requestId,
|
|
99
|
-
channelId,
|
|
67
|
+
export class RunMutationReq extends LSDReqResMessage('LSD.RunMutationReq', {
|
|
100
68
|
mutationEventEncoded: mutationEventSchemaEncodedAny,
|
|
101
69
|
persisted: Schema.Boolean,
|
|
102
|
-
})
|
|
70
|
+
}) {
|
|
103
71
|
}
|
|
104
|
-
export class RunMutationRes extends
|
|
105
|
-
liveStoreVersion,
|
|
106
|
-
requestId,
|
|
107
|
-
channelId,
|
|
108
|
-
}).annotations({ identifier: 'LSD.RunMutationRes' }) {
|
|
72
|
+
export class RunMutationRes extends LSDReqResMessage('LSD.RunMutationRes', {}) {
|
|
109
73
|
}
|
|
110
|
-
export class MutationLogReq extends
|
|
111
|
-
liveStoreVersion,
|
|
112
|
-
requestId,
|
|
113
|
-
channelId,
|
|
114
|
-
}).annotations({ identifier: 'LSD.MutationLogReq' }) {
|
|
74
|
+
export class MutationLogReq extends LSDReqResMessage('LSD.MutationLogReq', {}) {
|
|
115
75
|
}
|
|
116
|
-
export class MutationLogRes extends
|
|
117
|
-
liveStoreVersion,
|
|
118
|
-
requestId,
|
|
119
|
-
channelId,
|
|
76
|
+
export class MutationLogRes extends LSDReqResMessage('LSD.MutationLogRes', {
|
|
120
77
|
mutationLog: Transferable.Uint8Array,
|
|
121
|
-
})
|
|
78
|
+
}) {
|
|
122
79
|
}
|
|
123
|
-
export class ReactivityGraphSubscribe extends
|
|
124
|
-
liveStoreVersion,
|
|
125
|
-
requestId,
|
|
126
|
-
channelId,
|
|
80
|
+
export class ReactivityGraphSubscribe extends LSDReqResMessage('LSD.ReactivityGraphSubscribe', {
|
|
127
81
|
includeResults: Schema.Boolean,
|
|
128
|
-
})
|
|
82
|
+
}) {
|
|
129
83
|
}
|
|
130
|
-
export class ReactivityGraphUnsubscribe extends
|
|
131
|
-
liveStoreVersion,
|
|
132
|
-
requestId,
|
|
133
|
-
channelId,
|
|
134
|
-
}).annotations({ identifier: 'LSD.ReactivityGraphUnsubscribe' }) {
|
|
84
|
+
export class ReactivityGraphUnsubscribe extends LSDReqResMessage('LSD.ReactivityGraphUnsubscribe', {}) {
|
|
135
85
|
}
|
|
136
|
-
export class ReactivityGraphRes extends
|
|
137
|
-
liveStoreVersion,
|
|
138
|
-
requestId,
|
|
86
|
+
export class ReactivityGraphRes extends LSDReqResMessage('LSD.ReactivityGraphRes', {
|
|
139
87
|
reactivityGraph: Schema.Any,
|
|
140
|
-
})
|
|
88
|
+
}) {
|
|
141
89
|
}
|
|
142
|
-
export class LiveQueriesSubscribe extends
|
|
143
|
-
liveStoreVersion,
|
|
144
|
-
requestId,
|
|
145
|
-
channelId,
|
|
146
|
-
}).annotations({ identifier: 'LSD.LiveQueriesSubscribe' }) {
|
|
90
|
+
export class LiveQueriesSubscribe extends LSDReqResMessage('LSD.LiveQueriesSubscribe', {}) {
|
|
147
91
|
}
|
|
148
|
-
export class LiveQueriesUnsubscribe extends
|
|
149
|
-
liveStoreVersion,
|
|
150
|
-
requestId,
|
|
151
|
-
channelId,
|
|
152
|
-
}).annotations({ identifier: 'LSD.LiveQueriesUnsubscribe' }) {
|
|
92
|
+
export class LiveQueriesUnsubscribe extends LSDReqResMessage('LSD.LiveQueriesUnsubscribe', {}) {
|
|
153
93
|
}
|
|
154
94
|
export class SerializedLiveQuery extends Schema.Struct({
|
|
155
95
|
_tag: Schema.Literal('js', 'sql', 'graphql'),
|
|
@@ -159,79 +99,62 @@ export class SerializedLiveQuery extends Schema.Struct({
|
|
|
159
99
|
executionTimes: Schema.Array(Schema.Number),
|
|
160
100
|
lastestResult: Schema.Any,
|
|
161
101
|
activeSubscriptions: Schema.Array(Schema.Struct({ frames: Schema.Array(Schema.Struct({ name: Schema.String, filePath: Schema.String })) })),
|
|
162
|
-
})
|
|
102
|
+
}) {
|
|
163
103
|
}
|
|
164
|
-
export class LiveQueriesRes extends
|
|
165
|
-
liveStoreVersion,
|
|
166
|
-
requestId,
|
|
104
|
+
export class LiveQueriesRes extends LSDReqResMessage('LSD.LiveQueriesRes', {
|
|
167
105
|
liveQueries: Schema.Array(SerializedLiveQuery),
|
|
168
|
-
})
|
|
106
|
+
}) {
|
|
169
107
|
}
|
|
170
|
-
export class ResetAllDataReq extends
|
|
171
|
-
liveStoreVersion,
|
|
172
|
-
requestId,
|
|
173
|
-
channelId,
|
|
108
|
+
export class ResetAllDataReq extends LSDReqResMessage('LSD.ResetAllDataReq', {
|
|
174
109
|
mode: Schema.Literal('all-data', 'only-app-db'),
|
|
175
|
-
})
|
|
110
|
+
}) {
|
|
176
111
|
}
|
|
177
|
-
export class ResetAllDataRes extends
|
|
178
|
-
liveStoreVersion,
|
|
179
|
-
requestId,
|
|
180
|
-
}).annotations({ identifier: 'LSD.ResetAllDataRes' }) {
|
|
112
|
+
export class ResetAllDataRes extends LSDReqResMessage('LSD.ResetAllDataRes', {}) {
|
|
181
113
|
}
|
|
182
|
-
export class
|
|
183
|
-
liveStoreVersion,
|
|
184
|
-
requestId,
|
|
185
|
-
channelId,
|
|
186
|
-
}).annotations({ identifier: 'LSD.MessagePortForStoreReq' }) {
|
|
114
|
+
export class DatabaseFileInfoReq extends LSDReqResMessage('LSD.DatabaseFileInfoReq', {}) {
|
|
187
115
|
}
|
|
188
|
-
export class
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
116
|
+
export class DatabaseFileInfoRes extends LSDReqResMessage('LSD.DatabaseFileInfoRes', {
|
|
117
|
+
dbFileSize: Schema.Number,
|
|
118
|
+
mutationLogFileSize: Schema.Number,
|
|
119
|
+
}) {
|
|
120
|
+
}
|
|
121
|
+
export class MessagePortForStoreReq extends LSDReqResMessage('LSD.MessagePortForStoreReq', {}) {
|
|
122
|
+
}
|
|
123
|
+
export class MessagePortForStoreRes extends LSDReqResMessage('LSD.MessagePortForStoreRes', {
|
|
192
124
|
port: Transferable.MessagePort,
|
|
193
|
-
})
|
|
125
|
+
}) {
|
|
194
126
|
}
|
|
195
|
-
export class NetworkStatusChanged extends
|
|
196
|
-
liveStoreVersion,
|
|
197
|
-
channelId,
|
|
127
|
+
export class NetworkStatusChanged extends LSDChannelMessage('LSD.NetworkStatusChanged', {
|
|
198
128
|
networkStatus: NetworkStatus,
|
|
199
|
-
})
|
|
129
|
+
}) {
|
|
200
130
|
}
|
|
201
|
-
export class
|
|
202
|
-
liveStoreVersion,
|
|
203
|
-
}).annotations({ identifier: 'LSD.DevtoolsReady' }) {
|
|
131
|
+
export class SyncingInfoReq extends LSDReqResMessage('LSD.SyncingInfoReq', {}) {
|
|
204
132
|
}
|
|
205
|
-
export class
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
})
|
|
133
|
+
export class SyncingInfo extends Schema.Struct({
|
|
134
|
+
enabled: Schema.Boolean,
|
|
135
|
+
metadata: Schema.Record({ key: Schema.String, value: Schema.Any }),
|
|
136
|
+
}) {
|
|
209
137
|
}
|
|
210
|
-
export class
|
|
211
|
-
|
|
212
|
-
|
|
138
|
+
export class SyncingInfoRes extends LSDReqResMessage('LSD.SyncingInfoRes', {
|
|
139
|
+
syncingInfo: SyncingInfo,
|
|
140
|
+
}) {
|
|
141
|
+
}
|
|
142
|
+
export class DevtoolsReady extends LSDMessage('LSD.DevtoolsReady', {}) {
|
|
143
|
+
}
|
|
144
|
+
export class DevtoolsConnected extends LSDChannelMessage('LSD.DevtoolsConnected', {}) {
|
|
145
|
+
}
|
|
146
|
+
export class AppHostReady extends LSDChannelMessage('LSD.AppHostReady', {
|
|
213
147
|
isLeaderTab: Schema.Boolean,
|
|
214
|
-
})
|
|
148
|
+
}) {
|
|
215
149
|
}
|
|
216
|
-
export class Disconnect extends
|
|
217
|
-
liveStoreVersion,
|
|
218
|
-
requestId,
|
|
219
|
-
channelId,
|
|
220
|
-
}).annotations({ identifier: 'LSD.Disconnect' }) {
|
|
150
|
+
export class Disconnect extends LSDReqResMessage('LSD.Disconnect', {}) {
|
|
221
151
|
}
|
|
222
|
-
export class Ping extends
|
|
223
|
-
liveStoreVersion,
|
|
224
|
-
requestId,
|
|
225
|
-
channelId,
|
|
226
|
-
}).annotations({ identifier: 'LSD.Ping' }) {
|
|
152
|
+
export class Ping extends LSDReqResMessage('LSD.Ping', {}) {
|
|
227
153
|
}
|
|
228
|
-
export class Pong extends
|
|
229
|
-
liveStoreVersion,
|
|
230
|
-
requestId,
|
|
231
|
-
}).annotations({ identifier: 'LSD.Pong' }) {
|
|
154
|
+
export class Pong extends LSDReqResMessage('LSD.Pong', {}) {
|
|
232
155
|
}
|
|
233
|
-
export const MessageToAppHostCoordinator = Schema.Union(SnapshotReq, LoadDatabaseFileReq, MutationLogReq, ResetAllDataReq, MessagePortForStoreRes, DevtoolsReady, Disconnect, DevtoolsConnected, RunMutationReq, Ping).annotations({ identifier: 'LSD.MessageToAppHostCoordinator' });
|
|
156
|
+
export const MessageToAppHostCoordinator = Schema.Union(SnapshotReq, LoadDatabaseFileReq, MutationLogReq, ResetAllDataReq, MessagePortForStoreRes, DevtoolsReady, Disconnect, DevtoolsConnected, RunMutationReq, Ping, DatabaseFileInfoReq, SyncingInfoReq).annotations({ identifier: 'LSD.MessageToAppHostCoordinator' });
|
|
234
157
|
export const MessageToAppHostStore = Schema.Union(DebugInfoReq, DebugInfoHistorySubscribe, DebugInfoHistoryUnsubscribe, DebugInfoResetReq, DebugInfoRerunQueryReq, ReactivityGraphSubscribe, ReactivityGraphUnsubscribe, LiveQueriesSubscribe, LiveQueriesUnsubscribe).annotations({ identifier: 'LSD.MessageToAppHostStore' });
|
|
235
|
-
export const MessageFromAppHostCoordinator = Schema.Union(SnapshotRes, LoadDatabaseFileRes, MutationLogRes, ResetAllDataRes, MessagePortForStoreReq, Disconnect, MutationBroadcast, AppHostReady, NetworkStatusChanged, RunMutationRes, Pong).annotations({ identifier: 'LSD.MessageFromAppHostCoordinator' });
|
|
158
|
+
export const MessageFromAppHostCoordinator = Schema.Union(SnapshotRes, LoadDatabaseFileRes, MutationLogRes, ResetAllDataRes, MessagePortForStoreReq, Disconnect, MutationBroadcast, AppHostReady, NetworkStatusChanged, RunMutationRes, Pong, DatabaseFileInfoRes, SyncingInfoRes).annotations({ identifier: 'LSD.MessageFromAppHostCoordinator' });
|
|
236
159
|
export const MessageFromAppHostStore = Schema.Union(DebugInfoRes, DebugInfoHistoryRes, DebugInfoResetRes, DebugInfoRerunQueryRes, ReactivityGraphRes, LiveQueriesRes).annotations({ identifier: 'LSD.MessageFromAppHostStore' });
|
|
237
160
|
//# sourceMappingURL=devtools-messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools-messages.js","sourceRoot":"","sources":["../../src/devtools/devtools-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,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index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { BrowserChannel } from '@livestore/utils/effect';
|
|
1
2
|
export * from './devtools-messages.js';
|
|
2
3
|
export * from './devtools-window-message.js';
|
|
4
|
+
export declare namespace WebBridge {
|
|
5
|
+
const makeBroadcastChannel: (key?: string) => import("effect/Effect").Effect<BrowserChannel.BrowserChannel<never, never>, never, import("effect/Scope").Scope>;
|
|
6
|
+
}
|
|
3
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/devtools/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/devtools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAU,MAAM,yBAAyB,CAAA;AAEhE,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAE5C,yBAAiB,SAAS,CAAC;IAClB,MAAM,oBAAoB,SAAU,MAAM,qHAK7C,CAAA;CACL"}
|
package/dist/devtools/index.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import { BrowserChannel, Schema } from '@livestore/utils/effect';
|
|
1
2
|
export * from './devtools-messages.js';
|
|
2
3
|
export * from './devtools-window-message.js';
|
|
4
|
+
export var WebBridge;
|
|
5
|
+
(function (WebBridge) {
|
|
6
|
+
WebBridge.makeBroadcastChannel = (key) => BrowserChannel.broadcastChannel({
|
|
7
|
+
channelName: `livestore-web-bridge-devtools${key ? `-${key}` : ''}`,
|
|
8
|
+
listenSchema: Schema.Never,
|
|
9
|
+
sendSchema: Schema.Never,
|
|
10
|
+
});
|
|
11
|
+
})(WebBridge || (WebBridge = {}));
|
|
3
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/devtools/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/devtools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAEhE,cAAc,wBAAwB,CAAA;AACtC,cAAc,8BAA8B,CAAA;AAE5C,MAAM,KAAW,SAAS,CAOzB;AAPD,WAAiB,SAAS;IACX,8BAAoB,GAAG,CAAC,GAAY,EAAE,EAAE,CACnD,cAAc,CAAC,gBAAgB,CAAC;QAC9B,WAAW,EAAE,gCAAgC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;QACnE,YAAY,EAAE,MAAM,CAAC,KAAK;QAC1B,UAAU,EAAE,MAAM,CAAC,KAAK;KACzB,CAAC,CAAA;AACN,CAAC,EAPgB,SAAS,KAAT,SAAS,QAOzB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect } from '@livestore/utils/effect';
|
|
2
|
-
import { type InMemoryDatabase, type MigrationOptionsFromMutationLog, SqliteError } from './adapter-types.js';
|
|
2
|
+
import { type InMemoryDatabase, type MigrationOptionsFromMutationLog, SqliteError, UnexpectedError } from './adapter-types.js';
|
|
3
3
|
import type { LiveStoreSchema } from './schema/index.js';
|
|
4
4
|
export declare const rehydrateFromMutationLog: ({ logDb, db, schema, migrationOptions, onProgress, }: {
|
|
5
5
|
logDb: InMemoryDatabase;
|
|
@@ -10,5 +10,5 @@ export declare const rehydrateFromMutationLog: ({ logDb, db, schema, migrationOp
|
|
|
10
10
|
done: number;
|
|
11
11
|
total: number;
|
|
12
12
|
}) => Effect.Effect<void>;
|
|
13
|
-
}) => Effect.Effect<void, SqliteError, never>;
|
|
13
|
+
}) => Effect.Effect<void, UnexpectedError | SqliteError, never>;
|
|
14
14
|
//# sourceMappingURL=rehydrate-from-mutationlog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rehydrate-from-mutationlog.d.ts","sourceRoot":"","sources":["../src/rehydrate-from-mutationlog.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,MAAM,EAA0B,MAAM,yBAAyB,CAAA;AAE/E,OAAO,
|
|
1
|
+
{"version":3,"file":"rehydrate-from-mutationlog.d.ts","sourceRoot":"","sources":["../src/rehydrate-from-mutationlog.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,MAAM,EAA0B,MAAM,yBAAyB,CAAA;AAE/E,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,+BAA+B,EACpC,WAAW,EACX,eAAe,EAChB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,KAAK,EAAE,eAAe,EAAmC,MAAM,mBAAmB,CAAA;AAKzF,eAAO,MAAM,wBAAwB,yDAMlC;IACD,KAAK,EAAE,gBAAgB,CAAA;IACvB,EAAE,EAAE,gBAAgB,CAAA;IACpB,MAAM,EAAE,eAAe,CAAA;IACvB,gBAAgB,EAAE,+BAA+B,CAAA;IACjD,UAAU,EAAE,CAAC,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;CACxE,8DA8GE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { memoizeByRef, shouldNeverHappen } from '@livestore/utils';
|
|
2
2
|
import { Chunk, Effect, Option, Schema, Stream } from '@livestore/utils/effect';
|
|
3
|
-
import { SqliteError } from './adapter-types.js';
|
|
3
|
+
import { SqliteError, UnexpectedError, } from './adapter-types.js';
|
|
4
4
|
import { getExecArgsFromMutation } from './mutation.js';
|
|
5
5
|
import { MUTATION_LOG_META_TABLE } from './schema/index.js';
|
|
6
6
|
import { sql } from './util.js';
|
|
@@ -14,21 +14,20 @@ export const rehydrateFromMutationLog = ({ logDb, db, schema, migrationOptions,
|
|
|
14
14
|
if (migrationOptions.excludeMutations?.has(row.mutation) === true)
|
|
15
15
|
return;
|
|
16
16
|
if (hashMutation(mutationDef) !== row.schemaHash) {
|
|
17
|
-
|
|
17
|
+
yield* Effect.logWarning(`Schema hash mismatch for mutation ${row.mutation}. Trying to apply mutation anyway.`);
|
|
18
18
|
}
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
There was an error
|
|
19
|
+
const argsDecoded = yield* Schema.decodeUnknown(Schema.parseJson(mutationDef.schema))(row.argsJson).pipe(Effect.mapError((cause) => UnexpectedError.make({
|
|
20
|
+
cause,
|
|
21
|
+
note: `\
|
|
22
|
+
There was an error during rehydrating from the mutation log while decoding
|
|
23
|
+
the persisted mutation event args for mutation "${row.mutation}".
|
|
23
24
|
This likely means the schema has changed in an incompatible way.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
`);
|
|
27
|
-
}
|
|
25
|
+
`,
|
|
26
|
+
})));
|
|
28
27
|
const mutationEventDecoded = {
|
|
29
28
|
id: row.id,
|
|
30
29
|
mutation: row.mutation,
|
|
31
|
-
args:
|
|
30
|
+
args: argsDecoded,
|
|
32
31
|
};
|
|
33
32
|
// const argsEncoded = JSON.parse(row.args_json)
|
|
34
33
|
// const mutationSqlRes =
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rehydrate-from-mutationlog.js","sourceRoot":"","sources":["../src/rehydrate-from-mutationlog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAE/E,OAAO,
|
|
1
|
+
{"version":3,"file":"rehydrate-from-mutationlog.js","sourceRoot":"","sources":["../src/rehydrate-from-mutationlog.ts"],"names":[],"m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,EAAE,CAAA;QAC3D,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAA;IAC1C,CAAC,CACF,CAAC,IAAI,CACJ,MAAM,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,EACpC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CACjB,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAClB,KAAK,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAA;QAE3B,kBAAkB,EAAE,CAAA;QACpB,KAAK,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,CAAA;IACxE,CAAC,CAAC,CACH,EACD,MAAM,CAAC,QAAQ,CAChB,CAAA;AACH,CAAC,CAAC,CAAC,IAAI,CACL,MAAM,CAAC,sBAAsB,CAAC,4CAA4C,CAAC,EAC3E,MAAM,CAAC,QAAQ,CAAC,4CAA4C,CAAC,CAC9D,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livestore/common",
|
|
3
|
-
"version": "0.0.55-dev.
|
|
3
|
+
"version": "0.0.55-dev.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@opentelemetry/api": "^1.9.0",
|
|
32
|
-
"@livestore/utils": "0.0.55-dev.
|
|
33
|
-
"effect-db-schema": "0.0.55-dev.
|
|
32
|
+
"@livestore/utils": "0.0.55-dev.2",
|
|
33
|
+
"effect-db-schema": "0.0.55-dev.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"vitest": "^2.0.4"
|
package/src/adapter-types.ts
CHANGED
|
@@ -93,6 +93,7 @@ export type BootDb = {
|
|
|
93
93
|
|
|
94
94
|
export class UnexpectedError extends Schema.TaggedError<UnexpectedError>()('LiveStore.UnexpectedError', {
|
|
95
95
|
cause: Schema.AnyError,
|
|
96
|
+
note: Schema.optional(Schema.String),
|
|
96
97
|
payload: Schema.optional(Schema.Any),
|
|
97
98
|
}) {
|
|
98
99
|
static mapToUnexpectedError = <A, E, R>(effect: Effect.Effect<A, E, R>) =>
|