@byte_fluffy/nexra-sdk 0.1.0-alpha.4 → 0.1.0-alpha.40
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/README.md +333 -11
- package/dist/assets-Cusrjj7_.d.ts +61 -0
- package/dist/catalog.d.ts +47 -1
- package/dist/catalog.js +18 -3
- package/dist/chunk-Q4A3HJBX.js +53677 -0
- package/dist/chunk-SIBYK5IX.js +819 -0
- package/dist/errors-DJZuAKoO.d.ts +33 -0
- package/dist/index.d.ts +76 -968
- package/dist/index.js +128 -1044
- package/dist/json-Cz0MkWQn.d.ts +11 -0
- package/dist/language.d.ts +38 -0
- package/dist/language.js +718 -0
- package/dist/{index-mytCeh5t.d.ts → media-geometry-YD9Y_CFw.d.ts} +138 -87
- package/dist/media.d.ts +213 -0
- package/dist/media.js +26 -0
- package/dist/types.d.ts +5 -0
- package/dist/types.js +0 -0
- package/dist/voices-BHzDQ5xH.d.ts +340 -0
- package/package.json +38 -1
- package/dist/chunk-AV3GN4TV.js +0 -6239
|
@@ -1,37 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
|
|
3
|
-
interface JsonObject {
|
|
4
|
-
[key: string]: JsonValue;
|
|
5
|
-
}
|
|
6
|
-
interface CursorPage<T> {
|
|
7
|
-
data: T[];
|
|
8
|
-
nextCursor?: string;
|
|
9
|
-
}
|
|
1
|
+
import { b as JsonPrimitive, a as JsonObject, J as JsonValue } from './json-Cz0MkWQn.js';
|
|
10
2
|
|
|
11
3
|
declare const BILLING_METRICS: readonly ["requests", "input_tokens", "cached_input_tokens", "cache_write_tokens", "cache_creation_5m_input_tokens", "cache_creation_1h_input_tokens", "cache_read_input_tokens", "output_tokens", "input_characters", "input_utf8_bytes", "input_images", "output_images", "input_audio_seconds", "output_audio_seconds", "input_video_seconds", "output_video_seconds", "provider_credits", "web_search_requests"];
|
|
12
4
|
type BillingMetric = (typeof BILLING_METRICS)[number];
|
|
13
|
-
declare const BILLING_EXPORT_DIMENSIONS: readonly ["resolution", "duration", "layer_decomposition", "with_audio", "has_input_video", "hd", "prompt_extend", "modality", "tier", "quality", "image_count", "input_token_tier", "input_modality", "service_tier", "inference_geo", "speed", "region_scope", "has_reference_image", "mode"];
|
|
14
|
-
type UsageComponentEvidence = {
|
|
15
|
-
source: "provider_native" | "request_derived" | "response_derived" | "tariff_equivalent" | "unknown";
|
|
16
|
-
paths?: string[];
|
|
17
|
-
calculation?: string;
|
|
18
|
-
};
|
|
19
|
-
interface MeteredUsageComponent {
|
|
20
|
-
metric: BillingMetric;
|
|
21
|
-
quantity: number;
|
|
22
|
-
dimensions?: Record<string, JsonPrimitive>;
|
|
23
|
-
evidence?: UsageComponentEvidence;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Provider evidence is normalized into independent metered components instead
|
|
27
|
-
* of one canonical model response. This keeps protocol conversion separate
|
|
28
|
-
* from billing and allows one request to carry differently-dimensioned usage.
|
|
29
|
-
*/
|
|
30
|
-
interface NormalizedUsageV1 {
|
|
31
|
-
schemaVersion: 1;
|
|
32
|
-
components: MeteredUsageComponent[];
|
|
33
|
-
billingEvidenceComplete?: boolean;
|
|
34
|
-
}
|
|
35
5
|
interface MeteredPriceRate {
|
|
36
6
|
metric: BillingMetric;
|
|
37
7
|
unitSize: number;
|
|
@@ -46,42 +16,8 @@ interface MeteredPriceRuleV1 {
|
|
|
46
16
|
rates: MeteredPriceRate[];
|
|
47
17
|
}
|
|
48
18
|
type PriceRule = MeteredPriceRuleV1;
|
|
49
|
-
interface PriceEvaluationLine {
|
|
50
|
-
evidence?: UsageComponentEvidence;
|
|
51
|
-
metric: BillingMetric;
|
|
52
|
-
quantity: number;
|
|
53
|
-
unitSize: number;
|
|
54
|
-
unitPrice: string;
|
|
55
|
-
rounding: "proportional" | "ceil";
|
|
56
|
-
includedQuantity: number;
|
|
57
|
-
dimensions?: Record<string, JsonPrimitive>;
|
|
58
|
-
amount: string;
|
|
59
|
-
discountedAmount?: string;
|
|
60
|
-
}
|
|
61
|
-
/** Preserve frozen row order when distributing the eight-decimal remainder. */
|
|
62
|
-
declare function allocateDiscountedPriceLines(lines: readonly PriceEvaluationLine[], saleAmount: string): PriceEvaluationLine[];
|
|
63
|
-
interface PriceEvaluationIssue {
|
|
64
|
-
code: "dimension_mismatch" | "ambiguous_rate" | "missing_usage";
|
|
65
|
-
metric: BillingMetric;
|
|
66
|
-
componentIndex: number;
|
|
67
|
-
}
|
|
68
|
-
interface PriceEvaluation {
|
|
69
|
-
status: "rated" | "incomplete";
|
|
70
|
-
amount: string;
|
|
71
|
-
lines: PriceEvaluationLine[];
|
|
72
|
-
issues: PriceEvaluationIssue[];
|
|
73
|
-
}
|
|
74
|
-
declare function validateNormalizedUsage(value: unknown): asserts value is NormalizedUsageV1;
|
|
75
|
-
/**
|
|
76
|
-
* Deterministically rates normalized usage without mutating wallets or billing
|
|
77
|
-
* records. Amounts are rounded half-up to the database's eight-decimal money
|
|
78
|
-
* scale per line; ceil rates round usage units before multiplying the price.
|
|
79
|
-
*/
|
|
80
|
-
declare function evaluatePriceRule(ruleValue: unknown, usageValue: unknown): PriceEvaluation;
|
|
81
|
-
declare function validatePriceRule(value: unknown): asserts value is PriceRule;
|
|
82
19
|
|
|
83
20
|
type MeteringKind = "token" | "non_token" | "mixed";
|
|
84
|
-
type UsageEvidenceStatus = "complete" | "partial" | "missing" | "invalid" | "not_expected";
|
|
85
21
|
interface MeteringContract {
|
|
86
22
|
schemaVersion: 1;
|
|
87
23
|
kind: MeteringKind;
|
|
@@ -91,19 +27,30 @@ interface MeteringContract {
|
|
|
91
27
|
whenFeature?: string;
|
|
92
28
|
}>;
|
|
93
29
|
}
|
|
94
|
-
interface UsageEvidenceAssessment {
|
|
95
|
-
kind: MeteringKind | "unknown";
|
|
96
|
-
evidenceStatus: UsageEvidenceStatus;
|
|
97
|
-
expectedMetrics: BillingMetric[];
|
|
98
|
-
observedMetrics: BillingMetric[];
|
|
99
|
-
missingMetrics: BillingMetric[];
|
|
100
|
-
issues: string[];
|
|
101
|
-
}
|
|
102
|
-
declare function validateMeteringContract(value: unknown): asserts value is MeteringContract;
|
|
103
|
-
/** Evidence completeness is independent of sale/cost prices and delivery success. */
|
|
104
|
-
declare function assessUsageEvidence(contract: unknown, usage: unknown, features?: Readonly<Record<string, boolean>>): UsageEvidenceAssessment;
|
|
105
30
|
|
|
106
31
|
type ModelModality = "language" | "embedding" | "reranker" | "image" | "video" | "audio" | "world" | "multimodal" | "other";
|
|
32
|
+
/** A concrete operation of a code-owned endpoint contract, shared by API and UI. */
|
|
33
|
+
type ModelHttpOperation = Readonly<{
|
|
34
|
+
key: string;
|
|
35
|
+
kind: "request" | "create" | "query" | "cancel" | "delete" | "stream" | "generate" | "edit";
|
|
36
|
+
httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
37
|
+
pathTemplate: string;
|
|
38
|
+
documentationUrl?: string;
|
|
39
|
+
schemaProjection: "request" | "bearer-request" | "managed-task-create" | "managed-task-query" | "managed-task-cancel" | "native-task-create" | "native-task-query" | "native-task-delete";
|
|
40
|
+
responseStatus?: number;
|
|
41
|
+
idempotencyKey?: boolean;
|
|
42
|
+
queryParameters?: Readonly<JsonObject>;
|
|
43
|
+
headerParameters?: Readonly<JsonObject>;
|
|
44
|
+
pathParameters?: Readonly<JsonObject>;
|
|
45
|
+
/** Operation-specific body; binary fields describe multipart file parts. */
|
|
46
|
+
bodyParameters?: Readonly<JsonObject>;
|
|
47
|
+
responseBody?: Readonly<JsonObject>;
|
|
48
|
+
requestBody?: Readonly<{
|
|
49
|
+
properties: readonly string[];
|
|
50
|
+
required: readonly string[];
|
|
51
|
+
oneOfRequired?: readonly (readonly string[])[];
|
|
52
|
+
}>;
|
|
53
|
+
}>;
|
|
107
54
|
interface ModelEndpointSummary {
|
|
108
55
|
key: string;
|
|
109
56
|
label: string;
|
|
@@ -114,6 +61,8 @@ interface ModelEndpointSummary {
|
|
|
114
61
|
capabilities: string[];
|
|
115
62
|
/** Task execution of this native endpoint, not a second model parameter definition. */
|
|
116
63
|
sourceEndpointKey?: string | null;
|
|
64
|
+
documentationUrl?: string;
|
|
65
|
+
httpOperations?: readonly ModelHttpOperation[];
|
|
117
66
|
}
|
|
118
67
|
interface ModelCapabilitySummary {
|
|
119
68
|
inputModalities: string[];
|
|
@@ -121,6 +70,10 @@ interface ModelCapabilitySummary {
|
|
|
121
70
|
/** User-facing input patterns such as text-to-video or image-to-image. */
|
|
122
71
|
inputModes: string[];
|
|
123
72
|
features: string[];
|
|
73
|
+
/** Maximum combined input and output context supported by the model. */
|
|
74
|
+
contextWindowTokens?: number;
|
|
75
|
+
/** Maximum generated output tokens supported by the model. */
|
|
76
|
+
maxOutputTokens?: number;
|
|
124
77
|
}
|
|
125
78
|
interface ModelDateVersion {
|
|
126
79
|
id: string;
|
|
@@ -181,6 +134,8 @@ interface TaskModel extends TaskModelSummary {
|
|
|
181
134
|
interface ModelSchema {
|
|
182
135
|
model: string;
|
|
183
136
|
version: number;
|
|
137
|
+
/** Contract owner for the returned schema. Defaults to nexra for older servers. */
|
|
138
|
+
contract?: "nexra" | "native";
|
|
184
139
|
dialect: "https://json-schema.org/draft/2020-12/schema" | string;
|
|
185
140
|
inputSchema: JsonObject;
|
|
186
141
|
outputSchema: JsonObject;
|
|
@@ -228,6 +183,18 @@ interface NexraModelOperation {
|
|
|
228
183
|
outputSchema: JsonObject;
|
|
229
184
|
metering: MeteringContract;
|
|
230
185
|
}
|
|
186
|
+
/** Public native wire endpoint metadata. Provider routing and credentials stay private. */
|
|
187
|
+
interface NexraModelEndpointSpec {
|
|
188
|
+
endpointKey: string;
|
|
189
|
+
operation: string;
|
|
190
|
+
protocol: string;
|
|
191
|
+
method: string;
|
|
192
|
+
path: string;
|
|
193
|
+
capabilities: readonly string[];
|
|
194
|
+
inputSchema?: JsonObject;
|
|
195
|
+
outputSchema?: JsonObject;
|
|
196
|
+
httpOperations?: readonly ModelHttpOperation[];
|
|
197
|
+
}
|
|
231
198
|
interface NexraModelSpec {
|
|
232
199
|
id: string;
|
|
233
200
|
contractVersion: number;
|
|
@@ -240,6 +207,7 @@ interface NexraModelSpec {
|
|
|
240
207
|
aliases: readonly string[];
|
|
241
208
|
capabilities: ModelCapabilitySummary;
|
|
242
209
|
operations: readonly NexraModelOperation[];
|
|
210
|
+
endpoints: readonly NexraModelEndpointSpec[];
|
|
243
211
|
}
|
|
244
212
|
interface NexraModelSpecFilter {
|
|
245
213
|
kind?: ModelModality;
|
|
@@ -252,12 +220,32 @@ interface NexraSalePrice {
|
|
|
252
220
|
priceRevision: string;
|
|
253
221
|
effectiveFrom: string;
|
|
254
222
|
rule: PriceRule;
|
|
223
|
+
displayEstimates?: readonly Readonly<{
|
|
224
|
+
parameters: JsonObject;
|
|
225
|
+
inputImageCounts: readonly number[];
|
|
226
|
+
amount: string;
|
|
227
|
+
maximumAmount: string;
|
|
228
|
+
}>[];
|
|
229
|
+
displayEstimatesValidUntil?: string;
|
|
230
|
+
}
|
|
231
|
+
interface NexraSalePriceList {
|
|
232
|
+
quoteContextRevision?: string;
|
|
233
|
+
currency: NexraBillingCurrency;
|
|
234
|
+
prices: readonly NexraSalePrice[];
|
|
255
235
|
}
|
|
256
236
|
interface CreateNexraQuoteRequest {
|
|
257
237
|
modelId: string;
|
|
258
238
|
operation: string;
|
|
259
239
|
input: JsonObject;
|
|
260
240
|
}
|
|
241
|
+
interface CreateNexraDisplayQuoteBatchRequest {
|
|
242
|
+
modelId: string;
|
|
243
|
+
operation: string;
|
|
244
|
+
entries: readonly Readonly<{
|
|
245
|
+
key: string;
|
|
246
|
+
input: JsonObject;
|
|
247
|
+
}>[];
|
|
248
|
+
}
|
|
261
249
|
interface NexraQuote {
|
|
262
250
|
quoteToken: string;
|
|
263
251
|
modelId: string;
|
|
@@ -269,6 +257,53 @@ interface NexraQuote {
|
|
|
269
257
|
accuracy: "exact" | "estimated";
|
|
270
258
|
expiresAt: string;
|
|
271
259
|
}
|
|
260
|
+
type NexraDisplayQuoteBatchEntry = Readonly<{
|
|
261
|
+
key: string;
|
|
262
|
+
amount: string;
|
|
263
|
+
maximumAmount: string;
|
|
264
|
+
accuracy: "exact" | "estimated";
|
|
265
|
+
}> | Readonly<{
|
|
266
|
+
key: string;
|
|
267
|
+
error: {
|
|
268
|
+
code: string;
|
|
269
|
+
message: string;
|
|
270
|
+
};
|
|
271
|
+
}>;
|
|
272
|
+
interface NexraDisplayQuoteBatch {
|
|
273
|
+
modelId: string;
|
|
274
|
+
contractVersion: number;
|
|
275
|
+
priceRevision: string;
|
|
276
|
+
pricingPolicyRevision: string;
|
|
277
|
+
quoteContextRevision: string;
|
|
278
|
+
currency: NexraBillingCurrency;
|
|
279
|
+
entries: readonly NexraDisplayQuoteBatchEntry[];
|
|
280
|
+
expiresAt: string;
|
|
281
|
+
}
|
|
282
|
+
interface NexraCatalogRevision {
|
|
283
|
+
revision: string;
|
|
284
|
+
changedAt: string;
|
|
285
|
+
}
|
|
286
|
+
interface NexraCatalogModelIdentity {
|
|
287
|
+
modelId: string;
|
|
288
|
+
operation: string;
|
|
289
|
+
revision: string;
|
|
290
|
+
available: boolean;
|
|
291
|
+
}
|
|
292
|
+
interface NexraCatalogChangeParams {
|
|
293
|
+
after?: string;
|
|
294
|
+
upper?: string;
|
|
295
|
+
cursor?: string;
|
|
296
|
+
limit?: number;
|
|
297
|
+
}
|
|
298
|
+
interface NexraCatalogChangePage extends NexraCatalogRevision {
|
|
299
|
+
data: readonly NexraCatalogModelIdentity[];
|
|
300
|
+
nextCursor?: string;
|
|
301
|
+
}
|
|
302
|
+
interface NexraCatalogModelState extends NexraCatalogModelIdentity {
|
|
303
|
+
displayName?: string;
|
|
304
|
+
inputSchema?: JsonObject;
|
|
305
|
+
prices: readonly NexraSalePrice[];
|
|
306
|
+
}
|
|
272
307
|
interface NexraSettlement {
|
|
273
308
|
amount: string;
|
|
274
309
|
currency: NexraBillingCurrency;
|
|
@@ -298,16 +333,32 @@ declare class HttpTransport {
|
|
|
298
333
|
json<T>(path: string, init?: RequestInit, options?: RequestOptions): Promise<T>;
|
|
299
334
|
response(path: string, init?: RequestInit, options?: RequestOptions): Promise<Response>;
|
|
300
335
|
}
|
|
301
|
-
declare function jsonBody(value: unknown): Pick<RequestInit, "body" | "headers">;
|
|
302
|
-
declare function queryString(values: Record<string, string | number | undefined>): string;
|
|
303
|
-
declare function sleep(milliseconds: number, signal?: AbortSignal | null): Promise<void>;
|
|
304
336
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
337
|
+
/** UI-friendly view of Nexra's canonical geometry fields. */
|
|
338
|
+
type UnifiedMediaGeometry = {
|
|
339
|
+
resolution?: string;
|
|
340
|
+
ratio?: string;
|
|
341
|
+
quality?: string;
|
|
342
|
+
};
|
|
343
|
+
type MediaGeometryField = {
|
|
344
|
+
field: string;
|
|
345
|
+
options: readonly string[];
|
|
346
|
+
default?: string;
|
|
347
|
+
optionLabels: Readonly<Record<string, string>>;
|
|
348
|
+
};
|
|
349
|
+
type MediaGeometryProjection = {
|
|
350
|
+
kind: "resolution-ratio" | "ratio-only" | "none";
|
|
351
|
+
resolution?: MediaGeometryField;
|
|
352
|
+
ratio?: MediaGeometryField;
|
|
353
|
+
quality?: MediaGeometryField;
|
|
354
|
+
};
|
|
355
|
+
/** Read controls from the Nexra contract. It never exposes provider-native size fields. */
|
|
356
|
+
declare function projectMediaGeometry(inputSchema: JsonObject): MediaGeometryProjection;
|
|
357
|
+
/** UI geometry aliases → canonical Nexra request fields. */
|
|
358
|
+
declare function encodeMediaGeometry(inputSchema: JsonObject, geometry: UnifiedMediaGeometry): JsonObject;
|
|
359
|
+
/** Canonical Nexra request fields → UI geometry aliases. */
|
|
360
|
+
declare function decodeMediaGeometry(_inputSchema: JsonObject, input: JsonObject): UnifiedMediaGeometry;
|
|
361
|
+
/** Normalize the SDK convenience alias `ratio` without producing Native fields. */
|
|
362
|
+
declare function applyMediaGeometry(inputSchema: JsonObject, input: JsonObject): JsonObject;
|
|
312
363
|
|
|
313
|
-
export { type
|
|
364
|
+
export { type NexraCatalogChangeParams as A, type NexraCatalogChangePage as B, type CreateNexraDisplayQuoteBatchRequest as C, type NexraCatalogModelState as D, type NexraModelEndpointSpec as E, type FetchLike as F, type NexraCatalogModelIdentity as G, HttpTransport as H, type ModelSearchParams as M, type NexraClientOptions as N, type TaskModelSummary as T, type UnifiedMediaGeometry as U, type TaskModel as a, type ModelSchema as b, type ModelResourceList as c, type CreateNexraQuoteRequest as d, type MediaGeometryField as e, type MediaGeometryProjection as f, type ModelCapabilitySummary as g, type ModelDateVersion as h, type ModelEndpointSummary as i, type ModelModality as j, type ModelResourceOption as k, type NexraBillingCurrency as l, type NexraCatalogRevision as m, type NexraDisplayQuoteBatch as n, type NexraDisplayQuoteBatchEntry as o, type NexraModelOperation as p, type NexraModelSpec as q, type NexraModelSpecFilter as r, type NexraQuote as s, type NexraSalePrice as t, type NexraSalePriceList as u, type NexraSettlement as v, applyMediaGeometry as w, decodeMediaGeometry as x, encodeMediaGeometry as y, projectMediaGeometry as z };
|
package/dist/media.d.ts
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { b as AssetReference } from './assets-Cusrjj7_.js';
|
|
2
|
+
import { a as JsonObject } from './json-Cz0MkWQn.js';
|
|
3
|
+
|
|
4
|
+
declare const NEXRA_MEDIA_API_VERSION: 1;
|
|
5
|
+
/** Catalog-level generation taxonomy. Text keeps its native endpoint protocols. */
|
|
6
|
+
declare const NEXRA_GENERATION_OPERATIONS: readonly ["text.generate", "image.generate", "video.generate", "audio.generate", "image.upscale", "video.upscale"];
|
|
7
|
+
type NexraGenerationOperation = (typeof NEXRA_GENERATION_OPERATIONS)[number];
|
|
8
|
+
declare const NEXRA_MEDIA_OPERATIONS: readonly ["image.generate", "video.generate", "audio.generate", "image.upscale", "video.upscale"];
|
|
9
|
+
type NexraMediaOperation = (typeof NEXRA_MEDIA_OPERATIONS)[number];
|
|
10
|
+
declare const NEXRA_PUBLISHED_MEDIA_OPERATIONS: readonly ["image.generate", "video.generate", "audio.generate", "image.upscale"];
|
|
11
|
+
type NexraPublishedMediaOperation = (typeof NEXRA_PUBLISHED_MEDIA_OPERATIONS)[number];
|
|
12
|
+
declare const NEXRA_MEDIA_FEATURES: readonly ["text-to-image", "image-to-image", "image-reference", "image-edit", "image-inpaint", "image-control", "text-to-video", "first-frame", "first-last-frame", "image-to-video", "video-to-video", "audio-to-video", "avatar-video", "reference-image", "reference-video", "reference-audio", "omni-reference", "tts", "music", "sfx", "voice-reference", "voice-design", "scale-factor", "target-resolution"];
|
|
13
|
+
type NexraMediaFeature = (typeof NEXRA_MEDIA_FEATURES)[number];
|
|
14
|
+
/** JSON wire locator. SDK-only Blob/File support is normalized into one of these forms. */
|
|
15
|
+
type NexraMediaSource = string | AssetReference;
|
|
16
|
+
type NexraTextRole = "prompt" | "negative_prompt" | "script" | "lyrics";
|
|
17
|
+
type NexraImageRole = "source" | "reference" | "first_frame" | "last_frame" | "mask" | "control" | "subject" | "background";
|
|
18
|
+
type NexraVideoRole = "source" | "reference" | "edit" | "extend";
|
|
19
|
+
type NexraAudioRole = "source" | "reference" | "voice_reference";
|
|
20
|
+
type NexraTextContentPart = Readonly<{
|
|
21
|
+
type: "text";
|
|
22
|
+
text: string;
|
|
23
|
+
role?: NexraTextRole;
|
|
24
|
+
}>;
|
|
25
|
+
type NexraImageContentPart = Readonly<{
|
|
26
|
+
type: "image";
|
|
27
|
+
source: NexraMediaSource;
|
|
28
|
+
role?: NexraImageRole;
|
|
29
|
+
/** Stable prompt reference name for models that address media as `@name`. */
|
|
30
|
+
name?: string;
|
|
31
|
+
}>;
|
|
32
|
+
/** An image pinned inside a generated video; only models declaring this role accept it. */
|
|
33
|
+
type NexraVideoKeyframeContentPart = Readonly<{
|
|
34
|
+
type: "image";
|
|
35
|
+
source: NexraMediaSource;
|
|
36
|
+
role: "keyframe";
|
|
37
|
+
/** Position in seconds, strictly inside the generated clip. */
|
|
38
|
+
timestamp: number;
|
|
39
|
+
}>;
|
|
40
|
+
type NexraVideoContentPart = Readonly<{
|
|
41
|
+
type: "video";
|
|
42
|
+
source: NexraMediaSource;
|
|
43
|
+
role?: NexraVideoRole;
|
|
44
|
+
}>;
|
|
45
|
+
type NexraAudioContentPart = Readonly<{
|
|
46
|
+
type: "audio";
|
|
47
|
+
source: NexraMediaSource;
|
|
48
|
+
role?: NexraAudioRole;
|
|
49
|
+
}>;
|
|
50
|
+
type NexraMediaContentPart = NexraTextContentPart | NexraImageContentPart | NexraVideoContentPart | NexraAudioContentPart;
|
|
51
|
+
type NexraDraftContentPart = Readonly<{
|
|
52
|
+
type: "draft_task";
|
|
53
|
+
draft_task: Readonly<{
|
|
54
|
+
id: string;
|
|
55
|
+
}>;
|
|
56
|
+
}>;
|
|
57
|
+
type NexraImageGenerateInput = Readonly<{
|
|
58
|
+
content: readonly (NexraTextContentPart | NexraImageContentPart)[];
|
|
59
|
+
aspect_ratio?: string;
|
|
60
|
+
resolution?: string;
|
|
61
|
+
quality?: string;
|
|
62
|
+
count?: number;
|
|
63
|
+
output_format?: string;
|
|
64
|
+
seed?: number;
|
|
65
|
+
}>;
|
|
66
|
+
type NexraVideoGenerateInput = Readonly<{
|
|
67
|
+
content: readonly (NexraMediaContentPart | NexraDraftContentPart | NexraVideoKeyframeContentPart)[];
|
|
68
|
+
task_type?: string;
|
|
69
|
+
draft?: boolean;
|
|
70
|
+
/** Explicit no-watermark value, only on models whose contract declares it. */
|
|
71
|
+
watermark?: false;
|
|
72
|
+
/** Optional preset or cloned voice used by talking-avatar video models. */
|
|
73
|
+
voice?: string;
|
|
74
|
+
aspect_ratio?: string;
|
|
75
|
+
resolution?: string;
|
|
76
|
+
quality?: string;
|
|
77
|
+
duration?: number;
|
|
78
|
+
fit?: "contain" | "cover";
|
|
79
|
+
title?: string;
|
|
80
|
+
generate_audio?: boolean;
|
|
81
|
+
output_format?: string;
|
|
82
|
+
seed?: number;
|
|
83
|
+
}>;
|
|
84
|
+
type NexraAudioGenerateInput = Readonly<{
|
|
85
|
+
content: readonly (NexraTextContentPart | NexraAudioContentPart)[];
|
|
86
|
+
voice?: string;
|
|
87
|
+
language?: string;
|
|
88
|
+
duration?: number;
|
|
89
|
+
output_format?: string;
|
|
90
|
+
sample_rate?: number;
|
|
91
|
+
speed?: number;
|
|
92
|
+
volume?: number;
|
|
93
|
+
pitch?: number;
|
|
94
|
+
emotion?: string;
|
|
95
|
+
instrumental?: boolean;
|
|
96
|
+
loop?: boolean;
|
|
97
|
+
prompt_influence?: number;
|
|
98
|
+
seed?: number;
|
|
99
|
+
}>;
|
|
100
|
+
type NexraImageUpscaleInput = Readonly<{
|
|
101
|
+
content: readonly [NexraImageContentPart];
|
|
102
|
+
scale?: number;
|
|
103
|
+
resolution?: string;
|
|
104
|
+
output_format?: string;
|
|
105
|
+
preserve_details?: boolean;
|
|
106
|
+
}>;
|
|
107
|
+
type NexraVideoUpscaleInput = Readonly<{
|
|
108
|
+
content: readonly [NexraVideoContentPart];
|
|
109
|
+
scale?: number;
|
|
110
|
+
resolution?: string;
|
|
111
|
+
output_format?: string;
|
|
112
|
+
preserve_details?: boolean;
|
|
113
|
+
}>;
|
|
114
|
+
type NexraMediaInputByOperation = Readonly<{
|
|
115
|
+
"image.generate": NexraImageGenerateInput;
|
|
116
|
+
"video.generate": NexraVideoGenerateInput;
|
|
117
|
+
"audio.generate": NexraAudioGenerateInput;
|
|
118
|
+
"image.upscale": NexraImageUpscaleInput;
|
|
119
|
+
"video.upscale": NexraVideoUpscaleInput;
|
|
120
|
+
}>;
|
|
121
|
+
type NexraMediaKind = "image" | "video" | "audio";
|
|
122
|
+
type NexraMediaInputSlot = Readonly<{
|
|
123
|
+
mediaKind: NexraMediaKind;
|
|
124
|
+
role: string;
|
|
125
|
+
min?: number;
|
|
126
|
+
max: number;
|
|
127
|
+
maxBytes?: number;
|
|
128
|
+
minDurationSeconds?: number;
|
|
129
|
+
maxDurationSeconds?: number;
|
|
130
|
+
}>;
|
|
131
|
+
type NexraMediaInputMode = Readonly<{
|
|
132
|
+
id: string;
|
|
133
|
+
slots: readonly NexraMediaInputSlot[];
|
|
134
|
+
}>;
|
|
135
|
+
type NexraMediaParameterValue = string | number | boolean;
|
|
136
|
+
type NexraMediaParameter = Readonly<{
|
|
137
|
+
key: string;
|
|
138
|
+
label?: string;
|
|
139
|
+
}> & (Readonly<{
|
|
140
|
+
kind: "enum";
|
|
141
|
+
options: readonly NexraMediaParameterValue[];
|
|
142
|
+
default: NexraMediaParameterValue;
|
|
143
|
+
allowCustom?: boolean;
|
|
144
|
+
}> | Readonly<{
|
|
145
|
+
kind: "range";
|
|
146
|
+
min: number;
|
|
147
|
+
max: number;
|
|
148
|
+
step: number;
|
|
149
|
+
default: number;
|
|
150
|
+
autoValue?: number;
|
|
151
|
+
unit?: string;
|
|
152
|
+
}> | Readonly<{
|
|
153
|
+
kind: "toggle";
|
|
154
|
+
default: boolean;
|
|
155
|
+
}> | Readonly<{
|
|
156
|
+
kind: "resource";
|
|
157
|
+
resource: "voice";
|
|
158
|
+
default?: string;
|
|
159
|
+
allowCustom?: boolean;
|
|
160
|
+
}>);
|
|
161
|
+
type NexraMediaParameterConstraint = Readonly<{
|
|
162
|
+
when: Readonly<Record<string, NexraMediaParameterValue | readonly NexraMediaParameterValue[]>>;
|
|
163
|
+
parameter: string;
|
|
164
|
+
allowedValues?: readonly NexraMediaParameterValue[];
|
|
165
|
+
fixedValue?: NexraMediaParameterValue;
|
|
166
|
+
disabled?: boolean;
|
|
167
|
+
}>;
|
|
168
|
+
type NexraMediaOperationDefinition = Readonly<{
|
|
169
|
+
operation: NexraMediaOperation;
|
|
170
|
+
status: "active" | "hold";
|
|
171
|
+
outputKind: NexraMediaKind;
|
|
172
|
+
features: readonly NexraMediaFeature[];
|
|
173
|
+
parameterKeys: readonly string[];
|
|
174
|
+
}>;
|
|
175
|
+
declare const NEXRA_MEDIA_OPERATION_DEFINITIONS: readonly [{
|
|
176
|
+
readonly operation: "image.generate";
|
|
177
|
+
readonly status: "active";
|
|
178
|
+
readonly outputKind: "image";
|
|
179
|
+
readonly features: readonly ["text-to-image", "image-to-image", "image-reference", "image-edit", "image-inpaint", "image-control"];
|
|
180
|
+
readonly parameterKeys: readonly ["aspect_ratio", "resolution", "quality", "count", "output_format", "seed"];
|
|
181
|
+
}, {
|
|
182
|
+
readonly operation: "video.generate";
|
|
183
|
+
readonly status: "active";
|
|
184
|
+
readonly outputKind: "video";
|
|
185
|
+
readonly features: readonly ["text-to-video", "first-frame", "first-last-frame", "image-to-video", "video-to-video", "audio-to-video", "avatar-video", "reference-image", "reference-video", "reference-audio", "omni-reference"];
|
|
186
|
+
readonly parameterKeys: readonly ["voice", "aspect_ratio", "resolution", "quality", "duration", "fit", "title", "generate_audio", "output_format", "seed", "watermark"];
|
|
187
|
+
}, {
|
|
188
|
+
readonly operation: "audio.generate";
|
|
189
|
+
readonly status: "active";
|
|
190
|
+
readonly outputKind: "audio";
|
|
191
|
+
readonly features: readonly ["tts", "music", "sfx", "voice-reference", "voice-design"];
|
|
192
|
+
readonly parameterKeys: readonly ["voice", "language", "duration", "output_format", "sample_rate", "speed", "volume", "pitch", "emotion", "instrumental", "loop", "prompt_influence", "seed"];
|
|
193
|
+
}, {
|
|
194
|
+
readonly operation: "image.upscale";
|
|
195
|
+
readonly status: "active";
|
|
196
|
+
readonly outputKind: "image";
|
|
197
|
+
readonly features: readonly ["scale-factor", "target-resolution"];
|
|
198
|
+
readonly parameterKeys: readonly ["scale", "resolution", "output_format", "preserve_details"];
|
|
199
|
+
}, {
|
|
200
|
+
readonly operation: "video.upscale";
|
|
201
|
+
readonly status: "hold";
|
|
202
|
+
readonly outputKind: "video";
|
|
203
|
+
readonly features: readonly ["scale-factor", "target-resolution"];
|
|
204
|
+
readonly parameterKeys: readonly ["scale", "resolution", "output_format", "preserve_details"];
|
|
205
|
+
}];
|
|
206
|
+
declare const NEXRA_MEDIA_INPUT_SCHEMAS: Readonly<Record<NexraPublishedMediaOperation, JsonObject>>;
|
|
207
|
+
declare function nexraMediaInputSchema(operation: NexraMediaOperation): JsonObject | undefined;
|
|
208
|
+
declare function isNexraMediaInput(value: unknown): value is JsonObject;
|
|
209
|
+
declare function nexraMediaOperationForMode(mode: string): NexraPublishedMediaOperation | undefined;
|
|
210
|
+
/** Narrow the shared category vocabulary for one Experience Center input mode. */
|
|
211
|
+
declare function nexraMediaInputSchemaForMode(mode: string): JsonObject | undefined;
|
|
212
|
+
|
|
213
|
+
export { NEXRA_GENERATION_OPERATIONS, NEXRA_MEDIA_API_VERSION, NEXRA_MEDIA_FEATURES, NEXRA_MEDIA_INPUT_SCHEMAS, NEXRA_MEDIA_OPERATIONS, NEXRA_MEDIA_OPERATION_DEFINITIONS, NEXRA_PUBLISHED_MEDIA_OPERATIONS, type NexraAudioContentPart, type NexraAudioGenerateInput, type NexraGenerationOperation, type NexraImageContentPart, type NexraImageGenerateInput, type NexraImageUpscaleInput, type NexraMediaContentPart, type NexraMediaFeature, type NexraMediaInputByOperation, type NexraMediaInputMode, type NexraMediaInputSlot, type NexraMediaKind, type NexraMediaOperation, type NexraMediaOperationDefinition, type NexraMediaParameter, type NexraMediaParameterConstraint, type NexraMediaSource, type NexraPublishedMediaOperation, type NexraTextContentPart, type NexraVideoContentPart, type NexraVideoGenerateInput, type NexraVideoKeyframeContentPart, type NexraVideoUpscaleInput, isNexraMediaInput, nexraMediaInputSchema, nexraMediaInputSchemaForMode, nexraMediaOperationForMode };
|
package/dist/media.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NEXRA_GENERATION_OPERATIONS,
|
|
3
|
+
NEXRA_MEDIA_API_VERSION,
|
|
4
|
+
NEXRA_MEDIA_FEATURES,
|
|
5
|
+
NEXRA_MEDIA_INPUT_SCHEMAS,
|
|
6
|
+
NEXRA_MEDIA_OPERATIONS,
|
|
7
|
+
NEXRA_MEDIA_OPERATION_DEFINITIONS,
|
|
8
|
+
NEXRA_PUBLISHED_MEDIA_OPERATIONS,
|
|
9
|
+
isNexraMediaInput,
|
|
10
|
+
nexraMediaInputSchema,
|
|
11
|
+
nexraMediaInputSchemaForMode,
|
|
12
|
+
nexraMediaOperationForMode
|
|
13
|
+
} from "./chunk-SIBYK5IX.js";
|
|
14
|
+
export {
|
|
15
|
+
NEXRA_GENERATION_OPERATIONS,
|
|
16
|
+
NEXRA_MEDIA_API_VERSION,
|
|
17
|
+
NEXRA_MEDIA_FEATURES,
|
|
18
|
+
NEXRA_MEDIA_INPUT_SCHEMAS,
|
|
19
|
+
NEXRA_MEDIA_OPERATIONS,
|
|
20
|
+
NEXRA_MEDIA_OPERATION_DEFINITIONS,
|
|
21
|
+
NEXRA_PUBLISHED_MEDIA_OPERATIONS,
|
|
22
|
+
isNexraMediaInput,
|
|
23
|
+
nexraMediaInputSchema,
|
|
24
|
+
nexraMediaInputSchemaForMode,
|
|
25
|
+
nexraMediaOperationForMode
|
|
26
|
+
};
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { A as AssetImportRequest, a as AssetInput, b as AssetReference, c as AssetUploadOptions, d as MediaAsset, e as MediaAssetStatus, f as MediaKind } from './assets-Cusrjj7_.js';
|
|
2
|
+
export { C as CreateNexraDisplayQuoteBatchRequest, d as CreateNexraQuoteRequest, F as FetchLike, e as MediaGeometryField, f as MediaGeometryProjection, g as ModelCapabilitySummary, h as ModelDateVersion, i as ModelEndpointSummary, j as ModelModality, c as ModelResourceList, k as ModelResourceOption, b as ModelSchema, M as ModelSearchParams, l as NexraBillingCurrency, m as NexraCatalogRevision, N as NexraClientOptions, n as NexraDisplayQuoteBatch, o as NexraDisplayQuoteBatchEntry, p as NexraModelOperation, q as NexraModelSpec, r as NexraModelSpecFilter, s as NexraQuote, t as NexraSalePrice, u as NexraSalePriceList, v as NexraSettlement, a as TaskModel, T as TaskModelSummary, U as UnifiedMediaGeometry } from './media-geometry-YD9Y_CFw.js';
|
|
3
|
+
export { C as CursorPage, a as JsonObject, b as JsonPrimitive, J as JsonValue } from './json-Cz0MkWQn.js';
|
|
4
|
+
export { A as ApiErrorPayload, N as NexraError, a as PublicError, b as PublicErrorContext, P as PublicErrorFields } from './errors-DJZuAKoO.js';
|
|
5
|
+
export { d as CreateTaskOptions, e as CreateTaskRequest, C as CreateVoiceRequest, f as RequestDetails, b as RunResult, R as RunTaskOptions, c as Task, h as TaskCost, i as TaskError, j as TaskEvent, k as TaskEventType, l as TaskListParams, m as TaskPage, n as TaskProgress, o as TaskReceipt, c as TaskResult, p as TaskStatus, q as TaskTiming, r as TaskUsage, s as TaskWebhookConfig, t as TerminalTaskStatus, u as VerifyWebhookOptions, V as Voice, a as VoiceCreation, W as WaitTaskOptions, v as WatchTaskOptions } from './voices-BHzDQ5xH.js';
|
package/dist/types.js
ADDED
|
File without changes
|