@byte_fluffy/nexra-sdk 0.1.0-alpha.5 → 0.1.0-alpha.7

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.
@@ -253,6 +253,10 @@ interface NexraSalePrice {
253
253
  effectiveFrom: string;
254
254
  rule: PriceRule;
255
255
  }
256
+ interface NexraSalePriceList {
257
+ currency: NexraBillingCurrency;
258
+ prices: readonly NexraSalePrice[];
259
+ }
256
260
  interface CreateNexraQuoteRequest {
257
261
  modelId: string;
258
262
  operation: string;
@@ -336,9 +340,10 @@ declare function applyMediaGeometry(inputSchema: JsonObject, input: JsonObject):
336
340
  declare class CatalogClient {
337
341
  private readonly transport;
338
342
  constructor(transport: HttpTransport);
343
+ listPrices(signal?: AbortSignal): Promise<NexraSalePriceList>;
339
344
  quote(request: CreateNexraQuoteRequest, signal?: AbortSignal): Promise<NexraQuote>;
340
345
  }
341
346
  declare function getModelSpec(modelId: string): NexraModelSpec | undefined;
342
347
  declare function listModelSpecs(filter?: NexraModelSpecFilter): readonly NexraModelSpec[];
343
348
 
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 };
349
+ export { jsonBody as $, type NexraQuote as A, type BillingMetric as B, type CursorPage as C, type NexraSalePrice as D, type NexraSalePriceList as E, type FetchLike as F, type NormalizedUsageV1 as G, HttpTransport as H, type PriceEvaluationIssue as I, type JsonObject as J, type PriceEvaluationLine as K, type PriceRule as L, type ModelSchema as M, type NexraSettlement as N, type UsageComponentEvidence as O, type PriceEvaluation as P, type UsageEvidenceAssessment as Q, type UsageEvidenceStatus as R, allocateDiscountedPriceLines as S, type TaskModelSummary as T, type UnifiedMediaGeometry as U, applyMediaGeometry as V, assessUsageEvidence as W, decodeMediaGeometry as X, encodeMediaGeometry as Y, evaluatePriceRule as Z, getModelSpec as _, type JsonValue as a, listModelSpecs as a0, projectMediaGeometry as a1, queryString as a2, sleep as a3, validateMeteringContract as a4, validateNormalizedUsage as a5, validatePriceRule as a6, 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 };
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-DLTP5_Ri.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 NexraSalePriceList, G as NormalizedUsageV1, P as PriceEvaluation, I as PriceEvaluationIssue, K as PriceEvaluationLine, L as PriceRule, U as UnifiedMediaGeometry, O as UsageComponentEvidence, Q as UsageEvidenceAssessment, R as UsageEvidenceStatus, S as allocateDiscountedPriceLines, V as applyMediaGeometry, W as assessUsageEvidence, X as decodeMediaGeometry, Y as encodeMediaGeometry, Z as evaluatePriceRule, _ as getModelSpec, $ as jsonBody, a0 as listModelSpecs, a1 as projectMediaGeometry, a2 as queryString, a3 as sleep, a4 as validateMeteringContract, a5 as validateNormalizedUsage, a6 as validatePriceRule } from './index-DLTP5_Ri.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> {
@@ -647,6 +649,8 @@ interface RequestDetails {
647
649
  model: string | null;
648
650
  operation: string | null;
649
651
  status: string;
652
+ /** Linked Task lifecycle when this request accepted a Task; HTTP `status` stays accepted. */
653
+ taskStatus?: string | null;
650
654
  httpStatus: number | null;
651
655
  errorCode: string | null;
652
656
  /** HTTP duration, never substituted with asynchronous task duration. */
@@ -920,6 +924,10 @@ declare const SANDBOX_OPERATIONS: readonly [{
920
924
  readonly id: "text-to-music";
921
925
  readonly modality: "audio";
922
926
  readonly label: "音乐生成";
927
+ }, {
928
+ readonly id: "multimodal-to-video";
929
+ readonly modality: "video";
930
+ readonly label: "全能参考生";
923
931
  }, {
924
932
  readonly id: "text-to-video";
925
933
  readonly modality: "video";
@@ -928,10 +936,6 @@ declare const SANDBOX_OPERATIONS: readonly [{
928
936
  readonly id: "image-to-video";
929
937
  readonly modality: "video";
930
938
  readonly label: "首尾帧生成视频";
931
- }, {
932
- readonly id: "multimodal-to-video";
933
- readonly modality: "video";
934
- readonly label: "全能参考生";
935
939
  }, {
936
940
  readonly id: "text-to-image";
937
941
  readonly modality: "image";
@@ -958,6 +962,10 @@ declare function sandboxOperations(models: TaskModelSummary[]): ({
958
962
  readonly id: "text-to-music";
959
963
  readonly modality: "audio";
960
964
  readonly label: "音乐生成";
965
+ } | {
966
+ readonly id: "multimodal-to-video";
967
+ readonly modality: "video";
968
+ readonly label: "全能参考生";
961
969
  } | {
962
970
  readonly id: "text-to-video";
963
971
  readonly modality: "video";
@@ -966,10 +974,6 @@ declare function sandboxOperations(models: TaskModelSummary[]): ({
966
974
  readonly id: "image-to-video";
967
975
  readonly modality: "video";
968
976
  readonly label: "首尾帧生成视频";
969
- } | {
970
- readonly id: "multimodal-to-video";
971
- readonly modality: "video";
972
- readonly label: "全能参考生";
973
977
  } | {
974
978
  readonly id: "text-to-image";
975
979
  readonly modality: "image";
@@ -994,6 +998,19 @@ declare function adaptSandboxInput(schema: ModelSchema, mode: string, input: Jso
994
998
  /** Minimal operation form. Unsupported controls remain explicit provider defaults. */
995
999
  declare function sandboxInputSchema(schemas: ModelSchema[], mode: string): ModelSchema;
996
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
+
997
1014
  declare class AssetsClient {
998
1015
  private readonly transport;
999
1016
  constructor(transport: HttpTransport);
@@ -1091,4 +1108,4 @@ interface VerifyWebhookOptions {
1091
1108
  /** @deprecated Only verifies legacy signed webhooks, not callback_url notifications. */
1092
1109
  declare function verifyWebhook(request: Request, secret: string, options?: VerifyWebhookOptions): Promise<boolean>;
1093
1110
 
1094
- 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 };