@ai-grator/api 0.3.77 → 0.3.78
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/admin/endpoints/admin.ts +16 -0
- package/admin/endpoints/commands/create-admin-preset-category.command.ts +29 -0
- package/admin/endpoints/commands/create-admin-preset.command.ts +30 -0
- package/admin/endpoints/commands/delete-admin-preset-category.command.ts +29 -0
- package/admin/endpoints/commands/delete-admin-preset.command.ts +28 -0
- package/admin/endpoints/commands/index.ts +9 -0
- package/admin/endpoints/commands/reorder-admin-preset-categories.command.ts +33 -0
- package/admin/endpoints/commands/reorder-admin-presets.command.ts +33 -0
- package/admin/endpoints/commands/update-admin-preset-category.command.ts +36 -0
- package/admin/endpoints/commands/update-admin-preset-status.command.ts +37 -0
- package/admin/endpoints/commands/update-admin-preset.command.ts +36 -0
- package/admin/endpoints/queries/get-admin-preset-categories.query.ts +22 -0
- package/admin/endpoints/queries/get-admin-preset.query.ts +29 -0
- package/admin/endpoints/queries/get-admin-presets.query.ts +37 -0
- package/admin/endpoints/queries/index.ts +3 -0
- package/admin/models/admin-preset-category-response.schema.ts +14 -0
- package/admin/models/admin-preset-response.schema.ts +67 -0
- package/admin/models/index.ts +2 -0
- package/build/admin/endpoints/admin.d.ts +12 -0
- package/build/admin/endpoints/admin.d.ts.map +1 -1
- package/build/admin/endpoints/admin.js +14 -0
- package/build/admin/endpoints/commands/create-admin-preset-category.command.d.ts +51 -0
- package/build/admin/endpoints/commands/create-admin-preset-category.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/create-admin-preset-category.command.js +25 -0
- package/build/admin/endpoints/commands/create-admin-preset.command.d.ts +490 -0
- package/build/admin/endpoints/commands/create-admin-preset.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/create-admin-preset.command.js +26 -0
- package/build/admin/endpoints/commands/delete-admin-preset-category.command.d.ts +27 -0
- package/build/admin/endpoints/commands/delete-admin-preset-category.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/delete-admin-preset-category.command.js +26 -0
- package/build/admin/endpoints/commands/delete-admin-preset.command.d.ts +26 -0
- package/build/admin/endpoints/commands/delete-admin-preset.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/delete-admin-preset.command.js +25 -0
- package/build/admin/endpoints/commands/index.d.ts +9 -0
- package/build/admin/endpoints/commands/index.d.ts.map +1 -1
- package/build/admin/endpoints/commands/index.js +9 -0
- package/build/admin/endpoints/commands/reorder-admin-preset-categories.command.d.ts +26 -0
- package/build/admin/endpoints/commands/reorder-admin-preset-categories.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/reorder-admin-preset-categories.command.js +28 -0
- package/build/admin/endpoints/commands/reorder-admin-presets.command.d.ts +29 -0
- package/build/admin/endpoints/commands/reorder-admin-presets.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/reorder-admin-presets.command.js +30 -0
- package/build/admin/endpoints/commands/update-admin-preset-category.command.d.ts +59 -0
- package/build/admin/endpoints/commands/update-admin-preset-category.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/update-admin-preset-category.command.js +31 -0
- package/build/admin/endpoints/commands/update-admin-preset-status.command.d.ts +312 -0
- package/build/admin/endpoints/commands/update-admin-preset-status.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/update-admin-preset-status.command.js +32 -0
- package/build/admin/endpoints/commands/update-admin-preset.command.d.ts +497 -0
- package/build/admin/endpoints/commands/update-admin-preset.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/update-admin-preset.command.js +31 -0
- package/build/admin/endpoints/queries/get-admin-preset-categories.query.d.ts +38 -0
- package/build/admin/endpoints/queries/get-admin-preset-categories.query.d.ts.map +1 -0
- package/build/admin/endpoints/queries/get-admin-preset-categories.query.js +21 -0
- package/build/admin/endpoints/queries/get-admin-preset.query.d.ts +304 -0
- package/build/admin/endpoints/queries/get-admin-preset.query.d.ts.map +1 -0
- package/build/admin/endpoints/queries/get-admin-preset.query.js +26 -0
- package/build/admin/endpoints/queries/get-admin-presets.query.d.ts +141 -0
- package/build/admin/endpoints/queries/get-admin-presets.query.d.ts.map +1 -0
- package/build/admin/endpoints/queries/get-admin-presets.query.js +34 -0
- package/build/admin/endpoints/queries/index.d.ts +3 -0
- package/build/admin/endpoints/queries/index.d.ts.map +1 -1
- package/build/admin/endpoints/queries/index.js +3 -0
- package/build/admin/models/admin-preset-category-response.schema.d.ts +13 -0
- package/build/admin/models/admin-preset-category-response.schema.d.ts.map +1 -0
- package/build/admin/models/admin-preset-category-response.schema.js +14 -0
- package/build/admin/models/admin-preset-response.schema.d.ts +205 -0
- package/build/admin/models/admin-preset-response.schema.d.ts.map +1 -0
- package/build/admin/models/admin-preset-response.schema.js +52 -0
- package/build/admin/models/index.d.ts +2 -0
- package/build/admin/models/index.d.ts.map +1 -1
- package/build/admin/models/index.js +2 -0
- package/build/chat/endpoints/commands/create-chat.command.d.ts +8 -0
- package/build/chat/endpoints/commands/create-chat.command.d.ts.map +1 -1
- package/build/chat/endpoints/commands/update-chat.command.d.ts +8 -0
- package/build/chat/endpoints/commands/update-chat.command.d.ts.map +1 -1
- package/build/chat/endpoints/queries/get-chat-by-uuid.query.d.ts +8 -0
- package/build/chat/endpoints/queries/get-chat-by-uuid.query.d.ts.map +1 -1
- package/build/chat/endpoints/queries/get-chats.query.d.ts +10 -0
- package/build/chat/endpoints/queries/get-chats.query.d.ts.map +1 -1
- package/build/chat/endpoints/queries/get-chats.query.js +4 -1
- package/build/chat/models/chat-response.schema.d.ts +4 -0
- package/build/chat/models/chat-response.schema.d.ts.map +1 -1
- package/build/chat/models/chat-response.schema.js +2 -0
- package/build/errors/errors.d.ts +202 -0
- package/build/errors/errors.d.ts.map +1 -1
- package/build/errors/errors.js +202 -0
- package/build/generation-job/endpoints/commands/create-generation-job.command.d.ts +8 -0
- package/build/generation-job/endpoints/commands/create-generation-job.command.d.ts.map +1 -1
- package/build/generation-job/endpoints/commands/update-generation-job.command.d.ts +8 -0
- package/build/generation-job/endpoints/commands/update-generation-job.command.d.ts.map +1 -1
- package/build/generation-job/endpoints/queries/get-generation-job-by-uuid.query.d.ts +8 -0
- package/build/generation-job/endpoints/queries/get-generation-job-by-uuid.query.d.ts.map +1 -1
- package/build/generation-job/endpoints/queries/get-generation-job-history.query.d.ts +14 -0
- package/build/generation-job/endpoints/queries/get-generation-job-history.query.d.ts.map +1 -1
- package/build/generation-job/endpoints/queries/get-generation-job-history.query.js +2 -0
- package/build/generation-job/endpoints/queries/get-generation-jobs.query.d.ts +10 -0
- package/build/generation-job/endpoints/queries/get-generation-jobs.query.d.ts.map +1 -1
- package/build/generation-job/endpoints/queries/get-generation-jobs.query.js +2 -0
- package/build/generation-job/models/generation-job-response.schema.d.ts +4 -0
- package/build/generation-job/models/generation-job-response.schema.d.ts.map +1 -1
- package/build/generation-job/models/generation-job-response.schema.js +2 -0
- package/build/generation-job-chat/endpoints/commands/create-generation-job-chat.command.d.ts +8 -0
- package/build/generation-job-chat/endpoints/commands/create-generation-job-chat.command.d.ts.map +1 -1
- package/build/generation-job-chat/endpoints/commands/update-generation-job-chat.command.d.ts +8 -0
- package/build/generation-job-chat/endpoints/commands/update-generation-job-chat.command.d.ts.map +1 -1
- package/build/generation-job-chat/endpoints/queries/get-generation-job-chat-by-uuid.query.d.ts +8 -0
- package/build/generation-job-chat/endpoints/queries/get-generation-job-chat-by-uuid.query.d.ts.map +1 -1
- package/build/generation-job-chat/endpoints/queries/get-generation-job-chats.query.d.ts +10 -0
- package/build/generation-job-chat/endpoints/queries/get-generation-job-chats.query.d.ts.map +1 -1
- package/build/generation-job-chat/endpoints/queries/get-generation-job-chats.query.js +2 -0
- package/build/generation-job-chat/models/generation-job-chat-response.schema.d.ts +4 -0
- package/build/generation-job-chat/models/generation-job-chat-response.schema.d.ts.map +1 -1
- package/build/generation-job-chat/models/generation-job-chat-response.schema.js +2 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/preset/endpoints/commands/add-preset-favorite.command.d.ts +25 -0
- package/build/preset/endpoints/commands/add-preset-favorite.command.d.ts.map +1 -0
- package/build/preset/endpoints/commands/add-preset-favorite.command.js +22 -0
- package/build/preset/endpoints/commands/index.d.ts +5 -0
- package/build/preset/endpoints/commands/index.d.ts.map +1 -0
- package/build/preset/endpoints/commands/index.js +20 -0
- package/build/preset/endpoints/commands/prepare-preset.command.d.ts +198 -0
- package/build/preset/endpoints/commands/prepare-preset.command.d.ts.map +1 -0
- package/build/preset/endpoints/commands/prepare-preset.command.js +41 -0
- package/build/preset/endpoints/commands/remove-preset-favorite.command.d.ts +25 -0
- package/build/preset/endpoints/commands/remove-preset-favorite.command.d.ts.map +1 -0
- package/build/preset/endpoints/commands/remove-preset-favorite.command.js +22 -0
- package/build/preset/endpoints/commands/run-preset.command.d.ts +387 -0
- package/build/preset/endpoints/commands/run-preset.command.d.ts.map +1 -0
- package/build/preset/endpoints/commands/run-preset.command.js +55 -0
- package/build/preset/endpoints/index.d.ts +4 -0
- package/build/preset/endpoints/index.d.ts.map +1 -0
- package/build/preset/endpoints/index.js +19 -0
- package/build/preset/endpoints/preset.d.ts +16 -0
- package/build/preset/endpoints/preset.d.ts.map +1 -0
- package/build/preset/endpoints/preset.js +18 -0
- package/build/preset/endpoints/queries/get-preset-price.query.d.ts +62 -0
- package/build/preset/endpoints/queries/get-preset-price.query.d.ts.map +1 -0
- package/build/preset/endpoints/queries/get-preset-price.query.js +30 -0
- package/build/preset/endpoints/queries/get-preset-results.query.d.ts +74 -0
- package/build/preset/endpoints/queries/get-preset-results.query.d.ts.map +1 -0
- package/build/preset/endpoints/queries/get-preset-results.query.js +32 -0
- package/build/preset/endpoints/queries/get-public-preset-by-slug.query.d.ts +334 -0
- package/build/preset/endpoints/queries/get-public-preset-by-slug.query.d.ts.map +1 -0
- package/build/preset/endpoints/queries/get-public-preset-by-slug.query.js +25 -0
- package/build/preset/endpoints/queries/index.d.ts +6 -0
- package/build/preset/endpoints/queries/index.d.ts.map +1 -0
- package/build/preset/endpoints/queries/index.js +21 -0
- package/build/preset/endpoints/queries/list-public-preset-categories.query.d.ts +28 -0
- package/build/preset/endpoints/queries/list-public-preset-categories.query.d.ts.map +1 -0
- package/build/preset/endpoints/queries/list-public-preset-categories.query.js +19 -0
- package/build/preset/endpoints/queries/list-public-presets.query.d.ts +122 -0
- package/build/preset/endpoints/queries/list-public-presets.query.d.ts.map +1 -0
- package/build/preset/endpoints/queries/list-public-presets.query.js +32 -0
- package/build/preset/enums/index.d.ts +10 -0
- package/build/preset/enums/index.d.ts.map +1 -0
- package/build/preset/enums/index.js +25 -0
- package/build/preset/enums/preset-card-media-type.enum.d.ts +6 -0
- package/build/preset/enums/preset-card-media-type.enum.d.ts.map +1 -0
- package/build/preset/enums/preset-card-media-type.enum.js +9 -0
- package/build/preset/enums/preset-example-type.enum.d.ts +5 -0
- package/build/preset/enums/preset-example-type.enum.d.ts.map +1 -0
- package/build/preset/enums/preset-example-type.enum.js +8 -0
- package/build/preset/enums/preset-field-type.enum.d.ts +6 -0
- package/build/preset/enums/preset-field-type.enum.d.ts.map +1 -0
- package/build/preset/enums/preset-field-type.enum.js +9 -0
- package/build/preset/enums/preset-filter.enum.d.ts +6 -0
- package/build/preset/enums/preset-filter.enum.d.ts.map +1 -0
- package/build/preset/enums/preset-filter.enum.js +9 -0
- package/build/preset/enums/preset-limits.d.ts +30 -0
- package/build/preset/enums/preset-limits.d.ts.map +1 -0
- package/build/preset/enums/preset-limits.js +32 -0
- package/build/preset/enums/preset-result-type.enum.d.ts +5 -0
- package/build/preset/enums/preset-result-type.enum.d.ts.map +1 -0
- package/build/preset/enums/preset-result-type.enum.js +8 -0
- package/build/preset/enums/preset-select-display.enum.d.ts +7 -0
- package/build/preset/enums/preset-select-display.enum.d.ts.map +1 -0
- package/build/preset/enums/preset-select-display.enum.js +10 -0
- package/build/preset/enums/preset-status.enum.d.ts +5 -0
- package/build/preset/enums/preset-status.enum.d.ts.map +1 -0
- package/build/preset/enums/preset-status.enum.js +8 -0
- package/build/preset/enums/preset-tool.enum.d.ts +6 -0
- package/build/preset/enums/preset-tool.enum.d.ts.map +1 -0
- package/build/preset/enums/preset-tool.enum.js +9 -0
- package/build/preset/helpers/index.d.ts +3 -0
- package/build/preset/helpers/index.d.ts.map +1 -0
- package/build/preset/helpers/index.js +18 -0
- package/build/preset/helpers/preset-prompt-placeholder.helper.d.ts +4 -0
- package/build/preset/helpers/preset-prompt-placeholder.helper.d.ts.map +1 -0
- package/build/preset/helpers/preset-prompt-placeholder.helper.js +12 -0
- package/build/preset/helpers/preset-tag.helper.d.ts +3 -0
- package/build/preset/helpers/preset-tag.helper.d.ts.map +1 -0
- package/build/preset/helpers/preset-tag.helper.js +9 -0
- package/build/preset/index.d.ts +5 -0
- package/build/preset/index.d.ts.map +1 -0
- package/build/preset/index.js +20 -0
- package/build/preset/models/index.d.ts +9 -0
- package/build/preset/models/index.d.ts.map +1 -0
- package/build/preset/models/index.js +24 -0
- package/build/preset/models/preset-common.schema.d.ts +23 -0
- package/build/preset/models/preset-common.schema.d.ts.map +1 -0
- package/build/preset/models/preset-common.schema.js +26 -0
- package/build/preset/models/preset-field-value.schema.d.ts +51 -0
- package/build/preset/models/preset-field-value.schema.d.ts.map +1 -0
- package/build/preset/models/preset-field-value.schema.js +44 -0
- package/build/preset/models/preset-field.schema.d.ts +310 -0
- package/build/preset/models/preset-field.schema.d.ts.map +1 -0
- package/build/preset/models/preset-field.schema.js +186 -0
- package/build/preset/models/preset-input.schema.d.ts +106 -0
- package/build/preset/models/preset-input.schema.d.ts.map +1 -0
- package/build/preset/models/preset-input.schema.js +97 -0
- package/build/preset/models/preset-media.schema.d.ts +81 -0
- package/build/preset/models/preset-media.schema.d.ts.map +1 -0
- package/build/preset/models/preset-media.schema.js +75 -0
- package/build/preset/models/preset-result.schema.d.ts +23 -0
- package/build/preset/models/preset-result.schema.d.ts.map +1 -0
- package/build/preset/models/preset-result.schema.js +21 -0
- package/build/preset/models/preset-tag.schema.d.ts +10 -0
- package/build/preset/models/preset-tag.schema.d.ts.map +1 -0
- package/build/preset/models/preset-tag.schema.js +11 -0
- package/build/preset/models/public-preset.schema.d.ts +322 -0
- package/build/preset/models/public-preset.schema.d.ts.map +1 -0
- package/build/preset/models/public-preset.schema.js +50 -0
- package/build/trend/endpoints/commands/generate-trend.command.d.ts +8 -0
- package/build/trend/endpoints/commands/generate-trend.command.d.ts.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/chat/endpoints/queries/get-chats.query.ts +4 -1
- package/chat/models/chat-response.schema.ts +2 -0
- package/errors/errors.ts +202 -0
- package/generation-job/endpoints/queries/get-generation-job-history.query.ts +2 -0
- package/generation-job/endpoints/queries/get-generation-jobs.query.ts +2 -0
- package/generation-job/models/generation-job-response.schema.ts +2 -0
- package/generation-job-chat/endpoints/queries/get-generation-job-chats.query.ts +2 -0
- package/generation-job-chat/models/generation-job-chat-response.schema.ts +2 -0
- package/index.ts +1 -0
- package/package.json +1 -1
- package/preset/endpoints/commands/add-preset-favorite.command.ts +26 -0
- package/preset/endpoints/commands/index.ts +4 -0
- package/preset/endpoints/commands/prepare-preset.command.ts +47 -0
- package/preset/endpoints/commands/remove-preset-favorite.command.ts +26 -0
- package/preset/endpoints/commands/run-preset.command.ts +65 -0
- package/preset/endpoints/index.ts +3 -0
- package/preset/endpoints/preset.ts +18 -0
- package/preset/endpoints/queries/get-preset-price.query.ts +35 -0
- package/preset/endpoints/queries/get-preset-results.query.ts +37 -0
- package/preset/endpoints/queries/get-public-preset-by-slug.query.ts +30 -0
- package/preset/endpoints/queries/index.ts +5 -0
- package/preset/endpoints/queries/list-public-preset-categories.query.ts +20 -0
- package/preset/endpoints/queries/list-public-presets.query.ts +35 -0
- package/preset/enums/index.ts +9 -0
- package/preset/enums/preset-card-media-type.enum.ts +5 -0
- package/preset/enums/preset-example-type.enum.ts +4 -0
- package/preset/enums/preset-field-type.enum.ts +5 -0
- package/preset/enums/preset-filter.enum.ts +5 -0
- package/preset/enums/preset-limits.ts +33 -0
- package/preset/enums/preset-result-type.enum.ts +4 -0
- package/preset/enums/preset-select-display.enum.ts +6 -0
- package/preset/enums/preset-status.enum.ts +4 -0
- package/preset/enums/preset-tool.enum.ts +5 -0
- package/preset/helpers/index.ts +2 -0
- package/preset/helpers/preset-prompt-placeholder.helper.ts +9 -0
- package/preset/helpers/preset-tag.helper.ts +9 -0
- package/preset/index.ts +4 -0
- package/preset/models/index.ts +8 -0
- package/preset/models/preset-common.schema.ts +45 -0
- package/preset/models/preset-field-value.schema.ts +51 -0
- package/preset/models/preset-field.schema.ts +251 -0
- package/preset/models/preset-input.schema.ts +129 -0
- package/preset/models/preset-media.schema.ts +94 -0
- package/preset/models/preset-result.schema.ts +21 -0
- package/preset/models/preset-tag.schema.ts +13 -0
- package/preset/models/public-preset.schema.ts +68 -0
package/admin/endpoints/admin.ts
CHANGED
|
@@ -83,6 +83,22 @@ export const ADMIN_ROUTES = {
|
|
|
83
83
|
UPDATE_TREND_CATEGORY: (categoryId: string) => `trend-categories/${categoryId}`,
|
|
84
84
|
DELETE_TREND_CATEGORY: (categoryId: string) => `trend-categories/${categoryId}`,
|
|
85
85
|
|
|
86
|
+
// PRESETS
|
|
87
|
+
GET_PRESETS: 'presets',
|
|
88
|
+
CREATE_PRESET: 'presets',
|
|
89
|
+
REORDER_PRESETS: 'presets/reorder',
|
|
90
|
+
GET_PRESET: (presetId: string) => `presets/${presetId}`,
|
|
91
|
+
UPDATE_PRESET: (presetId: string) => `presets/${presetId}`,
|
|
92
|
+
DELETE_PRESET: (presetId: string) => `presets/${presetId}`,
|
|
93
|
+
UPDATE_PRESET_STATUS: (presetId: string) => `presets/${presetId}/status`,
|
|
94
|
+
|
|
95
|
+
// PRESET CATEGORIES
|
|
96
|
+
GET_PRESET_CATEGORIES: 'preset-categories',
|
|
97
|
+
CREATE_PRESET_CATEGORY: 'preset-categories',
|
|
98
|
+
REORDER_PRESET_CATEGORIES: 'preset-categories/reorder',
|
|
99
|
+
UPDATE_PRESET_CATEGORY: (categoryId: string) => `preset-categories/${categoryId}`,
|
|
100
|
+
DELETE_PRESET_CATEGORY: (categoryId: string) => `preset-categories/${categoryId}`,
|
|
101
|
+
|
|
86
102
|
// ORGANIZATION
|
|
87
103
|
GET_ORGANIZATION: 'organization',
|
|
88
104
|
UPDATE_ORGANIZATION: 'organization',
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema } from '../../../_common';
|
|
3
|
+
import { PresetCategoryInputSchema } from '../../../preset';
|
|
4
|
+
import { AdminPresetCategoryResponseSchema } from '../../models';
|
|
5
|
+
import { ADMIN_ROUTES } from '../admin';
|
|
6
|
+
|
|
7
|
+
export const CreateAdminPresetCategoryCommandBody = PresetCategoryInputSchema;
|
|
8
|
+
|
|
9
|
+
export const CreateAdminPresetCategoryCommandResponse = AdminPresetCategoryResponseSchema;
|
|
10
|
+
|
|
11
|
+
export const CreateAdminPresetCategoryCommand = defineContract({
|
|
12
|
+
method: HTTP_METHODS.POST,
|
|
13
|
+
path: ADMIN_ROUTES.CREATE_PRESET_CATEGORY,
|
|
14
|
+
summary: 'Create preset category',
|
|
15
|
+
request: {
|
|
16
|
+
body: CreateAdminPresetCategoryCommandBody,
|
|
17
|
+
},
|
|
18
|
+
responses: {
|
|
19
|
+
201: CreateAdminPresetCategoryCommandResponse,
|
|
20
|
+
400: HttpErrorResponseSchema,
|
|
21
|
+
401: HttpErrorResponseSchema,
|
|
22
|
+
403: HttpErrorResponseSchema,
|
|
23
|
+
409: HttpErrorResponseSchema,
|
|
24
|
+
500: HttpErrorResponseSchema,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export type CreateAdminPresetCategoryCommandBodyType = z.infer<typeof CreateAdminPresetCategoryCommandBody>;
|
|
29
|
+
export type CreateAdminPresetCategoryCommandResponseType = z.infer<typeof CreateAdminPresetCategoryCommandResponse>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema } from '../../../_common';
|
|
3
|
+
import { PresetInputSchema } from '../../../preset';
|
|
4
|
+
import { AdminPresetResponseSchema } from '../../models';
|
|
5
|
+
import { ADMIN_ROUTES } from '../admin';
|
|
6
|
+
|
|
7
|
+
export const CreateAdminPresetCommandBody = PresetInputSchema;
|
|
8
|
+
|
|
9
|
+
export const CreateAdminPresetCommandResponse = AdminPresetResponseSchema;
|
|
10
|
+
|
|
11
|
+
export const CreateAdminPresetCommand = defineContract({
|
|
12
|
+
method: HTTP_METHODS.POST,
|
|
13
|
+
path: ADMIN_ROUTES.CREATE_PRESET,
|
|
14
|
+
summary: 'Create preset as draft',
|
|
15
|
+
request: {
|
|
16
|
+
body: CreateAdminPresetCommandBody,
|
|
17
|
+
},
|
|
18
|
+
responses: {
|
|
19
|
+
201: CreateAdminPresetCommandResponse,
|
|
20
|
+
400: HttpErrorResponseSchema,
|
|
21
|
+
401: HttpErrorResponseSchema,
|
|
22
|
+
403: HttpErrorResponseSchema,
|
|
23
|
+
404: HttpErrorResponseSchema,
|
|
24
|
+
409: HttpErrorResponseSchema,
|
|
25
|
+
500: HttpErrorResponseSchema,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export type CreateAdminPresetCommandBodyType = z.infer<typeof CreateAdminPresetCommandBody>;
|
|
30
|
+
export type CreateAdminPresetCommandResponseType = z.infer<typeof CreateAdminPresetCommandResponse>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema, HttpSuccessResponseSchema } from '../../../_common';
|
|
3
|
+
import { ADMIN_ROUTES } from '../admin';
|
|
4
|
+
|
|
5
|
+
export const DeleteAdminPresetCategoryCommandParams = z.object({
|
|
6
|
+
categoryId: z.uuid(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const DeleteAdminPresetCategoryCommandResponse = HttpSuccessResponseSchema;
|
|
10
|
+
|
|
11
|
+
export const DeleteAdminPresetCategoryCommand = defineContract({
|
|
12
|
+
method: HTTP_METHODS.DELETE,
|
|
13
|
+
path: ADMIN_ROUTES.DELETE_PRESET_CATEGORY(':categoryId'),
|
|
14
|
+
summary: 'Delete preset category; refused while it has presets',
|
|
15
|
+
request: {
|
|
16
|
+
params: DeleteAdminPresetCategoryCommandParams,
|
|
17
|
+
},
|
|
18
|
+
responses: {
|
|
19
|
+
200: DeleteAdminPresetCategoryCommandResponse,
|
|
20
|
+
401: HttpErrorResponseSchema,
|
|
21
|
+
403: HttpErrorResponseSchema,
|
|
22
|
+
404: HttpErrorResponseSchema,
|
|
23
|
+
409: HttpErrorResponseSchema,
|
|
24
|
+
500: HttpErrorResponseSchema,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export type DeleteAdminPresetCategoryCommandParamsType = z.infer<typeof DeleteAdminPresetCategoryCommandParams>;
|
|
29
|
+
export type DeleteAdminPresetCategoryCommandResponseType = z.infer<typeof DeleteAdminPresetCategoryCommandResponse>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema, HttpSuccessResponseSchema } from '../../../_common';
|
|
3
|
+
import { ADMIN_ROUTES } from '../admin';
|
|
4
|
+
|
|
5
|
+
export const DeleteAdminPresetCommandParams = z.object({
|
|
6
|
+
presetId: z.uuid(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const DeleteAdminPresetCommandResponse = HttpSuccessResponseSchema;
|
|
10
|
+
|
|
11
|
+
export const DeleteAdminPresetCommand = defineContract({
|
|
12
|
+
method: HTTP_METHODS.DELETE,
|
|
13
|
+
path: ADMIN_ROUTES.DELETE_PRESET(':presetId'),
|
|
14
|
+
summary: 'Delete preset; chats and generations keep the preset title tag',
|
|
15
|
+
request: {
|
|
16
|
+
params: DeleteAdminPresetCommandParams,
|
|
17
|
+
},
|
|
18
|
+
responses: {
|
|
19
|
+
200: DeleteAdminPresetCommandResponse,
|
|
20
|
+
401: HttpErrorResponseSchema,
|
|
21
|
+
403: HttpErrorResponseSchema,
|
|
22
|
+
404: HttpErrorResponseSchema,
|
|
23
|
+
500: HttpErrorResponseSchema,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type DeleteAdminPresetCommandParamsType = z.infer<typeof DeleteAdminPresetCommandParams>;
|
|
28
|
+
export type DeleteAdminPresetCommandResponseType = z.infer<typeof DeleteAdminPresetCommandResponse>;
|
|
@@ -26,3 +26,12 @@ export * from './delete-admin-trend-category.command';
|
|
|
26
26
|
export * from './create-admin-blacklist-entry.command';
|
|
27
27
|
export * from './delete-admin-blacklist-entry.command';
|
|
28
28
|
export * from './ban-admin-antifraud-check-value.command';
|
|
29
|
+
export * from './create-admin-preset-category.command';
|
|
30
|
+
export * from './create-admin-preset.command';
|
|
31
|
+
export * from './delete-admin-preset-category.command';
|
|
32
|
+
export * from './delete-admin-preset.command';
|
|
33
|
+
export * from './reorder-admin-preset-categories.command';
|
|
34
|
+
export * from './reorder-admin-presets.command';
|
|
35
|
+
export * from './update-admin-preset-category.command';
|
|
36
|
+
export * from './update-admin-preset-status.command';
|
|
37
|
+
export * from './update-admin-preset.command';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema, HttpSuccessResponseSchema } from '../../../_common';
|
|
3
|
+
import { ADMIN_ROUTES } from '../admin';
|
|
4
|
+
|
|
5
|
+
export const ReorderAdminPresetCategoriesCommandBody = z.object({
|
|
6
|
+
categoryIds: z
|
|
7
|
+
.array(z.uuid())
|
|
8
|
+
.min(1)
|
|
9
|
+
.refine((ids) => new Set(ids).size === ids.length, { message: 'Category ids must be unique' }),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const ReorderAdminPresetCategoriesCommandResponse = HttpSuccessResponseSchema;
|
|
13
|
+
|
|
14
|
+
export const ReorderAdminPresetCategoriesCommand = defineContract({
|
|
15
|
+
method: HTTP_METHODS.POST,
|
|
16
|
+
path: ADMIN_ROUTES.REORDER_PRESET_CATEGORIES,
|
|
17
|
+
summary: 'Set order of all preset categories; position in the array is the order',
|
|
18
|
+
request: {
|
|
19
|
+
body: ReorderAdminPresetCategoriesCommandBody,
|
|
20
|
+
},
|
|
21
|
+
responses: {
|
|
22
|
+
200: ReorderAdminPresetCategoriesCommandResponse,
|
|
23
|
+
400: HttpErrorResponseSchema,
|
|
24
|
+
401: HttpErrorResponseSchema,
|
|
25
|
+
403: HttpErrorResponseSchema,
|
|
26
|
+
500: HttpErrorResponseSchema,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export type ReorderAdminPresetCategoriesCommandBodyType = z.infer<typeof ReorderAdminPresetCategoriesCommandBody>;
|
|
31
|
+
export type ReorderAdminPresetCategoriesCommandResponseType = z.infer<
|
|
32
|
+
typeof ReorderAdminPresetCategoriesCommandResponse
|
|
33
|
+
>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema, HttpSuccessResponseSchema } from '../../../_common';
|
|
3
|
+
import { ADMIN_ROUTES } from '../admin';
|
|
4
|
+
|
|
5
|
+
export const ReorderAdminPresetsCommandBody = z.object({
|
|
6
|
+
categoryId: z.uuid(),
|
|
7
|
+
presetIds: z
|
|
8
|
+
.array(z.uuid())
|
|
9
|
+
.min(1)
|
|
10
|
+
.refine((ids) => new Set(ids).size === ids.length, { message: 'Preset ids must be unique' }),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const ReorderAdminPresetsCommandResponse = HttpSuccessResponseSchema;
|
|
14
|
+
|
|
15
|
+
export const ReorderAdminPresetsCommand = defineContract({
|
|
16
|
+
method: HTTP_METHODS.POST,
|
|
17
|
+
path: ADMIN_ROUTES.REORDER_PRESETS,
|
|
18
|
+
summary: 'Set order of all presets of a category; position in the array is the order',
|
|
19
|
+
request: {
|
|
20
|
+
body: ReorderAdminPresetsCommandBody,
|
|
21
|
+
},
|
|
22
|
+
responses: {
|
|
23
|
+
200: ReorderAdminPresetsCommandResponse,
|
|
24
|
+
400: HttpErrorResponseSchema,
|
|
25
|
+
401: HttpErrorResponseSchema,
|
|
26
|
+
403: HttpErrorResponseSchema,
|
|
27
|
+
404: HttpErrorResponseSchema,
|
|
28
|
+
500: HttpErrorResponseSchema,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export type ReorderAdminPresetsCommandBodyType = z.infer<typeof ReorderAdminPresetsCommandBody>;
|
|
33
|
+
export type ReorderAdminPresetsCommandResponseType = z.infer<typeof ReorderAdminPresetsCommandResponse>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema } from '../../../_common';
|
|
3
|
+
import { PresetCategoryInputSchema } from '../../../preset';
|
|
4
|
+
import { AdminPresetCategoryResponseSchema } from '../../models';
|
|
5
|
+
import { ADMIN_ROUTES } from '../admin';
|
|
6
|
+
|
|
7
|
+
export const UpdateAdminPresetCategoryCommandParams = z.object({
|
|
8
|
+
categoryId: z.uuid(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const UpdateAdminPresetCategoryCommandBody = PresetCategoryInputSchema;
|
|
12
|
+
|
|
13
|
+
export const UpdateAdminPresetCategoryCommandResponse = AdminPresetCategoryResponseSchema;
|
|
14
|
+
|
|
15
|
+
export const UpdateAdminPresetCategoryCommand = defineContract({
|
|
16
|
+
method: HTTP_METHODS.PUT,
|
|
17
|
+
path: ADMIN_ROUTES.UPDATE_PRESET_CATEGORY(':categoryId'),
|
|
18
|
+
summary: 'Update preset category',
|
|
19
|
+
request: {
|
|
20
|
+
params: UpdateAdminPresetCategoryCommandParams,
|
|
21
|
+
body: UpdateAdminPresetCategoryCommandBody,
|
|
22
|
+
},
|
|
23
|
+
responses: {
|
|
24
|
+
200: UpdateAdminPresetCategoryCommandResponse,
|
|
25
|
+
400: HttpErrorResponseSchema,
|
|
26
|
+
401: HttpErrorResponseSchema,
|
|
27
|
+
403: HttpErrorResponseSchema,
|
|
28
|
+
404: HttpErrorResponseSchema,
|
|
29
|
+
409: HttpErrorResponseSchema,
|
|
30
|
+
500: HttpErrorResponseSchema,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export type UpdateAdminPresetCategoryCommandParamsType = z.infer<typeof UpdateAdminPresetCategoryCommandParams>;
|
|
35
|
+
export type UpdateAdminPresetCategoryCommandBodyType = z.infer<typeof UpdateAdminPresetCategoryCommandBody>;
|
|
36
|
+
export type UpdateAdminPresetCategoryCommandResponseType = z.infer<typeof UpdateAdminPresetCategoryCommandResponse>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema } from '../../../_common';
|
|
3
|
+
import { PresetStatusSchema } from '../../../preset';
|
|
4
|
+
import { AdminPresetResponseSchema } from '../../models';
|
|
5
|
+
import { ADMIN_ROUTES } from '../admin';
|
|
6
|
+
|
|
7
|
+
export const UpdateAdminPresetStatusCommandParams = z.object({
|
|
8
|
+
presetId: z.uuid(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const UpdateAdminPresetStatusCommandBody = z.object({
|
|
12
|
+
status: PresetStatusSchema,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const UpdateAdminPresetStatusCommandResponse = AdminPresetResponseSchema;
|
|
16
|
+
|
|
17
|
+
export const UpdateAdminPresetStatusCommand = defineContract({
|
|
18
|
+
method: HTTP_METHODS.PATCH,
|
|
19
|
+
path: ADMIN_ROUTES.UPDATE_PRESET_STATUS(':presetId'),
|
|
20
|
+
summary: 'Publish or unpublish preset',
|
|
21
|
+
request: {
|
|
22
|
+
params: UpdateAdminPresetStatusCommandParams,
|
|
23
|
+
body: UpdateAdminPresetStatusCommandBody,
|
|
24
|
+
},
|
|
25
|
+
responses: {
|
|
26
|
+
200: UpdateAdminPresetStatusCommandResponse,
|
|
27
|
+
400: HttpErrorResponseSchema,
|
|
28
|
+
401: HttpErrorResponseSchema,
|
|
29
|
+
403: HttpErrorResponseSchema,
|
|
30
|
+
404: HttpErrorResponseSchema,
|
|
31
|
+
500: HttpErrorResponseSchema,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export type UpdateAdminPresetStatusCommandParamsType = z.infer<typeof UpdateAdminPresetStatusCommandParams>;
|
|
36
|
+
export type UpdateAdminPresetStatusCommandBodyType = z.infer<typeof UpdateAdminPresetStatusCommandBody>;
|
|
37
|
+
export type UpdateAdminPresetStatusCommandResponseType = z.infer<typeof UpdateAdminPresetStatusCommandResponse>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema } from '../../../_common';
|
|
3
|
+
import { PresetInputSchema } from '../../../preset';
|
|
4
|
+
import { AdminPresetResponseSchema } from '../../models';
|
|
5
|
+
import { ADMIN_ROUTES } from '../admin';
|
|
6
|
+
|
|
7
|
+
export const UpdateAdminPresetCommandParams = z.object({
|
|
8
|
+
presetId: z.uuid(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const UpdateAdminPresetCommandBody = PresetInputSchema;
|
|
12
|
+
|
|
13
|
+
export const UpdateAdminPresetCommandResponse = AdminPresetResponseSchema;
|
|
14
|
+
|
|
15
|
+
export const UpdateAdminPresetCommand = defineContract({
|
|
16
|
+
method: HTTP_METHODS.PUT,
|
|
17
|
+
path: ADMIN_ROUTES.UPDATE_PRESET(':presetId'),
|
|
18
|
+
summary: 'Replace preset content; status and order are kept',
|
|
19
|
+
request: {
|
|
20
|
+
params: UpdateAdminPresetCommandParams,
|
|
21
|
+
body: UpdateAdminPresetCommandBody,
|
|
22
|
+
},
|
|
23
|
+
responses: {
|
|
24
|
+
200: UpdateAdminPresetCommandResponse,
|
|
25
|
+
400: HttpErrorResponseSchema,
|
|
26
|
+
401: HttpErrorResponseSchema,
|
|
27
|
+
403: HttpErrorResponseSchema,
|
|
28
|
+
404: HttpErrorResponseSchema,
|
|
29
|
+
409: HttpErrorResponseSchema,
|
|
30
|
+
500: HttpErrorResponseSchema,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export type UpdateAdminPresetCommandParamsType = z.infer<typeof UpdateAdminPresetCommandParams>;
|
|
35
|
+
export type UpdateAdminPresetCommandBodyType = z.infer<typeof UpdateAdminPresetCommandBody>;
|
|
36
|
+
export type UpdateAdminPresetCommandResponseType = z.infer<typeof UpdateAdminPresetCommandResponse>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema } from '../../../_common';
|
|
3
|
+
import { AdminPresetCategoryResponseSchema } from '../../models';
|
|
4
|
+
import { ADMIN_ROUTES } from '../admin';
|
|
5
|
+
|
|
6
|
+
export const GetAdminPresetCategoriesQueryResponse = z.object({
|
|
7
|
+
categories: z.array(AdminPresetCategoryResponseSchema),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const GetAdminPresetCategoriesQuery = defineContract({
|
|
11
|
+
method: HTTP_METHODS.GET,
|
|
12
|
+
path: ADMIN_ROUTES.GET_PRESET_CATEGORIES,
|
|
13
|
+
summary: 'Get all preset categories ordered by order',
|
|
14
|
+
responses: {
|
|
15
|
+
200: GetAdminPresetCategoriesQueryResponse,
|
|
16
|
+
401: HttpErrorResponseSchema,
|
|
17
|
+
403: HttpErrorResponseSchema,
|
|
18
|
+
500: HttpErrorResponseSchema,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export type GetAdminPresetCategoriesQueryResponseType = z.infer<typeof GetAdminPresetCategoriesQueryResponse>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema } from '../../../_common';
|
|
3
|
+
import { AdminPresetResponseSchema } from '../../models';
|
|
4
|
+
import { ADMIN_ROUTES } from '../admin';
|
|
5
|
+
|
|
6
|
+
export const GetAdminPresetQueryParams = z.object({
|
|
7
|
+
presetId: z.uuid(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const GetAdminPresetQueryResponse = AdminPresetResponseSchema;
|
|
11
|
+
|
|
12
|
+
export const GetAdminPresetQuery = defineContract({
|
|
13
|
+
method: HTTP_METHODS.GET,
|
|
14
|
+
path: ADMIN_ROUTES.GET_PRESET(':presetId'),
|
|
15
|
+
summary: 'Get preset with fields, media and example',
|
|
16
|
+
request: {
|
|
17
|
+
params: GetAdminPresetQueryParams,
|
|
18
|
+
},
|
|
19
|
+
responses: {
|
|
20
|
+
200: GetAdminPresetQueryResponse,
|
|
21
|
+
401: HttpErrorResponseSchema,
|
|
22
|
+
403: HttpErrorResponseSchema,
|
|
23
|
+
404: HttpErrorResponseSchema,
|
|
24
|
+
500: HttpErrorResponseSchema,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export type GetAdminPresetQueryParamsType = z.infer<typeof GetAdminPresetQueryParams>;
|
|
29
|
+
export type GetAdminPresetQueryResponseType = z.infer<typeof GetAdminPresetQueryResponse>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, defineOffsetPaginationQuery, HTTP_METHODS, HttpErrorResponseSchema } from '../../../_common';
|
|
3
|
+
import { PRESET_SEARCH_MAX_LENGTH, PresetStatusSchema, PresetToolSchema } from '../../../preset';
|
|
4
|
+
import { AdminPresetListItemSchema } from '../../models';
|
|
5
|
+
import { ADMIN_ROUTES } from '../admin';
|
|
6
|
+
|
|
7
|
+
export const GetAdminPresetsQueryQuery = defineOffsetPaginationQuery().extend({
|
|
8
|
+
search: z.string().trim().max(PRESET_SEARCH_MAX_LENGTH).optional(),
|
|
9
|
+
status: PresetStatusSchema.optional(),
|
|
10
|
+
categoryId: z.uuid().optional(),
|
|
11
|
+
tool: PresetToolSchema.optional(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const GetAdminPresetsQueryResponse = z.object({
|
|
15
|
+
presets: z.array(AdminPresetListItemSchema),
|
|
16
|
+
total: z.number().int().nonnegative(),
|
|
17
|
+
page: z.number().int().positive(),
|
|
18
|
+
limit: z.number().int().positive(),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const GetAdminPresetsQuery = defineContract({
|
|
22
|
+
method: HTTP_METHODS.GET,
|
|
23
|
+
path: ADMIN_ROUTES.GET_PRESETS,
|
|
24
|
+
summary: 'Get presets list ordered by category and order',
|
|
25
|
+
request: {
|
|
26
|
+
query: GetAdminPresetsQueryQuery,
|
|
27
|
+
},
|
|
28
|
+
responses: {
|
|
29
|
+
200: GetAdminPresetsQueryResponse,
|
|
30
|
+
401: HttpErrorResponseSchema,
|
|
31
|
+
403: HttpErrorResponseSchema,
|
|
32
|
+
500: HttpErrorResponseSchema,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export type GetAdminPresetsQueryQueryType = z.infer<typeof GetAdminPresetsQueryQuery>;
|
|
37
|
+
export type GetAdminPresetsQueryResponseType = z.infer<typeof GetAdminPresetsQueryResponse>;
|
|
@@ -27,3 +27,6 @@ export * from './get-admin-trend.query';
|
|
|
27
27
|
export * from './get-admin-trend-categories.query';
|
|
28
28
|
export * from './get-admin-blacklist-entries.query';
|
|
29
29
|
export * from './get-admin-antifraud-checks.query';
|
|
30
|
+
export * from './get-admin-preset-categories.query';
|
|
31
|
+
export * from './get-admin-preset.query';
|
|
32
|
+
export * from './get-admin-presets.query';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const AdminPresetCategoryResponseSchema = z.object({
|
|
4
|
+
uuid: z.uuid(),
|
|
5
|
+
slug: z.string(),
|
|
6
|
+
name: z.string(),
|
|
7
|
+
icon: z.string(),
|
|
8
|
+
order: z.int(),
|
|
9
|
+
isActive: z.boolean(),
|
|
10
|
+
createdAt: z.iso.datetime(),
|
|
11
|
+
updatedAt: z.iso.datetime(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type AdminPresetCategoryResponseSchemaType = z.infer<typeof AdminPresetCategoryResponseSchema>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
PresetCardMediaSchema,
|
|
4
|
+
PresetChatOptionsSchema,
|
|
5
|
+
PresetExampleSchema,
|
|
6
|
+
PresetFieldKeySchema,
|
|
7
|
+
PresetFieldResponseSchema,
|
|
8
|
+
PresetModelParamsSchema,
|
|
9
|
+
PresetStatusSchema,
|
|
10
|
+
PresetToolSchema,
|
|
11
|
+
} from '../../preset';
|
|
12
|
+
|
|
13
|
+
export const AdminPresetCategoryRefSchema = z.object({
|
|
14
|
+
uuid: z.uuid(),
|
|
15
|
+
slug: z.string(),
|
|
16
|
+
name: z.string(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const AdminPresetModelRefSchema = z.object({
|
|
20
|
+
uuid: z.uuid(),
|
|
21
|
+
title: z.string(),
|
|
22
|
+
isActive: z.boolean(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const AdminPresetResponseSchema = z.object({
|
|
26
|
+
uuid: z.uuid(),
|
|
27
|
+
slug: z.string(),
|
|
28
|
+
status: PresetStatusSchema,
|
|
29
|
+
order: z.int(),
|
|
30
|
+
category: AdminPresetCategoryRefSchema,
|
|
31
|
+
title: z.string(),
|
|
32
|
+
shortDescription: z.string(),
|
|
33
|
+
description: z.string(),
|
|
34
|
+
badge: z.string().nullable(),
|
|
35
|
+
tool: PresetToolSchema,
|
|
36
|
+
generationModel: AdminPresetModelRefSchema.nullable(),
|
|
37
|
+
aiModel: AdminPresetModelRefSchema.nullable(),
|
|
38
|
+
promptTemplate: z.string(),
|
|
39
|
+
fixedParams: PresetModelParamsSchema,
|
|
40
|
+
chatOptions: PresetChatOptionsSchema.nullable(),
|
|
41
|
+
cardMedia: PresetCardMediaSchema,
|
|
42
|
+
example: PresetExampleSchema.nullable(),
|
|
43
|
+
fields: z.array(PresetFieldResponseSchema),
|
|
44
|
+
requireOneOf: z.array(z.array(PresetFieldKeySchema)),
|
|
45
|
+
createdAt: z.iso.datetime(),
|
|
46
|
+
updatedAt: z.iso.datetime(),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export const AdminPresetListItemSchema = z.object({
|
|
50
|
+
uuid: z.uuid(),
|
|
51
|
+
slug: z.string(),
|
|
52
|
+
status: PresetStatusSchema,
|
|
53
|
+
order: z.int(),
|
|
54
|
+
category: AdminPresetCategoryRefSchema,
|
|
55
|
+
title: z.string(),
|
|
56
|
+
tool: PresetToolSchema,
|
|
57
|
+
modelTitle: z.string(),
|
|
58
|
+
isModelActive: z.boolean(),
|
|
59
|
+
cardMedia: PresetCardMediaSchema.nullable(),
|
|
60
|
+
createdAt: z.iso.datetime(),
|
|
61
|
+
updatedAt: z.iso.datetime(),
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export type AdminPresetCategoryRefSchemaType = z.infer<typeof AdminPresetCategoryRefSchema>;
|
|
65
|
+
export type AdminPresetModelRefSchemaType = z.infer<typeof AdminPresetModelRefSchema>;
|
|
66
|
+
export type AdminPresetResponseSchemaType = z.infer<typeof AdminPresetResponseSchema>;
|
|
67
|
+
export type AdminPresetListItemSchemaType = z.infer<typeof AdminPresetListItemSchema>;
|
package/admin/models/index.ts
CHANGED
|
@@ -21,3 +21,5 @@ export * from './admin-trend-category-response.schema';
|
|
|
21
21
|
export * from './admin-trend-response.schema';
|
|
22
22
|
export * from './admin-blacklist-entry-response.schema';
|
|
23
23
|
export * from './admin-antifraud-check-response.schema';
|
|
24
|
+
export * from './admin-preset-category-response.schema';
|
|
25
|
+
export * from './admin-preset-response.schema';
|
|
@@ -55,6 +55,18 @@ export declare const ADMIN_ROUTES: {
|
|
|
55
55
|
readonly CREATE_TREND_CATEGORY: "trend-categories";
|
|
56
56
|
readonly UPDATE_TREND_CATEGORY: (categoryId: string) => string;
|
|
57
57
|
readonly DELETE_TREND_CATEGORY: (categoryId: string) => string;
|
|
58
|
+
readonly GET_PRESETS: "presets";
|
|
59
|
+
readonly CREATE_PRESET: "presets";
|
|
60
|
+
readonly REORDER_PRESETS: "presets/reorder";
|
|
61
|
+
readonly GET_PRESET: (presetId: string) => string;
|
|
62
|
+
readonly UPDATE_PRESET: (presetId: string) => string;
|
|
63
|
+
readonly DELETE_PRESET: (presetId: string) => string;
|
|
64
|
+
readonly UPDATE_PRESET_STATUS: (presetId: string) => string;
|
|
65
|
+
readonly GET_PRESET_CATEGORIES: "preset-categories";
|
|
66
|
+
readonly CREATE_PRESET_CATEGORY: "preset-categories";
|
|
67
|
+
readonly REORDER_PRESET_CATEGORIES: "preset-categories/reorder";
|
|
68
|
+
readonly UPDATE_PRESET_CATEGORY: (categoryId: string) => string;
|
|
69
|
+
readonly DELETE_PRESET_CATEGORY: (categoryId: string) => string;
|
|
58
70
|
readonly GET_ORGANIZATION: "organization";
|
|
59
71
|
readonly UPDATE_ORGANIZATION: "organization";
|
|
60
72
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../../admin/endpoints/admin.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,YAAY;;sCAGI,MAAM;gDACI,MAAM;iDACL,MAAM;sDACD,MAAM;yDACH,MAAM;kDACb,MAAM;+DACO,MAAM;wDACb,MAAM,aAAa,MAAM;uDAE1B,MAAM;yDACJ,MAAM;;;;;;;;gCAgB/B,MAAM;6CACO,MAAM;gCACnB,MAAM;;kCAEJ,MAAM;;;;+CAQO,MAAM;;kDAIH,MAAM;;iDAIP,MAAM;0CACb,MAAM;8CACF,MAAM;;;gCAKpB,MAAM;mCACH,MAAM;mCACN,MAAM;0CACC,MAAM;;;6CAKH,MAAM;6CACN,MAAM;;;;;kCAOjB,MAAM;qCACH,MAAM;qCACN,MAAM;4CACC,MAAM;;;iDAKD,MAAM;iDACN,MAAM;;;
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../../admin/endpoints/admin.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,OAAgB,CAAC;AAEjD,eAAO,MAAM,YAAY;;sCAGI,MAAM;gDACI,MAAM;iDACL,MAAM;sDACD,MAAM;yDACH,MAAM;kDACb,MAAM;+DACO,MAAM;wDACb,MAAM,aAAa,MAAM;uDAE1B,MAAM;yDACJ,MAAM;;;;;;;;gCAgB/B,MAAM;6CACO,MAAM;gCACnB,MAAM;;kCAEJ,MAAM;;;;+CAQO,MAAM;;kDAIH,MAAM;;iDAIP,MAAM;0CACb,MAAM;8CACF,MAAM;;;gCAKpB,MAAM;mCACH,MAAM;mCACN,MAAM;0CACC,MAAM;;;6CAKH,MAAM;6CACN,MAAM;;;;;kCAOjB,MAAM;qCACH,MAAM;qCACN,MAAM;4CACC,MAAM;;;iDAKD,MAAM;iDACN,MAAM;;;;oCAMnB,MAAM;uCACH,MAAM;uCACN,MAAM;8CACC,MAAM;;;;kDAMF,MAAM;kDACN,MAAM;;;CAKrC,CAAC"}
|
|
@@ -71,6 +71,20 @@ exports.ADMIN_ROUTES = {
|
|
|
71
71
|
CREATE_TREND_CATEGORY: 'trend-categories',
|
|
72
72
|
UPDATE_TREND_CATEGORY: (categoryId) => `trend-categories/${categoryId}`,
|
|
73
73
|
DELETE_TREND_CATEGORY: (categoryId) => `trend-categories/${categoryId}`,
|
|
74
|
+
// PRESETS
|
|
75
|
+
GET_PRESETS: 'presets',
|
|
76
|
+
CREATE_PRESET: 'presets',
|
|
77
|
+
REORDER_PRESETS: 'presets/reorder',
|
|
78
|
+
GET_PRESET: (presetId) => `presets/${presetId}`,
|
|
79
|
+
UPDATE_PRESET: (presetId) => `presets/${presetId}`,
|
|
80
|
+
DELETE_PRESET: (presetId) => `presets/${presetId}`,
|
|
81
|
+
UPDATE_PRESET_STATUS: (presetId) => `presets/${presetId}/status`,
|
|
82
|
+
// PRESET CATEGORIES
|
|
83
|
+
GET_PRESET_CATEGORIES: 'preset-categories',
|
|
84
|
+
CREATE_PRESET_CATEGORY: 'preset-categories',
|
|
85
|
+
REORDER_PRESET_CATEGORIES: 'preset-categories/reorder',
|
|
86
|
+
UPDATE_PRESET_CATEGORY: (categoryId) => `preset-categories/${categoryId}`,
|
|
87
|
+
DELETE_PRESET_CATEGORY: (categoryId) => `preset-categories/${categoryId}`,
|
|
74
88
|
// ORGANIZATION
|
|
75
89
|
GET_ORGANIZATION: 'organization',
|
|
76
90
|
UPDATE_ORGANIZATION: 'organization',
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HTTP_METHODS } from '../../../_common';
|
|
3
|
+
export declare const CreateAdminPresetCategoryCommandBody: z.ZodObject<{
|
|
4
|
+
slug: z.ZodString;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
icon: z.ZodString;
|
|
7
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const CreateAdminPresetCategoryCommandResponse: z.ZodObject<{
|
|
10
|
+
uuid: z.ZodUUID;
|
|
11
|
+
slug: z.ZodString;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
icon: z.ZodString;
|
|
14
|
+
order: z.ZodInt;
|
|
15
|
+
isActive: z.ZodBoolean;
|
|
16
|
+
createdAt: z.ZodISODateTime;
|
|
17
|
+
updatedAt: z.ZodISODateTime;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export declare const CreateAdminPresetCategoryCommand: {
|
|
20
|
+
method: HTTP_METHODS.POST;
|
|
21
|
+
path: "preset-categories";
|
|
22
|
+
summary: string;
|
|
23
|
+
request: {
|
|
24
|
+
body: z.ZodObject<{
|
|
25
|
+
slug: z.ZodString;
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
icon: z.ZodString;
|
|
28
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
};
|
|
31
|
+
responses: {
|
|
32
|
+
201: z.ZodObject<{
|
|
33
|
+
uuid: z.ZodUUID;
|
|
34
|
+
slug: z.ZodString;
|
|
35
|
+
name: z.ZodString;
|
|
36
|
+
icon: z.ZodString;
|
|
37
|
+
order: z.ZodInt;
|
|
38
|
+
isActive: z.ZodBoolean;
|
|
39
|
+
createdAt: z.ZodISODateTime;
|
|
40
|
+
updatedAt: z.ZodISODateTime;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
400: z.ZodType<import("../../../_common").HttpErrorResponse, unknown, z.core.$ZodTypeInternals<import("../../../_common").HttpErrorResponse, unknown>>;
|
|
43
|
+
401: z.ZodType<import("../../../_common").HttpErrorResponse, unknown, z.core.$ZodTypeInternals<import("../../../_common").HttpErrorResponse, unknown>>;
|
|
44
|
+
403: z.ZodType<import("../../../_common").HttpErrorResponse, unknown, z.core.$ZodTypeInternals<import("../../../_common").HttpErrorResponse, unknown>>;
|
|
45
|
+
409: z.ZodType<import("../../../_common").HttpErrorResponse, unknown, z.core.$ZodTypeInternals<import("../../../_common").HttpErrorResponse, unknown>>;
|
|
46
|
+
500: z.ZodType<import("../../../_common").HttpErrorResponse, unknown, z.core.$ZodTypeInternals<import("../../../_common").HttpErrorResponse, unknown>>;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export type CreateAdminPresetCategoryCommandBodyType = z.infer<typeof CreateAdminPresetCategoryCommandBody>;
|
|
50
|
+
export type CreateAdminPresetCategoryCommandResponseType = z.infer<typeof CreateAdminPresetCategoryCommandResponse>;
|
|
51
|
+
//# sourceMappingURL=create-admin-preset-category.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-admin-preset-category.command.d.ts","sourceRoot":"","sources":["../../../../admin/endpoints/commands/create-admin-preset-category.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,YAAY,EAA2B,MAAM,kBAAkB,CAAC;AAKzF,eAAO,MAAM,oCAAoC;;;;;iBAA4B,CAAC;AAE9E,eAAO,MAAM,wCAAwC;;;;;;;;;iBAAoC,CAAC;AAE1F,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAe3C,CAAC;AAEH,MAAM,MAAM,wCAAwC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAC5G,MAAM,MAAM,4CAA4C,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateAdminPresetCategoryCommand = exports.CreateAdminPresetCategoryCommandResponse = exports.CreateAdminPresetCategoryCommandBody = void 0;
|
|
4
|
+
const _common_1 = require("../../../_common");
|
|
5
|
+
const preset_1 = require("../../../preset");
|
|
6
|
+
const models_1 = require("../../models");
|
|
7
|
+
const admin_1 = require("../admin");
|
|
8
|
+
exports.CreateAdminPresetCategoryCommandBody = preset_1.PresetCategoryInputSchema;
|
|
9
|
+
exports.CreateAdminPresetCategoryCommandResponse = models_1.AdminPresetCategoryResponseSchema;
|
|
10
|
+
exports.CreateAdminPresetCategoryCommand = (0, _common_1.defineContract)({
|
|
11
|
+
method: _common_1.HTTP_METHODS.POST,
|
|
12
|
+
path: admin_1.ADMIN_ROUTES.CREATE_PRESET_CATEGORY,
|
|
13
|
+
summary: 'Create preset category',
|
|
14
|
+
request: {
|
|
15
|
+
body: exports.CreateAdminPresetCategoryCommandBody,
|
|
16
|
+
},
|
|
17
|
+
responses: {
|
|
18
|
+
201: exports.CreateAdminPresetCategoryCommandResponse,
|
|
19
|
+
400: _common_1.HttpErrorResponseSchema,
|
|
20
|
+
401: _common_1.HttpErrorResponseSchema,
|
|
21
|
+
403: _common_1.HttpErrorResponseSchema,
|
|
22
|
+
409: _common_1.HttpErrorResponseSchema,
|
|
23
|
+
500: _common_1.HttpErrorResponseSchema,
|
|
24
|
+
},
|
|
25
|
+
});
|