@sogni-ai/sogni-client 5.75.2 → 5.77.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.
@@ -92,7 +92,12 @@ import {
92
92
  import { getFileContentType } from './utils/fileContentType.js';
93
93
  import { TokenType } from '../types/token.js';
94
94
  import type { JobProvenance } from './types/JobProvenance.js';
95
- import { getMaxContextImages, validateSampler, isGptImageModel, resolveGptImageGifSize } from '../lib/validation.js';
95
+ import {
96
+ getMaxContextImages,
97
+ validateSampler,
98
+ isGptImageModel,
99
+ resolveGptImageGifSize
100
+ } from '../lib/validation.js';
96
101
  import ModelTiersRaw, {
97
102
  isAudioTier,
98
103
  isComfyImageTier,
@@ -1083,6 +1088,7 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
1083
1088
  lastFrameUrl: data.lastFrameUrl,
1084
1089
  outputFormat: data.outputFormat,
1085
1090
  ...seedanceDraftFields,
1091
+ ...(data.lastFrameKey ? { lastFrameKey: data.lastFrameKey } : {}),
1086
1092
  isNSFW: Boolean(data.triggeredNSFWFilter),
1087
1093
  nsfwDetected: data.nsfwDetected === true,
1088
1094
  nsfwSources: Array.isArray(data.nsfwSources) ? [...data.nsfwSources] : [],
@@ -3348,7 +3354,8 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
3348
3354
  gptImageComplexity,
3349
3355
  outputFormat,
3350
3356
  billingMode,
3351
- priorityMode
3357
+ priorityMode,
3358
+ includeMonthlyFairUse
3352
3359
  }: EstimateRequest): Promise<CostEstimation> {
3353
3360
  let apiVersion = 2;
3354
3361
  const modelOptions = await this.getModelOptions(model);
@@ -3388,12 +3395,15 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
3388
3395
  }
3389
3396
  const queryParams = new URLSearchParams();
3390
3397
  if (gptImageQuality) queryParams.set('gptImageQuality', gptImageQuality);
3391
- if (gptImageFrameCount !== undefined) queryParams.set('gptImageFrameCount', String(gptImageFrameCount));
3392
- if (gptImageFrameDurationMs !== undefined) queryParams.set('gptImageFrameDurationMs', String(gptImageFrameDurationMs));
3398
+ if (gptImageFrameCount !== undefined)
3399
+ queryParams.set('gptImageFrameCount', String(gptImageFrameCount));
3400
+ if (gptImageFrameDurationMs !== undefined)
3401
+ queryParams.set('gptImageFrameDurationMs', String(gptImageFrameDurationMs));
3393
3402
  if (gptImageComplexity !== undefined) queryParams.set('gptImageComplexity', gptImageComplexity);
3394
3403
  if (outputFormat) queryParams.set('outputFormat', outputFormat);
3395
3404
  if (billingMode) queryParams.set('billingMode', billingMode);
3396
3405
  if (priorityMode !== undefined) queryParams.set('priorityMode', String(priorityMode));
3406
+ if (includeMonthlyFairUse === true) queryParams.set('includeMonthlyFairUse', 'true');
3397
3407
  const query = queryParams.toString();
3398
3408
  const r = await this.client.socket.get<EstimationResponse>(
3399
3409
  `/api/v${apiVersion}/job/estimate/${pathParams.join('/')}${query ? `?${query}` : ''}`
@@ -3405,7 +3415,8 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
3405
3415
  sogni: r.quote.project.costInSogni,
3406
3416
  estimatedRenderSeconds: r.benchmark?.estimatedRenderTimeSec,
3407
3417
  estimatedTotalSeconds: r.benchmark?.estimatedTotalTimeSec,
3408
- dailyFairUsePct: r.dailyFairUse?.pct
3418
+ dailyFairUsePct: r.dailyFairUse?.pct,
3419
+ ...(r.monthlyFairUse ? { monthlyFairUsePct: r.monthlyFairUse.pct } : {})
3409
3420
  };
3410
3421
  }
3411
3422
 
@@ -3527,6 +3538,7 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
3527
3538
  if (network) query.set('network', network);
3528
3539
  if (params.billingMode) query.set('billingMode', params.billingMode);
3529
3540
  if (params.priorityMode !== undefined) query.set('priorityMode', String(params.priorityMode));
3541
+ if (params.includeMonthlyFairUse === true) query.set('includeMonthlyFairUse', 'true');
3530
3542
  if (params.seedanceDraft === true) query.set('seedanceDraft', '1');
3531
3543
  if (params.seedanceDraftJobId !== undefined) {
3532
3544
  query.set('seedanceDraftJobId', params.seedanceDraftJobId);
@@ -3542,7 +3554,8 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
3542
3554
  sogni: r.quote.project.costInSogni,
3543
3555
  estimatedRenderSeconds: r.benchmark?.estimatedRenderTimeSec,
3544
3556
  estimatedTotalSeconds: r.benchmark?.estimatedTotalTimeSec,
3545
- dailyFairUsePct: r.dailyFairUse?.pct
3557
+ dailyFairUsePct: r.dailyFairUse?.pct,
3558
+ ...(r.monthlyFairUse ? { monthlyFairUsePct: r.monthlyFairUse.pct } : {})
3546
3559
  };
