@rocicorp/zero 0.23.2025081400 → 0.23.2025081900
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/analyze-query/src/bin-analyze.d.ts.map +1 -1
- package/out/analyze-query/src/bin-analyze.js +56 -99
- package/out/analyze-query/src/bin-analyze.js.map +1 -1
- package/out/analyze-query/src/explain-queries.d.ts +4 -0
- package/out/analyze-query/src/explain-queries.d.ts.map +1 -0
- package/out/analyze-query/src/explain-queries.js +18 -0
- package/out/analyze-query/src/explain-queries.js.map +1 -0
- package/out/analyze-query/src/run-ast.d.ts +29 -0
- package/out/analyze-query/src/run-ast.d.ts.map +1 -0
- package/out/analyze-query/src/run-ast.js +68 -0
- package/out/analyze-query/src/run-ast.js.map +1 -0
- package/out/{chunk-O536GEIT.js → chunk-RPVWLROJ.js} +80 -35
- package/out/{chunk-O536GEIT.js.map → chunk-RPVWLROJ.js.map} +3 -3
- package/out/{chunk-JHJ3MBXW.js → chunk-ZKQCPILX.js} +55 -58
- package/out/chunk-ZKQCPILX.js.map +7 -0
- package/out/{chunk-ZKRMVMWK.js → chunk-ZZJ2SCHD.js} +124 -63
- package/out/{chunk-ZKRMVMWK.js.map → chunk-ZZJ2SCHD.js.map} +4 -4
- package/out/{inspector-J5P4DOGH.js → inspector-NC47TWFX.js} +4 -3
- package/out/{inspector-J5P4DOGH.js.map → inspector-NC47TWFX.js.map} +2 -2
- package/out/react.js +2 -2
- package/out/solid.js +3 -3
- package/out/zero/package.json +1 -1
- package/out/zero/src/server/reaper.d.ts +2 -0
- package/out/zero/src/server/reaper.d.ts.map +1 -0
- package/out/zero/src/server/reaper.js +2 -0
- package/out/zero/src/server/reaper.js.map +1 -0
- package/out/zero-cache/src/auth/write-authorizer.d.ts.map +1 -1
- package/out/zero-cache/src/auth/write-authorizer.js +2 -3
- package/out/zero-cache/src/auth/write-authorizer.js.map +1 -1
- package/out/zero-cache/src/config/zero-config.d.ts +4 -0
- package/out/zero-cache/src/config/zero-config.d.ts.map +1 -1
- package/out/zero-cache/src/config/zero-config.js +9 -1
- package/out/zero-cache/src/config/zero-config.js.map +1 -1
- package/out/zero-cache/src/custom-queries/transform-query.d.ts +2 -3
- package/out/zero-cache/src/custom-queries/transform-query.d.ts.map +1 -1
- package/out/zero-cache/src/custom-queries/transform-query.js +18 -4
- package/out/zero-cache/src/custom-queries/transform-query.js.map +1 -1
- package/out/zero-cache/src/observability/events.d.ts.map +1 -1
- package/out/zero-cache/src/observability/events.js +3 -3
- package/out/zero-cache/src/observability/events.js.map +1 -1
- package/out/zero-cache/src/server/inspect-metrics-delegate.d.ts +23 -0
- package/out/zero-cache/src/server/inspect-metrics-delegate.d.ts.map +1 -0
- package/out/zero-cache/src/server/inspect-metrics-delegate.js +55 -0
- package/out/zero-cache/src/server/inspect-metrics-delegate.js.map +1 -0
- package/out/zero-cache/src/server/main.d.ts.map +1 -1
- package/out/zero-cache/src/server/main.js +12 -15
- package/out/zero-cache/src/server/main.js.map +1 -1
- package/out/zero-cache/src/server/reaper.d.ts +3 -0
- package/out/zero-cache/src/server/reaper.d.ts.map +1 -0
- package/out/zero-cache/src/server/reaper.js +31 -0
- package/out/zero-cache/src/server/reaper.js.map +1 -0
- package/out/zero-cache/src/server/runner/zero-dispatcher.d.ts.map +1 -1
- package/out/zero-cache/src/server/runner/zero-dispatcher.js +6 -0
- package/out/zero-cache/src/server/runner/zero-dispatcher.js.map +1 -1
- package/out/zero-cache/src/server/syncer.d.ts.map +1 -1
- package/out/zero-cache/src/server/syncer.js +3 -1
- package/out/zero-cache/src/server/syncer.js.map +1 -1
- package/out/zero-cache/src/services/analyze.d.ts +6 -0
- package/out/zero-cache/src/services/analyze.d.ts.map +1 -0
- package/out/zero-cache/src/services/analyze.js +70 -0
- package/out/zero-cache/src/services/analyze.js.map +1 -0
- package/out/zero-cache/src/services/change-source/custom/change-source.js +1 -1
- 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 +8 -3
- package/out/zero-cache/src/services/change-source/pg/initial-sync.js.map +1 -1
- package/out/zero-cache/src/services/mutagen/pusher.d.ts +38 -2
- package/out/zero-cache/src/services/mutagen/pusher.d.ts.map +1 -1
- package/out/zero-cache/src/services/replicator/change-processor.d.ts +3 -2
- package/out/zero-cache/src/services/replicator/change-processor.d.ts.map +1 -1
- package/out/zero-cache/src/services/replicator/change-processor.js +39 -34
- package/out/zero-cache/src/services/replicator/change-processor.js.map +1 -1
- package/out/zero-cache/src/services/replicator/incremental-sync.d.ts.map +1 -1
- package/out/zero-cache/src/services/replicator/incremental-sync.js +1 -3
- package/out/zero-cache/src/services/replicator/incremental-sync.js.map +1 -1
- package/out/zero-cache/src/services/replicator/replication-status.js +1 -1
- package/out/zero-cache/src/services/replicator/replication-status.js.map +1 -1
- package/out/zero-cache/src/services/running-state.d.ts +5 -0
- package/out/zero-cache/src/services/running-state.d.ts.map +1 -1
- package/out/zero-cache/src/services/running-state.js +8 -1
- package/out/zero-cache/src/services/running-state.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-handler.d.ts +2 -0
- 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 +3 -0
- package/out/zero-cache/src/services/view-syncer/client-handler.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr-purger.d.ts +16 -0
- package/out/zero-cache/src/services/view-syncer/cvr-purger.d.ts.map +1 -0
- package/out/zero-cache/src/services/view-syncer/cvr-purger.js +86 -0
- package/out/zero-cache/src/services/view-syncer/cvr-purger.js.map +1 -0
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts +16 -9
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.js +50 -30
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/schema/cvr.js +36 -26
- package/out/zero-cache/src/services/view-syncer/schema/cvr.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/schema/init.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/schema/init.js +27 -0
- package/out/zero-cache/src/services/view-syncer/schema/init.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts +2 -9
- 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 +93 -75
- package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
- package/out/zero-cache/src/types/pg.d.ts +1 -1
- package/out/zero-cache/src/types/pg.js +1 -1
- package/out/zero-client/src/client/context.d.ts +1 -0
- package/out/zero-client/src/client/context.d.ts.map +1 -1
- package/out/zero-client/src/client/inspector/inspector.d.ts.map +1 -1
- package/out/zero-client/src/client/inspector/types.d.ts +1 -0
- package/out/zero-client/src/client/inspector/types.d.ts.map +1 -1
- package/out/zero-client/src/client/zero.d.ts.map +1 -1
- package/out/zero-client/src/mod.d.ts +1 -1
- package/out/zero-client/src/mod.d.ts.map +1 -1
- package/out/zero-events/src/status.d.ts +10 -9
- package/out/zero-events/src/status.d.ts.map +1 -1
- package/out/zero-events/src/status.js +7 -10
- package/out/zero-events/src/status.js.map +1 -1
- package/out/zero-protocol/src/custom-queries.d.ts +77 -5
- package/out/zero-protocol/src/custom-queries.d.ts.map +1 -1
- package/out/zero-protocol/src/custom-queries.js +19 -1
- package/out/zero-protocol/src/custom-queries.js.map +1 -1
- package/out/zero-protocol/src/down.d.ts +19 -1
- package/out/zero-protocol/src/down.d.ts.map +1 -1
- package/out/zero-protocol/src/down.js +2 -1
- package/out/zero-protocol/src/down.js.map +1 -1
- package/out/zero-protocol/src/inspect-down.d.ts +8 -0
- package/out/zero-protocol/src/inspect-down.d.ts.map +1 -1
- package/out/zero-protocol/src/inspect-down.js +1 -0
- package/out/zero-protocol/src/inspect-down.js.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-server/src/mod.d.ts +1 -0
- package/out/zero-server/src/mod.d.ts.map +1 -1
- package/out/zero-server/src/mod.js +1 -0
- package/out/zero-server/src/mod.js.map +1 -1
- package/out/zero-server/src/process-mutations.d.ts +46 -0
- package/out/zero-server/src/process-mutations.d.ts.map +1 -0
- package/out/zero-server/src/process-mutations.js +187 -0
- package/out/zero-server/src/process-mutations.js.map +1 -0
- package/out/zero-server/src/push-processor.d.ts +2 -27
- package/out/zero-server/src/push-processor.d.ts.map +1 -1
- package/out/zero-server/src/push-processor.js +17 -154
- package/out/zero-server/src/push-processor.js.map +1 -1
- package/out/zero-server/src/queries/process-queries.d.ts +1 -1
- package/out/zero-server/src/queries/process-queries.d.ts.map +1 -1
- package/out/zero-server/src/queries/process-queries.js +1 -1
- package/out/zero-server/src/queries/process-queries.js.map +1 -1
- package/out/zero-server/src/zql-database.d.ts +1 -1
- package/out/zero-server/src/zql-database.d.ts.map +1 -1
- package/out/zero.js +14 -10
- package/out/zql/src/builder/builder.d.ts +5 -1
- package/out/zql/src/builder/builder.d.ts.map +1 -1
- package/out/zql/src/builder/builder.js +49 -16
- package/out/zql/src/builder/builder.js.map +1 -1
- package/out/zql/src/builder/debug-delegate.d.ts +29 -0
- package/out/zql/src/builder/debug-delegate.d.ts.map +1 -0
- package/out/zql/src/builder/debug-delegate.js +55 -0
- package/out/zql/src/builder/debug-delegate.js.map +1 -0
- package/out/zql/src/builder/filter.d.ts +0 -3
- package/out/zql/src/builder/filter.d.ts.map +1 -1
- package/out/zql/src/builder/filter.js +0 -3
- package/out/zql/src/builder/filter.js.map +1 -1
- package/out/zql/src/ivm/filter-operators.d.ts +2 -1
- package/out/zql/src/ivm/filter-operators.d.ts.map +1 -1
- package/out/zql/src/ivm/filter-operators.js +7 -2
- package/out/zql/src/ivm/filter-operators.js.map +1 -1
- package/out/zql/src/ivm/memory-source.d.ts +2 -0
- package/out/zql/src/ivm/memory-source.d.ts.map +1 -1
- package/out/zql/src/ivm/memory-source.js.map +1 -1
- package/out/zql/src/ivm/source.d.ts +2 -1
- package/out/zql/src/ivm/source.d.ts.map +1 -1
- package/out/zql/src/query/measure-push-operator.d.ts +19 -0
- package/out/zql/src/query/measure-push-operator.d.ts.map +1 -0
- package/out/zql/src/query/measure-push-operator.js +36 -0
- package/out/zql/src/query/measure-push-operator.js.map +1 -0
- package/out/zql/src/query/metrics-delegate.d.ts +3 -0
- package/out/zql/src/query/metrics-delegate.d.ts.map +1 -1
- package/out/zql/src/query/metrics-delegate.js +6 -1
- package/out/zql/src/query/metrics-delegate.js.map +1 -1
- package/out/zql/src/query/named.d.ts +38 -9
- package/out/zql/src/query/named.d.ts.map +1 -1
- package/out/zql/src/query/named.js +49 -24
- package/out/zql/src/query/named.js.map +1 -1
- package/out/zql/src/query/query-impl.d.ts +1 -1
- package/out/zql/src/query/query-impl.d.ts.map +1 -1
- package/out/zql/src/query/query-impl.js.map +1 -1
- package/out/zqlite/src/query-delegate.d.ts +1 -0
- package/out/zqlite/src/query-delegate.d.ts.map +1 -1
- package/out/zqlite/src/query-delegate.js +2 -1
- package/out/zqlite/src/query-delegate.js.map +1 -1
- package/out/zqlite/src/table-source.d.ts +3 -2
- package/out/zqlite/src/table-source.d.ts.map +1 -1
- package/out/zqlite/src/table-source.js +8 -10
- package/out/zqlite/src/table-source.js.map +1 -1
- package/package.json +1 -1
- package/out/chunk-JHJ3MBXW.js.map +0 -7
- package/out/zero-client/src/client/measure-push-operator.d.ts +0 -17
- package/out/zero-client/src/client/measure-push-operator.d.ts.map +0 -1
- package/out/zqlite/src/runtime-debug.d.ts +0 -23
- package/out/zqlite/src/runtime-debug.d.ts.map +0 -1
- package/out/zqlite/src/runtime-debug.js +0 -69
- package/out/zqlite/src/runtime-debug.js.map +0 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { pushBodySchema, pushParamsSchema, } from "../../zero-protocol/src/push.js";
|
|
2
|
+
import * as v from "../../shared/src/valita.js";
|
|
3
|
+
import { MutationAlreadyProcessedError } from "../../zero-cache/src/services/mutagen/mutagen.js";
|
|
4
|
+
import { createLogContext } from "./logging.js";
|
|
5
|
+
import { assert } from "../../shared/src/asserts.js";
|
|
6
|
+
export async function mapMutationRequest(cb, queryOrQueryString, body, logLevel) {
|
|
7
|
+
if (logLevel === undefined) {
|
|
8
|
+
if (queryOrQueryString instanceof Request && typeof body === 'string') {
|
|
9
|
+
logLevel = body;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
logLevel = 'info';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
let queryString;
|
|
16
|
+
if (queryOrQueryString instanceof Request) {
|
|
17
|
+
const url = new URL(queryOrQueryString.url);
|
|
18
|
+
queryString = url.searchParams;
|
|
19
|
+
body = await queryOrQueryString.json();
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
queryString = queryOrQueryString;
|
|
23
|
+
}
|
|
24
|
+
const req = v.parse(body, pushBodySchema);
|
|
25
|
+
if (queryString instanceof URLSearchParams) {
|
|
26
|
+
queryString = Object.fromEntries(queryString);
|
|
27
|
+
}
|
|
28
|
+
const queryParams = v.parse(queryString, pushParamsSchema, 'passthrough');
|
|
29
|
+
if (req.pushVersion !== 1) {
|
|
30
|
+
return {
|
|
31
|
+
error: 'unsupportedPushVersion',
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const transactor = new Transactor(req, queryParams, logLevel);
|
|
35
|
+
const responses = [];
|
|
36
|
+
for (const m of req.mutations) {
|
|
37
|
+
assert(m.type === 'custom', 'Expected custom mutation');
|
|
38
|
+
const res = await cb((dbProvider, innerCb) => transactor.transact(dbProvider, m, innerCb), m);
|
|
39
|
+
responses.push(res);
|
|
40
|
+
// We only stop processing if the mutation is out of order.
|
|
41
|
+
// If the mutation has already been processed or if it returns an application error,
|
|
42
|
+
// we continue processing the next mutation.
|
|
43
|
+
if ('error' in res.result && res.result.error === 'oooMutation') {
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
mutations: responses,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
class Transactor {
|
|
52
|
+
#req;
|
|
53
|
+
#params;
|
|
54
|
+
#lc;
|
|
55
|
+
constructor(req, params, logLevel) {
|
|
56
|
+
this.#req = req;
|
|
57
|
+
this.#params = params;
|
|
58
|
+
this.#lc = createLogContext(logLevel).withContext('PushProcessor');
|
|
59
|
+
}
|
|
60
|
+
transact = async (dbProvider, mutation, cb) => {
|
|
61
|
+
let caughtError = undefined;
|
|
62
|
+
for (;;) {
|
|
63
|
+
try {
|
|
64
|
+
const ret = await this.#transactImpl(dbProvider, mutation, cb, caughtError);
|
|
65
|
+
// The first time through we caught an error.
|
|
66
|
+
// We want to report that error as it was an application
|
|
67
|
+
// level error.
|
|
68
|
+
if (caughtError !== undefined) {
|
|
69
|
+
this.#lc.warn?.(`Mutation ${mutation.id} for client ${mutation.clientID} was retried after an error: ${caughtError}`);
|
|
70
|
+
return makeAppErrorResponse(mutation, caughtError);
|
|
71
|
+
}
|
|
72
|
+
return ret;
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
if (e instanceof OutOfOrderMutation) {
|
|
76
|
+
this.#lc.error?.(e);
|
|
77
|
+
return {
|
|
78
|
+
id: {
|
|
79
|
+
clientID: mutation.clientID,
|
|
80
|
+
id: mutation.id,
|
|
81
|
+
},
|
|
82
|
+
result: {
|
|
83
|
+
error: 'oooMutation',
|
|
84
|
+
details: e.message,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (e instanceof MutationAlreadyProcessedError) {
|
|
89
|
+
this.#lc.warn?.(e);
|
|
90
|
+
return {
|
|
91
|
+
id: {
|
|
92
|
+
clientID: mutation.clientID,
|
|
93
|
+
id: mutation.id,
|
|
94
|
+
},
|
|
95
|
+
result: {
|
|
96
|
+
error: 'alreadyProcessed',
|
|
97
|
+
details: e.message,
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
// We threw an error while running in error mode.
|
|
102
|
+
// Re-throw the error and stop processing any further
|
|
103
|
+
// mutations as all subsequent mutations will fail by being
|
|
104
|
+
// out of order.
|
|
105
|
+
if (caughtError !== undefined) {
|
|
106
|
+
throw e;
|
|
107
|
+
}
|
|
108
|
+
caughtError = e;
|
|
109
|
+
this.#lc.error?.(`Unexpected error processing mutation ${mutation.id} for client ${mutation.clientID}`, e);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
#transactImpl(dbProvider, mutation, cb, caughtError) {
|
|
114
|
+
return dbProvider.transaction(async (dbTx, transactionHooks) => {
|
|
115
|
+
await this.#checkAndIncrementLastMutationID(transactionHooks, mutation.clientID, mutation.id);
|
|
116
|
+
if (caughtError === undefined) {
|
|
117
|
+
await cb(dbTx, mutation.name, mutation.args[0]);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
const appError = makeAppErrorResponse(mutation, caughtError);
|
|
121
|
+
await transactionHooks.writeMutationResult(appError);
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
id: {
|
|
125
|
+
clientID: mutation.clientID,
|
|
126
|
+
id: mutation.id,
|
|
127
|
+
},
|
|
128
|
+
result: {},
|
|
129
|
+
};
|
|
130
|
+
}, {
|
|
131
|
+
upstreamSchema: this.#params.schema,
|
|
132
|
+
clientGroupID: this.#req.clientGroupID,
|
|
133
|
+
clientID: mutation.clientID,
|
|
134
|
+
mutationID: mutation.id,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
async #checkAndIncrementLastMutationID(transactionHooks, clientID, receivedMutationID) {
|
|
138
|
+
const { lastMutationID } = await transactionHooks.updateClientMutationID();
|
|
139
|
+
if (receivedMutationID < lastMutationID) {
|
|
140
|
+
throw new MutationAlreadyProcessedError(clientID, receivedMutationID, lastMutationID);
|
|
141
|
+
}
|
|
142
|
+
else if (receivedMutationID > lastMutationID) {
|
|
143
|
+
throw new OutOfOrderMutation(clientID, receivedMutationID, lastMutationID);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
export class OutOfOrderMutation extends Error {
|
|
148
|
+
constructor(clientID, receivedMutationID, lastMutationID) {
|
|
149
|
+
super(`Client ${clientID} sent mutation ID ${receivedMutationID} but expected ${lastMutationID}`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function makeAppErrorResponse(m, e) {
|
|
153
|
+
return {
|
|
154
|
+
id: {
|
|
155
|
+
clientID: m.clientID,
|
|
156
|
+
id: m.id,
|
|
157
|
+
},
|
|
158
|
+
result: {
|
|
159
|
+
error: 'app',
|
|
160
|
+
details: e instanceof Error ? e.message : 'exception was not of type `Error`',
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
export function getMutation(
|
|
165
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
166
|
+
mutators, name) {
|
|
167
|
+
let path;
|
|
168
|
+
if (name.includes('|')) {
|
|
169
|
+
path = name.split('|');
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
path = name.split('.');
|
|
173
|
+
}
|
|
174
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
175
|
+
let mutator;
|
|
176
|
+
if (path.length === 1) {
|
|
177
|
+
mutator = mutators[path[0]];
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
const nextMap = mutators[path[0]];
|
|
181
|
+
assert(typeof nextMap === 'object' && nextMap !== undefined, `could not find mutator map for ${name}`);
|
|
182
|
+
mutator = nextMap[path[1]];
|
|
183
|
+
}
|
|
184
|
+
assert(typeof mutator === 'function', () => `could not find mutator ${name}`);
|
|
185
|
+
return mutator;
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=process-mutations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-mutations.js","sourceRoot":"","sources":["../../../../zero-server/src/process-mutations.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,gBAAgB,GAMjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,CAAC,MAAM,4BAA4B,CAAC;AAChD,OAAO,EAAC,6BAA6B,EAAC,MAAM,kDAAkD,CAAC;AAC/F,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAC,MAAM,EAAC,MAAM,6BAA6B,CAAC;AAsEnD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,EAG8B,EAC9B,kBAAsE,EACtE,IAAmC,EACnC,QAA+B;IAE/B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,IAAI,kBAAkB,YAAY,OAAO,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtE,QAAQ,GAAG,IAAgB,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,QAAQ,GAAG,MAAM,CAAC;QACpB,CAAC;IACH,CAAC;IAED,IAAI,WAAqD,CAAC;IAC1D,IAAI,kBAAkB,YAAY,OAAO,EAAE,CAAC;QAC1C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC5C,WAAW,GAAG,GAAG,CAAC,YAAY,CAAC;QAE/B,IAAI,GAAG,MAAM,kBAAkB,CAAC,IAAI,EAAE,CAAC;IACzC,CAAC;SAAM,CAAC;QACN,WAAW,GAAG,kBAAkB,CAAC;IACnC,CAAC;IACD,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAC1C,IAAI,WAAW,YAAY,eAAe,EAAE,CAAC;QAC3C,WAAW,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Q,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED,8DAA8D;IAC9D,IAAI,OAAY,CAAC;IACjB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC;SAAM,CAAC;QACN,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,MAAM,CACJ,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,SAAS,EACpD,kCAAkC,IAAI,EAAE,CACzC,CAAC;QACF,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;IAED,MAAM,CAAC,OAAO,OAAO,KAAK,UAAU,EAAE,GAAG,EAAE,CAAC,0BAA0B,IAAI,EAAE,CAAC,CAAC;IAC9E,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,29 +1,8 @@
|
|
|
1
1
|
import { type LogLevel } from '@rocicorp/logger';
|
|
2
2
|
import type { ReadonlyJSONValue } from '../../shared/src/json.ts';
|
|
3
|
-
import
|
|
4
|
-
import { pushParamsSchema, type MutationResponse, type PushResponse } from '../../zero-protocol/src/push.ts';
|
|
3
|
+
import { type PushResponse } from '../../zero-protocol/src/push.ts';
|
|
5
4
|
import type { CustomMutatorDefs } from './custom.ts';
|
|
6
|
-
|
|
7
|
-
export interface TransactionProviderHooks {
|
|
8
|
-
updateClientMutationID: () => Promise<{
|
|
9
|
-
lastMutationID: number | bigint;
|
|
10
|
-
}>;
|
|
11
|
-
writeMutationResult: (result: MutationResponse) => Promise<void>;
|
|
12
|
-
}
|
|
13
|
-
export interface TransactionProviderInput {
|
|
14
|
-
upstreamSchema: string;
|
|
15
|
-
clientGroupID: string;
|
|
16
|
-
clientID: string;
|
|
17
|
-
mutationID: number;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Defines the abstract interface for a database that PushProcessor can execute
|
|
21
|
-
* transactions against.
|
|
22
|
-
*/
|
|
23
|
-
export interface Database<T> {
|
|
24
|
-
transaction: <R>(callback: (tx: T, transactionHooks: TransactionProviderHooks) => Promise<R>, transactionInput: TransactionProviderInput) => Promise<R>;
|
|
25
|
-
}
|
|
26
|
-
type ExtractTransactionType<D> = D extends Database<infer T> ? T : never;
|
|
5
|
+
import { type ExtractTransactionType, type Database } from '../../zero-server/src/process-mutations.ts';
|
|
27
6
|
export declare class PushProcessor<D extends Database<ExtractTransactionType<D>>, MD extends CustomMutatorDefs<ExtractTransactionType<D>>> {
|
|
28
7
|
#private;
|
|
29
8
|
constructor(dbProvider: D, logLevel?: LogLevel);
|
|
@@ -47,8 +26,4 @@ export declare class PushProcessor<D extends Database<ExtractTransactionType<D>>
|
|
|
47
26
|
*/
|
|
48
27
|
process(mutators: MD, request: Request): Promise<PushResponse>;
|
|
49
28
|
}
|
|
50
|
-
export declare class OutOfOrderMutation extends Error {
|
|
51
|
-
constructor(clientID: string, receivedMutationID: number, lastMutationID: number | bigint);
|
|
52
|
-
}
|
|
53
|
-
export {};
|
|
54
29
|
//# sourceMappingURL=push-processor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push-processor.d.ts","sourceRoot":"","sources":["../../../../zero-server/src/push-processor.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"push-processor.d.ts","sourceRoot":"","sources":["../../../../zero-server/src/push-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,aAAa,CAAC;AACnD,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,QAAQ,EAGd,MAAM,4CAA4C,CAAC;AAGpD,qBAAa,aAAa,CACxB,CAAC,SAAS,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,EAC7C,EAAE,SAAS,iBAAiB,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;;gBAK3C,UAAU,EAAE,CAAC,EAAE,QAAQ,GAAE,QAAiB;IAKtD;;;;;;;;;;OAUG;IACH,OAAO,CACL,QAAQ,EAAE,EAAE,EACZ,WAAW,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACrD,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,YAAY,CAAC;IAExB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC;CA6D/D"}
|
|
@@ -1,174 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {} from '@rocicorp/logger';
|
|
2
2
|
import { assert } from "../../shared/src/asserts.js";
|
|
3
|
-
import
|
|
4
|
-
import { MutationAlreadyProcessedError } from "../../zero-cache/src/services/mutagen/mutagen.js";
|
|
5
|
-
import { pushBodySchema, pushParamsSchema, } from "../../zero-protocol/src/push.js";
|
|
3
|
+
import {} from "../../zero-protocol/src/push.js";
|
|
6
4
|
import { splitMutatorKey } from "../../zql/src/mutate/custom.js";
|
|
7
|
-
import {
|
|
5
|
+
import { mapMutationRequest, } from "../../zero-server/src/process-mutations.js";
|
|
6
|
+
import { must } from "../../shared/src/must.js";
|
|
8
7
|
export class PushProcessor {
|
|
9
8
|
#dbProvider;
|
|
10
|
-
#
|
|
9
|
+
#logLevel;
|
|
11
10
|
constructor(dbProvider, logLevel = 'info') {
|
|
12
11
|
this.#dbProvider = dbProvider;
|
|
13
|
-
this.#
|
|
12
|
+
this.#logLevel = logLevel;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
|
-
let queryString;
|
|
14
|
+
process(mutators, queryOrQueryString, body) {
|
|
17
15
|
if (queryOrQueryString instanceof Request) {
|
|
18
|
-
|
|
19
|
-
queryString = url.searchParams;
|
|
20
|
-
body = await queryOrQueryString.json();
|
|
16
|
+
return mapMutationRequest((transact, mutations) => this.#processMutation(mutators, transact, mutations), queryOrQueryString, this.#logLevel);
|
|
21
17
|
}
|
|
22
|
-
|
|
23
|
-
queryString = queryOrQueryString;
|
|
24
|
-
}
|
|
25
|
-
const req = v.parse(body, pushBodySchema);
|
|
26
|
-
if (queryString instanceof URLSearchParams) {
|
|
27
|
-
queryString = Object.fromEntries(queryString);
|
|
28
|
-
}
|
|
29
|
-
const queryParams = v.parse(queryString, pushParamsSchema, 'passthrough');
|
|
30
|
-
if (req.pushVersion !== 1) {
|
|
31
|
-
this.#lc.error?.(`Unsupported push version ${req.pushVersion} for clientGroupID ${req.clientGroupID}`);
|
|
32
|
-
return {
|
|
33
|
-
error: 'unsupportedPushVersion',
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
const responses = [];
|
|
37
|
-
for (const m of req.mutations) {
|
|
38
|
-
const res = await this.#processMutation(mutators, queryParams, req, m);
|
|
39
|
-
responses.push(res);
|
|
40
|
-
// we only break if we encounter an out-of-order mutation.
|
|
41
|
-
// otherwise we continue processing the rest of the mutations.
|
|
42
|
-
if ('error' in res.result && res.result.error === 'oooMutation') {
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return {
|
|
47
|
-
mutations: responses,
|
|
48
|
-
};
|
|
18
|
+
return mapMutationRequest((transact, mutation) => this.#processMutation(mutators, transact, mutation), queryOrQueryString, must(body), this.#logLevel);
|
|
49
19
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
for (;;) {
|
|
53
|
-
try {
|
|
54
|
-
const ret = await this.#processMutationImpl(mutators, params, req, m, caughtError);
|
|
55
|
-
// The first time through we caught an error.
|
|
56
|
-
// We want to report that error as it was an application
|
|
57
|
-
// level error.
|
|
58
|
-
if (caughtError !== undefined) {
|
|
59
|
-
this.#lc.warn?.(`Mutation ${m.id} for client ${m.clientID} was retried after an error: ${caughtError}`);
|
|
60
|
-
return makeAppErrorResponse(m, caughtError);
|
|
61
|
-
}
|
|
62
|
-
return ret;
|
|
63
|
-
}
|
|
64
|
-
catch (e) {
|
|
65
|
-
if (e instanceof OutOfOrderMutation) {
|
|
66
|
-
this.#lc.error?.(e);
|
|
67
|
-
return {
|
|
68
|
-
id: {
|
|
69
|
-
clientID: m.clientID,
|
|
70
|
-
id: m.id,
|
|
71
|
-
},
|
|
72
|
-
result: {
|
|
73
|
-
error: 'oooMutation',
|
|
74
|
-
details: e.message,
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
if (e instanceof MutationAlreadyProcessedError) {
|
|
79
|
-
this.#lc.warn?.(e);
|
|
80
|
-
return {
|
|
81
|
-
id: {
|
|
82
|
-
clientID: m.clientID,
|
|
83
|
-
id: m.id,
|
|
84
|
-
},
|
|
85
|
-
result: {
|
|
86
|
-
error: 'alreadyProcessed',
|
|
87
|
-
details: e.message,
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
// We threw an error while running in error mode.
|
|
92
|
-
// Re-throw the error and stop processing any further
|
|
93
|
-
// mutations as all subsequent mutations will fail by being
|
|
94
|
-
// out of order.
|
|
95
|
-
if (caughtError !== undefined) {
|
|
96
|
-
throw e;
|
|
97
|
-
}
|
|
98
|
-
caughtError = e;
|
|
99
|
-
this.#lc.error?.(`Unexpected error processing mutation ${m.id} for client ${m.clientID}`, e);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
#processMutationImpl(mutators, params, req, m, caughtError) {
|
|
104
|
-
if (m.type === 'crud') {
|
|
105
|
-
throw new Error('crud mutators are deprecated in favor of custom mutators.');
|
|
106
|
-
}
|
|
107
|
-
return this.#dbProvider.transaction(async (dbTx, transactionHooks) => {
|
|
108
|
-
await this.#checkAndIncrementLastMutationID(this.#lc, transactionHooks, m.clientID, m.id);
|
|
109
|
-
const result = {
|
|
110
|
-
id: {
|
|
111
|
-
clientID: m.clientID,
|
|
112
|
-
id: m.id,
|
|
113
|
-
},
|
|
114
|
-
result: {},
|
|
115
|
-
};
|
|
116
|
-
// no caught error? Not in error mode.
|
|
117
|
-
if (caughtError === undefined) {
|
|
118
|
-
await this.#dispatchMutation(dbTx, mutators, m);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
const appError = makeAppErrorResponse(m, caughtError);
|
|
122
|
-
await transactionHooks.writeMutationResult(appError);
|
|
123
|
-
}
|
|
124
|
-
return result;
|
|
125
|
-
}, {
|
|
126
|
-
upstreamSchema: params.schema,
|
|
127
|
-
clientGroupID: req.clientGroupID,
|
|
128
|
-
clientID: m.clientID,
|
|
129
|
-
mutationID: m.id,
|
|
130
|
-
});
|
|
20
|
+
#processMutation(mutators, transact, _mutation) {
|
|
21
|
+
return transact(this.#dbProvider, (tx, name, args) => this.#dispatchMutation(mutators, tx, name, args));
|
|
131
22
|
}
|
|
132
|
-
#dispatchMutation(dbTx,
|
|
133
|
-
const [namespace, name] = splitMutatorKey(
|
|
23
|
+
#dispatchMutation(mutators, dbTx, key, args) {
|
|
24
|
+
const [namespace, name] = splitMutatorKey(key);
|
|
134
25
|
if (name === undefined) {
|
|
135
26
|
const mutator = mutators[namespace];
|
|
136
|
-
assert(typeof mutator === 'function', () => `could not find mutator ${
|
|
137
|
-
return mutator(dbTx,
|
|
27
|
+
assert(typeof mutator === 'function', () => `could not find mutator ${key}`);
|
|
28
|
+
return mutator(dbTx, args);
|
|
138
29
|
}
|
|
139
30
|
const mutatorGroup = mutators[namespace];
|
|
140
31
|
assert(typeof mutatorGroup === 'object', () => `could not find mutators for namespace ${namespace}`);
|
|
141
32
|
const mutator = mutatorGroup[name];
|
|
142
|
-
assert(typeof mutator === 'function', () => `could not find mutator ${
|
|
143
|
-
return mutator(dbTx,
|
|
33
|
+
assert(typeof mutator === 'function', () => `could not find mutator ${key}`);
|
|
34
|
+
return mutator(dbTx, args);
|
|
144
35
|
}
|
|
145
|
-
async #checkAndIncrementLastMutationID(lc, transactionHooks, clientID, receivedMutationID) {
|
|
146
|
-
lc.debug?.(`Incrementing LMID. Received: ${receivedMutationID}`);
|
|
147
|
-
const { lastMutationID } = await transactionHooks.updateClientMutationID();
|
|
148
|
-
if (receivedMutationID < lastMutationID) {
|
|
149
|
-
throw new MutationAlreadyProcessedError(clientID, receivedMutationID, lastMutationID);
|
|
150
|
-
}
|
|
151
|
-
else if (receivedMutationID > lastMutationID) {
|
|
152
|
-
throw new OutOfOrderMutation(clientID, receivedMutationID, lastMutationID);
|
|
153
|
-
}
|
|
154
|
-
lc.debug?.(`Incremented LMID. Received: ${receivedMutationID}. New: ${lastMutationID}`);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
export class OutOfOrderMutation extends Error {
|
|
158
|
-
constructor(clientID, receivedMutationID, lastMutationID) {
|
|
159
|
-
super(`Client ${clientID} sent mutation ID ${receivedMutationID} but expected ${lastMutationID}`);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
function makeAppErrorResponse(m, e) {
|
|
163
|
-
return {
|
|
164
|
-
id: {
|
|
165
|
-
clientID: m.clientID,
|
|
166
|
-
id: m.id,
|
|
167
|
-
},
|
|
168
|
-
result: {
|
|
169
|
-
error: 'app',
|
|
170
|
-
details: e instanceof Error ? e.message : 'exception was not of type `Error`',
|
|
171
|
-
},
|
|
172
|
-
};
|
|
173
36
|
}
|
|
174
37
|
//# sourceMappingURL=push-processor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push-processor.js","sourceRoot":"","sources":["../../../../zero-server/src/push-processor.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"push-processor.js","sourceRoot":"","sources":["../../../../zero-server/src/push-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAC,MAAM,EAAC,MAAM,6BAA6B,CAAC;AAEnD,OAAO,EAIN,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAGL,kBAAkB,GAEnB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAC,IAAI,EAAC,MAAM,0BAA0B,CAAC;AAE9C,MAAM,OAAO,aAAa;IAIf,WAAW,CAAI;IACf,SAAS,CAAC;IAEnB,YAAY,UAAa,EAAE,WAAqB,MAAM;QACpD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IA0BD,OAAO,CACL,QAAY,EACZ,kBAAsE,EACtE,IAAwB;QAExB,IAAI,kBAAkB,YAAY,OAAO,EAAE,CAAC;YAC1C,OAAO,kBAAkB,CACvB,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,CACtB,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,EACtD,kBAAkB,EAClB,IAAI,CAAC,SAAS,CACf,CAAC;QACJ,CAAC;QACD,OAAO,kBAAkB,CACvB,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,CACrB,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,EACrD,kBAAkB,EAClB,IAAI,CAAC,IAAI,CAAC,EACV,IAAI,CAAC,SAAS,CACf,CAAC;IACJ,CAAC;IAED,gBAAgB,CACd,QAAY,EACZ,QAAoB,EACpB,SAAyB;QAEzB,OAAO,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CACnD,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,CACjD,CAAC;IACJ,CAAC;IAED,iBAAiB,CACf,QAAY,EACZ,IAA+B,EAC/B,GAAW,EACX,IAAuB;QAEvB,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;QAC/C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,MAAM,OAAO,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;YACpC,MAAM,CACJ,OAAO,OAAO,KAAK,UAAU,EAC7B,GAAG,EAAE,CAAC,0BAA0B,GAAG,EAAE,CACtC,CAAC;YACF,OAAO,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7B,CAAC;QAED,MAAM,YAAY,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;QACzC,MAAM,CACJ,OAAO,YAAY,KAAK,QAAQ,EAChC,GAAG,EAAE,CAAC,yCAAyC,SAAS,EAAE,CAC3D,CAAC;QACF,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,CACJ,OAAO,OAAO,KAAK,UAAU,EAC7B,GAAG,EAAE,CAAC,0BAA0B,GAAG,EAAE,CACtC,CAAC;QACF,OAAO,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF"}
|
|
@@ -10,7 +10,7 @@ import type { Schema } from '../../../zero-schema/src/builder/schema-builder.ts'
|
|
|
10
10
|
*
|
|
11
11
|
* If you need to limit concurrency, you can use a library like `p-limit` to wrap the `cb` function.
|
|
12
12
|
*/
|
|
13
|
-
export declare function
|
|
13
|
+
export declare function mapQueryRequest<S extends Schema>(cb: (name: string, args: readonly ReadonlyJSONValue[]) => Promise<{
|
|
14
14
|
query: AnyQuery;
|
|
15
15
|
}>, schema: S, requestOrJsonBody: Request | ReadonlyJSONValue): Promise<TransformResponseMessage>;
|
|
16
16
|
//# sourceMappingURL=process-queries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-queries.d.ts","sourceRoot":"","sources":["../../../../../zero-server/src/queries/process-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,sCAAsC,CAAC;AAEnE,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,oDAAoD,CAAC;AAI/E;;;;;;;GAOG;AACH,wBAAsB,
|
|
1
|
+
{"version":3,"file":"process-queries.d.ts","sourceRoot":"","sources":["../../../../../zero-server/src/queries/process-queries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,sCAAsC,CAAC;AAEnE,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,oDAAoD,CAAC;AAI/E;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,CAAC,SAAS,MAAM,EACpD,EAAE,EAAE,CACF,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,iBAAiB,EAAE,KAC/B,OAAO,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAA;CAAC,CAAC,EAC/B,MAAM,EAAE,CAAC,EACT,iBAAiB,EAAE,OAAO,GAAG,iBAAiB,GAC7C,OAAO,CAAC,wBAAwB,CAAC,CAwBnC"}
|
|
@@ -11,7 +11,7 @@ import { mapAST } from "../../../zero-protocol/src/ast.js";
|
|
|
11
11
|
*
|
|
12
12
|
* If you need to limit concurrency, you can use a library like `p-limit` to wrap the `cb` function.
|
|
13
13
|
*/
|
|
14
|
-
export async function
|
|
14
|
+
export async function mapQueryRequest(cb, schema, requestOrJsonBody) {
|
|
15
15
|
const nameMapper = clientToServer(schema.tables);
|
|
16
16
|
let body;
|
|
17
17
|
if (requestOrJsonBody instanceof Request) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-queries.js","sourceRoot":"","sources":["../../../../../zero-server/src/queries/process-queries.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,MAAM,sCAAsC,CAAC;AACnE,OAAO,KAAK,CAAC,MAAM,+BAA+B,CAAC;AACnD,OAAO,EACL,6BAA6B,GAE9B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EAAC,cAAc,EAAC,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAC,MAAM,EAAC,MAAM,mCAAmC,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"process-queries.js","sourceRoot":"","sources":["../../../../../zero-server/src/queries/process-queries.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,MAAM,sCAAsC,CAAC;AACnE,OAAO,KAAK,CAAC,MAAM,+BAA+B,CAAC;AACnD,OAAO,EACL,6BAA6B,GAE9B,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EAAC,cAAc,EAAC,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAC,MAAM,EAAC,MAAM,mCAAmC,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,EAG+B,EAC/B,MAAS,EACT,iBAA8C;IAE9C,MAAM,UAAU,GAAG,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAEjD,IAAI,IAAuB,CAAC;IAC5B,IAAI,iBAAiB,YAAY,OAAO,EAAE,CAAC;QACzC,IAAI,GAAG,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;IACxC,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,iBAAiB,CAAC;IAC3B,CAAC;IAED,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,6BAA6B,CAAC,CAAC;IAC5D,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CACjC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,EAAC,GAAG,EAAC,EAAE;QACxB,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QAE7C,OAAO;YACL,EAAE,EAAE,GAAG,CAAC,EAAE;YACV,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,UAAU,CAAC;SACnC,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DBConnection } from '../../zql/src/mutate/custom.ts';
|
|
2
2
|
import { TransactionImpl } from './custom.ts';
|
|
3
3
|
import type { Schema } from '../../zero-schema/src/builder/schema-builder.ts';
|
|
4
|
-
import type { Database, TransactionProviderHooks, TransactionProviderInput } from './
|
|
4
|
+
import type { Database, TransactionProviderHooks, TransactionProviderInput } from './process-mutations.ts';
|
|
5
5
|
/**
|
|
6
6
|
* Implements a Database for use with PushProcessor that is backed by Postgres.
|
|
7
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zql-database.d.ts","sourceRoot":"","sources":["../../../../zero-server/src/zql-database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EAAiB,eAAe,EAAC,MAAM,aAAa,CAAC;AAC5D,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,iDAAiD,CAAC;AAE5E,OAAO,KAAK,EACV,QAAQ,EACR,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,
|
|
1
|
+
{"version":3,"file":"zql-database.d.ts","sourceRoot":"","sources":["../../../../zero-server/src/zql-database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EAAiB,eAAe,EAAC,MAAM,aAAa,CAAC;AAC5D,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,iDAAiD,CAAC;AAE5E,OAAO,KAAK,EACV,QAAQ,EACR,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAEhC;;;;;;GAMG;AACH,qBAAa,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,kBAAkB,CAC3D,YAAW,QAAQ,CAAC,eAAe,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC;;gBAc/C,UAAU,EAAE,YAAY,CAAC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAOnE,WAAW,CAAC,CAAC,EACX,QAAQ,EAAE,CACR,EAAE,EAAE,eAAe,CAAC,CAAC,EAAE,kBAAkB,CAAC,EAC1C,gBAAgB,EAAE,wBAAwB,KACvC,OAAO,CAAC,CAAC,CAAC,EACf,gBAAgB,EAAE,wBAAwB,GACzC,OAAO,CAAC,CAAC,CAAC;CA2Cd"}
|
package/out/zero.js
CHANGED
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
createBuilder,
|
|
6
6
|
definePermissions,
|
|
7
7
|
escapeLike,
|
|
8
|
-
queries,
|
|
9
|
-
queriesWithContext,
|
|
10
8
|
relationships,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
syncedQuery,
|
|
10
|
+
syncedQueryWithContext,
|
|
11
|
+
withContext,
|
|
12
|
+
withValidation
|
|
13
|
+
} from "./chunk-ZKQCPILX.js";
|
|
14
14
|
import {
|
|
15
15
|
IDBNotFoundError,
|
|
16
16
|
TransactionClosedError,
|
|
@@ -27,12 +27,14 @@ import {
|
|
|
27
27
|
number,
|
|
28
28
|
string,
|
|
29
29
|
table,
|
|
30
|
+
transformRequestMessageSchema,
|
|
31
|
+
transformResponseMessageSchema,
|
|
30
32
|
update_needed_reason_type_enum_exports
|
|
31
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-ZZJ2SCHD.js";
|
|
32
34
|
import "./chunk-MKB4RXL3.js";
|
|
33
35
|
import {
|
|
34
36
|
applyChange
|
|
35
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-RPVWLROJ.js";
|
|
36
38
|
import "./chunk-SGW2EIVJ.js";
|
|
37
39
|
import "./chunk-424PT5DM.js";
|
|
38
40
|
export {
|
|
@@ -57,12 +59,14 @@ export {
|
|
|
57
59
|
json,
|
|
58
60
|
makeIDBName,
|
|
59
61
|
number,
|
|
60
|
-
queries,
|
|
61
|
-
queriesWithContext,
|
|
62
62
|
relationships,
|
|
63
63
|
string,
|
|
64
|
+
syncedQuery,
|
|
65
|
+
syncedQueryWithContext,
|
|
64
66
|
table,
|
|
65
67
|
transformRequestMessageSchema,
|
|
66
|
-
transformResponseMessageSchema
|
|
68
|
+
transformResponseMessageSchema,
|
|
69
|
+
withContext,
|
|
70
|
+
withValidation
|
|
67
71
|
};
|
|
68
72
|
//# sourceMappingURL=zero.js.map
|
|
@@ -3,8 +3,9 @@ import type { AST, Condition, Disjunction, Ordering } from '../../../zero-protoc
|
|
|
3
3
|
import type { Row } from '../../../zero-protocol/src/data.ts';
|
|
4
4
|
import type { PrimaryKey } from '../../../zero-protocol/src/primary-key.ts';
|
|
5
5
|
import { type FilterInput } from '../ivm/filter-operators.ts';
|
|
6
|
-
import type { Input, Storage } from '../ivm/operator.ts';
|
|
6
|
+
import type { Input, InputBase, Storage } from '../ivm/operator.ts';
|
|
7
7
|
import type { Source, SourceInput } from '../ivm/source.ts';
|
|
8
|
+
import type { DebugDelegate } from './debug-delegate.ts';
|
|
8
9
|
import { type NoSubqueryCondition } from './filter.ts';
|
|
9
10
|
export type StaticQueryParameters = {
|
|
10
11
|
authData: Record<string, JSONValue>;
|
|
@@ -15,6 +16,8 @@ export type StaticQueryParameters = {
|
|
|
15
16
|
* pipeline to delegate environment to provide sources and storage.
|
|
16
17
|
*/
|
|
17
18
|
export interface BuilderDelegate {
|
|
19
|
+
readonly applyFiltersAnyway?: boolean | undefined;
|
|
20
|
+
readonly debug?: DebugDelegate | undefined;
|
|
18
21
|
/**
|
|
19
22
|
* Called once for each source needed by the AST.
|
|
20
23
|
* Might be called multiple times with same tableName. It is OK to return
|
|
@@ -27,6 +30,7 @@ export interface BuilderDelegate {
|
|
|
27
30
|
*/
|
|
28
31
|
createStorage(name: string): Storage;
|
|
29
32
|
decorateInput(input: Input, name: string): Input;
|
|
33
|
+
addEdge(source: InputBase, dest: InputBase): void;
|
|
30
34
|
decorateFilterInput(input: FilterInput, name: string): FilterInput;
|
|
31
35
|
decorateSourceInput(input: SourceInput, queryID: string): Input;
|
|
32
36
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../../../zql/src/builder/builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,6BAA6B,CAAC;AAE3D,OAAO,KAAK,EACV,GAAG,EAGH,SAAS,EAIT,WAAW,EAEX,QAAQ,EAIT,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,oCAAoC,CAAC;AAC5D,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,2CAA2C,CAAC;AAI1E,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EAAC,KAAK,EAAE,OAAO,EAAC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../../../zql/src/builder/builder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,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