@ai-grator/api 0.2.49 → 0.2.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/_common/error.contract.ts +2 -0
  2. package/build/_common/error.contract.d.ts +1 -0
  3. package/build/_common/error.contract.d.ts.map +1 -1
  4. package/build/_common/error.contract.js +1 -0
  5. package/build/errors/errors.d.ts +10 -0
  6. package/build/errors/errors.d.ts.map +1 -1
  7. package/build/errors/errors.js +10 -0
  8. package/build/generation-model/endpoints/queries/get-generation-models-by-type.query.d.ts +4 -0
  9. package/build/generation-model/endpoints/queries/get-generation-models-by-type.query.d.ts.map +1 -1
  10. package/build/generation-model/endpoints/queries/get-generation-models.query.d.ts +4 -0
  11. package/build/generation-model/endpoints/queries/get-generation-models.query.d.ts.map +1 -1
  12. package/build/generation-model/endpoints/queries/get-generation-price.query.d.ts +2 -0
  13. package/build/generation-model/endpoints/queries/get-generation-price.query.d.ts.map +1 -1
  14. package/build/generation-model/endpoints/queries/get-generation-price.query.js +1 -0
  15. package/build/generation-model/models/generation-model-response.schema.d.ts +4 -0
  16. package/build/generation-model/models/generation-model-response.schema.d.ts.map +1 -1
  17. package/build/generation-model/models/generation-model-response.schema.js +5 -1
  18. package/build/referral/models/bonus-history-response.schema.d.ts +6 -0
  19. package/build/referral/models/bonus-history-response.schema.d.ts.map +1 -1
  20. package/build/referral/models/bonus-history-response.schema.js +1 -0
  21. package/build/tsconfig.tsbuildinfo +1 -1
  22. package/build/wallet/enums/wallet-transaction-source-type.enum.d.ts +2 -1
  23. package/build/wallet/enums/wallet-transaction-source-type.enum.d.ts.map +1 -1
  24. package/build/wallet/enums/wallet-transaction-source-type.enum.js +1 -0
  25. package/errors/errors.ts +10 -0
  26. package/generation-model/endpoints/queries/get-generation-price.query.ts +1 -0
  27. package/generation-model/models/generation-model-response.schema.ts +6 -0
  28. package/package.json +1 -1
  29. package/referral/models/bonus-history-response.schema.ts +1 -0
  30. package/wallet/enums/wallet-transaction-source-type.enum.ts +1 -0
@@ -6,6 +6,7 @@ export declare enum WALLET_TRANSACTION_SOURCE_TYPE {
6
6
  PAYMENT = "payment",
7
7
  EMAIL_VERIFICATION = "email_verification",
8
8
  REFERRAL = "referral",
9
- ADMIN_BONUS_OPERATION = "admin_bonus_operation"
9
+ ADMIN_BONUS_OPERATION = "admin_bonus_operation",
10
+ FIRST_DEPOSIT_BONUS = "first_deposit_bonus"
10
11
  }
11
12
  //# sourceMappingURL=wallet-transaction-source-type.enum.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wallet-transaction-source-type.enum.d.ts","sourceRoot":"","sources":["../../../wallet/enums/wallet-transaction-source-type.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,8BAA8B;IACtC,oBAAoB,yBAAyB;IAC7C,oBAAoB,yBAAyB;IAC7C,oBAAoB,yBAAyB;IAC7C,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,kBAAkB,uBAAuB;IACzC,QAAQ,aAAa;IACrB,qBAAqB,0BAA0B;CAClD"}
1
+ {"version":3,"file":"wallet-transaction-source-type.enum.d.ts","sourceRoot":"","sources":["../../../wallet/enums/wallet-transaction-source-type.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,8BAA8B;IACtC,oBAAoB,yBAAyB;IAC7C,oBAAoB,yBAAyB;IAC7C,oBAAoB,yBAAyB;IAC7C,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,kBAAkB,uBAAuB;IACzC,QAAQ,aAAa;IACrB,qBAAqB,0BAA0B;IAC/C,mBAAmB,wBAAwB;CAC9C"}
@@ -11,4 +11,5 @@ var WALLET_TRANSACTION_SOURCE_TYPE;
11
11
  WALLET_TRANSACTION_SOURCE_TYPE["EMAIL_VERIFICATION"] = "email_verification";
12
12
  WALLET_TRANSACTION_SOURCE_TYPE["REFERRAL"] = "referral";
13
13
  WALLET_TRANSACTION_SOURCE_TYPE["ADMIN_BONUS_OPERATION"] = "admin_bonus_operation";
14
+ WALLET_TRANSACTION_SOURCE_TYPE["FIRST_DEPOSIT_BONUS"] = "first_deposit_bonus";
14
15
  })(WALLET_TRANSACTION_SOURCE_TYPE || (exports.WALLET_TRANSACTION_SOURCE_TYPE = WALLET_TRANSACTION_SOURCE_TYPE = {}));
