@purpleschool/gptbot-tools 0.2.49 → 0.2.50-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.
- package/ai-proxy/routes/ai-proxy.routes.ts +1 -0
- package/build/ai-proxy/routes/ai-proxy.routes.js +1 -0
- package/build/index.js +3 -0
- package/build/photo-sessions/commands/admin/create-photo-session-style.command.js +21 -0
- package/build/photo-sessions/commands/admin/delete-photo-session-style.command.js +12 -0
- package/build/photo-sessions/commands/admin/index.js +19 -0
- package/build/photo-sessions/commands/admin/update-photo-session-style.command.js +28 -0
- package/build/photo-sessions/commands/delete-all-photo-sessions-jobs.command.js +15 -0
- package/build/photo-sessions/commands/delete-photo-sessions-job-by-uuid.command.js +14 -0
- package/build/photo-sessions/commands/get-photo-sessions-price.command.js +30 -0
- package/build/photo-sessions/commands/index.js +26 -0
- package/build/photo-sessions/commands/photo-sessions.command.js +41 -0
- package/build/photo-sessions/commands/retry-photo-sessions-job.command.js +23 -0
- package/build/photo-sessions/commands/set-reaction-to-photo-sessions-job.command.js +27 -0
- package/build/photo-sessions/commands/update-photo-sessions-job-favorite.command.js +16 -0
- package/build/photo-sessions/commands/update-photo-sessions-job-title.command.js +16 -0
- package/build/photo-sessions/commands/update-published-status-photo-sessions-jobs.command.js +26 -0
- package/build/photo-sessions/enums/index.js +18 -0
- package/build/photo-sessions/enums/photo-session-look-type.enum.js +9 -0
- package/build/photo-sessions/enums/photo-session-strategy.enum.js +8 -0
- package/build/photo-sessions/index.js +21 -0
- package/build/photo-sessions/models/index.js +20 -0
- package/build/photo-sessions/models/photo-session-config.schema.js +16 -0
- package/build/photo-sessions/models/photo-session-job.schema.js +46 -0
- package/build/photo-sessions/models/photo-session-model.schema.js +42 -0
- package/build/photo-sessions/models/photo-session-style.schema.js +22 -0
- package/build/photo-sessions/queries/find-photo-session-style-by-id.query.js +10 -0
- package/build/photo-sessions/queries/find-photo-session-styles.query.js +19 -0
- package/build/photo-sessions/queries/find-photo-sessions-job-by-id.query.js +10 -0
- package/build/photo-sessions/queries/find-photo-sessions-jobs.query.js +28 -0
- package/build/photo-sessions/queries/get-photo-sessions-config.query.js +10 -0
- package/build/photo-sessions/queries/index.js +21 -0
- package/build/photo-sessions/routes/index.js +18 -0
- package/build/photo-sessions/routes/photo-sessions.amqp.routes.js +22 -0
- package/build/photo-sessions/routes/photo-sessions.http.routes.js +4 -0
- package/build/tools/enums/tool-content-type.enum.js +1 -0
- package/build/tools/enums/tool-type.enum.js +1 -0
- package/build/tools/models/global-tools-config.schema.js +2 -0
- package/index.ts +3 -0
- package/package.json +2 -2
- package/photo-sessions/commands/admin/create-photo-session-style.command.ts +22 -0
- package/photo-sessions/commands/admin/delete-photo-session-style.command.ts +12 -0
- package/photo-sessions/commands/admin/index.ts +3 -0
- package/photo-sessions/commands/admin/update-photo-session-style.command.ts +34 -0
- package/photo-sessions/commands/delete-all-photo-sessions-jobs.command.ts +15 -0
- package/photo-sessions/commands/delete-photo-sessions-job-by-uuid.command.ts +14 -0
- package/photo-sessions/commands/get-photo-sessions-price.command.ts +32 -0
- package/photo-sessions/commands/index.ts +10 -0
- package/photo-sessions/commands/photo-sessions.command.ts +41 -0
- package/photo-sessions/commands/retry-photo-sessions-job.command.ts +23 -0
- package/photo-sessions/commands/set-reaction-to-photo-sessions-job.command.ts +30 -0
- package/photo-sessions/commands/update-photo-sessions-job-favorite.command.ts +16 -0
- package/photo-sessions/commands/update-photo-sessions-job-title.command.ts +16 -0
- package/photo-sessions/commands/update-published-status-photo-sessions-jobs.command.ts +26 -0
- package/photo-sessions/enums/index.ts +2 -0
- package/photo-sessions/enums/photo-session-look-type.enum.ts +5 -0
- package/photo-sessions/enums/photo-session-strategy.enum.ts +4 -0
- package/photo-sessions/index.ts +5 -0
- package/photo-sessions/models/index.ts +4 -0
- package/photo-sessions/models/photo-session-config.schema.ts +17 -0
- package/photo-sessions/models/photo-session-job.schema.ts +49 -0
- package/photo-sessions/models/photo-session-model.schema.ts +56 -0
- package/photo-sessions/models/photo-session-style.schema.ts +25 -0
- package/photo-sessions/queries/find-photo-session-style-by-id.query.ts +11 -0
- package/photo-sessions/queries/find-photo-session-styles.query.ts +21 -0
- package/photo-sessions/queries/find-photo-sessions-job-by-id.query.ts +11 -0
- package/photo-sessions/queries/find-photo-sessions-jobs.query.ts +30 -0
- package/photo-sessions/queries/get-photo-sessions-config.query.ts +11 -0
- package/photo-sessions/queries/index.ts +5 -0
- package/photo-sessions/routes/index.ts +2 -0
- package/photo-sessions/routes/photo-sessions.amqp.routes.ts +19 -0
- package/photo-sessions/routes/photo-sessions.http.routes.ts +1 -0
- package/tools/enums/tool-content-type.enum.ts +1 -0
- package/tools/enums/tool-type.enum.ts +1 -0
- package/tools/models/global-tools-config.schema.ts +2 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { TOOL_MODEL_STATUS, IconVariantsSchema } from '../../common';
|
|
3
|
+
import { PHOTO_SESSION_STRATEGY } from '../enums';
|
|
4
|
+
|
|
5
|
+
export const PhotoSessionModelParamsSchema = z.object({
|
|
6
|
+
imageAttachment: z.object({
|
|
7
|
+
supported: z.boolean(),
|
|
8
|
+
maxImages: z.number(),
|
|
9
|
+
acceptedTypes: z.array(z.string()),
|
|
10
|
+
}),
|
|
11
|
+
aspectRatio: z.record(
|
|
12
|
+
z.string(),
|
|
13
|
+
z.object({
|
|
14
|
+
width: z.number(),
|
|
15
|
+
height: z.number(),
|
|
16
|
+
}),
|
|
17
|
+
),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export type PhotoSessionModelParams = z.infer<typeof PhotoSessionModelParamsSchema>;
|
|
21
|
+
|
|
22
|
+
export const PhotoSessionModelPricingRuleConditionSchema = z.object({
|
|
23
|
+
withoutSub: z.boolean().optional(),
|
|
24
|
+
});
|
|
25
|
+
export type PhotoSessionModelPricingRuleCondition = z.infer<
|
|
26
|
+
typeof PhotoSessionModelPricingRuleConditionSchema
|
|
27
|
+
>;
|
|
28
|
+
|
|
29
|
+
export const PhotoSessionModelPricingRulesSchema = z.array(
|
|
30
|
+
z.object({
|
|
31
|
+
condition: PhotoSessionModelPricingRuleConditionSchema,
|
|
32
|
+
value: z.number(),
|
|
33
|
+
}),
|
|
34
|
+
);
|
|
35
|
+
export type PhotoSessionModelPricingRules = z.infer<typeof PhotoSessionModelPricingRulesSchema>;
|
|
36
|
+
|
|
37
|
+
export const PhotoSessionModelSchema = z.object({
|
|
38
|
+
uuid: z.string(),
|
|
39
|
+
title: z.string(),
|
|
40
|
+
description: z.string(),
|
|
41
|
+
aiModel: z.string(),
|
|
42
|
+
isNew: z.boolean(),
|
|
43
|
+
tierLabel: z.string(),
|
|
44
|
+
pricePerImage: z.number(),
|
|
45
|
+
order: z.number(),
|
|
46
|
+
status: z.nativeEnum(TOOL_MODEL_STATUS),
|
|
47
|
+
icons: IconVariantsSchema,
|
|
48
|
+
strategy: z.nativeEnum(PHOTO_SESSION_STRATEGY),
|
|
49
|
+
maxInputLength: z.number(),
|
|
50
|
+
params: PhotoSessionModelParamsSchema,
|
|
51
|
+
pricingRules: PhotoSessionModelPricingRulesSchema,
|
|
52
|
+
createdAt: z.date(),
|
|
53
|
+
updatedAt: z.date(),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export type PhotoSessionModel = z.infer<typeof PhotoSessionModelSchema>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const PhotoSessionStyleReferenceSchema = z.object({
|
|
4
|
+
uuid: z.string().uuid(),
|
|
5
|
+
styleId: z.string().uuid(),
|
|
6
|
+
photoUrl: z.string(),
|
|
7
|
+
description: z.string().nullable().optional(),
|
|
8
|
+
order: z.number().int().min(0).max(5),
|
|
9
|
+
createdAt: z.date(),
|
|
10
|
+
updatedAt: z.date(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export type PhotoSessionStyleReference = z.infer<typeof PhotoSessionStyleReferenceSchema>;
|
|
14
|
+
|
|
15
|
+
export const PhotoSessionStyleSchema = z.object({
|
|
16
|
+
uuid: z.string().uuid(),
|
|
17
|
+
code: z.string(),
|
|
18
|
+
title: z.string(),
|
|
19
|
+
description: z.string().nullable().optional(),
|
|
20
|
+
references: z.array(PhotoSessionStyleReferenceSchema),
|
|
21
|
+
createdAt: z.date(),
|
|
22
|
+
updatedAt: z.date(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export type PhotoSessionStyle = z.infer<typeof PhotoSessionStyleSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { PhotoSessionStyleSchema } from '../models';
|
|
4
|
+
|
|
5
|
+
export namespace FindPhotoSessionStyleByIdQuery {
|
|
6
|
+
export const RequestSchema = PhotoSessionStyleSchema.pick({ uuid: true });
|
|
7
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = ICommandResponseSchema(PhotoSessionStyleSchema);
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { PhotoSessionStyleSchema } from '../models';
|
|
4
|
+
|
|
5
|
+
export namespace FindPhotoSessionStylesQuery {
|
|
6
|
+
export const RequestSchema = z.object({
|
|
7
|
+
limit: z.coerce.number().min(1).max(48).optional().default(24),
|
|
8
|
+
offset: z.coerce.number().min(0).optional().default(0),
|
|
9
|
+
});
|
|
10
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseSchema = ICommandResponseSchema(
|
|
13
|
+
z.object({
|
|
14
|
+
data: z.array(PhotoSessionStyleSchema),
|
|
15
|
+
page: z.number(),
|
|
16
|
+
totalPages: z.number(),
|
|
17
|
+
total: z.number(),
|
|
18
|
+
}),
|
|
19
|
+
);
|
|
20
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { PhotoSessionJobSchema } from '../models';
|
|
4
|
+
|
|
5
|
+
export namespace FindPhotoSessionsJobByIdQuery {
|
|
6
|
+
export const RequestSchema = PhotoSessionJobSchema.pick({ uuid: true });
|
|
7
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = ICommandResponseSchema(PhotoSessionJobSchema);
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { JOB_SCOPE } from '../../common';
|
|
3
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
4
|
+
import { PhotoSessionJobSchema } from '../models';
|
|
5
|
+
import { JOB_SORT, JOB_STATUS } from '../../tools';
|
|
6
|
+
|
|
7
|
+
export namespace FindPhotoSessionsJobsQuery {
|
|
8
|
+
export const RequestSchema = z.object({
|
|
9
|
+
userId: z.string().uuid().optional(),
|
|
10
|
+
unregisteredUserId: z.string().uuid().optional(),
|
|
11
|
+
scope: z.nativeEnum(JOB_SCOPE).optional().default(JOB_SCOPE.TOOL),
|
|
12
|
+
title: z.string().optional(),
|
|
13
|
+
isFavorite: z.coerce.boolean().optional(),
|
|
14
|
+
createdAtSortOrder: z.nativeEnum(JOB_SORT).optional().default(JOB_SORT.DESC),
|
|
15
|
+
status: z.nativeEnum(JOB_STATUS).optional(),
|
|
16
|
+
limit: z.coerce.number().min(1).optional(),
|
|
17
|
+
offset: z.coerce.number().min(0).default(0).optional(),
|
|
18
|
+
});
|
|
19
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
20
|
+
|
|
21
|
+
export const ResponseSchema = ICommandResponseSchema(
|
|
22
|
+
z.object({
|
|
23
|
+
data: z.array(PhotoSessionJobSchema),
|
|
24
|
+
page: z.number(),
|
|
25
|
+
totalPages: z.number(),
|
|
26
|
+
total: z.number(),
|
|
27
|
+
}),
|
|
28
|
+
);
|
|
29
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
|
|
3
|
+
import { PhotoSessionConfigSchema } from '../models';
|
|
4
|
+
|
|
5
|
+
export namespace GetPhotoSessionsConfigQuery {
|
|
6
|
+
export const RequestSchema = LocaleRequestSchema;
|
|
7
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = ICommandResponseSchema(PhotoSessionConfigSchema);
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const PHOTO_SESSIONS_AMQP_ROUTES = {
|
|
2
|
+
EXECUTE: 'tools.photo-sessions.execute.rpc',
|
|
3
|
+
GET_PRICE: 'tools.photo-sessions.get-price.rpc',
|
|
4
|
+
CONFIG: 'tools.photo-sessions.config.rpc',
|
|
5
|
+
GET_JOB: 'tools.photo-sessions.jobs.get.rpc',
|
|
6
|
+
LIST_JOBS: 'tools.photo-sessions.jobs.list.rpc',
|
|
7
|
+
SET_REACTION: 'tools.photo-sessions.jobs.set-reaction.rpc',
|
|
8
|
+
UPDATE_TITLE: 'tools.photo-sessions.jobs.update-title.rpc',
|
|
9
|
+
UPDATE_FAVORITE: 'tools.photo-sessions.jobs.update-favorite.rpc',
|
|
10
|
+
SOFT_DELETE: 'tools.photo-sessions.jobs.soft-delete.rpc',
|
|
11
|
+
SOFT_DELETE_ALL: 'tools.photo-sessions.jobs.soft-delete-all.rpc',
|
|
12
|
+
RETRY: 'tools.photo-sessions.jobs.retry.rpc',
|
|
13
|
+
UPDATE_JOB: 'tools.photo-sessions.jobs.update.rpc',
|
|
14
|
+
LIST_STYLES: 'tools.photo-sessions.styles.list.rpc',
|
|
15
|
+
GET_STYLE: 'tools.photo-sessions.styles.get.rpc',
|
|
16
|
+
CREATE_STYLE: 'tools.photo-sessions.styles.create.rpc',
|
|
17
|
+
UPDATE_STYLE: 'tools.photo-sessions.styles.update.rpc',
|
|
18
|
+
DELETE_STYLE: 'tools.photo-sessions.styles.delete.rpc',
|
|
19
|
+
} as const;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const PHOTO_SESSIONS_CONTROLLER = 'photo-sessions';
|
|
@@ -16,6 +16,7 @@ import { SolvingEduTaskConfigSchema } from '../../solving-edu-task';
|
|
|
16
16
|
import { SpellCorrectorToolConfigSchema } from '../../spell-corrector';
|
|
17
17
|
import { DiagramsConfigSchema } from '../../diagrams';
|
|
18
18
|
import { HtmlPageBuilderConfigSchema } from '../../html-page-builder/models';
|
|
19
|
+
import { PhotoSessionConfigSchema } from '../../photo-sessions';
|
|
19
20
|
import { ImageRecognitionConfigSchema } from '../../image-recognition';
|
|
20
21
|
|
|
21
22
|
export const GlobalToolsConfigSchema = z.object({
|
|
@@ -35,6 +36,7 @@ export const GlobalToolsConfigSchema = z.object({
|
|
|
35
36
|
[TOOL_CONTENT_TYPE.SPELL_CORRECTOR]: SpellCorrectorToolConfigSchema,
|
|
36
37
|
[TOOL_CONTENT_TYPE.DIAGRAMS]: DiagramsConfigSchema,
|
|
37
38
|
[TOOL_CONTENT_TYPE.HTML_PAGE_BUILDER]: HtmlPageBuilderConfigSchema,
|
|
39
|
+
[TOOL_CONTENT_TYPE.PHOTO_SESSIONS]: PhotoSessionConfigSchema,
|
|
38
40
|
[TOOL_CONTENT_TYPE.IMAGE_RECOGNITION]: ImageRecognitionConfigSchema,
|
|
39
41
|
});
|
|
40
42
|
|