@byte_fluffy/nexra-sdk 0.1.0-alpha.34 → 0.1.0-alpha.36
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/README.md +13 -0
- package/dist/catalog.js +2 -2
- package/dist/{chunk-R4BEO26Q.js → chunk-AAGTZN2G.js} +25 -0
- package/dist/{chunk-ZPOVSD7D.js → chunk-UOM4JX4G.js} +12 -14
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/language.js +3 -3
- package/dist/media.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/{voices-bcGBcfH-.d.ts → voices-CFRCuodH.d.ts} +18 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,19 @@ available from `@byte_fluffy/nexra-sdk/media`.
|
|
|
37
37
|
The default API base URL is `https://api.nexra-ai.com/v1`. When overriding
|
|
38
38
|
`baseUrl`, include the `/v1` API prefix.
|
|
39
39
|
|
|
40
|
+
## DeepSeek model identity correction
|
|
41
|
+
|
|
42
|
+
`0.1.0-alpha.36` replaces `ctyun/deepseek-v4-1-flash` with
|
|
43
|
+
`deepseek/deepseek-v4-1-flash`. Update model IDs in SDK calls, direct HTTP
|
|
44
|
+
requests, persisted selections and catalog caches. Upgrading the SDK does not
|
|
45
|
+
rewrite a hardcoded model ID. The previous public ID and `deepseek-v4.1-flash`
|
|
46
|
+
alias are retired; neither resolves in the new catalog.
|
|
47
|
+
|
|
48
|
+
The server rollout must apply migration `0056_deepseek_model_identity` before
|
|
49
|
+
syncing the new model definition. The model UUID, channel-specific upstream IDs,
|
|
50
|
+
routes, prices and original request history remain attached to the same model.
|
|
51
|
+
The API paths and native payload shapes remain unchanged.
|
|
52
|
+
|
|
40
53
|
## Error contract migration
|
|
41
54
|
|
|
42
55
|
`0.1.0-alpha.30` introduces the flat public error response and matching SDK
|
package/dist/catalog.js
CHANGED
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
listModelSpecs,
|
|
10
10
|
projectMediaGeometry,
|
|
11
11
|
resolveNexraLanguageReasoning
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-UOM4JX4G.js";
|
|
13
|
+
import "./chunk-AAGTZN2G.js";
|
|
14
14
|
export {
|
|
15
15
|
CatalogClient,
|
|
16
16
|
applyMediaGeometry,
|
|
@@ -694,6 +694,31 @@ function isTerminalTaskStatus(status) {
|
|
|
694
694
|
return status === "succeeded" || status === "failed" || status === "cancelled";
|
|
695
695
|
}
|
|
696
696
|
|
|
697
|
+
// ../contracts/src/usage-query-reference.ts
|
|
698
|
+
var USAGE_QUERY_LIST_FILTERS = [
|
|
699
|
+
"userIds",
|
|
700
|
+
"apiKeyIds",
|
|
701
|
+
"providerIds",
|
|
702
|
+
"channelIds",
|
|
703
|
+
"modelIds",
|
|
704
|
+
"operations",
|
|
705
|
+
"requestStatuses",
|
|
706
|
+
"usageSources",
|
|
707
|
+
"normalizationStatuses",
|
|
708
|
+
"ratingStatuses"
|
|
709
|
+
];
|
|
710
|
+
var USAGE_QUERY_PARAMETERS = [
|
|
711
|
+
"start",
|
|
712
|
+
"end",
|
|
713
|
+
"timeZoneOffsetMinutes",
|
|
714
|
+
"groupBy",
|
|
715
|
+
"limit",
|
|
716
|
+
"cursor",
|
|
717
|
+
...USAGE_QUERY_LIST_FILTERS,
|
|
718
|
+
"upstreamModelId",
|
|
719
|
+
"breakdown"
|
|
720
|
+
];
|
|
721
|
+
|
|
697
722
|
// ../contracts/src/admin-errors.ts
|
|
698
723
|
var CALL_ERROR_STATUSES = ["failed", "rejected", "delivery_failed"];
|
|
699
724
|
var CALL_ANOMALY_STATUSES = [...CALL_ERROR_STATUSES, "cancelled"];
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
normalizePublicErrorInput,
|
|
3
3
|
pickPublicErrorFields,
|
|
4
4
|
sortRatioDisplayOrder
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AAGTZN2G.js";
|
|
6
6
|
|
|
7
7
|
// src/catalog/generated/audio.generated.json
|
|
8
8
|
var audio_generated_default = [
|
|
@@ -7738,17 +7738,15 @@ var image_generated_default = [
|
|
|
7738
7738
|
// src/catalog/generated/language.generated.json
|
|
7739
7739
|
var language_generated_default = [
|
|
7740
7740
|
{
|
|
7741
|
-
id: "
|
|
7741
|
+
id: "deepseek/deepseek-v4-1-flash",
|
|
7742
7742
|
contractVersion: 1,
|
|
7743
7743
|
developer: "deepseek",
|
|
7744
7744
|
displayName: "DeepSeek V4.1 Flash",
|
|
7745
|
-
summary: "
|
|
7745
|
+
summary: "DeepSeek V4.1 Flash \u652F\u6301\u6587\u672C\u4E0E\u56FE\u50CF\u7406\u89E3\u3001\u63A8\u7406\u3001\u5DE5\u5177\u8C03\u7528\u548C\u7ED3\u6784\u5316\u8F93\u51FA\u3002",
|
|
7746
7746
|
kind: "language",
|
|
7747
7747
|
family: "DeepSeek V4 Flash",
|
|
7748
7748
|
versionLabel: "4.1 Flash",
|
|
7749
|
-
aliases: [
|
|
7750
|
-
"deepseek-v4.1-flash"
|
|
7751
|
-
],
|
|
7749
|
+
aliases: [],
|
|
7752
7750
|
capabilities: {
|
|
7753
7751
|
inputModalities: [
|
|
7754
7752
|
"text",
|
|
@@ -7845,9 +7843,9 @@ var language_generated_default = [
|
|
|
7845
7843
|
type: "string",
|
|
7846
7844
|
description: "Nexra \u516C\u5171\u6A21\u578B ID\uFF0C\u5FC5\u987B\u4E0E\u5916\u5C42 modelId \u76F8\u540C\u3002",
|
|
7847
7845
|
title: "\u6A21\u578B ID",
|
|
7848
|
-
const: "
|
|
7846
|
+
const: "deepseek/deepseek-v4-1-flash",
|
|
7849
7847
|
examples: [
|
|
7850
|
-
"
|
|
7848
|
+
"deepseek/deepseek-v4-1-flash"
|
|
7851
7849
|
]
|
|
7852
7850
|
},
|
|
7853
7851
|
messages: {
|
|
@@ -7996,7 +7994,7 @@ var language_generated_default = [
|
|
|
7996
7994
|
},
|
|
7997
7995
|
outputSchema: {
|
|
7998
7996
|
type: "object",
|
|
7999
|
-
description: "\
|
|
7997
|
+
description: "\u534F\u8BAE\u539F\u751F Chat Completions \u54CD\u5E94\uFF1Bstream=true \u65F6\u8FD4\u56DE SSE\u3002",
|
|
8000
7998
|
additionalProperties: true
|
|
8001
7999
|
}
|
|
8002
8000
|
},
|
|
@@ -8021,9 +8019,9 @@ var language_generated_default = [
|
|
|
8021
8019
|
type: "string",
|
|
8022
8020
|
description: "Nexra \u516C\u5171\u6A21\u578B ID\uFF0C\u5FC5\u987B\u4E0E\u5916\u5C42 modelId \u76F8\u540C\u3002",
|
|
8023
8021
|
title: "\u6A21\u578B ID",
|
|
8024
|
-
const: "
|
|
8022
|
+
const: "deepseek/deepseek-v4-1-flash",
|
|
8025
8023
|
examples: [
|
|
8026
|
-
"
|
|
8024
|
+
"deepseek/deepseek-v4-1-flash"
|
|
8027
8025
|
]
|
|
8028
8026
|
},
|
|
8029
8027
|
messages: {
|
|
@@ -8189,7 +8187,7 @@ var language_generated_default = [
|
|
|
8189
8187
|
},
|
|
8190
8188
|
outputSchema: {
|
|
8191
8189
|
type: "object",
|
|
8192
|
-
description: "\
|
|
8190
|
+
description: "\u534F\u8BAE\u539F\u751F Messages \u54CD\u5E94\uFF1Bstream=true \u65F6\u8FD4\u56DE Anthropic SSE\u3002",
|
|
8193
8191
|
additionalProperties: true
|
|
8194
8192
|
}
|
|
8195
8193
|
}
|
|
@@ -50897,7 +50895,7 @@ var NexraWaitTimeoutError = class extends Error {
|
|
|
50897
50895
|
};
|
|
50898
50896
|
|
|
50899
50897
|
// src/generated/version.generated.ts
|
|
50900
|
-
var SDK_VERSION = "0.1.0-alpha.
|
|
50898
|
+
var SDK_VERSION = "0.1.0-alpha.36";
|
|
50901
50899
|
|
|
50902
50900
|
// src/transport.ts
|
|
50903
50901
|
var DEFAULT_BASE_URL = "https://api.nexra-ai.com/v1";
|
|
@@ -51160,7 +51158,7 @@ var productDisplayNames = /* @__PURE__ */ new Map([
|
|
|
51160
51158
|
["bytedance/doubao-seedream-5-0-pro-260628", "Seedream 5.0 Pro"],
|
|
51161
51159
|
["bytedance/doubao-tts-v1", "Doubao TTS v1"],
|
|
51162
51160
|
["bytedance/doubao-tts-v2", "Doubao TTS v2"],
|
|
51163
|
-
["
|
|
51161
|
+
["deepseek/deepseek-v4-1-flash", "DeepSeek V4.1 Flash"],
|
|
51164
51162
|
["elevenlabs/eleven_flash_v2_5", "ElevenLabs Flash v2.5"],
|
|
51165
51163
|
["elevenlabs/eleven_multilingual_v2", "ElevenLabs Multilingual v2"],
|
|
51166
51164
|
["fish-audio/s1", "Fish Audio S1"],
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { C as CursorPage, J as JsonValue } from './json-Cz0MkWQn.js';
|
|
|
5
5
|
export { a as JsonObject, b as JsonPrimitive } from './json-Cz0MkWQn.js';
|
|
6
6
|
import { N as NexraError, P as PublicErrorFields } from './errors-DZlSwyv8.js';
|
|
7
7
|
export { A as ApiErrorPayload, a as PublicError, b as PublicErrorContext } from './errors-DZlSwyv8.js';
|
|
8
|
-
import { V as Voice, C as CreateVoiceRequest, a as VoiceCreation, A as AssetsClient, T as TasksClient, R as RunTaskOptions, b as RunResult, c as TaskResult } from './voices-
|
|
9
|
-
export { d as CreateTaskOptions, e as CreateTaskRequest, f as RequestDetails, g as TASK_STATUSES, h as TaskCost, i as TaskError, j as TaskEvent, k as TaskEventType, l as TaskListParams, m as TaskPage, n as TaskProgress, o as TaskReceipt, p as TaskStatus, q as TaskTiming, r as TaskUsage, s as TaskWebhookConfig, t as TerminalTaskStatus, u as VerifyWebhookOptions, W as WaitTaskOptions, v as WatchTaskOptions, w as isTerminalTaskStatus, x as verifyWebhook } from './voices-
|
|
8
|
+
import { V as Voice, C as CreateVoiceRequest, a as VoiceCreation, A as AssetsClient, T as TasksClient, R as RunTaskOptions, b as RunResult, c as TaskResult } from './voices-CFRCuodH.js';
|
|
9
|
+
export { d as CreateTaskOptions, e as CreateTaskRequest, f as RequestDetails, g as TASK_STATUSES, h as TaskCost, i as TaskError, j as TaskEvent, k as TaskEventType, l as TaskListParams, m as TaskPage, n as TaskProgress, o as TaskReceipt, p as TaskStatus, q as TaskTiming, r as TaskUsage, s as TaskWebhookConfig, t as TerminalTaskStatus, u as VerifyWebhookOptions, W as WaitTaskOptions, v as WatchTaskOptions, w as isTerminalTaskStatus, x as verifyWebhook } from './voices-CFRCuodH.js';
|
|
10
10
|
import { CatalogClient } from './catalog.js';
|
|
11
11
|
export { formatModelDisplayName, getModelSpec, listModelSpecs } from './catalog.js';
|
|
12
12
|
export { ceilDecimal, multiplyDecimal } from './decimal.js';
|
package/dist/index.js
CHANGED
|
@@ -20,13 +20,13 @@ import {
|
|
|
20
20
|
projectMediaGeometry,
|
|
21
21
|
queryString,
|
|
22
22
|
sleep
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-UOM4JX4G.js";
|
|
24
24
|
import {
|
|
25
25
|
MEDIA_KINDS,
|
|
26
26
|
TASK_STATUSES,
|
|
27
27
|
createTaskRequest,
|
|
28
28
|
isTerminalTaskStatus
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-AAGTZN2G.js";
|
|
30
30
|
|
|
31
31
|
// src/assets.ts
|
|
32
32
|
var AssetsClient = class {
|
package/dist/language.js
CHANGED
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
jsonBody,
|
|
7
7
|
parseServerSentEvents,
|
|
8
8
|
resolveNexraLanguageReasoning
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UOM4JX4G.js";
|
|
10
10
|
import {
|
|
11
11
|
isPublicErrorCode,
|
|
12
12
|
publicErrorMessage,
|
|
13
13
|
resolvePublicErrorLocale
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-AAGTZN2G.js";
|
|
15
15
|
|
|
16
16
|
// src/language/index.ts
|
|
17
17
|
import { createAnthropic } from "@ai-sdk/anthropic";
|
|
@@ -177,7 +177,7 @@ function chatRequest(binding, options, stream) {
|
|
|
177
177
|
if (tool.type !== "function") throw new UnsupportedFunctionalityError({ functionality: "provider tools in Chat Completions" });
|
|
178
178
|
return { type: "function", function: { name: tool.name, description: tool.description, parameters: tool.inputSchema, ...tool.strict !== void 0 ? { strict: tool.strict } : {} } };
|
|
179
179
|
});
|
|
180
|
-
const choice = options.toolChoice;
|
|
180
|
+
const choice = tools?.length ? options.toolChoice : void 0;
|
|
181
181
|
return {
|
|
182
182
|
...extension.max_completion_tokens === void 0 ? { max_tokens: options.maxOutputTokens } : {},
|
|
183
183
|
temperature: options.temperature,
|
package/dist/media.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export { A as AssetImportRequest, a as AssetInput, b as AssetReference, c as Ass
|
|
|
2
2
|
export { C as CreateNexraDisplayQuoteBatchRequest, d as CreateNexraQuoteRequest, F as FetchLike, e as MediaGeometryField, f as MediaGeometryProjection, g as ModelCapabilitySummary, h as ModelDateVersion, i as ModelEndpointSummary, j as ModelModality, c as ModelResourceList, k as ModelResourceOption, b as ModelSchema, M as ModelSearchParams, l as NexraBillingCurrency, m as NexraCatalogRevision, N as NexraClientOptions, n as NexraDisplayQuoteBatch, o as NexraDisplayQuoteBatchEntry, p as NexraModelOperation, q as NexraModelSpec, r as NexraModelSpecFilter, s as NexraQuote, t as NexraSalePrice, u as NexraSalePriceList, v as NexraSettlement, a as TaskModel, T as TaskModelSummary, U as UnifiedMediaGeometry } from './media-geometry-DAVFGry1.js';
|
|
3
3
|
export { C as CursorPage, a as JsonObject, b as JsonPrimitive, J as JsonValue } from './json-Cz0MkWQn.js';
|
|
4
4
|
export { A as ApiErrorPayload, N as NexraError, a as PublicError, b as PublicErrorContext, P as PublicErrorFields } from './errors-DZlSwyv8.js';
|
|
5
|
-
export { d as CreateTaskOptions, e as CreateTaskRequest, C as CreateVoiceRequest, f as RequestDetails, b as RunResult, R as RunTaskOptions, c as Task, h as TaskCost, i as TaskError, j as TaskEvent, k as TaskEventType, l as TaskListParams, m as TaskPage, n as TaskProgress, o as TaskReceipt, c as TaskResult, p as TaskStatus, q as TaskTiming, r as TaskUsage, s as TaskWebhookConfig, t as TerminalTaskStatus, u as VerifyWebhookOptions, V as Voice, a as VoiceCreation, W as WaitTaskOptions, v as WatchTaskOptions } from './voices-
|
|
5
|
+
export { d as CreateTaskOptions, e as CreateTaskRequest, C as CreateVoiceRequest, f as RequestDetails, b as RunResult, R as RunTaskOptions, c as Task, h as TaskCost, i as TaskError, j as TaskEvent, k as TaskEventType, l as TaskListParams, m as TaskPage, n as TaskProgress, o as TaskReceipt, c as TaskResult, p as TaskStatus, q as TaskTiming, r as TaskUsage, s as TaskWebhookConfig, t as TerminalTaskStatus, u as VerifyWebhookOptions, V as Voice, a as VoiceCreation, W as WaitTaskOptions, v as WatchTaskOptions } from './voices-CFRCuodH.js';
|
|
@@ -62,6 +62,16 @@ declare function verifyWebhook(request: Request, secret: string, options?: Verif
|
|
|
62
62
|
|
|
63
63
|
type TaskPage<TOutput = JsonValue> = CursorPage<TaskResult<TOutput>>;
|
|
64
64
|
|
|
65
|
+
declare const REQUEST_HISTORY_MODALITIES: readonly ["image", "video", "audio", "language"];
|
|
66
|
+
declare const REQUEST_HISTORY_KINDS: readonly ["task", "api"];
|
|
67
|
+
declare const REQUEST_HISTORY_DISPLAY_STATUSES: readonly ["succeeded", "failed", "delivery_failed", "running"];
|
|
68
|
+
type RequestHistoryFilters = Readonly<{
|
|
69
|
+
query?: string;
|
|
70
|
+
modality?: typeof REQUEST_HISTORY_MODALITIES[number];
|
|
71
|
+
kind?: typeof REQUEST_HISTORY_KINDS[number];
|
|
72
|
+
displayStatus?: typeof REQUEST_HISTORY_DISPLAY_STATUSES[number];
|
|
73
|
+
}>;
|
|
74
|
+
|
|
65
75
|
declare const TASK_STATUSES: readonly ["queued", "running", "succeeded", "failed", "cancelling", "cancelled"];
|
|
66
76
|
type TaskStatus = (typeof TASK_STATUSES)[number];
|
|
67
77
|
type TerminalTaskStatus = "succeeded" | "failed" | "cancelled";
|
|
@@ -83,6 +93,7 @@ interface TaskCost {
|
|
|
83
93
|
amount: string;
|
|
84
94
|
currency: string;
|
|
85
95
|
}
|
|
96
|
+
type TaskBillingReason = "request_failed" | "request_cancelled" | "billing_usage_unavailable" | "billing_usage_invalid" | "billing_usage_incomplete" | "billing_evidence_invalid" | "billing_evidence_incomplete" | "billing_hold_unavailable" | "billing_price_unavailable" | "billing_pricing_unavailable";
|
|
86
97
|
interface TaskQueueSnapshot {
|
|
87
98
|
phase: "waiting_capacity" | "waiting_channel" | "dispatch_pending";
|
|
88
99
|
since: string;
|
|
@@ -154,6 +165,8 @@ interface Task<TOutput = JsonValue> extends PublicErrorFields {
|
|
|
154
165
|
cost?: TaskCost;
|
|
155
166
|
/** Customer billing state; absent on older servers. */
|
|
156
167
|
billingStatus?: "pending" | "succeeded" | "failed" | "refunded" | "unavailable";
|
|
168
|
+
/** Safe read-only cause; execution failures release authorization rather than failing settlement. */
|
|
169
|
+
billingReason?: TaskBillingReason;
|
|
157
170
|
/** Final customer sale settlement. Provider procurement cost is never exposed here. */
|
|
158
171
|
settlement?: NexraSettlement;
|
|
159
172
|
/**
|
|
@@ -207,10 +220,13 @@ interface RequestDetails extends PublicErrorFields {
|
|
|
207
220
|
timing?: TaskTiming;
|
|
208
221
|
cost?: TaskCost;
|
|
209
222
|
billingStatus?: Task["billingStatus"];
|
|
223
|
+
billingReason?: Task["billingReason"];
|
|
210
224
|
settlement?: NexraSettlement;
|
|
211
225
|
metadata?: JsonObject;
|
|
212
226
|
/** Caller-asserted origin extracted from metadata.callerUrl; diagnostics display only. */
|
|
213
227
|
callerUrl?: string | null;
|
|
228
|
+
/** Client address recorded at the trusted HTTP ingress; absent on historical requests. */
|
|
229
|
+
clientIp?: string | null;
|
|
214
230
|
/** Caller-asserted end-user identifier extracted from metadata.endUserId; diagnostics display only. */
|
|
215
231
|
endUserId?: string | null;
|
|
216
232
|
/** Name of the API key that authenticated this request; diagnostics display only. */
|
|
@@ -269,11 +285,12 @@ type CreateTaskControls = Readonly<{
|
|
|
269
285
|
* is deliberately not an envelope. Persistent Task records still retain their
|
|
270
286
|
* own `input` snapshot after the HTTP boundary separates control fields. */
|
|
271
287
|
type CreateTaskRequest<TInput extends JsonObject = JsonObject> = TInput & CreateTaskControls;
|
|
272
|
-
interface TaskListParams {
|
|
288
|
+
interface TaskListParams extends RequestHistoryFilters {
|
|
273
289
|
status?: TaskStatus;
|
|
274
290
|
model?: string;
|
|
275
291
|
limit?: number;
|
|
276
292
|
cursor?: string;
|
|
293
|
+
orphanOnly?: boolean;
|
|
277
294
|
}
|
|
278
295
|
interface RunResult<TOutput = JsonValue> {
|
|
279
296
|
taskId: string;
|