@veruna/api-contracts 22.8.0 → 22.11.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.
- package/build/locales/en.d.ts +4 -0
- package/build/locales/en.js +4 -0
- package/build/locales/en.js.map +1 -1
- package/build/locales/index.d.ts +8 -0
- package/build/locales/ru.d.ts +4 -0
- package/build/locales/ru.js +4 -0
- package/build/locales/ru.js.map +1 -1
- package/build/locales/validation.d.ts +136 -0
- package/build/locales/validation.js +110 -0
- package/build/locales/validation.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/v1/ai/tool-id.enum.d.ts +2 -0
- package/build/v1/ai/tool-id.enum.js +2 -0
- package/build/v1/ai/tool-id.enum.js.map +1 -1
- package/build/v1/ai-call/ai-caller.enum.d.ts +2 -0
- package/build/v1/ai-call/ai-caller.enum.js +2 -0
- package/build/v1/ai-call/ai-caller.enum.js.map +1 -1
- package/build/v1/ai-model/schemas/model-settings.schema.d.ts +105 -0
- package/build/v1/ai-model/schemas/model-settings.schema.js +20 -0
- package/build/v1/ai-model/schemas/model-settings.schema.js.map +1 -1
- package/build/v1/ai-model/schemas/setting-key.enum.d.ts +8 -2
- package/build/v1/ai-model/schemas/setting-key.enum.js +7 -1
- package/build/v1/ai-model/schemas/setting-key.enum.js.map +1 -1
- package/build/v1/chat/commands/create-reg-chat.command.d.ts +2 -0
- package/build/v1/chat/commands/create-unreg-chat.command.d.ts +2 -0
- package/build/v1/chat/commands/update-chat-title.command.d.ts +2 -0
- package/build/v1/chat/commands/update-chat.command.d.ts +2 -0
- package/build/v1/chat/queries/get-last-active-chat.query.d.ts +2 -0
- package/build/v1/chat/queries/get-reg-chat.query.d.ts +2 -0
- package/build/v1/chat/queries/get-unreg-chat.query.d.ts +2 -0
- package/build/v1/chat/schemas/chat-with-messages-response.schema.d.ts +2 -0
- package/build/v1/client-file/schemas/audio-mime-type.enum.d.ts +16 -0
- package/build/v1/client-file/schemas/audio-mime-type.enum.js +21 -0
- package/build/v1/client-file/schemas/audio-mime-type.enum.js.map +1 -0
- package/build/v1/client-file/schemas/client-file-type.enum.d.ts +2 -1
- package/build/v1/client-file/schemas/client-file-type.enum.js +1 -0
- package/build/v1/client-file/schemas/client-file-type.enum.js.map +1 -1
- package/build/v1/client-file/schemas/index.d.ts +1 -0
- package/build/v1/client-file/schemas/index.js +1 -0
- package/build/v1/client-file/schemas/index.js.map +1 -1
- package/build/v1/message/commands/create-message.command.d.ts +12 -0
- package/build/v1/message/message.errors.d.ts +4 -0
- package/build/v1/message/message.errors.js +20 -0
- package/build/v1/message/message.errors.js.map +1 -1
- package/build/v1/message/queries/get-message-stream-reg.query.d.ts +12 -0
- package/build/v1/message/queries/get-message-stream-unreg.query.d.ts +12 -0
- package/build/v1/message/schemas/cancel-stream-response.schema.d.ts +2 -1
- package/build/v1/message/schemas/cancel-stream-response.schema.js +2 -1
- package/build/v1/message/schemas/cancel-stream-response.schema.js.map +1 -1
- package/build/v1/message/schemas/generation-step-type.enum.d.ts +4 -0
- package/build/v1/message/schemas/generation-step-type.enum.js +4 -0
- package/build/v1/message/schemas/generation-step-type.enum.js.map +1 -1
- package/build/v1/message/schemas/index.d.ts +1 -1
- package/build/v1/message/schemas/index.js +4 -3
- package/build/v1/message/schemas/index.js.map +1 -1
- package/build/v1/message/schemas/message-attachment-response.schema.d.ts +7 -1
- package/build/v1/message/schemas/message-attachment-response.schema.js +5 -1
- package/build/v1/message/schemas/message-attachment-response.schema.js.map +1 -1
- package/build/v1/message/schemas/message-response.schema.d.ts +2 -0
- package/build/v1/message/schemas/message-stream-frame.schema.d.ts +6 -0
- package/build/v1/message/schemas/stream-event-type.enum.d.ts +7 -0
- package/build/v1/message/schemas/stream-event-type.enum.js +7 -0
- package/build/v1/message/schemas/stream-event-type.enum.js.map +1 -1
- package/build/v1/message/schemas/stream-events.schema.d.ts +17 -0
- package/build/v1/message/schemas/stream-events.schema.js +10 -1
- package/build/v1/message/schemas/stream-events.schema.js.map +1 -1
- package/build/v1/model-route/admin/commands/create-model-route.command.d.ts +68 -0
- package/build/v1/model-route/admin/commands/update-model-route.command.d.ts +68 -0
- package/build/v1/model-route/admin/commands/upsert-route-tool.command.d.ts +2 -0
- package/build/v1/model-route/admin/queries/get-model-route.query.d.ts +34 -0
- package/build/v1/model-route/admin/queries/list-model-routes-by-model.query.d.ts +34 -0
- package/build/v1/model-route/admin/queries/list-route-tools.query.d.ts +1 -0
- package/build/v1/model-route/schemas/audio-generation-config.constants.d.ts +5 -0
- package/build/v1/model-route/schemas/audio-generation-config.constants.js +9 -0
- package/build/v1/model-route/schemas/audio-generation-config.constants.js.map +1 -0
- package/build/v1/model-route/schemas/audio-generation-config.schema.d.ts +29 -0
- package/build/v1/model-route/schemas/audio-generation-config.schema.js +76 -0
- package/build/v1/model-route/schemas/audio-generation-config.schema.js.map +1 -0
- package/build/v1/model-route/schemas/audio-source-kind.enum.d.ts +9 -0
- package/build/v1/model-route/schemas/audio-source-kind.enum.js +14 -0
- package/build/v1/model-route/schemas/audio-source-kind.enum.js.map +1 -0
- package/build/v1/model-route/schemas/create-model-route-request.schema.d.ts +34 -0
- package/build/v1/model-route/schemas/duration-unit.enum.d.ts +5 -0
- package/build/v1/model-route/schemas/duration-unit.enum.js +10 -0
- package/build/v1/model-route/schemas/duration-unit.enum.js.map +1 -0
- package/build/v1/model-route/schemas/fal-generation-config.constants.d.ts +11 -0
- package/build/v1/model-route/schemas/fal-generation-config.constants.js +25 -0
- package/build/v1/model-route/schemas/fal-generation-config.constants.js.map +1 -0
- package/build/v1/model-route/schemas/fal-generation-config.schema.d.ts +21 -0
- package/build/v1/model-route/schemas/fal-generation-config.schema.js +84 -0
- package/build/v1/model-route/schemas/fal-generation-config.schema.js.map +1 -0
- package/build/v1/model-route/schemas/fal-result-shape.enum.d.ts +9 -0
- package/build/v1/model-route/schemas/fal-result-shape.enum.js +14 -0
- package/build/v1/model-route/schemas/fal-result-shape.enum.js.map +1 -0
- package/build/v1/model-route/schemas/index.d.ts +11 -0
- package/build/v1/model-route/schemas/index.js +11 -0
- package/build/v1/model-route/schemas/index.js.map +1 -1
- package/build/v1/model-route/schemas/kie-result-format.enum.d.ts +12 -0
- package/build/v1/model-route/schemas/kie-result-format.enum.js +17 -0
- package/build/v1/model-route/schemas/kie-result-format.enum.js.map +1 -0
- package/build/v1/model-route/schemas/list-model-routes-response.schema.d.ts +34 -0
- package/build/v1/model-route/schemas/media-input-keys.constants.d.ts +4 -0
- package/build/v1/model-route/schemas/media-input-keys.constants.js +12 -0
- package/build/v1/model-route/schemas/media-input-keys.constants.js.map +1 -0
- package/build/v1/model-route/schemas/media-input-keys.schema.d.ts +3 -0
- package/build/v1/model-route/schemas/media-input-keys.schema.js +34 -0
- package/build/v1/model-route/schemas/media-input-keys.schema.js.map +1 -0
- package/build/v1/model-route/schemas/media-input-slot.enum.d.ts +15 -0
- package/build/v1/model-route/schemas/media-input-slot.enum.js +20 -0
- package/build/v1/model-route/schemas/media-input-slot.enum.js.map +1 -0
- package/build/v1/model-route/schemas/media-pricing-source.enum.d.ts +9 -0
- package/build/v1/model-route/schemas/media-pricing-source.enum.js +14 -0
- package/build/v1/model-route/schemas/media-pricing-source.enum.js.map +1 -0
- package/build/v1/model-route/schemas/media-pricing-unit.enum.d.ts +9 -0
- package/build/v1/model-route/schemas/media-pricing-unit.enum.js +14 -0
- package/build/v1/model-route/schemas/media-pricing-unit.enum.js.map +1 -0
- package/build/v1/model-route/schemas/media-pricing.constants.d.ts +1 -0
- package/build/v1/model-route/schemas/media-pricing.constants.js +5 -0
- package/build/v1/model-route/schemas/media-pricing.constants.js.map +1 -0
- package/build/v1/model-route/schemas/media-pricing.schema.d.ts +37 -0
- package/build/v1/model-route/schemas/media-pricing.schema.js +55 -0
- package/build/v1/model-route/schemas/media-pricing.schema.js.map +1 -0
- package/build/v1/model-route/schemas/media-wire-key.constants.d.ts +1 -0
- package/build/v1/model-route/schemas/media-wire-key.constants.js +5 -0
- package/build/v1/model-route/schemas/media-wire-key.constants.js.map +1 -0
- package/build/v1/model-route/schemas/media-wire-key.schema.d.ts +2 -0
- package/build/v1/model-route/schemas/media-wire-key.schema.js +9 -0
- package/build/v1/model-route/schemas/media-wire-key.schema.js.map +1 -0
- package/build/v1/model-route/schemas/model-route-response.schema.d.ts +34 -0
- package/build/v1/model-route/schemas/music-operation.enum.d.ts +16 -0
- package/build/v1/model-route/schemas/music-operation.enum.js +21 -0
- package/build/v1/model-route/schemas/music-operation.enum.js.map +1 -0
- package/build/v1/model-route/schemas/openrouter-transport.enum.d.ts +5 -1
- package/build/v1/model-route/schemas/openrouter-transport.enum.js +4 -0
- package/build/v1/model-route/schemas/openrouter-transport.enum.js.map +1 -1
- package/build/v1/model-route/schemas/provider-generation-config.schema.d.ts +81 -0
- package/build/v1/model-route/schemas/provider-generation-config.schema.js +35 -2
- package/build/v1/model-route/schemas/provider-generation-config.schema.js.map +1 -1
- package/build/v1/model-route/schemas/route-tool-response.schema.d.ts +2 -0
- package/build/v1/model-route/schemas/route-tool-settings.constants.d.ts +2 -0
- package/build/v1/model-route/schemas/route-tool-settings.constants.js +6 -0
- package/build/v1/model-route/schemas/route-tool-settings.constants.js.map +1 -0
- package/build/v1/model-route/schemas/route-tool-settings.schema.d.ts +12 -4
- package/build/v1/model-route/schemas/route-tool-settings.schema.js +12 -5
- package/build/v1/model-route/schemas/route-tool-settings.schema.js.map +1 -1
- package/build/v1/model-route/schemas/update-model-route-request.schema.d.ts +34 -0
- package/build/v1/model-route/schemas/upsert-route-tool-request.schema.d.ts +1 -0
- package/build/v1/tool/admin/commands/create-model-tool-binding.command.d.ts +210 -0
- package/build/v1/tool/admin/commands/update-model-tool-binding.command.d.ts +211 -0
- package/build/v1/tool/admin/queries/get-model-tool-bindings.query.d.ts +105 -0
- package/build/v1/tool/schemas/model-tool-binding.constants.d.ts +2 -0
- package/build/v1/tool/schemas/model-tool-binding.constants.js +6 -0
- package/build/v1/tool/schemas/model-tool-binding.constants.js.map +1 -0
- package/build/v1/tool/schemas/tool.schema.d.ts +527 -0
- package/build/v1/tool/schemas/tool.schema.js +20 -1
- package/build/v1/tool/schemas/tool.schema.js.map +1 -1
- package/build-esm/.tsbuildinfo +1 -1
- package/build-esm/locales/en.js +4 -0
- package/build-esm/locales/en.js.map +1 -1
- package/build-esm/locales/ru.js +4 -0
- package/build-esm/locales/ru.js.map +1 -1
- package/build-esm/locales/validation.js +110 -0
- package/build-esm/locales/validation.js.map +1 -1
- package/build-esm/v1/ai/tool-id.enum.js +2 -0
- package/build-esm/v1/ai/tool-id.enum.js.map +1 -1
- package/build-esm/v1/ai-call/ai-caller.enum.js +2 -0
- package/build-esm/v1/ai-call/ai-caller.enum.js.map +1 -1
- package/build-esm/v1/ai-model/schemas/model-settings.schema.js +20 -0
- package/build-esm/v1/ai-model/schemas/model-settings.schema.js.map +1 -1
- package/build-esm/v1/ai-model/schemas/setting-key.enum.js +7 -1
- package/build-esm/v1/ai-model/schemas/setting-key.enum.js.map +1 -1
- package/build-esm/v1/client-file/schemas/audio-mime-type.enum.js +18 -0
- package/build-esm/v1/client-file/schemas/audio-mime-type.enum.js.map +1 -0
- package/build-esm/v1/client-file/schemas/client-file-type.enum.js +1 -0
- package/build-esm/v1/client-file/schemas/client-file-type.enum.js.map +1 -1
- package/build-esm/v1/client-file/schemas/index.js +1 -0
- package/build-esm/v1/client-file/schemas/index.js.map +1 -1
- package/build-esm/v1/message/message.errors.js +20 -0
- package/build-esm/v1/message/message.errors.js.map +1 -1
- package/build-esm/v1/message/schemas/cancel-stream-response.schema.js +2 -1
- package/build-esm/v1/message/schemas/cancel-stream-response.schema.js.map +1 -1
- package/build-esm/v1/message/schemas/generation-step-type.enum.js +4 -0
- package/build-esm/v1/message/schemas/generation-step-type.enum.js.map +1 -1
- package/build-esm/v1/message/schemas/index.js +1 -1
- package/build-esm/v1/message/schemas/index.js.map +1 -1
- package/build-esm/v1/message/schemas/message-attachment-response.schema.js +5 -1
- package/build-esm/v1/message/schemas/message-attachment-response.schema.js.map +1 -1
- package/build-esm/v1/message/schemas/stream-event-type.enum.js +7 -0
- package/build-esm/v1/message/schemas/stream-event-type.enum.js.map +1 -1
- package/build-esm/v1/message/schemas/stream-events.schema.js +9 -0
- package/build-esm/v1/message/schemas/stream-events.schema.js.map +1 -1
- package/build-esm/v1/model-route/schemas/audio-generation-config.constants.js +6 -0
- package/build-esm/v1/model-route/schemas/audio-generation-config.constants.js.map +1 -0
- package/build-esm/v1/model-route/schemas/audio-generation-config.schema.js +72 -0
- package/build-esm/v1/model-route/schemas/audio-generation-config.schema.js.map +1 -0
- package/build-esm/v1/model-route/schemas/audio-source-kind.enum.js +11 -0
- package/build-esm/v1/model-route/schemas/audio-source-kind.enum.js.map +1 -0
- package/build-esm/v1/model-route/schemas/duration-unit.enum.js +7 -0
- package/build-esm/v1/model-route/schemas/duration-unit.enum.js.map +1 -0
- package/build-esm/v1/model-route/schemas/fal-generation-config.constants.js +22 -0
- package/build-esm/v1/model-route/schemas/fal-generation-config.constants.js.map +1 -0
- package/build-esm/v1/model-route/schemas/fal-generation-config.schema.js +77 -0
- package/build-esm/v1/model-route/schemas/fal-generation-config.schema.js.map +1 -0
- package/build-esm/v1/model-route/schemas/fal-result-shape.enum.js +11 -0
- package/build-esm/v1/model-route/schemas/fal-result-shape.enum.js.map +1 -0
- package/build-esm/v1/model-route/schemas/index.js +11 -0
- package/build-esm/v1/model-route/schemas/index.js.map +1 -1
- package/build-esm/v1/model-route/schemas/kie-result-format.enum.js +14 -0
- package/build-esm/v1/model-route/schemas/kie-result-format.enum.js.map +1 -0
- package/build-esm/v1/model-route/schemas/media-input-keys.constants.js +9 -0
- package/build-esm/v1/model-route/schemas/media-input-keys.constants.js.map +1 -0
- package/build-esm/v1/model-route/schemas/media-input-keys.schema.js +31 -0
- package/build-esm/v1/model-route/schemas/media-input-keys.schema.js.map +1 -0
- package/build-esm/v1/model-route/schemas/media-input-slot.enum.js +17 -0
- package/build-esm/v1/model-route/schemas/media-input-slot.enum.js.map +1 -0
- package/build-esm/v1/model-route/schemas/media-pricing-source.enum.js +11 -0
- package/build-esm/v1/model-route/schemas/media-pricing-source.enum.js.map +1 -0
- package/build-esm/v1/model-route/schemas/media-pricing-unit.enum.js +11 -0
- package/build-esm/v1/model-route/schemas/media-pricing-unit.enum.js.map +1 -0
- package/build-esm/v1/model-route/schemas/media-pricing.constants.js +2 -0
- package/build-esm/v1/model-route/schemas/media-pricing.constants.js.map +1 -0
- package/build-esm/v1/model-route/schemas/media-pricing.schema.js +52 -0
- package/build-esm/v1/model-route/schemas/media-pricing.schema.js.map +1 -0
- package/build-esm/v1/model-route/schemas/media-wire-key.constants.js +2 -0
- package/build-esm/v1/model-route/schemas/media-wire-key.constants.js.map +1 -0
- package/build-esm/v1/model-route/schemas/media-wire-key.schema.js +6 -0
- package/build-esm/v1/model-route/schemas/media-wire-key.schema.js.map +1 -0
- package/build-esm/v1/model-route/schemas/music-operation.enum.js +18 -0
- package/build-esm/v1/model-route/schemas/music-operation.enum.js.map +1 -0
- package/build-esm/v1/model-route/schemas/openrouter-transport.enum.js +4 -0
- package/build-esm/v1/model-route/schemas/openrouter-transport.enum.js.map +1 -1
- package/build-esm/v1/model-route/schemas/provider-generation-config.schema.js +33 -1
- package/build-esm/v1/model-route/schemas/provider-generation-config.schema.js.map +1 -1
- package/build-esm/v1/model-route/schemas/route-tool-settings.constants.js +3 -0
- package/build-esm/v1/model-route/schemas/route-tool-settings.constants.js.map +1 -0
- package/build-esm/v1/model-route/schemas/route-tool-settings.schema.js +10 -4
- package/build-esm/v1/model-route/schemas/route-tool-settings.schema.js.map +1 -1
- package/build-esm/v1/tool/schemas/model-tool-binding.constants.js +3 -0
- package/build-esm/v1/tool/schemas/model-tool-binding.constants.js.map +1 -0
- package/build-esm/v1/tool/schemas/tool.schema.js +18 -0
- package/build-esm/v1/tool/schemas/tool.schema.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AudioSourceKind } from './audio-source-kind.enum';
|
|
3
|
+
import { MusicOperation } from './music-operation.enum';
|
|
4
|
+
export { AUDIO_MAX_OUTPUTS_CEILING } from './audio-generation-config.constants';
|
|
5
|
+
/**
|
|
6
|
+
* Neutral block of a music route (`runtimeOverrides.audio`): what the route can do, whatever the
|
|
7
|
+
* provider. An audio request on a route without it is not eligible.
|
|
8
|
+
*/
|
|
9
|
+
export declare const AudioGenerationConfigSchema: z.ZodObject<{
|
|
10
|
+
operation: z.ZodEnum<typeof MusicOperation>;
|
|
11
|
+
sources: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof AudioSourceKind>>>;
|
|
12
|
+
vendorRefTtlHours: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
maxOutputs: z.ZodNumber;
|
|
14
|
+
maxLyricsChars: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
pricing: z.ZodObject<{
|
|
16
|
+
unit: z.ZodEnum<typeof import("./media-pricing-unit.enum").MediaPricingUnit>;
|
|
17
|
+
rates: z.ZodArray<z.ZodObject<{
|
|
18
|
+
conditions: z.ZodArray<z.ZodObject<{
|
|
19
|
+
settingKey: z.ZodEnum<typeof import("../..").SettingKey>;
|
|
20
|
+
optionId: z.ZodString;
|
|
21
|
+
}, z.core.$strict>>;
|
|
22
|
+
usd: z.ZodNumber;
|
|
23
|
+
}, z.core.$strict>>;
|
|
24
|
+
perInputImageUsd: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
source: z.ZodEnum<typeof import("./media-pricing-source.enum").MediaPricingSource>;
|
|
26
|
+
verifiedAt: z.ZodISODate;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
export type AudioGenerationConfig = z.infer<typeof AudioGenerationConfigSchema>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AudioGenerationConfigSchema = exports.AUDIO_MAX_OUTPUTS_CEILING = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const audio_generation_config_constants_1 = require("./audio-generation-config.constants");
|
|
6
|
+
const audio_source_kind_enum_1 = require("./audio-source-kind.enum");
|
|
7
|
+
const media_pricing_schema_1 = require("./media-pricing.schema");
|
|
8
|
+
const music_operation_enum_1 = require("./music-operation.enum");
|
|
9
|
+
var audio_generation_config_constants_2 = require("./audio-generation-config.constants");
|
|
10
|
+
Object.defineProperty(exports, "AUDIO_MAX_OUTPUTS_CEILING", { enumerable: true, get: function () { return audio_generation_config_constants_2.AUDIO_MAX_OUTPUTS_CEILING; } });
|
|
11
|
+
/**
|
|
12
|
+
* Neutral block of a music route (`runtimeOverrides.audio`): what the route can do, whatever the
|
|
13
|
+
* provider. An audio request on a route without it is not eligible.
|
|
14
|
+
*/
|
|
15
|
+
exports.AudioGenerationConfigSchema = zod_1.z
|
|
16
|
+
.object({
|
|
17
|
+
operation: zod_1.z.enum(music_operation_enum_1.MusicOperation),
|
|
18
|
+
/** Source kinds the route takes, in order of preference. Edits only. */
|
|
19
|
+
sources: zod_1.z
|
|
20
|
+
.array(zod_1.z.enum(audio_source_kind_enum_1.AudioSourceKind))
|
|
21
|
+
.max(audio_generation_config_constants_1.AUDIO_SOURCES_MAX, { message: 'AudioGenerationConfig.sources.max' })
|
|
22
|
+
.refine((sources) => new Set(sources).size === sources.length, {
|
|
23
|
+
message: 'AudioGenerationConfig.sources.duplicate',
|
|
24
|
+
})
|
|
25
|
+
.optional(),
|
|
26
|
+
/** How long a vendor's track handle stays valid. Needed when VENDOR_REF is a source. */
|
|
27
|
+
vendorRefTtlHours: zod_1.z
|
|
28
|
+
.number()
|
|
29
|
+
.int()
|
|
30
|
+
.positive()
|
|
31
|
+
.max(audio_generation_config_constants_1.AUDIO_VENDOR_REF_TTL_HOURS_MAX, {
|
|
32
|
+
message: 'AudioGenerationConfig.vendorRefTtlHours.max',
|
|
33
|
+
})
|
|
34
|
+
.optional(),
|
|
35
|
+
/** Outputs one call may return; the quota pre-check and a cap use it. */
|
|
36
|
+
maxOutputs: zod_1.z.number().int().min(1).max(audio_generation_config_constants_1.AUDIO_MAX_OUTPUTS_CEILING),
|
|
37
|
+
/** Longest lyrics the route takes; routes that cannot take long lyrics are filtered out. */
|
|
38
|
+
maxLyricsChars: zod_1.z
|
|
39
|
+
.number()
|
|
40
|
+
.int()
|
|
41
|
+
.positive()
|
|
42
|
+
.max(audio_generation_config_constants_1.AUDIO_LYRICS_CHARS_MAX, { message: 'AudioGenerationConfig.maxLyricsChars.max' })
|
|
43
|
+
.optional(),
|
|
44
|
+
pricing: media_pricing_schema_1.MediaPricingSchema,
|
|
45
|
+
})
|
|
46
|
+
.strict()
|
|
47
|
+
.superRefine((config, ctx) => {
|
|
48
|
+
const sources = config.sources;
|
|
49
|
+
if (config.operation === music_operation_enum_1.MusicOperation.GENERATE) {
|
|
50
|
+
if (sources !== undefined) {
|
|
51
|
+
ctx.addIssue({
|
|
52
|
+
code: 'custom',
|
|
53
|
+
message: 'AudioGenerationConfig.sources.forbiddenOnGenerate',
|
|
54
|
+
path: ['sources'],
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (sources === undefined || sources.length === 0) {
|
|
60
|
+
ctx.addIssue({
|
|
61
|
+
code: 'custom',
|
|
62
|
+
message: 'AudioGenerationConfig.sources.required',
|
|
63
|
+
path: ['sources'],
|
|
64
|
+
});
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (sources.includes(audio_source_kind_enum_1.AudioSourceKind.VENDOR_REF) &&
|
|
68
|
+
config.vendorRefTtlHours === undefined) {
|
|
69
|
+
ctx.addIssue({
|
|
70
|
+
code: 'custom',
|
|
71
|
+
message: 'AudioGenerationConfig.vendorRefTtlHours.required',
|
|
72
|
+
path: ['vendorRefTtlHours'],
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=audio-generation-config.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio-generation-config.schema.js","sourceRoot":"","sources":["../../../../v1/model-route/schemas/audio-generation-config.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,2FAK6C;AAC7C,qEAA2D;AAC3D,iEAA4D;AAC5D,iEAAwD;AAExD,yFAAgF;AAAvE,8IAAA,yBAAyB,OAAA;AAElC;;;GAGG;AACU,QAAA,2BAA2B,GAAG,OAAC;KACvC,MAAM,CAAC;IACJ,SAAS,EAAE,OAAC,CAAC,IAAI,CAAC,qCAAc,CAAC;IACjC,wEAAwE;IACxE,OAAO,EAAE,OAAC;SACL,KAAK,CAAC,OAAC,CAAC,IAAI,CAAC,wCAAe,CAAC,CAAC;SAC9B,GAAG,CAAC,qDAAiB,EAAE,EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC;SACxE,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM,EAAE;QAC3D,OAAO,EAAE,yCAAyC;KACrD,CAAC;SACD,QAAQ,EAAE;IACf,wFAAwF;IACxF,iBAAiB,EAAE,OAAC;SACf,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,GAAG,CAAC,kEAA8B,EAAE;QACjC,OAAO,EAAE,6CAA6C;KACzD,CAAC;SACD,QAAQ,EAAE;IACf,yEAAyE;IACzE,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,6DAAyB,CAAC;IAClE,4FAA4F;IAC5F,cAAc,EAAE,OAAC;SACZ,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,GAAG,CAAC,0DAAsB,EAAE,EAAE,OAAO,EAAE,0CAA0C,EAAE,CAAC;SACpF,QAAQ,EAAE;IACf,OAAO,EAAE,yCAAkB;CAC9B,CAAC;KACD,MAAM,EAAE;KACR,WAAW,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;IACzB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAC/B,IAAI,MAAM,CAAC,SAAS,KAAK,qCAAc,CAAC,QAAQ,EAAE,CAAC;QAC/C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YACxB,GAAG,CAAC,QAAQ,CAAC;gBACT,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,mDAAmD;gBAC5D,IAAI,EAAE,CAAC,SAAS,CAAC;aACpB,CAAC,CAAC;QACP,CAAC;QACD,OAAO;IACX,CAAC;IACD,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChD,GAAG,CAAC,QAAQ,CAAC;YACT,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,wCAAwC;YACjD,IAAI,EAAE,CAAC,SAAS,CAAC;SACpB,CAAC,CAAC;QACH,OAAO;IACX,CAAC;IACD,IACI,OAAO,CAAC,QAAQ,CAAC,wCAAe,CAAC,UAAU,CAAC;QAC5C,MAAM,CAAC,iBAAiB,KAAK,SAAS,EACxC,CAAC;QACC,GAAG,CAAC,QAAQ,CAAC;YACT,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,kDAAkD;YAC3D,IAAI,EAAE,CAAC,mBAAmB,CAAC;SAC9B,CAAC,CAAC;IACP,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a route takes the source audio of an edit, in the route's own order of preference.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum AudioSourceKind {
|
|
5
|
+
/** The vendor's own handle of a track it made (task id and audio id); expires with the vendor's storage. */
|
|
6
|
+
VENDOR_REF = "VENDOR_REF",
|
|
7
|
+
/** A URL the vendor downloads the audio from. */
|
|
8
|
+
URL = "URL"
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AudioSourceKind = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* How a route takes the source audio of an edit, in the route's own order of preference.
|
|
6
|
+
*/
|
|
7
|
+
var AudioSourceKind;
|
|
8
|
+
(function (AudioSourceKind) {
|
|
9
|
+
/** The vendor's own handle of a track it made (task id and audio id); expires with the vendor's storage. */
|
|
10
|
+
AudioSourceKind["VENDOR_REF"] = "VENDOR_REF";
|
|
11
|
+
/** A URL the vendor downloads the audio from. */
|
|
12
|
+
AudioSourceKind["URL"] = "URL";
|
|
13
|
+
})(AudioSourceKind || (exports.AudioSourceKind = AudioSourceKind = {}));
|
|
14
|
+
//# sourceMappingURL=audio-source-kind.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio-source-kind.enum.js","sourceRoot":"","sources":["../../../../v1/model-route/schemas/audio-source-kind.enum.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,eAKX;AALD,WAAY,eAAe;IACvB,4GAA4G;IAC5G,4CAAyB,CAAA;IACzB,iDAAiD;IACjD,8BAAW,CAAA;AACf,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B"}
|
|
@@ -40,6 +40,40 @@ export declare const CreateModelRouteRequestSchema: z.ZodObject<{
|
|
|
40
40
|
fallback: z.ZodOptional<z.ZodNumber>;
|
|
41
41
|
}, z.core.$strict>>;
|
|
42
42
|
selectedOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
43
|
+
resultFormat: z.ZodOptional<z.ZodEnum<typeof import("./kie-result-format.enum").KieResultFormat>>;
|
|
44
|
+
inputKeys: z.ZodOptional<z.ZodRecord<z.ZodEnum<typeof import("./media-input-slot.enum").MediaInputSlot> & z.core.$partial, z.ZodString>>;
|
|
45
|
+
vendorRefKeys: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
taskId: z.ZodString;
|
|
47
|
+
itemId: z.ZodString;
|
|
48
|
+
}, z.core.$strict>>;
|
|
49
|
+
}, z.core.$strict>>;
|
|
50
|
+
fal: z.ZodOptional<z.ZodObject<{
|
|
51
|
+
appId: z.ZodString;
|
|
52
|
+
inputKeys: z.ZodRecord<z.ZodEnum<typeof import("./media-input-slot.enum").MediaInputSlot> & z.core.$partial, z.ZodString>;
|
|
53
|
+
fixedInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
54
|
+
result: z.ZodEnum<typeof import("./fal-result-shape.enum").FalResultShape>;
|
|
55
|
+
durationUnit: z.ZodOptional<z.ZodEnum<typeof import("./duration-unit.enum").DurationUnit>>;
|
|
56
|
+
unitPriceUsd: z.ZodNumber;
|
|
57
|
+
}, z.core.$strict>>;
|
|
58
|
+
audio: z.ZodOptional<z.ZodObject<{
|
|
59
|
+
operation: z.ZodEnum<typeof import("./music-operation.enum").MusicOperation>;
|
|
60
|
+
sources: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof import("./audio-source-kind.enum").AudioSourceKind>>>;
|
|
61
|
+
vendorRefTtlHours: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
maxOutputs: z.ZodNumber;
|
|
63
|
+
maxLyricsChars: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
pricing: z.ZodObject<{
|
|
65
|
+
unit: z.ZodEnum<typeof import("./media-pricing-unit.enum").MediaPricingUnit>;
|
|
66
|
+
rates: z.ZodArray<z.ZodObject<{
|
|
67
|
+
conditions: z.ZodArray<z.ZodObject<{
|
|
68
|
+
settingKey: z.ZodEnum<typeof import("../..").SettingKey>;
|
|
69
|
+
optionId: z.ZodString;
|
|
70
|
+
}, z.core.$strict>>;
|
|
71
|
+
usd: z.ZodNumber;
|
|
72
|
+
}, z.core.$strict>>;
|
|
73
|
+
perInputImageUsd: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
source: z.ZodEnum<typeof import("./media-pricing-source.enum").MediaPricingSource>;
|
|
75
|
+
verifiedAt: z.ZodISODate;
|
|
76
|
+
}, z.core.$strict>;
|
|
43
77
|
}, z.core.$strict>>;
|
|
44
78
|
wellflow: z.ZodOptional<z.ZodObject<{
|
|
45
79
|
protocol: z.ZodOptional<z.ZodEnum<typeof import("./wellflow-protocol.enum").WellflowProtocol>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DurationUnit = void 0;
|
|
4
|
+
/** Unit of the duration input a provider's app expects. */
|
|
5
|
+
var DurationUnit;
|
|
6
|
+
(function (DurationUnit) {
|
|
7
|
+
DurationUnit["SECONDS"] = "SECONDS";
|
|
8
|
+
DurationUnit["MILLISECONDS"] = "MILLISECONDS";
|
|
9
|
+
})(DurationUnit || (exports.DurationUnit = DurationUnit = {}));
|
|
10
|
+
//# sourceMappingURL=duration-unit.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration-unit.enum.js","sourceRoot":"","sources":["../../../../v1/model-route/schemas/duration-unit.enum.ts"],"names":[],"mappings":";;;AAAA,2DAA2D;AAC3D,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,6CAA6B,CAAA;AACjC,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Most keys a fal route's `fixedInput` may hold. */
|
|
2
|
+
export declare const FAL_FIXED_INPUT_MAX_KEYS = 20;
|
|
3
|
+
/** Longest string value of a fal route's `fixedInput`. */
|
|
4
|
+
export declare const FAL_FIXED_INPUT_STRING_MAX = 200;
|
|
5
|
+
/** Safety, sync and output count are controlled by the fal adapter. */
|
|
6
|
+
export declare const FAL_RESERVED_WIRE_KEYS: ReadonlySet<string>;
|
|
7
|
+
export declare const FAL_FIXED_INPUT_FORBIDDEN_KEYS: ReadonlySet<string>;
|
|
8
|
+
/** One fal app id segment: lowercase, digits, dot, underscore, dash. */
|
|
9
|
+
export declare const FAL_APP_ID_SEGMENT: RegExp;
|
|
10
|
+
export declare const ASCII_CONTROL_MAX = 31;
|
|
11
|
+
export declare const ASCII_DELETE = 127;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ASCII_DELETE = exports.ASCII_CONTROL_MAX = exports.FAL_APP_ID_SEGMENT = exports.FAL_FIXED_INPUT_FORBIDDEN_KEYS = exports.FAL_RESERVED_WIRE_KEYS = exports.FAL_FIXED_INPUT_STRING_MAX = exports.FAL_FIXED_INPUT_MAX_KEYS = void 0;
|
|
4
|
+
/** Most keys a fal route's `fixedInput` may hold. */
|
|
5
|
+
exports.FAL_FIXED_INPUT_MAX_KEYS = 20;
|
|
6
|
+
/** Longest string value of a fal route's `fixedInput`. */
|
|
7
|
+
exports.FAL_FIXED_INPUT_STRING_MAX = 200;
|
|
8
|
+
/** Safety, sync and output count are controlled by the fal adapter. */
|
|
9
|
+
exports.FAL_RESERVED_WIRE_KEYS = new Set([
|
|
10
|
+
'sync_mode',
|
|
11
|
+
'enable_safety_checker',
|
|
12
|
+
'num_outputs',
|
|
13
|
+
'num_samples',
|
|
14
|
+
'n',
|
|
15
|
+
'batch_size',
|
|
16
|
+
]);
|
|
17
|
+
exports.FAL_FIXED_INPUT_FORBIDDEN_KEYS = new Set([
|
|
18
|
+
...exports.FAL_RESERVED_WIRE_KEYS,
|
|
19
|
+
'prompt',
|
|
20
|
+
]);
|
|
21
|
+
/** One fal app id segment: lowercase, digits, dot, underscore, dash. */
|
|
22
|
+
exports.FAL_APP_ID_SEGMENT = /^[a-z0-9._-]+$/;
|
|
23
|
+
exports.ASCII_CONTROL_MAX = 0x1f;
|
|
24
|
+
exports.ASCII_DELETE = 0x7f;
|
|
25
|
+
//# sourceMappingURL=fal-generation-config.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fal-generation-config.constants.js","sourceRoot":"","sources":["../../../../v1/model-route/schemas/fal-generation-config.constants.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACxC,QAAA,wBAAwB,GAAG,EAAE,CAAC;AAE3C,0DAA0D;AAC7C,QAAA,0BAA0B,GAAG,GAAG,CAAC;AAE9C,uEAAuE;AAC1D,QAAA,sBAAsB,GAAwB,IAAI,GAAG,CAAC;IAC/D,WAAW;IACX,uBAAuB;IACvB,aAAa;IACb,aAAa;IACb,GAAG;IACH,YAAY;CACf,CAAC,CAAC;AAEU,QAAA,8BAA8B,GAAwB,IAAI,GAAG,CAAC;IACvE,GAAG,8BAAsB;IACzB,QAAQ;CACX,CAAC,CAAC;AAEH,wEAAwE;AAC3D,QAAA,kBAAkB,GAAG,gBAAgB,CAAC;AAEtC,QAAA,iBAAiB,GAAG,IAAI,CAAC;AACzB,QAAA,YAAY,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DurationUnit } from './duration-unit.enum';
|
|
3
|
+
import { FalResultShape } from './fal-result-shape.enum';
|
|
4
|
+
export { FAL_FIXED_INPUT_FORBIDDEN_KEYS, FAL_FIXED_INPUT_MAX_KEYS, FAL_FIXED_INPUT_STRING_MAX, } from './fal-generation-config.constants';
|
|
5
|
+
/** `owner/app`: exactly two segments, so the id cannot reshape the URL it is placed into. */
|
|
6
|
+
export declare function isFalAppId(value: string): boolean;
|
|
7
|
+
export declare const FalFixedInputValueSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
8
|
+
export type FalFixedInputValue = z.infer<typeof FalFixedInputValueSchema>;
|
|
9
|
+
/**
|
|
10
|
+
* Route namespace of the fal provider (`runtimeOverrides.fal`): which app serves the route, how the
|
|
11
|
+
* neutral input slots map to the app's own keys, and what its result looks like.
|
|
12
|
+
*/
|
|
13
|
+
export declare const FalGenerationConfigSchema: z.ZodObject<{
|
|
14
|
+
appId: z.ZodString;
|
|
15
|
+
inputKeys: z.ZodRecord<z.ZodEnum<typeof import("./media-input-slot.enum").MediaInputSlot> & z.core.$partial, z.ZodString>;
|
|
16
|
+
fixedInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
17
|
+
result: z.ZodEnum<typeof FalResultShape>;
|
|
18
|
+
durationUnit: z.ZodOptional<z.ZodEnum<typeof DurationUnit>>;
|
|
19
|
+
unitPriceUsd: z.ZodNumber;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
export type FalGenerationConfig = z.infer<typeof FalGenerationConfigSchema>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FalGenerationConfigSchema = exports.FalFixedInputValueSchema = exports.FAL_FIXED_INPUT_STRING_MAX = exports.FAL_FIXED_INPUT_MAX_KEYS = exports.FAL_FIXED_INPUT_FORBIDDEN_KEYS = void 0;
|
|
4
|
+
exports.isFalAppId = isFalAppId;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const duration_unit_enum_1 = require("./duration-unit.enum");
|
|
7
|
+
const fal_generation_config_constants_1 = require("./fal-generation-config.constants");
|
|
8
|
+
const fal_result_shape_enum_1 = require("./fal-result-shape.enum");
|
|
9
|
+
const media_input_keys_schema_1 = require("./media-input-keys.schema");
|
|
10
|
+
const media_wire_key_schema_1 = require("./media-wire-key.schema");
|
|
11
|
+
var fal_generation_config_constants_2 = require("./fal-generation-config.constants");
|
|
12
|
+
Object.defineProperty(exports, "FAL_FIXED_INPUT_FORBIDDEN_KEYS", { enumerable: true, get: function () { return fal_generation_config_constants_2.FAL_FIXED_INPUT_FORBIDDEN_KEYS; } });
|
|
13
|
+
Object.defineProperty(exports, "FAL_FIXED_INPUT_MAX_KEYS", { enumerable: true, get: function () { return fal_generation_config_constants_2.FAL_FIXED_INPUT_MAX_KEYS; } });
|
|
14
|
+
Object.defineProperty(exports, "FAL_FIXED_INPUT_STRING_MAX", { enumerable: true, get: function () { return fal_generation_config_constants_2.FAL_FIXED_INPUT_STRING_MAX; } });
|
|
15
|
+
function isFalAppIdSegment(segment) {
|
|
16
|
+
return fal_generation_config_constants_1.FAL_APP_ID_SEGMENT.test(segment) && !segment.includes('..') && segment !== '.';
|
|
17
|
+
}
|
|
18
|
+
/** `owner/app`: exactly two segments, so the id cannot reshape the URL it is placed into. */
|
|
19
|
+
function isFalAppId(value) {
|
|
20
|
+
const segments = value.split('/');
|
|
21
|
+
return segments.length === 2 && segments.every(isFalAppIdSegment);
|
|
22
|
+
}
|
|
23
|
+
function looksLikeUrl(value) {
|
|
24
|
+
let start = 0;
|
|
25
|
+
for (const character of value) {
|
|
26
|
+
const code = character.charCodeAt(0);
|
|
27
|
+
if (code > fal_generation_config_constants_1.ASCII_CONTROL_MAX && code !== fal_generation_config_constants_1.ASCII_DELETE && character.trim() !== '') {
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
start += character.length;
|
|
31
|
+
}
|
|
32
|
+
const lower = value.slice(start).toLowerCase();
|
|
33
|
+
return (lower.includes('://') ||
|
|
34
|
+
lower.startsWith('//') ||
|
|
35
|
+
lower.startsWith('data:') ||
|
|
36
|
+
lower.startsWith('javascript:'));
|
|
37
|
+
}
|
|
38
|
+
exports.FalFixedInputValueSchema = zod_1.z.union([
|
|
39
|
+
zod_1.z
|
|
40
|
+
.string()
|
|
41
|
+
.max(fal_generation_config_constants_1.FAL_FIXED_INPUT_STRING_MAX)
|
|
42
|
+
.refine((value) => !looksLikeUrl(value), {
|
|
43
|
+
message: 'FalGenerationConfig.fixedInput.urlValue',
|
|
44
|
+
}),
|
|
45
|
+
zod_1.z.number(),
|
|
46
|
+
zod_1.z.boolean(),
|
|
47
|
+
]);
|
|
48
|
+
/**
|
|
49
|
+
* Route namespace of the fal provider (`runtimeOverrides.fal`): which app serves the route, how the
|
|
50
|
+
* neutral input slots map to the app's own keys, and what its result looks like.
|
|
51
|
+
*/
|
|
52
|
+
exports.FalGenerationConfigSchema = zod_1.z
|
|
53
|
+
.object({
|
|
54
|
+
appId: zod_1.z.string().refine(isFalAppId, { message: 'FalGenerationConfig.appId.invalid' }),
|
|
55
|
+
inputKeys: (0, media_input_keys_schema_1.createMediaInputKeysSchema)(fal_generation_config_constants_1.FAL_RESERVED_WIRE_KEYS, 'FalGenerationConfig'),
|
|
56
|
+
fixedInput: zod_1.z.record(media_wire_key_schema_1.MediaWireKeySchema, exports.FalFixedInputValueSchema).optional(),
|
|
57
|
+
result: zod_1.z.enum(fal_result_shape_enum_1.FalResultShape),
|
|
58
|
+
durationUnit: zod_1.z.enum(duration_unit_enum_1.DurationUnit).optional(),
|
|
59
|
+
/** USD per `x-fal-billable-units`: the app's billing-unit price, not a rate of the media price table. */
|
|
60
|
+
unitPriceUsd: zod_1.z.number().positive(),
|
|
61
|
+
})
|
|
62
|
+
.strict()
|
|
63
|
+
.superRefine((config, ctx) => {
|
|
64
|
+
const mappedKeys = new Set(Object.values(config.inputKeys).map((key) => key?.toLowerCase()));
|
|
65
|
+
const fixedKeys = Object.keys(config.fixedInput ?? {});
|
|
66
|
+
if (fixedKeys.length > fal_generation_config_constants_1.FAL_FIXED_INPUT_MAX_KEYS) {
|
|
67
|
+
ctx.addIssue({
|
|
68
|
+
code: 'custom',
|
|
69
|
+
message: 'FalGenerationConfig.fixedInput.tooManyKeys',
|
|
70
|
+
path: ['fixedInput'],
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
for (const key of fixedKeys) {
|
|
74
|
+
const lower = key.toLowerCase();
|
|
75
|
+
if (fal_generation_config_constants_1.FAL_FIXED_INPUT_FORBIDDEN_KEYS.has(lower) || mappedKeys.has(lower)) {
|
|
76
|
+
ctx.addIssue({
|
|
77
|
+
code: 'custom',
|
|
78
|
+
message: 'FalGenerationConfig.fixedInput.reservedKey',
|
|
79
|
+
path: ['fixedInput', key],
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=fal-generation-config.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fal-generation-config.schema.js","sourceRoot":"","sources":["../../../../v1/model-route/schemas/fal-generation-config.schema.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Where a fal app puts its output in the result body. */
|
|
2
|
+
export declare enum FalResultShape {
|
|
3
|
+
/** A single file object. */
|
|
4
|
+
AUDIO_FILE = "AUDIO_FILE",
|
|
5
|
+
/** A list of file objects. */
|
|
6
|
+
AUDIO_FILE_LIST = "AUDIO_FILE_LIST",
|
|
7
|
+
/** One zip archive that holds the outputs. */
|
|
8
|
+
ZIP_FILE = "ZIP_FILE"
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FalResultShape = void 0;
|
|
4
|
+
/** Where a fal app puts its output in the result body. */
|
|
5
|
+
var FalResultShape;
|
|
6
|
+
(function (FalResultShape) {
|
|
7
|
+
/** A single file object. */
|
|
8
|
+
FalResultShape["AUDIO_FILE"] = "AUDIO_FILE";
|
|
9
|
+
/** A list of file objects. */
|
|
10
|
+
FalResultShape["AUDIO_FILE_LIST"] = "AUDIO_FILE_LIST";
|
|
11
|
+
/** One zip archive that holds the outputs. */
|
|
12
|
+
FalResultShape["ZIP_FILE"] = "ZIP_FILE";
|
|
13
|
+
})(FalResultShape || (exports.FalResultShape = FalResultShape = {}));
|
|
14
|
+
//# sourceMappingURL=fal-result-shape.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fal-result-shape.enum.js","sourceRoot":"","sources":["../../../../v1/model-route/schemas/fal-result-shape.enum.ts"],"names":[],"mappings":";;;AAAA,0DAA0D;AAC1D,IAAY,cAOX;AAPD,WAAY,cAAc;IACtB,4BAA4B;IAC5B,2CAAyB,CAAA;IACzB,8BAA8B;IAC9B,qDAAmC,CAAA;IACnC,8CAA8C;IAC9C,uCAAqB,CAAA;AACzB,CAAC,EAPW,cAAc,8BAAd,cAAc,QAOzB"}
|
|
@@ -5,6 +5,17 @@ export * from './wellflow-protocol.enum';
|
|
|
5
5
|
export * from './openrouter-transport.enum';
|
|
6
6
|
export * from './reseller-transport.enum';
|
|
7
7
|
export * from './prompt-cache-ttl.enum';
|
|
8
|
+
export * from './music-operation.enum';
|
|
9
|
+
export * from './audio-source-kind.enum';
|
|
10
|
+
export * from './media-input-slot.enum';
|
|
11
|
+
export * from './kie-result-format.enum';
|
|
12
|
+
export * from './fal-result-shape.enum';
|
|
13
|
+
export * from './duration-unit.enum';
|
|
14
|
+
export * from './media-pricing-unit.enum';
|
|
15
|
+
export * from './media-pricing-source.enum';
|
|
16
|
+
export * from './media-pricing.schema';
|
|
17
|
+
export * from './audio-generation-config.schema';
|
|
18
|
+
export * from './fal-generation-config.schema';
|
|
8
19
|
export * from './route-token-pricing.schema';
|
|
9
20
|
export * from './route-image-pricing.schema';
|
|
10
21
|
export * from './provider-generation-config.schema';
|
|
@@ -21,6 +21,17 @@ __exportStar(require("./wellflow-protocol.enum"), exports);
|
|
|
21
21
|
__exportStar(require("./openrouter-transport.enum"), exports);
|
|
22
22
|
__exportStar(require("./reseller-transport.enum"), exports);
|
|
23
23
|
__exportStar(require("./prompt-cache-ttl.enum"), exports);
|
|
24
|
+
__exportStar(require("./music-operation.enum"), exports);
|
|
25
|
+
__exportStar(require("./audio-source-kind.enum"), exports);
|
|
26
|
+
__exportStar(require("./media-input-slot.enum"), exports);
|
|
27
|
+
__exportStar(require("./kie-result-format.enum"), exports);
|
|
28
|
+
__exportStar(require("./fal-result-shape.enum"), exports);
|
|
29
|
+
__exportStar(require("./duration-unit.enum"), exports);
|
|
30
|
+
__exportStar(require("./media-pricing-unit.enum"), exports);
|
|
31
|
+
__exportStar(require("./media-pricing-source.enum"), exports);
|
|
32
|
+
__exportStar(require("./media-pricing.schema"), exports);
|
|
33
|
+
__exportStar(require("./audio-generation-config.schema"), exports);
|
|
34
|
+
__exportStar(require("./fal-generation-config.schema"), exports);
|
|
24
35
|
__exportStar(require("./route-token-pricing.schema"), exports);
|
|
25
36
|
__exportStar(require("./route-image-pricing.schema"), exports);
|
|
26
37
|
__exportStar(require("./provider-generation-config.schema"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../v1/model-route/schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,gEAA8C;AAC9C,sDAAoC;AACpC,2DAAyC;AACzC,8DAA4C;AAC5C,4DAA0C;AAC1C,0DAAwC;AACxC,+DAA6C;AAC7C,+DAA6C;AAC7C,sEAAoD;AACpD,gEAA8C;AAC9C,sEAAoD;AACpD,sEAAoD;AACpD,sEAAoD;AACpD,qEAAmD;AACnD,8DAA4C;AAC5C,+DAA6C;AAC7C,+DAA6C;AAC7C,qEAAmD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../v1/model-route/schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,gEAA8C;AAC9C,sDAAoC;AACpC,2DAAyC;AACzC,8DAA4C;AAC5C,4DAA0C;AAC1C,0DAAwC;AACxC,yDAAuC;AACvC,2DAAyC;AACzC,0DAAwC;AACxC,2DAAyC;AACzC,0DAAwC;AACxC,uDAAqC;AACrC,4DAA0C;AAC1C,8DAA4C;AAC5C,yDAAuC;AACvC,mEAAiD;AACjD,iEAA+C;AAC/C,+DAA6C;AAC7C,+DAA6C;AAC7C,sEAAoD;AACpD,gEAA8C;AAC9C,sEAAoD;AACpD,sEAAoD;AACpD,sEAAoD;AACpD,qEAAmD;AACnD,8DAA4C;AAC5C,+DAA6C;AAC7C,+DAA6C;AAC7C,qEAAmD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the finished KIE task reports its output. Fixed when the task is created, so a route edited
|
|
3
|
+
* mid-flight does not change how the task in flight is read.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum KieResultFormat {
|
|
6
|
+
/** `resultJson.resultUrls`: the common jobs/recordInfo result. */
|
|
7
|
+
RESULT_URLS = "RESULT_URLS",
|
|
8
|
+
/** Suno tracks: a list of tracks with audio URL, title and duration. */
|
|
9
|
+
SUNO_TRACKS = "SUNO_TRACKS",
|
|
10
|
+
/** Suno stem separation: a list of stems with their group names. */
|
|
11
|
+
SUNO_STEMS = "SUNO_STEMS"
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KieResultFormat = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* How the finished KIE task reports its output. Fixed when the task is created, so a route edited
|
|
6
|
+
* mid-flight does not change how the task in flight is read.
|
|
7
|
+
*/
|
|
8
|
+
var KieResultFormat;
|
|
9
|
+
(function (KieResultFormat) {
|
|
10
|
+
/** `resultJson.resultUrls`: the common jobs/recordInfo result. */
|
|
11
|
+
KieResultFormat["RESULT_URLS"] = "RESULT_URLS";
|
|
12
|
+
/** Suno tracks: a list of tracks with audio URL, title and duration. */
|
|
13
|
+
KieResultFormat["SUNO_TRACKS"] = "SUNO_TRACKS";
|
|
14
|
+
/** Suno stem separation: a list of stems with their group names. */
|
|
15
|
+
KieResultFormat["SUNO_STEMS"] = "SUNO_STEMS";
|
|
16
|
+
})(KieResultFormat || (exports.KieResultFormat = KieResultFormat = {}));
|
|
17
|
+
//# sourceMappingURL=kie-result-format.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kie-result-format.enum.js","sourceRoot":"","sources":["../../../../v1/model-route/schemas/kie-result-format.enum.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAY,eAOX;AAPD,WAAY,eAAe;IACvB,kEAAkE;IAClE,8CAA2B,CAAA;IAC3B,wEAAwE;IACxE,8CAA2B,CAAA;IAC3B,oEAAoE;IACpE,4CAAyB,CAAA;AAC7B,CAAC,EAPW,eAAe,+BAAf,eAAe,QAO1B"}
|
|
@@ -40,6 +40,40 @@ export declare const ListModelRoutesResponseSchema: z.ZodObject<{
|
|
|
40
40
|
fallback: z.ZodOptional<z.ZodNumber>;
|
|
41
41
|
}, z.core.$strict>>;
|
|
42
42
|
selectedOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
43
|
+
resultFormat: z.ZodOptional<z.ZodEnum<typeof import("./kie-result-format.enum").KieResultFormat>>;
|
|
44
|
+
inputKeys: z.ZodOptional<z.ZodRecord<z.ZodEnum<typeof import("./media-input-slot.enum").MediaInputSlot> & z.core.$partial, z.ZodString>>;
|
|
45
|
+
vendorRefKeys: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
taskId: z.ZodString;
|
|
47
|
+
itemId: z.ZodString;
|
|
48
|
+
}, z.core.$strict>>;
|
|
49
|
+
}, z.core.$strict>>;
|
|
50
|
+
fal: z.ZodOptional<z.ZodObject<{
|
|
51
|
+
appId: z.ZodString;
|
|
52
|
+
inputKeys: z.ZodRecord<z.ZodEnum<typeof import("./media-input-slot.enum").MediaInputSlot> & z.core.$partial, z.ZodString>;
|
|
53
|
+
fixedInput: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
54
|
+
result: z.ZodEnum<typeof import("./fal-result-shape.enum").FalResultShape>;
|
|
55
|
+
durationUnit: z.ZodOptional<z.ZodEnum<typeof import("./duration-unit.enum").DurationUnit>>;
|
|
56
|
+
unitPriceUsd: z.ZodNumber;
|
|
57
|
+
}, z.core.$strict>>;
|
|
58
|
+
audio: z.ZodOptional<z.ZodObject<{
|
|
59
|
+
operation: z.ZodEnum<typeof import("./music-operation.enum").MusicOperation>;
|
|
60
|
+
sources: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof import("./audio-source-kind.enum").AudioSourceKind>>>;
|
|
61
|
+
vendorRefTtlHours: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
maxOutputs: z.ZodNumber;
|
|
63
|
+
maxLyricsChars: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
pricing: z.ZodObject<{
|
|
65
|
+
unit: z.ZodEnum<typeof import("./media-pricing-unit.enum").MediaPricingUnit>;
|
|
66
|
+
rates: z.ZodArray<z.ZodObject<{
|
|
67
|
+
conditions: z.ZodArray<z.ZodObject<{
|
|
68
|
+
settingKey: z.ZodEnum<typeof import("../..").SettingKey>;
|
|
69
|
+
optionId: z.ZodString;
|
|
70
|
+
}, z.core.$strict>>;
|
|
71
|
+
usd: z.ZodNumber;
|
|
72
|
+
}, z.core.$strict>>;
|
|
73
|
+
perInputImageUsd: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
source: z.ZodEnum<typeof import("./media-pricing-source.enum").MediaPricingSource>;
|
|
75
|
+
verifiedAt: z.ZodISODate;
|
|
76
|
+
}, z.core.$strict>;
|
|
43
77
|
}, z.core.$strict>>;
|
|
44
78
|
wellflow: z.ZodOptional<z.ZodObject<{
|
|
45
79
|
protocol: z.ZodOptional<z.ZodEnum<typeof import("./wellflow-protocol.enum").WellflowProtocol>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KIE_RESERVED_WIRE_KEYS = exports.COMPOSED_PROMPT_CONFLICTING_SLOTS = void 0;
|
|
4
|
+
const media_input_slot_enum_1 = require("./media-input-slot.enum");
|
|
5
|
+
exports.COMPOSED_PROMPT_CONFLICTING_SLOTS = [
|
|
6
|
+
media_input_slot_enum_1.MediaInputSlot.STYLE,
|
|
7
|
+
media_input_slot_enum_1.MediaInputSlot.LYRICS,
|
|
8
|
+
media_input_slot_enum_1.MediaInputSlot.NEGATIVE_STYLE,
|
|
9
|
+
];
|
|
10
|
+
/** Wire keys that only the KIE adapter sets. */
|
|
11
|
+
exports.KIE_RESERVED_WIRE_KEYS = new Set(['prompt', 'callBackUrl', 'model'].map((key) => key.toLowerCase()));
|
|
12
|
+
//# sourceMappingURL=media-input-keys.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-input-keys.constants.js","sourceRoot":"","sources":["../../../../v1/model-route/schemas/media-input-keys.constants.ts"],"names":[],"mappings":";;;AAAA,mEAAyD;AAE5C,QAAA,iCAAiC,GAAG;IAC7C,sCAAc,CAAC,KAAK;IACpB,sCAAc,CAAC,MAAM;IACrB,sCAAc,CAAC,cAAc;CAChC,CAAC;AAEF,gDAAgD;AACnC,QAAA,sBAAsB,GAAwB,IAAI,GAAG,CAC9D,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CACrE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createMediaInputKeysSchema = createMediaInputKeysSchema;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const media_input_keys_constants_1 = require("./media-input-keys.constants");
|
|
6
|
+
const media_input_slot_enum_1 = require("./media-input-slot.enum");
|
|
7
|
+
const media_wire_key_schema_1 = require("./media-wire-key.schema");
|
|
8
|
+
function createMediaInputKeysSchema(reservedWireKeys, schemaName) {
|
|
9
|
+
const reserved = new Set(Array.from(reservedWireKeys, (key) => key.toLowerCase()));
|
|
10
|
+
return zod_1.z
|
|
11
|
+
.partialRecord(zod_1.z.enum(media_input_slot_enum_1.MediaInputSlot), media_wire_key_schema_1.MediaWireKeySchema)
|
|
12
|
+
.superRefine((inputKeys, ctx) => {
|
|
13
|
+
const keys = Object.values(inputKeys)
|
|
14
|
+
.filter((key) => key !== undefined)
|
|
15
|
+
.map((key) => key.toLowerCase());
|
|
16
|
+
if (keys.some((key) => reserved.has(key))) {
|
|
17
|
+
ctx.addIssue({ code: 'custom', message: `${schemaName}.inputKeys.reserved` });
|
|
18
|
+
}
|
|
19
|
+
if (new Set(keys).size !== keys.length) {
|
|
20
|
+
ctx.addIssue({
|
|
21
|
+
code: 'custom',
|
|
22
|
+
message: `${schemaName}.inputKeys.duplicateWireKey`,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
if (inputKeys[media_input_slot_enum_1.MediaInputSlot.COMPOSED_PROMPT] !== undefined &&
|
|
26
|
+
media_input_keys_constants_1.COMPOSED_PROMPT_CONFLICTING_SLOTS.some((slot) => inputKeys[slot] !== undefined)) {
|
|
27
|
+
ctx.addIssue({
|
|
28
|
+
code: 'custom',
|
|
29
|
+
message: `${schemaName}.inputKeys.composedPromptConflict`,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=media-input-keys.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-input-keys.schema.js","sourceRoot":"","sources":["../../../../v1/model-route/schemas/media-input-keys.schema.ts"],"names":[],"mappings":";;AAKA,gEAgCC;AArCD,6BAAwB;AACxB,6EAAiF;AACjF,mEAAyD;AACzD,mEAA6D;AAE7D,SAAgB,0BAA0B,CACtC,gBAAqC,EACrC,UAAkB;IAElB,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAEnF,OAAO,OAAC;SACH,aAAa,CAAC,OAAC,CAAC,IAAI,CAAC,sCAAc,CAAC,EAAE,0CAAkB,CAAC;SACzD,WAAW,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,EAAE;QAC5B,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;aAChC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,SAAS,CAAC;aAClC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;QAErC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACxC,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,UAAU,qBAAqB,EAAE,CAAC,CAAC;QAClF,CAAC;QACD,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;YACrC,GAAG,CAAC,QAAQ,CAAC;gBACT,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,GAAG,UAAU,6BAA6B;aACtD,CAAC,CAAC;QACP,CAAC;QACD,IACI,SAAS,CAAC,sCAAc,CAAC,eAAe,CAAC,KAAK,SAAS;YACvD,8DAAiC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,EACjF,CAAC;YACC,GAAG,CAAC,QAAQ,CAAC;gBACT,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,GAAG,UAAU,mCAAmC;aAC5D,CAAC,CAAC;QACP,CAAC;IACL,CAAC,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A provider-neutral input of a media request. A route maps each slot it uses to the wire key of its
|
|
3
|
+
* own provider (`kie.inputKeys`, `fal.inputKeys`); a slot with no mapping is not sent.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum MediaInputSlot {
|
|
6
|
+
/** One prompt that folds style, lyrics and "avoid" text together, for prompt-only routes. */
|
|
7
|
+
COMPOSED_PROMPT = "COMPOSED_PROMPT",
|
|
8
|
+
TITLE = "TITLE",
|
|
9
|
+
STYLE = "STYLE",
|
|
10
|
+
LYRICS = "LYRICS",
|
|
11
|
+
NEGATIVE_STYLE = "NEGATIVE_STYLE",
|
|
12
|
+
/** Second at which an extension starts in the source track. */
|
|
13
|
+
CONTINUE_AT_SEC = "CONTINUE_AT_SEC",
|
|
14
|
+
SOURCE_AUDIO_URL = "SOURCE_AUDIO_URL"
|
|
15
|
+
}
|