Skip to content

Commit

Permalink
Regenerate all client code with the latest version of Orval
Browse files Browse the repository at this point in the history
All code changes here should be the result of using an updated Orval
version.
  • Loading branch information
kasperg committed Oct 10, 2023
1 parent 0604aa8 commit 3685783
Show file tree
Hide file tree
Showing 127 changed files with 1,717 additions and 793 deletions.
73 changes: 47 additions & 26 deletions src/core/cover-service-api/cover-service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.8.1 🍺
* Generated by orval v6.18.1 🍺
* Do not edit manually.
* DDF Cover Service
* This service provides covers for library materials indexed by isbn, issn, faust, pid.
Expand All @@ -8,58 +8,52 @@ The service is provided by [Det Digitale Folkebibliotek](https://detdigitalefolk
Authentication is done via OAuth2 against auth.dbc.dk. To obtain a valid token follow the instructions here: [Open Platform](https://openplatform.dbc.dk/v3/). To use the "Authorize" option in this tool use your 'client_id' and 'client_secret' and fill in '@agency' (e.g. '@123456') for both username and password.
* OpenAPI spec version: 2.0
*/
import {
useQuery,
import { useQuery } from "react-query";
import type {
UseQueryOptions,
QueryFunction,
UseQueryResult,
QueryKey
} from "react-query";
import type { Cover, GetCoverCollectionParams } from "./model";
import { fetcher, ErrorType, BodyType } from "./mutator/fetcher";

type AwaitedInput<T> = PromiseLike<T> | T;

type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
import { fetcher } from "./mutator/fetcher";
import type { ErrorType } from "./mutator/fetcher";

/**
* Get covers by identifier in specific image format(s), specific image size(s) and with or without generic covers.
* @summary Search multiple covers
*/
export const getCoverCollection = (
params?: GetCoverCollectionParams,
params: GetCoverCollectionParams,
signal?: AbortSignal
) => {
return fetcher<Cover[]>({
url: `/api/v2/covers`,
method: "get",
signal,
params
params,
signal
});
};

export const getGetCoverCollectionQueryKey = (
params?: GetCoverCollectionParams
) => [`/api/v2/covers`, ...(params ? [params] : [])];

export type GetCoverCollectionQueryResult = NonNullable<
Awaited<ReturnType<typeof getCoverCollection>>
>;
export type GetCoverCollectionQueryError = ErrorType<void>;
params: GetCoverCollectionParams
) => {
return [`/api/v2/covers`, ...(params ? [params] : [])] as const;
};

export const useGetCoverCollection = <
export const getGetCoverCollectionQueryOptions = <
TData = Awaited<ReturnType<typeof getCoverCollection>>,
TError = ErrorType<void>
>(
params?: GetCoverCollectionParams,
params: GetCoverCollectionParams,
options?: {
query?: UseQueryOptions<
Awaited<ReturnType<typeof getCoverCollection>>,
TError,
TData
>;
}
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
) => {
const { query: queryOptions } = options ?? {};

const queryKey =
Expand All @@ -69,14 +63,41 @@ export const useGetCoverCollection = <
Awaited<ReturnType<typeof getCoverCollection>>
> = ({ signal }) => getCoverCollection(params, signal);

const query = useQuery<
return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
Awaited<ReturnType<typeof getCoverCollection>>,
TError,
TData
>(queryKey, queryFn, queryOptions);
> & { queryKey: QueryKey };
};

export type GetCoverCollectionQueryResult = NonNullable<
Awaited<ReturnType<typeof getCoverCollection>>
>;
export type GetCoverCollectionQueryError = ErrorType<void>;

return {
queryKey,
...query
/**
* @summary Search multiple covers
*/
export const useGetCoverCollection = <
TData = Awaited<ReturnType<typeof getCoverCollection>>,
TError = ErrorType<void>
>(
params: GetCoverCollectionParams,
options?: {
query?: UseQueryOptions<
Awaited<ReturnType<typeof getCoverCollection>>,
TError,
TData
>;
}
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
const queryOptions = getGetCoverCollectionQueryOptions(params, options);

const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
queryKey: QueryKey;
};

query.queryKey = queryOptions.queryKey;

return query;
};
2 changes: 1 addition & 1 deletion src/core/cover-service-api/model/cover.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.8.1 🍺
* Generated by orval v6.18.1 🍺
* Do not edit manually.
* DDF Cover Service
* This service provides covers for library materials indexed by isbn, issn, faust, pid.
Expand Down
2 changes: 1 addition & 1 deletion src/core/cover-service-api/model/coverImageUrls.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.8.1 🍺
* Generated by orval v6.18.1 🍺
* Do not edit manually.
* DDF Cover Service
* This service provides covers for library materials indexed by isbn, issn, faust, pid.
Expand Down
2 changes: 1 addition & 1 deletion src/core/cover-service-api/model/coverType.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.8.1 🍺
* Generated by orval v6.18.1 🍺
* Do not edit manually.
* DDF Cover Service
* This service provides covers for library materials indexed by isbn, issn, faust, pid.
Expand Down
25 changes: 24 additions & 1 deletion src/core/cover-service-api/model/getCoverCollectionParams.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.8.1 🍺
* Generated by orval v6.18.1 🍺
* Do not edit manually.
* DDF Cover Service
* This service provides covers for library materials indexed by isbn, issn, faust, pid.
Expand All @@ -12,7 +12,30 @@ import type { GetCoverCollectionType } from "./getCoverCollectionType";
import type { GetCoverCollectionSizesItem } from "./getCoverCollectionSizesItem";

export type GetCoverCollectionParams = {
/**
* The type of the identifier, i.e. 'isbn', 'faust', 'pid' or 'issn'
*/
type: GetCoverCollectionType;
/**
* A list of identifiers of {type}. Maximum number os identifiers per reqeust is 200
*/
identifiers: string[];
/**
* A list of image sizes for the cover(s) you want to receive. Please note:
- If the cover is not available for the requested size 'null' will be returned for that size.
- If the 'sizes' parameter is omitted the 'default' size will be returned,
- If you request the 'original' size a cover will always be returned.
The different sizes in pixels (height).
- default: 1000px
- original: [variable]
- xx-small: 104px
- x-small: 136px
- small: 160px
- small-medium: 230px
- medium: 270px
- medium-large: 430px
- large: 540px
*/
sizes?: GetCoverCollectionSizesItem[];
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.8.1 🍺
* Generated by orval v6.18.1 🍺
* Do not edit manually.
* DDF Cover Service
* This service provides covers for library materials indexed by isbn, issn, faust, pid.
Expand Down
2 changes: 1 addition & 1 deletion src/core/cover-service-api/model/getCoverCollectionType.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.8.1 🍺
* Generated by orval v6.18.1 🍺
* Do not edit manually.
* DDF Cover Service
* This service provides covers for library materials indexed by isbn, issn, faust, pid.
Expand Down
2 changes: 1 addition & 1 deletion src/core/cover-service-api/model/imageUrl.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.8.1 🍺
* Generated by orval v6.18.1 🍺
* Do not edit manually.
* DDF Cover Service
* This service provides covers for library materials indexed by isbn, issn, faust, pid.
Expand Down
2 changes: 1 addition & 1 deletion src/core/cover-service-api/model/imageUrlSize.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Generated by orval v6.8.1 🍺
* Generated by orval v6.18.1 🍺
* Do not edit manually.
* DDF Cover Service
* This service provides covers for library materials indexed by isbn, issn, faust, pid.
Expand Down
17 changes: 14 additions & 3 deletions src/core/cover-service-api/model/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
/**
* Generated by orval v6.18.1 🍺
* Do not edit manually.
* DDF Cover Service
* This service provides covers for library materials indexed by isbn, issn, faust, pid.
The service is provided by [Det Digitale Folkebibliotek](https://detdigitalefolkebibliotek.dk/section/i-brug-paa-biblioteket/cover-service)
### Authentication notes
Authentication is done via OAuth2 against auth.dbc.dk. To obtain a valid token follow the instructions here: [Open Platform](https://openplatform.dbc.dk/v3/). To use the "Authorize" option in this tool use your 'client_id' and 'client_secret' and fill in '@agency' (e.g. '@123456') for both username and password.
* OpenAPI spec version: 2.0
*/

export * from "./cover";
export * from "./coverImageUrls";
export * from "./coverType";
export * from "./imageUrlSize";
export * from "./getCoverCollectionParams";
export * from "./getCoverCollectionSizesItem";
export * from "./imageUrl";
export * from "./coverImageUrls";
export * from "./getCoverCollectionType";
export * from "./imageUrl";
export * from "./imageUrlSize";
Loading

0 comments on commit 3685783

Please sign in to comment.