@byte_fluffy/nexra-sdk 0.1.0-alpha.13 → 0.1.0-alpha.15

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/dist/catalog.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  getModelSpec,
7
7
  listModelSpecs,
8
8
  projectMediaGeometry
9
- } from "./chunk-JQ3P2VAK.js";
9
+ } from "./chunk-C5MJ4UNN.js";
10
10
  export {
11
11
  CatalogClient,
12
12
  applyMediaGeometry,
@@ -19977,7 +19977,6 @@ var video_generated_default = [
19977
19977
  order: 4,
19978
19978
  control: "segmented",
19979
19979
  optionLabels: {
19980
- adaptive: "\u81EA\u9002\u5E94",
19981
19980
  "21:9": "21:9",
19982
19981
  "16:9": "16:9",
19983
19982
  "4:3": "4:3",
@@ -19999,8 +19998,8 @@ var video_generated_default = [
19999
19998
  order: 5,
20000
19999
  control: "segmented",
20001
20000
  optionLabels: {
20002
- "768P": "768P",
20003
- "2K": "2K"
20001
+ "480P": "480P",
20002
+ "768P": "768P"
20004
20003
  }
20005
20004
  },
20006
20005
  default: "480P"
@@ -20422,37 +20421,6 @@ var video_generated_default = [
20422
20421
  }
20423
20422
  }
20424
20423
  }
20425
- },
20426
- {
20427
- if: {
20428
- required: [
20429
- "ratio"
20430
- ],
20431
- properties: {
20432
- ratio: {
20433
- const: "adaptive"
20434
- }
20435
- }
20436
- },
20437
- then: {
20438
- anyOf: [
20439
- {
20440
- required: [
20441
- "images"
20442
- ]
20443
- },
20444
- {
20445
- required: [
20446
- "videos"
20447
- ]
20448
- },
20449
- {
20450
- required: [
20451
- "audios"
20452
- ]
20453
- }
20454
- ]
20455
- }
20456
20424
  }
20457
20425
  ],
20458
20426
  anyOf: [
@@ -24404,6 +24372,243 @@ var video_generated_default = [
24404
24372
  }
24405
24373
  ]
24406
24374
  },
