@rocicorp/zero 0.18.2025032401 → 0.18.2025032900
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/out/advanced.js +0 -1
- package/out/{chunk-5WXONOGR.js → chunk-I7LQ2GI3.js} +230 -145
- package/out/chunk-I7LQ2GI3.js.map +7 -0
- package/out/{chunk-2B2QE5AT.js → chunk-MB3DEFRC.js} +25 -2
- package/out/{chunk-2B2QE5AT.js.map → chunk-MB3DEFRC.js.map} +2 -2
- package/out/{chunk-DSUPSGE4.js → chunk-NBZURO2P.js} +81 -26
- package/out/{chunk-DSUPSGE4.js.map → chunk-NBZURO2P.js.map} +4 -4
- package/out/{inspector-ROITQB3J.js → inspector-SH2ZK7O3.js} +253 -102
- package/out/inspector-SH2ZK7O3.js.map +7 -0
- package/out/react.js +2 -3
- package/out/react.js.map +2 -2
- package/out/shared/src/deep-merge.d.ts +6 -0
- package/out/shared/src/deep-merge.d.ts.map +1 -0
- package/out/shared/src/sentinels.d.ts +3 -0
- package/out/shared/src/sentinels.d.ts.map +1 -0
- package/out/solid.js +3 -4
- package/out/solid.js.map +2 -2
- package/out/z2s/src/compiler.d.ts +5 -3
- package/out/z2s/src/compiler.d.ts.map +1 -1
- package/out/z2s/src/compiler.js +116 -16
- package/out/z2s/src/compiler.js.map +1 -1
- package/out/z2s/src/sql.d.ts +8 -0
- package/out/z2s/src/sql.d.ts.map +1 -1
- package/out/z2s/src/sql.js +205 -11
- package/out/z2s/src/sql.js.map +1 -1
- package/out/zero/src/zero-cache-dev.d.ts +1 -1
- package/out/zero/src/zero-cache-dev.d.ts.map +1 -1
- package/out/zero/src/zero-cache-dev.js +1 -1
- package/out/zero/src/zero-cache-dev.js.map +1 -1
- package/out/zero-cache/src/auth/load-permissions.d.ts.map +1 -1
- package/out/zero-cache/src/auth/load-permissions.js +2 -1
- package/out/zero-cache/src/auth/load-permissions.js.map +1 -1
- package/out/zero-cache/src/config/zero-config.d.ts +1 -1
- package/out/zero-cache/src/config/zero-config.d.ts.map +1 -1
- package/out/zero-cache/src/config/zero-config.js +6 -3
- package/out/zero-cache/src/config/zero-config.js.map +1 -1
- package/out/zero-cache/src/db/migration-lite.d.ts.map +1 -1
- package/out/zero-cache/src/db/migration-lite.js +21 -9
- package/out/zero-cache/src/db/migration-lite.js.map +1 -1
- package/out/zero-cache/src/scripts/deploy-permissions.d.ts +1 -1
- package/out/zero-cache/src/scripts/deploy-permissions.d.ts.map +1 -1
- package/out/zero-cache/src/scripts/deploy-permissions.js +1 -1
- package/out/zero-cache/src/scripts/deploy-permissions.js.map +1 -1
- package/out/zero-cache/src/server/main.d.ts.map +1 -1
- package/out/zero-cache/src/server/main.js +17 -1
- package/out/zero-cache/src/server/main.js.map +1 -1
- package/out/zero-cache/src/server/multi/config.d.ts +1 -1
- package/out/zero-cache/src/server/multi/main.d.ts +1 -1
- package/out/zero-cache/src/server/multi/main.d.ts.map +1 -1
- package/out/zero-cache/src/server/multi/main.js +1 -1
- package/out/zero-cache/src/server/multi/main.js.map +1 -1
- package/out/zero-cache/src/server/multi/run-worker.d.ts +1 -1
- package/out/zero-cache/src/server/multi/run-worker.d.ts.map +1 -1
- package/out/zero-cache/src/server/multi/run-worker.js +1 -1
- package/out/zero-cache/src/server/multi/run-worker.js.map +1 -1
- package/out/zero-cache/src/server/syncer.js +1 -1
- package/out/zero-cache/src/server/syncer.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/change-source.d.ts +1 -1
- package/out/zero-cache/src/services/change-source/pg/change-source.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/change-source.js +96 -42
- package/out/zero-cache/src/services/change-source/pg/change-source.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/decommission.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/decommission.js +16 -5
- package/out/zero-cache/src/services/change-source/pg/decommission.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts +1 -2
- package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/initial-sync.js +18 -31
- package/out/zero-cache/src/services/change-source/pg/initial-sync.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/ddl.d.ts +7 -35
- package/out/zero-cache/src/services/change-source/pg/schema/ddl.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/ddl.js +42 -74
- package/out/zero-cache/src/services/change-source/pg/schema/ddl.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/init.js +69 -21
- package/out/zero-cache/src/services/change-source/pg/schema/init.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/shard.d.ts +54 -27
- package/out/zero-cache/src/services/change-source/pg/schema/shard.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/shard.js +53 -16
- package/out/zero-cache/src/services/change-source/pg/schema/shard.js.map +1 -1
- package/out/zero-cache/src/services/change-source/replica-schema.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/replica-schema.js +10 -1
- package/out/zero-cache/src/services/change-source/replica-schema.js.map +1 -1
- package/out/zero-cache/src/services/mutagen/mutagen.d.ts +7 -5
- package/out/zero-cache/src/services/mutagen/mutagen.d.ts.map +1 -1
- package/out/zero-cache/src/services/mutagen/mutagen.js +20 -5
- package/out/zero-cache/src/services/mutagen/mutagen.js.map +1 -1
- package/out/zero-cache/src/services/mutagen/pusher.d.ts +1 -1
- package/out/zero-cache/src/services/mutagen/pusher.d.ts.map +1 -1
- package/out/zero-cache/src/services/mutagen/pusher.js +24 -10
- package/out/zero-cache/src/services/mutagen/pusher.js.map +1 -1
- package/out/zero-cache/src/services/replicator/change-processor.d.ts.map +1 -1
- package/out/zero-cache/src/services/replicator/change-processor.js +25 -14
- package/out/zero-cache/src/services/replicator/change-processor.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-handler.d.ts +8 -4
- package/out/zero-cache/src/services/view-syncer/client-handler.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-handler.js +47 -23
- package/out/zero-cache/src/services/view-syncer/client-handler.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-schema.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-schema.js +8 -2
- package/out/zero-cache/src/services/view-syncer/client-schema.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts +2 -0
- package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr-store.js +35 -0
- package/out/zero-cache/src/services/view-syncer/cvr-store.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts +3 -0
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.js +32 -20
- package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
- package/out/zero-cache/src/types/bigint-json.d.ts +1 -1
- package/out/zero-cache/src/types/bigint-json.d.ts.map +1 -1
- package/out/zero-cache/src/types/bigint-json.js.map +1 -1
- package/out/zero-cache/src/types/lite.d.ts.map +1 -1
- package/out/zero-cache/src/types/lite.js +4 -3
- package/out/zero-cache/src/types/lite.js.map +1 -1
- package/out/zero-cache/src/types/shards.d.ts +4 -0
- package/out/zero-cache/src/types/shards.d.ts.map +1 -1
- package/out/zero-cache/src/types/shards.js +1 -1
- package/out/zero-cache/src/types/shards.js.map +1 -1
- package/out/zero-cache/src/workers/connection.d.ts +1 -2
- package/out/zero-cache/src/workers/connection.d.ts.map +1 -1
- package/out/zero-cache/src/workers/connection.js +64 -21
- package/out/zero-cache/src/workers/connection.js.map +1 -1
- package/out/zero-cache/src/workers/replicator.d.ts.map +1 -1
- package/out/zero-cache/src/workers/replicator.js +4 -8
- package/out/zero-cache/src/workers/replicator.js.map +1 -1
- package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts.map +1 -1
- package/out/zero-cache/src/workers/syncer-ws-message-handler.js +16 -7
- package/out/zero-cache/src/workers/syncer-ws-message-handler.js.map +1 -1
- package/out/zero-client/src/client/custom.d.ts +9 -11
- package/out/zero-client/src/client/custom.d.ts.map +1 -1
- package/out/zero-client/src/client/inspector/inspector.d.ts +2 -1
- package/out/zero-client/src/client/inspector/inspector.d.ts.map +1 -1
- package/out/zero-client/src/client/inspector/types.d.ts +7 -2
- package/out/zero-client/src/client/inspector/types.d.ts.map +1 -1
- package/out/zero-client/src/client/mutation-tracker.d.ts +23 -8
- package/out/zero-client/src/client/mutation-tracker.d.ts.map +1 -1
- package/out/zero-client/src/client/options.d.ts +7 -2
- package/out/zero-client/src/client/options.d.ts.map +1 -1
- package/out/zero-client/src/client/query-manager.d.ts +2 -1
- package/out/zero-client/src/client/query-manager.d.ts.map +1 -1
- package/out/zero-client/src/client/zero.d.ts +2 -1
- package/out/zero-client/src/client/zero.d.ts.map +1 -1
- package/out/zero-client/src/mod.d.ts +8 -2
- package/out/zero-client/src/mod.d.ts.map +1 -1
- package/out/zero-pg/src/custom.d.ts +2 -13
- package/out/zero-pg/src/custom.d.ts.map +1 -1
- package/out/zero-pg/src/custom.js +11 -14
- package/out/zero-pg/src/custom.js.map +1 -1
- package/out/zero-pg/src/mod.d.ts +2 -2
- package/out/zero-pg/src/mod.d.ts.map +1 -1
- package/out/zero-pg/src/mod.js +2 -1
- package/out/zero-pg/src/mod.js.map +1 -1
- package/out/zero-pg/src/postgres-connection.d.ts +30 -0
- package/out/zero-pg/src/postgres-connection.d.ts.map +1 -0
- package/out/zero-pg/src/postgres-connection.js +31 -0
- package/out/zero-pg/src/postgres-connection.js.map +1 -0
- package/out/zero-pg/src/query.d.ts +2 -2
- package/out/zero-pg/src/query.d.ts.map +1 -1
- package/out/zero-pg/src/query.js +8 -15
- package/out/zero-pg/src/query.js.map +1 -1
- package/out/zero-pg/src/web.d.ts +5 -13
- package/out/zero-pg/src/web.d.ts.map +1 -1
- package/out/zero-pg/src/web.js +13 -20
- package/out/zero-pg/src/web.js.map +1 -1
- package/out/zero-protocol/src/client-schema.d.ts +1 -1
- package/out/zero-protocol/src/client-schema.d.ts.map +1 -1
- package/out/zero-protocol/src/client-schema.js +1 -1
- package/out/zero-protocol/src/client-schema.js.map +1 -1
- package/out/zero-protocol/src/down.d.ts +19 -4
- package/out/zero-protocol/src/down.d.ts.map +1 -1
- package/out/zero-protocol/src/down.js +2 -2
- package/out/zero-protocol/src/down.js.map +1 -1
- package/out/zero-protocol/src/inspect-down.d.ts +59 -0
- package/out/zero-protocol/src/inspect-down.d.ts.map +1 -0
- package/out/zero-protocol/src/inspect-down.js +23 -0
- package/out/zero-protocol/src/inspect-down.js.map +1 -0
- package/out/zero-protocol/src/inspect-up.d.ts +21 -0
- package/out/zero-protocol/src/inspect-up.d.ts.map +1 -0
- package/out/zero-protocol/src/inspect-up.js +12 -0
- package/out/zero-protocol/src/inspect-up.js.map +1 -0
- package/out/zero-protocol/src/mutation-type-enum.d.ts +1 -0
- package/out/zero-protocol/src/mutation-type-enum.d.ts.map +1 -1
- package/out/zero-protocol/src/protocol-version.d.ts +1 -1
- package/out/zero-protocol/src/protocol-version.d.ts.map +1 -1
- package/out/zero-protocol/src/protocol-version.js +3 -1
- package/out/zero-protocol/src/protocol-version.js.map +1 -1
- package/out/zero-protocol/src/push.d.ts +38 -6
- package/out/zero-protocol/src/push.d.ts.map +1 -1
- package/out/zero-protocol/src/push.js +14 -2
- package/out/zero-protocol/src/push.js.map +1 -1
- package/out/zero-protocol/src/up.d.ts +5 -1
- package/out/zero-protocol/src/up.d.ts.map +1 -1
- package/out/zero-protocol/src/up.js +2 -1
- package/out/zero-protocol/src/up.js.map +1 -1
- package/out/zero-react/src/use-query.d.ts +1 -2
- package/out/zero-react/src/use-query.d.ts.map +1 -1
- package/out/zero-schema/src/builder/table-builder.d.ts +13 -0
- package/out/zero-schema/src/builder/table-builder.d.ts.map +1 -1
- package/out/zero-schema/src/builder/table-builder.js +17 -0
- package/out/zero-schema/src/builder/table-builder.js.map +1 -1
- package/out/zero-schema/src/permissions.d.ts.map +1 -1
- package/out/zero-schema/src/table-schema.d.ts +3 -1
- package/out/zero-schema/src/table-schema.d.ts.map +1 -1
- package/out/zero-schema/src/table-schema.js.map +1 -1
- package/out/zero-solid/src/create-zero.d.ts +2 -2
- package/out/zero-solid/src/create-zero.d.ts.map +1 -1
- package/out/zero-solid/src/solid-view.d.ts +1 -2
- package/out/zero-solid/src/solid-view.d.ts.map +1 -1
- package/out/zero-solid/src/use-query.d.ts +1 -2
- package/out/zero-solid/src/use-query.d.ts.map +1 -1
- package/out/zero.js +13 -6
- package/out/zql/src/mutate/custom.d.ts +0 -1
- package/out/zql/src/mutate/custom.d.ts.map +1 -1
- package/out/zql/src/mutate/custom.js.map +1 -1
- package/out/zql/src/query/query-impl.d.ts +9 -6
- package/out/zql/src/query/query-impl.d.ts.map +1 -1
- package/out/zql/src/query/query-impl.js +16 -18
- package/out/zql/src/query/query-impl.js.map +1 -1
- package/out/zql/src/query/query-internal.d.ts +2 -9
- package/out/zql/src/query/query-internal.d.ts.map +1 -1
- package/out/zql/src/query/query.d.ts +5 -0
- package/out/zql/src/query/query.d.ts.map +1 -1
- package/out/zql/src/query/static-query.d.ts +1 -1
- package/out/zql/src/query/static-query.d.ts.map +1 -1
- package/out/zql/src/query/static-query.js +2 -2
- package/out/zql/src/query/static-query.js.map +1 -1
- package/out/zql/src/query/ttl.d.ts +1 -1
- package/out/zql/src/query/ttl.d.ts.map +1 -1
- package/out/zql/src/query/ttl.js +1 -1
- package/out/zql/src/query/ttl.js.map +1 -1
- package/out/zqlite/src/table-source.d.ts.map +1 -1
- package/out/zqlite/src/table-source.js +8 -0
- package/out/zqlite/src/table-source.js.map +1 -1
- package/package.json +4 -5
- package/out/chunk-5WXONOGR.js.map +0 -7
- package/out/chunk-ULOTOBTC.js +0 -1
- package/out/chunk-ULOTOBTC.js.map +0 -7
- package/out/inspector-ROITQB3J.js.map +0 -7
- package/out/zero-protocol/src/warm.d.ts +0 -10
- package/out/zero-protocol/src/warm.d.ts.map +0 -1
- package/out/zero-protocol/src/warm.js +0 -6
- package/out/zero-protocol/src/warm.js.map +0 -1
- package/out/zero-schema/src/mod.d.ts +0 -5
- package/out/zero-schema/src/mod.d.ts.map +0 -1
- package/out/zql/src/query/query-internal.js +0 -2
- package/out/zql/src/query/query-internal.js.map +0 -1
package/out/advanced.js
CHANGED
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
deepEqual,
|
|
47
47
|
deepFreeze,
|
|
48
48
|
deepFreezeAllowUndefined,
|
|
49
|
+
defaultFormat,
|
|
49
50
|
desiredQueriesPrefixForClient,
|
|
50
51
|
diff,
|
|
51
52
|
diff2,
|
|
@@ -59,11 +60,13 @@ import {
|
|
|
59
60
|
getClientGroupIDForClient,
|
|
60
61
|
getClientGroups,
|
|
61
62
|
getClients,
|
|
63
|
+
getNonCryptoRandomValues,
|
|
62
64
|
getSizeOfValue,
|
|
63
65
|
h64,
|
|
64
66
|
hasClientState,
|
|
65
67
|
hashOfAST,
|
|
66
68
|
initClientV6,
|
|
69
|
+
inspectDownMessageSchema,
|
|
67
70
|
isLocalMetaDD31,
|
|
68
71
|
isProd,
|
|
69
72
|
joinIterables,
|
|
@@ -78,6 +81,7 @@ import {
|
|
|
78
81
|
mustGetChunk,
|
|
79
82
|
mustGetClient,
|
|
80
83
|
mustGetHeadHash,
|
|
84
|
+
nanoid,
|
|
81
85
|
newQuery,
|
|
82
86
|
newRandomHash,
|
|
83
87
|
newWriteLocal,
|
|
@@ -112,12 +116,12 @@ import {
|
|
|
112
116
|
withWrite,
|
|
113
117
|
withWriteNoImplicitCommit,
|
|
114
118
|
wrapIterable
|
|
115
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-NBZURO2P.js";
|
|
116
120
|
import {
|
|
117
121
|
compareTTL,
|
|
118
122
|
hasOwn,
|
|
119
123
|
parseTTL
|
|
120
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-MB3DEFRC.js";
|
|
121
125
|
import {
|
|
122
126
|
assert,
|
|
123
127
|
assertArray,
|
|
@@ -4124,17 +4128,6 @@ function diffBinarySearch(diff3, prefix, compareKey) {
|
|
|
4124
4128
|
);
|
|
4125
4129
|
}
|
|
4126
4130
|
|
|
4127
|
-
// ../shared/src/random-values.ts
|
|
4128
|
-
function getNonCryptoRandomValues(array5) {
|
|
4129
|
-
if (array5 === null) {
|
|
4130
|
-
throw new TypeError("array cannot be null");
|
|
4131
|
-
}
|
|
4132
|
-
for (let i = 0; i < array5.length; i++) {
|
|
4133
|
-
array5[i] = Math.floor(Math.random() * 256);
|
|
4134
|
-
}
|
|
4135
|
-
return array5;
|
|
4136
|
-
}
|
|
4137
|
-
|
|
4138
4131
|
// ../replicache/src/sync/request-id.ts
|
|
4139
4132
|
var sessionID = "";
|
|
4140
4133
|
function getSessionID() {
|
|
@@ -5190,7 +5183,7 @@ var ReplicacheImpl = class {
|
|
|
5190
5183
|
}
|
|
5191
5184
|
return rv;
|
|
5192
5185
|
}
|
|
5193
|
-
async #mutate(name, mutatorImpl, args,
|
|
5186
|
+
async #mutate(name, mutatorImpl, args, timestamp2) {
|
|
5194
5187
|
const frozenArgs = deepFreeze(args ?? null);
|
|
5195
5188
|
if (this.#subscriptions.hasPendingSubscriptionRuns) {
|
|
5196
5189
|
await Promise.resolve();
|
|
@@ -5207,7 +5200,7 @@ var ReplicacheImpl = class {
|
|
|
5207
5200
|
frozenArgs,
|
|
5208
5201
|
originalHash,
|
|
5209
5202
|
dagWrite,
|
|
5210
|
-
|
|
5203
|
+
timestamp2,
|
|
5211
5204
|
clientID,
|
|
5212
5205
|
Latest
|
|
5213
5206
|
);
|
|
@@ -5558,7 +5551,9 @@ var valueTypeSchema = valita_exports.union(
|
|
|
5558
5551
|
valita_exports.literal("number"),
|
|
5559
5552
|
valita_exports.literal("boolean"),
|
|
5560
5553
|
valita_exports.literal("null"),
|
|
5561
|
-
valita_exports.literal("json")
|
|
5554
|
+
valita_exports.literal("json"),
|
|
5555
|
+
valita_exports.literal("date"),
|
|
5556
|
+
valita_exports.literal("timestamp")
|
|
5562
5557
|
);
|
|
5563
5558
|
var columnSchemaSchema = valita_exports.object({
|
|
5564
5559
|
type: valueTypeSchema
|
|
@@ -5618,6 +5613,20 @@ function json() {
|
|
|
5618
5613
|
customType: null
|
|
5619
5614
|
});
|
|
5620
5615
|
}
|
|
5616
|
+
function date() {
|
|
5617
|
+
return new ColumnBuilder({
|
|
5618
|
+
type: "date",
|
|
5619
|
+
optional: false,
|
|
5620
|
+
customType: null
|
|
5621
|
+
});
|
|
5622
|
+
}
|
|
5623
|
+
function timestamp() {
|
|
5624
|
+
return new ColumnBuilder({
|
|
5625
|
+
type: "timestamp",
|
|
5626
|
+
optional: false,
|
|
5627
|
+
customType: null
|
|
5628
|
+
});
|
|
5629
|
+
}
|
|
5621
5630
|
function enumeration() {
|
|
5622
5631
|
return new ColumnBuilder({
|
|
5623
5632
|
type: "string",
|
|
@@ -5817,7 +5826,9 @@ async function definePermissions(schema, definer) {
|
|
|
5817
5826
|
for (const name of Object.keys(schema.tables)) {
|
|
5818
5827
|
expressionBuilders[name] = new StaticQuery(
|
|
5819
5828
|
schema,
|
|
5820
|
-
name
|
|
5829
|
+
name,
|
|
5830
|
+
{ table: name },
|
|
5831
|
+
defaultFormat
|
|
5821
5832
|
).expressionBuilder();
|
|
5822
5833
|
}
|
|
5823
5834
|
const config = await definer();
|
|
@@ -6288,13 +6299,18 @@ var mutationIDSchema = valita_exports.object({
|
|
|
6288
6299
|
clientID: valita_exports.string()
|
|
6289
6300
|
});
|
|
6290
6301
|
var appErrorSchema = valita_exports.object({
|
|
6291
|
-
error: valita_exports.literal("app")
|
|
6292
|
-
//
|
|
6302
|
+
error: valita_exports.literal("app"),
|
|
6303
|
+
// The user can return any additional data here
|
|
6304
|
+
details: jsonSchema.optional()
|
|
6293
6305
|
});
|
|
6294
6306
|
var zeroErrorSchema = valita_exports.object({
|
|
6295
|
-
error: valita_exports.literal("ooo-mutation")
|
|
6307
|
+
error: valita_exports.literal("ooo-mutation"),
|
|
6308
|
+
details: jsonSchema.optional()
|
|
6309
|
+
});
|
|
6310
|
+
var mutationOkSchema = valita_exports.object({
|
|
6311
|
+
// The user can return any additional data here
|
|
6312
|
+
data: jsonSchema.optional()
|
|
6296
6313
|
});
|
|
6297
|
-
var mutationOkSchema = valita_exports.object({});
|
|
6298
6314
|
var mutationErrorSchema = valita_exports.union(appErrorSchema, zeroErrorSchema);
|
|
6299
6315
|
var mutationResultSchema = valita_exports.union(mutationOkSchema, mutationErrorSchema);
|
|
6300
6316
|
var mutationResponseSchema = valita_exports.object({
|
|
@@ -6340,6 +6356,10 @@ var pushResponseMessageSchema = valita_exports.tuple([
|
|
|
6340
6356
|
valita_exports.literal("push-response"),
|
|
6341
6357
|
pushResponseSchema
|
|
6342
6358
|
]);
|
|
6359
|
+
var pushParamsSchema = valita_exports.object({
|
|
6360
|
+
schema: valita_exports.string(),
|
|
6361
|
+
appID: valita_exports.string()
|
|
6362
|
+
});
|
|
6343
6363
|
function mapCRUD(arg, map) {
|
|
6344
6364
|
return {
|
|
6345
6365
|
ops: arg.ops.map(
|
|
@@ -6355,16 +6375,9 @@ function mapCRUD(arg, map) {
|
|
|
6355
6375
|
};
|
|
6356
6376
|
}
|
|
6357
6377
|
|
|
6358
|
-
// ../zero-protocol/src/warm.ts
|
|
6359
|
-
var warmBodySchema = valita_exports.object({
|
|
6360
|
-
payload: valita_exports.string()
|
|
6361
|
-
});
|
|
6362
|
-
var warmMessageSchema = valita_exports.tuple([valita_exports.literal("warm"), warmBodySchema]);
|
|
6363
|
-
|
|
6364
6378
|
// ../zero-protocol/src/down.ts
|
|
6365
6379
|
var downstreamSchema = valita_exports.union(
|
|
6366
6380
|
connectedMessageSchema,
|
|
6367
|
-
warmMessageSchema,
|
|
6368
6381
|
errorMessageSchema,
|
|
6369
6382
|
pongMessageSchema,
|
|
6370
6383
|
pokeStartMessageSchema,
|
|
@@ -6372,11 +6385,12 @@ var downstreamSchema = valita_exports.union(
|
|
|
6372
6385
|
pokeEndMessageSchema,
|
|
6373
6386
|
pullResponseMessageSchema,
|
|
6374
6387
|
deleteClientsMessageSchema,
|
|
6375
|
-
pushResponseMessageSchema
|
|
6388
|
+
pushResponseMessageSchema,
|
|
6389
|
+
inspectDownMessageSchema
|
|
6376
6390
|
);
|
|
6377
6391
|
|
|
6378
6392
|
// ../zero-protocol/src/protocol-version.ts
|
|
6379
|
-
var PROTOCOL_VERSION =
|
|
6393
|
+
var PROTOCOL_VERSION = 12;
|
|
6380
6394
|
var MIN_SERVER_SUPPORTED_SYNC_PROTOCOL = 6;
|
|
6381
6395
|
assert(MIN_SERVER_SUPPORTED_SYNC_PROTOCOL < PROTOCOL_VERSION);
|
|
6382
6396
|
|
|
@@ -6387,24 +6401,6 @@ function customMutatorKey(namespace, name) {
|
|
|
6387
6401
|
return `${namespace}|${name}`;
|
|
6388
6402
|
}
|
|
6389
6403
|
|
|
6390
|
-
// ../zero-client/src/util/nanoid.ts
|
|
6391
|
-
function nanoid(size = 21) {
|
|
6392
|
-
const randomBytes = getNonCryptoRandomValues(new Uint8Array(size));
|
|
6393
|
-
return randomBytes.reduce((id, byte) => {
|
|
6394
|
-
byte &= 63;
|
|
6395
|
-
if (byte < 36) {
|
|
6396
|
-
id += byte.toString(36);
|
|
6397
|
-
} else if (byte < 62) {
|
|
6398
|
-
id += (byte - 26).toString(36).toUpperCase();
|
|
6399
|
-
} else if (byte > 62) {
|
|
6400
|
-
id += "-";
|
|
6401
|
-
} else {
|
|
6402
|
-
id += "_";
|
|
6403
|
-
}
|
|
6404
|
-
return id;
|
|
6405
|
-
}, "");
|
|
6406
|
-
}
|
|
6407
|
-
|
|
6408
6404
|
// ../zero-client/src/util/socket.ts
|
|
6409
6405
|
function send(ws, data) {
|
|
6410
6406
|
ws.send(JSON.stringify(data));
|
|
@@ -7909,6 +7905,11 @@ async function deleteImpl(tx, arg, schema, ivmBranch) {
|
|
|
7909
7905
|
}
|
|
7910
7906
|
}
|
|
7911
7907
|
|
|
7908
|
+
// ../shared/src/sentinels.ts
|
|
7909
|
+
function emptyFunction() {
|
|
7910
|
+
}
|
|
7911
|
+
var emptyObject = Object.freeze({});
|
|
7912
|
+
|
|
7912
7913
|
// ../zero-client/src/client/custom.ts
|
|
7913
7914
|
var TransactionImpl = class {
|
|
7914
7915
|
constructor(lc, repTx, schema, slowMaterializeThreshold) {
|
|
@@ -7943,14 +7944,16 @@ var TransactionImpl = class {
|
|
|
7943
7944
|
token;
|
|
7944
7945
|
};
|
|
7945
7946
|
function makeReplicacheMutator(lc, mutationTracker, mutator, schema, slowMaterializeThreshold) {
|
|
7946
|
-
return (repTx, args) => {
|
|
7947
|
+
return async (repTx, args) => {
|
|
7947
7948
|
const tx = new TransactionImpl(lc, repTx, schema, slowMaterializeThreshold);
|
|
7948
|
-
|
|
7949
|
+
await mutator(tx, args);
|
|
7949
7950
|
if (repTx.reason === "initial") {
|
|
7950
7951
|
const serverPromise = mutationTracker.trackMutation(repTx.mutationID);
|
|
7951
|
-
|
|
7952
|
+
return {
|
|
7953
|
+
server: serverPromise
|
|
7954
|
+
};
|
|
7952
7955
|
}
|
|
7953
|
-
return
|
|
7956
|
+
return {};
|
|
7954
7957
|
};
|
|
7955
7958
|
}
|
|
7956
7959
|
function makeSchemaCRUD(schema, tx, ivmBranch) {
|
|
@@ -7971,8 +7974,7 @@ function makeSchemaQuery(lc, schema, ivmBranch, slowMaterializeThreshold) {
|
|
|
7971
7974
|
const context = new ZeroContext(
|
|
7972
7975
|
lc,
|
|
7973
7976
|
ivmBranch,
|
|
7974
|
-
() =>
|
|
7975
|
-
},
|
|
7977
|
+
() => emptyFunction,
|
|
7976
7978
|
() => {
|
|
7977
7979
|
},
|
|
7978
7980
|
(applyViewUpdates) => applyViewUpdates(),
|
|
@@ -8321,7 +8323,7 @@ function makeMessage(message, context, logLevel) {
|
|
|
8321
8323
|
}
|
|
8322
8324
|
|
|
8323
8325
|
// ../zero-client/src/client/version.ts
|
|
8324
|
-
var version2 = "0.18.
|
|
8326
|
+
var version2 = "0.18.2025032900";
|
|
8325
8327
|
|
|
8326
8328
|
// ../zero-client/src/client/log-options.ts
|
|
8327
8329
|
var LevelFilterLogSink = class {
|
|
@@ -8615,6 +8617,140 @@ var State = class {
|
|
|
8615
8617
|
}
|
|
8616
8618
|
};
|
|
8617
8619
|
|
|
8620
|
+
// ../zero-client/src/client/mutation-tracker.ts
|
|
8621
|
+
import { resolver as resolver7 } from "@rocicorp/resolver";
|
|
8622
|
+
var transientPushErrorTypes = [
|
|
8623
|
+
"zero-pusher",
|
|
8624
|
+
"http",
|
|
8625
|
+
// These should never actually be received as they cause the websocket
|
|
8626
|
+
// connection to be closed.
|
|
8627
|
+
"unsupported-push-version",
|
|
8628
|
+
"unsupported-schema-version"
|
|
8629
|
+
];
|
|
8630
|
+
var MutationTracker = class {
|
|
8631
|
+
#outstandingMutations;
|
|
8632
|
+
#allMutationsConfirmedListeners;
|
|
8633
|
+
#clientID;
|
|
8634
|
+
constructor() {
|
|
8635
|
+
this.#outstandingMutations = /* @__PURE__ */ new Map();
|
|
8636
|
+
this.#allMutationsConfirmedListeners = /* @__PURE__ */ new Set();
|
|
8637
|
+
}
|
|
8638
|
+
set clientID(clientID) {
|
|
8639
|
+
this.#clientID = clientID;
|
|
8640
|
+
}
|
|
8641
|
+
trackMutation(id) {
|
|
8642
|
+
assert(!this.#outstandingMutations.has(id));
|
|
8643
|
+
const mutationResolver = resolver7();
|
|
8644
|
+
this.#outstandingMutations.set(id, {
|
|
8645
|
+
resolver: mutationResolver
|
|
8646
|
+
});
|
|
8647
|
+
return mutationResolver.promise;
|
|
8648
|
+
}
|
|
8649
|
+
processPushResponse(response) {
|
|
8650
|
+
if ("error" in response) {
|
|
8651
|
+
this.#processPushError(response);
|
|
8652
|
+
} else {
|
|
8653
|
+
this.#processPushOk(response);
|
|
8654
|
+
}
|
|
8655
|
+
}
|
|
8656
|
+
/**
|
|
8657
|
+
* When we reconnect to zero-cache, we resolve all outstanding mutations
|
|
8658
|
+
* whose ID is less than or equal to the lastMutationID.
|
|
8659
|
+
*
|
|
8660
|
+
* The reason is that any responses the API server sent
|
|
8661
|
+
* to those mutations have been lost.
|
|
8662
|
+
*
|
|
8663
|
+
* An example case: the API server responds while the connection
|
|
8664
|
+
* is down. Those responses are dropped.
|
|
8665
|
+
*
|
|
8666
|
+
* Mutations whose LMID is > the lastMutationID are not resolved
|
|
8667
|
+
* since they will be retried by the client, giving us another chance
|
|
8668
|
+
* at getting a response.
|
|
8669
|
+
*
|
|
8670
|
+
* The only way to ensure that all API server responses are
|
|
8671
|
+
* received would be to have the API server write them
|
|
8672
|
+
* to the DB while writing the LMID.
|
|
8673
|
+
*
|
|
8674
|
+
* This would have the downside of not being able to provide responses to a
|
|
8675
|
+
* mutation with data gathered after the transaction.
|
|
8676
|
+
*/
|
|
8677
|
+
onConnected(lastMutationID) {
|
|
8678
|
+
for (const [id, entry] of this.#outstandingMutations) {
|
|
8679
|
+
if (id <= lastMutationID) {
|
|
8680
|
+
this.#settleMutation(id, entry, "resolve", emptyObject);
|
|
8681
|
+
} else {
|
|
8682
|
+
break;
|
|
8683
|
+
}
|
|
8684
|
+
}
|
|
8685
|
+
}
|
|
8686
|
+
get size() {
|
|
8687
|
+
return this.#outstandingMutations.size;
|
|
8688
|
+
}
|
|
8689
|
+
#processPushError(error) {
|
|
8690
|
+
if (transientPushErrorTypes.includes(error.error)) {
|
|
8691
|
+
return;
|
|
8692
|
+
}
|
|
8693
|
+
const mids = error.mutationIDs;
|
|
8694
|
+
if (!mids) {
|
|
8695
|
+
return;
|
|
8696
|
+
}
|
|
8697
|
+
for (const mid of mids) {
|
|
8698
|
+
this.#processMutationError(mid, error);
|
|
8699
|
+
}
|
|
8700
|
+
}
|
|
8701
|
+
#processPushOk(ok) {
|
|
8702
|
+
for (const mutation of ok.mutations) {
|
|
8703
|
+
if ("error" in mutation.result) {
|
|
8704
|
+
this.#processMutationError(mutation.id, mutation.result);
|
|
8705
|
+
} else {
|
|
8706
|
+
this.#processMutationOk(mutation.result, mutation.id);
|
|
8707
|
+
}
|
|
8708
|
+
}
|
|
8709
|
+
}
|
|
8710
|
+
#processMutationError(mid, error) {
|
|
8711
|
+
assert(
|
|
8712
|
+
mid.clientID === this.#clientID,
|
|
8713
|
+
"received mutation for the wrong client"
|
|
8714
|
+
);
|
|
8715
|
+
const entry = this.#outstandingMutations.get(mid.id);
|
|
8716
|
+
assert(entry);
|
|
8717
|
+
this.#settleMutation(mid.id, entry, "reject", error);
|
|
8718
|
+
}
|
|
8719
|
+
#processMutationOk(result, mid) {
|
|
8720
|
+
assert(
|
|
8721
|
+
mid.clientID === this.#clientID,
|
|
8722
|
+
"received mutation for the wrong client"
|
|
8723
|
+
);
|
|
8724
|
+
const entry = this.#outstandingMutations.get(mid.id);
|
|
8725
|
+
assert(entry);
|
|
8726
|
+
this.#settleMutation(mid.id, entry, "resolve", result);
|
|
8727
|
+
}
|
|
8728
|
+
#settleMutation(mutationID, entry, type, result) {
|
|
8729
|
+
switch (type) {
|
|
8730
|
+
case "resolve":
|
|
8731
|
+
assert(!("error" in result));
|
|
8732
|
+
entry.resolver.resolve(result);
|
|
8733
|
+
break;
|
|
8734
|
+
case "reject":
|
|
8735
|
+
assert("error" in result);
|
|
8736
|
+
entry.resolver.reject(result);
|
|
8737
|
+
break;
|
|
8738
|
+
}
|
|
8739
|
+
const removed = this.#outstandingMutations.delete(mutationID);
|
|
8740
|
+
if (removed && this.#outstandingMutations.size === 0) {
|
|
8741
|
+
this.#notifyAllMutationsConfirmedListeners();
|
|
8742
|
+
}
|
|
8743
|
+
}
|
|
8744
|
+
onAllMutationsConfirmed(listener) {
|
|
8745
|
+
this.#allMutationsConfirmedListeners.add(listener);
|
|
8746
|
+
}
|
|
8747
|
+
#notifyAllMutationsConfirmedListeners() {
|
|
8748
|
+
for (const listener of this.#allMutationsConfirmedListeners) {
|
|
8749
|
+
listener();
|
|
8750
|
+
}
|
|
8751
|
+
}
|
|
8752
|
+
};
|
|
8753
|
+
|
|
8618
8754
|
// ../zero-client/src/client/ping-result-enum.ts
|
|
8619
8755
|
var TimedOut = 0;
|
|
8620
8756
|
var Success = 1;
|
|
@@ -8628,11 +8764,24 @@ var QueryManager = class {
|
|
|
8628
8764
|
#recentQueriesMaxSize;
|
|
8629
8765
|
#recentQueries = /* @__PURE__ */ new Set();
|
|
8630
8766
|
#gotQueries = /* @__PURE__ */ new Set();
|
|
8631
|
-
|
|
8767
|
+
#mutationTracker;
|
|
8768
|
+
#pendingRemovals = [];
|
|
8769
|
+
constructor(mutationTracker, clientID, tables, send2, experimentalWatch, recentQueriesMaxSize) {
|
|
8632
8770
|
this.#clientID = clientID;
|
|
8633
8771
|
this.#clientToServer = clientToServer(tables);
|
|
8634
8772
|
this.#recentQueriesMaxSize = recentQueriesMaxSize;
|
|
8635
8773
|
this.#send = send2;
|
|
8774
|
+
this.#mutationTracker = mutationTracker;
|
|
8775
|
+
this.#mutationTracker.onAllMutationsConfirmed(() => {
|
|
8776
|
+
if (this.#pendingRemovals.length === 0) {
|
|
8777
|
+
return;
|
|
8778
|
+
}
|
|
8779
|
+
const pendingRemovals = this.#pendingRemovals;
|
|
8780
|
+
this.#pendingRemovals = [];
|
|
8781
|
+
for (const removal of pendingRemovals) {
|
|
8782
|
+
removal();
|
|
8783
|
+
}
|
|
8784
|
+
});
|
|
8636
8785
|
experimentalWatch(
|
|
8637
8786
|
(diff3) => {
|
|
8638
8787
|
for (const diffOp of diff3) {
|
|
@@ -8746,6 +8895,12 @@ var QueryManager = class {
|
|
|
8746
8895
|
return;
|
|
8747
8896
|
}
|
|
8748
8897
|
removed = true;
|
|
8898
|
+
if (this.#mutationTracker.size > 0) {
|
|
8899
|
+
this.#pendingRemovals.push(
|
|
8900
|
+
() => this.#remove(entry, astHash, gotCallback)
|
|
8901
|
+
);
|
|
8902
|
+
return;
|
|
8903
|
+
}
|
|
8749
8904
|
this.#remove(entry, astHash, gotCallback);
|
|
8750
8905
|
};
|
|
8751
8906
|
}
|
|
@@ -9295,84 +9450,6 @@ var ZeroRep = class {
|
|
|
9295
9450
|
};
|
|
9296
9451
|
};
|
|
9297
9452
|
|
|
9298
|
-
// ../zero-client/src/client/mutation-tracker.ts
|
|
9299
|
-
import { resolver as resolver7 } from "@rocicorp/resolver";
|
|
9300
|
-
var MutationTracker = class {
|
|
9301
|
-
#outstandingMutations;
|
|
9302
|
-
#clientID;
|
|
9303
|
-
constructor() {
|
|
9304
|
-
this.#outstandingMutations = /* @__PURE__ */ new Map();
|
|
9305
|
-
}
|
|
9306
|
-
set clientID(clientID) {
|
|
9307
|
-
this.#clientID = clientID;
|
|
9308
|
-
}
|
|
9309
|
-
trackMutation(id) {
|
|
9310
|
-
assert(!this.#outstandingMutations.has(id));
|
|
9311
|
-
const mutationResolver = resolver7();
|
|
9312
|
-
this.#outstandingMutations.set(id, mutationResolver);
|
|
9313
|
-
return mutationResolver.promise;
|
|
9314
|
-
}
|
|
9315
|
-
/**
|
|
9316
|
-
* Called if the mutation is never able to be sent to the server
|
|
9317
|
-
* and abandoned before persisted.
|
|
9318
|
-
* In that case, we have no `pushResponse` to process.
|
|
9319
|
-
*/
|
|
9320
|
-
rejectMutation(id, e) {
|
|
9321
|
-
const resolver9 = this.#outstandingMutations.get(id);
|
|
9322
|
-
assert(resolver9);
|
|
9323
|
-
resolver9.reject(e);
|
|
9324
|
-
this.#outstandingMutations.delete(id);
|
|
9325
|
-
}
|
|
9326
|
-
processPushResponse(response) {
|
|
9327
|
-
if ("error" in response) {
|
|
9328
|
-
this.#processPushError(response);
|
|
9329
|
-
} else {
|
|
9330
|
-
this.#processPushOk(response);
|
|
9331
|
-
}
|
|
9332
|
-
}
|
|
9333
|
-
get size() {
|
|
9334
|
-
return this.#outstandingMutations.size;
|
|
9335
|
-
}
|
|
9336
|
-
#processPushError(error) {
|
|
9337
|
-
const mids = error.mutationIDs;
|
|
9338
|
-
if (!mids) {
|
|
9339
|
-
return;
|
|
9340
|
-
}
|
|
9341
|
-
for (const mid of mids) {
|
|
9342
|
-
this.#processMutationError(mid, error);
|
|
9343
|
-
}
|
|
9344
|
-
}
|
|
9345
|
-
#processPushOk(ok) {
|
|
9346
|
-
for (const mutation of ok.mutations) {
|
|
9347
|
-
if ("error" in mutation.result) {
|
|
9348
|
-
this.#processMutationError(mutation.id, mutation.result);
|
|
9349
|
-
} else {
|
|
9350
|
-
this.#processMutationOk(mutation.result, mutation.id);
|
|
9351
|
-
}
|
|
9352
|
-
}
|
|
9353
|
-
}
|
|
9354
|
-
#processMutationError(mid, error) {
|
|
9355
|
-
assert(
|
|
9356
|
-
mid.clientID === this.#clientID,
|
|
9357
|
-
"received mutation for the wrong client"
|
|
9358
|
-
);
|
|
9359
|
-
const resolver9 = this.#outstandingMutations.get(mid.id);
|
|
9360
|
-
assert(resolver9);
|
|
9361
|
-
resolver9.reject(error);
|
|
9362
|
-
this.#outstandingMutations.delete(mid.id);
|
|
9363
|
-
}
|
|
9364
|
-
#processMutationOk(result, mid) {
|
|
9365
|
-
assert(
|
|
9366
|
-
mid.clientID === this.#clientID,
|
|
9367
|
-
"received mutation for the wrong client"
|
|
9368
|
-
);
|
|
9369
|
-
const resolver9 = this.#outstandingMutations.get(mid.id);
|
|
9370
|
-
assert(resolver9);
|
|
9371
|
-
resolver9.resolve(result);
|
|
9372
|
-
this.#outstandingMutations.delete(mid.id);
|
|
9373
|
-
}
|
|
9374
|
-
};
|
|
9375
|
-
|
|
9376
9453
|
// ../zero-client/src/client/zero.ts
|
|
9377
9454
|
var onSetConnectionStateSymbol = Symbol();
|
|
9378
9455
|
var exposedToTestingSymbol = Symbol();
|
|
@@ -9586,6 +9663,8 @@ var Zero = class {
|
|
|
9586
9663
|
mutatorOrMutators,
|
|
9587
9664
|
schema,
|
|
9588
9665
|
slowMaterializeThreshold
|
|
9666
|
+
// Replicache expects mutators to only be able to return JSON
|
|
9667
|
+
// but Zero wraps the return with: `{server?: Promise<MutationResult>, client?: T}`
|
|
9589
9668
|
);
|
|
9590
9669
|
continue;
|
|
9591
9670
|
}
|
|
@@ -9642,6 +9721,8 @@ var Zero = class {
|
|
|
9642
9721
|
const replicacheImplOptions = {
|
|
9643
9722
|
enableClientGroupForking: false,
|
|
9644
9723
|
enableMutationRecovery: false,
|
|
9724
|
+
enablePullAndPushInOpen: false,
|
|
9725
|
+
// Zero calls push in its connection management code
|
|
9645
9726
|
onClientsDeleted: (clientIDs, clientGroupIDs) => this.#deleteClientsManager.onClientsDeleted(clientIDs, clientGroupIDs),
|
|
9646
9727
|
zero: new ZeroRep(
|
|
9647
9728
|
this.#zeroContext,
|
|
@@ -9678,10 +9759,8 @@ var Zero = class {
|
|
|
9678
9759
|
});
|
|
9679
9760
|
this.#onClientStateNotFound = onClientStateNotFoundCallback;
|
|
9680
9761
|
this.#rep.onClientStateNotFound = onClientStateNotFoundCallback;
|
|
9681
|
-
|
|
9762
|
+
const { mutate, mutateBatch } = makeCRUDMutate(schema, rep.mutate);
|
|
9682
9763
|
if (options.mutators) {
|
|
9683
|
-
mutate = {};
|
|
9684
|
-
mutateBatch = void 0;
|
|
9685
9764
|
for (const [namespaceOrKey, mutatorsOrMutator] of Object.entries(
|
|
9686
9765
|
options.mutators
|
|
9687
9766
|
)) {
|
|
@@ -9704,6 +9783,7 @@ var Zero = class {
|
|
|
9704
9783
|
this.mutate = mutate;
|
|
9705
9784
|
this.mutateBatch = mutateBatch;
|
|
9706
9785
|
this.#queryManager = new QueryManager(
|
|
9786
|
+
this.#mutationTracker,
|
|
9707
9787
|
rep.clientID,
|
|
9708
9788
|
schema.tables,
|
|
9709
9789
|
(msg) => this.#sendChangeDesiredQueries(msg),
|
|
@@ -9928,14 +10008,14 @@ var Zero = class {
|
|
|
9928
10008
|
return this.#handlePokeEnd(lc, downMessage);
|
|
9929
10009
|
case "pull":
|
|
9930
10010
|
return this.#handlePullResponse(lc, downMessage);
|
|
9931
|
-
case "warm":
|
|
9932
|
-
break;
|
|
9933
10011
|
case "deleteClients":
|
|
9934
10012
|
return this.#deleteClientsManager.clientsDeletedOnServer(
|
|
9935
10013
|
downMessage[1]
|
|
9936
10014
|
);
|
|
9937
10015
|
case "push-response":
|
|
9938
10016
|
return this.#mutationTracker.processPushResponse(downMessage[1]);
|
|
10017
|
+
case "inspect":
|
|
10018
|
+
break;
|
|
9939
10019
|
default:
|
|
9940
10020
|
msgType;
|
|
9941
10021
|
rejectInvalidMessage();
|
|
@@ -10161,6 +10241,9 @@ var Zero = class {
|
|
|
10161
10241
|
try {
|
|
10162
10242
|
l.debug?.("Waiting for connection to be acknowledged");
|
|
10163
10243
|
await this.#connectResolver.promise;
|
|
10244
|
+
this.#mutationTracker.onConnected(this.#lastMutationIDReceived);
|
|
10245
|
+
this.#rep.push().catch(() => {
|
|
10246
|
+
});
|
|
10164
10247
|
} finally {
|
|
10165
10248
|
clearTimeout(timeoutID);
|
|
10166
10249
|
this.#closeAbortController.signal.removeEventListener(
|
|
@@ -10294,17 +10377,17 @@ var Zero = class {
|
|
|
10294
10377
|
const now = Date.now();
|
|
10295
10378
|
for (let i = start; i < req.mutations.length; i++) {
|
|
10296
10379
|
const m = req.mutations[i];
|
|
10297
|
-
const
|
|
10380
|
+
const timestamp2 = now - Math.round(performance.now() - m.timestamp);
|
|
10298
10381
|
const zeroM = m.name === CRUD_MUTATION_NAME ? {
|
|
10299
10382
|
type: CRUD,
|
|
10300
|
-
timestamp,
|
|
10383
|
+
timestamp: timestamp2,
|
|
10301
10384
|
id: m.id,
|
|
10302
10385
|
clientID: m.clientID,
|
|
10303
10386
|
name: m.name,
|
|
10304
10387
|
args: [mapCRUD(m.args, this.#clientToServer)]
|
|
10305
10388
|
} : {
|
|
10306
10389
|
type: Custom,
|
|
10307
|
-
timestamp,
|
|
10390
|
+
timestamp: timestamp2,
|
|
10308
10391
|
id: m.id,
|
|
10309
10392
|
clientID: m.clientID,
|
|
10310
10393
|
name: m.name,
|
|
@@ -10614,8 +10697,8 @@ var Zero = class {
|
|
|
10614
10697
|
*/
|
|
10615
10698
|
async inspect() {
|
|
10616
10699
|
BUNDLE_SIZE: {
|
|
10617
|
-
const m = await import("./inspector-
|
|
10618
|
-
return m.newInspector(this.#rep, this.#schema);
|
|
10700
|
+
const m = await import("./inspector-SH2ZK7O3.js");
|
|
10701
|
+
return m.newInspector(this.#rep, this.#schema, () => this.#socket);
|
|
10619
10702
|
}
|
|
10620
10703
|
}
|
|
10621
10704
|
};
|
|
@@ -10724,6 +10807,8 @@ export {
|
|
|
10724
10807
|
number2 as number,
|
|
10725
10808
|
boolean,
|
|
10726
10809
|
json,
|
|
10810
|
+
date,
|
|
10811
|
+
timestamp,
|
|
10727
10812
|
enumeration,
|
|
10728
10813
|
createSchema,
|
|
10729
10814
|
ANYONE_CAN,
|
|
@@ -10733,4 +10818,4 @@ export {
|
|
|
10733
10818
|
escapeLike,
|
|
10734
10819
|
Zero
|
|
10735
10820
|
};
|
|
10736
|
-
//# sourceMappingURL=chunk-
|
|
10821
|
+
//# sourceMappingURL=chunk-I7LQ2GI3.js.map
|