vidspotai-shared 1.0.32 → 1.0.34
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/lib/globals/index.d.ts +1 -0
- package/lib/globals/index.d.ts.map +1 -1
- package/lib/globals/index.js +1 -0
- package/lib/models/user.model.d.ts +2 -0
- package/lib/models/user.model.d.ts.map +1 -1
- package/lib/models/video.model.d.ts +9 -0
- package/lib/models/video.model.d.ts.map +1 -1
- package/lib/services/aiGen/aiGenFactory.service.d.ts.map +1 -1
- package/lib/services/aiGen/aiGenFactory.service.js +36 -12
- package/lib/services/aiGen/providers/bytedance/bytedance.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/bytedance/bytedance.service.js +22 -2
- package/lib/services/aiGen/providers/google/google.service.js +1 -1
- package/lib/services/aiGen/providers/kling/kling.service.d.ts +7 -2
- package/lib/services/aiGen/providers/kling/kling.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/kling/kling.service.js +126 -10
- package/lib/services/aiGen/providers/kling/types.d.ts +13 -0
- package/lib/services/aiGen/providers/kling/types.d.ts.map +1 -1
- package/lib/services/aiGen/providers/runway/runway.service.d.ts.map +1 -1
- package/lib/services/aiGen/providers/runway/runway.service.js +16 -4
- package/lib/services/aiGen/providers/types.d.ts +6 -0
- package/lib/services/aiGen/providers/types.d.ts.map +1 -1
- package/lib/services/credit.service.d.ts +1 -0
- package/lib/services/credit.service.d.ts.map +1 -1
- package/lib/services/credit.service.js +17 -0
- package/lib/services/index.d.ts +1 -0
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/index.js +1 -0
- package/lib/services/tts/providers/elevenlabs.service.d.ts +1 -0
- package/lib/services/tts/providers/elevenlabs.service.d.ts.map +1 -1
- package/lib/services/tts/providers/elevenlabs.service.js +4 -2
- package/lib/utils/helpers.js +2 -2
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +1 -0
- package/lib/utils/logger.d.ts +2 -1
- package/lib/utils/logger.d.ts.map +1 -1
- package/lib/utils/logger.js +2 -0
- package/package.json +1 -1
- package/lib/globals/aiModels.d.ts +0 -63
- package/lib/globals/aiModels.d.ts.map +0 -1
- package/lib/globals/aiModels.js +0 -529
|
@@ -11,9 +11,11 @@ class ElevenLabsService extends types_1.BaseTtsProviderService {
|
|
|
11
11
|
constructor() {
|
|
12
12
|
super();
|
|
13
13
|
this.baseUrl = "https://api.elevenlabs.io/v1";
|
|
14
|
-
|
|
14
|
+
const raw = process.env.ELEVENLABS_API_KEY?.trim();
|
|
15
|
+
if (!raw) {
|
|
15
16
|
throw new Error("Missing ELEVENLABS_API_KEY in environment variables");
|
|
16
17
|
}
|
|
18
|
+
this.apiKey = raw;
|
|
17
19
|
}
|
|
18
20
|
async generate(params) {
|
|
19
21
|
const voiceId = params.voiceId ?? elevenlabs_1.elevenlabsConfig.defaultVoiceId;
|
|
@@ -27,7 +29,7 @@ class ElevenLabsService extends types_1.BaseTtsProviderService {
|
|
|
27
29
|
},
|
|
28
30
|
}, {
|
|
29
31
|
headers: {
|
|
30
|
-
"xi-api-key":
|
|
32
|
+
"xi-api-key": this.apiKey,
|
|
31
33
|
"Content-Type": "application/json",
|
|
32
34
|
Accept: "audio/mpeg",
|
|
33
35
|
},
|
package/lib/utils/helpers.js
CHANGED
|
@@ -49,8 +49,8 @@ const getPriceIdByType = (type, freq = types_1.ERENEWAL_FREQUENCY.MONTHLY) => {
|
|
|
49
49
|
};
|
|
50
50
|
exports.getPriceIdByType = getPriceIdByType;
|
|
51
51
|
const getCreditsFromCost = (cost) => {
|
|
52
|
-
const margin = 0.2;
|
|
53
|
-
const costPerCredit = 0.1;
|
|
52
|
+
const margin = 0.2; // 20% margin
|
|
53
|
+
const costPerCredit = 0.1; // multiple
|
|
54
54
|
const minCredits = 10;
|
|
55
55
|
if (cost <= 0)
|
|
56
56
|
return 0;
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
|
package/lib/utils/index.js
CHANGED
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./helpers"), exports);
|
|
18
18
|
__exportStar(require("./logger"), exports);
|
|
19
|
+
__exportStar(require("./ttsUtils"), exports);
|
package/lib/utils/logger.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AA0B1C;;GAEG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAsExD;AAED,eAAO,MAAM,MAAM,gBAAyB,CAAC"}
|
package/lib/utils/logger.js
CHANGED
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.logger = void 0;
|
|
6
7
|
exports.createLogger = createLogger;
|
|
7
8
|
const winston_1 = __importDefault(require("winston"));
|
|
8
9
|
const winston_slack_webhook_transport_1 = __importDefault(require("winston-slack-webhook-transport"));
|
|
@@ -83,3 +84,4 @@ function createLogger(serviceName) {
|
|
|
83
84
|
exitOnError: false,
|
|
84
85
|
});
|
|
85
86
|
}
|
|
87
|
+
exports.logger = createLogger("shared");
|
package/package.json
CHANGED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
export declare enum EVideoGenModels {
|
|
2
|
-
GOOGLE_VEO_3_1_PREVIEW = "google-veo-3.1-preview",
|
|
3
|
-
GOOGLE_VEO_3_1__FAST_PREVIEW = "google-veo-3.1-fast-preview",
|
|
4
|
-
GOOGLE_VEO_3 = "google-veo-3",
|
|
5
|
-
GOOGLE_VEO_3_FAST = "google-veo-3-fast",
|
|
6
|
-
GOOGLE_VEO_2 = "google-veo-2",
|
|
7
|
-
RUNWAY_GEN4_TURBO = "runway-gen4-turbo",
|
|
8
|
-
RUNWAY_GEN4_ALEPH = "runway-gen4-aleph",
|
|
9
|
-
KLING_V1 = "kling-v1",
|
|
10
|
-
KLING_V1_6 = "kling-v1.6",
|
|
11
|
-
KLING_V2_MASTER = "kling-v2-master",
|
|
12
|
-
KLING_V2_1_MASTER = "kling-v2.1-master",
|
|
13
|
-
MINIMAX_HAILUO_02 = "minimax-hailuo-02",
|
|
14
|
-
T2V_01_DIRECTOR = "T2V-01-Director",
|
|
15
|
-
T2V_01 = "T2V-01",
|
|
16
|
-
AZURE_SORA = "azure-sora",
|
|
17
|
-
ALIBABA_WAN_2_5 = "alibaba-wan-2.5",
|
|
18
|
-
ALIBABA_WAN_2_2 = "alibaba-wan-2.2",
|
|
19
|
-
OPENAI_SORA_2 = "openai-sora-2",
|
|
20
|
-
OPENAI_SORA_2_PRO = "openai-sora-2-pro"
|
|
21
|
-
}
|
|
22
|
-
export declare const EImageGenModels: {
|
|
23
|
-
readonly OPENAI_DALLE_3: "openai-dalle-3";
|
|
24
|
-
readonly STABILITY_STABLE_DIFFUSION: "stability-stable-diffusion";
|
|
25
|
-
readonly MIDJOURNEY_V6: "midjourney-v6";
|
|
26
|
-
readonly FLUX_1_1: "flux-1.1";
|
|
27
|
-
readonly IDEOGRAM_1_0: "ideogram-1.0";
|
|
28
|
-
};
|
|
29
|
-
export declare enum ETextGenModels {
|
|
30
|
-
OPENAI_GPT_4O_MINI = "openai-gpt-4o-mini",
|
|
31
|
-
OPENAI_GPT_5_MINI = "openai-gpt-5-mini"
|
|
32
|
-
}
|
|
33
|
-
export type TAiGenModel = EVideoGenModels | ETextGenModels;
|
|
34
|
-
type GenerationType = "text-to-video" | "image-to-video" | "video-to-video" | "text-to-text" | "image-to-text";
|
|
35
|
-
interface ISchemaField {
|
|
36
|
-
required?: boolean;
|
|
37
|
-
allowedValues?: string[] | number[];
|
|
38
|
-
default?: string | number;
|
|
39
|
-
}
|
|
40
|
-
interface ICostTable {
|
|
41
|
-
[key: string]: {
|
|
42
|
-
[key: number]: number;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
interface IModelSchema {
|
|
46
|
-
modelId: string;
|
|
47
|
-
type: GenerationType[];
|
|
48
|
-
fields: Record<string, ISchemaField>;
|
|
49
|
-
resolutionRules?: Record<string, string[]>;
|
|
50
|
-
durationRules?: Record<number, string[]>;
|
|
51
|
-
concurrentRequests?: number;
|
|
52
|
-
requestPerMin?: number;
|
|
53
|
-
requestPerDay?: number;
|
|
54
|
-
cost?: {
|
|
55
|
-
perSecond?: number;
|
|
56
|
-
per1KTokens?: number;
|
|
57
|
-
table?: ICostTable;
|
|
58
|
-
fixed?: number;
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
export declare const aiModelConfigs: Record<TAiGenModel, IModelSchema>;
|
|
62
|
-
export {};
|
|
63
|
-
//# sourceMappingURL=aiModels.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aiModels.d.ts","sourceRoot":"","sources":["../../src/globals/aiModels.ts"],"names":[],"mappings":"AAwBA,oBAAY,eAAe;IACzB,sBAAsB,2BAA2B;IACjD,4BAA4B,gCAAgC;IAC5D,YA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