@byline/core 3.15.1 → 3.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/collection-types.d.ts +7 -7
- package/dist/@types/db-types.d.ts +46 -24
- package/dist/@types/query-predicate.d.ts +25 -3
- package/dist/@types/search-types.d.ts +8 -1
- package/dist/@types/site-config.d.ts +2 -2
- package/dist/auth/assert-actor-can-perform.d.ts +1 -1
- package/dist/auth/assert-actor-can-perform.js +1 -1
- package/dist/auth/register-collection-abilities.d.ts +1 -1
- package/dist/auth/register-collection-abilities.js +1 -1
- package/dist/config/config.d.ts +1 -1
- package/dist/config/config.js +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/lib/errors.d.ts +1 -1
- package/dist/lib/errors.js +1 -1
- package/dist/query/parse-where.js +71 -20
- package/dist/query/parse-where.test.node.js +93 -0
- package/dist/schemas/zod/builder.js +2 -2
- package/dist/services/build-search-document.d.ts +39 -1
- package/dist/services/build-search-document.js +102 -16
- package/dist/services/build-search-document.test.node.js +111 -0
- package/dist/services/document-lifecycle/audit.d.ts +1 -1
- package/dist/services/document-lifecycle/audit.js +3 -3
- package/dist/services/document-lifecycle/context.d.ts +1 -1
- package/dist/services/document-lifecycle/create.d.ts +1 -1
- package/dist/services/document-lifecycle/create.js +1 -1
- package/dist/services/document-lifecycle/delete.js +3 -3
- package/dist/services/document-lifecycle/internals.d.ts +2 -2
- package/dist/services/document-lifecycle/internals.js +3 -3
- package/dist/services/document-lifecycle/status.js +1 -1
- package/dist/services/document-lifecycle/system-fields.d.ts +2 -2
- package/dist/services/document-lifecycle/system-fields.js +3 -3
- package/dist/services/document-lifecycle/tree.js +1 -1
- package/dist/services/document-lifecycle/update.d.ts +2 -2
- package/dist/services/document-lifecycle.test.node.js +3 -3
- package/dist/services/document-to-markdown.d.ts +1 -1
- package/dist/services/document-to-markdown.js +1 -1
- package/dist/services/document-to-markdown.test.node.js +1 -1
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/populate.d.ts +1 -1
- package/package.json +3 -5
|
@@ -43,7 +43,7 @@ export declare function updateDocument(ctx: DocumentLifecycleContext, params: {
|
|
|
43
43
|
* The editorial advertised-locale set. `undefined` leaves the existing
|
|
44
44
|
* set untouched (sticky — document-grain, like `path`); an explicit array
|
|
45
45
|
* (empty included) replaces it wholesale. Driven by the admin
|
|
46
|
-
* available-locales sidebar widget. See docs/
|
|
46
|
+
* available-locales sidebar widget. See docs/07-internationalization/index.md.
|
|
47
47
|
*/
|
|
48
48
|
availableLocales?: string[];
|
|
49
49
|
}): Promise<UpdateDocumentResult>;
|
|
@@ -78,7 +78,7 @@ export declare function updateDocumentWithPatches(ctx: DocumentLifecycleContext,
|
|
|
78
78
|
* The editorial advertised-locale set (typically supplied alongside
|
|
79
79
|
* patches when the admin available-locales widget has been edited).
|
|
80
80
|
* `undefined` leaves the existing set untouched (sticky); an explicit
|
|
81
|
-
* array replaces it wholesale. See docs/
|
|
81
|
+
* array replaces it wholesale. See docs/07-internationalization/index.md.
|
|
82
82
|
*/
|
|
83
83
|
availableLocales?: string[];
|
|
84
84
|
}): Promise<UpdateDocumentWithPatchesResult>;
|
|
@@ -36,7 +36,7 @@ function createMockDb() {
|
|
|
36
36
|
const getDocumentById = vi.fn().mockResolvedValue(null);
|
|
37
37
|
const getCurrentVersionMetadata = vi.fn().mockResolvedValue(null);
|
|
38
38
|
const getCurrentPath = vi.fn().mockResolvedValue('current-path');
|
|
39
|
-
// Audit capability (docs/
|
|
39
|
+
// Audit capability (docs/06-auth-and-security/02-auditability.md — W2). `withTransaction` is a passthrough
|
|
40
40
|
// in unit tests (runs the unit of work immediately, no real tx); `append`
|
|
41
41
|
// records the calls so write-point tests can assert the audit rows emitted.
|
|
42
42
|
const auditAppend = vi.fn().mockResolvedValue({ id: 'audit-1' });
|
|
@@ -165,7 +165,7 @@ describe('Document lifecycle service', () => {
|
|
|
165
165
|
data: { title: 'Hello' },
|
|
166
166
|
locale: 'en',
|
|
167
167
|
});
|
|
168
|
-
// Audit contract (docs/
|
|
168
|
+
// Audit contract (docs/06-auth-and-security/02-auditability.md — W1): every version row
|
|
169
169
|
// records the actor that created it.
|
|
170
170
|
expect(createDocumentVersion.mock.calls[0]?.[0].createdBy).toBe(TEST_ACTOR_ID);
|
|
171
171
|
});
|
|
@@ -703,7 +703,7 @@ describe('Document lifecycle service', () => {
|
|
|
703
703
|
getCurrentVersionMetadata.mockResolvedValue({ ...metadataRow });
|
|
704
704
|
const ctx = buildCtx(db);
|
|
705
705
|
await changeDocumentStatus(ctx, { documentId: 'doc-1', nextStatus: 'published' });
|
|
706
|
-
// The mutation + audit row run inside one withTransaction (docs/
|
|
706
|
+
// The mutation + audit row run inside one withTransaction (docs/06-auth-and-security/02-auditability.md).
|
|
707
707
|
expect(withTransaction).toHaveBeenCalledOnce();
|
|
708
708
|
expect(auditAppend).toHaveBeenCalledWith(expect.objectContaining({
|
|
709
709
|
documentId: 'doc-1',
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* `documentToMarkdown` — the document-grain markdown assembler for the
|
|
10
10
|
* agent-readable export surface (`.md` routes, `llms.txt`). See
|
|
11
|
-
*
|
|
11
|
+
* TODO-INTERNAL.md → "Markdown export".
|
|
12
12
|
*
|
|
13
13
|
* A page is a composite (text, richtext, blocks, arrays, relations); this
|
|
14
14
|
* walks the collection's schema and the locale-resolved field data in
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* `documentToMarkdown` — the document-grain markdown assembler for the
|
|
10
10
|
* agent-readable export surface (`.md` routes, `llms.txt`). See
|
|
11
|
-
*
|
|
11
|
+
* TODO-INTERNAL.md → "Markdown export".
|
|
12
12
|
*
|
|
13
13
|
* A page is a composite (text, richtext, blocks, arrays, relations); this
|
|
14
14
|
* walks the collection's schema and the locale-resolved field data in
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Contract tests for the document-grain markdown assembler. The expected
|
|
10
10
|
* strings ARE the format contract — agents build on this shape, so a
|
|
11
11
|
* change here is a consumer-visible format change and should be
|
|
12
|
-
* deliberate (
|
|
12
|
+
* deliberate (TODO-INTERNAL.md → "The output is a contract surface").
|
|
13
13
|
*/
|
|
14
14
|
import { describe, expect, it } from 'vitest';
|
|
15
15
|
import { documentToMarkdown } from './document-to-markdown.js';
|
package/dist/services/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { ERR_CONFLICT, ERR_INVALID_TRANSITION, ERR_NOT_FOUND, ERR_PATCH_FAILED, ERR_READ_BUDGET_EXCEEDED, ERR_VALIDATION, } from '../lib/errors.js';
|
|
2
2
|
export { normaliseDateFields } from '../utils/normalise-dates.js';
|
|
3
3
|
export { type AssignCounterValuesInput, assignCounterValues } from './assign-counter-values.js';
|
|
4
|
-
export { type BuildSearchDocumentOptions, buildSearchDocument, type SearchSourceDocument, } from './build-search-document.js';
|
|
4
|
+
export { type BuildSearchDocumentOptions, buildSearchDocument, resolveSearchZones, type SearchSourceDocument, } from './build-search-document.js';
|
|
5
5
|
export { type CollectionRecord, type EnsureCollectionsInput, ensureCollections, } from './collection-bootstrap.js';
|
|
6
6
|
export { type DiscoverCounterGroupsInput, discoverCounterGroups, } from './discover-counter-groups.js';
|
|
7
7
|
export * from './document-lifecycle/index.js';
|
package/dist/services/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export { ERR_CONFLICT, ERR_INVALID_TRANSITION, ERR_NOT_FOUND, ERR_PATCH_FAILED, ERR_READ_BUDGET_EXCEEDED, ERR_VALIDATION, } from '../lib/errors.js';
|
|
3
3
|
export { normaliseDateFields } from '../utils/normalise-dates.js';
|
|
4
4
|
export { assignCounterValues } from './assign-counter-values.js';
|
|
5
|
-
export { buildSearchDocument, } from './build-search-document.js';
|
|
5
|
+
export { buildSearchDocument, resolveSearchZones, } from './build-search-document.js';
|
|
6
6
|
export { ensureCollections, } from './collection-bootstrap.js';
|
|
7
7
|
export { discoverCounterGroups, } from './discover-counter-groups.js';
|
|
8
8
|
export * from './document-lifecycle/index.js';
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* documents. The guard is in place from day one so that the hook work
|
|
26
26
|
* in Phase 4+ cannot reintroduce the problem.
|
|
27
27
|
*
|
|
28
|
-
* See docs/
|
|
28
|
+
* See docs/04-collections/02-relationships.md for the full design rationale.
|
|
29
29
|
*
|
|
30
30
|
* ---------------------------------------------------------------------
|
|
31
31
|
* DSL summary
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@byline/core",
|
|
3
3
|
"private": false,
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.16.0",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=20.9.0"
|
|
8
8
|
},
|
|
@@ -73,19 +73,17 @@
|
|
|
73
73
|
],
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"dotenv": "^17.4.2",
|
|
76
|
-
"jose": "^6.2.3",
|
|
77
|
-
"npm-run-all": "^4.1.5",
|
|
78
76
|
"pino": "^10.3.1",
|
|
79
77
|
"sharp": "^0.34.5",
|
|
80
|
-
"uuid": "^14.0.0",
|
|
81
78
|
"zod": "^4.4.3",
|
|
82
|
-
"@byline/auth": "3.
|
|
79
|
+
"@byline/auth": "3.16.0"
|
|
83
80
|
},
|
|
84
81
|
"devDependencies": {
|
|
85
82
|
"@biomejs/biome": "2.4.15",
|
|
86
83
|
"@types/node": "^25.9.1",
|
|
87
84
|
"chokidar": "^5.0.0",
|
|
88
85
|
"chokidar-cli": "^3.0.0",
|
|
86
|
+
"npm-run-all": "^4.1.5",
|
|
89
87
|
"tsc-alias": "^1.8.17",
|
|
90
88
|
"tsx": "^4.22.3",
|
|
91
89
|
"typescript": "6.0.3",
|