@openrouter/sdk 1.2.48 → 1.2.49
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/esm/funcs/{betaAnalyticsGetAnalyticsMeta.d.ts → analyticsGetAnalyticsMeta.d.ts} +2 -2
- package/esm/funcs/{betaAnalyticsGetAnalyticsMeta.js → analyticsGetAnalyticsMeta.js} +3 -3
- package/esm/funcs/{betaAnalyticsQueryAnalytics.d.ts → analyticsQueryAnalytics.d.ts} +2 -2
- package/esm/funcs/{betaAnalyticsQueryAnalytics.js → analyticsQueryAnalytics.js} +3 -3
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/sdk/analytics.d.ts +14 -0
- package/esm/sdk/analytics.js +20 -0
- package/esm/sdk/beta.d.ts +0 -3
- package/esm/sdk/beta.js +0 -4
- package/esm/sdk/sdk.d.ts +2 -2
- package/esm/sdk/sdk.js +3 -3
- package/jsr.json +1 -1
- package/package.json +6 -6
- package/esm/sdk/betaanalytics.d.ts +0 -19
- package/esm/sdk/betaanalytics.js +0 -29
|
@@ -14,5 +14,5 @@ import { Result } from "../types/fp.js";
|
|
|
14
14
|
* @remarks
|
|
15
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.
|
|
16
16
|
*/
|
|
17
|
-
export declare function
|
|
18
|
-
//# sourceMappingURL=
|
|
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
|
+
//# sourceMappingURL=analyticsGetAnalyticsMeta.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id:
|
|
3
|
+
* @generated-id: f7372eee4934
|
|
4
4
|
*/
|
|
5
5
|
import { encodeSimple } from "../lib/encodings.js";
|
|
6
6
|
import { matchStatusCode } from "../lib/http.js";
|
|
@@ -18,7 +18,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
18
18
|
* @remarks
|
|
19
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.
|
|
20
20
|
*/
|
|
21
|
-
export function
|
|
21
|
+
export function analyticsGetAnalyticsMeta(client, request, options) {
|
|
22
22
|
return new APIPromise($do(client, request, options));
|
|
23
23
|
}
|
|
24
24
|
async function $do(client, request, options) {
|
|
@@ -93,4 +93,4 @@ async function $do(client, request, options) {
|
|
|
93
93
|
}
|
|
94
94
|
return [result, { status: "complete", request: req, response }];
|
|
95
95
|
}
|
|
96
|
-
//# sourceMappingURL=
|
|
96
|
+
//# sourceMappingURL=analyticsGetAnalyticsMeta.js.map
|
|
@@ -14,5 +14,5 @@ import { Result } from "../types/fp.js";
|
|
|
14
14
|
* @remarks
|
|
15
15
|
* Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
|
-
export declare function
|
|
18
|
-
//# sourceMappingURL=
|
|
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
|
+
//# sourceMappingURL=analyticsQueryAnalytics.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id:
|
|
3
|
+
* @generated-id: 36a22bd7b94b
|
|
4
4
|
*/
|
|
5
5
|
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
6
6
|
import { matchStatusCode } from "../lib/http.js";
|
|
@@ -18,7 +18,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
18
18
|
* @remarks
|
|
19
19
|
* Execute an analytics query with specified metrics, dimensions, filters, and time range. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
20
20
|
*/
|
|
21
|
-
export function
|
|
21
|
+
export function analyticsQueryAnalytics(client, request, options) {
|
|
22
22
|
return new APIPromise($do(client, request, options));
|
|
23
23
|
}
|
|
24
24
|
async function $do(client, request, options) {
|
|
@@ -94,4 +94,4 @@ async function $do(client, request, options) {
|
|
|
94
94
|
}
|
|
95
95
|
return [result, { status: "complete", request: req, response }];
|
|
96
96
|
}
|
|
97
|
-
//# sourceMappingURL=
|
|
97
|
+
//# sourceMappingURL=analyticsQueryAnalytics.js.map
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -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.
|
|
53
|
+
readonly sdkVersion: "1.2.49";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.49 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.
|
|
32
|
+
sdkVersion: "1.2.49",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.49 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
package/esm/sdk/analytics.d.ts
CHANGED
|
@@ -9,5 +9,19 @@ export declare class Analytics extends ClientSDK {
|
|
|
9
9
|
* Returns user activity data grouped by endpoint for the last 30 (completed) UTC days. Pass `workspace_id` to scope the response to a single workspace. Pass `group_by=workspace` to split each row per workspace and include `workspace_id` on every item; by default rows are aggregated across workspaces and `workspace_id` is not returned. Activity recorded before workspace resolution existed is permanently attributed to the account default workspace (no backfill is possible). [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
10
10
|
*/
|
|
11
11
|
getUserActivity(request?: operations.GetUserActivityRequest | undefined, options?: RequestOptions): Promise<models.ActivityResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* Get available analytics metrics and dimensions
|
|
14
|
+
*
|
|
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.
|
|
17
|
+
*/
|
|
18
|
+
getAnalyticsMeta(request?: operations.GetAnalyticsMetaRequest | undefined, options?: RequestOptions): Promise<operations.GetAnalyticsMetaResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Query analytics data
|
|
21
|
+
*
|
|
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.
|
|
24
|
+
*/
|
|
25
|
+
queryAnalytics(request: operations.QueryAnalyticsRequest, options?: RequestOptions): Promise<operations.QueryAnalyticsResponse>;
|
|
12
26
|
}
|
|
13
27
|
//# sourceMappingURL=analytics.d.ts.map
|
package/esm/sdk/analytics.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
* @generated-id: 411d91261be3
|
|
4
4
|
*/
|
|
5
|
+
import { analyticsGetAnalyticsMeta } from "../funcs/analyticsGetAnalyticsMeta.js";
|
|
5
6
|
import { analyticsGetUserActivity } from "../funcs/analyticsGetUserActivity.js";
|
|
7
|
+
import { analyticsQueryAnalytics } from "../funcs/analyticsQueryAnalytics.js";
|
|
6
8
|
import { ClientSDK } from "../lib/sdks.js";
|
|
7
9
|
import { unwrapAsync } from "../types/fp.js";
|
|
8
10
|
export class Analytics extends ClientSDK {
|
|
@@ -15,5 +17,23 @@ export class Analytics extends ClientSDK {
|
|
|
15
17
|
async getUserActivity(request, options) {
|
|
16
18
|
return unwrapAsync(analyticsGetUserActivity(this, request, options));
|
|
17
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Get available analytics metrics and dimensions
|
|
22
|
+
*
|
|
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.
|
|
25
|
+
*/
|
|
26
|
+
async getAnalyticsMeta(request, options) {
|
|
27
|
+
return unwrapAsync(analyticsGetAnalyticsMeta(this, request, options));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Query analytics data
|
|
31
|
+
*
|
|
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.
|
|
34
|
+
*/
|
|
35
|
+
async queryAnalytics(request, options) {
|
|
36
|
+
return unwrapAsync(analyticsQueryAnalytics(this, request, options));
|
|
37
|
+
}
|
|
18
38
|
}
|
|
19
39
|
//# sourceMappingURL=analytics.js.map
|
package/esm/sdk/beta.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { ClientSDK } from "../lib/sdks.js";
|
|
2
|
-
import { BetaAnalytics } from "./betaanalytics.js";
|
|
3
2
|
import { BetaResponses } from "./betaresponses.js";
|
|
4
3
|
export declare class Beta extends ClientSDK {
|
|
5
|
-
private _analytics?;
|
|
6
|
-
get analytics(): BetaAnalytics;
|
|
7
4
|
private _responses?;
|
|
8
5
|
get responses(): BetaResponses;
|
|
9
6
|
}
|
package/esm/sdk/beta.js
CHANGED
|
@@ -3,12 +3,8 @@
|
|
|
3
3
|
* @generated-id: afeac65e28f8
|
|
4
4
|
*/
|
|
5
5
|
import { ClientSDK } from "../lib/sdks.js";
|
|
6
|
-
import { BetaAnalytics } from "./betaanalytics.js";
|
|
7
6
|
import { BetaResponses } from "./betaresponses.js";
|
|
8
7
|
export class Beta extends ClientSDK {
|
|
9
|
-
get analytics() {
|
|
10
|
-
return (this._analytics ?? (this._analytics = new BetaAnalytics(this._options)));
|
|
11
|
-
}
|
|
12
8
|
get responses() {
|
|
13
9
|
return (this._responses ?? (this._responses = new BetaResponses(this._options)));
|
|
14
10
|
}
|
package/esm/sdk/sdk.d.ts
CHANGED
|
@@ -36,8 +36,6 @@ export { ToolType };
|
|
|
36
36
|
export declare class OpenRouter extends ClientSDK {
|
|
37
37
|
private _analytics?;
|
|
38
38
|
get analytics(): Analytics;
|
|
39
|
-
private _beta?;
|
|
40
|
-
get beta(): Beta;
|
|
41
39
|
private _tts?;
|
|
42
40
|
get tts(): TTS;
|
|
43
41
|
private _stt?;
|
|
@@ -84,6 +82,8 @@ export declare class OpenRouter extends ClientSDK {
|
|
|
84
82
|
get rerank(): Rerank;
|
|
85
83
|
private _responses?;
|
|
86
84
|
get responses(): Responses;
|
|
85
|
+
private _beta?;
|
|
86
|
+
get beta(): Beta;
|
|
87
87
|
private _scim?;
|
|
88
88
|
get scim(): Scim;
|
|
89
89
|
private _videoGeneration?;
|
package/esm/sdk/sdk.js
CHANGED
|
@@ -39,9 +39,6 @@ export class OpenRouter extends ClientSDK {
|
|
|
39
39
|
get analytics() {
|
|
40
40
|
return (this._analytics ?? (this._analytics = new Analytics(this._options)));
|
|
41
41
|
}
|
|
42
|
-
get beta() {
|
|
43
|
-
return (this._beta ?? (this._beta = new Beta(this._options)));
|
|
44
|
-
}
|
|
45
42
|
get tts() {
|
|
46
43
|
return (this._tts ?? (this._tts = new TTS(this._options)));
|
|
47
44
|
}
|
|
@@ -111,6 +108,9 @@ export class OpenRouter extends ClientSDK {
|
|
|
111
108
|
get responses() {
|
|
112
109
|
return (this._responses ?? (this._responses = new Responses(this._options)));
|
|
113
110
|
}
|
|
111
|
+
get beta() {
|
|
112
|
+
return (this._beta ?? (this._beta = new Beta(this._options)));
|
|
113
|
+
}
|
|
114
114
|
get scim() {
|
|
115
115
|
return (this._scim ?? (this._scim = new Scim(this._options)));
|
|
116
116
|
}
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.49",
|
|
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
|
-
"
|
|
77
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
78
|
-
"test": "vitest --run --project unit",
|
|
76
|
+
"test:e2e": "vitest --run --project e2e",
|
|
79
77
|
"typecheck": "tsc --noEmit",
|
|
80
78
|
"typecheck:transit": "exit 0",
|
|
79
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
81
80
|
"prepare": "npm run build",
|
|
82
|
-
"test:e2e": "vitest --run --project e2e",
|
|
83
81
|
"test:transit": "exit 0",
|
|
84
|
-
"test:watch": "vitest --watch --project unit"
|
|
82
|
+
"test:watch": "vitest --watch --project unit",
|
|
83
|
+
"compile": "tsc",
|
|
84
|
+
"test": "vitest --run --project unit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
|
-
import * as operations from "../models/operations/index.js";
|
|
3
|
-
export declare class BetaAnalytics extends ClientSDK {
|
|
4
|
-
/**
|
|
5
|
-
* Get available analytics metrics and dimensions
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* Returns the available metrics, dimensions, filter operators, and granularities for the analytics query endpoint. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
9
|
-
*/
|
|
10
|
-
getAnalyticsMeta(request?: operations.GetAnalyticsMetaRequest | undefined, options?: RequestOptions): Promise<operations.GetAnalyticsMetaResponse>;
|
|
11
|
-
/**
|
|
12
|
-
* Query analytics data
|
|
13
|
-
*
|
|
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.
|
|
16
|
-
*/
|
|
17
|
-
queryAnalytics(request: operations.QueryAnalyticsRequest, options?: RequestOptions): Promise<operations.QueryAnalyticsResponse>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=betaanalytics.d.ts.map
|
package/esm/sdk/betaanalytics.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
* @generated-id: 814879ad7548
|
|
4
|
-
*/
|
|
5
|
-
import { betaAnalyticsGetAnalyticsMeta } from "../funcs/betaAnalyticsGetAnalyticsMeta.js";
|
|
6
|
-
import { betaAnalyticsQueryAnalytics } from "../funcs/betaAnalyticsQueryAnalytics.js";
|
|
7
|
-
import { ClientSDK } from "../lib/sdks.js";
|
|
8
|
-
import { unwrapAsync } from "../types/fp.js";
|
|
9
|
-
export class BetaAnalytics extends ClientSDK {
|
|
10
|
-
/**
|
|
11
|
-
* Get available analytics metrics and dimensions
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
* 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
|
-
*/
|
|
16
|
-
async getAnalyticsMeta(request, options) {
|
|
17
|
-
return unwrapAsync(betaAnalyticsGetAnalyticsMeta(this, request, options));
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Query analytics data
|
|
21
|
-
*
|
|
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.
|
|
24
|
-
*/
|
|
25
|
-
async queryAnalytics(request, options) {
|
|
26
|
-
return unwrapAsync(betaAnalyticsQueryAnalytics(this, request, options));
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=betaanalytics.js.map
|