@purpleschool/gptbot-tools 0.0.118-stage-2 → 0.0.119-stage-2

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 (27) hide show
  1. package/build/image-editor/commands/update-published-status-image-editor-jobs.command.js +7 -1
  2. package/build/image-editor/models/image-editor-job.schema.js +1 -0
  3. package/build/image-generation/commands/execute-image-generation.command.js +1 -1
  4. package/build/image-generation/commands/update-published-status-image-generation-jobs.command.js +7 -1
  5. package/build/image-generation/models/image-generation-job.schema.js +1 -0
  6. package/build/image-generation/queries/find-image-generation-job-by-id.query.js +1 -5
  7. package/build/music/commands/update-published-status-music-jobs.command.js +7 -1
  8. package/build/music/models/music-job.schema.js +1 -0
  9. package/build/video/commands/update-published-status-video-jobs.command.js +7 -1
  10. package/build/video/models/video-job.schema.js +2 -0
  11. package/build/video-editor/commands/update-published-status-video-editor-jobs.command.js +7 -1
  12. package/build/video-editor/models/video-editor-job.schema.js +1 -0
  13. package/build/video-editor/queries/find-video-editor-job-by-id.query.js +1 -5
  14. package/image-editor/commands/update-published-status-image-editor-jobs.command.ts +9 -3
  15. package/image-editor/models/image-editor-job.schema.ts +1 -0
  16. package/image-generation/commands/execute-image-generation.command.ts +1 -1
  17. package/image-generation/commands/update-published-status-image-generation-jobs.command.ts +9 -3
  18. package/image-generation/models/image-generation-job.schema.ts +1 -0
  19. package/image-generation/queries/find-image-generation-job-by-id.query.ts +5 -9
  20. package/music/commands/update-published-status-music-jobs.command.ts +9 -3
  21. package/music/models/music-job.schema.ts +1 -0
  22. package/package.json +1 -1
  23. package/video/commands/update-published-status-video-jobs.command.ts +9 -3
  24. package/video/models/video-job.schema.ts +2 -0
  25. package/video-editor/commands/update-published-status-video-editor-jobs.command.ts +9 -3
  26. package/video-editor/models/video-editor-job.schema.ts +1 -0
  27. package/video-editor/queries/find-video-editor-job-by-id.query.ts +5 -9
@@ -12,8 +12,14 @@ var UpdatePublishedStatusImageEditorJobsCommand;
12
12
  userId: zod_1.z.string().uuid().nullable().optional(),
13
13
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
14
14
  }),
15
- data: zod_1.z.object({
15
+ data: zod_1.z
16
+ .object({
16
17
  isPublished: zod_1.z.boolean(),
18
+ postId: zod_1.z.string().nullable().optional(),
19
+ })
20
+ .refine((data) => (data.isPublished ? !!data.postId : true), {
21
+ message: 'Post ID is required when job is published',
22
+ path: ['postId'],
17
23
  }),
18
24
  });
19
25
  UpdatePublishedStatusImageEditorJobsCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageEditorJobSchema);
