@s-hirano-ist/s-core 1.2.0 → 1.3.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.
Files changed (166) hide show
  1. package/dist/articles/entities/article-entity.d.ts +342 -11
  2. package/dist/articles/entities/article-entity.d.ts.map +1 -1
  3. package/dist/articles/entities/article-entity.js +295 -9
  4. package/dist/articles/entities/article-entity.js.map +1 -1
  5. package/dist/articles/events/article-created-event.d.ts +36 -0
  6. package/dist/articles/events/article-created-event.d.ts.map +1 -1
  7. package/dist/articles/events/article-created-event.js +36 -0
  8. package/dist/articles/events/article-created-event.js.map +1 -1
  9. package/dist/articles/events/article-deleted-event.d.ts +30 -0
  10. package/dist/articles/events/article-deleted-event.d.ts.map +1 -1
  11. package/dist/articles/events/article-deleted-event.js +30 -0
  12. package/dist/articles/events/article-deleted-event.js.map +1 -1
  13. package/dist/articles/index.d.ts +33 -0
  14. package/dist/articles/index.d.ts.map +1 -1
  15. package/dist/articles/index.js +33 -0
  16. package/dist/articles/index.js.map +1 -1
  17. package/dist/articles/repositories/articles-command-repository.interface.d.ts +37 -0
  18. package/dist/articles/repositories/articles-command-repository.interface.d.ts.map +1 -1
  19. package/dist/articles/repositories/articles-query-repository.interface.d.ts +53 -0
  20. package/dist/articles/repositories/articles-query-repository.interface.d.ts.map +1 -1
  21. package/dist/articles/repositories/category-query-repository.interface.d.ts +29 -0
  22. package/dist/articles/repositories/category-query-repository.interface.d.ts.map +1 -1
  23. package/dist/articles/services/articles-domain-service.d.ts +40 -0
  24. package/dist/articles/services/articles-domain-service.d.ts.map +1 -1
  25. package/dist/articles/services/articles-domain-service.js +50 -0
  26. package/dist/articles/services/articles-domain-service.js.map +1 -1
  27. package/dist/articles/types/cache-strategy.d.ts +19 -0
  28. package/dist/articles/types/cache-strategy.d.ts.map +1 -1
  29. package/dist/articles/types/query-params.d.ts +83 -5
  30. package/dist/articles/types/query-params.d.ts.map +1 -1
  31. package/dist/articles/types/sort-order.d.ts +12 -0
  32. package/dist/articles/types/sort-order.d.ts.map +1 -1
  33. package/dist/books/entities/books-entity.d.ts +348 -13
  34. package/dist/books/entities/books-entity.d.ts.map +1 -1
  35. package/dist/books/entities/books-entity.js +296 -11
  36. package/dist/books/entities/books-entity.js.map +1 -1
  37. package/dist/books/events/book-created-event.d.ts +32 -0
  38. package/dist/books/events/book-created-event.d.ts.map +1 -1
  39. package/dist/books/events/book-created-event.js +32 -0
  40. package/dist/books/events/book-created-event.js.map +1 -1
  41. package/dist/books/events/book-deleted-event.d.ts +30 -0
  42. package/dist/books/events/book-deleted-event.d.ts.map +1 -1
  43. package/dist/books/events/book-deleted-event.js +30 -0
  44. package/dist/books/events/book-deleted-event.js.map +1 -1
  45. package/dist/books/index.d.ts +33 -0
  46. package/dist/books/index.d.ts.map +1 -1
  47. package/dist/books/index.js +33 -0
  48. package/dist/books/index.js.map +1 -1
  49. package/dist/books/repositories/books-command-repository.interface.d.ts +45 -0
  50. package/dist/books/repositories/books-command-repository.interface.d.ts.map +1 -1
  51. package/dist/books/repositories/books-query-repository.interface.d.ts +53 -0
  52. package/dist/books/repositories/books-query-repository.interface.d.ts.map +1 -1
  53. package/dist/books/services/books-domain-service.d.ts +40 -0
  54. package/dist/books/services/books-domain-service.d.ts.map +1 -1
  55. package/dist/books/services/books-domain-service.js +50 -0
  56. package/dist/books/services/books-domain-service.js.map +1 -1
  57. package/dist/books/types/cache-strategy.d.ts +19 -0
  58. package/dist/books/types/cache-strategy.d.ts.map +1 -1
  59. package/dist/books/types/query-params.d.ts +44 -3
  60. package/dist/books/types/query-params.d.ts.map +1 -1
  61. package/dist/books/types/sort-order.d.ts +12 -0
  62. package/dist/books/types/sort-order.d.ts.map +1 -1
  63. package/dist/common/entities/common-entity.d.ts +282 -2
  64. package/dist/common/entities/common-entity.d.ts.map +1 -1
  65. package/dist/common/entities/common-entity.js +235 -2
  66. package/dist/common/entities/common-entity.js.map +1 -1
  67. package/dist/common/events/base-domain-event.d.ts +32 -0
  68. package/dist/common/events/base-domain-event.d.ts.map +1 -1
  69. package/dist/common/events/base-domain-event.js +32 -0
  70. package/dist/common/events/base-domain-event.js.map +1 -1
  71. package/dist/common/events/domain-event.interface.d.ts +54 -0
  72. package/dist/common/events/domain-event.interface.d.ts.map +1 -1
  73. package/dist/common/events/system-error-event.d.ts +36 -0
  74. package/dist/common/events/system-error-event.d.ts.map +1 -1
  75. package/dist/common/events/system-error-event.js +36 -0
  76. package/dist/common/events/system-error-event.js.map +1 -1
  77. package/dist/common/events/system-warning-event.d.ts +35 -0
  78. package/dist/common/events/system-warning-event.d.ts.map +1 -1
  79. package/dist/common/events/system-warning-event.js +35 -0
  80. package/dist/common/events/system-warning-event.js.map +1 -1
  81. package/dist/common/index.d.ts +23 -0
  82. package/dist/common/index.d.ts.map +1 -1
  83. package/dist/common/index.js +23 -0
  84. package/dist/common/index.js.map +1 -1
  85. package/dist/common/services/entity-factory.d.ts +27 -0
  86. package/dist/common/services/entity-factory.d.ts.map +1 -1
  87. package/dist/common/services/entity-factory.js +27 -0
  88. package/dist/common/services/entity-factory.js.map +1 -1
  89. package/dist/common/services/id-generator.d.ts +32 -0
  90. package/dist/common/services/id-generator.d.ts.map +1 -1
  91. package/dist/common/services/id-generator.js +32 -0
  92. package/dist/common/services/id-generator.js.map +1 -1
  93. package/dist/errors/error-classes.d.ts +83 -0
  94. package/dist/errors/error-classes.d.ts.map +1 -1
  95. package/dist/errors/error-classes.js +83 -0
  96. package/dist/errors/error-classes.js.map +1 -1
  97. package/dist/errors/index.d.ts +29 -0
  98. package/dist/errors/index.d.ts.map +1 -1
  99. package/dist/errors/index.js +29 -0
  100. package/dist/errors/index.js.map +1 -1
  101. package/dist/images/entities/image-entity.d.ts +373 -4
  102. package/dist/images/entities/image-entity.d.ts.map +1 -1
  103. package/dist/images/entities/image-entity.js +320 -3
  104. package/dist/images/entities/image-entity.js.map +1 -1
  105. package/dist/images/events/image-created-event.d.ts +30 -0
  106. package/dist/images/events/image-created-event.d.ts.map +1 -1
  107. package/dist/images/events/image-created-event.js +30 -0
  108. package/dist/images/events/image-created-event.js.map +1 -1
  109. package/dist/images/events/image-deleted-event.d.ts +30 -0
  110. package/dist/images/events/image-deleted-event.d.ts.map +1 -1
  111. package/dist/images/events/image-deleted-event.js +30 -0
  112. package/dist/images/events/image-deleted-event.js.map +1 -1
  113. package/dist/images/index.d.ts +35 -0
  114. package/dist/images/index.d.ts.map +1 -1
  115. package/dist/images/index.js +35 -0
  116. package/dist/images/index.js.map +1 -1
  117. package/dist/images/repositories/images-command-repository.interface.d.ts +43 -0
  118. package/dist/images/repositories/images-command-repository.interface.d.ts.map +1 -1
  119. package/dist/images/repositories/images-query-repository.interface.d.ts +59 -0
  120. package/dist/images/repositories/images-query-repository.interface.d.ts.map +1 -1
  121. package/dist/images/services/images-domain-service.d.ts +40 -0
  122. package/dist/images/services/images-domain-service.d.ts.map +1 -1
  123. package/dist/images/services/images-domain-service.js +50 -0
  124. package/dist/images/services/images-domain-service.js.map +1 -1
  125. package/dist/images/types/cache-strategy.d.ts +19 -0
  126. package/dist/images/types/cache-strategy.d.ts.map +1 -1
  127. package/dist/images/types/query-params.d.ts +44 -3
  128. package/dist/images/types/query-params.d.ts.map +1 -1
  129. package/dist/images/types/sort-order.d.ts +12 -0
  130. package/dist/images/types/sort-order.d.ts.map +1 -1
  131. package/dist/index.d.ts +30 -0
  132. package/dist/index.d.ts.map +1 -1
  133. package/dist/index.js +30 -0
  134. package/dist/index.js.map +1 -1
  135. package/dist/notes/entities/note-entity.d.ts +212 -6
  136. package/dist/notes/entities/note-entity.d.ts.map +1 -1
  137. package/dist/notes/entities/note-entity.js +182 -4
  138. package/dist/notes/entities/note-entity.js.map +1 -1
  139. package/dist/notes/events/note-created-event.d.ts +32 -0
  140. package/dist/notes/events/note-created-event.d.ts.map +1 -1
  141. package/dist/notes/events/note-created-event.js +32 -0
  142. package/dist/notes/events/note-created-event.js.map +1 -1
  143. package/dist/notes/events/note-deleted-event.d.ts +30 -0
  144. package/dist/notes/events/note-deleted-event.d.ts.map +1 -1
  145. package/dist/notes/events/note-deleted-event.js +30 -0
  146. package/dist/notes/events/note-deleted-event.js.map +1 -1
  147. package/dist/notes/index.d.ts +32 -0
  148. package/dist/notes/index.d.ts.map +1 -1
  149. package/dist/notes/index.js +32 -0
  150. package/dist/notes/index.js.map +1 -1
  151. package/dist/notes/repositories/notes-command-repository.interface.d.ts +37 -0
  152. package/dist/notes/repositories/notes-command-repository.interface.d.ts.map +1 -1
  153. package/dist/notes/repositories/notes-query-repository.interface.d.ts +53 -0
  154. package/dist/notes/repositories/notes-query-repository.interface.d.ts.map +1 -1
  155. package/dist/notes/services/notes-domain-service.d.ts +40 -0
  156. package/dist/notes/services/notes-domain-service.d.ts.map +1 -1
  157. package/dist/notes/services/notes-domain-service.js +50 -0
  158. package/dist/notes/services/notes-domain-service.js.map +1 -1
  159. package/dist/notes/types/cache-strategy.d.ts +19 -0
  160. package/dist/notes/types/cache-strategy.d.ts.map +1 -1
  161. package/dist/notes/types/query-params.d.ts +44 -3
  162. package/dist/notes/types/query-params.d.ts.map +1 -1
  163. package/dist/notes/types/sort-order.d.ts +12 -0
  164. package/dist/notes/types/sort-order.d.ts.map +1 -1
  165. package/dist/tsconfig.tsbuildinfo +1 -1
  166. package/package.json +1 -1