package/errors/errors.ts CHANGED
@@ -338,6 +338,16 @@ export const ERRORS = {
338
338
  code: 'GENERATION_JOB.ATTACHMENT_SLOT_NOT_MULTIPLE',
339
339
  message: 'Превышено максимальное количество файлов для этого слота вложения',
340
340
  },
341
+ CONFLICTING_ATTACHMENT_SLOTS: {
342
+ httpCode: 400,
343
+ code: 'GENERATION_JOB.CONFLICTING_ATTACHMENT_SLOTS',
344
+ message: 'Эти вложения нельзя использовать вместе в одной генерации',
345
+ },
346
+ ATTACHMENT_SLOT_REQUIRES_COMPANION: {
347
+ httpCode: 400,
348
+ code: 'GENERATION_JOB.ATTACHMENT_SLOT_REQUIRES_COMPANION',
349
+ message: 'Это вложение нельзя использовать без другого обязательного вложения',
350
+ },
341
351
  CHAT_MODEL_MISMATCH: {
342
352
  httpCode: 400,
343
353
  code: 'GENERATION_JOB.CHAT_MODEL_MISMATCH',
@@ -8,6 +8,7 @@ export const GetGenerationPriceBodyParams = z.object({
8
8
 
9
9
  export const GetGenerationPriceBody = z.object({
10
10
  params: z.record(z.string(), z.unknown()),
11
+ attachments: z.record(z.string(), z.array(z.uuid())).optional(),
11
12
  });
12
13
 
13
14
  export const GetGenerationPriceResponse = z.object({
@@ -17,6 +17,10 @@ export const AttachmentSlotSchema = z.object({
17
17
 
18
18
  export const AttachmentPolicySchema = z.record(z.string(), AttachmentSlotSchema);
19
19
 
20
+ export const AttachmentSlotConflictSchema = z.tuple([z.array(z.string()), z.array(z.string())]);
21
+
22
+ export const DependentAttachmentSlotsSchema = z.record(z.string(), z.array(z.string()));
23
+
20
24
  export const GenerationModelResponseSchema = z.object({
21
25
  uuid: z.uuid(),
22
26
  titleModel: z.string().min(1),
@@ -29,6 +33,8 @@ export const GenerationModelResponseSchema = z.object({
29
33
  isActive: z.boolean(),
30
34
  isNew: z.boolean(),
31
35
  attachmentPolicy: AttachmentPolicySchema,
36
+ conflictingSlots: z.array(AttachmentSlotConflictSchema),
37
+ dependentSlots: DependentAttachmentSlotsSchema,
32
38
  paramsSchema: JsonObjectSchema,
33
39
  pricingPolicy: PricingPolicySchema,
34
40
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-grator/api",
3
- "version": "0.2.49",
3
+ "version": "0.2.51",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "scripts": {
@@ -11,6 +11,7 @@ export const BonusHistorySourceSchema = z.discriminatedUnion('type', [
11
11
  z.object({ type: z.literal('referral'), refereeId: z.string() }),
12
12
  z.object({ type: z.literal('payment'), amount: z.number() }),
13
13
  z.object({ type: z.literal('email_verification') }),
14
+ z.object({ type: z.literal('first_deposit_bonus') }),
14
15
  z.object({ type: z.literal('admin_bonus_operation') }),
15
16
  z.object({ type: z.literal('message'), model: z.string() }),
16
17
  z.object({ type: z.literal('generation_job_image') }),
@@ -7,4 +7,5 @@ export enum WALLET_TRANSACTION_SOURCE_TYPE {
7
7
  EMAIL_VERIFICATION = 'email_verification',
8
8
  REFERRAL = 'referral',
9
9
  ADMIN_BONUS_OPERATION = 'admin_bonus_operation',
10
+ FIRST_DEPOSIT_BONUS = 'first_deposit_bonus',
10
11
  }