@purpleschool/gptbot-tools 0.2.62-stage2 → 0.2.63-stage2

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 (37) hide show
  1. package/build/photo-sessions/commands/admin/update-photo-session-style.command.d.ts +0 -1
  2. package/build/photo-sessions/commands/admin/update-photo-session-style.command.js +1 -11
  3. package/build/photo-sessions/commands/delete-all-photo-sessions-jobs.command.d.ts +1 -1
  4. package/build/photo-sessions/commands/delete-all-photo-sessions-jobs.command.js +6 -2
  5. package/build/photo-sessions/commands/get-photo-sessions-price.command.d.ts +46 -7
  6. package/build/photo-sessions/commands/get-photo-sessions-price.command.js +6 -7
  7. package/build/photo-sessions/commands/photo-sessions.command.d.ts +253 -95
  8. package/build/photo-sessions/commands/photo-sessions.command.js +14 -17
  9. package/build/photo-sessions/commands/retry-photo-sessions-job.command.d.ts +148 -24
  10. package/build/photo-sessions/commands/retry-photo-sessions-job.command.js +0 -3
  11. package/build/photo-sessions/commands/set-reaction-to-photo-sessions-job.command.d.ts +105 -17
  12. package/build/photo-sessions/commands/set-reaction-to-photo-sessions-job.command.js +1 -1
  13. package/build/photo-sessions/commands/update-photo-sessions-job-favorite.command.d.ts +104 -16
  14. package/build/photo-sessions/commands/update-photo-sessions-job-title.command.d.ts +204 -78
  15. package/build/photo-sessions/commands/update-photo-sessions-job-title.command.js +1 -1
  16. package/build/photo-sessions/commands/update-published-status-photo-sessions-jobs.command.d.ts +104 -16
  17. package/build/photo-sessions/enums/index.d.ts +1 -0
  18. package/build/photo-sessions/enums/index.js +1 -0
  19. package/build/photo-sessions/enums/photo-session-group-status.enum.d.ts +7 -0
  20. package/build/photo-sessions/enums/photo-session-group-status.enum.js +11 -0
  21. package/build/photo-sessions/models/index.d.ts +1 -0
  22. package/build/photo-sessions/models/index.js +1 -0
  23. package/build/photo-sessions/models/photo-session-group.schema.d.ts +116 -0
  24. package/build/photo-sessions/models/photo-session-group.schema.js +27 -0
  25. package/build/photo-sessions/models/photo-session-job.schema.d.ts +104 -13
  26. package/build/photo-sessions/models/photo-session-job.schema.js +16 -11
  27. package/build/photo-sessions/queries/find-photo-session-styles.query.d.ts +2 -2
  28. package/build/photo-sessions/queries/find-photo-session-styles.query.js +2 -2
  29. package/build/photo-sessions/queries/find-photo-sessions-job-by-id.query.d.ts +206 -78
  30. package/build/photo-sessions/queries/find-photo-sessions-job-by-id.query.js +10 -2
  31. package/build/photo-sessions/queries/find-photo-sessions-jobs.query.d.ts +210 -83
  32. package/build/photo-sessions/queries/find-photo-sessions-jobs.query.js +11 -6
  33. package/build/tools/events/tool-job-complete.event.d.ts +1 -0
  34. package/build/tools/events/tool-job-failed.event.d.ts +1 -0
  35. package/build/tools/models/tool-job.schema.d.ts +1 -0
  36. package/build/tools/models/tool-job.schema.js +1 -0
  37. package/package.json +1 -1
@@ -1,17 +1,18 @@
1
1
  import { z } from 'zod';
2
2
  import { JOB_SCOPE } from '../../common';
