@orthacms/content-server 0.4.2 → 0.5.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/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +41 -1
- package/dist/lib/content.module.d.ts.map +1 -1
- package/dist/lib/content.module.js +31 -1
- package/dist/lib/copilot/entry-proposal.applier.d.ts.map +1 -1
- package/dist/lib/copilot/entry-proposal.applier.js +5 -4
- package/dist/lib/docs/describe-content-api.d.ts +7 -0
- package/dist/lib/docs/describe-content-api.d.ts.map +1 -1
- package/dist/lib/docs/describe-content-api.js +177 -53
- package/dist/lib/docs/describe-views-api.d.ts +19 -0
- package/dist/lib/docs/describe-views-api.d.ts.map +1 -0
- package/dist/lib/docs/describe-views-api.js +76 -0
- package/dist/lib/docs/field-schema.d.ts.map +1 -1
- package/dist/lib/docs/field-schema.js +36 -2
- package/dist/lib/docs/openapi-writer.d.ts +49 -0
- package/dist/lib/docs/openapi-writer.d.ts.map +1 -0
- package/dist/lib/docs/openapi-writer.js +76 -0
- package/dist/lib/docs/public-api-schemas.d.ts +45 -0
- package/dist/lib/docs/public-api-schemas.d.ts.map +1 -0
- package/dist/lib/docs/public-api-schemas.js +377 -0
- package/dist/lib/docs/views-schemas.d.ts +22 -0
- package/dist/lib/docs/views-schemas.d.ts.map +1 -0
- package/dist/lib/docs/views-schemas.js +156 -0
- package/dist/lib/entries/application/use-cases/bulk-publish-entries.use-case.d.ts +8 -2
- package/dist/lib/entries/application/use-cases/bulk-publish-entries.use-case.d.ts.map +1 -1
- package/dist/lib/entries/application/use-cases/bulk-publish-entries.use-case.js +19 -4
- package/dist/lib/entries/application/use-cases/bulk-unpublish-entries.use-case.d.ts +2 -2
- package/dist/lib/entries/application/use-cases/bulk-unpublish-entries.use-case.d.ts.map +1 -1
- package/dist/lib/entries/application/use-cases/bulk-unpublish-entries.use-case.js +14 -4
- package/dist/lib/entries/application/use-cases/publish-entry.use-case.d.ts +6 -8
- package/dist/lib/entries/application/use-cases/publish-entry.use-case.d.ts.map +1 -1
- package/dist/lib/entries/application/use-cases/publish-entry.use-case.js +10 -4
- package/dist/lib/entries/application/use-cases/unpublish-entry.use-case.d.ts +2 -5
- package/dist/lib/entries/application/use-cases/unpublish-entry.use-case.d.ts.map +1 -1
- package/dist/lib/entries/application/use-cases/unpublish-entry.use-case.js +6 -1
- package/dist/lib/entries/domain/entry.d.ts +8 -1
- package/dist/lib/entries/domain/entry.d.ts.map +1 -1
- package/dist/lib/entries/domain/entry.js +12 -12
- package/dist/lib/entries/domain/events/entry-events.d.ts +47 -5
- package/dist/lib/entries/domain/events/entry-events.d.ts.map +1 -1
- package/dist/lib/entries/domain/events/entry-events.js +26 -10
- package/dist/lib/entries/entries.constants.d.ts +10 -2
- package/dist/lib/entries/entries.constants.d.ts.map +1 -1
- package/dist/lib/entries/entries.constants.js +11 -2
- package/dist/lib/entries/http/controllers/bulk-entries.controller.d.ts +2 -2
- package/dist/lib/entries/http/controllers/bulk-entries.controller.d.ts.map +1 -1
- package/dist/lib/entries/http/controllers/bulk-entries.controller.js +8 -6
- package/dist/lib/entries/http/controllers/create-entry.controller.d.ts.map +1 -1
- package/dist/lib/entries/http/controllers/create-entry.controller.js +1 -1
- package/dist/lib/entries/http/controllers/update-entry.controller.d.ts.map +1 -1
- package/dist/lib/entries/http/controllers/update-entry.controller.js +1 -1
- package/dist/lib/entries/http/dto/extension-bag.validator.d.ts +14 -0
- package/dist/lib/entries/http/dto/extension-bag.validator.d.ts.map +1 -0
- package/dist/lib/entries/http/dto/extension-bag.validator.js +42 -0
- package/dist/lib/entries/http/dto/save-entry.dto.d.ts +16 -0
- package/dist/lib/entries/http/dto/save-entry.dto.d.ts.map +1 -1
- package/dist/lib/entries/http/dto/save-entry.dto.js +30 -0
- package/dist/lib/entries/infrastructure/persistence/entry-writer.service.d.ts +50 -8
- package/dist/lib/entries/infrastructure/persistence/entry-writer.service.d.ts.map +1 -1
- package/dist/lib/entries/infrastructure/persistence/entry-writer.service.js +183 -32
- package/dist/lib/entries/infrastructure/persistence/relation-link.service.d.ts +38 -5
- package/dist/lib/entries/infrastructure/persistence/relation-link.service.d.ts.map +1 -1
- package/dist/lib/entries/infrastructure/persistence/relation-link.service.js +38 -6
- package/dist/lib/entries/infrastructure/queries/entries.service.d.ts +3 -1
- package/dist/lib/entries/infrastructure/queries/entries.service.d.ts.map +1 -1
- package/dist/lib/entries/infrastructure/queries/entries.service.js +17 -5
- package/dist/lib/entries/infrastructure/queries/entry-match.query.d.ts +82 -0
- package/dist/lib/entries/infrastructure/queries/entry-match.query.d.ts.map +1 -0
- package/dist/lib/entries/infrastructure/queries/entry-match.query.js +152 -0
- package/dist/lib/extension/entry-filter-provider.d.ts +79 -0
- package/dist/lib/extension/entry-filter-provider.d.ts.map +1 -0
- package/dist/lib/extension/entry-filter-provider.js +149 -0
- package/dist/lib/extension/entry-write-extension.d.ts +185 -0
- package/dist/lib/extension/entry-write-extension.d.ts.map +1 -0
- package/dist/lib/extension/entry-write-extension.js +182 -0
- package/dist/lib/extension/read-scope.d.ts +107 -0
- package/dist/lib/extension/read-scope.d.ts.map +1 -0
- package/dist/lib/extension/read-scope.js +131 -0
- package/dist/lib/insights/docs/describe-content-insights-api.d.ts +23 -0
- package/dist/lib/insights/docs/describe-content-insights-api.d.ts.map +1 -0
- package/dist/lib/insights/docs/describe-content-insights-api.js +329 -0
- package/dist/lib/mcp/content-tools.provider.d.ts.map +1 -1
- package/dist/lib/mcp/content-tools.provider.js +10 -9
- package/dist/lib/public-api/http/controllers/public-entry-writes.controller.d.ts +14 -13
- package/dist/lib/public-api/http/controllers/public-entry-writes.controller.d.ts.map +1 -1
- package/dist/lib/public-api/http/controllers/public-entry-writes.controller.js +62 -46
- package/dist/lib/public-api/http/guards/api-token-workspace.guard.d.ts.map +1 -1
- package/dist/lib/public-api/http/guards/api-token-workspace.guard.js +8 -0
- package/dist/lib/public-api/infrastructure/public-entries.query.d.ts +14 -1
- package/dist/lib/public-api/infrastructure/public-entries.query.d.ts.map +1 -1
- package/dist/lib/public-api/infrastructure/public-entries.query.js +20 -3
- package/dist/lib/public-api/infrastructure/public-entry-writes.service.d.ts +10 -9
- package/dist/lib/public-api/infrastructure/public-entry-writes.service.d.ts.map +1 -1
- package/dist/lib/public-api/infrastructure/public-entry-writes.service.js +23 -24
- package/dist/lib/public-api/infrastructure/public-expansion.query.d.ts +16 -4
- package/dist/lib/public-api/infrastructure/public-expansion.query.d.ts.map +1 -1
- package/dist/lib/public-api/infrastructure/public-expansion.query.js +29 -9
- package/dist/lib/public-api/infrastructure/token-actor.d.ts +37 -0
- package/dist/lib/public-api/infrastructure/token-actor.d.ts.map +1 -0
- package/dist/lib/public-api/infrastructure/token-actor.js +58 -0
- package/dist/lib/revisions/application/use-cases/restore-revision.use-case.d.ts.map +1 -1
- package/dist/lib/revisions/application/use-cases/restore-revision.use-case.js +23 -1
- package/dist/lib/revisions/infrastructure/persistence/revision-snapshot.d.ts +7 -1
- package/dist/lib/revisions/infrastructure/persistence/revision-snapshot.d.ts.map +1 -1
- package/dist/lib/revisions/infrastructure/persistence/revision-snapshot.js +9 -2
- package/dist/lib/revisions/infrastructure/purge/revisions-workspace.purger.d.ts +28 -0
- package/dist/lib/revisions/infrastructure/purge/revisions-workspace.purger.d.ts.map +1 -0
- package/dist/lib/revisions/infrastructure/purge/revisions-workspace.purger.js +52 -0
- package/dist/lib/revisions/types/revision-view.d.ts +11 -0
- package/dist/lib/revisions/types/revision-view.d.ts.map +1 -1
- package/dist/lib/utils/content-plugin.d.ts.map +1 -1
- package/dist/lib/utils/content-plugin.js +10 -1
- package/dist/lib/utils/content-views-plugin.d.ts +28 -0
- package/dist/lib/utils/content-views-plugin.d.ts.map +1 -0
- package/dist/lib/utils/content-views-plugin.js +37 -0
- package/dist/lib/views/application/queries/saved-views.query.d.ts +16 -0
- package/dist/lib/views/application/queries/saved-views.query.d.ts.map +1 -0
- package/dist/lib/views/application/queries/saved-views.query.js +46 -0
- package/dist/lib/views/application/saved-view-access.service.d.ts +30 -0
- package/dist/lib/views/application/saved-view-access.service.d.ts.map +1 -0
- package/dist/lib/views/application/saved-view-access.service.js +55 -0
- package/dist/lib/views/application/use-cases/create-saved-view.use-case.d.ts +30 -0
- package/dist/lib/views/application/use-cases/create-saved-view.use-case.d.ts.map +1 -0
- package/dist/lib/views/application/use-cases/create-saved-view.use-case.js +81 -0
- package/dist/lib/views/application/use-cases/delete-saved-view.use-case.d.ts +18 -0
- package/dist/lib/views/application/use-cases/delete-saved-view.use-case.d.ts.map +1 -0
- package/dist/lib/views/application/use-cases/delete-saved-view.use-case.js +56 -0
- package/dist/lib/views/application/use-cases/set-default-view.use-case.d.ts +23 -0
- package/dist/lib/views/application/use-cases/set-default-view.use-case.d.ts.map +1 -0
- package/dist/lib/views/application/use-cases/set-default-view.use-case.js +51 -0
- package/dist/lib/views/application/use-cases/update-saved-view.use-case.d.ts +24 -0
- package/dist/lib/views/application/use-cases/update-saved-view.use-case.d.ts.map +1 -0
- package/dist/lib/views/application/use-cases/update-saved-view.use-case.js +90 -0
- package/dist/lib/views/application/view-scope.service.d.ts +25 -0
- package/dist/lib/views/application/view-scope.service.d.ts.map +1 -0
- package/dist/lib/views/application/view-scope.service.js +45 -0
- package/dist/lib/views/content-views.module.d.ts +22 -0
- package/dist/lib/views/content-views.module.d.ts.map +1 -0
- package/dist/lib/views/content-views.module.js +63 -0
- package/dist/lib/views/domain/errors/index.d.ts +6 -0
- package/dist/lib/views/domain/errors/index.d.ts.map +1 -0
- package/dist/lib/views/domain/errors/index.js +12 -0
- package/dist/lib/views/domain/errors/saved-view-forbidden.error.d.ts +10 -0
- package/dist/lib/views/domain/errors/saved-view-forbidden.error.d.ts.map +1 -0
- package/dist/lib/views/domain/errors/saved-view-forbidden.error.js +16 -0
- package/dist/lib/views/domain/errors/saved-view-limit-error.d.ts +9 -0
- package/dist/lib/views/domain/errors/saved-view-limit-error.d.ts.map +1 -0
- package/dist/lib/views/domain/errors/saved-view-limit-error.js +16 -0
- package/dist/lib/views/domain/errors/saved-view-name-taken.error.d.ts +5 -0
- package/dist/lib/views/domain/errors/saved-view-name-taken.error.d.ts.map +1 -0
- package/dist/lib/views/domain/errors/saved-view-name-taken.error.js +11 -0
- package/dist/lib/views/domain/errors/saved-view-not-found.error.d.ts +9 -0
- package/dist/lib/views/domain/errors/saved-view-not-found.error.d.ts.map +1 -0
- package/dist/lib/views/domain/errors/saved-view-not-found.error.js +15 -0
- package/dist/lib/views/domain/events/saved-view-events.d.ts +28 -0
- package/dist/lib/views/domain/events/saved-view-events.d.ts.map +1 -0
- package/dist/lib/views/domain/events/saved-view-events.js +38 -0
- package/dist/lib/views/domain/saved-view.d.ts +66 -0
- package/dist/lib/views/domain/saved-view.d.ts.map +1 -0
- package/dist/lib/views/domain/saved-view.js +18 -0
- package/dist/lib/views/domain/saved-view.repository.d.ts +77 -0
- package/dist/lib/views/domain/saved-view.repository.d.ts.map +1 -0
- package/dist/lib/views/domain/saved-view.repository.js +5 -0
- package/dist/lib/views/http/controllers/saved-views.controller.d.ts +45 -0
- package/dist/lib/views/http/controllers/saved-views.controller.d.ts.map +1 -0
- package/dist/lib/views/http/controllers/saved-views.controller.js +216 -0
- package/dist/lib/views/http/controllers/to-http-error.d.ts +10 -0
- package/dist/lib/views/http/controllers/to-http-error.d.ts.map +1 -0
- package/dist/lib/views/http/controllers/to-http-error.js +26 -0
- package/dist/lib/views/http/dto/save-view.dto.d.ts +54 -0
- package/dist/lib/views/http/dto/save-view.dto.d.ts.map +1 -0
- package/dist/lib/views/http/dto/save-view.dto.js +230 -0
- package/dist/lib/views/http/dto/view-payload.validator.d.ts +20 -0
- package/dist/lib/views/http/dto/view-payload.validator.d.ts.map +1 -0
- package/dist/lib/views/http/dto/view-payload.validator.js +52 -0
- package/dist/lib/views/infrastructure/persistence/drizzle-saved-view.repository.d.ts +26 -0
- package/dist/lib/views/infrastructure/persistence/drizzle-saved-view.repository.d.ts.map +1 -0
- package/dist/lib/views/infrastructure/persistence/drizzle-saved-view.repository.js +135 -0
- package/dist/lib/views/infrastructure/schema/external-refs.d.ts +68 -0
- package/dist/lib/views/infrastructure/schema/external-refs.d.ts.map +1 -0
- package/dist/lib/views/infrastructure/schema/external-refs.js +29 -0
- package/dist/lib/views/infrastructure/schema/index.d.ts +8 -0
- package/dist/lib/views/infrastructure/schema/index.d.ts.map +1 -0
- package/dist/lib/views/infrastructure/schema/index.js +13 -0
- package/dist/lib/views/infrastructure/schema/saved-views.d.ts +275 -0
- package/dist/lib/views/infrastructure/schema/saved-views.d.ts.map +1 -0
- package/dist/lib/views/infrastructure/schema/saved-views.js +87 -0
- package/dist/lib/views/views.constants.d.ts +26 -0
- package/dist/lib/views/views.constants.d.ts.map +1 -0
- package/dist/lib/views/views.constants.js +28 -0
- package/dist/lib/views/views.tokens.d.ts +17 -0
- package/dist/lib/views/views.tokens.d.ts.map +1 -0
- package/dist/lib/views/views.tokens.js +21 -0
- package/migrations/0000_saved_views.sql +29 -0
- package/migrations/meta/0000_snapshot.json +256 -0
- package/migrations/meta/_journal.json +13 -0
- package/package.json +13 -12
- package/dist/lib/entries/controllers/bulk-entries.controller.d.ts +0 -26
- package/dist/lib/entries/controllers/bulk-entries.controller.d.ts.map +0 -1
- package/dist/lib/entries/controllers/create-entry.controller.d.ts +0 -20
- package/dist/lib/entries/controllers/create-entry.controller.d.ts.map +0 -1
- package/dist/lib/entries/controllers/delete-entry.controller.d.ts +0 -24
- package/dist/lib/entries/controllers/delete-entry.controller.d.ts.map +0 -1
- package/dist/lib/entries/controllers/get-entry.controller.d.ts +0 -34
- package/dist/lib/entries/controllers/get-entry.controller.d.ts.map +0 -1
- package/dist/lib/entries/controllers/list-entries.controller.d.ts +0 -20
- package/dist/lib/entries/controllers/list-entries.controller.d.ts.map +0 -1
- package/dist/lib/entries/controllers/publish-entry.controller.d.ts +0 -19
- package/dist/lib/entries/controllers/publish-entry.controller.d.ts.map +0 -1
- package/dist/lib/entries/controllers/resolve-type.d.ts +0 -9
- package/dist/lib/entries/controllers/resolve-type.d.ts.map +0 -1
- package/dist/lib/entries/controllers/update-entry.controller.d.ts +0 -18
- package/dist/lib/entries/controllers/update-entry.controller.d.ts.map +0 -1
- package/dist/lib/entries/dto/bulk-ids.dto.d.ts +0 -11
- package/dist/lib/entries/dto/bulk-ids.dto.d.ts.map +0 -1
- package/dist/lib/entries/dto/list-entries-query.dto.d.ts +0 -46
- package/dist/lib/entries/dto/list-entries-query.dto.d.ts.map +0 -1
- package/dist/lib/entries/dto/relation-delta-map.validator.d.ts +0 -19
- package/dist/lib/entries/dto/relation-delta-map.validator.d.ts.map +0 -1
- package/dist/lib/entries/dto/save-entry.dto.d.ts +0 -46
- package/dist/lib/entries/dto/save-entry.dto.d.ts.map +0 -1
- package/dist/lib/entries/infrastructure/persistence/field-selection.d.ts +0 -24
- package/dist/lib/entries/infrastructure/persistence/field-selection.d.ts.map +0 -1
- package/dist/lib/entries/infrastructure/queries/entry-filter-schema.d.ts +0 -40
- package/dist/lib/entries/infrastructure/queries/entry-filter-schema.d.ts.map +0 -1
- package/dist/lib/entries/services/entries.service.d.ts +0 -59
- package/dist/lib/entries/services/entries.service.d.ts.map +0 -1
- package/dist/lib/entries/services/entry-counter.service.d.ts +0 -31
- package/dist/lib/entries/services/entry-counter.service.d.ts.map +0 -1
- package/dist/lib/entries/services/entry-filter-schema.d.ts +0 -32
- package/dist/lib/entries/services/entry-filter-schema.d.ts.map +0 -1
- package/dist/lib/entries/services/entry-row.d.ts +0 -56
- package/dist/lib/entries/services/entry-row.d.ts.map +0 -1
- package/dist/lib/entries/services/entry-writer.service.d.ts +0 -193
- package/dist/lib/entries/services/entry-writer.service.d.ts.map +0 -1
- package/dist/lib/entries/services/relation-link.service.d.ts +0 -115
- package/dist/lib/entries/services/relation-link.service.d.ts.map +0 -1
- package/dist/lib/extension/per-locale-relation.d.ts +0 -18
- package/dist/lib/extension/per-locale-relation.d.ts.map +0 -1
- package/dist/lib/public/controllers/get-public-entry.controller.d.ts +0 -26
- package/dist/lib/public/controllers/get-public-entry.controller.d.ts.map +0 -1
- package/dist/lib/public/controllers/list-public-entries.controller.d.ts +0 -24
- package/dist/lib/public/controllers/list-public-entries.controller.d.ts.map +0 -1
- package/dist/lib/public/controllers/public-schema.controller.d.ts +0 -18
- package/dist/lib/public/controllers/public-schema.controller.d.ts.map +0 -1
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { type Database } from '@ortha-cms/database';
|
|
2
|
-
import type { AnyContentType } from '../../types/content-type';
|
|
3
|
-
import { type AnyFieldSpec } from '../../types/fields';
|
|
4
|
-
import type { RelationDelta, RelationFieldView } from '../types/entry-list-view';
|
|
5
|
-
/** A generated content row seen as a bag of values by property name. */
|
|
6
|
-
type Row = Record<string, unknown>;
|
|
7
|
-
/** Default links per page when the caller doesn't specify one. */
|
|
8
|
-
export declare const RELATION_PAGE_SIZE = 20;
|
|
9
|
-
/**
|
|
10
|
-
* The transaction handle Drizzle hands the `db.transaction(tx => …)` callback —
|
|
11
|
-
* derived from {@link Database} so link writes share the exact query surface of
|
|
12
|
-
* the client without hard-coding the dialect's transaction type.
|
|
13
|
-
*/
|
|
14
|
-
export type DbTransaction = Parameters<Parameters<Database['transaction']>[0]>[0];
|
|
15
|
-
/**
|
|
16
|
-
* Reads and writes the relation **links** an entry owns beyond its own columns:
|
|
17
|
-
* many-to-many join rows and the inverse (back-reference) side of a two-way
|
|
18
|
-
* relation. Owning **single** relations are plain `<field>_id` FK columns —
|
|
19
|
-
* written by `toColumns`, read off the row — so they need no join plumbing.
|
|
20
|
-
*
|
|
21
|
-
* Everything is **paginated**: a relation can hold thousands of links, so reads
|
|
22
|
-
* return one ordered page + a `total` (never every id), and writes apply an
|
|
23
|
-
* incremental {@link RelationDelta} (link / unlink / reorder) inside a
|
|
24
|
-
* transaction — so a huge relation never has to be sent or held in full.
|
|
25
|
-
* Order is persisted in the join table's `position` column, owned by the
|
|
26
|
-
* **source** side; the inverse reads by it (stable) but can't reorder it.
|
|
27
|
-
*/
|
|
28
|
-
export declare class RelationLinkService {
|
|
29
|
-
private readonly db;
|
|
30
|
-
constructor(db: Database);
|
|
31
|
-
/**
|
|
32
|
-
* First page (+ total) of **every** relation field of `type` for one entry,
|
|
33
|
-
* keyed by field name — what the editor loads on open. Each field is read
|
|
34
|
-
* independently (paginated), so a relation with many links contributes only
|
|
35
|
-
* its first page, not every id.
|
|
36
|
-
*/
|
|
37
|
-
readAll(type: AnyContentType, row: Row, workspaceId: string, pageSize?: number): Promise<Record<string, RelationFieldView>>;
|
|
38
|
-
/**
|
|
39
|
-
* One page of a single relation field's links, ordered by `position`
|
|
40
|
-
* (owning) and resolved to display-ready refs (id + title). `row` is the
|
|
41
|
-
* editing entry (its FK columns back a single relation); pass it to avoid a
|
|
42
|
-
* re-read. Returns `{ items, total }`.
|
|
43
|
-
*/
|
|
44
|
-
readField(type: AnyContentType, row: Row, field: string, spec: AnyFieldSpec, page: number, pageSize: number, workspaceId: string): Promise<RelationFieldView>;
|
|
45
|
-
/**
|
|
46
|
-
* Apply an incremental {@link RelationDelta} to one many/inverse relation
|
|
47
|
-
* field inside `tx`: validate the linked targets are in the workspace, unlink
|
|
48
|
-
* the removed pairs, append the new ones (`position = max+1` for the source,
|
|
49
|
-
* `ON CONFLICT DO NOTHING`), then renumber to `order` (owning side only).
|
|
50
|
-
* A single relation or an inverse-of-single owns no delta-writable link, so
|
|
51
|
-
* it's a no-op. Returns nothing — read the field back for the new state.
|
|
52
|
-
*/
|
|
53
|
-
applyDelta(tx: DbTransaction, type: AnyContentType, sourceId: string, field: string, delta: RelationDelta, workspaceId: string): Promise<void>;
|
|
54
|
-
/**
|
|
55
|
-
* Replace a many-relation's links with exactly `values[field]` (array),
|
|
56
|
-
* position = array index — the **whole-set** write used only when a caller
|
|
57
|
-
* genuinely submits a relation **array** in the entry body (legacy / bulk).
|
|
58
|
-
* The editor uses {@link applyDelta} instead. Runs inside the entry's
|
|
59
|
-
* transaction. **Only an array counts**: a field that's absent or `null`
|
|
60
|
-
* (`coerceValues` stamps `null` onto every unset field) is left untouched, so
|
|
61
|
-
* a save that manages a relation purely through deltas can never have its
|
|
62
|
-
* links cleared here.
|
|
63
|
-
*/
|
|
64
|
-
writeLinks(tx: DbTransaction, type: AnyContentType, sourceId: string, values: Record<string, unknown>, workspaceId: string): Promise<void>;
|
|
65
|
-
/**
|
|
66
|
-
* Count the links of one join-backed relation field for an entry — the
|
|
67
|
-
* `total` a read would report, without fetching or resolving any page. Runs
|
|
68
|
-
* on the passed executor (the write transaction when validating a just-saved
|
|
69
|
-
* entry, so it sees the delta's uncommitted rows). Returns 0 for a relation
|
|
70
|
-
* that owns no writable links from this side (single FK / inverse-of-single).
|
|
71
|
-
*/
|
|
72
|
-
countLinks(exec: Database | DbTransaction, type: AnyContentType, row: Row, field: string, spec: AnyFieldSpec, workspaceId: string): Promise<number>;
|
|
73
|
-
/**
|
|
74
|
-
* Take the transaction-scoped advisory lock for one physical source list
|
|
75
|
-
* (`<join table>:<sourceId>`), serializing every appender to that list so no
|
|
76
|
-
* two concurrent writes read the same `max(position)`. Auto-releases at
|
|
77
|
-
* commit/rollback. Keyed on the table name too, so distinct join tables that
|
|
78
|
-
* happen to share a source id don't falsely contend.
|
|
79
|
-
*/
|
|
80
|
-
private lockSource;
|
|
81
|
-
/** Next append position for a source: `max(position) + 1`, else 0. */
|
|
82
|
-
private nextPosition;
|
|
83
|
-
/**
|
|
84
|
-
* Resolve `ids` (in order) to display-ready refs via one lookup on the target
|
|
85
|
-
* type, scoped to the workspace. Ids with no **live** row drop to an id-only
|
|
86
|
-
* ref — a soft-deleted (paranoid) target is excluded here just as it is on
|
|
87
|
-
* the inverse read side, so a trashed record never surfaces its title on the
|
|
88
|
-
* owning side while it's hidden on the other.
|
|
89
|
-
*/
|
|
90
|
-
private refsFor;
|
|
91
|
-
/** Build a display ref from a full target row. */
|
|
92
|
-
private rowToRef;
|
|
93
|
-
/**
|
|
94
|
-
* Verify every id to be linked exists **in the same workspace** (the join FK
|
|
95
|
-
* has no workspace constraint of its own). A missing or cross-workspace id is
|
|
96
|
-
* a uniform 422 — indistinguishable from an invalid id, so no enumeration
|
|
97
|
-
* signal.
|
|
98
|
-
*/
|
|
99
|
-
private assertTargets;
|
|
100
|
-
/**
|
|
101
|
-
* The join-table plan for a relation field, or `null` when it owns no join
|
|
102
|
-
* table (an owning single relation, or an inverse-of-single). An owning
|
|
103
|
-
* many-relation uses its own join table (`source→target`); an inverse of a
|
|
104
|
-
* many-to-many reuses the owning side's join table with the roles swapped.
|
|
105
|
-
*/
|
|
106
|
-
private joinPlanFor;
|
|
107
|
-
/**
|
|
108
|
-
* The inverse-of-single (one-to-many) plan for a relation field, or `null`:
|
|
109
|
-
* it reads the owner rows whose FK points back at the editing record, and
|
|
110
|
-
* owns no writable link from this side.
|
|
111
|
-
*/
|
|
112
|
-
private inversePlanFor;
|
|
113
|
-
}
|
|
114
|
-
export {};
|
|
115
|
-
//# sourceMappingURL=relation-link.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"relation-link.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/services/relation-link.service.ts"],"names":[],"mappings":"AAeA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,KAAK,EACR,aAAa,EACb,iBAAiB,EAEpB,MAAM,0BAA0B,CAAC;AAMlC,wEAAwE;AACxE,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnC,kEAAkE;AAClE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAUrC;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,CAClC,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CACzC,CAAC,CAAC,CAAC,CAAC;AA0BL;;;;;;;;;;;;GAYG;AACH,qBACa,mBAAmB;IACE,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,QAAQ;IAI3D;;;;;OAKG;IACG,OAAO,CACT,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,MAAM,EACnB,QAAQ,SAAqB,GAC9B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAoB7C;;;;;OAKG;IACG,SAAS,CACX,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,iBAAiB,CAAC;IA0E7B;;;;;;;OAOG;IACG,UAAU,CACZ,EAAE,EAAE,aAAa,EACjB,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC;IA+FhB;;;;;;;;;OASG;IACG,UAAU,CACZ,EAAE,EAAE,aAAa,EACjB,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC;IAwChB;;;;;;OAMG;IACG,UAAU,CACZ,IAAI,EAAE,QAAQ,GAAG,aAAa,EAC9B,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,YAAY,EAClB,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC;IA8BlB;;;;;;OAMG;YACW,UAAU;IAWxB,sEAAsE;YACxD,YAAY;IAc1B;;;;;;OAMG;YACW,OAAO;IAuBrB,kDAAkD;IAClD,OAAO,CAAC,QAAQ;IAWhB;;;;;OAKG;YACW,aAAa;IAmC3B;;;;;OAKG;IACH,OAAO,CAAC,WAAW;IA8BnB;;;;OAIG;IACH,OAAO,CAAC,cAAc;CAYzB"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type AnyFieldSpec } from '../types/fields';
|
|
2
|
-
import type { AnyContentType } from '../types/content-type';
|
|
3
|
-
/**
|
|
4
|
-
* Whether a field is a **per-locale relation** — a *single owning* relation
|
|
5
|
-
* (`!many`, `!inverse`) on an **i18n** owner whose **target type is also i18n**.
|
|
6
|
-
*
|
|
7
|
-
* Such a relation can't be shared across a translation group: a shared FK would
|
|
8
|
-
* point at one specific locale's row, i.e. a cross-locale link. So the platform
|
|
9
|
-
* treats it as `localized` — not synced onto siblings, not copied into a
|
|
10
|
-
* translation draft, and the picker offers only same-locale candidates. Both the
|
|
11
|
-
* schema serializer (which stamps `localized` for the admin) and the i18n
|
|
12
|
-
* sibling-sync consult this, so the rule lives in one place.
|
|
13
|
-
*
|
|
14
|
-
* The target's i18n-ness is read via the resolved thunk `spec.relation.to()` —
|
|
15
|
-
* safe because the registry resolves every relation target at boot.
|
|
16
|
-
*/
|
|
17
|
-
export declare function isPerLocaleRelation(owner: AnyContentType, spec: AnyFieldSpec): boolean;
|
|
18
|
-
//# sourceMappingURL=per-locale-relation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"per-locale-relation.d.ts","sourceRoot":"","sources":["../../../src/lib/extension/per-locale-relation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAC/B,KAAK,EAAE,cAAc,EACrB,IAAI,EAAE,YAAY,GACnB,OAAO,CAQT"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ContentTypeRegistry } from '../../registry/content-type-registry';
|
|
2
|
-
import { EntryWriterService } from '../../entries/infrastructure/persistence/entry-writer.service';
|
|
3
|
-
import type { EntryRecord, EntryRelationsView, RelationFieldView } from '../../entries/types/entry-list-view';
|
|
4
|
-
/**
|
|
5
|
-
* `GET /api/v1/content/:typeName/:id[/relations[/:field]]` — the external,
|
|
6
|
-
* bearer-token-authenticated single-entry reads, mirroring the admin's
|
|
7
|
-
* `GetEntryController`. Every route is scoped to the token's workspace
|
|
8
|
-
* (`@CurrentWorkspace()`), so an id outside it reads as 404. Read-only:
|
|
9
|
-
* `content:read`, enforced against the token's scope by {@link ApiTokenGuard}.
|
|
10
|
-
*/
|
|
11
|
-
export declare class GetPublicEntryController {
|
|
12
|
-
private readonly registry;
|
|
13
|
-
private readonly writer;
|
|
14
|
-
constructor(registry: ContentTypeRegistry, writer: EntryWriterService);
|
|
15
|
-
/**
|
|
16
|
-
* One live entry by id (404 if unknown or soft-deleted in the workspace).
|
|
17
|
-
* `?fields=title,slug` narrows the returned `values` bag to those fields;
|
|
18
|
-
* omitted, the whole record is returned. An unknown name is a 400.
|
|
19
|
-
*/
|
|
20
|
-
getOne(typeName: string, id: string, workspaceId: string, fields?: string): Promise<EntryRecord>;
|
|
21
|
-
/** First page of every relation field's links for one entry. */
|
|
22
|
-
getRelations(typeName: string, id: string, workspaceId: string): Promise<EntryRelationsView>;
|
|
23
|
-
/** One page of a single relation field's links (`{ items, total }`). */
|
|
24
|
-
getRelationField(typeName: string, id: string, field: string, workspaceId: string, page?: string, pageSize?: string): Promise<RelationFieldView>;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=get-public-entry.controller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-public-entry.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/public/controllers/get-public-entry.controller.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+DAA+D,CAAC;AAInG,OAAO,KAAK,EACR,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACpB,MAAM,qCAAqC,CAAC;AAE7C;;;;;;GAMG;AACH,qBAIa,wBAAwB;IAG7B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,kBAAkB;IAG/C;;;;OAIG;IAEH,MAAM,CACiB,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACtB,MAAM,CAAC,EAAE,MAAM,GACjC,OAAO,CAAC,WAAW,CAAC;IAKvB,gEAAgE;IAE1D,YAAY,CACK,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,kBAAkB,CAAC;IAO9B,wEAAwE;IAExE,gBAAgB,CACO,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,EACT,WAAW,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,MAAM,EACT,QAAQ,CAAC,EAAE,MAAM,GACrC,OAAO,CAAC,iBAAiB,CAAC;CAWhC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ContentTypeRegistry } from '../../registry/content-type-registry';
|
|
2
|
-
import { EntriesService } from '../../entries/infrastructure/queries/entries.service';
|
|
3
|
-
import { ListEntriesQueryDto } from '../../entries/http/dto/list-entries-query.dto';
|
|
4
|
-
import type { EntryListView } from '../../entries/types/entry-list-view';
|
|
5
|
-
/**
|
|
6
|
-
* `GET /api/v1/content/:typeName` — the external, **bearer-token**-authenticated
|
|
7
|
-
* mirror of the admin's records list. Same generic pipeline
|
|
8
|
-
* (`search`/`filter`/`sort`/pagination + relation filtering), same
|
|
9
|
-
* `{ items, total, page, pageSize }` envelope — the only difference is the
|
|
10
|
-
* caller: an API token instead of a session.
|
|
11
|
-
*
|
|
12
|
-
* `@Public()` opts the route out of the app-wide session `AuthGuard` so
|
|
13
|
-
* {@link ApiTokenGuard} owns authentication; the guard authorizes the token's
|
|
14
|
-
* scope against `content:read` and mirrors the token's workspace onto the
|
|
15
|
-
* request, so `@CurrentWorkspace()` scopes the query exactly as the admin
|
|
16
|
-
* routes do — a token can never read another workspace's entries.
|
|
17
|
-
*/
|
|
18
|
-
export declare class ListPublicEntriesController {
|
|
19
|
-
private readonly registry;
|
|
20
|
-
private readonly entries;
|
|
21
|
-
constructor(registry: ContentTypeRegistry, entries: EntriesService);
|
|
22
|
-
list(typeName: string, query: ListEntriesQueryDto, workspaceId: string): Promise<EntryListView>;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=list-public-entries.controller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-public-entries.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/public/controllers/list-public-entries.controller.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AAEpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEzE;;;;;;;;;;;;GAYG;AACH,qBAIa,2BAA2B;IAGhC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADP,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,cAAc;IAI5C,IAAI,CACmB,QAAQ,EAAE,MAAM,EAC1B,KAAK,EAAE,mBAAmB,EACf,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,aAAa,CAAC;CAI5B"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ContentTypeRegistry, SerializedContentType, SerializedContentTypeSummary } from '../../registry/content-type-registry';
|
|
2
|
-
/**
|
|
3
|
-
* `GET /api/v1/content-schema[/:name]` — schema discovery for the external API,
|
|
4
|
-
* so a developer can enumerate the available content types (collections +
|
|
5
|
-
* pages) and read one type's full field list before querying it. Same registry
|
|
6
|
-
* projection the admin schema routes serve, behind the bearer-token guard on
|
|
7
|
-
* `content:read`. Schema is not workspace-specific — the types are code-defined
|
|
8
|
-
* — but access still requires a valid token.
|
|
9
|
-
*/
|
|
10
|
-
export declare class PublicSchemaController {
|
|
11
|
-
private readonly registry;
|
|
12
|
-
constructor(registry: ContentTypeRegistry);
|
|
13
|
-
/** Summaries of every content type. */
|
|
14
|
-
list(): SerializedContentTypeSummary[];
|
|
15
|
-
/** One type's full field schema (404 if unknown). */
|
|
16
|
-
get(name: string): SerializedContentType;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=public-schema.controller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public-schema.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/public/controllers/public-schema.controller.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACR,mBAAmB,EACnB,qBAAqB,EACrB,4BAA4B,EAC/B,MAAM,sCAAsC,CAAC;AAE9C;;;;;;;GAOG;AACH,qBAIa,sBAAsB;IAG3B,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,mBAAmB;IAGlD,uCAAuC;IAEvC,IAAI,IAAI,4BAA4B,EAAE;IAItC,qDAAqD;IAErD,GAAG,CAAgB,IAAI,EAAE,MAAM,GAAG,qBAAqB;CAO1D"}
|