@ai-grator/api 0.1.46 → 0.1.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai-model/models/ai-model-response.schema.ts +21 -11
- package/build/ai-model/endpoints/queries/get-ai-model-by-uuid.query.d.ts +24 -6
- package/build/ai-model/endpoints/queries/get-ai-model-by-uuid.query.d.ts.map +1 -1
- package/build/ai-model/endpoints/queries/get-ai-models.query.d.ts +24 -6
- package/build/ai-model/endpoints/queries/get-ai-models.query.d.ts.map +1 -1
- package/build/ai-model/models/ai-model-response.schema.d.ts +32 -3
- package/build/ai-model/models/ai-model-response.schema.d.ts.map +1 -1
- package/build/ai-model/models/ai-model-response.schema.js +18 -11
- package/build/file/enums/file.enum.d.ts +3 -2
- package/build/file/enums/file.enum.d.ts.map +1 -1
- package/build/file/helpers/index.d.ts +1 -0
- package/build/file/helpers/index.d.ts.map +1 -1
- package/build/file/helpers/index.js +1 -0
- package/build/file/helpers/supported-files.helper.d.ts +13 -0
- package/build/file/helpers/supported-files.helper.d.ts.map +1 -0
- package/build/file/helpers/supported-files.helper.js +78 -0
- package/build/file/models/index.d.ts +1 -0
- package/build/file/models/index.d.ts.map +1 -1
- package/build/file/models/index.js +1 -0
- package/build/file/models/supported-files.schema.d.ts +19 -0
- package/build/file/models/supported-files.schema.d.ts.map +1 -0
- package/build/file/models/supported-files.schema.js +15 -0
- package/build/model-page/endpoints/queries/get-public-model-by-slug.query.d.ts +18 -0
- package/build/model-page/endpoints/queries/get-public-model-by-slug.query.d.ts.map +1 -1
- package/build/model-page/models/public-model-detail.schema.d.ts +27 -0
- package/build/model-page/models/public-model-detail.schema.d.ts.map +1 -1
- package/build/model-page/models/public-model-detail.schema.js +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/file/enums/file.enum.ts +7 -8
- package/file/helpers/index.ts +1 -0
- package/file/helpers/supported-files.helper.ts +102 -0
- package/file/models/index.ts +1 -0
- package/file/models/supported-files.schema.ts +17 -0
- package/model-page/models/public-model-detail.schema.ts +2 -1
- package/package.json +1 -1
- package/build/scripts/generate-openapi.d.ts +0 -2
- package/build/scripts/generate-openapi.d.ts.map +0 -1
- package/build/scripts/generate-openapi.js +0 -533
- package/scripts/generate-openapi.ts +0 -908
|
@@ -1,908 +0,0 @@
|
|
|
1
|
-
import { mkdir, writeFile } from 'node:fs/promises';
|
|
2
|
-
import { dirname, resolve } from 'node:path';
|
|
3
|
-
|
|
4
|
-
import { OpenAPIRegistry, OpenApiGeneratorV3 } from '@asteasolutions/zod-to-openapi';
|
|
5
|
-
import { z } from 'zod';
|
|
6
|
-
|
|
7
|
-
import type { HttpContract } from '../_common/http-contract.helper';
|
|
8
|
-
|
|
9
|
-
type ContractGroup = {
|
|
10
|
-
controller: string;
|
|
11
|
-
tag: string;
|
|
12
|
-
contracts: HttpContract[];
|
|
13
|
-
bodyContentType?: string;
|
|
14
|
-
};
|
|
15
|
-
import { HttpErrorResponseSchema } from '../_common/error.contract';
|
|
16
|
-
import { HttpSuccessResponseSchema } from '../_common/success.contract';
|
|
17
|
-
import { ADMIN_CONTROLLER } from '../admin/endpoints/admin';
|
|
18
|
-
import {
|
|
19
|
-
BanAdminUserCommand,
|
|
20
|
-
BanAdminUserCommandParams,
|
|
21
|
-
BanAdminUserCommandResponse,
|
|
22
|
-
} from '../admin/endpoints/commands/ban-admin-user.command';
|
|
23
|
-
import {
|
|
24
|
-
CreateAdminPartnerBonusOperationCommand,
|
|
25
|
-
CreateAdminPartnerBonusOperationCommandBody,
|
|
26
|
-
CreateAdminPartnerBonusOperationCommandParams,
|
|
27
|
-
CreateAdminPartnerBonusOperationCommandResponse,
|
|
28
|
-
} from '../admin/endpoints/commands/create-admin-partner-bonus-operation.command';
|
|
29
|
-
import {
|
|
30
|
-
UpdateAdminPartnerReferralConfigCommand,
|
|
31
|
-
UpdateAdminPartnerReferralConfigCommandBody,
|
|
32
|
-
UpdateAdminPartnerReferralConfigCommandParams,
|
|
33
|
-
UpdateAdminPartnerReferralConfigCommandResponse,
|
|
34
|
-
} from '../admin/endpoints/commands/update-admin-partner-referral-config.command';
|
|
35
|
-
import {
|
|
36
|
-
UpdateAdminReferralConfigCommand,
|
|
37
|
-
UpdateAdminReferralConfigCommandBody,
|
|
38
|
-
} from '../admin/endpoints/commands/update-admin-referral-config.command';
|
|
39
|
-
import {
|
|
40
|
-
GetAdminPartnersQuery,
|
|
41
|
-
GetAdminPartnersQueryQuery,
|
|
42
|
-
GetAdminPartnersQueryResponse,
|
|
43
|
-
} from '../admin/endpoints/queries/get-admin-partners.query';
|
|
44
|
-
import {
|
|
45
|
-
GetAdminPartnerQuery,
|
|
46
|
-
GetAdminPartnerQueryParams,
|
|
47
|
-
GetAdminPartnerQueryResponse,
|
|
48
|
-
} from '../admin/endpoints/queries/get-admin-partner.query';
|
|
49
|
-
import {
|
|
50
|
-
GetAdminPartnerBonusOperationsQuery,
|
|
51
|
-
GetAdminPartnerBonusOperationsQueryParams,
|
|
52
|
-
GetAdminPartnerBonusOperationsQueryQuery,
|
|
53
|
-
GetAdminPartnerBonusOperationsQueryResponse,
|
|
54
|
-
} from '../admin/endpoints/queries/get-admin-partner-bonus-operations.query';
|
|
55
|
-
import {
|
|
56
|
-
GetAdminPartnerL2BonusesQuery,
|
|
57
|
-
GetAdminPartnerL2BonusesQueryParams,
|
|
58
|
-
GetAdminPartnerL2BonusesQueryQuery,
|
|
59
|
-
GetAdminPartnerL2BonusesQueryResponse,
|
|
60
|
-
} from '../admin/endpoints/queries/get-admin-partner-l2-bonuses.query';
|
|
61
|
-
import {
|
|
62
|
-
GetAdminPartnerReferralConfigQuery,
|
|
63
|
-
GetAdminPartnerReferralConfigQueryParams,
|
|
64
|
-
GetAdminPartnerReferralConfigQueryResponse,
|
|
65
|
-
} from '../admin/endpoints/queries/get-admin-partner-referral-config.query';
|
|
66
|
-
import {
|
|
67
|
-
GetAdminPartnerReferralsQuery,
|
|
68
|
-
GetAdminPartnerReferralsQueryParams,
|
|
69
|
-
GetAdminPartnerReferralsQueryQuery,
|
|
70
|
-
GetAdminPartnerReferralsQueryResponse,
|
|
71
|
-
} from '../admin/endpoints/queries/get-admin-partner-referrals.query';
|
|
72
|
-
import {
|
|
73
|
-
GetAdminReferralConfigQuery,
|
|
74
|
-
GetAdminReferralConfigQueryResponse,
|
|
75
|
-
} from '../admin/endpoints/queries/get-admin-referral-config.query';
|
|
76
|
-
import {
|
|
77
|
-
GetAdminUsersQuery,
|
|
78
|
-
GetAdminUsersQueryQuery,
|
|
79
|
-
GetAdminUsersQueryResponse,
|
|
80
|
-
} from '../admin/endpoints/queries/get-admin-users.query';
|
|
81
|
-
import {
|
|
82
|
-
GetAdminUserQuery,
|
|
83
|
-
GetAdminUserQueryParams,
|
|
84
|
-
GetAdminUserQueryResponse,
|
|
85
|
-
} from '../admin/endpoints/queries/get-admin-user.query';
|
|
86
|
-
import {
|
|
87
|
-
GetAdminUserTransactionsQuery,
|
|
88
|
-
GetAdminUserTransactionsQueryQuery,
|
|
89
|
-
GetAdminUserTransactionsQueryResponse,
|
|
90
|
-
} from '../admin/endpoints/queries/get-admin-user-transactions.query';
|
|
91
|
-
import {
|
|
92
|
-
GetAdminStatsQuery,
|
|
93
|
-
GetAdminStatsQueryQuery,
|
|
94
|
-
GetAdminStatsQueryResponse,
|
|
95
|
-
} from '../billing/endpoints/queries/get-admin-stats.query';
|
|
96
|
-
import {
|
|
97
|
-
GetAdminKieBalanceQuery,
|
|
98
|
-
GetAdminKieBalanceQueryResponse,
|
|
99
|
-
} from '../admin/endpoints/queries/get-admin-kie-balance.query';
|
|
100
|
-
import { AUTH_CONTROLLER } from '../auth/endpoints/auth';
|
|
101
|
-
import { AuthChangePasswordSchema, ChangePasswordCommand } from '../auth/endpoints/commands/change-password.command';
|
|
102
|
-
import { AuthDeleteAccountSchema, DeleteAccountCommand } from '../auth/endpoints/commands/delete-account.command';
|
|
103
|
-
import { AuthLoginSchema, LoginCommand } from '../auth/endpoints/commands/login.command';
|
|
104
|
-
import { AuthRegisterSchema, RegisterCommand } from '../auth/endpoints/commands/register.command';
|
|
105
|
-
import { AuthResetPasswordSchema, ResetPasswordCommand } from '../auth/endpoints/commands/reset-password.command';
|
|
106
|
-
import { AuthRestorePasswordSchema, RestorePasswordCommand } from '../auth/endpoints/commands/restore-password.command';
|
|
107
|
-
import { AuthVerifyEmailSchema, VerifyEmailCommand } from '../auth/endpoints/commands/verify-email.command';
|
|
108
|
-
import {
|
|
109
|
-
AuthVerifyEmailRetrySchema,
|
|
110
|
-
VerifyEmailRetryCommand,
|
|
111
|
-
} from '../auth/endpoints/commands/verify-email-retry.command';
|
|
112
|
-
import { CHAT_CONTROLLER } from '../chat/endpoints/chat';
|
|
113
|
-
import {
|
|
114
|
-
CreateChatCommand,
|
|
115
|
-
CreateChatCommandBody,
|
|
116
|
-
CreateChatCommandResponse,
|
|
117
|
-
} from '../chat/endpoints/commands/create-chat.command';
|
|
118
|
-
import {
|
|
119
|
-
DeleteChatCommand,
|
|
120
|
-
DeleteChatCommandParams,
|
|
121
|
-
DeleteChatCommandResponse,
|
|
122
|
-
} from '../chat/endpoints/commands/delete-chat.command';
|
|
123
|
-
import {
|
|
124
|
-
UpdateChatCommand,
|
|
125
|
-
UpdateChatCommandBody,
|
|
126
|
-
UpdateChatCommandParams,
|
|
127
|
-
UpdateChatCommandResponse,
|
|
128
|
-
} from '../chat/endpoints/commands/update-chat.command';
|
|
129
|
-
import {
|
|
130
|
-
GetChatByUuidQuery,
|
|
131
|
-
GetChatByUuidQueryParams,
|
|
132
|
-
GetChatByUuidQueryResponse,
|
|
133
|
-
} from '../chat/endpoints/queries/get-chat-by-uuid.query';
|
|
134
|
-
import { GetChatsQuery, GetChatsQueryResponse } from '../chat/endpoints/queries/get-chats.query';
|
|
135
|
-
import { MESSAGE_CONTROLLER } from '../message/endpoints/message';
|
|
136
|
-
import {
|
|
137
|
-
CreateMessageCommand,
|
|
138
|
-
CreateMessageCommandBody,
|
|
139
|
-
CreateMessageCommandResponse,
|
|
140
|
-
} from '../message/endpoints/commands/create-message.command';
|
|
141
|
-
import {
|
|
142
|
-
DeleteMessageCommand,
|
|
143
|
-
DeleteMessageCommandParams,
|
|
144
|
-
DeleteMessageCommandResponse,
|
|
145
|
-
} from '../message/endpoints/commands/delete-message.command';
|
|
146
|
-
import {
|
|
147
|
-
GetMessageByUuidQuery,
|
|
148
|
-
GetMessageByUuidQueryParams,
|
|
149
|
-
GetMessageByUuidQueryResponse,
|
|
150
|
-
} from '../message/endpoints/queries/get-message-by-uuid.query';
|
|
151
|
-
import {
|
|
152
|
-
GetMessagesByChatQuery,
|
|
153
|
-
GetMessagesByChatQueryParams,
|
|
154
|
-
GetMessagesByChatQueryResponse,
|
|
155
|
-
} from '../message/endpoints/queries/get-messages-by-chat.query';
|
|
156
|
-
import {
|
|
157
|
-
GetMessagePriceEstimateQuery,
|
|
158
|
-
GetMessagePriceEstimateBody,
|
|
159
|
-
GetMessagePriceEstimateResponse,
|
|
160
|
-
} from '../message/endpoints/queries/get-message-price-estimate.query';
|
|
161
|
-
import { FILE_CONTROLLER } from '../file/endpoints/file';
|
|
162
|
-
import {
|
|
163
|
-
UploadFileCommand,
|
|
164
|
-
UploadFileCommandBody,
|
|
165
|
-
UploadFileCommandResponse,
|
|
166
|
-
} from '../file/endpoints/commands/upload-file.command';
|
|
167
|
-
import { SUPPORT_CONTROLLER } from '../support/endpoints/support';
|
|
168
|
-
import {
|
|
169
|
-
SendSupportMessageCommand,
|
|
170
|
-
SendSupportMessageCommandBody,
|
|
171
|
-
SendSupportMessageCommandResponse,
|
|
172
|
-
} from '../support/endpoints/commands/send-support-message.command';
|
|
173
|
-
import {
|
|
174
|
-
MarkSupportChatReadByUserCommand,
|
|
175
|
-
MarkSupportChatReadByUserCommandResponse,
|
|
176
|
-
} from '../support/endpoints/commands/mark-support-chat-read-by-user.command';
|
|
177
|
-
import {
|
|
178
|
-
GetSupportHistoryQuery,
|
|
179
|
-
GetSupportHistoryQueryQuery,
|
|
180
|
-
GetSupportHistoryQueryResponse,
|
|
181
|
-
} from '../support/endpoints/queries/get-support-history.query';
|
|
182
|
-
import {
|
|
183
|
-
GetSupportUnreadCountQuery,
|
|
184
|
-
GetSupportUnreadCountQueryResponse,
|
|
185
|
-
} from '../support/endpoints/queries/get-support-unread-count.query';
|
|
186
|
-
import {
|
|
187
|
-
SendAdminSupportReplyCommand,
|
|
188
|
-
SendAdminSupportReplyCommandBody,
|
|
189
|
-
SendAdminSupportReplyCommandParams,
|
|
190
|
-
SendAdminSupportReplyCommandResponse,
|
|
191
|
-
} from '../admin/endpoints/commands/send-admin-support-reply.command';
|
|
192
|
-
import {
|
|
193
|
-
MarkAdminSupportChatReadCommand,
|
|
194
|
-
MarkAdminSupportChatReadCommandParams,
|
|
195
|
-
MarkAdminSupportChatReadCommandResponse,
|
|
196
|
-
} from '../admin/endpoints/commands/mark-admin-support-chat-read.command';
|
|
197
|
-
import {
|
|
198
|
-
GetAdminSupportChatsQuery,
|
|
199
|
-
GetAdminSupportChatsQueryQuery,
|
|
200
|
-
GetAdminSupportChatsQueryResponse,
|
|
201
|
-
} from '../admin/endpoints/queries/get-admin-support-chats.query';
|
|
202
|
-
import {
|
|
203
|
-
GetAdminSupportChatMessagesQuery,
|
|
204
|
-
GetAdminSupportChatMessagesQueryParams,
|
|
205
|
-
GetAdminSupportChatMessagesQueryQuery,
|
|
206
|
-
GetAdminSupportChatMessagesQueryResponse,
|
|
207
|
-
} from '../admin/endpoints/queries/get-admin-support-chat-messages.query';
|
|
208
|
-
import { WALLET_CONTROLLER } from '../wallet/endpoints/wallet';
|
|
209
|
-
import {
|
|
210
|
-
GetWalletBalanceQuery,
|
|
211
|
-
GetWalletBalanceQueryResponse,
|
|
212
|
-
} from '../wallet/endpoints/queries/get-wallet-balance.query';
|
|
213
|
-
import {
|
|
214
|
-
GetWalletTransactionsQuery,
|
|
215
|
-
GetWalletTransactionsQueryQuery,
|
|
216
|
-
GetWalletTransactionsQueryResponse,
|
|
217
|
-
} from '../wallet/endpoints/queries/get-wallet-transactions.query';
|
|
218
|
-
import { PAYMENT_CONTROLLER } from '../payment/endpoints/payment';
|
|
219
|
-
import {
|
|
220
|
-
CreatePaymentCommand,
|
|
221
|
-
CreatePaymentCommandBody,
|
|
222
|
-
CreatePaymentCommandResponse,
|
|
223
|
-
} from '../payment/endpoints/commands/create-payment.command';
|
|
224
|
-
import { ORGANIZATION_CONTROLLER } from '../organization/endpoints/organization';
|
|
225
|
-
import {
|
|
226
|
-
GetOrganizationQuery,
|
|
227
|
-
GetOrganizationQueryResponse,
|
|
228
|
-
} from '../organization/endpoints/queries/get-organization.query';
|
|
229
|
-
import {
|
|
230
|
-
CreateAdminPageCommand,
|
|
231
|
-
CreateAdminPageCommandBody,
|
|
232
|
-
CreateAdminPageCommandResponse,
|
|
233
|
-
} from '../admin/endpoints/commands/create-admin-page.command';
|
|
234
|
-
import {
|
|
235
|
-
UpdateAdminPageCommand,
|
|
236
|
-
UpdateAdminPageCommandBody,
|
|
237
|
-
UpdateAdminPageCommandParams,
|
|
238
|
-
UpdateAdminPageCommandResponse,
|
|
239
|
-
} from '../admin/endpoints/commands/update-admin-page.command';
|
|
240
|
-
import {
|
|
241
|
-
UpdateAdminPageStatusCommand,
|
|
242
|
-
UpdateAdminPageStatusCommandBody,
|
|
243
|
-
UpdateAdminPageStatusCommandParams,
|
|
244
|
-
UpdateAdminPageStatusCommandResponse,
|
|
245
|
-
} from '../admin/endpoints/commands/update-admin-page-status.command';
|
|
246
|
-
import {
|
|
247
|
-
DeleteAdminPageCommand,
|
|
248
|
-
DeleteAdminPageCommandParams,
|
|
249
|
-
DeleteAdminPageCommandResponse,
|
|
250
|
-
} from '../admin/endpoints/commands/delete-admin-page.command';
|
|
251
|
-
import {
|
|
252
|
-
CreateAdminModelFamilyCommand,
|
|
253
|
-
CreateAdminModelFamilyCommandBody,
|
|
254
|
-
CreateAdminModelFamilyCommandResponse,
|
|
255
|
-
} from '../admin/endpoints/commands/create-admin-model-family.command';
|
|
256
|
-
import {
|
|
257
|
-
UpdateAdminModelFamilyCommand,
|
|
258
|
-
UpdateAdminModelFamilyCommandBody,
|
|
259
|
-
UpdateAdminModelFamilyCommandParams,
|
|
260
|
-
UpdateAdminModelFamilyCommandResponse,
|
|
261
|
-
} from '../admin/endpoints/commands/update-admin-model-family.command';
|
|
262
|
-
import {
|
|
263
|
-
DeleteAdminModelFamilyCommand,
|
|
264
|
-
DeleteAdminModelFamilyCommandParams,
|
|
265
|
-
DeleteAdminModelFamilyCommandResponse,
|
|
266
|
-
} from '../admin/endpoints/commands/delete-admin-model-family.command';
|
|
267
|
-
import {
|
|
268
|
-
UpdateAdminOrganizationCommand,
|
|
269
|
-
UpdateAdminOrganizationCommandBody,
|
|
270
|
-
UpdateAdminOrganizationCommandResponse,
|
|
271
|
-
} from '../admin/endpoints/commands/update-admin-organization.command';
|
|
272
|
-
import {
|
|
273
|
-
GetAdminPagesQuery,
|
|
274
|
-
GetAdminPagesQueryQuery,
|
|
275
|
-
GetAdminPagesQueryResponse,
|
|
276
|
-
} from '../admin/endpoints/queries/get-admin-pages.query';
|
|
277
|
-
import {
|
|
278
|
-
GetAdminPageQuery,
|
|
279
|
-
GetAdminPageQueryParams,
|
|
280
|
-
GetAdminPageQueryResponse,
|
|
281
|
-
} from '../admin/endpoints/queries/get-admin-page.query';
|
|
282
|
-
import {
|
|
283
|
-
GetAdminModelFamiliesQuery,
|
|
284
|
-
GetAdminModelFamiliesQueryResponse,
|
|
285
|
-
} from '../admin/endpoints/queries/get-admin-model-families.query';
|
|
286
|
-
import {
|
|
287
|
-
GetAdminOrganizationQuery,
|
|
288
|
-
GetAdminOrganizationQueryResponse,
|
|
289
|
-
} from '../admin/endpoints/queries/get-admin-organization.query';
|
|
290
|
-
import { AI_MODELS_CONTROLLER } from '../ai-model/endpoints/ai-model';
|
|
291
|
-
import {
|
|
292
|
-
GetPublicPageBySlugQuery,
|
|
293
|
-
GetPublicPageBySlugQueryParams,
|
|
294
|
-
GetPublicPageBySlugQueryResponse,
|
|
295
|
-
} from '../model-page/endpoints/queries/get-public-page-by-slug.query';
|
|
296
|
-
import { PUBLIC_MODEL_CONTROLLER, PUBLIC_PAGE_CONTROLLER } from '../model-page/endpoints/model-page';
|
|
297
|
-
import {
|
|
298
|
-
GetAiModelByUuidQuery,
|
|
299
|
-
GetAiModelByUuidQueryParams,
|
|
300
|
-
GetAiModelByUuidQueryResponse,
|
|
301
|
-
} from '../ai-model/endpoints/queries/get-ai-model-by-uuid.query';
|
|
302
|
-
import { GetAllAiModelsQuery, GetAllAiModelsQueryResponse } from '../ai-model/endpoints/queries/get-ai-models.query';
|
|
303
|
-
import {
|
|
304
|
-
GetPublicModelBySlugQuery,
|
|
305
|
-
GetPublicModelBySlugQueryParams,
|
|
306
|
-
GetPublicModelBySlugQueryResponse,
|
|
307
|
-
} from '../model-page/endpoints/queries/get-public-model-by-slug.query';
|
|
308
|
-
import {
|
|
309
|
-
ListPublicModelsQuery,
|
|
310
|
-
ListPublicModelsQueryResponse,
|
|
311
|
-
} from '../model-page/endpoints/queries/list-public-models.query';
|
|
312
|
-
import { MODEL_CATALOG_CONTROLLER } from '../model-catalog/endpoints/model-catalog';
|
|
313
|
-
import {
|
|
314
|
-
GetModelCatalogQuery,
|
|
315
|
-
GetModelCatalogQueryResponse,
|
|
316
|
-
} from '../model-catalog/endpoints/queries/get-model-catalog.query';
|
|
317
|
-
import { PRICING_PAGE_CONTROLLER } from '../pricing-page/endpoints/pricing-page';
|
|
318
|
-
import {
|
|
319
|
-
GetPricingPageQuery,
|
|
320
|
-
GetPricingPageQueryResponse,
|
|
321
|
-
} from '../pricing-page/endpoints/queries/get-pricing-page.query';
|
|
322
|
-
import { CONTACT_FORM_CONTROLLER } from '../contact-form/endpoints/contact-form';
|
|
323
|
-
import {
|
|
324
|
-
SubmitContactFormCommand,
|
|
325
|
-
SubmitContactFormCommandBody,
|
|
326
|
-
SubmitContactFormCommandResponse,
|
|
327
|
-
} from '../contact-form/endpoints/commands/submit-contact-form.command';
|
|
328
|
-
import { GENERATION_MODEL_CONTROLLER } from '../generation-model/endpoints/generation-model';
|
|
329
|
-
import {
|
|
330
|
-
GetGenerationModelsQuery,
|
|
331
|
-
GetGenerationModelsQueryResponse,
|
|
332
|
-
} from '../generation-model/endpoints/queries/get-generation-models.query';
|
|
333
|
-
import {
|
|
334
|
-
GetGenerationModelsByTypeQuery,
|
|
335
|
-
GetGenerationModelsByTypeQueryParams,
|
|
336
|
-
GetGenerationModelsByTypeQueryResponse,
|
|
337
|
-
} from '../generation-model/endpoints/queries/get-generation-models-by-type.query';
|
|
338
|
-
import {
|
|
339
|
-
GetMusicStylesQuery,
|
|
340
|
-
GetMusicStylesQueryResponse,
|
|
341
|
-
} from '../generation-model/endpoints/queries/get-music-styles.query';
|
|
342
|
-
import { GENERATION_JOB_CONTROLLER } from '../generation-job/endpoints/generation-job';
|
|
343
|
-
import {
|
|
344
|
-
CreateGenerationJobCommand,
|
|
345
|
-
CreateGenerationJobCommandBody,
|
|
346
|
-
CreateGenerationJobCommandResponse,
|
|
347
|
-
} from '../generation-job/endpoints/commands/create-generation-job.command';
|
|
348
|
-
import {
|
|
349
|
-
DeleteGenerationJobCommand,
|
|
350
|
-
DeleteGenerationJobCommandParams,
|
|
351
|
-
DeleteGenerationJobCommandResponse,
|
|
352
|
-
} from '../generation-job/endpoints/commands/delete-generation-job.command';
|
|
353
|
-
import {
|
|
354
|
-
UpdateGenerationJobCommand,
|
|
355
|
-
UpdateGenerationJobCommandBody,
|
|
356
|
-
UpdateGenerationJobCommandParams,
|
|
357
|
-
UpdateGenerationJobCommandResponse,
|
|
358
|
-
} from '../generation-job/endpoints/commands/update-generation-job.command';
|
|
359
|
-
import {
|
|
360
|
-
GetGenerationJobByUuidQuery,
|
|
361
|
-
GetGenerationJobByUuidQueryParams,
|
|
362
|
-
GetGenerationJobByUuidQueryResponse,
|
|
363
|
-
} from '../generation-job/endpoints/queries/get-generation-job-by-uuid.query';
|
|
364
|
-
import {
|
|
365
|
-
GetGenerationJobsQuery,
|
|
366
|
-
GetGenerationJobsQueryResponse,
|
|
367
|
-
} from '../generation-job/endpoints/queries/get-generation-jobs.query';
|
|
368
|
-
import {
|
|
369
|
-
GetGenerationJobHistoryQuery,
|
|
370
|
-
GetGenerationJobHistoryQueryQuery,
|
|
371
|
-
GetGenerationJobHistoryQueryResponse,
|
|
372
|
-
} from '../generation-job/endpoints/queries/get-generation-job-history.query';
|
|
373
|
-
import { GENERATION_JOB_CHAT_CONTROLLER } from '../generation-job-chat/endpoints/generation-job-chat';
|
|
374
|
-
import {
|
|
375
|
-
CreateGenerationJobChatCommand,
|
|
376
|
-
CreateGenerationJobChatCommandBody,
|
|
377
|
-
CreateGenerationJobChatCommandResponse,
|
|
378
|
-
} from '../generation-job-chat/endpoints/commands/create-generation-job-chat.command';
|
|
379
|
-
import {
|
|
380
|
-
UpdateGenerationJobChatCommand,
|
|
381
|
-
UpdateGenerationJobChatCommandBody,
|
|
382
|
-
UpdateGenerationJobChatCommandParams,
|
|
383
|
-
UpdateGenerationJobChatCommandResponse,
|
|
384
|
-
} from '../generation-job-chat/endpoints/commands/update-generation-job-chat.command';
|
|
385
|
-
import {
|
|
386
|
-
DeleteGenerationJobChatCommand,
|
|
387
|
-
DeleteGenerationJobChatCommandParams,
|
|
388
|
-
DeleteGenerationJobChatCommandResponse,
|
|
389
|
-
} from '../generation-job-chat/endpoints/commands/delete-generation-job-chat.command';
|
|
390
|
-
import {
|
|
391
|
-
GetGenerationJobChatsQuery,
|
|
392
|
-
GetGenerationJobChatsQueryQuery,
|
|
393
|
-
GetGenerationJobChatsQueryResponse,
|
|
394
|
-
} from '../generation-job-chat/endpoints/queries/get-generation-job-chats.query';
|
|
395
|
-
import {
|
|
396
|
-
GetGenerationJobChatByUuidQuery,
|
|
397
|
-
GetGenerationJobChatByUuidQueryParams,
|
|
398
|
-
GetGenerationJobChatByUuidQueryResponse,
|
|
399
|
-
} from '../generation-job-chat/endpoints/queries/get-generation-job-chat-by-uuid.query';
|
|
400
|
-
import {
|
|
401
|
-
GetGenerationPriceQuery,
|
|
402
|
-
GetGenerationPriceBodyParams,
|
|
403
|
-
GetGenerationPriceBody,
|
|
404
|
-
GetGenerationPriceResponse,
|
|
405
|
-
} from '../generation-model/endpoints/queries/get-generation-price.query';
|
|
406
|
-
import { MARKETPLACE_CARD_CONTROLLER } from '../marketplace-card/endpoints/marketplace-card';
|
|
407
|
-
import {
|
|
408
|
-
CreateMarketplaceCardCommand,
|
|
409
|
-
CreateMarketplaceCardCommandBody,
|
|
410
|
-
CreateMarketplaceCardCommandResponse,
|
|
411
|
-
} from '../marketplace-card/endpoints/commands/create-marketplace-card.command';
|
|
412
|
-
import {
|
|
413
|
-
DeleteMarketplaceCardCommand,
|
|
414
|
-
DeleteMarketplaceCardCommandParams,
|
|
415
|
-
DeleteMarketplaceCardCommandResponse,
|
|
416
|
-
} from '../marketplace-card/endpoints/commands/delete-marketplace-card.command';
|
|
417
|
-
import {
|
|
418
|
-
UpdateMarketplaceCardCommand,
|
|
419
|
-
UpdateMarketplaceCardCommandBody,
|
|
420
|
-
UpdateMarketplaceCardCommandParams,
|
|
421
|
-
UpdateMarketplaceCardCommandResponse,
|
|
422
|
-
} from '../marketplace-card/endpoints/commands/update-marketplace-card.command';
|
|
423
|
-
import {
|
|
424
|
-
GetMarketplaceCardQuery,
|
|
425
|
-
GetMarketplaceCardQueryParams,
|
|
426
|
-
GetMarketplaceCardQueryResponse,
|
|
427
|
-
} from '../marketplace-card/endpoints/queries/get-marketplace-card.query';
|
|
428
|
-
import {
|
|
429
|
-
GetMarketplaceCardHistoryQuery,
|
|
430
|
-
GetMarketplaceCardHistoryQueryQuery,
|
|
431
|
-
GetMarketplaceCardHistoryQueryResponse,
|
|
432
|
-
} from '../marketplace-card/endpoints/queries/get-marketplace-card-history.query';
|
|
433
|
-
import {
|
|
434
|
-
GetMarketplaceCardConfigQuery,
|
|
435
|
-
GetMarketplaceCardConfigResponse,
|
|
436
|
-
} from '../marketplace-card/endpoints/queries/get-marketplace-card-config.query';
|
|
437
|
-
import { USER_CONTEXT_CONTROLLER } from '../user-context/endpoints/user-context';
|
|
438
|
-
import {
|
|
439
|
-
GetUserContextQuery,
|
|
440
|
-
GetUserContextQueryResponse,
|
|
441
|
-
} from '../user-context/endpoints/queries/get-user-context.query';
|
|
442
|
-
import {
|
|
443
|
-
UpsertUserContextCommand,
|
|
444
|
-
UpsertUserContextCommandBody,
|
|
445
|
-
UpsertUserContextCommandResponse,
|
|
446
|
-
} from '../user-context/endpoints/commands/upsert-user-context.command';
|
|
447
|
-
import {
|
|
448
|
-
ToggleUserContextCommand,
|
|
449
|
-
ToggleUserContextCommandBody,
|
|
450
|
-
ToggleUserContextCommandResponse,
|
|
451
|
-
} from '../user-context/endpoints/commands/toggle-user-context.command';
|
|
452
|
-
|
|
453
|
-
const supportedHttpMethods = new Set(['get', 'post', 'put', 'patch', 'delete']);
|
|
454
|
-
|
|
455
|
-
type OpenApiResponse = {
|
|
456
|
-
description: string;
|
|
457
|
-
content: Record<string, { schema: z.ZodTypeAny }>;
|
|
458
|
-
};
|
|
459
|
-
|
|
460
|
-
function toOpenApiPath(controller: string, routePath: string): string {
|
|
461
|
-
const normalizedController = controller.replace(/^\/+|\/+$/g, '');
|
|
462
|
-
const normalizedRoute = routePath.replace(/^\/+|\/+$/g, '');
|
|
463
|
-
const joined = `/${normalizedController}/${normalizedRoute}`.replace(/\/+/g, '/');
|
|
464
|
-
|
|
465
|
-
return joined.replace(/:([^/]+)/g, '{$1}');
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
function buildResponses(
|
|
469
|
-
contractsResponses: HttpContract['responses'],
|
|
470
|
-
schemaResolver: (schema: z.ZodTypeAny) => z.ZodTypeAny,
|
|
471
|
-
): Record<string, OpenApiResponse> {
|
|
472
|
-
const entries = Object.entries(contractsResponses).map(([status, schema]): [string, OpenApiResponse] => {
|
|
473
|
-
return [
|
|
474
|
-
status,
|
|
475
|
-
{
|
|
476
|
-
description: `HTTP ${status}`,
|
|
477
|
-
content: {
|
|
478
|
-
'application/json': {
|
|
479
|
-
schema: schemaResolver(schema),
|
|
480
|
-
},
|
|
481
|
-
},
|
|
482
|
-
},
|
|
483
|
-
];
|
|
484
|
-
});
|
|
485
|
-
|
|
486
|
-
return Object.fromEntries(entries);
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
function buildSseSuccessResponses(
|
|
490
|
-
contractsResponses: HttpContract['responses'],
|
|
491
|
-
successStatus: number,
|
|
492
|
-
schemaResolver: (schema: z.ZodTypeAny) => z.ZodTypeAny,
|
|
493
|
-
): Record<string, OpenApiResponse> {
|
|
494
|
-
const entries = Object.entries(contractsResponses).map(([status, schema]): [string, OpenApiResponse] => {
|
|
495
|
-
const statusCode = Number(status);
|
|
496
|
-
const contentType = statusCode === successStatus ? 'text/event-stream' : 'application/json';
|
|
497
|
-
|
|
498
|
-
return [
|
|
499
|
-
status,
|
|
500
|
-
{
|
|
501
|
-
description: `HTTP ${status}`,
|
|
502
|
-
content: {
|
|
503
|
-
[contentType]: {
|
|
504
|
-
schema: schemaResolver(schema),
|
|
505
|
-
},
|
|
506
|
-
},
|
|
507
|
-
},
|
|
508
|
-
];
|
|
509
|
-
});
|
|
510
|
-
|
|
511
|
-
return Object.fromEntries(entries);
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
async function main() {
|
|
515
|
-
const registry = new OpenAPIRegistry();
|
|
516
|
-
const schemaMap = new WeakMap<z.ZodTypeAny, z.ZodTypeAny>();
|
|
517
|
-
|
|
518
|
-
const registerSchema = <T extends z.ZodTypeAny>(name: string, schema: T): T => {
|
|
519
|
-
const registered = schema.meta({ id: name });
|
|
520
|
-
schemaMap.set(schema, registered);
|
|
521
|
-
return registered;
|
|
522
|
-
};
|
|
523
|
-
|
|
524
|
-
const resolveSchema = <T extends z.ZodTypeAny>(schema: T): T => (schemaMap.get(schema) as T | undefined) ?? schema;
|
|
525
|
-
|
|
526
|
-
registerSchema('HttpErrorResponse', HttpErrorResponseSchema);
|
|
527
|
-
registerSchema('HttpSuccessResponse', HttpSuccessResponseSchema);
|
|
528
|
-
registerSchema('AuthLoginRequest', AuthLoginSchema.LoginCommandBody);
|
|
529
|
-
registerSchema('AuthLoginResponse', AuthLoginSchema.LoginCommandResponse);
|
|
530
|
-
registerSchema('AuthRegisterRequest', AuthRegisterSchema.RegisterCommandBody);
|
|
531
|
-
registerSchema('AuthRegisterResponse', AuthRegisterSchema.RegisterCommandResponse);
|
|
532
|
-
registerSchema('AuthResetPasswordRequest', AuthResetPasswordSchema.ResetPasswordCommandBody);
|
|
533
|
-
registerSchema('AuthResetPasswordResponse', AuthResetPasswordSchema.ResetPasswordCommandResponse);
|
|
534
|
-
registerSchema('AuthRestorePasswordRequest', AuthRestorePasswordSchema.RestorePasswordCommandBody);
|
|
535
|
-
registerSchema('AuthRestorePasswordResponse', AuthRestorePasswordSchema.RestorePasswordCommandResponse);
|
|
536
|
-
registerSchema('AuthVerifyEmailRequest', AuthVerifyEmailSchema.VerifyEmailCommandBody);
|
|
537
|
-
registerSchema('AuthVerifyEmailResponse', AuthVerifyEmailSchema.VerifyEmailCommandResponse);
|
|
538
|
-
registerSchema('AuthVerifyEmailRetryRequest', AuthVerifyEmailRetrySchema.VerifyEmailRetryCommandBody);
|
|
539
|
-
registerSchema('AuthVerifyEmailRetryResponse', AuthVerifyEmailRetrySchema.VerifyEmailRetryCommandResponse);
|
|
540
|
-
registerSchema('AuthDeleteAccountResponse', AuthDeleteAccountSchema.DeleteAccountCommandResponse);
|
|
541
|
-
registerSchema('AuthChangePasswordRequest', AuthChangePasswordSchema.ChangePasswordCommandBody);
|
|
542
|
-
registerSchema('AuthChangePasswordResponse', AuthChangePasswordSchema.ChangePasswordCommandResponse);
|
|
543
|
-
registerSchema('ChatCreateRequest', CreateChatCommandBody);
|
|
544
|
-
registerSchema('ChatCreateResponse', CreateChatCommandResponse);
|
|
545
|
-
registerSchema('ChatGetAllResponse', GetChatsQueryResponse);
|
|
546
|
-
registerSchema('ChatGetByUuidParams', GetChatByUuidQueryParams);
|
|
547
|
-
registerSchema('ChatGetByUuidResponse', GetChatByUuidQueryResponse);
|
|
548
|
-
registerSchema('ChatUpdateParams', UpdateChatCommandParams);
|
|
549
|
-
registerSchema('ChatUpdateRequest', UpdateChatCommandBody);
|
|
550
|
-
registerSchema('ChatUpdateResponse', UpdateChatCommandResponse);
|
|
551
|
-
registerSchema('ChatDeleteParams', DeleteChatCommandParams);
|
|
552
|
-
registerSchema('ChatDeleteResponse', DeleteChatCommandResponse);
|
|
553
|
-
registerSchema('MessageCreateRequest', CreateMessageCommandBody);
|
|
554
|
-
registerSchema('MessageCreateResponse', CreateMessageCommandResponse);
|
|
555
|
-
registerSchema('MessageGetByUuidParams', GetMessageByUuidQueryParams);
|
|
556
|
-
registerSchema('MessageGetByUuidResponse', GetMessageByUuidQueryResponse);
|
|
557
|
-
registerSchema('MessageGetByChatParams', GetMessagesByChatQueryParams);
|
|
558
|
-
registerSchema('MessageGetByChatResponse', GetMessagesByChatQueryResponse);
|
|
559
|
-
registerSchema('MessagePriceEstimateBody', GetMessagePriceEstimateBody);
|
|
560
|
-
registerSchema('MessagePriceEstimateResponse', GetMessagePriceEstimateResponse);
|
|
561
|
-
registerSchema('MessageDeleteParams', DeleteMessageCommandParams);
|
|
562
|
-
registerSchema('MessageDeleteResponse', DeleteMessageCommandResponse);
|
|
563
|
-
registerSchema('FileUploadRequest', UploadFileCommandBody);
|
|
564
|
-
registerSchema('FileUploadResponse', UploadFileCommandResponse);
|
|
565
|
-
registerSchema('WalletBalanceResponse', GetWalletBalanceQueryResponse);
|
|
566
|
-
registerSchema('WalletTransactionsQuery', GetWalletTransactionsQueryQuery);
|
|
567
|
-
registerSchema('WalletTransactionsResponse', GetWalletTransactionsQueryResponse);
|
|
568
|
-
registerSchema('PaymentCreateRequest', CreatePaymentCommandBody);
|
|
569
|
-
registerSchema('PaymentCreateResponse', CreatePaymentCommandResponse);
|
|
570
|
-
registerSchema('AiModelsGetAllResponse', GetAllAiModelsQueryResponse);
|
|
571
|
-
registerSchema('AiModelsGetByUuidParams', GetAiModelByUuidQueryParams);
|
|
572
|
-
registerSchema('AiModelsGetByUuidResponse', GetAiModelByUuidQueryResponse);
|
|
573
|
-
registerSchema('PublicModelsListResponse', ListPublicModelsQueryResponse);
|
|
574
|
-
registerSchema('PublicModelsGetBySlugParams', GetPublicModelBySlugQueryParams);
|
|
575
|
-
registerSchema('PublicModelsGetBySlugResponse', GetPublicModelBySlugQueryResponse);
|
|
576
|
-
registerSchema('ModelCatalogGetAllResponse', GetModelCatalogQueryResponse);
|
|
577
|
-
registerSchema('PricingPageGetResponse', GetPricingPageQueryResponse);
|
|
578
|
-
registerSchema('ContactFormSubmitRequest', SubmitContactFormCommandBody);
|
|
579
|
-
registerSchema('ContactFormSubmitResponse', SubmitContactFormCommandResponse);
|
|
580
|
-
registerSchema('GenerationModelGetAllResponse', GetGenerationModelsQueryResponse);
|
|
581
|
-
registerSchema('GenerationModelGetByTypeParams', GetGenerationModelsByTypeQueryParams);
|
|
582
|
-
registerSchema('GenerationModelGetByTypeResponse', GetGenerationModelsByTypeQueryResponse);
|
|
583
|
-
registerSchema('GenerationModelGetMusicStylesResponse', GetMusicStylesQueryResponse);
|
|
584
|
-
registerSchema('GenerationJobCreateRequest', CreateGenerationJobCommandBody);
|
|
585
|
-
registerSchema('GenerationJobCreateResponse', CreateGenerationJobCommandResponse);
|
|
586
|
-
registerSchema('GenerationJobGetAllResponse', GetGenerationJobsQueryResponse);
|
|
587
|
-
registerSchema('GenerationJobGetByUuidParams', GetGenerationJobByUuidQueryParams);
|
|
588
|
-
registerSchema('GenerationJobGetByUuidResponse', GetGenerationJobByUuidQueryResponse);
|
|
589
|
-
registerSchema('GenerationJobUpdateParams', UpdateGenerationJobCommandParams);
|
|
590
|
-
registerSchema('GenerationJobUpdateRequest', UpdateGenerationJobCommandBody);
|
|
591
|
-
registerSchema('GenerationJobUpdateResponse', UpdateGenerationJobCommandResponse);
|
|
592
|
-
registerSchema('GenerationJobDeleteParams', DeleteGenerationJobCommandParams);
|
|
593
|
-
registerSchema('GenerationJobDeleteResponse', DeleteGenerationJobCommandResponse);
|
|
594
|
-
registerSchema('GenerationJobHistoryQuery', GetGenerationJobHistoryQueryQuery);
|
|
595
|
-
registerSchema('GenerationJobHistoryResponse', GetGenerationJobHistoryQueryResponse);
|
|
596
|
-
registerSchema('GenerationJobChatCreateRequest', CreateGenerationJobChatCommandBody);
|
|
597
|
-
registerSchema('GenerationJobChatCreateResponse', CreateGenerationJobChatCommandResponse);
|
|
598
|
-
registerSchema('GenerationJobChatGetAllQuery', GetGenerationJobChatsQueryQuery);
|
|
599
|
-
registerSchema('GenerationJobChatGetAllResponse', GetGenerationJobChatsQueryResponse);
|
|
600
|
-
registerSchema('GenerationJobChatGetByUuidParams', GetGenerationJobChatByUuidQueryParams);
|
|
601
|
-
registerSchema('GenerationJobChatGetByUuidResponse', GetGenerationJobChatByUuidQueryResponse);
|
|
602
|
-
registerSchema('GenerationJobChatUpdateParams', UpdateGenerationJobChatCommandParams);
|
|
603
|
-
registerSchema('GenerationJobChatUpdateRequest', UpdateGenerationJobChatCommandBody);
|
|
604
|
-
registerSchema('GenerationJobChatUpdateResponse', UpdateGenerationJobChatCommandResponse);
|
|
605
|
-
registerSchema('GenerationJobChatDeleteParams', DeleteGenerationJobChatCommandParams);
|
|
606
|
-
registerSchema('GenerationJobChatDeleteResponse', DeleteGenerationJobChatCommandResponse);
|
|
607
|
-
registerSchema('GenerationPriceParams', GetGenerationPriceBodyParams);
|
|
608
|
-
registerSchema('GenerationPriceRequest', GetGenerationPriceBody);
|
|
609
|
-
registerSchema('GenerationPriceResponse', GetGenerationPriceResponse);
|
|
610
|
-
registerSchema('AdminBanUserParams', BanAdminUserCommandParams);
|
|
611
|
-
registerSchema('AdminBanUserResponse', BanAdminUserCommandResponse);
|
|
612
|
-
registerSchema('AdminCreatePartnerBonusOperationParams', CreateAdminPartnerBonusOperationCommandParams);
|
|
613
|
-
registerSchema('AdminCreatePartnerBonusOperationRequest', CreateAdminPartnerBonusOperationCommandBody);
|
|
614
|
-
registerSchema('AdminCreatePartnerBonusOperationResponse', CreateAdminPartnerBonusOperationCommandResponse);
|
|
615
|
-
registerSchema('AdminUpdatePartnerReferralConfigParams', UpdateAdminPartnerReferralConfigCommandParams);
|
|
616
|
-
registerSchema('AdminUpdatePartnerReferralConfigRequest', UpdateAdminPartnerReferralConfigCommandBody);
|
|
617
|
-
registerSchema('AdminUpdatePartnerReferralConfigResponse', UpdateAdminPartnerReferralConfigCommandResponse);
|
|
618
|
-
registerSchema('AdminUpdateReferralConfigRequest', UpdateAdminReferralConfigCommandBody);
|
|
619
|
-
registerSchema('AdminGetPartnersQuery', GetAdminPartnersQueryQuery);
|
|
620
|
-
registerSchema('AdminGetPartnersResponse', GetAdminPartnersQueryResponse);
|
|
621
|
-
registerSchema('AdminGetPartnerParams', GetAdminPartnerQueryParams);
|
|
622
|
-
registerSchema('AdminGetPartnerResponse', GetAdminPartnerQueryResponse);
|
|
623
|
-
registerSchema('AdminGetPartnerBonusOpsParams', GetAdminPartnerBonusOperationsQueryParams);
|
|
624
|
-
registerSchema('AdminGetPartnerBonusOpsQuery', GetAdminPartnerBonusOperationsQueryQuery);
|
|
625
|
-
registerSchema('AdminGetPartnerBonusOpsResponse', GetAdminPartnerBonusOperationsQueryResponse);
|
|
626
|
-
registerSchema('AdminGetPartnerL2BonusesParams', GetAdminPartnerL2BonusesQueryParams);
|
|
627
|
-
registerSchema('AdminGetPartnerL2BonusesQuery', GetAdminPartnerL2BonusesQueryQuery);
|
|
628
|
-
registerSchema('AdminGetPartnerL2BonusesResponse', GetAdminPartnerL2BonusesQueryResponse);
|
|
629
|
-
registerSchema('AdminGetPartnerRefConfigParams', GetAdminPartnerReferralConfigQueryParams);
|
|
630
|
-
registerSchema('AdminGetPartnerRefConfigResponse', GetAdminPartnerReferralConfigQueryResponse);
|
|
631
|
-
registerSchema('AdminGetPartnerReferralsParams', GetAdminPartnerReferralsQueryParams);
|
|
632
|
-
registerSchema('AdminGetPartnerReferralsQuery', GetAdminPartnerReferralsQueryQuery);
|
|
633
|
-
registerSchema('AdminGetPartnerReferralsResponse', GetAdminPartnerReferralsQueryResponse);
|
|
634
|
-
registerSchema('AdminGetReferralConfigResponse', GetAdminReferralConfigQueryResponse);
|
|
635
|
-
registerSchema('AdminGetUsersQuery', GetAdminUsersQueryQuery);
|
|
636
|
-
registerSchema('AdminGetUsersResponse', GetAdminUsersQueryResponse);
|
|
637
|
-
registerSchema('AdminGetUserParams', GetAdminUserQueryParams);
|
|
638
|
-
registerSchema('AdminGetUserResponse', GetAdminUserQueryResponse);
|
|
639
|
-
registerSchema('AdminGetUserTransactionsQuery', GetAdminUserTransactionsQueryQuery);
|
|
640
|
-
registerSchema('AdminGetUserTransactionsResponse', GetAdminUserTransactionsQueryResponse);
|
|
641
|
-
registerSchema('AdminGetStatsQuery', GetAdminStatsQueryQuery);
|
|
642
|
-
registerSchema('AdminGetStatsResponse', GetAdminStatsQueryResponse);
|
|
643
|
-
registerSchema('AdminGetKieBalanceResponse', GetAdminKieBalanceQueryResponse);
|
|
644
|
-
registerSchema('AdminGetSupportChatsQuery', GetAdminSupportChatsQueryQuery);
|
|
645
|
-
registerSchema('AdminGetSupportChatsResponse', GetAdminSupportChatsQueryResponse);
|
|
646
|
-
registerSchema('AdminGetSupportChatMessagesParams', GetAdminSupportChatMessagesQueryParams);
|
|
647
|
-
registerSchema('AdminGetSupportChatMessagesQuery', GetAdminSupportChatMessagesQueryQuery);
|
|
648
|
-
registerSchema('AdminGetSupportChatMessagesResponse', GetAdminSupportChatMessagesQueryResponse);
|
|
649
|
-
registerSchema('AdminSendSupportReplyParams', SendAdminSupportReplyCommandParams);
|
|
650
|
-
registerSchema('AdminSendSupportReplyRequest', SendAdminSupportReplyCommandBody);
|
|
651
|
-
registerSchema('AdminSendSupportReplyResponse', SendAdminSupportReplyCommandResponse);
|
|
652
|
-
registerSchema('AdminMarkSupportChatReadParams', MarkAdminSupportChatReadCommandParams);
|
|
653
|
-
registerSchema('AdminMarkSupportChatReadResponse', MarkAdminSupportChatReadCommandResponse);
|
|
654
|
-
registerSchema('SupportSendMessageRequest', SendSupportMessageCommandBody);
|
|
655
|
-
registerSchema('SupportSendMessageResponse', SendSupportMessageCommandResponse);
|
|
656
|
-
registerSchema('SupportGetHistoryQuery', GetSupportHistoryQueryQuery);
|
|
657
|
-
registerSchema('SupportGetHistoryResponse', GetSupportHistoryQueryResponse);
|
|
658
|
-
registerSchema('SupportGetUnreadCountResponse', GetSupportUnreadCountQueryResponse);
|
|
659
|
-
registerSchema('SupportMarkReadResponse', MarkSupportChatReadByUserCommandResponse);
|
|
660
|
-
registerSchema('MarketplaceCardCreateRequest', CreateMarketplaceCardCommandBody);
|
|
661
|
-
registerSchema('MarketplaceCardCreateResponse', CreateMarketplaceCardCommandResponse);
|
|
662
|
-
registerSchema('MarketplaceCardGetByUuidParams', GetMarketplaceCardQueryParams);
|
|
663
|
-
registerSchema('MarketplaceCardGetByUuidResponse', GetMarketplaceCardQueryResponse);
|
|
664
|
-
registerSchema('MarketplaceCardUpdateParams', UpdateMarketplaceCardCommandParams);
|
|
665
|
-
registerSchema('MarketplaceCardUpdateRequest', UpdateMarketplaceCardCommandBody);
|
|
666
|
-
registerSchema('MarketplaceCardUpdateResponse', UpdateMarketplaceCardCommandResponse);
|
|
667
|
-
registerSchema('MarketplaceCardDeleteParams', DeleteMarketplaceCardCommandParams);
|
|
668
|
-
registerSchema('MarketplaceCardDeleteResponse', DeleteMarketplaceCardCommandResponse);
|
|
669
|
-
registerSchema('MarketplaceCardHistoryQuery', GetMarketplaceCardHistoryQueryQuery);
|
|
670
|
-
registerSchema('MarketplaceCardHistoryResponse', GetMarketplaceCardHistoryQueryResponse);
|
|
671
|
-
registerSchema('MarketplaceCardConfigResponse', GetMarketplaceCardConfigResponse);
|
|
672
|
-
registerSchema('AdminGetPagesQuery', GetAdminPagesQueryQuery);
|
|
673
|
-
registerSchema('AdminGetPagesResponse', GetAdminPagesQueryResponse);
|
|
674
|
-
registerSchema('AdminGetPageParams', GetAdminPageQueryParams);
|
|
675
|
-
registerSchema('AdminGetPageResponse', GetAdminPageQueryResponse);
|
|
676
|
-
registerSchema('AdminCreatePageRequest', CreateAdminPageCommandBody);
|
|
677
|
-
registerSchema('AdminCreatePageResponse', CreateAdminPageCommandResponse);
|
|
678
|
-
registerSchema('AdminUpdatePageParams', UpdateAdminPageCommandParams);
|
|
679
|
-
registerSchema('AdminUpdatePageRequest', UpdateAdminPageCommandBody);
|
|
680
|
-
registerSchema('AdminUpdatePageResponse', UpdateAdminPageCommandResponse);
|
|
681
|
-
registerSchema('AdminUpdatePageStatusParams', UpdateAdminPageStatusCommandParams);
|
|
682
|
-
registerSchema('AdminUpdatePageStatusRequest', UpdateAdminPageStatusCommandBody);
|
|
683
|
-
registerSchema('AdminUpdatePageStatusResponse', UpdateAdminPageStatusCommandResponse);
|
|
684
|
-
registerSchema('AdminDeletePageParams', DeleteAdminPageCommandParams);
|
|
685
|
-
registerSchema('AdminDeletePageResponse', DeleteAdminPageCommandResponse);
|
|
686
|
-
registerSchema('AdminGetModelFamiliesResponse', GetAdminModelFamiliesQueryResponse);
|
|
687
|
-
registerSchema('AdminCreateModelFamilyRequest', CreateAdminModelFamilyCommandBody);
|
|
688
|
-
registerSchema('AdminCreateModelFamilyResponse', CreateAdminModelFamilyCommandResponse);
|
|
689
|
-
registerSchema('AdminUpdateModelFamilyParams', UpdateAdminModelFamilyCommandParams);
|
|
690
|
-
registerSchema('AdminUpdateModelFamilyRequest', UpdateAdminModelFamilyCommandBody);
|
|
691
|
-
registerSchema('AdminUpdateModelFamilyResponse', UpdateAdminModelFamilyCommandResponse);
|
|
692
|
-
registerSchema('AdminDeleteModelFamilyParams', DeleteAdminModelFamilyCommandParams);
|
|
693
|
-
registerSchema('AdminDeleteModelFamilyResponse', DeleteAdminModelFamilyCommandResponse);
|
|
694
|
-
registerSchema('AdminGetOrganizationResponse', GetAdminOrganizationQueryResponse);
|
|
695
|
-
registerSchema('AdminUpdateOrganizationRequest', UpdateAdminOrganizationCommandBody);
|
|
696
|
-
registerSchema('AdminUpdateOrganizationResponse', UpdateAdminOrganizationCommandResponse);
|
|
697
|
-
registerSchema('OrganizationGetResponse', GetOrganizationQueryResponse);
|
|
698
|
-
registerSchema('PublicPageGetBySlugParams', GetPublicPageBySlugQueryParams);
|
|
699
|
-
registerSchema('PublicPageGetBySlugResponse', GetPublicPageBySlugQueryResponse);
|
|
700
|
-
registerSchema('UserContextGetResponse', GetUserContextQueryResponse);
|
|
701
|
-
registerSchema('UserContextUpsertRequest', UpsertUserContextCommandBody);
|
|
702
|
-
registerSchema('UserContextUpsertResponse', UpsertUserContextCommandResponse);
|
|
703
|
-
registerSchema('UserContextToggleRequest', ToggleUserContextCommandBody);
|
|
704
|
-
registerSchema('UserContextToggleResponse', ToggleUserContextCommandResponse);
|
|
705
|
-
|
|
706
|
-
const authContracts: HttpContract[] = [
|
|
707
|
-
RegisterCommand,
|
|
708
|
-
LoginCommand,
|
|
709
|
-
DeleteAccountCommand,
|
|
710
|
-
ResetPasswordCommand,
|
|
711
|
-
RestorePasswordCommand,
|
|
712
|
-
ChangePasswordCommand,
|
|
713
|
-
VerifyEmailCommand,
|
|
714
|
-
VerifyEmailRetryCommand,
|
|
715
|
-
];
|
|
716
|
-
const chatContracts: HttpContract[] = [
|
|
717
|
-
CreateChatCommand,
|
|
718
|
-
GetChatsQuery,
|
|
719
|
-
GetChatByUuidQuery,
|
|
720
|
-
UpdateChatCommand,
|
|
721
|
-
DeleteChatCommand,
|
|
722
|
-
];
|
|
723
|
-
const messageContracts: HttpContract[] = [
|
|
724
|
-
CreateMessageCommand,
|
|
725
|
-
GetMessagePriceEstimateQuery,
|
|
726
|
-
GetMessagesByChatQuery,
|
|
727
|
-
GetMessageByUuidQuery,
|
|
728
|
-
DeleteMessageCommand,
|
|
729
|
-
];
|
|
730
|
-
const fileContracts: HttpContract[] = [UploadFileCommand];
|
|
731
|
-
const supportContracts: HttpContract[] = [
|
|
732
|
-
SendSupportMessageCommand,
|
|
733
|
-
GetSupportHistoryQuery,
|
|
734
|
-
GetSupportUnreadCountQuery,
|
|
735
|
-
MarkSupportChatReadByUserCommand,
|
|
736
|
-
];
|
|
737
|
-
const walletContracts: HttpContract[] = [GetWalletBalanceQuery, GetWalletTransactionsQuery];
|
|
738
|
-
const paymentContracts: HttpContract[] = [CreatePaymentCommand];
|
|
739
|
-
const userContextContracts: HttpContract[] = [
|
|
740
|
-
GetUserContextQuery,
|
|
741
|
-
UpsertUserContextCommand,
|
|
742
|
-
ToggleUserContextCommand,
|
|
743
|
-
];
|
|
744
|
-
const marketplaceCardContracts: HttpContract[] = [
|
|
745
|
-
CreateMarketplaceCardCommand,
|
|
746
|
-
GetMarketplaceCardHistoryQuery,
|
|
747
|
-
GetMarketplaceCardConfigQuery,
|
|
748
|
-
GetMarketplaceCardQuery,
|
|
749
|
-
UpdateMarketplaceCardCommand,
|
|
750
|
-
DeleteMarketplaceCardCommand,
|
|
751
|
-
];
|
|
752
|
-
const aiModelContracts: HttpContract[] = [GetAllAiModelsQuery, GetAiModelByUuidQuery];
|
|
753
|
-
const publicModelContracts: HttpContract[] = [ListPublicModelsQuery, GetPublicModelBySlugQuery];
|
|
754
|
-
const publicPageContracts: HttpContract[] = [GetPublicPageBySlugQuery];
|
|
755
|
-
const modelCatalogContracts: HttpContract[] = [GetModelCatalogQuery];
|
|
756
|
-
const pricingPageContracts: HttpContract[] = [GetPricingPageQuery];
|
|
757
|
-
const contactFormContracts: HttpContract[] = [SubmitContactFormCommand];
|
|
758
|
-
const generationModelContracts: HttpContract[] = [
|
|
759
|
-
GetGenerationModelsQuery,
|
|
760
|
-
GetGenerationModelsByTypeQuery,
|
|
761
|
-
GetGenerationPriceQuery,
|
|
762
|
-
GetMusicStylesQuery,
|
|
763
|
-
];
|
|
764
|
-
const generationJobContracts: HttpContract[] = [
|
|
765
|
-
CreateGenerationJobCommand,
|
|
766
|
-
GetGenerationJobsQuery,
|
|
767
|
-
GetGenerationJobByUuidQuery,
|
|
768
|
-
GetGenerationJobHistoryQuery,
|
|
769
|
-
UpdateGenerationJobCommand,
|
|
770
|
-
DeleteGenerationJobCommand,
|
|
771
|
-
];
|
|
772
|
-
const generationJobChatContracts: HttpContract[] = [
|
|
773
|
-
CreateGenerationJobChatCommand,
|
|
774
|
-
GetGenerationJobChatsQuery,
|
|
775
|
-
GetGenerationJobChatByUuidQuery,
|
|
776
|
-
UpdateGenerationJobChatCommand,
|
|
777
|
-
DeleteGenerationJobChatCommand,
|
|
778
|
-
];
|
|
779
|
-
const adminContracts: HttpContract[] = [
|
|
780
|
-
BanAdminUserCommand,
|
|
781
|
-
CreateAdminPartnerBonusOperationCommand,
|
|
782
|
-
UpdateAdminPartnerReferralConfigCommand,
|
|
783
|
-
UpdateAdminReferralConfigCommand,
|
|
784
|
-
GetAdminPartnersQuery,
|
|
785
|
-
GetAdminPartnerQuery,
|
|
786
|
-
GetAdminPartnerBonusOperationsQuery,
|
|
787
|
-
GetAdminPartnerL2BonusesQuery,
|
|
788
|
-
GetAdminPartnerReferralConfigQuery,
|
|
789
|
-
GetAdminPartnerReferralsQuery,
|
|
790
|
-
GetAdminReferralConfigQuery,
|
|
791
|
-
GetAdminUsersQuery,
|
|
792
|
-
GetAdminUserQuery,
|
|
793
|
-
GetAdminUserTransactionsQuery,
|
|
794
|
-
GetAdminStatsQuery,
|
|
795
|
-
GetAdminKieBalanceQuery,
|
|
796
|
-
GetAdminSupportChatsQuery,
|
|
797
|
-
GetAdminSupportChatMessagesQuery,
|
|
798
|
-
SendAdminSupportReplyCommand,
|
|
799
|
-
MarkAdminSupportChatReadCommand,
|
|
800
|
-
GetAdminPagesQuery,
|
|
801
|
-
GetAdminPageQuery,
|
|
802
|
-
CreateAdminPageCommand,
|
|
803
|
-
UpdateAdminPageCommand,
|
|
804
|
-
UpdateAdminPageStatusCommand,
|
|
805
|
-
DeleteAdminPageCommand,
|
|
806
|
-
GetAdminModelFamiliesQuery,
|
|
807
|
-
CreateAdminModelFamilyCommand,
|
|
808
|
-
UpdateAdminModelFamilyCommand,
|
|
809
|
-
DeleteAdminModelFamilyCommand,
|
|
810
|
-
GetAdminOrganizationQuery,
|
|
811
|
-
UpdateAdminOrganizationCommand,
|
|
812
|
-
];
|
|
813
|
-
const organizationContracts: HttpContract[] = [GetOrganizationQuery];
|
|
814
|
-
|
|
815
|
-
const DEFAULT_BODY_CONTENT_TYPE = 'application/json';
|
|
816
|
-
const SSE_CREATED_CONTRACTS = new Set<HttpContract>([CreateMessageCommand]);
|
|
817
|
-
|
|
818
|
-
const registerContractGroup = ({
|
|
819
|
-
controller,
|
|
820
|
-
tag,
|
|
821
|
-
contracts,
|
|
822
|
-
bodyContentType = DEFAULT_BODY_CONTENT_TYPE,
|
|
823
|
-
}: ContractGroup): void => {
|
|
824
|
-
for (const contract of contracts) {
|
|
825
|
-
const method = contract.method.toLowerCase();
|
|
826
|
-
|
|
827
|
-
if (!supportedHttpMethods.has(method)) {
|
|
828
|
-
throw new Error(`Unsupported HTTP method: ${contract.method}`);
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
registry.registerPath({
|
|
832
|
-
method: method as 'get' | 'post' | 'put' | 'patch' | 'delete',
|
|
833
|
-
path: toOpenApiPath(controller, contract.path),
|
|
834
|
-
summary: contract.summary,
|
|
835
|
-
tags: [tag],
|
|
836
|
-
request: {
|
|
837
|
-
...(contract.request?.body
|
|
838
|
-
? {
|
|
839
|
-
body: {
|
|
840
|
-
required: true,
|
|
841
|
-
content: {
|
|
842
|
-
[bodyContentType]: {
|
|
843
|
-
schema: resolveSchema(contract.request.body),
|
|
844
|
-
},
|
|
845
|
-
},
|
|
846
|
-
},
|
|
847
|
-
}
|
|
848
|
-
: {}),
|
|
849
|
-
...(contract.request?.query ? { query: resolveSchema(contract.request.query) } : {}),
|
|
850
|
-
...(contract.request?.params ? { params: resolveSchema(contract.request.params) } : {}),
|
|
851
|
-
},
|
|
852
|
-
responses: SSE_CREATED_CONTRACTS.has(contract)
|
|
853
|
-
? buildSseSuccessResponses(contract.responses, 201, resolveSchema)
|
|
854
|
-
: buildResponses(contract.responses, resolveSchema),
|
|
855
|
-
});
|
|
856
|
-
}
|
|
857
|
-
};
|
|
858
|
-
|
|
859
|
-
const contractGroups: ContractGroup[] = [
|
|
860
|
-
{ controller: AUTH_CONTROLLER, tag: 'Auth', contracts: authContracts },
|
|
861
|
-
{ controller: CHAT_CONTROLLER, tag: 'Chat', contracts: chatContracts },
|
|
862
|
-
{ controller: MESSAGE_CONTROLLER, tag: 'Message', contracts: messageContracts },
|
|
863
|
-
{ controller: FILE_CONTROLLER, tag: 'File', contracts: fileContracts, bodyContentType: 'multipart/form-data' },
|
|
864
|
-
{ controller: SUPPORT_CONTROLLER, tag: 'Support', contracts: supportContracts },
|
|
865
|
-
{ controller: WALLET_CONTROLLER, tag: 'Wallet', contracts: walletContracts },
|
|
866
|
-
{ controller: PAYMENT_CONTROLLER, tag: 'Payment', contracts: paymentContracts },
|
|
867
|
-
{ controller: AI_MODELS_CONTROLLER, tag: 'AI Models', contracts: aiModelContracts },
|
|
868
|
-
{ controller: PUBLIC_MODEL_CONTROLLER, tag: 'Models (public)', contracts: publicModelContracts },
|
|
869
|
-
{ controller: PUBLIC_PAGE_CONTROLLER, tag: 'Pages (public)', contracts: publicPageContracts },
|
|
870
|
-
{ controller: MODEL_CATALOG_CONTROLLER, tag: 'Model Catalog', contracts: modelCatalogContracts },
|
|
871
|
-
{ controller: PRICING_PAGE_CONTROLLER, tag: 'Pricing Page (public)', contracts: pricingPageContracts },
|
|
872
|
-
{ controller: CONTACT_FORM_CONTROLLER, tag: 'Contact Form (public)', contracts: contactFormContracts },
|
|
873
|
-
{ controller: GENERATION_MODEL_CONTROLLER, tag: 'Generation Models', contracts: generationModelContracts },
|
|
874
|
-
{ controller: GENERATION_JOB_CONTROLLER, tag: 'Generation Jobs', contracts: generationJobContracts },
|
|
875
|
-
{
|
|
876
|
-
controller: GENERATION_JOB_CHAT_CONTROLLER,
|
|
877
|
-
tag: 'Generation Job Chats',
|
|
878
|
-
contracts: generationJobChatContracts,
|
|
879
|
-
},
|
|
880
|
-
{ controller: ADMIN_CONTROLLER, tag: 'Admin', contracts: adminContracts },
|
|
881
|
-
{ controller: MARKETPLACE_CARD_CONTROLLER, tag: 'Marketplace Cards', contracts: marketplaceCardContracts },
|
|
882
|
-
{ controller: ORGANIZATION_CONTROLLER, tag: 'Organization', contracts: organizationContracts },
|
|
883
|
-
{ controller: USER_CONTEXT_CONTROLLER, tag: 'User Context', contracts: userContextContracts },
|
|
884
|
-
];
|
|
885
|
-
|
|
886
|
-
for (const group of contractGroups) {
|
|
887
|
-
registerContractGroup(group);
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
const generator = new OpenApiGeneratorV3(registry.definitions);
|
|
891
|
-
const document = generator.generateDocument({
|
|
892
|
-
openapi: '3.0.0',
|
|
893
|
-
info: {
|
|
894
|
-
title: 'AI Aggregator API',
|
|
895
|
-
version: '1.0.0',
|
|
896
|
-
},
|
|
897
|
-
servers: [{ url: '/' }],
|
|
898
|
-
});
|
|
899
|
-
|
|
900
|
-
const outputPath = resolve(process.cwd(), process.argv[2] ?? 'libs/contract/build/openapi.json');
|
|
901
|
-
|
|
902
|
-
await mkdir(dirname(outputPath), { recursive: true });
|
|
903
|
-
await writeFile(outputPath, JSON.stringify(document, null, 2), 'utf-8');
|
|
904
|
-
|
|
905
|
-
console.log(`OpenAPI generated: ${outputPath}`);
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
void main();
|