@s-hirano-ist/s-core 1.6.0 → 1.7.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/articles/entities/article-entity.d.ts +30 -99
- package/dist/articles/entities/article-entity.d.ts.map +1 -1
- package/dist/articles/entities/article-entity.js +1 -67
- package/dist/articles/entities/article-entity.js.map +1 -1
- package/dist/articles/index.d.ts +1 -0
- package/dist/articles/index.d.ts.map +1 -1
- package/dist/articles/index.js +1 -0
- package/dist/articles/index.js.map +1 -1
- package/dist/articles/repositories/articles-command-repository.interface.d.ts +4 -0
- package/dist/articles/repositories/articles-command-repository.interface.d.ts.map +1 -1
- package/dist/articles/services/articles-batch-domain-service.d.ts +82 -0
- package/dist/articles/services/articles-batch-domain-service.d.ts.map +1 -0
- package/dist/articles/services/articles-batch-domain-service.js +91 -0
- package/dist/articles/services/articles-batch-domain-service.js.map +1 -0
- package/dist/books/entities/books-entity.d.ts +34 -104
- package/dist/books/entities/books-entity.d.ts.map +1 -1
- package/dist/books/entities/books-entity.js +1 -67
- package/dist/books/entities/books-entity.js.map +1 -1
- package/dist/books/index.d.ts +1 -0
- package/dist/books/index.d.ts.map +1 -1
- package/dist/books/index.js +1 -0
- package/dist/books/index.js.map +1 -1
- package/dist/books/repositories/books-command-repository.interface.d.ts +4 -0
- package/dist/books/repositories/books-command-repository.interface.d.ts.map +1 -1
- package/dist/books/services/books-batch-domain-service.d.ts +36 -0
- package/dist/books/services/books-batch-domain-service.d.ts.map +1 -0
- package/dist/books/services/books-batch-domain-service.js +49 -0
- package/dist/books/services/books-batch-domain-service.js.map +1 -0
- package/dist/common/entities/common-entity.d.ts +8 -20
- package/dist/common/entities/common-entity.d.ts.map +1 -1
- package/dist/common/entities/common-entity.js +2 -14
- package/dist/common/entities/common-entity.js.map +1 -1
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +2 -0
- package/dist/common/index.js.map +1 -1
- package/dist/common/repositories/batch-command-repository.interface.d.ts +93 -0
- package/dist/common/repositories/batch-command-repository.interface.d.ts.map +1 -0
- package/dist/common/repositories/batch-command-repository.interface.js +2 -0
- package/dist/common/repositories/batch-command-repository.interface.js.map +1 -0
- package/dist/images/entities/image-entity.d.ts +27 -101
- package/dist/images/entities/image-entity.d.ts.map +1 -1
- package/dist/images/entities/image-entity.js +1 -67
- package/dist/images/entities/image-entity.js.map +1 -1
- package/dist/images/index.d.ts +1 -0
- package/dist/images/index.d.ts.map +1 -1
- package/dist/images/index.js +1 -0
- package/dist/images/index.js.map +1 -1
- package/dist/images/repositories/images-command-repository.interface.d.ts +4 -0
- package/dist/images/repositories/images-command-repository.interface.d.ts.map +1 -1
- package/dist/images/services/images-batch-domain-service.d.ts +36 -0
- package/dist/images/services/images-batch-domain-service.d.ts.map +1 -0
- package/dist/images/services/images-batch-domain-service.js +49 -0
- package/dist/images/services/images-batch-domain-service.js.map +1 -0
- package/dist/notes/entities/note-entity.d.ts +13 -76
- package/dist/notes/entities/note-entity.d.ts.map +1 -1
- package/dist/notes/entities/note-entity.js +1 -67
- package/dist/notes/entities/note-entity.js.map +1 -1
- package/dist/notes/index.d.ts +1 -0
- package/dist/notes/index.d.ts.map +1 -1
- package/dist/notes/index.js +1 -0
- package/dist/notes/index.js.map +1 -1
- package/dist/notes/repositories/notes-command-repository.interface.d.ts +4 -0
- package/dist/notes/repositories/notes-command-repository.interface.d.ts.map +1 -1
- package/dist/notes/services/notes-batch-domain-service.d.ts +36 -0
- package/dist/notes/services/notes-batch-domain-service.d.ts.map +1 -0
- package/dist/notes/services/notes-batch-domain-service.js +49 -0
- package/dist/notes/services/notes-batch-domain-service.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -15,7 +15,7 @@ import { UserId } from "../../common/entities/common-entity.js";
|
|
|
15
15
|
*
|
|
16
16
|
* @see {@link makeISBN} for factory function
|
|
17
17
|
*/
|
|
18
|
-
export declare const ISBN: z.core.$ZodBranded<z.ZodString, "ISBN">;
|
|
18
|
+
export declare const ISBN: z.core.$ZodBranded<z.ZodString, "ISBN", "out">;
|
|
19
19
|
/**
|
|
20
20
|
* Branded type for validated ISBN identifiers.
|
|
21
21
|
*/
|
|
@@ -46,7 +46,7 @@ export declare const makeISBN: (v: string) => ISBN;
|
|
|
46
46
|
*
|
|
47
47
|
* @see {@link makeBookTitle} for factory function
|
|
48
48
|
*/
|
|
49
|
-
export declare const BookTitle: z.core.$ZodBranded<z.ZodString, "BookTitle">;
|
|
49
|
+
export declare const BookTitle: z.core.$ZodBranded<z.ZodString, "BookTitle", "out">;
|
|
50
50
|
/**
|
|
51
51
|
* Branded type for validated book titles.
|
|
52
52
|
*/
|
|
@@ -73,7 +73,7 @@ export declare const makeBookTitle: (v: string) => BookTitle;
|
|
|
73
73
|
*
|
|
74
74
|
* @see {@link makeGoogleTitle} for factory function
|
|
75
75
|
*/
|
|
76
|
-
export declare const GoogleTitle: z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleTitle">;
|
|
76
|
+
export declare const GoogleTitle: z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleTitle", "out">;
|
|
77
77
|
/**
|
|
78
78
|
* Branded type for Google Books API titles.
|
|
79
79
|
*/
|
|
@@ -93,7 +93,7 @@ export declare const makeGoogleTitle: (v: string | null | undefined) => GoogleTi
|
|
|
93
93
|
*
|
|
94
94
|
* @see {@link makeGoogleSubTitle} for factory function
|
|
95
95
|
*/
|
|
96
|
-
export declare const GoogleSubtitle: z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleSubTitle">;
|
|
96
|
+
export declare const GoogleSubtitle: z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleSubTitle", "out">;
|
|
97
97
|
/**
|
|
98
98
|
* Branded type for Google Books API subtitles.
|
|
99
99
|
*/
|
|
@@ -114,7 +114,7 @@ export declare const makeGoogleSubTitle: (v: string | null | undefined) => Googl
|
|
|
114
114
|
*
|
|
115
115
|
* @see {@link makeGoogleAuthors} for factory function
|
|
116
116
|
*/
|
|
117
|
-
export declare const GoogleAuthors: z.core.$ZodBranded<z.ZodNullable<z.ZodArray<z.ZodString>>, "GoogleAuthors">;
|
|
117
|
+
export declare const GoogleAuthors: z.core.$ZodBranded<z.ZodNullable<z.ZodArray<z.ZodString>>, "GoogleAuthors", "out">;
|
|
118
118
|
/**
|
|
119
119
|
* Branded type for Google Books API authors.
|
|
120
120
|
*/
|
|
@@ -134,7 +134,7 @@ export declare const makeGoogleAuthors: (v: string[] | null | undefined) => Goog
|
|
|
134
134
|
*
|
|
135
135
|
* @see {@link makeGoogleDescription} for factory function
|
|
136
136
|
*/
|
|
137
|
-
export declare const GoogleDescription: z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleDescription">;
|
|
137
|
+
export declare const GoogleDescription: z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleDescription", "out">;
|
|
138
138
|
/**
|
|
139
139
|
* Branded type for Google Books API descriptions.
|
|
140
140
|
*/
|
|
@@ -154,7 +154,7 @@ export declare const makeGoogleDescription: (v: string | null | undefined) => Go
|
|
|
154
154
|
*
|
|
155
155
|
* @see {@link makeGoogleImgSrc} for factory function
|
|
156
156
|
*/
|
|
157
|
-
export declare const GoogleImgSrc: z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleImgSrc">;
|
|
157
|
+
export declare const GoogleImgSrc: z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleImgSrc", "out">;
|
|
158
158
|
/**
|
|
159
159
|
* Branded type for Google Books API image URLs.
|
|
160
160
|
*/
|
|
@@ -174,7 +174,7 @@ export declare const makeGoogleImgSrc: (v: string | null | undefined) => GoogleI
|
|
|
174
174
|
*
|
|
175
175
|
* @see {@link makeGoogleHref} for factory function
|
|
176
176
|
*/
|
|
177
|
-
export declare const GoogleHref: z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleHref">;
|
|
177
|
+
export declare const GoogleHref: z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleHref", "out">;
|
|
178
178
|
/**
|
|
179
179
|
* Branded type for Google Books API links.
|
|
180
180
|
*/
|
|
@@ -194,7 +194,7 @@ export declare const makeGoogleHref: (v: string | null | undefined) => GoogleHre
|
|
|
194
194
|
*
|
|
195
195
|
* @see {@link makeBookMarkdown} for factory function
|
|
196
196
|
*/
|
|
197
|
-
export declare const BookMarkdown: z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "BookMarkdown">;
|
|
197
|
+
export declare const BookMarkdown: z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "BookMarkdown", "out">;
|
|
198
198
|
/**
|
|
199
199
|
* Branded type for book markdown content.
|
|
200
200
|
*/
|
|
@@ -216,18 +216,18 @@ export declare const makeBookMarkdown: (v: string | null) => BookMarkdown;
|
|
|
216
216
|
* @see {@link ExportedBook} for the published state
|
|
217
217
|
*/
|
|
218
218
|
export declare const UnexportedBook: z.ZodObject<{
|
|
219
|
-
id: z.core.$ZodBranded<z.ZodDefault<z.ZodUUID>, "Id">;
|
|
220
|
-
userId: z.core.$ZodBranded<z.ZodString, "UserId">;
|
|
221
|
-
ISBN: z.core.$ZodBranded<z.ZodString, "ISBN">;
|
|
222
|
-
title: z.core.$ZodBranded<z.ZodString, "BookTitle">;
|
|
223
|
-
googleTitle: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleTitle">>;
|
|
224
|
-
googleSubtitle: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleSubTitle">>;
|
|
225
|
-
googleAuthors: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodArray<z.ZodString>>, "GoogleAuthors">>;
|
|
226
|
-
googleDescription: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleDescription">>;
|
|
227
|
-
googleImgSrc: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleImgSrc">>;
|
|
228
|
-
googleHref: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleHref">>;
|
|
229
|
-
markdown: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "BookMarkdown">>;
|
|
230
|
-
createdAt: z.core.$ZodBranded<z.ZodDate, "CreatedAt">;
|
|
219
|
+
id: z.core.$ZodBranded<z.ZodDefault<z.ZodUUID>, "Id", "out">;
|
|
220
|
+
userId: z.core.$ZodBranded<z.ZodString, "UserId", "out">;
|
|
221
|
+
ISBN: z.core.$ZodBranded<z.ZodString, "ISBN", "out">;
|
|
222
|
+
title: z.core.$ZodBranded<z.ZodString, "BookTitle", "out">;
|
|
223
|
+
googleTitle: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleTitle", "out">>;
|
|
224
|
+
googleSubtitle: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleSubTitle", "out">>;
|
|
225
|
+
googleAuthors: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodArray<z.ZodString>>, "GoogleAuthors", "out">>;
|
|
226
|
+
googleDescription: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleDescription", "out">>;
|
|
227
|
+
googleImgSrc: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleImgSrc", "out">>;
|
|
228
|
+
googleHref: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleHref", "out">>;
|
|
229
|
+
markdown: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "BookMarkdown", "out">>;
|
|
230
|
+
createdAt: z.core.$ZodBranded<z.ZodDate, "CreatedAt", "out">;
|
|
231
231
|
status: z.ZodLiteral<"UNEXPORTED">;
|
|
232
232
|
}, z.core.$strip>;
|
|
233
233
|
/**
|
|
@@ -247,20 +247,20 @@ export type UnexportedBook = Readonly<z.infer<typeof UnexportedBook>>;
|
|
|
247
247
|
* @see {@link UnexportedBook} for the initial state
|
|
248
248
|
*/
|
|
249
249
|
export declare const ExportedBook: z.ZodObject<{
|
|
250
|
-
id: z.core.$ZodBranded<z.ZodDefault<z.ZodUUID>, "Id">;
|
|
251
|
-
userId: z.core.$ZodBranded<z.ZodString, "UserId">;
|
|
252
|
-
ISBN: z.core.$ZodBranded<z.ZodString, "ISBN">;
|
|
253
|
-
title: z.core.$ZodBranded<z.ZodString, "BookTitle">;
|
|
254
|
-
googleTitle: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleTitle">>;
|
|
255
|
-
googleSubtitle: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleSubTitle">>;
|
|
256
|
-
googleAuthors: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodArray<z.ZodString>>, "GoogleAuthors">>;
|
|
257
|
-
googleDescription: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleDescription">>;
|
|
258
|
-
googleImgSrc: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleImgSrc">>;
|
|
259
|
-
googleHref: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleHref">>;
|
|
260
|
-
markdown: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "BookMarkdown">>;
|
|
261
|
-
createdAt: z.core.$ZodBranded<z.ZodDate, "CreatedAt">;
|
|
250
|
+
id: z.core.$ZodBranded<z.ZodDefault<z.ZodUUID>, "Id", "out">;
|
|
251
|
+
userId: z.core.$ZodBranded<z.ZodString, "UserId", "out">;
|
|
252
|
+
ISBN: z.core.$ZodBranded<z.ZodString, "ISBN", "out">;
|
|
253
|
+
title: z.core.$ZodBranded<z.ZodString, "BookTitle", "out">;
|
|
254
|
+
googleTitle: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleTitle", "out">>;
|
|
255
|
+
googleSubtitle: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleSubTitle", "out">>;
|
|
256
|
+
googleAuthors: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodArray<z.ZodString>>, "GoogleAuthors", "out">>;
|
|
257
|
+
googleDescription: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleDescription", "out">>;
|
|
258
|
+
googleImgSrc: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleImgSrc", "out">>;
|
|
259
|
+
googleHref: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleHref", "out">>;
|
|
260
|
+
markdown: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "BookMarkdown", "out">>;
|
|
261
|
+
createdAt: z.core.$ZodBranded<z.ZodDate, "CreatedAt", "out">;
|
|
262
262
|
status: z.ZodLiteral<"EXPORTED">;
|
|
263
|
-
exportedAt: z.core.$ZodBranded<z.ZodDate, "ExportedAt">;
|
|
263
|
+
exportedAt: z.core.$ZodBranded<z.ZodDate, "ExportedAt", "out">;
|
|
264
264
|
}, z.core.$strip>;
|
|
265
265
|
/**
|
|
266
266
|
* Type for an exported book entity.
|
|
@@ -269,39 +269,6 @@ export declare const ExportedBook: z.ZodObject<{
|
|
|
269
269
|
* Immutable entity representing a published book.
|
|
270
270
|
*/
|
|
271
271
|
export type ExportedBook = Readonly<z.infer<typeof ExportedBook>>;
|
|
272
|
-
/**
|
|
273
|
-
* Zod schema for a book marked for export in the current batch.
|
|
274
|
-
*
|
|
275
|
-
* @remarks
|
|
276
|
-
* Represents a book that has been marked for export but not yet finalized.
|
|
277
|
-
* This intermediate state allows for batch processing with revert capability.
|
|
278
|
-
*
|
|
279
|
-
* @see {@link UnexportedBook} for the initial state
|
|
280
|
-
* @see {@link ExportedBook} for the final state
|
|
281
|
-
*/
|
|
282
|
-
export declare const LastUpdatedBook: z.ZodObject<{
|
|
283
|
-
id: z.core.$ZodBranded<z.ZodDefault<z.ZodUUID>, "Id">;
|
|
284
|
-
userId: z.core.$ZodBranded<z.ZodString, "UserId">;
|
|
285
|
-
ISBN: z.core.$ZodBranded<z.ZodString, "ISBN">;
|
|
286
|
-
title: z.core.$ZodBranded<z.ZodString, "BookTitle">;
|
|
287
|
-
googleTitle: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleTitle">>;
|
|
288
|
-
googleSubtitle: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleSubTitle">>;
|
|
289
|
-
googleAuthors: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodArray<z.ZodString>>, "GoogleAuthors">>;
|
|
290
|
-
googleDescription: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleDescription">>;
|
|
291
|
-
googleImgSrc: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleImgSrc">>;
|
|
292
|
-
googleHref: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "GoogleHref">>;
|
|
293
|
-
markdown: z.ZodOptional<z.core.$ZodBranded<z.ZodNullable<z.ZodString>, "BookMarkdown">>;
|
|
294
|
-
createdAt: z.core.$ZodBranded<z.ZodDate, "CreatedAt">;
|
|
295
|
-
status: z.ZodLiteral<"LAST_UPDATED">;
|
|
296
|
-
}, z.core.$strip>;
|
|
297
|
-
/**
|
|
298
|
-
* Type for a book marked for export.
|
|
299
|
-
*
|
|
300
|
-
* @remarks
|
|
301
|
-
* Immutable entity representing a book in the current export batch.
|
|
302
|
-
* Can be reverted back to UnexportedBook or finalized to ExportedBook.
|
|
303
|
-
*/
|
|
304
|
-
export type LastUpdatedBook = Readonly<z.infer<typeof LastUpdatedBook>>;
|
|
305
272
|
/**
|
|
306
273
|
* Arguments for creating a new book.
|
|
307
274
|
*
|
|
@@ -367,42 +334,5 @@ export declare const bookEntity: {
|
|
|
367
334
|
* @throws {UnexpectedError} For unexpected errors during export
|
|
368
335
|
*/
|
|
369
336
|
export: (book: UnexportedBook) => ExportedBook;
|
|
370
|
-
/**
|
|
371
|
-
* Marks a book for export in the current batch.
|
|
372
|
-
*
|
|
373
|
-
* @remarks
|
|
374
|
-
* Transitions from UNEXPORTED to LAST_UPDATED status.
|
|
375
|
-
* This allows for batch processing with revert capability.
|
|
376
|
-
*
|
|
377
|
-
* @param book - The unexported book to mark
|
|
378
|
-
* @returns A frozen LastUpdatedBook
|
|
379
|
-
* @throws {InvalidFormatError} When the book state is invalid
|
|
380
|
-
* @throws {UnexpectedError} For unexpected errors
|
|
381
|
-
*/
|
|
382
|
-
markAsLastUpdated: (book: UnexportedBook) => LastUpdatedBook;
|
|
383
|
-
/**
|
|
384
|
-
* Reverts a book from LAST_UPDATED back to UNEXPORTED.
|
|
385
|
-
*
|
|
386
|
-
* @remarks
|
|
387
|
-
* Use this when batch processing fails and needs to be rolled back.
|
|
388
|
-
*
|
|
389
|
-
* @param book - The last updated book to revert
|
|
390
|
-
* @returns A frozen UnexportedBook
|
|
391
|
-
* @throws {InvalidFormatError} When the book state is invalid
|
|
392
|
-
* @throws {UnexpectedError} For unexpected errors
|
|
393
|
-
*/
|
|
394
|
-
revert: (book: LastUpdatedBook) => UnexportedBook;
|
|
395
|
-
/**
|
|
396
|
-
* Finalizes a book from LAST_UPDATED to EXPORTED.
|
|
397
|
-
*
|
|
398
|
-
* @remarks
|
|
399
|
-
* Use this after batch processing succeeds to confirm the export.
|
|
400
|
-
*
|
|
401
|
-
* @param book - The last updated book to finalize
|
|
402
|
-
* @returns A frozen ExportedBook with exportedAt timestamp
|
|
403
|
-
* @throws {InvalidFormatError} When the book state is invalid
|
|
404
|
-
* @throws {UnexpectedError} For unexpected errors
|
|
405
|
-
*/
|
|
406
|
-
finalize: (book: LastUpdatedBook) => ExportedBook;
|
|
407
337
|
};
|
|
408
338
|
//# sourceMappingURL=books-entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"books-entity.d.ts","sourceRoot":"","sources":["../../../books/entities/books-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,
|
|
1
|
+
{"version":3,"file":"books-entity.d.ts","sourceRoot":"","sources":["../../../books/entities/books-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAQN,MAAM,EACN,MAAM,wCAAwC,CAAC;AAKhD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,IAAI,gDAKA,CAAC;AAElB;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ,GAAI,GAAG,MAAM,KAAG,IAAqB,CAAC;AAE3D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,qDAIA,CAAC;AAEvB;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAElD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,GAAI,GAAG,MAAM,KAAG,SAA+B,CAAC;AAE1E;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,sEAA+C,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,KAAG,WAC1C,CAAC;AAEtB;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,yEAAkD,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CA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GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,GAAG,MAAM,GAAG,IAAI,KAAG,YAC9B,CAAC;AAwBvB;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;iBAA4C,CAAC;AAExE;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC;AAEtE;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;iBAAoC,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC;AAElE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACrC,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,IAAI,EAAE,IAAI,CAAC;IACX,qBAAqB;IACrB,KAAK,EAAE,SAAS,CAAC;CACjB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,UAAU;IACtB;;;;;;;OAOG;mBACY,cAAc,KAAG,cAAc;IAW9C;;;;;;;OAOG;mBACY,cAAc,KAAG,YAAY;CAS5C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { CreatedAt, ExportedStatus, Id,
|
|
2
|
+
import { CreatedAt, ExportedStatus, Id, makeCreatedAt, makeExportedStatus, makeId, UnexportedStatus, UserId, } from "../../common/entities/common-entity.js";
|
|
3
3
|
import { createEntityWithErrorHandling } from "../../common/services/entity-factory.js";
|
|
4
4
|
// Value objects
|
|
5
5
|
/**
|
|
@@ -227,17 +227,6 @@ export const UnexportedBook = Base.extend({ status: UnexportedStatus });
|
|
|
227
227
|
* @see {@link UnexportedBook} for the initial state
|
|
228
228
|
*/
|
|
229
229
|
export const ExportedBook = Base.extend(ExportedStatus.shape);
|
|
230
|
-
/**
|
|
231
|
-
* Zod schema for a book marked for export in the current batch.
|
|
232
|
-
*
|
|
233
|
-
* @remarks
|
|
234
|
-
* Represents a book that has been marked for export but not yet finalized.
|
|
235
|
-
* This intermediate state allows for batch processing with revert capability.
|
|
236
|
-
*
|
|
237
|
-
* @see {@link UnexportedBook} for the initial state
|
|
238
|
-
* @see {@link ExportedBook} for the final state
|
|
239
|
-
*/
|
|
240
|
-
export const LastUpdatedBook = Base.extend({ status: LastUpdatedStatus });
|
|
241
230
|
/**
|
|
242
231
|
* Factory object for Book domain entity operations.
|
|
243
232
|
*
|
|
@@ -294,60 +283,5 @@ export const bookEntity = {
|
|
|
294
283
|
});
|
|
295
284
|
});
|
|
296
285
|
},
|
|
297
|
-
/**
|
|
298
|
-
* Marks a book for export in the current batch.
|
|
299
|
-
*
|
|
300
|
-
* @remarks
|
|
301
|
-
* Transitions from UNEXPORTED to LAST_UPDATED status.
|
|
302
|
-
* This allows for batch processing with revert capability.
|
|
303
|
-
*
|
|
304
|
-
* @param book - The unexported book to mark
|
|
305
|
-
* @returns A frozen LastUpdatedBook
|
|
306
|
-
* @throws {InvalidFormatError} When the book state is invalid
|
|
307
|
-
* @throws {UnexpectedError} For unexpected errors
|
|
308
|
-
*/
|
|
309
|
-
markAsLastUpdated: (book) => {
|
|
310
|
-
return createEntityWithErrorHandling(() => Object.freeze({
|
|
311
|
-
...book,
|
|
312
|
-
status: "LAST_UPDATED",
|
|
313
|
-
}));
|
|
314
|
-
},
|
|
315
|
-
/**
|
|
316
|
-
* Reverts a book from LAST_UPDATED back to UNEXPORTED.
|
|
317
|
-
*
|
|
318
|
-
* @remarks
|
|
319
|
-
* Use this when batch processing fails and needs to be rolled back.
|
|
320
|
-
*
|
|
321
|
-
* @param book - The last updated book to revert
|
|
322
|
-
* @returns A frozen UnexportedBook
|
|
323
|
-
* @throws {InvalidFormatError} When the book state is invalid
|
|
324
|
-
* @throws {UnexpectedError} For unexpected errors
|
|
325
|
-
*/
|
|
326
|
-
revert: (book) => {
|
|
327
|
-
return createEntityWithErrorHandling(() => Object.freeze({
|
|
328
|
-
...book,
|
|
329
|
-
status: "UNEXPORTED",
|
|
330
|
-
}));
|
|
331
|
-
},
|
|
332
|
-
/**
|
|
333
|
-
* Finalizes a book from LAST_UPDATED to EXPORTED.
|
|
334
|
-
*
|
|
335
|
-
* @remarks
|
|
336
|
-
* Use this after batch processing succeeds to confirm the export.
|
|
337
|
-
*
|
|
338
|
-
* @param book - The last updated book to finalize
|
|
339
|
-
* @returns A frozen ExportedBook with exportedAt timestamp
|
|
340
|
-
* @throws {InvalidFormatError} When the book state is invalid
|
|
341
|
-
* @throws {UnexpectedError} For unexpected errors
|
|
342
|
-
*/
|
|
343
|
-
finalize: (book) => {
|
|
344
|
-
return createEntityWithErrorHandling(() => {
|
|
345
|
-
const exportedStatus = makeExportedStatus();
|
|
346
|
-
return Object.freeze({
|
|
347
|
-
...book,
|
|
348
|
-
...exportedStatus,
|
|
349
|
-
});
|
|
350
|
-
});
|
|
351
|
-
},
|
|
352
286
|
};
|
|
353
287
|
//# sourceMappingURL=books-entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"books-entity.js","sourceRoot":"","sources":["../../../books/entities/books-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACN,SAAS,EACT,cAAc,EACd,EAAE,EACF,
|
|
1
|
+
{"version":3,"file":"books-entity.js","sourceRoot":"","sources":["../../../books/entities/books-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,EACh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D,OAAO,6BAA6B,CAAC,GAAG,EAAE,CACzC,MAAM,CAAC,MAAM,CAAC;YACb,EAAE,EAAE,MAAM,EAAE;YACZ,MAAM,EAAE,YAAY;YACpB,SAAS,EAAE,aAAa,EAAE;YAC1B,GAAG,IAAI;SACP,CAAC,CACF,CAAC;IACH,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,EAAE,CAAC,IAAoB,EAAgB,EAAE;QAC9C,OAAO,6BAA6B,CAAC,GAAG,EAAE;YACzC,MAAM,cAAc,GAAG,kBAAkB,EAAE,CAAC;YAC5C,OAAO,MAAM,CAAC,MAAM,CAAC;gBACpB,GAAG,IAAI;gBACP,GAAG,cAAc;aACjB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;CACD,CAAC"}
|
package/dist/books/index.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export * from "./events/book-created-event.js";
|
|
|
36
36
|
export * from "./events/book-deleted-event.js";
|
|
37
37
|
export * from "./repositories/books-command-repository.interface.js";
|
|
38
38
|
export * from "./repositories/books-query-repository.interface.js";
|
|
39
|
+
export * from "./services/books-batch-domain-service.js";
|
|
39
40
|
export * from "./services/books-domain-service.js";
|
|
40
41
|
export * from "./types/cache-strategy.js";
|
|
41
42
|
export * from "./types/query-params.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../books/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,cAAc,4BAA4B,CAAC;AAG3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAG/C,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AAGnE,cAAc,oCAAoC,CAAC;AAGnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../books/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,cAAc,4BAA4B,CAAC;AAG3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAG/C,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AAGnE,cAAc,0CAA0C,CAAC;AACzD,cAAc,oCAAoC,CAAC;AAGnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC"}
|
package/dist/books/index.js
CHANGED
|
@@ -40,6 +40,7 @@ export * from "./events/book-deleted-event.js";
|
|
|
40
40
|
export * from "./repositories/books-command-repository.interface.js";
|
|
41
41
|
export * from "./repositories/books-query-repository.interface.js";
|
|
42
42
|
// Services
|
|
43
|
+
export * from "./services/books-batch-domain-service.js";
|
|
43
44
|
export * from "./services/books-domain-service.js";
|
|
44
45
|
// Types
|
|
45
46
|
export * from "./types/cache-strategy.js";
|
package/dist/books/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../books/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,WAAW;AACX,cAAc,4BAA4B,CAAC;AAE3C,SAAS;AACT,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAE/C,eAAe;AACf,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AAEnE,WAAW;AACX,cAAc,oCAAoC,CAAC;AAEnD,QAAQ;AACR,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../books/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,WAAW;AACX,cAAc,4BAA4B,CAAC;AAE3C,SAAS;AACT,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAE/C,eAAe;AACf,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AAEnE,WAAW;AACX,cAAc,0CAA0C,CAAC;AACzD,cAAc,oCAAoC,CAAC;AAEnD,QAAQ;AACR,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC"}
|
|
@@ -7,6 +7,9 @@ import type { UnexportedBook } from "../entities/books-entity.js";
|
|
|
7
7
|
* Follows the CQRS pattern - this interface handles write operations only.
|
|
8
8
|
* Implementations should be provided by the infrastructure layer (e.g., Prisma).
|
|
9
9
|
*
|
|
10
|
+
* For batch operations (bulkUpdateStatus), use {@link IBatchCommandRepository}
|
|
11
|
+
* from the common module directly.
|
|
12
|
+
*
|
|
10
13
|
* @example
|
|
11
14
|
* ```typescript
|
|
12
15
|
* // Infrastructure implementation
|
|
@@ -24,6 +27,7 @@ import type { UnexportedBook } from "../entities/books-entity.js";
|
|
|
24
27
|
* ```
|
|
25
28
|
*
|
|
26
29
|
* @see {@link IBooksQueryRepository} for read operations
|
|
30
|
+
* @see {@link IBatchCommandRepository} for batch operations
|
|
27
31
|
*/
|
|
28
32
|
export type IBooksCommandRepository = {
|
|
29
33
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"books-command-repository.interface.d.ts","sourceRoot":"","sources":["../../../books/repositories/books-command-repository.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,EAAE,EACF,MAAM,EACN,MAAM,EACN,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE
|
|
1
|
+
{"version":3,"file":"books-command-repository.interface.d.ts","sourceRoot":"","sources":["../../../books/repositories/books-command-repository.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,EAAE,EACF,MAAM,EACN,MAAM,EACN,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACrC;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5C;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElE;;;;;;;OAOG;IACH,mBAAmB,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;CACjD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type UserId } from "../../common/entities/common-entity.js";
|
|
2
|
+
import type { BulkUpdateResult, IBatchCommandRepository } from "../../common/repositories/batch-command-repository.interface.js";
|
|
3
|
+
/**
|
|
4
|
+
* Result of the reset operation.
|
|
5
|
+
*/
|
|
6
|
+
export type ResetResult = {
|
|
7
|
+
finalized: BulkUpdateResult;
|
|
8
|
+
marked: BulkUpdateResult;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Domain service for batch operations on Books.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* Encapsulates the business logic for batch status transitions.
|
|
15
|
+
* Manages the state machine for book lifecycle:
|
|
16
|
+
*
|
|
17
|
+
* ```
|
|
18
|
+
* UNEXPORTED --> LAST_UPDATED --> EXPORTED
|
|
19
|
+
* |
|
|
20
|
+
* v
|
|
21
|
+
* UNEXPORTED (revert)
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare class BooksBatchDomainService {
|
|
25
|
+
private readonly commandRepository;
|
|
26
|
+
constructor(commandRepository: IBatchCommandRepository);
|
|
27
|
+
/**
|
|
28
|
+
* Resets books for a new batch export.
|
|
29
|
+
*/
|
|
30
|
+
resetBooks(userId: UserId): Promise<ResetResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Reverts books from LAST_UPDATED back to UNEXPORTED.
|
|
33
|
+
*/
|
|
34
|
+
revertBooks(userId: UserId): Promise<BulkUpdateResult>;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=books-batch-domain-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"books-batch-domain-service.d.ts","sourceRoot":"","sources":["../../../books/services/books-batch-domain-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,MAAM,EACX,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EACX,gBAAgB,EAChB,uBAAuB,EACvB,MAAM,iEAAiE,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACzB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,MAAM,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,qBAAa,uBAAuB;IACvB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAAjB,iBAAiB,EAAE,uBAAuB;IAEvE;;OAEG;IACU,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAiB7D;;OAEG;IACU,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAOnE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { makeExportedAt, } from "../../common/entities/common-entity.js";
|
|
2
|
+
/**
|
|
3
|
+
* Domain service for batch operations on Books.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Encapsulates the business logic for batch status transitions.
|
|
7
|
+
* Manages the state machine for book lifecycle:
|
|
8
|
+
*
|
|
9
|
+
* ```
|
|
10
|
+
* UNEXPORTED --> LAST_UPDATED --> EXPORTED
|
|
11
|
+
* |
|
|
12
|
+
* v
|
|
13
|
+
* UNEXPORTED (revert)
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export class BooksBatchDomainService {
|
|
17
|
+
commandRepository;
|
|
18
|
+
constructor(commandRepository) {
|
|
19
|
+
this.commandRepository = commandRepository;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Resets books for a new batch export.
|
|
23
|
+
*/
|
|
24
|
+
async resetBooks(userId) {
|
|
25
|
+
const finalized = await this.commandRepository.bulkUpdateStatus({
|
|
26
|
+
userId,
|
|
27
|
+
fromStatus: "LAST_UPDATED",
|
|
28
|
+
toStatus: "EXPORTED",
|
|
29
|
+
exportedAt: makeExportedAt(),
|
|
30
|
+
});
|
|
31
|
+
const marked = await this.commandRepository.bulkUpdateStatus({
|
|
32
|
+
userId,
|
|
33
|
+
fromStatus: "UNEXPORTED",
|
|
34
|
+
toStatus: "LAST_UPDATED",
|
|
35
|
+
});
|
|
36
|
+
return { finalized, marked };
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Reverts books from LAST_UPDATED back to UNEXPORTED.
|
|
40
|
+
*/
|
|
41
|
+
async revertBooks(userId) {
|
|
42
|
+
return this.commandRepository.bulkUpdateStatus({
|
|
43
|
+
userId,
|
|
44
|
+
fromStatus: "LAST_UPDATED",
|
|
45
|
+
toStatus: "UNEXPORTED",
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=books-batch-domain-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"books-batch-domain-service.js","sourceRoot":"","sources":["../../../books/services/books-batch-domain-service.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,cAAc,GAEd,MAAM,wCAAwC,CAAC;AAchD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,uBAAuB;IACN;IAA7B,YAA6B,iBAA0C;QAA1C,sBAAiB,GAAjB,iBAAiB,CAAyB;IAAG,CAAC;IAE3E;;OAEG;IACI,KAAK,CAAC,UAAU,CAAC,MAAc;QACrC,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC;YAC/D,MAAM;YACN,UAAU,EAAE,cAAc;YAC1B,QAAQ,EAAE,UAAU;YACpB,UAAU,EAAE,cAAc,EAAE;SAC5B,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC;YAC5D,MAAM;YACN,UAAU,EAAE,YAAY;YACxB,QAAQ,EAAE,cAAc;SACxB,CAAC,CAAC;QAEH,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IAC9B,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,WAAW,CAAC,MAAc;QACtC,OAAO,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC;YAC9C,MAAM;YACN,UAAU,EAAE,cAAc;YAC1B,QAAQ,EAAE,YAAY;SACtB,CAAC,CAAC;IACJ,CAAC;CACD"}
|
|
@@ -14,7 +14,7 @@ import { z } from "zod";
|
|
|
14
14
|
*
|
|
15
15
|
* @see {@link makeId} for factory function
|
|
16
16
|
*/
|
|
17
|
-
export declare const Id: z.core.$ZodBranded<z.ZodDefault<z.ZodUUID>, "Id">;
|
|
17
|
+
export declare const Id: z.core.$ZodBranded<z.ZodDefault<z.ZodUUID>, "Id", "out">;
|
|
18
18
|
/**
|
|
19
19
|
* Branded type for validated UUIDv7 identifiers.
|
|
20
20
|
*
|
|
@@ -51,7 +51,7 @@ export declare const makeId: (id?: string) => Id;
|
|
|
51
51
|
*
|
|
52
52
|
* @see {@link makeUserId} for factory function
|
|
53
53
|
*/
|
|
54
|
-
export declare const UserId: z.core.$ZodBranded<z.ZodString, "UserId">;
|
|
54
|
+
export declare const UserId: z.core.$ZodBranded<z.ZodString, "UserId", "out">;
|
|
55
55
|
/**
|
|
56
56
|
* Branded type for validated user identifiers.
|
|
57
57
|
*
|
|
@@ -87,7 +87,7 @@ export declare const makeUserId: (v: string) => UserId;
|
|
|
87
87
|
*
|
|
88
88
|
* @see {@link makeCreatedAt} for factory function
|
|
89
89
|
*/
|
|
90
|
-
export declare const CreatedAt: z.core.$ZodBranded<z.ZodDate, "CreatedAt">;
|
|
90
|
+
export declare const CreatedAt: z.core.$ZodBranded<z.ZodDate, "CreatedAt", "out">;
|
|
91
91
|
/**
|
|
92
92
|
* Branded type for validated creation timestamps.
|
|
93
93
|
*/
|
|
@@ -120,7 +120,7 @@ export declare const makeCreatedAt: (createdAt?: Date) => CreatedAt;
|
|
|
120
120
|
*
|
|
121
121
|
* @see {@link makeUpdatedAt} for factory function
|
|
122
122
|
*/
|
|
123
|
-
export declare const UpdatedAt: z.core.$ZodBranded<z.ZodDate, "UpdatedAt">;
|
|
123
|
+
export declare const UpdatedAt: z.core.$ZodBranded<z.ZodDate, "UpdatedAt", "out">;
|
|
124
124
|
/**
|
|
125
125
|
* Branded type for validated update timestamps.
|
|
126
126
|
*/
|
|
@@ -183,17 +183,6 @@ export declare const LastUpdatedStatus: z.ZodLiteral<"LAST_UPDATED">;
|
|
|
183
183
|
* Literal type for the LAST_UPDATED status.
|
|
184
184
|
*/
|
|
185
185
|
export type LastUpdatedStatus = z.infer<typeof LastUpdatedStatus>;
|
|
186
|
-
/**
|
|
187
|
-
* Creates a LastUpdatedStatus value.
|
|
188
|
-
*
|
|
189
|
-
* @returns The literal "LAST_UPDATED" status
|
|
190
|
-
*
|
|
191
|
-
* @example
|
|
192
|
-
* ```typescript
|
|
193
|
-
* const status = makeLastUpdatedStatus(); // "LAST_UPDATED"
|
|
194
|
-
* ```
|
|
195
|
-
*/
|
|
196
|
-
export declare const makeLastUpdatedStatus: () => LastUpdatedStatus;
|
|
197
186
|
/**
|
|
198
187
|
* Zod schema for validating export timestamps.
|
|
199
188
|
*
|
|
@@ -208,7 +197,7 @@ export declare const makeLastUpdatedStatus: () => LastUpdatedStatus;
|
|
|
208
197
|
*
|
|
209
198
|
* @see {@link makeExportedAt} for factory function
|
|
210
199
|
*/
|
|
211
|
-
export declare const ExportedAt: z.core.$ZodBranded<z.ZodDate, "ExportedAt">;
|
|
200
|
+
export declare const ExportedAt: z.core.$ZodBranded<z.ZodDate, "ExportedAt", "out">;
|
|
212
201
|
/**
|
|
213
202
|
* Branded type for validated export timestamps.
|
|
214
203
|
*/
|
|
@@ -247,7 +236,7 @@ export declare const makeExportedAt: (exportedAt?: Date) => ExportedAt;
|
|
|
247
236
|
*/
|
|
248
237
|
export declare const ExportedStatus: z.ZodObject<{
|
|
249
238
|
status: z.ZodLiteral<"EXPORTED">;
|
|
250
|
-
exportedAt: z.core.$ZodBranded<z.ZodDate, "ExportedAt">;
|
|
239
|
+
exportedAt: z.core.$ZodBranded<z.ZodDate, "ExportedAt", "out">;
|
|
251
240
|
}, z.core.$strip>;
|
|
252
241
|
/**
|
|
253
242
|
* Type for the EXPORTED status with timestamp.
|
|
@@ -287,14 +276,13 @@ export type Status = UnexportedStatus | LastUpdatedStatus | ExportedStatus["stat
|
|
|
287
276
|
* @param status - The status string ("UNEXPORTED", "LAST_UPDATED", or "EXPORTED")
|
|
288
277
|
* @returns The status value
|
|
289
278
|
*
|
|
290
|
-
* @deprecated This is for legacy compatibility. Use {@link makeUnexportedStatus}
|
|
291
|
-
*
|
|
279
|
+
* @deprecated This is for legacy compatibility. Use {@link makeUnexportedStatus}
|
|
280
|
+
* or {@link makeExportedStatus} instead.
|
|
292
281
|
*
|
|
293
282
|
* @example
|
|
294
283
|
* ```typescript
|
|
295
284
|
* // Prefer these:
|
|
296
285
|
* const unexported = makeUnexportedStatus();
|
|
297
|
-
* const lastUpdated = makeLastUpdatedStatus();
|
|
298
286
|
* const exported = makeExportedStatus();
|
|
299
287
|
*
|
|
300
288
|
* // Instead of:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-entity.d.ts","sourceRoot":"","sources":["../../../common/entities/common-entity.ts"],"names":[],"mappings":"A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,eAAO,MAAM,gBAAgB,4BAA0B,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEhE;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,QAAO,gBACH,CAAC;AAEtC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,8BAA4B,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,oDAAiC,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,GAAI,aAAa,IAAI,KAAG,UAGlD,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,cAAc;;;iBAGzB,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,QAAO,cAC+B,CAAC;AAEtE;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,MAAM,GACf,gBAAgB,GAChB,iBAAiB,GACjB,cAAc,CAAC,QAAQ,CAAC,CAAC;AAE5B;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,UAAU,GACtB,QAAQ,YAAY,GAAG,cAAc,GAAG,UAAU,KAChD,MAEF,CAAC"}
|
|
@@ -167,17 +167,6 @@ export const makeUnexportedStatus = () => UnexportedStatus.parse("UNEXPORTED");
|
|
|
167
167
|
* @see {@link Status} for the union type
|
|
168
168
|
*/
|
|
169
169
|
export const LastUpdatedStatus = z.literal("LAST_UPDATED");
|
|
170
|
-
/**
|
|
171
|
-
* Creates a LastUpdatedStatus value.
|
|
172
|
-
*
|
|
173
|
-
* @returns The literal "LAST_UPDATED" status
|
|
174
|
-
*
|
|
175
|
-
* @example
|
|
176
|
-
* ```typescript
|
|
177
|
-
* const status = makeLastUpdatedStatus(); // "LAST_UPDATED"
|
|
178
|
-
* ```
|
|
179
|
-
*/
|
|
180
|
-
export const makeLastUpdatedStatus = () => LastUpdatedStatus.parse("LAST_UPDATED");
|
|
181
170
|
/**
|
|
182
171
|
* Zod schema for validating export timestamps.
|
|
183
172
|
*
|
|
@@ -251,14 +240,13 @@ export const makeExportedStatus = () => ExportedStatus.parse({ status: "EXPORTED
|
|
|
251
240
|
* @param status - The status string ("UNEXPORTED", "LAST_UPDATED", or "EXPORTED")
|
|
252
241
|
* @returns The status value
|
|
253
242
|
*
|
|
254
|
-
* @deprecated This is for legacy compatibility. Use {@link makeUnexportedStatus}
|
|
255
|
-
*
|
|
243
|
+
* @deprecated This is for legacy compatibility. Use {@link makeUnexportedStatus}
|
|
244
|
+
* or {@link makeExportedStatus} instead.
|
|
256
245
|
*
|
|
257
246
|
* @example
|
|
258
247
|
* ```typescript
|
|
259
248
|
* // Prefer these:
|
|
260
249
|
* const unexported = makeUnexportedStatus();
|
|
261
|
-
* const lastUpdated = makeLastUpdatedStatus();
|
|
262
250
|
* const exported = makeExportedStatus();
|
|
263
251
|
*
|
|
264
252
|
* // Instead of:
|