@classytic/repo-core 0.31.0 → 0.32.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/CHANGELOG.md +22 -0
- package/dist/_virtual/_rolldown/runtime.mjs +1 -2
- package/dist/adapter/index.mjs +1 -2
- package/dist/adapter/types.d.mts +0 -2
- package/dist/adapter/widen.d.mts +0 -2
- package/dist/adapter/widen.mjs +1 -2
- package/dist/aggregate/keyset.d.mts +0 -2
- package/dist/aggregate/keyset.mjs +1 -2
- package/dist/aggregate/normalize.d.mts +0 -2
- package/dist/aggregate/normalize.mjs +1 -2
- package/dist/better-auth/index.d.mts +0 -2
- package/dist/better-auth/index.mjs +1 -2
- package/dist/cache/engine.d.mts +0 -2
- package/dist/cache/engine.mjs +1 -2
- package/dist/cache/envelope.mjs +1 -2
- package/dist/cache/keys.mjs +1 -2
- package/dist/cache/memo.d.mts +0 -2
- package/dist/cache/memo.mjs +1 -2
- package/dist/cache/memory-adapter.d.mts +0 -2
- package/dist/cache/memory-adapter.mjs +1 -2
- package/dist/cache/options.d.mts +0 -2
- package/dist/cache/options.mjs +1 -2
- package/dist/cache/plugin/context.d.mts +0 -2
- package/dist/cache/plugin/context.mjs +1 -2
- package/dist/cache/plugin/index.d.mts +0 -2
- package/dist/cache/plugin/index.mjs +1 -2
- package/dist/cache/plugin/invalidation-hooks.mjs +1 -2
- package/dist/cache/plugin/read-hooks.mjs +1 -2
- package/dist/cache/plugin/swr.mjs +1 -2
- package/dist/cache/runtime.d.mts +0 -2
- package/dist/cache/runtime.mjs +0 -1
- package/dist/cache/stable-stringify.d.mts +0 -2
- package/dist/cache/stable-stringify.mjs +1 -2
- package/dist/cache/tag-index.mjs +1 -2
- package/dist/cache/timeout-adapter.d.mts +0 -2
- package/dist/cache/timeout-adapter.mjs +1 -2
- package/dist/cache/types.d.mts +0 -2
- package/dist/cache/version-store.mjs +1 -2
- package/dist/cleanup/define-purge-step.d.mts +0 -2
- package/dist/cleanup/define-purge-step.mjs +1 -2
- package/dist/cleanup/index.mjs +1 -2
- package/dist/cleanup/types.d.mts +0 -2
- package/dist/context/types.d.mts +0 -2
- package/dist/errors/codes.d.mts +0 -2
- package/dist/errors/codes.mjs +1 -2
- package/dist/errors/conflict.d.mts +0 -2
- package/dist/errors/conflict.mjs +1 -2
- package/dist/errors/contract.d.mts +0 -2
- package/dist/errors/contract.mjs +1 -2
- package/dist/errors/create-error.d.mts +0 -2
- package/dist/errors/create-error.mjs +1 -2
- package/dist/errors/duplicate-key.d.mts +0 -2
- package/dist/errors/duplicate-key.mjs +1 -2
- package/dist/errors/schema.d.mts +0 -2
- package/dist/errors/schema.mjs +1 -2
- package/dist/errors/types.d.mts +0 -2
- package/dist/events/emit.d.mts +0 -2
- package/dist/events/emit.mjs +1 -2
- package/dist/events/index.mjs +1 -2
- package/dist/events/types.d.mts +0 -2
- package/dist/filter/builders.d.mts +0 -2
- package/dist/filter/builders.mjs +1 -2
- package/dist/filter/coerce-dates.d.mts +0 -2
- package/dist/filter/coerce-dates.mjs +1 -2
- package/dist/filter/from-record.d.mts +0 -2
- package/dist/filter/from-record.mjs +1 -2
- package/dist/filter/guard.d.mts +0 -2
- package/dist/filter/guard.mjs +1 -2
- package/dist/filter/match-record.d.mts +0 -2
- package/dist/filter/match-record.mjs +1 -2
- package/dist/filter/match.d.mts +0 -2
- package/dist/filter/match.mjs +1 -2
- package/dist/filter/scope.d.mts +0 -2
- package/dist/filter/scope.mjs +1 -2
- package/dist/filter/types.d.mts +0 -2
- package/dist/filter/walk.d.mts +0 -2
- package/dist/filter/walk.mjs +1 -2
- package/dist/hash/index.d.mts +0 -2
- package/dist/hash/index.mjs +1 -2
- package/dist/hooks/engine.d.mts +0 -2
- package/dist/hooks/engine.mjs +1 -2
- package/dist/hooks/events.d.mts +0 -2
- package/dist/hooks/events.mjs +1 -2
- package/dist/hooks/priority.d.mts +0 -2
- package/dist/hooks/priority.mjs +1 -2
- package/dist/hooks/types.d.mts +0 -2
- package/dist/idempotency/index.d.mts +0 -2
- package/dist/idempotency/index.mjs +1 -2
- package/dist/loader/batch-loader.d.mts +0 -2
- package/dist/loader/batch-loader.mjs +1 -2
- package/dist/loader/index.mjs +1 -2
- package/dist/lock/index.d.mts +0 -2
- package/dist/lock/index.mjs +1 -2
- package/dist/lookup/types.d.mts +0 -2
- package/dist/operations/index.mjs +1 -2
- package/dist/operations/registry.d.mts +0 -2
- package/dist/operations/registry.mjs +1 -2
- package/dist/operations/types.d.mts +0 -2
- package/dist/pagination/canonical.d.mts +0 -2
- package/dist/pagination/canonical.mjs +1 -2
- package/dist/pagination/cursor.d.mts +0 -2
- package/dist/pagination/cursor.mjs +1 -2
- package/dist/pagination/keyset.d.mts +0 -2
- package/dist/pagination/keyset.mjs +1 -2
- package/dist/pagination/merge-keyset.d.mts +0 -2
- package/dist/pagination/merge-keyset.mjs +1 -2
- package/dist/pagination/offset.d.mts +0 -2
- package/dist/pagination/offset.mjs +1 -2
- package/dist/pagination/types.d.mts +0 -2
- package/dist/plugins/index.mjs +1 -2
- package/dist/plugins/tenant-helpers.d.mts +0 -2
- package/dist/plugins/tenant-helpers.mjs +1 -2
- package/dist/query-parser/coerce.d.mts +0 -2
- package/dist/query-parser/coerce.mjs +1 -2
- package/dist/query-parser/errors.d.mts +0 -2
- package/dist/query-parser/errors.mjs +1 -2
- package/dist/query-parser/format-query.d.mts +30 -0
- package/dist/query-parser/format-query.mjs +90 -0
- package/dist/query-parser/grammar.d.mts +0 -2
- package/dist/query-parser/grammar.mjs +1 -2
- package/dist/query-parser/index.d.mts +2 -1
- package/dist/query-parser/index.mjs +2 -1
- package/dist/query-parser/parse-url.d.mts +0 -2
- package/dist/query-parser/parse-url.mjs +1 -2
- package/dist/query-parser/regex-safety.d.mts +0 -2
- package/dist/query-parser/regex-safety.mjs +1 -2
- package/dist/query-parser/reserved.d.mts +0 -2
- package/dist/query-parser/reserved.mjs +1 -2
- package/dist/query-parser/types.d.mts +0 -2
- package/dist/repository/agg-output.d.mts +0 -2
- package/dist/repository/agg-output.mjs +1 -2
- package/dist/repository/archive.d.mts +0 -2
- package/dist/repository/archive.mjs +1 -2
- package/dist/repository/base.d.mts +0 -2
- package/dist/repository/base.mjs +1 -2
- package/dist/repository/bulk-upsert.d.mts +0 -2
- package/dist/repository/bulk-upsert.mjs +1 -2
- package/dist/repository/capabilities.d.mts +0 -2
- package/dist/repository/distribution.d.mts +0 -2
- package/dist/repository/distribution.mjs +1 -2
- package/dist/repository/options.d.mts +0 -2
- package/dist/repository/options.mjs +1 -2
- package/dist/repository/plugin-types.d.mts +0 -2
- package/dist/repository/plugin-types.mjs +1 -2
- package/dist/repository/purge.d.mts +0 -2
- package/dist/repository/purge.mjs +1 -2
- package/dist/repository/read-only.d.mts +0 -2
- package/dist/repository/read-only.mjs +1 -2
- package/dist/repository/resilience.d.mts +0 -2
- package/dist/repository/resilience.mjs +1 -2
- package/dist/repository/retrying-transaction.d.mts +0 -2
- package/dist/repository/retrying-transaction.mjs +1 -2
- package/dist/repository/types.d.mts +0 -2
- package/dist/schema/field-rules.d.mts +0 -2
- package/dist/schema/field-rules.mjs +1 -2
- package/dist/schema/generator.d.mts +0 -2
- package/dist/schema/generator.mjs +1 -2
- package/dist/schema/standard-schema.d.mts +0 -2
- package/dist/schema/standard-schema.mjs +1 -2
- package/dist/schema/types.d.mts +0 -2
- package/dist/sync/index.d.mts +0 -2
- package/dist/sync/index.mjs +0 -0
- package/dist/tenant/index.mjs +1 -2
- package/dist/tenant/resolve.d.mts +0 -2
- package/dist/tenant/resolve.mjs +1 -2
- package/dist/tenant/types.d.mts +0 -2
- package/dist/testing/change-log-conformance.d.mts +0 -2
- package/dist/testing/change-log-conformance.mjs +1 -2
- package/dist/testing/command-stream-conformance.d.mts +0 -2
- package/dist/testing/command-stream-conformance.mjs +1 -2
- package/dist/testing/conformance.d.mts +0 -2
- package/dist/testing/conformance.mjs +1 -2
- package/dist/testing/data-access-conformance.d.mts +0 -2
- package/dist/testing/data-access-conformance.mjs +1 -2
- package/dist/testing/idempotency-conformance.d.mts +0 -2
- package/dist/testing/idempotency-conformance.mjs +1 -2
- package/dist/testing/lock-conformance.d.mts +0 -2
- package/dist/testing/lock-conformance.mjs +1 -2
- package/dist/testing/merge-keyset-conformance.d.mts +0 -2
- package/dist/testing/merge-keyset-conformance.mjs +1 -2
- package/dist/testing/pagination-property-conformance.d.mts +0 -2
- package/dist/testing/pagination-property-conformance.mjs +1 -2
- package/dist/testing/purge-conformance.d.mts +0 -2
- package/dist/testing/purge-conformance.mjs +1 -2
- package/dist/testing/query-grammar-conformance.d.mts +0 -2
- package/dist/testing/query-grammar-conformance.mjs +1 -2
- package/dist/testing/read-model-property-conformance.d.mts +0 -2
- package/dist/testing/read-model-property-conformance.mjs +1 -2
- package/dist/testing/types.d.mts +0 -2
- package/dist/testing/usage-conformance.d.mts +0 -2
- package/dist/testing/usage-conformance.mjs +1 -2
- package/dist/update/builders.d.mts +0 -2
- package/dist/update/builders.mjs +1 -2
- package/dist/update/compile.d.mts +0 -2
- package/dist/update/compile.mjs +1 -2
- package/dist/update/guard.d.mts +0 -2
- package/dist/update/guard.mjs +1 -2
- package/dist/update/types.d.mts +0 -2
- package/dist/usage/index.d.mts +0 -2
- package/dist/usage/index.mjs +1 -2
- package/llms.txt +29 -0
- package/package.json +16 -5
- package/skills/repo-core/SKILL.md +108 -0
- package/skills/repo-core/references/contracts.md +69 -0
- package/skills/repo-core/references/kit-authoring.md +75 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/repository/plugin-types.ts
|
|
2
2
|
/**
|
|
3
3
|
* Ordered pairs that produce wrong behavior when installed out of order.
|
|
4
4
|
* Each entry: `[mustComeFirst, mustComeAfter, reason]`.
|
|
@@ -41,5 +41,4 @@ function validatePluginOrder(plugins, repoName, mode = "warn", onWarn = (m) => {
|
|
|
41
41
|
onWarn(message);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
//#endregion
|
|
45
44
|
export { PLUGIN_ORDER_CONSTRAINTS, validatePluginOrder };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TenantPurgeOptions, TenantPurgeResult, TenantPurgeStrategy } from "./types.mjs";
|
|
2
|
-
//#region src/repository/purge.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Strategies that perform a write. `skip` is handled by the orchestrator
|
|
5
4
|
* before the port is ever consulted, so ports only deal with the three
|
|
@@ -88,5 +87,4 @@ interface PurgePort {
|
|
|
88
87
|
* @param port Kit-specific driver glue (one `purgeChunk` method).
|
|
89
88
|
*/
|
|
90
89
|
declare function runChunkedPurge(strategy: TenantPurgeStrategy, options: TenantPurgeOptions, port: PurgePort): Promise<TenantPurgeResult>;
|
|
91
|
-
//#endregion
|
|
92
90
|
export { PurgePort, WritingPurgeStrategy, runChunkedPurge };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { withRetry } from "./resilience.mjs";
|
|
2
|
-
|
|
2
|
+
// src/repository/purge.ts
|
|
3
3
|
/**
|
|
4
4
|
* Chunked tenant-purge orchestrator — kit-agnostic.
|
|
5
5
|
*
|
|
@@ -79,5 +79,4 @@ async function runChunkedPurge(strategy, options, port) {
|
|
|
79
79
|
durationMs: Date.now() - start
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
|
-
//#endregion
|
|
83
82
|
export { runChunkedPurge };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/repository/read-only.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* `asReadOnlyRepo` — seal a repository whose rows are owned by ANOTHER writer.
|
|
4
3
|
*
|
|
@@ -56,5 +55,4 @@ declare class ReadOnlyRepositoryError extends Error {
|
|
|
56
55
|
declare function asReadOnlyRepo<TRepo extends object>(repo: TRepo, options: ReadOnlyRepoOptions): TRepo;
|
|
57
56
|
/** True when a repository (or adapter repository) declares itself read-only. */
|
|
58
57
|
declare function isReadOnlyRepo(repo: unknown): boolean;
|
|
59
|
-
//#endregion
|
|
60
58
|
export { ReadOnlyRepoOptions, ReadOnlyRepositoryError, asReadOnlyRepo, isReadOnlyRepo };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/repository/read-only.ts
|
|
2
2
|
/**
|
|
3
3
|
* Methods that only READ. Everything else callable is refused — a novel
|
|
4
4
|
* kit-contributed method is sealed until it is listed here deliberately.
|
|
@@ -76,5 +76,4 @@ function isReadOnlyRepo(repo) {
|
|
|
76
76
|
if (!repo || typeof repo !== "object") return false;
|
|
77
77
|
return repo.capabilities?.readOnly === true;
|
|
78
78
|
}
|
|
79
|
-
//#endregion
|
|
80
79
|
export { ReadOnlyRepositoryError, asReadOnlyRepo, isReadOnlyRepo };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/repository/resilience.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Resilience primitives — the single retry/abort contract every kit and
|
|
4
3
|
* every chunked orchestrator (purge, batch imports, outbox relays) uses.
|
|
@@ -70,5 +69,4 @@ declare function withRetry<T>(fn: () => Promise<T>, policy: RetryPolicy | undefi
|
|
|
70
69
|
* round-trip instead of running to completion.
|
|
71
70
|
*/
|
|
72
71
|
declare function throwIfAborted(signal: AbortSignal | undefined): void;
|
|
73
|
-
//#endregion
|
|
74
72
|
export { RetryPolicy, isTransientError, throwIfAborted, withRetry };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/repository/resilience.ts
|
|
2
2
|
/**
|
|
3
3
|
* Resilience primitives — the single retry/abort contract every kit and
|
|
4
4
|
* every chunked orchestrator (purge, batch imports, outbox relays) uses.
|
|
@@ -122,5 +122,4 @@ async function withRetry(fn, policy, signal) {
|
|
|
122
122
|
function throwIfAborted(signal) {
|
|
123
123
|
signal?.throwIfAborted();
|
|
124
124
|
}
|
|
125
|
-
//#endregion
|
|
126
125
|
export { isTransientError, throwIfAborted, withRetry };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { StandardRepo, TransactionHandle } from "./types.mjs";
|
|
2
2
|
import { IsTransientConflictFn } from "../errors/conflict.mjs";
|
|
3
|
-
//#region src/repository/retrying-transaction.d.ts
|
|
4
3
|
interface RetryingTransactionOptions {
|
|
5
4
|
/** Max attempts including the first. Default 5. */
|
|
6
5
|
maxAttempts?: number;
|
|
@@ -44,5 +43,4 @@ interface RetryingTransactionOptions {
|
|
|
44
43
|
* closed on an unconfirmed deployment).
|
|
45
44
|
*/
|
|
46
45
|
declare function retryingTransaction<TDoc, T>(repo: StandardRepo<TDoc>, fn: (txRepo: StandardRepo<TDoc>, uow?: TransactionHandle) => Promise<T>, options?: RetryingTransactionOptions): Promise<T>;
|
|
47
|
-
//#endregion
|
|
48
46
|
export { RetryingTransactionOptions, retryingTransaction };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { neverTransient } from "../errors/conflict.mjs";
|
|
2
2
|
import { withRetry } from "./resilience.mjs";
|
|
3
|
-
|
|
3
|
+
// src/repository/retrying-transaction.ts
|
|
4
4
|
/**
|
|
5
5
|
* Run `fn` inside `repo.withTransaction`, re-running on transient conflicts.
|
|
6
6
|
*
|
|
@@ -31,5 +31,4 @@ async function retryingTransaction(repo, fn, options = {}) {
|
|
|
31
31
|
}
|
|
32
32
|
}, options.signal);
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
34
|
export { retryingTransaction };
|
|
@@ -7,7 +7,6 @@ import { ArchiveOptions, ArchiveResult, ArchiveSink } from "./archive.mjs";
|
|
|
7
7
|
import { CacheOptions } from "../cache/options.mjs";
|
|
8
8
|
import { RepoCapabilities } from "./capabilities.mjs";
|
|
9
9
|
import { BulkUpsertOptions, BulkUpsertResult } from "./bulk-upsert.mjs";
|
|
10
|
-
//#region src/repository/types.d.ts
|
|
11
10
|
/**
|
|
12
11
|
* Accepted filter input across every repository method. A repository
|
|
13
12
|
* call can pass either a plain record (`{ status: 'active' }`) or a
|
|
@@ -2008,5 +2007,4 @@ interface CursorOptions {
|
|
|
2008
2007
|
sort?: Record<string, 1 | -1>;
|
|
2009
2008
|
[key: string]: unknown;
|
|
2010
2009
|
}
|
|
2011
|
-
//#endregion
|
|
2012
2010
|
export { AggCacheOptions, AggDateBucket, AggDateBucketInterval, AggDateBucketUnit, AggExecutionHints, AggMeasure, AggPaginationRequest, AggRequest, AggResult, AggRow, AggTopN, AggTopNTies, BulkCreateResult, BulkWriteOperation, BulkWriteResult, ChangeEvent, ClaimTransition, ClaimVersionTransition, CursorOptions, DeleteManyResult, DeleteOptions, DeleteResult, FilterInput, FindAllOptions, FindOneAndUpdateOptions, InferDoc, KeysetAggPaginationResult, MinimalRepo, PaginationParams, QueryOptions, RepositorySession, StandardRepo, TenantPurgeOptions, TenantPurgeProgress, TenantPurgeResult, TenantPurgeStrategy, TransactionHandle, TransitionArgs, TransitionMachine, UpdateManyResult, WatchOptions, WriteOptions };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { JsonSchema, SchemaBuilderOptions, ValidationResult } from "./types.mjs";
|
|
2
|
-
//#region src/schema/field-rules.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Collect the set of fields that must NOT appear in a generated schema.
|
|
5
4
|
*
|
|
@@ -108,5 +107,4 @@ declare function mergeFieldRuleConstraints(schemas: Record<string, unknown> | nu
|
|
|
108
107
|
* widening logic.
|
|
109
108
|
*/
|
|
110
109
|
declare function applyNullable(prop: Record<string, unknown>): void;
|
|
111
|
-
//#endregion
|
|
112
110
|
export { applyFieldRules, applyNullable, collectFieldsToOmit, getImmutableFields, getSystemManagedFields, isFieldUpdateAllowed, mergeFieldRuleConstraints, validateUpdateBody };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schema/field-rules.ts
|
|
2
2
|
/**
|
|
3
3
|
* Collect the set of fields that must NOT appear in a generated schema.
|
|
4
4
|
*
|
|
@@ -260,5 +260,4 @@ function widenEnumToIncludeNull(prop) {
|
|
|
260
260
|
if (prop["enum"].includes(null)) return;
|
|
261
261
|
prop["enum"] = [...prop["enum"], null];
|
|
262
262
|
}
|
|
263
|
-
//#endregion
|
|
264
263
|
export { applyFieldRules, applyNullable, collectFieldsToOmit, getImmutableFields, getSystemManagedFields, isFieldUpdateAllowed, mergeFieldRuleConstraints, validateUpdateBody };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CrudSchemas, SchemaBuilderOptions } from "./types.mjs";
|
|
2
|
-
//#region src/schema/generator.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Resource-level context threaded into the generator at boot. Lets the
|
|
5
4
|
* generator shape output to per-resource config (idField pattern,
|
|
@@ -67,5 +66,4 @@ type SchemaGenerator<TModel = unknown> = (model: TModel, options?: SchemaBuilder
|
|
|
67
66
|
* accept either a generator or a config-bag.
|
|
68
67
|
*/
|
|
69
68
|
declare function isSchemaGenerator(value: unknown): value is SchemaGenerator;
|
|
70
|
-
//#endregion
|
|
71
69
|
export { SchemaGenerator, SchemaGeneratorContext, isSchemaGenerator };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schema/generator.ts
|
|
2
2
|
/**
|
|
3
3
|
* Runtime predicate — true when `value` matches the generator shape.
|
|
4
4
|
*
|
|
@@ -12,5 +12,4 @@
|
|
|
12
12
|
function isSchemaGenerator(value) {
|
|
13
13
|
return typeof value === "function" && value.length >= 1 && value.length <= 3;
|
|
14
14
|
}
|
|
15
|
-
//#endregion
|
|
16
15
|
export { isSchemaGenerator };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/schema/standard-schema.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Standard Schema integration — the validator-agnostic validation slot.
|
|
4
3
|
*
|
|
@@ -85,5 +84,4 @@ declare namespace StandardSchemaV1 {
|
|
|
85
84
|
* shape every kit's own validation errors serialize to.
|
|
86
85
|
*/
|
|
87
86
|
declare function validateStandardSchema<TSchema extends StandardSchemaV1>(schema: TSchema, data: unknown): Promise<StandardSchemaV1.InferOutput<TSchema>>;
|
|
88
|
-
//#endregion
|
|
89
87
|
export { StandardSchemaV1, validateStandardSchema };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ERROR_CODES } from "../errors/codes.mjs";
|
|
2
|
-
|
|
2
|
+
// src/schema/standard-schema.ts
|
|
3
3
|
/**
|
|
4
4
|
* Standard Schema integration — the validator-agnostic validation slot.
|
|
5
5
|
*
|
|
@@ -55,5 +55,4 @@ async function validateStandardSchema(schema, data) {
|
|
|
55
55
|
}
|
|
56
56
|
return result.value;
|
|
57
57
|
}
|
|
58
|
-
//#endregion
|
|
59
58
|
export { validateStandardSchema };
|
package/dist/schema/types.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/schema/types.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Schema contract types — shared across every kit that emits JSON Schemas
|
|
4
3
|
* from its native schema (Mongoose models, Drizzle tables, Prisma schemas,
|
|
@@ -216,5 +215,4 @@ interface ValidationResult {
|
|
|
216
215
|
}>;
|
|
217
216
|
message?: string;
|
|
218
217
|
}
|
|
219
|
-
//#endregion
|
|
220
218
|
export { CrudSchemas, FieldRule, FieldRules, JsonSchema, SchemaBuilderOptions, ValidationResult };
|
package/dist/sync/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/sync/index.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* The sync contracts kits implement and a sync engine (`@classytic/arc-sync`) consumes:
|
|
4
3
|
*
|
|
@@ -162,5 +161,4 @@ interface CommandStreamStore<TTx extends CommandStreamTx = CommandStreamTx> {
|
|
|
162
161
|
* the feed entries appended with their `session` reach `changes` only on commit.
|
|
163
162
|
*/
|
|
164
163
|
declare function createMemoryCommandStreamStore(feed?: ChangeLogStore): CommandStreamStore;
|
|
165
|
-
//#endregion
|
|
166
164
|
export { ChangeEntry, ChangeLogAppendOptions, ChangeLogStore, ChangeOp, ChangesPage, ChangesSinceOptions, CommandAliasRecord, CommandOutcome, CommandStreamRecord, CommandStreamStore, CommandStreamTx, CommandVerdictRecord, CursorExpiredError, MemoryChangeLogStore, createMemoryCommandStreamStore };
|
package/dist/sync/index.mjs
CHANGED
|
Binary file
|
package/dist/tenant/index.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { DEFAULT_TENANT_CONFIG, assertNoLegacyTenantKeys, resolveTenantConfig, resolveTenantField };
|
|
1
|
+
export { DEFAULT_TENANT_CONFIG, assertNoLegacyTenantKeys, resolveTenantConfig, resolveTenantField } from "./resolve.mjs";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ResolvedTenantConfig, TenantConfig } from "./types.mjs";
|
|
2
|
-
//#region src/tenant/resolve.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Sensible defaults for a freshly-built package (field strategy).
|
|
5
4
|
*
|
|
@@ -59,5 +58,4 @@ declare function resolveTenantField(config?: TenantConfig | boolean): string | f
|
|
|
59
58
|
* the package carried a sibling field-type option.
|
|
60
59
|
*/
|
|
61
60
|
declare function assertNoLegacyTenantKeys(config: unknown, pkg: string, extra?: ReadonlyArray<readonly [string, string]>): void;
|
|
62
|
-
//#endregion
|
|
63
61
|
export { DEFAULT_TENANT_CONFIG, assertNoLegacyTenantKeys, resolveTenantConfig, resolveTenantField };
|
package/dist/tenant/resolve.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/tenant/resolve.ts
|
|
2
2
|
const DEFAULT_TENANT_CONFIG = {
|
|
3
3
|
strategy: "field",
|
|
4
4
|
enabled: true,
|
|
@@ -110,5 +110,4 @@ function assertNoLegacyTenantKeys(config, pkg, extra = []) {
|
|
|
110
110
|
throw new Error(`${pkg}: \`${key}\` was renamed to \`${became}\`. It is REFUSED rather than ignored because ignoring it disables tenancy SILENTLY — no tenant field, no tenant filter, and every read spanning all tenants while returning plausible numbers. Move the value to \`tenant\` (\`tenant: false\` for a single-tenant deployment).`);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
//#endregion
|
|
114
113
|
export { DEFAULT_TENANT_CONFIG, assertNoLegacyTenantKeys, resolveTenantConfig, resolveTenantField };
|
package/dist/tenant/types.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/tenant/types.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Tenant scope configuration — canonical static contract for the org.
|
|
4
3
|
*
|
|
@@ -138,5 +137,4 @@ type ResolvedTenantConfig = {
|
|
|
138
137
|
required: boolean;
|
|
139
138
|
resolve?: TenantConfig['resolve'] | undefined;
|
|
140
139
|
};
|
|
141
|
-
//#endregion
|
|
142
140
|
export { ResolvedTenantConfig, TenantConfig, TenantFieldType, TenantStrategy };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ChangeLogStore } from "../sync/index.mjs";
|
|
2
|
-
//#region src/testing/change-log-conformance.d.ts
|
|
3
2
|
interface ChangeLogConformanceHarness {
|
|
4
3
|
/** A store over an EMPTY backend, per scenario. */
|
|
5
4
|
createStore(): ChangeLogStore | Promise<ChangeLogStore>;
|
|
@@ -17,5 +16,4 @@ declare function changeLogStoreCases(harness: ChangeLogConformanceHarness): {
|
|
|
17
16
|
}[];
|
|
18
17
|
/** The contract as a vitest suite. */
|
|
19
18
|
declare function runChangeLogStoreConformance(harness: ChangeLogConformanceHarness): void;
|
|
20
|
-
//#endregion
|
|
21
19
|
export { ChangeLogConformanceHarness, changeLogStoreCases, runChangeLogStoreConformance };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it } from "vitest";
|
|
2
|
-
|
|
2
|
+
// src/testing/change-log-conformance.ts
|
|
3
3
|
/**
|
|
4
4
|
* `runChangeLogStoreConformance` — the contract every `ChangeLogStore` passes. A kit runs it against
|
|
5
5
|
* its real backend; passing it is what "implements the store" means.
|
|
@@ -200,5 +200,4 @@ function runChangeLogStoreConformance(harness) {
|
|
|
200
200
|
else it(c.name, c.run, 3e4);
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
|
-
//#endregion
|
|
204
203
|
export { changeLogStoreCases, runChangeLogStoreConformance };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CommandStreamStore } from "../sync/index.mjs";
|
|
2
|
-
//#region src/testing/command-stream-conformance.d.ts
|
|
3
2
|
interface CommandStreamConformanceHarness {
|
|
4
3
|
/** A store over an EMPTY backend, per scenario. */
|
|
5
4
|
createStore(): CommandStreamStore | Promise<CommandStreamStore>;
|
|
@@ -11,5 +10,4 @@ declare function commandStreamStoreCases(harness: CommandStreamConformanceHarnes
|
|
|
11
10
|
}[];
|
|
12
11
|
/** The contract as a vitest suite. */
|
|
13
12
|
declare function runCommandStreamStoreConformance(harness: CommandStreamConformanceHarness): void;
|
|
14
|
-
//#endregion
|
|
15
13
|
export { CommandStreamConformanceHarness, commandStreamStoreCases, runCommandStreamStoreConformance };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it } from "vitest";
|
|
2
|
-
|
|
2
|
+
// src/testing/command-stream-conformance.ts
|
|
3
3
|
/**
|
|
4
4
|
* `runCommandStreamStoreConformance` — the contract every `CommandStreamStore` passes, run against
|
|
5
5
|
* its real backend. The serialisation case is the one that matters: a store whose transactions can
|
|
@@ -159,5 +159,4 @@ function runCommandStreamStoreConformance(harness) {
|
|
|
159
159
|
for (const c of commandStreamStoreCases(harness)) it(c.name, c.run, 6e4);
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
-
//#endregion
|
|
163
162
|
export { commandStreamStoreCases, runCommandStreamStoreConformance };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { ConformanceDoc, ConformanceHarness } from "./types.mjs";
|
|
2
|
-
//#region src/testing/conformance.d.ts
|
|
3
2
|
declare function runStandardRepoConformance<TDoc extends ConformanceDoc = ConformanceDoc>(harness: ConformanceHarness<TDoc>): void;
|
|
4
|
-
//#endregion
|
|
5
3
|
export { runStandardRepoConformance };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isVersionConflictError } from "../errors/conflict.mjs";
|
|
2
2
|
import { and, anyOf as in_, eq, gt, isNull, like, ne, or } from "../filter/builders.mjs";
|
|
3
3
|
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
4
|
-
|
|
4
|
+
// src/testing/conformance.ts
|
|
5
5
|
/**
|
|
6
6
|
* `runStandardRepoConformance` — the cross-kit contract suite.
|
|
7
7
|
*
|
|
@@ -1541,5 +1541,4 @@ function runStandardRepoConformance(harness) {
|
|
|
1541
1541
|
});
|
|
1542
1542
|
});
|
|
1543
1543
|
}
|
|
1544
|
-
//#endregion
|
|
1545
1544
|
export { runStandardRepoConformance };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { RepoCapabilities } from "../repository/capabilities.mjs";
|
|
2
2
|
import { AggRequest, AggResult } from "../repository/types.mjs";
|
|
3
3
|
import { BulkUpsertOptions, BulkUpsertResult } from "../repository/bulk-upsert.mjs";
|
|
4
|
-
//#region src/testing/data-access-conformance.d.ts
|
|
5
4
|
/** `getByIds(..., { preserveOrder: true })` reached through the kit's own signature. */
|
|
6
5
|
interface OrderedIdsFixture {
|
|
7
6
|
/** Insert one record per name; returns their ids in the same order. */
|
|
@@ -85,5 +84,4 @@ type DataAccessCapability = 'getByIdsOrdered' | 'scopedJoins' | 'bulkUpsert' | '
|
|
|
85
84
|
/** Whether a group runs, is skipped (capability not declared), or fails (declared, no fixture). */
|
|
86
85
|
declare function dataAccessGroupState(features: RepoCapabilities, capability: DataAccessCapability, fixture: unknown): 'run' | 'skip' | 'missing-fixture';
|
|
87
86
|
declare function runDataAccessConformance(harness: DataAccessConformanceHarness): void;
|
|
88
|
-
//#endregion
|
|
89
87
|
export { BulkUpsertFixture, DataAccessCapability, DataAccessConformanceHarness, OrderedIdsFixture, ReadModelFixture, ScopedJoinFixture, dataAccessGroupState, runDataAccessConformance };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
2
|
-
|
|
2
|
+
// src/testing/data-access-conformance.ts
|
|
3
3
|
/**
|
|
4
4
|
* Data-access conformance: behaviour groups a kit OPTS INTO through `RepoCapabilities`.
|
|
5
5
|
*
|
|
@@ -327,5 +327,4 @@ function runDataAccessConformance(harness) {
|
|
|
327
327
|
});
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
|
-
//#endregion
|
|
331
330
|
export { dataAccessGroupState, runDataAccessConformance };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IdempotencyClaimStore } from "../idempotency/index.mjs";
|
|
2
|
-
//#region src/testing/idempotency-conformance.d.ts
|
|
3
2
|
interface IdempotencyConformanceHarness {
|
|
4
3
|
/** A store over an EMPTY backend, per scenario. */
|
|
5
4
|
createStore(): IdempotencyClaimStore | Promise<IdempotencyClaimStore>;
|
|
@@ -11,5 +10,4 @@ declare function idempotencyStoreCases(harness: IdempotencyConformanceHarness):
|
|
|
11
10
|
}[];
|
|
12
11
|
/** Register every contract case as a vitest test against `harness.createStore()`. */
|
|
13
12
|
declare function runIdempotencyStoreConformance(harness: IdempotencyConformanceHarness): void;
|
|
14
|
-
//#endregion
|
|
15
13
|
export { IdempotencyConformanceHarness, idempotencyStoreCases, runIdempotencyStoreConformance };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { completeClaim, decideClaim, identityKey, runIdempotent } from "../idempotency/index.mjs";
|
|
2
2
|
import { describe, it } from "vitest";
|
|
3
|
-
|
|
3
|
+
// src/testing/idempotency-conformance.ts
|
|
4
4
|
/**
|
|
5
5
|
* `runIdempotencyStoreConformance` — the contract every `IdempotencyClaimStore` passes.
|
|
6
6
|
* Mirrors `runLockAdapterConformance`: a kit runs it against its real backend, and passing it
|
|
@@ -311,5 +311,4 @@ function runIdempotencyStoreConformance(harness) {
|
|
|
311
311
|
for (const c of idempotencyStoreCases(harness)) it(c.name, c.run);
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
//#endregion
|
|
315
314
|
export { idempotencyStoreCases, runIdempotencyStoreConformance };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LockAdapter } from "../lock/index.mjs";
|
|
2
|
-
//#region src/testing/lock-conformance.d.ts
|
|
3
2
|
interface LockConformanceHarness {
|
|
4
3
|
/**
|
|
5
4
|
* Construct a fresh adapter for each describe block. May be async
|
|
@@ -20,5 +19,4 @@ interface LockConformanceHarness {
|
|
|
20
19
|
beforeEach?(adapter: LockAdapter): void | Promise<void>;
|
|
21
20
|
}
|
|
22
21
|
declare function runLockAdapterConformance(harness: LockConformanceHarness): void;
|
|
23
|
-
//#endregion
|
|
24
22
|
export { LockConformanceHarness, runLockAdapterConformance };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { beforeEach, describe, expect, it } from "vitest";
|
|
2
|
-
|
|
2
|
+
// src/testing/lock-conformance.ts
|
|
3
3
|
/**
|
|
4
4
|
* `runLockAdapterConformance` — cross-kit lock-adapter contract suite.
|
|
5
5
|
*
|
|
@@ -168,5 +168,4 @@ function runLockAdapterConformance(harness) {
|
|
|
168
168
|
function sleep(ms) {
|
|
169
169
|
return new Promise((r) => setTimeout(r, ms));
|
|
170
170
|
}
|
|
171
|
-
//#endregion
|
|
172
171
|
export { runLockAdapterConformance };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RepoCapabilities } from "../repository/capabilities.mjs";
|
|
2
2
|
import { KeysetSource } from "../pagination/merge-keyset.mjs";
|
|
3
|
-
//#region src/testing/merge-keyset-conformance.d.ts
|
|
4
3
|
interface MergeKeysetFixture {
|
|
5
4
|
/** Insert into source 0 or 1; `k` is a small integer sort key (ties expected), `label` unique. */
|
|
6
5
|
insert(source: 0 | 1, rows: ReadonlyArray<{
|
|
@@ -22,5 +21,4 @@ interface MergeKeysetHarness {
|
|
|
22
21
|
numRuns?: number;
|
|
23
22
|
}
|
|
24
23
|
declare function runMergeKeysetConformance(harness: MergeKeysetHarness): void;
|
|
25
|
-
//#endregion
|
|
26
24
|
export { MergeKeysetFixture, MergeKeysetHarness, runMergeKeysetConformance };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mergeKeysetPages } from "../pagination/merge-keyset.mjs";
|
|
2
2
|
import { describe, expect, it } from "vitest";
|
|
3
3
|
import fc from "fast-check";
|
|
4
|
-
|
|
4
|
+
// src/testing/merge-keyset-conformance.ts
|
|
5
5
|
/**
|
|
6
6
|
* `mergeKeysetPages` over a kit's real sources (fast-check), gated by
|
|
7
7
|
* `RepoCapabilities.mergeKeyset`: two sources ordered by the same total order (descending key),
|
|
@@ -81,5 +81,4 @@ function runMergeKeysetConformance(harness) {
|
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
//#endregion
|
|
85
84
|
export { runMergeKeysetConformance };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { RepoCapabilities } from "../repository/capabilities.mjs";
|
|
2
|
-
//#region src/testing/pagination-property-conformance.d.ts
|
|
3
2
|
interface PropertyRow {
|
|
4
3
|
id: string;
|
|
5
4
|
k: number | null;
|
|
@@ -40,5 +39,4 @@ interface PaginationPropertyHarness {
|
|
|
40
39
|
numRuns?: number;
|
|
41
40
|
}
|
|
42
41
|
declare function runPaginationPropertyConformance(harness: PaginationPropertyHarness): void;
|
|
43
|
-
//#endregion
|
|
44
42
|
export { PaginationPropertyFixture, PaginationPropertyHarness, PropertyRow, runPaginationPropertyConformance };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import fc from "fast-check";
|
|
3
|
-
|
|
3
|
+
// src/testing/pagination-property-conformance.ts
|
|
4
4
|
/**
|
|
5
5
|
* Pagination properties (fast-check), gated by `RepoCapabilities.paginationProperties`.
|
|
6
6
|
*
|
|
@@ -156,5 +156,4 @@ function runPaginationPropertyConformance(harness) {
|
|
|
156
156
|
});
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
|
-
//#endregion
|
|
160
159
|
export { runPaginationPropertyConformance };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TenantPurgeOptions, TenantPurgeResult, TenantPurgeStrategy } from "../repository/types.mjs";
|
|
2
|
-
//#region src/testing/purge-conformance.d.ts
|
|
3
2
|
/** Everything the shared scenarios need from a kit. */
|
|
4
3
|
interface PurgeConformanceContext {
|
|
5
4
|
/**
|
|
@@ -29,5 +28,4 @@ interface PurgeConformanceHarness {
|
|
|
29
28
|
setup(): Promise<PurgeConformanceContext>;
|
|
30
29
|
}
|
|
31
30
|
declare function runPurgeConformance(harness: PurgeConformanceHarness): void;
|
|
32
|
-
//#endregion
|
|
33
31
|
export { PurgeConformanceContext, PurgeConformanceHarness, runPurgeConformance };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { beforeEach, describe, expect, it } from "vitest";
|
|
2
|
-
|
|
2
|
+
// src/testing/purge-conformance.ts
|
|
3
3
|
/**
|
|
4
4
|
* `runPurgeConformance` — cross-kit chunked-purge contract suite.
|
|
5
5
|
*
|
|
@@ -155,5 +155,4 @@ function runPurgeConformance(harness) {
|
|
|
155
155
|
});
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
-
//#endregion
|
|
159
158
|
export { runPurgeConformance };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/testing/query-grammar-conformance.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* `runQueryGrammarConformance` — every list-query parser reads a URL the same way.
|
|
4
3
|
*
|
|
@@ -56,5 +55,4 @@ interface QueryGrammarConformanceOptions {
|
|
|
56
55
|
readonly unsupportedOperators?: readonly string[];
|
|
57
56
|
}
|
|
58
57
|
declare function runQueryGrammarConformance(name: string, harness: QueryGrammarHarness, conformance?: QueryGrammarConformanceOptions): void;
|
|
59
|
-
//#endregion
|
|
60
58
|
export { QUERY_GRAMMAR_DOCS, QUERY_GRAMMAR_FILTER_CASES, QUERY_GRAMMAR_PAGING_CASES, QUERY_GRAMMAR_REFUSED, QueryGrammarCaseOptions, QueryGrammarConformanceOptions, QueryGrammarHarness, QueryGrammarParsed, runQueryGrammarConformance };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
|
|
2
|
+
// src/testing/query-grammar-conformance.ts
|
|
3
3
|
/**
|
|
4
4
|
* `runQueryGrammarConformance` — every list-query parser reads a URL the same way.
|
|
5
5
|
*
|
|
@@ -376,5 +376,4 @@ function runQueryGrammarConformance(name, harness, conformance = {}) {
|
|
|
376
376
|
});
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
|
-
//#endregion
|
|
380
379
|
export { QUERY_GRAMMAR_DOCS, QUERY_GRAMMAR_FILTER_CASES, QUERY_GRAMMAR_PAGING_CASES, QUERY_GRAMMAR_REFUSED, runQueryGrammarConformance };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RepoCapabilities } from "../repository/capabilities.mjs";
|
|
2
2
|
import { ReadModelFixture } from "./data-access-conformance.mjs";
|
|
3
|
-
//#region src/testing/read-model-property-conformance.d.ts
|
|
4
3
|
interface ReadModelPropertyHarness {
|
|
5
4
|
name: string;
|
|
6
5
|
features: RepoCapabilities;
|
|
@@ -9,5 +8,4 @@ interface ReadModelPropertyHarness {
|
|
|
9
8
|
numRuns?: number;
|
|
10
9
|
}
|
|
11
10
|
declare function runReadModelPropertyConformance(harness: ReadModelPropertyHarness): void;
|
|
12
|
-
//#endregion
|
|
13
11
|
export { ReadModelPropertyHarness, runReadModelPropertyConformance };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import fc from "fast-check";
|
|
3
|
-
|
|
3
|
+
// src/testing/read-model-property-conformance.ts
|
|
4
4
|
/**
|
|
5
5
|
* Read-model properties (fast-check), gated by `RepoCapabilities.readModel`.
|
|
6
6
|
*
|
|
@@ -70,5 +70,4 @@ function runReadModelPropertyConformance(harness) {
|
|
|
70
70
|
});
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
//#endregion
|
|
74
73
|
export { runReadModelPropertyConformance };
|
package/dist/testing/types.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AggregateOpsSupport, RepoCapabilities } from "../repository/capabilities.mjs";
|
|
2
2
|
import { MinimalRepo, StandardRepo } from "../repository/types.mjs";
|
|
3
|
-
//#region src/testing/types.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* The conformance scenarios operate on a minimal doc shape common to
|
|
6
5
|
* every backend:
|
|
@@ -123,5 +122,4 @@ interface ConformanceHarness<TDoc extends ConformanceDoc = ConformanceDoc> {
|
|
|
123
122
|
*/
|
|
124
123
|
makeDoc(overrides?: Partial<ConformanceDoc>): Partial<TDoc>;
|
|
125
124
|
}
|
|
126
|
-
//#endregion
|
|
127
125
|
export { type AggregateOpsSupport, ConformanceContext, ConformanceDoc, ConformanceFeatures, ConformanceHarness };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { UsageStore } from "../usage/index.mjs";
|
|
2
|
-
//#region src/testing/usage-conformance.d.ts
|
|
3
2
|
interface UsageConformanceHarness {
|
|
4
3
|
/**
|
|
5
4
|
* Construct the store under test. May be async (SQL migrations,
|
|
@@ -14,5 +13,4 @@ interface UsageConformanceHarness {
|
|
|
14
13
|
beforeEach?(store: UsageStore): void | Promise<void>;
|
|
15
14
|
}
|
|
16
15
|
declare function runUsageStoreContract(harness: UsageConformanceHarness): void;
|
|
17
|
-
//#endregion
|
|
18
16
|
export { UsageConformanceHarness, runUsageStoreContract };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { beforeEach, describe, expect, it } from "vitest";
|
|
2
|
-
|
|
2
|
+
// src/testing/usage-conformance.ts
|
|
3
3
|
/**
|
|
4
4
|
* `runUsageStoreContract` — cross-kit usage-store contract suite.
|
|
5
5
|
*
|
|
@@ -97,5 +97,4 @@ function runUsageStoreContract(harness) {
|
|
|
97
97
|
});
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
|
-
//#endregion
|
|
101
100
|
export { runUsageStoreContract };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { UpdateSpec } from "./types.mjs";
|
|
2
|
-
//#region src/update/builders.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Compose an `UpdateSpec` from the four primitive mutations.
|
|
5
4
|
*
|
|
@@ -47,5 +46,4 @@ declare function setOnInsertFields(fields: Record<string, unknown>): UpdateSpec;
|
|
|
47
46
|
* always a caller bug.
|
|
48
47
|
*/
|
|
49
48
|
declare function combineUpdates(...specs: readonly UpdateSpec[]): UpdateSpec;
|
|
50
|
-
//#endregion
|
|
51
49
|
export { combineUpdates, incFields, setFields, setOnInsertFields, unsetFields, update };
|
package/dist/update/builders.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/update/builders.ts
|
|
2
2
|
/**
|
|
3
3
|
* Compose an `UpdateSpec` from the four primitive mutations.
|
|
4
4
|
*
|
|
@@ -88,5 +88,4 @@ function stripUndefined(record) {
|
|
|
88
88
|
for (const [k, v] of Object.entries(record)) if (v !== void 0) out[k] = v;
|
|
89
89
|
return Object.keys(out).length > 0 ? Object.freeze(out) : void 0;
|
|
90
90
|
}
|
|
91
|
-
//#endregion
|
|
92
91
|
export { combineUpdates, incFields, setFields, setOnInsertFields, unsetFields, update };
|