@orthacms/content-server 0.4.3 → 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 +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/lib/content.module.d.ts.map +1 -1
- package/dist/lib/content.module.js +8 -0
- 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/infrastructure/persistence/entry-writer.service.d.ts +22 -6
- package/dist/lib/entries/infrastructure/persistence/entry-writer.service.d.ts.map +1 -1
- package/dist/lib/entries/infrastructure/persistence/entry-writer.service.js +71 -17
- 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-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/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 +12 -1
- 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/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.map +1 -1
- package/dist/lib/utils/content-views-plugin.js +8 -0
- package/dist/lib/views/application/use-cases/create-saved-view.use-case.d.ts +4 -1
- package/dist/lib/views/application/use-cases/create-saved-view.use-case.d.ts.map +1 -1
- package/dist/lib/views/application/use-cases/create-saved-view.use-case.js +33 -9
- package/dist/lib/views/application/use-cases/delete-saved-view.use-case.d.ts +4 -1
- package/dist/lib/views/application/use-cases/delete-saved-view.use-case.d.ts.map +1 -1
- package/dist/lib/views/application/use-cases/delete-saved-view.use-case.js +24 -3
- package/dist/lib/views/application/use-cases/update-saved-view.use-case.d.ts +4 -1
- package/dist/lib/views/application/use-cases/update-saved-view.use-case.d.ts.map +1 -1
- package/dist/lib/views/application/use-cases/update-saved-view.use-case.js +32 -3
- 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/infrastructure/persistence/drizzle-saved-view.repository.d.ts +12 -3
- package/dist/lib/views/infrastructure/persistence/drizzle-saved-view.repository.d.ts.map +1 -1
- package/dist/lib/views/infrastructure/persistence/drizzle-saved-view.repository.js +15 -5
- package/package.json +11 -11
- 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/entry-access-source.d.ts +0 -112
- package/dist/lib/extension/entry-access-source.d.ts.map +0 -1
- package/dist/lib/extension/entry-write-hook.d.ts +0 -98
- package/dist/lib/extension/entry-write-hook.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,26 +0,0 @@
|
|
|
1
|
-
import type { ContentTypeRegistry } from '../../registry/content-type-registry';
|
|
2
|
-
import { EntryWriterService } from '../services/entry-writer.service';
|
|
3
|
-
import { BulkIdsDto } from '../dto/bulk-ids.dto';
|
|
4
|
-
import type { BulkActionResult, BulkPublishPreview, BulkPublishResult } from '../types/bulk-publish';
|
|
5
|
-
/**
|
|
6
|
-
* Bulk entry actions over a set of `{ ids }`. **Registered before the
|
|
7
|
-
* single-item controllers** (see `content.module.ts`): the literal `bulk`
|
|
8
|
-
* segment sits in the same slot as those controllers' `:id`, so it must match
|
|
9
|
-
* first — otherwise `/bulk/publish` would resolve as `:id='bulk'` (and trip the
|
|
10
|
-
* single-item `ParseUUIDPipe`). `WorkspaceGuard` scopes every action to a
|
|
11
|
-
* workspace the caller belongs to. Per-route permissions: publish/unpublish need
|
|
12
|
-
* `content:publish`, delete/restore need `content:delete`.
|
|
13
|
-
*/
|
|
14
|
-
export declare class BulkEntriesController {
|
|
15
|
-
private readonly registry;
|
|
16
|
-
private readonly writer;
|
|
17
|
-
constructor(registry: ContentTypeRegistry, writer: EntryWriterService);
|
|
18
|
-
/** Dry run: validate each id and report a per-entry verdict. Writes nothing. */
|
|
19
|
-
previewPublish(typeName: string, body: BulkIdsDto, workspaceId: string): Promise<BulkPublishPreview>;
|
|
20
|
-
publish(typeName: string, body: BulkIdsDto, workspaceId: string): Promise<BulkPublishResult>;
|
|
21
|
-
unpublish(typeName: string, body: BulkIdsDto, workspaceId: string): Promise<BulkActionResult>;
|
|
22
|
-
remove(typeName: string, body: BulkIdsDto, workspaceId: string): Promise<BulkActionResult>;
|
|
23
|
-
restore(typeName: string, body: BulkIdsDto, workspaceId: string): Promise<BulkActionResult>;
|
|
24
|
-
purge(typeName: string, body: BulkIdsDto, workspaceId: string): Promise<BulkActionResult>;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=bulk-entries.controller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bulk-entries.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/controllers/bulk-entries.controller.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EACR,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACpB,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;GAQG;AACH,qBAEa,qBAAqB;IAG1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,kBAAkB;IAG/C,gFAAgF;IAIhF,cAAc,CACS,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,UAAU,EACJ,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,kBAAkB,CAAC;IAQ9B,OAAO,CACgB,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,UAAU,EACJ,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,iBAAiB,CAAC;IAQ7B,SAAS,CACc,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,UAAU,EACJ,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,gBAAgB,CAAC;IAQ5B,MAAM,CACiB,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,UAAU,EACJ,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,gBAAgB,CAAC;IAQ5B,OAAO,CACgB,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,UAAU,EACJ,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,gBAAgB,CAAC;IAQ5B,KAAK,CACkB,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,UAAU,EACJ,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,gBAAgB,CAAC;CAI/B"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ContentTypeRegistry } from '../../registry/content-type-registry';
|
|
2
|
-
import { EntryWriterService } from '../services/entry-writer.service';
|
|
3
|
-
import { SaveEntryDto } from '../dto/save-entry.dto';
|
|
4
|
-
import type { EntryRecord } from '../types/entry-list-view';
|
|
5
|
-
/**
|
|
6
|
-
* `POST /api/content/:typeName` — create a draft entry from a validated values
|
|
7
|
-
* bag. The `:typeName` resolves via the registry (404 if unknown); the body is
|
|
8
|
-
* validated against the type's field specs (422 with the issue list on failure).
|
|
9
|
-
* `OriginGuard` defends this state-changing POST (CSRF); `WorkspaceGuard` scopes
|
|
10
|
-
* it to a workspace the caller belongs to; `content:create` gates it. The
|
|
11
|
-
* synchronous CSRF + permission guards run before `WorkspaceGuard` so a rejected
|
|
12
|
-
* request never incurs its membership DB probe.
|
|
13
|
-
*/
|
|
14
|
-
export declare class CreateEntryController {
|
|
15
|
-
private readonly registry;
|
|
16
|
-
private readonly writer;
|
|
17
|
-
constructor(registry: ContentTypeRegistry, writer: EntryWriterService);
|
|
18
|
-
create(typeName: string, body: SaveEntryDto, workspaceId: string): Promise<EntryRecord>;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=create-entry.controller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-entry.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/controllers/create-entry.controller.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D;;;;;;;;GAQG;AACH,qBAGa,qBAAqB;IAG1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,kBAAkB;IAI/C,MAAM,CACiB,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,YAAY,EACN,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,WAAW,CAAC;CAW1B"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ContentTypeRegistry } from '../../registry/content-type-registry';
|
|
2
|
-
import { EntryWriterService } from '../services/entry-writer.service';
|
|
3
|
-
import type { EntryRecord } from '../types/entry-list-view';
|
|
4
|
-
/**
|
|
5
|
-
* Single-entry removal lifecycle, all gated on `content:delete`:
|
|
6
|
-
* - `DELETE /api/content/:typeName/:id` — soft delete (stamp `deleted_at`) for a
|
|
7
|
-
* paranoid type, hard delete otherwise; 204.
|
|
8
|
-
* - `POST /api/content/:typeName/:id/restore` — clear the tombstone (paranoid
|
|
9
|
-
* only); returns the restored record.
|
|
10
|
-
* - `DELETE /api/content/:typeName/:id/permanent` — permanently remove a
|
|
11
|
-
* tombstoned row (paranoid only); 204.
|
|
12
|
-
*
|
|
13
|
-
* `OriginGuard` defends these state-changing writes; `WorkspaceGuard` scopes them
|
|
14
|
-
* to a workspace the caller belongs to.
|
|
15
|
-
*/
|
|
16
|
-
export declare class DeleteEntryController {
|
|
17
|
-
private readonly registry;
|
|
18
|
-
private readonly writer;
|
|
19
|
-
constructor(registry: ContentTypeRegistry, writer: EntryWriterService);
|
|
20
|
-
remove(typeName: string, id: string, workspaceId: string): Promise<void>;
|
|
21
|
-
restore(typeName: string, id: string, workspaceId: string): Promise<EntryRecord>;
|
|
22
|
-
purge(typeName: string, id: string, workspaceId: string): Promise<void>;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=delete-entry.controller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-entry.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/controllers/delete-entry.controller.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D;;;;;;;;;;;GAWG;AACH,qBAGa,qBAAqB;IAG1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,kBAAkB;IAKzC,MAAM,CACW,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,IAAI,CAAC;IAMhB,OAAO,CACgB,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,WAAW,CAAC;IAOjB,KAAK,CACY,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,IAAI,CAAC;CAInB"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { ContentTypeRegistry } from '../../registry/content-type-registry';
|
|
2
|
-
import { EntryWriterService } from '../services/entry-writer.service';
|
|
3
|
-
import type { EntryRecord, EntryRelationsView, RelationFieldView } from '../types/entry-list-view';
|
|
4
|
-
/**
|
|
5
|
-
* `GET /api/content/:typeName/:id` — one live entry by id (404 if unknown or
|
|
6
|
-
* soft-deleted), so the editor can open an entry by deep link without relying on
|
|
7
|
-
* the records-list cache. `WorkspaceGuard` scopes it to a workspace the caller
|
|
8
|
-
* belongs to; gated on `content:read`.
|
|
9
|
-
*/
|
|
10
|
-
export declare class GetEntryController {
|
|
11
|
-
private readonly registry;
|
|
12
|
-
private readonly writer;
|
|
13
|
-
constructor(registry: ContentTypeRegistry, writer: EntryWriterService);
|
|
14
|
-
getOne(typeName: string, id: string, workspaceId: string): Promise<EntryRecord>;
|
|
15
|
-
/**
|
|
16
|
-
* `GET /api/content/:typeName/:id/relations` — one entry's relation links,
|
|
17
|
-
* keyed by field name. Every relation field (owning single/many **and**
|
|
18
|
-
* inverse back-references) resolved to display-ready refs (id + title) in a
|
|
19
|
-
* bounded set of queries, so the editor can render assigned relations by
|
|
20
|
-
* title and seed the form value with their ids without a round-trip per
|
|
21
|
-
* link. 404 when the entry is missing or soft-deleted in this workspace.
|
|
22
|
-
*/
|
|
23
|
-
getRelations(typeName: string, id: string, workspaceId: string): Promise<EntryRelationsView>;
|
|
24
|
-
/**
|
|
25
|
-
* `GET /api/content/:typeName/:id/relations/:field` — one page of a single
|
|
26
|
-
* relation field's links (`{ items, total }`), ordered by position. Drives
|
|
27
|
-
* the editor's infinite-scroll of a many/inverse relation, so a field with
|
|
28
|
-
* thousands of links is paged, never loaded whole. `?page=&pageSize=`
|
|
29
|
-
* (1-based; clamped). 400 if `field` isn't a relation; 404 if the entry is
|
|
30
|
-
* missing. `content:read`.
|
|
31
|
-
*/
|
|
32
|
-
getRelationField(typeName: string, id: string, field: string, workspaceId: string, page?: string, pageSize?: string): Promise<RelationFieldView>;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=get-entry.controller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-entry.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/controllers/get-entry.controller.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EACR,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACpB,MAAM,0BAA0B,CAAC;AAIlC;;;;;GAKG;AACH,qBAGa,kBAAkB;IAGvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,kBAAkB;IAI/C,MAAM,CACiB,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,WAAW,CAAC;IAKvB;;;;;;;OAOG;IAEG,YAAY,CACK,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,kBAAkB,CAAC;IAO9B;;;;;;;OAOG;IAEH,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,20 +0,0 @@
|
|
|
1
|
-
import type { ContentTypeRegistry } from '../../registry/content-type-registry';
|
|
2
|
-
import { EntriesService } from '../services/entries.service';
|
|
3
|
-
import { ListEntriesQueryDto } from '../dto/list-entries-query.dto';
|
|
4
|
-
import type { EntryListView } from '../types/entry-list-view';
|
|
5
|
-
/**
|
|
6
|
-
* `GET /api/content/:typeName` — one page of a collection's entries, filtered/
|
|
7
|
-
* searched/sorted via query params (`?search=`, `?filter=`, `?sort=`, `?page=`,
|
|
8
|
-
* `?pageSize=`). The `:typeName` is resolved from the registry (404 if unknown),
|
|
9
|
-
* so this single route serves every collection; the service runs the generic SQL
|
|
10
|
-
* pipeline against the type's generated table. Authentication is enforced by the
|
|
11
|
-
* app-wide AuthGuard; `WorkspaceGuard` scopes the request to a workspace the
|
|
12
|
-
* caller belongs to; read access is gated on `content:read`.
|
|
13
|
-
*/
|
|
14
|
-
export declare class ListEntriesController {
|
|
15
|
-
private readonly registry;
|
|
16
|
-
private readonly entries;
|
|
17
|
-
constructor(registry: ContentTypeRegistry, entries: EntriesService);
|
|
18
|
-
list(typeName: string, query: ListEntriesQueryDto, workspaceId: string): Promise<EntryListView>;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=list-entries.controller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-entries.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/controllers/list-entries.controller.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;;;;;;;GAQG;AACH,qBAGa,qBAAqB;IAG1B,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;CAO5B"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ContentTypeRegistry } from '../../registry/content-type-registry';
|
|
2
|
-
import { EntryWriterService } from '../services/entry-writer.service';
|
|
3
|
-
import type { EntryRecord } from '../types/entry-list-view';
|
|
4
|
-
/**
|
|
5
|
-
* `POST /api/content/:typeName/:id/publish` and `.../unpublish` — the publish
|
|
6
|
-
* workflow for a single entry. Publish revalidates the stored row (a 422 if the
|
|
7
|
-
* draft no longer passes), then stamps `status='published'` + `published_at`;
|
|
8
|
-
* unpublish reverts to draft. Both 400 on a non-publishable type and 404 on a
|
|
9
|
-
* missing live row. `OriginGuard` defends the writes; `WorkspaceGuard` scopes
|
|
10
|
-
* them to a workspace the caller belongs to; `content:publish` gates them.
|
|
11
|
-
*/
|
|
12
|
-
export declare class PublishEntryController {
|
|
13
|
-
private readonly registry;
|
|
14
|
-
private readonly writer;
|
|
15
|
-
constructor(registry: ContentTypeRegistry, writer: EntryWriterService);
|
|
16
|
-
publish(typeName: string, id: string, workspaceId: string): Promise<EntryRecord>;
|
|
17
|
-
unpublish(typeName: string, id: string, workspaceId: string): Promise<EntryRecord>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=publish-entry.controller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"publish-entry.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/controllers/publish-entry.controller.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D;;;;;;;GAOG;AACH,qBAGa,sBAAsB;IAG3B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,kBAAkB;IAI/C,OAAO,CACgB,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,WAAW,CAAC;IAMvB,SAAS,CACc,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,WAAW,CAAC;CAI1B"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { AnyContentType } from '../../types/content-type';
|
|
2
|
-
import type { ContentTypeRegistry } from '../../registry/content-type-registry';
|
|
3
|
-
/**
|
|
4
|
-
* Resolve a `:typeName` route param to a registered content type, or throw 404.
|
|
5
|
-
* Every entries controller routes one path per HTTP verb against the registry,
|
|
6
|
-
* so this single lookup keeps them thin and consistent.
|
|
7
|
-
*/
|
|
8
|
-
export declare function resolveType(registry: ContentTypeRegistry, typeName: string): AnyContentType;
|
|
9
|
-
//# sourceMappingURL=resolve-type.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-type.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/controllers/resolve-type.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAEhF;;;;GAIG;AACH,wBAAgB,WAAW,CACvB,QAAQ,EAAE,mBAAmB,EAC7B,QAAQ,EAAE,MAAM,GACjB,cAAc,CAMhB"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { ContentTypeRegistry } from '../../registry/content-type-registry';
|
|
2
|
-
import { EntryWriterService } from '../services/entry-writer.service';
|
|
3
|
-
import { SaveEntryDto } from '../dto/save-entry.dto';
|
|
4
|
-
import type { EntryRecord } from '../types/entry-list-view';
|
|
5
|
-
/**
|
|
6
|
-
* `PATCH /api/content/:typeName/:id` — replace a live entry's values with a
|
|
7
|
-
* validated bag (the editor always submits the full document). 404 if there's no
|
|
8
|
-
* live row; 422 with the issue list on validation failure. `OriginGuard` defends
|
|
9
|
-
* this state-changing write; `WorkspaceGuard` scopes it to a workspace the caller
|
|
10
|
-
* belongs to; `content:update` gates it.
|
|
11
|
-
*/
|
|
12
|
-
export declare class UpdateEntryController {
|
|
13
|
-
private readonly registry;
|
|
14
|
-
private readonly writer;
|
|
15
|
-
constructor(registry: ContentTypeRegistry, writer: EntryWriterService);
|
|
16
|
-
update(typeName: string, id: string, body: SaveEntryDto, workspaceId: string): Promise<EntryRecord>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=update-entry.controller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-entry.controller.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/controllers/update-entry.controller.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D;;;;;;GAMG;AACH,qBAGa,qBAAqB;IAG1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,kBAAkB;IAI/C,MAAM,CACiB,QAAQ,EAAE,MAAM,EACP,EAAE,EAAE,MAAM,EAC9B,IAAI,EAAE,YAAY,EACN,WAAW,EAAE,MAAM,GACxC,OAAO,CAAC,WAAW,CAAC;CAU1B"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Body for the bulk endpoints (`/bulk/publish`, `/bulk/unpublish`,
|
|
3
|
-
* `/bulk/delete`, `/bulk/restore`, and the publish dry run): the set of entry
|
|
4
|
-
* ids to act on. Non-empty, uuid-typed, and capped at {@link BULK_MAX_IDS} so a
|
|
5
|
-
* single request can't fan out unbounded work.
|
|
6
|
-
*/
|
|
7
|
-
export declare class BulkIdsDto {
|
|
8
|
-
/** Entry ids to act on. */
|
|
9
|
-
ids: string[];
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=bulk-ids.dto.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bulk-ids.dto.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/dto/bulk-ids.dto.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,qBAAa,UAAU;IACnB,2BAA2B;IAK3B,GAAG,EAAG,MAAM,EAAE,CAAC;CAClB"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/** `?deleted=only` flips the list to the trash view (soft-deleted rows). */
|
|
2
|
-
export declare const DELETED_ONLY = "only";
|
|
3
|
-
/**
|
|
4
|
-
* Query parameters for `GET /api/content/:typeName`. Pagination is 1-based; the
|
|
5
|
-
* service applies the defaults (page 1, {@link DEFAULT_PAGE_SIZE}) so the
|
|
6
|
-
* contract has one source of truth. `@Type` coerces the raw query strings — the
|
|
7
|
-
* host's global `ValidationPipe` transforms but does not implicitly convert.
|
|
8
|
-
*/
|
|
9
|
-
export declare class ListEntriesQueryDto {
|
|
10
|
-
/** Free-text search across the type's text-like columns (text/richtext/select). */
|
|
11
|
-
search?: string;
|
|
12
|
-
/**
|
|
13
|
-
* Structured filter tree as a JSON string (`?filter=<json>`), produced by
|
|
14
|
-
* the admin query builder and validated against the type's derived filter
|
|
15
|
-
* schema by `parseFilterTree`. Length-capped here as a first line of
|
|
16
|
-
* defence; the engine's node/depth caps bound the parsed shape.
|
|
17
|
-
*/
|
|
18
|
-
filter?: string;
|
|
19
|
-
/** Sort spec: a column id (ascending) or `-`-prefixed (descending). */
|
|
20
|
-
sort?: string;
|
|
21
|
-
/** 1-based page number. */
|
|
22
|
-
page?: number;
|
|
23
|
-
/** Rows per page, capped at {@link MAX_PAGE_SIZE}. */
|
|
24
|
-
pageSize?: number;
|
|
25
|
-
/**
|
|
26
|
-
* `only` lists soft-deleted rows (the trash view) instead of live ones.
|
|
27
|
-
* Meaningful only for paranoid types; ignored otherwise. Absent (the
|
|
28
|
-
* default) lists live rows.
|
|
29
|
-
*/
|
|
30
|
-
deleted?: typeof DELETED_ONLY;
|
|
31
|
-
/**
|
|
32
|
-
* Locale slug the list targets — an **extension-owned** param this package
|
|
33
|
-
* declares (the strict ValidationPipe rejects undeclared keys) but never
|
|
34
|
-
* interprets: it's forwarded to the bound `CONTENT_ENTRY_EXTENSION`, which
|
|
35
|
-
* validates and applies it. Ignored when no extension is bound or the type
|
|
36
|
-
* isn't localized.
|
|
37
|
-
*/
|
|
38
|
-
locale?: string;
|
|
39
|
-
/**
|
|
40
|
-
* `default` widens the locale scope to fall back to the default locale
|
|
41
|
-
* where the requested one is missing (the relation picker's mode).
|
|
42
|
-
* Extension-owned, like {@link locale}.
|
|
43
|
-
*/
|
|
44
|
-
localeFallback?: string;
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=list-entries-query.dto.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-entries-query.dto.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/dto/list-entries-query.dto.ts"],"names":[],"mappings":"AAYA,4EAA4E;AAC5E,eAAO,MAAM,YAAY,SAAS,CAAC;AAEnC;;;;;GAKG;AACH,qBAAa,mBAAmB;IAC5B,mFAAmF;IAInF,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IAIH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,uEAAuE;IAIvE,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,2BAA2B;IAK3B,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,sDAAsD;IAMtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IAGH,OAAO,CAAC,EAAE,OAAO,YAAY,CAAC;IAE9B;;;;;;OAMG;IAIH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IAGH,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type ValidationOptions, type ValidatorConstraintInterface } from 'class-validator';
|
|
2
|
-
/**
|
|
3
|
-
* Validates the `relations` bag of {@link SaveEntryDto}: a map from field name to
|
|
4
|
-
* `{ link?, unlink?, order? }`, each an array of uuid strings. class-validator
|
|
5
|
-
* can't decorate a `Record`'s dynamic keys, so this constraint checks the shape
|
|
6
|
-
* of every value — turning a malformed delta (a non-array `unlink`, a non-uuid
|
|
7
|
-
* id, an unknown inner key, or an over-large array) into a clean **400** instead
|
|
8
|
-
* of letting it reach `inArray(...)` against a `uuid` column and surface as a
|
|
9
|
-
* 500. Unknown inner keys are rejected so the nested `Record` can't slip past
|
|
10
|
-
* the app's `forbidNonWhitelisted` posture, and the id arrays and the map itself
|
|
11
|
-
* are size-bounded so a single request can't carry an unbounded payload.
|
|
12
|
-
*/
|
|
13
|
-
export declare class RelationDeltaMapConstraint implements ValidatorConstraintInterface {
|
|
14
|
-
validate(value: unknown): boolean;
|
|
15
|
-
defaultMessage(): string;
|
|
16
|
-
}
|
|
17
|
-
/** Property decorator applying {@link RelationDeltaMapConstraint}. */
|
|
18
|
-
export declare function IsRelationDeltaMap(options?: ValidationOptions): (object: object, propertyName: string) => void;
|
|
19
|
-
//# sourceMappingURL=relation-delta-map.validator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"relation-delta-map.validator.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/dto/relation-delta-map.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,EACpC,MAAM,iBAAiB,CAAC;AAmCzB;;;;;;;;;;GAUG;AACH,qBACa,0BACT,YAAW,4BAA4B;IAEvC,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAwBjC,cAAc,IAAI,MAAM;CAG3B;AAED,sEAAsE;AACtE,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,iBAAiB,IAClD,QAAQ,MAAM,EAAE,cAAc,MAAM,KAAG,IAAI,CAOtD"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { RelationDelta } from '../types/entry-list-view';
|
|
2
|
-
/**
|
|
3
|
-
* Body for `POST /api/content/:typeName` (create) and
|
|
4
|
-
* `PATCH /api/content/:typeName/:id` (update). The field `values` bag crosses the
|
|
5
|
-
* wire, plus optional per-field relation **deltas** (`relations`) — the editor
|
|
6
|
-
* stages its many-to-many / inverse link changes locally and sends them here
|
|
7
|
-
* with the rest of the document, so a save persists everything in **one
|
|
8
|
-
* transaction** without ever transmitting a huge relation whole.
|
|
9
|
-
*
|
|
10
|
-
* Reserved envelope columns (`status`/`published_at`/`deleted_at`) are owned by
|
|
11
|
-
* the service and can't be set from here: `toColumns` projects only keys
|
|
12
|
-
* declared on the type, so a reserved (or otherwise unknown) key in the bag is
|
|
13
|
-
* silently dropped before storage; on a non-publishable type
|
|
14
|
-
* `EntryValidationService` additionally flags unknown keys as a 422. The bag's
|
|
15
|
-
* *contents* are validated against the type's field specs by that same service
|
|
16
|
-
* (a dynamic, per-type contract class-validator can't express); the relation
|
|
17
|
-
* deltas' ids are validated as existing workspace entries by
|
|
18
|
-
* `RelationLinkService`. `values` is structurally only "an object" (its contents
|
|
19
|
-
* are the per-type contract); the `relations` bag's *shape* — each value a
|
|
20
|
-
* `{ link?, unlink?, order? }` of uuid arrays — is enforced here so a malformed
|
|
21
|
-
* delta is a clean 400, not a 500 from a bad id hitting the query.
|
|
22
|
-
*/
|
|
23
|
-
export declare class SaveEntryDto {
|
|
24
|
-
/** Field values keyed by field name. */
|
|
25
|
-
values: Record<string, unknown>;
|
|
26
|
-
/**
|
|
27
|
-
* Per-field relation deltas (`{ <field>: { link?, unlink?, order? } }`) —
|
|
28
|
-
* many/inverse relations only; a single relation is set through `values`.
|
|
29
|
-
*/
|
|
30
|
-
relations?: Record<string, RelationDelta>;
|
|
31
|
-
/**
|
|
32
|
-
* Locale slug the entry is created in — an **extension-owned** param this
|
|
33
|
-
* package declares but never interprets (forwarded to the bound
|
|
34
|
-
* `CONTENT_ENTRY_EXTENSION`, which validates it and stamps the envelope
|
|
35
|
-
* column). Read on create only; an update never re-homes a row's locale.
|
|
36
|
-
*/
|
|
37
|
-
locale?: string;
|
|
38
|
-
/**
|
|
39
|
-
* The existing translation group a created row joins (making it a sibling)
|
|
40
|
-
* — an **extension-owned**, opaque param, like {@link locale}. Absent → the
|
|
41
|
-
* row starts its own fresh group. The bound extension validates it against
|
|
42
|
-
* the workspace. Read on create only.
|
|
43
|
-
*/
|
|
44
|
-
localeGroupId?: string;
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=save-entry.dto.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"save-entry.dto.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/dto/save-entry.dto.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,YAAY;IACrB,wCAAwC;IAExC,MAAM,EAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjC;;;OAGG;IAIH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAE1C;;;;;OAKG;IAIH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IAGH,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { AnyContentType } from '../../../types/content-type';
|
|
2
|
-
/**
|
|
3
|
-
* The set of field names a `?fields=` list selects, or `undefined` when the
|
|
4
|
-
* caller asked for none (the default — the whole record).
|
|
5
|
-
*/
|
|
6
|
-
export type FieldSelection = ReadonlySet<string> | undefined;
|
|
7
|
-
/**
|
|
8
|
-
* Parse `?fields=title,slug` into the set {@link toRecord} projects `values`
|
|
9
|
-
* down to. Only fields that carry a column are selectable — a many-relation or
|
|
10
|
-
* an inverse back-reference has no value on the row (its links live in a join
|
|
11
|
-
* table), so naming one is a client error, not a silently empty key.
|
|
12
|
-
*
|
|
13
|
-
* **Unknown names are rejected with a 400**, deliberately unlike
|
|
14
|
-
* `?relationFields=`, which drops them. That list is an internal rendering hint
|
|
15
|
-
* where a hidden column legitimately vanishes; this one is an external API
|
|
16
|
-
* contract, where silently honouring `?fields=titel` would return records with
|
|
17
|
-
* no fields and no explanation. Failing loudly makes the typo obvious.
|
|
18
|
-
*
|
|
19
|
-
* Envelope data (`id`, timestamps, `status`/`publishedAt`, `locale`) is **not**
|
|
20
|
-
* selectable and is always returned — it identifies the record rather than
|
|
21
|
-
* describing it, and callers can ignore what they don't need.
|
|
22
|
-
*/
|
|
23
|
-
export declare function parseFieldSelection(type: AnyContentType, raw: string | undefined): FieldSelection;
|
|
24
|
-
//# sourceMappingURL=field-selection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"field-selection.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/infrastructure/persistence/field-selection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGlE;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;AAE7D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAC/B,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,MAAM,GAAG,SAAS,GACxB,cAAc,CAiBhB"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { type FieldSchema, type FilterSchema, type ScalarFieldSchema } from '@ortha-cms/utils-server';
|
|
2
|
-
import { type AnyContentType } from '../../../types/content-type';
|
|
3
|
-
import { type AnyFieldSpec } from '../../../types/fields';
|
|
4
|
-
/**
|
|
5
|
-
* The filter scalar type for one content field, or `null` to leave it
|
|
6
|
-
* unfilterable. Mirrors the admin's `filterFieldsFromSchema`: text-like fields
|
|
7
|
-
* filter as strings, `select` as an enum of its options, numerics as numbers,
|
|
8
|
-
* dates as dates. `json`/`multiselect` have no scalar editor, and `relation`
|
|
9
|
-
* filtering (by raw FK uuid) has no UI yet — all skipped.
|
|
10
|
-
*/
|
|
11
|
-
export declare function scalarTypeFor(spec: AnyFieldSpec): ScalarFieldSchema | null;
|
|
12
|
-
/**
|
|
13
|
-
* Whether a field is backed by a comparable scalar column — the single source of
|
|
14
|
-
* truth for "can this field be filtered or sorted". `json`/`multiselect` (jsonb)
|
|
15
|
-
* and `relation` (FK uuid / join table) are not: they have no scalar editor and
|
|
16
|
-
* ordering them is meaningless. The sort whitelist and the filter schema both
|
|
17
|
-
* derive from this, so the two can't drift apart.
|
|
18
|
-
*/
|
|
19
|
-
export declare function isScalarField(spec: AnyFieldSpec): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Build the query-builder `FilterSchema` for one content type at request time.
|
|
22
|
-
* Whitelists the always-present envelope columns (`createdAt`/`updatedAt`),
|
|
23
|
-
* plus `status`/`publishedAt` only on publishable types, plus `locale` on i18n
|
|
24
|
-
* types, plus every filterable field (those `isScalarField` admits — the same
|
|
25
|
-
* set the admin's `filterFieldsFromSchema` offers), keyed by the property
|
|
26
|
-
* names the engine resolves to table columns. (`status` has a matching admin
|
|
27
|
-
* filter; the timestamp envelopes like `publishedAt` are filterable via the
|
|
28
|
-
* API but have no UI control yet.) This is the security boundary: only listed
|
|
29
|
-
* fields/ops reach SQL, and the engine's depth/node caps bound payload
|
|
30
|
-
* blow-up.
|
|
31
|
-
*
|
|
32
|
-
* `extensionFields` are **virtual** fields contributed by the bound
|
|
33
|
-
* `CONTENT_ENTRY_EXTENSION` (e.g. locale aggregates): their declarations merge
|
|
34
|
-
* into `fields` (so the parser can coerce values) and their names are
|
|
35
|
-
* registered on the schema's `extensionFields` set, routing them to the
|
|
36
|
-
* extension's own SQL resolver instead of a table column. A field column
|
|
37
|
-
* always wins a name collision — an extension cannot shadow real data.
|
|
38
|
-
*/
|
|
39
|
-
export declare function buildEntryFilterSchema(type: AnyContentType, extensionFields?: FieldSchema): FilterSchema;
|
|
40
|
-
//# sourceMappingURL=entry-filter-schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-filter-schema.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/infrastructure/queries/entry-filter-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE9E;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,iBAAiB,GAAG,IAAI,CAsB1E;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAEzD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAClC,IAAI,EAAE,cAAc,EACpB,eAAe,CAAC,EAAE,WAAW,GAC9B,YAAY,CAmCd"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { type Database } from '@ortha-cms/database';
|
|
2
|
-
import { type ContentEntryExtension } from '../../extension/entry-extension';
|
|
3
|
-
import type { AnyContentType } from '../../types/content-type';
|
|
4
|
-
import { type ListEntriesQueryDto } from '../dto/list-entries-query.dto';
|
|
5
|
-
import type { EntryListView } from '../types/entry-list-view';
|
|
6
|
-
/**
|
|
7
|
-
* Reads a collection's entries. Generic over the content type: the physical
|
|
8
|
-
* table, the filterable columns, the searchable columns, and the sort whitelist
|
|
9
|
-
* are all derived from `type` at request time, so one service backs every
|
|
10
|
-
* collection. Owns no schema of its own — it queries the HOST-owned generated
|
|
11
|
-
* `content_<name>` tables through the shared Drizzle client.
|
|
12
|
-
*/
|
|
13
|
-
export declare class EntriesService {
|
|
14
|
-
private readonly db;
|
|
15
|
-
private readonly extension?;
|
|
16
|
-
constructor(db: Database, extension?: ContentEntryExtension | undefined);
|
|
17
|
-
/**
|
|
18
|
-
* One page of a collection's entries: search → filter → sort → paginate, run
|
|
19
|
-
* in SQL against the type's generated table, returned as the
|
|
20
|
-
* `{ items, total, page, pageSize }` envelope the admin records table renders.
|
|
21
|
-
* Scoped to `workspaceId` — only the calling workspace's entries are counted
|
|
22
|
-
* or listed.
|
|
23
|
-
*/
|
|
24
|
-
list(type: AnyContentType, query: ListEntriesQueryDto, workspaceId: string): Promise<EntryListView>;
|
|
25
|
-
/**
|
|
26
|
-
* The full WHERE: the workspace scope AND free-text search AND the
|
|
27
|
-
* query-builder `?filter=` tree AND (for paranoid types) the not-deleted
|
|
28
|
-
* guard. `and(undefined, …)` collapses empties, so an unfiltered list still
|
|
29
|
-
* scans the workspace's whole table. The workspace predicate is always
|
|
30
|
-
* present, so an entry never leaks across workspaces. A malformed filter
|
|
31
|
-
* throws a `FilterException` (HTTP 400).
|
|
32
|
-
*/
|
|
33
|
-
private listWhere;
|
|
34
|
-
/**
|
|
35
|
-
* The soft-delete guard for paranoid types: the default list excludes
|
|
36
|
-
* tombstoned rows (`deleted_at IS NULL`); `?deleted=only` flips to the trash
|
|
37
|
-
* view (`deleted_at IS NOT NULL`). A non-paranoid type has no `deleted_at`,
|
|
38
|
-
* so the predicate collapses to `undefined`.
|
|
39
|
-
*/
|
|
40
|
-
private deletedPredicate;
|
|
41
|
-
/**
|
|
42
|
-
* Case-insensitive `ILIKE` across the type's text-like columns, OR-ed
|
|
43
|
-
* together; `undefined` when there's no search term. The needle's LIKE
|
|
44
|
-
* metacharacters are escaped so a literal `%`/`_` searches literally.
|
|
45
|
-
*/
|
|
46
|
-
private searchPredicate;
|
|
47
|
-
/**
|
|
48
|
-
* Translate the `?sort=` spec (`col` asc, `-col` desc) into an ORDER BY,
|
|
49
|
-
* always with an `id` tiebreaker so pagination is stable across requests.
|
|
50
|
-
* Sortable = the always-present envelope columns + `status` (publishable
|
|
51
|
-
* only) + the type's **scalar** fields. Non-scalar fields (`json`/
|
|
52
|
-
* `multiselect`, single/many `relation`) are excluded — a many-relation has
|
|
53
|
-
* no column on the main table at all, so ordering by it would pass
|
|
54
|
-
* `undefined` to `asc`/`desc`; the others have no meaningful order. An
|
|
55
|
-
* unknown or excluded column falls back to `updatedAt` desc.
|
|
56
|
-
*/
|
|
57
|
-
private orderBy;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=entries.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entries.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/services/entries.service.ts"],"names":[],"mappings":"AAcA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAEH,KAAK,qBAAqB,EAC7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAEH,KAAK,mBAAmB,EAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAiB9D;;;;;;GAMG;AACH,qBACa,cAAc;IAED,OAAO,CAAC,QAAQ,CAAC,EAAE;IAKrC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC;gBALQ,EAAE,EAAE,QAAQ,EAK9B,SAAS,CAAC,EAAE,qBAAqB,YAAA;IAGtD;;;;;;OAMG;IACG,IAAI,CACN,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE,mBAAmB,EAC1B,WAAW,EAAE,MAAM,GACpB,OAAO,CAAC,aAAa,CAAC;IA8BzB;;;;;;;OAOG;YACW,SAAS;IAqCvB;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;IAWxB;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAcvB;;;;;;;;;OASG;IACH,OAAO,CAAC,OAAO;CAsBlB"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { type Database } from '@ortha-cms/database';
|
|
2
|
-
import type { ContentEntryCounter } from '@ortha-cms/identity-server';
|
|
3
|
-
import type { ContentTypeRegistry } from '../../registry/content-type-registry';
|
|
4
|
-
/**
|
|
5
|
-
* Implements identity's {@link ContentEntryCounter} port over the generated
|
|
6
|
-
* `content_<name>` tables: counts how many entries of a content type a
|
|
7
|
-
* workspace holds. Bound to `CONTENT_ENTRY_COUNTER` in {@link ContentModule},
|
|
8
|
-
* so identity's "revoke a content-type grant only when empty" rule resolves
|
|
9
|
-
* against the real stored entries.
|
|
10
|
-
*/
|
|
11
|
-
export declare class EntryCounterService implements ContentEntryCounter {
|
|
12
|
-
private readonly db;
|
|
13
|
-
private readonly registry;
|
|
14
|
-
constructor(db: Database, registry: ContentTypeRegistry);
|
|
15
|
-
/**
|
|
16
|
-
* Every stored row of content type `slug` in `workspaceId`. Counts the
|
|
17
|
-
* whole workspace slice of the type's table — including soft-deleted rows
|
|
18
|
-
* for paranoid types (data that still exists must keep the grant). An
|
|
19
|
-
* unknown slug (no such content type) counts as `0`.
|
|
20
|
-
*/
|
|
21
|
-
countEntries(workspaceId: string, slug: string): Promise<number>;
|
|
22
|
-
/**
|
|
23
|
-
* Every stored row the workspace holds across **all** content types —
|
|
24
|
-
* summed over each type's table. Backs the workspace-delete guard (delete is
|
|
25
|
-
* refused until this is zero). The per-type counts run concurrently.
|
|
26
|
-
*/
|
|
27
|
-
countWorkspaceEntries(workspaceId: string): Promise<number>;
|
|
28
|
-
/** Counts a single content type's rows in a workspace. */
|
|
29
|
-
private countTable;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=entry-counter.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-counter.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/services/entry-counter.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAMhF;;;;;;GAMG;AACH,qBACa,mBAAoB,YAAW,mBAAmB;IAErC,OAAO,CAAC,QAAQ,CAAC,EAAE;IACZ,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADf,EAAE,EAAE,QAAQ,EACL,QAAQ,EAAE,mBAAmB;IAG3E;;;;;OAKG;IACG,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAMtE;;;;OAIG;IACG,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IASjE,0DAA0D;YAC5C,UAAU;CAW3B"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { type FieldSchema, type FilterSchema } from '@ortha-cms/utils-server';
|
|
2
|
-
import { type AnyContentType } from '../../types/content-type';
|
|
3
|
-
import { type AnyFieldSpec } from '../../types/fields';
|
|
4
|
-
/**
|
|
5
|
-
* Whether a field is backed by a comparable scalar column — the single source of
|
|
6
|
-
* truth for "can this field be filtered or sorted". `json`/`multiselect` (jsonb)
|
|
7
|
-
* and `relation` (FK uuid / join table) are not: they have no scalar editor and
|
|
8
|
-
* ordering them is meaningless. The sort whitelist and the filter schema both
|
|
9
|
-
* derive from this, so the two can't drift apart.
|
|
10
|
-
*/
|
|
11
|
-
export declare function isScalarField(spec: AnyFieldSpec): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Build the query-builder `FilterSchema` for one content type at request time.
|
|
14
|
-
* Whitelists the always-present envelope columns (`createdAt`/`updatedAt`),
|
|
15
|
-
* plus `status`/`publishedAt` only on publishable types, plus `locale` on i18n
|
|
16
|
-
* types, plus every filterable field (those `isScalarField` admits — the same
|
|
17
|
-
* set the admin's `filterFieldsFromSchema` offers), keyed by the property
|
|
18
|
-
* names the engine resolves to table columns. (`status` has a matching admin
|
|
19
|
-
* filter; the timestamp envelopes like `publishedAt` are filterable via the
|
|
20
|
-
* API but have no UI control yet.) This is the security boundary: only listed
|
|
21
|
-
* fields/ops reach SQL, and the engine's depth/node caps bound payload
|
|
22
|
-
* blow-up.
|
|
23
|
-
*
|
|
24
|
-
* `extensionFields` are **virtual** fields contributed by the bound
|
|
25
|
-
* `CONTENT_ENTRY_EXTENSION` (e.g. locale aggregates): their declarations merge
|
|
26
|
-
* into `fields` (so the parser can coerce values) and their names are
|
|
27
|
-
* registered on the schema's `extensionFields` set, routing them to the
|
|
28
|
-
* extension's own SQL resolver instead of a table column. A field column
|
|
29
|
-
* always wins a name collision — an extension cannot shadow real data.
|
|
30
|
-
*/
|
|
31
|
-
export declare function buildEntryFilterSchema(type: AnyContentType, extensionFields?: FieldSchema): FilterSchema;
|
|
32
|
-
//# sourceMappingURL=entry-filter-schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entry-filter-schema.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/services/entry-filter-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,WAAW,EAChB,KAAK,YAAY,EAEpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAiC3E;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAEzD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAClC,IAAI,EAAE,cAAc,EACpB,eAAe,CAAC,EAAE,WAAW,GAC9B,YAAY,CAmCd"}
|