@openrouter/sdk 0.1.17 → 0.1.18
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 +0 -8
- package/esm/lib/config.d.ts +10 -2
- package/esm/lib/config.js +2 -2
- package/esm/lib/env.d.ts +13 -0
- package/esm/lib/env.js +16 -0
- package/esm/lib/sdks.js +2 -2
- package/jsr.json +1 -1
- package/package.json +2 -16
- package/REACT_QUERY.md +0 -296
- package/esm/react-query/_context.d.ts +0 -8
- package/esm/react-query/_context.js +0 -14
- package/esm/react-query/_types.d.ts +0 -27
- package/esm/react-query/_types.js +0 -5
- package/esm/react-query/analyticsGetUserActivity.d.ts +0 -36
- package/esm/react-query/analyticsGetUserActivity.js +0 -77
- package/esm/react-query/apiKeysCreate.d.ts +0 -20
- package/esm/react-query/apiKeysCreate.js +0 -39
- package/esm/react-query/apiKeysDelete.d.ts +0 -20
- package/esm/react-query/apiKeysDelete.js +0 -39
- package/esm/react-query/apiKeysGet.d.ts +0 -24
- package/esm/react-query/apiKeysGet.js +0 -66
- package/esm/react-query/apiKeysGetCurrentKeyMetadata.d.ts +0 -29
- package/esm/react-query/apiKeysGetCurrentKeyMetadata.js +0 -66
- package/esm/react-query/apiKeysList.d.ts +0 -37
- package/esm/react-query/apiKeysList.js +0 -69
- package/esm/react-query/apiKeysUpdate.d.ts +0 -20
- package/esm/react-query/apiKeysUpdate.js +0 -39
- package/esm/react-query/betaResponsesSend.d.ts +0 -24
- package/esm/react-query/betaResponsesSend.js +0 -42
- package/esm/react-query/chatSend.d.ts +0 -24
- package/esm/react-query/chatSend.js +0 -42
- package/esm/react-query/completionsGenerate.d.ts +0 -23
- package/esm/react-query/completionsGenerate.js +0 -42
- package/esm/react-query/creditsCreateCoinbaseCharge.d.ts +0 -25
- package/esm/react-query/creditsCreateCoinbaseCharge.js +0 -42
- package/esm/react-query/creditsGetCredits.d.ts +0 -29
- package/esm/react-query/creditsGetCredits.js +0 -66
- package/esm/react-query/embeddingsGenerate.d.ts +0 -23
- package/esm/react-query/embeddingsGenerate.js +0 -42
- package/esm/react-query/embeddingsListModels.d.ts +0 -29
- package/esm/react-query/embeddingsListModels.js +0 -66
- package/esm/react-query/endpointsList.d.ts +0 -24
- package/esm/react-query/endpointsList.js +0 -66
- package/esm/react-query/endpointsListZdrEndpoints.d.ts +0 -23
- package/esm/react-query/endpointsListZdrEndpoints.js +0 -60
- package/esm/react-query/generationsGetGeneration.d.ts +0 -30
- package/esm/react-query/generationsGetGeneration.js +0 -71
- package/esm/react-query/index.d.ts +0 -27
- package/esm/react-query/index.js +0 -30
- package/esm/react-query/modelsCount.d.ts +0 -23
- package/esm/react-query/modelsCount.js +0 -60
- package/esm/react-query/modelsList.d.ts +0 -38
- package/esm/react-query/modelsList.js +0 -69
- package/esm/react-query/modelsListForUser.d.ts +0 -24
- package/esm/react-query/modelsListForUser.js +0 -60
- package/esm/react-query/oAuthCreateAuthCode.d.ts +0 -23
- package/esm/react-query/oAuthCreateAuthCode.js +0 -42
- package/esm/react-query/oAuthExchangeAuthCodeForAPIKey.d.ts +0 -23
- package/esm/react-query/oAuthExchangeAuthCodeForAPIKey.js +0 -42
- package/esm/react-query/parametersGetParameters.d.ts +0 -38
- package/esm/react-query/parametersGetParameters.js +0 -80
- package/esm/react-query/providersList.d.ts +0 -23
- package/esm/react-query/providersList.js +0 -60
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export { OpenRouterProvider, useOpenRouterContext } from "./_context.js";
|
|
2
|
-
export * from "./_types.js";
|
|
3
|
-
export * from "./analyticsGetUserActivity.js";
|
|
4
|
-
export * from "./apiKeysCreate.js";
|
|
5
|
-
export * from "./apiKeysDelete.js";
|
|
6
|
-
export * from "./apiKeysGet.js";
|
|
7
|
-
export * from "./apiKeysGetCurrentKeyMetadata.js";
|
|
8
|
-
export * from "./apiKeysList.js";
|
|
9
|
-
export * from "./apiKeysUpdate.js";
|
|
10
|
-
export * from "./betaResponsesSend.js";
|
|
11
|
-
export * from "./chatSend.js";
|
|
12
|
-
export * from "./completionsGenerate.js";
|
|
13
|
-
export * from "./creditsCreateCoinbaseCharge.js";
|
|
14
|
-
export * from "./creditsGetCredits.js";
|
|
15
|
-
export * from "./embeddingsGenerate.js";
|
|
16
|
-
export * from "./embeddingsListModels.js";
|
|
17
|
-
export * from "./endpointsList.js";
|
|
18
|
-
export * from "./endpointsListZdrEndpoints.js";
|
|
19
|
-
export * from "./generationsGetGeneration.js";
|
|
20
|
-
export * from "./modelsCount.js";
|
|
21
|
-
export * from "./modelsList.js";
|
|
22
|
-
export * from "./modelsListForUser.js";
|
|
23
|
-
export * from "./oAuthCreateAuthCode.js";
|
|
24
|
-
export * from "./oAuthExchangeAuthCodeForAPIKey.js";
|
|
25
|
-
export * from "./parametersGetParameters.js";
|
|
26
|
-
export * from "./providersList.js";
|
|
27
|
-
//# sourceMappingURL=index.d.ts.map
|
package/esm/react-query/index.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
export { OpenRouterProvider, useOpenRouterContext } from "./_context.js";
|
|
5
|
-
export * from "./_types.js";
|
|
6
|
-
export * from "./analyticsGetUserActivity.js";
|
|
7
|
-
export * from "./apiKeysCreate.js";
|
|
8
|
-
export * from "./apiKeysDelete.js";
|
|
9
|
-
export * from "./apiKeysGet.js";
|
|
10
|
-
export * from "./apiKeysGetCurrentKeyMetadata.js";
|
|
11
|
-
export * from "./apiKeysList.js";
|
|
12
|
-
export * from "./apiKeysUpdate.js";
|
|
13
|
-
export * from "./betaResponsesSend.js";
|
|
14
|
-
export * from "./chatSend.js";
|
|
15
|
-
export * from "./completionsGenerate.js";
|
|
16
|
-
export * from "./creditsCreateCoinbaseCharge.js";
|
|
17
|
-
export * from "./creditsGetCredits.js";
|
|
18
|
-
export * from "./embeddingsGenerate.js";
|
|
19
|
-
export * from "./embeddingsListModels.js";
|
|
20
|
-
export * from "./endpointsList.js";
|
|
21
|
-
export * from "./endpointsListZdrEndpoints.js";
|
|
22
|
-
export * from "./generationsGetGeneration.js";
|
|
23
|
-
export * from "./modelsCount.js";
|
|
24
|
-
export * from "./modelsList.js";
|
|
25
|
-
export * from "./modelsListForUser.js";
|
|
26
|
-
export * from "./oAuthCreateAuthCode.js";
|
|
27
|
-
export * from "./oAuthExchangeAuthCodeForAPIKey.js";
|
|
28
|
-
export * from "./parametersGetParameters.js";
|
|
29
|
-
export * from "./providersList.js";
|
|
30
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { InvalidateQueryFilters, QueryClient, QueryFunctionContext, QueryKey, UseQueryResult, UseSuspenseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import { OpenRouterCore } from "../core.js";
|
|
3
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
4
|
-
import * as models from "../models/index.js";
|
|
5
|
-
import { QueryHookOptions, SuspenseQueryHookOptions } from "./_types.js";
|
|
6
|
-
export type ModelsCountQueryData = models.ModelsCountResponse;
|
|
7
|
-
/**
|
|
8
|
-
* Get total count of available models
|
|
9
|
-
*/
|
|
10
|
-
export declare function useModelsCount(options?: QueryHookOptions<ModelsCountQueryData>): UseQueryResult<ModelsCountQueryData, Error>;
|
|
11
|
-
/**
|
|
12
|
-
* Get total count of available models
|
|
13
|
-
*/
|
|
14
|
-
export declare function useModelsCountSuspense(options?: SuspenseQueryHookOptions<ModelsCountQueryData>): UseSuspenseQueryResult<ModelsCountQueryData, Error>;
|
|
15
|
-
export declare function prefetchModelsCount(queryClient: QueryClient, client$: OpenRouterCore): Promise<void>;
|
|
16
|
-
export declare function setModelsCountData(client: QueryClient, data: ModelsCountQueryData): ModelsCountQueryData | undefined;
|
|
17
|
-
export declare function invalidateAllModelsCount(client: QueryClient, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
|
|
18
|
-
export declare function buildModelsCountQuery(client$: OpenRouterCore, options?: RequestOptions): {
|
|
19
|
-
queryKey: QueryKey;
|
|
20
|
-
queryFn: (context: QueryFunctionContext) => Promise<ModelsCountQueryData>;
|
|
21
|
-
};
|
|
22
|
-
export declare function queryKeyModelsCount(): QueryKey;
|
|
23
|
-
//# sourceMappingURL=modelsCount.d.ts.map
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import { useQuery, useSuspenseQuery, } from "@tanstack/react-query";
|
|
5
|
-
import { modelsCount } from "../funcs/modelsCount.js";
|
|
6
|
-
import { combineSignals } from "../lib/primitives.js";
|
|
7
|
-
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
-
import { useOpenRouterContext } from "./_context.js";
|
|
9
|
-
/**
|
|
10
|
-
* Get total count of available models
|
|
11
|
-
*/
|
|
12
|
-
export function useModelsCount(options) {
|
|
13
|
-
const client = useOpenRouterContext();
|
|
14
|
-
return useQuery({
|
|
15
|
-
...buildModelsCountQuery(client, options),
|
|
16
|
-
...options,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Get total count of available models
|
|
21
|
-
*/
|
|
22
|
-
export function useModelsCountSuspense(options) {
|
|
23
|
-
const client = useOpenRouterContext();
|
|
24
|
-
return useSuspenseQuery({
|
|
25
|
-
...buildModelsCountQuery(client, options),
|
|
26
|
-
...options,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
export function prefetchModelsCount(queryClient, client$) {
|
|
30
|
-
return queryClient.prefetchQuery({
|
|
31
|
-
...buildModelsCountQuery(client$),
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
export function setModelsCountData(client, data) {
|
|
35
|
-
const key = queryKeyModelsCount();
|
|
36
|
-
return client.setQueryData(key, data);
|
|
37
|
-
}
|
|
38
|
-
export function invalidateAllModelsCount(client, filters) {
|
|
39
|
-
return client.invalidateQueries({
|
|
40
|
-
...filters,
|
|
41
|
-
queryKey: ["@openrouter/sdk", "Models", "count"],
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
export function buildModelsCountQuery(client$, options) {
|
|
45
|
-
return {
|
|
46
|
-
queryKey: queryKeyModelsCount(),
|
|
47
|
-
queryFn: async function modelsCountQueryFn(ctx) {
|
|
48
|
-
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
49
|
-
const mergedOptions = {
|
|
50
|
-
...options,
|
|
51
|
-
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
52
|
-
};
|
|
53
|
-
return unwrapAsync(modelsCount(client$, mergedOptions));
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
export function queryKeyModelsCount() {
|
|
58
|
-
return ["@openrouter/sdk", "Models", "count"];
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=modelsCount.js.map
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { InvalidateQueryFilters, QueryClient, QueryFunctionContext, QueryKey, UseQueryResult, UseSuspenseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import { OpenRouterCore } from "../core.js";
|
|
3
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
4
|
-
import * as models from "../models/index.js";
|
|
5
|
-
import * as operations from "../models/operations/index.js";
|
|
6
|
-
import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes } from "./_types.js";
|
|
7
|
-
export type ModelsListQueryData = models.ModelsListResponse;
|
|
8
|
-
/**
|
|
9
|
-
* List all models and their properties
|
|
10
|
-
*/
|
|
11
|
-
export declare function useModelsList(request?: operations.GetModelsRequest | undefined, options?: QueryHookOptions<ModelsListQueryData>): UseQueryResult<ModelsListQueryData, Error>;
|
|
12
|
-
/**
|
|
13
|
-
* List all models and their properties
|
|
14
|
-
*/
|
|
15
|
-
export declare function useModelsListSuspense(request?: operations.GetModelsRequest | undefined, options?: SuspenseQueryHookOptions<ModelsListQueryData>): UseSuspenseQueryResult<ModelsListQueryData, Error>;
|
|
16
|
-
export declare function prefetchModelsList(queryClient: QueryClient, client$: OpenRouterCore, request?: operations.GetModelsRequest | undefined): Promise<void>;
|
|
17
|
-
export declare function setModelsListData(client: QueryClient, queryKeyBase: [
|
|
18
|
-
parameters: {
|
|
19
|
-
category?: string | undefined;
|
|
20
|
-
supportedParameters?: string | undefined;
|
|
21
|
-
}
|
|
22
|
-
], data: ModelsListQueryData): ModelsListQueryData | undefined;
|
|
23
|
-
export declare function invalidateModelsList(client: QueryClient, queryKeyBase: TupleToPrefixes<[
|
|
24
|
-
parameters: {
|
|
25
|
-
category?: string | undefined;
|
|
26
|
-
supportedParameters?: string | undefined;
|
|
27
|
-
}
|
|
28
|
-
]>, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
|
|
29
|
-
export declare function invalidateAllModelsList(client: QueryClient, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
|
|
30
|
-
export declare function buildModelsListQuery(client$: OpenRouterCore, request?: operations.GetModelsRequest | undefined, options?: RequestOptions): {
|
|
31
|
-
queryKey: QueryKey;
|
|
32
|
-
queryFn: (context: QueryFunctionContext) => Promise<ModelsListQueryData>;
|
|
33
|
-
};
|
|
34
|
-
export declare function queryKeyModelsList(parameters: {
|
|
35
|
-
category?: string | undefined;
|
|
36
|
-
supportedParameters?: string | undefined;
|
|
37
|
-
}): QueryKey;
|
|
38
|
-
//# sourceMappingURL=modelsList.d.ts.map
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import { useQuery, useSuspenseQuery, } from "@tanstack/react-query";
|
|
5
|
-
import { modelsList } from "../funcs/modelsList.js";
|
|
6
|
-
import { combineSignals } from "../lib/primitives.js";
|
|
7
|
-
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
-
import { useOpenRouterContext } from "./_context.js";
|
|
9
|
-
/**
|
|
10
|
-
* List all models and their properties
|
|
11
|
-
*/
|
|
12
|
-
export function useModelsList(request, options) {
|
|
13
|
-
const client = useOpenRouterContext();
|
|
14
|
-
return useQuery({
|
|
15
|
-
...buildModelsListQuery(client, request, options),
|
|
16
|
-
...options,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* List all models and their properties
|
|
21
|
-
*/
|
|
22
|
-
export function useModelsListSuspense(request, options) {
|
|
23
|
-
const client = useOpenRouterContext();
|
|
24
|
-
return useSuspenseQuery({
|
|
25
|
-
...buildModelsListQuery(client, request, options),
|
|
26
|
-
...options,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
export function prefetchModelsList(queryClient, client$, request) {
|
|
30
|
-
return queryClient.prefetchQuery({
|
|
31
|
-
...buildModelsListQuery(client$, request),
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
export function setModelsListData(client, queryKeyBase, data) {
|
|
35
|
-
const key = queryKeyModelsList(...queryKeyBase);
|
|
36
|
-
return client.setQueryData(key, data);
|
|
37
|
-
}
|
|
38
|
-
export function invalidateModelsList(client, queryKeyBase, filters) {
|
|
39
|
-
return client.invalidateQueries({
|
|
40
|
-
...filters,
|
|
41
|
-
queryKey: ["@openrouter/sdk", "Models", "list", ...queryKeyBase],
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
export function invalidateAllModelsList(client, filters) {
|
|
45
|
-
return client.invalidateQueries({
|
|
46
|
-
...filters,
|
|
47
|
-
queryKey: ["@openrouter/sdk", "Models", "list"],
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
export function buildModelsListQuery(client$, request, options) {
|
|
51
|
-
return {
|
|
52
|
-
queryKey: queryKeyModelsList({
|
|
53
|
-
category: request?.category,
|
|
54
|
-
supportedParameters: request?.supportedParameters,
|
|
55
|
-
}),
|
|
56
|
-
queryFn: async function modelsListQueryFn(ctx) {
|
|
57
|
-
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
58
|
-
const mergedOptions = {
|
|
59
|
-
...options,
|
|
60
|
-
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
61
|
-
};
|
|
62
|
-
return unwrapAsync(modelsList(client$, request, mergedOptions));
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
export function queryKeyModelsList(parameters) {
|
|
67
|
-
return ["@openrouter/sdk", "Models", "list", parameters];
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=modelsList.js.map
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { InvalidateQueryFilters, QueryClient, QueryFunctionContext, QueryKey, UseQueryResult, UseSuspenseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import { OpenRouterCore } from "../core.js";
|
|
3
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
4
|
-
import * as models from "../models/index.js";
|
|
5
|
-
import * as operations from "../models/operations/index.js";
|
|
6
|
-
import { QueryHookOptions, SuspenseQueryHookOptions } from "./_types.js";
|
|
7
|
-
export type ModelsListForUserQueryData = models.ModelsListResponse;
|
|
8
|
-
/**
|
|
9
|
-
* List models filtered by user provider preferences
|
|
10
|
-
*/
|
|
11
|
-
export declare function useModelsListForUser(security: operations.ListModelsUserSecurity, options?: QueryHookOptions<ModelsListForUserQueryData>): UseQueryResult<ModelsListForUserQueryData, Error>;
|
|
12
|
-
/**
|
|
13
|
-
* List models filtered by user provider preferences
|
|
14
|
-
*/
|
|
15
|
-
export declare function useModelsListForUserSuspense(security: operations.ListModelsUserSecurity, options?: SuspenseQueryHookOptions<ModelsListForUserQueryData>): UseSuspenseQueryResult<ModelsListForUserQueryData, Error>;
|
|
16
|
-
export declare function prefetchModelsListForUser(queryClient: QueryClient, client$: OpenRouterCore, security: operations.ListModelsUserSecurity): Promise<void>;
|
|
17
|
-
export declare function setModelsListForUserData(client: QueryClient, data: ModelsListForUserQueryData): ModelsListForUserQueryData | undefined;
|
|
18
|
-
export declare function invalidateAllModelsListForUser(client: QueryClient, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
|
|
19
|
-
export declare function buildModelsListForUserQuery(client$: OpenRouterCore, security: operations.ListModelsUserSecurity, options?: RequestOptions): {
|
|
20
|
-
queryKey: QueryKey;
|
|
21
|
-
queryFn: (context: QueryFunctionContext) => Promise<ModelsListForUserQueryData>;
|
|
22
|
-
};
|
|
23
|
-
export declare function queryKeyModelsListForUser(): QueryKey;
|
|
24
|
-
//# sourceMappingURL=modelsListForUser.d.ts.map
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import { useQuery, useSuspenseQuery, } from "@tanstack/react-query";
|
|
5
|
-
import { modelsListForUser } from "../funcs/modelsListForUser.js";
|
|
6
|
-
import { combineSignals } from "../lib/primitives.js";
|
|
7
|
-
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
-
import { useOpenRouterContext } from "./_context.js";
|
|
9
|
-
/**
|
|
10
|
-
* List models filtered by user provider preferences
|
|
11
|
-
*/
|
|
12
|
-
export function useModelsListForUser(security, options) {
|
|
13
|
-
const client = useOpenRouterContext();
|
|
14
|
-
return useQuery({
|
|
15
|
-
...buildModelsListForUserQuery(client, security, options),
|
|
16
|
-
...options,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* List models filtered by user provider preferences
|
|
21
|
-
*/
|
|
22
|
-
export function useModelsListForUserSuspense(security, options) {
|
|
23
|
-
const client = useOpenRouterContext();
|
|
24
|
-
return useSuspenseQuery({
|
|
25
|
-
...buildModelsListForUserQuery(client, security, options),
|
|
26
|
-
...options,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
export function prefetchModelsListForUser(queryClient, client$, security) {
|
|
30
|
-
return queryClient.prefetchQuery({
|
|
31
|
-
...buildModelsListForUserQuery(client$, security),
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
export function setModelsListForUserData(client, data) {
|
|
35
|
-
const key = queryKeyModelsListForUser();
|
|
36
|
-
return client.setQueryData(key, data);
|
|
37
|
-
}
|
|
38
|
-
export function invalidateAllModelsListForUser(client, filters) {
|
|
39
|
-
return client.invalidateQueries({
|
|
40
|
-
...filters,
|
|
41
|
-
queryKey: ["@openrouter/sdk", "Models", "listForUser"],
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
export function buildModelsListForUserQuery(client$, security, options) {
|
|
45
|
-
return {
|
|
46
|
-
queryKey: queryKeyModelsListForUser(),
|
|
47
|
-
queryFn: async function modelsListForUserQueryFn(ctx) {
|
|
48
|
-
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
49
|
-
const mergedOptions = {
|
|
50
|
-
...options,
|
|
51
|
-
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
52
|
-
};
|
|
53
|
-
return unwrapAsync(modelsListForUser(client$, security, mergedOptions));
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
export function queryKeyModelsListForUser() {
|
|
58
|
-
return ["@openrouter/sdk", "Models", "listForUser"];
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=modelsListForUser.js.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { MutationKey, UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import { OpenRouterCore } from "../core.js";
|
|
3
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
4
|
-
import * as operations from "../models/operations/index.js";
|
|
5
|
-
import { MutationHookOptions } from "./_types.js";
|
|
6
|
-
export type OAuthCreateAuthCodeMutationVariables = {
|
|
7
|
-
request: operations.CreateAuthKeysCodeRequest;
|
|
8
|
-
options?: RequestOptions;
|
|
9
|
-
};
|
|
10
|
-
export type OAuthCreateAuthCodeMutationData = operations.CreateAuthKeysCodeResponse;
|
|
11
|
-
/**
|
|
12
|
-
* Create authorization code
|
|
13
|
-
*
|
|
14
|
-
* @remarks
|
|
15
|
-
* Create an authorization code for the PKCE flow to generate a user-controlled API key
|
|
16
|
-
*/
|
|
17
|
-
export declare function useOAuthCreateAuthCodeMutation(options?: MutationHookOptions<OAuthCreateAuthCodeMutationData, Error, OAuthCreateAuthCodeMutationVariables>): UseMutationResult<OAuthCreateAuthCodeMutationData, Error, OAuthCreateAuthCodeMutationVariables>;
|
|
18
|
-
export declare function mutationKeyOAuthCreateAuthCode(): MutationKey;
|
|
19
|
-
export declare function buildOAuthCreateAuthCodeMutation(client$: OpenRouterCore, hookOptions?: RequestOptions): {
|
|
20
|
-
mutationKey: MutationKey;
|
|
21
|
-
mutationFn: (variables: OAuthCreateAuthCodeMutationVariables) => Promise<OAuthCreateAuthCodeMutationData>;
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=oAuthCreateAuthCode.d.ts.map
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import { useMutation, } from "@tanstack/react-query";
|
|
5
|
-
import { oAuthCreateAuthCode } from "../funcs/oAuthCreateAuthCode.js";
|
|
6
|
-
import { combineSignals } from "../lib/primitives.js";
|
|
7
|
-
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
-
import { useOpenRouterContext } from "./_context.js";
|
|
9
|
-
/**
|
|
10
|
-
* Create authorization code
|
|
11
|
-
*
|
|
12
|
-
* @remarks
|
|
13
|
-
* Create an authorization code for the PKCE flow to generate a user-controlled API key
|
|
14
|
-
*/
|
|
15
|
-
export function useOAuthCreateAuthCodeMutation(options) {
|
|
16
|
-
const client = useOpenRouterContext();
|
|
17
|
-
return useMutation({
|
|
18
|
-
...buildOAuthCreateAuthCodeMutation(client, options),
|
|
19
|
-
...options,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
export function mutationKeyOAuthCreateAuthCode() {
|
|
23
|
-
return ["@openrouter/sdk", "OAuth", "createAuthCode"];
|
|
24
|
-
}
|
|
25
|
-
export function buildOAuthCreateAuthCodeMutation(client$, hookOptions) {
|
|
26
|
-
return {
|
|
27
|
-
mutationKey: mutationKeyOAuthCreateAuthCode(),
|
|
28
|
-
mutationFn: function oAuthCreateAuthCodeMutationFn({ request, options, }) {
|
|
29
|
-
const mergedOptions = {
|
|
30
|
-
...hookOptions,
|
|
31
|
-
...options,
|
|
32
|
-
fetchOptions: {
|
|
33
|
-
...hookOptions?.fetchOptions,
|
|
34
|
-
...options?.fetchOptions,
|
|
35
|
-
signal: combineSignals(hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal),
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
return unwrapAsync(oAuthCreateAuthCode(client$, request, mergedOptions));
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=oAuthCreateAuthCode.js.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { MutationKey, UseMutationResult } from "@tanstack/react-query";
|
|
2
|
-
import { OpenRouterCore } from "../core.js";
|
|
3
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
4
|
-
import * as operations from "../models/operations/index.js";
|
|
5
|
-
import { MutationHookOptions } from "./_types.js";
|
|
6
|
-
export type OAuthExchangeAuthCodeForAPIKeyMutationVariables = {
|
|
7
|
-
request: operations.ExchangeAuthCodeForAPIKeyRequest;
|
|
8
|
-
options?: RequestOptions;
|
|
9
|
-
};
|
|
10
|
-
export type OAuthExchangeAuthCodeForAPIKeyMutationData = operations.ExchangeAuthCodeForAPIKeyResponse;
|
|
11
|
-
/**
|
|
12
|
-
* Exchange authorization code for API key
|
|
13
|
-
*
|
|
14
|
-
* @remarks
|
|
15
|
-
* Exchange an authorization code from the PKCE flow for a user-controlled API key
|
|
16
|
-
*/
|
|
17
|
-
export declare function useOAuthExchangeAuthCodeForAPIKeyMutation(options?: MutationHookOptions<OAuthExchangeAuthCodeForAPIKeyMutationData, Error, OAuthExchangeAuthCodeForAPIKeyMutationVariables>): UseMutationResult<OAuthExchangeAuthCodeForAPIKeyMutationData, Error, OAuthExchangeAuthCodeForAPIKeyMutationVariables>;
|
|
18
|
-
export declare function mutationKeyOAuthExchangeAuthCodeForAPIKey(): MutationKey;
|
|
19
|
-
export declare function buildOAuthExchangeAuthCodeForAPIKeyMutation(client$: OpenRouterCore, hookOptions?: RequestOptions): {
|
|
20
|
-
mutationKey: MutationKey;
|
|
21
|
-
mutationFn: (variables: OAuthExchangeAuthCodeForAPIKeyMutationVariables) => Promise<OAuthExchangeAuthCodeForAPIKeyMutationData>;
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=oAuthExchangeAuthCodeForAPIKey.d.ts.map
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import { useMutation, } from "@tanstack/react-query";
|
|
5
|
-
import { oAuthExchangeAuthCodeForAPIKey } from "../funcs/oAuthExchangeAuthCodeForAPIKey.js";
|
|
6
|
-
import { combineSignals } from "../lib/primitives.js";
|
|
7
|
-
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
-
import { useOpenRouterContext } from "./_context.js";
|
|
9
|
-
/**
|
|
10
|
-
* Exchange authorization code for API key
|
|
11
|
-
*
|
|
12
|
-
* @remarks
|
|
13
|
-
* Exchange an authorization code from the PKCE flow for a user-controlled API key
|
|
14
|
-
*/
|
|
15
|
-
export function useOAuthExchangeAuthCodeForAPIKeyMutation(options) {
|
|
16
|
-
const client = useOpenRouterContext();
|
|
17
|
-
return useMutation({
|
|
18
|
-
...buildOAuthExchangeAuthCodeForAPIKeyMutation(client, options),
|
|
19
|
-
...options,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
export function mutationKeyOAuthExchangeAuthCodeForAPIKey() {
|
|
23
|
-
return ["@openrouter/sdk", "OAuth", "exchangeAuthCodeForAPIKey"];
|
|
24
|
-
}
|
|
25
|
-
export function buildOAuthExchangeAuthCodeForAPIKeyMutation(client$, hookOptions) {
|
|
26
|
-
return {
|
|
27
|
-
mutationKey: mutationKeyOAuthExchangeAuthCodeForAPIKey(),
|
|
28
|
-
mutationFn: function oAuthExchangeAuthCodeForAPIKeyMutationFn({ request, options, }) {
|
|
29
|
-
const mergedOptions = {
|
|
30
|
-
...hookOptions,
|
|
31
|
-
...options,
|
|
32
|
-
fetchOptions: {
|
|
33
|
-
...hookOptions?.fetchOptions,
|
|
34
|
-
...options?.fetchOptions,
|
|
35
|
-
signal: combineSignals(hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal),
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
return unwrapAsync(oAuthExchangeAuthCodeForAPIKey(client$, request, mergedOptions));
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=oAuthExchangeAuthCodeForAPIKey.js.map
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { InvalidateQueryFilters, QueryClient, QueryFunctionContext, QueryKey, UseQueryResult, UseSuspenseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import { OpenRouterCore } from "../core.js";
|
|
3
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
4
|
-
import * as operations from "../models/operations/index.js";
|
|
5
|
-
import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes } from "./_types.js";
|
|
6
|
-
export type ParametersGetParametersQueryData = operations.GetParametersResponse;
|
|
7
|
-
/**
|
|
8
|
-
* Get a model's supported parameters and data about which are most popular
|
|
9
|
-
*/
|
|
10
|
-
export declare function useParametersGetParameters(security: operations.GetParametersSecurity, request: operations.GetParametersRequest, options?: QueryHookOptions<ParametersGetParametersQueryData>): UseQueryResult<ParametersGetParametersQueryData, Error>;
|
|
11
|
-
/**
|
|
12
|
-
* Get a model's supported parameters and data about which are most popular
|
|
13
|
-
*/
|
|
14
|
-
export declare function useParametersGetParametersSuspense(security: operations.GetParametersSecurity, request: operations.GetParametersRequest, options?: SuspenseQueryHookOptions<ParametersGetParametersQueryData>): UseSuspenseQueryResult<ParametersGetParametersQueryData, Error>;
|
|
15
|
-
export declare function prefetchParametersGetParameters(queryClient: QueryClient, client$: OpenRouterCore, security: operations.GetParametersSecurity, request: operations.GetParametersRequest): Promise<void>;
|
|
16
|
-
export declare function setParametersGetParametersData(client: QueryClient, queryKeyBase: [
|
|
17
|
-
author: string,
|
|
18
|
-
slug: string,
|
|
19
|
-
parameters: {
|
|
20
|
-
provider?: operations.GetParametersProvider | undefined;
|
|
21
|
-
}
|
|
22
|
-
], data: ParametersGetParametersQueryData): ParametersGetParametersQueryData | undefined;
|
|
23
|
-
export declare function invalidateParametersGetParameters(client: QueryClient, queryKeyBase: TupleToPrefixes<[
|
|
24
|
-
author: string,
|
|
25
|
-
slug: string,
|
|
26
|
-
parameters: {
|
|
27
|
-
provider?: operations.GetParametersProvider | undefined;
|
|
28
|
-
}
|
|
29
|
-
]>, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
|
|
30
|
-
export declare function invalidateAllParametersGetParameters(client: QueryClient, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
|
|
31
|
-
export declare function buildParametersGetParametersQuery(client$: OpenRouterCore, security: operations.GetParametersSecurity, request: operations.GetParametersRequest, options?: RequestOptions): {
|
|
32
|
-
queryKey: QueryKey;
|
|
33
|
-
queryFn: (context: QueryFunctionContext) => Promise<ParametersGetParametersQueryData>;
|
|
34
|
-
};
|
|
35
|
-
export declare function queryKeyParametersGetParameters(author: string, slug: string, parameters: {
|
|
36
|
-
provider?: operations.GetParametersProvider | undefined;
|
|
37
|
-
}): QueryKey;
|
|
38
|
-
//# sourceMappingURL=parametersGetParameters.d.ts.map
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import { useQuery, useSuspenseQuery, } from "@tanstack/react-query";
|
|
5
|
-
import { parametersGetParameters } from "../funcs/parametersGetParameters.js";
|
|
6
|
-
import { combineSignals } from "../lib/primitives.js";
|
|
7
|
-
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
-
import { useOpenRouterContext } from "./_context.js";
|
|
9
|
-
/**
|
|
10
|
-
* Get a model's supported parameters and data about which are most popular
|
|
11
|
-
*/
|
|
12
|
-
export function useParametersGetParameters(security, request, options) {
|
|
13
|
-
const client = useOpenRouterContext();
|
|
14
|
-
return useQuery({
|
|
15
|
-
...buildParametersGetParametersQuery(client, security, request, options),
|
|
16
|
-
...options,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Get a model's supported parameters and data about which are most popular
|
|
21
|
-
*/
|
|
22
|
-
export function useParametersGetParametersSuspense(security, request, options) {
|
|
23
|
-
const client = useOpenRouterContext();
|
|
24
|
-
return useSuspenseQuery({
|
|
25
|
-
...buildParametersGetParametersQuery(client, security, request, options),
|
|
26
|
-
...options,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
export function prefetchParametersGetParameters(queryClient, client$, security, request) {
|
|
30
|
-
return queryClient.prefetchQuery({
|
|
31
|
-
...buildParametersGetParametersQuery(client$, security, request),
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
export function setParametersGetParametersData(client, queryKeyBase, data) {
|
|
35
|
-
const key = queryKeyParametersGetParameters(...queryKeyBase);
|
|
36
|
-
return client.setQueryData(key, data);
|
|
37
|
-
}
|
|
38
|
-
export function invalidateParametersGetParameters(client, queryKeyBase, filters) {
|
|
39
|
-
return client.invalidateQueries({
|
|
40
|
-
...filters,
|
|
41
|
-
queryKey: [
|
|
42
|
-
"@openrouter/sdk",
|
|
43
|
-
"Parameters",
|
|
44
|
-
"getParameters",
|
|
45
|
-
...queryKeyBase,
|
|
46
|
-
],
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
export function invalidateAllParametersGetParameters(client, filters) {
|
|
50
|
-
return client.invalidateQueries({
|
|
51
|
-
...filters,
|
|
52
|
-
queryKey: ["@openrouter/sdk", "Parameters", "getParameters"],
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
export function buildParametersGetParametersQuery(client$, security, request, options) {
|
|
56
|
-
return {
|
|
57
|
-
queryKey: queryKeyParametersGetParameters(request.author, request.slug, {
|
|
58
|
-
provider: request.provider,
|
|
59
|
-
}),
|
|
60
|
-
queryFn: async function parametersGetParametersQueryFn(ctx) {
|
|
61
|
-
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
62
|
-
const mergedOptions = {
|
|
63
|
-
...options,
|
|
64
|
-
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
65
|
-
};
|
|
66
|
-
return unwrapAsync(parametersGetParameters(client$, security, request, mergedOptions));
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
export function queryKeyParametersGetParameters(author, slug, parameters) {
|
|
71
|
-
return [
|
|
72
|
-
"@openrouter/sdk",
|
|
73
|
-
"Parameters",
|
|
74
|
-
"getParameters",
|
|
75
|
-
author,
|
|
76
|
-
slug,
|
|
77
|
-
parameters,
|
|
78
|
-
];
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=parametersGetParameters.js.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { InvalidateQueryFilters, QueryClient, QueryFunctionContext, QueryKey, UseQueryResult, UseSuspenseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import { OpenRouterCore } from "../core.js";
|
|
3
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
4
|
-
import * as operations from "../models/operations/index.js";
|
|
5
|
-
import { QueryHookOptions, SuspenseQueryHookOptions } from "./_types.js";
|
|
6
|
-
export type ProvidersListQueryData = operations.ListProvidersResponse;
|
|
7
|
-
/**
|
|
8
|
-
* List all providers
|
|
9
|
-
*/
|
|
10
|
-
export declare function useProvidersList(options?: QueryHookOptions<ProvidersListQueryData>): UseQueryResult<ProvidersListQueryData, Error>;
|
|
11
|
-
/**
|
|
12
|
-
* List all providers
|
|
13
|
-
*/
|
|
14
|
-
export declare function useProvidersListSuspense(options?: SuspenseQueryHookOptions<ProvidersListQueryData>): UseSuspenseQueryResult<ProvidersListQueryData, Error>;
|
|
15
|
-
export declare function prefetchProvidersList(queryClient: QueryClient, client$: OpenRouterCore): Promise<void>;
|
|
16
|
-
export declare function setProvidersListData(client: QueryClient, data: ProvidersListQueryData): ProvidersListQueryData | undefined;
|
|
17
|
-
export declare function invalidateAllProvidersList(client: QueryClient, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
|
|
18
|
-
export declare function buildProvidersListQuery(client$: OpenRouterCore, options?: RequestOptions): {
|
|
19
|
-
queryKey: QueryKey;
|
|
20
|
-
queryFn: (context: QueryFunctionContext) => Promise<ProvidersListQueryData>;
|
|
21
|
-
};
|
|
22
|
-
export declare function queryKeyProvidersList(): QueryKey;
|
|
23
|
-
//# sourceMappingURL=providersList.d.ts.map
|