24375
+ {
24376
+ id: "bytedance/doubao-seedance-1-5-pro-251215",
24377
+ contractVersion: 1,
24378
+ developer: "bytedance",
24379
+ displayName: "Doubao Seedance 1.5 Pro",
24380
+ summary: "Generate 4\u201312 second video from text and optional first/last-frame images with native audio at up to 1080p.",
24381
+ kind: "video",
24382
+ family: "Seedance Pro",
24383
+ versionLabel: "1.5",
24384
+ aliases: [
24385
+ "seed",
24386
+ "seedance-v1.5",
24387
+ "volcengine/doubao-seedance-1-5-pro-251215"
24388
+ ],
24389
+ capabilities: {
24390
+ inputModalities: [
24391
+ "text",
24392
+ "image"
24393
+ ],
24394
+ outputModalities: [
24395
+ "video"
24396
+ ],
24397
+ inputModes: [
24398
+ "text-to-video",
24399
+ "image-to-video"
24400
+ ],
24401
+ features: []
24402
+ },
24403
+ operations: [
24404
+ {
24405
+ operation: "video.generate",
24406
+ inputModalities: [
24407
+ "text",
24408
+ "image"
24409
+ ],
24410
+ outputModalities: [
24411
+ "video"
24412
+ ],
24413
+ inputSchema: {
24414
+ type: "object",
24415
+ properties: {
24416
+ duration: {
24417
+ description: "Requested output duration in seconds.",
24418
+ type: "integer",
24419
+ enum: [
24420
+ 4,
24421
+ 8,
24422
+ 12
24423
+ ],
24424
+ "x-ui": {
24425
+ order: 4,
24426
+ control: "segmented",
24427
+ optionLabels: {
24428
+ "4": "4 \u79D2",
24429
+ "8": "8 \u79D2",
24430
+ "12": "12 \u79D2"
24431
+ }
24432
+ },
24433
+ default: 4
24434
+ },
24435
+ images: {
24436
+ type: "array",
24437
+ items: {
24438
+ oneOf: [
24439
+ {
24440
+ type: "string",
24441
+ format: "uri"
24442
+ },
24443
+ {
24444
+ type: "object",
24445
+ properties: {
24446
+ url: {
24447
+ type: "string",
24448
+ format: "uri"
24449
+ },
24450
+ role: {
24451
+ type: "string",
24452
+ enum: [
24453
+ "first_frame",
24454
+ "last_frame"
24455
+ ]
24456
+ }
24457
+ },
24458
+ required: [
24459
+ "url"
24460
+ ],
24461
+ additionalProperties: false
24462
+ },
24463
+ {
24464
+ type: "object",
24465
+ properties: {
24466
+ assetId: {
24467
+ type: "string",
24468
+ minLength: 1
24469
+ },
24470
+ role: {
24471
+ type: "string",
24472
+ enum: [
24473
+ "first_frame",
24474
+ "last_frame"
24475
+ ]
24476
+ }
24477
+ },
24478
+ required: [
24479
+ "assetId"
24480
+ ],
24481
+ additionalProperties: false
24482
+ }
24483
+ ]
24484
+ },
24485
+ description: "Image inputs; assign a role when the model exposes role-specific behavior.",
24486
+ minItems: 1,
24487
+ maxItems: 2,
24488
+ "x-ui": {
24489
+ order: 1,
24490
+ control: "media",
24491
+ roles: [
24492
+ "first_frame",
24493
+ "last_frame"
24494
+ ],
24495
+ accept: [
24496
+ "url"
24497
+ ]
24498
+ }
24499
+ },
24500
+ ratio: {
24501
+ type: "string",
24502
+ description: "Requested output aspect ratio.",
24503
+ enum: [
24504
+ "1:1",
24505
+ "3:4",
24506
+ "4:3",
24507
+ "9:16",
24508
+ "16:9",
24509
+ "21:9"
24510
+ ],
24511
+ "x-ui": {
24512
+ order: 2,
24513
+ control: "segmented",
24514
+ optionLabels: {
24515
+ "1:1": "1:1\uFF08\u65B9\u5F62\uFF09",
24516
+ "3:4": "3:4",
24517
+ "4:3": "4:3",
24518
+ "9:16": "9:16\uFF08\u7AD6\u5C4F\uFF09",
24519
+ "16:9": "16:9\uFF08\u6A2A\u5C4F\uFF09",
24520
+ "21:9": "21:9"
24521
+ }
24522
+ },
24523
+ default: "16:9"
24524
+ },
24525
+ resolution: {
24526
+ type: "string",
24527
+ description: "Requested output resolution.",
24528
+ enum: [
24529
+ "480p",
24530
+ "720p",
24531
+ "1080p"
24532
+ ],
24533
+ "x-ui": {
24534
+ order: 3,
24535
+ control: "segmented",
24536
+ optionLabels: {
24537
+ "480p": "480p",
24538
+ "720p": "720p",
24539
+ "1080p": "1080p"
24540
+ }
24541
+ },
24542
+ default: "720p"
24543
+ },
24544
+ texts: {
24545
+ type: "string",
24546
+ description: "Describe the subject, action, camera movement, and style of the video.",
24547
+ minLength: 1,
24548
+ title: "Prompt",
24549
+ "x-ui": {
24550
+ order: 0,
24551
+ control: "textarea"
24552
+ }
24553
+ },
24554
+ with_audio: {
24555
+ type: "boolean",
24556
+ description: "Whether the generated output should include audio.",
24557
+ "x-ui": {
24558
+ order: 5,
24559
+ control: "switch"
24560
+ },
24561
+ default: true
24562
+ }
24563
+ },
24564
+ additionalProperties: false,
24565
+ required: [
24566
+ "texts"
24567
+ ]
24568
+ },
24569
+ outputSchema: {
24570
+ type: "object",
24571
+ properties: {
24572
+ videos: {
24573
+ type: "array",
24574
+ items: {
24575
+ type: "string",
24576
+ format: "uri"
24577
+ },
24578
+ description: "`content` \u4E3A\u89C6\u9891 URL \u5B57\u7B26\u4E32\u6570\u7EC4"
24579
+ }
24580
+ },
24581
+ additionalProperties: false
24582
+ },
24583
+ metering: {
24584
+ schemaVersion: 1,
24585
+ kind: "token",
24586
+ metrics: [
24587
+ {
24588
+ metric: "requests",
24589
+ requirement: "required"
24590
+ },
24591
+ {
24592
+ metric: "output_tokens",
24593
+ requirement: "required"
24594
+ }
24595
+ ]
24596
+ }
24597
+ }
24598
+ ],
24599
+ endpoints: [
24600
+ {
24601
+ endpointKey: "native-volcengine-ark",
24602
+ operation: "video.generate",
24603
+ protocol: "ark-video-task",
24604
+ method: "POST",
24605
+ path: "/proxy/volcengine-ark/contents/generations/tasks",
24606
+ capabilities: [
24607
+ "native_proxy"
24608
+ ]
24609
+ }
24610
+ ]
24611
+ },
24407
24612
  {
24408
24613
  id: "bytedance/doubao-seedance-2-0-260128",
24409
24614
  contractVersion: 2,
@@ -27811,6 +28016,21 @@ var video_generated_default = [
27811
28016
  },
27812
28017
  default: "16:9"
27813
28018
  },
