@cube-dev/platform-client 0.0.19
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/CHANGELOG.md +22 -0
- package/LICENCE +21 -0
- package/dist/core/client.d.ts +8 -0
- package/dist/core/client.d.ts.map +1 -0
- package/dist/core/client.js +30 -0
- package/dist/core/client.js.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +2 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/types.d.ts +21 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/react-query/CubePlatformApiProvider.d.ts +14 -0
- package/dist/react-query/CubePlatformApiProvider.d.ts.map +1 -0
- package/dist/react-query/CubePlatformApiProvider.js +12 -0
- package/dist/react-query/CubePlatformApiProvider.js.map +1 -0
- package/dist/react-query/deprecated.d.ts +31 -0
- package/dist/react-query/deprecated.d.ts.map +1 -0
- package/dist/react-query/deprecated.js +20 -0
- package/dist/react-query/deprecated.js.map +1 -0
- package/dist/react-query/hooks.d.ts +41 -0
- package/dist/react-query/hooks.d.ts.map +1 -0
- package/dist/react-query/hooks.js +85 -0
- package/dist/react-query/hooks.js.map +1 -0
- package/dist/react-query/index.d.ts +5 -0
- package/dist/react-query/index.d.ts.map +1 -0
- package/dist/react-query/index.js +5 -0
- package/dist/react-query/index.js.map +1 -0
- package/dist/react-query/types.d.ts +12 -0
- package/dist/react-query/types.d.ts.map +1 -0
- package/dist/react-query/types.js +2 -0
- package/dist/react-query/types.js.map +1 -0
- package/dist/schema.d.ts +3837 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +6 -0
- package/dist/schema.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +81 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@cube-dev/platform-client` are documented here.
|
|
4
|
+
|
|
5
|
+
This file is **curated for the public npm audience**: keep entries user-facing and
|
|
6
|
+
omit internal churn, private-package refactors, and anything that shouldn't be
|
|
7
|
+
surfaced to external consumers. Raw commits are only an input — see
|
|
8
|
+
`yarn changelog:commits` — never paste them in verbatim.
|
|
9
|
+
|
|
10
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
11
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
12
|
+
|
|
13
|
+
## [Unreleased]
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- `createCubePlatformClient` — the new name for the client factory.
|
|
18
|
+
- Cube Platform-branded type and hook names: `CubePlatformClient`, `CubePlatformClientConfig`, `PlatformApiSchemas`, and the react-query exports `CubePlatformApiProvider`, `useCubePlatformApi`, `useCubePlatformApiQuery`, `useCubePlatformApiSuspenseQuery`, `useCubePlatformApiMutation`, `useCubePlatformApiLazyQuery`, `useCubePlatformApiQueryOptions`, `CubePlatformApiQueryKey`, `UseCubePlatformApiLazyQueryResult`.
|
|
19
|
+
|
|
20
|
+
### Deprecated
|
|
21
|
+
|
|
22
|
+
- The former `CubeCloud*` / `ConsoleApiSchemas` names are deprecated in favor of the `CubePlatform*` / `PlatformApiSchemas` equivalents. All remain as aliases and will be removed in a future major version: `createCubeCloudApiClient`, `CubeCloudApiClient`, `CubeCloudApiClientConfig`, `ConsoleApiSchemas`, `CubeCloudApiProvider`, `CubeCloudApiProviderProps`, `useCubeCloudApi`, `useCubeCloudApiQuery`, `useCubeCloudApiSuspenseQuery`, `useCubeCloudApiMutation`, `useCubeCloudApiLazyQuery`, `useCubeCloudApiQueryOptions`, `CubeCloudApiQueryKey`, `UseCubeCloudApiLazyQueryResult`.
|
package/LICENCE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Cube Dev, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CubePlatformClient, CubePlatformClientConfig } from './types.js';
|
|
2
|
+
export declare function createCubePlatformClient(config: CubePlatformClientConfig): CubePlatformClient;
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Renamed to {@link createCubePlatformClient}. This alias will be
|
|
5
|
+
* removed in a future major version. Update imports to `createCubePlatformClient`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const createCubeCloudApiClient: typeof createCubePlatformClient;
|
|
8
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE/E,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,wBAAwB,GAAG,kBAAkB,CA2B7F;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,iCAA2B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import createFetchClient, {} from 'openapi-fetch';
|
|
2
|
+
export function createCubePlatformClient(config) {
|
|
3
|
+
const fetchClient = createFetchClient({
|
|
4
|
+
baseUrl: config.baseUrl,
|
|
5
|
+
});
|
|
6
|
+
if (config.getHeaders) {
|
|
7
|
+
const headerMiddleware = {
|
|
8
|
+
async onRequest({ request }) {
|
|
9
|
+
const headers = await config.getHeaders();
|
|
10
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
11
|
+
if (value !== undefined && value !== null) {
|
|
12
|
+
request.headers.set(key, String(value));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return request;
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
fetchClient.use(headerMiddleware);
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
fetchClient,
|
|
22
|
+
config,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Renamed to {@link createCubePlatformClient}. This alias will be
|
|
27
|
+
* removed in a future major version. Update imports to `createCubePlatformClient`.
|
|
28
|
+
*/
|
|
29
|
+
export const createCubeCloudApiClient = createCubePlatformClient;
|
|
30
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,EAAE,EAAmB,MAAM,eAAe,CAAC;AAKnE,MAAM,UAAU,wBAAwB,CAAC,MAAgC;IACvE,MAAM,WAAW,GAAG,iBAAiB,CAAQ;QAC3C,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACtB,MAAM,gBAAgB,GAAe;YACnC,KAAK,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE;gBACzB,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,UAAW,EAAE,CAAC;gBAE3C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;oBACnD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;wBAC1C,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;oBAC1C,CAAC;gBACH,CAAC;gBAED,OAAO,OAAO,CAAC;YACjB,CAAC;SACF,CAAC;QAEF,WAAW,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACpC,CAAC;IAED,OAAO;QACL,WAAW;QACX,MAAM;KACP,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createCubePlatformClient, createCubeCloudApiClient } from './client.js';
|
|
2
|
+
export type { CubePlatformClient, CubePlatformClientConfig } from './types.js';
|
|
3
|
+
export type { CubeCloudApiClient, CubeCloudApiClientConfig } from './types.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACjF,YAAY,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAG/E,YAAY,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Client } from 'openapi-fetch';
|
|
2
|
+
import type { paths } from '../schema.js';
|
|
3
|
+
export interface CubePlatformClientConfig {
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
getHeaders?: () => Promise<Record<string, string>> | Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
export interface CubePlatformClient {
|
|
8
|
+
fetchClient: Client<paths>;
|
|
9
|
+
config: CubePlatformClientConfig;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Renamed to {@link CubePlatformClientConfig}. This alias will be
|
|
13
|
+
* removed in a future major version.
|
|
14
|
+
*/
|
|
15
|
+
export type CubeCloudApiClientConfig = CubePlatformClientConfig;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Renamed to {@link CubePlatformClient}. This alias will be removed
|
|
18
|
+
* in a future major version.
|
|
19
|
+
*/
|
|
20
|
+
export type CubeCloudApiClient = CubePlatformClient;
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7E;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3B,MAAM,EAAE,wBAAwB,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,wBAAwB,CAAC;AAEhE;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { components } from './schema.js';
|
|
2
|
+
export { createCubePlatformClient, createCubeCloudApiClient, type CubePlatformClient, type CubePlatformClientConfig, type CubeCloudApiClient, type CubeCloudApiClientConfig, } from './core/index.js';
|
|
3
|
+
export type PlatformApiSchemas = components['schemas'];
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Renamed to {@link PlatformApiSchemas}. This alias will be removed
|
|
6
|
+
* in a future major version.
|
|
7
|
+
*/
|
|
8
|
+
export type ConsoleApiSchemas = PlatformApiSchemas;
|
|
9
|
+
export type { paths, operations } from './schema.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAE7B,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,GAC9B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAEnD,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GAMzB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type OpenapiQueryClient } from 'openapi-react-query';
|
|
3
|
+
import type { paths } from '../schema.js';
|
|
4
|
+
import type { CubePlatformClient } from '../core/types.js';
|
|
5
|
+
export interface CubePlatformApiContextValue {
|
|
6
|
+
queryClient: OpenapiQueryClient<paths>;
|
|
7
|
+
}
|
|
8
|
+
export declare const CubePlatformApiContext: import("react").Context<CubePlatformApiContextValue | null>;
|
|
9
|
+
export interface CubePlatformApiProviderProps {
|
|
10
|
+
client: CubePlatformClient;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function CubePlatformApiProvider({ client, children }: CubePlatformApiProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=CubePlatformApiProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubePlatformApiProvider.d.ts","sourceRoot":"","sources":["../../src/react-query/CubePlatformApiProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAC/D,OAAiC,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAExF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,WAAW,2BAA2B;IAC1C,WAAW,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,sBAAsB,6DAA0D,CAAC;AAE9F,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,uBAAuB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,4BAA4B,2CAUzF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useMemo } from 'react';
|
|
3
|
+
import createOpenApiQueryClient, {} from 'openapi-react-query';
|
|
4
|
+
export const CubePlatformApiContext = createContext(null);
|
|
5
|
+
export function CubePlatformApiProvider({ client, children }) {
|
|
6
|
+
const value = useMemo(() => {
|
|
7
|
+
const queryClient = createOpenApiQueryClient(client.fetchClient);
|
|
8
|
+
return { queryClient };
|
|
9
|
+
}, [client.fetchClient]);
|
|
10
|
+
return (_jsx(CubePlatformApiContext.Provider, { value: value, children: children }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=CubePlatformApiProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubePlatformApiProvider.js","sourceRoot":"","sources":["../../src/react-query/CubePlatformApiProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAkB,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,wBAAwB,EAAE,EAA2B,MAAM,qBAAqB,CAAC;AASxF,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAqC,IAAI,CAAC,CAAC;AAO9F,MAAM,UAAU,uBAAuB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAgC;IACxF,MAAM,KAAK,GAAG,OAAO,CAA8B,GAAG,EAAE;QACtD,MAAM,WAAW,GAAG,wBAAwB,CAAQ,MAAM,CAAC,WAAW,CAAC,CAAC;QAExE,OAAO,EAAE,WAAW,EAAE,CAAC;IACzB,CAAC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;IAEzB,OAAO,CACL,KAAC,sBAAsB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAAmC,CAC5F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useCubePlatformApi, useCubePlatformApiLazyQuery } from './hooks.js';
|
|
2
|
+
import { CubePlatformApiProvider } from './CubePlatformApiProvider.js';
|
|
3
|
+
import type { HttpMethod, PathsWithMethod } from 'openapi-typescript-helpers';
|
|
4
|
+
import type { CubePlatformApiProviderProps } from './CubePlatformApiProvider.js';
|
|
5
|
+
import type { CubePlatformApiQueryKey, UseCubePlatformApiLazyQueryResult } from './types.js';
|
|
6
|
+
import type { paths } from '../schema.js';
|
|
7
|
+
/** @deprecated Renamed to {@link CubePlatformApiProvider}. */
|
|
8
|
+
export declare const CubeCloudApiProvider: typeof CubePlatformApiProvider;
|
|
9
|
+
/** @deprecated Renamed to {@link CubePlatformApiProviderProps}. */
|
|
10
|
+
export type CubeCloudApiProviderProps = CubePlatformApiProviderProps;
|
|
11
|
+
/** @deprecated Renamed to {@link useCubePlatformApi}. */
|
|
12
|
+
export declare const useCubeCloudApi: typeof useCubePlatformApi;
|
|
13
|
+
/** @deprecated Renamed to {@link useCubePlatformApiQuery}. */
|
|
14
|
+
export declare const useCubeCloudApiQuery: <Method extends HttpMethod, Path extends PathsWithMethod<paths, Method>, Init extends import("openapi-fetch").MaybeOptionalInit<paths[Path], Method>, Response extends Required<import("openapi-fetch").FetchResponse<paths[Path][Method] & Record<string, any>, Init, import("openapi-typescript-helpers").MediaType>>, Options extends Omit<import("@tanstack/react-query").UseQueryOptions<Response['data'], any, Options["select"] extends infer T ? T extends Options["select"] ? T extends (data: Response["data"]) => infer R ? R : Response["data"] : never : never, any>, 'queryKey' | 'queryFn'>>(method: Method, url: Path, ...[init, options, queryClient]: import("openapi-typescript-helpers").RequiredKeysOf<Init> extends never ? [(Init & {
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
})?, Options?, import("@tanstack/query-core").QueryClient?] : [Init & {
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}, Options?, import("@tanstack/query-core").QueryClient?]) => import("@tanstack/react-query").UseQueryResult<Options["select"] extends infer T ? T extends Options["select"] ? T extends (data: Response["data"]) => infer R ? R : Response["data"] : never : never, any>;
|
|
19
|
+
/** @deprecated Renamed to {@link useCubePlatformApiSuspenseQuery}. */
|
|
20
|
+
export declare const useCubeCloudApiSuspenseQuery: import("openapi-react-query").UseSuspenseQueryMethod<paths, `${string}/${string}`>;
|
|
21
|
+
/** @deprecated Renamed to {@link useCubePlatformApiMutation}. */
|
|
22
|
+
export declare const useCubeCloudApiMutation: import("openapi-react-query").UseMutationMethod<paths, `${string}/${string}`>;
|
|
23
|
+
/** @deprecated Renamed to {@link useCubePlatformApiLazyQuery}. */
|
|
24
|
+
export declare const useCubeCloudApiLazyQuery: typeof useCubePlatformApiLazyQuery;
|
|
25
|
+
/** @deprecated Renamed to {@link useCubePlatformApiQueryOptions}. */
|
|
26
|
+
export declare const useCubeCloudApiQueryOptions: import("openapi-react-query").QueryOptionsFunction<paths, `${string}/${string}`>;
|
|
27
|
+
/** @deprecated Renamed to {@link CubePlatformApiQueryKey}. */
|
|
28
|
+
export type CubeCloudApiQueryKey<Method extends HttpMethod, Path extends PathsWithMethod<paths, Method>> = CubePlatformApiQueryKey<Method, Path>;
|
|
29
|
+
/** @deprecated Renamed to {@link UseCubePlatformApiLazyQueryResult}. */
|
|
30
|
+
export type UseCubeCloudApiLazyQueryResult<TData, TError> = UseCubePlatformApiLazyQueryResult<TData, TError>;
|
|
31
|
+
//# sourceMappingURL=deprecated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1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|
1
|
+
// Deprecated aliases for the react-query entry point. Kept for backward
|
|
2
|
+
// compatibility with the former `@cube-dev/console-public-sdk` names; these
|
|
3
|
+
// will be removed in a future major version.
|
|
4
|
+
import { useCubePlatformApi, useCubePlatformApiQuery, useCubePlatformApiSuspenseQuery, useCubePlatformApiMutation, useCubePlatformApiLazyQuery, useCubePlatformApiQueryOptions, } from './hooks.js';
|
|
5
|
+
import { CubePlatformApiProvider } from './CubePlatformApiProvider.js';
|
|
6
|
+
/** @deprecated Renamed to {@link CubePlatformApiProvider}. */
|
|
7
|
+
export const CubeCloudApiProvider = CubePlatformApiProvider;
|
|
8
|
+
/** @deprecated Renamed to {@link useCubePlatformApi}. */
|
|
9
|
+
export const useCubeCloudApi = useCubePlatformApi;
|
|
10
|
+
/** @deprecated Renamed to {@link useCubePlatformApiQuery}. */
|
|
11
|
+
export const useCubeCloudApiQuery = useCubePlatformApiQuery;
|
|
12
|
+
/** @deprecated Renamed to {@link useCubePlatformApiSuspenseQuery}. */
|
|
13
|
+
export const useCubeCloudApiSuspenseQuery = useCubePlatformApiSuspenseQuery;
|
|
14
|
+
/** @deprecated Renamed to {@link useCubePlatformApiMutation}. */
|
|
15
|
+
export const useCubeCloudApiMutation = useCubePlatformApiMutation;
|
|
16
|
+
/** @deprecated Renamed to {@link useCubePlatformApiLazyQuery}. */
|
|
17
|
+
export const useCubeCloudApiLazyQuery = useCubePlatformApiLazyQuery;
|
|
18
|
+
/** @deprecated Renamed to {@link useCubePlatformApiQueryOptions}. */
|
|
19
|
+
export const useCubeCloudApiQueryOptions = useCubePlatformApiQueryOptions;
|
|
20
|
+
//# sourceMappingURL=deprecated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecated.js","sourceRoot":"","sources":["../../src/react-query/deprecated.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,4EAA4E;AAC5E,6CAA6C;AAE7C,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,+BAA+B,EAC/B,0BAA0B,EAC1B,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAOvE,8DAA8D;AAC9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAI5D,yDAAyD;AACzD,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAClD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAC5D,sEAAsE;AACtE,MAAM,CAAC,MAAM,4BAA4B,GAAG,+BAA+B,CAAC;AAC5E,iEAAiE;AACjE,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AAClE,kEAAkE;AAClE,MAAM,CAAC,MAAM,wBAAwB,GAAG,2BAA2B,CAAC;AACpE,qEAAqE;AACrE,MAAM,CAAC,MAAM,2BAA2B,GAAG,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query';
|
|
2
|
+
import type { OpenapiQueryClient } from 'openapi-react-query';
|
|
3
|
+
import type { FetchResponse, MaybeOptionalInit } from 'openapi-fetch';
|
|
4
|
+
import type { HttpMethod, MediaType, PathsWithMethod, RequiredKeysOf } from 'openapi-typescript-helpers';
|
|
5
|
+
import type { paths } from '../schema.js';
|
|
6
|
+
import type { UseCubePlatformApiLazyQueryResult } from './types.js';
|
|
7
|
+
type CubePlatformQueryClient = OpenapiQueryClient<paths>;
|
|
8
|
+
type InitWithUnknowns<Init> = Init & {
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
};
|
|
11
|
+
type InferSelectReturnType<TData, TSelect> = TSelect extends (data: TData) => infer R ? R : TData;
|
|
12
|
+
type SafeOperation<T> = T & Record<string, any>;
|
|
13
|
+
/**
|
|
14
|
+
* UseQuery method type with error overridden to `any`.
|
|
15
|
+
* Copied from openapi-react-query's UseQueryMethod but with `any` error type.
|
|
16
|
+
*/
|
|
17
|
+
type UseQueryMethodWithAnyError = <Method extends HttpMethod, Path extends PathsWithMethod<paths, Method>, Init extends MaybeOptionalInit<paths[Path], Method>, Response extends Required<FetchResponse<SafeOperation<paths[Path][Method]>, Init, MediaType>>, Options extends Omit<UseQueryOptions<Response['data'], any, InferSelectReturnType<Response['data'], Options['select']>, any>, 'queryKey' | 'queryFn'>>(method: Method, url: Path, ...[init, options, queryClient]: RequiredKeysOf<Init> extends never ? [InitWithUnknowns<Init>?, Options?, QueryClient?] : [InitWithUnknowns<Init>, Options?, QueryClient?]) => UseQueryResult<InferSelectReturnType<Response['data'], Options['select']>, any>;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the OpenAPI query client with full type inference.
|
|
20
|
+
* Use this when you need the best type inference for method/path autocomplete.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* const $api = useCubePlatformApi();
|
|
24
|
+
* const { data } = $api.useQuery('get', '/api/v1/deployments/', ...);
|
|
25
|
+
*/
|
|
26
|
+
export declare function useCubePlatformApi(): CubePlatformQueryClient;
|
|
27
|
+
/**
|
|
28
|
+
* Hook for making GET/POST queries with full type inference.
|
|
29
|
+
* Error type is overridden to `any` for easier consumption.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* const { data } = useCubePlatformApiQuery('get', '/api/v1/deployments/');
|
|
33
|
+
*/
|
|
34
|
+
export declare const useCubePlatformApiQuery: UseQueryMethodWithAnyError;
|
|
35
|
+
export declare const useCubePlatformApiSuspenseQuery: CubePlatformQueryClient['useSuspenseQuery'];
|
|
36
|
+
export declare const useCubePlatformApiMutation: CubePlatformQueryClient['useMutation'];
|
|
37
|
+
export declare const useCubePlatformApiQueryOptions: CubePlatformQueryClient['queryOptions'];
|
|
38
|
+
type UseQueryParams = Parameters<CubePlatformQueryClient['useQuery']>;
|
|
39
|
+
export declare function useCubePlatformApiLazyQuery(...args: UseQueryParams): UseCubePlatformApiLazyQueryResult<unknown, unknown>;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/react-query/hooks.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,eAAe,EACf,cAAc,EACf,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,YAAY,CAAC;AAGpE,KAAK,uBAAuB,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;AAGzD,KAAK,gBAAgB,CAAC,IAAI,IAAI,IAAI,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAChE,KAAK,qBAAqB,CAAC,KAAK,EAAE,OAAO,IAAI,OAAO,SAAS,CAAC,IAAI,EAAE,KAAK,KAAK,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAIlG,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEhD;;;GAGG;AAEH,KAAK,0BAA0B,GAAG,CAChC,MAAM,SAAS,UAAU,EACzB,IAAI,SAAS,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,EAC3C,IAAI,SAAS,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,EACnD,QAAQ,SAAS,QAAQ,CAAC,aAAa,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AAE,OAAO,CAAC,CAyBrD"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { useContext, useCallback, useMemo } from 'react';
|
|
2
|
+
import createOpenApiQueryClient from 'openapi-react-query';
|
|
3
|
+
import { CubePlatformApiContext, } from './CubePlatformApiProvider.js';
|
|
4
|
+
function useCubePlatformApiContext() {
|
|
5
|
+
const context = useContext(CubePlatformApiContext);
|
|
6
|
+
if (!context) {
|
|
7
|
+
throw new Error('useCubePlatformApiQuery must be used within a CubePlatformApiProvider. ' +
|
|
8
|
+
'Wrap your component tree with <CubePlatformApiProvider client={client}>.');
|
|
9
|
+
}
|
|
10
|
+
return context.queryClient;
|
|
11
|
+
}
|
|
12
|
+
function useCubePlatformApiContextOptional() {
|
|
13
|
+
const context = useContext(CubePlatformApiContext);
|
|
14
|
+
return context?.queryClient ?? null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Returns the OpenAPI query client with full type inference.
|
|
18
|
+
* Use this when you need the best type inference for method/path autocomplete.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const $api = useCubePlatformApi();
|
|
22
|
+
* const { data } = $api.useQuery('get', '/api/v1/deployments/', ...);
|
|
23
|
+
*/
|
|
24
|
+
export function useCubePlatformApi() {
|
|
25
|
+
return useCubePlatformApiContext();
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Hook for making GET/POST queries with full type inference.
|
|
29
|
+
* Error type is overridden to `any` for easier consumption.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* const { data } = useCubePlatformApiQuery('get', '/api/v1/deployments/');
|
|
33
|
+
*/
|
|
34
|
+
export const useCubePlatformApiQuery = ((...args) => {
|
|
35
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
36
|
+
const queryClient = useCubePlatformApiContext();
|
|
37
|
+
return queryClient.useQuery(...args);
|
|
38
|
+
});
|
|
39
|
+
export const useCubePlatformApiSuspenseQuery = ((...args) => {
|
|
40
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
41
|
+
const queryClient = useCubePlatformApiContext();
|
|
42
|
+
const result = queryClient.useSuspenseQuery(...args);
|
|
43
|
+
return result;
|
|
44
|
+
});
|
|
45
|
+
export const useCubePlatformApiMutation = ((method, path, options, queryClient) => {
|
|
46
|
+
const { client, ...restOptions } = options ?? {};
|
|
47
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
48
|
+
const contextQueryClient = useCubePlatformApiContextOptional();
|
|
49
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
50
|
+
const directQueryClient = useMemo(() => {
|
|
51
|
+
if (client) {
|
|
52
|
+
return createOpenApiQueryClient(client.fetchClient);
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}, [client]);
|
|
56
|
+
const resolvedQueryClient = directQueryClient ?? contextQueryClient;
|
|
57
|
+
if (!resolvedQueryClient) {
|
|
58
|
+
throw new Error('useCubePlatformApiMutation requires either a client option or CubePlatformApiProvider. ' +
|
|
59
|
+
'Either pass { client } in options or wrap your component tree with <CubePlatformApiProvider client={client}>.');
|
|
60
|
+
}
|
|
61
|
+
return resolvedQueryClient.useMutation(method, path, restOptions, queryClient);
|
|
62
|
+
});
|
|
63
|
+
export const useCubePlatformApiQueryOptions = ((...args) => {
|
|
64
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
65
|
+
const queryClient = useCubePlatformApiContext();
|
|
66
|
+
return queryClient.queryOptions(...args);
|
|
67
|
+
});
|
|
68
|
+
export function useCubePlatformApiLazyQuery(...args) {
|
|
69
|
+
const [method, path, init, options, reactQueryClient] = args;
|
|
70
|
+
const result = useCubePlatformApiQuery(method, path, init,
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
|
+
{ ...options, enabled: false }, reactQueryClient);
|
|
73
|
+
const trigger = useCallback(async () => {
|
|
74
|
+
const { data } = await result.refetch();
|
|
75
|
+
return data;
|
|
76
|
+
}, [result]);
|
|
77
|
+
return {
|
|
78
|
+
trigger,
|
|
79
|
+
data: result.data,
|
|
80
|
+
isLoading: result.isFetching,
|
|
81
|
+
error: result.error,
|
|
82
|
+
isFetching: result.isFetching,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/react-query/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,wBAAwB,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EACL,sBAAsB,GAEvB,MAAM,8BAA8B,CAAC;AA0DtC,SAAS,yBAAyB;IAChC,MAAM,OAAO,GAAG,UAAU,CAAC,sBAAsB,CAAuC,CAAC;IAEzF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,yEAAyE;YACvE,0EAA0E,CAC7E,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC,WAAW,CAAC;AAC7B,CAAC;AAED,SAAS,iCAAiC;IACxC,MAAM,OAAO,GAAG,UAAU,CAAC,sBAAsB,CAAuC,CAAC;IAEzF,OAAO,OAAO,EAAE,WAAW,IAAI,IAAI,CAAC;AACtC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,yBAAyB,EAAE,CAAC;AACrC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CACtC,GAAG,IAAqD,EACxD,EAAE;IACF,sDAAsD;IACtD,MAAM,WAAW,GAAG,yBAAyB,EAAE,CAAC;IAEhD,OAAO,WAAW,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;AACvC,CAAC,CAA0C,CAAC;AAE5C,MAAM,CAAC,MAAM,+BAA+B,GAAgD,CAAC,CAC3F,GA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,CACzC,GAAG,IAAoB;IAEvB,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,CAAC,GAAG,IAAI,CAAC;IAE7D,MAAM,MAAM,GAAG,uBAAuB,CACpC,MAAM,EACN,IAAI,EACJ,IAAI;IACJ,8DAA8D;IAC9D,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAS,EACrC,gBAAgB,CACjB,CAAC;IAEF,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QACrC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;QAExC,OAAO,IAAI,CAAC;IACd,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO;QACL,OAAO;QACP,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,SAAS,EAAE,MAAM,CAAC,UAAU;QAC5B,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,UAAU,EAAE,MAAM,CAAC,UAAU;KAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { CubePlatformApiProvider, type CubePlatformApiProviderProps, } from './CubePlatformApiProvider.js';
|
|
2
|
+
export { useCubePlatformApi, useCubePlatformApiQuery, useCubePlatformApiSuspenseQuery, useCubePlatformApiMutation, useCubePlatformApiLazyQuery, useCubePlatformApiQueryOptions, } from './hooks.js';
|
|
3
|
+
export type { CubePlatformApiQueryKey, UseCubePlatformApiLazyQueryResult } from './types.js';
|
|
4
|
+
export * from './deprecated.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react-query/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,KAAK,4BAA4B,GAClC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,+BAA+B,EAC/B,0BAA0B,EAC1B,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,uBAAuB,EAAE,iCAAiC,EAAE,MAAM,YAAY,CAAC;AAG7F,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { CubePlatformApiProvider, } from './CubePlatformApiProvider.js';
|
|
2
|
+
export { useCubePlatformApi, useCubePlatformApiQuery, useCubePlatformApiSuspenseQuery, useCubePlatformApiMutation, useCubePlatformApiLazyQuery, useCubePlatformApiQueryOptions, } from './hooks.js';
|
|
3
|
+
// Deprecated aliases — kept for backward compatibility, removed in a future major.
|
|
4
|
+
export * from './deprecated.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react-query/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,GAExB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,+BAA+B,EAC/B,0BAA0B,EAC1B,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,YAAY,CAAC;AAGpB,mFAAmF;AACnF,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { HttpMethod, PathsWithMethod } from 'openapi-typescript-helpers';
|
|
2
|
+
import type { MaybeOptionalInit } from 'openapi-fetch';
|
|
3
|
+
import type { paths } from '../schema.js';
|
|
4
|
+
export type CubePlatformApiQueryKey<Method extends HttpMethod, Path extends PathsWithMethod<paths, Method>> = readonly [Method, Path, MaybeOptionalInit<paths[Path], Method>];
|
|
5
|
+
export interface UseCubePlatformApiLazyQueryResult<TData, TError> {
|
|
6
|
+
trigger: () => Promise<TData>;
|
|
7
|
+
data: TData | undefined;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
error: TError | null;
|
|
10
|
+
isFetching: boolean;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/react-query/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,MAAM,uBAAuB,CACjC,MAAM,SAAS,UAAU,EACzB,IAAI,SAAS,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,IACzC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAEpE,MAAM,WAAW,iCAAiC,CAAC,KAAK,EAAE,MAAM;IAC9D,OAAO,EAAE,MAAM,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,EAAE,KAAK,GAAG,SAAS,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/react-query/types.ts"],"names":[],"mappings":""}
|