@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulk-unpublish-entries.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/application/use-cases/bulk-unpublish-entries.use-case.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"bulk-unpublish-entries.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/application/use-cases/bulk-unpublish-entries.use-case.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,KAAK,UAAU,EACf,YAAY,EACZ,UAAU,EACb,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAC3F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAIjE;;;;;;;;;;GAUG;AACH,qBACa,2BAA2B;IAEhC,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFN,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,kBAAkB;IAGzC,OAAO,CACT,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,MAAM,EAAE,EACb,WAAW,EAAE,MAAM,EACnB,KAAK,CAAC,EAAE,UAAU,GACnB,OAAO,CAAC,gBAAgB,CAAC;CA6D/B"}
|
|
@@ -7,6 +7,7 @@ const database_1 = require("@orthacms/database");
|
|
|
7
7
|
const content_domain_1 = require("@orthacms/content-domain");
|
|
8
8
|
const entry_writer_service_1 = require("../../infrastructure/persistence/entry-writer.service");
|
|
9
9
|
const entry_1 = require("../../domain/entry");
|
|
10
|
+
const entry_row_1 = require("../../infrastructure/persistence/entry-row");
|
|
10
11
|
/**
|
|
11
12
|
* Revert a set of live entries to draft. Runs inside one {@link UnitOfWork}, and
|
|
12
13
|
* **one set of ids runs through all three effects**: the `{ count }` reported,
|
|
@@ -27,7 +28,7 @@ let BulkUnpublishEntriesUseCase = class BulkUnpublishEntriesUseCase {
|
|
|
27
28
|
this.outbox = outbox;
|
|
28
29
|
this.writer = writer;
|
|
29
30
|
}
|
|
30
|
-
async execute(type, ids, workspaceId) {
|
|
31
|
+
async execute(type, ids, workspaceId, actor) {
|
|
31
32
|
if (!type.publishable) {
|
|
32
33
|
throw new common_1.BadRequestException(`Content type "${type.name}" is not publishable.`);
|
|
33
34
|
}
|
|
@@ -38,21 +39,30 @@ let BulkUnpublishEntriesUseCase = class BulkUnpublishEntriesUseCase {
|
|
|
38
39
|
// The set that actually transitions (published → draft), captured
|
|
39
40
|
// before the write so we emit one event per real change.
|
|
40
41
|
const publishedIds = await this.writer.publishedIdsAmong(exec, type, ids, workspaceId);
|
|
42
|
+
// Read the labels **before** the write: an audit row carries a
|
|
43
|
+
// frozen title, and after `markDraftBulk` the rows are still there
|
|
44
|
+
// but a later kind (a purge) would have taken them, so reading them
|
|
45
|
+
// up front is the habit that keeps every bulk path the same shape.
|
|
46
|
+
const byId = await this.writer.loadLiveByIds(type, publishedIds, workspaceId, exec);
|
|
41
47
|
const count = await this.writer.markDraftBulk(exec, type, ids, workspaceId);
|
|
42
48
|
// Revert each really-transitioned entry's published revision back to
|
|
43
49
|
// draft — the same set the outbox emits an event for.
|
|
44
50
|
for (const id of publishedIds) {
|
|
45
51
|
await this.writer.markRevisionUnpublished(exec, id, workspaceId);
|
|
46
52
|
}
|
|
47
|
-
|
|
53
|
+
const events = publishedIds.flatMap((id) => {
|
|
54
|
+
const row = byId.get(id);
|
|
48
55
|
const entry = entry_1.Entry.rehydrate({
|
|
49
56
|
id,
|
|
50
57
|
contentType: type.name,
|
|
51
|
-
status: content_domain_1.ENTRY_STATUS.Published
|
|
58
|
+
status: content_domain_1.ENTRY_STATUS.Published,
|
|
59
|
+
workspaceId,
|
|
60
|
+
title: row ? (0, entry_row_1.entryTitle)(type, row) : null
|
|
52
61
|
});
|
|
53
62
|
entry.unpublish();
|
|
54
63
|
return entry.pullEvents();
|
|
55
|
-
})
|
|
64
|
+
});
|
|
65
|
+
await this.outbox.append(actor ? (0, database_1.attachActor)(events, actor) : events);
|
|
56
66
|
return { count };
|
|
57
67
|
});
|
|
58
68
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OutboxWriter, UnitOfWork } from '@orthacms/database';
|
|
1
|
+
import { type EventActor, OutboxWriter, UnitOfWork } from '@orthacms/database';
|
|
2
2
|
import type { AnyContentType } from '../../../types/content-type';
|
|
3
3
|
import { EntryValidationService } from '../../../validation/services/entry-validation.service';
|
|
4
4
|
import { EntryWriterService } from '../../infrastructure/persistence/entry-writer.service';
|
|
@@ -23,14 +23,12 @@ export declare class PublishEntryUseCase {
|
|
|
23
23
|
constructor(uow: UnitOfWork, outbox: OutboxWriter, writer: EntryWriterService, validation: EntryValidationService);
|
|
24
24
|
execute(type: AnyContentType, id: string, workspaceId: string,
|
|
25
25
|
/**
|
|
26
|
-
* The acting
|
|
27
|
-
* name who did this. Without it every content row in the activity
|
|
28
|
-
* read "System"
|
|
26
|
+
* The acting principal, merged onto the outbox events so the audit log
|
|
27
|
+
* can name who did this. Without it every content row in the activity
|
|
28
|
+
* log read "System" — which is also what a token-authenticated publish
|
|
29
|
+
* read as until `actor_type` let a credential be named.
|
|
29
30
|
*/
|
|
30
|
-
actor?:
|
|
31
|
-
id: string;
|
|
32
|
-
email: string | null;
|
|
33
|
-
},
|
|
31
|
+
actor?: EventActor,
|
|
34
32
|
/**
|
|
35
33
|
* The version to mark live, when publishing a **specific** earlier one
|
|
36
34
|
* whose content the caller already re-applied to the live row. Omitted
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-entry.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/application/use-cases/publish-entry.use-case.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"publish-entry.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/application/use-cases/publish-entry.use-case.ts"],"names":[],"mappings":"AAMA,OAAO,EAEH,KAAK,UAAU,EACf,YAAY,EACZ,UAAU,EACb,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAE3F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAK/D;;;;;;;;;;;GAWG;AACH,qBACa,mBAAmB;IAExB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAHV,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,kBAAkB,EAC1B,UAAU,EAAE,sBAAsB;IAGjD,OAAO,CACT,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,MAAM;IACnB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,UAAU;IAClB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,GACxB,OAAO,CAAC,WAAW,CAAC;IA+EvB,OAAO,CAAC,QAAQ;CAKnB"}
|
|
@@ -7,6 +7,7 @@ const database_1 = require("@orthacms/database");
|
|
|
7
7
|
const entry_validation_service_1 = require("../../../validation/services/entry-validation.service");
|
|
8
8
|
const entry_writer_service_1 = require("../../infrastructure/persistence/entry-writer.service");
|
|
9
9
|
const entry_row_1 = require("../../infrastructure/persistence/entry-row");
|
|
10
|
+
const entry_row_2 = require("../../infrastructure/persistence/entry-row");
|
|
10
11
|
const entry_1 = require("../../domain/entry");
|
|
11
12
|
const entry_publish_blocked_error_1 = require("../../domain/entry-publish-blocked.error");
|
|
12
13
|
/**
|
|
@@ -34,9 +35,10 @@ let PublishEntryUseCase = class PublishEntryUseCase {
|
|
|
34
35
|
}
|
|
35
36
|
async execute(type, id, workspaceId,
|
|
36
37
|
/**
|
|
37
|
-
* The acting
|
|
38
|
-
* name who did this. Without it every content row in the activity
|
|
39
|
-
* read "System"
|
|
38
|
+
* The acting principal, merged onto the outbox events so the audit log
|
|
39
|
+
* can name who did this. Without it every content row in the activity
|
|
40
|
+
* log read "System" — which is also what a token-authenticated publish
|
|
41
|
+
* read as until `actor_type` let a credential be named.
|
|
40
42
|
*/
|
|
41
43
|
actor,
|
|
42
44
|
/**
|
|
@@ -63,7 +65,11 @@ let PublishEntryUseCase = class PublishEntryUseCase {
|
|
|
63
65
|
const entry = entry_1.Entry.rehydrate({
|
|
64
66
|
id,
|
|
65
67
|
contentType: type.name,
|
|
66
|
-
status: current['status']
|
|
68
|
+
status: current['status'],
|
|
69
|
+
workspaceId,
|
|
70
|
+
// The stored row is already loaded, so the audit row gets a
|
|
71
|
+
// readable name for free rather than a bare uuid.
|
|
72
|
+
title: (0, entry_row_2.entryTitle)(type, current)
|
|
67
73
|
});
|
|
68
74
|
try {
|
|
69
75
|
entry.publish({ valid: issues.length === 0, issues });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OutboxWriter, UnitOfWork } from '@orthacms/database';
|
|
1
|
+
import { type EventActor, OutboxWriter, UnitOfWork } from '@orthacms/database';
|
|
2
2
|
import type { AnyContentType } from '../../../types/content-type';
|
|
3
3
|
import { EntryWriterService } from '../../infrastructure/persistence/entry-writer.service';
|
|
4
4
|
import type { EntryRecord } from '../../types/entry-list-view';
|
|
@@ -21,10 +21,7 @@ export declare class UnpublishEntryUseCase {
|
|
|
21
21
|
* name who did this. Without it every content row in the activity log
|
|
22
22
|
* read "System".
|
|
23
23
|
*/
|
|
24
|
-
actor?:
|
|
25
|
-
id: string;
|
|
26
|
-
email: string | null;
|
|
27
|
-
}): Promise<EntryRecord>;
|
|
24
|
+
actor?: EventActor): Promise<EntryRecord>;
|
|
28
25
|
private notFound;
|
|
29
26
|
}
|
|
30
27
|
//# sourceMappingURL=unpublish-entry.use-case.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unpublish-entry.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/application/use-cases/unpublish-entry.use-case.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"unpublish-entry.use-case.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/application/use-cases/unpublish-entry.use-case.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,KAAK,UAAU,EACf,YAAY,EACZ,UAAU,EACb,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAE3F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAI/D;;;;;;;GAOG;AACH,qBACa,qBAAqB;IAE1B,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFN,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,kBAAkB;IAGzC,OAAO,CACT,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,MAAM;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,UAAU,GACnB,OAAO,CAAC,WAAW,CAAC;IA8CvB,OAAO,CAAC,QAAQ;CAKnB"}
|
|
@@ -6,6 +6,7 @@ const common_1 = require("@nestjs/common");
|
|
|
6
6
|
const database_1 = require("@orthacms/database");
|
|
7
7
|
const entry_writer_service_1 = require("../../infrastructure/persistence/entry-writer.service");
|
|
8
8
|
const entry_row_1 = require("../../infrastructure/persistence/entry-row");
|
|
9
|
+
const entry_row_2 = require("../../infrastructure/persistence/entry-row");
|
|
9
10
|
const entry_1 = require("../../domain/entry");
|
|
10
11
|
/**
|
|
11
12
|
* Revert one entry to draft. Runs inside a {@link UnitOfWork} so the status
|
|
@@ -42,7 +43,11 @@ let UnpublishEntryUseCase = class UnpublishEntryUseCase {
|
|
|
42
43
|
const entry = entry_1.Entry.rehydrate({
|
|
43
44
|
id,
|
|
44
45
|
contentType: type.name,
|
|
45
|
-
status: current['status']
|
|
46
|
+
status: current['status'],
|
|
47
|
+
workspaceId,
|
|
48
|
+
// The stored row is already loaded, so the audit row gets a
|
|
49
|
+
// readable name for free rather than a bare uuid.
|
|
50
|
+
title: (0, entry_row_2.entryTitle)(type, current)
|
|
46
51
|
});
|
|
47
52
|
entry.unpublish();
|
|
48
53
|
const updated = await this.writer.markDraft(exec, type, id, workspaceId);
|
|
@@ -8,6 +8,13 @@ export interface EntryState {
|
|
|
8
8
|
contentType: string;
|
|
9
9
|
/** Current publish status of the stored row. */
|
|
10
10
|
status: EntryStatus;
|
|
11
|
+
/** The workspace the row lives in — carried only for the event payload. */
|
|
12
|
+
workspaceId?: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* A human label for the entry, carried only for the event payload so the
|
|
15
|
+
* audit row names something a reader recognises instead of a uuid.
|
|
16
|
+
*/
|
|
17
|
+
title?: string | null;
|
|
11
18
|
}
|
|
12
19
|
/**
|
|
13
20
|
* The outcome of the publish precondition, computed by the use-case from the
|
|
@@ -37,7 +44,7 @@ export interface PublishGate {
|
|
|
37
44
|
*/
|
|
38
45
|
export declare class Entry {
|
|
39
46
|
private readonly _id;
|
|
40
|
-
private readonly
|
|
47
|
+
private readonly _subject;
|
|
41
48
|
private _status;
|
|
42
49
|
private readonly events;
|
|
43
50
|
private constructor();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/domain/entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAGH,KAAK,WAAW,EAChB,KAAK,eAAe,EACvB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../../../src/lib/entries/domain/entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAGH,KAAK,WAAW,EAChB,KAAK,eAAe,EACvB,MAAM,0BAA0B,CAAC;AASlC,oFAAoF;AACpF,MAAM,WAAW,UAAU;IACvB,gBAAgB;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,0EAA0E;IAC1E,WAAW,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,MAAM,EAAE,WAAW,CAAC;IACpB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACxB,qCAAqC;IACrC,KAAK,EAAE,OAAO,CAAC;IACf,iDAAiD;IACjD,MAAM,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAAa,KAAK;IAIV,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,OAAO;IALnB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAE5C,OAAO;IAMP,gEAAgE;IAChE,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,KAAK;IAY1C;;;;;;;;OAQG;IACH,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAYhC;;;;;OAKG;IACH,SAAS,IAAI,IAAI;IASjB,oBAAoB;IACpB,IAAI,EAAE,IAAI,MAAM,CAEf;IAED,kCAAkC;IAClC,IAAI,MAAM,IAAI,WAAW,CAExB;IAED,gEAAgE;IAChE,UAAU,IAAI,WAAW,EAAE;IAI3B,OAAO,CAAC,KAAK;CAKhB"}
|
|
@@ -21,17 +21,21 @@ const entry_publish_blocked_error_1 = require("./entry-publish-blocked.error");
|
|
|
21
21
|
*/
|
|
22
22
|
class Entry {
|
|
23
23
|
_id;
|
|
24
|
-
|
|
24
|
+
_subject;
|
|
25
25
|
_status;
|
|
26
26
|
events = [];
|
|
27
|
-
constructor(_id,
|
|
27
|
+
constructor(_id, _subject, _status) {
|
|
28
28
|
this._id = _id;
|
|
29
|
-
this.
|
|
29
|
+
this._subject = _subject;
|
|
30
30
|
this._status = _status;
|
|
31
31
|
}
|
|
32
32
|
/** Reconstructs an entry from its persisted lifecycle state. */
|
|
33
33
|
static rehydrate(state) {
|
|
34
|
-
return new Entry(state.id,
|
|
34
|
+
return new Entry(state.id, {
|
|
35
|
+
contentType: state.contentType,
|
|
36
|
+
workspaceId: state.workspaceId ?? null,
|
|
37
|
+
title: state.title ?? null
|
|
38
|
+
}, state.status);
|
|
35
39
|
}
|
|
36
40
|
/**
|
|
37
41
|
* Publish the entry. Rejects with {@link EntryPublishBlockedError} when the
|
|
@@ -51,9 +55,7 @@ class Entry {
|
|
|
51
55
|
}
|
|
52
56
|
(0, content_domain_1.assertTransition)(this._status, content_domain_1.ENTRY_STATUS.Published);
|
|
53
57
|
this._status = content_domain_1.ENTRY_STATUS.Published;
|
|
54
|
-
this.raise(entry_events_1.ENTRY_EVENT_KINDS.PUBLISHED
|
|
55
|
-
contentType: this._contentType
|
|
56
|
-
});
|
|
58
|
+
this.raise(entry_events_1.ENTRY_EVENT_KINDS.PUBLISHED);
|
|
57
59
|
}
|
|
58
60
|
/**
|
|
59
61
|
* Revert the entry to draft. A `published` row transitions to `draft` via
|
|
@@ -67,9 +69,7 @@ class Entry {
|
|
|
67
69
|
}
|
|
68
70
|
(0, content_domain_1.assertTransition)(this._status, content_domain_1.ENTRY_STATUS.Draft);
|
|
69
71
|
this._status = content_domain_1.ENTRY_STATUS.Draft;
|
|
70
|
-
this.raise(entry_events_1.ENTRY_EVENT_KINDS.UNPUBLISHED
|
|
71
|
-
contentType: this._contentType
|
|
72
|
-
});
|
|
72
|
+
this.raise(entry_events_1.ENTRY_EVENT_KINDS.UNPUBLISHED);
|
|
73
73
|
}
|
|
74
74
|
/** The entry id. */
|
|
75
75
|
get id() {
|
|
@@ -83,8 +83,8 @@ class Entry {
|
|
|
83
83
|
pullEvents() {
|
|
84
84
|
return this.events.splice(0, this.events.length);
|
|
85
85
|
}
|
|
86
|
-
raise(kind
|
|
87
|
-
this.events.push((0, entry_events_1.entryEvent)(kind, this._id,
|
|
86
|
+
raise(kind) {
|
|
87
|
+
this.events.push((0, entry_events_1.entryEvent)(kind, this._id, (0, entry_events_1.entrySubjectPayload)(this._subject)));
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
exports.Entry = Entry;
|
|
@@ -26,6 +26,48 @@ export declare const ENTRY_EVENT_KINDS: {
|
|
|
26
26
|
readonly RESTORED: "entry.restored";
|
|
27
27
|
readonly PURGED: "entry.purged";
|
|
28
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* What an entry event says about **which entry** it is about, beyond the id.
|
|
31
|
+
*
|
|
32
|
+
* Both extra fields exist because of what an audit row can and cannot recover
|
|
33
|
+
* afterwards:
|
|
34
|
+
*
|
|
35
|
+
* - `workspaceId` is the only way the trail can answer a workspace-shaped
|
|
36
|
+
* question. `activity_events` grew a nullable `workspace_id` for it, filled
|
|
37
|
+
* from the event payload, and an entry is the most-produced audited fact in
|
|
38
|
+
* the product — so an entry event that omitted it would leave the column
|
|
39
|
+
* mostly empty and the question mostly unanswerable.
|
|
40
|
+
* - `title` is what makes the row **readable**. An audit row keeps no FK and no
|
|
41
|
+
* denormalised name; its whole handle on the subject is `subject_id`. That is
|
|
42
|
+
* survivable for an entry that still exists and unrecoverable for one that
|
|
43
|
+
* does not — and `entry.purged` is precisely the case where this row is the
|
|
44
|
+
* only remaining record of the thing. A uuid is not an answer to "what did
|
|
45
|
+
* they delete".
|
|
46
|
+
*
|
|
47
|
+
* Both are optional so a caller that genuinely has neither (a unit test, an
|
|
48
|
+
* event minted outside the write path) is not forced to invent them.
|
|
49
|
+
*/
|
|
50
|
+
export interface EntrySubject {
|
|
51
|
+
/** The content type's machine name. */
|
|
52
|
+
contentType: string;
|
|
53
|
+
/** The workspace the entry lives in. */
|
|
54
|
+
workspaceId?: string | null;
|
|
55
|
+
/**
|
|
56
|
+
* A human label for the entry **at the time of the event** — a frozen
|
|
57
|
+
* snapshot, like `actor_email`, not a lookup. The point is to survive the
|
|
58
|
+
* subject.
|
|
59
|
+
*/
|
|
60
|
+
title?: string | null;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The subject fields every entry event's payload carries.
|
|
64
|
+
*
|
|
65
|
+
* Exported because the {@link Entry} model raises its two events through the
|
|
66
|
+
* envelope builder directly rather than the per-kind helpers — those two are
|
|
67
|
+
* status transitions the model owns, and it must produce the same payload shape
|
|
68
|
+
* as the five the write path mints.
|
|
69
|
+
*/
|
|
70
|
+
export declare function entrySubjectPayload(subject: EntrySubject): Record<string, unknown>;
|
|
29
71
|
/**
|
|
30
72
|
* Builds an entry {@link DomainEvent} of `kind` for `entryId`, carrying
|
|
31
73
|
* `payload`. Keeps the domain model free of the event envelope's plumbing — the
|
|
@@ -33,7 +75,7 @@ export declare const ENTRY_EVENT_KINDS: {
|
|
|
33
75
|
*/
|
|
34
76
|
export declare function entryEvent(kind: string, entryId: string, payload: Record<string, unknown>): DomainEvent;
|
|
35
77
|
/** A new entry exists. `contentType` is what lets the log name *what* was made. */
|
|
36
|
-
export declare function entryCreated(entryId: string,
|
|
78
|
+
export declare function entryCreated(entryId: string, subject: EntrySubject): DomainEvent;
|
|
37
79
|
/**
|
|
38
80
|
* An entry's stored values changed, naming **which fields** did.
|
|
39
81
|
*
|
|
@@ -46,16 +88,16 @@ export declare function entryCreated(entryId: string, contentType: string): Doma
|
|
|
46
88
|
* and therefore no event at all, so the log records editorial changes rather
|
|
47
89
|
* than round trips.
|
|
48
90
|
*/
|
|
49
|
-
export declare function entryUpdated(entryId: string,
|
|
91
|
+
export declare function entryUpdated(entryId: string, subject: EntrySubject, fields: readonly string[]): DomainEvent;
|
|
50
92
|
/**
|
|
51
93
|
* An entry was deleted. `soft` distinguishes the two very different facts the
|
|
52
94
|
* one route produces: a **paranoid** type is tombstoned and can be restored,
|
|
53
95
|
* while any other type is gone from the table the moment this commits, and a
|
|
54
96
|
* reviewer reading the log needs to know which happened.
|
|
55
97
|
*/
|
|
56
|
-
export declare function entryDeleted(entryId: string,
|
|
98
|
+
export declare function entryDeleted(entryId: string, subject: EntrySubject, soft: boolean): DomainEvent;
|
|
57
99
|
/** A soft-deleted entry's tombstone was cleared. */
|
|
58
|
-
export declare function entryRestored(entryId: string,
|
|
100
|
+
export declare function entryRestored(entryId: string, subject: EntrySubject): DomainEvent;
|
|
59
101
|
/**
|
|
60
102
|
* A tombstoned entry was destroyed permanently.
|
|
61
103
|
*
|
|
@@ -63,5 +105,5 @@ export declare function entryRestored(entryId: string, contentType: string): Dom
|
|
|
63
105
|
* action with nothing left behind to inspect afterwards, so it is exactly the
|
|
64
106
|
* one an audit trail has to record distinctly.
|
|
65
107
|
*/
|
|
66
|
-
export declare function entryPurged(entryId: string,
|
|
108
|
+
export declare function entryPurged(entryId: string, subject: EntrySubject): DomainEvent;
|
|
67
109
|
//# sourceMappingURL=entry-events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-events.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/domain/events/entry-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEzE;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;CAQpB,CAAC;AAKX;;;;GAIG;AACH,wBAAgB,UAAU,CACtB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,WAAW,CAOb;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CACxB,OAAO,EAAE,MAAM,EACf,
|
|
1
|
+
{"version":3,"file":"entry-events.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/domain/events/entry-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEzE;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;CAQpB,CAAC;AAKX;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,YAAY;IACzB,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAC/B,OAAO,EAAE,YAAY,GACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAMzB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACtB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACjC,WAAW,CAOb;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,YAAY,GACtB,WAAW,CAMb;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,SAAS,MAAM,EAAE,GAC1B,WAAW,CAKb;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,OAAO,GACd,WAAW,CAKb;AAED,oDAAoD;AACpD,wBAAgB,aAAa,CACzB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,YAAY,GACtB,WAAW,CAMb;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACvB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,YAAY,GACtB,WAAW,CAMb"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ENTRY_EVENT_KINDS = void 0;
|
|
4
|
+
exports.entrySubjectPayload = entrySubjectPayload;
|
|
4
5
|
exports.entryEvent = entryEvent;
|
|
5
6
|
exports.entryCreated = entryCreated;
|
|
6
7
|
exports.entryUpdated = entryUpdated;
|
|
@@ -37,6 +38,21 @@ exports.ENTRY_EVENT_KINDS = {
|
|
|
37
38
|
};
|
|
38
39
|
/** The aggregate type stamped on every entry domain event. */
|
|
39
40
|
const AGGREGATE_TYPE = 'content_entry';
|
|
41
|
+
/**
|
|
42
|
+
* The subject fields every entry event's payload carries.
|
|
43
|
+
*
|
|
44
|
+
* Exported because the {@link Entry} model raises its two events through the
|
|
45
|
+
* envelope builder directly rather than the per-kind helpers — those two are
|
|
46
|
+
* status transitions the model owns, and it must produce the same payload shape
|
|
47
|
+
* as the five the write path mints.
|
|
48
|
+
*/
|
|
49
|
+
function entrySubjectPayload(subject) {
|
|
50
|
+
return {
|
|
51
|
+
contentType: subject.contentType,
|
|
52
|
+
workspaceId: subject.workspaceId ?? null,
|
|
53
|
+
title: subject.title ?? null
|
|
54
|
+
};
|
|
55
|
+
}
|
|
40
56
|
/**
|
|
41
57
|
* Builds an entry {@link DomainEvent} of `kind` for `entryId`, carrying
|
|
42
58
|
* `payload`. Keeps the domain model free of the event envelope's plumbing — the
|
|
@@ -51,8 +67,8 @@ function entryEvent(kind, entryId, payload) {
|
|
|
51
67
|
});
|
|
52
68
|
}
|
|
53
69
|
/** A new entry exists. `contentType` is what lets the log name *what* was made. */
|
|
54
|
-
function entryCreated(entryId,
|
|
55
|
-
return entryEvent(exports.ENTRY_EVENT_KINDS.CREATED, entryId,
|
|
70
|
+
function entryCreated(entryId, subject) {
|
|
71
|
+
return entryEvent(exports.ENTRY_EVENT_KINDS.CREATED, entryId, entrySubjectPayload(subject));
|
|
56
72
|
}
|
|
57
73
|
/**
|
|
58
74
|
* An entry's stored values changed, naming **which fields** did.
|
|
@@ -66,9 +82,9 @@ function entryCreated(entryId, contentType) {
|
|
|
66
82
|
* and therefore no event at all, so the log records editorial changes rather
|
|
67
83
|
* than round trips.
|
|
68
84
|
*/
|
|
69
|
-
function entryUpdated(entryId,
|
|
85
|
+
function entryUpdated(entryId, subject, fields) {
|
|
70
86
|
return entryEvent(exports.ENTRY_EVENT_KINDS.UPDATED, entryId, {
|
|
71
|
-
|
|
87
|
+
...entrySubjectPayload(subject),
|
|
72
88
|
fields: [...fields]
|
|
73
89
|
});
|
|
74
90
|
}
|
|
@@ -78,15 +94,15 @@ function entryUpdated(entryId, contentType, fields) {
|
|
|
78
94
|
* while any other type is gone from the table the moment this commits, and a
|
|
79
95
|
* reviewer reading the log needs to know which happened.
|
|
80
96
|
*/
|
|
81
|
-
function entryDeleted(entryId,
|
|
97
|
+
function entryDeleted(entryId, subject, soft) {
|
|
82
98
|
return entryEvent(exports.ENTRY_EVENT_KINDS.DELETED, entryId, {
|
|
83
|
-
|
|
99
|
+
...entrySubjectPayload(subject),
|
|
84
100
|
soft
|
|
85
101
|
});
|
|
86
102
|
}
|
|
87
103
|
/** A soft-deleted entry's tombstone was cleared. */
|
|
88
|
-
function entryRestored(entryId,
|
|
89
|
-
return entryEvent(exports.ENTRY_EVENT_KINDS.RESTORED, entryId,
|
|
104
|
+
function entryRestored(entryId, subject) {
|
|
105
|
+
return entryEvent(exports.ENTRY_EVENT_KINDS.RESTORED, entryId, entrySubjectPayload(subject));
|
|
90
106
|
}
|
|
91
107
|
/**
|
|
92
108
|
* A tombstoned entry was destroyed permanently.
|
|
@@ -95,6 +111,6 @@ function entryRestored(entryId, contentType) {
|
|
|
95
111
|
* action with nothing left behind to inspect afterwards, so it is exactly the
|
|
96
112
|
* one an audit trail has to record distinctly.
|
|
97
113
|
*/
|
|
98
|
-
function entryPurged(entryId,
|
|
99
|
-
return entryEvent(exports.ENTRY_EVENT_KINDS.PURGED, entryId,
|
|
114
|
+
function entryPurged(entryId, subject) {
|
|
115
|
+
return entryEvent(exports.ENTRY_EVENT_KINDS.PURGED, entryId, entrySubjectPayload(subject));
|
|
100
116
|
}
|
|
@@ -3,8 +3,16 @@
|
|
|
3
3
|
export declare const DEFAULT_PAGE_SIZE = 25;
|
|
4
4
|
/** Hard cap on rows per page — bounds a single query's cost. */
|
|
5
5
|
export declare const MAX_PAGE_SIZE = 100;
|
|
6
|
-
/**
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Max length of the raw `?filter=` JSON string — a coarse first guard against
|
|
8
|
+
* oversized payloads, ahead of the filter engine's own budgets.
|
|
9
|
+
*
|
|
10
|
+
* Re-exported rather than declared: the number belongs to the engine that
|
|
11
|
+
* enforces the rest of the filter's limits, and four packages each declaring
|
|
12
|
+
* their own copy is how one of them (`alarms`) came to say 8192 while the other
|
|
13
|
+
* three said 4096. See `filters/budgets.ts` in `@orthacms/utils-server`.
|
|
14
|
+
*/
|
|
15
|
+
export { FILTER_MAX_LENGTH } from '@orthacms/utils-server';
|
|
8
16
|
/** Max ids a single bulk action (`{ ids }`) may target — bounds the statement. */
|
|
9
17
|
export declare const BULK_MAX_IDS = 100;
|
|
10
18
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entries.constants.d.ts","sourceRoot":"","sources":["../../../src/lib/entries/entries.constants.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAEhE,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,gEAAgE;AAChE,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC
|
|
1
|
+
{"version":3,"file":"entries.constants.d.ts","sourceRoot":"","sources":["../../../src/lib/entries/entries.constants.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAEhE,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,gEAAgE;AAChE,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC;;;;;;;;GAQG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,kFAAkF;AAClF,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,KAAK,CAAC"}
|
|
@@ -6,8 +6,17 @@ exports.BULK_MAX_SAVE_ITEMS = exports.BULK_MAX_IDS = exports.FILTER_MAX_LENGTH =
|
|
|
6
6
|
exports.DEFAULT_PAGE_SIZE = 25;
|
|
7
7
|
/** Hard cap on rows per page — bounds a single query's cost. */
|
|
8
8
|
exports.MAX_PAGE_SIZE = 100;
|
|
9
|
-
/**
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Max length of the raw `?filter=` JSON string — a coarse first guard against
|
|
11
|
+
* oversized payloads, ahead of the filter engine's own budgets.
|
|
12
|
+
*
|
|
13
|
+
* Re-exported rather than declared: the number belongs to the engine that
|
|
14
|
+
* enforces the rest of the filter's limits, and four packages each declaring
|
|
15
|
+
* their own copy is how one of them (`alarms`) came to say 8192 while the other
|
|
16
|
+
* three said 4096. See `filters/budgets.ts` in `@orthacms/utils-server`.
|
|
17
|
+
*/
|
|
18
|
+
var utils_server_1 = require("@orthacms/utils-server");
|
|
19
|
+
Object.defineProperty(exports, "FILTER_MAX_LENGTH", { enumerable: true, get: function () { return utils_server_1.FILTER_MAX_LENGTH; } });
|
|
11
20
|
/** Max ids a single bulk action (`{ ids }`) may target — bounds the statement. */
|
|
12
21
|
exports.BULK_MAX_IDS = 100;
|
|
13
22
|
/**
|
|
@@ -24,8 +24,8 @@ export declare class BulkEntriesController {
|
|
|
24
24
|
constructor(registry: ContentTypeRegistry, writer: EntryWriterService, bulkPublishPreview: BulkPublishPreviewQuery, bulkPublishEntries: BulkPublishEntriesUseCase, bulkUnpublishEntries: BulkUnpublishEntriesUseCase);
|
|
25
25
|
/** Dry run: validate each id and report a per-entry verdict. Writes nothing. */
|
|
26
26
|
previewPublish(typeName: string, body: BulkIdsDto, workspaceId: string): Promise<BulkPublishPreview>;
|
|
27
|
-
publish(typeName: string, body: BulkIdsDto, workspaceId: string): Promise<BulkPublishResult>;
|
|
28
|
-
unpublish(typeName: string, body: BulkIdsDto, workspaceId: string): Promise<BulkActionResult>;
|
|
27
|
+
publish(typeName: string, body: BulkIdsDto, workspaceId: string, user?: PublicUser): Promise<BulkPublishResult>;
|
|
28
|
+
unpublish(typeName: string, body: BulkIdsDto, workspaceId: string, user?: PublicUser): Promise<BulkActionResult>;
|
|
29
29
|
remove(typeName: string, body: BulkIdsDto, workspaceId: string, user?: PublicUser): Promise<BulkActionResult>;
|
|
30
30
|
restore(typeName: string, body: BulkIdsDto, workspaceId: string, user?: PublicUser): Promise<BulkActionResult>;
|
|
31
31
|
purge(typeName: string, body: BulkIdsDto, workspaceId: string, user?: PublicUser): Promise<BulkActionResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulk-entries.controller.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/http/controllers/bulk-entries.controller.ts"],"names":[],"mappings":"AASA,OAAO,EAKH,KAAK,UAAU,EAElB,MAAM,2BAA2B,CAAC;AAInC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAC3F,OAAO,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAClG,OAAO,EAAE,yBAAyB,EAAE,MAAM,2DAA2D,CAAC;AACtG,OAAO,EAAE,2BAA2B,EAAE,MAAM,6DAA6D,CAAC;AAC1G,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EACR,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACpB,MAAM,0BAA0B,CAAC;AAIlC;;;;;;;;GAQG;AACH,qBAEa,qBAAqB;IAG1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBAJpB,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,kBAAkB,EAC1B,kBAAkB,EAAE,uBAAuB,EAC3C,kBAAkB,EAAE,yBAAyB,EAC7C,oBAAoB,EAAE,2BAA2B;IAGtE,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,
|
|
1
|
+
{"version":3,"file":"bulk-entries.controller.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/http/controllers/bulk-entries.controller.ts"],"names":[],"mappings":"AASA,OAAO,EAKH,KAAK,UAAU,EAElB,MAAM,2BAA2B,CAAC;AAInC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAC3F,OAAO,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAClG,OAAO,EAAE,yBAAyB,EAAE,MAAM,2DAA2D,CAAC;AACtG,OAAO,EAAE,2BAA2B,EAAE,MAAM,6DAA6D,CAAC;AAC1G,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EACR,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACpB,MAAM,0BAA0B,CAAC;AAIlC;;;;;;;;GAQG;AACH,qBAEa,qBAAqB;IAG1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBAJpB,QAAQ,EAAE,mBAAmB,EAC7B,MAAM,EAAE,kBAAkB,EAC1B,kBAAkB,EAAE,uBAAuB,EAC3C,kBAAkB,EAAE,yBAAyB,EAC7C,oBAAoB,EAAE,2BAA2B;IAGtE,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,EACxB,IAAI,CAAC,EAAE,UAAU,GACjC,OAAO,CAAC,iBAAiB,CAAC;IAa7B,SAAS,CACc,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,UAAU,EACJ,WAAW,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,UAAU,GACjC,OAAO,CAAC,gBAAgB,CAAC;IAa5B,MAAM,CACiB,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,UAAU,EACJ,WAAW,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,UAAU,GACjC,OAAO,CAAC,gBAAgB,CAAC;IAa5B,OAAO,CACgB,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,UAAU,EACJ,WAAW,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,UAAU,GACjC,OAAO,CAAC,gBAAgB,CAAC;IAa5B,KAAK,CACkB,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,UAAU,EACJ,WAAW,EAAE,MAAM,EACxB,IAAI,CAAC,EAAE,UAAU,GACjC,OAAO,CAAC,gBAAgB,CAAC;CAS/B"}
|
|
@@ -41,13 +41,13 @@ let BulkEntriesController = class BulkEntriesController {
|
|
|
41
41
|
const type = (0, resolve_type_1.resolveType)(this.registry, typeName);
|
|
42
42
|
return this.bulkPublishPreview.preview(type, body.ids, workspaceId);
|
|
43
43
|
}
|
|
44
|
-
publish(typeName, body, workspaceId) {
|
|
44
|
+
publish(typeName, body, workspaceId, user) {
|
|
45
45
|
const type = (0, resolve_type_1.resolveType)(this.registry, typeName);
|
|
46
|
-
return this.bulkPublishEntries.execute(type, body.ids, workspaceId);
|
|
46
|
+
return this.bulkPublishEntries.execute(type, body.ids, workspaceId, (0, to_actor_1.toActor)(user));
|
|
47
47
|
}
|
|
48
|
-
unpublish(typeName, body, workspaceId) {
|
|
48
|
+
unpublish(typeName, body, workspaceId, user) {
|
|
49
49
|
const type = (0, resolve_type_1.resolveType)(this.registry, typeName);
|
|
50
|
-
return this.bulkUnpublishEntries.execute(type, body.ids, workspaceId);
|
|
50
|
+
return this.bulkUnpublishEntries.execute(type, body.ids, workspaceId, (0, to_actor_1.toActor)(user));
|
|
51
51
|
}
|
|
52
52
|
remove(typeName, body, workspaceId, user) {
|
|
53
53
|
const type = (0, resolve_type_1.resolveType)(this.registry, typeName);
|
|
@@ -81,8 +81,9 @@ tslib_1.__decorate([
|
|
|
81
81
|
tslib_1.__param(0, (0, common_1.Param)('typeName')),
|
|
82
82
|
tslib_1.__param(1, (0, common_1.Body)()),
|
|
83
83
|
tslib_1.__param(2, (0, workspaces_server_1.CurrentWorkspace)()),
|
|
84
|
+
tslib_1.__param(3, (0, identity_server_1.CurrentUser)()),
|
|
84
85
|
tslib_1.__metadata("design:type", Function),
|
|
85
|
-
tslib_1.__metadata("design:paramtypes", [String, bulk_ids_dto_1.BulkIdsDto, String]),
|
|
86
|
+
tslib_1.__metadata("design:paramtypes", [String, bulk_ids_dto_1.BulkIdsDto, String, Object]),
|
|
86
87
|
tslib_1.__metadata("design:returntype", Promise)
|
|
87
88
|
], BulkEntriesController.prototype, "publish", null);
|
|
88
89
|
tslib_1.__decorate([
|
|
@@ -92,8 +93,9 @@ tslib_1.__decorate([
|
|
|
92
93
|
tslib_1.__param(0, (0, common_1.Param)('typeName')),
|
|
93
94
|
tslib_1.__param(1, (0, common_1.Body)()),
|
|
94
95
|
tslib_1.__param(2, (0, workspaces_server_1.CurrentWorkspace)()),
|
|
96
|
+
tslib_1.__param(3, (0, identity_server_1.CurrentUser)()),
|
|
95
97
|
tslib_1.__metadata("design:type", Function),
|
|
96
|
-
tslib_1.__metadata("design:paramtypes", [String, bulk_ids_dto_1.BulkIdsDto, String]),
|
|
98
|
+
tslib_1.__metadata("design:paramtypes", [String, bulk_ids_dto_1.BulkIdsDto, String, Object]),
|
|
97
99
|
tslib_1.__metadata("design:returntype", Promise)
|
|
98
100
|
], BulkEntriesController.prototype, "unpublish", null);
|
|
99
101
|
tslib_1.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-entry.controller.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/http/controllers/create-entry.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAKH,KAAK,UAAU,EAElB,MAAM,2BAA2B,CAAC;AAInC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAI/D;;;;;;;;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,EACxB,IAAI,CAAC,EAAE,UAAU,GACjC,OAAO,CAAC,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"create-entry.controller.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/http/controllers/create-entry.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAKH,KAAK,UAAU,EAElB,MAAM,2BAA2B,CAAC;AAInC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAI/D;;;;;;;;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,EACxB,IAAI,CAAC,EAAE,UAAU,GACjC,OAAO,CAAC,WAAW,CAAC;CAa1B"}
|
|
@@ -29,7 +29,7 @@ let CreateEntryController = class CreateEntryController {
|
|
|
29
29
|
}
|
|
30
30
|
create(typeName, body, workspaceId, user) {
|
|
31
31
|
const type = (0, resolve_type_1.resolveType)(this.registry, typeName);
|
|
32
|
-
return this.writer.create(type, body.values, workspaceId, body.relations, body.locale, body.localeGroupId, (0, to_actor_1.toActor)(user));
|
|
32
|
+
return this.writer.create(type, body.values, workspaceId, body.relations, body.locale, body.localeGroupId, (0, to_actor_1.toActor)(user), body.extensions);
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
exports.CreateEntryController = CreateEntryController;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-entry.controller.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/http/controllers/update-entry.controller.ts"],"names":[],"mappings":"AAQA,OAAO,EAKH,KAAK,UAAU,EAElB,MAAM,2BAA2B,CAAC;AAInC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAI/D;;;;;;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,EACxB,IAAI,CAAC,EAAE,UAAU,GACjC,OAAO,CAAC,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"update-entry.controller.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/http/controllers/update-entry.controller.ts"],"names":[],"mappings":"AAQA,OAAO,EAKH,KAAK,UAAU,EAElB,MAAM,2BAA2B,CAAC;AAInC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAI/D;;;;;;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,EACxB,IAAI,CAAC,EAAE,UAAU,GACjC,OAAO,CAAC,WAAW,CAAC;CAY1B"}
|
|
@@ -27,7 +27,7 @@ let UpdateEntryController = class UpdateEntryController {
|
|
|
27
27
|
}
|
|
28
28
|
update(typeName, id, body, workspaceId, user) {
|
|
29
29
|
const type = (0, resolve_type_1.resolveType)(this.registry, typeName);
|
|
30
|
-
return this.writer.update(type, id, body.values, workspaceId, body.relations, (0, to_actor_1.toActor)(user));
|
|
30
|
+
return this.writer.update(type, id, body.values, workspaceId, body.relations, (0, to_actor_1.toActor)(user), { extensions: body.extensions });
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
exports.UpdateEntryController = UpdateEntryController;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ValidationOptions } from 'class-validator';
|
|
2
|
+
/**
|
|
3
|
+
* Most extension keys one save may carry.
|
|
4
|
+
*
|
|
5
|
+
* A key names an installed plugin, so the real ceiling is single digits; this is
|
|
6
|
+
* a guard against a client posting an object with thousands of keys, each of
|
|
7
|
+
* which the registry would otherwise walk on every write. Deliberately not a
|
|
8
|
+
* bound on the *values* — those are the extensions' own contracts, and
|
|
9
|
+
* content-server declares the bag opaque.
|
|
10
|
+
*/
|
|
11
|
+
export declare const MAX_EXTENSION_KEYS = 16;
|
|
12
|
+
/** Rejects an extension bag with more keys than {@link MAX_EXTENSION_KEYS}. */
|
|
13
|
+
export declare function MaxExtensionKeys(options?: ValidationOptions): (target: object, propertyName: string) => void;
|
|
14
|
+
//# sourceMappingURL=extension-bag.validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-bag.validator.d.ts","sourceRoot":"","sources":["../../../../../src/lib/entries/http/dto/extension-bag.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAE5E;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,iBAAiB,IACvC,QAAQ,MAAM,EAAE,cAAc,MAAM,KAAG,IAAI,CAyB/D"}
|