3
- import { JOB_SORT, JOB_STATUS } from '../../tools';
3
+ import { JOB_SORT } from '../../tools';
4
+ import { PHOTO_SESSION_GROUP_STATUS } from '../enums';
4
5
  export declare namespace FindPhotoSessionsJobsQuery {
5
6
  const RequestSchema: z.ZodObject<{
6
7
  userId: z.ZodOptional<z.ZodString>;
7
8
  unregisteredUserId: z.ZodOptional<z.ZodString>;
8
- scope: z.ZodDefault<z.ZodOptional<z.ZodEnum<typeof JOB_SCOPE>>>;
9
+ scope: z.ZodOptional<z.ZodEnum<typeof JOB_SCOPE>>;
9
10
  title: z.ZodOptional<z.ZodString>;
10
11
  isFavorite: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
11
- createdAtSortOrder: z.ZodDefault<z.ZodOptional<z.ZodEnum<typeof JOB_SORT>>>;
12
- status: z.ZodOptional<z.ZodEnum<typeof JOB_STATUS>>;
12
+ createdAtSortOrder: z.ZodOptional<z.ZodEnum<typeof JOB_SORT>>;
13
+ status: z.ZodOptional<z.ZodEnum<typeof PHOTO_SESSION_GROUP_STATUS>>;
13
14
  limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
14
- offset: z.ZodOptional<z.ZodDefault<z.ZodCoercedNumber<unknown>>>;
15
+ offset: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
15
16
  }, z.core.$strip>;
16
17
  type Request = z.infer<typeof RequestSchema>;
17
18
  const ResponseSchema: z.ZodObject<{
@@ -19,51 +20,114 @@ export declare namespace FindPhotoSessionsJobsQuery {
19
20
  data: z.ZodOptional<z.ZodType<{
20
21
  data: {
21
22
  uuid: string;
22
- prompt: string;
23
- reaction: import("../..").USER_REACTION | null;
24
- dislikeReason: string | null;
25
- externalId: string | null;
26
23
  title: string;
27
- status: JOB_STATUS;
24
+ prompt: string;
25
+ status: PHOTO_SESSION_GROUP_STATUS;
28
26
  error: string | null;
29
27
  modelId: string;
30
28
  price: number;
31
- previewUrl: string | null;
32
- params: {
33
- attachedFiles?: {
34
- uuid: string;
35
- url: string;
36
- name: string;
37
- mimeType: string;
38
- type: string;
39
- size: number;
40
- duration?: number | null | undefined;
41
- content?: string | null | undefined;
42
- contentLength?: number | null | undefined;
43
- }[] | undefined;
44
- imageUrls?: string[] | undefined;
45
- styleId?: string | null | undefined;
46
- referenceId?: string | null | undefined;
47
- referenceIds?: string[] | undefined;
48
- customStylePrompt?: string | null | undefined;
49
- customStylePhotos?: string[] | undefined;
50
- clothingPhotos?: string[] | undefined;
51
- hairstylePhotos?: string[] | undefined;
52
- accessoriesPhotos?: string[] | undefined;
53
- aspectRatio?: string | undefined;
54
- userHasActiveSubscriptionOrProduct?: boolean | undefined;
55
- };
56
- imageUrls: string[] | null;
57
- attempts: any[];
58
- userId?: string | null | undefined;
59
- unregisteredUserId?: string | null | undefined;
60
- isPublished: boolean;
61
- postId: string | null;
29
+ tokenReservationId: string | null;
30
+ params: unknown;
31
+ attempts: unknown[];
32
+ scope: JOB_SCOPE;
33
+ userId: string | null;
34
+ unregisteredUserId: string | null;
62
35
  isDeleted: boolean;
63
- isFavorite: boolean;
64
- tokenReservationId?: string | null | undefined;
36
+ subJobs: {
37
+ uuid: string;
38
+ prompt: string;
39
+ reaction: import("../..").USER_REACTION | null;
40
+ dislikeReason: string | null;
41
+ externalId: string | null;
42
+ title: string;
43
+ status: import("../..").JOB_STATUS;
44
+ error: string | null;
45
+ modelId: string;
46
+ groupId: string;
47
+ previewUrl: string | null;
48
+ params: {
49
+ attachedFiles?: {
50
+ uuid: string;
51
+ url: string;
52
+ name: string;
53
+ mimeType: string;
54
+ type: string;
55
+ size: number;
56
+ duration?: number | null | undefined;
57
+ content?: string | null | undefined;
58
+ contentLength?: number | null | undefined;
59
+ }[] | undefined;
60
+ imageUrls?: string[] | undefined;
61
+ referenceFile?: {
62
+ uuid: string;
63
+ url: string;
64
+ name: string;
65
+ mimeType: string;
66
+ type: string;
67
+ size: number;
68
+ duration?: number | null | undefined;
69
+ content?: string | null | undefined;
70
+ contentLength?: number | null | undefined;
71
+ } | undefined;
72
+ styleId?: string | null | undefined;
73
+ referenceId?: string | null | undefined;
74
+ referenceIds?: string[] | undefined;
75
+ clothingPhotos?: {
76
+ uuid: string;
77
+ url: string;
78
+ name: string;
79
+ mimeType: string;
80
+ type: string;
81
+ size: number;
82
+ duration?: number | null | undefined;
83
+ content?: string | null | undefined;
84
+ contentLength?: number | null | undefined;
85
+ }[] | undefined;
86
+ hairstylePhotos?: {
87
+ uuid: string;
88
+ url: string;
89
+ name: string;
90
+ mimeType: string;
91
+ type: string;
92
+ size: number;
93
+ duration?: number | null | undefined;
94
+ content?: string | null | undefined;
95
+ contentLength?: number | null | undefined;
96
+ }[] | undefined;
97
+ accessoriesPhotos?: {
98
+ uuid: string;
99
+ url: string;
100
+ name: string;
101
+ mimeType: string;
102
+ type: string;
103
+ size: number;
104
+ duration?: number | null | undefined;
105
+ content?: string | null | undefined;
106
+ contentLength?: number | null | undefined;
107
+ }[] | undefined;
108
+ aspectRatio?: string | undefined;
109
+ userHasActiveSubscriptionOrProduct?: boolean | undefined;
110
+ };
111
+ imageUrls: string[] | null;
112
+ attempts: {
113
+ order: number;
114
+ attemptId?: string | undefined;
115
+ status: import("../..").JOB_STATUS;
116
+ error: string | null;
117
+ timestamp: Date;
118
+ }[];
119
+ userId?: string | null | undefined;
120
+ unregisteredUserId?: string | null | undefined;
121
+ isPublished: boolean;
122
+ postId: string | null;
123
+ isDeleted: boolean;
124
+ isFavorite: boolean;
125
+ createdAt: Date;
126
+ completedAt?: Date | null | undefined;
127
+ updatedAt: Date;
128
+ }[];
65
129
  createdAt: Date;
66
- completedAt?: Date | null | undefined;
130
+ completedAt: Date | null;
67
131
  updatedAt: Date;
68
132
  }[];
69
133
  page: number;
@@ -72,51 +136,114 @@ export declare namespace FindPhotoSessionsJobsQuery {
72
136
  }, unknown, z.core.$ZodTypeInternals<{
73
137
  data: {
74
138
  uuid: string;
75
- prompt: string;
76
- reaction: import("../..").USER_REACTION | null;
77
- dislikeReason: string | null;
78
- externalId: string | null;
79
139
  title: string;
80
- status: JOB_STATUS;
140
+ prompt: string;
141
+ status: PHOTO_SESSION_GROUP_STATUS;
81
142
  error: string | null;
82
143
  modelId: string;
83
144
  price: number;
84
- previewUrl: string | null;
85
- params: {
86
- attachedFiles?: {
87
- uuid: string;
88
- url: string;
89
- name: string;
90
- mimeType: string;
91
- type: string;
92
- size: number;
93
- duration?: number | null | undefined;
94
- content?: string | null | undefined;
95
- contentLength?: number | null | undefined;
96
- }[] | undefined;
97
- imageUrls?: string[] | undefined;
98
- styleId?: string | null | undefined;
99
- referenceId?: string | null | undefined;
100
- referenceIds?: string[] | undefined;
101
- customStylePrompt?: string | null | undefined;
102
- customStylePhotos?: string[] | undefined;
103
- clothingPhotos?: string[] | undefined;
104
- hairstylePhotos?: string[] | undefined;
105
- accessoriesPhotos?: string[] | undefined;
106
- aspectRatio?: string | undefined;
107
- userHasActiveSubscriptionOrProduct?: boolean | undefined;
108
- };
109
- imageUrls: string[] | null;
110
- attempts: any[];
111
- userId?: string | null | undefined;
112
- unregisteredUserId?: string | null | undefined;
113
- isPublished: boolean;
114
- postId: string | null;
145
+ tokenReservationId: string | null;
146
+ params: unknown;
147
+ attempts: unknown[];
148
+ scope: JOB_SCOPE;
149
+ userId: string | null;
150
+ unregisteredUserId: string | null;
115
151
  isDeleted: boolean;
116
- isFavorite: boolean;
117
- tokenReservationId?: string | null | undefined;
152
+ subJobs: {
153
+ uuid: string;
154
+ prompt: string;
155
+ reaction: import("../..").USER_REACTION | null;
156
+ dislikeReason: string | null;
157
+ externalId: string | null;
158
+ title: string;
159
+ status: import("../..").JOB_STATUS;
160
+ error: string | null;
161
+ modelId: string;
162
+ groupId: string;
163
+ previewUrl: string | null;
164
+ params: {
165
+ attachedFiles?: {
166
+ uuid: string;
167
+ url: string;
168
+ name: string;
169
+ mimeType: string;
170
+ type: string;
171
+ size: number;
172
+ duration?: number | null | undefined;
173
+ content?: string | null | undefined;
174
+ contentLength?: number | null | undefined;
175
+ }[] | undefined;
176
+ imageUrls?: string[] | undefined;
177
+ referenceFile?: {
178
+ uuid: string;
179
+ url: string;
180
+ name: string;
181
+ mimeType: string;
182
+ type: string;
183
+ size: number;
184
+ duration?: number | null | undefined;
185
+ content?: string | null | undefined;
186
+ contentLength?: number | null | undefined;
187
+ } | undefined;
188
+ styleId?: string | null | undefined;
189
+ referenceId?: string | null | undefined;
190
+ referenceIds?: string[] | undefined;
191
+ clothingPhotos?: {
192
+ uuid: string;
193
+ url: string;
194
+ name: string;
195
+ mimeType: string;
196
+ type: string;
197
+ size: number;
198
+ duration?: number | null | undefined;
199
+ content?: string | null | undefined;
200
+ contentLength?: number | null | undefined;
201
+ }[] | undefined;
202
+ hairstylePhotos?: {
203
+ uuid: string;
204
+ url: string;
205
+ name: string;
206
+ mimeType: string;
207
+ type: string;
208
+ size: number;
209
+ duration?: number | null | undefined;
210
+ content?: string | null | undefined;
211
+ contentLength?: number | null | undefined;
212
+ }[] | undefined;
213
+ accessoriesPhotos?: {
214
+ uuid: string;
215
+ url: string;
216
+ name: string;
217
+ mimeType: string;
218
+ type: string;
219
+ size: number;
220
+ duration?: number | null | undefined;
221
+ content?: string | null | undefined;
222
+ contentLength?: number | null | undefined;
223
+ }[] | undefined;
224
+ aspectRatio?: string | undefined;
225
+ userHasActiveSubscriptionOrProduct?: boolean | undefined;
226
+ };
227
+ imageUrls: string[] | null;
228
+ attempts: {
229
+ order: number;
230
+ attemptId?: string | undefined;
231
+ status: import("../..").JOB_STATUS;
232
+ error: string | null;
233
+ timestamp: Date;
234
+ }[];
235
+ userId?: string | null | undefined;
236
+ unregisteredUserId?: string | null | undefined;
237
+ isPublished: boolean;
238
+ postId: string | null;
239
+ isDeleted: boolean;
240
+ isFavorite: boolean;
241
+ createdAt: Date;
242
+ completedAt?: Date | null | undefined;
243
+ updatedAt: Date;
244
+ }[];
118
245
  createdAt: Date;
119
- completedAt?: Date | null | undefined;
246
+ completedAt: Date | null;
120
247
  updatedAt: Date;
121
248
  }[];
122
249
  page: number;
@@ -6,21 +6,26 @@ const common_1 = require("../../common");
6
6
  const command_response_schema_1 = require("../../common/models/command-response.schema");
7
7
  const models_1 = require("../models");
8
8
  const tools_1 = require("../../tools");
9
+ const enums_1 = require("../enums");
9
10
  var FindPhotoSessionsJobsQuery;
10
11
  (function (FindPhotoSessionsJobsQuery) {
11
- FindPhotoSessionsJobsQuery.RequestSchema = zod_1.z.object({
12
+ FindPhotoSessionsJobsQuery.RequestSchema = zod_1.z
13
+ .object({
12
14
  userId: zod_1.z.string().uuid().optional(),
13
15
  unregisteredUserId: zod_1.z.string().uuid().optional(),
14
- scope: zod_1.z.nativeEnum(common_1.JOB_SCOPE).optional().default(common_1.JOB_SCOPE.TOOL),
16
+ scope: zod_1.z.nativeEnum(common_1.JOB_SCOPE).optional(),
15
17
  title: zod_1.z.string().optional(),
16
18
  isFavorite: zod_1.z.coerce.boolean().optional(),
17
- createdAtSortOrder: zod_1.z.nativeEnum(tools_1.JOB_SORT).optional().default(tools_1.JOB_SORT.DESC),
18
- status: zod_1.z.nativeEnum(tools_1.JOB_STATUS).optional(),
19
+ createdAtSortOrder: zod_1.z.nativeEnum(tools_1.JOB_SORT).optional(),
20
+ status: zod_1.z.nativeEnum(enums_1.PHOTO_SESSION_GROUP_STATUS).optional(),
19
21
  limit: zod_1.z.coerce.number().min(1).optional(),
20
- offset: zod_1.z.coerce.number().min(0).default(0).optional(),
22
+ offset: zod_1.z.coerce.number().min(0).optional(),
23
+ })
24
+ .refine((data) => Boolean(data.userId) !== Boolean(data.unregisteredUserId), {
25
+ message: 'Exactly one owner identity is required',
21
26
  });
22
27
  FindPhotoSessionsJobsQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(zod_1.z.object({
23
- data: zod_1.z.array(models_1.PhotoSessionJobSchema),
28
+ data: zod_1.z.array(models_1.PhotoSessionGroupSchema),
24
29
  page: zod_1.z.number(),
25
30
  totalPages: zod_1.z.number(),
26
31
  total: zod_1.z.number(),
@@ -9,6 +9,7 @@ export declare namespace ToolJobCompleteEvent {
9
9
  unregisteredUserId: z.ZodNullable<z.ZodString>;
10
10
  price: z.ZodNumber;
11
11
  tokenReservationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
+ idempotencyKey: z.ZodOptional<z.ZodString>;
12
13
  createdAt: z.ZodDate;
13
14
  updatedAt: z.ZodDate;
14
15
  toolType: z.ZodEnum<typeof TOOL_TYPE>;
@@ -8,6 +8,7 @@ export declare namespace ToolJobFailedEvent {
8
8
  unregisteredUserId: z.ZodNullable<z.ZodString>;
9
9
  price: z.ZodNumber;
10
10
  tokenReservationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
+ idempotencyKey: z.ZodOptional<z.ZodString>;
11
12
  createdAt: z.ZodDate;
12
13
  updatedAt: z.ZodDate;
13
14
  toolType: z.ZodEnum<typeof TOOL_TYPE>;
@@ -5,6 +5,7 @@ export declare const ToolJobSchema: z.ZodObject<{
5
5
  unregisteredUserId: z.ZodNullable<z.ZodString>;
6
6
  price: z.ZodNumber;
7
7
  tokenReservationId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
+ idempotencyKey: z.ZodOptional<z.ZodString>;
8
9
  createdAt: z.ZodDate;
9
10
  updatedAt: z.ZodDate;
10
11
  }, z.core.$strip>;
@@ -8,6 +8,7 @@ exports.ToolJobSchema = zod_1.z.object({
8
8
  unregisteredUserId: zod_1.z.string().nullable(),
9
9
  price: zod_1.z.number(),
10
10
  tokenReservationId: zod_1.z.string().nullable().optional(),
11
+ idempotencyKey: zod_1.z.string().optional(),
11
12
  createdAt: zod_1.z.date(),
12
13
  updatedAt: zod_1.z.date(),
13
14
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot-tools",
3
- "version": "0.2.62-stage2",
3
+ "version": "0.2.63-stage2",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "files": [