@nodaro/sdk 1.10.0 → 1.12.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.
- package/dist/index.cjs +10 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -3358,6 +3358,18 @@ interface CommonInput {
|
|
|
3358
3358
|
llmModel?: string;
|
|
3359
3359
|
/** Reasoning effort level (model-dependent). */
|
|
3360
3360
|
reasoningEffort?: string;
|
|
3361
|
+
/**
|
|
3362
|
+
* Gemini models only. Runs the request on the provider's own API so
|
|
3363
|
+
* `temperature`, `maxTokens` and the full reasoning range actually take
|
|
3364
|
+
* effect — on the default lane those levers are not reliably honoured.
|
|
3365
|
+
* Bills one credit tier up. A model without a direct lane returns
|
|
3366
|
+
* `400 advanced_mode_unsupported`.
|
|
3367
|
+
*/
|
|
3368
|
+
advancedMode?: boolean;
|
|
3369
|
+
/** Sampling temperature. Only honoured when `advancedMode` is true. */
|
|
3370
|
+
temperature?: number;
|
|
3371
|
+
/** Output token cap. Only honoured when `advancedMode` is true. */
|
|
3372
|
+
maxTokens?: number;
|
|
3361
3373
|
nodeContext?: WizardNodeContext;
|
|
3362
3374
|
userPreference?: string;
|
|
3363
3375
|
/** Associates this call with a workflow execution. Read server-side before Zod. */
|
|
@@ -4426,6 +4438,14 @@ interface ClientOptions {
|
|
|
4426
4438
|
fetch?: typeof fetch;
|
|
4427
4439
|
/** Default request timeout in ms. Default 60s. */
|
|
4428
4440
|
timeoutMs?: number;
|
|
4441
|
+
/**
|
|
4442
|
+
* Overrides the `X-Nodaro-Client` label. Defaults to `sdk/<version>`.
|
|
4443
|
+
*
|
|
4444
|
+
* Exists for `@nodaro/cli`, which is a wrapper AROUND this SDK: without an
|
|
4445
|
+
* override every CLI invocation would be recorded as an SDK call and the two
|
|
4446
|
+
* surfaces could never be told apart.
|
|
4447
|
+
*/
|
|
4448
|
+
clientLabel?: string;
|
|
4429
4449
|
}
|
|
4430
4450
|
interface RequestOptions {
|
|
4431
4451
|
body?: unknown;
|
|
@@ -4454,6 +4474,10 @@ declare class NodaroClient {
|
|
|
4454
4474
|
readonly baseUrl: string;
|
|
4455
4475
|
readonly auth: Auth;
|
|
4456
4476
|
readonly timeoutMs: number;
|
|
4477
|
+
/** Value sent as `X-Nodaro-Client`; recorded by the backend as job provenance. */
|
|
4478
|
+
readonly clientLabel: string;
|
|
4479
|
+
/** Whether to actually send it — see the note on {@link CLIENT_HEADER}. */
|
|
4480
|
+
private readonly sendClientHeader;
|
|
4457
4481
|
private readonly fetchOverride;
|
|
4458
4482
|
/**
|
|
4459
4483
|
* Resolved lazily so consumers can swap `globalThis.fetch` after the
|
package/dist/index.d.ts
CHANGED
|
@@ -3358,6 +3358,18 @@ interface CommonInput {
|
|
|
3358
3358
|
llmModel?: string;
|
|
3359
3359
|
/** Reasoning effort level (model-dependent). */
|
|
3360
3360
|
reasoningEffort?: string;
|
|
3361
|
+
/**
|
|
3362
|
+
* Gemini models only. Runs the request on the provider's own API so
|
|
3363
|
+
* `temperature`, `maxTokens` and the full reasoning range actually take
|
|
3364
|
+
* effect — on the default lane those levers are not reliably honoured.
|
|
3365
|
+
* Bills one credit tier up. A model without a direct lane returns
|
|
3366
|
+
* `400 advanced_mode_unsupported`.
|
|
3367
|
+
*/
|
|
3368
|
+
advancedMode?: boolean;
|
|
3369
|
+
/** Sampling temperature. Only honoured when `advancedMode` is true. */
|
|
3370
|
+
temperature?: number;
|
|
3371
|
+
/** Output token cap. Only honoured when `advancedMode` is true. */
|
|
3372
|
+
maxTokens?: number;
|
|
3361
3373
|
nodeContext?: WizardNodeContext;
|
|
3362
3374
|
userPreference?: string;
|
|
3363
3375
|
/** Associates this call with a workflow execution. Read server-side before Zod. */
|
|
@@ -4426,6 +4438,14 @@ interface ClientOptions {
|
|
|
4426
4438
|
fetch?: typeof fetch;
|
|
4427
4439
|
/** Default request timeout in ms. Default 60s. */
|
|
4428
4440
|
timeoutMs?: number;
|
|
4441
|
+
/**
|
|
4442
|
+
* Overrides the `X-Nodaro-Client` label. Defaults to `sdk/<version>`.
|
|
4443
|
+
*
|
|
4444
|
+
* Exists for `@nodaro/cli`, which is a wrapper AROUND this SDK: without an
|
|
4445
|
+
* override every CLI invocation would be recorded as an SDK call and the two
|
|
4446
|
+
* surfaces could never be told apart.
|
|
4447
|
+
*/
|
|
4448
|
+
clientLabel?: string;
|
|
4429
4449
|
}
|
|
4430
4450
|
interface RequestOptions {
|
|
4431
4451
|
body?: unknown;
|
|
@@ -4454,6 +4474,10 @@ declare class NodaroClient {
|
|
|
4454
4474
|
readonly baseUrl: string;
|
|
4455
4475
|
readonly auth: Auth;
|
|
4456
4476
|
readonly timeoutMs: number;
|
|
4477
|
+
/** Value sent as `X-Nodaro-Client`; recorded by the backend as job provenance. */
|
|
4478
|
+
readonly clientLabel: string;
|
|
4479
|
+
/** Whether to actually send it — see the note on {@link CLIENT_HEADER}. */
|
|
4480
|
+
private readonly sendClientHeader;
|
|
4457
4481
|
private readonly fetchOverride;
|
|
4458
4482
|
/**
|
|
4459
4483
|
* Resolved lazily so consumers can swap `globalThis.fetch` after the
|
package/dist/index.js
CHANGED
|
@@ -2117,10 +2117,17 @@ var CommunityResource = class {
|
|
|
2117
2117
|
};
|
|
2118
2118
|
|
|
2119
2119
|
// src/client.ts
|
|
2120
|
+
var SDK_VERSION = "1.12.0" ;
|
|
2121
|
+
var CLIENT_HEADER = "X-Nodaro-Client";
|
|
2122
|
+
var isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
2120
2123
|
var NodaroClient = class {
|
|
2121
2124
|
baseUrl;
|
|
2122
2125
|
auth;
|
|
2123
2126
|
timeoutMs;
|
|
2127
|
+
/** Value sent as `X-Nodaro-Client`; recorded by the backend as job provenance. */
|
|
2128
|
+
clientLabel;
|
|
2129
|
+
/** Whether to actually send it — see the note on {@link CLIENT_HEADER}. */
|
|
2130
|
+
sendClientHeader;
|
|
2124
2131
|
fetchOverride;
|
|
2125
2132
|
/**
|
|
2126
2133
|
* Resolved lazily so consumers can swap `globalThis.fetch` after the
|
|
@@ -2161,6 +2168,8 @@ var NodaroClient = class {
|
|
|
2161
2168
|
this.auth = opts.auth;
|
|
2162
2169
|
this.fetchOverride = opts.fetch;
|
|
2163
2170
|
this.timeoutMs = opts.timeoutMs ?? 6e4;
|
|
2171
|
+
this.clientLabel = opts.clientLabel ?? `sdk/${SDK_VERSION}`;
|
|
2172
|
+
this.sendClientHeader = opts.clientLabel !== void 0 || !isBrowser();
|
|
2164
2173
|
this.workflows = new WorkflowsResource(this);
|
|
2165
2174
|
this.projects = new ProjectsResource(this);
|
|
2166
2175
|
this.jobs = new JobsResource(this);
|
|
@@ -2193,6 +2202,7 @@ var NodaroClient = class {
|
|
|
2193
2202
|
const isFormData = typeof FormData !== "undefined" && options.body instanceof FormData;
|
|
2194
2203
|
const headers = {
|
|
2195
2204
|
...isFormData ? {} : { "Content-Type": "application/json" },
|
|
2205
|
+
...this.sendClientHeader ? { [CLIENT_HEADER]: this.clientLabel } : {},
|
|
2196
2206
|
...options.headers ?? {}
|
|
2197
2207
|
};
|
|
2198
2208
|
if (token) headers["Authorization"] = `Bearer ${token}`;
|