sitero-server 0.5.0 → 0.7.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/export/index.js +10 -0
- package/dist/src/application/resources/file/operations/queries/find-detail/cache.js +4 -1
- package/dist/src/application/resources/file/operations/queries/find-list-cards/cache.js +1 -0
- package/dist/src/application/resources/file/operations/queries/find-relations/cache.js +4 -1
- package/dist/src/application/resources/page/collect-page-file-ids.js +14 -0
- package/dist/src/application/resources/page/errors/codes.js +7 -0
- package/dist/src/application/resources/page/errors/operation-errors.js +23 -0
- package/dist/src/application/resources/page/operations/commands/update/cache.js +23 -0
- package/dist/src/application/resources/page/operations/commands/update/page-update-command.js +36 -0
- package/dist/src/application/resources/page/operations/commands/update/validation/schema.js +104 -0
- package/dist/src/application/resources/page/operations/commands/update/validation/validate-input.js +25 -0
- package/dist/src/application/resources/page/operations/queries/find-detail/cache.js +28 -0
- package/dist/src/application/resources/page/operations/queries/find-detail/page-find-detail-query.js +35 -0
- package/dist/src/application/resources/page/operations/queries/find-detail/validation/schema.js +9 -0
- package/dist/src/application/resources/page/operations/queries/find-many/cache.js +17 -0
- package/dist/src/application/resources/page/operations/queries/find-many/page-find-many-query.js +35 -0
- package/dist/src/application/resources/page/operations/queries/find-many/validation/schema.js +8 -0
- package/dist/src/application/resources/page/operations/queries/find-many/validation/validate-input.js +12 -0
- package/dist/src/application/resources/post/assert-post-write-relations-exist.js +0 -1
- package/dist/src/application/resources/post/collect-post-reference-ids.js +1 -3
- package/dist/src/application/resources/post/create-post-list-card-cache-tags.js +19 -0
- package/dist/src/application/resources/post/errors/codes.js +6 -0
- package/dist/src/application/resources/post/operations/commands/create/cache.js +0 -1
- package/dist/src/application/resources/post/operations/commands/create/post-create-command.js +2 -0
- package/dist/src/application/resources/post/operations/commands/create/validation/schema.js +1 -1
- package/dist/src/application/resources/post/operations/commands/create/validation/validate-input.js +8 -0
- package/dist/src/application/resources/post/operations/commands/delete/cache.js +0 -1
- package/dist/src/application/resources/post/operations/commands/lifecycle.js +32 -0
- package/dist/src/application/resources/post/operations/commands/update/cache.js +0 -2
- package/dist/src/application/resources/post/operations/commands/update/post-update-command.js +2 -0
- package/dist/src/application/resources/post/operations/commands/update/validation/schema.js +1 -1
- package/dist/src/application/resources/post/operations/commands/update/validation/validate-input.js +8 -0
- package/dist/src/application/resources/post/operations/queries/find-detail/cache.js +5 -15
- package/dist/src/application/resources/post/operations/queries/find-detail/validation/schema.js +9 -0
- package/dist/src/application/resources/post/operations/queries/find-detail/validation/validate-input.js +2 -0
- package/dist/src/application/resources/post/operations/queries/find-list-cards/cache.js +6 -13
- package/dist/src/application/resources/post/operations/queries/find-list-cards/validation/schema.js +3 -1
- package/dist/src/application/resources/post/operations/queries/find-many/cache.js +3 -1
- package/dist/src/application/resources/post/operations/queries/find-many/validation/schema.js +3 -1
- package/dist/src/application/resources/post/operations/queries/find-relations/cache.js +1 -0
- package/dist/src/application/resources/post/validate-topic.js +35 -0
- package/dist/src/application/resources/seo-metadata/errors/codes.js +2 -0
- package/dist/src/application/resources/seo-metadata/errors/operation-errors.js +13 -1
- package/dist/src/application/resources/seo-metadata/operations/commands/upsert/cache.js +8 -2
- package/dist/src/application/resources/seo-metadata/operations/commands/upsert/seo-metadata-upsert-command.js +7 -2
- package/dist/src/application/resources/seo-metadata/operations/commands/upsert/validation/schema.js +9 -2
- package/dist/src/application/resources/seo-metadata/operations/commands/upsert/validation/validate-input.js +13 -7
- package/dist/src/composition/create-sitero-server.js +38 -1
- package/dist/types/src/application/conventions/cache/constants.d.ts +2 -1
- package/dist/types/src/application/conventions/cache/constants.d.ts.map +1 -1
- package/dist/types/src/application/resources/file/operations/queries/find-detail/cache.d.ts.map +1 -1
- package/dist/types/src/application/resources/file/operations/queries/find-list-cards/cache.d.ts.map +1 -1
- package/dist/types/src/application/resources/file/operations/queries/find-relations/cache.d.ts.map +1 -1
- package/dist/types/src/application/resources/file/projections/detail.d.ts +2 -1
- package/dist/types/src/application/resources/file/projections/detail.d.ts.map +1 -1
- package/dist/types/src/application/resources/file/projections/relations.d.ts +1 -0
- package/dist/types/src/application/resources/file/projections/relations.d.ts.map +1 -1
- package/dist/types/src/application/resources/page/collect-page-file-ids.d.ts +6 -0
- package/dist/types/src/application/resources/page/collect-page-file-ids.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/errors/codes.d.ts +7 -0
- package/dist/types/src/application/resources/page/errors/codes.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/errors/index.d.ts +3 -0
- package/dist/types/src/application/resources/page/errors/index.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/errors/operation-errors.d.ts +11 -0
- package/dist/types/src/application/resources/page/errors/operation-errors.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/index.d.ts +5 -0
- package/dist/types/src/application/resources/page/index.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/commands/index.d.ts +2 -0
- package/dist/types/src/application/resources/page/operations/commands/index.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/commands/update/cache.d.ts +4 -0
- package/dist/types/src/application/resources/page/operations/commands/update/cache.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/commands/update/index.d.ts +3 -0
- package/dist/types/src/application/resources/page/operations/commands/update/index.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/commands/update/page-update-command.d.ts +11 -0
- package/dist/types/src/application/resources/page/operations/commands/update/page-update-command.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/commands/update/types.d.ts +15 -0
- package/dist/types/src/application/resources/page/operations/commands/update/types.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/commands/update/validation/schema.d.ts +98 -0
- package/dist/types/src/application/resources/page/operations/commands/update/validation/schema.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/commands/update/validation/validate-input.d.ts +9 -0
- package/dist/types/src/application/resources/page/operations/commands/update/validation/validate-input.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/index.d.ts +3 -0
- package/dist/types/src/application/resources/page/operations/index.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/queries/find-detail/cache.d.ts +5 -0
- package/dist/types/src/application/resources/page/operations/queries/find-detail/cache.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/queries/find-detail/index.d.ts +3 -0
- package/dist/types/src/application/resources/page/operations/queries/find-detail/index.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/queries/find-detail/page-find-detail-query.d.ts +6 -0
- package/dist/types/src/application/resources/page/operations/queries/find-detail/page-find-detail-query.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/queries/find-detail/types.d.ts +11 -0
- package/dist/types/src/application/resources/page/operations/queries/find-detail/types.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/queries/find-detail/validation/schema.d.ts +7 -0
- package/dist/types/src/application/resources/page/operations/queries/find-detail/validation/schema.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/queries/find-many/cache.d.ts +4 -0
- package/dist/types/src/application/resources/page/operations/queries/find-many/cache.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/queries/find-many/index.d.ts +3 -0
- package/dist/types/src/application/resources/page/operations/queries/find-many/index.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/queries/find-many/page-find-many-query.d.ts +8 -0
- package/dist/types/src/application/resources/page/operations/queries/find-many/page-find-many-query.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/queries/find-many/types.d.ts +9 -0
- package/dist/types/src/application/resources/page/operations/queries/find-many/types.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/queries/find-many/validation/schema.d.ts +5 -0
- package/dist/types/src/application/resources/page/operations/queries/find-many/validation/schema.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/queries/find-many/validation/validate-input.d.ts +3 -0
- package/dist/types/src/application/resources/page/operations/queries/find-many/validation/validate-input.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/operations/queries/index.d.ts +3 -0
- package/dist/types/src/application/resources/page/operations/queries/index.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/ports.d.ts +38 -0
- package/dist/types/src/application/resources/page/ports.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/projections/detail.d.ts +14 -0
- package/dist/types/src/application/resources/page/projections/detail.d.ts.map +1 -0
- package/dist/types/src/application/resources/page/projections/index.d.ts +2 -0
- package/dist/types/src/application/resources/page/projections/index.d.ts.map +1 -0
- package/dist/types/src/application/resources/post/assert-post-write-relations-exist.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/collect-post-reference-ids.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/create-post-list-card-cache-tags.d.ts +3 -0
- package/dist/types/src/application/resources/post/create-post-list-card-cache-tags.d.ts.map +1 -0
- package/dist/types/src/application/resources/post/errors/codes.d.ts +6 -0
- package/dist/types/src/application/resources/post/errors/codes.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/index.d.ts +3 -2
- package/dist/types/src/application/resources/post/index.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/commands/create/cache.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/commands/create/post-create-command.d.ts +2 -0
- package/dist/types/src/application/resources/post/operations/commands/create/post-create-command.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/commands/create/validation/schema.d.ts +1 -5
- package/dist/types/src/application/resources/post/operations/commands/create/validation/schema.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/commands/create/validation/validate-input.d.ts +2 -0
- package/dist/types/src/application/resources/post/operations/commands/create/validation/validate-input.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/commands/delete/cache.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/commands/index.d.ts +1 -0
- package/dist/types/src/application/resources/post/operations/commands/index.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/commands/lifecycle.d.ts +11 -0
- package/dist/types/src/application/resources/post/operations/commands/lifecycle.d.ts.map +1 -0
- package/dist/types/src/application/resources/post/operations/commands/update/cache.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/commands/update/post-update-command.d.ts +2 -0
- package/dist/types/src/application/resources/post/operations/commands/update/post-update-command.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/commands/update/validation/schema.d.ts +0 -3
- package/dist/types/src/application/resources/post/operations/commands/update/validation/schema.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/commands/update/validation/validate-input.d.ts +2 -0
- package/dist/types/src/application/resources/post/operations/commands/update/validation/validate-input.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/queries/find-detail/cache.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/queries/find-detail/validation/schema.d.ts +6 -2
- package/dist/types/src/application/resources/post/operations/queries/find-detail/validation/schema.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/queries/find-detail/validation/validate-input.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/queries/find-list-cards/cache.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/queries/find-list-cards/validation/schema.d.ts +7 -3
- package/dist/types/src/application/resources/post/operations/queries/find-list-cards/validation/schema.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/queries/find-many/cache.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/queries/find-many/validation/schema.d.ts +7 -3
- package/dist/types/src/application/resources/post/operations/queries/find-many/validation/schema.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/operations/queries/find-relations/cache.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/ports.d.ts +26 -9
- package/dist/types/src/application/resources/post/ports.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/projections/detail.d.ts +3 -4
- package/dist/types/src/application/resources/post/projections/detail.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/projections/index.d.ts +1 -0
- package/dist/types/src/application/resources/post/projections/index.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/projections/list-card.d.ts +4 -8
- package/dist/types/src/application/resources/post/projections/list-card.d.ts.map +1 -1
- package/dist/types/src/application/resources/post/projections/reference-with-cover.d.ts +7 -0
- package/dist/types/src/application/resources/post/projections/reference-with-cover.d.ts.map +1 -0
- package/dist/types/src/application/resources/post/validate-topic.d.ts +11 -0
- package/dist/types/src/application/resources/post/validate-topic.d.ts.map +1 -0
- package/dist/types/src/application/resources/seo-metadata/errors/codes.d.ts +2 -0
- package/dist/types/src/application/resources/seo-metadata/errors/codes.d.ts.map +1 -1
- package/dist/types/src/application/resources/seo-metadata/errors/index.d.ts +1 -1
- package/dist/types/src/application/resources/seo-metadata/errors/index.d.ts.map +1 -1
- package/dist/types/src/application/resources/seo-metadata/errors/operation-errors.d.ts +6 -0
- package/dist/types/src/application/resources/seo-metadata/errors/operation-errors.d.ts.map +1 -1
- package/dist/types/src/application/resources/seo-metadata/index.d.ts +2 -1
- package/dist/types/src/application/resources/seo-metadata/index.d.ts.map +1 -1
- package/dist/types/src/application/resources/seo-metadata/operations/commands/upsert/cache.d.ts.map +1 -1
- package/dist/types/src/application/resources/seo-metadata/operations/commands/upsert/seo-metadata-upsert-command.d.ts +2 -0
- package/dist/types/src/application/resources/seo-metadata/operations/commands/upsert/seo-metadata-upsert-command.d.ts.map +1 -1
- package/dist/types/src/application/resources/seo-metadata/operations/commands/upsert/types.d.ts +5 -7
- package/dist/types/src/application/resources/seo-metadata/operations/commands/upsert/types.d.ts.map +1 -1
- package/dist/types/src/application/resources/seo-metadata/operations/commands/upsert/validation/schema.d.ts +55 -2
- package/dist/types/src/application/resources/seo-metadata/operations/commands/upsert/validation/schema.d.ts.map +1 -1
- package/dist/types/src/application/resources/seo-metadata/operations/commands/upsert/validation/validate-input.d.ts +2 -0
- package/dist/types/src/application/resources/seo-metadata/operations/commands/upsert/validation/validate-input.d.ts.map +1 -1
- package/dist/types/src/application/resources/seo-metadata/ports.d.ts +10 -3
- package/dist/types/src/application/resources/seo-metadata/ports.d.ts.map +1 -1
- package/dist/types/src/composition/create-sitero-server.d.ts.map +1 -1
- package/dist/types/src/composition/policies.d.ts +6 -0
- package/dist/types/src/composition/policies.d.ts.map +1 -1
- package/dist/types/src/composition/types.d.ts +14 -0
- package/dist/types/src/composition/types.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +8 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/src/application/resources/post/operations/commands/update/validation/validate-input.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { normalizeStringSelection } from '../../../../../../conventions/normalization/normalize-string-selection.js';
|
|
2
2
|
import { assertPostWriteRelationsExist } from '../../../../assert-post-write-relations-exist.js';
|
|
3
3
|
import { PostNotFoundError } from '../../../../errors/operation-errors.js';
|
|
4
|
+
import { validatePostTopic } from '../../../../validate-topic.js';
|
|
4
5
|
import { postUpdateInputSchema } from './schema.js';
|
|
5
6
|
|
|
6
7
|
async function validateInput(input) {
|
|
@@ -29,6 +30,13 @@ async function validateInput(input) {
|
|
|
29
30
|
files1: normalizeItems(data.files1),
|
|
30
31
|
files2: normalizeItems(data.files2)
|
|
31
32
|
};
|
|
33
|
+
await validatePostTopic({
|
|
34
|
+
type: previousResult.post.type,
|
|
35
|
+
topicKey: previousResult.post.topicKey,
|
|
36
|
+
parents: preparedInput.parents,
|
|
37
|
+
topics: input.topics,
|
|
38
|
+
postQueryPort
|
|
39
|
+
});
|
|
32
40
|
await assertPostWriteRelationsExist({
|
|
33
41
|
relations: preparedInput,
|
|
34
42
|
adminQueryPort,
|
|
@@ -2,27 +2,17 @@ import { createCacheKey } from '../../../../../conventions/cache/cache-key.js';
|
|
|
2
2
|
import { createResourceTag, createRelationTag } from '../../../../../conventions/cache/cache-tag.js';
|
|
3
3
|
import { collectPostFileIds } from '../../../collect-post-file-ids.js';
|
|
4
4
|
import { collectPostReferenceIds } from '../../../collect-post-reference-ids.js';
|
|
5
|
+
import { createPostListCardCacheTags } from '../../../create-post-list-card-cache-tags.js';
|
|
5
6
|
|
|
6
7
|
const createPostFindDetailCacheKey = (input) => createCacheKey("post", "find-detail", {
|
|
7
8
|
id: input.id,
|
|
8
9
|
type: input.type,
|
|
10
|
+
deletion: input.deletion ?? "active",
|
|
11
|
+
visibility: input.visibility,
|
|
9
12
|
slug: input.slug,
|
|
10
13
|
isActive: input.isActive,
|
|
11
14
|
topicSlug: input.topicSlug
|
|
12
15
|
});
|
|
13
|
-
function createPostListCardCacheTags(post) {
|
|
14
|
-
return [
|
|
15
|
-
createResourceTag("post", { id: post.id }),
|
|
16
|
-
...post.topic ? [
|
|
17
|
-
createResourceTag("post", { id: post.topic.id }),
|
|
18
|
-
createRelationTag("post", "topic", { id: post.id })
|
|
19
|
-
] : [],
|
|
20
|
-
...post.coverImage ? [
|
|
21
|
-
createResourceTag("file", { id: post.coverImage.id }),
|
|
22
|
-
createRelationTag("post", "cover-image", { id: post.id })
|
|
23
|
-
] : []
|
|
24
|
-
].flat();
|
|
25
|
-
}
|
|
26
16
|
const createPostFindDetailCacheTags = (_, result) => {
|
|
27
17
|
const { post, previous, next } = result.data;
|
|
28
18
|
const postReferenceIds = collectPostReferenceIds(post);
|
|
@@ -41,17 +31,17 @@ const createPostFindDetailCacheTags = (_, result) => {
|
|
|
41
31
|
createResourceTag("post", { id })
|
|
42
32
|
]),
|
|
43
33
|
...fileIds.map((id) => createResourceTag("file", { id })),
|
|
44
|
-
createRelationTag("post", "topic", { id: post.id }),
|
|
45
34
|
createRelationTag("post", "parent", { id: post.id }),
|
|
46
35
|
createRelationTag("post", "child", { id: post.id }),
|
|
47
36
|
createRelationTag("post", "tag", { id: post.id }),
|
|
48
37
|
createRelationTag("post", "tagged-post", { id: post.id }),
|
|
49
38
|
createRelationTag("post", "related-post", { id: post.id }),
|
|
50
39
|
createRelationTag("post", "referencing-post", { id: post.id }),
|
|
51
|
-
createRelationTag("post", "posts-in-topic", { id: post.id }),
|
|
52
40
|
createRelationTag("post", "cover-image", { id: post.id }),
|
|
53
41
|
createRelationTag("post", "content-image", { id: post.id }),
|
|
54
42
|
createRelationTag("post", "file", { id: post.id }),
|
|
43
|
+
...createPostListCardCacheTags(post),
|
|
44
|
+
...post.relatedPosts.flatMap(createPostListCardCacheTags),
|
|
55
45
|
...previous ? createPostListCardCacheTags(previous) : [],
|
|
56
46
|
...next ? createPostListCardCacheTags(next) : []
|
|
57
47
|
].flat()
|
package/dist/src/application/resources/post/operations/queries/find-detail/validation/schema.js
CHANGED
|
@@ -6,10 +6,19 @@ import { POST_FIELD_ERROR_CODES } from '../../../../errors/codes.js';
|
|
|
6
6
|
const postFindDetailInputSchema = () => z.object({
|
|
7
7
|
id: idSchema().optional(),
|
|
8
8
|
type: z.enum(POST_TYPES).optional(),
|
|
9
|
+
deletion: z.enum(["active", "deleted", "all"]).optional(),
|
|
10
|
+
visibility: z.literal("public").optional(),
|
|
9
11
|
slug: slugSchema().optional(),
|
|
10
12
|
isActive: z.boolean().optional(),
|
|
11
13
|
topicSlug: slugSchema().optional()
|
|
12
14
|
}).superRefine((input, context) => {
|
|
15
|
+
if (input.id === void 0 && input.slug !== void 0 && input.type !== void 0 && !["TAG", "PRODUCT_TAG"].includes(input.type) && !input.topicSlug) {
|
|
16
|
+
context.addIssue({
|
|
17
|
+
code: "custom",
|
|
18
|
+
message: POST_FIELD_ERROR_CODES.LOOKUP_INVALID,
|
|
19
|
+
path: ["topicSlug"]
|
|
20
|
+
});
|
|
21
|
+
}
|
|
13
22
|
const hasId = input.id !== void 0;
|
|
14
23
|
const hasTypeSlug = input.type !== void 0 && input.slug !== void 0;
|
|
15
24
|
if (hasId && (input.type !== void 0 || input.slug !== void 0) || !hasId && !hasTypeSlug) {
|
|
@@ -4,6 +4,8 @@ function validateInput(input) {
|
|
|
4
4
|
const parsedInput = postFindDetailInputSchema().parse(input);
|
|
5
5
|
const { isActive, topicSlug } = parsedInput;
|
|
6
6
|
const scope = {
|
|
7
|
+
...parsedInput.deletion ? { deletion: parsedInput.deletion } : {},
|
|
8
|
+
...parsedInput.visibility ? { visibility: parsedInput.visibility } : {},
|
|
7
9
|
...isActive !== void 0 ? { isActive } : {},
|
|
8
10
|
...topicSlug !== void 0 ? { topicSlug } : {}
|
|
9
11
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { createCacheKey, normalizeSelection } from '../../../../../conventions/cache/cache-key.js';
|
|
2
|
-
import { createResourceTag
|
|
2
|
+
import { createResourceTag } from '../../../../../conventions/cache/cache-tag.js';
|
|
3
|
+
import { createPostListCardCacheTags } from '../../../create-post-list-card-cache-tags.js';
|
|
3
4
|
|
|
4
5
|
const createPostFindListCardsCacheKey = (input) => createCacheKey("post", "find-list-cards", {
|
|
5
6
|
locale: input.locale,
|
|
6
7
|
searchString: input.searchString,
|
|
7
8
|
type: input.type,
|
|
9
|
+
deletion: input.deletion ?? "active",
|
|
10
|
+
visibility: input.visibility,
|
|
8
11
|
isActive: input.isActive,
|
|
9
12
|
isIndexActive: input.isIndexActive,
|
|
10
13
|
isSlugActive: input.isSlugActive,
|
|
@@ -20,7 +23,7 @@ const createPostFindListCardsCacheKey = (input) => createCacheKey("post", "find-
|
|
|
20
23
|
state8: input.state8,
|
|
21
24
|
state9: input.state9,
|
|
22
25
|
state10: input.state10,
|
|
23
|
-
|
|
26
|
+
topicKey: input.topicKey,
|
|
24
27
|
topicSlug: input.topicSlug,
|
|
25
28
|
parentId: input.parentId,
|
|
26
29
|
parentSlug: input.parentSlug,
|
|
@@ -38,17 +41,7 @@ const createPostFindListCardsCacheTags = (input, result) => {
|
|
|
38
41
|
...new Set(
|
|
39
42
|
[
|
|
40
43
|
createResourceTag("post"),
|
|
41
|
-
...result.data.items.flatMap(
|
|
42
|
-
createResourceTag("post", { id: post.id }),
|
|
43
|
-
...post.topic ? [
|
|
44
|
-
createResourceTag("post", { id: post.topic.id }),
|
|
45
|
-
createRelationTag("post", "topic", { id: post.id })
|
|
46
|
-
] : [],
|
|
47
|
-
...post.coverImage ? [
|
|
48
|
-
createResourceTag("file", { id: post.coverImage.id }),
|
|
49
|
-
createRelationTag("post", "cover-image", { id: post.id })
|
|
50
|
-
] : []
|
|
51
|
-
])
|
|
44
|
+
...result.data.items.flatMap(createPostListCardCacheTags)
|
|
52
45
|
].flat()
|
|
53
46
|
)
|
|
54
47
|
];
|
package/dist/src/application/resources/post/operations/queries/find-list-cards/validation/schema.js
CHANGED
|
@@ -6,6 +6,8 @@ const postFindListCardsInputSchema = () => z.object({
|
|
|
6
6
|
locale: requiredTextSchema(),
|
|
7
7
|
searchString: textSchema().optional(),
|
|
8
8
|
type: z.enum(POST_TYPES).optional(),
|
|
9
|
+
deletion: z.enum(["active", "deleted", "all"]).optional(),
|
|
10
|
+
visibility: z.literal("public").optional(),
|
|
9
11
|
isActive: z.boolean().optional(),
|
|
10
12
|
isIndexActive: z.boolean().optional(),
|
|
11
13
|
isSlugActive: z.boolean().optional(),
|
|
@@ -21,7 +23,7 @@ const postFindListCardsInputSchema = () => z.object({
|
|
|
21
23
|
state8: z.boolean().optional(),
|
|
22
24
|
state9: z.boolean().optional(),
|
|
23
25
|
state10: z.boolean().optional(),
|
|
24
|
-
|
|
26
|
+
topicKey: idSchema().nullable().optional(),
|
|
25
27
|
topicSlug: textSchema().optional(),
|
|
26
28
|
parentId: idSchema().optional(),
|
|
27
29
|
parentSlug: textSchema().optional(),
|
|
@@ -3,7 +3,9 @@ import { createResourceTag } from '../../../../../conventions/cache/cache-tag.js
|
|
|
3
3
|
|
|
4
4
|
const createPostFindManyCacheKey = (input) => createCacheKey("post", "find-many", {
|
|
5
5
|
type: input?.type,
|
|
6
|
-
|
|
6
|
+
deletion: input?.deletion ?? "active",
|
|
7
|
+
visibility: input?.visibility,
|
|
8
|
+
topicKey: input?.topicKey,
|
|
7
9
|
postIds: normalizeSelection(input?.postIds)
|
|
8
10
|
});
|
|
9
11
|
const createPostFindManyCacheTags = (input, result) => {
|
package/dist/src/application/resources/post/operations/queries/find-many/validation/schema.js
CHANGED
|
@@ -4,7 +4,9 @@ import { idSchema } from '../../../../../../conventions/validation/schema.js';
|
|
|
4
4
|
|
|
5
5
|
const postFindManyInputSchema = () => z.object({
|
|
6
6
|
type: z.enum(POST_TYPES).optional(),
|
|
7
|
-
|
|
7
|
+
deletion: z.enum(["active", "deleted", "all"]).optional(),
|
|
8
|
+
visibility: z.literal("public").optional(),
|
|
9
|
+
topicKey: idSchema().nullable().optional(),
|
|
8
10
|
postIds: z.array(idSchema()).optional()
|
|
9
11
|
}).optional();
|
|
10
12
|
|
|
@@ -3,6 +3,7 @@ import { createResourceTag, createRelationTag } from '../../../../../conventions
|
|
|
3
3
|
|
|
4
4
|
const createPostFindRelationsCacheKey = (input) => createCacheKey("post", "find-relations", { id: input.id });
|
|
5
5
|
const createPostFindRelationsCacheTags = (input) => [
|
|
6
|
+
createResourceTag("post"),
|
|
6
7
|
createResourceTag("post", { id: input.id }),
|
|
7
8
|
createRelationTag("post", "child", { id: input.id }),
|
|
8
9
|
createRelationTag("post", "tagged-post", { id: input.id }),
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ZodError } from 'zod';
|
|
2
|
+
|
|
3
|
+
function invalid(path, message) {
|
|
4
|
+
throw new ZodError([{ code: "custom", path: [path], message }]);
|
|
5
|
+
}
|
|
6
|
+
async function validatePostTopic(input) {
|
|
7
|
+
const { type, topicKey, parents, topics, postQueryPort } = input;
|
|
8
|
+
if (type === "TAG" || type === "PRODUCT_TAG") {
|
|
9
|
+
if (topicKey !== null)
|
|
10
|
+
invalid("topicKey", "Tags must not belong to a collection");
|
|
11
|
+
if (parents.length)
|
|
12
|
+
invalid("parents", "Tags must not have category parents");
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const topic = topicKey !== null && Object.hasOwn(topics, topicKey) ? topics[topicKey] : void 0;
|
|
16
|
+
if (!topic || !topic.roles.includes(type))
|
|
17
|
+
invalid("topicKey", "Unknown collection or unsupported content type");
|
|
18
|
+
const expectedParent = type === "SUBCATEGORY" ? "CATEGORY" : type === "POST" || type === "PRODUCT" ? topic.roles.includes("SUBCATEGORY") ? "SUBCATEGORY" : topic.roles.includes("CATEGORY") ? "CATEGORY" : null : null;
|
|
19
|
+
if (!parents.length) return;
|
|
20
|
+
if (!expectedParent)
|
|
21
|
+
invalid("parents", "This content type does not support category parents");
|
|
22
|
+
const records = await postQueryPort.findMany({
|
|
23
|
+
postIds: parents.map(({ id }) => id)
|
|
24
|
+
});
|
|
25
|
+
if (records.length !== new Set(parents.map(({ id }) => id)).size || records.some(
|
|
26
|
+
(parent) => parent.topicKey !== topicKey || parent.type !== expectedParent
|
|
27
|
+
)) {
|
|
28
|
+
invalid(
|
|
29
|
+
"parents",
|
|
30
|
+
"Parents must have the expected type and belong to the same collection"
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { validatePostTopic };
|
|
@@ -7,5 +7,17 @@ class SeoMetadataPostNotFoundError extends OperationError {
|
|
|
7
7
|
this.name = "SeoMetadataPostNotFoundError";
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
+
class SeoMetadataPageNotFoundError extends OperationError {
|
|
11
|
+
constructor() {
|
|
12
|
+
super({ code: SEO_METADATA_ERROR_CODES.PAGE_NOT_FOUND });
|
|
13
|
+
this.name = "SeoMetadataPageNotFoundError";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
class SeoMetadataPageUnavailableError extends OperationError {
|
|
17
|
+
constructor() {
|
|
18
|
+
super({ code: SEO_METADATA_ERROR_CODES.PAGE_UNAVAILABLE });
|
|
19
|
+
this.name = "SeoMetadataPageUnavailableError";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
10
22
|
|
|
11
|
-
export { SeoMetadataPostNotFoundError };
|
|
23
|
+
export { SeoMetadataPageNotFoundError, SeoMetadataPageUnavailableError, SeoMetadataPostNotFoundError };
|
|
@@ -5,8 +5,14 @@ const createSeoMetadataUpsertInvalidationTags = (input, result) => [
|
|
|
5
5
|
...result.data.seoMetadatas.flatMap(
|
|
6
6
|
(seoMetadata) => createResourceTag("seo-metadata", { id: seoMetadata.id })
|
|
7
7
|
),
|
|
8
|
-
createResourceTag("post"
|
|
9
|
-
|
|
8
|
+
createResourceTag(input.postId !== void 0 ? "post" : "page", {
|
|
9
|
+
id: input.postId ?? input.pageId
|
|
10
|
+
}),
|
|
11
|
+
createRelationTag(
|
|
12
|
+
input.postId !== void 0 ? "post" : "page",
|
|
13
|
+
"seo-metadata",
|
|
14
|
+
{ id: input.postId ?? input.pageId }
|
|
15
|
+
)
|
|
10
16
|
].flat();
|
|
11
17
|
|
|
12
18
|
export { createSeoMetadataUpsertInvalidationTags };
|
|
@@ -5,7 +5,12 @@ import { createSeoMetadataUpsertInvalidationTags } from './cache.js';
|
|
|
5
5
|
import { validateInput } from './validation/validate-input.js';
|
|
6
6
|
|
|
7
7
|
function createSeoMetadataUpsertCommand(input) {
|
|
8
|
-
const {
|
|
8
|
+
const {
|
|
9
|
+
authorization,
|
|
10
|
+
seoMetadataCommandPort,
|
|
11
|
+
postQueryPort,
|
|
12
|
+
pageQueryPort
|
|
13
|
+
} = input;
|
|
9
14
|
return createOperation(
|
|
10
15
|
{
|
|
11
16
|
authorization,
|
|
@@ -14,7 +19,7 @@ function createSeoMetadataUpsertCommand(input) {
|
|
|
14
19
|
invalidate: { tags: createSeoMetadataUpsertInvalidationTags }
|
|
15
20
|
},
|
|
16
21
|
async validate(input2) {
|
|
17
|
-
return validateInput({ input: input2, postQueryPort });
|
|
22
|
+
return validateInput({ input: input2, postQueryPort, pageQueryPort });
|
|
18
23
|
}
|
|
19
24
|
},
|
|
20
25
|
async (input2) => {
|
package/dist/src/application/resources/seo-metadata/operations/commands/upsert/validation/schema.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { addDuplicateLocaleIssues } from '../../../../../../conventions/validation/add-duplicate-locale-issues.js';
|
|
3
|
-
import { textSchema,
|
|
3
|
+
import { textSchema, idSchema, requiredTextSchema } from '../../../../../../conventions/validation/schema.js';
|
|
4
4
|
|
|
5
5
|
const OG_TYPES = [
|
|
6
6
|
"article",
|
|
@@ -30,7 +30,7 @@ const nullableText = textSchema().nullable();
|
|
|
30
30
|
const nullableNonNegativeInt = z.number().nonnegative().max(2147483647).multipleOf(1).nullable();
|
|
31
31
|
const nullableDatetime = z.iso.datetime().nullable();
|
|
32
32
|
const jsonLd = z.array(z.object({}).passthrough());
|
|
33
|
-
const
|
|
33
|
+
const postSeoMetadataUpsertInputSchema = () => z.object({
|
|
34
34
|
postId: idSchema(),
|
|
35
35
|
translations: z.array(
|
|
36
36
|
z.object({
|
|
@@ -67,5 +67,12 @@ const seoMetadataUpsertInputSchema = () => z.object({
|
|
|
67
67
|
})
|
|
68
68
|
).min(1).superRefine(addDuplicateLocaleIssues)
|
|
69
69
|
}).strict();
|
|
70
|
+
const seoMetadataUpsertInputSchema = () => {
|
|
71
|
+
const post = postSeoMetadataUpsertInputSchema();
|
|
72
|
+
return z.union([
|
|
73
|
+
post,
|
|
74
|
+
post.omit({ postId: true }).extend({ pageId: idSchema() }).strict()
|
|
75
|
+
]);
|
|
76
|
+
};
|
|
70
77
|
|
|
71
78
|
export { seoMetadataUpsertInputSchema };
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import { SeoMetadataPostNotFoundError } from '../../../../errors/operation-errors.js';
|
|
1
|
+
import { SeoMetadataPostNotFoundError, SeoMetadataPageUnavailableError, SeoMetadataPageNotFoundError } from '../../../../errors/operation-errors.js';
|
|
2
2
|
import { seoMetadataUpsertInputSchema } from './schema.js';
|
|
3
3
|
|
|
4
4
|
async function validateInput(input) {
|
|
5
5
|
const validatedInput = seoMetadataUpsertInputSchema().parse(input.input);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
throw new SeoMetadataPostNotFoundError();
|
|
6
|
+
if ("postId" in validatedInput) {
|
|
7
|
+
const [post] = await input.postQueryPort.findMany({
|
|
8
|
+
postIds: [validatedInput.postId]
|
|
9
|
+
});
|
|
10
|
+
if (!post) throw new SeoMetadataPostNotFoundError();
|
|
11
|
+
} else {
|
|
12
|
+
if (!input.pageQueryPort) throw new SeoMetadataPageUnavailableError();
|
|
13
|
+
const page = await input.pageQueryPort.findDetail({
|
|
14
|
+
id: validatedInput.pageId
|
|
15
|
+
});
|
|
16
|
+
if (!page) throw new SeoMetadataPageNotFoundError();
|
|
11
17
|
}
|
|
12
18
|
return {
|
|
13
|
-
postId: validatedInput.postId,
|
|
19
|
+
..."postId" in validatedInput ? { postId: validatedInput.postId } : { pageId: validatedInput.pageId },
|
|
14
20
|
translations: validatedInput.translations.map((translation) => ({
|
|
15
21
|
...translation,
|
|
16
22
|
ogArticlePublishedTime: translation.ogArticlePublishedTime ? new Date(translation.ogArticlePublishedTime) : null,
|
|
@@ -39,6 +39,9 @@ import { createFileUpdateCommand } from '../application/resources/file/operation
|
|
|
39
39
|
import { createInquiryDeleteCommand } from '../application/resources/inquiry/operations/commands/delete/inquiry-delete-command.js';
|
|
40
40
|
import { createInquiryFindQuery } from '../application/resources/inquiry/operations/queries/find/inquiry-find-query.js';
|
|
41
41
|
import { createInquiryFindListCardsQuery } from '../application/resources/inquiry/operations/queries/find-list-cards/inquiry-find-list-cards-query.js';
|
|
42
|
+
import { createPageFindDetailQuery } from '../application/resources/page/operations/queries/find-detail/page-find-detail-query.js';
|
|
43
|
+
import { createPageFindManyQuery } from '../application/resources/page/operations/queries/find-many/page-find-many-query.js';
|
|
44
|
+
import { createPageUpdateCommand } from '../application/resources/page/operations/commands/update/page-update-command.js';
|
|
42
45
|
import { createPostFindDetailQuery } from '../application/resources/post/operations/queries/find-detail/post-find-detail-query.js';
|
|
43
46
|
import { createPostFindRelationsQuery } from '../application/resources/post/operations/queries/find-relations/post-find-relations-query.js';
|
|
44
47
|
import { createPostFindManyQuery } from '../application/resources/post/operations/queries/find-many/post-find-many-query.js';
|
|
@@ -46,6 +49,7 @@ import { createPostFindListCardsQuery } from '../application/resources/post/oper
|
|
|
46
49
|
import { createPostCreateCommand } from '../application/resources/post/operations/commands/create/post-create-command.js';
|
|
47
50
|
import { createPostDeleteCommand } from '../application/resources/post/operations/commands/delete/post-delete-command.js';
|
|
48
51
|
import { createPostUpdateCommand } from '../application/resources/post/operations/commands/update/post-update-command.js';
|
|
52
|
+
import { createPostLifecycleCommand } from '../application/resources/post/operations/commands/lifecycle.js';
|
|
49
53
|
import { createSeoMetadataUpsertCommand } from '../application/resources/seo-metadata/operations/commands/upsert/seo-metadata-upsert-command.js';
|
|
50
54
|
import { createAdminSessionAuthenticate } from '../application/sessions/admin/authenticate/admin-session-authenticate.js';
|
|
51
55
|
import { createNoopRateLimiterPort } from '../contracts/rate-limiter/port.js';
|
|
@@ -101,6 +105,8 @@ function createSiteroServer(input) {
|
|
|
101
105
|
const observer = kernel?.observer;
|
|
102
106
|
const rateLimiter = kernel?.rateLimiter ?? createNoopRateLimiterPort();
|
|
103
107
|
const adminPolicies = policies?.resources?.admin;
|
|
108
|
+
const pagePorts = input.ports.resources.page;
|
|
109
|
+
const pagePolicies = policies?.resources?.page;
|
|
104
110
|
const configPolicies = policies?.resources?.config;
|
|
105
111
|
const filePolicies = policies?.resources?.file;
|
|
106
112
|
const inquiryPolicies = policies?.resources?.inquiry;
|
|
@@ -274,6 +280,22 @@ function createSiteroServer(input) {
|
|
|
274
280
|
)
|
|
275
281
|
})
|
|
276
282
|
},
|
|
283
|
+
...pagePorts ? {
|
|
284
|
+
page: {
|
|
285
|
+
findDetail: createPageFindDetailQuery({
|
|
286
|
+
pageQueryPort: pagePorts.pageQueryPort
|
|
287
|
+
}),
|
|
288
|
+
findMany: createPageFindManyQuery({
|
|
289
|
+
pageQueryPort: pagePorts.pageQueryPort,
|
|
290
|
+
authorization: resolveCmsAuthorization(pagePolicies?.findMany)
|
|
291
|
+
}),
|
|
292
|
+
update: createPageUpdateCommand({
|
|
293
|
+
...pagePorts,
|
|
294
|
+
fileQueryPort,
|
|
295
|
+
authorization: resolveCmsAuthorization(pagePolicies?.update)
|
|
296
|
+
})
|
|
297
|
+
}
|
|
298
|
+
} : {},
|
|
277
299
|
config: {
|
|
278
300
|
update: createConfigUpdateCommand({
|
|
279
301
|
configCommandPort,
|
|
@@ -380,6 +402,7 @@ function createSiteroServer(input) {
|
|
|
380
402
|
},
|
|
381
403
|
post: {
|
|
382
404
|
create: createPostCreateCommand({
|
|
405
|
+
topics: input.topics ?? {},
|
|
383
406
|
authorization: resolveCmsAuthorization(postPolicies?.create),
|
|
384
407
|
postCommandPort,
|
|
385
408
|
postQueryPort,
|
|
@@ -387,6 +410,7 @@ function createSiteroServer(input) {
|
|
|
387
410
|
fileQueryPort
|
|
388
411
|
}),
|
|
389
412
|
update: createPostUpdateCommand({
|
|
413
|
+
topics: input.topics ?? {},
|
|
390
414
|
authorization: resolveCmsAuthorization(postPolicies?.update),
|
|
391
415
|
postCommandPort,
|
|
392
416
|
postQueryPort,
|
|
@@ -398,6 +422,18 @@ function createSiteroServer(input) {
|
|
|
398
422
|
postCommandPort,
|
|
399
423
|
postQueryPort
|
|
400
424
|
}),
|
|
425
|
+
restore: createPostLifecycleCommand({
|
|
426
|
+
action: "restore",
|
|
427
|
+
authorization: resolveCmsAuthorization(postPolicies?.restore),
|
|
428
|
+
postCommandPort,
|
|
429
|
+
postQueryPort
|
|
430
|
+
}),
|
|
431
|
+
purge: createPostLifecycleCommand({
|
|
432
|
+
action: "purge",
|
|
433
|
+
authorization: resolveCmsAuthorization(postPolicies?.purge),
|
|
434
|
+
postCommandPort,
|
|
435
|
+
postQueryPort
|
|
436
|
+
}),
|
|
401
437
|
findDetail: createPostFindDetailQuery({
|
|
402
438
|
postQueryPort
|
|
403
439
|
}),
|
|
@@ -414,7 +450,8 @@ function createSiteroServer(input) {
|
|
|
414
450
|
upsert: createSeoMetadataUpsertCommand({
|
|
415
451
|
authorization: resolveCmsAuthorization(seoMetadataPolicies?.upsert),
|
|
416
452
|
seoMetadataCommandPort,
|
|
417
|
-
postQueryPort
|
|
453
|
+
postQueryPort,
|
|
454
|
+
pageQueryPort: pagePorts?.pageQueryPort
|
|
418
455
|
})
|
|
419
456
|
}
|
|
420
457
|
}
|
|
@@ -7,7 +7,7 @@ export declare const LABEL: {
|
|
|
7
7
|
readonly none: "__none";
|
|
8
8
|
readonly all: "__all";
|
|
9
9
|
};
|
|
10
|
-
export declare const RESOURCES: readonly ["admin", "admin-refresh-token", "config", "file", "inquiry", "post", "seo-metadata"];
|
|
10
|
+
export declare const RESOURCES: readonly ["admin", "admin-refresh-token", "config", "file", "inquiry", "page", "post", "seo-metadata"];
|
|
11
11
|
export type Resource = (typeof RESOURCES)[number];
|
|
12
12
|
export interface ResourceRelationMap {
|
|
13
13
|
admin: keyof Omit<AdminDetail, keyof AdminSafe | "translations">;
|
|
@@ -15,6 +15,7 @@ export interface ResourceRelationMap {
|
|
|
15
15
|
config: "translation" | "file";
|
|
16
16
|
file: never;
|
|
17
17
|
inquiry: never;
|
|
18
|
+
page: "file" | "seo-metadata";
|
|
18
19
|
post: "author" | "topic" | "parent" | "child" | "tag" | "tagged-post" | "related-post" | "referencing-post" | "posts-in-topic" | "cover-image" | "content-image" | "file" | "seo-metadata";
|
|
19
20
|
"seo-metadata": never;
|
|
20
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/application/conventions/cache/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,eAAO,MAAM,KAAK;;;;;;CAMR,CAAC;AAKX,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/application/conventions/cache/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,eAAO,MAAM,KAAK;;;;;;CAMR,CAAC;AAKX,eAAO,MAAM,SAAS,wGASZ,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAKlD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,MAAM,SAAS,GAAG,cAAc,CAAC,CAAC;IACjE,qBAAqB,EAAE,KAAK,CAAC;IAC7B,MAAM,EAAE,aAAa,GAAG,MAAM,CAAC;IAC/B,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE,KAAK,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC;IAC9B,IAAI,EACA,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,OAAO,GACP,KAAK,GACL,aAAa,GACb,cAAc,GACd,kBAAkB,GAClB,gBAAgB,GAChB,aAAa,GACb,eAAe,GACf,MAAM,GACN,cAAc,CAAC;IACnB,cAAc,EAAE,KAAK,CAAC;CACvB;AAED,MAAM,MAAM,QAAQ,CAAC,YAAY,SAAS,QAAQ,GAAG,QAAQ,IAC3D,mBAAmB,CAAC,YAAY,CAAC,CAAC;AAKpC,eAAO,MAAM,OAAO,oFAMV,CAAC;AAEX,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/types/src/application/resources/file/operations/queries/find-detail/cache.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/application/resources/file/operations/queries/find-detail/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAMjE,eAAO,MAAM,4BAA4B,GAAI,OAAO,mBAAmB,WACd,CAAC;AAE1D,eAAO,MAAM,6BAA6B,GACxC,GAAG,mBAAmB,EACtB,QAAQ,OAAO,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/application/resources/file/operations/queries/find-detail/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAMjE,eAAO,MAAM,4BAA4B,GAAI,OAAO,mBAAmB,WACd,CAAC;AAE1D,eAAO,MAAM,6BAA6B,GACxC,GAAG,mBAAmB,EACtB,QAAQ,OAAO,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,aAKxD,CAAC"}
|
package/dist/types/src/application/resources/file/operations/queries/find-list-cards/cache.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/application/resources/file/operations/queries/find-list-cards/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,+BAA+B,EAChC,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAOjE,eAAO,MAAM,+BAA+B,GAC1C,OAAO,+BAA+B,WAYpC,CAAC;AAEL,eAAO,MAAM,gCAAgC,GAC3C,GAAG,+BAA+B,EAClC,QAAQ,OAAO,CAAC,uBAAuB,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/application/resources/file/operations/queries/find-list-cards/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,+BAA+B,EAChC,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAOjE,eAAO,MAAM,+BAA+B,GAC1C,OAAO,+BAA+B,WAYpC,CAAC;AAEL,eAAO,MAAM,gCAAgC,GAC3C,GAAG,+BAA+B,EAClC,QAAQ,OAAO,CAAC,uBAAuB,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,aAWpE,CAAC"}
|
package/dist/types/src/application/resources/file/operations/queries/find-relations/cache.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/application/resources/file/operations/queries/find-relations/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAMtD,eAAO,MAAM,+BAA+B,GAC1C,OAAO,sBAAsB,WACgC,CAAC;AAEhE,eAAO,MAAM,gCAAgC,GAC3C,OAAO,sBAAsB,
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/application/resources/file/operations/queries/find-relations/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAMtD,eAAO,MAAM,+BAA+B,GAC1C,OAAO,sBAAsB,WACgC,CAAC;AAEhE,eAAO,MAAM,gCAAgC,GAC3C,OAAO,sBAAsB,aAKrB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FileCard } from "./card";
|
|
2
|
-
import type { AdminSafe, Config, Post } from "sitero-domain";
|
|
2
|
+
import type { AdminSafe, Config, Post, Page } from "sitero-domain";
|
|
3
3
|
/**
|
|
4
4
|
* File detail projection for CMS storage views and future lifecycle commands.
|
|
5
5
|
* Reference collections explain the derived `isInUse` state for CMS views.
|
|
@@ -7,6 +7,7 @@ import type { AdminSafe, Config, Post } from "sitero-domain";
|
|
|
7
7
|
export type FileDetail = FileCard & {
|
|
8
8
|
/** Derived from live resource references; it is not persisted File state. */
|
|
9
9
|
isInUse: boolean;
|
|
10
|
+
pages: Page[];
|
|
10
11
|
adminAsAvatarImage: AdminSafe[];
|
|
11
12
|
postsAsCoverImage: Post[];
|
|
12
13
|
postsAsContentImage: Post[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detail.d.ts","sourceRoot":"","sources":["../../../../../../../src/application/resources/file/projections/detail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"detail.d.ts","sourceRoot":"","sources":["../../../../../../../src/application/resources/file/projections/detail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEnE;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG;IAClC,6EAA6E;IAC7E,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,kBAAkB,EAAE,SAAS,EAAE,CAAC;IAChC,iBAAiB,EAAE,IAAI,EAAE,CAAC;IAC1B,mBAAmB,EAAE,IAAI,EAAE,CAAC;IAC5B,aAAa,EAAE,IAAI,EAAE,CAAC;IACtB,aAAa,EAAE,IAAI,EAAE,CAAC;IACtB,YAAY,EAAE,IAAI,EAAE,CAAC;IACrB,YAAY,EAAE,IAAI,EAAE,CAAC;IACrB,YAAY,EAAE,IAAI,EAAE,CAAC;IACrB,YAAY,EAAE,IAAI,EAAE,CAAC;IACrB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relations.d.ts","sourceRoot":"","sources":["../../../../../../../src/application/resources/file/projections/relations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"relations.d.ts","sourceRoot":"","sources":["../../../../../../../src/application/resources/file/projections/relations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type PageData } from "sitero-domain";
|
|
2
|
+
/** Includes retained references even when their fields are hidden by consumer config. */
|
|
3
|
+
export declare function collectPageFileIds(page: {
|
|
4
|
+
[K in keyof PageData]?: PageData[K] | undefined;
|
|
5
|
+
}): string[];
|
|
6
|
+
//# sourceMappingURL=collect-page-file-ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collect-page-file-ids.d.ts","sourceRoot":"","sources":["../../../../../../src/application/resources/page/collect-page-file-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AACjE,yFAAyF;AACzF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;KACtC,CAAC,IAAI,MAAM,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS;CAChD,GAAG,MAAM,EAAE,CASX"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Stable Page resource operation error codes. */
|
|
2
|
+
export declare const PAGE_ERROR_CODES: {
|
|
3
|
+
readonly UNAVAILABLE: "PAGE_UNAVAILABLE";
|
|
4
|
+
readonly NOT_FOUND: "PAGE_NOT_FOUND";
|
|
5
|
+
readonly MEDIA_TYPE_INVALID: "PAGE_MEDIA_TYPE_INVALID";
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../../../../../../../src/application/resources/page/errors/codes.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/application/resources/page/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OperationError } from "../../../../contracts/operation";
|
|
2
|
+
export declare class PageNotFoundError extends OperationError {
|
|
3
|
+
constructor();
|
|
4
|
+
}
|
|
5
|
+
export declare class PageMediaTypeInvalidError extends OperationError {
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
export declare class PageUnavailableError extends OperationError {
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=operation-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-errors.d.ts","sourceRoot":"","sources":["../../../../../../../src/application/resources/page/errors/operation-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,qBAAa,iBAAkB,SAAQ,cAAc;;CAKpD;AAED,qBAAa,yBAA0B,SAAQ,cAAc;;CAK5D;AAED,qBAAa,oBAAqB,SAAQ,cAAc;;CAKvD"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { PageCommandPort, PageFindManyCriteria, PageLookupInput, PageQueryPort, PageUpdateWriteData, PageUpdateWriteInput, } from "./ports";
|
|
2
|
+
export { PAGE_ERROR_CODES, PageNotFoundError, PageUnavailableError, PageMediaTypeInvalidError, } from "./errors";
|
|
3
|
+
export { type PageReference, type PageMedia, type PageDetail, } from "./projections";
|
|
4
|
+
export { type PageFindDetailQuery, createPageFindDetailQuery, type PageFindDetailInput, type PageFindDetailResult, type PageFindManyQuery, createPageFindManyQuery, type PageFindManyInput, type PageFindManyResult, type PageUpdateInput, type PageUpdateResult, createPageUpdateCommand, type PageUpdateCommand, } from "./operations";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/application/resources/page/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,UAAU,CAAC;AAKlB,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,UAAU,GAChB,MAAM,eAAe,CAAC;AAKvB,OAAO,EAEL,KAAK,mBAAmB,EACxB,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EAGvB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,uBAAuB,EACvB,KAAK,iBAAiB,GACvB,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/application/resources/page/operations/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,uBAAuB,GACxB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PageUpdateResult, ValidatedPageUpdateInput } from "./types";
|
|
2
|
+
import type { OperationSuccess } from "../../../../../../kernel";
|
|
3
|
+
export declare const createPageUpdateInvalidationTags: (input: ValidatedPageUpdateInput, result: Extract<PageUpdateResult, OperationSuccess<unknown>>) => string[];
|
|
4
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/application/resources/page/operations/commands/update/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAOjE,eAAO,MAAM,gCAAgC,GAC3C,OAAO,wBAAwB,EAC/B,QAAQ,OAAO,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,aAqB7D,CAAC"}
|