vidspotai-shared 1.0.0

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 (142) hide show
  1. package/lib/globals/aiModels.d.ts +60 -0
  2. package/lib/globals/aiModels.d.ts.map +1 -0
  3. package/lib/globals/aiModels.js +463 -0
  4. package/lib/globals/config.d.ts +4 -0
  5. package/lib/globals/config.d.ts.map +1 -0
  6. package/lib/globals/config.js +20 -0
  7. package/lib/globals/index.d.ts +6 -0
  8. package/lib/globals/index.d.ts.map +1 -0
  9. package/lib/globals/index.js +21 -0
  10. package/lib/globals/plans.d.ts +3 -0
  11. package/lib/globals/plans.d.ts.map +1 -0
  12. package/lib/globals/plans.js +60 -0
  13. package/lib/globals/schemas.d.ts +3 -0
  14. package/lib/globals/schemas.d.ts.map +1 -0
  15. package/lib/globals/schemas.js +18 -0
  16. package/lib/globals/types.d.ts +90 -0
  17. package/lib/globals/types.d.ts.map +1 -0
  18. package/lib/globals/types.js +93 -0
  19. package/lib/index.d.ts +6 -0
  20. package/lib/index.d.ts.map +1 -0
  21. package/lib/index.js +21 -0
  22. package/lib/libs/firebase.d.ts +7 -0
  23. package/lib/libs/firebase.d.ts.map +1 -0
  24. package/lib/libs/firebase.js +60 -0
  25. package/lib/libs/index.d.ts +2 -0
  26. package/lib/libs/index.d.ts.map +1 -0
  27. package/lib/libs/index.js +17 -0
  28. package/lib/models/index.d.ts +4 -0
  29. package/lib/models/index.d.ts.map +1 -0
  30. package/lib/models/index.js +19 -0
  31. package/lib/models/script.model.d.ts +39 -0
  32. package/lib/models/script.model.d.ts.map +1 -0
  33. package/lib/models/script.model.js +26 -0
  34. package/lib/models/user.model.d.ts +46 -0
  35. package/lib/models/user.model.d.ts.map +1 -0
  36. package/lib/models/user.model.js +2 -0
  37. package/lib/models/video.model.d.ts +43 -0
  38. package/lib/models/video.model.d.ts.map +1 -0
  39. package/lib/models/video.model.js +2 -0
  40. package/lib/services/aiGen/aiGenFactory.service.d.ts +8 -0
  41. package/lib/services/aiGen/aiGenFactory.service.d.ts.map +1 -0
  42. package/lib/services/aiGen/aiGenFactory.service.js +56 -0
  43. package/lib/services/aiGen/atypes.d.ts +5 -0
  44. package/lib/services/aiGen/atypes.d.ts.map +1 -0
  45. package/lib/services/aiGen/atypes.js +8 -0
  46. package/lib/services/aiGen/helpers.d.ts +3 -0
  47. package/lib/services/aiGen/helpers.d.ts.map +1 -0
  48. package/lib/services/aiGen/helpers.js +76 -0
  49. package/lib/services/aiGen/index.d.ts +5 -0
  50. package/lib/services/aiGen/index.d.ts.map +1 -0
  51. package/lib/services/aiGen/index.js +20 -0
  52. package/lib/services/aiGen/providers/alibaba/alibaba.d.ts +12 -0
  53. package/lib/services/aiGen/providers/alibaba/alibaba.d.ts.map +1 -0
  54. package/lib/services/aiGen/providers/alibaba/alibaba.js +146 -0
  55. package/lib/services/aiGen/providers/alibaba/helpers.d.ts +3 -0
  56. package/lib/services/aiGen/providers/alibaba/helpers.d.ts.map +1 -0
  57. package/lib/services/aiGen/providers/alibaba/helpers.js +31 -0
  58. package/lib/services/aiGen/providers/azure/azure.d.ts +1 -0
  59. package/lib/services/aiGen/providers/azure/azure.d.ts.map +1 -0
  60. package/lib/services/aiGen/providers/azure/azure.js +1 -0
  61. package/lib/services/aiGen/providers/azure/azure.service.d.ts +14 -0
  62. package/lib/services/aiGen/providers/azure/azure.service.d.ts.map +1 -0
  63. package/lib/services/aiGen/providers/azure/azure.service.js +125 -0
  64. package/lib/services/aiGen/providers/azure/index.d.ts +2 -0
  65. package/lib/services/aiGen/providers/azure/index.d.ts.map +1 -0
  66. package/lib/services/aiGen/providers/azure/index.js +17 -0
  67. package/lib/services/aiGen/providers/baseAiGenProvider.service.d.ts +8 -0
  68. package/lib/services/aiGen/providers/baseAiGenProvider.service.d.ts.map +1 -0
  69. package/lib/services/aiGen/providers/baseAiGenProvider.service.js +12 -0
  70. package/lib/services/aiGen/providers/google/google.service.d.ts +10 -0
  71. package/lib/services/aiGen/providers/google/google.service.d.ts.map +1 -0
  72. package/lib/services/aiGen/providers/google/google.service.js +96 -0
  73. package/lib/services/aiGen/providers/google/index.d.ts +2 -0
  74. package/lib/services/aiGen/providers/google/index.d.ts.map +1 -0
  75. package/lib/services/aiGen/providers/google/index.js +17 -0
  76. package/lib/services/aiGen/providers/index.d.ts +8 -0
  77. package/lib/services/aiGen/providers/index.d.ts.map +1 -0
  78. package/lib/services/aiGen/providers/index.js +23 -0
  79. package/lib/services/aiGen/providers/kling/btypes.d.ts +73 -0
  80. package/lib/services/aiGen/providers/kling/btypes.d.ts.map +1 -0
  81. package/lib/services/aiGen/providers/kling/btypes.js +2 -0
  82. package/lib/services/aiGen/providers/kling/index.d.ts +3 -0
  83. package/lib/services/aiGen/providers/kling/index.d.ts.map +1 -0
  84. package/lib/services/aiGen/providers/kling/index.js +18 -0
  85. package/lib/services/aiGen/providers/kling/kling.service.d.ts +13 -0
  86. package/lib/services/aiGen/providers/kling/kling.service.d.ts.map +1 -0
  87. package/lib/services/aiGen/providers/kling/kling.service.js +139 -0
  88. package/lib/services/aiGen/providers/kling/types.d.ts +73 -0
  89. package/lib/services/aiGen/providers/kling/types.d.ts.map +1 -0
  90. package/lib/services/aiGen/providers/kling/types.js +2 -0
  91. package/lib/services/aiGen/providers/minimax/ctypes.d.ts +26 -0
  92. package/lib/services/aiGen/providers/minimax/ctypes.d.ts.map +1 -0
  93. package/lib/services/aiGen/providers/minimax/ctypes.js +3 -0
  94. package/lib/services/aiGen/providers/minimax/index.d.ts +3 -0
  95. package/lib/services/aiGen/providers/minimax/index.d.ts.map +1 -0
  96. package/lib/services/aiGen/providers/minimax/index.js +18 -0
  97. package/lib/services/aiGen/providers/minimax/minimax.service.d.ts +12 -0
  98. package/lib/services/aiGen/providers/minimax/minimax.service.d.ts.map +1 -0
  99. package/lib/services/aiGen/providers/minimax/minimax.service.js +115 -0
  100. package/lib/services/aiGen/providers/minimax/types.d.ts +26 -0
  101. package/lib/services/aiGen/providers/minimax/types.d.ts.map +1 -0
  102. package/lib/services/aiGen/providers/minimax/types.js +3 -0
  103. package/lib/services/aiGen/providers/openai/index.d.ts +2 -0
  104. package/lib/services/aiGen/providers/openai/index.d.ts.map +1 -0
  105. package/lib/services/aiGen/providers/openai/index.js +17 -0
  106. package/lib/services/aiGen/providers/openai/openai.service.d.ts +12 -0
  107. package/lib/services/aiGen/providers/openai/openai.service.d.ts.map +1 -0
  108. package/lib/services/aiGen/providers/openai/openai.service.js +97 -0
  109. package/lib/services/aiGen/providers/runway/dtypes.d.ts +14 -0
  110. package/lib/services/aiGen/providers/runway/dtypes.d.ts.map +1 -0
  111. package/lib/services/aiGen/providers/runway/dtypes.js +27 -0
  112. package/lib/services/aiGen/providers/runway/index.d.ts +3 -0
  113. package/lib/services/aiGen/providers/runway/index.d.ts.map +1 -0
  114. package/lib/services/aiGen/providers/runway/index.js +18 -0
  115. package/lib/services/aiGen/providers/runway/runway.service.d.ts +12 -0
  116. package/lib/services/aiGen/providers/runway/runway.service.d.ts.map +1 -0
  117. package/lib/services/aiGen/providers/runway/runway.service.js +122 -0
  118. package/lib/services/aiGen/providers/runway/types.d.ts +14 -0
  119. package/lib/services/aiGen/providers/runway/types.d.ts.map +1 -0
  120. package/lib/services/aiGen/providers/runway/types.js +27 -0
  121. package/lib/services/aiGen/providers/types.d.ts +49 -0
  122. package/lib/services/aiGen/providers/types.d.ts.map +1 -0
  123. package/lib/services/aiGen/providers/types.js +2 -0
  124. package/lib/services/aiGen/types.d.ts +5 -0
  125. package/lib/services/aiGen/types.d.ts.map +1 -0
  126. package/lib/services/aiGen/types.js +8 -0
  127. package/lib/services/firestore.service.d.ts +66 -0
  128. package/lib/services/firestore.service.d.ts.map +1 -0
  129. package/lib/services/firestore.service.js +118 -0
  130. package/lib/services/index.d.ts +4 -0
  131. package/lib/services/index.d.ts.map +1 -0
  132. package/lib/services/index.js +19 -0
  133. package/lib/services/redis.service.d.ts +19 -0
  134. package/lib/services/redis.service.d.ts.map +1 -0
  135. package/lib/services/redis.service.js +97 -0
  136. package/lib/utils/helpers.d.ts +6 -0
  137. package/lib/utils/helpers.d.ts.map +1 -0
  138. package/lib/utils/helpers.js +55 -0
  139. package/lib/utils/index.d.ts +2 -0
  140. package/lib/utils/index.d.ts.map +1 -0
  141. package/lib/utils/index.js +17 -0
  142. package/package.json +31 -0