@@ -26,6 +26,7 @@ exports.ImageEditorJobSchema = zod_1.z.object({
26
26
  userId: zod_1.z.string().nullable().optional(),
27
27
  unregisteredUserId: zod_1.z.string().nullable().optional(),
28
28
  isPublished: zod_1.z.boolean(),
29
+ postId: zod_1.z.string().nullable(),
29
30
  isDeleted: zod_1.z.boolean(),
30
31
  tokenReservationId: zod_1.z.string().nullable().optional(),
31
32
  createdAt: zod_1.z.date(),
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ExecuteImageGenerationCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const command_response_schema_1 = require("../../common/models/command-response.schema");
6
- const models_1 = require("../models");
7
6
  const tools_1 = require("../../tools");
7
+ const models_1 = require("../models");
8
8
  var ExecuteImageGenerationCommand;
9
9
  (function (ExecuteImageGenerationCommand) {
10
10
  ExecuteImageGenerationCommand.RequestSchema = zod_1.z.object({
@@ -12,8 +12,14 @@ var UpdatePublishedStatusImageGenerationJobsCommand;
12
12
  userId: zod_1.z.string().uuid().nullable().optional(),
13
13
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
14
14
  }),
15
- data: zod_1.z.object({
15
+ data: zod_1.z
16
+ .object({
16
17
  isPublished: zod_1.z.boolean(),
18
+ postId: zod_1.z.string().nullable().optional(),
19
+ })
20
+ .refine((data) => (data.isPublished ? !!data.postId : true), {
21
+ message: 'Post ID is required when job is published',
22
+ path: ['postId'],
17
23
  }),
18
24
  });
19
25
  UpdatePublishedStatusImageGenerationJobsCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageGenerationJobSchema);
@@ -29,6 +29,7 @@ exports.ImageGenerationJobSchema = zod_1.z.object({
29
29
  userId: zod_1.z.string().nullable().optional(),
30
30
  unregisteredUserId: zod_1.z.string().nullable().optional(),
31
31
  isPublished: zod_1.z.boolean(),
32
+ postId: zod_1.z.string().nullable(),
32
33
  isDeleted: zod_1.z.boolean(),
33
34
  internalError: zod_1.z.string().nullable(),
34
35
  tokenReservationId: zod_1.z.string().nullable().optional(),
@@ -6,14 +6,10 @@ const command_response_schema_1 = require("../../common/models/command-response.
6
6
  const models_1 = require("../models");
7
7
  var FindImageGenerationJobByIdQuery;
8
8
  (function (FindImageGenerationJobByIdQuery) {
9
- FindImageGenerationJobByIdQuery.RequestSchema = zod_1.z
10
- .object({
9
+ FindImageGenerationJobByIdQuery.RequestSchema = zod_1.z.object({
11
10
  uuid: zod_1.z.string(),
12
11
  userId: zod_1.z.string().uuid().nullable().optional(),
13
12
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
14
- })
15
- .refine((data) => data.userId || data.unregisteredUserId, {
16
- message: 'Either userId or unregisteredUserId must be provided',
17
13
  });
18
14
  FindImageGenerationJobByIdQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageGenerationJobSchema);
19
15
  })(FindImageGenerationJobByIdQuery || (exports.FindImageGenerationJobByIdQuery = FindImageGenerationJobByIdQuery = {}));
@@ -12,8 +12,14 @@ var UpdatePublishedStatusMusicJobsCommand;
12
12
  userId: zod_1.z.string().uuid().nullable().optional(),
13
13
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
14
14
  }),
15
- data: zod_1.z.object({
15
+ data: zod_1.z
16
+ .object({
16
17
  isPublished: zod_1.z.boolean(),
18
+ postId: zod_1.z.string().nullable().optional(),
19
+ })
20
+ .refine((data) => (data.isPublished ? !!data.postId : true), {
21
+ message: 'Post ID is required when job is published',
22
+ path: ['postId'],
17
23
  }),
18
24
  });
19
25
  UpdatePublishedStatusMusicJobsCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.MusicJobSchema);
@@ -47,6 +47,7 @@ exports.MusicJobSchema = zod_1.z.object({
47
47
  userId: zod_1.z.string().nullable().optional(),
48
48
  unregisteredUserId: zod_1.z.string().nullable().optional(),
49
49
  isPublished: zod_1.z.boolean(),
50
+ postId: zod_1.z.string().nullable(),
50
51
  isDeleted: zod_1.z.boolean(),
51
52
  tokenReservationId: zod_1.z.string().nullable().optional(),
52
53
  createdAt: zod_1.z.date(),
@@ -12,8 +12,14 @@ var UpdatePublishedStatusVideoJobsCommand;
12
12
  userId: zod_1.z.string().uuid().nullable().optional(),
13
13
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
14
14
  }),
15
- data: zod_1.z.object({
15
+ data: zod_1.z
16
+ .object({
16
17
  isPublished: zod_1.z.boolean(),
18
+ postId: zod_1.z.string().nullable().optional(),
19
+ })
20
+ .refine((data) => (data.isPublished ? !!data.postId : true), {
21
+ message: 'Post ID is required when job is published',
22
+ path: ['postId'],
17
23
  }),
18
24
  });
19
25
  UpdatePublishedStatusVideoJobsCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.VideoJobSchema);
@@ -17,6 +17,8 @@ exports.VideoJobSchema = zod_1.z.object({
17
17
  uuid: zod_1.z.string(),
18
18
  prompt: zod_1.z.string(),
19
19
  reaction: zod_1.z.nativeEnum(common_1.USER_REACTION).nullable(),
20
+ isPublished: zod_1.z.boolean(),
21
+ postId: zod_1.z.string().nullable(),
20
22
  dislikeReason: zod_1.z.string().nullable(),
21
23
  externalId: zod_1.z.string().nullable(),
22
24
  title: zod_1.z.string(),
@@ -12,8 +12,14 @@ var UpdatePublishedStatusVideoEditorJobsCommand;
12
12
  userId: zod_1.z.string().uuid().nullable().optional(),
13
13
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
14
14
  }),
15
- data: zod_1.z.object({
15
+ data: zod_1.z
16
+ .object({
16
17
  isPublished: zod_1.z.boolean(),
18
+ postId: zod_1.z.string().nullable().optional(),
19
+ })
20
+ .refine((data) => (data.isPublished ? !!data.postId : true), {
21
+ message: 'Post ID is required when job is published',
22
+ path: ['postId'],
17
23
  }),
18
24
  });
19
25
  UpdatePublishedStatusVideoEditorJobsCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(video_editor_job_schema_1.VideoEditorJobSchema);
@@ -25,6 +25,7 @@ exports.VideoEditorJobSchema = zod_1.z.object({
25
25
  unregisteredUserId: zod_1.z.string().nullable().optional(),
26
26
  tokenReservationId: zod_1.z.string().nullable().optional(),
27
27
  isPublished: zod_1.z.boolean(),
28
+ postId: zod_1.z.string().nullable(),
28
29
  isDeleted: zod_1.z.boolean(),
29
30
  createdAt: zod_1.z.date(),
30
31
  completedAt: zod_1.z.date().nullable().optional(),
@@ -6,14 +6,10 @@ const command_response_schema_1 = require("../../common/models/command-response.
6
6
  const video_editor_job_schema_1 = require("../models/video-editor-job.schema");
7
7
  var FindVideoEditorJobByIdQuery;
8
8
  (function (FindVideoEditorJobByIdQuery) {
9
- FindVideoEditorJobByIdQuery.RequestSchema = zod_1.z
10
- .object({
9
+ FindVideoEditorJobByIdQuery.RequestSchema = zod_1.z.object({
11
10
  uuid: zod_1.z.string(),
12
11
  userId: zod_1.z.string().uuid().nullable().optional(),
13
12
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
14
- })
15
- .refine((data) => data.userId || data.unregisteredUserId, {
16
- message: 'Either userId or unregisteredUserId must be provided',
17
13
  });
18
14
  FindVideoEditorJobByIdQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(video_editor_job_schema_1.VideoEditorJobSchema);
19
15
  })(FindVideoEditorJobByIdQuery || (exports.FindVideoEditorJobByIdQuery = FindVideoEditorJobByIdQuery = {}));
@@ -9,9 +9,15 @@ export namespace UpdatePublishedStatusImageEditorJobsCommand {
9
9
  userId: z.string().uuid().nullable().optional(),
10
10
  unregisteredUserId: z.string().uuid().nullable().optional(),
11
11
  }),
12
- data: z.object({
13
- isPublished: z.boolean(),
14
- }),
12
+ data: z
13
+ .object({
14
+ isPublished: z.boolean(),
15
+ postId: z.string().nullable().optional(),
16
+ })
17
+ .refine((data) => (data.isPublished ? !!data.postId : true), {
18
+ message: 'Post ID is required when job is published',
19
+ path: ['postId'],
20
+ }),
15
21
  });
16
22
  export type Request = z.infer<typeof RequestSchema>;
17
23
 
@@ -27,6 +27,7 @@ export const ImageEditorJobSchema = z.object({
27
27
  userId: z.string().nullable().optional(),
28
28
  unregisteredUserId: z.string().nullable().optional(),
29
29
  isPublished: z.boolean(),
30
+ postId: z.string().nullable(),
30
31
  isDeleted: z.boolean(),
31
32
  tokenReservationId: z.string().nullable().optional(),
32
33
  createdAt: z.date(),
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
- import { ImageGenerationJobSchema, ImageGenerationRequestParamsSchema } from '../models';
4
3
  import { JOB_REQUEST_ORIGIN } from '../../tools';
4
+ import { ImageGenerationJobSchema, ImageGenerationRequestParamsSchema } from '../models';
5
5
 
6
6
  export namespace ExecuteImageGenerationCommand {
7
7
  export const RequestSchema = z.object({
@@ -9,9 +9,15 @@ export namespace UpdatePublishedStatusImageGenerationJobsCommand {
9
9
  userId: z.string().uuid().nullable().optional(),
10
10
  unregisteredUserId: z.string().uuid().nullable().optional(),
11
11
  }),
12
- data: z.object({
13
- isPublished: z.boolean(),
14
- }),
12
+ data: z
13
+ .object({
14
+ isPublished: z.boolean(),
15
+ postId: z.string().nullable().optional(),
16
+ })
17
+ .refine((data) => (data.isPublished ? !!data.postId : true), {
18
+ message: 'Post ID is required when job is published',
19
+ path: ['postId'],
20
+ }),
15
21
  });
16
22
  export type Request = z.infer<typeof RequestSchema>;
17
23
 
@@ -29,6 +29,7 @@ export const ImageGenerationJobSchema = z.object({
29
29
  userId: z.string().nullable().optional(),
30
30
  unregisteredUserId: z.string().nullable().optional(),
31
31
  isPublished: z.boolean(),
32
+ postId: z.string().nullable(),
32
33
  isDeleted: z.boolean(),
33
34
  internalError: z.string().nullable(),
34
35
  tokenReservationId: z.string().nullable().optional(),
@@ -3,15 +3,11 @@ import { ICommandResponseSchema } from '../../common/models/command-response.sch
3
3
  import { ImageGenerationJobSchema } from '../models';
4
4
 
5
5
  export namespace FindImageGenerationJobByIdQuery {
6
- export const RequestSchema = z
7
- .object({
8
- uuid: z.string(),
9
- userId: z.string().uuid().nullable().optional(),
10
- unregisteredUserId: z.string().uuid().nullable().optional(),
11
- })
12
- .refine((data) => data.userId || data.unregisteredUserId, {
13
- message: 'Either userId or unregisteredUserId must be provided',
14
- });
6
+ export const RequestSchema = z.object({
7
+ uuid: z.string(),
8
+ userId: z.string().uuid().nullable().optional(),
9
+ unregisteredUserId: z.string().uuid().nullable().optional(),
10
+ });
15
11
  export type Request = z.infer<typeof RequestSchema>;
16
12
 
17
13
  export const ResponseSchema = ICommandResponseSchema(ImageGenerationJobSchema);
@@ -9,9 +9,15 @@ export namespace UpdatePublishedStatusMusicJobsCommand {
9
9
  userId: z.string().uuid().nullable().optional(),
10
10
  unregisteredUserId: z.string().uuid().nullable().optional(),
11
11
  }),
12
- data: z.object({
13
- isPublished: z.boolean(),
14
- }),
12
+ data: z
13
+ .object({
14
+ isPublished: z.boolean(),
15
+ postId: z.string().nullable().optional(),
16
+ })
17
+ .refine((data) => (data.isPublished ? !!data.postId : true), {
18
+ message: 'Post ID is required when job is published',
19
+ path: ['postId'],
20
+ }),
15
21
  });
16
22
  export type Request = z.infer<typeof RequestSchema>;
17
23
 
@@ -48,6 +48,7 @@ export const MusicJobSchema = z.object({
48
48
  userId: z.string().nullable().optional(),
49
49
  unregisteredUserId: z.string().nullable().optional(),
50
50
  isPublished: z.boolean(),
51
+ postId: z.string().nullable(),
51
52
  isDeleted: z.boolean(),
52
53
  tokenReservationId: z.string().nullable().optional(),
53
54
  createdAt: z.date(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot-tools",
3
- "version": "0.0.118-stage-2",
3
+ "version": "0.0.119-stage-2",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "scripts": {
@@ -9,9 +9,15 @@ export namespace UpdatePublishedStatusVideoJobsCommand {
9
9
  userId: z.string().uuid().nullable().optional(),
10
10
  unregisteredUserId: z.string().uuid().nullable().optional(),
11
11
  }),
12
- data: z.object({
13
- isPublished: z.boolean(),
14
- }),
12
+ data: z
13
+ .object({
14
+ isPublished: z.boolean(),
15
+ postId: z.string().nullable().optional(),
16
+ })
17
+ .refine((data) => (data.isPublished ? !!data.postId : true), {
18
+ message: 'Post ID is required when job is published',
19
+ path: ['postId'],
20
+ }),
15
21
  });
16
22
  export type Request = z.infer<typeof RequestSchema>;
17
23
 
@@ -18,6 +18,8 @@ export const VideoJobSchema = z.object({
18
18
  uuid: z.string(),
19
19
  prompt: z.string(),
20
20
  reaction: z.nativeEnum(USER_REACTION).nullable(),
21
+ isPublished: z.boolean(),
22
+ postId: z.string().nullable(),
21
23
  dislikeReason: z.string().nullable(),
22
24
  externalId: z.string().nullable(),
23
25
  title: z.string(),
@@ -9,9 +9,15 @@ export namespace UpdatePublishedStatusVideoEditorJobsCommand {
9
9
  userId: z.string().uuid().nullable().optional(),
10
10
  unregisteredUserId: z.string().uuid().nullable().optional(),
11
11
  }),
12
- data: z.object({
13
- isPublished: z.boolean(),
14
- }),
12
+ data: z
13
+ .object({
14
+ isPublished: z.boolean(),
15
+ postId: z.string().nullable().optional(),
16
+ })
17
+ .refine((data) => (data.isPublished ? !!data.postId : true), {
18
+ message: 'Post ID is required when job is published',
19
+ path: ['postId'],
20
+ }),
15
21
  });
16
22
  export type Request = z.infer<typeof RequestSchema>;
17
23
 
@@ -23,6 +23,7 @@ export const VideoEditorJobSchema = z.object({
23
23
  unregisteredUserId: z.string().nullable().optional(),
24
24
  tokenReservationId: z.string().nullable().optional(),
25
25
  isPublished: z.boolean(),
26
+ postId: z.string().nullable(),
26
27
  isDeleted: z.boolean(),
27
28
  createdAt: z.date(),
28
29
  completedAt: z.date().nullable().optional(),
@@ -3,15 +3,11 @@ import { ICommandResponseSchema } from '../../common/models/command-response.sch
3
3
  import { VideoEditorJobSchema } from '../models/video-editor-job.schema';
4
4
 
5
5
  export namespace FindVideoEditorJobByIdQuery {
6
- export const RequestSchema = z
7
- .object({
8
- uuid: z.string(),
9
- userId: z.string().uuid().nullable().optional(),
10
- unregisteredUserId: z.string().uuid().nullable().optional(),
11
- })
12
- .refine((data) => data.userId || data.unregisteredUserId, {
13
- message: 'Either userId or unregisteredUserId must be provided',
14
- });
6
+ export const RequestSchema = z.object({
7
+ uuid: z.string(),
8
+ userId: z.string().uuid().nullable().optional(),
9
+ unregisteredUserId: z.string().uuid().nullable().optional(),
10
+ });
15
11
  export type Request = z.infer<typeof RequestSchema>;
16
12
 
17
13
  export const ResponseSchema = ICommandResponseSchema(VideoEditorJobSchema);