@@ -1,28 +1,121 @@
1
1
  import { z } from "zod";
2
- import { CreatedAt, ExportedStatus, Id, makeCreatedAt, makeExportedStatus, makeId, UnexportedStatus, UserId, } from "../../common/entities/common-entity";
2
+ import { CreatedAt, ExportedStatus, Id, LastUpdatedStatus, makeCreatedAt, makeExportedStatus, makeId, UnexportedStatus, UserId, } from "../../common/entities/common-entity";
3
3
  import { createEntityWithErrorHandling } from "../../common/services/entity-factory";
4
4
  // Value objects
5
- const CategoryName = z
5
+ /**
6
+ * Zod schema for validating category names.
7
+ *
8
+ * @remarks
9
+ * Validates that the category name is a trimmed string between 1 and 16 characters.
10
+ * Used for organizing articles into logical groups.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * const name = CategoryName.parse("Technology");
15
+ * ```
16
+ *
17
+ * @see {@link makeCategoryName} for factory function
18
+ */
19
+ export const CategoryName = z
6
20
  .string({ message: "required" })
7
21
  .trim()
8
22
  .min(1, { message: "required" })
9
23
  .max(16, { message: "tooLong" })
10
24
  .brand();
25
+ /**
26
+ * Creates a validated CategoryName from a string.
27
+ *
28
+ * @param v - The raw string value to validate
29
+ * @returns A branded CategoryName value
30
+ * @throws {ZodError} When validation fails (empty or exceeds 16 chars)
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * const name = makeCategoryName("Technology");
35
+ * ```
36
+ */
11
37
  export const makeCategoryName = (v) => CategoryName.parse(v);