@@ -0,0 +1,60 @@
1
+ export declare enum EVideoGenModels {
2
+ GOOGLE_VEO_3 = "google-veo-3",
3
+ GOOGLE_VEO_3_FAST = "google-veo-3-fast",
4
+ GOOGLE_VEO_2 = "google-veo-2",
5
+ RUNWAY_GEN4_TURBO = "runway-gen4-turbo",
6
+ RUNWAY_GEN4_ALEPH = "runway-gen4-aleph",
7
+ KLING_V1 = "kling-v1",
8
+ KLING_V1_6 = "kling-v1.6",
9
+ KLING_V2_MASTER = "kling-v2-master",
10
+ KLING_V2_1_MASTER = "kling-v2.1-master",
11
+ MINIMAX_HAILUO_02 = "minimax-hailuo-02",
12
+ T2V_01_DIRECTOR = "T2V-01-Director",
13
+ T2V_01 = "T2V-01",
14
+ AZURE_SORA = "azure-sora",
15
+ ALIBABA_WAN_2_5 = "alibaba-wan-2.5",
16
+ ALIBABA_WAN_2_2 = "alibaba-wan-2.2",
17
+ OPENAI_SORA_2 = "openai-sora-2",
18
+ OPENAI_SORA_2_PRO = "openai-sora-2-pro"
19
+ }
20
+ export declare const EImageGenModels: {
21
+ readonly OPENAI_DALLE_3: "openai-dalle-3";
22
+ readonly STABILITY_STABLE_DIFFUSION: "stability-stable-diffusion";
23
+ readonly MIDJOURNEY_V6: "midjourney-v6";
24
+ readonly FLUX_1_1: "flux-1.1";
25
+ readonly IDEOGRAM_1_0: "ideogram-1.0";
26
+ };
27
+ export declare enum ETextGenModels {
28
+ OPENAI_GPT_4O_MINI = "openai-gpt-4o-mini"
29
+ }
30
+ export type TAiGenModel = EVideoGenModels | ETextGenModels;
31
+ type GenerationType = "text-to-video" | "image-to-video" | "video-to-video" | "text-to-text" | "image-to-text";
32
+ interface ISchemaField {
33
+ required?: boolean;
34
+ allowedValues?: string[] | number[];
35
+ default?: string | number;
36
+ }
37
+ interface ICostTable {
38
+ [key: string]: {
39
+ [key: number]: number;
40
+ };
41
+ }
42
+ interface IModelSchema {
43
+ modelId: string;
44
+ type: GenerationType[];
45
+ fields: Record<string, ISchemaField>;
46
+ resolutionRules?: Record<string, string[]>;
47
+ durationRules?: Record<number, string[]>;
48
+ concurrentRequests?: number;
49
+ requestPerMin?: number;
50
+ requestPerDay?: number;
51
+ cost?: {
52
+ perSecond?: number;
53
+ per1KTokens?: number;
54
+ table?: ICostTable;
55
+ fixed?: number;
56
+ };
57
+ }
58
+ export declare const aiModelConfigs: Record<TAiGenModel, IModelSchema>;
59
+ export {};
60
+ //# sourceMappingURL=aiModels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aiModels.d.ts","sourceRoot":"","sources":["../../src/globals/aiModels.ts"],"names":[],"mappings":"AAwBA,oBAAY,eAAe;IACzB,YAAY,iBAAiB;IAC7B,iBAAiB,sBAAsB;IACvC,YAAY,iBAAiB;IAC7B,iBAAiB,sBAAsB;IACvC,iBAAiB,sBAAsB;IACvC,QAAQ,aAAa;IACrB,UAAU,eAAe;IACzB,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;IACvC,iBAAiB,sBAAsB;IACvC,eAAe,oBAAoB;IACnC,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,aAAa,kBAAkB;IAC/B,iBAAiB,sBAAsB;CACxC;AAaD,eAAO,MAAM,eAAe;;;;;;CAMlB,CAAC;AAaX,oBAAY,cAAc;IAExB,kBAAkB,uBAAuB;CAI1C;AAID,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,cAAc,CAAC;AAG3D,KAAK,cAAc,GACf,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,cAAc,GACd,eAAe,CAAC;AAEpB,UAAU,YAAY;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAED,UAAU,UAAU;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;CACH;AAED,UAAU,YAAY;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,cAAc,EAAE,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAErC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACzC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE;QACL,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,UAAU,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAGD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,WAAW,EAAE,YAAY,CAiZ5D,CAAC"}
@@ -0,0 +1,463 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.aiModelConfigs = exports.ETextGenModels = exports.EImageGenModels = exports.EVideoGenModels = void 0;
4
+ const types_1 = require("../services/aiGen/providers/runway/types");
5
+ // export const EVideoGenModels = {
6
+ // GOOGLE_VEO_3: "google-veo-3",
7
+ // GOOGLE_VEO_3_FAST: "google-veo-3-fast",
8
+ // GOOGLE_VEO_2: "google-veo-2",
9
+ // RUNWAY_GEN4_TURBO: "runway-gen4-turbo",
10
+ // RUNWAY_GEN4_ALEPH: "runway-gen4-aleph",
11
+ // KLING_V1: "kling-v1",
12
+ // KLING_V1_6: "kling-v1.6",
13
+ // KLING_V2_MASTER: "kling-v2-master",
14
+ // KLING_V2_1_MASTER: "kling-v2.1-master",
15
+ // MINIMAX_HAILUO_02: "minimax-hailuo-02",
16
+ // T2V_01_DIRECTOR: "T2V-01-Director",
17
+ // T2V_01: "T2V-01",
18
+ // OPENAI_SORA: "openai-sora",
19
+ // } as const;
20
+ var EVideoGenModels;
21
+ (function (EVideoGenModels) {
22
+ EVideoGenModels["GOOGLE_VEO_3"] = "google-veo-3";
23
+ EVideoGenModels["GOOGLE_VEO_3_FAST"] = "google-veo-3-fast";
24
+ EVideoGenModels["GOOGLE_VEO_2"] = "google-veo-2";
25
+ EVideoGenModels["RUNWAY_GEN4_TURBO"] = "runway-gen4-turbo";
26
+ EVideoGenModels["RUNWAY_GEN4_ALEPH"] = "runway-gen4-aleph";
27
+ EVideoGenModels["KLING_V1"] = "kling-v1";
28
+ EVideoGenModels["KLING_V1_6"] = "kling-v1.6";
29
+ EVideoGenModels["KLING_V2_MASTER"] = "kling-v2-master";
30
+ EVideoGenModels["KLING_V2_1_MASTER"] = "kling-v2.1-master";
31
+ EVideoGenModels["MINIMAX_HAILUO_02"] = "minimax-hailuo-02";
32
+ EVideoGenModels["T2V_01_DIRECTOR"] = "T2V-01-Director";
33
+ EVideoGenModels["T2V_01"] = "T2V-01";
34
+ EVideoGenModels["AZURE_SORA"] = "azure-sora";
35
+ EVideoGenModels["ALIBABA_WAN_2_5"] = "alibaba-wan-2.5";
36
+ EVideoGenModels["ALIBABA_WAN_2_2"] = "alibaba-wan-2.2";
37
+ EVideoGenModels["OPENAI_SORA_2"] = "openai-sora-2";
38
+ EVideoGenModels["OPENAI_SORA_2_PRO"] = "openai-sora-2-pro";
39
+ })(EVideoGenModels || (exports.EVideoGenModels = EVideoGenModels = {}));
40
+ // export type TVideoGenModel =
41
+ // (typeof EVideoGenModels)[keyof typeof EVideoGenModels];
42
+ // export const EImageGenModels = {
43
+ // OPENAI_DALLE_3: "openai-dalle-3",
44
+ // STABILITY_STABLE_DIFFUSION: "stability-stable-diffusion",
45
+ // MIDJOURNEY_V6: "midjourney-v6",
46
+ // FLUX_1_1: "flux-1.1",
47
+ // IDEOGRAM_1_0: "ideogram-1.0",
48
+ // } as const;
49
+ exports.EImageGenModels = {
50
+ OPENAI_DALLE_3: "openai-dalle-3",
51
+ STABILITY_STABLE_DIFFUSION: "stability-stable-diffusion",
52
+ MIDJOURNEY_V6: "midjourney-v6",
53
+ FLUX_1_1: "flux-1.1",
54
+ IDEOGRAM_1_0: "ideogram-1.0",
55
+ };
56
+ // export type ImageGenModel =
57
+ // (typeof EImageGenModels)[keyof typeof EImageGenModels];
58
+ // export const ETextGenModels = {
59
+ // // OPENAI_GPT_4O: "openai-gpt-4o",
60
+ // OPENAI_GPT_4O_MINI: "openai-gpt-4o-mini",
61
+ // // OPENAI_GPT_3_5_TURBO: "openai-gpt-3.5-turbo",
62
+ // // ANTHROPIC_CLAUDE_3: "anthropic-claude-3",
63
+ // // ANTHROPIC_CLAUDE_INSTANT_100K: "anthropic-claude-instant-100k",
64
+ // } as const;
65
+ var ETextGenModels;
66
+ (function (ETextGenModels) {
67
+ // OPENAI_GPT_4O = "openai-gpt-4o",
68
+ ETextGenModels["OPENAI_GPT_4O_MINI"] = "openai-gpt-4o-mini";
69
+ // OPENAI_GPT_3_5_TURBO = "openai-gpt-3.5-turbo",
70
+ // ANTHROPIC_CLAUDE_3 = "anthropic-claude-3",
71
+ // ANTHROPIC_CLAUDE_INSTANT_100K = "anthropic-claude-instant-100k",
72
+ })(ETextGenModels || (exports.ETextGenModels = ETextGenModels = {}));
73
+ // Combined config
74
+ exports.aiModelConfigs = {
75
+ // --- Google models ---
76
+ "google-veo-3": {
77
+ modelId: "veo-3.0-generate-001",
78
+ type: ["text-to-video", "image-to-video"],
79
+ fields: {
80
+ prompt: { required: true },
81
+ aspectRatio: { allowedValues: ["16:9", "9:16"] }, // 16:9 as default
82
+ resolution: { allowedValues: ["720p", "1080p"] }, // 720p as default
83
+ duration: { allowedValues: [8] }, // in seconds, 8s as default
84
+ imageUrl: {},
85
+ negative_prompt: {},
86
+ },
87
+ resolutionRules: {
88
+ "720p": ["16:9", "9:16"],
89
+ "1080p": ["16:9"],
90
+ },
91
+ // concurrentRequests: 1,
92
+ requestPerMin: 2,
93
+ requestPerDay: 10,
94
+ cost: {
95
+ perSecond: 0.4,
96
+ },
97
+ },
98
+ "google-veo-3-fast": {
99
+ modelId: "veo-3.0-fast-generate-001",
100
+ type: ["text-to-video", "image-to-video"],
101
+ fields: {
102
+ prompt: { required: true },
103
+ aspectRatio: { allowedValues: ["16:9", "9:16"] }, // 16:9 as default
104
+ resolution: { allowedValues: ["720p", "1080p"] }, // 720p as default
105
+ duration: { allowedValues: [8] }, // in seconds, 8s as default
106
+ imageUrl: {},
107
+ negative_prompt: {},
108
+ },
109
+ resolutionRules: {
110
+ "720p": ["16:9", "9:16"],
111
+ "1080p": ["16:9"],
112
+ },
113
+ // parallelRequests: 1,
114
+ cost: {
115
+ perSecond: 0.15,
116
+ },
117
+ },
118
+ "google-veo-2": {
119
+ modelId: "veo-2.0-generate-001",
120
+ type: ["text-to-video", "image-to-video"],
121
+ fields: {
122
+ prompt: { required: true },
123
+ aspectRatio: { allowedValues: ["16:9", "9:16"] }, // 16:9 as default
124
+ resolution: { allowedValues: ["720p"] }, // 720p as default
125
+ duration: { allowedValues: [8] }, // in seconds, 8s as default
126
+ imageUrl: {},
127
+ negative_prompt: {},
128
+ },
129
+ resolutionRules: {
130
+ "720p": ["16:9", "9:16"],
131
+ },
132
+ // parallelRequests: 1,
133
+ cost: {
134
+ perSecond: 0.35,
135
+ },
136
+ },
137
+ // --- Runway models ---
138
+ "runway-gen4-turbo": {
139
+ modelId: "gen4_turbo",
140
+ type: ["image-to-video"],
141
+ fields: {
142
+ prompt: { required: true },
143
+ imageUrl: { required: true },
144
+ aspecetRatio: {
145
+ allowedValues: types_1.GEN4_TURBO_RATIOS,
146
+ },
147
+ duration: {
148
+ allowedValues: types_1.GEN4_TURBO_DURATIONS,
149
+ }, // in seconds
150
+ },
151
+ // parallelRequests: 1,
152
+ cost: {
153
+ perSecond: 0.05,
154
+ },
155
+ },
156
+ "runway-gen4-aleph": {
157
+ modelId: "gen4_aleph",
158
+ type: ["video-to-video"],
159
+ fields: {
160
+ prompt: { required: true },
161
+ videoUrl: { required: true },
162
+ aspecetRatio: {
163
+ allowedValues: types_1.GEN4_ALEPH_RATIOS,
164
+ },
165
+ duration: { allowedValues: types_1.GEN4_ALEPH_DURATIONS }, // in seconds
166
+ },
167
+ // parallelRequests: 1,
168
+ cost: {
169
+ perSecond: 0.15,
170
+ },
171
+ },
172
+ /// --- Kling models ---
173
+ "kling-v1": {
174
+ modelId: "kling-v1",
175
+ type: ["text-to-video"],
176
+ fields: {
177
+ prompt: { required: true },
178
+ aspectRatio: { allowedValues: ["16:9", "9:16", "1:1"] }, // default 16:9
179
+ duration: { allowedValues: [5, 10] }, // seconds (5 or 10)
180
+ cfg_scale: {}, // float, probably between 0 and 1
181
+ negative_prompt: {},
182
+ mode: { allowedValues: ["std", "pro"] },
183
+ },
184
+ concurrentRequests: 3,
185
+ // "std" = Standard mode, "pro" = Professional mode
186
+ cost: {
187
+ table: {
188
+ std: { 5: 0.14, 10: 0.28 },
189
+ pro: { 5: 0.49, 10: 0.98 },
190
+ },
191
+ },
192
+ },
193
+ "kling-v1.6": {
194
+ modelId: "kling-v1-6",
195
+ type: ["text-to-video"],
196
+ fields: {
197
+ prompt: { required: true },
198
+ aspectRatio: { allowedValues: ["16:9", "9:16", "1:1"] }, // assumed similar to v1
199
+ duration: { allowedValues: [5, 10] }, // likely same limits
200
+ cfg_scale: {},
201
+ mode: { allowedValues: ["std", "pro"] },
202
+ negative_prompt: {},
203
+ },
204
+ concurrentRequests: 3,
205
+ cost: {
206
+ table: {
207
+ std: { 5: 0.28, 10: 0.56 },
208
+ pro: { 5: 0.49, 10: 0.98 },
209
+ },
210
+ },
211
+ },
212
+ "kling-v2-master": {
213
+ modelId: "kling-v2-master",
214
+ type: ["text-to-video"],
215
+ fields: {
216
+ prompt: { required: true },
217
+ aspectRatio: { allowedValues: ["16:9", "9:16", "1:1"] },
218
+ duration: { allowedValues: [5, 10] },
219
+ mode: { allowedValues: ["pro"] },
220
+ negative_prompt: {},
221
+ },
222
+ concurrentRequests: 3,
223
+ cost: {
224
+ table: {
225
+ pro: { 5: 1.4, 10: 2.8 },
226
+ },
227
+ },
228
+ },
229
+ "kling-v2.1-master": {
230
+ modelId: "kling-v2-1-master",
231
+ type: ["text-to-video"],
232
+ fields: {
233
+ prompt: { required: true },
234
+ aspectRatio: { allowedValues: ["16:9", "9:16", "1:1"] },
235
+ duration: { allowedValues: [5, 10] },
236
+ mode: { allowedValues: ["pro"] },
237
+ negative_prompt: {},
238
+ },
239
+ concurrentRequests: 3,
240
+ cost: {
241
+ table: {
242
+ pro: { 5: 1.4, 10: 2.8 },
243
+ },
244
+ },
245
+ },
246
+ // --- OpenAI models ---
247
+ "openai-gpt-4o-mini": {
248
+ modelId: "gpt-4o-mini",
249
+ type: ["text-to-text", "image-to-text"],
250
+ fields: {
251
+ prompt: { required: true },
252
+ maxCompletionTokens: { default: 2048 },
253
+ temperature: { default: 1.0 },
254
+ topP: { default: 1.0 },
255
+ frequencyPenalty: { default: 0.0 },
256
+ presencePenalty: { default: 0.0 },
257
+ },
258
+ // parallelRequests: 5,
259
+ // requestPerMin: 500,
260
+ // requestPerDay: 10000,
261
+ // tokenPerMin: 200000, // 150k tokens per minute
262
+ },
263
+ "azure-sora": {
264
+ modelId: "sora",
265
+ type: ["text-to-video", "image-to-video", "video-to-video"],
266
+ fields: {
267
+ prompt: { required: true },
268
+ dimenions: {
269
+ allowedValues: [
270
+ "480x480",
271
+ "480x854",
272
+ "854x480",
273
+ "720x720",
274
+ "720x1280",
275
+ "1280x720",
276
+ "1080x1080",
277
+ "1080x1920",
278
+ "1920x1080",
279
+ ],
280
+ default: "480x480",
281
+ },
282
+ duration: {
283
+ allowedValues: [1, 5, 10, 15, 20], // in seconds
284
+ default: 5,
285
+ },
286
+ imageUrl: { required: false }, // up to 2
287
+ videoUrl: { required: false }, // up to 5s
288
+ },
289
+ // parallelRequests: 1,
290
+ cost: {
291
+ table: {
292
+ "480x480": { 5: 0.15, 10: 0.15, 15: 0.15, 20: 0.15 },
293
+ "480x854": { 5: 0.2, 10: 0.2, 15: 0.2, 20: 0.2 },
294
+ "720x720": { 5: 0.3, 10: 0.3, 15: 0.3, 20: 0.3 },
295
+ "1280x720": { 5: 0.45, 10: 0.5, 15: 0.65, 20: 0.75 },
296
+ "1080x1080": { 5: 0.6, 10: 0.75, 15: 1.1, 20: 1.35 },
297
+ "1920x1080": { 5: 1.3, 10: 1.85, 15: 2.9, 20: 3.6 },
298
+ },
299
+ },
300
+ },
301
+ // --- MINIMAX model ---
302
+ "minimax-hailuo-02": {
303
+ modelId: "MiniMax-Hailuo-02",
304
+ type: ["text-to-video"],
305
+ fields: {
306
+ prompt: { required: true },
307
+ resolution: { allowedValues: ["512P", "768P", "1080P"] }, // 768P as default
308
+ duration: { allowedValues: [6, 10] }, // in seconds, 6s as default
309
+ },
310
+ durationRules: {
311
+ 6: ["512P", "768P", "1080P"],
312
+ 10: ["512P", "768P"],
313
+ },
314
+ // parallelRequests: 1,
315
+ cost: {
316
+ table: {
317
+ "512P": { 6: 0.1, 10: 0.15 },
318
+ "768P": { 6: 0.28, 10: 0.56 },
319
+ "1080P": { 6: 0.49 },
320
+ },
321
+ },
322
+ },
323
+ "T2V-01-Director": {
324
+ modelId: "T2V-01-Director",
325
+ type: ["text-to-video"],
326
+ fields: {
327
+ prompt: { required: true },
328
+ resolution: { allowedValues: ["720P"] }, // 720P as default
329
+ duration: { allowedValues: [6] }, // in seconds, 5s as default
330
+ },
331
+ durationRules: {
332
+ 6: ["720P"],
333
+ },
334
+ // parallelRequests: 1,
335
+ cost: {
336
+ fixed: 0.28, // cost per video generation
337
+ },
338
+ },
339
+ "T2V-01": {
340
+ modelId: "T2V-01-Director",
341
+ type: ["text-to-video"],
342
+ fields: {
343
+ prompt: { required: true },
344
+ resolution: { allowedValues: ["720P"] }, // 720P as default
345
+ duration: { allowedValues: [6] }, // in seconds, 5s as default
346
+ },
347
+ durationRules: {
348
+ 6: ["720P"],
349
+ },
350
+ // parallelRequests: 1,
351
+ cost: { fixed: 0.28 },
352
+ },
353
+ // --- Alibaba models ---
354
+ "alibaba-wan-2.5": {
355
+ modelId: "wan2.5-t2v-preview",
356
+ type: ["text-to-video"],
357
+ fields: {
358
+ prompt: { required: true },
359
+ resolution: {
360
+ allowedValues: ["480p", "720p", "1080p"],
361
+ default: "1080p",
362
+ },
363
+ apectRatio: {
364
+ allowedValues: ["16:9", "9:16", "1:1", "4:3", "3:4"],
365
+ default: "16:9",
366
+ },
367
+ duration: {
368
+ allowedValues: [5, 10],
369
+ default: 5,
370
+ },
371
+ },
372
+ resolutionRules: {
373
+ "480p": ["16:9", "9:16", "1:1"],
374
+ "720p": ["16:9", "9:16", "1:1", "4:3", "3:4"],
375
+ "1080p": ["16:9", "1:1", "4:3", "3:4"],
376
+ },
377
+ cost: {
378
+ table: {
379
+ "832x480": { 5: 0.25, 10: 0.5 },
380
+ "480x832": { 5: 0.25, 10: 0.5 },
381
+ "624x624": { 5: 0.25, 10: 0.5 },
382
+ "1280x720": { 5: 0.5, 10: 1.0 },
383
+ "720x1280": { 5: 0.5, 10: 1.0 },
384
+ "960x960": { 5: 0.5, 10: 1.0 },
385
+ "1088x832": { 5: 0.5, 10: 1.0 },
386
+ "832x1088": { 5: 0.5, 10: 1.0 },
387
+ "1920x1080": { 5: 0.75, 10: 1.5 },
388
+ "1080x1920": { 5: 0.75, 10: 1.5 },
389
+ "1440x1440": { 5: 0.75, 10: 1.5 },
390
+ "1632x1248": { 5: 0.75, 10: 1.5 },
391
+ "1248x1632": { 5: 0.75, 10: 1.5 },
392
+ },
393
+ },
394
+ },
395
+ "alibaba-wan-2.2": {
396
+ modelId: "wan2.2-t2v-plus",
397
+ type: ["text-to-video"],
398
+ fields: {
399
+ prompt: { required: true },
400
+ resolution: {
401
+ allowedValues: ["480p", "1080p"],
402
+ },
403
+ apectRatio: {
404
+ allowedValues: ["16:9", "9:16", "1:1", "4:3", "3:4"],
405
+ },
406
+ duration: {
407
+ allowedValues: [5],
408
+ },
409
+ },
410
+ resolutionRules: {
411
+ "480p": ["16:9", "9:16", "1:1"],
412
+ "1080p": ["16:9", "1:1", "4:3", "3:4"],
413
+ },
414
+ cost: {
415
+ table: {
416
+ "832x480": { 5: 0.1 }, // 0.02/sec × 5s
417
+ "480x832": { 5: 0.1 },
418
+ "624x624": { 5: 0.1 },
419
+ "1920x1080": { 5: 0.5 }, // 0.10/sec × 5s
420
+ "1080x1920": { 5: 0.5 },
421
+ "1440x1440": { 5: 0.5 },
422
+ "1632x1248": { 5: 0.5 },
423
+ "1248x1632": { 5: 0.5 },
424
+ },
425
+ },
426
+ },
427
+ "openai-sora-2": {
428
+ modelId: "sora-2",
429
+ type: ["text-to-video", "image-to-video", "video-to-video"],
430
+ fields: {
431
+ prompt: { required: true },
432
+ durations: {
433
+ allowedValues: [4, 8, 12], // in seconds
434
+ default: 4,
435
+ },
436
+ dimensions: {
437
+ allowedValues: ["720x1280", "1280x720", "1024x1792", "1792x1024"],
438
+ default: "720x1280",
439
+ },
440
+ },
441
+ cost: {
442
+ perSecond: 0.1,
443
+ },
444
+ },
445
+ "openai-sora-2-pro": {
446
+ modelId: "sora-2-pro",
447
+ type: ["text-to-video", "image-to-video", "video-to-video"],
448
+ fields: {
449
+ prompt: { required: true },
450
+ durations: {
451
+ allowedValues: [4, 8, 12], // in seconds
452
+ default: 4,
453
+ },
454
+ dimensions: {
455
+ allowedValues: ["720x1280", "1280x720", "1024x1792", "1792x1024"],
456
+ default: "720x1280",
457
+ },
458
+ },
459
+ cost: {
460
+ perSecond: 0.3,
461
+ },
462
+ },
463
+ };
@@ -0,0 +1,4 @@
1
+ import { IConfig } from "./types";
2
+ declare const config: IConfig;
3
+ export default config;
4
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/globals/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,OAAO,EAAE,MAAM,SAAS,CAAC;AAgBzC,QAAA,MAAM,MAAM,EAAE,OAGb,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const types_1 = require("./types");
4
+ const configData = {
5
+ default: {
6
+ env: types_1.EENVS.DEV,
7
+ },
8
+ dev: {
9
+ env: types_1.EENVS.DEV,
10
+ },
11
+ prod: {
12
+ env: types_1.EENVS.PROD,
13
+ },
14
+ };
15
+ const env = process.env.NODE_ENV === "production" ? types_1.EENVS.PROD : types_1.EENVS.DEV;
16
+ const config = {
17
+ ...configData.default,
18
+ ...configData[env],
19
+ };
20
+ exports.default = config;
@@ -0,0 +1,6 @@
1
+ export * from "./aiModels";
2
+ export * from "./config";
3
+ export * from "./plans";
4
+ export * from "./schemas";
5
+ export * from "./types";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/globals/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./aiModels"), exports);
18
+ __exportStar(require("./config"), exports);
19
+ __exportStar(require("./plans"), exports);
20
+ __exportStar(require("./schemas"), exports);
21
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,3 @@
1
+ import { TPaymentPlans } from "./types";
2
+ export declare const PAYMENT_PLANS: TPaymentPlans;
3
+ //# sourceMappingURL=plans.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../../src/globals/plans.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,aAAa,EAEd,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,aAAa,EAAE,aAqC3B,CAAC"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PAYMENT_PLANS = void 0;
7
+ const config_1 = __importDefault(require("./config"));
8
+ const types_1 = require("./types");
9
+ exports.PAYMENT_PLANS = {
10
+ [types_1.ESUBSCRIPTION_PLANS.BASIC]: {
11
+ [types_1.ERENEWAL_FREQUENCY.MONTHLY]: {
12
+ id: config_1.default.env === "dev" ? "price_1SE6qzRDP4iEEKsW7lNtxJXa" : "",
13
+ price: 20,
14
+ credits: 1000,
15
+ },
16
+ [types_1.ERENEWAL_FREQUENCY.YEARLY]: {
17
+ id: config_1.default.env === "dev" ? "price_1SI7qdRDP4iEEKsWFPXyTfLb" : "",
18
+ price: 50,
19
+ credits: 12000,
20
+ },
21
+ },
22
+ [types_1.ESUBSCRIPTION_PLANS.PRO]: {
23
+ [types_1.ERENEWAL_FREQUENCY.MONTHLY]: {
24
+ id: config_1.default.env === "dev" ? "price_1SE6qmRDP4iEEKsWNRWk18uB" : "",
25
+ price: 50,
26
+ credits: 3000,
27
+ },
28
+ [types_1.ERENEWAL_FREQUENCY.YEARLY]: {
29
+ id: config_1.default.env === "dev" ? "price_1SI7sGRDP4iEEKsWVT2vXPg7" : "",
30
+ price: 20,
31
+ credits: 36000,
32
+ },
33
+ },
34
+ [types_1.ESUBSCRIPTION_PLANS.BUSINESS]: {
35
+ [types_1.ERENEWAL_FREQUENCY.MONTHLY]: {
36
+ id: config_1.default.env === "dev" ? "price_1SE6qYRDP4iEEKsWXbFTHAdx" : "",
37
+ price: 100,
38
+ credits: 8000,
39
+ },
40
+ [types_1.ERENEWAL_FREQUENCY.YEARLY]: {
41
+ id: config_1.default.env === "dev" ? "price_1SI7xdRDP4iEEKsWyLOfQhy3" : "",
42
+ price: 20,
43
+ credits: 96000,
44
+ },
45
+ },
46
+ };
47
+ // export const SUBSCRIPTION_PLAN_DETAILS: TSubscriptionPlanDetails = {
48
+ // [ESUBSCRIPTION_PLANS.BASIC]: {
49
+ // price: 20,
50
+ // credits: 1000,
51
+ // },
52
+ // [ESUBSCRIPTION_PLANS.PRO]: {
53
+ // price: 50,
54
+ // credits: 3000,
55
+ // },
56
+ // [ESUBSCRIPTION_PLANS.BUSINESS]: {
57
+ // price: 100,
58
+ // credits: 8000,
59
+ // },
60
+ // };
@@ -0,0 +1,3 @@
1
+ import { z } from "zod";
2
+ export declare const urlSchema: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
3
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/globals/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,SAAS,wDAWpB,CAAC"}