@openrouter/sdk 1.5.79 → 1.5.81

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.
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
12
12
  * Get available analytics metrics and dimensions
13
13
  *
14
14
  * @remarks
15
- * Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.
15
+ * Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Workspace-scoped management keys are accepted. [Management key](/docs/guides/overview/auth/management-api-keys) required.
16
16
  */
17
17
  export declare function analyticsGetAnalyticsMeta(client: OpenRouterCore, request?: operations.GetAnalyticsMetaRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.GetAnalyticsMetaResponse, errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
18
18
  //# sourceMappingURL=analyticsGetAnalyticsMeta.d.ts.map
@@ -16,7 +16,7 @@ import { APIPromise } from "../types/async.js";
16
16
  * Get available analytics metrics and dimensions
17
17
  *
18
18
  * @remarks
19
- * Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.
19
+ * Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Workspace-scoped management keys are accepted. [Management key](/docs/guides/overview/auth/management-api-keys) required.
20
20
  */
21
21
  export function analyticsGetAnalyticsMeta(client, request, options) {
22
22
  return new APIPromise($do(client, request, options));
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
12
12
  * Query analytics data
13
13
  *
14
14
  * @remarks
15
- * Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.
15
+ * Execute an analytics query with specified metrics, dimensions, filters, and time range. A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: it is refused a `workspace` filter naming another workspace, it excludes legacy rows with no workspace (including for the default workspace), and possible-cache metrics such as `possible_cached_tokens` return 400. [Management key](/docs/guides/overview/auth/management-api-keys) required.
16
16
  */
17
17
  export declare function analyticsQueryAnalytics(client: OpenRouterCore, request: operations.QueryAnalyticsRequest, options?: RequestOptions): APIPromise<Result<operations.QueryAnalyticsResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.RequestTimeoutResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
18
18
  //# sourceMappingURL=analyticsQueryAnalytics.d.ts.map
@@ -16,7 +16,7 @@ import { APIPromise } from "../types/async.js";
16
16
  * Query analytics data
17
17
  *
18
18
  * @remarks
19
- * Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.
19
+ * Execute an analytics query with specified metrics, dimensions, filters, and time range. A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: it is refused a `workspace` filter naming another workspace, it excludes legacy rows with no workspace (including for the default workspace), and possible-cache metrics such as `possible_cached_tokens` return 400. [Management key](/docs/guides/overview/auth/management-api-keys) required.
20
20
  */
21
21
  export function analyticsQueryAnalytics(client, request, options) {
22
22
  return new APIPromise($do(client, request, options));
@@ -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.5.79";
53
+ readonly sdkVersion: "1.5.81";
54
54
  readonly genVersion: "2.950.13";
55
- readonly userAgent: "speakeasy-sdk/typescript 1.5.79 2.950.13 1.0.0 @openrouter/sdk";
55
+ readonly userAgent: "speakeasy-sdk/typescript 1.5.81 2.950.13 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.5.79",
32
+ sdkVersion: "1.5.81",
33
33
  genVersion: "2.950.13",
34
- userAgent: "speakeasy-sdk/typescript 1.5.79 2.950.13 1.0.0 @openrouter/sdk",
34
+ userAgent: "speakeasy-sdk/typescript 1.5.81 2.950.13 1.0.0 @openrouter/sdk",
35
35
  };
36
36
  //# sourceMappingURL=config.js.map
@@ -34,7 +34,10 @@ export type ExtractionListAnswer = {
34
34
  * Set to `image` or `document` when the answer was read from an image or a PDF rather than the state text.
35
35
  */
36
36
  source?: ExtractionListAnswerSource | undefined;
37
- spans?: Array<Array<number>> | undefined;
37
+ /**
38
+ * One span per item of `value`, in the same order; null for an item that has no offsets in the state text (read from an image or a document).
39
+ */
40
+ spans?: Array<Array<number> | null> | undefined;
38
41
  /**
39
42
  * Confidence in the spelling of text read from an image.
40
43
  */
@@ -33,7 +33,7 @@ export const ExtractionListAnswer$inboundSchema = z.object({
33
33
  guess: z.array(z.union([z.string(), z.number()])).optional(),
34
34
  p_null: z.number().optional(),
35
35
  source: ExtractionListAnswerSource$inboundSchema.optional(),
36
- spans: z.array(z.array(z.int())).optional(),
36
+ spans: z.array(z.nullable(z.array(z.int()))).optional(),
37
37
  spell_confidence: z.number().optional(),
38
38
  type: z.literal("list"),
39
39
  value: z.nullable(z.array(z.union([z.string(), z.number()]))),
@@ -13,14 +13,14 @@ export declare class Analytics extends ClientSDK {
13
13
  * Get available analytics metrics and dimensions
14
14
  *
15
15
  * @remarks
16
- * Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.
16
+ * Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Workspace-scoped management keys are accepted. [Management key](/docs/guides/overview/auth/management-api-keys) required.
17
17
  */
18
18
  getAnalyticsMeta(request?: operations.GetAnalyticsMetaRequest | undefined, options?: RequestOptions): Promise<operations.GetAnalyticsMetaResponse>;
19
19
  /**
20
20
  * Query analytics data
21
21
  *
22
22
  * @remarks
23
- * Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.
23
+ * Execute an analytics query with specified metrics, dimensions, filters, and time range. A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: it is refused a `workspace` filter naming another workspace, it excludes legacy rows with no workspace (including for the default workspace), and possible-cache metrics such as `possible_cached_tokens` return 400. [Management key](/docs/guides/overview/auth/management-api-keys) required.
24
24
  */
25
25
  queryAnalytics(request: operations.QueryAnalyticsRequest, options?: RequestOptions): Promise<operations.QueryAnalyticsResponse>;
26
26
  }
@@ -21,7 +21,7 @@ export class Analytics extends ClientSDK {
21
21
  * Get available analytics metrics and dimensions
22
22
  *
23
23
  * @remarks
24
- * Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.
24
+ * Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. Workspace-scoped management keys are accepted. [Management key](/docs/guides/overview/auth/management-api-keys) required.
25
25
  */
26
26
  async getAnalyticsMeta(request, options) {
27
27
  return unwrapAsync(analyticsGetAnalyticsMeta(this, request, options));
@@ -30,7 +30,7 @@ export class Analytics extends ClientSDK {
30
30
  * Query analytics data
31
31
  *
32
32
  * @remarks
33
- * Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.
33
+ * Execute an analytics query with specified metrics, dimensions, filters, and time range. A workspace-scoped management key needs `activity:view_all` on its own workspace and reads only that workspace: it is refused a `workspace` filter naming another workspace, it excludes legacy rows with no workspace (including for the default workspace), and possible-cache metrics such as `possible_cached_tokens` return 400. [Management key](/docs/guides/overview/auth/management-api-keys) required.
34
34
  */
35
35
  async queryAnalytics(request, options) {
36
36
  return unwrapAsync(analyticsQueryAnalytics(this, request, options));
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@openrouter/sdk",
5
- "version": "1.5.79",
5
+ "version": "1.5.81",
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.5.79",
3
+ "version": "1.5.81",
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": [
@@ -21,8 +21,8 @@
21
21
  "license": "Apache-2.0",
22
22
  "packageManager": "pnpm@10.22.0",
23
23
  "publishConfig": {
24
- "access": "public",
25
- "provenance": true
24
+ "provenance": true,
25
+ "access": "public"
26
26
  },
27
27
  "type": "module",
28
28
  "main": "./esm/index.js",
@@ -73,15 +73,15 @@
73
73
  "lint": "eslint --cache --max-warnings=0 src",
74
74
  "build": "tsc && node scripts/unbarrel-imports.js",
75
75
  "prepublishOnly": "npm run build",
76
- "compile": "tsc && node scripts/unbarrel-imports.js",
77
- "postinstall": "node scripts/check-types.js || true",
78
- "test:e2e": "vitest --run --project e2e",
79
76
  "test:watch": "vitest --watch --project unit",
80
- "typecheck": "tsc --noEmit",
81
- "typecheck:transit": "exit 0",
82
77
  "prepare": "npm run build",
83
78
  "test": "vitest --run --project unit",
84
- "test:transit": "exit 0"
79
+ "test:e2e": "vitest --run --project e2e",
80
+ "test:transit": "exit 0",
81
+ "typecheck": "tsc --noEmit",
82
+ "typecheck:transit": "exit 0",
83
+ "compile": "tsc && node scripts/unbarrel-imports.js",
84
+ "postinstall": "node scripts/check-types.js || true"
85
85
  },
86
86
  "peerDependencies": {
87
87