@classytic/repo-core 0.11.0 → 0.12.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 +20 -1
- package/dist/repository/index.d.mts +2 -2
- package/dist/repository/types.d.mts +62 -1
- package/package.json +176 -176
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,26 @@ All notable changes to `@classytic/repo-core` are documented here.
|
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
-
## [0.
|
|
7
|
+
## [0.12.0] - 2026-07-15
|
|
8
|
+
|
|
9
|
+
### Added — `StandardRepo.transition?()` contract (state-machine CAS with history)
|
|
10
|
+
|
|
11
|
+
- **`TransitionMachine`** — the canonical structural contract for the state
|
|
12
|
+
machine (`{ name, assertTransition }`). Primitives'
|
|
13
|
+
`defineStateMachine()` output and mongokit's local `TransitionMachine`
|
|
14
|
+
are structurally identical by design; nobody imports anybody (same
|
|
15
|
+
policy as `ClaimTransition`).
|
|
16
|
+
- **`TransitionArgs`** — `{ from, to, field?, set?, push?, where?, by?,
|
|
17
|
+
note?, history?, at? }`.
|
|
18
|
+
- **`StandardRepo.transition?(id, machine, args, options)`** — OPTIONAL
|
|
19
|
+
member declaring the state-machine-backed CAS transition mongokit 3.22
|
|
20
|
+
ships as a class primitive: legality pre-flight via the machine (which
|
|
21
|
+
throws the domain's typed error), CAS via `claim`, `$push`ed status
|
|
22
|
+
history, and accurate race-loss diagnosis (machine error from the row's
|
|
23
|
+
CURRENT state / 404 `TRANSITION_TARGET_MISSING` / 409
|
|
24
|
+
`TRANSITION_RACE_LOST`). Unlike `claim`/`claimVersion` it THROWS rather
|
|
25
|
+
than returning `null` — it owns the error liturgy domain packages used
|
|
26
|
+
to copy-paste. Promote to required once sqlitekit implements it.
|
|
8
27
|
|
|
9
28
|
### Added — `./usage` subpath (period-bucketed counter contract)
|
|
10
29
|
|
|
@@ -6,8 +6,8 @@ import { ArchiveOptions, ArchivePort, ArchiveProgress, ArchiveResult, ArchiveSin
|
|
|
6
6
|
import { PLUGIN_ORDER_CONSTRAINTS, Plugin, PluginFunction, PluginType, validatePluginOrder } from "./plugin-types.mjs";
|
|
7
7
|
import { RepositoryBase, RepositoryBaseOptions } from "./base.mjs";
|
|
8
8
|
import { AggregateOpsSupport, RepoCapabilities } from "./capabilities.mjs";
|
|
9
|
-
import { 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, UpdateManyResult, WatchOptions, WriteOptions } from "./types.mjs";
|
|
9
|
+
import { 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, TransitionArgs, TransitionMachine, UpdateManyResult, WatchOptions, WriteOptions } from "./types.mjs";
|
|
10
10
|
import { DistributionConfig, DistributionMissHandler, createDistributionGuard, filterReferencesKey } from "./distribution.mjs";
|
|
11
11
|
import { STANDARD_REPO_OPTION_KEYS, StandardRepoOptionKey } from "./options.mjs";
|
|
12
12
|
import { PurgePort, WritingPurgeStrategy, runChunkedPurge } from "./purge.mjs";
|
|
13
|
-
export { type AggCacheOptions, type AggDateBucket, type AggDateBucketInterval, type AggDateBucketUnit, type AggExecutionHints, type AggMeasure, type AggPaginationRequest, type AggRequest, type AggResult, type AggRow, type AggTopN, type AggTopNTies, type AggregateOpsSupport, type ArchiveOptions, type ArchivePort, type ArchiveProgress, type ArchiveResult, type ArchiveSink, type BulkCreateResult, type BulkWriteOperation, type BulkWriteResult, type ChangeEvent, type ClaimTransition, type ClaimVersionTransition, type CursorOptions, type DeleteManyResult, type DeleteOptions, type DeleteResult, type DistributionConfig, type DistributionMissHandler, type FilterInput, type FindAllOptions, type FindOneAndUpdateOptions, type InferDoc, type KeysetAggPaginationResult, type LookupPopulateOptions, type LookupPopulateResult, type LookupRow, type LookupSpec, type MinimalRepo, PLUGIN_ORDER_CONSTRAINTS, type PaginationParams, type Plugin, type PluginFunction, type PluginType, type PurgePort, type QueryOptions, type RepoCapabilities, RepositoryBase, type RepositoryBaseOptions, type RepositorySession, type RetryPolicy, STANDARD_REPO_OPTION_KEYS, type StandardRepo, type StandardRepoOptionKey, type TenantPurgeOptions, type TenantPurgeProgress, type TenantPurgeResult, type TenantPurgeStrategy, type UpdateInput, type UpdateManyResult, type WatchOptions, type WriteOptions, type WritingPurgeStrategy, createDistributionGuard, filterReferencesKey, nestDottedKeys, nestDottedKeysAll, runChunkedArchive, runChunkedPurge, throwIfAborted, validatePluginOrder, withRetry };
|
|
13
|
+
export { type AggCacheOptions, type AggDateBucket, type AggDateBucketInterval, type AggDateBucketUnit, type AggExecutionHints, type AggMeasure, type AggPaginationRequest, type AggRequest, type AggResult, type AggRow, type AggTopN, type AggTopNTies, type AggregateOpsSupport, type ArchiveOptions, type ArchivePort, type ArchiveProgress, type ArchiveResult, type ArchiveSink, type BulkCreateResult, type BulkWriteOperation, type BulkWriteResult, type ChangeEvent, type ClaimTransition, type ClaimVersionTransition, type CursorOptions, type DeleteManyResult, type DeleteOptions, type DeleteResult, type DistributionConfig, type DistributionMissHandler, type FilterInput, type FindAllOptions, type FindOneAndUpdateOptions, type InferDoc, type KeysetAggPaginationResult, type LookupPopulateOptions, type LookupPopulateResult, type LookupRow, type LookupSpec, type MinimalRepo, PLUGIN_ORDER_CONSTRAINTS, type PaginationParams, type Plugin, type PluginFunction, type PluginType, type PurgePort, type QueryOptions, type RepoCapabilities, RepositoryBase, type RepositoryBaseOptions, type RepositorySession, type RetryPolicy, STANDARD_REPO_OPTION_KEYS, type StandardRepo, type StandardRepoOptionKey, type TenantPurgeOptions, type TenantPurgeProgress, type TenantPurgeResult, type TenantPurgeStrategy, type TransitionArgs, type TransitionMachine, type UpdateInput, type UpdateManyResult, type WatchOptions, type WriteOptions, type WritingPurgeStrategy, createDistributionGuard, filterReferencesKey, nestDottedKeys, nestDottedKeysAll, runChunkedArchive, runChunkedPurge, throwIfAborted, validatePluginOrder, withRetry };
|
|
@@ -342,6 +342,46 @@ interface ClaimTransition {
|
|
|
342
342
|
*/
|
|
343
343
|
where?: Record<string, unknown>;
|
|
344
344
|
}
|
|
345
|
+
/**
|
|
346
|
+
* Structural contract for the state machine consumed by
|
|
347
|
+
* `StandardRepo.transition()` — the CANONICAL shape; mongokit's
|
|
348
|
+
* `TransitionMachine` and primitives' `StateMachine` (from
|
|
349
|
+
* `@classytic/primitives/state-machine`, whose `defineStateMachine()`
|
|
350
|
+
* satisfies it as-is) are structurally identical by design. Neither
|
|
351
|
+
* repo-core nor the kits import primitives — compatibility is
|
|
352
|
+
* structural, same policy as `ClaimTransition` above.
|
|
353
|
+
*
|
|
354
|
+
* `assertTransition` MUST throw (the domain's typed error, via the
|
|
355
|
+
* machine's own error factory) when `from → to` is illegal. Kits never
|
|
356
|
+
* invent their own transition-error vocabulary — the machine owns it.
|
|
357
|
+
*/
|
|
358
|
+
interface TransitionMachine {
|
|
359
|
+
/** Aggregate name — surfaces in race/missing error messages. */
|
|
360
|
+
readonly name: string;
|
|
361
|
+
assertTransition(entityId: string, from: string, to: string): void;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Args for `StandardRepo.transition()` — the state-machine-backed CAS
|
|
365
|
+
* with status history. See the method JSDoc for semantics.
|
|
366
|
+
*/
|
|
367
|
+
interface TransitionArgs {
|
|
368
|
+
from: string | readonly string[];
|
|
369
|
+
to: string;
|
|
370
|
+
/** State field (dotted paths allowed on kits that support them). Default `'status'`. */
|
|
371
|
+
field?: string;
|
|
372
|
+
/** Set-payload applied alongside the state write (field-shape). */
|
|
373
|
+
set?: Record<string, unknown>;
|
|
374
|
+
/** Kit-specific extra append entries merged beside the history append. */
|
|
375
|
+
push?: Record<string, unknown>;
|
|
376
|
+
/** Additional CAS guards, AND-merged into the match (same as `ClaimTransition.where`). */
|
|
377
|
+
where?: Record<string, unknown>;
|
|
378
|
+
by?: string;
|
|
379
|
+
note?: string;
|
|
380
|
+
/** History field name (default `'statusHistory'`), or `false` to skip the append. */
|
|
381
|
+
history?: string | false;
|
|
382
|
+
/** Timestamp for the history entry — default `now`. */
|
|
383
|
+
at?: Date;
|
|
384
|
+
}
|
|
345
385
|
/**
|
|
346
386
|
* Transition spec for `StandardRepo.claimVersion()` — optimistic-
|
|
347
387
|
* concurrency CAS via a version stamp. Sibling to `ClaimTransition`;
|
|
@@ -1410,6 +1450,27 @@ interface StandardRepo<TDoc> extends MinimalRepo<TDoc> {
|
|
|
1410
1450
|
* same shape and compile down to flat column writes.
|
|
1411
1451
|
*/
|
|
1412
1452
|
claimVersion(id: string, transition: ClaimVersionTransition, update: Record<string, unknown>, options?: WriteOptions): Promise<TDoc | null>;
|
|
1453
|
+
/**
|
|
1454
|
+
* State-machine-backed CAS transition with status history — the
|
|
1455
|
+
* canonical domain-verb shape (mongokit 3.22 `Repository.transition`).
|
|
1456
|
+
* One call: machine legality pre-flight (the machine throws the
|
|
1457
|
+
* DOMAIN's typed error), CAS via `claim`, appended history entry
|
|
1458
|
+
* (`{ status: to, occurredAt, by?, note? }` onto `args.history` /
|
|
1459
|
+
* `statusHistory`), and accurate race-loss diagnosis — on CAS miss
|
|
1460
|
+
* the kit re-reads the row and throws the machine's error from the
|
|
1461
|
+
* row's CURRENT state, a 404-shaped `TRANSITION_TARGET_MISSING`
|
|
1462
|
+
* error when the row vanished, or a 409 `TRANSITION_RACE_LOST`
|
|
1463
|
+
* when the move is still legal (caller may re-read and retry).
|
|
1464
|
+
*
|
|
1465
|
+
* Unlike `claim`/`claimVersion`, this method THROWS instead of
|
|
1466
|
+
* returning `null` — it exists precisely to own the error liturgy
|
|
1467
|
+
* that every domain package copy-pasted around `claim`.
|
|
1468
|
+
*
|
|
1469
|
+
* **Optional (for now).** Mongokit ≥3.22 ships it; promote to
|
|
1470
|
+
* required once sqlitekit implements it (SQL kits compile the
|
|
1471
|
+
* history append to their JSON-array/audit-table strategy).
|
|
1472
|
+
*/
|
|
1473
|
+
transition?(id: string, machine: TransitionMachine, args: TransitionArgs, options?: WriteOptions): Promise<TDoc>;
|
|
1413
1474
|
/**
|
|
1414
1475
|
* Classify an error from a write as a unique-constraint violation.
|
|
1415
1476
|
* Arc's idempotency + outbox adapters need this to distinguish
|
|
@@ -1750,4 +1811,4 @@ interface CursorOptions {
|
|
|
1750
1811
|
[key: string]: unknown;
|
|
1751
1812
|
}
|
|
1752
1813
|
//#endregion
|
|
1753
|
-
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, UpdateManyResult, WatchOptions, WriteOptions };
|
|
1814
|
+
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, TransitionArgs, TransitionMachine, UpdateManyResult, WatchOptions, WriteOptions };
|
package/package.json
CHANGED
|
@@ -1,176 +1,176 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@classytic/repo-core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Driver-agnostic repository primitives: hooks, Filter IR, operations, pagination, cache contract. Foundation for mongokit, sqlitekit, pgkit, and prismakit. Lean by design
|
|
5
|
-
"type": "module",
|
|
6
|
-
"sideEffects": false,
|
|
7
|
-
"files": [
|
|
8
|
-
"dist",
|
|
9
|
-
"README.md",
|
|
10
|
-
"LICENSE",
|
|
11
|
-
"CHANGELOG.md"
|
|
12
|
-
],
|
|
13
|
-
"engines": {
|
|
14
|
-
"node": ">=22"
|
|
15
|
-
},
|
|
16
|
-
"exports": {
|
|
17
|
-
"./hooks": {
|
|
18
|
-
"types": "./dist/hooks/index.d.mts",
|
|
19
|
-
"default": "./dist/hooks/index.mjs"
|
|
20
|
-
},
|
|
21
|
-
"./operations": {
|
|
22
|
-
"types": "./dist/operations/index.d.mts",
|
|
23
|
-
"default": "./dist/operations/index.mjs"
|
|
24
|
-
},
|
|
25
|
-
"./errors": {
|
|
26
|
-
"types": "./dist/errors/index.d.mts",
|
|
27
|
-
"default": "./dist/errors/index.mjs"
|
|
28
|
-
},
|
|
29
|
-
"./pagination": {
|
|
30
|
-
"types": "./dist/pagination/index.d.mts",
|
|
31
|
-
"default": "./dist/pagination/index.mjs"
|
|
32
|
-
},
|
|
33
|
-
"./repository": {
|
|
34
|
-
"types": "./dist/repository/index.d.mts",
|
|
35
|
-
"default": "./dist/repository/index.mjs"
|
|
36
|
-
},
|
|
37
|
-
"./filter": {
|
|
38
|
-
"types": "./dist/filter/index.d.mts",
|
|
39
|
-
"default": "./dist/filter/index.mjs"
|
|
40
|
-
},
|
|
41
|
-
"./update": {
|
|
42
|
-
"types": "./dist/update/index.d.mts",
|
|
43
|
-
"default": "./dist/update/index.mjs"
|
|
44
|
-
},
|
|
45
|
-
"./query-parser": {
|
|
46
|
-
"types": "./dist/query-parser/index.d.mts",
|
|
47
|
-
"default": "./dist/query-parser/index.mjs"
|
|
48
|
-
},
|
|
49
|
-
"./context": {
|
|
50
|
-
"types": "./dist/context/index.d.mts",
|
|
51
|
-
"default": "./dist/context/index.mjs"
|
|
52
|
-
},
|
|
53
|
-
"./cache": {
|
|
54
|
-
"types": "./dist/cache/index.d.mts",
|
|
55
|
-
"default": "./dist/cache/index.mjs"
|
|
56
|
-
},
|
|
57
|
-
"./events": {
|
|
58
|
-
"types": "./dist/events/index.d.mts",
|
|
59
|
-
"default": "./dist/events/index.mjs"
|
|
60
|
-
},
|
|
61
|
-
"./schema": {
|
|
62
|
-
"types": "./dist/schema/index.d.mts",
|
|
63
|
-
"default": "./dist/schema/index.mjs"
|
|
64
|
-
},
|
|
65
|
-
"./testing": {
|
|
66
|
-
"types": "./dist/testing/index.d.mts",
|
|
67
|
-
"default": "./dist/testing/index.mjs"
|
|
68
|
-
},
|
|
69
|
-
"./tenant": {
|
|
70
|
-
"types": "./dist/tenant/index.d.mts",
|
|
71
|
-
"default": "./dist/tenant/index.mjs"
|
|
72
|
-
},
|
|
73
|
-
"./lookup": {
|
|
74
|
-
"types": "./dist/lookup/index.d.mts",
|
|
75
|
-
"default": "./dist/lookup/index.mjs"
|
|
76
|
-
},
|
|
77
|
-
"./adapter": {
|
|
78
|
-
"types": "./dist/adapter/index.d.mts",
|
|
79
|
-
"default": "./dist/adapter/index.mjs"
|
|
80
|
-
},
|
|
81
|
-
"./better-auth": {
|
|
82
|
-
"types": "./dist/better-auth/index.d.mts",
|
|
83
|
-
"default": "./dist/better-auth/index.mjs"
|
|
84
|
-
},
|
|
85
|
-
"./aggregate": {
|
|
86
|
-
"types": "./dist/aggregate/index.d.mts",
|
|
87
|
-
"default": "./dist/aggregate/index.mjs"
|
|
88
|
-
},
|
|
89
|
-
"./plugins": {
|
|
90
|
-
"types": "./dist/plugins/index.d.mts",
|
|
91
|
-
"default": "./dist/plugins/index.mjs"
|
|
92
|
-
},
|
|
93
|
-
"./lock": {
|
|
94
|
-
"types": "./dist/lock/index.d.mts",
|
|
95
|
-
"default": "./dist/lock/index.mjs"
|
|
96
|
-
},
|
|
97
|
-
"./usage": {
|
|
98
|
-
"types": "./dist/usage/index.d.mts",
|
|
99
|
-
"default": "./dist/usage/index.mjs"
|
|
100
|
-
},
|
|
101
|
-
"./package.json": "./package.json",
|
|
102
|
-
"./sync": {
|
|
103
|
-
"types": "./dist/sync/index.d.mts",
|
|
104
|
-
"default": "./dist/sync/index.mjs"
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
"keywords": [
|
|
108
|
-
"repository",
|
|
109
|
-
"repository-pattern",
|
|
110
|
-
"data-access",
|
|
111
|
-
"hooks",
|
|
112
|
-
"filter-ir",
|
|
113
|
-
"pagination",
|
|
114
|
-
"cursor-pagination",
|
|
115
|
-
"keyset-pagination",
|
|
116
|
-
"plugin-based",
|
|
117
|
-
"driver-agnostic",
|
|
118
|
-
"typescript",
|
|
119
|
-
"esm"
|
|
120
|
-
],
|
|
121
|
-
"author": "Classytic <classytic.dev@gmail.com> (https://github.com/classytic)",
|
|
122
|
-
"license": "MIT",
|
|
123
|
-
"repository": {
|
|
124
|
-
"type": "git",
|
|
125
|
-
"url": "git+https://github.com/classytic/repo-core.git"
|
|
126
|
-
},
|
|
127
|
-
"bugs": {
|
|
128
|
-
"url": "https://github.com/classytic/repo-core/issues"
|
|
129
|
-
},
|
|
130
|
-
"homepage": "https://github.com/classytic/repo-core#readme",
|
|
131
|
-
"scripts": {
|
|
132
|
-
"build": "tsdown",
|
|
133
|
-
"dev": "tsdown --watch",
|
|
134
|
-
"test": "vitest run --project unit --project integration",
|
|
135
|
-
"test:unit": "vitest run --project unit",
|
|
136
|
-
"test:integration": "vitest run --project integration",
|
|
137
|
-
"test:e2e": "vitest run --project e2e",
|
|
138
|
-
"test:all": "vitest run",
|
|
139
|
-
"test:watch": "vitest --project unit --project integration",
|
|
140
|
-
"bench": "vitest bench --run --project bench",
|
|
141
|
-
"test:coverage": "vitest run --coverage",
|
|
142
|
-
"typecheck": "tsc --noEmit && tsc -p tsconfig.test.json",
|
|
143
|
-
"lint": "biome check src tests",
|
|
144
|
-
"lint:fix": "biome check src tests --write",
|
|
145
|
-
"format": "biome format src tests --write",
|
|
146
|
-
"check": "biome ci src tests --diagnostic-level=error",
|
|
147
|
-
"knip": "knip",
|
|
148
|
-
"push": "classytic-push",
|
|
149
|
-
"prepublishOnly": "npm run check && npm run build && npm run typecheck && npm test",
|
|
150
|
-
"release:tag": "node -e \"require('child_process').execSync('npm run push -- v'+require('./package.json').version,{stdio:'inherit'})\"",
|
|
151
|
-
"release": "npm run push -- main && npm run release:tag && npm publish",
|
|
152
|
-
"publish:dry": "npm publish --dry-run --access public",
|
|
153
|
-
"publish:npm": "npm publish --access public"
|
|
154
|
-
},
|
|
155
|
-
"devDependencies": {
|
|
156
|
-
"@arethetypeswrong/cli": "^0.18.2",
|
|
157
|
-
"@biomejs/biome": "^2.4.12",
|
|
158
|
-
"@classytic/dev-tools": "^0.2.0",
|
|
159
|
-
"@types/node": "^22.0.0",
|
|
160
|
-
"@vitest/coverage-v8": "^4.1.4",
|
|
161
|
-
"fast-check": "^4.7.0",
|
|
162
|
-
"knip": "^6.3.0",
|
|
163
|
-
"publint": "^0.3.18",
|
|
164
|
-
"tsdown": "^0.22.5",
|
|
165
|
-
"typescript": "^7.0.2",
|
|
166
|
-
"vitest": "^4.1.4"
|
|
167
|
-
},
|
|
168
|
-
"peerDependencies": {
|
|
169
|
-
"vitest": "^3.0.0 || ^4.0.0"
|
|
170
|
-
},
|
|
171
|
-
"peerDependenciesMeta": {
|
|
172
|
-
"vitest": {
|
|
173
|
-
"optional": true
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@classytic/repo-core",
|
|
3
|
+
"version": "0.12.0",
|
|
4
|
+
"description": "Driver-agnostic repository primitives: hooks, Filter IR, operations, pagination, cache contract. Foundation for mongokit, sqlitekit, pgkit, and prismakit. Lean by design — no plugins ship here; each kit owns its own.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md",
|
|
10
|
+
"LICENSE",
|
|
11
|
+
"CHANGELOG.md"
|
|
12
|
+
],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=22"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
"./hooks": {
|
|
18
|
+
"types": "./dist/hooks/index.d.mts",
|
|
19
|
+
"default": "./dist/hooks/index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"./operations": {
|
|
22
|
+
"types": "./dist/operations/index.d.mts",
|
|
23
|
+
"default": "./dist/operations/index.mjs"
|
|
24
|
+
},
|
|
25
|
+
"./errors": {
|
|
26
|
+
"types": "./dist/errors/index.d.mts",
|
|
27
|
+
"default": "./dist/errors/index.mjs"
|
|
28
|
+
},
|
|
29
|
+
"./pagination": {
|
|
30
|
+
"types": "./dist/pagination/index.d.mts",
|
|
31
|
+
"default": "./dist/pagination/index.mjs"
|
|
32
|
+
},
|
|
33
|
+
"./repository": {
|
|
34
|
+
"types": "./dist/repository/index.d.mts",
|
|
35
|
+
"default": "./dist/repository/index.mjs"
|
|
36
|
+
},
|
|
37
|
+
"./filter": {
|
|
38
|
+
"types": "./dist/filter/index.d.mts",
|
|
39
|
+
"default": "./dist/filter/index.mjs"
|
|
40
|
+
},
|
|
41
|
+
"./update": {
|
|
42
|
+
"types": "./dist/update/index.d.mts",
|
|
43
|
+
"default": "./dist/update/index.mjs"
|
|
44
|
+
},
|
|
45
|
+
"./query-parser": {
|
|
46
|
+
"types": "./dist/query-parser/index.d.mts",
|
|
47
|
+
"default": "./dist/query-parser/index.mjs"
|
|
48
|
+
},
|
|
49
|
+
"./context": {
|
|
50
|
+
"types": "./dist/context/index.d.mts",
|
|
51
|
+
"default": "./dist/context/index.mjs"
|
|
52
|
+
},
|
|
53
|
+
"./cache": {
|
|
54
|
+
"types": "./dist/cache/index.d.mts",
|
|
55
|
+
"default": "./dist/cache/index.mjs"
|
|
56
|
+
},
|
|
57
|
+
"./events": {
|
|
58
|
+
"types": "./dist/events/index.d.mts",
|
|
59
|
+
"default": "./dist/events/index.mjs"
|
|
60
|
+
},
|
|
61
|
+
"./schema": {
|
|
62
|
+
"types": "./dist/schema/index.d.mts",
|
|
63
|
+
"default": "./dist/schema/index.mjs"
|
|
64
|
+
},
|
|
65
|
+
"./testing": {
|
|
66
|
+
"types": "./dist/testing/index.d.mts",
|
|
67
|
+
"default": "./dist/testing/index.mjs"
|
|
68
|
+
},
|
|
69
|
+
"./tenant": {
|
|
70
|
+
"types": "./dist/tenant/index.d.mts",
|
|
71
|
+
"default": "./dist/tenant/index.mjs"
|
|
72
|
+
},
|
|
73
|
+
"./lookup": {
|
|
74
|
+
"types": "./dist/lookup/index.d.mts",
|
|
75
|
+
"default": "./dist/lookup/index.mjs"
|
|
76
|
+
},
|
|
77
|
+
"./adapter": {
|
|
78
|
+
"types": "./dist/adapter/index.d.mts",
|
|
79
|
+
"default": "./dist/adapter/index.mjs"
|
|
80
|
+
},
|
|
81
|
+
"./better-auth": {
|
|
82
|
+
"types": "./dist/better-auth/index.d.mts",
|
|
83
|
+
"default": "./dist/better-auth/index.mjs"
|
|
84
|
+
},
|
|
85
|
+
"./aggregate": {
|
|
86
|
+
"types": "./dist/aggregate/index.d.mts",
|
|
87
|
+
"default": "./dist/aggregate/index.mjs"
|
|
88
|
+
},
|
|
89
|
+
"./plugins": {
|
|
90
|
+
"types": "./dist/plugins/index.d.mts",
|
|
91
|
+
"default": "./dist/plugins/index.mjs"
|
|
92
|
+
},
|
|
93
|
+
"./lock": {
|
|
94
|
+
"types": "./dist/lock/index.d.mts",
|
|
95
|
+
"default": "./dist/lock/index.mjs"
|
|
96
|
+
},
|
|
97
|
+
"./usage": {
|
|
98
|
+
"types": "./dist/usage/index.d.mts",
|
|
99
|
+
"default": "./dist/usage/index.mjs"
|
|
100
|
+
},
|
|
101
|
+
"./package.json": "./package.json",
|
|
102
|
+
"./sync": {
|
|
103
|
+
"types": "./dist/sync/index.d.mts",
|
|
104
|
+
"default": "./dist/sync/index.mjs"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"keywords": [
|
|
108
|
+
"repository",
|
|
109
|
+
"repository-pattern",
|
|
110
|
+
"data-access",
|
|
111
|
+
"hooks",
|
|
112
|
+
"filter-ir",
|
|
113
|
+
"pagination",
|
|
114
|
+
"cursor-pagination",
|
|
115
|
+
"keyset-pagination",
|
|
116
|
+
"plugin-based",
|
|
117
|
+
"driver-agnostic",
|
|
118
|
+
"typescript",
|
|
119
|
+
"esm"
|
|
120
|
+
],
|
|
121
|
+
"author": "Classytic <classytic.dev@gmail.com> (https://github.com/classytic)",
|
|
122
|
+
"license": "MIT",
|
|
123
|
+
"repository": {
|
|
124
|
+
"type": "git",
|
|
125
|
+
"url": "git+https://github.com/classytic/repo-core.git"
|
|
126
|
+
},
|
|
127
|
+
"bugs": {
|
|
128
|
+
"url": "https://github.com/classytic/repo-core/issues"
|
|
129
|
+
},
|
|
130
|
+
"homepage": "https://github.com/classytic/repo-core#readme",
|
|
131
|
+
"scripts": {
|
|
132
|
+
"build": "tsdown",
|
|
133
|
+
"dev": "tsdown --watch",
|
|
134
|
+
"test": "vitest run --project unit --project integration",
|
|
135
|
+
"test:unit": "vitest run --project unit",
|
|
136
|
+
"test:integration": "vitest run --project integration",
|
|
137
|
+
"test:e2e": "vitest run --project e2e",
|
|
138
|
+
"test:all": "vitest run",
|
|
139
|
+
"test:watch": "vitest --project unit --project integration",
|
|
140
|
+
"bench": "vitest bench --run --project bench",
|
|
141
|
+
"test:coverage": "vitest run --coverage",
|
|
142
|
+
"typecheck": "tsc --noEmit && tsc -p tsconfig.test.json",
|
|
143
|
+
"lint": "biome check src tests",
|
|
144
|
+
"lint:fix": "biome check src tests --write",
|
|
145
|
+
"format": "biome format src tests --write",
|
|
146
|
+
"check": "biome ci src tests --diagnostic-level=error",
|
|
147
|
+
"knip": "knip",
|
|
148
|
+
"push": "classytic-push",
|
|
149
|
+
"prepublishOnly": "npm run check && npm run build && npm run typecheck && npm test",
|
|
150
|
+
"release:tag": "node -e \"require('child_process').execSync('npm run push -- v'+require('./package.json').version,{stdio:'inherit'})\"",
|
|
151
|
+
"release": "npm run push -- main && npm run release:tag && npm publish",
|
|
152
|
+
"publish:dry": "npm publish --dry-run --access public",
|
|
153
|
+
"publish:npm": "npm publish --access public"
|
|
154
|
+
},
|
|
155
|
+
"devDependencies": {
|
|
156
|
+
"@arethetypeswrong/cli": "^0.18.2",
|
|
157
|
+
"@biomejs/biome": "^2.4.12",
|
|
158
|
+
"@classytic/dev-tools": "^0.2.0",
|
|
159
|
+
"@types/node": "^22.0.0",
|
|
160
|
+
"@vitest/coverage-v8": "^4.1.4",
|
|
161
|
+
"fast-check": "^4.7.0",
|
|
162
|
+
"knip": "^6.3.0",
|
|
163
|
+
"publint": "^0.3.18",
|
|
164
|
+
"tsdown": "^0.22.5",
|
|
165
|
+
"typescript": "^7.0.2",
|
|
166
|
+
"vitest": "^4.1.4"
|
|
167
|
+
},
|
|
168
|
+
"peerDependencies": {
|
|
169
|
+
"vitest": "^3.0.0 || ^4.0.0"
|
|
170
|
+
},
|
|
171
|
+
"peerDependenciesMeta": {
|
|
172
|
+
"vitest": {
|
|
173
|
+
"optional": true
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|