@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,5 +1,4 @@
|
|
|
1
1
|
import { HttpError } from "./types.mjs";
|
|
2
|
-
//#region src/errors/create-error.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Create an error with an HTTP status code attached.
|
|
5
4
|
*
|
|
@@ -14,5 +13,4 @@ import { HttpError } from "./types.mjs";
|
|
|
14
13
|
declare function createError(status: number, message: string): HttpError;
|
|
15
14
|
/** Runtime predicate — true when `value` already carries an `HttpError` shape. */
|
|
16
15
|
declare function isHttpError(value: unknown): value is HttpError;
|
|
17
|
-
//#endregion
|
|
18
16
|
export { createError, isHttpError };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/errors/create-error.ts
|
|
2
2
|
/**
|
|
3
3
|
* Create an error with an HTTP status code attached.
|
|
4
4
|
*
|
|
@@ -19,5 +19,4 @@ function isHttpError(value) {
|
|
|
19
19
|
const status = value.status;
|
|
20
20
|
return typeof status === "number" && Number.isFinite(status);
|
|
21
21
|
}
|
|
22
|
-
//#endregion
|
|
23
22
|
export { createError, isHttpError };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DuplicateKeyMeta, HttpError } from "./types.mjs";
|
|
2
|
-
//#region src/errors/duplicate-key.d.ts
|
|
3
2
|
/** Predicate shape kits implement and repositories expose as `isDuplicateKeyError`. */
|
|
4
3
|
type IsDuplicateKeyErrorFn = (err: unknown) => boolean;
|
|
5
4
|
/**
|
|
@@ -33,5 +32,4 @@ interface ToDuplicateKeyHttpErrorOptions {
|
|
|
33
32
|
* only when `exposeValues: true`.
|
|
34
33
|
*/
|
|
35
34
|
declare function toDuplicateKeyHttpError(meta: DuplicateKeyMeta, options?: ToDuplicateKeyHttpErrorOptions): HttpError;
|
|
36
|
-
//#endregion
|
|
37
35
|
export { IsDuplicateKeyErrorFn, ToDuplicateKeyHttpErrorOptions, conservativeMongoIsDuplicateKey, toDuplicateKeyHttpError };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createError } from "./create-error.mjs";
|
|
2
|
-
|
|
2
|
+
// src/errors/duplicate-key.ts
|
|
3
3
|
/**
|
|
4
4
|
* Duplicate-key detection — driver-agnostic contract.
|
|
5
5
|
*
|
|
@@ -54,5 +54,4 @@ function toDuplicateKeyHttpError(meta, options = {}) {
|
|
|
54
54
|
};
|
|
55
55
|
return httpError;
|
|
56
56
|
}
|
|
57
|
-
//#endregion
|
|
58
57
|
export { conservativeMongoIsDuplicateKey, toDuplicateKeyHttpError };
|
package/dist/errors/schema.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/errors/schema.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Canonical JSON Schema constants for `ErrorContract` + `ErrorDetail`.
|
|
4
3
|
*
|
|
@@ -97,5 +96,4 @@ declare const errorContractSchema: {
|
|
|
97
96
|
};
|
|
98
97
|
readonly required: readonly ['code', 'message'];
|
|
99
98
|
};
|
|
100
|
-
//#endregion
|
|
101
99
|
export { errorContractSchema, errorDetailSchema };
|
package/dist/errors/schema.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/errors/schema.ts
|
|
2
2
|
/**
|
|
3
3
|
* Canonical JSON Schema constants for `ErrorContract` + `ErrorDetail`.
|
|
4
4
|
*
|
|
@@ -74,5 +74,4 @@ const errorContractSchema = {
|
|
|
74
74
|
},
|
|
75
75
|
required: ["code", "message"]
|
|
76
76
|
};
|
|
77
|
-
//#endregion
|
|
78
77
|
export { errorContractSchema, errorDetailSchema };
|
package/dist/errors/types.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/errors/types.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* HTTP-shaped error contracts used across every driver kit, integrator,
|
|
4
3
|
* and HTTP-emitting service in the org.
|
|
@@ -124,5 +123,4 @@ interface ErrorDetail {
|
|
|
124
123
|
message: string;
|
|
125
124
|
meta?: Readonly<Record<string, unknown>>;
|
|
126
125
|
}
|
|
127
|
-
//#endregion
|
|
128
126
|
export { DuplicateKeyMeta, ErrorContract, ErrorDetail, HttpError, ValidationErrorMeta };
|
package/dist/events/emit.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EventMeta, RepositoryEventPublisher } from "./types.mjs";
|
|
2
2
|
import { RepositoryBase } from "../repository/base.mjs";
|
|
3
|
-
//#region src/events/emit.d.ts
|
|
4
3
|
/** Construction-time event wiring. */
|
|
5
4
|
interface RepositoryEventsOptions {
|
|
6
5
|
/** Any arc / primitives-compatible transport. Only `publish` is consumed. */
|
|
@@ -17,5 +16,4 @@ interface RepositoryEventsOptions {
|
|
|
17
16
|
}
|
|
18
17
|
/** Install the after-hooks. Called by `RepositoryBase`; not host-facing. */
|
|
19
18
|
declare function registerRepositoryEvents(repo: RepositoryBase, options: RepositoryEventsOptions): void;
|
|
20
|
-
//#endregion
|
|
21
19
|
export { RepositoryEventsOptions, registerRepositoryEvents };
|
package/dist/events/emit.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HOOK_PRIORITY } from "../hooks/priority.mjs";
|
|
2
|
-
|
|
2
|
+
// src/events/emit.ts
|
|
3
3
|
const CREATED_OPS = ["create"];
|
|
4
4
|
const UPDATED_OPS = [
|
|
5
5
|
"update",
|
|
@@ -101,5 +101,4 @@ function registerRepositoryEvents(repo, options) {
|
|
|
101
101
|
await publish(buildEvent(verb, result, context, void 0));
|
|
102
102
|
}, observe);
|
|
103
103
|
}
|
|
104
|
-
//#endregion
|
|
105
104
|
export { registerRepositoryEvents };
|
package/dist/events/index.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { registerRepositoryEvents };
|
|
1
|
+
export { registerRepositoryEvents } from "./emit.mjs";
|
package/dist/events/types.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/events/types.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Domain-event types — structural mirror of the org-wide event contract.
|
|
4
3
|
*
|
|
@@ -69,5 +68,4 @@ interface RepositoryEventPublisher {
|
|
|
69
68
|
/** Batch publish (optional). Used for `createMany` when available. */
|
|
70
69
|
publishMany?(events: readonly DomainEvent[]): Promise<PublishManyResult>;
|
|
71
70
|
}
|
|
72
|
-
//#endregion
|
|
73
71
|
export { DomainEvent, EventMeta, PublishManyResult, RepositoryEventPublisher };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Filter, FilterEq, FilterExists, FilterFalse, FilterGt, FilterGte, FilterIn, FilterLike, FilterLt, FilterLte, FilterNe, FilterNin, FilterRaw, FilterRegex, FilterTrue } from "./types.mjs";
|
|
2
|
-
//#region src/filter/builders.d.ts
|
|
3
2
|
declare const eq: (field: string, value: unknown) => FilterEq;
|
|
4
3
|
declare const ne: (field: string, value: unknown) => FilterNe;
|
|
5
4
|
declare const gt: (field: string, value: unknown) => FilterGt;
|
|
@@ -55,5 +54,4 @@ declare function isNotNull(field: string): FilterExists;
|
|
|
55
54
|
* predicates used in client-side filtering don't rely on `raw`.
|
|
56
55
|
*/
|
|
57
56
|
declare function raw(sql: string, params?: readonly unknown[]): FilterRaw;
|
|
58
|
-
//#endregion
|
|
59
57
|
export { FALSE, type FilterRaw, TRUE, and, in_ as anyOf, in_, between, contains, endsWith, eq, exists, gt, gte, iEq, not as invert, not, isNotNull, isNull, like, lt, lte, ne, nin, nin as noneOf, or, raw, regex, startsWith };
|
package/dist/filter/builders.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/filter/builders.ts
|
|
2
2
|
const eq = (field, value) => Object.freeze({
|
|
3
3
|
op: "eq",
|
|
4
4
|
field,
|
|
@@ -168,5 +168,4 @@ function raw(sql, params = []) {
|
|
|
168
168
|
function escapeLikePattern(value) {
|
|
169
169
|
return value.replace(/[\\%_]/g, (c) => `\\${c}`);
|
|
170
170
|
}
|
|
171
|
-
//#endregion
|
|
172
171
|
export { FALSE, TRUE, and, in_ as anyOf, in_, between, contains, endsWith, eq, exists, gt, gte, iEq, not as invert, not, isNotNull, isNull, like, lt, lte, ne, nin, nin as noneOf, or, raw, regex, startsWith };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/filter/coerce-dates.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* ISO-date coercion for record-shape filters — the canonical helper every
|
|
4
3
|
* kit shares.
|
|
@@ -83,5 +82,4 @@ interface CoerceFilterDatesOptions {
|
|
|
83
82
|
isDateField?: (field: string) => boolean;
|
|
84
83
|
}
|
|
85
84
|
declare function coerceFilterDates(filter: Record<string, unknown>, options?: CoerceFilterDatesOptions): Record<string, unknown>;
|
|
86
|
-
//#endregion
|
|
87
85
|
export { CoerceFilterDatesOptions, ISO_DATE_PATTERN, coerceFilterDates, tryCoerceIsoDate };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/filter/coerce-dates.ts
|
|
2
2
|
/**
|
|
3
3
|
* ISO-date coercion for record-shape filters — the canonical helper every
|
|
4
4
|
* kit shares.
|
|
@@ -110,5 +110,4 @@ function coerceFilterDates(filter, options) {
|
|
|
110
110
|
}
|
|
111
111
|
return out;
|
|
112
112
|
}
|
|
113
|
-
//#endregion
|
|
114
113
|
export { ISO_DATE_PATTERN, coerceFilterDates, tryCoerceIsoDate };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Filter } from "./types.mjs";
|
|
2
|
-
//#region src/filter/from-record.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Convert a plain record (Mongo-style query object) into a Filter IR
|
|
5
4
|
* tree. Multiple top-level keys AND together. Empty record → `TRUE`.
|
|
@@ -8,5 +7,4 @@ import { Filter } from "./types.mjs";
|
|
|
8
7
|
* unchanged so callers can mix-and-match without branching.
|
|
9
8
|
*/
|
|
10
9
|
declare function recordToFilter(input: Filter | Record<string, unknown>): Filter;
|
|
11
|
-
//#endregion
|
|
12
10
|
export { recordToFilter };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TRUE, and, anyOf as in_, contains, endsWith, eq, gt, gte, isNotNull, isNull, like, lt, lte, ne, nin, startsWith } from "./builders.mjs";
|
|
2
|
-
|
|
2
|
+
// src/filter/from-record.ts
|
|
3
3
|
/**
|
|
4
4
|
* Plain-record → Filter IR conversion — the canonical normalizer every
|
|
5
5
|
* kit shares (promoted from per-kit copies in repo-core 0.6.0).
|
|
@@ -129,5 +129,4 @@ function recordToFilter(input) {
|
|
|
129
129
|
if (leaves.length === 1) return leaves[0];
|
|
130
130
|
return and(...leaves);
|
|
131
131
|
}
|
|
132
|
-
//#endregion
|
|
133
132
|
export { recordToFilter };
|
package/dist/filter/guard.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Filter } from "./types.mjs";
|
|
2
|
-
//#region src/filter/guard.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* True when `value` is a Filter IR node.
|
|
5
4
|
*
|
|
@@ -8,5 +7,4 @@ import { Filter } from "./types.mjs";
|
|
|
8
7
|
* values is an array) is left to the compiler — this is the fast-path gate.
|
|
9
8
|
*/
|
|
10
9
|
declare function isFilter(value: unknown): value is Filter;
|
|
11
|
-
//#endregion
|
|
12
10
|
export { isFilter };
|
package/dist/filter/guard.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/filter/guard.ts
|
|
2
2
|
const FILTER_OPS = /* @__PURE__ */ new Set([
|
|
3
3
|
"eq",
|
|
4
4
|
"ne",
|
|
@@ -30,5 +30,4 @@ function isFilter(value) {
|
|
|
30
30
|
const op = value.op;
|
|
31
31
|
return typeof op === "string" && FILTER_OPS.has(op);
|
|
32
32
|
}
|
|
33
|
-
//#endregion
|
|
34
33
|
export { isFilter };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Filter } from "./types.mjs";
|
|
2
|
-
//#region src/filter/match-record.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Convert an arc Mongo-record `_policyFilters` object into Filter IR.
|
|
5
4
|
* `{}` → `TRUE`. Throws on unsupported top-level operators.
|
|
@@ -15,5 +14,4 @@ declare function policyRecordToFilter(record: Record<string, unknown>): Filter;
|
|
|
15
14
|
* @param filters Arc's `_policyFilters` in Mongo record syntax.
|
|
16
15
|
*/
|
|
17
16
|
declare function matchesRecordFilter(item: unknown, filters: Record<string, unknown>): boolean;
|
|
18
|
-
//#endregion
|
|
19
17
|
export { matchesRecordFilter, policyRecordToFilter };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FALSE, TRUE, and, anyOf as in_, eq, gt, gte, invert as not, isNotNull, isNull, lt, lte, nin, or, regex } from "./builders.mjs";
|
|
2
2
|
import { matchFilter } from "./match.mjs";
|
|
3
|
-
|
|
3
|
+
// src/filter/match-record.ts
|
|
4
4
|
/**
|
|
5
5
|
* Mongo-record `_policyFilters` → Filter IR conversion + in-memory match.
|
|
6
6
|
*
|
|
@@ -189,5 +189,4 @@ function matchesRecordFilter(item, filters) {
|
|
|
189
189
|
if (item === null || typeof item !== "object") return false;
|
|
190
190
|
return matchFilter(item, policyRecordToFilter(filters));
|
|
191
191
|
}
|
|
192
|
-
//#endregion
|
|
193
192
|
export { matchesRecordFilter, policyRecordToFilter };
|
package/dist/filter/match.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Filter } from "./types.mjs";
|
|
2
|
-
//#region src/filter/match.d.ts
|
|
3
2
|
/** Evaluate a filter against a single document. Returns true iff the doc matches. */
|
|
4
3
|
declare function matchFilter(doc: unknown, filter: Filter): boolean;
|
|
5
4
|
/**
|
|
@@ -7,5 +6,4 @@ declare function matchFilter(doc: unknown, filter: Filter): boolean;
|
|
|
7
6
|
* `array.filter(asPredicate(myFilter))`.
|
|
8
7
|
*/
|
|
9
8
|
declare function asPredicate<T>(filter: Filter): (doc: T) => boolean;
|
|
10
|
-
//#endregion
|
|
11
9
|
export { asPredicate, matchFilter };
|
package/dist/filter/match.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/filter/match.ts
|
|
2
2
|
/** Evaluate a filter against a single document. Returns true iff the doc matches. */
|
|
3
3
|
function matchFilter(doc, filter) {
|
|
4
4
|
switch (filter.op) {
|
|
@@ -210,5 +210,4 @@ function likeToRegex(pattern) {
|
|
|
210
210
|
}
|
|
211
211
|
return out;
|
|
212
212
|
}
|
|
213
|
-
//#endregion
|
|
214
213
|
export { asPredicate, matchFilter };
|
package/dist/filter/scope.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Filter } from "./types.mjs";
|
|
2
|
-
//#region src/filter/scope.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Inject a tenant-scope predicate into an existing filter.
|
|
5
4
|
*
|
|
@@ -26,5 +25,4 @@ declare function buildTenantScope(existing: Filter | Record<string, unknown> | u
|
|
|
26
25
|
declare function mergeScope(existing: Filter | Record<string, unknown> | undefined, scope: Filter): Filter;
|
|
27
26
|
/** Convenience: scope that matches everything — the identity under AND. */
|
|
28
27
|
declare const SCOPE_ANY: Filter;
|
|
29
|
-
//#endregion
|
|
30
28
|
export { SCOPE_ANY, buildTenantScope, mergeScope };
|
package/dist/filter/scope.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isFilter } from "./guard.mjs";
|
|
2
2
|
import { TRUE, and, eq } from "./builders.mjs";
|
|
3
|
-
|
|
3
|
+
// src/filter/scope.ts
|
|
4
4
|
/**
|
|
5
5
|
* Scope-injection helpers.
|
|
6
6
|
*
|
|
@@ -50,5 +50,4 @@ function mergeScope(existing, scope) {
|
|
|
50
50
|
}
|
|
51
51
|
/** Convenience: scope that matches everything — the identity under AND. */
|
|
52
52
|
const SCOPE_ANY = TRUE;
|
|
53
|
-
//#endregion
|
|
54
53
|
export { SCOPE_ANY, buildTenantScope, mergeScope };
|
package/dist/filter/types.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/filter/types.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Filter IR — driver-agnostic query AST.
|
|
4
3
|
*
|
|
@@ -139,5 +138,4 @@ interface FilterRaw {
|
|
|
139
138
|
type Filter = FilterEq | FilterNe | FilterGt | FilterGte | FilterLt | FilterLte | FilterIn | FilterNin | FilterLike | FilterRegex | FilterExists | FilterAnd | FilterOr | FilterNot | FilterTrue | FilterFalse | FilterRaw;
|
|
140
139
|
/** Narrow set of ops for pattern-matching exhaustiveness checks. */
|
|
141
140
|
type FilterOp = Filter['op'];
|
|
142
|
-
//#endregion
|
|
143
141
|
export { Filter, FilterAnd, FilterEq, FilterExists, FilterFalse, FilterGt, FilterGte, FilterIn, FilterLike, FilterLt, FilterLte, FilterNe, FilterNin, FilterNot, FilterOp, FilterOr, FilterRaw, FilterRegex, FilterTrue };
|
package/dist/filter/walk.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Filter } from "./types.mjs";
|
|
2
|
-
//#region src/filter/walk.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Depth-first visit of every node. Visitor returns `false` to stop descent
|
|
5
4
|
* into the current subtree (e.g. optimization prunes). Otherwise visits
|
|
@@ -19,5 +18,4 @@ declare function walkFilter(filter: Filter, visit: (node: Filter) => boolean | u
|
|
|
19
18
|
declare function mapFilter(filter: Filter, transform: (node: Filter) => Filter): Filter;
|
|
20
19
|
/** Collect every field name referenced in the tree. Useful for index hints, policy checks. */
|
|
21
20
|
declare function collectFields(filter: Filter): string[];
|
|
22
|
-
//#endregion
|
|
23
21
|
export { collectFields, mapFilter, walkFilter };
|
package/dist/filter/walk.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/filter/walk.ts
|
|
2
2
|
/**
|
|
3
3
|
* Depth-first visit of every node. Visitor returns `false` to stop descent
|
|
4
4
|
* into the current subtree (e.g. optimization prunes). Otherwise visits
|
|
@@ -73,5 +73,4 @@ function collectFields(filter) {
|
|
|
73
73
|
});
|
|
74
74
|
return [...seen];
|
|
75
75
|
}
|
|
76
|
-
//#endregion
|
|
77
76
|
export { collectFields, mapFilter, walkFilter };
|
package/dist/hash/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { stableStringify } from "../cache/stable-stringify.mjs";
|
|
2
|
-
//#region src/hash/index.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* SHA-256 hex digest of a value's canonical (key-order-independent) JSON form.
|
|
5
4
|
* Equivalent inputs → identical digest. `algorithm` may be any hash Node's
|
|
@@ -10,5 +9,4 @@ declare function contentHash(value: unknown, options?: {
|
|
|
10
9
|
algorithm?: string;
|
|
11
10
|
encoding?: 'hex' | 'base64' | 'base64url';
|
|
12
11
|
}): string;
|
|
13
|
-
//#endregion
|
|
14
12
|
export { contentHash, stableStringify };
|
package/dist/hash/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { stableStringify } from "../cache/stable-stringify.mjs";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
|
-
|
|
3
|
+
// src/hash/index.ts
|
|
4
4
|
/**
|
|
5
5
|
* Content-addressing — a stable cryptographic hash of any JSON-serializable value.
|
|
6
6
|
*
|
|
@@ -27,5 +27,4 @@ function contentHash(value, options = {}) {
|
|
|
27
27
|
const { algorithm = "sha256", encoding = "hex" } = options;
|
|
28
28
|
return createHash(algorithm).update(stableStringify(value)).digest(encoding);
|
|
29
29
|
}
|
|
30
|
-
//#endregion
|
|
31
30
|
export { contentHash, stableStringify };
|
package/dist/hooks/engine.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { HookListener, HookMode, PrioritizedHook } from "./types.mjs";
|
|
2
|
-
//#region src/hooks/engine.d.ts
|
|
3
2
|
/** The default priority assigned when a user omits one on `on(...)`. */
|
|
4
3
|
declare const DEFAULT_LISTENER_PRIORITY = 500;
|
|
5
4
|
declare class HookEngine {
|
|
@@ -43,5 +42,4 @@ declare class HookEngine {
|
|
|
43
42
|
*/
|
|
44
43
|
listeners(): Map<string, readonly PrioritizedHook[]>;
|
|
45
44
|
}
|
|
46
|
-
//#endregion
|
|
47
45
|
export { DEFAULT_LISTENER_PRIORITY, HookEngine };
|
package/dist/hooks/engine.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/engine.ts
|
|
2
2
|
/** The default priority assigned when a user omits one on `on(...)`. */
|
|
3
3
|
const DEFAULT_LISTENER_PRIORITY = 500;
|
|
4
4
|
var HookEngine = class {
|
|
@@ -97,5 +97,4 @@ var HookEngine = class {
|
|
|
97
97
|
return snapshot;
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
-
//#endregion
|
|
101
100
|
export { DEFAULT_LISTENER_PRIORITY, HookEngine };
|
package/dist/hooks/events.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/hooks/events.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Canonical repository-operation event names.
|
|
4
3
|
*
|
|
@@ -91,5 +90,4 @@ declare const HOOK_EVENTS: {
|
|
|
91
90
|
};
|
|
92
91
|
/** String-literal union of every canonical hook event name. */
|
|
93
92
|
type HookEventName = (typeof HOOK_EVENTS)[keyof typeof HOOK_EVENTS];
|
|
94
|
-
//#endregion
|
|
95
93
|
export { HOOK_EVENTS, HookEventName };
|
package/dist/hooks/events.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/events.ts
|
|
2
2
|
/**
|
|
3
3
|
* Canonical repository-operation event names.
|
|
4
4
|
*
|
|
@@ -89,5 +89,4 @@ const HOOK_EVENTS = {
|
|
|
89
89
|
AFTER_DISTINCT: "after:distinct",
|
|
90
90
|
ERROR_DISTINCT: "error:distinct"
|
|
91
91
|
};
|
|
92
|
-
//#endregion
|
|
93
92
|
export { HOOK_EVENTS };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/hooks/priority.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Hook priority constants for the repository lifecycle.
|
|
4
3
|
*
|
|
@@ -29,5 +28,4 @@ declare const HOOK_PRIORITY: {
|
|
|
29
28
|
};
|
|
30
29
|
/** The numeric type of any `HOOK_PRIORITY` value. */
|
|
31
30
|
type HookPriority = (typeof HOOK_PRIORITY)[keyof typeof HOOK_PRIORITY];
|
|
32
|
-
//#endregion
|
|
33
31
|
export { HOOK_PRIORITY, HookPriority };
|
package/dist/hooks/priority.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hooks/priority.ts
|
|
2
2
|
/**
|
|
3
3
|
* Hook priority constants for the repository lifecycle.
|
|
4
4
|
*
|
|
@@ -27,5 +27,4 @@ const HOOK_PRIORITY = {
|
|
|
27
27
|
/** Default priority for user-registered hooks with no explicit priority. */
|
|
28
28
|
DEFAULT: 500
|
|
29
29
|
};
|
|
30
|
-
//#endregion
|
|
31
30
|
export { HOOK_PRIORITY };
|
package/dist/hooks/types.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/hooks/types.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Hook system types.
|
|
4
3
|
*
|
|
@@ -33,5 +32,4 @@ interface PrioritizedHook {
|
|
|
33
32
|
}
|
|
34
33
|
/** Event phase discriminator for hook names. */
|
|
35
34
|
type EventPhase = 'before' | 'after' | 'error';
|
|
36
|
-
//#endregion
|
|
37
35
|
export { EventPhase, HookListener, HookMode, PrioritizedHook };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/idempotency/index.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Idempotency — the ONE contract for "run this command at most once per key".
|
|
4
3
|
*
|
|
@@ -458,5 +457,4 @@ declare function createMemoryIdempotencyStore(): IdempotencyClaimStore & {
|
|
|
458
457
|
/** Every stored claim — for assertions. */
|
|
459
458
|
readonly claims: () => IdempotencyClaim<unknown>[];
|
|
460
459
|
};
|
|
461
|
-
//#endregion
|
|
462
460
|
export { ClaimDecision, ClaimError, ClaimOutcome, ClaimRequest, ClaimResult, ClaimState, ClaimedDecision, DEFAULT_LEASE_MS, ExhaustedDecision, FailureDisposition, IdempotencyClaim, IdempotencyClaimStore, IdempotencyError, IdempotencyErrorCode, IdempotencyIdentity, IdempotencyStoreCallOptions, IdempotentAttempt, IdempotentReplayError, IdempotentRun, InFlightDecision, MAX_FINGERPRINT_DEPTH, ReplayedDecision, RunIdempotentOptions, completeClaim, createMemoryIdempotencyStore, decideClaim, fingerprintRequest, holdsLease, identityKey, isInFlight, isLeaseExpired, newLeaseToken, renewLease, runIdempotent, sameIdentity };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { contentHash } from "../hash/index.mjs";
|
|
2
|
-
|
|
2
|
+
// src/idempotency/index.ts
|
|
3
3
|
/**
|
|
4
4
|
* Idempotency — the ONE contract for "run this command at most once per key".
|
|
5
5
|
*
|
|
@@ -415,5 +415,4 @@ function createMemoryIdempotencyStore() {
|
|
|
415
415
|
claims: () => [...rows.values()]
|
|
416
416
|
};
|
|
417
417
|
}
|
|
418
|
-
//#endregion
|
|
419
418
|
export { DEFAULT_LEASE_MS, IdempotencyError, IdempotentReplayError, MAX_FINGERPRINT_DEPTH, completeClaim, createMemoryIdempotencyStore, decideClaim, fingerprintRequest, holdsLease, identityKey, isInFlight, isLeaseExpired, newLeaseToken, renewLease, runIdempotent, sameIdentity };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/loader/batch-loader.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Collapse many per-item reads issued in one operation into ONE round trip.
|
|
4
3
|
*
|
|
@@ -90,5 +89,4 @@ interface BatchLoader<K, V> {
|
|
|
90
89
|
};
|
|
91
90
|
}
|
|
92
91
|
declare function createBatchLoader<K, V>(options: BatchLoaderOptions<K, V>): BatchLoader<K, V>;
|
|
93
|
-
//#endregion
|
|
94
92
|
export { BatchLoader, BatchLoaderOptions, DEFAULT_MAX_BATCH_SIZE, createBatchLoader };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/loader/batch-loader.ts
|
|
2
2
|
/**
|
|
3
3
|
* Collapse many per-item reads issued in one operation into ONE round trip.
|
|
4
4
|
*
|
|
@@ -149,5 +149,4 @@ function createBatchLoader(options) {
|
|
|
149
149
|
stats
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
-
//#endregion
|
|
153
152
|
export { DEFAULT_MAX_BATCH_SIZE, createBatchLoader };
|
package/dist/loader/index.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { DEFAULT_MAX_BATCH_SIZE, createBatchLoader };
|
|
1
|
+
export { DEFAULT_MAX_BATCH_SIZE, createBatchLoader } from "./batch-loader.mjs";
|
package/dist/lock/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/lock/index.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Distributed lock contract for the @classytic ecosystem.
|
|
4
3
|
*
|
|
@@ -149,5 +148,4 @@ declare function getInstanceId(): string;
|
|
|
149
148
|
* simulate multiple replicas in one process. Pass `null` to reset.
|
|
150
149
|
*/
|
|
151
150
|
declare function setInstanceIdForTesting(id: string | null): void;
|
|
152
|
-
//#endregion
|
|
153
151
|
export { BaseLockAdapterOptions, LockAdapter, LockState, createMemoryLockAdapter, getInstanceId, setInstanceIdForTesting };
|
package/dist/lock/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __require } from "../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
|
-
|
|
3
|
+
// src/lock/index.ts
|
|
4
4
|
/**
|
|
5
5
|
* Distributed lock contract for the @classytic ecosystem.
|
|
6
6
|
*
|
|
@@ -165,5 +165,4 @@ function buildInstanceId() {
|
|
|
165
165
|
function setInstanceIdForTesting(id) {
|
|
166
166
|
cachedInstanceId = id;
|
|
167
167
|
}
|
|
168
|
-
//#endregion
|
|
169
168
|
export { createMemoryLockAdapter, getInstanceId, setInstanceIdForTesting };
|
package/dist/lookup/types.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Filter } from "../filter/types.mjs";
|
|
2
2
|
import { KeysetPaginationResultCore, OffsetPaginationResultCore } from "../pagination/types.mjs";
|
|
3
|
-
//#region src/lookup/types.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Single lookup join. Reads like a `LEFT JOIN from ON from.foreignField
|
|
6
5
|
* = this.localField`, with the joined payload landing on `as`.
|
|
@@ -165,5 +164,4 @@ type LookupRow<TBase = Record<string, unknown>, TExtra extends Record<string, un
|
|
|
165
164
|
* uniformly so callers don't branch on the kit.
|
|
166
165
|
*/
|
|
167
166
|
type LookupPopulateResult<TBase = Record<string, unknown>, TExtra extends Record<string, unknown> = Record<string, unknown>> = OffsetPaginationResultCore<LookupRow<TBase, TExtra>> | KeysetPaginationResultCore<LookupRow<TBase, TExtra>>;
|
|
168
|
-
//#endregion
|
|
169
167
|
export { LookupPopulateOptions, LookupPopulateResult, LookupRow, LookupSpec };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { CORE_OP_REGISTRY, describe, extendRegistry, listOperations, mutatingOperations, operationsByPolicyKey, readOperations };
|
|
1
|
+
export { CORE_OP_REGISTRY, describe, extendRegistry, listOperations, mutatingOperations, operationsByPolicyKey, readOperations } from "./registry.mjs";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CoreRepositoryOperation, OperationDescriptor, OperationRegistry, PolicyKey, RepositoryOperation } from "./types.mjs";
|
|
2
|
-
//#region src/operations/registry.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* The core registry. Driver kits merge their own descriptors on top of this
|
|
5
4
|
* via `extendRegistry`.
|
|
@@ -36,5 +35,4 @@ declare function operationsByPolicyKey<Op extends string>(registry: OperationReg
|
|
|
36
35
|
* kits can introduce operations without every plugin needing an update.
|
|
37
36
|
*/
|
|
38
37
|
declare function describe<Op extends string>(registry: OperationRegistry<Op>, op: RepositoryOperation): OperationDescriptor | undefined;
|
|
39
|
-
//#endregion
|
|
40
38
|
export { CORE_OP_REGISTRY, describe, extendRegistry, listOperations, mutatingOperations, operationsByPolicyKey, readOperations };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/operations/registry.ts
|
|
2
2
|
/**
|
|
3
3
|
* The core registry. Driver kits merge their own descriptors on top of this
|
|
4
4
|
* via `extendRegistry`.
|
|
@@ -136,5 +136,4 @@ function operationsByPolicyKey(registry, key) {
|
|
|
136
136
|
function describe(registry, op) {
|
|
137
137
|
return Object.hasOwn(registry, op) ? registry[op] : void 0;
|
|
138
138
|
}
|
|
139
|
-
//#endregion
|
|
140
139
|
export { CORE_OP_REGISTRY, describe, extendRegistry, listOperations, mutatingOperations, operationsByPolicyKey, readOperations };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/operations/types.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Operation-registry type definitions.
|
|
4
3
|
*
|
|
@@ -45,5 +44,4 @@ interface OperationDescriptor {
|
|
|
45
44
|
* additions (see `extendRegistry`).
|
|
46
45
|
*/
|
|
47
46
|
type OperationRegistry<Op extends string = RepositoryOperation> = Readonly<Record<Op, OperationDescriptor>>;
|
|
48
|
-
//#endregion
|
|
49
47
|
export { CoreRepositoryOperation, OperationDescriptor, OperationRegistry, PolicyKey, RepositoryOperation };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AnyPaginationResult, BareListResult, PaginatedResult } from "./types.mjs";
|
|
2
|
-
//#region src/pagination/canonical.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Type guard: is this value a paginated result envelope (vs a bare array
|
|
5
4
|
* or some other shape)?
|
|
@@ -30,5 +29,4 @@ declare function toCanonicalList<TDoc>(input: TDoc[]): BareListResult<TDoc>;
|
|
|
30
29
|
declare function toCanonicalList<TDoc>(input: readonly TDoc[]): BareListResult<TDoc>;
|
|
31
30
|
declare function toCanonicalList<TDoc, TExtra extends Record<string, unknown>>(input: AnyPaginationResult<TDoc, TExtra>): PaginatedResult<TDoc, TExtra>;
|
|
32
31
|
declare function toCanonicalList<TDoc>(input: readonly TDoc[] | AnyPaginationResult<TDoc>): PaginatedResult<TDoc>;
|
|
33
|
-
//#endregion
|
|
34
32
|
export { isPaginatedResult, toCanonicalList };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/pagination/canonical.ts
|
|
2
2
|
/**
|
|
3
3
|
* Type guard: is this value a paginated result envelope (vs a bare array
|
|
4
4
|
* or some other shape)?
|
|
@@ -22,5 +22,4 @@ function toCanonicalList(input) {
|
|
|
22
22
|
if (isPaginatedResult(input)) return { ...input };
|
|
23
23
|
return { data: [...input] };
|
|
24
24
|
}
|
|
25
|
-
//#endregion
|
|
26
25
|
export { isPaginatedResult, toCanonicalList };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DecodedCursor, SortSpec } from "./types.mjs";
|
|
2
|
-
//#region src/pagination/cursor.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Encode a document's sort values and id into a base64url cursor token.
|
|
5
4
|
*
|
|
@@ -39,5 +38,4 @@ declare function validateCursorSort(cursorSort: SortSpec, currentSort: SortSpec)
|
|
|
39
38
|
* pre-breaking-change deploy; reject so pagination restarts cleanly.
|
|
40
39
|
*/
|
|
41
40
|
declare function validateCursorVersion(cursorVersion: number, expectedVersion: number, minVersion?: number): void;
|
|
42
|
-
//#endregion
|
|
43
41
|
export { decodeCursor, encodeCursor, validateCursorSort, validateCursorVersion };
|