@openrouter/sdk 1.2.148 → 1.3.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.
@@ -11,6 +11,7 @@ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
11
  import { pathToFunc } from "../lib/url.js";
12
12
  import * as errors from "../models/errors/index.js";
13
13
  import * as models from "../models/index.js";
14
+ import { CreateApiAlphaDecisionsServerList } from "../models/operations/createapialphadecisions.js";
14
15
  import * as operations from "../models/operations/index.js";
15
16
  import { APIPromise } from "../types/async.js";
16
17
  /**
@@ -29,6 +30,10 @@ async function $do(client, request, options) {
29
30
  }
30
31
  const payload = parsed.value;
31
32
  const body = encodeJSON("body", payload.DecisionsRequest, { explode: true });
33
+ const baseURL = options?.serverURL
34
+ || pathToFunc(CreateApiAlphaDecisionsServerList[0], {
35
+ charEncoding: "percent",
36
+ })();
32
37
  const path = pathToFunc("/api/alpha/decisions")();
33
38
  const headers = new Headers(compactMap({
34
39
  "Content-Type": "application/json",
@@ -42,7 +47,7 @@ async function $do(client, request, options) {
42
47
  const requestSecurity = resolveGlobalSecurity(securityInput);
43
48
  const context = {
44
49
  options: client._options,
45
- baseURL: options?.serverURL ?? client._baseURL ?? "",
50
+ baseURL: baseURL ?? "",
46
51
  operationID: "createApiAlphaDecisions",
47
52
  oAuth2Scopes: null,
48
53
  resolvedSecurity: requestSecurity,
@@ -65,7 +70,7 @@ async function $do(client, request, options) {
65
70
  const requestRes = client._createRequest(context, {
66
71
  security: requestSecurity,
67
72
  method: "POST",
68
- baseURL: options?.serverURL,
73
+ baseURL: baseURL,
69
74
  path: path,
70
75
  headers: headers,
71
76
  body: body,
@@ -50,8 +50,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
50
50
  export declare const SDK_METADATA: {
51
51
  readonly language: "typescript";
52
52
  readonly openapiDocVersion: "1.0.0";
53
- readonly sdkVersion: "1.2.148";
53
+ readonly sdkVersion: "1.3.0";
54
54
  readonly genVersion: "2.914.0";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.2.148 2.914.0 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.3.0 2.914.0 1.0.0 @openrouter/sdk";
56
56
  };
57
57
  //# sourceMappingURL=config.d.ts.map
package/esm/lib/config.js CHANGED
@@ -29,8 +29,8 @@ export function serverURLFromOptions(options) {
29
29
  export const SDK_METADATA = {
30
30
  language: "typescript",
31
31
  openapiDocVersion: "1.0.0",
32
- sdkVersion: "1.2.148",
32
+ sdkVersion: "1.3.0",
33
33
  genVersion: "2.914.0",
34
- userAgent: "speakeasy-sdk/typescript 1.2.148 2.914.0 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.3.0 2.914.0 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -1,5 +1,6 @@
1
1
  import * as z from "zod/v4";
2
2
  import * as models from "../index.js";
3
+ export declare const CreateApiAlphaDecisionsServerList: readonly ["https://openrouter.ai"];
3
4
  export type CreateApiAlphaDecisionsGlobals = {
4
5
  /**
5
6
  * The app identifier should be your app's URL and is used as the primary identifier for rankings.
@@ -5,6 +5,9 @@
5
5
  import * as z from "zod/v4";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import * as models from "../index.js";
8
+ export const CreateApiAlphaDecisionsServerList = [
9
+ "https://openrouter.ai",
10
+ ];
8
11
  /** @internal */
9
12
  export const CreateApiAlphaDecisionsRequest$outboundSchema = z.object({
10
13
  httpReferer: z.string().optional(),
@@ -2,7 +2,7 @@ import * as z from "zod/v4";
2
2
  import { Result as SafeParseResult } from "../types/fp.js";
3
3
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
4
  /**
5
- * Metadata for one stored secret. The secret value is never returned. `fingerprint` is a keyed SHA-256 digest of the value: equal fingerprints within one scope mean equal values, but a workspace secret and its intern copy carry different fingerprints. `hosts` and `fingerprint` are `null` only for legacy rows written before host binding was required; storing the secret again assigns hosts.
5
+ * Metadata for one stored secret. The secret value is never returned. `fingerprint` is an HMAC-SHA-256 of the value keyed with that vault's own data key, so it is comparable only within one vault: equal fingerprints in one vault mean equal values, and rewriting the same value keeps its fingerprint. The same value stored in two vaults (for example a workspace secret and its intern copy) carries different fingerprints, so comparing fingerprints across vaults cannot show that a copy matches or that a rotation propagated. `hosts` and `fingerprint` are `null` only for legacy rows written before host binding was required; storing the secret again assigns hosts.
6
6
  */
7
7
  export type VaultSecret = {
8
8
  createdAt: Date;
@@ -7,7 +7,7 @@ import { VaultSecret } from "./vaultsecret.js";
7
7
  */
8
8
  export type VaultSecretResponse = {
9
9
  /**
10
- * Metadata for one stored secret. The secret value is never returned. `fingerprint` is a keyed SHA-256 digest of the value: equal fingerprints within one scope mean equal values, but a workspace secret and its intern copy carry different fingerprints. `hosts` and `fingerprint` are `null` only for legacy rows written before host binding was required; storing the secret again assigns hosts.
10
+ * Metadata for one stored secret. The secret value is never returned. `fingerprint` is an HMAC-SHA-256 of the value keyed with that vault's own data key, so it is comparable only within one vault: equal fingerprints in one vault mean equal values, and rewriting the same value keeps its fingerprint. The same value stored in two vaults (for example a workspace secret and its intern copy) carries different fingerprints, so comparing fingerprints across vaults cannot show that a copy matches or that a rotation propagated. `hosts` and `fingerprint` are `null` only for legacy rows written before host binding was required; storing the secret again assigns hosts.
11
11
  */
12
12
  data: VaultSecret;
13
13
  };
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.2.148",
5
+ "version": "1.3.0",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openrouter/sdk",
3
- "version": "1.2.148",
3
+ "version": "1.3.0",
4
4
  "author": "OpenRouter",
5
5
  "description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
6
6
  "keywords": [
@@ -73,15 +73,15 @@
73
73
  "lint": "eslint --cache --max-warnings=0 src",
74
74
  "build": "tsc",
75
75
  "prepublishOnly": "npm run build",
76
- "test:transit": "exit 0",
77
- "test:watch": "vitest --watch --project unit",
78
76
  "compile": "tsc",
79
- "prepare": "npm run build",
77
+ "postinstall": "node scripts/check-types.js || true",
80
78
  "test:e2e": "vitest --run --project e2e",
79
+ "test:transit": "exit 0",
81
80
  "typecheck": "tsc --noEmit",
82
81
  "typecheck:transit": "exit 0",
83
- "postinstall": "node scripts/check-types.js || true",
84
- "test": "vitest --run --project unit"
82
+ "prepare": "npm run build",
83
+ "test": "vitest --run --project unit",
84
+ "test:watch": "vitest --watch --project unit"
85
85
  },
86
86
  "peerDependencies": {},
87
87
  "devDependencies": {