@cratis/chronicle 6.18.0 → 6.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/testing/IReadModelProcessor.d.ts +7 -0
- package/dist/testing/IReadModelProcessor.d.ts.map +1 -0
- package/dist/testing/IReadModelProcessor.js +4 -0
- package/dist/testing/IReadModelProcessor.js.map +1 -0
- package/dist/testing/ReadModelScenario.d.ts +6 -8
- package/dist/testing/ReadModelScenario.d.ts.map +1 -1
- package/dist/testing/ReadModelScenario.js +50 -50
- package/dist/testing/ReadModelScenario.js.map +1 -1
- package/dist/testing/ReadModelState.d.ts +6 -0
- package/dist/testing/ReadModelState.d.ts.map +1 -0
- package/dist/testing/ReadModelState.js +4 -0
- package/dist/testing/ReadModelState.js.map +1 -0
- package/dist/testing/ReducerReadModelProcessor.d.ts +13 -0
- package/dist/testing/ReducerReadModelProcessor.d.ts.map +1 -0
- package/dist/testing/ReducerReadModelProcessor.js +38 -0
- package/dist/testing/ReducerReadModelProcessor.js.map +1 -0
- package/dist/testing/ScenarioEvent.d.ts +8 -0
- package/dist/testing/ScenarioEvent.d.ts.map +1 -0
- package/dist/testing/ScenarioEvent.js +4 -0
- package/dist/testing/ScenarioEvent.js.map +1 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +1 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/projections/ProjectionCapabilities.d.ts +3 -0
- package/dist/testing/projections/ProjectionCapabilities.d.ts.map +1 -1
- package/dist/testing/projections/ProjectionCapabilities.js +117 -43
- package/dist/testing/projections/ProjectionCapabilities.js.map +1 -1
- package/dist/testing/projections/ProjectionExpressionEvaluator.d.ts +9 -0
- package/dist/testing/projections/ProjectionExpressionEvaluator.d.ts.map +1 -0
- package/dist/testing/projections/ProjectionExpressionEvaluator.js +68 -0
- package/dist/testing/projections/ProjectionExpressionEvaluator.js.map +1 -0
- package/dist/testing/projections/ProjectionReadModelProcessor.d.ts +30 -0
- package/dist/testing/projections/ProjectionReadModelProcessor.d.ts.map +1 -0
- package/dist/testing/projections/ProjectionReadModelProcessor.js +142 -0
- package/dist/testing/projections/ProjectionReadModelProcessor.js.map +1 -0
- package/dist/testing/projections/ProjectionValueConverter.d.ts +13 -0
- package/dist/testing/projections/ProjectionValueConverter.d.ts.map +1 -0
- package/dist/testing/projections/ProjectionValueConverter.js +122 -0
- package/dist/testing/projections/ProjectionValueConverter.js.map +1 -0
- package/dist/testing/projections/for_ProjectionCapabilities/given/Changed.d.ts +0 -2
- package/dist/testing/projections/for_ProjectionCapabilities/given/Changed.d.ts.map +1 -1
- package/dist/testing/projections/for_ProjectionCapabilities/given/Changed.js +0 -4
- package/dist/testing/projections/for_ProjectionCapabilities/given/Changed.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/testing/IReadModelProcessor.ts +10 -0
- package/testing/ReadModelScenario.spec.ts +156 -10
- package/testing/ReadModelScenario.ts +57 -57
- package/testing/ReadModelState.ts +5 -0
- package/testing/ReducerReadModelProcessor.ts +39 -0
- package/testing/ScenarioEvent.ts +7 -0
- package/testing/index.ts +1 -0
- package/testing/projections/ProjectionCapabilities.ts +100 -39
- package/testing/projections/ProjectionExpressionEvaluator.ts +57 -0
- package/testing/projections/ProjectionReadModelProcessor.fixtures.spec.ts +135 -0
- package/testing/projections/ProjectionReadModelProcessor.ts +147 -0
- package/testing/projections/ProjectionValueConverter.spec.ts +81 -0
- package/testing/projections/ProjectionValueConverter.ts +113 -0
- package/testing/projections/for_ProjectionCapabilities/given/Changed.ts +1 -3
- package/testing/projections/for_ProjectionCapabilities/when_rejecting_unsupported_operations.spec.ts +81 -1
- package/testing/projections/for_ProjectionCapabilities/when_validating_numeric_schemas.spec.ts +40 -12
- package/testing/projections/for_ProjectionCapabilities/when_validating_schema_boundaries.spec.ts +76 -29
- package/testing/projections/for_ProjectionCapabilities/when_validating_supported_operations.spec.ts +8 -35
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { JsonSchema } from '../../schemas/JsonSchema.js';
|
|
2
|
+
/** Converts values only in the numeric and scalar schema subset admitted by ProjectionCapabilities. */
|
|
3
|
+
export declare class ProjectionValueConverter {
|
|
4
|
+
/** Kernel JsonSchemaExtensions.GetDefaultValue: only nullable schemas have a null default. */
|
|
5
|
+
static defaultValue(schema: JsonSchema): unknown;
|
|
6
|
+
/** A null exact-case value falls through to the first case-insensitive property in JSON order. */
|
|
7
|
+
private static sourceKey;
|
|
8
|
+
/** The kernel deserializes event JSON against its registered schema before mapping. */
|
|
9
|
+
static eventContent(content: unknown, schema: JsonSchema): Record<string, unknown>;
|
|
10
|
+
static convert(value: unknown, schema: JsonSchema, eventContent?: boolean, expression?: boolean): unknown;
|
|
11
|
+
static checkNumber(number: number, schema: JsonSchema): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ProjectionValueConverter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectionValueConverter.d.ts","sourceRoot":"","sources":["../../../testing/projections/ProjectionValueConverter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,uGAAuG;AACvG,qBAAa,wBAAwB;IACjC,8FAA8F;IAC9F,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAO/C;IAED,kGAAkG;IAClG,OAAO,CAAC,MAAM,CAAC,SAAS;IAKxB,uFAAuF;IACvF,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAcjF;IAED,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,UAAQ,EAAE,UAAU,UAAO,GAAG,OAAO,CA+DnG;IAED,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAM3D;CACJ"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/** Converts values only in the numeric and scalar schema subset admitted by ProjectionCapabilities. */
|
|
4
|
+
export class ProjectionValueConverter {
|
|
5
|
+
/** Kernel JsonSchemaExtensions.GetDefaultValue: only nullable schemas have a null default. */
|
|
6
|
+
static defaultValue(schema) {
|
|
7
|
+
if (Array.isArray(schema.type) && schema.type.includes('null'))
|
|
8
|
+
return null;
|
|
9
|
+
if (schema.format === 'guid')
|
|
10
|
+
return '00000000-0000-0000-0000-000000000000';
|
|
11
|
+
if (schema.format === 'date-time')
|
|
12
|
+
return '0001-01-01T00:00:00';
|
|
13
|
+
if (schema.type === 'number' || schema.type === 'integer')
|
|
14
|
+
return 0;
|
|
15
|
+
if (schema.type === 'boolean')
|
|
16
|
+
return false;
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
/** A null exact-case value falls through to the first case-insensitive property in JSON order. */
|
|
20
|
+
static sourceKey(input, name) {
|
|
21
|
+
return Object.hasOwn(input, name) && input[name] != null
|
|
22
|
+
? name : Object.keys(input).find(key => key.toLowerCase() === name.toLowerCase());
|
|
23
|
+
}
|
|
24
|
+
/** The kernel deserializes event JSON against its registered schema before mapping. */
|
|
25
|
+
static eventContent(content, schema) {
|
|
26
|
+
const serialized = content !== null && typeof content === 'object' && !Array.isArray(content)
|
|
27
|
+
? content : {};
|
|
28
|
+
const result = Object.create(null);
|
|
29
|
+
for (const [name, property] of Object.entries(schema.properties ?? {})) {
|
|
30
|
+
const source = this.sourceKey(serialized, name);
|
|
31
|
+
const value = source === undefined ? null : serialized[source];
|
|
32
|
+
if (value !== null && value !== undefined)
|
|
33
|
+
result[name] = this.convert(value, property, true, false);
|
|
34
|
+
else {
|
|
35
|
+
const fallback = this.defaultValue(property);
|
|
36
|
+
if (fallback !== null && fallback !== undefined)
|
|
37
|
+
result[name] = fallback;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
static convert(value, schema, eventContent = false, expression = true) {
|
|
43
|
+
if (value == null)
|
|
44
|
+
return null;
|
|
45
|
+
// Concept conversion belongs to expression evaluation, never schema-bound input deserialization.
|
|
46
|
+
if (expression && schema.type !== 'object' && schema.type !== 'array' &&
|
|
47
|
+
typeof value === 'object' && !Array.isArray(value) && Object.keys(value).length === 1 && 'value' in value) {
|
|
48
|
+
return this.convert(value.value, schema, eventContent, expression);
|
|
49
|
+
}
|
|
50
|
+
if (schema.type === 'object' && typeof value === 'object' && !Array.isArray(value)) {
|
|
51
|
+
const input = value;
|
|
52
|
+
if (schema.additionalProperties || !schema.properties)
|
|
53
|
+
return structuredClone(input);
|
|
54
|
+
const result = Object.create(null);
|
|
55
|
+
for (const [name, property] of Object.entries(schema.properties)) {
|
|
56
|
+
const source = this.sourceKey(input, name);
|
|
57
|
+
if (source !== undefined && input[source] != null)
|
|
58
|
+
result[name] = this.convert(input[source], property, eventContent, false);
|
|
59
|
+
else {
|
|
60
|
+
const fallback = this.defaultValue(property);
|
|
61
|
+
if (fallback !== null && fallback !== undefined)
|
|
62
|
+
result[name] = fallback;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
if (schema.type === 'array' && Array.isArray(value)) {
|
|
68
|
+
return value.map(item => schema.items ? this.convert(item, schema.items, eventContent, false) : structuredClone(item));
|
|
69
|
+
}
|
|
70
|
+
if (schema.type === 'boolean') {
|
|
71
|
+
if (typeof value === 'boolean')
|
|
72
|
+
return value;
|
|
73
|
+
if (!eventContent && typeof value === 'string' && /^(true|false)$/i.test(value))
|
|
74
|
+
return value.toLowerCase() === 'true';
|
|
75
|
+
throw new RangeError(`Projection boolean value '${String(value)}' requires a kernel-backed test (ChronicleKernelScenario / live kernel).`);
|
|
76
|
+
}
|
|
77
|
+
if (schema.type === 'number' || schema.type === 'integer') {
|
|
78
|
+
if (eventContent && typeof value !== 'number') {
|
|
79
|
+
throw new RangeError(`Projection event numeric value '${String(value)}' must be a JSON number.`);
|
|
80
|
+
}
|
|
81
|
+
if (typeof value !== 'number' && (typeof value !== 'string' ||
|
|
82
|
+
!(schema.type === 'integer' ? /^[+-]?\d+$/.test(value) : /^[+-]?(?:\d+(?:\.\d+)?|\.\d+)$/.test(value)))) {
|
|
83
|
+
throw new RangeError(`Projection numeric value '${String(value)}' is not supported by ${schema.type}/${schema.format ?? 'double'}.`);
|
|
84
|
+
}
|
|
85
|
+
const number = typeof value === 'number' ? value : Number(value);
|
|
86
|
+
this.checkNumber(number, schema);
|
|
87
|
+
return number;
|
|
88
|
+
}
|
|
89
|
+
if (schema.format === 'date-time') {
|
|
90
|
+
if (value === '0001-01-01T00:00:00')
|
|
91
|
+
return value; // Kernel default for a missing DateTime member.
|
|
92
|
+
// Bound the accepted subset to UTC ISO text with a four-digit year. Date.parse accepts
|
|
93
|
+
// years beyond DateTime.MaxValue, and silently normalizes some invalid calendar dates.
|
|
94
|
+
if (typeof value !== 'string' || !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$/.test(value) ||
|
|
95
|
+
+value.slice(0, 4) < 1 || !Number.isFinite(Date.parse(value)) ||
|
|
96
|
+
new Date(value).toISOString().slice(0, 19) !== value.slice(0, 19)) {
|
|
97
|
+
throw new RangeError(`Projection date-time value '${String(value)}' is outside the supported DateTime range or UTC ISO format.`);
|
|
98
|
+
}
|
|
99
|
+
return value;
|
|
100
|
+
}
|
|
101
|
+
if (eventContent && (schema.type === 'string' || (Array.isArray(schema.type) && schema.type[0] === 'string')) && typeof value !== 'string') {
|
|
102
|
+
throw new RangeError(`Projection event string value '${String(value)}' must be a JSON string.`);
|
|
103
|
+
}
|
|
104
|
+
if (schema.format === 'guid' && typeof value === 'string') {
|
|
105
|
+
if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value)) {
|
|
106
|
+
throw new RangeError(`Projection GUID value '${value}' requires a kernel-backed test (ChronicleKernelScenario / live kernel).`);
|
|
107
|
+
}
|
|
108
|
+
return value.toLowerCase();
|
|
109
|
+
}
|
|
110
|
+
if (schema.type === 'string' && typeof value !== 'string')
|
|
111
|
+
return String(value);
|
|
112
|
+
return value;
|
|
113
|
+
}
|
|
114
|
+
static checkNumber(number, schema) {
|
|
115
|
+
if (!Number.isFinite(number) || (schema.type === 'integer' && (!Number.isSafeInteger(number) ||
|
|
116
|
+
(schema.format === 'int32' && (number < -2147483648 || number > 2147483647)) ||
|
|
117
|
+
(schema.format === 'uint32' && (number < 0 || number > 4294967295))))) {
|
|
118
|
+
throw new RangeError(`Projection numeric value '${number}' is outside the supported ${schema.type}/${schema.format ?? 'double'} range.`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=ProjectionValueConverter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectionValueConverter.js","sourceRoot":"","sources":["../../../testing/projections/ProjectionValueConverter.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAIrG,uGAAuG;AACvG,MAAM,OAAO,wBAAwB;IACjC,8FAA8F;IAC9F,MAAM,CAAC,YAAY,CAAC,MAAkB;QAClC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,OAAO,IAAI,CAAC;QAC5E,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM;YAAE,OAAO,sCAAsC,CAAC;QAC5E,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW;YAAE,OAAO,qBAAqB,CAAC;QA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AO,MAAM,CAAC,KAAK,CAAC,CAAC;QAChF,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,MAAc,EAAE,MAAkB;QACjD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC;YACxF,CAAC,MAAM,CAAC,MAAM,KAAK,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,UAAU,IAAI,MAAM,GAAG,UAAU,CAAC,CAAC;YAC5E,CAAC,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACxE,MAAM,IAAI,UAAU,CAAC,6BAA6B,MAAM,8BAA8B,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,MAAM,IAAI,QAAQ,SAAS,CAAC,CAAC;QAC7I,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Changed.d.ts","sourceRoot":"","sources":["../../../../../testing/projections/for_ProjectionCapabilities/given/Changed.ts"],"names":[],"mappings":"AAMA,qBAAa,OAAO;IAAG,IAAI,EAAG,MAAM,CAAC;IAAC,QAAQ,EAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Changed.d.ts","sourceRoot":"","sources":["../../../../../testing/projections/for_ProjectionCapabilities/given/Changed.ts"],"names":[],"mappings":"AAMA,qBAAa,OAAO;IAAG,IAAI,EAAG,MAAM,CAAC;IAAC,QAAQ,EAAG,MAAM,CAAC;CAAE"}
|
|
@@ -5,12 +5,8 @@ import { eventType } from '../../../../events/eventTypeDecorator.js';
|
|
|
5
5
|
export class Changed {
|
|
6
6
|
name;
|
|
7
7
|
quantity;
|
|
8
|
-
labels;
|
|
9
|
-
details;
|
|
10
8
|
}
|
|
11
9
|
field(String)(Changed.prototype, 'name');
|
|
12
10
|
field(Number)(Changed.prototype, 'quantity');
|
|
13
|
-
field(Array)(Changed.prototype, 'labels');
|
|
14
|
-
field(Object)(Changed.prototype, 'details');
|
|
15
11
|
eventType('capability-changed')(Changed);
|
|
16
12
|
//# sourceMappingURL=Changed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Changed.js","sourceRoot":"","sources":["../../../../../testing/projections/for_ProjectionCapabilities/given/Changed.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAErE,MAAM,OAAO,OAAO;IAAG,IAAI,CAAU;IAAC,QAAQ,CAAU;
|
|
1
|
+
{"version":3,"file":"Changed.js","sourceRoot":"","sources":["../../../../../testing/projections/for_ProjectionCapabilities/given/Changed.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAErE,MAAM,OAAO,OAAO;IAAG,IAAI,CAAU;IAAC,QAAQ,CAAU;CAAE;AAC1D,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AACzC,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AAC7C,SAAS,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"7.0.2","root":["../ChronicleClient.ts","../ChronicleOptions.ts","../EventStore.ts","../EventStoreName.ts","../EventStoreNamespaceName.ts","../IChronicleClient.ts","../IEventStore.ts","../Metrics.ts","../Tracing.ts","../index.ts","../artifacts/ActivatedArtifact.ts","../artifacts/ArtifactActivationContext.ts","../artifacts/ArtifactCompletionFailed.ts","../artifacts/ArtifactDelivery.ts","../artifacts/ArtifactInvocationContext.ts","../artifacts/ArtifactKind.ts","../artifacts/ClientArtifactsActivator.ts","../artifacts/DefaultClientArtifactsProvider.ts","../artifacts/IClientArtifactsProvider.ts","../artifacts/index.ts","../artifacts/validateArtifactSchemas.ts","../artifacts/withActivatedArtifact.ts","../auditing/Causation.ts","../auditing/CausationManager.ts","../auditing/CausationType.ts","../auditing/ICausationManager.ts","../auditing/index.ts","../compliance/ComplianceContracts.ts","../compliance/ComplianceMetadata.ts","../compliance/ComplianceMetadataResolver.ts","../compliance/ComplianceMetadataType.ts","../compliance/IPIIManager.ts","../compliance/PIIManager.ts","../compliance/PIINotSupportedOnEventSourceId.ts","../compliance/index.ts","../compliance/pii.ts","../compliance/subject.ts","../confidentiality/EncryptedNotSupportedOnEventSourceId.ts","../confidentiality/EncryptionScope.ts","../confidentiality/PIIAndEncryptedCombinedNotSupported.ts","../confidentiality/SecurityMetadata.ts","../confidentiality/SecurityMetadataResolver.ts","../confidentiality/SecurityMetadataType.ts","../confidentiality/encrypted.ts","../confidentiality/index.ts","../connection/ChronicleConnection.ts","../connection/ChronicleConnectionString.ts","../connection/ChronicleServerAddressResolver.ts","../connection/ChronicleServices.ts","../connection/ChronicleSrvResolutionError.ts","../connection/ChronicleSrvResolver.ts","../connection/CompatibilityPreflight.ts","../connection/ConnectionLifecycle.ts","../connection/DateTimeOffset.ts","../connection/Guid.ts","../connection/ILoadBalancerStrategy.ts","../connection/IncompatibleChronicleServer.ts","../connection/KernelKeepAlive.ts","../connection/LeastConnectionsLoadBalancerStrategy.ts","../connection/LoadBalancerMode.ts","../connection/LoadBalancerStrategyFactory.ts","../connection/RandomLoadBalancerStrategy.ts","../connection/RejectedChronicleCredentials.ts","../connection/RoundRobinLoadBalancerStrategy.ts","../connection/TokenProvider.ts","../connection/callResults.ts","../connection/clientVersion.ts","../connection/fetchOAuthAccessToken.ts","../connection/formatServerAddress.ts","../connection/index.ts","../correlation/CorrelationId.ts","../correlation/CorrelationIdManager.ts","../correlation/ICorrelationIdAccessor.ts","../correlation/ICorrelationIdSetter.ts","../correlation/index.ts","../eventSequences/AppendError.ts","../eventSequences/AppendOperationsBroadcaster.ts","../eventSequences/AppendOptions.ts","../eventSequences/AppendResult.ts","../eventSequences/AppendedEventWithResult.ts","../eventSequences/CompleteStreamError.ts","../eventSequences/CompleteStreamResult.ts","../eventSequences/ConcurrencyScope.ts","../eventSequences/ConcurrencyViolation.ts","../eventSequences/ConstraintViolation.ts","../eventSequences/EventForEventSourceId.ts","../eventSequences/EventLog.ts","../eventSequences/EventSequence.ts","../eventSequences/EventSequenceId.ts","../eventSequences/EventSequenceNumber.ts","../eventSequences/IEventLog.ts","../eventSequences/IEventSequence.ts","../eventSequences/ITransactionalEventSequence.ts","../eventSequences/TransactionalEventSequence.ts","../eventSequences/WaitForCompletionOptions.ts","../eventSequences/WaitForCompletionResult.ts","../eventSequences/index.ts","../eventStoreSubscriptions/EventStoreSubscriptionBuilder.ts","../eventStoreSubscriptions/EventStoreSubscriptionDefinition.ts","../eventStoreSubscriptions/EventStoreSubscriptionId.ts","../eventStoreSubscriptions/EventStoreSubscriptions.ts","../eventStoreSubscriptions/IEventStoreSubscriptionBuilder.ts","../eventStoreSubscriptions/IEventStoreSubscriptions.ts","../eventStoreSubscriptions/contracts.ts","../eventStoreSubscriptions/index.ts","../events/AppendedEvent.ts","../events/CausationEntry.ts","../events/EventContext.ts","../events/EventType.ts","../events/EventTypeGeneration.ts","../events/EventTypeId.ts","../events/EventTypes.ts","../events/IEventTypes.ts","../events/Tag.ts","../events/WireEventContext.ts","../events/eventTypeDecorator.ts","../events/filterEventsByTagDecorator.ts","../events/index.ts","../events/isRegisteredEvent.ts","../events/mergeTags.ts","../events/tagDecorator.ts","../events/toClientEventContext.ts","../events/constraints/ConstraintBuilder.ts","../events/constraints/ConstraintId.ts","../events/constraints/Constraints.ts","../events/constraints/IConstraint.ts","../events/constraints/IConstraintBuilder.ts","../events/constraints/IConstraints.ts","../events/constraints/IUniqueConstraintBuilder.ts","../events/constraints/UniqueConstraintBuilder.ts","../events/constraints/constraint.ts","../events/constraints/index.ts","../events/constraints/removeConstraint.ts","../events/constraints/unique.ts","../events/migrations/EventMigrationBuilder.ts","../events/migrations/EventMigrationPropertyBuilder.ts","../events/migrations/EventTypeMigrators.ts","../events/migrations/IEventMigrationBuilder.ts","../events/migrations/IEventMigrationPropertyBuilder.ts","../events/migrations/IEventTypeMigration.ts","../events/migrations/IEventTypeMigrators.ts","../events/migrations/InvalidMigrationGenerationGap.ts","../events/migrations/eventTypeMigration.ts","../events/migrations/index.ts","../externalServices/ExternalServiceBuilder.ts","../externalServices/ExternalServices.ts","../externalServices/IExternalServiceBuilder.ts","../externalServices/IExternalServices.ts","../externalServices/index.ts","../identities/IIdentityManager.ts","../identities/IdentityManager.ts","../identities/index.ts","../identity/IIdentityProvider.ts","../identity/Identity.ts","../identity/IdentityProvider.ts","../identity/index.ts","../jobs/IJobs.ts","../jobs/JobId.ts","../jobs/Jobs.ts","../jobs/index.ts","../observation/FailedPartition.ts","../observation/FailedPartitionAttempt.ts","../observation/FailedPartitions.ts","../observation/ICanBeNotifiedWhenPartitionReplayed.ts","../observation/ICanBeNotifiedWhenReplay.ts","../observation/IFailedPartitions.ts","../observation/IObservers.ts","../observation/ObserverId.ts","../observation/ObserverInformation.ts","../observation/ObserverRemovalOutcome.ts","../observation/ObserverRemovalResult.ts","../observation/ObserverRunningState.ts","../observation/ObserverType.ts","../observation/Observers.ts","../observation/index.ts","../observation/notifyReplayLifecycle.ts","../observation/toClientFailedPartition.ts","../observation/toObserverInformation.ts","../observation/toObserverRemovalResult.ts","../observation/toObserverRunningState.ts","../projections/CompiledProjectionDefinitions.ts","../projections/GlobalHandlerPropertyNotOnVariant.ts","../projections/IProjections.ts","../projections/InvalidEventContextPropertyError.ts","../projections/ProjectionCapabilityProvenance.ts","../projections/ProjectionDefinitionCompiler.ts","../projections/ProjectionEventSchema.ts","../projections/ProjectionId.ts","../projections/ProjectionQueryResult.ts","../projections/ProjectionState.ts","../projections/Projections.ts","../projections/ResolvedModelBoundMetadata.ts","../projections/UnableToQueryProjection.ts","../projections/VariantMustDeclareEntersOnEvent.ts","../projections/VariantReclassifier.ts","../projections/canonicalStringify.ts","../projections/captureProjectionProvenance.ts","../projections/constantValueExpression.ts","../projections/eventContextPropertyExpression.ts","../projections/eventContractPath.ts","../projections/index.ts","../projections/invalidEventContextPropertyInProjection.ts","../projections/notSetPropertyPath.ts","../projections/declarative/AddBuilder.ts","../projections/declarative/AddChildBuilder.ts","../projections/declarative/AllSetBuilder.ts","../projections/declarative/ChildrenBuilder.ts","../projections/declarative/CompositeKeyBuilder.ts","../projections/declarative/FromBuilder.ts","../projections/declarative/FromEveryBuilder.ts","../projections/declarative/IAddBuilder.ts","../projections/declarative/IAddChildBuilder.ts","../projections/declarative/IAllSetBuilder.ts","../projections/declarative/IChildrenBuilder.ts","../projections/declarative/ICompositeKeyBuilder.ts","../projections/declarative/IFromBuilder.ts","../projections/declarative/IFromEveryBuilder.ts","../projections/declarative/IJoinBuilder.ts","../projections/declarative/INestedBuilder.ts","../projections/declarative/IProjectionBuilder.ts","../projections/declarative/IProjectionBuilderFor.ts","../projections/declarative/IProjectionFor.ts","../projections/declarative/IReadModelPropertiesBuilder.ts","../projections/declarative/IRemovedWithBuilder.ts","../projections/declarative/IRemovedWithJoinBuilder.ts","../projections/declarative/ISetBuilder.ts","../projections/declarative/ISubtractBuilder.ts","../projections/declarative/JoinBuilder.ts","../projections/declarative/NestedBuilder.ts","../projections/declarative/ProjectionBuilderCore.ts","../projections/declarative/ProjectionBuilderFor.ts","../projections/declarative/RemovedWithBuilder.ts","../projections/declarative/RemovedWithJoinBuilder.ts","../projections/declarative/SetBuilder.ts","../projections/declarative/SubtractBuilder.ts","../projections/declarative/index.ts","../projections/declarative/projection.ts","../projections/declarative/projectionBuilderProvenance.ts","../projections/modelBound/FromEventMetadata.ts","../projections/modelBound/FromEventOptions.ts","../projections/modelBound/addFrom.ts","../projections/modelBound/childrenAndNestedBuilder.ts","../projections/modelBound/childrenFrom.ts","../projections/modelBound/clearWith.ts","../projections/modelBound/count.ts","../projections/modelBound/decrement.ts","../projections/modelBound/entersOn.ts","../projections/modelBound/eventSequence.ts","../projections/modelBound/fromAll.ts","../projections/modelBound/fromEvent.ts","../projections/modelBound/fromEvery.ts","../projections/modelBound/globalFor.ts","../projections/modelBound/increment.ts","../projections/modelBound/index.ts","../projections/modelBound/isModelBoundProjection.ts","../projections/modelBound/join.ts","../projections/modelBound/nested.ts","../projections/modelBound/noAutoMap.ts","../projections/modelBound/notRewindable.ts","../projections/modelBound/passive.ts","../projections/modelBound/removedWith.ts","../projections/modelBound/removedWithJoin.ts","../projections/modelBound/setFrom.ts","../projections/modelBound/setFromContext.ts","../projections/modelBound/setValue.ts","../projections/modelBound/subtractFrom.ts","../projections/modelBound/variantOf.ts","../reactors/IReactors.ts","../reactors/ReactorId.ts","../reactors/ReactorResultHandler.ts","../reactors/ReactorServices.ts","../reactors/ReactorSideEffects.ts","../reactors/Reactors.ts","../reactors/index.ts","../reactors/onceOnly.ts","../reactors/reactor.ts","../reactors/replay.ts","../readModels/IMaterializedReadModels.ts","../readModels/IReadModels.ts","../readModels/MaterializedReadModels.ts","../readModels/ReadModelChangeset.ts","../readModels/ReadModelId.ts","../readModels/ReadModelSnapshot.ts","../readModels/ReadModelSubjectResolver.ts","../readModels/ReadModels.ts","../readModels/assertUniqueReadModelIds.ts","../readModels/buildReadModelDefinition.ts","../readModels/deserializeReadModel.ts","../readModels/index.ts","../readModels/indexDecorator.ts","../readModels/readModel.ts","../readModels/rootReadModelTypes.ts","../reducers/IReducers.ts","../reducers/ReducerEventDispatcher.ts","../reducers/ReducerEventHandler.ts","../reducers/ReducerId.ts","../reducers/Reducers.ts","../reducers/index.ts","../reducers/reducer.ts","../schemas/JsonSchema.ts","../schemas/JsonSchemaGenerator.ts","../schemas/createDeferredSchema.ts","../schemas/index.ts","../schemas/jsonSchemaProperty.ts","../seeding/EventSeeding.ts","../seeding/ICanSeedEvents.ts","../seeding/IEventSeeding.ts","../seeding/IEventSeedingBuilder.ts","../seeding/IEventSeedingScopeBuilder.ts","../seeding/index.ts","../seeding/seeder.ts","../sinks/WellKnownSinks.ts","../sinks/index.ts","../testing/ReadModelScenario.ts","../testing/ReadModelScenarioGiven.ts","../testing/ReadModelScenarioGivenBuilder.ts","../testing/index.ts","../testing/projections/ProjectionCapabilities.ts","../testing/projections/UnsupportedProjectionOperation.ts","../testing/projections/for_ProjectionCapabilities/given/Changed.ts","../testing/projections/for_ProjectionCapabilities/given/Model.ts","../testing/projections/for_ProjectionCapabilities/given/Removed.ts","../testing/projections/for_ProjectionCapabilities/given/compile.ts","../transactions/IUnitOfWork.ts","../transactions/IUnitOfWorkManager.ts","../transactions/NoUnitOfWorkHasBeenStarted.ts","../transactions/UnitOfWork.ts","../transactions/UnitOfWorkManager.ts","../transactions/index.ts","../types/DecoratorType.ts","../types/TypeDiscoverer.ts","../types/TypeIntrospector.ts","../types/conceptValueType.ts","../types/index.ts","../types/modelBoundProperty.ts","../types/modelBoundPropertyMetadata.ts","../types/propertyDecoratorMetadata.ts","../types/standardDecoratorMetadata.ts","../webhooks/IWebhook.ts","../webhooks/IWebhookDefinitionBuilder.ts","../webhooks/IWebhooks.ts","../webhooks/WebhookDefinitionBuilder.ts","../webhooks/WebhookId.ts","../webhooks/WebhookTargetUrl.ts","../webhooks/Webhooks.ts","../webhooks/index.ts","../webhooks/webhook.ts"],"packageJsons":["../package.json","../../node_modules/@bufbuild/protobuf/dist/esm/package.json","../../node_modules/@bufbuild/protobuf/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/package.json","../../node_modules/@cratis/chronicle.contracts/package.json","../../node_modules/@cratis/fundamentals/dist/esm/package.json","../../node_modules/@cratis/fundamentals/package.json","../../node_modules/@grpc/grpc-js/package.json","../../node_modules/@grpc/proto-loader/package.json","../../node_modules/@js-sdsl/ordered-map/package.json","../../node_modules/@opentelemetry/api/package.json","../../node_modules/@types/node/package.json","../../node_modules/glob/dist/esm/package.json","../../node_modules/glob/package.json","../../node_modules/long/package.json","../../node_modules/long/umd/package.json","../../node_modules/lru-cache/dist/esm/package.json","../../node_modules/lru-cache/package.json","../../node_modules/minimatch/dist/esm/package.json","../../node_modules/minimatch/package.json","../../node_modules/minipass/dist/esm/package.json","../../node_modules/minipass/package.json","../../node_modules/nice-grpc-common/package.json","../../node_modules/nice-grpc/package.json","../../node_modules/path-scurry/dist/esm/package.json","../../node_modules/path-scurry/package.json","../../node_modules/protobufjs/package.json","../../node_modules/reflect-metadata/package.json","../../node_modules/ts-error/package.json","../../node_modules/undici-types/package.json","../../node_modules/undici/package.json"],"missingPackageJsons":["../../node_modules/@bufbuild/protobuf/dist/esm/codegenv1/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/codegenv2/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/reflect/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wire/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wkt/package.json","../../node_modules/@bufbuild/protobuf/wire/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/generated/google/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/generated/google/protobuf/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/generated/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/generated/protobuf-net/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/package.json","../../node_modules/@cratis/chronicle.contracts/dist/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/reflect/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wire/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wkt/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/wire/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/nice-grpc-common/package.json","../../node_modules/@cratis/fundamentals/dist/esm/geospatial/package.json","../../node_modules/@cratis/fundamentals/dist/esm/json/package.json","../../node_modules/@grpc/grpc-js/build/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/google/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/google/protobuf/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/grpc/channelz/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/grpc/channelz/v1/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/grpc/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/data/orca/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/data/orca/v3/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/data/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/service/orca/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/service/orca/v3/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/service/package.json","../../node_modules/@grpc/grpc-js/build/src/package.json","../../node_modules/@grpc/proto-loader/build/package.json","../../node_modules/@grpc/proto-loader/build/src/package.json","../../node_modules/@js-sdsl/ordered-map/dist/esm/package.json","../../node_modules/@js-sdsl/ordered-map/dist/package.json","../../node_modules/@opentelemetry/api/build/package.json","../../node_modules/@opentelemetry/api/build/src/api/package.json","../../node_modules/@opentelemetry/api/build/src/baggage/internal/package.json","../../node_modules/@opentelemetry/api/build/src/baggage/package.json","../../node_modules/@opentelemetry/api/build/src/common/package.json","../../node_modules/@opentelemetry/api/build/src/context/package.json","../../node_modules/@opentelemetry/api/build/src/diag/package.json","../../node_modules/@opentelemetry/api/build/src/metrics/package.json","../../node_modules/@opentelemetry/api/build/src/package.json","../../node_modules/@opentelemetry/api/build/src/propagation/package.json","../../node_modules/@opentelemetry/api/build/src/trace/internal/package.json","../../node_modules/@opentelemetry/api/build/src/trace/package.json","../../node_modules/@types/assert/package.json","../../node_modules/@types/assert/strict/package.json","../../node_modules/@types/async_hooks/package.json","../../node_modules/@types/buffer/package.json","../../node_modules/@types/child_process/package.json","../../node_modules/@types/cluster/package.json","../../node_modules/@types/console/package.json","../../node_modules/@types/constants/package.json","../../node_modules/@types/crypto/package.json","../../node_modules/@types/dgram/package.json","../../node_modules/@types/diagnostics_channel/package.json","../../node_modules/@types/dns/package.json","../../node_modules/@types/dns/promises/package.json","../../node_modules/@types/domain/package.json","../../node_modules/@types/events/package.json","../../node_modules/@types/fs/package.json","../../node_modules/@types/fs/promises/package.json","../../node_modules/@types/http/package.json","../../node_modules/@types/http2/package.json","../../node_modules/@types/https/package.json","../../node_modules/@types/inspector/package.json","../../node_modules/@types/inspector/promises/package.json","../../node_modules/@types/module/package.json","../../node_modules/@types/net/package.json","../../node_modules/@types/node/assert/package.json","../../node_modules/@types/node/dns/package.json","../../node_modules/@types/node/fs/package.json","../../node_modules/@types/node/inspector/package.json","../../node_modules/@types/node/path/package.json","../../node_modules/@types/node/readline/package.json","../../node_modules/@types/node/stream/package.json","../../node_modules/@types/node/test/package.json","../../node_modules/@types/node/timers/package.json","../../node_modules/@types/node/util/package.json","../../node_modules/@types/node/web-globals/package.json","../../node_modules/@types/node/zlib/package.json","../../node_modules/@types/os/package.json","../../node_modules/@types/path/package.json","../../node_modules/@types/path/posix/package.json","../../node_modules/@types/path/win32/package.json","../../node_modules/@types/perf_hooks/package.json","../../node_modules/@types/process/package.json","../../node_modules/@types/punycode/package.json","../../node_modules/@types/querystring/package.json","../../node_modules/@types/readline/package.json","../../node_modules/@types/readline/promises/package.json","../../node_modules/@types/repl/package.json","../../node_modules/@types/stream/consumers/package.json","../../node_modules/@types/stream/iter/package.json","../../node_modules/@types/stream/package.json","../../node_modules/@types/stream/promises/package.json","../../node_modules/@types/stream/web/package.json","../../node_modules/@types/string_decoder/package.json","../../node_modules/@types/timers/package.json","../../node_modules/@types/timers/promises/package.json","../../node_modules/@types/tls/package.json","../../node_modules/@types/trace_events/package.json","../../node_modules/@types/tty/package.json","../../node_modules/@types/url/package.json","../../node_modules/@types/util/package.json","../../node_modules/@types/util/types/package.json","../../node_modules/@types/v8/package.json","../../node_modules/@types/vm/package.json","../../node_modules/@types/wasi/package.json","../../node_modules/@types/worker_threads/package.json","../../node_modules/@types/zlib/package.json","../../node_modules/assert/package.json","../../node_modules/assert/strict/package.json","../../node_modules/async_hooks/package.json","../../node_modules/buffer/package.json","../../node_modules/child_process/package.json","../../node_modules/cluster/package.json","../../node_modules/console/package.json","../../node_modules/constants/package.json","../../node_modules/crypto/package.json","../../node_modules/dgram/package.json","../../node_modules/diagnostics_channel/package.json","../../node_modules/dns/package.json","../../node_modules/dns/promises/package.json","../../node_modules/domain/package.json","../../node_modules/events/package.json","../../node_modules/fs/package.json","../../node_modules/fs/promises/package.json","../../node_modules/http/package.json","../../node_modules/http2/package.json","../../node_modules/https/package.json","../../node_modules/inspector/package.json","../../node_modules/inspector/promises/package.json","../../node_modules/module/package.json","../../node_modules/net/package.json","../../node_modules/nice-grpc-common/lib/client/package.json","../../node_modules/nice-grpc-common/lib/package.json","../../node_modules/nice-grpc-common/lib/server/package.json","../../node_modules/nice-grpc/lib/client/package.json","../../node_modules/nice-grpc/lib/package.json","../../node_modules/nice-grpc/lib/server/package.json","../../node_modules/nice-grpc/lib/service-definitions/package.json","../../node_modules/nice-grpc/lib/utils/package.json","../../node_modules/os/package.json","../../node_modules/path/package.json","../../node_modules/path/posix/package.json","../../node_modules/path/win32/package.json","../../node_modules/perf_hooks/package.json","../../node_modules/process/package.json","../../node_modules/protobufjs/ext/descriptor/package.json","../../node_modules/protobufjs/ext/package.json","../../node_modules/protobufjs/node_modules/@types/long/package.json","../../node_modules/protobufjs/node_modules/long/package.json","../../node_modules/punycode/package.json","../../node_modules/querystring/package.json","../../node_modules/readline/package.json","../../node_modules/readline/promises/package.json","../../node_modules/repl/package.json","../../node_modules/stream/consumers/package.json","../../node_modules/stream/iter/package.json","../../node_modules/stream/package.json","../../node_modules/stream/promises/package.json","../../node_modules/stream/web/package.json","../../node_modules/string_decoder/package.json","../../node_modules/timers/package.json","../../node_modules/timers/promises/package.json","../../node_modules/tls/package.json","../../node_modules/trace_events/package.json","../../node_modules/ts-error/lib/package.json","../../node_modules/tty/package.json","../../node_modules/undici/types/package.json","../../node_modules/url/package.json","../../node_modules/util/package.json","../../node_modules/util/types/package.json","../../node_modules/v8/package.json","../../node_modules/vm/package.json","../../node_modules/wasi/package.json","../../node_modules/worker_threads/package.json","../../node_modules/zlib/package.json"]}
|
|
1
|
+
{"version":"7.0.2","root":["../ChronicleClient.ts","../ChronicleOptions.ts","../EventStore.ts","../EventStoreName.ts","../EventStoreNamespaceName.ts","../IChronicleClient.ts","../IEventStore.ts","../Metrics.ts","../Tracing.ts","../index.ts","../artifacts/ActivatedArtifact.ts","../artifacts/ArtifactActivationContext.ts","../artifacts/ArtifactCompletionFailed.ts","../artifacts/ArtifactDelivery.ts","../artifacts/ArtifactInvocationContext.ts","../artifacts/ArtifactKind.ts","../artifacts/ClientArtifactsActivator.ts","../artifacts/DefaultClientArtifactsProvider.ts","../artifacts/IClientArtifactsProvider.ts","../artifacts/index.ts","../artifacts/validateArtifactSchemas.ts","../artifacts/withActivatedArtifact.ts","../auditing/Causation.ts","../auditing/CausationManager.ts","../auditing/CausationType.ts","../auditing/ICausationManager.ts","../auditing/index.ts","../compliance/ComplianceContracts.ts","../compliance/ComplianceMetadata.ts","../compliance/ComplianceMetadataResolver.ts","../compliance/ComplianceMetadataType.ts","../compliance/IPIIManager.ts","../compliance/PIIManager.ts","../compliance/PIINotSupportedOnEventSourceId.ts","../compliance/index.ts","../compliance/pii.ts","../compliance/subject.ts","../confidentiality/EncryptedNotSupportedOnEventSourceId.ts","../confidentiality/EncryptionScope.ts","../confidentiality/PIIAndEncryptedCombinedNotSupported.ts","../confidentiality/SecurityMetadata.ts","../confidentiality/SecurityMetadataResolver.ts","../confidentiality/SecurityMetadataType.ts","../confidentiality/encrypted.ts","../confidentiality/index.ts","../connection/ChronicleConnection.ts","../connection/ChronicleConnectionString.ts","../connection/ChronicleServerAddressResolver.ts","../connection/ChronicleServices.ts","../connection/ChronicleSrvResolutionError.ts","../connection/ChronicleSrvResolver.ts","../connection/CompatibilityPreflight.ts","../connection/ConnectionLifecycle.ts","../connection/DateTimeOffset.ts","../connection/Guid.ts","../connection/ILoadBalancerStrategy.ts","../connection/IncompatibleChronicleServer.ts","../connection/KernelKeepAlive.ts","../connection/LeastConnectionsLoadBalancerStrategy.ts","../connection/LoadBalancerMode.ts","../connection/LoadBalancerStrategyFactory.ts","../connection/RandomLoadBalancerStrategy.ts","../connection/RejectedChronicleCredentials.ts","../connection/RoundRobinLoadBalancerStrategy.ts","../connection/TokenProvider.ts","../connection/callResults.ts","../connection/clientVersion.ts","../connection/fetchOAuthAccessToken.ts","../connection/formatServerAddress.ts","../connection/index.ts","../correlation/CorrelationId.ts","../correlation/CorrelationIdManager.ts","../correlation/ICorrelationIdAccessor.ts","../correlation/ICorrelationIdSetter.ts","../correlation/index.ts","../eventSequences/AppendError.ts","../eventSequences/AppendOperationsBroadcaster.ts","../eventSequences/AppendOptions.ts","../eventSequences/AppendResult.ts","../eventSequences/AppendedEventWithResult.ts","../eventSequences/CompleteStreamError.ts","../eventSequences/CompleteStreamResult.ts","../eventSequences/ConcurrencyScope.ts","../eventSequences/ConcurrencyViolation.ts","../eventSequences/ConstraintViolation.ts","../eventSequences/EventForEventSourceId.ts","../eventSequences/EventLog.ts","../eventSequences/EventSequence.ts","../eventSequences/EventSequenceId.ts","../eventSequences/EventSequenceNumber.ts","../eventSequences/IEventLog.ts","../eventSequences/IEventSequence.ts","../eventSequences/ITransactionalEventSequence.ts","../eventSequences/TransactionalEventSequence.ts","../eventSequences/WaitForCompletionOptions.ts","../eventSequences/WaitForCompletionResult.ts","../eventSequences/index.ts","../eventStoreSubscriptions/EventStoreSubscriptionBuilder.ts","../eventStoreSubscriptions/EventStoreSubscriptionDefinition.ts","../eventStoreSubscriptions/EventStoreSubscriptionId.ts","../eventStoreSubscriptions/EventStoreSubscriptions.ts","../eventStoreSubscriptions/IEventStoreSubscriptionBuilder.ts","../eventStoreSubscriptions/IEventStoreSubscriptions.ts","../eventStoreSubscriptions/contracts.ts","../eventStoreSubscriptions/index.ts","../events/AppendedEvent.ts","../events/CausationEntry.ts","../events/EventContext.ts","../events/EventType.ts","../events/EventTypeGeneration.ts","../events/EventTypeId.ts","../events/EventTypes.ts","../events/IEventTypes.ts","../events/Tag.ts","../events/WireEventContext.ts","../events/eventTypeDecorator.ts","../events/filterEventsByTagDecorator.ts","../events/index.ts","../events/isRegisteredEvent.ts","../events/mergeTags.ts","../events/tagDecorator.ts","../events/toClientEventContext.ts","../events/constraints/ConstraintBuilder.ts","../events/constraints/ConstraintId.ts","../events/constraints/Constraints.ts","../events/constraints/IConstraint.ts","../events/constraints/IConstraintBuilder.ts","../events/constraints/IConstraints.ts","../events/constraints/IUniqueConstraintBuilder.ts","../events/constraints/UniqueConstraintBuilder.ts","../events/constraints/constraint.ts","../events/constraints/index.ts","../events/constraints/removeConstraint.ts","../events/constraints/unique.ts","../events/migrations/EventMigrationBuilder.ts","../events/migrations/EventMigrationPropertyBuilder.ts","../events/migrations/EventTypeMigrators.ts","../events/migrations/IEventMigrationBuilder.ts","../events/migrations/IEventMigrationPropertyBuilder.ts","../events/migrations/IEventTypeMigration.ts","../events/migrations/IEventTypeMigrators.ts","../events/migrations/InvalidMigrationGenerationGap.ts","../events/migrations/eventTypeMigration.ts","../events/migrations/index.ts","../externalServices/ExternalServiceBuilder.ts","../externalServices/ExternalServices.ts","../externalServices/IExternalServiceBuilder.ts","../externalServices/IExternalServices.ts","../externalServices/index.ts","../identities/IIdentityManager.ts","../identities/IdentityManager.ts","../identities/index.ts","../identity/IIdentityProvider.ts","../identity/Identity.ts","../identity/IdentityProvider.ts","../identity/index.ts","../jobs/IJobs.ts","../jobs/JobId.ts","../jobs/Jobs.ts","../jobs/index.ts","../observation/FailedPartition.ts","../observation/FailedPartitionAttempt.ts","../observation/FailedPartitions.ts","../observation/ICanBeNotifiedWhenPartitionReplayed.ts","../observation/ICanBeNotifiedWhenReplay.ts","../observation/IFailedPartitions.ts","../observation/IObservers.ts","../observation/ObserverId.ts","../observation/ObserverInformation.ts","../observation/ObserverRemovalOutcome.ts","../observation/ObserverRemovalResult.ts","../observation/ObserverRunningState.ts","../observation/ObserverType.ts","../observation/Observers.ts","../observation/index.ts","../observation/notifyReplayLifecycle.ts","../observation/toClientFailedPartition.ts","../observation/toObserverInformation.ts","../observation/toObserverRemovalResult.ts","../observation/toObserverRunningState.ts","../projections/CompiledProjectionDefinitions.ts","../projections/GlobalHandlerPropertyNotOnVariant.ts","../projections/IProjections.ts","../projections/InvalidEventContextPropertyError.ts","../projections/ProjectionCapabilityProvenance.ts","../projections/ProjectionDefinitionCompiler.ts","../projections/ProjectionEventSchema.ts","../projections/ProjectionId.ts","../projections/ProjectionQueryResult.ts","../projections/ProjectionState.ts","../projections/Projections.ts","../projections/ResolvedModelBoundMetadata.ts","../projections/UnableToQueryProjection.ts","../projections/VariantMustDeclareEntersOnEvent.ts","../projections/VariantReclassifier.ts","../projections/canonicalStringify.ts","../projections/captureProjectionProvenance.ts","../projections/constantValueExpression.ts","../projections/eventContextPropertyExpression.ts","../projections/eventContractPath.ts","../projections/index.ts","../projections/invalidEventContextPropertyInProjection.ts","../projections/notSetPropertyPath.ts","../projections/declarative/AddBuilder.ts","../projections/declarative/AddChildBuilder.ts","../projections/declarative/AllSetBuilder.ts","../projections/declarative/ChildrenBuilder.ts","../projections/declarative/CompositeKeyBuilder.ts","../projections/declarative/FromBuilder.ts","../projections/declarative/FromEveryBuilder.ts","../projections/declarative/IAddBuilder.ts","../projections/declarative/IAddChildBuilder.ts","../projections/declarative/IAllSetBuilder.ts","../projections/declarative/IChildrenBuilder.ts","../projections/declarative/ICompositeKeyBuilder.ts","../projections/declarative/IFromBuilder.ts","../projections/declarative/IFromEveryBuilder.ts","../projections/declarative/IJoinBuilder.ts","../projections/declarative/INestedBuilder.ts","../projections/declarative/IProjectionBuilder.ts","../projections/declarative/IProjectionBuilderFor.ts","../projections/declarative/IProjectionFor.ts","../projections/declarative/IReadModelPropertiesBuilder.ts","../projections/declarative/IRemovedWithBuilder.ts","../projections/declarative/IRemovedWithJoinBuilder.ts","../projections/declarative/ISetBuilder.ts","../projections/declarative/ISubtractBuilder.ts","../projections/declarative/JoinBuilder.ts","../projections/declarative/NestedBuilder.ts","../projections/declarative/ProjectionBuilderCore.ts","../projections/declarative/ProjectionBuilderFor.ts","../projections/declarative/RemovedWithBuilder.ts","../projections/declarative/RemovedWithJoinBuilder.ts","../projections/declarative/SetBuilder.ts","../projections/declarative/SubtractBuilder.ts","../projections/declarative/index.ts","../projections/declarative/projection.ts","../projections/declarative/projectionBuilderProvenance.ts","../projections/modelBound/FromEventMetadata.ts","../projections/modelBound/FromEventOptions.ts","../projections/modelBound/addFrom.ts","../projections/modelBound/childrenAndNestedBuilder.ts","../projections/modelBound/childrenFrom.ts","../projections/modelBound/clearWith.ts","../projections/modelBound/count.ts","../projections/modelBound/decrement.ts","../projections/modelBound/entersOn.ts","../projections/modelBound/eventSequence.ts","../projections/modelBound/fromAll.ts","../projections/modelBound/fromEvent.ts","../projections/modelBound/fromEvery.ts","../projections/modelBound/globalFor.ts","../projections/modelBound/increment.ts","../projections/modelBound/index.ts","../projections/modelBound/isModelBoundProjection.ts","../projections/modelBound/join.ts","../projections/modelBound/nested.ts","../projections/modelBound/noAutoMap.ts","../projections/modelBound/notRewindable.ts","../projections/modelBound/passive.ts","../projections/modelBound/removedWith.ts","../projections/modelBound/removedWithJoin.ts","../projections/modelBound/setFrom.ts","../projections/modelBound/setFromContext.ts","../projections/modelBound/setValue.ts","../projections/modelBound/subtractFrom.ts","../projections/modelBound/variantOf.ts","../reactors/IReactors.ts","../reactors/ReactorId.ts","../reactors/ReactorResultHandler.ts","../reactors/ReactorServices.ts","../reactors/ReactorSideEffects.ts","../reactors/Reactors.ts","../reactors/index.ts","../reactors/onceOnly.ts","../reactors/reactor.ts","../reactors/replay.ts","../readModels/IMaterializedReadModels.ts","../readModels/IReadModels.ts","../readModels/MaterializedReadModels.ts","../readModels/ReadModelChangeset.ts","../readModels/ReadModelId.ts","../readModels/ReadModelSnapshot.ts","../readModels/ReadModelSubjectResolver.ts","../readModels/ReadModels.ts","../readModels/assertUniqueReadModelIds.ts","../readModels/buildReadModelDefinition.ts","../readModels/deserializeReadModel.ts","../readModels/index.ts","../readModels/indexDecorator.ts","../readModels/readModel.ts","../readModels/rootReadModelTypes.ts","../reducers/IReducers.ts","../reducers/ReducerEventDispatcher.ts","../reducers/ReducerEventHandler.ts","../reducers/ReducerId.ts","../reducers/Reducers.ts","../reducers/index.ts","../reducers/reducer.ts","../schemas/JsonSchema.ts","../schemas/JsonSchemaGenerator.ts","../schemas/createDeferredSchema.ts","../schemas/index.ts","../schemas/jsonSchemaProperty.ts","../seeding/EventSeeding.ts","../seeding/ICanSeedEvents.ts","../seeding/IEventSeeding.ts","../seeding/IEventSeedingBuilder.ts","../seeding/IEventSeedingScopeBuilder.ts","../seeding/index.ts","../seeding/seeder.ts","../sinks/WellKnownSinks.ts","../sinks/index.ts","../testing/IReadModelProcessor.ts","../testing/ReadModelScenario.ts","../testing/ReadModelScenarioGiven.ts","../testing/ReadModelScenarioGivenBuilder.ts","../testing/ReadModelState.ts","../testing/ReducerReadModelProcessor.ts","../testing/ScenarioEvent.ts","../testing/index.ts","../testing/projections/ProjectionCapabilities.ts","../testing/projections/ProjectionExpressionEvaluator.ts","../testing/projections/ProjectionReadModelProcessor.ts","../testing/projections/ProjectionValueConverter.ts","../testing/projections/UnsupportedProjectionOperation.ts","../testing/projections/for_ProjectionCapabilities/given/Changed.ts","../testing/projections/for_ProjectionCapabilities/given/Model.ts","../testing/projections/for_ProjectionCapabilities/given/Removed.ts","../testing/projections/for_ProjectionCapabilities/given/compile.ts","../transactions/IUnitOfWork.ts","../transactions/IUnitOfWorkManager.ts","../transactions/NoUnitOfWorkHasBeenStarted.ts","../transactions/UnitOfWork.ts","../transactions/UnitOfWorkManager.ts","../transactions/index.ts","../types/DecoratorType.ts","../types/TypeDiscoverer.ts","../types/TypeIntrospector.ts","../types/conceptValueType.ts","../types/index.ts","../types/modelBoundProperty.ts","../types/modelBoundPropertyMetadata.ts","../types/propertyDecoratorMetadata.ts","../types/standardDecoratorMetadata.ts","../webhooks/IWebhook.ts","../webhooks/IWebhookDefinitionBuilder.ts","../webhooks/IWebhooks.ts","../webhooks/WebhookDefinitionBuilder.ts","../webhooks/WebhookId.ts","../webhooks/WebhookTargetUrl.ts","../webhooks/Webhooks.ts","../webhooks/index.ts","../webhooks/webhook.ts"],"packageJsons":["../package.json","../../node_modules/@bufbuild/protobuf/dist/esm/package.json","../../node_modules/@bufbuild/protobuf/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/package.json","../../node_modules/@cratis/chronicle.contracts/package.json","../../node_modules/@cratis/fundamentals/dist/esm/package.json","../../node_modules/@cratis/fundamentals/package.json","../../node_modules/@grpc/grpc-js/package.json","../../node_modules/@grpc/proto-loader/package.json","../../node_modules/@js-sdsl/ordered-map/package.json","../../node_modules/@opentelemetry/api/package.json","../../node_modules/@types/node/package.json","../../node_modules/glob/dist/esm/package.json","../../node_modules/glob/package.json","../../node_modules/long/package.json","../../node_modules/long/umd/package.json","../../node_modules/lru-cache/dist/esm/package.json","../../node_modules/lru-cache/package.json","../../node_modules/minimatch/dist/esm/package.json","../../node_modules/minimatch/package.json","../../node_modules/minipass/dist/esm/package.json","../../node_modules/minipass/package.json","../../node_modules/nice-grpc-common/package.json","../../node_modules/nice-grpc/package.json","../../node_modules/path-scurry/dist/esm/package.json","../../node_modules/path-scurry/package.json","../../node_modules/protobufjs/package.json","../../node_modules/reflect-metadata/package.json","../../node_modules/ts-error/package.json","../../node_modules/undici-types/package.json","../../node_modules/undici/package.json"],"missingPackageJsons":["../../node_modules/@bufbuild/protobuf/dist/esm/codegenv1/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/codegenv2/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/reflect/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wire/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/package.json","../../node_modules/@bufbuild/protobuf/dist/esm/wkt/package.json","../../node_modules/@bufbuild/protobuf/wire/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/generated/google/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/generated/google/protobuf/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/generated/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/generated/protobuf-net/package.json","../../node_modules/@cratis/chronicle.contracts/dist/esm/package.json","../../node_modules/@cratis/chronicle.contracts/dist/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/reflect/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wire/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/dist/esm/wkt/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/@bufbuild/protobuf/wire/package.json","../../node_modules/@cratis/chronicle.contracts/node_modules/nice-grpc-common/package.json","../../node_modules/@cratis/fundamentals/dist/esm/geospatial/package.json","../../node_modules/@cratis/fundamentals/dist/esm/json/package.json","../../node_modules/@grpc/grpc-js/build/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/google/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/google/protobuf/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/grpc/channelz/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/grpc/channelz/v1/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/grpc/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/data/orca/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/data/orca/v3/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/data/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/service/orca/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/service/orca/v3/package.json","../../node_modules/@grpc/grpc-js/build/src/generated/xds/service/package.json","../../node_modules/@grpc/grpc-js/build/src/package.json","../../node_modules/@grpc/proto-loader/build/package.json","../../node_modules/@grpc/proto-loader/build/src/package.json","../../node_modules/@js-sdsl/ordered-map/dist/esm/package.json","../../node_modules/@js-sdsl/ordered-map/dist/package.json","../../node_modules/@opentelemetry/api/build/package.json","../../node_modules/@opentelemetry/api/build/src/api/package.json","../../node_modules/@opentelemetry/api/build/src/baggage/internal/package.json","../../node_modules/@opentelemetry/api/build/src/baggage/package.json","../../node_modules/@opentelemetry/api/build/src/common/package.json","../../node_modules/@opentelemetry/api/build/src/context/package.json","../../node_modules/@opentelemetry/api/build/src/diag/package.json","../../node_modules/@opentelemetry/api/build/src/metrics/package.json","../../node_modules/@opentelemetry/api/build/src/package.json","../../node_modules/@opentelemetry/api/build/src/propagation/package.json","../../node_modules/@opentelemetry/api/build/src/trace/internal/package.json","../../node_modules/@opentelemetry/api/build/src/trace/package.json","../../node_modules/@types/assert/package.json","../../node_modules/@types/assert/strict/package.json","../../node_modules/@types/async_hooks/package.json","../../node_modules/@types/buffer/package.json","../../node_modules/@types/child_process/package.json","../../node_modules/@types/cluster/package.json","../../node_modules/@types/console/package.json","../../node_modules/@types/constants/package.json","../../node_modules/@types/crypto/package.json","../../node_modules/@types/dgram/package.json","../../node_modules/@types/diagnostics_channel/package.json","../../node_modules/@types/dns/package.json","../../node_modules/@types/dns/promises/package.json","../../node_modules/@types/domain/package.json","../../node_modules/@types/events/package.json","../../node_modules/@types/fs/package.json","../../node_modules/@types/fs/promises/package.json","../../node_modules/@types/http/package.json","../../node_modules/@types/http2/package.json","../../node_modules/@types/https/package.json","../../node_modules/@types/inspector/package.json","../../node_modules/@types/inspector/promises/package.json","../../node_modules/@types/module/package.json","../../node_modules/@types/net/package.json","../../node_modules/@types/node/assert/package.json","../../node_modules/@types/node/dns/package.json","../../node_modules/@types/node/fs/package.json","../../node_modules/@types/node/inspector/package.json","../../node_modules/@types/node/path/package.json","../../node_modules/@types/node/readline/package.json","../../node_modules/@types/node/stream/package.json","../../node_modules/@types/node/test/package.json","../../node_modules/@types/node/timers/package.json","../../node_modules/@types/node/util/package.json","../../node_modules/@types/node/web-globals/package.json","../../node_modules/@types/node/zlib/package.json","../../node_modules/@types/os/package.json","../../node_modules/@types/path/package.json","../../node_modules/@types/path/posix/package.json","../../node_modules/@types/path/win32/package.json","../../node_modules/@types/perf_hooks/package.json","../../node_modules/@types/process/package.json","../../node_modules/@types/punycode/package.json","../../node_modules/@types/querystring/package.json","../../node_modules/@types/readline/package.json","../../node_modules/@types/readline/promises/package.json","../../node_modules/@types/repl/package.json","../../node_modules/@types/stream/consumers/package.json","../../node_modules/@types/stream/iter/package.json","../../node_modules/@types/stream/package.json","../../node_modules/@types/stream/promises/package.json","../../node_modules/@types/stream/web/package.json","../../node_modules/@types/string_decoder/package.json","../../node_modules/@types/timers/package.json","../../node_modules/@types/timers/promises/package.json","../../node_modules/@types/tls/package.json","../../node_modules/@types/trace_events/package.json","../../node_modules/@types/tty/package.json","../../node_modules/@types/url/package.json","../../node_modules/@types/util/package.json","../../node_modules/@types/util/types/package.json","../../node_modules/@types/v8/package.json","../../node_modules/@types/vm/package.json","../../node_modules/@types/wasi/package.json","../../node_modules/@types/worker_threads/package.json","../../node_modules/@types/zlib/package.json","../../node_modules/assert/package.json","../../node_modules/assert/strict/package.json","../../node_modules/async_hooks/package.json","../../node_modules/buffer/package.json","../../node_modules/child_process/package.json","../../node_modules/cluster/package.json","../../node_modules/console/package.json","../../node_modules/constants/package.json","../../node_modules/crypto/package.json","../../node_modules/dgram/package.json","../../node_modules/diagnostics_channel/package.json","../../node_modules/dns/package.json","../../node_modules/dns/promises/package.json","../../node_modules/domain/package.json","../../node_modules/events/package.json","../../node_modules/fs/package.json","../../node_modules/fs/promises/package.json","../../node_modules/http/package.json","../../node_modules/http2/package.json","../../node_modules/https/package.json","../../node_modules/inspector/package.json","../../node_modules/inspector/promises/package.json","../../node_modules/module/package.json","../../node_modules/net/package.json","../../node_modules/nice-grpc-common/lib/client/package.json","../../node_modules/nice-grpc-common/lib/package.json","../../node_modules/nice-grpc-common/lib/server/package.json","../../node_modules/nice-grpc/lib/client/package.json","../../node_modules/nice-grpc/lib/package.json","../../node_modules/nice-grpc/lib/server/package.json","../../node_modules/nice-grpc/lib/service-definitions/package.json","../../node_modules/nice-grpc/lib/utils/package.json","../../node_modules/os/package.json","../../node_modules/path/package.json","../../node_modules/path/posix/package.json","../../node_modules/path/win32/package.json","../../node_modules/perf_hooks/package.json","../../node_modules/process/package.json","../../node_modules/protobufjs/ext/descriptor/package.json","../../node_modules/protobufjs/ext/package.json","../../node_modules/protobufjs/node_modules/@types/long/package.json","../../node_modules/protobufjs/node_modules/long/package.json","../../node_modules/punycode/package.json","../../node_modules/querystring/package.json","../../node_modules/readline/package.json","../../node_modules/readline/promises/package.json","../../node_modules/repl/package.json","../../node_modules/stream/consumers/package.json","../../node_modules/stream/iter/package.json","../../node_modules/stream/package.json","../../node_modules/stream/promises/package.json","../../node_modules/stream/web/package.json","../../node_modules/string_decoder/package.json","../../node_modules/timers/package.json","../../node_modules/timers/promises/package.json","../../node_modules/tls/package.json","../../node_modules/trace_events/package.json","../../node_modules/ts-error/lib/package.json","../../node_modules/tty/package.json","../../node_modules/undici/types/package.json","../../node_modules/url/package.json","../../node_modules/util/package.json","../../node_modules/util/types/package.json","../../node_modules/v8/package.json","../../node_modules/vm/package.json","../../node_modules/wasi/package.json","../../node_modules/worker_threads/package.json","../../node_modules/zlib/package.json"]}
|
package/package.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import type { ReadModelState } from './ReadModelState.js';
|
|
5
|
+
import type { ScenarioEvent } from './ScenarioEvent.js';
|
|
6
|
+
|
|
7
|
+
/** Replays the complete serialized scenario history for independent event sources. */
|
|
8
|
+
export interface IReadModelProcessor<TReadModel extends object> {
|
|
9
|
+
process(events: readonly ScenarioEvent[]): Promise<Map<string, ReadModelState<TReadModel>>>;
|
|
10
|
+
}
|
|
@@ -2,18 +2,26 @@
|
|
|
2
2
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
3
|
|
|
4
4
|
import { describe, expect, it } from 'vitest';
|
|
5
|
-
import { ConceptAs, field } from '@cratis/fundamentals';
|
|
5
|
+
import { ConceptAs, field, Guid } from '@cratis/fundamentals';
|
|
6
6
|
import type { Constructor } from '@cratis/fundamentals';
|
|
7
|
+
import { pii } from '../compliance/pii.js';
|
|
7
8
|
import { eventType } from '../events/eventTypeDecorator.js';
|
|
8
9
|
import type { EventContext } from '../events/EventContext.js';
|
|
9
10
|
import { fromEvent } from '../projections/modelBound/fromEvent.js';
|
|
11
|
+
import { setFrom } from '../projections/modelBound/setFrom.js';
|
|
12
|
+
import { setFromContext } from '../projections/modelBound/setFromContext.js';
|
|
13
|
+
import { removedWith } from '../projections/modelBound/removedWith.js';
|
|
14
|
+
import type { IProjectionBuilderFor } from '../projections/declarative/IProjectionBuilderFor.js';
|
|
15
|
+
import type { IProjectionFor } from '../projections/declarative/IProjectionFor.js';
|
|
10
16
|
import { projection } from '../projections/declarative/projection.js';
|
|
11
17
|
import { reducer } from '../reducers/reducer.js';
|
|
12
|
-
import {
|
|
18
|
+
import { readModel } from '../readModels/readModel.js';
|
|
19
|
+
import { ReadModelScenario, ReadModelScenarioGivenBuilder, UnsupportedProjectionOperation } from './index.js';
|
|
13
20
|
import { readModelScenarioExample } from './ReadModelScenario.example.js';
|
|
14
21
|
|
|
15
22
|
class ItemAdded {
|
|
16
|
-
|
|
23
|
+
@field(Number) amount: number;
|
|
24
|
+
constructor(amount: number) { this.amount = amount; }
|
|
17
25
|
}
|
|
18
26
|
eventType('scenario-item-added')(ItemAdded);
|
|
19
27
|
class ItemRemoved {}
|
|
@@ -177,15 +185,153 @@ describe('ReadModelScenario', () => {
|
|
|
177
185
|
await expect(scenario.instance).rejects.toThrow('FailingReducer');
|
|
178
186
|
});
|
|
179
187
|
|
|
180
|
-
it('
|
|
181
|
-
class ProjectedState {
|
|
188
|
+
it('replays a compiled model-bound projection and recreates it after removal', async () => {
|
|
189
|
+
class ProjectedState {
|
|
190
|
+
@field(String) id = '';
|
|
191
|
+
@field(Number) count = 0;
|
|
192
|
+
}
|
|
182
193
|
fromEvent(ItemAdded)(ProjectedState);
|
|
183
|
-
|
|
194
|
+
setFrom(ItemAdded, 'amount')(ProjectedState.prototype, 'count');
|
|
195
|
+
removedWith(ItemRemoved)(ProjectedState);
|
|
196
|
+
const scenario = new ReadModelScenario(ProjectedState, artifacts);
|
|
197
|
+
scenario.given.forEventSource('A').events(new ItemAdded(3), new ItemRemoved());
|
|
198
|
+
expect(await scenario.instanceForEventSourceId('A')).toBeNull();
|
|
199
|
+
expect(await scenario.wasDeletedForEventSourceId('A')).toBe(true);
|
|
200
|
+
scenario.given.forEventSource('A').events(new UnrelatedEvent(), new ItemAdded(7));
|
|
201
|
+
expect(await scenario.instance).toMatchObject({ count: 7 });
|
|
202
|
+
expect(await scenario.wasDeletedForEventSourceId('A')).toBe(false);
|
|
203
|
+
});
|
|
184
204
|
|
|
185
|
-
|
|
186
|
-
class
|
|
205
|
+
it('discovers a property-only model-bound read model without an artifact catalog', async () => {
|
|
206
|
+
class PropertyOnlyState { @field(String) id = ''; @field(Number) count = 0; }
|
|
207
|
+
setFrom(ItemAdded, 'amount')(PropertyOnlyState.prototype, 'count');
|
|
208
|
+
const scenario = new ReadModelScenario(PropertyOnlyState);
|
|
209
|
+
scenario.given.forEventSource('A').events(new ItemAdded(5));
|
|
210
|
+
expect(await scenario.instance).toMatchObject({ count: 5 });
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
it('defaults a projection Subject mapping to the event source when the seed has no subject', async () => {
|
|
214
|
+
class SubjectState { @field(String) id = ''; @field(String) subject = ''; }
|
|
215
|
+
fromEvent(ItemAdded)(SubjectState);
|
|
216
|
+
setFromContext(ItemAdded, 'subject')(SubjectState.prototype, 'subject');
|
|
217
|
+
const scenario = new ReadModelScenario(SubjectState, artifacts);
|
|
218
|
+
scenario.given.forEventSource('source-a').events(new ItemAdded(1));
|
|
219
|
+
expect(await scenario.instance).toMatchObject({ subject: 'source-a' });
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
it('defaults a projection Hash and CausedBy mapping to kernel sentinels when the seed omits them', async () => {
|
|
223
|
+
class ContextDefaults { @field(String) id = ''; @field(String) hash = ''; @field(String) causedByName = ''; }
|
|
224
|
+
setFromContext(ItemAdded, 'hash')(ContextDefaults.prototype, 'hash');
|
|
225
|
+
setFromContext(ItemAdded, 'causedBy.name')(ContextDefaults.prototype, 'causedByName');
|
|
226
|
+
const scenario = new ReadModelScenario(ContextDefaults, artifacts);
|
|
227
|
+
scenario.given.forEventSource('A').events(new ItemAdded(1));
|
|
228
|
+
expect(await scenario.instance).toMatchObject({ hash: '', causedByName: '[Not Set]' });
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
it('rejects a seeded generation different from the subscribed generation before mapping', async () => {
|
|
232
|
+
class LaterItemAdded { @field(Number) oldAmount = 42; }
|
|
233
|
+
eventType('scenario-item-added', 2)(LaterItemAdded);
|
|
234
|
+
class GenerationState { @field(String) id = ''; @field(Number) count = 0; }
|
|
235
|
+
fromEvent(ItemAdded)(GenerationState);
|
|
236
|
+
setFrom(ItemAdded, 'amount')(GenerationState.prototype, 'count');
|
|
237
|
+
const scenario = new ReadModelScenario(GenerationState, { ...artifacts, eventTypes: [...artifacts.eventTypes, LaterItemAdded] });
|
|
238
|
+
scenario.given.forEventSource('source-a').events(new LaterItemAdded());
|
|
239
|
+
await expect(scenario.instance).rejects.toThrow(UnsupportedProjectionOperation);
|
|
240
|
+
await expect(scenario.instance).rejects.toThrow(/GenerationState.*From\[scenario-item-added:1\].*seeded event generation 2/);
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
it('rejects a seeded generation different from a removal subscription', async () => {
|
|
244
|
+
class LaterItemRemoved {}
|
|
245
|
+
eventType('scenario-item-removed', 2)(LaterItemRemoved);
|
|
246
|
+
class GenerationState { @field(String) id = ''; @field(Number) count = 0; }
|
|
247
|
+
fromEvent(ItemAdded)(GenerationState);
|
|
248
|
+
removedWith(ItemRemoved)(GenerationState);
|
|
249
|
+
const scenario = new ReadModelScenario(GenerationState, { ...artifacts, eventTypes: [...artifacts.eventTypes, LaterItemRemoved] });
|
|
250
|
+
scenario.given.forEventSource('source-a').events(new LaterItemRemoved());
|
|
251
|
+
await expect(scenario.wasDeletedForEventSourceId('source-a')).rejects.toThrow(/RemovedWith\[scenario-item-removed:1\].*seeded event generation 2/);
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
it('selects a declarative projection using its final compiled contract', async () => {
|
|
255
|
+
class FluentState { @field(String) id = ''; @field(Number) count = 0; }
|
|
256
|
+
class FluentProjection implements IProjectionFor<FluentState> {
|
|
257
|
+
define(builder: IProjectionBuilderFor<FluentState>): void {
|
|
258
|
+
builder.from(ItemAdded, from => from.set(model => model.count).to(event => event.amount));
|
|
259
|
+
}
|
|
260
|
+
}
|
|
187
261
|
projection('scenario-fluent-projection', FluentState)(FluentProjection);
|
|
188
|
-
|
|
189
|
-
|
|
262
|
+
const scenario = new ReadModelScenario(FluentState, { ...artifacts, projections: [FluentProjection] });
|
|
263
|
+
scenario.given.forEventSource('A').events(new ItemAdded(8));
|
|
264
|
+
expect(await scenario.instance).toMatchObject({ count: 8 });
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it('does not infer an unbound projection against an incomplete isolated read-model catalog', () => {
|
|
268
|
+
class AmbiguousState { @field(Number) count = 0; }
|
|
269
|
+
class AlsoMatching { @field(Number) count = 0; }
|
|
270
|
+
readModel()(AmbiguousState);
|
|
271
|
+
readModel()(AlsoMatching);
|
|
272
|
+
class UnboundProjection implements IProjectionFor<AmbiguousState> {
|
|
273
|
+
define(builder: IProjectionBuilderFor<AmbiguousState>): void {
|
|
274
|
+
builder.from(ItemAdded, from => from.set(model => model.count).to(event => event.amount));
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
projection('unbound-scenario-projection')(UnboundProjection);
|
|
278
|
+
expect(() => new ReadModelScenario(AmbiguousState, { ...artifacts, projections: [UnboundProjection] }))
|
|
279
|
+
.toThrow('No reducer or projection');
|
|
280
|
+
expect(() => new ReadModelScenario(AmbiguousState, {
|
|
281
|
+
...artifacts, projections: [UnboundProjection], readModels: [AmbiguousState, AlsoMatching]
|
|
282
|
+
})).toThrow('found 0');
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
it('includes the read-model name and original error when projection replay fails', async () => {
|
|
286
|
+
class NumericState { @field(Guid) id!: Guid; }
|
|
287
|
+
fromEvent(ItemAdded)(NumericState);
|
|
288
|
+
const scenario = new ReadModelScenario(NumericState, artifacts);
|
|
289
|
+
scenario.given.forEventSource('01').events(new ItemAdded(1));
|
|
290
|
+
await expect(scenario.instance).rejects.toMatchObject({
|
|
291
|
+
message: expect.stringContaining('NumericState'),
|
|
292
|
+
cause: expect.objectContaining({ message: expect.stringContaining('Projection GUID value') })
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
it('rejects a protected identifier before any events are seeded', () => {
|
|
297
|
+
class ProtectedState { @field(String) id = ''; }
|
|
298
|
+
pii()(ProtectedState.prototype, 'id');
|
|
299
|
+
fromEvent(ItemAdded)(ProtectedState);
|
|
300
|
+
expect(() => new ReadModelScenario(ProtectedState, artifacts))
|
|
301
|
+
.toThrow(/ReadModel.Schema.id.*protected fields require a kernel-backed test/);
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
it('rejects unsupported mappings before replay even when no events are seeded', () => {
|
|
305
|
+
class CustomKeyState { @field(String) id = ''; @field(Number) count = 0; }
|
|
306
|
+
fromEvent(ItemAdded, { key: 'amount' })(CustomKeyState);
|
|
307
|
+
expect(() => new ReadModelScenario(CustomKeyState, artifacts)).toThrow('only $eventSourceId keys are supported');
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
it('rejects noncanonical GUID source IDs instead of merging independent histories', async () => {
|
|
311
|
+
class NumericState { @field(Guid) id!: Guid; }
|
|
312
|
+
fromEvent(ItemAdded)(NumericState);
|
|
313
|
+
const scenario = new ReadModelScenario(NumericState, artifacts);
|
|
314
|
+
scenario.given.forEventSource('01').events(new ItemAdded(1));
|
|
315
|
+
await expect(scenario.instance).rejects.toThrow('Projection GUID value');
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
it('keeps reducer precedence when a projection also applies', async () => {
|
|
319
|
+
class DualState { @field(Number) count = 0; }
|
|
320
|
+
class DualReducer { itemAdded(event: ItemAdded): DualState { return { count: event.amount }; } }
|
|
321
|
+
reducer('scenario-dual-reducer', undefined, DualState)(DualReducer);
|
|
322
|
+
fromEvent(ItemAdded)(DualState);
|
|
323
|
+
const scenario = new ReadModelScenario(DualState, { ...artifacts, reducers: [DualReducer] });
|
|
324
|
+
scenario.given.forEventSource('A').events(new ItemAdded(4));
|
|
325
|
+
expect(await scenario.instance).toEqual({ count: 4 });
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
it('rejects multiple applicable projections before replay', () => {
|
|
329
|
+
class FluentState { @field(Number) count = 0; }
|
|
330
|
+
class FirstProjection implements IProjectionFor<FluentState> { define(): void {} }
|
|
331
|
+
class SecondProjection implements IProjectionFor<FluentState> { define(): void {} }
|
|
332
|
+
projection('first-projection', FluentState)(FirstProjection);
|
|
333
|
+
projection('second-projection', FluentState)(SecondProjection);
|
|
334
|
+
expect(() => new ReadModelScenario(FluentState, { ...artifacts, projections: [FirstProjection, SecondProjection] }))
|
|
335
|
+
.toThrow('Multiple projections found');
|
|
190
336
|
});
|
|
191
337
|
});
|