@aventara/core 1.0.0-rc.1 → 1.0.0-rc.11
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/CHANGELOG.md +1022 -16
- package/ERRORS.md +142 -0
- package/README.md +330 -16
- package/dist/adapters/adapter-discovery-diagnostic.guidance.d.ts +6 -0
- package/dist/adapters/adapter-discovery-diagnostic.guidance.js +7 -0
- package/dist/adapters/adapter-field.d.ts +22 -0
- package/dist/adapters/adapter-identifier.d.ts +9 -0
- package/dist/adapters/adapter-identifier.js +6 -1
- package/dist/adapters/adapter-model.d.ts +9 -0
- package/dist/adapters/adapter-operation.d.ts +18 -3
- package/dist/adapters/adapter-resource.d.ts +5 -0
- package/dist/adapters/adapter.interface.d.ts +10 -0
- package/dist/avz/avz.d.ts +1 -1
- package/dist/avz/json-shape.registry.d.ts +2 -1
- package/dist/compiler/contract-compiler-diagnostic.guidance.d.ts +6 -0
- package/dist/compiler/contract-compiler-diagnostic.guidance.js +97 -0
- package/dist/compiler/contract.compiler.d.ts +6 -0
- package/dist/compiler/contract.compiler.js +281 -31
- package/dist/compiler/create-requirements.projector.js +1 -3
- package/dist/compiler/field-validator.compiler.js +1 -3
- package/dist/compiler/managed-elsewhere.projector.d.ts +52 -0
- package/dist/compiler/managed-elsewhere.projector.js +179 -0
- package/dist/compiler/managed-elsewhere.validator.d.ts +9 -0
- package/dist/compiler/managed-elsewhere.validator.js +74 -0
- package/dist/config/cache-stage.factory.d.ts +24 -0
- package/dist/config/cache-stage.factory.js +3 -0
- package/dist/config/computed-fields.d.ts +62 -0
- package/dist/config/computed-fields.js +73 -0
- package/dist/config/config-diagnostic.guidance.d.ts +6 -0
- package/dist/config/config-diagnostic.guidance.js +32 -0
- package/dist/config/config.resolver.d.ts +24 -0
- package/dist/config/config.resolver.js +66 -7
- package/dist/config/config.validator.js +283 -21
- package/dist/config/define-resource.d.ts +1 -5
- package/dist/config/entrypoint.normalizer.d.ts +3 -2
- package/dist/config/exact-framework-config.d.ts +73 -22
- package/dist/config/field-compute.resolver.d.ts +2 -0
- package/dist/config/field-compute.resolver.js +9 -3
- package/dist/config/framework-config.d.ts +53 -15
- package/dist/config/framework-resources-config.d.ts +25 -14
- package/dist/config/pipeline-config.d.ts +20 -4
- package/dist/config/pipeline-tree.resolver.d.ts +2 -2
- package/dist/config/pipeline-tree.resolver.js +2 -3
- package/dist/contracts/access-route.rules.d.ts +10 -0
- package/dist/contracts/access-route.rules.js +45 -0
- package/dist/contracts/canonical-json.writer.d.ts +7 -0
- package/dist/contracts/canonical-json.writer.js +55 -0
- package/dist/contracts/capability.d.ts +26 -1
- package/dist/contracts/capability.js +20 -0
- package/dist/contracts/client-contract-structure.validator.d.ts +365 -89
- package/dist/contracts/client-contract-structure.validator.js +49 -2
- package/dist/contracts/contract-access.d.ts +29 -0
- package/dist/contracts/contract-access.js +1 -0
- package/dist/contracts/contract-canonicalizer.d.ts +9 -1
- package/dist/contracts/contract-canonicalizer.js +35 -4
- package/dist/contracts/contract-hash.d.ts +0 -1
- package/dist/contracts/contract-hash.js +1 -1
- package/dist/contracts/contract-limits.d.ts +6 -0
- package/dist/contracts/contract-limits.js +2 -0
- package/dist/contracts/contract.d.ts +42 -1
- package/dist/contracts/field.d.ts +58 -1
- package/dist/contracts/json-schema.projector.d.ts +11 -0
- package/dist/contracts/json-schema.projector.js +76 -0
- package/dist/contracts/scalar-value-type.d.ts +3 -1
- package/dist/framework/access-facade.d.ts +116 -0
- package/dist/framework/access-facade.js +118 -0
- package/dist/framework/contract-view.d.ts +120 -16
- package/dist/framework/framework-construction.error.d.ts +14 -4
- package/dist/framework/framework-construction.error.js +18 -2
- package/dist/framework/framework.d.ts +26 -5
- package/dist/framework/framework.factory.d.ts +1 -1
- package/dist/framework/framework.factory.js +145 -24
- package/dist/framework/operation-facade.d.ts +141 -13
- package/dist/framework/operation-facade.js +9 -1
- package/dist/framework/operation-set.runner.d.ts +47 -0
- package/dist/framework/operation-set.runner.js +168 -0
- package/dist/index.d.ts +19 -5
- package/dist/index.js +3 -0
- package/dist/internal.d.ts +9 -2
- package/dist/internal.js +8 -0
- package/dist/operations/database-refusal.d.ts +51 -0
- package/dist/operations/database-refusal.js +45 -0
- package/dist/operations/operation-arguments.d.ts +148 -60
- package/dist/operations/operation-call.d.ts +9 -5
- package/dist/operations/operation-result.d.ts +6 -4
- package/dist/operations/operation-validator-core.js +160 -39
- package/dist/operations/operation-validator.d.ts +1 -1
- package/dist/operations/structural-limits.walker.d.ts +1 -1
- package/dist/operations/structural-limits.walker.js +1 -3
- package/dist/operations/validation-code.guidance.d.ts +6 -0
- package/dist/operations/validation-code.guidance.js +90 -0
- package/dist/operations/write-scope.resolver.d.ts +4 -0
- package/dist/operations/write-scope.resolver.js +2 -0
- package/dist/policy/access-provider.interface.d.ts +91 -0
- package/dist/policy/access-provider.interface.js +1 -0
- package/dist/policy/access-provider.registry.d.ts +17 -0
- package/dist/policy/access-provider.registry.js +15 -0
- package/dist/policy/access-question.d.ts +20 -0
- package/dist/policy/access-question.js +1 -0
- package/dist/policy/access-question.registry.d.ts +5 -0
- package/dist/policy/access-question.registry.js +19 -0
- package/dist/policy/access-question.runtime.d.ts +36 -0
- package/dist/policy/access-question.runtime.js +295 -0
- package/dist/policy/access-verb.table.d.ts +56 -0
- package/dist/policy/access-verb.table.js +21 -0
- package/dist/policy/access-verbs.d.ts +46 -0
- package/dist/policy/access-verbs.js +1 -0
- package/dist/policy/policy-admission.d.ts +20 -0
- package/dist/policy/policy-admission.js +407 -0
- package/dist/policy/policy-after-update.runtime.d.ts +79 -0
- package/dist/policy/policy-after-update.runtime.js +206 -0
- package/dist/policy/policy-condition.d.ts +15 -0
- package/dist/policy/policy-condition.js +36 -0
- package/dist/policy/policy-engine.d.ts +205 -0
- package/dist/policy/policy-engine.js +1 -0
- package/dist/policy/policy-named-rows.d.ts +18 -0
- package/dist/policy/policy-named-rows.js +51 -0
- package/dist/policy/policy-nested-write.runtime.d.ts +44 -0
- package/dist/policy/policy-nested-write.runtime.js +536 -0
- package/dist/policy/policy-read.runtime.d.ts +81 -0
- package/dist/policy/policy-read.runtime.js +501 -0
- package/dist/policy/policy-reference-write.runtime.d.ts +51 -0
- package/dist/policy/policy-reference-write.runtime.js +336 -0
- package/dist/policy/policy-request.d.ts +72 -0
- package/dist/policy/policy-request.js +115 -0
- package/dist/policy/policy-session.d.ts +106 -0
- package/dist/policy/policy-session.js +293 -0
- package/dist/policy/policy-startup.validator.d.ts +10 -0
- package/dist/policy/policy-startup.validator.js +112 -0
- package/dist/policy/policy-write.runtime.d.ts +39 -0
- package/dist/policy/policy-write.runtime.js +530 -0
- package/dist/prebuilt/core-version.generated.d.ts +2 -0
- package/dist/prebuilt/core-version.generated.js +1 -0
- package/dist/prebuilt/prebuilt-changes.d.ts +29 -0
- package/dist/prebuilt/prebuilt-changes.js +63 -0
- package/dist/prebuilt/prebuilt-contracts.d.ts +40 -0
- package/dist/prebuilt/prebuilt-contracts.emitter.d.ts +16 -0
- package/dist/prebuilt/prebuilt-contracts.emitter.js +50 -0
- package/dist/prebuilt/prebuilt-contracts.js +1 -0
- package/dist/prebuilt/prebuilt-contracts.loader.d.ts +19 -0
- package/dist/prebuilt/prebuilt-contracts.loader.js +75 -0
- package/dist/prebuilt/prebuilt-inputs.fingerprint.d.ts +16 -0
- package/dist/prebuilt/prebuilt-inputs.fingerprint.js +227 -0
- package/dist/protocol/absent-route.responder.d.ts +49 -14
- package/dist/protocol/absent-route.responder.js +92 -15
- package/dist/protocol/contract-document.responder.d.ts +9 -1
- package/dist/protocol/contract-document.responder.js +3 -2
- package/dist/protocol/http-request.decoder.d.ts +52 -3
- package/dist/protocol/http-request.decoder.js +45 -6
- package/dist/protocol/http-request.reader.d.ts +10 -3
- package/dist/protocol/http-request.reader.js +12 -2
- package/dist/protocol/http-response.encoder.d.ts +12 -0
- package/dist/protocol/http-response.encoder.js +17 -3
- package/dist/protocol/operation-response.guard.js +1 -3
- package/dist/protocol/operation-set.decoder.d.ts +48 -0
- package/dist/protocol/operation-set.decoder.js +185 -0
- package/dist/protocol/operation-set.handler.d.ts +27 -0
- package/dist/protocol/operation-set.handler.js +179 -0
- package/dist/protocol/protocol-headers.d.ts +12 -3
- package/dist/protocol/protocol-headers.js +12 -5
- package/dist/protocol/protocol-surface.d.ts +16 -3
- package/dist/protocol/protocol-surface.js +41 -1
- package/dist/protocol/protocol.binder.d.ts +52 -1
- package/dist/protocol/protocol.binder.js +6 -1
- package/dist/protocol/protocol.handler.d.ts +45 -1
- package/dist/protocol/protocol.handler.js +164 -19
- package/dist/protocol/read-cache.responder.d.ts +26 -0
- package/dist/protocol/read-cache.responder.js +47 -0
- package/dist/protocol/read-query.codec.d.ts +34 -0
- package/dist/protocol/read-query.codec.js +125 -0
- package/dist/runtime/caller-data.copier.d.ts +18 -3
- package/dist/runtime/caller-data.copier.js +21 -8
- package/dist/runtime/caller-data.door.d.ts +13 -6
- package/dist/runtime/computed-read-runtime.d.ts +6 -1
- package/dist/runtime/computed-read-runtime.js +229 -48
- package/dist/runtime/computed-value.error.d.ts +3 -2
- package/dist/runtime/computed-value.error.js +3 -2
- package/dist/runtime/context-executor.runtime.d.ts +4 -3
- package/dist/runtime/context-executor.runtime.js +4 -2
- package/dist/runtime/core-class.brand.d.ts +10 -0
- package/dist/runtime/core-class.brand.js +21 -0
- package/dist/runtime/create-requirement.d.ts +31 -5
- package/dist/runtime/create-requirement.js +130 -24
- package/dist/runtime/decimal.d.ts +14 -0
- package/dist/runtime/decimal.js +21 -0
- package/dist/runtime/diagnostics-reporter.d.ts +49 -9
- package/dist/runtime/diagnostics-reporter.js +16 -9
- package/dist/runtime/error-boundary.d.ts +9 -2
- package/dist/runtime/error-boundary.js +12 -0
- package/dist/runtime/error-guidance.d.ts +12 -0
- package/dist/runtime/error-guidance.js +1 -0
- package/dist/runtime/error.catalog.d.ts +49 -0
- package/dist/runtime/error.catalog.js +49 -0
- package/dist/runtime/execution-options.d.ts +8 -0
- package/dist/runtime/field-check.evaluator.d.ts +0 -2
- package/dist/runtime/field-check.evaluator.js +1 -1
- package/dist/runtime/field-compute.d.ts +11 -10
- package/dist/runtime/field-stage.runtime.d.ts +3 -3
- package/dist/runtime/field-stage.runtime.js +9 -11
- package/dist/runtime/field-validator.runtime.d.ts +19 -1
- package/dist/runtime/field-validator.runtime.js +49 -9
- package/dist/runtime/framework-error.js +9 -0
- package/dist/runtime/framework-warning.emitter.d.ts +6 -0
- package/dist/runtime/framework-warning.emitter.js +8 -0
- package/dist/runtime/json-value.d.ts +10 -5
- package/dist/runtime/level-lifecycle.runtime.d.ts +4 -3
- package/dist/runtime/level-lifecycle.runtime.js +3 -5
- package/dist/runtime/mutation-planner.d.ts +1 -6
- package/dist/runtime/mutation-planner.js +4 -17
- package/dist/runtime/nested-write.walker.js +2 -1
- package/dist/runtime/operation-code.guidance.d.ts +6 -0
- package/dist/runtime/operation-code.guidance.js +167 -0
- package/dist/runtime/operation-request.d.ts +16 -9
- package/dist/runtime/operation-runtime.d.ts +35 -17
- package/dist/runtime/operation-runtime.js +220 -49
- package/dist/runtime/outcome-mapper.d.ts +2 -1
- package/dist/runtime/output-validator.d.ts +1 -1
- package/dist/runtime/output-validator.js +1 -3
- package/dist/runtime/owned-execution.registry.d.ts +34 -4
- package/dist/runtime/pipe-output.validator.d.ts +10 -0
- package/dist/runtime/pipe-output.validator.js +4 -2
- package/dist/runtime/pipeline.d.ts +52 -23
- package/dist/runtime/readonly-value.d.ts +20 -5
- package/dist/runtime/readonly-value.js +74 -26
- package/dist/runtime/record.guard.d.ts +14 -0
- package/dist/runtime/record.guard.js +10 -0
- package/dist/runtime/referential-action.d.ts +1 -1
- package/dist/runtime/request-envelope.validator.js +13 -10
- package/dist/runtime/scalar-runtime.d.ts +4 -21
- package/dist/runtime/scalar-runtime.js +91 -31
- package/dist/runtime/thenable.guard.d.ts +7 -0
- package/dist/runtime/thenable.guard.js +5 -0
- package/dist/runtime/unsent-value.normalizer.d.ts +15 -0
- package/dist/runtime/unsent-value.normalizer.js +129 -0
- package/dist/transactions/operation-arguments-encoder.js +9 -10
- package/dist/transactions/operation-fingerprint.js +2 -2
- package/dist/transactions/sql-statement.d.ts +10 -2
- package/dist/transactions/sql-statement.validator.d.ts +2 -2
- package/dist/transactions/sql-statement.validator.js +40 -6
- package/dist/transactions/transaction-envelope.d.ts +5 -4
- package/dist/transactions/transaction-integrity-error.js +2 -0
- package/dist/transactions/transaction-plan-assembler.d.ts +12 -5
- package/dist/transactions/transaction-plan-assembler.js +49 -17
- package/dist/transactions/transaction-plan-validator.d.ts +23 -7
- package/dist/transactions/transaction-plan-validator.js +31 -7
- package/dist/transactions/transaction-reference-collector.js +8 -10
- package/dist/transactions/transaction-reference-resolver.d.ts +3 -2
- package/dist/transactions/transaction-reference-resolver.js +1 -3
- package/dist/transactions/transaction-reference-validator.d.ts +43 -3
- package/dist/transactions/transaction-reference-validator.js +83 -57
- package/dist/transactions/transaction-reference.d.ts +1 -1
- package/dist/transactions/transaction-reference.js +5 -0
- package/dist/transactions/transaction-request.d.ts +8 -8
- package/dist/transactions/transaction-runtime.d.ts +5 -2
- package/dist/transactions/transaction-runtime.js +108 -27
- package/dist/transactions/transaction-settlement.runtime.d.ts +4 -3
- package/dist/transactions/transaction-slot-path-error.js +2 -0
- package/dist/transactions/transaction-stage.runtime.d.ts +5 -3
- package/dist/transactions/transaction-stage.runtime.js +8 -7
- package/package.json +6 -5
- package/src/runtime/field-check.evaluator.ts +1 -1
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { isThenable } from "../runtime/thenable.guard.js";
|
|
2
|
+
const LAZY_CALLS = new WeakMap();
|
|
3
|
+
const ignore = () => undefined;
|
|
4
|
+
export function signalOptionOf(options) {
|
|
5
|
+
if (typeof options !== "object" || options === null) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
const signal = options.signal;
|
|
9
|
+
return typeof signal === "object" &&
|
|
10
|
+
signal !== null &&
|
|
11
|
+
typeof signal.aborted === "boolean" &&
|
|
12
|
+
typeof signal.addEventListener === "function"
|
|
13
|
+
? signal
|
|
14
|
+
: undefined;
|
|
15
|
+
}
|
|
16
|
+
function start(run, signal) {
|
|
17
|
+
if (signal?.aborted === true) {
|
|
18
|
+
return { result: Promise.reject(signal.reason), done: Promise.resolve() };
|
|
19
|
+
}
|
|
20
|
+
let running;
|
|
21
|
+
try {
|
|
22
|
+
running = run();
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
running = Promise.reject(error);
|
|
26
|
+
}
|
|
27
|
+
const done = running.then(ignore, ignore);
|
|
28
|
+
if (signal === undefined) {
|
|
29
|
+
return { result: running, done };
|
|
30
|
+
}
|
|
31
|
+
const result = new Promise((resolve, reject) => {
|
|
32
|
+
const aborted = () => reject(signal.reason);
|
|
33
|
+
signal.addEventListener("abort", aborted, { once: true });
|
|
34
|
+
running.then((value) => {
|
|
35
|
+
signal.removeEventListener("abort", aborted);
|
|
36
|
+
resolve(value);
|
|
37
|
+
}, (error) => {
|
|
38
|
+
signal.removeEventListener("abort", aborted);
|
|
39
|
+
reject(error);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
return { result, done };
|
|
43
|
+
}
|
|
44
|
+
export function runAbortable(run, signal) {
|
|
45
|
+
return start(run, signal).result;
|
|
46
|
+
}
|
|
47
|
+
export function avLazy(make) {
|
|
48
|
+
const run = () => Promise.resolve(make());
|
|
49
|
+
const record = {
|
|
50
|
+
begin: (signal) => start(run, signal),
|
|
51
|
+
};
|
|
52
|
+
const result = () => record.begin().result;
|
|
53
|
+
const lazy = Object.freeze({
|
|
54
|
+
then: (onFulfilled, onRejected) => result().then(onFulfilled, onRejected),
|
|
55
|
+
catch: (onRejected) => result().catch(onRejected),
|
|
56
|
+
finally: (onFinally) => result().finally(onFinally),
|
|
57
|
+
[Symbol.toStringTag]: "Promise",
|
|
58
|
+
});
|
|
59
|
+
LAZY_CALLS.set(lazy, record);
|
|
60
|
+
return lazy;
|
|
61
|
+
}
|
|
62
|
+
export function maxAllConcurrencyOf(limits) {
|
|
63
|
+
const limit = limits.maxAllConcurrency;
|
|
64
|
+
return typeof limit === "number" && Number.isSafeInteger(limit) && limit >= 1
|
|
65
|
+
? limit
|
|
66
|
+
: 1;
|
|
67
|
+
}
|
|
68
|
+
export function runOperationSet(entries, options, limits) {
|
|
69
|
+
if (typeof entries !== "object" ||
|
|
70
|
+
entries === null ||
|
|
71
|
+
Array.isArray(entries)) {
|
|
72
|
+
return Promise.reject(new TypeError("all takes an object of calls: { key: avClient.Resource.find.many(…), … }."));
|
|
73
|
+
}
|
|
74
|
+
const keyed = [];
|
|
75
|
+
for (const key of Object.keys(entries)) {
|
|
76
|
+
const value = entries[key];
|
|
77
|
+
if (!isThenable(value)) {
|
|
78
|
+
return Promise.reject(new TypeError(`all's entry ${JSON.stringify(key)} is not a call.`));
|
|
79
|
+
}
|
|
80
|
+
keyed.push([key, value]);
|
|
81
|
+
}
|
|
82
|
+
const settle = typeof options === "object" &&
|
|
83
|
+
options !== null &&
|
|
84
|
+
options.settle === true;
|
|
85
|
+
const outer = signalOptionOf(options);
|
|
86
|
+
const group = new AbortController();
|
|
87
|
+
const forward = () => {
|
|
88
|
+
group.abort(outer?.reason);
|
|
89
|
+
};
|
|
90
|
+
if (outer?.aborted === true) {
|
|
91
|
+
forward();
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
outer?.addEventListener("abort", forward, { once: true });
|
|
95
|
+
}
|
|
96
|
+
const list = keyed.map(([key, value]) => {
|
|
97
|
+
const record = LAZY_CALLS.get(value);
|
|
98
|
+
let resolve = ignore;
|
|
99
|
+
let reject = ignore;
|
|
100
|
+
const outcome = new Promise((onResolve, onReject) => {
|
|
101
|
+
resolve = onResolve;
|
|
102
|
+
reject = onReject;
|
|
103
|
+
});
|
|
104
|
+
return {
|
|
105
|
+
key,
|
|
106
|
+
value,
|
|
107
|
+
record,
|
|
108
|
+
outcome,
|
|
109
|
+
resolve,
|
|
110
|
+
reject,
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
const answer = (entry, result) => {
|
|
114
|
+
result.then((value) => entry.resolve(value), (reason) => {
|
|
115
|
+
entry.reject(reason);
|
|
116
|
+
if (!settle) {
|
|
117
|
+
group.abort();
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
const follow = (entry, result) => {
|
|
122
|
+
const aborted = () => entry.reject(group.signal.reason);
|
|
123
|
+
if (group.signal.aborted) {
|
|
124
|
+
aborted();
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
group.signal.addEventListener("abort", aborted, { once: true });
|
|
128
|
+
}
|
|
129
|
+
answer(entry, result);
|
|
130
|
+
};
|
|
131
|
+
for (const entry of list) {
|
|
132
|
+
if (entry.record === undefined) {
|
|
133
|
+
follow(entry, entry.value);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const queued = list.filter((entry) => entry.record !== undefined);
|
|
137
|
+
const cap = maxAllConcurrencyOf(limits);
|
|
138
|
+
let next = 0;
|
|
139
|
+
let running = 0;
|
|
140
|
+
const launch = () => {
|
|
141
|
+
while (next < queued.length && (running < cap || group.signal.aborted)) {
|
|
142
|
+
const entry = queued[next];
|
|
143
|
+
const record = entry.record;
|
|
144
|
+
next += 1;
|
|
145
|
+
const call = record.begin(group.signal);
|
|
146
|
+
running += 1;
|
|
147
|
+
answer(entry, call.result);
|
|
148
|
+
void Promise.all([call.done, entry.outcome.then(ignore, ignore)]).then(() => {
|
|
149
|
+
running -= 1;
|
|
150
|
+
launch();
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
group.signal.addEventListener("abort", launch, { once: true });
|
|
155
|
+
launch();
|
|
156
|
+
const done = (result) => {
|
|
157
|
+
outer?.removeEventListener("abort", forward);
|
|
158
|
+
return result;
|
|
159
|
+
};
|
|
160
|
+
const byKey = (values) => Object.fromEntries(list.map(({ key }, index) => [key, values[index]]));
|
|
161
|
+
if (settle) {
|
|
162
|
+
return Promise.all(list.map(({ outcome }) => outcome.then((value) => ({ status: "fulfilled", value }), (reason) => ({ status: "rejected", reason })))).then((settled) => done(byKey(settled)));
|
|
163
|
+
}
|
|
164
|
+
return Promise.all(list.map(({ outcome }) => outcome)).then((values) => done(byKey(values)), (error) => {
|
|
165
|
+
group.abort();
|
|
166
|
+
throw done(error);
|
|
167
|
+
});
|
|
168
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export type { AvAdapterDiscoveryDiagnostic, AvAdapterDiscoveryDiagnosticCode, }
|
|
|
3
3
|
export type { AvAdapterModel } from "./adapters/adapter-model.js";
|
|
4
4
|
export type { AvContracts } from "./compiler/contract.compiler.js";
|
|
5
5
|
export type { AvContractCompilerDiagnostic, AvContractCompilerDiagnosticCode, } from "./compiler/contract-compiler-diagnostic.js";
|
|
6
|
+
export { cache } from "./config/cache-stage.factory.js";
|
|
7
|
+
export type { AvConfigComputedFields } from "./config/computed-fields.js";
|
|
6
8
|
export type { AvMcpEndpoint } from "./config/config.resolver.js";
|
|
7
9
|
export type { AvConfigDiagnostic, AvConfigDiagnosticCode, } from "./config/config-diagnostic.js";
|
|
8
10
|
export type { AvConfigLayerName, AvRequestOrigin, } from "./config/config-layer.js";
|
|
@@ -12,12 +14,13 @@ export type { AvConfigExact } from "./config/exact-framework-config.js";
|
|
|
12
14
|
export type { AvConfig, AvConfigAddedFieldDefinition, AvConfigAgentLayer, AvConfigAny, AvConfigExemptions, AvConfigFamily, AvConfigFieldDefinition, AvConfigFieldLifecycleTrait, AvConfigKnownFieldDefinition, AvConfigLayer, AvConfigLayerAny, AvConfigLayerKind, AvConfigLimits, AvConfigMcp, AvConfigOperations, AvConfigOperationsExemption, AvConfigOverlayField, AvConfigRelationFieldExemption, AvConfigResource, AvConfigResourceExemption, AvConfigResourceFields, AvConfigResourceKey, AvConfigResources, AvConfigResourcesAny, AvConfigResourceTransactions, AvConfigRootField, AvConfigScalarFieldExemption, AvConfigScalarTypeRef, AvConfigVariant, AvFieldCompute, AvRelationFieldCapabilityName, AvRelationFieldPipeline, AvScalarFieldCapabilityName, AvScalarFieldPipeline, AvZCheck, AvZFormat, } from "./config/framework-config.js";
|
|
13
15
|
export type { AvPipeline, AvTransactionPipeline, } from "./config/pipeline-config.js";
|
|
14
16
|
export type { AvPaginationCapability, AvProjectionScope, AvRelationFilterCapability, AvRelationMutationDirective, AvRelationReducer, AvScalarFilterOperator, AvScalarMutationDirective, AvWriteScope, } from "./contracts/capability.js";
|
|
15
|
-
export type { AvContract, AvContractAgent, AvContractApplication, AvContractClient, AvContractCore, } from "./contracts/contract.js";
|
|
17
|
+
export type { AvContract, AvContractAgent, AvContractApplication, AvContractClient, AvContractCore, AvCoreResource, } from "./contracts/contract.js";
|
|
18
|
+
export type { AvContractClientAccess } from "./contracts/contract-access.js";
|
|
16
19
|
export type { AvContractLimits } from "./contracts/contract-limits.js";
|
|
17
20
|
export type { AvContractClientProtocol, AvContractHash, AvContractProtocol, } from "./contracts/contract-protocol.js";
|
|
18
21
|
export type { AvCreateRequirementGroup, AvCreateRequirements, } from "./contracts/create-requirements.js";
|
|
19
22
|
export type { AvEnumDefinition } from "./contracts/enum-definition.js";
|
|
20
|
-
export type { AvField, AvProjectionScopes, AvRelationField, AvRelationFieldCapabilities, AvRelationMutationCapability, AvRelationProjectionCapability, AvRelationReducerCapability, AvScalarField, AvScalarFieldCapabilities, AvScalarFormat, AvScopedRelationMutations, AvScopedRelationReducers, AvWriteScopes, } from "./contracts/field.js";
|
|
23
|
+
export type { AvCoreField, AvCoreRelationField, AvField, AvProjectionScopes, AvRelationField, AvRelationFieldCapabilities, AvRelationMutationCapability, AvRelationProjectionCapability, AvRelationReducerCapability, AvScalarField, AvScalarFieldCapabilities, AvScalarFormat, AvScopedRelationMutations, AvScopedRelationReducers, AvWriteScopes, } from "./contracts/field.js";
|
|
21
24
|
export type { AvFieldCheck } from "./contracts/field-check.js";
|
|
22
25
|
export type { AvIdentifier, AvScalarFieldKey } from "./contracts/identifier.js";
|
|
23
26
|
export type { AvLifecycleTrait } from "./contracts/lifecycle-trait.js";
|
|
@@ -26,31 +29,42 @@ export type { AvOperationAvailability, AvOperationVariantScopes, AvResourceOpera
|
|
|
26
29
|
export type { AvBuiltInScalar, AvScalarDefinition, AvScalarRegistry, } from "./contracts/scalar.js";
|
|
27
30
|
export type { AvApplicationScalarForms, AvScalarValueType, AvWireScalarForms, } from "./contracts/scalar-value-type.js";
|
|
28
31
|
export type { AvTransactionCapability } from "./contracts/transaction-capability.js";
|
|
32
|
+
export type { AvContractView, AvManagedContractView, } from "./framework/contract-view.js";
|
|
29
33
|
export { createFramework } from "./framework/framework.factory.js";
|
|
30
34
|
export type { AvFramework } from "./framework/framework.js";
|
|
31
35
|
export type { AvConstructionDiagnostic, AvConstructionStage, } from "./framework/framework-construction.error.js";
|
|
32
36
|
export { AvConstructionError } from "./framework/framework-construction.error.js";
|
|
33
|
-
export type { AvApplicationFacade, AvApplicationFamilyFacade, AvApplicationResourceFacade, AvAppTxFacade, AvAppTxFamilyFacade, AvAppTxResourceFacade, AvClientFacade, AvClientFamilyFacade, AvClientResourceFacade, AvClientTxFacade, AvClientTxFamilyFacade, AvClientTxResourceFacade, } from "./framework/operation-facade.js";
|
|
34
|
-
export
|
|
37
|
+
export type { AvApplicationFacade, AvApplicationFamilyFacade, AvApplicationPlainCall, AvApplicationProjectingCall, AvApplicationResourceFacade, AvAppTxFacade, AvAppTxFamilyFacade, AvAppTxPlainCall, AvAppTxProjectingCall, AvAppTxResourceFacade, AvClientFacade, AvClientFamilyFacade, AvClientPlainCall, AvClientProjectingCall, AvClientResourceFacade, AvClientTxFacade, AvClientTxFamilyFacade, AvClientTxPlainCall, AvClientTxProjectingCall, AvClientTxResourceFacade, AvServerClientFacade, AvServerClientFamilyFacade, AvServerClientPlainCall, AvServerClientProjectingCall, AvServerClientResourceFacade, AvServerClientTxFacade, AvServerClientTxFamilyFacade, AvServerClientTxPlainCall, AvServerClientTxProjectingCall, AvServerClientTxResourceFacade, } from "./framework/operation-facade.js";
|
|
38
|
+
export { avLazy } from "./framework/operation-set.runner.js";
|
|
39
|
+
export type { AvCreateDataInput, AvCursorInput, AvFieldKey, AvIncludeInput, AvNoAdvertisedMember, AvNullsOrder, AvOperationArgumentMap, AvOperationArgumentsFor, AvOrderByEntry, AvOrderByInput, AvProjectionEntry, AvRelationProjectionInput, AvResourceKey, AvScalarFilterOperands, AvScalarOrderInput, AvScalarWhereInput, AvSelectInput, AvSortDirection, AvUniqueWhereInput, AvUpdateDataInput, AvWhereInput, } from "./operations/operation-arguments.js";
|
|
35
40
|
export type { AvDeferredOperationCall, AvOperationCall, AvOperationGrammar, AvOperationSlot, } from "./operations/operation-call.js";
|
|
36
41
|
export type { AvOperationFamily, AvOperationIdentity, AvOperationVariant, } from "./operations/operation-identity.js";
|
|
37
42
|
export type { AvOperationResultFor } from "./operations/operation-result.js";
|
|
38
43
|
export type { AvValidationCode, AvValidationIssue, } from "./operations/validation-code.js";
|
|
44
|
+
export type { AvAccessProvider } from "./policy/access-provider.interface.js";
|
|
45
|
+
export type { AvAccessQuestion } from "./policy/access-question.js";
|
|
46
|
+
export type { AvAccessVerbs } from "./policy/access-verbs.js";
|
|
47
|
+
export type { AvPolicyEngine, AvPolicyWhere, } from "./policy/policy-engine.js";
|
|
48
|
+
export type { AvPrebuiltContracts } from "./prebuilt/prebuilt-contracts.js";
|
|
39
49
|
export { AvDecimal } from "./runtime/decimal.js";
|
|
40
|
-
export type { AvDiagnostic, AvDiagnosticsSink, AvMcpDiagnostic, AvOperationDiagnostic, AvTransactionDiagnostic, } from "./runtime/diagnostics-reporter.js";
|
|
50
|
+
export type { AvCanDiagnostic, AvDiagnostic, AvDiagnosticsSink, AvMcpDiagnostic, AvOperationDiagnostic, AvTransactionDiagnostic, } from "./runtime/diagnostics-reporter.js";
|
|
51
|
+
export { AvErrorCatalog, type AvErrorCatalogCode, type AvErrorCatalogEntry, type AvErrorKind, } from "./runtime/error.catalog.js";
|
|
41
52
|
export type { AvExecutionOptions } from "./runtime/execution-options.js";
|
|
42
53
|
export type { AvComputeContext, AvComputeCreate, AvComputeRead, AvComputeUpdate, } from "./runtime/field-compute.js";
|
|
43
54
|
export { AvAuthError, AvConflictError, AvContractMismatchError, AvError, AvInternalError, AvNotFoundError, AvProtocolError, AvValidationError, } from "./runtime/framework-error.js";
|
|
44
55
|
export type { AvJsonValue } from "./runtime/json-value.js";
|
|
45
56
|
export type { AvMisuseEvent, AvMisuseSink, } from "./runtime/misuse-reporter.js";
|
|
57
|
+
export type { AvAgentOperationRequest, AvApplicationOperationRequest, AvClientOperationRequest, AvOperationRequest, AvRequestProtocol, } from "./runtime/operation-request.js";
|
|
46
58
|
export type { AvCause, AvOperationCode, AvOperationErrorCode, AvOperationFailureResponse, AvOperationNoMatchResponse, AvOperationResponse, AvOperationSuccessCode, AvOperationSuccessDataCode, AvOperationSuccessResponse, } from "./runtime/operation-response.js";
|
|
47
59
|
export type { AvAfterHook, AvBeforeHook, AvContext, AvFieldGuard, AvFieldPipe, AvFilter, AvGuard, AvInterceptor, AvPipe, AvTransactionAfterHook, AvTransactionBeforeHook, AvTransactionContext, AvTransactionFilter, AvTransactionGuard, AvTransactionInterceptor, AvTransactionPipe, AvTransactionStep, AvTransportContext, } from "./runtime/pipeline.js";
|
|
48
60
|
export type { AvDeepReadonly } from "./runtime/readonly-value.js";
|
|
49
61
|
export type { AvState } from "./runtime/request-state.js";
|
|
50
62
|
export type { AvOperation, AvOperationHandle, AvOperationReferenceSurface, AvReferenceableField, AvReferenceBuilder, AvSingleRowResult, AvTransactionResults, AvTransactionRunner, } from "./transactions/deferred-operation.js";
|
|
63
|
+
export type { AvSqlStatementBuilder, AvSqlStatementValue, } from "./transactions/sql-statement.js";
|
|
51
64
|
export type { AvTransactionIntegrityViolation } from "./transactions/transaction-integrity-error.js";
|
|
52
65
|
export { AvTransactionIntegrityError } from "./transactions/transaction-integrity-error.js";
|
|
53
66
|
export type { AvTransactionReference } from "./transactions/transaction-reference.js";
|
|
67
|
+
export type { AvAgentTransactionRequest, AvApplicationTransactionRequest, AvClientTransactionRequest, AvTransactionRequest, } from "./transactions/transaction-request.js";
|
|
54
68
|
export type { AvTransactionCommittedResponse, AvTransactionResponse, } from "./transactions/transaction-response.js";
|
|
55
69
|
export type { AvTransactionSlotPathViolation } from "./transactions/transaction-slot-path-error.js";
|
|
56
70
|
export { AvTransactionSlotPathError } from "./transactions/transaction-slot-path-error.js";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
export { cache } from "./config/cache-stage.factory.js";
|
|
1
2
|
export { defineResource, } from "./config/define-resource.js";
|
|
2
3
|
export { createFramework } from "./framework/framework.factory.js";
|
|
3
4
|
export { AvConstructionError } from "./framework/framework-construction.error.js";
|
|
5
|
+
export { avLazy } from "./framework/operation-set.runner.js";
|
|
4
6
|
export { AvDecimal } from "./runtime/decimal.js";
|
|
7
|
+
export { AvErrorCatalog, } from "./runtime/error.catalog.js";
|
|
5
8
|
export { AvAuthError, AvConflictError, AvContractMismatchError, AvError, AvInternalError, AvNotFoundError, AvProtocolError, AvValidationError, } from "./runtime/framework-error.js";
|
|
6
9
|
export { AvTransactionIntegrityError } from "./transactions/transaction-integrity-error.js";
|
|
7
10
|
export { AvTransactionSlotPathError } from "./transactions/transaction-slot-path-error.js";
|
package/dist/internal.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export type { AvAdapterSqlStatement, AvAdapterSqlValue, } from "./adapters/adapt
|
|
|
15
15
|
export type { AvAdapterTransactionExecutor } from "./adapters/adapter-transaction-executor.interface.js";
|
|
16
16
|
export { compileContracts } from "./compiler/contract.compiler.js";
|
|
17
17
|
export { resolveFrameworkConfig } from "./config/config.resolver.js";
|
|
18
|
+
export { canonicalJson } from "./contracts/canonical-json.writer.js";
|
|
18
19
|
export { PROJECTION_SCOPES, WRITE_SCOPES } from "./contracts/capability.js";
|
|
19
20
|
export { validateClientContractStructure } from "./contracts/client-contract-structure.validator.js";
|
|
20
21
|
export { AvCanonicalJsonError, canonicalizeContract, canonicalizeJson, } from "./contracts/contract-canonicalizer.js";
|
|
@@ -23,18 +24,24 @@ export { computeClientContractHash, verifyClientContractHash, } from "./contract
|
|
|
23
24
|
export { DEFAULT_CONTRACT_LIMITS } from "./contracts/contract-limits.js";
|
|
24
25
|
export { AVENTARA_PROTOCOL_VERSION } from "./contracts/contract-protocol.js";
|
|
25
26
|
export { advertisedDirectives, advertisedReducers } from "./contracts/field.js";
|
|
27
|
+
export { projectJsonValue } from "./contracts/json-schema.projector.js";
|
|
26
28
|
export { LIFECYCLE_TRAITS } from "./contracts/lifecycle-trait.js";
|
|
27
29
|
export { isOperationVariantAvailable, projectionScopeOf, writeScopeOf, } from "./contracts/resource-operations.js";
|
|
28
30
|
export { BUILT_IN_SCALARS } from "./contracts/scalar.js";
|
|
29
31
|
export { TRANSACTION_CAPABILITIES } from "./contracts/transaction-capability.js";
|
|
30
32
|
export type { AvContractApplicationView } from "./framework/contract-view.js";
|
|
33
|
+
export type { AvDatabaseRefusal } from "./operations/database-refusal.js";
|
|
34
|
+
export { DATABASE_REFUSALS } from "./operations/database-refusal.js";
|
|
31
35
|
export type { SemanticOperationArguments } from "./operations/operation-validator.js";
|
|
32
36
|
export { VALIDATION_CODES } from "./operations/validation-code.js";
|
|
37
|
+
export { accessProviderOf } from "./policy/access-provider.registry.js";
|
|
38
|
+
export { ACCESS_VERB_NAMES, ACCESS_VERBS, providerVerb, } from "./policy/access-verb.table.js";
|
|
39
|
+
export { holdRequestPrincipal } from "./policy/policy-request.js";
|
|
40
|
+
export { prebuiltFileChanges } from "./prebuilt/prebuilt-changes.js";
|
|
41
|
+
export { emitPrebuiltContracts, prebuiltContractsOf, } from "./prebuilt/prebuilt-contracts.emitter.js";
|
|
33
42
|
export { mcpFailureReporterOf } from "./runtime/diagnostics-reporter.js";
|
|
34
43
|
export type { AvErrorClassName } from "./runtime/framework-error-class.table.js";
|
|
35
44
|
export { FRAMEWORK_ERROR_CLASS_OF } from "./runtime/framework-error-class.table.js";
|
|
36
|
-
export type { AgentOperationRequest, ApplicationOperationRequest, ClientOperationRequest, ClientProtocolIdentity, FrameworkOperationRequest, } from "./runtime/operation-request.js";
|
|
37
45
|
export { OPERATION_CODES } from "./runtime/operation-response.js";
|
|
38
46
|
export type { BuiltinNonRow, OperationFingerprint, } from "./transactions/deferred-operation.js";
|
|
39
47
|
export { computeOperationFingerprint } from "./transactions/operation-fingerprint.js";
|
|
40
|
-
export type { AgentTransactionRequest, ApplicationTransactionRequest, ClientTransactionRequest, FrameworkTransactionRequest, } from "./transactions/transaction-request.js";
|
package/dist/internal.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { compileContracts } from "./compiler/contract.compiler.js";
|
|
2
2
|
export { resolveFrameworkConfig } from "./config/config.resolver.js";
|
|
3
|
+
export { canonicalJson } from "./contracts/canonical-json.writer.js";
|
|
3
4
|
export { PROJECTION_SCOPES, WRITE_SCOPES } from "./contracts/capability.js";
|
|
4
5
|
export { validateClientContractStructure } from "./contracts/client-contract-structure.validator.js";
|
|
5
6
|
export { AvCanonicalJsonError, canonicalizeContract, canonicalizeJson, } from "./contracts/contract-canonicalizer.js";
|
|
@@ -7,11 +8,18 @@ export { computeClientContractHash, verifyClientContractHash, } from "./contract
|
|
|
7
8
|
export { DEFAULT_CONTRACT_LIMITS } from "./contracts/contract-limits.js";
|
|
8
9
|
export { AVENTARA_PROTOCOL_VERSION } from "./contracts/contract-protocol.js";
|
|
9
10
|
export { advertisedDirectives, advertisedReducers } from "./contracts/field.js";
|
|
11
|
+
export { projectJsonValue } from "./contracts/json-schema.projector.js";
|
|
10
12
|
export { LIFECYCLE_TRAITS } from "./contracts/lifecycle-trait.js";
|
|
11
13
|
export { isOperationVariantAvailable, projectionScopeOf, writeScopeOf, } from "./contracts/resource-operations.js";
|
|
12
14
|
export { BUILT_IN_SCALARS } from "./contracts/scalar.js";
|
|
13
15
|
export { TRANSACTION_CAPABILITIES } from "./contracts/transaction-capability.js";
|
|
16
|
+
export { DATABASE_REFUSALS } from "./operations/database-refusal.js";
|
|
14
17
|
export { VALIDATION_CODES } from "./operations/validation-code.js";
|
|
18
|
+
export { accessProviderOf } from "./policy/access-provider.registry.js";
|
|
19
|
+
export { ACCESS_VERB_NAMES, ACCESS_VERBS, providerVerb, } from "./policy/access-verb.table.js";
|
|
20
|
+
export { holdRequestPrincipal } from "./policy/policy-request.js";
|
|
21
|
+
export { prebuiltFileChanges } from "./prebuilt/prebuilt-changes.js";
|
|
22
|
+
export { emitPrebuiltContracts, prebuiltContractsOf, } from "./prebuilt/prebuilt-contracts.emitter.js";
|
|
15
23
|
export { mcpFailureReporterOf } from "./runtime/diagnostics-reporter.js";
|
|
16
24
|
export { FRAMEWORK_ERROR_CLASS_OF } from "./runtime/framework-error-class.table.js";
|
|
17
25
|
export { OPERATION_CODES } from "./runtime/operation-response.js";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { AvValidationCode } from "./validation-code.js";
|
|
2
|
+
/**
|
|
3
|
+
* Why the database refused a caller's value, each with the validation code and the
|
|
4
|
+
* issue message an adapter answers it with.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DATABASE_REFUSALS: {
|
|
7
|
+
readonly tooLong: {
|
|
8
|
+
readonly code: "V1004";
|
|
9
|
+
readonly message: "The database refused this value: it is longer than the database can hold for its column.";
|
|
10
|
+
};
|
|
11
|
+
readonly outOfRange: {
|
|
12
|
+
readonly code: "V1004";
|
|
13
|
+
readonly message: "The database refused this value: it is outside the range its column can hold.";
|
|
14
|
+
};
|
|
15
|
+
readonly datetimeOutOfRange: {
|
|
16
|
+
readonly code: "V1004";
|
|
17
|
+
readonly message: "The database refused this value: the date and time is outside the range the database can hold.";
|
|
18
|
+
};
|
|
19
|
+
readonly divisionByZero: {
|
|
20
|
+
readonly code: "V1004";
|
|
21
|
+
readonly message: "The database refused this value: it divides by zero.";
|
|
22
|
+
};
|
|
23
|
+
readonly computedNull: {
|
|
24
|
+
readonly code: "V1004";
|
|
25
|
+
readonly message: "The database refused this value: the write computes no value for a column that requires one, as a division by zero does.";
|
|
26
|
+
};
|
|
27
|
+
readonly invalidInput: {
|
|
28
|
+
readonly code: "V1001";
|
|
29
|
+
readonly message: "The database refused this value: it is not valid input for its column's type.";
|
|
30
|
+
};
|
|
31
|
+
readonly nulInText: {
|
|
32
|
+
readonly code: "V1001";
|
|
33
|
+
readonly message: "The database refused this value: its text cannot contain the NUL character (U+0000).";
|
|
34
|
+
};
|
|
35
|
+
readonly nulInJson: {
|
|
36
|
+
readonly code: "V1001";
|
|
37
|
+
readonly message: "The database refused this value: its JSON cannot contain the NUL character (U+0000).";
|
|
38
|
+
};
|
|
39
|
+
readonly trailingEscape: {
|
|
40
|
+
readonly code: "V1001";
|
|
41
|
+
readonly message: "The database refused this value: a text match cannot end with the escape character \\.";
|
|
42
|
+
};
|
|
43
|
+
readonly backReference: {
|
|
44
|
+
readonly code: "V1012";
|
|
45
|
+
readonly message: "The data source refused this nested write: a record written through a relation cannot write that relation or its reference fields back.";
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/** A reason the database refused a caller's value: a key of {@link DATABASE_REFUSALS}. */
|
|
49
|
+
export type AvDatabaseRefusal = keyof typeof DATABASE_REFUSALS;
|
|
50
|
+
/** Whether `message` is the message of a database refusal answered under `code`. */
|
|
51
|
+
export declare function isDatabaseRefusalMessage(code: AvValidationCode, message: string): boolean;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export const DATABASE_REFUSALS = {
|
|
2
|
+
tooLong: {
|
|
3
|
+
code: "V1004",
|
|
4
|
+
message: "The database refused this value: it is longer than the database can hold for its column.",
|
|
5
|
+
},
|
|
6
|
+
outOfRange: {
|
|
7
|
+
code: "V1004",
|
|
8
|
+
message: "The database refused this value: it is outside the range its column can hold.",
|
|
9
|
+
},
|
|
10
|
+
datetimeOutOfRange: {
|
|
11
|
+
code: "V1004",
|
|
12
|
+
message: "The database refused this value: the date and time is outside the range the database can hold.",
|
|
13
|
+
},
|
|
14
|
+
divisionByZero: {
|
|
15
|
+
code: "V1004",
|
|
16
|
+
message: "The database refused this value: it divides by zero.",
|
|
17
|
+
},
|
|
18
|
+
computedNull: {
|
|
19
|
+
code: "V1004",
|
|
20
|
+
message: "The database refused this value: the write computes no value for a column that requires one, as a division by zero does.",
|
|
21
|
+
},
|
|
22
|
+
invalidInput: {
|
|
23
|
+
code: "V1001",
|
|
24
|
+
message: "The database refused this value: it is not valid input for its column's type.",
|
|
25
|
+
},
|
|
26
|
+
nulInText: {
|
|
27
|
+
code: "V1001",
|
|
28
|
+
message: "The database refused this value: its text cannot contain the NUL character (U+0000).",
|
|
29
|
+
},
|
|
30
|
+
nulInJson: {
|
|
31
|
+
code: "V1001",
|
|
32
|
+
message: "The database refused this value: its JSON cannot contain the NUL character (U+0000).",
|
|
33
|
+
},
|
|
34
|
+
trailingEscape: {
|
|
35
|
+
code: "V1001",
|
|
36
|
+
message: "The database refused this value: a text match cannot end with the escape character \\.",
|
|
37
|
+
},
|
|
38
|
+
backReference: {
|
|
39
|
+
code: "V1012",
|
|
40
|
+
message: "The data source refused this nested write: a record written through a relation cannot write that relation or its reference fields back.",
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
export function isDatabaseRefusalMessage(code, message) {
|
|
44
|
+
return Object.values(DATABASE_REFUSALS).some((refusal) => refusal.code === code && refusal.message === message);
|
|
45
|
+
}
|