@purpleschool/gptbot 0.11.5 → 0.11.7

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 (121) hide show
  1. package/api/controllers/http/community.ts +1 -0
  2. package/api/controllers/http/index.ts +1 -0
  3. package/api/controllers/http/spell-corrector.ts +14 -0
  4. package/api/controllers/http/unregistered-user.ts +5 -0
  5. package/api/controllers/http/user.ts +1 -0
  6. package/api/routes.ts +36 -0
  7. package/build/api/controllers/http/community.js +1 -0
  8. package/build/api/controllers/http/index.js +1 -0
  9. package/build/api/controllers/http/spell-corrector.js +16 -0
  10. package/build/api/controllers/http/unregistered-user.js +5 -1
  11. package/build/api/controllers/http/user.js +1 -0
  12. package/build/api/routes.js +25 -0
  13. package/build/commands/community/index.js +1 -0
  14. package/build/commands/community/set-visibility-community-post.command.js +21 -0
  15. package/build/commands/subscription/find-subscription.command.js +4 -1
  16. package/build/commands/subscription/get-available-upgrades.command.js +3 -1
  17. package/build/commands/tools/index.js +1 -0
  18. package/build/commands/tools/presentation/create-presentation.command.js +3 -0
  19. package/build/commands/tools/presentation/update-presentation.command.js +1 -0
  20. package/build/commands/tools/spell-corrector/delete-all-spell-corrector-jobs.command.js +8 -0
  21. package/build/commands/tools/spell-corrector/delete-spell-corrector-job-by-uuid.command.js +11 -0
  22. package/build/commands/tools/spell-corrector/find-spell-corrector-job-by-uuid.command.js +14 -0
  23. package/build/commands/tools/spell-corrector/find-spell-corrector-jobs.command.js +18 -0
  24. package/build/commands/tools/spell-corrector/get-spell-corrector-tool-config.command.js +11 -0
  25. package/build/commands/tools/spell-corrector/index.js +25 -0
  26. package/build/commands/tools/spell-corrector/retry-spell-corrector-job.command.js +14 -0
  27. package/build/commands/tools/spell-corrector/set-reaction-to-spell-corrector-job.command.js +28 -0
  28. package/build/commands/tools/spell-corrector/spell-corrector.command.js +15 -0
  29. package/build/commands/tools/spell-corrector/update-spell-corrector-job-title.command.js +17 -0
  30. package/build/commands/tools/video-editor/edit-video.command.js +2 -0
  31. package/build/commands/tools/video-editor/retry-video-editor-job.command.js +2 -0
  32. package/build/commands/unregistered-user/index.js +1 -0
  33. package/build/commands/unregistered-user/patch-locale.command.js +16 -0
  34. package/build/commands/user/get-me.command.js +1 -0
  35. package/build/commands/user/index.js +1 -0
  36. package/build/commands/user/patch-locale.command.js +16 -0
  37. package/build/constants/ai-model/enums/ai-model-strategy.enum.js +1 -0
  38. package/build/constants/model/enums/unified-model-content-type.enum.js +2 -0
  39. package/build/constants/presentation/enums/index.js +1 -0
  40. package/build/constants/presentation/enums/presentation-target-audience.enum.js +10 -0
  41. package/build/constants/subscription/enums/subscription-feature-type.enum.js +11 -1
  42. package/build/constants/tool-video-editor/enums/index.js +1 -0
  43. package/build/constants/tool-video-editor/enums/video-editor-pricing-rule-type.enum.js +8 -0
  44. package/build/constants/user/enums/index.js +1 -0
  45. package/build/constants/user/enums/locale.enum.js +8 -0
  46. package/build/helpers/video-editor/calculate-video-editing-price.helper.js +27 -2
  47. package/build/models/subscription-feature.schema.js +42 -1
  48. package/build/models/subscription.schema.js +7 -1
  49. package/build/models/tools/image-editor/image-editor-model.schema.js +2 -0
  50. package/build/models/tools/image-generation/image-generation-model.schema.js +1 -0
  51. package/build/models/tools/index.js +1 -0
  52. package/build/models/tools/presentation/index.js +1 -0
  53. package/build/models/tools/presentation/presentation-template.schema.js +1 -0
  54. package/build/models/tools/presentation/presentation-title-page.schema.js +9 -0
  55. package/build/models/tools/presentation/presentation.schema.js +3 -0
  56. package/build/models/tools/presentation/slide-content-edit.schema.js +18 -12
  57. package/build/models/tools/presentation/slide-content.schema.js +16 -12
  58. package/build/models/tools/spell-corrector/index.js +19 -0
  59. package/build/models/tools/spell-corrector/spell-corrector-config.schema.js +9 -0
  60. package/build/models/tools/spell-corrector/spell-corrector-job.schema.js +13 -0
  61. package/build/models/tools/spell-corrector/spell-corrector-model.schema.js +17 -0
  62. package/build/models/tools/stt/stt-response.schema.js +2 -0
  63. package/build/models/tools/video/video-config.schema.js +10 -2
  64. package/build/models/tools/video-editor/video-editor-job.schema.js +6 -1
  65. package/build/models/tools/video-editor/video-editor-model.schema.js +27 -2
  66. package/build/models/user.schema.js +2 -0
  67. package/commands/community/index.ts +1 -0
  68. package/commands/community/set-visibility-community-post.command.ts +24 -0
  69. package/commands/subscription/find-subscription.command.ts +11 -1
  70. package/commands/subscription/get-available-upgrades.command.ts +3 -1
  71. package/commands/tools/index.ts +1 -0
  72. package/commands/tools/presentation/create-presentation.command.ts +7 -1
  73. package/commands/tools/presentation/update-presentation.command.ts +1 -0
  74. package/commands/tools/spell-corrector/delete-all-spell-corrector-jobs.command.ts +6 -0
  75. package/commands/tools/spell-corrector/delete-spell-corrector-job-by-uuid.command.ts +11 -0
  76. package/commands/tools/spell-corrector/find-spell-corrector-job-by-uuid.command.ts +16 -0
  77. package/commands/tools/spell-corrector/find-spell-corrector-jobs.command.ts +18 -0
  78. package/commands/tools/spell-corrector/get-spell-corrector-tool-config.command.ts +10 -0
  79. package/commands/tools/spell-corrector/index.ts +9 -0
  80. package/commands/tools/spell-corrector/retry-spell-corrector-job.command.ts +14 -0
  81. package/commands/tools/spell-corrector/set-reaction-to-spell-corrector-job.command.ts +33 -0
  82. package/commands/tools/spell-corrector/spell-corrector.command.ts +17 -0
  83. package/commands/tools/spell-corrector/update-spell-corrector-job-title.command.ts +19 -0
  84. package/commands/tools/video-editor/edit-video.command.ts +2 -0
  85. package/commands/tools/video-editor/retry-video-editor-job.command.ts +2 -0
  86. package/commands/unregistered-user/index.ts +1 -0
  87. package/commands/unregistered-user/patch-locale.command.ts +18 -0
  88. package/commands/user/get-me.command.ts +2 -1
  89. package/commands/user/index.ts +1 -0
  90. package/commands/user/patch-locale.command.ts +18 -0
  91. package/constants/ai-model/enums/ai-model-strategy.enum.ts +1 -0
  92. package/constants/model/enums/unified-model-content-type.enum.ts +2 -0
  93. package/constants/presentation/enums/index.ts +1 -0
  94. package/constants/presentation/enums/presentation-target-audience.enum.ts +6 -0
  95. package/constants/subscription/enums/subscription-feature-type.enum.ts +11 -1
  96. package/constants/tool-video-editor/enums/index.ts +1 -0
  97. package/constants/tool-video-editor/enums/video-editor-pricing-rule-type.enum.ts +4 -0
  98. package/constants/user/enums/index.ts +1 -0
  99. package/constants/user/enums/locale.enum.ts +4 -0
  100. package/helpers/video-editor/calculate-video-editing-price.helper.ts +52 -2
  101. package/models/subscription-feature.schema.ts +57 -0
  102. package/models/subscription.schema.ts +11 -0
  103. package/models/tools/image-editor/image-editor-model.schema.ts +2 -0
  104. package/models/tools/image-generation/image-generation-model.schema.ts +1 -0
  105. package/models/tools/index.ts +1 -0
  106. package/models/tools/presentation/index.ts +1 -0
  107. package/models/tools/presentation/presentation-template.schema.ts +1 -0
  108. package/models/tools/presentation/presentation-title-page.schema.ts +9 -0
  109. package/models/tools/presentation/presentation.schema.ts +8 -1
  110. package/models/tools/presentation/slide-content-edit.schema.ts +18 -12
  111. package/models/tools/presentation/slide-content.schema.ts +25 -21
  112. package/models/tools/spell-corrector/index.ts +3 -0
  113. package/models/tools/spell-corrector/spell-corrector-config.schema.ts +7 -0
  114. package/models/tools/spell-corrector/spell-corrector-job.schema.ts +11 -0
  115. package/models/tools/spell-corrector/spell-corrector-model.schema.ts +15 -0
  116. package/models/tools/stt/stt-response.schema.ts +2 -0
  117. package/models/tools/video/video-config.schema.ts +14 -1
  118. package/models/tools/video-editor/video-editor-job.schema.ts +8 -0
  119. package/models/tools/video-editor/video-editor-model.schema.ts +36 -1
  120. package/models/user.schema.ts +2 -0
  121. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ export * from './spell-corrector-config.schema';