12
- const ArticleTitle = z
38
+ /**
39
+ * Zod schema for validating article titles.
40
+ *
41
+ * @remarks
42
+ * Validates that the title is a non-empty string between 1 and 128 characters.
43
+ *
44
+ * @example
45
+ * ```typescript
46
+ * const title = ArticleTitle.parse("Introduction to TypeScript");
47
+ * ```
48
+ *
49
+ * @see {@link makeArticleTitle} for factory function
50
+ */
51
+ export const ArticleTitle = z
13
52
  .string({ message: "required" })
14
53
  .min(1, { message: "required" })
15
54
  .max(128, { message: "tooLong" })
16
55
  .brand();
56
+ /**
57
+ * Creates a validated ArticleTitle from a string.
58
+ *
59
+ * @param v - The raw string value to validate
60
+ * @returns A branded ArticleTitle value
61
+ * @throws {ZodError} When validation fails (empty or exceeds 128 chars)
62
+ *
63
+ * @example
64
+ * ```typescript
65
+ * const title = makeArticleTitle("Introduction to TypeScript");
66
+ * ```
67
+ */
17
68
  export const makeArticleTitle = (v) => ArticleTitle.parse(v);
18
- const Quote = z
69
+ /**
70
+ * Zod schema for validating article quotes.
71
+ *
72
+ * @remarks
73
+ * Validates an optional quote with maximum 512 characters.
74
+ * Null and undefined values are allowed.
75
+ *
76
+ * @example
77
+ * ```typescript
78
+ * const quote = Quote.parse("This is a notable excerpt from the article.");
79
+ * const empty = Quote.parse(null);
80
+ * ```
81
+ *
82
+ * @see {@link makeQuote} for factory function
83
+ */
84
+ export const Quote = z
19
85
  .string()
