@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-entity.js","sourceRoot":"","sources":["../../../common/entities/common-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAA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,GAAqB,EAAE,CAC1D,gBAAgB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAEtC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;AAO3D;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,EAAgB,CAAC;AAOzD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAiB,EAAc,EAAE;IAC/D,IAAI,CAAC,UAAU;QAAE,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IACrD,OAAO,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IAC7B,UAAU,EAAE,UAAU;CACtB,CAAC,CAAC;AAOH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAmB,EAAE,CACtD,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;AAsBtE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CACzB,MAAkD,EACzC,EAAE;IACX,OAAO,MAAgB,CAAC;AACzB,CAAC,CAAC"}
|
package/dist/common/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export * from "./events/base-domain-event.js";
|
|
|
26
26
|
export * from "./events/domain-event.interface.js";
|
|
27
27
|
export * from "./events/system-error-event.js";
|
|
28
28
|
export * from "./events/system-warning-event.js";
|
|
29
|
+
export * from "./repositories/batch-command-repository.interface.js";
|
|
29
30
|
export * from "./services/entity-factory.js";
|
|
30
31
|
export * from "./services/id-generator.js";
|
|
31
32
|
export * from "./types/search-types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,cAAc,6BAA6B,CAAC;AAG5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,cAAc,6BAA6B,CAAC;AAG5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AAEjD,cAAc,sDAAsD,CAAC;AAErE,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAG3C,cAAc,yBAAyB,CAAC"}
|
package/dist/common/index.js
CHANGED
|
@@ -28,6 +28,8 @@ export * from "./events/base-domain-event.js";
|
|
|
28
28
|
export * from "./events/domain-event.interface.js";
|
|
29
29
|
export * from "./events/system-error-event.js";
|
|
30
30
|
export * from "./events/system-warning-event.js";
|
|
31
|
+
// Repositories
|
|
32
|
+
export * from "./repositories/batch-command-repository.interface.js";
|
|
31
33
|
// Services
|
|
32
34
|
export * from "./services/entity-factory.js";
|
|
33
35
|
export * from "./services/id-generator.js";
|
package/dist/common/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,WAAW;AACX,cAAc,6BAA6B,CAAC;AAE5C,SAAS;AACT,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,WAAW;AACX,cAAc,6BAA6B,CAAC;AAE5C,SAAS;AACT,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,eAAe;AACf,cAAc,sDAAsD,CAAC;AACrE,WAAW;AACX,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAE3C,QAAQ;AACR,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { ExportedAt, Status, UserId } from "../entities/common-entity.js";
|
|
2
|
+
/**
|
|
3
|
+
* Result of a bulk update operation.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Represents the number of records affected by a bulk operation.
|
|
7
|
+
* Used by batch domain services to report operation results.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const result = await repository.bulkUpdateStatus(params);
|
|
12
|
+
* console.log(`Updated ${result.count} records`);
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export type BulkUpdateResult = {
|
|
16
|
+
/** The number of records that were updated */
|
|
17
|
+
count: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Parameters for a status transition operation.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* Defines the criteria and target for bulk status updates.
|
|
24
|
+
* Used to transition multiple entities from one status to another.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const params: StatusTransitionParams = {
|
|
29
|
+
* userId: makeUserId("user-123"),
|
|
30
|
+
* fromStatus: "UNEXPORTED",
|
|
31
|
+
* toStatus: "LAST_UPDATED",
|
|
32
|
+
* };
|
|
33
|
+
*
|
|
34
|
+
* // For EXPORTED transitions, include exportedAt
|
|
35
|
+
* const exportParams: StatusTransitionParams = {
|
|
36
|
+
* userId: makeUserId("user-123"),
|
|
37
|
+
* fromStatus: "LAST_UPDATED",
|
|
38
|
+
* toStatus: "EXPORTED",
|
|
39
|
+
* exportedAt: makeExportedAt(),
|
|
40
|
+
* };
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export type StatusTransitionParams = {
|
|
44
|
+
/** The user ID for tenant isolation */
|
|
45
|
+
userId: UserId;
|
|
46
|
+
/** The current status of entities to update */
|
|
47
|
+
fromStatus: Status;
|
|
48
|
+
/** The target status to transition to */
|
|
49
|
+
toStatus: Status;
|
|
50
|
+
/** Timestamp for EXPORTED transitions (required when toStatus is "EXPORTED") */
|
|
51
|
+
exportedAt?: ExportedAt;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Interface for batch command operations on entities.
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* Provides bulk update capabilities while maintaining DDD principles.
|
|
58
|
+
* Domain services use this interface to perform batch operations.
|
|
59
|
+
*
|
|
60
|
+
* Implementations should:
|
|
61
|
+
* - Use efficient bulk operations (e.g., updateMany in Prisma)
|
|
62
|
+
* - Maintain transactional consistency
|
|
63
|
+
* - Support tenant isolation via userId
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* class PrismaArticlesBatchRepository implements IBatchCommandRepository {
|
|
68
|
+
* async bulkUpdateStatus(params: StatusTransitionParams): Promise<BulkUpdateResult> {
|
|
69
|
+
* const result = await prisma.article.updateMany({
|
|
70
|
+
* where: { userId: params.userId, status: params.fromStatus },
|
|
71
|
+
* data: {
|
|
72
|
+
* status: params.toStatus,
|
|
73
|
+
* ...(params.exportedAt && { exportedAt: params.exportedAt }),
|
|
74
|
+
* },
|
|
75
|
+
* });
|
|
76
|
+
* return { count: result.count };
|
|
77
|
+
* }
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* @see {@link StatusTransitionParams} for parameter details
|
|
82
|
+
* @see {@link BulkUpdateResult} for return type
|
|
83
|
+
*/
|
|
84
|
+
export type IBatchCommandRepository = {
|
|
85
|
+
/**
|
|
86
|
+
* Updates the status of all entities matching the criteria.
|
|
87
|
+
*
|
|
88
|
+
* @param params - The transition parameters
|
|
89
|
+
* @returns The number of records updated
|
|
90
|
+
*/
|
|
91
|
+
bulkUpdateStatus(params: StatusTransitionParams): Promise<BulkUpdateResult>;
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=batch-command-repository.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-command-repository.interface.d.ts","sourceRoot":"","sources":["../../../common/repositories/batch-command-repository.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAE/E;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACpC,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,gFAAgF;IAChF,UAAU,CAAC,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACrC;;;;;OAKG;IACH,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC5E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-command-repository.interface.js","sourceRoot":"","sources":["../../../common/repositories/batch-command-repository.interface.ts"],"names":[],"mappings":""}
|
|
@@ -15,7 +15,7 @@ import { UserId } from "../../common/entities/common-entity.js";
|
|
|
15
15
|
*
|
|
16
16
|
* @see {@link makePath} for factory function
|
|
17
17
|
*/
|
|
18
|
-
export declare const Path: z.z.core.$ZodBranded<z.ZodString, "Path">;
|
|
18
|
+
export declare const Path: z.z.core.$ZodBranded<z.ZodString, "Path", "out">;
|
|
19
19
|
/**
|
|
20
20
|
* Branded type for validated image paths.
|
|
21
21
|
*/
|
|
@@ -58,7 +58,7 @@ export declare const ContentType: z.z.core.$ZodBranded<z.ZodEnum<{
|
|
|
58
58
|
"image/gif": "image/gif";
|
|
59
59
|
jpeg: "jpeg";
|
|
60
60
|
png: "png";
|
|
61
|
-
}>, "ContentType">;
|
|
61
|
+
}>, "ContentType", "out">;
|
|
62
62
|
/**
|
|
63
63
|
* Branded type for validated content types.
|
|
64
64
|
*/
|
|
@@ -89,7 +89,7 @@ export declare const makeContentType: (v: string) => ContentType;
|
|
|
89
89
|
*
|
|
90
90
|
* @see {@link makeFileSize} for factory function
|
|
91
91
|
*/
|
|
92
|
-
export declare const FileSize: z.z.core.$ZodBranded<z.ZodNumber, "FileSize">;
|
|
92
|
+
export declare const FileSize: z.z.core.$ZodBranded<z.ZodNumber, "FileSize", "out">;
|
|
93
93
|
/**
|
|
94
94
|
* Branded type for validated file sizes.
|
|
95
95
|
*/
|
|
@@ -116,7 +116,7 @@ export declare const makeFileSize: (v: number) => FileSize;
|
|
|
116
116
|
*
|
|
117
117
|
* @see {@link makePixel} for factory function
|
|
118
118
|
*/
|
|
119
|
-
export declare const Pixel: z.z.core.$ZodBranded<z.ZodOptional<z.ZodNumber>, "Pixel">;
|
|
119
|
+
export declare const Pixel: z.z.core.$ZodBranded<z.ZodOptional<z.ZodNumber>, "Pixel", "out">;
|
|
120
120
|
/**
|
|
121
121
|
* Branded type for validated pixel dimensions.
|
|
122
122
|
*/
|
|
@@ -137,7 +137,7 @@ export declare const makePixel: (v: number) => Pixel;
|
|
|
137
137
|
*
|
|
138
138
|
* @see {@link makeTag} for factory function
|
|
139
139
|
*/
|
|
140
|
-
export declare const Tag: z.z.core.$ZodBranded<z.ZodString, "Tag">;
|
|
140
|
+
export declare const Tag: z.z.core.$ZodBranded<z.ZodString, "Tag", "out">;
|
|
141
141
|
/**
|
|
142
142
|
* Branded type for validated tags.
|
|
143
143
|
*/
|
|
@@ -158,7 +158,7 @@ export declare const makeTag: (v: string) => Tag;
|
|
|
158
158
|
*
|
|
159
159
|
* @see {@link makeDescription} for factory function
|
|
160
160
|
*/
|
|
161
|
-
export declare const Description: z.z.core.$ZodBranded<z.ZodOptional<z.ZodString>, "Description">;
|
|
161
|
+
export declare const Description: z.z.core.$ZodBranded<z.ZodOptional<z.ZodString>, "Description", "out">;
|
|
162
162
|
/**
|
|
163
163
|
* Branded type for validated descriptions.
|
|
164
164
|
*/
|
|
@@ -239,22 +239,22 @@ export declare const makeMetadata: (buffer: Buffer) => Promise<sharp.Metadata>;
|
|
|
239
239
|
* @see {@link ExportedImage} for the published state
|
|
240
240
|
*/
|
|
241
241
|
export declare const UnexportedImage: z.ZodObject<{
|
|
242
|
-
id: z.z.core.$ZodBranded<z.ZodDefault<z.ZodUUID>, "Id">;
|
|
243
|
-
userId: z.z.core.$ZodBranded<z.ZodString, "UserId">;
|
|
244
|
-
path: z.z.core.$ZodBranded<z.ZodString, "Path">;
|
|
242
|
+
id: z.z.core.$ZodBranded<z.ZodDefault<z.ZodUUID>, "Id", "out">;
|
|
243
|
+
userId: z.z.core.$ZodBranded<z.ZodString, "UserId", "out">;
|
|
244
|
+
path: z.z.core.$ZodBranded<z.ZodString, "Path", "out">;
|
|
245
245
|
contentType: z.z.core.$ZodBranded<z.ZodEnum<{
|
|
246
246
|
"image/jpeg": "image/jpeg";
|
|
247
247
|
"image/png": "image/png";
|
|
248
248
|
"image/gif": "image/gif";
|
|
249
249
|
jpeg: "jpeg";
|
|
250
250
|
png: "png";
|
|
251
|
-
}>, "ContentType">;
|
|
252
|
-
fileSize: z.z.core.$ZodBranded<z.ZodNumber, "FileSize">;
|
|
253
|
-
width: z.z.core.$ZodBranded<z.ZodOptional<z.ZodNumber>, "Pixel">;
|
|
254
|
-
height: z.z.core.$ZodBranded<z.ZodOptional<z.ZodNumber>, "Pixel">;
|
|
255
|
-
tags: z.ZodOptional<z.ZodArray<z.z.core.$ZodBranded<z.ZodString, "Tag">>>;
|
|
256
|
-
description: z.z.core.$ZodBranded<z.ZodOptional<z.ZodString>, "Description">;
|
|
257
|
-
createdAt: z.z.core.$ZodBranded<z.ZodDate, "CreatedAt">;
|
|
251
|
+
}>, "ContentType", "out">;
|
|
252
|
+
fileSize: z.z.core.$ZodBranded<z.ZodNumber, "FileSize", "out">;
|
|
253
|
+
width: z.z.core.$ZodBranded<z.ZodOptional<z.ZodNumber>, "Pixel", "out">;
|
|
254
|
+
height: z.z.core.$ZodBranded<z.ZodOptional<z.ZodNumber>, "Pixel", "out">;
|
|
255
|
+
tags: z.ZodOptional<z.ZodArray<z.z.core.$ZodBranded<z.ZodString, "Tag", "out">>>;
|
|
256
|
+
description: z.z.core.$ZodBranded<z.ZodOptional<z.ZodString>, "Description", "out">;
|
|
257
|
+
createdAt: z.z.core.$ZodBranded<z.ZodDate, "CreatedAt", "out">;
|
|
258
258
|
status: z.ZodLiteral<"UNEXPORTED">;
|
|
259
259
|
}, z.z.core.$strip>;
|
|
260
260
|
/**
|
|
@@ -274,24 +274,24 @@ export type UnexportedImage = Readonly<z.infer<typeof UnexportedImage>>;
|
|
|
274
274
|
* @see {@link UnexportedImage} for the initial state
|
|
275
275
|
*/
|
|
276
276
|
export declare const ExportedImage: z.ZodObject<{
|
|
277
|
-
id: z.z.core.$ZodBranded<z.ZodDefault<z.ZodUUID>, "Id">;
|
|
278
|
-
userId: z.z.core.$ZodBranded<z.ZodString, "UserId">;
|
|
279
|
-
path: z.z.core.$ZodBranded<z.ZodString, "Path">;
|
|
277
|
+
id: z.z.core.$ZodBranded<z.ZodDefault<z.ZodUUID>, "Id", "out">;
|
|
278
|
+
userId: z.z.core.$ZodBranded<z.ZodString, "UserId", "out">;
|
|
279
|
+
path: z.z.core.$ZodBranded<z.ZodString, "Path", "out">;
|
|
280
280
|
contentType: z.z.core.$ZodBranded<z.ZodEnum<{
|
|
281
281
|
"image/jpeg": "image/jpeg";
|
|
282
282
|
"image/png": "image/png";
|
|
283
283
|
"image/gif": "image/gif";
|
|
284
284
|
jpeg: "jpeg";
|
|
285
285
|
png: "png";
|
|
286
|
-
}>, "ContentType">;
|
|
287
|
-
fileSize: z.z.core.$ZodBranded<z.ZodNumber, "FileSize">;
|
|
288
|
-
width: z.z.core.$ZodBranded<z.ZodOptional<z.ZodNumber>, "Pixel">;
|
|
289
|
-
height: z.z.core.$ZodBranded<z.ZodOptional<z.ZodNumber>, "Pixel">;
|
|
290
|
-
tags: z.ZodOptional<z.ZodArray<z.z.core.$ZodBranded<z.ZodString, "Tag">>>;
|
|
291
|
-
description: z.z.core.$ZodBranded<z.ZodOptional<z.ZodString>, "Description">;
|
|
292
|
-
createdAt: z.z.core.$ZodBranded<z.ZodDate, "CreatedAt">;
|
|
286
|
+
}>, "ContentType", "out">;
|
|
287
|
+
fileSize: z.z.core.$ZodBranded<z.ZodNumber, "FileSize", "out">;
|
|
288
|
+
width: z.z.core.$ZodBranded<z.ZodOptional<z.ZodNumber>, "Pixel", "out">;
|
|
289
|
+
height: z.z.core.$ZodBranded<z.ZodOptional<z.ZodNumber>, "Pixel", "out">;
|
|
290
|
+
tags: z.ZodOptional<z.ZodArray<z.z.core.$ZodBranded<z.ZodString, "Tag", "out">>>;
|
|
291
|
+
description: z.z.core.$ZodBranded<z.ZodOptional<z.ZodString>, "Description", "out">;
|
|
292
|
+
createdAt: z.z.core.$ZodBranded<z.ZodDate, "CreatedAt", "out">;
|
|
293
293
|
status: z.ZodLiteral<"EXPORTED">;
|
|
294
|
-
exportedAt: z.z.core.$ZodBranded<z.ZodDate, "ExportedAt">;
|
|
294
|
+
exportedAt: z.z.core.$ZodBranded<z.ZodDate, "ExportedAt", "out">;
|
|
295
295
|
}, z.z.core.$strip>;
|
|
296
296
|
/**
|
|
297
297
|
* Type for an exported image entity.
|
|
@@ -300,43 +300,6 @@ export declare const ExportedImage: z.ZodObject<{
|
|
|
300
300
|
* Immutable entity representing a published image.
|
|
301
301
|
*/
|
|
302
302
|
export type ExportedImage = Readonly<z.infer<typeof ExportedImage>>;
|
|
303
|
-
/**
|
|
304
|
-
* Zod schema for an image marked for export in the current batch.
|
|
305
|
-
*
|
|
306
|
-
* @remarks
|
|
307
|
-
* Represents an image that has been marked for export but not yet finalized.
|
|
308
|
-
* This intermediate state allows for batch processing with revert capability.
|
|
309
|
-
*
|
|
310
|
-
* @see {@link UnexportedImage} for the initial state
|
|
311
|
-
* @see {@link ExportedImage} for the final state
|
|
312
|
-
*/
|
|
313
|
-
export declare const LastUpdatedImage: z.ZodObject<{
|
|
314
|
-
id: z.z.core.$ZodBranded<z.ZodDefault<z.ZodUUID>, "Id">;
|
|
315
|
-
userId: z.z.core.$ZodBranded<z.ZodString, "UserId">;
|
|
316
|
-
path: z.z.core.$ZodBranded<z.ZodString, "Path">;
|
|
317
|
-
contentType: z.z.core.$ZodBranded<z.ZodEnum<{
|
|
318
|
-
"image/jpeg": "image/jpeg";
|
|
319
|
-
"image/png": "image/png";
|
|
320
|
-
"image/gif": "image/gif";
|
|
321
|
-
jpeg: "jpeg";
|
|
322
|
-
png: "png";
|
|
323
|
-
}>, "ContentType">;
|
|
324
|
-
fileSize: z.z.core.$ZodBranded<z.ZodNumber, "FileSize">;
|
|
325
|
-
width: z.z.core.$ZodBranded<z.ZodOptional<z.ZodNumber>, "Pixel">;
|
|
326
|
-
height: z.z.core.$ZodBranded<z.ZodOptional<z.ZodNumber>, "Pixel">;
|
|
327
|
-
tags: z.ZodOptional<z.ZodArray<z.z.core.$ZodBranded<z.ZodString, "Tag">>>;
|
|
328
|
-
description: z.z.core.$ZodBranded<z.ZodOptional<z.ZodString>, "Description">;
|
|
329
|
-
createdAt: z.z.core.$ZodBranded<z.ZodDate, "CreatedAt">;
|
|
330
|
-
status: z.ZodLiteral<"LAST_UPDATED">;
|
|
331
|
-
}, z.z.core.$strip>;
|
|
332
|
-
/**
|
|
333
|
-
* Type for an image marked for export.
|
|
334
|
-
*
|
|
335
|
-
* @remarks
|
|
336
|
-
* Immutable entity representing an image in the current export batch.
|
|
337
|
-
* Can be reverted back to UnexportedImage or finalized to ExportedImage.
|
|
338
|
-
*/
|
|
339
|
-
export type LastUpdatedImage = Readonly<z.infer<typeof LastUpdatedImage>>;
|
|
340
303
|
/**
|
|
341
304
|
* Arguments for creating a new image.
|
|
342
305
|
*
|
|
@@ -416,42 +379,5 @@ export declare const imageEntity: {
|
|
|
416
379
|
* @throws {UnexpectedError} For unexpected errors during export
|
|
417
380
|
*/
|
|
418
381
|
export: (image: UnexportedImage) => ExportedImage;
|
|
419
|
-
/**
|
|
420
|
-
* Marks an image for export in the current batch.
|
|
421
|
-
*
|
|
422
|
-
* @remarks
|
|
423
|
-
* Transitions from UNEXPORTED to LAST_UPDATED status.
|
|
424
|
-
* This allows for batch processing with revert capability.
|
|
425
|
-
*
|
|
426
|
-
* @param image - The unexported image to mark
|
|
427
|
-
* @returns A frozen LastUpdatedImage
|
|
428
|
-
* @throws {InvalidFormatError} When the image state is invalid
|
|
429
|
-
* @throws {UnexpectedError} For unexpected errors
|
|
430
|
-
*/
|
|
431
|
-
markAsLastUpdated: (image: UnexportedImage) => LastUpdatedImage;
|
|
432
|
-
/**
|
|
433
|
-
* Reverts an image from LAST_UPDATED back to UNEXPORTED.
|
|
434
|
-
*
|
|
435
|
-
* @remarks
|
|
436
|
-
* Use this when batch processing fails and needs to be rolled back.
|
|
437
|
-
*
|
|
438
|
-
* @param image - The last updated image to revert
|
|
439
|
-
* @returns A frozen UnexportedImage
|
|
440
|
-
* @throws {InvalidFormatError} When the image state is invalid
|
|
441
|
-
* @throws {UnexpectedError} For unexpected errors
|
|
442
|
-
*/
|
|
443
|
-
revert: (image: LastUpdatedImage) => UnexportedImage;
|
|
444
|
-
/**
|
|
445
|
-
* Finalizes an image from LAST_UPDATED to EXPORTED.
|
|
446
|
-
*
|
|
447
|
-
* @remarks
|
|
448
|
-
* Use this after batch processing succeeds to confirm the export.
|
|
449
|
-
*
|
|
450
|
-
* @param image - The last updated image to finalize
|
|
451
|
-
* @returns A frozen ExportedImage with exportedAt timestamp
|
|
452
|
-
* @throws {InvalidFormatError} When the image state is invalid
|
|
453
|
-
* @throws {UnexpectedError} For unexpected errors
|
|
454
|
-
*/
|
|
455
|
-
finalize: (image: LastUpdatedImage) => ExportedImage;
|
|
456
382
|
};
|
|
457
383
|
//# sourceMappingURL=image-entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-entity.d.ts","sourceRoot":"","sources":["../../../images/entities/image-entity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,
|
|
1
|
+
{"version":3,"file":"image-entity.d.ts","sourceRoot":"","sources":["../../../images/entities/image-entity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAQN,MAAM,EACN,MAAM,wCAAwC,CAAC;AAkBhD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,IAAI,kDAAoC,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC;;;;;;;;;;;;;;;;;GAiBG;AACH,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AC;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,WAAW;IACvB;;;;;;;OAOG;mBACY,eAAe,KAAG,eAAe;IAWhD;;;;;;;OAOG;oBACa,eAAe,KAAG,aAAa;CAS/C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import sharp from "sharp";
|
|
2
2
|
import z from "zod";
|
|
3
|
-
import { CreatedAt, ExportedStatus, Id,
|
|
3
|
+
import { CreatedAt, ExportedStatus, Id, makeCreatedAt, makeExportedStatus, makeId, UnexportedStatus, UserId, } from "../../common/entities/common-entity.js";
|
|
4
4
|
import { createEntityWithErrorHandling } from "../../common/services/entity-factory.js";
|
|
5
5
|
import { idGenerator } from "../../common/services/id-generator.js";
|
|
6
6
|
/**
|
|
@@ -277,17 +277,6 @@ export const UnexportedImage = Base.extend({ status: UnexportedStatus });
|
|
|
277
277
|
* @see {@link UnexportedImage} for the initial state
|
|
278
278
|
*/
|
|
279
279
|
export const ExportedImage = Base.extend(ExportedStatus.shape);
|
|
280
|
-
/**
|
|
281
|
-
* Zod schema for an image marked for export in the current batch.
|
|
282
|
-
*
|
|
283
|
-
* @remarks
|
|
284
|
-
* Represents an image that has been marked for export but not yet finalized.
|
|
285
|
-
* This intermediate state allows for batch processing with revert capability.
|
|
286
|
-
*
|
|
287
|
-
* @see {@link UnexportedImage} for the initial state
|
|
288
|
-
* @see {@link ExportedImage} for the final state
|
|
289
|
-
*/
|
|
290
|
-
export const LastUpdatedImage = Base.extend({ status: LastUpdatedStatus });
|
|
291
280
|
/**
|
|
292
281
|
* Factory object for Image domain entity operations.
|
|
293
282
|
*
|
|
@@ -345,60 +334,5 @@ export const imageEntity = {
|
|
|
345
334
|
});
|
|
346
335
|
});
|
|
347
336
|
},
|
|
348
|
-
/**
|
|
349
|
-
* Marks an image for export in the current batch.
|
|
350
|
-
*
|
|
351
|
-
* @remarks
|
|
352
|
-
* Transitions from UNEXPORTED to LAST_UPDATED status.
|
|
353
|
-
* This allows for batch processing with revert capability.
|
|
354
|
-
*
|
|
355
|
-
* @param image - The unexported image to mark
|
|
356
|
-
* @returns A frozen LastUpdatedImage
|
|
357
|
-
* @throws {InvalidFormatError} When the image state is invalid
|
|
358
|
-
* @throws {UnexpectedError} For unexpected errors
|
|
359
|
-
*/
|
|
360
|
-
markAsLastUpdated: (image) => {
|
|
361
|
-
return createEntityWithErrorHandling(() => Object.freeze({
|
|
362
|
-
...image,
|
|
363
|
-
status: "LAST_UPDATED",
|
|
364
|
-
}));
|
|
365
|
-
},
|
|
366
|
-
/**
|
|
367
|
-
* Reverts an image from LAST_UPDATED back to UNEXPORTED.
|
|
368
|
-
*
|
|
369
|
-
* @remarks
|
|
370
|
-
* Use this when batch processing fails and needs to be rolled back.
|
|
371
|
-
*
|
|
372
|
-
* @param image - The last updated image to revert
|
|
373
|
-
* @returns A frozen UnexportedImage
|
|
374
|
-
* @throws {InvalidFormatError} When the image state is invalid
|
|
375
|
-
* @throws {UnexpectedError} For unexpected errors
|
|
376
|
-
*/
|
|
377
|
-
revert: (image) => {
|
|
378
|
-
return createEntityWithErrorHandling(() => Object.freeze({
|
|
379
|
-
...image,
|
|
380
|
-
status: "UNEXPORTED",
|
|
381
|
-
}));
|
|
382
|
-
},
|
|
383
|
-
/**
|
|
384
|
-
* Finalizes an image from LAST_UPDATED to EXPORTED.
|
|
385
|
-
*
|
|
386
|
-
* @remarks
|
|
387
|
-
* Use this after batch processing succeeds to confirm the export.
|
|
388
|
-
*
|
|
389
|
-
* @param image - The last updated image to finalize
|
|
390
|
-
* @returns A frozen ExportedImage with exportedAt timestamp
|
|
391
|
-
* @throws {InvalidFormatError} When the image state is invalid
|
|
392
|
-
* @throws {UnexpectedError} For unexpected errors
|
|
393
|
-
*/
|
|
394
|
-
finalize: (image) => {
|
|
395
|
-
return createEntityWithErrorHandling(() => {
|
|
396
|
-
const exportedStatus = makeExportedStatus();
|
|
397
|
-
return Object.freeze({
|
|
398
|
-
...image,
|
|
399
|
-
...exportedStatus,
|
|
400
|
-
});
|
|
401
|
-
});
|
|
402
|
-
},
|
|
403
337
|
};
|
|
404
338
|
//# sourceMappingURL=image-entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-entity.js","sourceRoot":"","sources":["../../../images/entities/image-entity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EACN,SAAS,EACT,cAAc,EACd,EAAE,EACF,
|
|
1
|
+
{"version":3,"file":"image-entity.js","sourceRoot":"","sources":["../../../images/entities/image-entity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EACN,SAAS,EACT,cAAc,EACd,EAAE,EACF,aAAa,EACb,kBAAkB,EAClB,MAAM,EACN,gBAAgB,EAChB,MAAM,GACN,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEpE;;;GAGG;AACH,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B;;;GAGG;AACH,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,gBAAgB;AAEhB;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,EAAU,CAAC;AAOtD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,iBAA0B,EAAQ,EAAE;IACvE,IAAI,iBAAiB,EAAE,CAAC;QACvB,MAAM,iBAAiB,GAAG,CAAC,CAAC,UAAU,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;QAC/D,MAAM,IAAI,GAA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AAO,MAAM,CAAC,MAAM,CAAC;gBACpB,GAAG,KAAK;gBACR,GAAG,cAAc;aACjB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;CACD,CAAC"}
|
package/dist/images/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export * from "./events/image-created-event.js";
|
|
|
38
38
|
export * from "./events/image-deleted-event.js";
|
|
39
39
|
export * from "./repositories/images-command-repository.interface.js";
|
|
40
40
|
export * from "./repositories/images-query-repository.interface.js";
|
|
41
|
+
export * from "./services/images-batch-domain-service.js";
|
|
41
42
|
export * from "./services/images-domain-service.js";
|
|
42
43
|
export * from "./types/cache-strategy.js";
|
|
43
44
|
export * from "./types/query-params.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../images/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,cAAc,4BAA4B,CAAC;AAG3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAGhD,cAAc,uDAAuD,CAAC;AACtE,cAAc,qDAAqD,CAAC;AAGpE,cAAc,qCAAqC,CAAC;AAGpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../images/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,cAAc,4BAA4B,CAAC;AAG3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAGhD,cAAc,uDAAuD,CAAC;AACtE,cAAc,qDAAqD,CAAC;AAGpE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qCAAqC,CAAC;AAGpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC"}
|
package/dist/images/index.js
CHANGED
|
@@ -42,6 +42,7 @@ export * from "./events/image-deleted-event.js";
|
|
|
42
42
|
export * from "./repositories/images-command-repository.interface.js";
|
|
43
43
|
export * from "./repositories/images-query-repository.interface.js";
|
|
44
44
|
// Services
|
|
45
|
+
export * from "./services/images-batch-domain-service.js";
|
|
45
46
|
export * from "./services/images-domain-service.js";
|
|
46
47
|
// Types
|
|
47
48
|
export * from "./types/cache-strategy.js";
|
package/dist/images/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../images/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,WAAW;AACX,cAAc,4BAA4B,CAAC;AAE3C,SAAS;AACT,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAEhD,eAAe;AACf,cAAc,uDAAuD,CAAC;AACtE,cAAc,qDAAqD,CAAC;AAEpE,WAAW;AACX,cAAc,qCAAqC,CAAC;AAEpD,QAAQ;AACR,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../images/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,WAAW;AACX,cAAc,4BAA4B,CAAC;AAE3C,SAAS;AACT,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAEhD,eAAe;AACf,cAAc,uDAAuD,CAAC;AACtE,cAAc,qDAAqD,CAAC;AAEpE,WAAW;AACX,cAAc,2CAA2C,CAAC;AAC1D,cAAc,qCAAqC,CAAC;AAEpD,QAAQ;AACR,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC"}
|
|
@@ -7,6 +7,9 @@ import type { Path, UnexportedImage } from "../entities/image-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 + MinIO).
|
|
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
|
|
@@ -23,6 +26,7 @@ import type { Path, UnexportedImage } from "../entities/image-entity.js";
|
|
|
23
26
|
* ```
|
|
24
27
|
*
|
|
25
28
|
* @see {@link IImagesQueryRepository} for read operations
|
|
29
|
+
* @see {@link IBatchCommandRepository} for batch operations
|
|
26
30
|
*/
|
|
27
31
|
export type IImagesCommandRepository = {
|
|
28
32
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"images-command-repository.interface.d.ts","sourceRoot":"","sources":["../../../images/repositories/images-command-repository.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEzE
|
|
1
|
+
{"version":3,"file":"images-command-repository.interface.d.ts","sourceRoot":"","sources":["../../../images/repositories/images-command-repository.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACtC;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C;;;;;;OAMG;IACH,eAAe,CACd,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,OAAO,GAClB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtE,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 Images.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* Encapsulates the business logic for batch status transitions.
|
|
15
|
+
* Manages the state machine for image lifecycle:
|
|
16
|
+
*
|
|
17
|
+
* ```
|
|
18
|
+
* UNEXPORTED --> LAST_UPDATED --> EXPORTED
|
|
19
|
+
* |
|
|
20
|
+
* v
|
|
21
|
+
* UNEXPORTED (revert)
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare class ImagesBatchDomainService {
|
|
25
|
+
private readonly commandRepository;
|
|
26
|
+
constructor(commandRepository: IBatchCommandRepository);
|
|
27
|
+
/**
|
|
28
|
+
* Resets images for a new batch export.
|
|
29
|
+
*/
|
|
30
|
+
resetImages(userId: UserId): Promise<ResetResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Reverts images from LAST_UPDATED back to UNEXPORTED.
|
|
33
|
+
*/
|
|
34
|
+
revertImages(userId: UserId): Promise<BulkUpdateResult>;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=images-batch-domain-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"images-batch-domain-service.d.ts","sourceRoot":"","sources":["../../../images/services/images-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,wBAAwB;IACxB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAAjB,iBAAiB,EAAE,uBAAuB;IAEvE;;OAEG;IACU,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAiB9D;;OAEG;IACU,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAOpE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { makeExportedAt, } from "../../common/entities/common-entity.js";
|
|
2
|
+
/**
|
|
3
|
+
* Domain service for batch operations on Images.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Encapsulates the business logic for batch status transitions.
|
|
7
|
+
* Manages the state machine for image lifecycle:
|
|
8
|
+
*
|
|
9
|
+
* ```
|
|
10
|
+
* UNEXPORTED --> LAST_UPDATED --> EXPORTED
|
|
11
|
+
* |
|
|
12
|
+
* v
|
|
13
|
+
* UNEXPORTED (revert)
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export class ImagesBatchDomainService {
|
|
17
|
+
commandRepository;
|
|
18
|
+
constructor(commandRepository) {
|
|
19
|
+
this.commandRepository = commandRepository;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Resets images for a new batch export.
|
|
23
|
+
*/
|
|
24
|
+
async resetImages(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 images from LAST_UPDATED back to UNEXPORTED.
|
|
40
|
+
*/
|
|
41
|
+
async revertImages(userId) {
|
|
42
|
+
return this.commandRepository.bulkUpdateStatus({
|
|
43
|
+
userId,
|
|
44
|
+
fromStatus: "LAST_UPDATED",
|
|
45
|
+
toStatus: "UNEXPORTED",
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=images-batch-domain-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"images-batch-domain-service.js","sourceRoot":"","sources":["../../../images/services/images-batch-domain-service.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,cAAc,GAEd,MAAM,wCAAwC,CAAC;AAchD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,wBAAwB;IACP;IAA7B,YAA6B,iBAA0C;QAA1C,sBAAiB,GAAjB,iBAAiB,CAAyB;IAAG,CAAC;IAE3E;;OAEG;IACI,KAAK,CAAC,WAAW,CAAC,MAAc;QACtC,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,YAAY,CAAC,MAAc;QACvC,OAAO,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC;YAC9C,MAAM;YACN,UAAU,EAAE,cAAc;YAC1B,QAAQ,EAAE,YAAY;SACtB,CAAC,CAAC;IACJ,CAAC;CACD"}
|