2
+ export * from './spell-corrector-job.schema';
3
+ export * from './spell-corrector-model.schema';
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ import { SpellCorrectorModelSchema } from './spell-corrector-model.schema';
3
+
4
+ export const SpellCorrectorToolConfigSchema = z.object({
5
+ maxSymbols: z.number(),
6
+ models: z.array(SpellCorrectorModelSchema),
7
+ });
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ import { ToolJobSchema } from '../../tool-job.schema';
3
+ import { USER_REACTION } from '../../../constants';
4
+
5
+ export const SpellCorrectorToolJobSchema = ToolJobSchema.extend({
6
+ modelId: z.string().uuid().nullable().optional(),
7
+ userInput: z.string(),
8
+ aiOutput: z.string().nullable().optional(),
9
+ title: z.string(),
10
+ reaction: z.nativeEnum(USER_REACTION).nullable(),
11
+ });
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ import { IconVariantsSchema } from '../../icon-variants.schema';
3
+ import { UnlockedBySchema } from '../../unlocked-by-subscription.schema';
4
+
5
+ export const SpellCorrectorModelSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ title: z.string(),
8
+ description: z.string(),
9
+ icon: z.string(),
10
+ price: z.number(),
11
+ order: z.number(),
12
+ canUse: z.boolean(),
13
+ icons: IconVariantsSchema,
14
+ unlockedBy: UnlockedBySchema.nullable(),
15
+ });
@@ -3,6 +3,8 @@ import { z } from 'zod';
3
3
  export const STTResponseSchema = z.object({
4
4
  raw: z.object({}),
5
5
  md: z.string(),
6
+ txtUrl: z.string().optional(),
7
+ srtUrl: z.string().optional(),
6
8
  });