20
86
  .max(512, { message: "tooLong" })
21
87
  .nullable()
22
88
  .optional()
23
89
  .brand();
90
+ /**
91
+ * Creates a validated Quote from a string or null/undefined.
92
+ *
93
+ * @param v - The raw string value, null, or undefined
94
+ * @returns A branded Quote value
95
+ * @throws {ZodError} When string exceeds 512 characters
96
+ *
97
+ * @example
98
+ * ```typescript
99
+ * const quote = makeQuote("Notable excerpt");
100
+ * const noQuote = makeQuote(null);
101
+ * ```
102
+ */
24
103
  export const makeQuote = (v) => Quote.parse(v);
25
- const Url = z
104
+ /**
105
+ * Zod schema for validating article URLs.
106
+ *
107
+ * @remarks
108
+ * Validates that the URL is a valid HTTP or HTTPS URL.
109
+ * Other protocols are not allowed.
110
+ *
111
+ * @example
112
+ * ```typescript
113
+ * const url = Url.parse("https://example.com/article");
114
+ * ```
115
+ *
116
+ * @see {@link makeUrl} for factory function
117
+ */
118
+ export const Url = z
26
119
  .url({ message: "invalidFormat" })
27
120
  .min(1, { message: "required" })
28
121
  .refine((url) => {
@@ -35,14 +128,84 @@ const Url = z
35
128
  }
36
129
  }, { message: "invalidFormat" })
37
130
  .brand();
131
+ /**
132
+ * Creates a validated Url from a string.
133
+ *
134
+ * @param v - The raw URL string
135
+ * @returns A branded Url value
136
+ * @throws {ZodError} When URL is invalid or not HTTP/HTTPS
137
+ *
138
+ * @example
139
+ * ```typescript
140
+ * const url = makeUrl("https://example.com/article");
141
+ * ```
142
+ */
38
143
  export const makeUrl = (v) => Url.parse(v);
39
- const OgTitle = z.string().nullable().optional().brand();
144
+ /**
145
+ * Zod schema for validating Open Graph titles.
146
+ *
147
+ * @remarks
148
+ * Optional string for the OG title fetched from the article URL.
149
+ * Null and undefined values are allowed.
150
+ *
151
+ * @see {@link makeOgTitle} for factory function
152
+ */
153
+ export const OgTitle = z.string().nullable().optional().brand();
154
+ /**
155
+ * Creates a validated OgTitle from a string or null/undefined.
156
+ *
157
+ * @param v - The raw OG title string, null, or undefined
158
+ * @returns A branded OgTitle value
159
+ */
40
160
  export const makeOgTitle = (v) => OgTitle.parse(v);
41
- const OgDescription = z.string().nullable().optional().brand();
161
+ /**
162
+ * Zod schema for validating Open Graph descriptions.
163
+ *
164
+ * @remarks
165
+ * Optional string for the OG description fetched from the article URL.
166
+ * Null and undefined values are allowed.
167
+ *
168
+ * @see {@link makeOgDescription} for factory function
169
+ */
170
+ export const OgDescription = z
171
+ .string()
172
+ .nullable()
173
+ .optional()
174
+ .brand();
175
+ /**
176
+ * Creates a validated OgDescription from a string or null/undefined.
177
+ *
178
+ * @param v - The raw OG description string, null, or undefined
179
+ * @returns A branded OgDescription value
180
+ */
42
181
  export const makeOgDescription = (v) => OgDescription.parse(v);
43
- const OgImageUrl = z.string().nullable().optional().brand();
182
+ /**
183
+ * Zod schema for validating Open Graph image URLs.
184
+ *
185
+ * @remarks
186
+ * Optional string for the OG image URL fetched from the article URL.
187
+ * Null and undefined values are allowed.
188
+ *
189
+ * @see {@link makeOgImageUrl} for factory function
190
+ */
191
+ export const OgImageUrl = z
192
+ .string()
193
+ .nullable()
194
+ .optional()
195
+ .brand();
196
+ /**
197
+ * Creates a validated OgImageUrl from a string or null/undefined.
198
+ *
199
+ * @param v - The raw OG image URL string, null, or undefined
200
+ * @returns A branded OgImageUrl value
201
+ */
44
202
  export const makeOgImageUrl = (v) => OgImageUrl.parse(v);
45
203
  // Entities
