@byte_fluffy/nexra-sdk 0.1.0-alpha.22 → 0.1.0-alpha.24
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 +12 -11
- package/dist/assets-dUJMQNJD.d.ts +61 -0
- package/dist/catalog.d.ts +3 -2
- package/dist/catalog.js +2 -1
- package/dist/{chunk-2DKVYO26.js → chunk-7V2P2UQD.js} +11268 -16548
- package/dist/chunk-TA3YGQQY.js +386 -0
- package/dist/index.d.ts +8 -5
- package/dist/index.js +16 -23
- package/dist/json-Drjj1OKl.d.ts +11 -0
- package/dist/{media-geometry-Ckr1-Mh3.d.ts → media-geometry-Bo6ukeIQ.d.ts} +34 -21
- package/dist/media.d.ts +200 -0
- package/dist/media.js +26 -0
- package/dist/{types-CcYROaH1.d.ts → types-DPLgTh8D.d.ts} +29 -76
- package/dist/types.d.ts +4 -2
- package/package.json +5 -1
package/dist/media.d.ts
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { A as AssetReference } from './assets-dUJMQNJD.js';
|
|
2
|
+
import { J as JsonObject } from './json-Drjj1OKl.js';
|
|
3
|
+
|
|
4
|
+
declare const NEXRA_MEDIA_API_VERSION: 1;
|
|
5
|
+
/** Catalog-level generation taxonomy. Text keeps its native endpoint protocols. */
|
|
6
|
+
declare const NEXRA_GENERATION_OPERATIONS: readonly ["text.generate", "image.generate", "video.generate", "audio.generate", "image.upscale", "video.upscale"];
|
|
7
|
+
type NexraGenerationOperation = (typeof NEXRA_GENERATION_OPERATIONS)[number];
|
|
8
|
+
declare const NEXRA_MEDIA_OPERATIONS: readonly ["image.generate", "video.generate", "audio.generate", "image.upscale", "video.upscale"];
|
|
9
|
+
type NexraMediaOperation = (typeof NEXRA_MEDIA_OPERATIONS)[number];
|
|
10
|
+
declare const NEXRA_PUBLISHED_MEDIA_OPERATIONS: readonly ["image.generate", "video.generate", "audio.generate", "image.upscale"];
|
|
11
|
+
type NexraPublishedMediaOperation = (typeof NEXRA_PUBLISHED_MEDIA_OPERATIONS)[number];
|
|
12
|
+
declare const NEXRA_MEDIA_FEATURES: readonly ["text-to-image", "image-to-image", "image-reference", "image-edit", "image-inpaint", "image-control", "text-to-video", "first-frame", "first-last-frame", "image-to-video", "video-to-video", "audio-to-video", "avatar-video", "reference-image", "reference-video", "reference-audio", "omni-reference", "tts", "music", "sfx", "voice-reference", "scale-factor", "target-resolution"];
|
|
13
|
+
type NexraMediaFeature = (typeof NEXRA_MEDIA_FEATURES)[number];
|
|
14
|
+
/** JSON wire locator. SDK-only Blob/File support is normalized into one of these forms. */
|
|
15
|
+
type NexraMediaSource = string | AssetReference;
|
|
16
|
+
type NexraTextRole = "prompt" | "negative_prompt" | "script" | "lyrics";
|
|
17
|
+
type NexraImageRole = "source" | "reference" | "first_frame" | "last_frame" | "mask" | "control" | "subject" | "background";
|
|
18
|
+
type NexraVideoRole = "source" | "reference" | "edit" | "extend";
|
|
19
|
+
type NexraAudioRole = "source" | "reference" | "voice_reference";
|
|
20
|
+
type NexraTextContentPart = Readonly<{
|
|
21
|
+
type: "text";
|
|
22
|
+
text: string;
|
|
23
|
+
role?: NexraTextRole;
|
|
24
|
+
}>;
|
|
25
|
+
type NexraImageContentPart = Readonly<{
|
|
26
|
+
type: "image";
|
|
27
|
+
source: NexraMediaSource;
|
|
28
|
+
role?: NexraImageRole;
|
|
29
|
+
/** Stable prompt reference name for models that address media as `@name`. */
|
|
30
|
+
name?: string;
|
|
31
|
+
}>;
|
|
32
|
+
type NexraVideoContentPart = Readonly<{
|
|
33
|
+
type: "video";
|
|
34
|
+
source: NexraMediaSource;
|
|
35
|
+
role?: NexraVideoRole;
|
|
36
|
+
}>;
|
|
37
|
+
type NexraAudioContentPart = Readonly<{
|
|
38
|
+
type: "audio";
|
|
39
|
+
source: NexraMediaSource;
|
|
40
|
+
role?: NexraAudioRole;
|
|
41
|
+
}>;
|
|
42
|
+
type NexraMediaContentPart = NexraTextContentPart | NexraImageContentPart | NexraVideoContentPart | NexraAudioContentPart;
|
|
43
|
+
type NexraDraftContentPart = Readonly<{
|
|
44
|
+
type: "draft_task";
|
|
45
|
+
draft_task: Readonly<{
|
|
46
|
+
id: string;
|
|
47
|
+
}>;
|
|
48
|
+
}>;
|
|
49
|
+
type NexraImageGenerateInput = Readonly<{
|
|
50
|
+
content: readonly (NexraTextContentPart | NexraImageContentPart)[];
|
|
51
|
+
aspect_ratio?: string;
|
|
52
|
+
resolution?: string;
|
|
53
|
+
quality?: string;
|
|
54
|
+
count?: number;
|
|
55
|
+
output_format?: string;
|
|
56
|
+
seed?: number;
|
|
57
|
+
}>;
|
|
58
|
+
type NexraVideoGenerateInput = Readonly<{
|
|
59
|
+
content: readonly (NexraMediaContentPart | NexraDraftContentPart)[];
|
|
60
|
+
draft?: boolean;
|
|
61
|
+
/** Optional preset or cloned voice used by talking-avatar video models. */
|
|
62
|
+
voice?: string;
|
|
63
|
+
aspect_ratio?: string;
|
|
64
|
+
resolution?: string;
|
|
65
|
+
quality?: string;
|
|
66
|
+
duration?: number;
|
|
67
|
+
generate_audio?: boolean;
|
|
68
|
+
output_format?: string;
|
|
69
|
+
seed?: number;
|
|
70
|
+
}>;
|
|
71
|
+
type NexraAudioGenerateInput = Readonly<{
|
|
72
|
+
content: readonly (NexraTextContentPart | NexraAudioContentPart)[];
|
|
73
|
+
voice?: string;
|
|
74
|
+
language?: string;
|
|
75
|
+
duration?: number;
|
|
76
|
+
output_format?: string;
|
|
77
|
+
sample_rate?: number;
|
|
78
|
+
speed?: number;
|
|
79
|
+
volume?: number;
|
|
80
|
+
pitch?: number;
|
|
81
|
+
emotion?: string;
|
|
82
|
+
instrumental?: boolean;
|
|
83
|
+
loop?: boolean;
|
|
84
|
+
prompt_influence?: number;
|
|
85
|
+
seed?: number;
|
|
86
|
+
}>;
|
|
87
|
+
type NexraImageUpscaleInput = Readonly<{
|
|
88
|
+
content: readonly [NexraImageContentPart];
|
|
89
|
+
scale?: number;
|
|
90
|
+
resolution?: string;
|
|
91
|
+
output_format?: string;
|
|
92
|
+
preserve_details?: boolean;
|
|
93
|
+
}>;
|
|
94
|
+
type NexraVideoUpscaleInput = Readonly<{
|
|
95
|
+
content: readonly [NexraVideoContentPart];
|
|
96
|
+
scale?: number;
|
|
97
|
+
resolution?: string;
|
|
98
|
+
output_format?: string;
|
|
99
|
+
preserve_details?: boolean;
|
|
100
|
+
}>;
|
|
101
|
+
type NexraMediaInputByOperation = Readonly<{
|
|
102
|
+
"image.generate": NexraImageGenerateInput;
|
|
103
|
+
"video.generate": NexraVideoGenerateInput;
|
|
104
|
+
"audio.generate": NexraAudioGenerateInput;
|
|
105
|
+
"image.upscale": NexraImageUpscaleInput;
|
|
106
|
+
"video.upscale": NexraVideoUpscaleInput;
|
|
107
|
+
}>;
|
|
108
|
+
type NexraMediaKind = "image" | "video" | "audio";
|
|
109
|
+
type NexraMediaInputSlot = Readonly<{
|
|
110
|
+
mediaKind: NexraMediaKind;
|
|
111
|
+
role: string;
|
|
112
|
+
min?: number;
|
|
113
|
+
max: number;
|
|
114
|
+
maxBytes?: number;
|
|
115
|
+
minDurationSeconds?: number;
|
|
116
|
+
maxDurationSeconds?: number;
|
|
117
|
+
}>;
|
|
118
|
+
type NexraMediaInputMode = Readonly<{
|
|
119
|
+
id: string;
|
|
120
|
+
slots: readonly NexraMediaInputSlot[];
|
|
121
|
+
}>;
|
|
122
|
+
type NexraMediaParameterValue = string | number | boolean;
|
|
123
|
+
type NexraMediaParameter = Readonly<{
|
|
124
|
+
key: string;
|
|
125
|
+
label?: string;
|
|
126
|
+
}> & (Readonly<{
|
|
127
|
+
kind: "enum";
|
|
128
|
+
options: readonly NexraMediaParameterValue[];
|
|
129
|
+
default: NexraMediaParameterValue;
|
|
130
|
+
allowCustom?: boolean;
|
|
131
|
+
}> | Readonly<{
|
|
132
|
+
kind: "range";
|
|
133
|
+
min: number;
|
|
134
|
+
max: number;
|
|
135
|
+
step: number;
|
|
136
|
+
default: number;
|
|
137
|
+
autoValue?: number;
|
|
138
|
+
unit?: string;
|
|
139
|
+
}> | Readonly<{
|
|
140
|
+
kind: "toggle";
|
|
141
|
+
default: boolean;
|
|
142
|
+
}> | Readonly<{
|
|
143
|
+
kind: "resource";
|
|
144
|
+
resource: "voice";
|
|
145
|
+
default?: string;
|
|
146
|
+
allowCustom?: boolean;
|
|
147
|
+
}>);
|
|
148
|
+
type NexraMediaParameterConstraint = Readonly<{
|
|
149
|
+
when: Readonly<Record<string, NexraMediaParameterValue | readonly NexraMediaParameterValue[]>>;
|
|
150
|
+
parameter: string;
|
|
151
|
+
allowedValues?: readonly NexraMediaParameterValue[];
|
|
152
|
+
fixedValue?: NexraMediaParameterValue;
|
|
153
|
+
disabled?: boolean;
|
|
154
|
+
}>;
|
|
155
|
+
type NexraMediaOperationDefinition = Readonly<{
|
|
156
|
+
operation: NexraMediaOperation;
|
|
157
|
+
status: "active" | "hold";
|
|
158
|
+
outputKind: NexraMediaKind;
|
|
159
|
+
features: readonly NexraMediaFeature[];
|
|
160
|
+
parameterKeys: readonly string[];
|
|
161
|
+
}>;
|
|
162
|
+
declare const NEXRA_MEDIA_OPERATION_DEFINITIONS: readonly [{
|
|
163
|
+
readonly operation: "image.generate";
|
|
164
|
+
readonly status: "active";
|
|
165
|
+
readonly outputKind: "image";
|
|
166
|
+
readonly features: readonly ["text-to-image", "image-to-image", "image-reference", "image-edit", "image-inpaint", "image-control"];
|
|
167
|
+
readonly parameterKeys: readonly ["aspect_ratio", "resolution", "quality", "count", "output_format", "seed"];
|
|
168
|
+
}, {
|
|
169
|
+
readonly operation: "video.generate";
|
|
170
|
+
readonly status: "active";
|
|
171
|
+
readonly outputKind: "video";
|
|
172
|
+
readonly features: readonly ["text-to-video", "first-frame", "first-last-frame", "image-to-video", "video-to-video", "audio-to-video", "avatar-video", "reference-image", "reference-video", "reference-audio", "omni-reference"];
|
|
173
|
+
readonly parameterKeys: readonly ["voice", "aspect_ratio", "resolution", "quality", "duration", "generate_audio", "output_format", "seed"];
|
|
174
|
+
}, {
|
|
175
|
+
readonly operation: "audio.generate";
|
|
176
|
+
readonly status: "active";
|
|
177
|
+
readonly outputKind: "audio";
|
|
178
|
+
readonly features: readonly ["tts", "music", "sfx", "voice-reference"];
|
|
179
|
+
readonly parameterKeys: readonly ["voice", "language", "duration", "output_format", "sample_rate", "speed", "volume", "pitch", "emotion", "instrumental", "loop", "prompt_influence", "seed"];
|
|
180
|
+
}, {
|
|
181
|
+
readonly operation: "image.upscale";
|
|
182
|
+
readonly status: "active";
|
|
183
|
+
readonly outputKind: "image";
|
|
184
|
+
readonly features: readonly ["scale-factor", "target-resolution"];
|
|
185
|
+
readonly parameterKeys: readonly ["scale", "resolution", "output_format", "preserve_details"];
|
|
186
|
+
}, {
|
|
187
|
+
readonly operation: "video.upscale";
|
|
188
|
+
readonly status: "hold";
|
|
189
|
+
readonly outputKind: "video";
|
|
190
|
+
readonly features: readonly ["scale-factor", "target-resolution"];
|
|
191
|
+
readonly parameterKeys: readonly ["scale", "resolution", "output_format", "preserve_details"];
|
|
192
|
+
}];
|
|
193
|
+
declare const NEXRA_MEDIA_INPUT_SCHEMAS: Readonly<Record<NexraPublishedMediaOperation, JsonObject>>;
|
|
194
|
+
declare function nexraMediaInputSchema(operation: NexraMediaOperation): JsonObject | undefined;
|
|
195
|
+
declare function isNexraMediaInput(value: unknown): value is JsonObject;
|
|
196
|
+
declare function nexraMediaOperationForMode(mode: string): NexraPublishedMediaOperation | undefined;
|
|
197
|
+
/** Narrow the shared category vocabulary for one Experience Center input mode. */
|
|
198
|
+
declare function nexraMediaInputSchemaForMode(mode: string): JsonObject | undefined;
|
|
199
|
+
|
|
200
|
+
export { NEXRA_GENERATION_OPERATIONS, NEXRA_MEDIA_API_VERSION, NEXRA_MEDIA_FEATURES, NEXRA_MEDIA_INPUT_SCHEMAS, NEXRA_MEDIA_OPERATIONS, NEXRA_MEDIA_OPERATION_DEFINITIONS, NEXRA_PUBLISHED_MEDIA_OPERATIONS, type NexraAudioContentPart, type NexraAudioGenerateInput, type NexraGenerationOperation, type NexraImageContentPart, type NexraImageGenerateInput, type NexraImageUpscaleInput, type NexraMediaContentPart, type NexraMediaFeature, type NexraMediaInputByOperation, type NexraMediaInputMode, type NexraMediaInputSlot, type NexraMediaKind, type NexraMediaOperation, type NexraMediaOperationDefinition, type NexraMediaParameter, type NexraMediaParameterConstraint, type NexraMediaSource, type NexraPublishedMediaOperation, type NexraTextContentPart, type NexraVideoContentPart, type NexraVideoGenerateInput, type NexraVideoUpscaleInput, isNexraMediaInput, nexraMediaInputSchema, nexraMediaInputSchemaForMode, nexraMediaOperationForMode };
|
package/dist/media.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NEXRA_GENERATION_OPERATIONS,
|
|
3
|
+
NEXRA_MEDIA_API_VERSION,
|
|
4
|
+
NEXRA_MEDIA_FEATURES,
|
|
5
|
+
NEXRA_MEDIA_INPUT_SCHEMAS,
|
|
6
|
+
NEXRA_MEDIA_OPERATIONS,
|
|
7
|
+
NEXRA_MEDIA_OPERATION_DEFINITIONS,
|
|
8
|
+
NEXRA_PUBLISHED_MEDIA_OPERATIONS,
|
|
9
|
+
isNexraMediaInput,
|
|
10
|
+
nexraMediaInputSchema,
|
|
11
|
+
nexraMediaInputSchemaForMode,
|
|
12
|
+
nexraMediaOperationForMode
|
|
13
|
+
} from "./chunk-TA3YGQQY.js";
|
|
14
|
+
export {
|
|
15
|
+
NEXRA_GENERATION_OPERATIONS,
|
|
16
|
+
NEXRA_MEDIA_API_VERSION,
|
|
17
|
+
NEXRA_MEDIA_FEATURES,
|
|
18
|
+
NEXRA_MEDIA_INPUT_SCHEMAS,
|
|
19
|
+
NEXRA_MEDIA_OPERATIONS,
|
|
20
|
+
NEXRA_MEDIA_OPERATION_DEFINITIONS,
|
|
21
|
+
NEXRA_PUBLISHED_MEDIA_OPERATIONS,
|
|
22
|
+
isNexraMediaInput,
|
|
23
|
+
nexraMediaInputSchema,
|
|
24
|
+
nexraMediaInputSchemaForMode,
|
|
25
|
+
nexraMediaOperationForMode
|
|
26
|
+
};
|
|
@@ -1,62 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type MediaKind = (typeof MEDIA_KINDS)[number];
|
|
5
|
-
type MediaAssetStatus = "pending" | "ready" | "failed" | "deleted";
|
|
6
|
-
interface MediaAsset {
|
|
7
|
-
id: string;
|
|
8
|
-
kind: MediaKind;
|
|
9
|
-
status: MediaAssetStatus;
|
|
10
|
-
source: "upload" | "generated" | "provider" | "imported";
|
|
11
|
-
name?: string;
|
|
12
|
-
mimeType?: string;
|
|
13
|
-
sizeBytes?: number;
|
|
14
|
-
width?: number;
|
|
15
|
-
height?: number;
|
|
16
|
-
durationMs?: number;
|
|
17
|
-
checksumSha256?: string;
|
|
18
|
-
url?: string;
|
|
19
|
-
downloadUrl?: string;
|
|
20
|
-
expiresAt?: string;
|
|
21
|
-
metadata?: JsonObject;
|
|
22
|
-
createdAt: string;
|
|
23
|
-
}
|
|
24
|
-
interface AssetReference {
|
|
25
|
-
assetId: string;
|
|
26
|
-
}
|
|
27
|
-
type AssetInput = AssetReference | Blob | File | MediaAsset | string | URL;
|
|
28
|
-
interface AssetUploadOptions {
|
|
29
|
-
kind?: MediaKind;
|
|
30
|
-
name?: string;
|
|
31
|
-
signal?: AbortSignal;
|
|
32
|
-
}
|
|
33
|
-
interface AssetImportRequest {
|
|
34
|
-
url: string;
|
|
35
|
-
kind?: MediaKind;
|
|
36
|
-
name?: string;
|
|
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
|
-
}
|
|
1
|
+
import { d as MediaAsset, c as AssetUploadOptions, a as AssetImportRequest, g as AssetCertificationRequest, h as AssetCertification, i as AssetCertificationWaitOptions } from './assets-dUJMQNJD.js';
|
|
2
|
+
import { l as NexraSettlement, H as HttpTransport } from './media-geometry-Bo6ukeIQ.js';
|
|
3
|
+
import { J as JsonObject, a as JsonValue, C as CursorPage } from './json-Drjj1OKl.js';
|
|
60
4
|
|
|
61
5
|
interface ApiErrorPayload {
|
|
62
6
|
error: {
|
|
@@ -243,12 +187,31 @@ interface TaskEvent {
|
|
|
243
187
|
occurredAt: string;
|
|
244
188
|
}
|
|
245
189
|
/** @deprecated Use CreateTaskRequest.callback_url. Kept for existing callers. */
|
|
246
|
-
|
|
190
|
+
type TaskWebhookConfig = JsonObject & Readonly<{
|
|
247
191
|
url: string;
|
|
248
192
|
/** Shared HMAC secret used to verify Nexra callback signatures. */
|
|
249
193
|
secret: string;
|
|
250
194
|
events?: Array<"completed">;
|
|
251
|
-
}
|
|
195
|
+
}>;
|
|
196
|
+
type CreateTaskControls = Readonly<{
|
|
197
|
+
/** @internal Console telemetry only: browser send time before uploads, not execution time. */
|
|
198
|
+
submittedAt?: string;
|
|
199
|
+
model: string;
|
|
200
|
+
/** Signed Nexra quote used to lock this input to a sale-price revision. */
|
|
201
|
+
quoteToken?: string;
|
|
202
|
+
/** Optional business identifiers such as orderId, available in request details. Do not include secrets. */
|
|
203
|
+
metadata?: JsonObject;
|
|
204
|
+
/** Platform completion callback, independent of provider callback support. Never sent upstream. */
|
|
205
|
+
callback_url?: string;
|
|
206
|
+
/** @deprecated Use callback_url; do not supply both. */
|
|
207
|
+
webhook?: TaskWebhookConfig;
|
|
208
|
+
/** @deprecated Compatibility check only; the server resolves the current contract. */
|
|
209
|
+
schemaVersion?: number;
|
|
210
|
+
}>;
|
|
211
|
+
/** Public Nexra Task request. Category parameters are top-level fields; `input`
|
|
212
|
+
* is deliberately not an envelope. Persistent Task records still retain their
|
|
213
|
+
* own `input` snapshot after the HTTP boundary separates control fields. */
|
|
214
|
+
type CreateTaskRequest<TInput extends JsonObject = JsonObject> = TInput & CreateTaskControls;
|
|
252
215
|
interface TaskListParams {
|
|
253
216
|
status?: TaskStatus;
|
|
254
217
|
model?: string;
|
|
@@ -279,8 +242,7 @@ declare class AssetsClient {
|
|
|
279
242
|
stream(asset: MediaAsset | string, signal?: AbortSignal): Promise<ReadableStream<Uint8Array>>;
|
|
280
243
|
}
|
|
281
244
|
|
|
282
|
-
interface CreateTaskOptions
|
|
283
|
-
input: TInput;
|
|
245
|
+
interface CreateTaskOptions {
|
|
284
246
|
quoteToken?: string;
|
|
285
247
|
submittedAt?: string;
|
|
286
248
|
metadata?: JsonObject;
|
|
@@ -291,15 +253,6 @@ interface CreateTaskOptions<TInput = Record<string, unknown>> {
|
|
|
291
253
|
idempotencyKey?: string;
|
|
292
254
|
signal?: AbortSignal;
|
|
293
255
|
}
|
|
294
|
-
type CreateTaskRequest<TInput extends Record<string, unknown> = Record<string, unknown>> = TInput & {
|
|
295
|
-
model: string;
|
|
296
|
-
quoteToken?: string;
|
|
297
|
-
submittedAt?: string;
|
|
298
|
-
metadata?: JsonObject;
|
|
299
|
-
callback_url?: string;
|
|
300
|
-
webhook?: TaskWebhookConfig;
|
|
301
|
-
schemaVersion?: number;
|
|
302
|
-
};
|
|
303
256
|
interface WatchTaskOptions {
|
|
304
257
|
signal?: AbortSignal;
|
|
305
258
|
lastEventId?: string;
|
|
@@ -310,20 +263,20 @@ interface WaitTaskOptions extends WatchTaskOptions {
|
|
|
310
263
|
pollIntervalMs?: number;
|
|
311
264
|
onEvent?: (event: TaskEvent) => void | Promise<void>;
|
|
312
265
|
}
|
|
313
|
-
interface RunTaskOptions
|
|
266
|
+
interface RunTaskOptions extends CreateTaskOptions, WaitTaskOptions {
|
|
314
267
|
cancelOnAbort?: boolean;
|
|
315
268
|
}
|
|
316
269
|
declare class TasksClient {
|
|
317
270
|
private readonly transport;
|
|
318
271
|
private readonly assets;
|
|
319
272
|
constructor(transport: HttpTransport, assets: AssetsClient);
|
|
320
|
-
create<TOutput = JsonValue, TInput = Record<string, unknown>>(model: string,
|
|
273
|
+
create<TOutput = JsonValue, TInput = Record<string, unknown>>(model: string, input: TInput, options?: CreateTaskOptions): Promise<TaskReceipt>;
|
|
321
274
|
get<TOutput = JsonValue>(taskId: string, signal?: AbortSignal): Promise<TaskResult<TOutput>>;
|
|
322
275
|
list<TOutput = JsonValue>(params?: TaskListParams, signal?: AbortSignal): Promise<CursorPage<TaskResult<TOutput>>>;
|
|
323
276
|
cancel<TOutput = JsonValue>(taskId: string, signal?: AbortSignal): Promise<TaskReceipt>;
|
|
324
277
|
watch(taskId: string, options?: WatchTaskOptions): AsyncGenerator<TaskEvent>;
|
|
325
278
|
wait<TOutput = JsonValue>(taskId: string, options?: WaitTaskOptions): Promise<TaskResult<TOutput>>;
|
|
326
|
-
run<TOutput = JsonValue, TInput = Record<string, unknown>>(model: string,
|
|
279
|
+
run<TOutput = JsonValue, TInput = Record<string, unknown>>(model: string, input: TInput, options?: RunTaskOptions): Promise<RunResult<TOutput>>;
|
|
327
280
|
}
|
|
328
281
|
|
|
329
282
|
interface VerifyWebhookOptions {
|
|
@@ -333,4 +286,4 @@ interface VerifyWebhookOptions {
|
|
|
333
286
|
/** @deprecated Only verifies legacy signed webhooks, not callback_url notifications. */
|
|
334
287
|
declare function verifyWebhook(request: Request, secret: string, options?: VerifyWebhookOptions): Promise<boolean>;
|
|
335
288
|
|
|
336
|
-
export { AssetsClient as A, type
|
|
289
|
+
export { AssetsClient as A, type CreateTaskOptions as C, type RunTaskOptions as R, TasksClient as T, type VerifyWebhookOptions as V, type WaitTaskOptions as W, type RunResult as a, type ApiErrorPayload as b, type TaskResult as c, type CreateTaskRequest as d, type RequestDetails as e, TASK_STATUSES as f, type Task as g, type TaskCost as h, type TaskError as i, type TaskEvent as j, type TaskEventType as k, type TaskListParams as l, type TaskPage as m, type TaskProgress as n, type TaskReceipt as o, type TaskStatus as p, type TaskTiming as q, type TaskUsage as r, type TaskWebhookConfig as s, type TerminalTaskStatus as t, type WatchTaskOptions as u, isTerminalTaskStatus as v, verifyWebhook as w };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { b as CreateNexraDisplayQuoteBatchRequest, C as CreateNexraQuoteRequest,
|
|
1
|
+
export { a as AssetImportRequest, b as AssetInput, A as AssetReference, c as AssetUploadOptions, d as MediaAsset, e as MediaAssetStatus, f as MediaKind } from './assets-dUJMQNJD.js';
|
|
2
|
+
export { b as CreateNexraDisplayQuoteBatchRequest, C as CreateNexraQuoteRequest, F as FetchLike, M as MediaGeometryField, g as MediaGeometryProjection, u as ModelCapabilitySummary, v as ModelDateVersion, w as ModelEndpointSummary, x as ModelModality, y as ModelResourceList, z as ModelResourceOption, s as ModelSchema, q as ModelSearchParams, h as NexraBillingCurrency, d as NexraCatalogRevision, t as NexraClientOptions, c as NexraDisplayQuoteBatch, A as NexraDisplayQuoteBatchEntry, j as NexraModelOperation, e as NexraModelSpec, f as NexraModelSpecFilter, a as NexraQuote, k as NexraSalePrice, N as NexraSalePriceList, l as NexraSettlement, r as TaskModel, T as TaskModelSummary, U as UnifiedMediaGeometry } from './media-geometry-Bo6ukeIQ.js';
|
|
3
|
+
export { C as CursorPage, J as JsonObject, b as JsonPrimitive, a as JsonValue } from './json-Drjj1OKl.js';
|
|
4
|
+
export { b as ApiErrorPayload, C as CreateTaskOptions, d as CreateTaskRequest, e as RequestDetails, a as RunResult, R as RunTaskOptions, g 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, V as VerifyWebhookOptions, W as WaitTaskOptions, u as WatchTaskOptions } from './types-DPLgTh8D.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byte_fluffy/nexra-sdk",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.24",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -32,6 +32,10 @@
|
|
|
32
32
|
"./types": {
|
|
33
33
|
"types": "./dist/types.d.ts",
|
|
34
34
|
"import": "./dist/types.js"
|
|
35
|
+
},
|
|
36
|
+
"./media": {
|
|
37
|
+
"types": "./dist/media.d.ts",
|
|
38
|
+
"import": "./dist/media.js"
|
|
35
39
|
}
|
|
36
40
|
},
|
|
37
41
|
"publishConfig": {
|