3547
3560
  }
3548
3561
 
@@ -3572,6 +3585,7 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
3572
3585
  if (network) query.set('network', network);
3573
3586
  if (params.billingMode) query.set('billingMode', params.billingMode);
3574
3587
  if (params.priorityMode !== undefined) query.set('priorityMode', String(params.priorityMode));
3588
+ if (params.includeMonthlyFairUse === true) query.set('includeMonthlyFairUse', 'true');
3575
3589
  const queryString = query.toString();
3576
3590
  const r = await this.client.socket.get<EstimationResponse>(
3577
3591
  `/api/v1/job-audio/estimate/${path}${queryString ? `?${queryString}` : ''}`
@@ -3583,7 +3597,8 @@ class ProjectsApi extends ApiGroup<ProjectApiEvents> {
3583
3597
  sogni: r.quote.project.costInSogni,
3584
3598
  estimatedRenderSeconds: r.benchmark?.estimatedRenderTimeSec,
3585
3599
  estimatedTotalSeconds: r.benchmark?.estimatedTotalTimeSec,
3586
- dailyFairUsePct: r.dailyFairUse?.pct
3600
+ dailyFairUsePct: r.dailyFairUse?.pct,
3601
+ ...(r.monthlyFairUse ? { monthlyFairUsePct: r.monthlyFairUse.pct } : {})
3587
3602
  };
3588
3603
  }
3589
3604
 
@@ -9,6 +9,8 @@ export interface EstimationResponse {
9
9
  * only to a signed-in subscriber whose plan covers the project on Fast.
10
10
  */
11
11
  dailyFairUse?: { pct: number };
12
+ /** Optional monthly capacity share requested by the caller. */
13
+ monthlyFairUse?: { pct: number };
12
14
  }
13
15
 
14
16
  export interface Benchmark {
@@ -107,6 +107,7 @@ export interface JobCompleted extends JobEventBase {
107
107
  */
108
108
  resultUrl: string | null;
109
109
  lastFrameUrl?: string;
110
+ lastFrameKey?: string;
110
111
  outputFormat?: string;
111
112
  /** Seedance 2.5: this job is a draft that can be finalized at 1080p. */
112
113
  seedanceDraft?: boolean;
@@ -829,7 +829,7 @@ export interface VideoProjectParams extends BaseProjectParams {
829
829
  * Output video format. Defaults to 'mp4'; 'mov' is supported by Seedance 2.5.
830
830
  */
831
831
  outputFormat?: VideoOutputFormat;
832
- /** Seedance 2.5: export a separate final-frame image, available as job.lastFrameUrl. */
832
+ /** Seedance 2.5 / MiniMax H3: export a final-frame image; refresh with job.getLastFrameUrl(). */
833
833
  returnLastFrame?: boolean;
834
834
  /**
835
835
  * SAM2 click coordinates for subject detection in animate-replace workflows.
@@ -1270,6 +1270,8 @@ export type MediaUrlParams = {
1270
1270
  };
1271
1271
 
1272
1272
  export interface EstimateRequest {
1273
+ /** Request the optional monthly capacity share alongside the daily estimate. */
1274
+ includeMonthlyFairUse?: boolean;
1273
1275
  /** Include Priority mode's 1.5× usage in the daily-capacity estimate. */
1274
1276
  priorityMode?: boolean;
1275
1277
  /**
@@ -1354,6 +1356,8 @@ export interface EstimateRequest {
1354
1356
  }
1355
1357
 
1356
1358
  export interface VideoEstimateRequest {
1359
+ /** Request the optional monthly capacity share alongside the daily estimate. */
1360
+ includeMonthlyFairUse?: boolean;
1357
1361
  /** Include Priority mode's 1.5× usage in the daily-capacity estimate. */
1358
1362
  priorityMode?: boolean;
1359
1363
  /** FlashVSR source geometry for an estimate. The server verifies the uploaded file at admission. */
@@ -1430,6 +1434,8 @@ export interface VideoEstimateRequest {
1430
1434
  }
1431
1435
 
1432
1436
  export interface AudioEstimateRequest {
1437
+ /** Request the optional monthly capacity share alongside the daily estimate. */
1438
+ includeMonthlyFairUse?: boolean;
1433
1439
  /** Include Priority mode's 1.5× usage in the daily-capacity estimate. */
1434
1440
  priorityMode?: boolean;
1435
1441
  tokenType: TokenType;
@@ -1484,6 +1490,8 @@ export interface CostEstimation {
1484
1490
  * for guests, premium-vendor models, token billing, trials and Relaxed.
1485
1491
  */
1486
1492
  dailyFairUsePct?: number;
1493
+ /** Estimated share of monthly Fast capacity, when requested and supplied by the server. */
1494
+ monthlyFairUsePct?: number;
1487
1495
  }
1488
1496
 
1489
1497
  export type EnhancementStrength = 'light' | 'medium' | 'heavy';
package/src/version.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED by scripts/generate-version.mjs — do not edit.
2
2
  // Source of truth: package.json version.
3
- export const LIB_VERSION = '5.75.2';
3
+ export const LIB_VERSION = '5.77.0';