@byte_fluffy/nexra-sdk 0.1.0-alpha.6 → 0.1.0-alpha.8

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.
@@ -121,6 +121,10 @@ interface ModelCapabilitySummary {
121
121
  /** User-facing input patterns such as text-to-video or image-to-image. */
122
122
  inputModes: string[];
123
123
  features: string[];
124
+ /** Maximum combined input and output context supported by the model. */
125
+ contextWindowTokens?: number;
126
+ /** Maximum generated output tokens supported by the model. */
127
+ maxOutputTokens?: number;
124
128
  }
125
129
  interface ModelDateVersion {
126
130
  id: string;
@@ -228,6 +232,15 @@ interface NexraModelOperation {
228
232
  outputSchema: JsonObject;
229
233
  metering: MeteringContract;
230
234
  }
235
+ /** Public native wire endpoint metadata. Provider routing and credentials stay private. */
236
+ interface NexraModelEndpointSpec {
237
+ endpointKey: string;
238
+ operation: string;
239
+ protocol: string;
240
+ method: string;
241
+ path: string;
242
+ capabilities: readonly string[];
243
+ }
231
244
  interface NexraModelSpec {
232
245
  id: string;
233
246
  contractVersion: number;
@@ -240,6 +253,7 @@ interface NexraModelSpec {
240
253
  aliases: readonly string[];
241
254
  capabilities: ModelCapabilitySummary;
242
255
  operations: readonly NexraModelOperation[];
256
+ endpoints: readonly NexraModelEndpointSpec[];
243
257
  }
244
258
  interface NexraModelSpecFilter {
245
259
  kind?: ModelModality;
@@ -253,11 +267,23 @@ interface NexraSalePrice {
253
267
  effectiveFrom: string;
254
268
  rule: PriceRule;
255
269
  }
270
+ interface NexraSalePriceList {
271
+ currency: NexraBillingCurrency;
272
+ prices: readonly NexraSalePrice[];
273
+ }
256
274
  interface CreateNexraQuoteRequest {
257
275
  modelId: string;
258
276
  operation: string;
259
277
  input: JsonObject;
260
278
  }
279
+ interface CreateNexraDisplayQuoteBatchRequest {
280
+ modelId: string;
281
+ operation: string;
282
+ entries: readonly Readonly<{
283
+ key: string;
284
+ input: JsonObject;
285
+ }>[];
286
+ }
261
287
  interface NexraQuote {
262
288
  quoteToken: string;
263
289
  modelId: string;
@@ -269,6 +295,32 @@ interface NexraQuote {
269
295
  accuracy: "exact" | "estimated";
270
296
  expiresAt: string;
271
297
  }
298
+ type NexraDisplayQuoteBatchEntry = Readonly<{
299
+ key: string;
300
+ amount: string;
301
+ maximumAmount: string;
302
+ accuracy: "exact" | "estimated";
303
+ }> | Readonly<{
304
+ key: string;
305
+ error: {
306
+ code: string;
307
+ message: string;
308
+ };
309
+ }>;
310
+ interface NexraDisplayQuoteBatch {
311
+ modelId: string;
312
+ contractVersion: number;
313
+ priceRevision: string;
314
+ pricingPolicyRevision: string;
315
+ quoteContextRevision: string;
316
+ currency: NexraBillingCurrency;
317
+ entries: readonly NexraDisplayQuoteBatchEntry[];
318
+ expiresAt: string;
319
+ }
320
+ interface NexraCatalogRevision {
321
+ revision: string;
322
+ changedAt: string;
323
+ }
272
324
  interface NexraSettlement {
273
325
  amount: string;
274
326
  currency: NexraBillingCurrency;
@@ -336,9 +388,12 @@ declare function applyMediaGeometry(inputSchema: JsonObject, input: JsonObject):
336
388
  declare class CatalogClient {
337
389
  private readonly transport;
338
390
  constructor(transport: HttpTransport);
391
+ listPrices(signal?: AbortSignal): Promise<NexraSalePriceList>;
339
392
  quote(request: CreateNexraQuoteRequest, signal?: AbortSignal): Promise<NexraQuote>;
393
+ quoteBatch(request: CreateNexraDisplayQuoteBatchRequest, signal?: AbortSignal): Promise<NexraDisplayQuoteBatch>;
394
+ revision(signal?: AbortSignal): Promise<NexraCatalogRevision>;
340
395
  }
341
396
  declare function getModelSpec(modelId: string): NexraModelSpec | undefined;
342
397
  declare function listModelSpecs(filter?: NexraModelSpecFilter): readonly NexraModelSpec[];
343
398
 
344
- export { listModelSpecs as $, type NexraQuote as A, type BillingMetric as B, type CursorPage as C, type NexraSalePrice as D, type NormalizedUsageV1 as E, type FetchLike as F, type PriceEvaluationIssue as G, HttpTransport as H, type PriceEvaluationLine as I, type JsonObject as J, type PriceRule as K, type UsageComponentEvidence as L, type ModelSchema as M, type NexraSettlement as N, type UsageEvidenceAssessment as O, type PriceEvaluation as P, type UsageEvidenceStatus as Q, allocateDiscountedPriceLines as R, applyMediaGeometry as S, type TaskModelSummary as T, type UnifiedMediaGeometry as U, assessUsageEvidence as V, decodeMediaGeometry as W, encodeMediaGeometry as X, evaluatePriceRule as Y, getModelSpec as Z, jsonBody as _, type JsonValue as a, projectMediaGeometry as a0, queryString as a1, sleep as a2, validateMeteringContract as a3, validateNormalizedUsage as a4, validatePriceRule as a5, type ModelSearchParams as b, type TaskModel as c, CatalogClient as d, type NexraClientOptions as e, BILLING_EXPORT_DIMENSIONS as f, BILLING_METRICS as g, type CreateNexraQuoteRequest as h, type JsonPrimitive as i, type MediaGeometryField as j, type MediaGeometryProjection as k, type MeteredPriceRate as l, type MeteredPriceRuleV1 as m, type MeteredUsageComponent as n, type MeteringContract as o, type MeteringKind as p, type ModelCapabilitySummary as q, type ModelDateVersion as r, type ModelEndpointSummary as s, type ModelModality as t, type ModelResourceList as u, type ModelResourceOption as v, type NexraBillingCurrency as w, type NexraModelOperation as x, type NexraModelSpec as y, type NexraModelSpecFilter as z };
399
+ export { assessUsageEvidence as $, type NexraDisplayQuoteBatchEntry as A, type BillingMetric as B, type CursorPage as C, type NexraModelEndpointSpec as D, type NexraModelOperation as E, type FetchLike as F, type NexraModelSpec as G, HttpTransport as H, type NexraModelSpecFilter as I, type JsonObject as J, type NexraQuote as K, type NexraSalePrice as L, type ModelSchema as M, type NexraSettlement as N, type NexraSalePriceList as O, type NormalizedUsageV1 as P, type PriceEvaluation as Q, type PriceEvaluationIssue as R, type PriceEvaluationLine as S, type TaskModelSummary as T, type PriceRule as U, type UnifiedMediaGeometry as V, type UsageComponentEvidence as W, type UsageEvidenceAssessment as X, type UsageEvidenceStatus as Y, allocateDiscountedPriceLines as Z, applyMediaGeometry as _, type JsonValue as a, decodeMediaGeometry as a0, encodeMediaGeometry as a1, evaluatePriceRule as a2, getModelSpec as a3, jsonBody as a4, listModelSpecs as a5, projectMediaGeometry as a6, queryString as a7, sleep as a8, validateMeteringContract as a9, validateNormalizedUsage as aa, validatePriceRule as ab, type ModelSearchParams as b, type TaskModel as c, CatalogClient as d, type NexraClientOptions as e, BILLING_EXPORT_DIMENSIONS as f, BILLING_METRICS as g, type CreateNexraDisplayQuoteBatchRequest as h, type CreateNexraQuoteRequest as i, type JsonPrimitive as j, type MediaGeometryField as k, type MediaGeometryProjection as l, type MeteredPriceRate as m, type MeteredPriceRuleV1 as n, type MeteredUsageComponent as o, type MeteringContract as p, type MeteringKind as q, type ModelCapabilitySummary as r, type ModelDateVersion as s, type ModelEndpointSummary as t, type ModelModality as u, type ModelResourceList as v, type ModelResourceOption as w, type NexraBillingCurrency as x, type NexraCatalogRevision as y, type NexraDisplayQuoteBatch as z };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { J as JsonObject, B as BillingMetric, a as JsonValue, N as NexraSettlement, C as CursorPage, M as ModelSchema, T as TaskModelSummary, H as HttpTransport, b as ModelSearchParams, c as TaskModel, d as CatalogClient, e as NexraClientOptions } from './index-FyUOK0F-.js';
2
- export { f as BILLING_EXPORT_DIMENSIONS, g as BILLING_METRICS, h as CreateNexraQuoteRequest, F as FetchLike, i as JsonPrimitive, j as MediaGeometryField, k as MediaGeometryProjection, l as MeteredPriceRate, m as MeteredPriceRuleV1, n as MeteredUsageComponent, o as MeteringContract, p as MeteringKind, q as ModelCapabilitySummary, r as ModelDateVersion, s as ModelEndpointSummary, t as ModelModality, u as ModelResourceList, v as ModelResourceOption, w as NexraBillingCurrency, x as NexraModelOperation, y as NexraModelSpec, z as NexraModelSpecFilter, A as NexraQuote, D as NexraSalePrice, E as NormalizedUsageV1, P as PriceEvaluation, G as PriceEvaluationIssue, I as PriceEvaluationLine, K as PriceRule, U as UnifiedMediaGeometry, L as UsageComponentEvidence, O as UsageEvidenceAssessment, Q as UsageEvidenceStatus, R as allocateDiscountedPriceLines, S as applyMediaGeometry, V as assessUsageEvidence, W as decodeMediaGeometry, X as encodeMediaGeometry, Y as evaluatePriceRule, Z as getModelSpec, _ as jsonBody, $ as listModelSpecs, a0 as projectMediaGeometry, a1 as queryString, a2 as sleep, a3 as validateMeteringContract, a4 as validateNormalizedUsage, a5 as validatePriceRule } from './index-FyUOK0F-.js';
1
+ import { J as JsonObject, B as BillingMetric, a as JsonValue, N as NexraSettlement, C as CursorPage, M as ModelSchema, T as TaskModelSummary, H as HttpTransport, b as ModelSearchParams, c as TaskModel, d as CatalogClient, e as NexraClientOptions } from './index-CAi88bUo.js';
2
+ export { f as BILLING_EXPORT_DIMENSIONS, g as BILLING_METRICS, h as CreateNexraDisplayQuoteBatchRequest, i as CreateNexraQuoteRequest, F as FetchLike, j as JsonPrimitive, k as MediaGeometryField, l as MediaGeometryProjection, m as MeteredPriceRate, n as MeteredPriceRuleV1, o as MeteredUsageComponent, p as MeteringContract, q as MeteringKind, r as ModelCapabilitySummary, s as ModelDateVersion, t as ModelEndpointSummary, u as ModelModality, v as ModelResourceList, w as ModelResourceOption, x as NexraBillingCurrency, y as NexraCatalogRevision, z as NexraDisplayQuoteBatch, A as NexraDisplayQuoteBatchEntry, D as NexraModelEndpointSpec, E as NexraModelOperation, G as NexraModelSpec, I as NexraModelSpecFilter, K as NexraQuote, L as NexraSalePrice, O as NexraSalePriceList, P as NormalizedUsageV1, Q as PriceEvaluation, R as PriceEvaluationIssue, S as PriceEvaluationLine, U as PriceRule, V as UnifiedMediaGeometry, W as UsageComponentEvidence, X as UsageEvidenceAssessment, Y as UsageEvidenceStatus, Z as allocateDiscountedPriceLines, _ as applyMediaGeometry, $ as assessUsageEvidence, a0 as decodeMediaGeometry, a1 as encodeMediaGeometry, a2 as evaluatePriceRule, a3 as getModelSpec, a4 as jsonBody, a5 as listModelSpecs, a6 as projectMediaGeometry, a7 as queryString, a8 as sleep, a9 as validateMeteringContract, aa as validateNormalizedUsage, ab as validatePriceRule } from './index-CAi88bUo.js';
3
3
  export { ceilDecimal, multiplyDecimal } from './decimal.js';
4
4
 
5
5
  declare const MEDIA_KINDS: readonly ["image", "video", "audio", "document", "archive", "other"];
@@ -590,6 +590,8 @@ interface TaskTiming {
590
590
  storageMs: number | null;
591
591
  totalMs: number | null;
592
592
  startSource: "client" | "server";
593
+ /** Server clock reading taken when this snapshot was built; lets clients anchor live timers to server time. */
594
+ observedAt?: string;
593
595
  }
594
596
  /** Repository/console read model. HTTP clients receive TaskReceipt or TaskResult. */
595
597
  interface Task<TOutput = JsonValue> {
@@ -996,6 +998,19 @@ declare function adaptSandboxInput(schema: ModelSchema, mode: string, input: Jso
996
998
  /** Minimal operation form. Unsupported controls remain explicit provider defaults. */
997
999
  declare function sandboxInputSchema(schemas: ModelSchema[], mode: string): ModelSchema;
998
1000
 
1001
+ /** 统一的比例展示顺序契约:`auto` → `1:1` → 常规比例按长边升序成对排列(竖前横后)→ `1:x`/`x:1` 极端长幅收尾。
1002
+ * 所有模型的画面比例选项共用这一顺序,保证规格面板跨模型一致。 */
1003
+ type RatioDisplayKey = readonly [number, number, number, number, string];
1004
+ declare function ratioDisplayOrderKey(value: string): RatioDisplayKey;
1005
+ declare function compareRatioDisplayOrder(a: string, b: string): number;
1006
+ declare function sortRatioDisplayOrder(values: readonly string[]): string[];
1007
+ /** Reorders ratio/aspect_ratio enums and their optionLabels inside JSON-Schema
1008
+ * properties so every published model presents aspect ratios in one order.
1009
+ * The optionLabels map is normalized to exactly the enum values (stale labels
1010
+ * dropped, missing ones filled with the value itself).
1011
+ * Returns the input reference untouched when nothing needs reordering. */
1012
+ declare function orderSchemaRatioProperties(properties: unknown): unknown;
1013
+
999
1014
  declare class AssetsClient {
1000
1015
  private readonly transport;
1001
1016
  constructor(transport: HttpTransport);
@@ -1093,4 +1108,4 @@ interface VerifyWebhookOptions {
1093
1108
  /** @deprecated Only verifies legacy signed webhooks, not callback_url notifications. */
1094
1109
  declare function verifyWebhook(request: Request, secret: string, options?: VerifyWebhookOptions): Promise<boolean>;
1095
1110
 
1096
- export { ADMIN_USER_ACTIVITY_KINDS, ADMIN_USER_ROLES, ADMIN_USER_STATUSES, type AdminOverview, type AdminUserActivityKind, type AdminUserActivityPage, type AdminUserActivityRow, type AdminUserApiKeyUpdate, type AdminUserApiKeyUpdateResult, type AdminUserDetail, type AdminUserDiscountRow, type AdminUserKeyRow, type AdminUserListCursor, type AdminUserListPage, type AdminUserListQuery, type AdminUserPricingAdjustmentRow, type AdminUserRole, type AdminUserStatus, type AdminUserSummaryRow, type AdminUserUpdate, type AdminUserUpdateResult, type AdminUserWalletOpenInput, type AdminUserWalletOpenResult, type AdminUserWalletSummary, type AdminWalletRechargeInput, type AdminWalletRechargeResult, type ApiErrorPayload, type AssetImportRequest, type AssetInput, type AssetReference, type AssetUploadOptions, AssetsClient, type AvailabilityBucket, type AvailabilityObservation, type AvailabilityStats, BILLING_CURRENCY, BillingMetric, CatalogClient, type CreateTaskOptions, type CreateTaskRequest, type CreateTaskRunRequest, CursorPage, HttpTransport, JsonObject, JsonValue, MEDIA_KINDS, MONEY_STRING_PATTERN, type MediaAsset, type MediaAssetStatus, type MediaKind, ModelSchema, ModelSearchParams, ModelsClient, type MoneyString, NexraApiError, NexraClient, NexraClientOptions, NexraSettlement, NexraTaskError, NexraWaitTimeoutError, type ObservationResult, type ProbeRunView, type ProbeTargetConfig, type ProbeTargetView, type RequestDetails, type RunResult, type RunTaskOptions, SANDBOX_OPERATIONS, type SandboxOperation, TASK_STATUSES, TOKEN_METRICS, type Task, type TaskCost, type TaskError, type TaskEvent, type TaskEventType, type TaskListParams, TaskModel, TaskModelSummary, type TaskPage, type TaskProgress, type TaskReceipt, type TaskResult, type TaskRun, type TaskRunListParams, type TaskStatus, type TaskTiming, type TaskUsage, type TaskWebhookConfig, TasksClient, type TerminalTaskStatus, USAGE_AMOUNT_KINDS, USAGE_ANOMALY_CATEGORIES, USAGE_FILTER_KINDS, USAGE_FILTER_SELECTION_LIMIT, USAGE_GROUP_BYS, USAGE_NORMALIZATION_STATUSES, USAGE_RATING_STATUSES, USAGE_SOURCES, type UploadDeliveryRegion, type UsageAmountKind, type UsageAnomaliesPage, type UsageAnomaliesQuery, type UsageAnomalyBreakdownRow, type UsageAnomalyCategory, type UsageAnomalyRow, type UsageAnomalySummaryPage, type UsageAnomalySummaryQuery, type UsageAnomalySummaryRow, type UsageDetailCharge, type UsageDetailRow, type UsageDetailUsage, type UsageDetailsPage, type UsageDetailsQuery, type UsageFilterKind, type UsageFilterOption, type UsageFilterOptionsPage, type UsageFilterOptionsQuery, type UsageFilters, type UsageGroupBy, type UsageNormalizationStatus, type UsageRatingStatus, type UsageSource, type UsageSummaryAmount, type UsageSummaryGroup, type UsageSummaryPage, type UsageSummaryQuery, type UsageSummaryRow, type UsageTimeWindow, type VerifyWebhookOptions, WALLET_MAX_BALANCE_UNITS, type WaitTaskOptions, type WatchTaskOptions, adaptSandboxInput, availabilityBuckets, availabilityStats, classifyObservation, createNexra, defaultProbeInterval, defaultProbeTimeout, encodeAdminUserCursor, encodeUsageFilterCursor, encodeUsageKeysetCursor, encodeUsageSummaryCursor, isMoneyString, isTerminalTaskStatus, modelInputDefaults, modelInputUi, modelUploadRegion, moneyFromUnits, moneyToUnits, multiplyMoney, normalizeModelParameterSchema, orderedSchemaProperties, parseAdminUserCursor, parseUsageFilterCursor, parseUsageKeysetCursor, parseUsageSummaryCursor, probeCostExceeds, rateProbeUsage, sandboxIdentity, sandboxInputSchema, sandboxModelModes, sandboxObject, sandboxOperations, sandboxProperties, sandboxSupports, sandboxVoiceKey, taskReceipt, taskResult, uploadedMediaInput, uploadedMediaUrl, validateAdminUserApiKeyUpdate, validateAdminUserListQuery, validateAdminUserUpdate, validateAdminWalletRechargeInput, validateUsageAnomaliesQuery, validateUsageAnomalySummaryQuery, validateUsageDetailsQuery, validateUsageFilterOptionsQuery, validateUsageFilters, validateUsageSummaryQuery, verifyWebhook };
1111
+ export { ADMIN_USER_ACTIVITY_KINDS, ADMIN_USER_ROLES, ADMIN_USER_STATUSES, type AdminOverview, type AdminUserActivityKind, type AdminUserActivityPage, type AdminUserActivityRow, type AdminUserApiKeyUpdate, type AdminUserApiKeyUpdateResult, type AdminUserDetail, type AdminUserDiscountRow, type AdminUserKeyRow, type AdminUserListCursor, type AdminUserListPage, type AdminUserListQuery, type AdminUserPricingAdjustmentRow, type AdminUserRole, type AdminUserStatus, type AdminUserSummaryRow, type AdminUserUpdate, type AdminUserUpdateResult, type AdminUserWalletOpenInput, type AdminUserWalletOpenResult, type AdminUserWalletSummary, type AdminWalletRechargeInput, type AdminWalletRechargeResult, type ApiErrorPayload, type AssetImportRequest, type AssetInput, type AssetReference, type AssetUploadOptions, AssetsClient, type AvailabilityBucket, type AvailabilityObservation, type AvailabilityStats, BILLING_CURRENCY, BillingMetric, CatalogClient, type CreateTaskOptions, type CreateTaskRequest, type CreateTaskRunRequest, CursorPage, HttpTransport, JsonObject, JsonValue, MEDIA_KINDS, MONEY_STRING_PATTERN, type MediaAsset, type MediaAssetStatus, type MediaKind, ModelSchema, ModelSearchParams, ModelsClient, type MoneyString, NexraApiError, NexraClient, NexraClientOptions, NexraSettlement, NexraTaskError, NexraWaitTimeoutError, type ObservationResult, type ProbeRunView, type ProbeTargetConfig, type ProbeTargetView, type RequestDetails, type RunResult, type RunTaskOptions, SANDBOX_OPERATIONS, type SandboxOperation, TASK_STATUSES, TOKEN_METRICS, type Task, type TaskCost, type TaskError, type TaskEvent, type TaskEventType, type TaskListParams, TaskModel, TaskModelSummary, type TaskPage, type TaskProgress, type TaskReceipt, type TaskResult, type TaskRun, type TaskRunListParams, type TaskStatus, type TaskTiming, type TaskUsage, type TaskWebhookConfig, TasksClient, type TerminalTaskStatus, USAGE_AMOUNT_KINDS, USAGE_ANOMALY_CATEGORIES, USAGE_FILTER_KINDS, USAGE_FILTER_SELECTION_LIMIT, USAGE_GROUP_BYS, USAGE_NORMALIZATION_STATUSES, USAGE_RATING_STATUSES, USAGE_SOURCES, type UploadDeliveryRegion, type UsageAmountKind, type UsageAnomaliesPage, type UsageAnomaliesQuery, type UsageAnomalyBreakdownRow, type UsageAnomalyCategory, type UsageAnomalyRow, type UsageAnomalySummaryPage, type UsageAnomalySummaryQuery, type UsageAnomalySummaryRow, type UsageDetailCharge, type UsageDetailRow, type UsageDetailUsage, type UsageDetailsPage, type UsageDetailsQuery, type UsageFilterKind, type UsageFilterOption, type UsageFilterOptionsPage, type UsageFilterOptionsQuery, type UsageFilters, type UsageGroupBy, type UsageNormalizationStatus, type UsageRatingStatus, type UsageSource, type UsageSummaryAmount, type UsageSummaryGroup, type UsageSummaryPage, type UsageSummaryQuery, type UsageSummaryRow, type UsageTimeWindow, type VerifyWebhookOptions, WALLET_MAX_BALANCE_UNITS, type WaitTaskOptions, type WatchTaskOptions, adaptSandboxInput, availabilityBuckets, availabilityStats, classifyObservation, compareRatioDisplayOrder, createNexra, defaultProbeInterval, defaultProbeTimeout, encodeAdminUserCursor, encodeUsageFilterCursor, encodeUsageKeysetCursor, encodeUsageSummaryCursor, isMoneyString, isTerminalTaskStatus, modelInputDefaults, modelInputUi, modelUploadRegion, moneyFromUnits, moneyToUnits, multiplyMoney, normalizeModelParameterSchema, orderSchemaRatioProperties, orderedSchemaProperties, parseAdminUserCursor, parseUsageFilterCursor, parseUsageKeysetCursor, parseUsageSummaryCursor, probeCostExceeds, rateProbeUsage, ratioDisplayOrderKey, sandboxIdentity, sandboxInputSchema, sandboxModelModes, sandboxObject, sandboxOperations, sandboxProperties, sandboxSupports, sandboxVoiceKey, sortRatioDisplayOrder, taskReceipt, taskResult, uploadedMediaInput, uploadedMediaUrl, validateAdminUserApiKeyUpdate, validateAdminUserListQuery, validateAdminUserUpdate, validateAdminWalletRechargeInput, validateUsageAnomaliesQuery, validateUsageAnomalySummaryQuery, validateUsageDetailsQuery, validateUsageFilterOptionsQuery, validateUsageFilters, validateUsageSummaryQuery, verifyWebhook };