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

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-Z7RXRNVE.js";
10
10
  export {
11
11
  CatalogClient,
12
12
  applyMediaGeometry,
@@ -24404,6 +24404,243 @@ var video_generated_default = [
24404
24404
  }
24405
24405
  ]
24406
24406
  },
24407
+ {
24408
+ id: "bytedance/doubao-seedance-1-5-pro-251215",
24409
+ contractVersion: 1,
24410
+ developer: "bytedance",
24411
+ displayName: "Doubao Seedance 1.5 Pro",
24412
+ summary: "Generate 4\u201312 second video from text and optional first/last-frame images with native audio at up to 1080p.",
24413
+ kind: "video",
24414
+ family: "Seedance Pro",
24415
+ versionLabel: "1.5",
24416
+ aliases: [
24417
+ "seed",
24418
+ "seedance-v1.5",
24419
+ "volcengine/doubao-seedance-1-5-pro-251215"
24420
+ ],
24421
+ capabilities: {
24422
+ inputModalities: [
24423
+ "text",
24424
+ "image"
24425
+ ],
24426
+ outputModalities: [
24427
+ "video"
24428
+ ],
24429
+ inputModes: [
24430
+ "text-to-video",
24431
+ "image-to-video"
24432
+ ],
24433
+ features: []
24434
+ },
24435
+ operations: [
24436
+ {
24437
+ operation: "video.generate",
24438
+ inputModalities: [
24439
+ "text",
24440
+ "image"
24441
+ ],
24442
+ outputModalities: [
24443
+ "video"
24444
+ ],
24445
+ inputSchema: {
24446
+ type: "object",
24447
+ properties: {
24448
+ duration: {
24449
+ description: "Requested output duration in seconds.",
24450
+ type: "integer",
24451
+ enum: [
24452
+ 4,
24453
+ 8,
24454
+ 12
24455
+ ],
24456
+ "x-ui": {
24457
+ order: 4,
24458
+ control: "segmented",
24459
+ optionLabels: {
24460
+ "4": "4 \u79D2",
24461
+ "8": "8 \u79D2",
24462
+ "12": "12 \u79D2"
24463
+ }
24464
+ },
24465
+ default: 4
24466
+ },
24467
+ images: {
24468
+ type: "array",
24469
+ items: {
24470
+ oneOf: [
24471
+ {
24472
+ type: "string",
24473
+ format: "uri"
24474
+ },
24475
+ {
24476
+ type: "object",
24477
+ properties: {
24478
+ url: {
24479
+ type: "string",
24480
+ format: "uri"
24481
+ },
24482
+ role: {
24483
+ type: "string",
24484
+ enum: [
24485
+ "first_frame",
24486
+ "last_frame"
24487
+ ]
24488
+ }
24489
+ },
24490
+ required: [
24491
+ "url"
24492
+ ],
24493
+ additionalProperties: false
24494
+ },
24495
+ {
24496
+ type: "object",
24497
+ properties: {
24498
+ assetId: {
24499
+ type: "string",
24500
+ minLength: 1
24501
+ },
24502
+ role: {
24503
+ type: "string",
24504
+ enum: [
24505
+ "first_frame",
24506
+ "last_frame"
24507
+ ]
24508
+ }
24509
+ },
24510
+ required: [
24511
+ "assetId"
24512
+ ],
24513
+ additionalProperties: false
24514
+ }
24515
+ ]
24516
+ },
24517
+ description: "Image inputs; assign a role when the model exposes role-specific behavior.",
24518
+ minItems: 1,
24519
+ maxItems: 2,
24520
+ "x-ui": {
24521
+ order: 1,
24522
+ control: "media",
24523
+ roles: [
24524
+ "first_frame",
24525
+ "last_frame"
24526
+ ],
24527
+ accept: [
24528
+ "url"
24529
+ ]
24530
+ }
24531
+ },
24532
+ ratio: {
24533
+ type: "string",
24534
+ description: "Requested output aspect ratio.",
24535
+ enum: [
24536
+ "1:1",
24537
+ "3:4",
24538
+ "4:3",
24539
+ "9:16",
24540
+ "16:9",
24541
+ "21:9"
24542
+ ],
24543
+ "x-ui": {
24544
+ order: 2,
24545
+ control: "segmented",
24546
+ optionLabels: {
24547
+ "1:1": "1:1\uFF08\u65B9\u5F62\uFF09",
24548
+ "3:4": "3:4",
24549
+ "4:3": "4:3",
24550
+ "9:16": "9:16\uFF08\u7AD6\u5C4F\uFF09",
24551
+ "16:9": "16:9\uFF08\u6A2A\u5C4F\uFF09",
24552
+ "21:9": "21:9"
24553
+ }
24554
+ },
24555
+ default: "16:9"
24556
+ },
24557
+ resolution: {
24558
+ type: "string",
24559
+ description: "Requested output resolution.",
24560
+ enum: [
24561
+ "480p",
24562
+ "720p",
24563
+ "1080p"
24564
+ ],
24565
+ "x-ui": {
24566
+ order: 3,
24567
+ control: "segmented",
24568
+ optionLabels: {
24569
+ "480p": "480p",
24570
+ "720p": "720p",
24571
+ "1080p": "1080p"
24572
+ }
24573
+ },
24574
+ default: "720p"
24575
+ },
24576
+ texts: {
24577
+ type: "string",
24578
+ description: "Describe the subject, action, camera movement, and style of the video.",
24579
+ minLength: 1,
24580
+ title: "Prompt",
24581
+ "x-ui": {
24582
+ order: 0,
24583
+ control: "textarea"
24584
+ }
24585
+ },
24586
+ with_audio: {
24587
+ type: "boolean",
24588
+ description: "Whether the generated output should include audio.",
24589
+ "x-ui": {
24590
+ order: 5,
24591
+ control: "switch"
24592
+ },
24593
+ default: true
24594
+ }
24595
+ },
24596
+ additionalProperties: false,
24597
+ required: [
24598
+ "texts"
24599
+ ]
24600
+ },
24601
+ outputSchema: {
24602
+ type: "object",
24603
+ properties: {
24604
+ videos: {
24605
+ type: "array",
24606
+ items: {
24607
+ type: "string",
24608
+ format: "uri"
24609
+ },
24610
+ description: "`content` \u4E3A\u89C6\u9891 URL \u5B57\u7B26\u4E32\u6570\u7EC4"
24611
+ }
24612
+ },
24613
+ additionalProperties: false
24614
+ },
24615
+ metering: {
24616
+ schemaVersion: 1,
24617
+ kind: "token",
24618
+ metrics: [
24619
+ {
24620
+ metric: "requests",
24621
+ requirement: "required"
24622
+ },
24623
+ {
24624
+ metric: "output_tokens",
24625
+ requirement: "required"
24626
+ }
24627
+ ]
24628
+ }
24629
+ }
24630
+ ],
24631
+ endpoints: [
24632
+ {
24633
+ endpointKey: "native-volcengine-ark",
24634
+ operation: "video.generate",
24635
+ protocol: "ark-video-task",
24636
+ method: "POST",
24637
+ path: "/proxy/volcengine-ark/contents/generations/tasks",
24638
+ capabilities: [
24639
+ "native_proxy"
24640
+ ]
24641
+ }
24642
+ ]
24643
+ },
24407
24644
  {
24408
24645
  id: "bytedance/doubao-seedance-2-0-260128",
24409
24646
  contractVersion: 2,
@@ -34128,7 +34365,7 @@ var NexraWaitTimeoutError = class extends Error {
34128
34365
  };
34129
34366
 
34130
34367
  // src/generated/version.generated.ts
34131
- var SDK_VERSION = "0.1.0-alpha.13";
34368
+ var SDK_VERSION = "0.1.0-alpha.14";
34132
34369
 
34133
34370
  // src/transport.ts
34134
34371
  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-Z7RXRNVE.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.14",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "sideEffects": false,