28019
+ resolution: {
28020
+ type: "string",
28021
+ description: "Omni Flash outputs video at its fixed 720p resolution.",
28022
+ enum: [
28023
+ "720p"
28024
+ ],
28025
+ "x-ui": {
28026
+ order: 3,
28027
+ control: "segmented",
28028
+ optionLabels: {
28029
+ "720p": "720P"
28030
+ }
28031
+ },
28032
+ default: "720p"
28033
+ },
27814
28034
  texts: {
27815
28035
  type: "string",
27816
28036
  description: "Describe the subject, action, camera movement, and style of the video.",
@@ -34128,7 +34348,7 @@ var NexraWaitTimeoutError = class extends Error {
34128
34348
  };
34129
34349
 
34130
34350
  // src/generated/version.generated.ts
34131
- var SDK_VERSION = "0.1.0-alpha.13";
34351
+ var SDK_VERSION = "0.1.0-alpha.15";
34132
34352
 
34133
34353
  // src/transport.ts
34134
34354
  var DEFAULT_BASE_URL = "https://api.nexra-ai.com/v1";
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AssetsClient, T as TasksClient, R as RunTaskOptions, a as RunResult, b as ApiErrorPayload, c as TaskResult } from './types-CPMdhb6o.js';
2
- export { d as AssetImportRequest, e as AssetInput, f as AssetReference, g as AssetUploadOptions, C as CreateTaskOptions, h as CreateTaskRequest, M as MEDIA_KINDS, i as MediaAsset, j as MediaAssetStatus, k as MediaKind, l as RequestDetails, m as TASK_STATUSES, n as Task, o as TaskCost, p as TaskError, q as TaskEvent, r as TaskEventType, s as TaskListParams, t as TaskPage, u as TaskProgress, v as TaskReceipt, w as TaskStatus, x as TaskTiming, y as TaskUsage, z as TaskWebhookConfig, B as TerminalTaskStatus, V as VerifyWebhookOptions, W as WaitTaskOptions, D as WatchTaskOptions, E as isTerminalTaskStatus, F as verifyWebhook } from './types-CPMdhb6o.js';
1
+ import { A as AssetsClient, T as TasksClient, R as RunTaskOptions, a as RunResult, b as ApiErrorPayload, c as TaskResult } from './types-5jsH7tBX.js';
2
+ export { d as AssetImportRequest, e as AssetInput, f as AssetReference, g as AssetUploadOptions, C as CreateTaskOptions, h as CreateTaskRequest, M as MEDIA_KINDS, i as MediaAsset, j as MediaAssetStatus, k as MediaKind, l as RequestDetails, m as TASK_STATUSES, n as Task, o as TaskCost, p as TaskError, q as TaskEvent, r as TaskEventType, s as TaskListParams, t as TaskPage, u as TaskProgress, v as TaskReceipt, w as TaskStatus, x as TaskTiming, y as TaskUsage, z as TaskWebhookConfig, B as TerminalTaskStatus, V as VerifyWebhookOptions, W as WaitTaskOptions, D as WatchTaskOptions, E as isTerminalTaskStatus, F as verifyWebhook } from './types-5jsH7tBX.js';
3
3
  import { H as HttpTransport, q as ModelSearchParams, r as CursorPage, T as TaskModelSummary, s as TaskModel, t as ModelSchema, u as NexraClientOptions, J as JsonValue } from './media-geometry-Ckr1-Mh3.js';
4
4
  export { b as CreateNexraDisplayQuoteBatchRequest, C as CreateNexraQuoteRequest, F as FetchLike, v as JsonObject, w as JsonPrimitive, M as MediaGeometryField, g as MediaGeometryProjection, x as ModelCapabilitySummary, y as ModelDateVersion, z as ModelEndpointSummary, A as ModelModality, B as ModelResourceList, D as ModelResourceOption, h as NexraBillingCurrency, d as NexraCatalogRevision, c as NexraDisplayQuoteBatch, E as NexraDisplayQuoteBatchEntry, j as NexraModelOperation, e as NexraModelSpec, f as NexraModelSpecFilter, a as NexraQuote, k as NexraSalePrice, N as NexraSalePriceList, l as NexraSettlement, U as UnifiedMediaGeometry, m as applyMediaGeometry, n as decodeMediaGeometry, o as encodeMediaGeometry, p as projectMediaGeometry } from './media-geometry-Ckr1-Mh3.js';
