@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,20 +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 ApiKeysCreateMutationVariables = {
|
|
7
|
-
request: operations.CreateKeysRequest;
|
|
8
|
-
options?: RequestOptions;
|
|
9
|
-
};
|
|
10
|
-
export type ApiKeysCreateMutationData = operations.CreateKeysResponse;
|
|
11
|
-
/**
|
|
12
|
-
* Create a new API key
|
|
13
|
-
*/
|
|
14
|
-
export declare function useApiKeysCreateMutation(options?: MutationHookOptions<ApiKeysCreateMutationData, Error, ApiKeysCreateMutationVariables>): UseMutationResult<ApiKeysCreateMutationData, Error, ApiKeysCreateMutationVariables>;
|
|
15
|
-
export declare function mutationKeyApiKeysCreate(): MutationKey;
|
|
16
|
-
export declare function buildApiKeysCreateMutation(client$: OpenRouterCore, hookOptions?: RequestOptions): {
|
|
17
|
-
mutationKey: MutationKey;
|
|
18
|
-
mutationFn: (variables: ApiKeysCreateMutationVariables) => Promise<ApiKeysCreateMutationData>;
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=apiKeysCreate.d.ts.map
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import { useMutation, } from "@tanstack/react-query";
|
|
5
|
-
import { apiKeysCreate } from "../funcs/apiKeysCreate.js";
|
|
6
|
-
import { combineSignals } from "../lib/primitives.js";
|
|
7
|
-
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
-
import { useOpenRouterContext } from "./_context.js";
|
|
9
|
-
/**
|
|
10
|
-
* Create a new API key
|
|
11
|
-
*/
|
|
12
|
-
export function useApiKeysCreateMutation(options) {
|
|
13
|
-
const client = useOpenRouterContext();
|
|
14
|
-
return useMutation({
|
|
15
|
-
...buildApiKeysCreateMutation(client, options),
|
|
16
|
-
...options,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
export function mutationKeyApiKeysCreate() {
|
|
20
|
-
return ["@openrouter/sdk", "API Keys", "create"];
|
|
21
|
-
}
|
|
22
|
-
export function buildApiKeysCreateMutation(client$, hookOptions) {
|
|
23
|
-
return {
|
|
24
|
-
mutationKey: mutationKeyApiKeysCreate(),
|
|
25
|
-
mutationFn: function apiKeysCreateMutationFn({ request, options, }) {
|
|
26
|
-
const mergedOptions = {
|
|
27
|
-
...hookOptions,
|
|
28
|
-
...options,
|
|
29
|
-
fetchOptions: {
|
|
30
|
-
...hookOptions?.fetchOptions,
|
|
31
|
-
...options?.fetchOptions,
|
|
32
|
-
signal: combineSignals(hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal),
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
return unwrapAsync(apiKeysCreate(client$, request, mergedOptions));
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=apiKeysCreate.js.map
|
|
@@ -1,20 +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 ApiKeysDeleteMutationVariables = {
|
|
7
|
-
request: operations.DeleteKeysRequest;
|
|
8
|
-
options?: RequestOptions;
|
|
9
|
-
};
|
|
10
|
-
export type ApiKeysDeleteMutationData = operations.DeleteKeysResponse;
|
|
11
|
-
/**
|
|
12
|
-
* Delete an API key
|
|
13
|
-
*/
|
|
14
|
-
export declare function useApiKeysDeleteMutation(options?: MutationHookOptions<ApiKeysDeleteMutationData, Error, ApiKeysDeleteMutationVariables>): UseMutationResult<ApiKeysDeleteMutationData, Error, ApiKeysDeleteMutationVariables>;
|
|
15
|
-
export declare function mutationKeyApiKeysDelete(): MutationKey;
|
|
16
|
-
export declare function buildApiKeysDeleteMutation(client$: OpenRouterCore, hookOptions?: RequestOptions): {
|
|
17
|
-
mutationKey: MutationKey;
|
|
18
|
-
mutationFn: (variables: ApiKeysDeleteMutationVariables) => Promise<ApiKeysDeleteMutationData>;
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=apiKeysDelete.d.ts.map
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import { useMutation, } from "@tanstack/react-query";
|
|
5
|
-
import { apiKeysDelete } from "../funcs/apiKeysDelete.js";
|
|
6
|
-
import { combineSignals } from "../lib/primitives.js";
|
|
7
|
-
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
-
import { useOpenRouterContext } from "./_context.js";
|
|
9
|
-
/**
|
|
10
|
-
* Delete an API key
|
|
11
|
-
*/
|
|
12
|
-
export function useApiKeysDeleteMutation(options) {
|
|
13
|
-
const client = useOpenRouterContext();
|
|
14
|
-
return useMutation({
|
|
15
|
-
...buildApiKeysDeleteMutation(client, options),
|
|
16
|
-
...options,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
export function mutationKeyApiKeysDelete() {
|
|
20
|
-
return ["@openrouter/sdk", "API Keys", "delete"];
|
|
21
|
-
}
|
|
22
|
-
export function buildApiKeysDeleteMutation(client$, hookOptions) {
|
|
23
|
-
return {
|
|
24
|
-
mutationKey: mutationKeyApiKeysDelete(),
|
|
25
|
-
mutationFn: function apiKeysDeleteMutationFn({ request, options, }) {
|
|
26
|
-
const mergedOptions = {
|
|
27
|
-
...hookOptions,
|
|
28
|
-
...options,
|
|
29
|
-
fetchOptions: {
|
|
30
|
-
...hookOptions?.fetchOptions,
|
|
31
|
-
...options?.fetchOptions,
|
|
32
|
-
signal: combineSignals(hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal),
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
return unwrapAsync(apiKeysDelete(client$, request, mergedOptions));
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=apiKeysDelete.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 operations from "../models/operations/index.js";
|
|
5
|
-
import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes } from "./_types.js";
|
|
6
|
-
export type ApiKeysGetQueryData = operations.GetKeyResponse;
|
|
7
|
-
/**
|
|
8
|
-
* Get a single API key
|
|
9
|
-
*/
|
|
10
|
-
export declare function useApiKeysGet(request: operations.GetKeyRequest, options?: QueryHookOptions<ApiKeysGetQueryData>): UseQueryResult<ApiKeysGetQueryData, Error>;
|
|
11
|
-
/**
|
|
12
|
-
* Get a single API key
|
|
13
|
-
*/
|
|
14
|
-
export declare function useApiKeysGetSuspense(request: operations.GetKeyRequest, options?: SuspenseQueryHookOptions<ApiKeysGetQueryData>): UseSuspenseQueryResult<ApiKeysGetQueryData, Error>;
|
|
15
|
-
export declare function prefetchApiKeysGet(queryClient: QueryClient, client$: OpenRouterCore, request: operations.GetKeyRequest): Promise<void>;
|
|
16
|
-
export declare function setApiKeysGetData(client: QueryClient, queryKeyBase: [hash: string], data: ApiKeysGetQueryData): ApiKeysGetQueryData | undefined;
|
|
17
|
-
export declare function invalidateApiKeysGet(client: QueryClient, queryKeyBase: TupleToPrefixes<[hash: string]>, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
|
|
18
|
-
export declare function invalidateAllApiKeysGet(client: QueryClient, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
|
|
19
|
-
export declare function buildApiKeysGetQuery(client$: OpenRouterCore, request: operations.GetKeyRequest, options?: RequestOptions): {
|
|
20
|
-
queryKey: QueryKey;
|
|
21
|
-
queryFn: (context: QueryFunctionContext) => Promise<ApiKeysGetQueryData>;
|
|
22
|
-
};
|
|
23
|
-
export declare function queryKeyApiKeysGet(hash: string): QueryKey;
|
|
24
|
-
//# sourceMappingURL=apiKeysGet.d.ts.map
|
|
@@ -1,66 +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 { apiKeysGet } from "../funcs/apiKeysGet.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 single API key
|
|
11
|
-
*/
|
|
12
|
-
export function useApiKeysGet(request, options) {
|
|
13
|
-
const client = useOpenRouterContext();
|
|
14
|
-
return useQuery({
|
|
15
|
-
...buildApiKeysGetQuery(client, request, options),
|
|
16
|
-
...options,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Get a single API key
|
|
21
|
-
*/
|
|
22
|
-
export function useApiKeysGetSuspense(request, options) {
|
|
23
|
-
const client = useOpenRouterContext();
|
|
24
|
-
return useSuspenseQuery({
|
|
25
|
-
...buildApiKeysGetQuery(client, request, options),
|
|
26
|
-
...options,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
export function prefetchApiKeysGet(queryClient, client$, request) {
|
|
30
|
-
return queryClient.prefetchQuery({
|
|
31
|
-
...buildApiKeysGetQuery(client$, request),
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
export function setApiKeysGetData(client, queryKeyBase, data) {
|
|
35
|
-
const key = queryKeyApiKeysGet(...queryKeyBase);
|
|
36
|
-
return client.setQueryData(key, data);
|
|
37
|
-
}
|
|
38
|
-
export function invalidateApiKeysGet(client, queryKeyBase, filters) {
|
|
39
|
-
return client.invalidateQueries({
|
|
40
|
-
...filters,
|
|
41
|
-
queryKey: ["@openrouter/sdk", "API Keys", "get", ...queryKeyBase],
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
export function invalidateAllApiKeysGet(client, filters) {
|
|
45
|
-
return client.invalidateQueries({
|
|
46
|
-
...filters,
|
|
47
|
-
queryKey: ["@openrouter/sdk", "API Keys", "get"],
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
export function buildApiKeysGetQuery(client$, request, options) {
|
|
51
|
-
return {
|
|
52
|
-
queryKey: queryKeyApiKeysGet(request.hash),
|
|
53
|
-
queryFn: async function apiKeysGetQueryFn(ctx) {
|
|
54
|
-
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
55
|
-
const mergedOptions = {
|
|
56
|
-
...options,
|
|
57
|
-
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
58
|
-
};
|
|
59
|
-
return unwrapAsync(apiKeysGet(client$, request, mergedOptions));
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
export function queryKeyApiKeysGet(hash) {
|
|
64
|
-
return ["@openrouter/sdk", "API Keys", "get", hash];
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=apiKeysGet.js.map
|
|
@@ -1,29 +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 ApiKeysGetCurrentKeyMetadataQueryData = operations.GetCurrentKeyResponse;
|
|
7
|
-
/**
|
|
8
|
-
* Get current API key
|
|
9
|
-
*
|
|
10
|
-
* @remarks
|
|
11
|
-
* Get information on the API key associated with the current authentication session
|
|
12
|
-
*/
|
|
13
|
-
export declare function useApiKeysGetCurrentKeyMetadata(options?: QueryHookOptions<ApiKeysGetCurrentKeyMetadataQueryData>): UseQueryResult<ApiKeysGetCurrentKeyMetadataQueryData, Error>;
|
|
14
|
-
/**
|
|
15
|
-
* Get current API key
|
|
16
|
-
*
|
|
17
|
-
* @remarks
|
|
18
|
-
* Get information on the API key associated with the current authentication session
|
|
19
|
-
*/
|
|
20
|
-
export declare function useApiKeysGetCurrentKeyMetadataSuspense(options?: SuspenseQueryHookOptions<ApiKeysGetCurrentKeyMetadataQueryData>): UseSuspenseQueryResult<ApiKeysGetCurrentKeyMetadataQueryData, Error>;
|
|
21
|
-
export declare function prefetchApiKeysGetCurrentKeyMetadata(queryClient: QueryClient, client$: OpenRouterCore): Promise<void>;
|
|
22
|
-
export declare function setApiKeysGetCurrentKeyMetadataData(client: QueryClient, data: ApiKeysGetCurrentKeyMetadataQueryData): ApiKeysGetCurrentKeyMetadataQueryData | undefined;
|
|
23
|
-
export declare function invalidateAllApiKeysGetCurrentKeyMetadata(client: QueryClient, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
|
|
24
|
-
export declare function buildApiKeysGetCurrentKeyMetadataQuery(client$: OpenRouterCore, options?: RequestOptions): {
|
|
25
|
-
queryKey: QueryKey;
|
|
26
|
-
queryFn: (context: QueryFunctionContext) => Promise<ApiKeysGetCurrentKeyMetadataQueryData>;
|
|
27
|
-
};
|
|
28
|
-
export declare function queryKeyApiKeysGetCurrentKeyMetadata(): QueryKey;
|
|
29
|
-
//# sourceMappingURL=apiKeysGetCurrentKeyMetadata.d.ts.map
|
|
@@ -1,66 +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 { apiKeysGetCurrentKeyMetadata } from "../funcs/apiKeysGetCurrentKeyMetadata.js";
|
|
6
|
-
import { combineSignals } from "../lib/primitives.js";
|
|
7
|
-
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
-
import { useOpenRouterContext } from "./_context.js";
|
|
9
|
-
/**
|
|
10
|
-
* Get current API key
|
|
11
|
-
*
|
|
12
|
-
* @remarks
|
|
13
|
-
* Get information on the API key associated with the current authentication session
|
|
14
|
-
*/
|
|
15
|
-
export function useApiKeysGetCurrentKeyMetadata(options) {
|
|
16
|
-
const client = useOpenRouterContext();
|
|
17
|
-
return useQuery({
|
|
18
|
-
...buildApiKeysGetCurrentKeyMetadataQuery(client, options),
|
|
19
|
-
...options,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Get current API key
|
|
24
|
-
*
|
|
25
|
-
* @remarks
|
|
26
|
-
* Get information on the API key associated with the current authentication session
|
|
27
|
-
*/
|
|
28
|
-
export function useApiKeysGetCurrentKeyMetadataSuspense(options) {
|
|
29
|
-
const client = useOpenRouterContext();
|
|
30
|
-
return useSuspenseQuery({
|
|
31
|
-
...buildApiKeysGetCurrentKeyMetadataQuery(client, options),
|
|
32
|
-
...options,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
export function prefetchApiKeysGetCurrentKeyMetadata(queryClient, client$) {
|
|
36
|
-
return queryClient.prefetchQuery({
|
|
37
|
-
...buildApiKeysGetCurrentKeyMetadataQuery(client$),
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
export function setApiKeysGetCurrentKeyMetadataData(client, data) {
|
|
41
|
-
const key = queryKeyApiKeysGetCurrentKeyMetadata();
|
|
42
|
-
return client.setQueryData(key, data);
|
|
43
|
-
}
|
|
44
|
-
export function invalidateAllApiKeysGetCurrentKeyMetadata(client, filters) {
|
|
45
|
-
return client.invalidateQueries({
|
|
46
|
-
...filters,
|
|
47
|
-
queryKey: ["@openrouter/sdk", "API Keys", "getCurrentKeyMetadata"],
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
export function buildApiKeysGetCurrentKeyMetadataQuery(client$, options) {
|
|
51
|
-
return {
|
|
52
|
-
queryKey: queryKeyApiKeysGetCurrentKeyMetadata(),
|
|
53
|
-
queryFn: async function apiKeysGetCurrentKeyMetadataQueryFn(ctx) {
|
|
54
|
-
const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
|
|
55
|
-
const mergedOptions = {
|
|
56
|
-
...options,
|
|
57
|
-
fetchOptions: { ...options?.fetchOptions, signal: sig },
|
|
58
|
-
};
|
|
59
|
-
return unwrapAsync(apiKeysGetCurrentKeyMetadata(client$, mergedOptions));
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
export function queryKeyApiKeysGetCurrentKeyMetadata() {
|
|
64
|
-
return ["@openrouter/sdk", "API Keys", "getCurrentKeyMetadata"];
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=apiKeysGetCurrentKeyMetadata.js.map
|
|
@@ -1,37 +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 ApiKeysListQueryData = operations.ListResponse;
|
|
7
|
-
/**
|
|
8
|
-
* List API keys
|
|
9
|
-
*/
|
|
10
|
-
export declare function useApiKeysList(request?: operations.ListRequest | undefined, options?: QueryHookOptions<ApiKeysListQueryData>): UseQueryResult<ApiKeysListQueryData, Error>;
|
|
11
|
-
/**
|
|
12
|
-
* List API keys
|
|
13
|
-
*/
|
|
14
|
-
export declare function useApiKeysListSuspense(request?: operations.ListRequest | undefined, options?: SuspenseQueryHookOptions<ApiKeysListQueryData>): UseSuspenseQueryResult<ApiKeysListQueryData, Error>;
|
|
15
|
-
export declare function prefetchApiKeysList(queryClient: QueryClient, client$: OpenRouterCore, request?: operations.ListRequest | undefined): Promise<void>;
|
|
16
|
-
export declare function setApiKeysListData(client: QueryClient, queryKeyBase: [
|
|
17
|
-
parameters: {
|
|
18
|
-
includeDisabled?: string | undefined;
|
|
19
|
-
offset?: string | undefined;
|
|
20
|
-
}
|
|
21
|
-
], data: ApiKeysListQueryData): ApiKeysListQueryData | undefined;
|
|
22
|
-
export declare function invalidateApiKeysList(client: QueryClient, queryKeyBase: TupleToPrefixes<[
|
|
23
|
-
parameters: {
|
|
24
|
-
includeDisabled?: string | undefined;
|
|
25
|
-
offset?: string | undefined;
|
|
26
|
-
}
|
|
27
|
-
]>, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
|
|
28
|
-
export declare function invalidateAllApiKeysList(client: QueryClient, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">): Promise<void>;
|
|
29
|
-
export declare function buildApiKeysListQuery(client$: OpenRouterCore, request?: operations.ListRequest | undefined, options?: RequestOptions): {
|
|
30
|
-
queryKey: QueryKey;
|
|
31
|
-
queryFn: (context: QueryFunctionContext) => Promise<ApiKeysListQueryData>;
|
|
32
|
-
};
|
|
33
|
-
export declare function queryKeyApiKeysList(parameters: {
|
|
34
|
-
includeDisabled?: string | undefined;
|
|
35
|
-
offset?: string | undefined;
|
|
36
|
-
}): QueryKey;
|
|
37
|
-
//# sourceMappingURL=apiKeysList.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 { apiKeysList } from "../funcs/apiKeysList.js";
|
|
6
|
-
import { combineSignals } from "../lib/primitives.js";
|
|
7
|
-
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
-
import { useOpenRouterContext } from "./_context.js";
|
|
9
|
-
/**
|
|
10
|
-
* List API keys
|
|
11
|
-
*/
|
|
12
|
-
export function useApiKeysList(request, options) {
|
|
13
|
-
const client = useOpenRouterContext();
|
|
14
|
-
return useQuery({
|
|
15
|
-
...buildApiKeysListQuery(client, request, options),
|
|
16
|
-
...options,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* List API keys
|
|
21
|
-
*/
|
|
22
|
-
export function useApiKeysListSuspense(request, options) {
|
|
23
|
-
const client = useOpenRouterContext();
|
|
24
|
-
return useSuspenseQuery({
|
|
25
|
-
...buildApiKeysListQuery(client, request, options),
|
|
26
|
-
...options,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
export function prefetchApiKeysList(queryClient, client$, request) {
|
|
30
|
-
return queryClient.prefetchQuery({
|
|
31
|
-
...buildApiKeysListQuery(client$, request),
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
export function setApiKeysListData(client, queryKeyBase, data) {
|
|
35
|
-
const key = queryKeyApiKeysList(...queryKeyBase);
|
|
36
|
-
return client.setQueryData(key, data);
|
|
37
|
-
}
|
|
38
|
-
export function invalidateApiKeysList(client, queryKeyBase, filters) {
|
|
39
|
-
return client.invalidateQueries({
|
|
40
|
-
...filters,
|
|
41
|
-
queryKey: ["@openrouter/sdk", "API Keys", "list", ...queryKeyBase],
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
export function invalidateAllApiKeysList(client, filters) {
|
|
45
|
-
return client.invalidateQueries({
|
|
46
|
-
...filters,
|
|
47
|
-
queryKey: ["@openrouter/sdk", "API Keys", "list"],
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
export function buildApiKeysListQuery(client$, request, options) {
|
|
51
|
-
return {
|
|
52
|
-
queryKey: queryKeyApiKeysList({
|
|
53
|
-
includeDisabled: request?.includeDisabled,
|
|
54
|
-
offset: request?.offset,
|
|
55
|
-
}),
|
|
56
|
-
queryFn: async function apiKeysListQueryFn(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(apiKeysList(client$, request, mergedOptions));
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
export function queryKeyApiKeysList(parameters) {
|
|
67
|
-
return ["@openrouter/sdk", "API Keys", "list", parameters];
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=apiKeysList.js.map
|
|
@@ -1,20 +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 ApiKeysUpdateMutationVariables = {
|
|
7
|
-
request: operations.UpdateKeysRequest;
|
|
8
|
-
options?: RequestOptions;
|
|
9
|
-
};
|
|
10
|
-
export type ApiKeysUpdateMutationData = operations.UpdateKeysResponse;
|
|
11
|
-
/**
|
|
12
|
-
* Update an API key
|
|
13
|
-
*/
|
|
14
|
-
export declare function useApiKeysUpdateMutation(options?: MutationHookOptions<ApiKeysUpdateMutationData, Error, ApiKeysUpdateMutationVariables>): UseMutationResult<ApiKeysUpdateMutationData, Error, ApiKeysUpdateMutationVariables>;
|
|
15
|
-
export declare function mutationKeyApiKeysUpdate(): MutationKey;
|
|
16
|
-
export declare function buildApiKeysUpdateMutation(client$: OpenRouterCore, hookOptions?: RequestOptions): {
|
|
17
|
-
mutationKey: MutationKey;
|
|
18
|
-
mutationFn: (variables: ApiKeysUpdateMutationVariables) => Promise<ApiKeysUpdateMutationData>;
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=apiKeysUpdate.d.ts.map
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import { useMutation, } from "@tanstack/react-query";
|
|
5
|
-
import { apiKeysUpdate } from "../funcs/apiKeysUpdate.js";
|
|
6
|
-
import { combineSignals } from "../lib/primitives.js";
|
|
7
|
-
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
-
import { useOpenRouterContext } from "./_context.js";
|
|
9
|
-
/**
|
|
10
|
-
* Update an API key
|
|
11
|
-
*/
|
|
12
|
-
export function useApiKeysUpdateMutation(options) {
|
|
13
|
-
const client = useOpenRouterContext();
|
|
14
|
-
return useMutation({
|
|
15
|
-
...buildApiKeysUpdateMutation(client, options),
|
|
16
|
-
...options,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
export function mutationKeyApiKeysUpdate() {
|
|
20
|
-
return ["@openrouter/sdk", "API Keys", "update"];
|
|
21
|
-
}
|
|
22
|
-
export function buildApiKeysUpdateMutation(client$, hookOptions) {
|
|
23
|
-
return {
|
|
24
|
-
mutationKey: mutationKeyApiKeysUpdate(),
|
|
25
|
-
mutationFn: function apiKeysUpdateMutationFn({ request, options, }) {
|
|
26
|
-
const mergedOptions = {
|
|
27
|
-
...hookOptions,
|
|
28
|
-
...options,
|
|
29
|
-
fetchOptions: {
|
|
30
|
-
...hookOptions?.fetchOptions,
|
|
31
|
-
...options?.fetchOptions,
|
|
32
|
-
signal: combineSignals(hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal),
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
return unwrapAsync(apiKeysUpdate(client$, request, mergedOptions));
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=apiKeysUpdate.js.map
|
|
@@ -1,24 +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 models from "../models/index.js";
|
|
5
|
-
import * as operations from "../models/operations/index.js";
|
|
6
|
-
import { MutationHookOptions } from "./_types.js";
|
|
7
|
-
export type BetaResponsesSendMutationVariables = {
|
|
8
|
-
request: models.OpenResponsesRequest;
|
|
9
|
-
options?: RequestOptions;
|
|
10
|
-
};
|
|
11
|
-
export type BetaResponsesSendMutationData = operations.CreateResponsesResponse;
|
|
12
|
-
/**
|
|
13
|
-
* Create a response
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* Creates a streaming or non-streaming response using OpenResponses API format
|
|
17
|
-
*/
|
|
18
|
-
export declare function useBetaResponsesSendMutation(options?: MutationHookOptions<BetaResponsesSendMutationData, Error, BetaResponsesSendMutationVariables>): UseMutationResult<BetaResponsesSendMutationData, Error, BetaResponsesSendMutationVariables>;
|
|
19
|
-
export declare function mutationKeyBetaResponsesSend(): MutationKey;
|
|
20
|
-
export declare function buildBetaResponsesSendMutation(client$: OpenRouterCore, hookOptions?: RequestOptions): {
|
|
21
|
-
mutationKey: MutationKey;
|
|
22
|
-
mutationFn: (variables: BetaResponsesSendMutationVariables) => Promise<BetaResponsesSendMutationData>;
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=betaResponsesSend.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 { betaResponsesSend } from "../funcs/betaResponsesSend.js";
|
|
6
|
-
import { combineSignals } from "../lib/primitives.js";
|
|
7
|
-
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
-
import { useOpenRouterContext } from "./_context.js";
|
|
9
|
-
/**
|
|
10
|
-
* Create a response
|
|
11
|
-
*
|
|
12
|
-
* @remarks
|
|
13
|
-
* Creates a streaming or non-streaming response using OpenResponses API format
|
|
14
|
-
*/
|
|
15
|
-
export function useBetaResponsesSendMutation(options) {
|
|
16
|
-
const client = useOpenRouterContext();
|
|
17
|
-
return useMutation({
|
|
18
|
-
...buildBetaResponsesSendMutation(client, options),
|
|
19
|
-
...options,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
export function mutationKeyBetaResponsesSend() {
|
|
23
|
-
return ["@openrouter/sdk", "responses", "send"];
|
|
24
|
-
}
|
|
25
|
-
export function buildBetaResponsesSendMutation(client$, hookOptions) {
|
|
26
|
-
return {
|
|
27
|
-
mutationKey: mutationKeyBetaResponsesSend(),
|
|
28
|
-
mutationFn: function betaResponsesSendMutationFn({ 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(betaResponsesSend(client$, request, mergedOptions));
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=betaResponsesSend.js.map
|
|
@@ -1,24 +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 models from "../models/index.js";
|
|
5
|
-
import * as operations from "../models/operations/index.js";
|
|
6
|
-
import { MutationHookOptions } from "./_types.js";
|
|
7
|
-
export type ChatSendMutationVariables = {
|
|
8
|
-
request: models.ChatGenerationParams;
|
|
9
|
-
options?: RequestOptions;
|
|
10
|
-
};
|
|
11
|
-
export type ChatSendMutationData = operations.SendChatCompletionRequestResponse;
|
|
12
|
-
/**
|
|
13
|
-
* Create a chat completion
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
|
|
17
|
-
*/
|
|
18
|
-
export declare function useChatSendMutation(options?: MutationHookOptions<ChatSendMutationData, Error, ChatSendMutationVariables>): UseMutationResult<ChatSendMutationData, Error, ChatSendMutationVariables>;
|
|
19
|
-
export declare function mutationKeyChatSend(): MutationKey;
|
|
20
|
-
export declare function buildChatSendMutation(client$: OpenRouterCore, hookOptions?: RequestOptions): {
|
|
21
|
-
mutationKey: MutationKey;
|
|
22
|
-
mutationFn: (variables: ChatSendMutationVariables) => Promise<ChatSendMutationData>;
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=chatSend.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 { chatSend } from "../funcs/chatSend.js";
|
|
6
|
-
import { combineSignals } from "../lib/primitives.js";
|
|
7
|
-
import { unwrapAsync } from "../types/fp.js";
|
|
8
|
-
import { useOpenRouterContext } from "./_context.js";
|
|
9
|
-
/**
|
|
10
|
-
* Create a chat completion
|
|
11
|
-
*
|
|
12
|
-
* @remarks
|
|
13
|
-
* Sends a request for a model response for the given chat conversation. Supports both streaming and non-streaming modes.
|
|
14
|
-
*/
|
|
15
|
-
export function useChatSendMutation(options) {
|
|
16
|
-
const client = useOpenRouterContext();
|
|
17
|
-
return useMutation({
|
|
18
|
-
...buildChatSendMutation(client, options),
|
|
19
|
-
...options,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
export function mutationKeyChatSend() {
|
|
23
|
-
return ["@openrouter/sdk", "chat", "send"];
|
|
24
|
-
}
|
|
25
|
-
export function buildChatSendMutation(client$, hookOptions) {
|
|
26
|
-
return {
|
|
27
|
-
mutationKey: mutationKeyChatSend(),
|
|
28
|
-
mutationFn: function chatSendMutationFn({ 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(chatSend(client$, request, mergedOptions));
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=chatSend.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 models from "../models/index.js";
|
|
5
|
-
import { MutationHookOptions } from "./_types.js";
|
|
6
|
-
export type CompletionsGenerateMutationVariables = {
|
|
7
|
-
request: models.CompletionCreateParams;
|
|
8
|
-
options?: RequestOptions;
|
|
9
|
-
};
|
|
10
|
-
export type CompletionsGenerateMutationData = models.CompletionResponse;
|
|
11
|
-
/**
|
|
12
|
-
* Create a completion
|
|
13
|
-
*
|
|
14
|
-
* @remarks
|
|
15
|
-
* Creates a completion for the provided prompt and parameters. Supports both streaming and non-streaming modes.
|
|
16
|
-
*/
|
|
17
|
-
export declare function useCompletionsGenerateMutation(options?: MutationHookOptions<CompletionsGenerateMutationData, Error, CompletionsGenerateMutationVariables>): UseMutationResult<CompletionsGenerateMutationData, Error, CompletionsGenerateMutationVariables>;
|
|
18
|
-
export declare function mutationKeyCompletionsGenerate(): MutationKey;
|
|
19
|
-
export declare function buildCompletionsGenerateMutation(client$: OpenRouterCore, hookOptions?: RequestOptions): {
|
|
20
|
-
mutationKey: MutationKey;
|
|
21
|
-
mutationFn: (variables: CompletionsGenerateMutationVariables) => Promise<CompletionsGenerateMutationData>;
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=completionsGenerate.d.ts.map
|