204
+ /**
205
+ * Base schema containing common article fields.
206
+ *
207
+ * @internal
208
+ */
46
209
  const Base = z.object({
47
210
  id: Id,
48
211
  userId: UserId,
@@ -56,9 +219,69 @@ const Base = z.object({
56
219
  ogDescription: OgDescription,
57
220
  ogImageUrl: OgImageUrl,
58
221
  });
222
+ /**
223
+ * Zod schema for an unexported article.
224
+ *
225
+ * @remarks
226
+ * Represents an article that has not yet been published.
227
+ * This is the initial state of all newly created articles.
228
+ *
229
+ * @see {@link ExportedArticle} for the published state
230
+ */
59
231
  export const UnexportedArticle = Base.extend({ status: UnexportedStatus });
60
- const ExportedArticle = Base.extend(ExportedStatus.shape);
232
+ /**
233
+ * Zod schema for an exported article.
234
+ *
235
+ * @remarks
236
+ * Represents an article that has been published.
237
+ * Includes the exportedAt timestamp.
238
+ *
239
+ * @see {@link UnexportedArticle} for the initial state
240
+ */
241
+ export const ExportedArticle = Base.extend(ExportedStatus.shape);
242
+ /**
243
+ * Zod schema for an article marked for export in the current batch.
244
+ *
245
+ * @remarks
246
+ * Represents an article that has been marked for export but not yet finalized.
247
+ * This intermediate state allows for batch processing with revert capability.
248
+ *
249
+ * @see {@link UnexportedArticle} for the initial state
250
+ * @see {@link ExportedArticle} for the final state
251
+ */
252
+ export const LastUpdatedArticle = Base.extend({ status: LastUpdatedStatus });
253
+ /**
254
+ * Factory object for Article domain entity operations.
255
+ *
256
+ * @remarks
257
+ * Provides immutable entity creation following DDD patterns.
258
+ * All returned entities are frozen using Object.freeze().
259
+ *
260
+ * @example
261
+ * ```typescript
262
+ * // Create a new unexported article
263
+ * const article = articleEntity.create({
264
+ * userId: makeUserId("user-123"),
265
+ * categoryName: makeCategoryName("Tech"),
266
+ * title: makeArticleTitle("Article Title"),
267
+ * url: makeUrl("https://example.com"),
268
+ * });
269
+ *
270
+ * // Export the article (changes status to EXPORTED)
271
+ * const exported = articleEntity.export(article);
272
+ * ```
273
+ *
274
+ * @see {@link CreateArticleArgs} for creation parameters
275
+ */
61
276
  export const articleEntity = {
277
+ /**
278
+ * Creates a new unexported article entity.
279
+ *
280
+ * @param args - The creation arguments containing required fields
281
+ * @returns A frozen UnexportedArticle instance with generated id and timestamps
282
+ * @throws {InvalidFormatError} When validation of any field fails
283
+ * @throws {UnexpectedError} For unexpected errors during creation
284
+ */
62
285
  create: (args) => {
63
286
  return createEntityWithErrorHandling(() => Object.freeze({
64
287
  id: makeId(),
@@ -68,6 +291,14 @@ export const articleEntity = {
68
291
  ...args,
69
292
  }));
70
293
  },
294
+ /**
295
+ * Transitions an article from UNEXPORTED to EXPORTED status.
296
+ *
297
+ * @param article - The unexported article to export
298
+ * @returns A frozen ExportedArticle with exportedAt timestamp
299
+ * @throws {InvalidFormatError} When the article state is invalid
300
+ * @throws {UnexpectedError} For unexpected errors during export
301
+ */
71
302
  export: (article) => {
72
303
  return createEntityWithErrorHandling(() => {
73
304
  const exportedStatus = makeExportedStatus();
@@ -77,5 +308,60 @@ export const articleEntity = {
77
308
  });
78
309
  });
79
310
  },
311
+ /**
312
+ * Marks an article for export in the current batch.
313
+ *
314
+ * @remarks
315
+ * Transitions from UNEXPORTED to LAST_UPDATED status.
316
+ * This allows for batch processing with revert capability.
317
+ *
318
+ * @param article - The unexported article to mark
319
+ * @returns A frozen LastUpdatedArticle
320
+ * @throws {InvalidFormatError} When the article state is invalid
321
+ * @throws {UnexpectedError} For unexpected errors
322
+ */
323
+ markAsLastUpdated: (article) => {
324
+ return createEntityWithErrorHandling(() => Object.freeze({
325
+ ...article,
326
+ status: "LAST_UPDATED",
327
+ }));
328
+ },
329
+ /**
330
+ * Reverts an article from LAST_UPDATED back to UNEXPORTED.
331
+ *
332
+ * @remarks
333
+ * Use this when batch processing fails and needs to be rolled back.
334
+ *
335
+ * @param article - The last updated article to revert
336
+ * @returns A frozen UnexportedArticle
337
+ * @throws {InvalidFormatError} When the article state is invalid
338
+ * @throws {UnexpectedError} For unexpected errors
339
+ */
340
+ revert: (article) => {
341
+ return createEntityWithErrorHandling(() => Object.freeze({
342
+ ...article,
343
+ status: "UNEXPORTED",
344
+ }));
345
+ },
346
+ /**
347
+ * Finalizes an article from LAST_UPDATED to EXPORTED.
348
+ *
349
+ * @remarks
350
+ * Use this after batch processing succeeds to confirm the export.
351
+ *
352
+ * @param article - The last updated article to finalize
353
+ * @returns A frozen ExportedArticle with exportedAt timestamp
354
+ * @throws {InvalidFormatError} When the article state is invalid
355
+ * @throws {UnexpectedError} For unexpected errors
356
+ */
357
+ finalize: (article) => {
358
+ return createEntityWithErrorHandling(() => {
359
+ const exportedStatus = makeExportedStatus();
360
+ return Object.freeze({
361
+ ...article,
362
+ ...exportedStatus,
363
+ });
364
+ });
365
+ },
80
366
  };
81
367
  //# sourceMappingURL=article-entity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"article-entity.js","sourceRoot":"","sources":["../../../articles/entities/article-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACN,SAAS,EACT,cAAc,EACd,EAAE,EACF,aAAa,EACb,kBAAkB,EAClB,MAAM,EACN,gBAAgB,EAChB,MAAM,GACN,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AAErF,gBAAgB;AAEhB,MAAM,YAAY,GAAG,CAAC;KACpB,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;KAC/B,IAAI,EAAE;KACN,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;KAC/B,GAAG,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;KAC/B,KAAK,EAAkB,CAAC;AAE1B,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAS,EAAgB,EAAE,CAC3D,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEvB,MAAM,YAAY,GAAG,CAAC;KACpB,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;KAC/B,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;KAC/B,GAAG,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;KAChC,KAAK,EAAkB,CAAC;AAE1B,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAS,EAAgB,EAAE,CAC3D,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEvB,MAAM,KAAK,GAAG,CAAC;KACb,MAAM,EAAE;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AO;YACV,MAAM,EAAE,YAAqB;SAC7B,CAAC,CACF,CAAC;IACH,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,EAAE,CAAC,OAA2B,EAAmB,EAAE;QAC1D,OAAO,6BAA6B,CAAC,GAAG,EAAE;YACzC,MAAM,cAAc,GAAG,kBAAkB,EAAE,CAAC;YAC5C,OAAO,MAAM,CAAC,MAAM,CAAC;gBACpB,GAAG,OAAO;gBACV,GAAG,cAAc;aACjB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;CACD,CAAC"}
@@ -1,5 +1,41 @@
1
1
  import { BaseDomainEvent } from "../../common/events/base-domain-event";
2
+ /**
3
+ * Domain event emitted when an article is created.
4
+ *
5
+ * @remarks
6
+ * Part of the event-driven architecture for cross-cutting concerns
7
+ * like notifications, logging, and analytics.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const event = new ArticleCreatedEvent({
12
+ * title: "New Article",
13
+ * url: "https://example.com",
14
+ * quote: "Important quote",
15
+ * categoryName: "Technology",
16
+ * userId: "user-123",
17
+ * caller: "addArticle",
18
+ * });
19
+ *
20
+ * // event.eventType === "article.created"
21
+ * await eventHandler.handle(event);
22
+ * ```
23
+ *
24
+ * @see {@link BaseDomainEvent} for base class
25
+ * @see {@link ArticleDeletedEvent} for deletion event
26
+ */
2
27
  export declare class ArticleCreatedEvent extends BaseDomainEvent {
28
+ /**
29
+ * Creates a new ArticleCreatedEvent.
30
+ *
31
+ * @param data - Event data containing article details and metadata
32
+ * @param data.title - The article title
33
+ * @param data.url - The article URL
34
+ * @param data.quote - Quote/excerpt from the article
35
+ * @param data.categoryName - The category name
36
+ * @param data.userId - The user who created the article
37
+ * @param data.caller - The function/method that triggered the event
38
+ */
3
39
  constructor(data: {
4
40
  title: string;
5
41
  url: string;
@@ -1 +1 @@
1
- {"version":3,"file":"article-created-event.d.ts","sourceRoot":"","sources":["../../../articles/events/article-created-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,qBAAa,mBAAoB,SAAQ,eAAe;gBAC3C,IAAI,EAAE;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,EAAE,MAAM,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KACf;CAeD"}
1
+ {"version":3,"file":"article-created-event.d.ts","sourceRoot":"","sources":["../../../articles/events/article-created-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,mBAAoB,SAAQ,eAAe;IACvD;;;;;;;;;;OAUG;gBACS,IAAI,EAAE;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,EAAE,MAAM,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KACf;CAeD"}
@@ -1,5 +1,41 @@
1
1
  import { BaseDomainEvent } from "../../common/events/base-domain-event";
2
+ /**
3
+ * Domain event emitted when an article is created.
4
+ *
5
+ * @remarks
6
+ * Part of the event-driven architecture for cross-cutting concerns
7
+ * like notifications, logging, and analytics.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const event = new ArticleCreatedEvent({
12
+ * title: "New Article",
13
+ * url: "https://example.com",
14
+ * quote: "Important quote",
15
+ * categoryName: "Technology",
16
+ * userId: "user-123",
17
+ * caller: "addArticle",
18
+ * });
19
+ *
20
+ * // event.eventType === "article.created"
21
+ * await eventHandler.handle(event);
22
+ * ```
23
+ *
24
+ * @see {@link BaseDomainEvent} for base class
25
+ * @see {@link ArticleDeletedEvent} for deletion event
26
+ */
2
27
  export class ArticleCreatedEvent extends BaseDomainEvent {
28
+ /**
29
+ * Creates a new ArticleCreatedEvent.
30
+ *
31
+ * @param data - Event data containing article details and metadata
32
+ * @param data.title - The article title
33
+ * @param data.url - The article URL
34
+ * @param data.quote - Quote/excerpt from the article
35
+ * @param data.categoryName - The category name
36
+ * @param data.userId - The user who created the article
37
+ * @param data.caller - The function/method that triggered the event
38
+ */
3
39
  constructor(data) {
4
40
  super("article.created", {
5
41
  title: data.title,
@@ -1 +1 @@
1
- {"version":3,"file":"article-created-event.js","sourceRoot":"","sources":["../../../articles/events/article-created-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,MAAM,OAAO,mBAAoB,SAAQ,eAAe;IACvD,YAAY,IAOX;QACA,KAAK,CACJ,iBAAiB,EACjB;YACC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,YAAY,EAAE,IAAI,CAAC,YAAY;SAC/B,EACD;YACC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;SACnB,CACD,CAAC;IACH,CAAC;CACD"}
1
+ {"version":3,"file":"article-created-event.js","sourceRoot":"","sources":["../../../articles/events/article-created-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,OAAO,mBAAoB,SAAQ,eAAe;IACvD;;;;;;;;;;OAUG;IACH,YAAY,IAOX;QACA,KAAK,CACJ,iBAAiB,EACjB;YACC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,YAAY,EAAE,IAAI,CAAC,YAAY;SAC/B,EACD;YACC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;SACnB,CACD,CAAC;IACH,CAAC;CACD"}
@@ -1,5 +1,35 @@
1
1
  import { BaseDomainEvent } from "../../common/events/base-domain-event";
2
+ /**
3
+ * Domain event emitted when an article is deleted.
4
+ *
5
+ * @remarks
6
+ * Part of the event-driven architecture for cross-cutting concerns
7
+ * like notifications, logging, and analytics.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const event = new ArticleDeletedEvent({
12
+ * title: "Deleted Article",
13
+ * userId: "user-123",
14
+ * caller: "deleteArticle",
15
+ * });
16
+ *
17
+ * // event.eventType === "article.deleted"
18
+ * await eventHandler.handle(event);
19
+ * ```
20
+ *
21
+ * @see {@link BaseDomainEvent} for base class
22
+ * @see {@link ArticleCreatedEvent} for creation event
23
+ */
2
24
  export declare class ArticleDeletedEvent extends BaseDomainEvent {
25
+ /**
26
+ * Creates a new ArticleDeletedEvent.
27
+ *
28
+ * @param data - Event data containing deletion details
29
+ * @param data.title - The title of the deleted article
30
+ * @param data.userId - The user who deleted the article
31
+ * @param data.caller - The function/method that triggered the event
32
+ */
3
33
  constructor(data: {
4
34
  title: string;
5
35
  userId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"article-deleted-event.d.ts","sourceRoot":"","sources":["../../../articles/events/article-deleted-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,qBAAa,mBAAoB,SAAQ,eAAe;gBAC3C,IAAI,EAAE;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KACf;CAYD"}
1
+ {"version":3,"file":"article-deleted-event.d.ts","sourceRoot":"","sources":["../../../articles/events/article-deleted-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,mBAAoB,SAAQ,eAAe;IACvD;;;;;;;OAOG;gBACS,IAAI,EAAE;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KACf;CAYD"}
@@ -1,5 +1,35 @@
1
1
  import { BaseDomainEvent } from "../../common/events/base-domain-event";
2
+ /**
3
+ * Domain event emitted when an article is deleted.
4
+ *
5
+ * @remarks
6
+ * Part of the event-driven architecture for cross-cutting concerns
7
+ * like notifications, logging, and analytics.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const event = new ArticleDeletedEvent({
12
+ * title: "Deleted Article",
13
+ * userId: "user-123",
14
+ * caller: "deleteArticle",
15
+ * });
16
+ *
17
+ * // event.eventType === "article.deleted"
18
+ * await eventHandler.handle(event);
19
+ * ```
20
+ *
21
+ * @see {@link BaseDomainEvent} for base class
22
+ * @see {@link ArticleCreatedEvent} for creation event
23
+ */
2
24
  export class ArticleDeletedEvent extends BaseDomainEvent {
25
+ /**
26
+ * Creates a new ArticleDeletedEvent.
27
+ *
28
+ * @param data - Event data containing deletion details
29
+ * @param data.title - The title of the deleted article
30
+ * @param data.userId - The user who deleted the article
31
+ * @param data.caller - The function/method that triggered the event
32
+ */
3
33
  constructor(data) {
4
34
  super("article.deleted", {
5
35
  title: data.title,
@@ -1 +1 @@
1
- {"version":3,"file":"article-deleted-event.js","sourceRoot":"","sources":["../../../articles/events/article-deleted-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,MAAM,OAAO,mBAAoB,SAAQ,eAAe;IACvD,YAAY,IAIX;QACA,KAAK,CACJ,iBAAiB,EACjB;YACC,KAAK,EAAE,IAAI,CAAC,KAAK;SACjB,EACD;YACC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;SACnB,CACD,CAAC;IACH,CAAC;CACD"}
1
+ {"version":3,"file":"article-deleted-event.js","sourceRoot":"","sources":["../../../articles/events/article-deleted-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,mBAAoB,SAAQ,eAAe;IACvD;;;;;;;OAOG;IACH,YAAY,IAIX;QACA,KAAK,CACJ,iBAAiB,EACjB;YACC,KAAK,EAAE,IAAI,CAAC,KAAK;SACjB,EACD;YACC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;SACnB,CACD,CAAC;IACH,CAAC;CACD"}
@@ -1,3 +1,36 @@
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * Articles domain for news and link management.
5
+ *
6
+ * @remarks
7
+ * Provides complete domain implementation for article management including:
8
+ *
9
+ * - **Entities** - Article value objects and entity factory
10
+ * - **Repositories** - Query and command repository interfaces (CQRS)
11
+ * - **Services** - Domain service for business logic
12
+ * - **Events** - Domain events for cross-cutting concerns
13
+ * - **Types** - Query parameters and cache strategies
14
+ *
15
+ * Articles support Open Graph metadata extraction (title, description, image URL)
16
+ * and can be organized into categories.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * import {
21
+ * articleEntity,
22
+ * makeArticleTitle,
23
+ * makeUrl,
24
+ * ArticleCreatedEvent,
25
+ * } from "@repo/core/articles";
26
+ *
27
+ * const article = articleEntity.create({
28
+ * userId: makeUserId("user-123"),
29
+ * title: makeArticleTitle("Breaking News"),
30
+ * url: makeUrl("https://example.com/news"),
31
+ * });
32
+ * ```
33
+ */
1
34
  export * from "./entities/article-entity";
2
35
  export * from "./events/article-created-event";
3
36
  export * from "./events/article-deleted-event";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../articles/index.ts"],"names":[],"mappings":"AACA,cAAc,2BAA2B,CAAC;AAG1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAG/C,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AAGnE,cAAc,oCAAoC,CAAC;AAGnD,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../articles/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,cAAc,2BAA2B,CAAC;AAG1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAG/C,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AAGnE,cAAc,oCAAoC,CAAC;AAGnD,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
@@ -1,3 +1,36 @@
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * Articles domain for news and link management.
5
+ *
6
+ * @remarks
7
+ * Provides complete domain implementation for article management including:
8
+ *
9
+ * - **Entities** - Article value objects and entity factory
10
+ * - **Repositories** - Query and command repository interfaces (CQRS)
11
+ * - **Services** - Domain service for business logic
12
+ * - **Events** - Domain events for cross-cutting concerns
13
+ * - **Types** - Query parameters and cache strategies
14
+ *
15
+ * Articles support Open Graph metadata extraction (title, description, image URL)
16
+ * and can be organized into categories.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * import {
21
+ * articleEntity,
22
+ * makeArticleTitle,
23
+ * makeUrl,
24
+ * ArticleCreatedEvent,
25
+ * } from "@repo/core/articles";
26
+ *
27
+ * const article = articleEntity.create({
28
+ * userId: makeUserId("user-123"),
29
+ * title: makeArticleTitle("Breaking News"),
30
+ * url: makeUrl("https://example.com/news"),
31
+ * });
32
+ * ```
33
+ */
1
34
  // Entities
2
35
  export * from "./entities/article-entity";
3
36
  // Events
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../articles/index.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,cAAc,2BAA2B,CAAC;AAE1C,SAAS;AACT,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAE/C,eAAe;AACf,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AAEnE,WAAW;AACX,cAAc,oCAAoC,CAAC;AAEnD,QAAQ;AACR,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../articles/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,WAAW;AACX,cAAc,2BAA2B,CAAC;AAE1C,SAAS;AACT,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAE/C,eAAe;AACf,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,oDAAoD,CAAC;AAEnE,WAAW;AACX,cAAc,oCAAoC,CAAC;AAEnD,QAAQ;AACR,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}