5
5
  import { CatalogClient } from './catalog.js';
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  projectMediaGeometry,
17
17
  queryString,
18
18
  sleep
19
- } from "./chunk-JQ3P2VAK.js";
19
+ } from "./chunk-C5MJ4UNN.js";
20
20
  import {
21
21
  ceilDecimal,
22
22
  multiplyDecimal
@@ -58,6 +58,38 @@ var AssetsClient = class {
58
58
  signal
59
59
  });
60
60
  }
61
+ certifyForSeedance(asset, request = {}, signal) {
62
+ const assetId = typeof asset === "string" ? asset : asset.id;
63
+ return this.transport.json(
64
+ `/assets/${encodeURIComponent(assetId)}/certifications/seedance`,
65
+ {
66
+ method: "POST",
67
+ ...jsonBody(request),
68
+ signal
69
+ },
70
+ { retryable: false }
71
+ );
72
+ }
73
+ getSeedanceCertification(asset, signal) {
74
+ const assetId = typeof asset === "string" ? asset : asset.id;
75
+ return this.transport.json(
76
+ `/assets/${encodeURIComponent(assetId)}/certifications/seedance`,
77
+ { signal }
78
+ );
79
+ }
80
+ async waitForSeedanceCertification(asset, options = {}) {
81
+ const pollIntervalMs = positiveInteger(options.pollIntervalMs ?? 2e3, "pollIntervalMs");
82
+ const timeoutMs = positiveInteger(options.timeoutMs ?? 3e5, "timeoutMs");
83
+ const deadline = Date.now() + timeoutMs;
84
+ while (true) {
85
+ const certification = await this.getSeedanceCertification(asset, options.signal);
86
+ if (certification.status !== "processing") return certification;
87
+ if (Date.now() >= deadline) {
88
+ throw new Error("Timed out waiting for Seedance Asset certification");
89
+ }
90
+ await wait(Math.min(pollIntervalMs, Math.max(1, deadline - Date.now())), options.signal);
91
+ }
92
+ }
61
93
  download(asset, signal) {
62
94
  const assetId = typeof asset === "string" ? asset : asset.id;
63
95
  return this.transport.response(`/assets/${encodeURIComponent(assetId)}/content`, {
@@ -70,6 +102,20 @@ var AssetsClient = class {
70
102
  return response.body;
71
103
  }
72
104
  };
105
+ function positiveInteger(value, name) {
106
+ if (!Number.isSafeInteger(value) || value < 1) throw new TypeError(`${name} must be a positive integer`);
107
+ return value;
108
+ }
109
+ async function wait(milliseconds, signal) {
110
+ if (signal?.aborted) throw signal.reason;
111
+ await new Promise((resolve, reject) => {
112
+ const timer = setTimeout(resolve, milliseconds);
113
+ signal?.addEventListener("abort", () => {
114
+ clearTimeout(timer);
115
+ reject(signal.reason);
116
+ }, { once: true });
117
+ });
118
+ }
73
119
  function inferKind(mimeType) {
74
120
  if (mimeType.startsWith("image/")) return "image";
75
121
  if (mimeType.startsWith("video/")) return "video";
@@ -35,6 +35,28 @@ interface AssetImportRequest {
35
35
  kind?: MediaKind;
36
36
  name?: string;
37
37
  }
38
+ type AssetCertificationProvider = "seedance";
39
+ type AssetCertificationStatus = "processing" | "ready" | "failed";
40
+ interface AssetCertification {
41
+ assetId: string;
42
+ provider: AssetCertificationProvider;
43
+ status: AssetCertificationStatus;
44
+ providerAssetId?: string;
45
+ assetUri?: string;
46
+ groupId?: string;
47
+ library: "general" | "liveness";
48
+ error?: string;
49
+ createdAt: string;
50
+ updatedAt: string;
51
+ }
52
+ interface AssetCertificationRequest {
53
+ library?: "general" | "liveness";
54
+ }
55
+ interface AssetCertificationWaitOptions {
56
+ pollIntervalMs?: number;
57
+ timeoutMs?: number;
58
+ signal?: AbortSignal;
59
+ }
38
60
 
39
61
  interface ApiErrorPayload {
40
62
  error: {
@@ -228,6 +250,9 @@ declare class AssetsClient {
228
250
  upload(file: Blob, options?: AssetUploadOptions): Promise<MediaAsset>;
229
251
  import(request: AssetImportRequest, signal?: AbortSignal): Promise<MediaAsset>;
230
252
  get(assetId: string, signal?: AbortSignal): Promise<MediaAsset>;
253
+ certifyForSeedance(asset: MediaAsset | string, request?: AssetCertificationRequest, signal?: AbortSignal): Promise<AssetCertification>;
254
+ getSeedanceCertification(asset: MediaAsset | string, signal?: AbortSignal): Promise<AssetCertification>;
255
+ waitForSeedanceCertification(asset: MediaAsset | string, options?: AssetCertificationWaitOptions): Promise<AssetCertification>;
231
256
  download(asset: MediaAsset | string, signal?: AbortSignal): Promise<Response>;
232
257
  stream(asset: MediaAsset | string, signal?: AbortSignal): Promise<ReadableStream<Uint8Array>>;
233
258
  }
package/dist/types.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { b as ApiErrorPayload, d as AssetImportRequest, e as AssetInput, f as AssetReference, g as AssetUploadOptions, C as CreateTaskOptions, h as CreateTaskRequest, i as MediaAsset, j as MediaAssetStatus, k as MediaKind, l as RequestDetails, a as RunResult, R as RunTaskOptions, n as Task, o as TaskCost, p as TaskError, q as TaskEvent, r as TaskEventType, s as TaskListParams, t as TaskPage, u as TaskProgress, v as TaskReceipt, c as TaskResult, w as TaskStatus, x as TaskTiming, y as TaskUsage, z as TaskWebhookConfig, B as TerminalTaskStatus, V as VerifyWebhookOptions, W as WaitTaskOptions, D as WatchTaskOptions } from './types-CPMdhb6o.js';
1
+ export { b as ApiErrorPayload, d as AssetImportRequest, e as AssetInput, f as AssetReference, g as AssetUploadOptions, C as CreateTaskOptions, h as CreateTaskRequest, i as MediaAsset, j as MediaAssetStatus, k as MediaKind, l as RequestDetails, a as RunResult, R as RunTaskOptions, n as Task, o as TaskCost, p as TaskError, q as TaskEvent, r as TaskEventType, s as TaskListParams, t as TaskPage, u as TaskProgress, v as TaskReceipt, c as TaskResult, w as TaskStatus, x as TaskTiming, y as TaskUsage, z as TaskWebhookConfig, B as TerminalTaskStatus, V as VerifyWebhookOptions, W as WaitTaskOptions, D as WatchTaskOptions } from './types-5jsH7tBX.js';
2
2
  export { b as CreateNexraDisplayQuoteBatchRequest, C as CreateNexraQuoteRequest, r as CursorPage, F as FetchLike, v as JsonObject, w as JsonPrimitive, J as JsonValue, M as MediaGeometryField, g as MediaGeometryProjection, x as ModelCapabilitySummary, y as ModelDateVersion, z as ModelEndpointSummary, A as ModelModality, B as ModelResourceList, D as ModelResourceOption, t as ModelSchema, q as ModelSearchParams, h as NexraBillingCurrency, d as NexraCatalogRevision, u as NexraClientOptions, c as NexraDisplayQuoteBatch, E as NexraDisplayQuoteBatchEntry, j as NexraModelOperation, e as NexraModelSpec, f as NexraModelSpecFilter, a as NexraQuote, k as NexraSalePrice, N as NexraSalePriceList, l as NexraSettlement, s as TaskModel, T as TaskModelSummary, U as UnifiedMediaGeometry } from './media-geometry-Ckr1-Mh3.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byte_fluffy/nexra-sdk",
3
- "version": "0.1.0-alpha.13",
3
+ "version": "0.1.0-alpha.15",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "sideEffects": false,
@@ -42,6 +42,7 @@
42
42
  "generate": "bun scripts/generate-public-catalog.ts",
43
43
  "build": "bun run generate && tsup",
44
44
  "test": "vitest run --root ../.. packages/sdk/tests",
45
+ "verify:video-schema-drift": "bun scripts/verify-video-schema-drift.ts",
45
46
  "prepack": "bun run build"
46
47
  },
47
48
  "devDependencies": {