7
9
 
8
10
  export type STTResponse = z.infer<typeof STTResponseSchema>;
@@ -1,6 +1,19 @@
1
1
  import { z } from 'zod';
2
2
  import { VideoModelSchema } from './video-model.schema';
3
+ import { IconVariantsSchema } from '../../icon-variants.schema';
3
4
 
4
- export const VideoConfigSchema = z.object({
5
+ export const VideoVendorSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ title: z.string(),
8
+ order: z.number(),
9
+ icons: IconVariantsSchema,
5
10
  models: z.array(VideoModelSchema),
6
11
  });
12
+
13
+ export type VideoVendor = z.infer<typeof VideoVendorSchema>;
14
+
15
+ export const VideoConfigSchema = z.object({
16
+ vendors: z.array(VideoVendorSchema),
17
+ });
18
+
19
+ export type VideoConfig = z.infer<typeof VideoConfigSchema>;
@@ -2,6 +2,13 @@ import { z } from 'zod';
2
2
  import { USER_REACTION } from '../../../constants';
3
3
  import { ToolJobSchema } from '../../tool-job.schema';
4
4
 
5
+ export const VideoEditorJobParamsSchema = z.object({
6
+ duration: z.number().optional(),
7
+ resolution: z.string().optional(),
8
+ });
9
+
10
+ export type VideoEditorJobParams = z.infer<typeof VideoEditorJobParamsSchema>;
11
+
5
12
  export const VideoEditorJobSchema = ToolJobSchema.extend({
6
13
  title: z.string(),
7
14
  prompt: z.string(),
@@ -21,6 +28,7 @@ export const VideoEditorJobSchema = ToolJobSchema.extend({
21
28
  url: z.string(),
22
29
  })
23
30
  .nullable(),
31
+ params: VideoEditorJobParamsSchema.optional(),
24
32
  modelId: z.string(),
25
33
  isPublished: z.boolean(),
26
34
  postId: z.string().nullable(),
@@ -1,11 +1,44 @@
1
1
  import { z } from 'zod';
2
2
  import { VIDEO_EDITOR_MODEL_LIMITATION } from '../../../constants/tool-video-editor/enums/video-editor-model-limitation.enum';
3
+ import { VIDEO_EDITOR_PRICING_RULE_TYPE } from '../../../constants/tool-video-editor/enums/video-editor-pricing-rule-type.enum';
3
4
  import { IconVariantsSchema } from '../../icon-variants.schema';
4
5
  import { UnlockedBySchema } from '../../unlocked-by-subscription.schema';
5
6
 
6
7
  export const VideoEditorModelParamsSchema = z.object({
7
- supportedFormats: z.array(z.string()),
8
+ duration: z
9
+ .object({
10
+ options: z.array(z.number()),
11
+ })
12
+ .optional(),
13
+ resolution: z
14
+ .object({
15
+ options: z.array(z.string()),
16
+ })
17
+ .optional(),
18
+ });
19
+
20
+ export const VideoEditorPricingRequestParamsSchema = z.object({
21
+ duration: z.number(),
22
+ resolution: z.string().optional(),
8
23
  });
24
+ export type VideoEditorPricingRequestParams = z.infer<typeof VideoEditorPricingRequestParamsSchema>;
25
+
26
+ export const VideoEditorModelPricingRuleConditionSchema = z.object({
27
+ duration: z.number().optional(),
28
+ resolution: z.string().optional(),
29
+ });
30
+ export type VideoEditorModelPricingRuleCondition = z.infer<
31
+ typeof VideoEditorModelPricingRuleConditionSchema
32
+ >;
33
+
34
+ export const VideoEditorModelPricingRulesSchema = z.array(
35
+ z.object({
36
+ type: z.nativeEnum(VIDEO_EDITOR_PRICING_RULE_TYPE),
37
+ condition: VideoEditorModelPricingRuleConditionSchema,
38
+ value: z.number(),
39
+ }),
40
+ );
41
+ export type VideoEditorModelPricingRules = z.infer<typeof VideoEditorModelPricingRulesSchema>;
9
42
 
10
43
  export const VideoEditorModelSchema = z.object({
11
44
  uuid: z.string(),
@@ -19,6 +52,8 @@ export const VideoEditorModelSchema = z.object({
19
52
  maxInputVideoSizeBytes: z.number(),
20
53
  maxInputVideoDurationInSeconds: z.number(),
21
54
  supportedFormats: z.array(z.string()),
55
+ params: VideoEditorModelParamsSchema,
56
+ pricingRules: VideoEditorModelPricingRulesSchema,
22
57
  createdAt: z.date(),
23
58
  updatedAt: z.date(),
24
59
  unlockedBy: UnlockedBySchema.nullable(),
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { UserToSubscriptionSchema } from './user-to-subscription.schema';
3
3
  import { UserToProductSchema } from './user-to-product.schema';
4
+ import { LOCALE } from '../constants';
4
5
 
5
6
  export const UserSchema = z.object({
6
7
  uuid: z.string().uuid(),
@@ -13,6 +14,7 @@ export const UserSchema = z.object({
13
14
  restoreTokenHash: z.string(),
14
15
  tokenBonusBalance: z.number(),
15
16
  role: z.string(),
17
+ locale: z.nativeEnum(LOCALE),
16
18
 
17
19
  createdAt: z.date(),
18
20
  updatedAt: z.date(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.11.5",
3
+ "version": "0.11.7",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",