@ai-grator/api 0.3.76 → 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 +20 -0
- package/admin/endpoints/commands/ban-admin-antifraud-check-value.command.ts +37 -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 +10 -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-antifraud-checks.query.ts +35 -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 +4 -0
- package/admin/enums/admin-antifraud-check-reason.enum.ts +5 -0
- package/admin/enums/index.ts +1 -0
- package/admin/models/admin-antifraud-check-response.schema.ts +27 -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 +3 -0
- package/build/admin/endpoints/admin.d.ts +14 -0
- package/build/admin/endpoints/admin.d.ts.map +1 -1
- package/build/admin/endpoints/admin.js +17 -0
- package/build/admin/endpoints/commands/ban-admin-antifraud-check-value.command.d.ts +71 -0
- package/build/admin/endpoints/commands/ban-admin-antifraud-check-value.command.d.ts.map +1 -0
- package/build/admin/endpoints/commands/ban-admin-antifraud-check-value.command.js +32 -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 +10 -0
- package/build/admin/endpoints/commands/index.d.ts.map +1 -1
- package/build/admin/endpoints/commands/index.js +10 -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-antifraud-checks.query.d.ts +78 -0
- package/build/admin/endpoints/queries/get-admin-antifraud-checks.query.d.ts.map +1 -0
- package/build/admin/endpoints/queries/get-admin-antifraud-checks.query.js +32 -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 +4 -0
- package/build/admin/endpoints/queries/index.d.ts.map +1 -1
- package/build/admin/endpoints/queries/index.js +4 -0
- package/build/admin/enums/admin-antifraud-check-reason.enum.d.ts +6 -0
- package/build/admin/enums/admin-antifraud-check-reason.enum.d.ts.map +1 -0
- package/build/admin/enums/admin-antifraud-check-reason.enum.js +9 -0
- package/build/admin/enums/index.d.ts +1 -0
- package/build/admin/enums/index.d.ts.map +1 -1
- package/build/admin/enums/index.js +1 -0
- package/build/admin/models/admin-antifraud-check-response.schema.d.ts +34 -0
- package/build/admin/models/admin-antifraud-check-response.schema.d.ts.map +1 -0
- package/build/admin/models/admin-antifraud-check-response.schema.js +23 -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 +3 -0
- package/build/admin/models/index.d.ts.map +1 -1
- package/build/admin/models/index.js +3 -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 +224 -5
- package/build/errors/errors.d.ts.map +1 -1
- package/build/errors/errors.js +224 -5
- 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 +224 -5
- 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
|
@@ -43,6 +43,10 @@ export const ADMIN_ROUTES = {
|
|
|
43
43
|
CREATE_BLACKLIST_ENTRY: 'blacklist',
|
|
44
44
|
DELETE_BLACKLIST_ENTRY: (entryId: string) => `blacklist/${entryId}`,
|
|
45
45
|
|
|
46
|
+
// ANTIFRAUD
|
|
47
|
+
GET_ANTIFRAUD_CHECKS: 'antifraud-checks',
|
|
48
|
+
BAN_ANTIFRAUD_CHECK_VALUE: (checkId: string) => `antifraud-checks/${checkId}/ban`,
|
|
49
|
+
|
|
46
50
|
// SUPPORT
|
|
47
51
|
GET_SUPPORT_CHATS: 'support/chats',
|
|
48
52
|
GET_SUPPORT_CHAT_MESSAGES: (userId: string) => `support/chats/${userId}/messages`,
|
|
@@ -79,6 +83,22 @@ export const ADMIN_ROUTES = {
|
|
|
79
83
|
UPDATE_TREND_CATEGORY: (categoryId: string) => `trend-categories/${categoryId}`,
|
|
80
84
|
DELETE_TREND_CATEGORY: (categoryId: string) => `trend-categories/${categoryId}`,
|
|
81
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
|
+
|
|
82
102
|
// ORGANIZATION
|
|
83
103
|
GET_ORGANIZATION: 'organization',
|
|
84
104
|
UPDATE_ORGANIZATION: 'organization',
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema } from '../../../_common';
|
|
3
|
+
import { AdminAntifraudCheckResponseSchema } from '../../models';
|
|
4
|
+
import { ADMIN_ROUTES } from '../admin';
|
|
5
|
+
|
|
6
|
+
export const BanAdminAntifraudCheckValueCommandParams = z.object({
|
|
7
|
+
checkId: z.uuid(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const BanAdminAntifraudCheckValueCommandBody = z.object({
|
|
11
|
+
reason: z.string().trim().min(1).max(500),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const BanAdminAntifraudCheckValueCommandResponse = AdminAntifraudCheckResponseSchema;
|
|
15
|
+
|
|
16
|
+
export const BanAdminAntifraudCheckValueCommand = defineContract({
|
|
17
|
+
method: HTTP_METHODS.POST,
|
|
18
|
+
path: ADMIN_ROUTES.BAN_ANTIFRAUD_CHECK_VALUE(':checkId'),
|
|
19
|
+
summary: 'Blacklist the IP or fingerprint an antifraud check matched on',
|
|
20
|
+
request: {
|
|
21
|
+
params: BanAdminAntifraudCheckValueCommandParams,
|
|
22
|
+
body: BanAdminAntifraudCheckValueCommandBody,
|
|
23
|
+
},
|
|
24
|
+
responses: {
|
|
25
|
+
200: BanAdminAntifraudCheckValueCommandResponse,
|
|
26
|
+
400: HttpErrorResponseSchema,
|
|
27
|
+
401: HttpErrorResponseSchema,
|
|
28
|
+
403: HttpErrorResponseSchema,
|
|
29
|
+
404: HttpErrorResponseSchema,
|
|
30
|
+
409: HttpErrorResponseSchema,
|
|
31
|
+
500: HttpErrorResponseSchema,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export type BanAdminAntifraudCheckValueCommandParamsType = z.infer<typeof BanAdminAntifraudCheckValueCommandParams>;
|
|
36
|
+
export type BanAdminAntifraudCheckValueCommandBodyType = z.infer<typeof BanAdminAntifraudCheckValueCommandBody>;
|
|
37
|
+
export type BanAdminAntifraudCheckValueCommandResponseType = z.infer<typeof BanAdminAntifraudCheckValueCommandResponse>;
|
|
@@ -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>;
|
|
@@ -25,3 +25,13 @@ export * from './update-admin-trend-category.command';
|
|
|
25
25
|
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
|
+
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,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, defineOffsetPaginationQuery, HTTP_METHODS, HttpErrorResponseSchema } from '../../../_common';
|
|
3
|
+
import { ADMIN_ANTIFRAUD_CHECK_REASON } from '../../enums';
|
|
4
|
+
import { AdminAntifraudCheckResponseSchema } from '../../models';
|
|
5
|
+
import { ADMIN_ROUTES } from '../admin';
|
|
6
|
+
|
|
7
|
+
export const GetAdminAntifraudChecksQueryQuery = defineOffsetPaginationQuery().extend({
|
|
8
|
+
reason: z.enum(ADMIN_ANTIFRAUD_CHECK_REASON).optional(),
|
|
9
|
+
search: z.string().trim().max(255).optional(),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export const GetAdminAntifraudChecksQueryResponse = z.object({
|
|
13
|
+
checks: z.array(AdminAntifraudCheckResponseSchema),
|
|
14
|
+
total: z.number().int().nonnegative(),
|
|
15
|
+
page: z.number().int().positive(),
|
|
16
|
+
limit: z.number().int().positive(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const GetAdminAntifraudChecksQuery = defineContract({
|
|
20
|
+
method: HTTP_METHODS.GET,
|
|
21
|
+
path: ADMIN_ROUTES.GET_ANTIFRAUD_CHECKS,
|
|
22
|
+
summary: 'Get account matches that denied the email verification bonus',
|
|
23
|
+
request: {
|
|
24
|
+
query: GetAdminAntifraudChecksQueryQuery,
|
|
25
|
+
},
|
|
26
|
+
responses: {
|
|
27
|
+
200: GetAdminAntifraudChecksQueryResponse,
|
|
28
|
+
401: HttpErrorResponseSchema,
|
|
29
|
+
403: HttpErrorResponseSchema,
|
|
30
|
+
500: HttpErrorResponseSchema,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export type GetAdminAntifraudChecksQueryQueryType = z.infer<typeof GetAdminAntifraudChecksQueryQuery>;
|
|
35
|
+
export type GetAdminAntifraudChecksQueryResponseType = z.infer<typeof GetAdminAntifraudChecksQueryResponse>;
|
|
@@ -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>;
|
|
@@ -26,3 +26,7 @@ export * from './get-admin-trends.query';
|
|
|
26
26
|
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
|
+
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';
|
package/admin/enums/index.ts
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ADMIN_ANTIFRAUD_CHECK_REASON } from '../enums';
|
|
3
|
+
|
|
4
|
+
export const AdminAntifraudCheckUserSchema = z.object({
|
|
5
|
+
uuid: z.uuid(),
|
|
6
|
+
email: z.string(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const AdminAntifraudCheckBanSchema = z.object({
|
|
10
|
+
entryId: z.uuid(),
|
|
11
|
+
reason: z.string().nullable(),
|
|
12
|
+
createdAt: z.iso.datetime(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const AdminAntifraudCheckResponseSchema = z.object({
|
|
16
|
+
uuid: z.uuid(),
|
|
17
|
+
user: AdminAntifraudCheckUserSchema,
|
|
18
|
+
matchedUser: AdminAntifraudCheckUserSchema,
|
|
19
|
+
reason: z.enum(ADMIN_ANTIFRAUD_CHECK_REASON),
|
|
20
|
+
value: z.string(),
|
|
21
|
+
ban: AdminAntifraudCheckBanSchema.nullable(),
|
|
22
|
+
createdAt: z.iso.datetime(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export type AdminAntifraudCheckUserSchemaType = z.infer<typeof AdminAntifraudCheckUserSchema>;
|
|
26
|
+
export type AdminAntifraudCheckBanSchemaType = z.infer<typeof AdminAntifraudCheckBanSchema>;
|
|
27
|
+
export type AdminAntifraudCheckResponseSchemaType = z.infer<typeof AdminAntifraudCheckResponseSchema>;
|
|
@@ -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
|
@@ -20,3 +20,6 @@ export * from './admin-linked-account-cluster.schema';
|
|
|
20
20
|
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
|
+
export * from './admin-antifraud-check-response.schema';
|
|
24
|
+
export * from './admin-preset-category-response.schema';
|
|
25
|
+
export * from './admin-preset-response.schema';
|