@zlooks.cn/blog-shared 1.0.0 → 1.0.1
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/events/catalog.d.ts +2 -0
- package/dist/events/catalog.d.ts.map +1 -0
- package/dist/events/catalog.js +80 -0
- package/dist/events/catalog.js.map +1 -0
- package/dist/events/comment-deleted.d.ts +33 -0
- package/dist/events/comment-deleted.d.ts.map +1 -0
- package/dist/events/comment-deleted.js +16 -0
- package/dist/events/comment-deleted.js.map +1 -0
- package/dist/events/comment-reply-changed.d.ts +45 -0
- package/dist/events/comment-reply-changed.d.ts.map +1 -0
- package/dist/events/comment-reply-changed.js +15 -0
- package/dist/events/comment-reply-changed.js.map +1 -0
- package/dist/events/comment-status-changed.d.ts +51 -0
- package/dist/events/comment-status-changed.d.ts.map +1 -0
- package/dist/events/comment-status-changed.js +16 -0
- package/dist/events/comment-status-changed.js.map +1 -0
- package/dist/events/comment-submitted.d.ts +45 -0
- package/dist/events/comment-submitted.d.ts.map +1 -0
- package/dist/events/comment-submitted.js +15 -0
- package/dist/events/comment-submitted.js.map +1 -0
- package/dist/events/definition.d.ts +3 -0
- package/dist/events/definition.d.ts.map +1 -0
- package/dist/events/definition.js +10 -0
- package/dist/events/definition.js.map +1 -0
- package/dist/events/page-archived.d.ts +45 -0
- package/dist/events/page-archived.d.ts.map +1 -0
- package/dist/events/page-archived.js +15 -0
- package/dist/events/page-archived.js.map +1 -0
- package/dist/events/page-publication-updated.d.ts +54 -0
- package/dist/events/page-publication-updated.d.ts.map +1 -0
- package/dist/events/page-publication-updated.js +18 -0
- package/dist/events/page-publication-updated.js.map +1 -0
- package/dist/events/page-published.d.ts +45 -0
- package/dist/events/page-published.d.ts.map +1 -0
- package/dist/events/page-published.js +15 -0
- package/dist/events/page-published.js.map +1 -0
- package/dist/events/post-archived.d.ts +64 -0
- package/dist/events/post-archived.d.ts.map +1 -0
- package/dist/events/post-archived.js +15 -0
- package/dist/events/post-archived.js.map +1 -0
- package/dist/events/post-publication-updated.d.ts +74 -0
- package/dist/events/post-publication-updated.d.ts.map +1 -0
- package/dist/events/post-publication-updated.js +18 -0
- package/dist/events/post-publication-updated.js.map +1 -0
- package/dist/events/post-published.d.ts +64 -0
- package/dist/events/post-published.d.ts.map +1 -0
- package/dist/events/post-published.js +15 -0
- package/dist/events/post-published.js.map +1 -0
- package/dist/events/snapshots.d.ts +105 -0
- package/dist/events/snapshots.d.ts.map +1 -0
- package/dist/events/snapshots.js +56 -0
- package/dist/events/snapshots.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/events/catalog.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,kBAAkB,6CAkE7B,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { defineEventCatalog } from '@zlooks.cn/event-bus';
|
|
2
|
+
import { BLOG_PLUGIN_ID } from '../identity.js';
|
|
3
|
+
import { blogCommentDeletedEvent } from './comment-deleted.js';
|
|
4
|
+
import { blogCommentReplyChangedEvent } from './comment-reply-changed.js';
|
|
5
|
+
import { blogCommentStatusChangedEvent } from './comment-status-changed.js';
|
|
6
|
+
import { blogCommentSubmittedEvent } from './comment-submitted.js';
|
|
7
|
+
import { blogPageArchivedEvent } from './page-archived.js';
|
|
8
|
+
import { blogPagePublicationUpdatedEvent } from './page-publication-updated.js';
|
|
9
|
+
import { blogPagePublishedEvent } from './page-published.js';
|
|
10
|
+
import { blogPostArchivedEvent } from './post-archived.js';
|
|
11
|
+
import { blogPostPublicationUpdatedEvent } from './post-publication-updated.js';
|
|
12
|
+
import { blogPostPublishedEvent } from './post-published.js';
|
|
13
|
+
export const BLOG_EVENT_CATALOG = defineEventCatalog({
|
|
14
|
+
providerId: BLOG_PLUGIN_ID,
|
|
15
|
+
displayName: '博客服务事件',
|
|
16
|
+
contractPackage: '@zlooks.cn/blog-shared',
|
|
17
|
+
events: [
|
|
18
|
+
{
|
|
19
|
+
definition: blogPostPublishedEvent,
|
|
20
|
+
title: '博客文章已发布',
|
|
21
|
+
description: '博客文章首次进入公开发布状态,携带不含 Markdown 正文的完整安全快照。',
|
|
22
|
+
consumerExport: 'consumeBlogPostPublishedEvent',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
definition: blogPostPublicationUpdatedEvent,
|
|
26
|
+
title: '已发布博客文章已更新',
|
|
27
|
+
description: '处于公开发布状态的博客文章发生可见内容或元数据变更。',
|
|
28
|
+
consumerExport: 'consumeBlogPostPublicationUpdatedEvent',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
definition: blogPostArchivedEvent,
|
|
32
|
+
title: '博客文章已归档',
|
|
33
|
+
description: '博客文章退出公开发布状态并进入归档状态。',
|
|
34
|
+
consumerExport: 'consumeBlogPostArchivedEvent',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
definition: blogPagePublishedEvent,
|
|
38
|
+
title: '博客页面已发布',
|
|
39
|
+
description: '博客页面首次进入公开发布状态,携带不含 Markdown 正文的完整安全快照。',
|
|
40
|
+
consumerExport: 'consumeBlogPagePublishedEvent',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
definition: blogPagePublicationUpdatedEvent,
|
|
44
|
+
title: '已发布博客页面已更新',
|
|
45
|
+
description: '处于公开发布状态的博客页面发生可见内容或元数据变更。',
|
|
46
|
+
consumerExport: 'consumeBlogPagePublicationUpdatedEvent',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
definition: blogPageArchivedEvent,
|
|
50
|
+
title: '博客页面已归档',
|
|
51
|
+
description: '博客页面退出公开发布状态并进入归档状态。',
|
|
52
|
+
consumerExport: 'consumeBlogPageArchivedEvent',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
definition: blogCommentSubmittedEvent,
|
|
56
|
+
title: '博客评论已提交',
|
|
57
|
+
description: '登录用户已经提交一条处于待审核状态的博客评论。',
|
|
58
|
+
consumerExport: 'consumeBlogCommentSubmittedEvent',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
definition: blogCommentStatusChangedEvent,
|
|
62
|
+
title: '博客评论审核状态已变化',
|
|
63
|
+
description: '博客评论的待审核、通过或拒绝状态发生真实变化。',
|
|
64
|
+
consumerExport: 'consumeBlogCommentStatusChangedEvent',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
definition: blogCommentReplyChangedEvent,
|
|
68
|
+
title: '博客评论回复已变化',
|
|
69
|
+
description: '博客评论的站点回复内容或回复时间发生变化。',
|
|
70
|
+
consumerExport: 'consumeBlogCommentReplyChangedEvent',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
definition: blogCommentDeletedEvent,
|
|
74
|
+
title: '博客评论已删除',
|
|
75
|
+
description: '博客评论已经删除,携带用于下游清理投影的最小安全快照。',
|
|
76
|
+
consumerExport: 'consumeBlogCommentDeletedEvent',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/events/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;IACnD,UAAU,EAAE,cAAc;IAC1B,WAAW,EAAE,QAAQ;IACrB,eAAe,EAAE,wBAAwB;IACzC,MAAM,EAAE;QACN;YACE,UAAU,EAAE,sBAAsB;YAClC,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,yCAAyC;YACtD,cAAc,EAAE,+BAA+B;SAChD;QACD;YACE,UAAU,EAAE,+BAA+B;YAC3C,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,4BAA4B;YACzC,cAAc,EAAE,wCAAwC;SACzD;QACD;YACE,UAAU,EAAE,qBAAqB;YACjC,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,sBAAsB;YACnC,cAAc,EAAE,8BAA8B;SAC/C;QACD;YACE,UAAU,EAAE,sBAAsB;YAClC,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,yCAAyC;YACtD,cAAc,EAAE,+BAA+B;SAChD;QACD;YACE,UAAU,EAAE,+BAA+B;YAC3C,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,4BAA4B;YACzC,cAAc,EAAE,wCAAwC;SACzD;QACD;YACE,UAAU,EAAE,qBAAqB;YACjC,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,sBAAsB;YACnC,cAAc,EAAE,8BAA8B;SAC/C;QACD;YACE,UAAU,EAAE,yBAAyB;YACrC,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,yBAAyB;YACtC,cAAc,EAAE,kCAAkC;SACnD;QACD;YACE,UAAU,EAAE,6BAA6B;YACzC,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,yBAAyB;YACtC,cAAc,EAAE,sCAAsC;SACvD;QACD;YACE,UAAU,EAAE,4BAA4B;YACxC,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,uBAAuB;YACpC,cAAc,EAAE,qCAAqC;SACtD;QACD;YACE,UAAU,EAAE,uBAAuB;YACnC,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,6BAA6B;YAC1C,cAAc,EAAE,gCAAgC;SACjD;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { DomainEvent } from '@zlooks.cn/event-bus';
|
|
2
|
+
import type { EventConsumeOptions, EventConsumer, EventSubscription } from '@zlooks.cn/event-client';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export declare const BLOG_COMMENT_DELETED_EVENT_TYPE = "cn.zlooks.blog.comment-deleted.v1";
|
|
5
|
+
declare const dataSchema: z.ZodReadonly<z.ZodObject<{
|
|
6
|
+
comment: z.ZodReadonly<z.ZodObject<{
|
|
7
|
+
id: z.ZodUUID;
|
|
8
|
+
postId: z.ZodUUID;
|
|
9
|
+
userId: z.ZodUUID;
|
|
10
|
+
status: z.ZodEnum<{
|
|
11
|
+
approved: "approved";
|
|
12
|
+
pending: "pending";
|
|
13
|
+
rejected: "rejected";
|
|
14
|
+
}>;
|
|
15
|
+
version: z.ZodNumber;
|
|
16
|
+
}, z.core.$strict>>;
|
|
17
|
+
deletedAt: z.ZodISODateTime;
|
|
18
|
+
}, z.core.$strict>>;
|
|
19
|
+
export declare const blogCommentDeletedEvent: import("@zlooks.cn/event-bus").EventDefinition<"cn.zlooks.blog.comment-deleted.v1", Readonly<{
|
|
20
|
+
comment: Readonly<{
|
|
21
|
+
id: string;
|
|
22
|
+
postId: string;
|
|
23
|
+
userId: string;
|
|
24
|
+
status: "approved" | "pending" | "rejected";
|
|
25
|
+
version: number;
|
|
26
|
+
}>;
|
|
27
|
+
deletedAt: string;
|
|
28
|
+
}>>;
|
|
29
|
+
export type BlogCommentDeletedEvent = DomainEvent<typeof BLOG_COMMENT_DELETED_EVENT_TYPE, z.infer<typeof dataSchema>>;
|
|
30
|
+
export declare function parseBlogCommentDeletedEvent(input: unknown): BlogCommentDeletedEvent;
|
|
31
|
+
export declare function consumeBlogCommentDeletedEvent(events: EventConsumer, options: EventConsumeOptions<ReturnType<typeof blogCommentDeletedEvent.parse>>): EventSubscription;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=comment-deleted.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-deleted.d.ts","sourceRoot":"","sources":["../../src/events/comment-deleted.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,+BAA+B,sCAAsC,CAAC;AACnF,QAAA,MAAM,UAAU;;;;;;;;;;;;;mBAGH,CAAC;AAEd,eAAO,MAAM,uBAAuB;;;;;;;;;GAKnC,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAC/C,OAAO,+BAA+B,EACtC,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAC3B,CAAC;AACF,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,OAAO,GAAG,uBAAuB,CAEpF;AACD,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,mBAAmB,CAAC,UAAU,CAAC,OAAO,uBAAuB,CAAC,KAAK,CAAC,CAAC,GAC7E,iBAAiB,CAEnB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineBlogEvent } from './definition.js';
|
|
3
|
+
import { blogDeletedCommentSnapshotSchema } from './snapshots.js';
|
|
4
|
+
export const BLOG_COMMENT_DELETED_EVENT_TYPE = 'cn.zlooks.blog.comment-deleted.v1';
|
|
5
|
+
const dataSchema = z.strictObject({
|
|
6
|
+
comment: blogDeletedCommentSnapshotSchema,
|
|
7
|
+
deletedAt: z.iso.datetime({ offset: true }),
|
|
8
|
+
}).readonly();
|
|
9
|
+
export const blogCommentDeletedEvent = defineBlogEvent(BLOG_COMMENT_DELETED_EVENT_TYPE, 'comment', dataSchema, ({ comment }) => comment.id);
|
|
10
|
+
export function parseBlogCommentDeletedEvent(input) {
|
|
11
|
+
return blogCommentDeletedEvent.parse(input);
|
|
12
|
+
}
|
|
13
|
+
export function consumeBlogCommentDeletedEvent(events, options) {
|
|
14
|
+
return events.consume(blogCommentDeletedEvent, options);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=comment-deleted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-deleted.js","sourceRoot":"","sources":["../../src/events/comment-deleted.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,gCAAgC,EAAE,MAAM,gBAAgB,CAAC;AAElE,MAAM,CAAC,MAAM,+BAA+B,GAAG,mCAAmC,CAAC;AACnF,MAAM,UAAU,GAAG,CAAC,CAAC,YAAY,CAAC;IAChC,OAAO,EAAE,gCAAgC;IACzC,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;CAC5C,CAAC,CAAC,QAAQ,EAAE,CAAC;AAEd,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CACpD,+BAA+B,EAC/B,SAAS,EACT,UAAU,EACV,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAC5B,CAAC;AAKF,MAAM,UAAU,4BAA4B,CAAC,KAAc;IACzD,OAAO,uBAAuB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC;AACD,MAAM,UAAU,8BAA8B,CAC5C,MAAqB,EACrB,OAA8E;IAE9E,OAAO,MAAM,CAAC,OAAO,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { DomainEvent } from '@zlooks.cn/event-bus';
|
|
2
|
+
import type { EventConsumeOptions, EventConsumer, EventSubscription } from '@zlooks.cn/event-client';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export declare const BLOG_COMMENT_REPLY_CHANGED_EVENT_TYPE = "cn.zlooks.blog.comment-reply-changed.v1";
|
|
5
|
+
declare const dataSchema: z.ZodReadonly<z.ZodObject<{
|
|
6
|
+
comment: z.ZodReadonly<z.ZodObject<{
|
|
7
|
+
id: z.ZodUUID;
|
|
8
|
+
postId: z.ZodUUID;
|
|
9
|
+
userId: z.ZodUUID;
|
|
10
|
+
content: z.ZodString;
|
|
11
|
+
status: z.ZodEnum<{
|
|
12
|
+
approved: "approved";
|
|
13
|
+
pending: "pending";
|
|
14
|
+
rejected: "rejected";
|
|
15
|
+
}>;
|
|
16
|
+
replyContent: z.ZodNullable<z.ZodString>;
|
|
17
|
+
repliedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
18
|
+
location: z.ZodNullable<z.ZodString>;
|
|
19
|
+
client: z.ZodNullable<z.ZodString>;
|
|
20
|
+
createdAt: z.ZodISODateTime;
|
|
21
|
+
updatedAt: z.ZodISODateTime;
|
|
22
|
+
version: z.ZodNumber;
|
|
23
|
+
}, z.core.$strict>>;
|
|
24
|
+
}, z.core.$strict>>;
|
|
25
|
+
export declare const blogCommentReplyChangedEvent: import("@zlooks.cn/event-bus").EventDefinition<"cn.zlooks.blog.comment-reply-changed.v1", Readonly<{
|
|
26
|
+
comment: Readonly<{
|
|
27
|
+
id: string;
|
|
28
|
+
postId: string;
|
|
29
|
+
userId: string;
|
|
30
|
+
content: string;
|
|
31
|
+
status: "approved" | "pending" | "rejected";
|
|
32
|
+
replyContent: string | null;
|
|
33
|
+
repliedAt: string | null;
|
|
34
|
+
location: string | null;
|
|
35
|
+
client: string | null;
|
|
36
|
+
createdAt: string;
|
|
37
|
+
updatedAt: string;
|
|
38
|
+
version: number;
|
|
39
|
+
}>;
|
|
40
|
+
}>>;
|
|
41
|
+
export type BlogCommentReplyChangedEvent = DomainEvent<typeof BLOG_COMMENT_REPLY_CHANGED_EVENT_TYPE, z.infer<typeof dataSchema>>;
|
|
42
|
+
export declare function parseBlogCommentReplyChangedEvent(input: unknown): BlogCommentReplyChangedEvent;
|
|
43
|
+
export declare function consumeBlogCommentReplyChangedEvent(events: EventConsumer, options: EventConsumeOptions<ReturnType<typeof blogCommentReplyChangedEvent.parse>>): EventSubscription;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=comment-reply-changed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-reply-changed.d.ts","sourceRoot":"","sources":["../../src/events/comment-reply-changed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,qCAAqC,4CAA4C,CAAC;AAC/F,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;mBAEH,CAAC;AAEd,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;GAKxC,CAAC;AACF,MAAM,MAAM,4BAA4B,GAAG,WAAW,CACpD,OAAO,qCAAqC,EAC5C,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAC3B,CAAC;AACF,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,OAAO,GAAG,4BAA4B,CAE9F;AACD,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,mBAAmB,CAAC,UAAU,CAAC,OAAO,4BAA4B,CAAC,KAAK,CAAC,CAAC,GAClF,iBAAiB,CAEnB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineBlogEvent } from './definition.js';
|
|
3
|
+
import { blogCommentEventSnapshotSchema } from './snapshots.js';
|
|
4
|
+
export const BLOG_COMMENT_REPLY_CHANGED_EVENT_TYPE = 'cn.zlooks.blog.comment-reply-changed.v1';
|
|
5
|
+
const dataSchema = z.strictObject({
|
|
6
|
+
comment: blogCommentEventSnapshotSchema,
|
|
7
|
+
}).readonly();
|
|
8
|
+
export const blogCommentReplyChangedEvent = defineBlogEvent(BLOG_COMMENT_REPLY_CHANGED_EVENT_TYPE, 'comment', dataSchema, ({ comment }) => comment.id);
|
|
9
|
+
export function parseBlogCommentReplyChangedEvent(input) {
|
|
10
|
+
return blogCommentReplyChangedEvent.parse(input);
|
|
11
|
+
}
|
|
12
|
+
export function consumeBlogCommentReplyChangedEvent(events, options) {
|
|
13
|
+
return events.consume(blogCommentReplyChangedEvent, options);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=comment-reply-changed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-reply-changed.js","sourceRoot":"","sources":["../../src/events/comment-reply-changed.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAEhE,MAAM,CAAC,MAAM,qCAAqC,GAAG,yCAAyC,CAAC;AAC/F,MAAM,UAAU,GAAG,CAAC,CAAC,YAAY,CAAC;IAChC,OAAO,EAAE,8BAA8B;CACxC,CAAC,CAAC,QAAQ,EAAE,CAAC;AAEd,MAAM,CAAC,MAAM,4BAA4B,GAAG,eAAe,CACzD,qCAAqC,EACrC,SAAS,EACT,UAAU,EACV,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAC5B,CAAC;AAKF,MAAM,UAAU,iCAAiC,CAAC,KAAc;IAC9D,OAAO,4BAA4B,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACnD,CAAC;AACD,MAAM,UAAU,mCAAmC,CACjD,MAAqB,EACrB,OAAmF;IAEnF,OAAO,MAAM,CAAC,OAAO,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { DomainEvent } from '@zlooks.cn/event-bus';
|
|
2
|
+
import type { EventConsumeOptions, EventConsumer, EventSubscription } from '@zlooks.cn/event-client';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export declare const BLOG_COMMENT_STATUS_CHANGED_EVENT_TYPE = "cn.zlooks.blog.comment-status-changed.v1";
|
|
5
|
+
declare const dataSchema: z.ZodReadonly<z.ZodObject<{
|
|
6
|
+
comment: z.ZodReadonly<z.ZodObject<{
|
|
7
|
+
id: z.ZodUUID;
|
|
8
|
+
postId: z.ZodUUID;
|
|
9
|
+
userId: z.ZodUUID;
|
|
10
|
+
content: z.ZodString;
|
|
11
|
+
status: z.ZodEnum<{
|
|
12
|
+
approved: "approved";
|
|
13
|
+
pending: "pending";
|
|
14
|
+
rejected: "rejected";
|
|
15
|
+
}>;
|
|
16
|
+
replyContent: z.ZodNullable<z.ZodString>;
|
|
17
|
+
repliedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
18
|
+
location: z.ZodNullable<z.ZodString>;
|
|
19
|
+
client: z.ZodNullable<z.ZodString>;
|
|
20
|
+
createdAt: z.ZodISODateTime;
|
|
21
|
+
updatedAt: z.ZodISODateTime;
|
|
22
|
+
version: z.ZodNumber;
|
|
23
|
+
}, z.core.$strict>>;
|
|
24
|
+
previousStatus: z.ZodEnum<{
|
|
25
|
+
approved: "approved";
|
|
26
|
+
pending: "pending";
|
|
27
|
+
rejected: "rejected";
|
|
28
|
+
}>;
|
|
29
|
+
}, z.core.$strict>>;
|
|
30
|
+
export declare const blogCommentStatusChangedEvent: import("@zlooks.cn/event-bus").EventDefinition<"cn.zlooks.blog.comment-status-changed.v1", Readonly<{
|
|
31
|
+
comment: Readonly<{
|
|
32
|
+
id: string;
|
|
33
|
+
postId: string;
|
|
34
|
+
userId: string;
|
|
35
|
+
content: string;
|
|
36
|
+
status: "approved" | "pending" | "rejected";
|
|
37
|
+
replyContent: string | null;
|
|
38
|
+
repliedAt: string | null;
|
|
39
|
+
location: string | null;
|
|
40
|
+
client: string | null;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
updatedAt: string;
|
|
43
|
+
version: number;
|
|
44
|
+
}>;
|
|
45
|
+
previousStatus: "approved" | "pending" | "rejected";
|
|
46
|
+
}>>;
|
|
47
|
+
export type BlogCommentStatusChangedEvent = DomainEvent<typeof BLOG_COMMENT_STATUS_CHANGED_EVENT_TYPE, z.infer<typeof dataSchema>>;
|
|
48
|
+
export declare function parseBlogCommentStatusChangedEvent(input: unknown): BlogCommentStatusChangedEvent;
|
|
49
|
+
export declare function consumeBlogCommentStatusChangedEvent(events: EventConsumer, options: EventConsumeOptions<ReturnType<typeof blogCommentStatusChangedEvent.parse>>): EventSubscription;
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=comment-status-changed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-status-changed.d.ts","sourceRoot":"","sources":["../../src/events/comment-status-changed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,sCAAsC,6CAA6C,CAAC;AACjG,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;mBAMJ,CAAC;AAEb,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;GAKzC,CAAC;AACF,MAAM,MAAM,6BAA6B,GAAG,WAAW,CACrD,OAAO,sCAAsC,EAC7C,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAC3B,CAAC;AACF,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,OAAO,GAAG,6BAA6B,CAEhG;AACD,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,mBAAmB,CAAC,UAAU,CAAC,OAAO,6BAA6B,CAAC,KAAK,CAAC,CAAC,GACnF,iBAAiB,CAEnB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineBlogEvent } from './definition.js';
|
|
3
|
+
import { blogCommentEventSnapshotSchema, blogCommentStatusSchema } from './snapshots.js';
|
|
4
|
+
export const BLOG_COMMENT_STATUS_CHANGED_EVENT_TYPE = 'cn.zlooks.blog.comment-status-changed.v1';
|
|
5
|
+
const dataSchema = z.strictObject({
|
|
6
|
+
comment: blogCommentEventSnapshotSchema,
|
|
7
|
+
previousStatus: blogCommentStatusSchema,
|
|
8
|
+
}).refine(({ comment, previousStatus }) => comment.status !== previousStatus, { message: 'Comment status change requires different previous and current statuses', path: ['previousStatus'] }).readonly();
|
|
9
|
+
export const blogCommentStatusChangedEvent = defineBlogEvent(BLOG_COMMENT_STATUS_CHANGED_EVENT_TYPE, 'comment', dataSchema, ({ comment }) => comment.id);
|
|
10
|
+
export function parseBlogCommentStatusChangedEvent(input) {
|
|
11
|
+
return blogCommentStatusChangedEvent.parse(input);
|
|
12
|
+
}
|
|
13
|
+
export function consumeBlogCommentStatusChangedEvent(events, options) {
|
|
14
|
+
return events.consume(blogCommentStatusChangedEvent, options);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=comment-status-changed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-status-changed.js","sourceRoot":"","sources":["../../src/events/comment-status-changed.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,8BAA8B,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzF,MAAM,CAAC,MAAM,sCAAsC,GAAG,0CAA0C,CAAC;AACjG,MAAM,UAAU,GAAG,CAAC,CAAC,YAAY,CAAC;IAChC,OAAO,EAAE,8BAA8B;IACvC,cAAc,EAAE,uBAAuB;CACxC,CAAC,CAAC,MAAM,CACP,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,KAAK,cAAc,EAClE,EAAE,OAAO,EAAE,wEAAwE,EAAE,IAAI,EAAE,CAAC,gBAAgB,CAAC,EAAE,CAChH,CAAC,QAAQ,EAAE,CAAC;AAEb,MAAM,CAAC,MAAM,6BAA6B,GAAG,eAAe,CAC1D,sCAAsC,EACtC,SAAS,EACT,UAAU,EACV,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAC5B,CAAC;AAKF,MAAM,UAAU,kCAAkC,CAAC,KAAc;IAC/D,OAAO,6BAA6B,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACpD,CAAC;AACD,MAAM,UAAU,oCAAoC,CAClD,MAAqB,EACrB,OAAoF;IAEpF,OAAO,MAAM,CAAC,OAAO,CAAC,6BAA6B,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { DomainEvent } from '@zlooks.cn/event-bus';
|
|
2
|
+
import type { EventConsumeOptions, EventConsumer, EventSubscription } from '@zlooks.cn/event-client';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export declare const BLOG_COMMENT_SUBMITTED_EVENT_TYPE = "cn.zlooks.blog.comment-submitted.v1";
|
|
5
|
+
declare const dataSchema: z.ZodReadonly<z.ZodObject<{
|
|
6
|
+
comment: z.ZodReadonly<z.ZodObject<{
|
|
7
|
+
id: z.ZodUUID;
|
|
8
|
+
postId: z.ZodUUID;
|
|
9
|
+
userId: z.ZodUUID;
|
|
10
|
+
content: z.ZodString;
|
|
11
|
+
status: z.ZodEnum<{
|
|
12
|
+
approved: "approved";
|
|
13
|
+
pending: "pending";
|
|
14
|
+
rejected: "rejected";
|
|
15
|
+
}>;
|
|
16
|
+
replyContent: z.ZodNullable<z.ZodString>;
|
|
17
|
+
repliedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
18
|
+
location: z.ZodNullable<z.ZodString>;
|
|
19
|
+
client: z.ZodNullable<z.ZodString>;
|
|
20
|
+
createdAt: z.ZodISODateTime;
|
|
21
|
+
updatedAt: z.ZodISODateTime;
|
|
22
|
+
version: z.ZodNumber;
|
|
23
|
+
}, z.core.$strict>>;
|
|
24
|
+
}, z.core.$strict>>;
|
|
25
|
+
export declare const blogCommentSubmittedEvent: import("@zlooks.cn/event-bus").EventDefinition<"cn.zlooks.blog.comment-submitted.v1", Readonly<{
|
|
26
|
+
comment: Readonly<{
|
|
27
|
+
id: string;
|
|
28
|
+
postId: string;
|
|
29
|
+
userId: string;
|
|
30
|
+
content: string;
|
|
31
|
+
status: "approved" | "pending" | "rejected";
|
|
32
|
+
replyContent: string | null;
|
|
33
|
+
repliedAt: string | null;
|
|
34
|
+
location: string | null;
|
|
35
|
+
client: string | null;
|
|
36
|
+
createdAt: string;
|
|
37
|
+
updatedAt: string;
|
|
38
|
+
version: number;
|
|
39
|
+
}>;
|
|
40
|
+
}>>;
|
|
41
|
+
export type BlogCommentSubmittedEvent = DomainEvent<typeof BLOG_COMMENT_SUBMITTED_EVENT_TYPE, z.infer<typeof dataSchema>>;
|
|
42
|
+
export declare function parseBlogCommentSubmittedEvent(input: unknown): BlogCommentSubmittedEvent;
|
|
43
|
+
export declare function consumeBlogCommentSubmittedEvent(events: EventConsumer, options: EventConsumeOptions<ReturnType<typeof blogCommentSubmittedEvent.parse>>): EventSubscription;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=comment-submitted.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-submitted.d.ts","sourceRoot":"","sources":["../../src/events/comment-submitted.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,iCAAiC,wCAAwC,CAAC;AACvF,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;mBAKH,CAAC;AAEd,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;GAKrC,CAAC;AACF,MAAM,MAAM,yBAAyB,GAAG,WAAW,CACjD,OAAO,iCAAiC,EACxC,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAC3B,CAAC;AACF,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,yBAAyB,CAExF;AACD,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,mBAAmB,CAAC,UAAU,CAAC,OAAO,yBAAyB,CAAC,KAAK,CAAC,CAAC,GAC/E,iBAAiB,CAEnB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineBlogEvent } from './definition.js';
|
|
3
|
+
import { blogCommentEventSnapshotSchema } from './snapshots.js';
|
|
4
|
+
export const BLOG_COMMENT_SUBMITTED_EVENT_TYPE = 'cn.zlooks.blog.comment-submitted.v1';
|
|
5
|
+
const dataSchema = z.strictObject({
|
|
6
|
+
comment: blogCommentEventSnapshotSchema.refine(({ status }) => status === 'pending', 'Submitted comment event requires pending status'),
|
|
7
|
+
}).readonly();
|
|
8
|
+
export const blogCommentSubmittedEvent = defineBlogEvent(BLOG_COMMENT_SUBMITTED_EVENT_TYPE, 'comment', dataSchema, ({ comment }) => comment.id);
|
|
9
|
+
export function parseBlogCommentSubmittedEvent(input) {
|
|
10
|
+
return blogCommentSubmittedEvent.parse(input);
|
|
11
|
+
}
|
|
12
|
+
export function consumeBlogCommentSubmittedEvent(events, options) {
|
|
13
|
+
return events.consume(blogCommentSubmittedEvent, options);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=comment-submitted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-submitted.js","sourceRoot":"","sources":["../../src/events/comment-submitted.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAEhE,MAAM,CAAC,MAAM,iCAAiC,GAAG,qCAAqC,CAAC;AACvF,MAAM,UAAU,GAAG,CAAC,CAAC,YAAY,CAAC;IAChC,OAAO,EAAE,8BAA8B,CAAC,MAAM,CAC5C,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,SAAS,EACpC,iDAAiD,CAClD;CACF,CAAC,CAAC,QAAQ,EAAE,CAAC;AAEd,MAAM,CAAC,MAAM,yBAAyB,GAAG,eAAe,CACtD,iCAAiC,EACjC,SAAS,EACT,UAAU,EACV,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAC5B,CAAC;AAKF,MAAM,UAAU,8BAA8B,CAAC,KAAc;IAC3D,OAAO,yBAAyB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AACD,MAAM,UAAU,gCAAgC,CAC9C,MAAqB,EACrB,OAAgF;IAEhF,OAAO,MAAM,CAAC,OAAO,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type EventDataSchema } from '@zlooks.cn/event-bus';
|
|
2
|
+
export declare function defineBlogEvent<const TType extends string, TData>(type: TType, aggregateType: string, dataSchema: EventDataSchema<TData>, aggregateId: (data: TData) => string): import("@zlooks.cn/event-bus").EventDefinition<TType, TData>;
|
|
3
|
+
//# sourceMappingURL=definition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/events/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGzE,wBAAgB,eAAe,CAAC,KAAK,CAAC,KAAK,SAAS,MAAM,EAAE,KAAK,EAC/D,IAAI,EAAE,KAAK,EACX,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,eAAe,CAAC,KAAK,CAAC,EAClC,WAAW,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,MAAM,gEAOrC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineEvent } from '@zlooks.cn/event-bus';
|
|
2
|
+
import { BLOG_SERVICE_NAMESPACE } from '../identity.js';
|
|
3
|
+
export function defineBlogEvent(type, aggregateType, dataSchema, aggregateId) {
|
|
4
|
+
return defineEvent(type, dataSchema, {
|
|
5
|
+
producer: BLOG_SERVICE_NAMESPACE,
|
|
6
|
+
aggregateType,
|
|
7
|
+
aggregateId,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../src/events/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAwB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,UAAU,eAAe,CAC7B,IAAW,EACX,aAAqB,EACrB,UAAkC,EAClC,WAAoC;IAEpC,OAAO,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE;QACnC,QAAQ,EAAE,sBAAsB;QAChC,aAAa;QACb,WAAW;KACZ,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { DomainEvent } from '@zlooks.cn/event-bus';
|
|
2
|
+
import type { EventConsumeOptions, EventConsumer, EventSubscription } from '@zlooks.cn/event-client';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export declare const BLOG_PAGE_ARCHIVED_EVENT_TYPE = "cn.zlooks.blog.page-archived.v1";
|
|
5
|
+
declare const dataSchema: z.ZodReadonly<z.ZodObject<{
|
|
6
|
+
page: z.ZodReadonly<z.ZodObject<{
|
|
7
|
+
id: z.ZodUUID;
|
|
8
|
+
title: z.ZodString;
|
|
9
|
+
slug: z.ZodReadonly<z.ZodString>;
|
|
10
|
+
summary: z.ZodString;
|
|
11
|
+
status: z.ZodEnum<{
|
|
12
|
+
archived: "archived";
|
|
13
|
+
published: "published";
|
|
14
|
+
}>;
|
|
15
|
+
position: z.ZodNullable<z.ZodEnum<{
|
|
16
|
+
navigation: "navigation";
|
|
17
|
+
sidebar: "sidebar";
|
|
18
|
+
}>>;
|
|
19
|
+
sortOrder: z.ZodNumber;
|
|
20
|
+
publishedAt: z.ZodISODateTime;
|
|
21
|
+
updatedAt: z.ZodISODateTime;
|
|
22
|
+
contentSha256: z.ZodString;
|
|
23
|
+
version: z.ZodNumber;
|
|
24
|
+
}, z.core.$strict>>;
|
|
25
|
+
}, z.core.$strict>>;
|
|
26
|
+
export declare const blogPageArchivedEvent: import("@zlooks.cn/event-bus").EventDefinition<"cn.zlooks.blog.page-archived.v1", Readonly<{
|
|
27
|
+
page: Readonly<{
|
|
28
|
+
id: string;
|
|
29
|
+
title: string;
|
|
30
|
+
slug: string;
|
|
31
|
+
summary: string;
|
|
32
|
+
status: "archived" | "published";
|
|
33
|
+
position: "navigation" | "sidebar" | null;
|
|
34
|
+
sortOrder: number;
|
|
35
|
+
publishedAt: string;
|
|
36
|
+
updatedAt: string;
|
|
37
|
+
contentSha256: string;
|
|
38
|
+
version: number;
|
|
39
|
+
}>;
|
|
40
|
+
}>>;
|
|
41
|
+
export type BlogPageArchivedEvent = DomainEvent<typeof BLOG_PAGE_ARCHIVED_EVENT_TYPE, z.infer<typeof dataSchema>>;
|
|
42
|
+
export declare function parseBlogPageArchivedEvent(input: unknown): BlogPageArchivedEvent;
|
|
43
|
+
export declare function consumeBlogPageArchivedEvent(events: EventConsumer, options: EventConsumeOptions<ReturnType<typeof blogPageArchivedEvent.parse>>): EventSubscription;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=page-archived.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-archived.d.ts","sourceRoot":"","sources":["../../src/events/page-archived.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,6BAA6B,oCAAoC,CAAC;AAC/E,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;mBAEH,CAAC;AACd,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;GAEjC,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC,OAAO,6BAA6B,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;AAClH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,qBAAqB,CAEhF;AACD,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,mBAAmB,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC,GAC3E,iBAAiB,CAEnB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineBlogEvent } from './definition.js';
|
|
3
|
+
import { blogPageEventSnapshotSchema } from './snapshots.js';
|
|
4
|
+
export const BLOG_PAGE_ARCHIVED_EVENT_TYPE = 'cn.zlooks.blog.page-archived.v1';
|
|
5
|
+
const dataSchema = z.strictObject({
|
|
6
|
+
page: blogPageEventSnapshotSchema.refine(({ status }) => status === 'archived', 'Archived page event requires archived status'),
|
|
7
|
+
}).readonly();
|
|
8
|
+
export const blogPageArchivedEvent = defineBlogEvent(BLOG_PAGE_ARCHIVED_EVENT_TYPE, 'page', dataSchema, ({ page }) => page.id);
|
|
9
|
+
export function parseBlogPageArchivedEvent(input) {
|
|
10
|
+
return blogPageArchivedEvent.parse(input);
|
|
11
|
+
}
|
|
12
|
+
export function consumeBlogPageArchivedEvent(events, options) {
|
|
13
|
+
return events.consume(blogPageArchivedEvent, options);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=page-archived.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-archived.js","sourceRoot":"","sources":["../../src/events/page-archived.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAE7D,MAAM,CAAC,MAAM,6BAA6B,GAAG,iCAAiC,CAAC;AAC/E,MAAM,UAAU,GAAG,CAAC,CAAC,YAAY,CAAC;IAChC,IAAI,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,UAAU,EAAE,8CAA8C,CAAC;CAChI,CAAC,CAAC,QAAQ,EAAE,CAAC;AACd,MAAM,CAAC,MAAM,qBAAqB,GAAG,eAAe,CAClD,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CACzE,CAAC;AAEF,MAAM,UAAU,0BAA0B,CAAC,KAAc;IACvD,OAAO,qBAAqB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC;AACD,MAAM,UAAU,4BAA4B,CAC1C,MAAqB,EACrB,OAA4E;IAE5E,OAAO,MAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { DomainEvent } from '@zlooks.cn/event-bus';
|
|
2
|
+
import type { EventConsumeOptions, EventConsumer, EventSubscription } from '@zlooks.cn/event-client';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export declare const BLOG_PAGE_PUBLICATION_UPDATED_EVENT_TYPE = "cn.zlooks.blog.page-publication-updated.v1";
|
|
5
|
+
declare const dataSchema: z.ZodReadonly<z.ZodObject<{
|
|
6
|
+
page: z.ZodReadonly<z.ZodObject<{
|
|
7
|
+
id: z.ZodUUID;
|
|
8
|
+
title: z.ZodString;
|
|
9
|
+
slug: z.ZodReadonly<z.ZodString>;
|
|
10
|
+
summary: z.ZodString;
|
|
11
|
+
status: z.ZodEnum<{
|
|
12
|
+
archived: "archived";
|
|
13
|
+
published: "published";
|
|
14
|
+
}>;
|
|
15
|
+
position: z.ZodNullable<z.ZodEnum<{
|
|
16
|
+
navigation: "navigation";
|
|
17
|
+
sidebar: "sidebar";
|
|
18
|
+
}>>;
|
|
19
|
+
sortOrder: z.ZodNumber;
|
|
20
|
+
publishedAt: z.ZodISODateTime;
|
|
21
|
+
updatedAt: z.ZodISODateTime;
|
|
22
|
+
contentSha256: z.ZodString;
|
|
23
|
+
version: z.ZodNumber;
|
|
24
|
+
}, z.core.$strict>>;
|
|
25
|
+
changedFields: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
26
|
+
content: "content";
|
|
27
|
+
position: "position";
|
|
28
|
+
slug: "slug";
|
|
29
|
+
sortOrder: "sortOrder";
|
|
30
|
+
summary: "summary";
|
|
31
|
+
title: "title";
|
|
32
|
+
}>>>;
|
|
33
|
+
}, z.core.$strict>>;
|
|
34
|
+
export declare const blogPagePublicationUpdatedEvent: import("@zlooks.cn/event-bus").EventDefinition<"cn.zlooks.blog.page-publication-updated.v1", Readonly<{
|
|
35
|
+
page: Readonly<{
|
|
36
|
+
id: string;
|
|
37
|
+
title: string;
|
|
38
|
+
slug: string;
|
|
39
|
+
summary: string;
|
|
40
|
+
status: "archived" | "published";
|
|
41
|
+
position: "navigation" | "sidebar" | null;
|
|
42
|
+
sortOrder: number;
|
|
43
|
+
publishedAt: string;
|
|
44
|
+
updatedAt: string;
|
|
45
|
+
contentSha256: string;
|
|
46
|
+
version: number;
|
|
47
|
+
}>;
|
|
48
|
+
changedFields: readonly ("content" | "position" | "slug" | "sortOrder" | "summary" | "title")[];
|
|
49
|
+
}>>;
|
|
50
|
+
export type BlogPagePublicationUpdatedEvent = DomainEvent<typeof BLOG_PAGE_PUBLICATION_UPDATED_EVENT_TYPE, z.infer<typeof dataSchema>>;
|
|
51
|
+
export declare function parseBlogPagePublicationUpdatedEvent(input: unknown): BlogPagePublicationUpdatedEvent;
|
|
52
|
+
export declare function consumeBlogPagePublicationUpdatedEvent(events: EventConsumer, options: EventConsumeOptions<ReturnType<typeof blogPagePublicationUpdatedEvent.parse>>): EventSubscription;
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=page-publication-updated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-publication-updated.d.ts","sourceRoot":"","sources":["../../src/events/page-publication-updated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,wCAAwC,+CAA+C,CAAC;AACrG,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAKH,CAAC;AACd,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;GAE3C,CAAC;AACF,MAAM,MAAM,+BAA+B,GAAG,WAAW,CAAC,OAAO,wCAAwC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;AACvI,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,OAAO,GAAG,+BAA+B,CAEpG;AACD,wBAAgB,sCAAsC,CACpD,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,mBAAmB,CAAC,UAAU,CAAC,OAAO,+BAA+B,CAAC,KAAK,CAAC,CAAC,GACrF,iBAAiB,CAEnB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineBlogEvent } from './definition.js';
|
|
3
|
+
import { blogPageChangedFieldSchema, blogPageEventSnapshotSchema } from './snapshots.js';
|
|
4
|
+
export const BLOG_PAGE_PUBLICATION_UPDATED_EVENT_TYPE = 'cn.zlooks.blog.page-publication-updated.v1';
|
|
5
|
+
const dataSchema = z.strictObject({
|
|
6
|
+
page: blogPageEventSnapshotSchema.refine(({ status }) => status === 'published', 'Updated public page requires published status'),
|
|
7
|
+
changedFields: z.array(blogPageChangedFieldSchema).min(1).max(6)
|
|
8
|
+
.refine((fields) => new Set(fields).size === fields.length, 'Changed page fields must be unique')
|
|
9
|
+
.readonly(),
|
|
10
|
+
}).readonly();
|
|
11
|
+
export const blogPagePublicationUpdatedEvent = defineBlogEvent(BLOG_PAGE_PUBLICATION_UPDATED_EVENT_TYPE, 'page', dataSchema, ({ page }) => page.id);
|
|
12
|
+
export function parseBlogPagePublicationUpdatedEvent(input) {
|
|
13
|
+
return blogPagePublicationUpdatedEvent.parse(input);
|
|
14
|
+
}
|
|
15
|
+
export function consumeBlogPagePublicationUpdatedEvent(events, options) {
|
|
16
|
+
return events.consume(blogPagePublicationUpdatedEvent, options);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=page-publication-updated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-publication-updated.js","sourceRoot":"","sources":["../../src/events/page-publication-updated.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAEzF,MAAM,CAAC,MAAM,wCAAwC,GAAG,4CAA4C,CAAC;AACrG,MAAM,UAAU,GAAG,CAAC,CAAC,YAAY,CAAC;IAChC,IAAI,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,WAAW,EAAE,+CAA+C,CAAC;IACjI,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;SAC7D,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,EAAE,oCAAoC,CAAC;SAChG,QAAQ,EAAE;CACd,CAAC,CAAC,QAAQ,EAAE,CAAC;AACd,MAAM,CAAC,MAAM,+BAA+B,GAAG,eAAe,CAC5D,wCAAwC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CACpF,CAAC;AAEF,MAAM,UAAU,oCAAoC,CAAC,KAAc;IACjE,OAAO,+BAA+B,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACtD,CAAC;AACD,MAAM,UAAU,sCAAsC,CACpD,MAAqB,EACrB,OAAsF;IAEtF,OAAO,MAAM,CAAC,OAAO,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { DomainEvent } from '@zlooks.cn/event-bus';
|
|
2
|
+
import type { EventConsumeOptions, EventConsumer, EventSubscription } from '@zlooks.cn/event-client';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export declare const BLOG_PAGE_PUBLISHED_EVENT_TYPE = "cn.zlooks.blog.page-published.v1";
|
|
5
|
+
declare const dataSchema: z.ZodReadonly<z.ZodObject<{
|
|
6
|
+
page: z.ZodReadonly<z.ZodObject<{
|
|
7
|
+
id: z.ZodUUID;
|
|
8
|
+
title: z.ZodString;
|
|
9
|
+
slug: z.ZodReadonly<z.ZodString>;
|
|
10
|
+
summary: z.ZodString;
|
|
11
|
+
status: z.ZodEnum<{
|
|
12
|
+
archived: "archived";
|
|
13
|
+
published: "published";
|
|
14
|
+
}>;
|
|
15
|
+
position: z.ZodNullable<z.ZodEnum<{
|
|
16
|
+
navigation: "navigation";
|
|
17
|
+
sidebar: "sidebar";
|
|
18
|
+
}>>;
|
|
19
|
+
sortOrder: z.ZodNumber;
|
|
20
|
+
publishedAt: z.ZodISODateTime;
|
|
21
|
+
updatedAt: z.ZodISODateTime;
|
|
22
|
+
contentSha256: z.ZodString;
|
|
23
|
+
version: z.ZodNumber;
|
|
24
|
+
}, z.core.$strict>>;
|
|
25
|
+
}, z.core.$strict>>;
|
|
26
|
+
export declare const blogPagePublishedEvent: import("@zlooks.cn/event-bus").EventDefinition<"cn.zlooks.blog.page-published.v1", Readonly<{
|
|
27
|
+
page: Readonly<{
|
|
28
|
+
id: string;
|
|
29
|
+
title: string;
|
|
30
|
+
slug: string;
|
|
31
|
+
summary: string;
|
|
32
|
+
status: "archived" | "published";
|
|
33
|
+
position: "navigation" | "sidebar" | null;
|
|
34
|
+
sortOrder: number;
|
|
35
|
+
publishedAt: string;
|
|
36
|
+
updatedAt: string;
|
|
37
|
+
contentSha256: string;
|
|
38
|
+
version: number;
|
|
39
|
+
}>;
|
|
40
|
+
}>>;
|
|
41
|
+
export type BlogPagePublishedEvent = DomainEvent<typeof BLOG_PAGE_PUBLISHED_EVENT_TYPE, z.infer<typeof dataSchema>>;
|
|
42
|
+
export declare function parseBlogPagePublishedEvent(input: unknown): BlogPagePublishedEvent;
|
|
43
|
+
export declare function consumeBlogPagePublishedEvent(events: EventConsumer, options: EventConsumeOptions<ReturnType<typeof blogPagePublishedEvent.parse>>): EventSubscription;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=page-published.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-published.d.ts","sourceRoot":"","sources":["../../src/events/page-published.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,8BAA8B,qCAAqC,CAAC;AACjF,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;mBAEH,CAAC;AACd,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;GAElC,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC,OAAO,8BAA8B,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;AACpH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,sBAAsB,CAElF;AACD,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,mBAAmB,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,KAAK,CAAC,CAAC,GAC5E,iBAAiB,CAEnB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineBlogEvent } from './definition.js';
|
|
3
|
+
import { blogPageEventSnapshotSchema } from './snapshots.js';
|
|
4
|
+
export const BLOG_PAGE_PUBLISHED_EVENT_TYPE = 'cn.zlooks.blog.page-published.v1';
|
|
5
|
+
const dataSchema = z.strictObject({
|
|
6
|
+
page: blogPageEventSnapshotSchema.refine(({ status }) => status === 'published', 'Published page event requires published status'),
|
|
7
|
+
}).readonly();
|
|
8
|
+
export const blogPagePublishedEvent = defineBlogEvent(BLOG_PAGE_PUBLISHED_EVENT_TYPE, 'page', dataSchema, ({ page }) => page.id);
|
|
9
|
+
export function parseBlogPagePublishedEvent(input) {
|
|
10
|
+
return blogPagePublishedEvent.parse(input);
|
|
11
|
+
}
|
|
12
|
+
export function consumeBlogPagePublishedEvent(events, options) {
|
|
13
|
+
return events.consume(blogPagePublishedEvent, options);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=page-published.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-published.js","sourceRoot":"","sources":["../../src/events/page-published.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAE7D,MAAM,CAAC,MAAM,8BAA8B,GAAG,kCAAkC,CAAC;AACjF,MAAM,UAAU,GAAG,CAAC,CAAC,YAAY,CAAC;IAChC,IAAI,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,WAAW,EAAE,gDAAgD,CAAC;CACnI,CAAC,CAAC,QAAQ,EAAE,CAAC;AACd,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CACnD,8BAA8B,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAC1E,CAAC;AAEF,MAAM,UAAU,2BAA2B,CAAC,KAAc;IACxD,OAAO,sBAAsB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC7C,CAAC;AACD,MAAM,UAAU,6BAA6B,CAC3C,MAAqB,EACrB,OAA6E;IAE7E,OAAO,MAAM,CAAC,OAAO,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { DomainEvent } from '@zlooks.cn/event-bus';
|
|
2
|
+
import type { EventConsumeOptions, EventConsumer, EventSubscription } from '@zlooks.cn/event-client';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export declare const BLOG_POST_ARCHIVED_EVENT_TYPE = "cn.zlooks.blog.post-archived.v1";
|
|
5
|
+
declare const dataSchema: z.ZodReadonly<z.ZodObject<{
|
|
6
|
+
post: z.ZodReadonly<z.ZodObject<{
|
|
7
|
+
id: z.ZodUUID;
|
|
8
|
+
title: z.ZodString;
|
|
9
|
+
slug: z.ZodReadonly<z.ZodString>;
|
|
10
|
+
summary: z.ZodNullable<z.ZodString>;
|
|
11
|
+
coverUrl: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
|
|
12
|
+
publishedAt: z.ZodISODateTime;
|
|
13
|
+
updatedAt: z.ZodISODateTime;
|
|
14
|
+
category: z.ZodReadonly<z.ZodObject<{
|
|
15
|
+
id: z.ZodUUID;
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
slug: z.ZodReadonly<z.ZodString>;
|
|
18
|
+
description: z.ZodNullable<z.ZodString>;
|
|
19
|
+
sortOrder: z.ZodNumber;
|
|
20
|
+
}, z.core.$strict>>;
|
|
21
|
+
tags: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
22
|
+
id: z.ZodUUID;
|
|
23
|
+
name: z.ZodString;
|
|
24
|
+
slug: z.ZodReadonly<z.ZodString>;
|
|
25
|
+
}, z.core.$strict>>>>;
|
|
26
|
+
status: z.ZodEnum<{
|
|
27
|
+
archived: "archived";
|
|
28
|
+
published: "published";
|
|
29
|
+
}>;
|
|
30
|
+
contentSha256: z.ZodString;
|
|
31
|
+
version: z.ZodNumber;
|
|
32
|
+
}, z.core.$strict>>;
|
|
33
|
+
}, z.core.$strict>>;
|
|
34
|
+
export declare const blogPostArchivedEvent: import("@zlooks.cn/event-bus").EventDefinition<"cn.zlooks.blog.post-archived.v1", Readonly<{
|
|
35
|
+
post: Readonly<{
|
|
36
|
+
id: string;
|
|
37
|
+
title: string;
|
|
38
|
+
slug: string;
|
|
39
|
+
summary: string | null;
|
|
40
|
+
coverUrl: string | null;
|
|
41
|
+
publishedAt: string;
|
|
42
|
+
updatedAt: string;
|
|
43
|
+
category: Readonly<{
|
|
44
|
+
id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
slug: string;
|
|
47
|
+
description: string | null;
|
|
48
|
+
sortOrder: number;
|
|
49
|
+
}>;
|
|
50
|
+
tags: readonly Readonly<{
|
|
51
|
+
id: string;
|
|
52
|
+
name: string;
|
|
53
|
+
slug: string;
|
|
54
|
+
}>[];
|
|
55
|
+
status: "archived" | "published";
|
|
56
|
+
contentSha256: string;
|
|
57
|
+
version: number;
|
|
58
|
+
}>;
|
|
59
|
+
}>>;
|
|
60
|
+
export type BlogPostArchivedEvent = DomainEvent<typeof BLOG_POST_ARCHIVED_EVENT_TYPE, z.infer<typeof dataSchema>>;
|
|
61
|
+
export declare function parseBlogPostArchivedEvent(input: unknown): BlogPostArchivedEvent;
|
|
62
|
+
export declare function consumeBlogPostArchivedEvent(events: EventConsumer, options: EventConsumeOptions<ReturnType<typeof blogPostArchivedEvent.parse>>): EventSubscription;
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=post-archived.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-archived.d.ts","sourceRoot":"","sources":["../../src/events/post-archived.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,6BAA6B,oCAAoC,CAAC;AAC/E,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAEH,CAAC;AACd,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;GAEjC,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC,OAAO,6BAA6B,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;AAClH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,qBAAqB,CAEhF;AACD,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,mBAAmB,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC,GAC3E,iBAAiB,CAEnB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineBlogEvent } from './definition.js';
|
|
3
|
+
import { blogPostEventSnapshotSchema } from './snapshots.js';
|
|
4
|
+
export const BLOG_POST_ARCHIVED_EVENT_TYPE = 'cn.zlooks.blog.post-archived.v1';
|
|
5
|
+
const dataSchema = z.strictObject({
|
|
6
|
+
post: blogPostEventSnapshotSchema.refine(({ status }) => status === 'archived', 'Archived post event requires archived status'),
|
|
7
|
+
}).readonly();
|
|
8
|
+
export const blogPostArchivedEvent = defineBlogEvent(BLOG_POST_ARCHIVED_EVENT_TYPE, 'post', dataSchema, ({ post }) => post.id);
|
|
9
|
+
export function parseBlogPostArchivedEvent(input) {
|
|
10
|
+
return blogPostArchivedEvent.parse(input);
|
|
11
|
+
}
|
|
12
|
+
export function consumeBlogPostArchivedEvent(events, options) {
|
|
13
|
+
return events.consume(blogPostArchivedEvent, options);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=post-archived.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-archived.js","sourceRoot":"","sources":["../../src/events/post-archived.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAE7D,MAAM,CAAC,MAAM,6BAA6B,GAAG,iCAAiC,CAAC;AAC/E,MAAM,UAAU,GAAG,CAAC,CAAC,YAAY,CAAC;IAChC,IAAI,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,UAAU,EAAE,8CAA8C,CAAC;CAChI,CAAC,CAAC,QAAQ,EAAE,CAAC;AACd,MAAM,CAAC,MAAM,qBAAqB,GAAG,eAAe,CAClD,6BAA6B,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CACzE,CAAC;AAEF,MAAM,UAAU,0BAA0B,CAAC,KAAc;IACvD,OAAO,qBAAqB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC;AACD,MAAM,UAAU,4BAA4B,CAC1C,MAAqB,EACrB,OAA4E;IAE5E,OAAO,MAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { DomainEvent } from '@zlooks.cn/event-bus';
|
|
2
|
+
import type { EventConsumeOptions, EventConsumer, EventSubscription } from '@zlooks.cn/event-client';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export declare const BLOG_POST_PUBLICATION_UPDATED_EVENT_TYPE = "cn.zlooks.blog.post-publication-updated.v1";
|
|
5
|
+
declare const dataSchema: z.ZodReadonly<z.ZodObject<{
|
|
6
|
+
post: z.ZodReadonly<z.ZodObject<{
|
|
7
|
+
id: z.ZodUUID;
|
|
8
|
+
title: z.ZodString;
|
|
9
|
+
slug: z.ZodReadonly<z.ZodString>;
|
|
10
|
+
summary: z.ZodNullable<z.ZodString>;
|
|
11
|
+
coverUrl: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
|
|
12
|
+
publishedAt: z.ZodISODateTime;
|
|
13
|
+
updatedAt: z.ZodISODateTime;
|
|
14
|
+
category: z.ZodReadonly<z.ZodObject<{
|
|
15
|
+
id: z.ZodUUID;
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
slug: z.ZodReadonly<z.ZodString>;
|
|
18
|
+
description: z.ZodNullable<z.ZodString>;
|
|
19
|
+
sortOrder: z.ZodNumber;
|
|
20
|
+
}, z.core.$strict>>;
|
|
21
|
+
tags: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
22
|
+
id: z.ZodUUID;
|
|
23
|
+
name: z.ZodString;
|
|
24
|
+
slug: z.ZodReadonly<z.ZodString>;
|
|
25
|
+
}, z.core.$strict>>>>;
|
|
26
|
+
status: z.ZodEnum<{
|
|
27
|
+
archived: "archived";
|
|
28
|
+
published: "published";
|
|
29
|
+
}>;
|
|
30
|
+
contentSha256: z.ZodString;
|
|
31
|
+
version: z.ZodNumber;
|
|
32
|
+
}, z.core.$strict>>;
|
|
33
|
+
changedFields: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
|
|
34
|
+
categoryId: "categoryId";
|
|
35
|
+
content: "content";
|
|
36
|
+
coverUrl: "coverUrl";
|
|
37
|
+
slug: "slug";
|
|
38
|
+
summary: "summary";
|
|
39
|
+
tagIds: "tagIds";
|
|
40
|
+
title: "title";
|
|
41
|
+
}>>>;
|
|
42
|
+
}, z.core.$strict>>;
|
|
43
|
+
export declare const blogPostPublicationUpdatedEvent: import("@zlooks.cn/event-bus").EventDefinition<"cn.zlooks.blog.post-publication-updated.v1", Readonly<{
|
|
44
|
+
post: Readonly<{
|
|
45
|
+
id: string;
|
|
46
|
+
title: string;
|
|
47
|
+
slug: string;
|
|
48
|
+
summary: string | null;
|
|
49
|
+
coverUrl: string | null;
|
|
50
|
+
publishedAt: string;
|
|
51
|
+
updatedAt: string;
|
|
52
|
+
category: Readonly<{
|
|
53
|
+
id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
slug: string;
|
|
56
|
+
description: string | null;
|
|
57
|
+
sortOrder: number;
|
|
58
|
+
}>;
|
|
59
|
+
tags: readonly Readonly<{
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
slug: string;
|
|
63
|
+
}>[];
|
|
64
|
+
status: "archived" | "published";
|
|
65
|
+
contentSha256: string;
|
|
66
|
+
version: number;
|
|
67
|
+
}>;
|
|
68
|
+
changedFields: readonly ("categoryId" | "content" | "coverUrl" | "slug" | "summary" | "tagIds" | "title")[];
|
|
69
|
+
}>>;
|
|
70
|
+
export type BlogPostPublicationUpdatedEvent = DomainEvent<typeof BLOG_POST_PUBLICATION_UPDATED_EVENT_TYPE, z.infer<typeof dataSchema>>;
|
|
71
|
+
export declare function parseBlogPostPublicationUpdatedEvent(input: unknown): BlogPostPublicationUpdatedEvent;
|
|
72
|
+
export declare function consumeBlogPostPublicationUpdatedEvent(events: EventConsumer, options: EventConsumeOptions<ReturnType<typeof blogPostPublicationUpdatedEvent.parse>>): EventSubscription;
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=post-publication-updated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-publication-updated.d.ts","sourceRoot":"","sources":["../../src/events/post-publication-updated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,wCAAwC,+CAA+C,CAAC;AACrG,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAKH,CAAC;AACd,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;GAE3C,CAAC;AACF,MAAM,MAAM,+BAA+B,GAAG,WAAW,CAAC,OAAO,wCAAwC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;AACvI,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,OAAO,GAAG,+BAA+B,CAEpG;AACD,wBAAgB,sCAAsC,CACpD,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,mBAAmB,CAAC,UAAU,CAAC,OAAO,+BAA+B,CAAC,KAAK,CAAC,CAAC,GACrF,iBAAiB,CAEnB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineBlogEvent } from './definition.js';
|
|
3
|
+
import { blogPostChangedFieldSchema, blogPostEventSnapshotSchema } from './snapshots.js';
|
|
4
|
+
export const BLOG_POST_PUBLICATION_UPDATED_EVENT_TYPE = 'cn.zlooks.blog.post-publication-updated.v1';
|
|
5
|
+
const dataSchema = z.strictObject({
|
|
6
|
+
post: blogPostEventSnapshotSchema.refine(({ status }) => status === 'published', 'Updated public post requires published status'),
|
|
7
|
+
changedFields: z.array(blogPostChangedFieldSchema).min(1).max(7)
|
|
8
|
+
.refine((fields) => new Set(fields).size === fields.length, 'Changed post fields must be unique')
|
|
9
|
+
.readonly(),
|
|
10
|
+
}).readonly();
|
|
11
|
+
export const blogPostPublicationUpdatedEvent = defineBlogEvent(BLOG_POST_PUBLICATION_UPDATED_EVENT_TYPE, 'post', dataSchema, ({ post }) => post.id);
|
|
12
|
+
export function parseBlogPostPublicationUpdatedEvent(input) {
|
|
13
|
+
return blogPostPublicationUpdatedEvent.parse(input);
|
|
14
|
+
}
|
|
15
|
+
export function consumeBlogPostPublicationUpdatedEvent(events, options) {
|
|
16
|
+
return events.consume(blogPostPublicationUpdatedEvent, options);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=post-publication-updated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-publication-updated.js","sourceRoot":"","sources":["../../src/events/post-publication-updated.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAEzF,MAAM,CAAC,MAAM,wCAAwC,GAAG,4CAA4C,CAAC;AACrG,MAAM,UAAU,GAAG,CAAC,CAAC,YAAY,CAAC;IAChC,IAAI,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,WAAW,EAAE,+CAA+C,CAAC;IACjI,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;SAC7D,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,EAAE,oCAAoC,CAAC;SAChG,QAAQ,EAAE;CACd,CAAC,CAAC,QAAQ,EAAE,CAAC;AACd,MAAM,CAAC,MAAM,+BAA+B,GAAG,eAAe,CAC5D,wCAAwC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CACpF,CAAC;AAEF,MAAM,UAAU,oCAAoC,CAAC,KAAc;IACjE,OAAO,+BAA+B,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACtD,CAAC;AACD,MAAM,UAAU,sCAAsC,CACpD,MAAqB,EACrB,OAAsF;IAEtF,OAAO,MAAM,CAAC,OAAO,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { DomainEvent } from '@zlooks.cn/event-bus';
|
|
2
|
+
import type { EventConsumeOptions, EventConsumer, EventSubscription } from '@zlooks.cn/event-client';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export declare const BLOG_POST_PUBLISHED_EVENT_TYPE = "cn.zlooks.blog.post-published.v1";
|
|
5
|
+
declare const dataSchema: z.ZodReadonly<z.ZodObject<{
|
|
6
|
+
post: z.ZodReadonly<z.ZodObject<{
|
|
7
|
+
id: z.ZodUUID;
|
|
8
|
+
title: z.ZodString;
|
|
9
|
+
slug: z.ZodReadonly<z.ZodString>;
|
|
10
|
+
summary: z.ZodNullable<z.ZodString>;
|
|
11
|
+
coverUrl: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
|
|
12
|
+
publishedAt: z.ZodISODateTime;
|
|
13
|
+
updatedAt: z.ZodISODateTime;
|
|
14
|
+
category: z.ZodReadonly<z.ZodObject<{
|
|
15
|
+
id: z.ZodUUID;
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
slug: z.ZodReadonly<z.ZodString>;
|
|
18
|
+
description: z.ZodNullable<z.ZodString>;
|
|
19
|
+
sortOrder: z.ZodNumber;
|
|
20
|
+
}, z.core.$strict>>;
|
|
21
|
+
tags: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
22
|
+
id: z.ZodUUID;
|
|
23
|
+
name: z.ZodString;
|
|
24
|
+
slug: z.ZodReadonly<z.ZodString>;
|
|
25
|
+
}, z.core.$strict>>>>;
|
|
26
|
+
status: z.ZodEnum<{
|
|
27
|
+
archived: "archived";
|
|
28
|
+
published: "published";
|
|
29
|
+
}>;
|
|
30
|
+
contentSha256: z.ZodString;
|
|
31
|
+
version: z.ZodNumber;
|
|
32
|
+
}, z.core.$strict>>;
|
|
33
|
+
}, z.core.$strict>>;
|
|
34
|
+
export declare const blogPostPublishedEvent: import("@zlooks.cn/event-bus").EventDefinition<"cn.zlooks.blog.post-published.v1", Readonly<{
|
|
35
|
+
post: Readonly<{
|
|
36
|
+
id: string;
|
|
37
|
+
title: string;
|
|
38
|
+
slug: string;
|
|
39
|
+
summary: string | null;
|
|
40
|
+
coverUrl: string | null;
|
|
41
|
+
publishedAt: string;
|
|
42
|
+
updatedAt: string;
|
|
43
|
+
category: Readonly<{
|
|
44
|
+
id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
slug: string;
|
|
47
|
+
description: string | null;
|
|
48
|
+
sortOrder: number;
|
|
49
|
+
}>;
|
|
50
|
+
tags: readonly Readonly<{
|
|
51
|
+
id: string;
|
|
52
|
+
name: string;
|
|
53
|
+
slug: string;
|
|
54
|
+
}>[];
|
|
55
|
+
status: "archived" | "published";
|
|
56
|
+
contentSha256: string;
|
|
57
|
+
version: number;
|
|
58
|
+
}>;
|
|
59
|
+
}>>;
|
|
60
|
+
export type BlogPostPublishedEvent = DomainEvent<typeof BLOG_POST_PUBLISHED_EVENT_TYPE, z.infer<typeof dataSchema>>;
|
|
61
|
+
export declare function parseBlogPostPublishedEvent(input: unknown): BlogPostPublishedEvent;
|
|
62
|
+
export declare function consumeBlogPostPublishedEvent(events: EventConsumer, options: EventConsumeOptions<ReturnType<typeof blogPostPublishedEvent.parse>>): EventSubscription;
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=post-published.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-published.d.ts","sourceRoot":"","sources":["../../src/events/post-published.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,8BAA8B,qCAAqC,CAAC;AACjF,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAEH,CAAC;AACd,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;GAElC,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC,OAAO,8BAA8B,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;AACpH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,sBAAsB,CAElF;AACD,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,mBAAmB,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,KAAK,CAAC,CAAC,GAC5E,iBAAiB,CAEnB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineBlogEvent } from './definition.js';
|
|
3
|
+
import { blogPostEventSnapshotSchema } from './snapshots.js';
|
|
4
|
+
export const BLOG_POST_PUBLISHED_EVENT_TYPE = 'cn.zlooks.blog.post-published.v1';
|
|
5
|
+
const dataSchema = z.strictObject({
|
|
6
|
+
post: blogPostEventSnapshotSchema.refine(({ status }) => status === 'published', 'Published post event requires published status'),
|
|
7
|
+
}).readonly();
|
|
8
|
+
export const blogPostPublishedEvent = defineBlogEvent(BLOG_POST_PUBLISHED_EVENT_TYPE, 'post', dataSchema, ({ post }) => post.id);
|
|
9
|
+
export function parseBlogPostPublishedEvent(input) {
|
|
10
|
+
return blogPostPublishedEvent.parse(input);
|
|
11
|
+
}
|
|
12
|
+
export function consumeBlogPostPublishedEvent(events, options) {
|
|
13
|
+
return events.consume(blogPostPublishedEvent, options);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=post-published.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-published.js","sourceRoot":"","sources":["../../src/events/post-published.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAE7D,MAAM,CAAC,MAAM,8BAA8B,GAAG,kCAAkC,CAAC;AACjF,MAAM,UAAU,GAAG,CAAC,CAAC,YAAY,CAAC;IAChC,IAAI,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,KAAK,WAAW,EAAE,gDAAgD,CAAC;CACnI,CAAC,CAAC,QAAQ,EAAE,CAAC;AACd,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CACnD,8BAA8B,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAC1E,CAAC;AAEF,MAAM,UAAU,2BAA2B,CAAC,KAAc;IACxD,OAAO,sBAAsB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC7C,CAAC;AACD,MAAM,UAAU,6BAA6B,CAC3C,MAAqB,EACrB,OAA6E;IAE7E,OAAO,MAAM,CAAC,OAAO,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const blogPostEventSnapshotSchema: z.ZodReadonly<z.ZodObject<{
|
|
3
|
+
id: z.ZodUUID;
|
|
4
|
+
title: z.ZodString;
|
|
5
|
+
slug: z.ZodReadonly<z.ZodString>;
|
|
6
|
+
summary: z.ZodNullable<z.ZodString>;
|
|
7
|
+
coverUrl: z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodURL]>>;
|
|
8
|
+
publishedAt: z.ZodISODateTime;
|
|
9
|
+
updatedAt: z.ZodISODateTime;
|
|
10
|
+
category: z.ZodReadonly<z.ZodObject<{
|
|
11
|
+
id: z.ZodUUID;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
slug: z.ZodReadonly<z.ZodString>;
|
|
14
|
+
description: z.ZodNullable<z.ZodString>;
|
|
15
|
+
sortOrder: z.ZodNumber;
|
|
16
|
+
}, z.core.$strict>>;
|
|
17
|
+
tags: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
|
|
18
|
+
id: z.ZodUUID;
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
slug: z.ZodReadonly<z.ZodString>;
|
|
21
|
+
}, z.core.$strict>>>>;
|
|
22
|
+
status: z.ZodEnum<{
|
|
23
|
+
archived: "archived";
|
|
24
|
+
published: "published";
|
|
25
|
+
}>;
|
|
26
|
+
contentSha256: z.ZodString;
|
|
27
|
+
version: z.ZodNumber;
|
|
28
|
+
}, z.core.$strict>>;
|
|
29
|
+
export declare const blogPostChangedFieldSchema: z.ZodEnum<{
|
|
30
|
+
categoryId: "categoryId";
|
|
31
|
+
content: "content";
|
|
32
|
+
coverUrl: "coverUrl";
|
|
33
|
+
slug: "slug";
|
|
34
|
+
summary: "summary";
|
|
35
|
+
tagIds: "tagIds";
|
|
36
|
+
title: "title";
|
|
37
|
+
}>;
|
|
38
|
+
export declare const blogPageEventSnapshotSchema: z.ZodReadonly<z.ZodObject<{
|
|
39
|
+
id: z.ZodUUID;
|
|
40
|
+
title: z.ZodString;
|
|
41
|
+
slug: z.ZodReadonly<z.ZodString>;
|
|
42
|
+
summary: z.ZodString;
|
|
43
|
+
status: z.ZodEnum<{
|
|
44
|
+
archived: "archived";
|
|
45
|
+
published: "published";
|
|
46
|
+
}>;
|
|
47
|
+
position: z.ZodNullable<z.ZodEnum<{
|
|
48
|
+
navigation: "navigation";
|
|
49
|
+
sidebar: "sidebar";
|
|
50
|
+
}>>;
|
|
51
|
+
sortOrder: z.ZodNumber;
|
|
52
|
+
publishedAt: z.ZodISODateTime;
|
|
53
|
+
updatedAt: z.ZodISODateTime;
|
|
54
|
+
contentSha256: z.ZodString;
|
|
55
|
+
version: z.ZodNumber;
|
|
56
|
+
}, z.core.$strict>>;
|
|
57
|
+
export declare const blogPageChangedFieldSchema: z.ZodEnum<{
|
|
58
|
+
content: "content";
|
|
59
|
+
position: "position";
|
|
60
|
+
slug: "slug";
|
|
61
|
+
sortOrder: "sortOrder";
|
|
62
|
+
summary: "summary";
|
|
63
|
+
title: "title";
|
|
64
|
+
}>;
|
|
65
|
+
export declare const blogCommentStatusSchema: z.ZodEnum<{
|
|
66
|
+
approved: "approved";
|
|
67
|
+
pending: "pending";
|
|
68
|
+
rejected: "rejected";
|
|
69
|
+
}>;
|
|
70
|
+
export declare const blogCommentEventSnapshotSchema: z.ZodReadonly<z.ZodObject<{
|
|
71
|
+
id: z.ZodUUID;
|
|
72
|
+
postId: z.ZodUUID;
|
|
73
|
+
userId: z.ZodUUID;
|
|
74
|
+
content: z.ZodString;
|
|
75
|
+
status: z.ZodEnum<{
|
|
76
|
+
approved: "approved";
|
|
77
|
+
pending: "pending";
|
|
78
|
+
rejected: "rejected";
|
|
79
|
+
}>;
|
|
80
|
+
replyContent: z.ZodNullable<z.ZodString>;
|
|
81
|
+
repliedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
82
|
+
location: z.ZodNullable<z.ZodString>;
|
|
83
|
+
client: z.ZodNullable<z.ZodString>;
|
|
84
|
+
createdAt: z.ZodISODateTime;
|
|
85
|
+
updatedAt: z.ZodISODateTime;
|
|
86
|
+
version: z.ZodNumber;
|
|
87
|
+
}, z.core.$strict>>;
|
|
88
|
+
export declare const blogDeletedCommentSnapshotSchema: z.ZodReadonly<z.ZodObject<{
|
|
89
|
+
id: z.ZodUUID;
|
|
90
|
+
postId: z.ZodUUID;
|
|
91
|
+
userId: z.ZodUUID;
|
|
92
|
+
status: z.ZodEnum<{
|
|
93
|
+
approved: "approved";
|
|
94
|
+
pending: "pending";
|
|
95
|
+
rejected: "rejected";
|
|
96
|
+
}>;
|
|
97
|
+
version: z.ZodNumber;
|
|
98
|
+
}, z.core.$strict>>;
|
|
99
|
+
export type BlogPostEventSnapshot = z.infer<typeof blogPostEventSnapshotSchema>;
|
|
100
|
+
export type BlogPostChangedField = z.infer<typeof blogPostChangedFieldSchema>;
|
|
101
|
+
export type BlogPageEventSnapshot = z.infer<typeof blogPageEventSnapshotSchema>;
|
|
102
|
+
export type BlogPageChangedField = z.infer<typeof blogPageChangedFieldSchema>;
|
|
103
|
+
export type BlogCommentEventSnapshot = z.infer<typeof blogCommentEventSnapshotSchema>;
|
|
104
|
+
export type BlogDeletedCommentSnapshot = z.infer<typeof blogDeletedCommentSnapshotSchema>;
|
|
105
|
+
//# sourceMappingURL=snapshots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshots.d.ts","sourceRoot":"","sources":["../../src/events/snapshots.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;mBAQ3B,CAAC;AAEd,eAAO,MAAM,0BAA0B;;;;;;;;EAErC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;mBAY3B,CAAC;AAEd,eAAO,MAAM,0BAA0B;;;;;;;EAErC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;EAA8C,CAAC;AACnF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;mBAgB/B,CAAC;AAEb,eAAO,MAAM,gCAAgC;;;;;;;;;;mBAMhC,CAAC;AAEd,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { blogCategorySummarySchema, blogPagePositionSchema, blogPostSlugSchema, blogPostSummarySchema, blogTagSummarySchema, } from '@zlooks.cn/blog-schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
const isoDateTime = z.iso.datetime({ offset: true });
|
|
4
|
+
const sha256 = z.string().regex(/^[a-f0-9]{64}$/);
|
|
5
|
+
const version = z.number().int().positive();
|
|
6
|
+
export const blogPostEventSnapshotSchema = blogPostSummarySchema.unwrap().extend({
|
|
7
|
+
category: blogCategorySummarySchema,
|
|
8
|
+
tags: z.array(blogTagSummarySchema).max(20)
|
|
9
|
+
.refine((tags) => new Set(tags.map(({ id }) => id)).size === tags.length, 'Post tags must be unique')
|
|
10
|
+
.readonly(),
|
|
11
|
+
status: z.enum(['published', 'archived']),
|
|
12
|
+
contentSha256: sha256,
|
|
13
|
+
version,
|
|
14
|
+
}).readonly();
|
|
15
|
+
export const blogPostChangedFieldSchema = z.enum([
|
|
16
|
+
'categoryId', 'title', 'slug', 'summary', 'coverUrl', 'content', 'tagIds',
|
|
17
|
+
]);
|
|
18
|
+
export const blogPageEventSnapshotSchema = z.strictObject({
|
|
19
|
+
id: z.uuid(),
|
|
20
|
+
title: z.string().trim().min(1).max(200),
|
|
21
|
+
slug: blogPostSlugSchema,
|
|
22
|
+
summary: z.string().trim().min(1).max(500),
|
|
23
|
+
status: z.enum(['published', 'archived']),
|
|
24
|
+
position: blogPagePositionSchema.nullable(),
|
|
25
|
+
sortOrder: z.number().int().min(-2_147_483_648).max(2_147_483_647),
|
|
26
|
+
publishedAt: isoDateTime,
|
|
27
|
+
updatedAt: isoDateTime,
|
|
28
|
+
contentSha256: sha256,
|
|
29
|
+
version,
|
|
30
|
+
}).readonly();
|
|
31
|
+
export const blogPageChangedFieldSchema = z.enum([
|
|
32
|
+
'title', 'slug', 'summary', 'content', 'position', 'sortOrder',
|
|
33
|
+
]);
|
|
34
|
+
export const blogCommentStatusSchema = z.enum(['pending', 'approved', 'rejected']);
|
|
35
|
+
export const blogCommentEventSnapshotSchema = z.strictObject({
|
|
36
|
+
id: z.uuid(),
|
|
37
|
+
postId: z.uuid(),
|
|
38
|
+
userId: z.uuid(),
|
|
39
|
+
content: z.string().trim().min(1).max(2_000),
|
|
40
|
+
status: blogCommentStatusSchema,
|
|
41
|
+
replyContent: z.string().trim().min(1).max(2_000).nullable(),
|
|
42
|
+
repliedAt: isoDateTime.nullable(),
|
|
43
|
+
location: z.string().trim().min(1).max(200).nullable(),
|
|
44
|
+
client: z.string().trim().min(1).max(160).nullable(),
|
|
45
|
+
createdAt: isoDateTime,
|
|
46
|
+
updatedAt: isoDateTime,
|
|
47
|
+
version,
|
|
48
|
+
}).refine((comment) => Boolean(comment.replyContent) === Boolean(comment.repliedAt), { message: 'Reply content and timestamp must agree', path: ['repliedAt'] }).readonly();
|
|
49
|
+
export const blogDeletedCommentSnapshotSchema = z.strictObject({
|
|
50
|
+
id: z.uuid(),
|
|
51
|
+
postId: z.uuid(),
|
|
52
|
+
userId: z.uuid(),
|
|
53
|
+
status: blogCommentStatusSchema,
|
|
54
|
+
version,
|
|
55
|
+
}).readonly();
|
|
56
|
+
//# sourceMappingURL=snapshots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshots.js","sourceRoot":"","sources":["../../src/events/snapshots.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,GAAG,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AACrD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AAClD,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;AAE5C,MAAM,CAAC,MAAM,2BAA2B,GAAG,qBAAqB,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC;IAC/E,QAAQ,EAAE,yBAAyB;IACnC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;SACxC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE,0BAA0B,CAAC;SACpG,QAAQ,EAAE;IACb,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACzC,aAAa,EAAE,MAAM;IACrB,OAAO;CACR,CAAC,CAAC,QAAQ,EAAE,CAAC;AAEd,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC;IAC/C,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ;CAC1E,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,YAAY,CAAC;IACxD,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;IACZ,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACxC,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAC1C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACzC,QAAQ,EAAE,sBAAsB,CAAC,QAAQ,EAAE;IAC3C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC;IAClE,WAAW,EAAE,WAAW;IACxB,SAAS,EAAE,WAAW;IACtB,aAAa,EAAE,MAAM;IACrB,OAAO;CACR,CAAC,CAAC,QAAQ,EAAE,CAAC;AAEd,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC;IAC/C,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW;CAC/D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;AACnF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC3D,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;IACZ,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;IAC5C,MAAM,EAAE,uBAAuB;IAC/B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;IAC5D,SAAS,EAAE,WAAW,CAAC,QAAQ,EAAE;IACjC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACtD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACpD,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,OAAO;CACR,CAAC,CAAC,MAAM,CACP,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,EACzE,EAAE,OAAO,EAAE,wCAAwC,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE,CAC3E,CAAC,QAAQ,EAAE,CAAC;AAEb,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,YAAY,CAAC;IAC7D,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;IACZ,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE;IAChB,MAAM,EAAE,uBAAuB;IAC/B,OAAO;CACR,CAAC,CAAC,QAAQ,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
export * from './identity.js';
|
|
2
2
|
export * from './micro.js';
|
|
3
3
|
export * from './themes.js';
|
|
4
|
+
export * from './events/comment-deleted.js';
|
|
5
|
+
export * from './events/comment-reply-changed.js';
|
|
6
|
+
export * from './events/comment-status-changed.js';
|
|
7
|
+
export * from './events/comment-submitted.js';
|
|
8
|
+
export * from './events/page-archived.js';
|
|
9
|
+
export * from './events/page-publication-updated.js';
|
|
10
|
+
export * from './events/page-published.js';
|
|
11
|
+
export * from './events/post-archived.js';
|
|
12
|
+
export * from './events/post-publication-updated.js';
|
|
13
|
+
export * from './events/post-published.js';
|
|
14
|
+
export * from './events/snapshots.js';
|
|
15
|
+
export * from './events/catalog.js';
|
|
4
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC;AACrD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC;AACrD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
export * from './identity.js';
|
|
2
2
|
export * from './micro.js';
|
|
3
3
|
export * from './themes.js';
|
|
4
|
+
export * from './events/comment-deleted.js';
|
|
5
|
+
export * from './events/comment-reply-changed.js';
|
|
6
|
+
export * from './events/comment-status-changed.js';
|
|
7
|
+
export * from './events/comment-submitted.js';
|
|
8
|
+
export * from './events/page-archived.js';
|
|
9
|
+
export * from './events/page-publication-updated.js';
|
|
10
|
+
export * from './events/page-published.js';
|
|
11
|
+
export * from './events/post-archived.js';
|
|
12
|
+
export * from './events/post-publication-updated.js';
|
|
13
|
+
export * from './events/post-published.js';
|
|
14
|
+
export * from './events/snapshots.js';
|
|
15
|
+
export * from './events/catalog.js';
|
|
4
16
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC;AACrD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sCAAsC,CAAC;AACrD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zlooks.cn/blog-shared",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@hile/context": "4.0.2",
|
|
23
23
|
"@zlooks.cn/blog-schema": "1.0.0",
|
|
24
|
+
"@zlooks.cn/event-bus": "1.0.1",
|
|
25
|
+
"@zlooks.cn/event-client": "1.0.1",
|
|
24
26
|
"zod": "4.4.3"
|
|
25
27
|
},
|
|
26
28
|
"devDependencies": {
|
|
@@ -29,5 +31,5 @@
|
|
|
29
31
|
"typescript": "7.0.2",
|
|
30
32
|
"vitest": "4.1.11"
|
|
31
33
|
},
|
|
32
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "b118899f7646d3cb4e82563f0d32f68238bb38d0"
|
|
33
35
|
}
|