From 53606f0494d1f469689e50a815202422daf01179 Mon Sep 17 00:00:00 2001 From: Kasper Birch Date: Tue, 9 Apr 2024 11:04:36 +0200 Subject: [PATCH 1/3] Update `orval` FBS client and execute `yarn codegen:client:fbs` - Incorporated a command to remove existing files in `src/core/fbs/model/*.*` before the execution of the `"codegen:client:fbs"` script. - Renamed `securitySchemes` to `securityDefinitions` for OpenAPI 2.0 compliance. - Updated fetcher methods to use uppercase naming convention. - Adjusted `invalidateQueries` for `getGetHoldingsV3QueryKey`, now requiring `recordId` parameter with added `faustIds`. --- package.json | 2 +- .../reservation/ReservationModalBody.tsx | 4 +- src/core/fbs/fbs-adapter.yaml | 3389 ++++++++--------- src/core/fbs/fbs.ts | 973 +++-- src/core/fbs/model/address.ts | 2 +- src/core/fbs/model/addressV2.ts | 2 +- src/core/fbs/model/agencyBranch.ts | 2 +- src/core/fbs/model/agencyDepartment.ts | 2 +- src/core/fbs/model/agencyLocation.ts | 2 +- src/core/fbs/model/agencySublocation.ts | 2 +- src/core/fbs/model/authenticatedPatronV4.ts | 2 +- src/core/fbs/model/authenticatedPatronV6.ts | 2 +- ...authenticatedPatronV6AuthenticateStatus.ts | 2 +- src/core/fbs/model/availabilityV3.ts | 2 +- src/core/fbs/model/blockStatus.ts | 2 +- src/core/fbs/model/booking.ts | 2 +- src/core/fbs/model/bookingInfo.ts | 2 +- src/core/fbs/model/createBooking.ts | 2 +- src/core/fbs/model/createPatronRequestV3.ts | 2 +- src/core/fbs/model/createReservation.ts | 2 +- src/core/fbs/model/createReservationBatch.ts | 2 +- .../fbs/model/createReservationBatchV2.ts | 2 +- .../fbs/model/deleteReservationsParams.ts | 9 +- src/core/fbs/model/feeMaterial.ts | 2 +- src/core/fbs/model/feeMaterialV2.ts | 2 +- src/core/fbs/model/feeV2.ts | 2 +- src/core/fbs/model/getAvailabilityV3Params.ts | 8 +- src/core/fbs/model/getBranchesParams.ts | 9 +- src/core/fbs/model/getFeesV2Params.ts | 10 +- src/core/fbs/model/getHoldingsV3Params.ts | 13 +- src/core/fbs/model/guardian.ts | 2 +- src/core/fbs/model/holdings.ts | 2 +- .../holdingsForBibliographicalRecordV3.ts | 2 +- src/core/fbs/model/holdingsV3.ts | 2 +- src/core/fbs/model/iLLBibliographicRecord.ts | 2 +- src/core/fbs/model/index.ts | 71 +- src/core/fbs/model/loanDetails.ts | 2 +- src/core/fbs/model/loanDetailsV2.ts | 2 +- src/core/fbs/model/loanV2.ts | 2 +- src/core/fbs/model/material.ts | 2 +- src/core/fbs/model/materialGroup.ts | 2 +- src/core/fbs/model/materialV3.ts | 2 +- src/core/fbs/model/patron.ts | 2 +- src/core/fbs/model/patronGroup.ts | 2 +- src/core/fbs/model/patronSettings.ts | 2 +- src/core/fbs/model/patronSettingsV3.ts | 2 +- src/core/fbs/model/patronSettingsV4.ts | 2 +- src/core/fbs/model/patronV3.ts | 2 +- src/core/fbs/model/patronV4.ts | 2 +- src/core/fbs/model/patronV5.ts | 2 +- .../fbs/model/patronWithGuardianRequest.ts | 2 +- src/core/fbs/model/period.ts | 2 +- src/core/fbs/model/periodical.ts | 2 +- src/core/fbs/model/periodicalReservation.ts | 2 +- src/core/fbs/model/pincodeChange.ts | 2 +- src/core/fbs/model/renewedLoanV2.ts | 2 +- src/core/fbs/model/reservationDetails.ts | 2 +- src/core/fbs/model/reservationDetailsV2.ts | 2 +- src/core/fbs/model/reservationResponseV2.ts | 2 +- src/core/fbs/model/reservationResult.ts | 2 +- src/core/fbs/model/reservationResultV2.ts | 2 +- src/core/fbs/model/updateGuardianRequest.ts | 2 +- src/core/fbs/model/updatePatronRequestV4.ts | 2 +- src/core/fbs/model/updateReservation.ts | 2 +- src/core/fbs/model/updateReservationBatch.ts | 2 +- src/core/fbs/mutator/fetcher.ts | 2 +- 66 files changed, 2502 insertions(+), 2098 deletions(-) diff --git a/package.json b/package.json index 7a10b28d37..0e1fd2f20f 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "cypress:open": "cypress open", "codegen:dbc:gateway": "CODEGEN_SCHEMA_PROFILE=next graphql-codegen -r dotenv/config --config dbc-gateway.codegen.yml", "codegen:rest-services": "orval", - "codegen:client:fbs": "orval --project fbsAdapter", + "codegen:client:fbs": "rm -rf src/core/fbs/model/*.* && orval --project fbsAdapter", "codegen:client:cover": "orval --project coverService", "codegen:client:publizon": "orval --project publizonAdapter", "codegen:client:dpl-cms": "rm -rf src/core/dpl-cms/model/*.* && orval --project dplCms", diff --git a/src/components/reservation/ReservationModalBody.tsx b/src/components/reservation/ReservationModalBody.tsx index 87146f8736..1f0b63477f 100644 --- a/src/components/reservation/ReservationModalBody.tsx +++ b/src/components/reservation/ReservationModalBody.tsx @@ -177,7 +177,9 @@ export const ReservationModalBody = ({ // This state is used to show the success or error modal. setReservationResponse(res); // Because after a successful reservation the holdings (reservations) are updated. - queryClient.invalidateQueries(getGetHoldingsV3QueryKey()); + queryClient.invalidateQueries( + getGetHoldingsV3QueryKey({ recordid: faustIds }) + ); } } ); diff --git a/src/core/fbs/fbs-adapter.yaml b/src/core/fbs/fbs-adapter.yaml index 9bf1a60ab6..04dbdd8b78 100644 --- a/src/core/fbs/fbs-adapter.yaml +++ b/src/core/fbs/fbs-adapter.yaml @@ -1,1712 +1,1689 @@ -swagger: '2.0' +swagger: "2.0" info: - title: 'FBS Adapter' - version: '1.0' + title: "FBS Adapter" + version: "1.0" basePath: / paths: - /external/v1/agencyid/branches: - get: - parameters: - - - description: 'Identifies the branchIds which are excluded from the result' - in: query - items: - type: string - name: exclude - type: array - responses: - 200: - description: 'No response was specified' - schema: - items: - $ref: '#/definitions/AgencyBranch' - type: array - 400: - description: 'bad request' - 401: - description: 'client unauthorized' - tags: - - external_v1_agencyid - description: "\n Returns array of branches.\n

Can be used for giving the patron the option of choosing a preferred branch or where to pick up\n reservations.

" - operationId: getBranches - summary: 'Get branches for an agency.' - /external/v1/agencyid/patrons/patronid/reservations: - delete: - parameters: - - - description: 'a list of reservation ids for reservations that are to be deleted' - in: query - items: - type: integer - name: reservationid - required: true - type: array - responses: - 200: - description: 'No response was specified' - 400: - description: 'bad request' - 401: - description: 'client unauthorized' - tags: - - external_v1_agencyid_patrons_patronid_reservations - operationId: deleteReservations - summary: 'Delete existing reservations.' - get: - responses: - 200: - description: 'No response was specified' - schema: - items: - $ref: '#/definitions/ReservationDetails' - type: array - 400: - description: 'bad request' - 401: - description: 'client unauthorized' - tags: - - external_v1_agencyid_patrons_patronid_reservations - description: "\n Returns an array of reservation details.\n

When the patron picks up the reserved materials,\n the reservation will no longer be returned.\n Expired or deleted reservations will not be returned.

\n\n The response contains reservation state, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other'\n .

\n The response contains loanType, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as 'loan'\n .

" - operationId: getReservations - summary: 'Get all unfulfilled reservations made by the patron (DEPRECATED).' - post: - parameters: - - - description: 'the reservations to be created' - in: body - name: createReservationBatch - required: true - schema: - $ref: '#/definitions/CreateReservationBatch' - responses: - 200: - description: 'No response was specified' - schema: - items: - $ref: '#/definitions/ReservationDetails' - type: array - 400: - description: 'bad request' - 401: - description: 'client unauthorized' - 404: - description: 'patron not found' - tags: - - external_v1_agencyid_patrons_patronid_reservations - description: "\n Returns an array of reservation details for the created reservations.\n

\n The response contains reservation state, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other'.

\n The response contains loanType, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other'\n .

\n

\n When making a reservation of a periodical, the values to put in the PeriodicalReservation structure can be obtained\n from the periodical information retrieved with the Catalog service.\n

\n

This method has been deprecated use /external/v1/{agencyid}/patrons/{patronid}/reservations/add instead

" - operationId: addReservationsDeprecated - summary: 'Create new reservations for the patron (DEPRECATED).' - put: - parameters: - - - description: 'the reservations to be updated' - in: body - name: reservations - required: true - schema: - $ref: '#/definitions/UpdateReservationBatch' - responses: - 200: - description: 'No response was specified' - schema: - items: - $ref: '#/definitions/ReservationDetails' - type: array - 400: - description: 'bad request' - 401: - description: 'client unauthorized' - tags: - - external_v1_agencyid_patrons_patronid_reservations - description: "\n Returns an array of the updated reservation details.\n

\n The response contains reservation state, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other'.

\n The response contains loanType, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other'\n .

" - operationId: updateReservations - summary: 'Update existing reservations.' - /external/v1/agencyid/patrons/patronid/reservations/v2: - get: - responses: - 200: - description: 'No response was specified' - schema: - items: - $ref: '#/definitions/ReservationDetailsV2' - type: array - 400: - description: 'bad request' - 401: - description: 'client unauthorized' - tags: - - external_v1_agencyid_patrons_patronid_reservations - description: "\n Returns an array of reservation details.\n

When the patron picks up the reserved materials,\n the reservation will no longer be returned.\n Expired or deleted reservations will not be returned.

\n\n The response contains reservation state, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other'\n .

\n The response contains reservationType, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, iit should be treated as 'normal'

\n

The response contains a transactionId, which links together parallel reservations.

" - operationId: getReservationsV2 - summary: 'Get all unfulfilled reservations made by the patron.' - post: - parameters: - - - description: 'the reservations to be created' - in: body - name: createReservationBatch - required: true - schema: - $ref: '#/definitions/CreateReservationBatchV2' - responses: - 200: - description: 'No response was specified' - schema: - $ref: '#/definitions/ReservationResponseV2' - 400: - description: 'bad request' - 401: - description: 'client unauthorized' - 404: - description: 'patron not found' - tags: - - external_v1_agencyid_patrons_patronid_reservations - description: "\n

Given a CreateReservationBatch, it creates a list of reservations and returns a ReservationResponse.

\n

The CreateReservationBatch.type indicates the reservation type of the request. If left out the request will be considered of type\n normal. The type can be any of the following values:

\n \n

The values are subject to change.

\n\n

ReservationResponse.success indicates if the reservations were created sucessfully. If any of the reservations have failed then all\n reservations will be failed and ReservationResponse.success will be false. If all reservations are successfully created ReservationResponse.success will be true.\n\n

\n\n

ReservationResponse.reservationResults contains details about each reservation.\n A ReservationResult.result has the status of a reservation and can be any of the following values:

\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as an error.

\n\n

\n\n The reservation detail in the response contains a reservation state, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other'.

\n\n

\n\n

\n When making a reservation of a periodical, the values to put in the PeriodicalReservation structure can be obtained\n from the periodical information retrieved with the Catalog service.\n

" - operationId: addReservationsV2 - summary: 'Create new reservations for the patron.' - /external/agencyid/catalog/availability/v3: - get: - parameters: - - - description: 'list of record ids' - in: query - items: - type: string - name: recordid - required: true - type: array - - - description: 'Identifies the branchIds which are excluded from the result' - in: query - items: - type: string - name: exclude - type: array - responses: - 200: - description: 'No response was specified' - schema: - items: - $ref: '#/definitions/AvailabilityV3' - type: array - 400: - description: 'bad request' - 401: - description: 'client unauthorized' - tags: - - external_agencyid_catalog - description: "\n Returns an array of availability for each bibliographical record." - operationId: getAvailabilityV3 - summary: 'Get availability of bibliographical records.' - /external/agencyid/catalog/holdings/v3: - get: - parameters: - - - description: 'Identifies the bibliographical records - The FAUST number.' - in: query - items: - type: string - name: recordid - required: true - type: array - - - description: 'Identifies the branchIds which are excluded from the result' - in: query - items: - type: string - name: exclude - type: array - responses: - 200: - description: 'No response was specified' - schema: - items: - $ref: '#/definitions/HoldingsForBibliographicalRecordV3' - type: array - 400: - description: 'bad request' - 401: - description: 'client unauthorized' - tags: - - external_agencyid_catalog - description: "\n Returns an array of holdings for each bibliographical record.\n The holdings lists the materials on each placement, and whether they are available on-shelf or lent out." - operationId: getHoldingsV3 - summary: 'Get placement holdings for bibliographical records.' - /external/agencyid/patron/patronid/fees/v2: - get: - parameters: - - - description: "true if all paid/unpaid fees should be included, false if only unpaid fees should\n be included; default=false" - in: query - name: includepaid - required: true - type: boolean - - - description: "true if fees that are not payable through a CMS system should be included (for read\n only access); default=false" - in: query - name: includenonpayable - required: true - type: boolean - responses: - 200: - description: 'No response was specified' - schema: - items: - $ref: '#/definitions/FeeV2' - type: array - 400: - description: 'bad request' - 401: - description: 'client unauthorized' - tags: - - external_agencyid_patron_patronid - description: "\n Returns array of fees.\n

If the fee covers loaned materials, information about the materials is returned.\n Each fee in the response includes a 'type', which is used to distinguish between different types of\n fees.

\n

If the material exists no more, which is the case for fees that are related to closed interlibraryloans,\n then the fee is still returned, but without material information

\n The list of available types currently is\n \n

While the type can be used by client systems to look up a suitable display message for the end user, it is\n important that unrecognized types are treated as 'other'.

" - operationId: getFeesV2 - summary: 'List of fees in FBS for the patron with all available information about the fee.' - /external/agencyid/patrons/v4: - post: - parameters: - - - description: 'the patron to be created' - in: body - name: createPatronRequest - required: true - schema: - $ref: '#/definitions/CreatePatronRequestV3' - responses: - 200: - description: 'No response was specified' - schema: - $ref: '#/definitions/AuthenticatedPatronV4' - 400: - description: 'bad request' - 401: - description: 'client unauthorized' - 404: - description: 'Data not found' - tags: - - external_agencyid_patrons - description: "\n When a patron doesn't have a patron account in the library system, but logs in using a trusted authentication\n source (e.g NemId), the patron account can be created using this service. Name and address will be automatically\n fetched from CPR-Registry, and cannot be supplied by the client. If the CPR-Registry is not authorized to\n provide information about the patron, then repsonse message 404 will be sent back\n

\n If a patron is blocked the reason is available as a code:\n \n

The codes are informational, and can be used for looking up end user messages by the client system. However,\n the list is subject to change at any time, so any unexpected values should be interpreted as 'other reason'.

" - operationId: createV4 - summary: 'Create a new patron who is a person.' - /external/agencyid/patrons/withGuardian/v1: - post: - parameters: - - - description: 'The payload with information for the patron to create' - in: body - name: patronWithGuardianRequest - required: true - schema: - $ref: '#/definitions/PatronWithGuardianRequest' - responses: - 200: - description: Ok - schema: - type: integer - 400: - description: 'bad request' - 401: - description: 'client unauthorized' - 404: - description: 'Data not found' - tags: - - external_agencyid_patrons - description: "\n\n Returns the id of the patron if the request succeeds.\n Name and address will be automatically fetched from the CPR-Registry.\n

If the CPR-Registry is not authorized to provide information about the patron, then response message 404 will be sent back.

\n

If the supplied cpr number of the patron equals that of the guardian, then response message 400 will be sent back.

\n

If the email of the guardian is invalid, then response message 400 will be sent back.

\n

If an email or phone number for the patron is supplied and it is invalid, then response message 400 will be sent back.

\n

In case of a successful creation of the patron, a confirmation email is sent to the guardian.\n In case of failure an email is sent to guardian stating the creation failed.

" - operationId: createWithGuardian - summary: 'Creates a person patron with a guardian (eg A financial responsible).' - put: - parameters: - - - description: 'The payload with information for the guardian update' - in: body - name: updateGuardianRequest - required: true - schema: - $ref: '#/definitions/UpdateGuardianRequest' - responses: - 200: - description: Ok - schema: - type: integer - 400: - description: 'bad request' - 401: - description: 'client unauthorized' - 404: - description: 'Data not found' - tags: - - external_agencyid_patrons - description: "\n If the person doesn't have a guardian, a new one is created with the information provided.\n\n Returns the id of the patron if the request succeeds.\n Name and address will be automatically fetched from the CPR-Registry.\n

If the CPR-Registry is not authorized to provide information about the patron and guardian, then response message 404 will be sent back.

\n

If the supplied cpr number of the patron equals that of the guardian, then response message 400 will be sent back.

\n

If the email of the guardian is invalid, then response message 400 will be sent back.

\n

In case of a successful update of the guardian, a confirmation email is sent to the guardian.\n In case of failure an email is sent to guardian stating the update failed.

" - operationId: updateGuardian - summary: "Updates a person patron's guardian (eg A financial responsible)." - /external/agencyid/patrons/patronid/loans/renew/v2: - post: - parameters: - - - description: 'a list of loanId to be renewed' - in: body - name: materialLoanIds - required: true - schema: - items: - type: integer - type: array - responses: - 200: - description: 'No response was specified' - schema: - items: - $ref: '#/definitions/RenewedLoanV2' - type: array - 400: - description: 'bad request' - 401: - description: 'client unauthorized' - 404: - description: 'patron not found' - tags: - - external_agencyid_patrons_patronid_loans - description: "\n Returns an array of the updated loans.\n

\n If the materials could not be renewed, the return date will be unchanged.\n

\n\n The response field renewalStatus will contain a list of one or more of these values:\n \n

\n If any other value is encountered then it must be treated as 'deniedOtherReason'.\n

\n The response contains the field loanDetails.loanType, which can be any of these values:\n \n

\n The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other' .\n

" - operationId: renewLoansV2 - summary: 'Renew loans.' - /external/agencyid/patrons/patronid/loans/v2: - get: - responses: - 200: - description: 'No response was specified' - schema: - items: - $ref: '#/definitions/LoanV2' - type: array - 400: - description: 'bad request' - 401: - description: 'client unauthorized' - 404: - description: 'patron not found' - tags: - - external_agencyid_patrons_patronid_loans - description: "\n Returns an array of loans.\n

\n

\n If a loan is not renewable then the field renewalStatus will contain a list of one or more of these values:\n \n

\n If any other value is encountered then it must be treated as 'deniedOtherReason'.\n

\n The response contains the field loanDetails.loanType, which can be any of these values:\n \n

\n The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other' .\n

\n

\n NOTE: Cicero can decide to skip evaluation of the returned loans to minimize response time for loaners with\n many loans. In that case isRenewable will have the value true, as if it were a successful validation.\n

" - operationId: getLoansV2 - summary: 'Get list of current loans by the patron.' - /external/agencyid/patrons/patronid/v2: - get: - responses: - 200: - description: 'No response was specified' - schema: - $ref: '#/definitions/AuthenticatedPatronV6' - 400: - description: 'bad request' - 401: - description: 'client unauthorized' - tags: - - external_agencyid_patrons - description: "\n

\n If a patron is blocked the reason is available as a code:\n \n

The codes are informational, and can be used for looking up end user messages by the client system. However,\n the list is subject to change at any time, so any unexpected values should be interpreted as 'other reason'.

" - operationId: getPatronInformationByPatronIdV2 - summary: 'Returns the patron details' - /external/agencyid/patrons/patronid/v5: - put: - parameters: - - - description: 'updated information about the patron' - in: body - name: updatePatron - required: true - schema: - $ref: '#/definitions/UpdatePatronRequestV4' - responses: - 200: - description: 'No response was specified' - schema: - $ref: '#/definitions/AuthenticatedPatronV6' - 400: - description: 'bad request' - 401: - description: 'client unauthorized' - 404: - description: 'patron not found' - tags: - - external_agencyid_patrons - description: "\n The name and address cannot be supplied by the client. If the CPR-Registry is not authorized to provide\n information about the patron, then the name and address will not be updated.\n

It is possible to either update just the pincode, update just some patron settings, or update both.

\n

\n If a patron is blocked the reason is available as a code:\n \n

The codes are informational, and can be used for looking up end user messages by the client system. However,\n the list is subject to change at any time, so any unexpected values should be interpreted as 'other reason'.

" - operationId: updateV5 - summary: 'Update information about the patron.' -securitySchemes: - oauth: - type: oauth2 - description: 'OAuth 2.0 password Grant' - flow: password - tokenUrl: 'https://login.bib.dk/oauth/token' + /external/v1/agencyid/branches: + get: + parameters: + - description: "Identifies the branchIds which are excluded from the result" + in: query + items: + type: string + name: exclude + type: array + responses: + 200: + description: "No response was specified" + schema: + items: + $ref: "#/definitions/AgencyBranch" + type: array + 400: + description: "bad request" + 401: + description: "client unauthorized" + tags: + - external_v1_agencyid + description: "\n Returns array of branches.\n

Can be used for giving the patron the option of choosing a preferred branch or where to pick up\n reservations.

" + operationId: getBranches + summary: "Get branches for an agency." + /external/v1/agencyid/patrons/patronid/reservations: + delete: + parameters: + - description: "a list of reservation ids for reservations that are to be deleted" + in: query + items: + type: integer + name: reservationid + required: true + type: array + responses: + 200: + description: "No response was specified" + 400: + description: "bad request" + 401: + description: "client unauthorized" + tags: + - external_v1_agencyid_patrons_patronid_reservations + operationId: deleteReservations + summary: "Delete existing reservations." + get: + responses: + 200: + description: "No response was specified" + schema: + items: + $ref: "#/definitions/ReservationDetails" + type: array + 400: + description: "bad request" + 401: + description: "client unauthorized" + tags: + - external_v1_agencyid_patrons_patronid_reservations + description: "\n Returns an array of reservation details.\n

When the patron picks up the reserved materials,\n the reservation will no longer be returned.\n Expired or deleted reservations will not be returned.

\n\n The response contains reservation state, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other'\n .

\n The response contains loanType, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as 'loan'\n .

" + operationId: getReservations + summary: "Get all unfulfilled reservations made by the patron (DEPRECATED)." + post: + parameters: + - description: "the reservations to be created" + in: body + name: createReservationBatch + required: true + schema: + $ref: "#/definitions/CreateReservationBatch" + responses: + 200: + description: "No response was specified" + schema: + items: + $ref: "#/definitions/ReservationDetails" + type: array + 400: + description: "bad request" + 401: + description: "client unauthorized" + 404: + description: "patron not found" + tags: + - external_v1_agencyid_patrons_patronid_reservations + description: "\n Returns an array of reservation details for the created reservations.\n

\n The response contains reservation state, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other'.

\n The response contains loanType, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other'\n .

\n

\n When making a reservation of a periodical, the values to put in the PeriodicalReservation structure can be obtained\n from the periodical information retrieved with the Catalog service.\n

\n

This method has been deprecated use /external/v1/{agencyid}/patrons/{patronid}/reservations/add instead

" + operationId: addReservationsDeprecated + summary: "Create new reservations for the patron (DEPRECATED)." + put: + parameters: + - description: "the reservations to be updated" + in: body + name: reservations + required: true + schema: + $ref: "#/definitions/UpdateReservationBatch" + responses: + 200: + description: "No response was specified" + schema: + items: + $ref: "#/definitions/ReservationDetails" + type: array + 400: + description: "bad request" + 401: + description: "client unauthorized" + tags: + - external_v1_agencyid_patrons_patronid_reservations + description: "\n Returns an array of the updated reservation details.\n

\n The response contains reservation state, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other'.

\n The response contains loanType, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other'\n .

" + operationId: updateReservations + summary: "Update existing reservations." + /external/v1/agencyid/patrons/patronid/reservations/v2: + get: + responses: + 200: + description: "No response was specified" + schema: + items: + $ref: "#/definitions/ReservationDetailsV2" + type: array + 400: + description: "bad request" + 401: + description: "client unauthorized" + tags: + - external_v1_agencyid_patrons_patronid_reservations + description: "\n Returns an array of reservation details.\n

When the patron picks up the reserved materials,\n the reservation will no longer be returned.\n Expired or deleted reservations will not be returned.

\n\n The response contains reservation state, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other'\n .

\n The response contains reservationType, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, iit should be treated as 'normal'

\n

The response contains a transactionId, which links together parallel reservations.

" + operationId: getReservationsV2 + summary: "Get all unfulfilled reservations made by the patron." + post: + parameters: + - description: "the reservations to be created" + in: body + name: createReservationBatch + required: true + schema: + $ref: "#/definitions/CreateReservationBatchV2" + responses: + 200: + description: "No response was specified" + schema: + $ref: "#/definitions/ReservationResponseV2" + 400: + description: "bad request" + 401: + description: "client unauthorized" + 404: + description: "patron not found" + tags: + - external_v1_agencyid_patrons_patronid_reservations + description: "\n

Given a CreateReservationBatch, it creates a list of reservations and returns a ReservationResponse.

\n

The CreateReservationBatch.type indicates the reservation type of the request. If left out the request will be considered of type\n normal. The type can be any of the following values:

\n \n

The values are subject to change.

\n\n

ReservationResponse.success indicates if the reservations were created sucessfully. If any of the reservations have failed then all\n reservations will be failed and ReservationResponse.success will be false. If all reservations are successfully created ReservationResponse.success will be true.\n\n

\n\n

ReservationResponse.reservationResults contains details about each reservation.\n A ReservationResult.result has the status of a reservation and can be any of the following values:

\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as an error.

\n\n

\n\n The reservation detail in the response contains a reservation state, which can be any of these values:\n \n

The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other'.

\n\n

\n\n

\n When making a reservation of a periodical, the values to put in the PeriodicalReservation structure can be obtained\n from the periodical information retrieved with the Catalog service.\n

" + operationId: addReservationsV2 + summary: "Create new reservations for the patron." + /external/agencyid/catalog/availability/v3: + get: + parameters: + - description: "list of record ids" + in: query + items: + type: string + name: recordid + required: true + type: array + - description: "Identifies the branchIds which are excluded from the result" + in: query + items: + type: string + name: exclude + type: array + responses: + 200: + description: "No response was specified" + schema: + items: + $ref: "#/definitions/AvailabilityV3" + type: array + 400: + description: "bad request" + 401: + description: "client unauthorized" + tags: + - external_agencyid_catalog + description: "\n Returns an array of availability for each bibliographical record." + operationId: getAvailabilityV3 + summary: "Get availability of bibliographical records." + /external/agencyid/catalog/holdings/v3: + get: + parameters: + - description: "Identifies the bibliographical records - The FAUST number." + in: query + items: + type: string + name: recordid + required: true + type: array + - description: "Identifies the branchIds which are excluded from the result" + in: query + items: + type: string + name: exclude + type: array + responses: + 200: + description: "No response was specified" + schema: + items: + $ref: "#/definitions/HoldingsForBibliographicalRecordV3" + type: array + 400: + description: "bad request" + 401: + description: "client unauthorized" + tags: + - external_agencyid_catalog + description: "\n Returns an array of holdings for each bibliographical record.\n The holdings lists the materials on each placement, and whether they are available on-shelf or lent out." + operationId: getHoldingsV3 + summary: "Get placement holdings for bibliographical records." + /external/agencyid/patron/patronid/fees/v2: + get: + parameters: + - description: "true if all paid/unpaid fees should be included, false if only unpaid fees should\n be included; default=false" + in: query + name: includepaid + required: true + type: boolean + - description: "true if fees that are not payable through a CMS system should be included (for read\n only access); default=false" + in: query + name: includenonpayable + required: true + type: boolean + responses: + 200: + description: "No response was specified" + schema: + items: + $ref: "#/definitions/FeeV2" + type: array + 400: + description: "bad request" + 401: + description: "client unauthorized" + tags: + - external_agencyid_patron_patronid + description: "\n Returns array of fees.\n

If the fee covers loaned materials, information about the materials is returned.\n Each fee in the response includes a 'type', which is used to distinguish between different types of\n fees.

\n

If the material exists no more, which is the case for fees that are related to closed interlibraryloans,\n then the fee is still returned, but without material information

\n The list of available types currently is\n \n

While the type can be used by client systems to look up a suitable display message for the end user, it is\n important that unrecognized types are treated as 'other'.

" + operationId: getFeesV2 + summary: "List of fees in FBS for the patron with all available information about the fee." + /external/agencyid/patrons/v4: + post: + parameters: + - description: "the patron to be created" + in: body + name: createPatronRequest + required: true + schema: + $ref: "#/definitions/CreatePatronRequestV3" + responses: + 200: + description: "No response was specified" + schema: + $ref: "#/definitions/AuthenticatedPatronV4" + 400: + description: "bad request" + 401: + description: "client unauthorized" + 404: + description: "Data not found" + tags: + - external_agencyid_patrons + description: "\n When a patron doesn't have a patron account in the library system, but logs in using a trusted authentication\n source (e.g NemId), the patron account can be created using this service. Name and address will be automatically\n fetched from CPR-Registry, and cannot be supplied by the client. If the CPR-Registry is not authorized to\n provide information about the patron, then repsonse message 404 will be sent back\n

\n If a patron is blocked the reason is available as a code:\n \n

The codes are informational, and can be used for looking up end user messages by the client system. However,\n the list is subject to change at any time, so any unexpected values should be interpreted as 'other reason'.

" + operationId: createV4 + summary: "Create a new patron who is a person." + /external/agencyid/patrons/withGuardian/v1: + post: + parameters: + - description: "The payload with information for the patron to create" + in: body + name: patronWithGuardianRequest + required: true + schema: + $ref: "#/definitions/PatronWithGuardianRequest" + responses: + 200: + description: Ok + schema: + type: integer + 400: + description: "bad request" + 401: + description: "client unauthorized" + 404: + description: "Data not found" + tags: + - external_agencyid_patrons + description: "\n\n Returns the id of the patron if the request succeeds.\n Name and address will be automatically fetched from the CPR-Registry.\n

If the CPR-Registry is not authorized to provide information about the patron, then response message 404 will be sent back.

\n

If the supplied cpr number of the patron equals that of the guardian, then response message 400 will be sent back.

\n

If the email of the guardian is invalid, then response message 400 will be sent back.

\n

If an email or phone number for the patron is supplied and it is invalid, then response message 400 will be sent back.

\n

In case of a successful creation of the patron, a confirmation email is sent to the guardian.\n In case of failure an email is sent to guardian stating the creation failed.

" + operationId: createWithGuardian + summary: "Creates a person patron with a guardian (eg A financial responsible)." + put: + parameters: + - description: "The payload with information for the guardian update" + in: body + name: updateGuardianRequest + required: true + schema: + $ref: "#/definitions/UpdateGuardianRequest" + responses: + 200: + description: Ok + schema: + type: integer + 400: + description: "bad request" + 401: + description: "client unauthorized" + 404: + description: "Data not found" + tags: + - external_agencyid_patrons + description: "\n If the person doesn't have a guardian, a new one is created with the information provided.\n\n Returns the id of the patron if the request succeeds.\n Name and address will be automatically fetched from the CPR-Registry.\n

If the CPR-Registry is not authorized to provide information about the patron and guardian, then response message 404 will be sent back.

\n

If the supplied cpr number of the patron equals that of the guardian, then response message 400 will be sent back.

\n

If the email of the guardian is invalid, then response message 400 will be sent back.

\n

In case of a successful update of the guardian, a confirmation email is sent to the guardian.\n In case of failure an email is sent to guardian stating the update failed.

" + operationId: updateGuardian + summary: "Updates a person patron's guardian (eg A financial responsible)." + /external/agencyid/patrons/patronid/loans/renew/v2: + post: + parameters: + - description: "a list of loanId to be renewed" + in: body + name: materialLoanIds + required: true + schema: + items: + type: integer + type: array + responses: + 200: + description: "No response was specified" + schema: + items: + $ref: "#/definitions/RenewedLoanV2" + type: array + 400: + description: "bad request" + 401: + description: "client unauthorized" + 404: + description: "patron not found" + tags: + - external_agencyid_patrons_patronid_loans + description: "\n Returns an array of the updated loans.\n

\n If the materials could not be renewed, the return date will be unchanged.\n

\n\n The response field renewalStatus will contain a list of one or more of these values:\n \n

\n If any other value is encountered then it must be treated as 'deniedOtherReason'.\n

\n The response contains the field loanDetails.loanType, which can be any of these values:\n \n

\n The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other' .\n

" + operationId: renewLoansV2 + summary: "Renew loans." + /external/agencyid/patrons/patronid/loans/v2: + get: + responses: + 200: + description: "No response was specified" + schema: + items: + $ref: "#/definitions/LoanV2" + type: array + 400: + description: "bad request" + 401: + description: "client unauthorized" + 404: + description: "patron not found" + tags: + - external_agencyid_patrons_patronid_loans + description: "\n Returns an array of loans.\n

\n

\n If a loan is not renewable then the field renewalStatus will contain a list of one or more of these values:\n \n

\n If any other value is encountered then it must be treated as 'deniedOtherReason'.\n

\n The response contains the field loanDetails.loanType, which can be any of these values:\n \n

\n The values are subject to change. If an unrecognized value is encountered, it should be treated as 'other' .\n

\n

\n NOTE: Cicero can decide to skip evaluation of the returned loans to minimize response time for loaners with\n many loans. In that case isRenewable will have the value true, as if it were a successful validation.\n

" + operationId: getLoansV2 + summary: "Get list of current loans by the patron." + /external/agencyid/patrons/patronid/v2: + get: + responses: + 200: + description: "No response was specified" + schema: + $ref: "#/definitions/AuthenticatedPatronV6" + 400: + description: "bad request" + 401: + description: "client unauthorized" + tags: + - external_agencyid_patrons + description: "\n

\n If a patron is blocked the reason is available as a code:\n \n

The codes are informational, and can be used for looking up end user messages by the client system. However,\n the list is subject to change at any time, so any unexpected values should be interpreted as 'other reason'.

" + operationId: getPatronInformationByPatronIdV2 + summary: "Returns the patron details" + /external/agencyid/patrons/patronid/v5: + put: + parameters: + - description: "updated information about the patron" + in: body + name: updatePatron + required: true + schema: + $ref: "#/definitions/UpdatePatronRequestV4" + responses: + 200: + description: "No response was specified" + schema: + $ref: "#/definitions/AuthenticatedPatronV6" + 400: + description: "bad request" + 401: + description: "client unauthorized" + 404: + description: "patron not found" + tags: + - external_agencyid_patrons + description: "\n The name and address cannot be supplied by the client. If the CPR-Registry is not authorized to provide\n information about the patron, then the name and address will not be updated.\n

It is possible to either update just the pincode, update just some patron settings, or update both.

\n

\n If a patron is blocked the reason is available as a code:\n \n

The codes are informational, and can be used for looking up end user messages by the client system. However,\n the list is subject to change at any time, so any unexpected values should be interpreted as 'other reason'.

" + operationId: updateV5 + summary: "Update information about the patron." +securityDefinitions: + oauth: + type: oauth2 + description: "OAuth 2.0 password Grant" + flow: password + tokenUrl: "https://login.bib.dk/oauth/token" security: - - - oauth: [] + - oauth: [] tags: - - - description: 'External Catalog' - name: external_agencyid_catalog - - - description: 'External Payment' - name: external_agencyid_patron_patronid - - - description: 'External Patron' - name: external_agencyid_patrons - - - description: 'External Material Loans' - name: external_agencyid_patrons_patronid_loans - - - description: 'External Placement' - name: external_v1_agencyid - - - description: 'External Reservations' - name: external_v1_agencyid_patrons_patronid_reservations + - description: "External Catalog" + name: external_agencyid_catalog + - description: "External Payment" + name: external_agencyid_patron_patronid + - description: "External Patron" + name: external_agencyid_patrons + - description: "External Material Loans" + name: external_agencyid_patrons_patronid_loans + - description: "External Placement" + name: external_v1_agencyid + - description: "External Reservations" + name: external_v1_agencyid_patrons_patronid_reservations definitions: - Address: - properties: - city: - type: string - country: - type: string - postalCode: - type: string - street: - description: 'Street and number' - type: string - required: - - country - - city - - street - - postalCode - AddressV2: - properties: - city: - description: City - type: string - coName: - description: 'c/o name' - type: string - country: - description: Country - type: string - postalCode: - description: 'Postal code' - type: string - street: - description: 'Street and number' - type: string - required: - - country - - city - - street - - coName - - postalCode - AgencyBranch: - properties: - branchId: - description: 'ISIL of branch (e.g. DK-761501)' - type: string - title: - description: 'Name of branch' - type: string - required: - - branchId - - title - AgencyDepartment: - properties: - departmentId: - description: 'Department identifier' - type: string - title: - description: 'Name of the department' - type: string - required: - - departmentId - - title - AgencyLocation: - properties: - locationId: - description: 'Location identifier' - type: string - title: - description: 'Name of the location' - type: string - required: - - locationId - - title - AgencySublocation: - properties: - sublocationId: - description: 'Sub-location identifier' - type: string - title: - description: 'Name of the sub-location' - type: string - required: - - title - - sublocationId - AuthenticatedPatronV4: - properties: - authenticated: - description: "True if patron successfully authenticated.\n If false then either the user is not known in the FBS, or an invalid combination of authentication parameters\n has been used." - type: boolean - patron: - $ref: '#/definitions/PatronV4' - description: 'Only available if patron exists in FBS and was succesfully authenticated.' - required: - - authenticated - AuthenticatedPatronV6: - properties: - authenticateStatus: - description: "AuthenticateStatus:\n " - enum: - - VALID - - INVALID - - LOANER_LOCKED_OUT - type: string - patron: - $ref: '#/definitions/PatronV5' - description: 'Only available if patron exists in FBS and was succesfully authenticated.' - required: - - authenticateStatus - AvailabilityV3: - properties: - available: - description: 'True if materials is available on-shelf at some placement, false if all materials are lent out' - type: boolean - recordId: - description: 'The FAUST number of the Bibliographic record' - type: string - reservable: - description: 'True if materials can be reserved' - type: boolean - reservations: - description: 'Total number of current active reservations of the Bibliographic record' - format: int64 - type: integer - required: - - recordId - - reservations - - reservable - - available - BlockStatus: - properties: - blockedReason: - description: 'Reason code for block' - type: string - blockedSince: - type: string - message: - description: 'Message about block' - type: string - required: - - blockedReason - - blockedSince - - message - Booking: - properties: - automaticForwardLoan: - description: 'True if automatic forward is active for this booking' - type: boolean - bookingId: - description: 'The booking identifier' - type: string - deliverBranchId: - description: 'The delivery branch identifier' - type: string - minimumMaterials: - description: 'The minimum number of materials' - format: int32 - type: integer - note: - description: 'Additional information about this booking' - type: string - patronGroupId: - description: 'The patron group ID for this booking' - format: int64 - type: integer - period: - $ref: '#/definitions/Period' - description: 'The booking period information containing the start and the end date' - preferredMaterials: - description: 'The preferred number of materials' - format: int32 - type: integer - recordId: - description: 'The record ID' - type: string - requestedFromBranchId: - description: 'The branch that provides the material for booking' - type: string - state: - description: 'The booking state' - type: string - required: - - recordId - - preferredMaterials - - period - - minimumMaterials - - patronGroupId - - automaticForwardLoan - - state - - requestedFromBranchId - - bookingId - - deliverBranchId - BookingInfo: - properties: - period: - $ref: '#/definitions/Period' - description: 'The booking period information containing the start and the end date' - preferredMaterials: - description: 'The preferred number of materials' - format: int32 - type: integer - required: - - preferredMaterials - - period - CreateBooking: - properties: - automaticForwardLoan: - description: 'True if automatic forward is active for this booking' - type: boolean - deliverBranchId: - description: 'The delivery branch identifier' - type: string - minimumMaterials: - description: 'The minimum number of materials' - format: int32 - type: integer - note: - description: 'Additional information about this booking' - type: string - patronGroupId: - description: 'The patron group ID for this booking' - format: int64 - type: integer - period: - $ref: '#/definitions/Period' - description: 'The booking period information containing the start and the end date' - preferredMaterials: - description: 'The preferred number of materials' - format: int32 - type: integer - recordId: - description: 'The record ID' - type: string - requestedFromBranchId: - description: 'The branch that provides the material for booking' - type: string - required: - - recordId - - preferredMaterials - - period - - minimumMaterials - - patronGroupId - - automaticForwardLoan - - requestedFromBranchId - - deliverBranchId - CreatePatronRequestV3: - properties: - cprNumber: - type: string - patron: - $ref: '#/definitions/PatronSettingsV3' - pincode: - type: string - required: - - cprNumber - - pincode - - patron - CreateReservation: - properties: - expiryDate: - description: "The date where the patron is no longer interested in the reserved material.\n If not set, a date will be calculated from the agency default interest period" - type: string - periodical: - $ref: '#/definitions/PeriodicalReservation' - description: 'Present if making reservation on a periodical' - pickupBranch: - description: "ISIL-number of pickup branch.\n If not set, will default to patrons preferred pickup branch" - type: string - recordId: - description: 'Identifies the bibliographical record to reserve - The FAUST number' - type: string - required: - - recordId - CreateReservationBatch: - properties: - reservations: - description: "Reservations with duplicate record id's will be removed." - items: - $ref: '#/definitions/CreateReservation' - type: array - required: - - reservations - CreateReservationBatchV2: - properties: - reservations: - description: "Reservations with duplicate record id's will be removed." - items: - $ref: '#/definitions/CreateReservation' - type: array - type: - description: 'Will be considered normal if not set' - type: string - required: - - reservations - FeeMaterial: - properties: - materialGroupName: - description: 'Name of the material group that the material belongs to' - type: string - materialItemNumber: - description: 'Identifies the exact material covered by the fee' - type: string - periodical: - $ref: '#/definitions/Periodical' - description: 'Present if material is a periodical' - recordId: - description: 'The FAUST number of the bibliographic record' - type: string - required: - - recordId - - materialGroupName - - materialItemNumber - FeeMaterialV2: - properties: - materialGroup: - $ref: '#/definitions/MaterialGroup' - description: 'The material group that the material belongs to' - materialItemNumber: - description: 'Identifies the exact material covered by the fee' - type: string - periodical: - $ref: '#/definitions/Periodical' - description: 'Present if material is a periodical' - recordId: - description: 'The FAUST number of the bibliographic record' - type: string - required: - - recordId - - materialGroup - - materialItemNumber - FeeV2: - properties: - amount: - description: 'The amount to pay, in the currency of the agency' - format: double - type: number - creationDate: - description: 'The date the fee was created' - type: string - dueDate: - description: 'Expected payment due date' - type: string - feeId: - description: 'Identifies the fee, used when registering a payment that covers the fee' - format: int64 - type: integer - materials: - description: 'Set if fee covers materials' - items: - $ref: '#/definitions/FeeMaterialV2' - type: array - paidDate: - description: 'If the fee has been paid in full, this will be set to the date of the final payment, otherwise not set' - type: string - payableByClient: - description: 'true if the client system is allowed to offer payment for the fee, false if not allowed' - type: boolean - reasonMessage: - description: "Human readable free text message about the reason for the fee, presentable to an end user (language is likely\n to be the mother tongue of the agency)" - type: string - type: - description: 'Can be used to distinguish between different types of fees' - type: string - required: - - payableByClient - - amount - - materials - - reasonMessage - - type - - creationDate - - feeId - Guardian: - properties: - address: - $ref: '#/definitions/Address' - cprNumber: - type: string - email: - description: 'Must be valid' - type: string - mobilePhoneNumber: - type: string - name: - description: 'The full name of the guardian' - type: string - required: - - cprNumber - - name - - email - Holdings: - properties: - branch: - $ref: '#/definitions/AgencyBranch' - description: 'Placement branch' - department: - $ref: '#/definitions/AgencyDepartment' - description: 'Placement department' - location: - $ref: '#/definitions/AgencyLocation' - description: 'Placement location' - materials: - description: 'Materials that belongs to this placement' - items: - $ref: '#/definitions/Material' - type: array - sublocation: - $ref: '#/definitions/AgencySublocation' - description: 'Placement sublocation' - required: - - materials - - branch - HoldingsForBibliographicalRecordV3: - properties: - holdings: - description: "An array of holdings for the materials matching the bibliographical record, as distributed across branches,\n departments and locations" - items: - $ref: '#/definitions/HoldingsV3' - type: array - recordId: - description: "Identifies the bibliographical record for the available materials,\n The FAUST number" - type: string - reservable: - description: 'True if there is any reservable materials' - type: boolean - reservations: - description: 'Total number of current active reservations for the bibliographical record' - format: int64 - type: integer - required: - - recordId - - reservations - - reservable - - holdings - HoldingsV3: - properties: - branch: - $ref: '#/definitions/AgencyBranch' - description: 'Placement branch' - department: - $ref: '#/definitions/AgencyDepartment' - description: 'Placement department' - location: - $ref: '#/definitions/AgencyLocation' - description: 'Placement location' - materials: - description: 'Materials that belongs to this placement' - items: - $ref: '#/definitions/MaterialV3' - type: array - sublocation: - $ref: '#/definitions/AgencySublocation' - description: 'Placement sublocation' - required: - - materials - - branch - ILLBibliographicRecord: - properties: - author: - description: 'The author of the material' - type: string - bibliographicCategory: - description: 'Bibliographic category from danMARC2 008 *t' - type: string - edition: - description: 'Edition-information from the bibliographic record' - type: string - isbn: - description: 'ISBN-information from the bibliographic record' - type: string - issn: - description: 'ISSN-information from the bibliographic record' - type: string - language: - description: 'Language of the requested material.' - type: string - mediumType: - description: 'Type of the requested material - from danMARC2 009 *a+*g (general and specific)' - type: string - periodicalNumber: - description: 'Issue number of a periodical' - type: string - periodicalVolume: - description: 'Volume name of a periodical' - type: string - placeOfPublication: - type: string - publicationDate: - description: 'Publication date of the requested material.' - type: string - publicationDateOfComponent: - description: 'Publication date of an item component, or article.' - type: string - publisher: - description: 'Publisher of the requested material.' - type: string - recordId: - description: 'The FAUST number' - type: string - title: - description: 'The title of the material' - type: string - required: - - recordId - - mediumType - LoanDetails: - properties: - dueDate: - description: 'The date when the material must be returned' - type: string - ilBibliographicRecord: - $ref: '#/definitions/ILLBibliographicRecord' - description: 'Additional bibliographic information for inter-library loans' - loanDate: - description: 'The date when the material was picked up' - type: string - loanId: - description: 'Identifies the loan for use when renewing the loan' - format: int64 - type: integer - loanType: - description: 'The loan type, either loan or interLibraryLoan' - type: string - materialGroupName: - description: 'Name of the material group that the material belongs to' - type: string - materialItemNumber: - description: 'Identifies the exact material that has been loaned' - type: string - periodical: - $ref: '#/definitions/Periodical' - description: 'Present if material is a periodical' - recordId: - description: 'The FAUST number of the bibliographic record' - type: string - required: - - recordId - - loanType - - dueDate - - loanDate - - materialGroupName - - materialItemNumber - - loanId - LoanDetailsV2: - properties: - dueDate: - description: 'The date when the material must be returned' - type: string - ilBibliographicRecord: - $ref: '#/definitions/ILLBibliographicRecord' - description: 'Additional bibliographic information for inter-library loans' - loanDate: - description: 'The date when the material was picked up' - type: string - loanId: - description: 'Identifies the loan for use when renewing the loan' - format: int64 - type: integer - loanType: - description: 'The loan type, either loan or interLibraryLoan' - type: string - materialGroup: - $ref: '#/definitions/MaterialGroup' - description: 'Material group that the material belongs to' - materialItemNumber: - description: 'Identifies the exact material that has been loaned' - type: string - periodical: - $ref: '#/definitions/Periodical' - description: 'Present if material is a periodical' - recordId: - description: 'The FAUST number of the bibliographic record' - type: string - required: - - recordId - - loanType - - materialGroup - - dueDate - - loanDate - - materialItemNumber - - loanId - LoanV2: - properties: - isLongtermLoan: - description: 'indicates whether this loan is a long term loan' - type: boolean - isRenewable: - description: 'indicates whether this loan can be renewed' - type: boolean - loanDetails: - $ref: '#/definitions/LoanDetailsV2' - description: 'The loan that was attempted renewed' - renewalStatusList: - description: 'if isRenewable == false then this states the reasons for denial' - items: - type: string - type: array - required: - - isRenewable - - loanDetails - - isLongtermLoan - - renewalStatusList - Material: - properties: - available: - description: 'True if material is available on-shelf, false if lent out' - type: boolean - itemNumber: - description: 'Identifies the material' - type: string - materialGroupName: - description: 'Name of the material group that the material belongs to' - type: string - periodical: - $ref: '#/definitions/Periodical' - description: 'Present if material is a periodical' - required: - - itemNumber - - available - - materialGroupName - MaterialGroup: - properties: - description: - description: 'Description of the material group' - type: string - name: - description: 'Name of the material group' - type: string - required: - - name - MaterialV3: - properties: - available: - description: 'True if material is available on-shelf, false if lent out' - type: boolean - itemNumber: - description: 'Identifies the material' - type: string - materialGroup: - $ref: '#/definitions/MaterialGroup' - description: 'Name of the material group that the material belongs to' - periodical: - $ref: '#/definitions/Periodical' - description: 'Present if material is a periodical' - required: - - itemNumber - - materialGroup - - available - Patron: - properties: - address: - $ref: '#/definitions/Address' - allowBookings: - description: 'True if the user is allowed to create bookings.' - type: boolean - birthday: - type: string - blockStatus: - description: "A list of block statuses -\n if the patron is not blocked then this value is empty or null" - items: - $ref: '#/definitions/BlockStatus' - type: array - coAddress: - $ref: '#/definitions/Address' - defaultInterestPeriod: - description: 'Length of default interest period in days' - format: int32 - type: integer - emailAddress: - type: string - name: - type: string - onHold: - $ref: '#/definitions/Period' - description: 'If not set then the patron is not on hold' - patronId: - description: 'Patron identifier to be used in subsequent service calls involving the patron' - format: int64 - type: integer - phoneNumber: - type: string - preferredPickupBranch: - description: 'ISIL of preferred pickup branch' - type: string - receiveEmail: - type: boolean - receivePostalMail: - description: 'This field is deprecated and is no longer used' - type: boolean - receiveSms: - type: boolean - resident: - description: 'True if the user is resident in the same municipality as the library' - type: boolean - required: - - preferredPickupBranch - - patronId - - receiveEmail - - receiveSms - - receivePostalMail - - defaultInterestPeriod - - resident - PatronGroup: - properties: - childGroups: - description: 'The array of child groups of this group' - items: - $ref: '#/definitions/PatronGroup' - type: array - description: - description: 'The description of the group' - type: string - membersCount: - description: 'The number of all members in this group, including descendants' - format: int64 - type: integer - name: - description: 'The name of the group' - type: string - patronGroupId: - description: 'The patron group identifier' - format: int64 - type: integer - required: - - membersCount - - patronGroupId - - name - - description - PatronSettings: - properties: - emailAddress: - description: "Required if patron should receive email notifications\n Existing email addresses are overwritten with this value\n If left empty existing email addresses are deleted" - type: string - onHold: - $ref: '#/definitions/Period' - description: 'If not set then the patron is not on hold' - phoneNumber: - description: "Required if patron should receive SMS notifications\n Existing phonenumbers are overwritten with this value\n If left empty existing phonenumbers are deleted" - type: string - preferredPickupBranch: - description: 'ISIL-number of preferred pickup branch' - type: string - receiveEmail: - type: boolean - receivePostalMail: - description: 'This field is deprecated and is no longer used' - type: boolean - receiveSms: - type: boolean - required: - - preferredPickupBranch - - receiveEmail - - receivePostalMail - - receiveSms - PatronSettingsV3: - properties: - emailAddress: - description: "Required if patron should receive email notifications\n Existing email addresses are overwritten with this value\n If left empty existing email addresses are deleted" - type: string - onHold: - $ref: '#/definitions/Period' - description: 'If not set then the patron is not on hold' - phoneNumber: - description: "Required if patron should receive SMS notifications\n Existing phonenumbers are overwritten with this value\n If left empty existing phonenumbers are deleted" - type: string - preferredLanguage: - description: "Language in which the patron prefers the communication with the library to take place\n If left empty default library language will be used" - type: string - preferredPickupBranch: - description: 'ISIL-number of preferred pickup branch' - type: string - receiveEmail: - type: boolean - receivePostalMail: - type: boolean - receiveSms: - type: boolean - required: - - preferredPickupBranch - - receiveEmail - - receivePostalMail - - receiveSms - PatronSettingsV4: - properties: - emailAddress: - description: "Required if patron should receive email notifications\n Existing email addresses are overwritten with this value\n If left empty existing email addresses are deleted" - type: string - notificationProtocols: - description: 'Notification protocols that the patron want to receive notification on. SMS and EMAIL are not included.' - items: - type: string - type: array - onHold: - $ref: '#/definitions/Period' - description: 'If not set then the patron is not on hold' - phoneNumber: - description: "Required if patron should receive SMS notifications\n Existing phonenumbers are overwritten with this value\n If left empty existing phonenumbers are deleted" - type: string - preferredLanguage: - description: "Language in which the patron prefers the communication with the library to take place\n If left empty default library language will be used" - type: string - preferredPickupBranch: - description: 'ISIL-number of preferred pickup branch' - type: string - receiveEmail: - type: boolean - receivePostalMail: - type: boolean - receiveSms: - type: boolean - required: - - preferredPickupBranch - - receiveEmail - - receivePostalMail - - receiveSms - PatronV3: - properties: - address: - $ref: '#/definitions/Address' - allowBookings: - description: 'True if the user is allowed to create bookings.' - type: boolean - birthday: - type: string - blockStatus: - description: "A list of block statuses -\n if the patron is not blocked then this value is empty or null" - items: - $ref: '#/definitions/BlockStatus' - type: array - defaultInterestPeriod: - description: 'Length of default interest period in days' - format: int32 - type: integer - emailAddress: - type: string - name: - type: string - onHold: - $ref: '#/definitions/Period' - description: 'If not set then the patron is not on hold' - patronId: - description: 'Patron identifier to be used in subsequent service calls involving the patron' - format: int64 - type: integer - phoneNumber: - type: string - preferredLanguage: - description: 'Language in which the patron prefers the communication with the library to take place' - type: string - preferredPickupBranch: - description: 'ISIL of preferred pickup branch' - type: string - receiveEmail: - type: boolean - receivePostalMail: - type: boolean - receiveSms: - type: boolean - resident: - description: 'True if the user is resident in the same municipality as the library' - type: boolean - secondaryAddress: - $ref: '#/definitions/Address' - required: - - preferredPickupBranch - - patronId - - receiveEmail - - receiveSms - - receivePostalMail - - defaultInterestPeriod - - resident - PatronV4: - properties: - address: - $ref: '#/definitions/AddressV2' - allowBookings: - description: 'True if the user is allowed to create bookings.' - type: boolean - birthday: - type: string - blockStatus: - description: "A list of block statuses -\n if the patron is not blocked then this value is empty or null" - items: - $ref: '#/definitions/BlockStatus' - type: array - defaultInterestPeriod: - description: 'Length of default interest period in days' - format: int32 - type: integer - emailAddress: - type: string - name: - type: string - onHold: - $ref: '#/definitions/Period' - description: 'If not set then the patron is not on hold' - patronId: - description: 'Patron identifier to be used in subsequent service calls involving the patron' - format: int64 - type: integer - phoneNumber: - type: string - preferredLanguage: - description: 'Language in which the patron prefers the communication with the library to take place' - type: string - preferredPickupBranch: - description: 'ISIL of preferred pickup branch' - type: string - receiveEmail: - type: boolean - receivePostalMail: - type: boolean - receiveSms: - type: boolean - resident: - description: 'True if the user is resident in the same municipality as the library' - type: boolean - secondaryAddress: - $ref: '#/definitions/AddressV2' - required: - - preferredPickupBranch - - patronId - - receiveEmail - - receiveSms - - receivePostalMail - - defaultInterestPeriod - - resident - PatronV5: - properties: - address: - $ref: '#/definitions/AddressV2' - allowBookings: - description: 'True if the user is allowed to create bookings.' - type: boolean - birthday: - type: string - blockStatus: - description: "A list of block statuses -\n if the patron is not blocked then this value is empty or null" - items: - $ref: '#/definitions/BlockStatus' - type: array - defaultInterestPeriod: - description: 'Length of default interest period in days' - format: int32 - type: integer - emailAddress: - type: string - name: - type: string - notificationProtocols: - description: 'Notification protocols that the patron want to receive notification on. SMS and EMAIL are not included.' - items: - type: string - type: array - onHold: - $ref: '#/definitions/Period' - description: 'If not set then the patron is not on hold' - patronId: - description: 'Patron identifier to be used in subsequent service calls involving the patron' - format: int64 - type: integer - phoneNumber: - type: string - preferredLanguage: - description: 'Language in which the patron prefers the communication with the library to take place' - type: string - preferredPickupBranch: - description: 'ISIL of preferred pickup branch' - type: string - receiveEmail: - type: boolean - receivePostalMail: - type: boolean - receiveSms: - type: boolean - resident: - description: 'True if the user is resident in the same municipality as the library' - type: boolean - secondaryAddress: - $ref: '#/definitions/AddressV2' - required: - - preferredPickupBranch - - patronId - - receiveEmail - - receiveSms - - receivePostalMail - - defaultInterestPeriod - - resident - PatronWithGuardianRequest: - properties: - address: - $ref: '#/definitions/Address' - cprNumber: - type: string - email: - description: 'Must be valid if supplied' - type: string - guardian: - $ref: '#/definitions/Guardian' - name: - description: 'The full name of the patron' - type: string - phoneNumber: - description: 'Must be valid if supplied' - type: string - pincode: - type: string - preferredPickupBranch: - description: 'Must be a valid branch id (eg. DK-761501)' - type: string - required: - - cprNumber - - pincode - - preferredPickupBranch - - name - - guardian - Period: - properties: - from: - description: 'Open-ended if not set' - type: string - to: - description: 'Open-ended if not set' - type: string - Periodical: - properties: - displayText: - description: 'A representation of the periodica volume information that is suitable for display' - type: string - volume: - type: string - volumeNumber: - type: string - volumeYear: - type: string - required: - - displayText - PeriodicalReservation: - properties: - volume: - type: string - volumeNumber: - type: string - volumeYear: - type: string - PincodeChange: - properties: - libraryCardNumber: - description: "Identifies the libraryCard for which the pincode is to be changed.\n This can be either a physical card or the CPR number, that is used as a libraryCard" - type: string - pincode: - description: 'The new pincode for the libraryCard' - type: string - required: - - pincode - - libraryCardNumber - RenewedLoanV2: - properties: - loanDetails: - $ref: '#/definitions/LoanDetailsV2' - description: 'The loan that was attempted renewed' - renewalStatus: - description: 'indicates if renewal was succesful or denied - including the reason for denial.' - items: - type: string - type: array - required: - - loanDetails - - renewalStatus - ReservationDetails: - properties: - dateOfReservation: - type: string - expiryDate: - description: 'The date when the patron is no longer interested in the reserved material' - type: string - ilBibliographicRecord: - $ref: '#/definitions/ILLBibliographicRecord' - description: 'Additional bibliographic information for inter-library loans' - loanType: - type: string - numberInQueue: - description: 'The number in the reservation queue.' - format: int32 - type: integer - periodical: - $ref: '#/definitions/Periodical' - description: 'Present if material is a periodical' - pickupBranch: - description: 'ISIL-number of pickup branch' - type: string - pickupDeadline: - description: 'Set if reserved material is available for loan' - type: string - pickupNumber: - description: "The reservation number. Will be present if the reservation is ready for pickup (the state is 'readyForPickup')" - type: string - recordId: - description: 'The FAUST number' - type: string - reservationId: - description: 'Identifies the reservation for use when updating or deleting the reservation' - format: int64 - type: integer - state: - type: string - required: - - recordId - - pickupBranch - - expiryDate - - reservationId - - loanType - - dateOfReservation - - state - ReservationDetailsV2: - properties: - dateOfReservation: - type: string - expiryDate: - description: 'The date when the patron is no longer interested in the reserved material' - type: string - ilBibliographicRecord: - $ref: '#/definitions/ILLBibliographicRecord' - description: 'Additional bibliographic information for inter-library loans' - numberInQueue: - description: 'The number in the reservation queue.' - format: int32 - type: integer - periodical: - $ref: '#/definitions/Periodical' - description: 'Present if material is a periodical' - pickupBranch: - description: 'ISIL-number of pickup branch' - type: string - pickupDeadline: - description: 'Set if reserved material is available for loan' - type: string - pickupNumber: - description: "The reservation number. Will be present if the reservation is ready for pickup (the state is 'readyForPickup')" - type: string - recordId: - description: 'The FAUST number' - type: string - reservationId: - description: 'Identifies the reservation for use when updating or deleting the reservation' - format: int64 - type: integer - reservationType: - type: string - state: - type: string - transactionId: - description: 'Identifies the transaction of reservations' - type: string - required: - - pickupBranch - - dateOfReservation - - transactionId - - recordId - - expiryDate - - reservationId - - reservationType - - state - ReservationResponseV2: - properties: - reservationResults: - description: 'Result of each reservation' - items: - $ref: '#/definitions/ReservationResultV2' - type: array - success: - description: 'True if all reservation were create successfully otherwise false' - type: boolean - required: - - success - - reservationResults - ReservationResult: - properties: - periodical: - $ref: '#/definitions/PeriodicalReservation' - description: 'Periodical information of the reservation' - recordId: - description: 'Recordid of the record to reserve' - type: string - reservationDetails: - $ref: '#/definitions/ReservationDetails' - description: 'The reservation data as returned by the create/update operation' - result: - description: 'The reservation result' - type: string - required: - - recordId - - result - ReservationResultV2: - properties: - periodical: - $ref: '#/definitions/PeriodicalReservation' - description: 'Periodical information of the reservation' - recordId: - description: 'Recordid of the record to reserve' - type: string - reservationDetails: - $ref: '#/definitions/ReservationDetailsV2' - description: 'The reservation data as returned by the create/update operation' - result: - description: 'The reservation result' - type: string - required: - - recordId - - result - UpdateGuardianRequest: - properties: - cprNumber: - description: 'If patronId is provided, this field will be ignored' - type: string - guardian: - $ref: '#/definitions/Guardian' - patronId: - format: int64 - type: integer - required: - - guardian - UpdatePatronRequestV4: - properties: - patron: - $ref: '#/definitions/PatronSettingsV4' - description: 'Set this if patron details are to be changed' - pincodeChange: - $ref: '#/definitions/PincodeChange' - description: 'Set this if pincode is to be changed' - UpdateReservation: - properties: - expiryDate: - description: "The date where the patron is no longer interested in the reserved material.\n If not set, a date will be calculated from the libraries default interest period" - type: string - pickupBranch: - description: "ISIL-number of pickup branch.\n If not set, will default to patrons preferred pickup branch" - type: string - reservationId: - description: 'Identifies the reservation' - format: int64 - type: integer - required: - - reservationId - UpdateReservationBatch: - properties: - reservations: - items: - $ref: '#/definitions/UpdateReservation' - type: array - required: - - reservations + Address: + properties: + city: + type: string + country: + type: string + postalCode: + type: string + street: + description: "Street and number" + type: string + required: + - country + - city + - street + - postalCode + AddressV2: + properties: + city: + description: City + type: string + coName: + description: "c/o name" + type: string + country: + description: Country + type: string + postalCode: + description: "Postal code" + type: string + street: + description: "Street and number" + type: string + required: + - country + - city + - street + - coName + - postalCode + AgencyBranch: + properties: + branchId: + description: "ISIL of branch (e.g. DK-761501)" + type: string + title: + description: "Name of branch" + type: string + required: + - branchId + - title + AgencyDepartment: + properties: + departmentId: + description: "Department identifier" + type: string + title: + description: "Name of the department" + type: string + required: + - departmentId + - title + AgencyLocation: + properties: + locationId: + description: "Location identifier" + type: string + title: + description: "Name of the location" + type: string + required: + - locationId + - title + AgencySublocation: + properties: + sublocationId: + description: "Sub-location identifier" + type: string + title: + description: "Name of the sub-location" + type: string + required: + - title + - sublocationId + AuthenticatedPatronV4: + properties: + authenticated: + description: "True if patron successfully authenticated.\n If false then either the user is not known in the FBS, or an invalid combination of authentication parameters\n has been used." + type: boolean + patron: + $ref: "#/definitions/PatronV4" + description: "Only available if patron exists in FBS and was succesfully authenticated." + required: + - authenticated + AuthenticatedPatronV6: + properties: + authenticateStatus: + description: "AuthenticateStatus:\n " + enum: + - VALID + - INVALID + - LOANER_LOCKED_OUT + type: string + patron: + $ref: "#/definitions/PatronV5" + description: "Only available if patron exists in FBS and was succesfully authenticated." + required: + - authenticateStatus + AvailabilityV3: + properties: + available: + description: "True if materials is available on-shelf at some placement, false if all materials are lent out" + type: boolean + recordId: + description: "The FAUST number of the Bibliographic record" + type: string + reservable: + description: "True if materials can be reserved" + type: boolean + reservations: + description: "Total number of current active reservations of the Bibliographic record" + format: int64 + type: integer + required: + - recordId + - reservations + - reservable + - available + BlockStatus: + properties: + blockedReason: + description: "Reason code for block" + type: string + blockedSince: + type: string + message: + description: "Message about block" + type: string + required: + - blockedReason + - blockedSince + - message + Booking: + properties: + automaticForwardLoan: + description: "True if automatic forward is active for this booking" + type: boolean + bookingId: + description: "The booking identifier" + type: string + deliverBranchId: + description: "The delivery branch identifier" + type: string + minimumMaterials: + description: "The minimum number of materials" + format: int32 + type: integer + note: + description: "Additional information about this booking" + type: string + patronGroupId: + description: "The patron group ID for this booking" + format: int64 + type: integer + period: + $ref: "#/definitions/Period" + description: "The booking period information containing the start and the end date" + preferredMaterials: + description: "The preferred number of materials" + format: int32 + type: integer + recordId: + description: "The record ID" + type: string + requestedFromBranchId: + description: "The branch that provides the material for booking" + type: string + state: + description: "The booking state" + type: string + required: + - recordId + - preferredMaterials + - period + - minimumMaterials + - patronGroupId + - automaticForwardLoan + - state + - requestedFromBranchId + - bookingId + - deliverBranchId + BookingInfo: + properties: + period: + $ref: "#/definitions/Period" + description: "The booking period information containing the start and the end date" + preferredMaterials: + description: "The preferred number of materials" + format: int32 + type: integer + required: + - preferredMaterials + - period + CreateBooking: + properties: + automaticForwardLoan: + description: "True if automatic forward is active for this booking" + type: boolean + deliverBranchId: + description: "The delivery branch identifier" + type: string + minimumMaterials: + description: "The minimum number of materials" + format: int32 + type: integer + note: + description: "Additional information about this booking" + type: string + patronGroupId: + description: "The patron group ID for this booking" + format: int64 + type: integer + period: + $ref: "#/definitions/Period" + description: "The booking period information containing the start and the end date" + preferredMaterials: + description: "The preferred number of materials" + format: int32 + type: integer + recordId: + description: "The record ID" + type: string + requestedFromBranchId: + description: "The branch that provides the material for booking" + type: string + required: + - recordId + - preferredMaterials + - period + - minimumMaterials + - patronGroupId + - automaticForwardLoan + - requestedFromBranchId + - deliverBranchId + CreatePatronRequestV3: + properties: + cprNumber: + type: string + patron: + $ref: "#/definitions/PatronSettingsV3" + pincode: + type: string + required: + - cprNumber + - pincode + - patron + CreateReservation: + properties: + expiryDate: + description: "The date where the patron is no longer interested in the reserved material.\n If not set, a date will be calculated from the agency default interest period" + type: string + periodical: + $ref: "#/definitions/PeriodicalReservation" + description: "Present if making reservation on a periodical" + pickupBranch: + description: "ISIL-number of pickup branch.\n If not set, will default to patrons preferred pickup branch" + type: string + recordId: + description: "Identifies the bibliographical record to reserve - The FAUST number" + type: string + required: + - recordId + CreateReservationBatch: + properties: + reservations: + description: "Reservations with duplicate record id's will be removed." + items: + $ref: "#/definitions/CreateReservation" + type: array + required: + - reservations + CreateReservationBatchV2: + properties: + reservations: + description: "Reservations with duplicate record id's will be removed." + items: + $ref: "#/definitions/CreateReservation" + type: array + type: + description: "Will be considered normal if not set" + type: string + required: + - reservations + FeeMaterial: + properties: + materialGroupName: + description: "Name of the material group that the material belongs to" + type: string + materialItemNumber: + description: "Identifies the exact material covered by the fee" + type: string + periodical: + $ref: "#/definitions/Periodical" + description: "Present if material is a periodical" + recordId: + description: "The FAUST number of the bibliographic record" + type: string + required: + - recordId + - materialGroupName + - materialItemNumber + FeeMaterialV2: + properties: + materialGroup: + $ref: "#/definitions/MaterialGroup" + description: "The material group that the material belongs to" + materialItemNumber: + description: "Identifies the exact material covered by the fee" + type: string + periodical: + $ref: "#/definitions/Periodical" + description: "Present if material is a periodical" + recordId: + description: "The FAUST number of the bibliographic record" + type: string + required: + - recordId + - materialGroup + - materialItemNumber + FeeV2: + properties: + amount: + description: "The amount to pay, in the currency of the agency" + format: double + type: number + creationDate: + description: "The date the fee was created" + type: string + dueDate: + description: "Expected payment due date" + type: string + feeId: + description: "Identifies the fee, used when registering a payment that covers the fee" + format: int64 + type: integer + materials: + description: "Set if fee covers materials" + items: + $ref: "#/definitions/FeeMaterialV2" + type: array + paidDate: + description: "If the fee has been paid in full, this will be set to the date of the final payment, otherwise not set" + type: string + payableByClient: + description: "true if the client system is allowed to offer payment for the fee, false if not allowed" + type: boolean + reasonMessage: + description: "Human readable free text message about the reason for the fee, presentable to an end user (language is likely\n to be the mother tongue of the agency)" + type: string + type: + description: "Can be used to distinguish between different types of fees" + type: string + required: + - payableByClient + - amount + - materials + - reasonMessage + - type + - creationDate + - feeId + Guardian: + properties: + address: + $ref: "#/definitions/Address" + cprNumber: + type: string + email: + description: "Must be valid" + type: string + mobilePhoneNumber: + type: string + name: + description: "The full name of the guardian" + type: string + required: + - cprNumber + - name + - email + Holdings: + properties: + branch: + $ref: "#/definitions/AgencyBranch" + description: "Placement branch" + department: + $ref: "#/definitions/AgencyDepartment" + description: "Placement department" + location: + $ref: "#/definitions/AgencyLocation" + description: "Placement location" + materials: + description: "Materials that belongs to this placement" + items: + $ref: "#/definitions/Material" + type: array + sublocation: + $ref: "#/definitions/AgencySublocation" + description: "Placement sublocation" + required: + - materials + - branch + HoldingsForBibliographicalRecordV3: + properties: + holdings: + description: "An array of holdings for the materials matching the bibliographical record, as distributed across branches,\n departments and locations" + items: + $ref: "#/definitions/HoldingsV3" + type: array + recordId: + description: "Identifies the bibliographical record for the available materials,\n The FAUST number" + type: string + reservable: + description: "True if there is any reservable materials" + type: boolean + reservations: + description: "Total number of current active reservations for the bibliographical record" + format: int64 + type: integer + required: + - recordId + - reservations + - reservable + - holdings + HoldingsV3: + properties: + branch: + $ref: "#/definitions/AgencyBranch" + description: "Placement branch" + department: + $ref: "#/definitions/AgencyDepartment" + description: "Placement department" + location: + $ref: "#/definitions/AgencyLocation" + description: "Placement location" + materials: + description: "Materials that belongs to this placement" + items: + $ref: "#/definitions/MaterialV3" + type: array + sublocation: + $ref: "#/definitions/AgencySublocation" + description: "Placement sublocation" + required: + - materials + - branch + ILLBibliographicRecord: + properties: + author: + description: "The author of the material" + type: string + bibliographicCategory: + description: "Bibliographic category from danMARC2 008 *t" + type: string + edition: + description: "Edition-information from the bibliographic record" + type: string + isbn: + description: "ISBN-information from the bibliographic record" + type: string + issn: + description: "ISSN-information from the bibliographic record" + type: string + language: + description: "Language of the requested material." + type: string + mediumType: + description: "Type of the requested material - from danMARC2 009 *a+*g (general and specific)" + type: string + periodicalNumber: + description: "Issue number of a periodical" + type: string + periodicalVolume: + description: "Volume name of a periodical" + type: string + placeOfPublication: + type: string + publicationDate: + description: "Publication date of the requested material." + type: string + publicationDateOfComponent: + description: "Publication date of an item component, or article." + type: string + publisher: + description: "Publisher of the requested material." + type: string + recordId: + description: "The FAUST number" + type: string + title: + description: "The title of the material" + type: string + required: + - recordId + - mediumType + LoanDetails: + properties: + dueDate: + description: "The date when the material must be returned" + type: string + ilBibliographicRecord: + $ref: "#/definitions/ILLBibliographicRecord" + description: "Additional bibliographic information for inter-library loans" + loanDate: + description: "The date when the material was picked up" + type: string + loanId: + description: "Identifies the loan for use when renewing the loan" + format: int64 + type: integer + loanType: + description: "The loan type, either loan or interLibraryLoan" + type: string + materialGroupName: + description: "Name of the material group that the material belongs to" + type: string + materialItemNumber: + description: "Identifies the exact material that has been loaned" + type: string + periodical: + $ref: "#/definitions/Periodical" + description: "Present if material is a periodical" + recordId: + description: "The FAUST number of the bibliographic record" + type: string + required: + - recordId + - loanType + - dueDate + - loanDate + - materialGroupName + - materialItemNumber + - loanId + LoanDetailsV2: + properties: + dueDate: + description: "The date when the material must be returned" + type: string + ilBibliographicRecord: + $ref: "#/definitions/ILLBibliographicRecord" + description: "Additional bibliographic information for inter-library loans" + loanDate: + description: "The date when the material was picked up" + type: string + loanId: + description: "Identifies the loan for use when renewing the loan" + format: int64 + type: integer + loanType: + description: "The loan type, either loan or interLibraryLoan" + type: string + materialGroup: + $ref: "#/definitions/MaterialGroup" + description: "Material group that the material belongs to" + materialItemNumber: + description: "Identifies the exact material that has been loaned" + type: string + periodical: + $ref: "#/definitions/Periodical" + description: "Present if material is a periodical" + recordId: + description: "The FAUST number of the bibliographic record" + type: string + required: + - recordId + - loanType + - materialGroup + - dueDate + - loanDate + - materialItemNumber + - loanId + LoanV2: + properties: + isLongtermLoan: + description: "indicates whether this loan is a long term loan" + type: boolean + isRenewable: + description: "indicates whether this loan can be renewed" + type: boolean + loanDetails: + $ref: "#/definitions/LoanDetailsV2" + description: "The loan that was attempted renewed" + renewalStatusList: + description: "if isRenewable == false then this states the reasons for denial" + items: + type: string + type: array + required: + - isRenewable + - loanDetails + - isLongtermLoan + - renewalStatusList + Material: + properties: + available: + description: "True if material is available on-shelf, false if lent out" + type: boolean + itemNumber: + description: "Identifies the material" + type: string + materialGroupName: + description: "Name of the material group that the material belongs to" + type: string + periodical: + $ref: "#/definitions/Periodical" + description: "Present if material is a periodical" + required: + - itemNumber + - available + - materialGroupName + MaterialGroup: + properties: + description: + description: "Description of the material group" + type: string + name: + description: "Name of the material group" + type: string + required: + - name + MaterialV3: + properties: + available: + description: "True if material is available on-shelf, false if lent out" + type: boolean + itemNumber: + description: "Identifies the material" + type: string + materialGroup: + $ref: "#/definitions/MaterialGroup" + description: "Name of the material group that the material belongs to" + periodical: + $ref: "#/definitions/Periodical" + description: "Present if material is a periodical" + required: + - itemNumber + - materialGroup + - available + Patron: + properties: + address: + $ref: "#/definitions/Address" + allowBookings: + description: "True if the user is allowed to create bookings." + type: boolean + birthday: + type: string + blockStatus: + description: "A list of block statuses -\n if the patron is not blocked then this value is empty or null" + items: + $ref: "#/definitions/BlockStatus" + type: array + coAddress: + $ref: "#/definitions/Address" + defaultInterestPeriod: + description: "Length of default interest period in days" + format: int32 + type: integer + emailAddress: + type: string + name: + type: string + onHold: + $ref: "#/definitions/Period" + description: "If not set then the patron is not on hold" + patronId: + description: "Patron identifier to be used in subsequent service calls involving the patron" + format: int64 + type: integer + phoneNumber: + type: string + preferredPickupBranch: + description: "ISIL of preferred pickup branch" + type: string + receiveEmail: + type: boolean + receivePostalMail: + description: "This field is deprecated and is no longer used" + type: boolean + receiveSms: + type: boolean + resident: + description: "True if the user is resident in the same municipality as the library" + type: boolean + required: + - preferredPickupBranch + - patronId + - receiveEmail + - receiveSms + - receivePostalMail + - defaultInterestPeriod + - resident + PatronGroup: + properties: + childGroups: + description: "The array of child groups of this group" + items: + $ref: "#/definitions/PatronGroup" + type: array + description: + description: "The description of the group" + type: string + membersCount: + description: "The number of all members in this group, including descendants" + format: int64 + type: integer + name: + description: "The name of the group" + type: string + patronGroupId: + description: "The patron group identifier" + format: int64 + type: integer + required: + - membersCount + - patronGroupId + - name + - description + PatronSettings: + properties: + emailAddress: + description: "Required if patron should receive email notifications\n Existing email addresses are overwritten with this value\n If left empty existing email addresses are deleted" + type: string + onHold: + $ref: "#/definitions/Period" + description: "If not set then the patron is not on hold" + phoneNumber: + description: "Required if patron should receive SMS notifications\n Existing phonenumbers are overwritten with this value\n If left empty existing phonenumbers are deleted" + type: string + preferredPickupBranch: + description: "ISIL-number of preferred pickup branch" + type: string + receiveEmail: + type: boolean + receivePostalMail: + description: "This field is deprecated and is no longer used" + type: boolean + receiveSms: + type: boolean + required: + - preferredPickupBranch + - receiveEmail + - receivePostalMail + - receiveSms + PatronSettingsV3: + properties: + emailAddress: + description: "Required if patron should receive email notifications\n Existing email addresses are overwritten with this value\n If left empty existing email addresses are deleted" + type: string + onHold: + $ref: "#/definitions/Period" + description: "If not set then the patron is not on hold" + phoneNumber: + description: "Required if patron should receive SMS notifications\n Existing phonenumbers are overwritten with this value\n If left empty existing phonenumbers are deleted" + type: string + preferredLanguage: + description: "Language in which the patron prefers the communication with the library to take place\n If left empty default library language will be used" + type: string + preferredPickupBranch: + description: "ISIL-number of preferred pickup branch" + type: string + receiveEmail: + type: boolean + receivePostalMail: + type: boolean + receiveSms: + type: boolean + required: + - preferredPickupBranch + - receiveEmail + - receivePostalMail + - receiveSms + PatronSettingsV4: + properties: + emailAddress: + description: "Required if patron should receive email notifications\n Existing email addresses are overwritten with this value\n If left empty existing email addresses are deleted" + type: string + notificationProtocols: + description: "Notification protocols that the patron want to receive notification on. SMS and EMAIL are not included." + items: + type: string + type: array + onHold: + $ref: "#/definitions/Period" + description: "If not set then the patron is not on hold" + phoneNumber: + description: "Required if patron should receive SMS notifications\n Existing phonenumbers are overwritten with this value\n If left empty existing phonenumbers are deleted" + type: string + preferredLanguage: + description: "Language in which the patron prefers the communication with the library to take place\n If left empty default library language will be used" + type: string + preferredPickupBranch: + description: "ISIL-number of preferred pickup branch" + type: string + receiveEmail: + type: boolean + receivePostalMail: + type: boolean + receiveSms: + type: boolean + required: + - preferredPickupBranch + - receiveEmail + - receivePostalMail + - receiveSms + PatronV3: + properties: + address: + $ref: "#/definitions/Address" + allowBookings: + description: "True if the user is allowed to create bookings." + type: boolean + birthday: + type: string + blockStatus: + description: "A list of block statuses -\n if the patron is not blocked then this value is empty or null" + items: + $ref: "#/definitions/BlockStatus" + type: array + defaultInterestPeriod: + description: "Length of default interest period in days" + format: int32 + type: integer + emailAddress: + type: string + name: + type: string + onHold: + $ref: "#/definitions/Period" + description: "If not set then the patron is not on hold" + patronId: + description: "Patron identifier to be used in subsequent service calls involving the patron" + format: int64 + type: integer + phoneNumber: + type: string + preferredLanguage: + description: "Language in which the patron prefers the communication with the library to take place" + type: string + preferredPickupBranch: + description: "ISIL of preferred pickup branch" + type: string + receiveEmail: + type: boolean + receivePostalMail: + type: boolean + receiveSms: + type: boolean + resident: + description: "True if the user is resident in the same municipality as the library" + type: boolean + secondaryAddress: + $ref: "#/definitions/Address" + required: + - preferredPickupBranch + - patronId + - receiveEmail + - receiveSms + - receivePostalMail + - defaultInterestPeriod + - resident + PatronV4: + properties: + address: + $ref: "#/definitions/AddressV2" + allowBookings: + description: "True if the user is allowed to create bookings." + type: boolean + birthday: + type: string + blockStatus: + description: "A list of block statuses -\n if the patron is not blocked then this value is empty or null" + items: + $ref: "#/definitions/BlockStatus" + type: array + defaultInterestPeriod: + description: "Length of default interest period in days" + format: int32 + type: integer + emailAddress: + type: string + name: + type: string + onHold: + $ref: "#/definitions/Period" + description: "If not set then the patron is not on hold" + patronId: + description: "Patron identifier to be used in subsequent service calls involving the patron" + format: int64 + type: integer + phoneNumber: + type: string + preferredLanguage: + description: "Language in which the patron prefers the communication with the library to take place" + type: string + preferredPickupBranch: + description: "ISIL of preferred pickup branch" + type: string + receiveEmail: + type: boolean + receivePostalMail: + type: boolean + receiveSms: + type: boolean + resident: + description: "True if the user is resident in the same municipality as the library" + type: boolean + secondaryAddress: + $ref: "#/definitions/AddressV2" + required: + - preferredPickupBranch + - patronId + - receiveEmail + - receiveSms + - receivePostalMail + - defaultInterestPeriod + - resident + PatronV5: + properties: + address: + $ref: "#/definitions/AddressV2" + allowBookings: + description: "True if the user is allowed to create bookings." + type: boolean + birthday: + type: string + blockStatus: + description: "A list of block statuses -\n if the patron is not blocked then this value is empty or null" + items: + $ref: "#/definitions/BlockStatus" + type: array + defaultInterestPeriod: + description: "Length of default interest period in days" + format: int32 + type: integer + emailAddress: + type: string + name: + type: string + notificationProtocols: + description: "Notification protocols that the patron want to receive notification on. SMS and EMAIL are not included." + items: + type: string + type: array + onHold: + $ref: "#/definitions/Period" + description: "If not set then the patron is not on hold" + patronId: + description: "Patron identifier to be used in subsequent service calls involving the patron" + format: int64 + type: integer + phoneNumber: + type: string + preferredLanguage: + description: "Language in which the patron prefers the communication with the library to take place" + type: string + preferredPickupBranch: + description: "ISIL of preferred pickup branch" + type: string + receiveEmail: + type: boolean + receivePostalMail: + type: boolean + receiveSms: + type: boolean + resident: + description: "True if the user is resident in the same municipality as the library" + type: boolean + secondaryAddress: + $ref: "#/definitions/AddressV2" + required: + - preferredPickupBranch + - patronId + - receiveEmail + - receiveSms + - receivePostalMail + - defaultInterestPeriod + - resident + PatronWithGuardianRequest: + properties: + address: + $ref: "#/definitions/Address" + cprNumber: + type: string + email: + description: "Must be valid if supplied" + type: string + guardian: + $ref: "#/definitions/Guardian" + name: + description: "The full name of the patron" + type: string + phoneNumber: + description: "Must be valid if supplied" + type: string + pincode: + type: string + preferredPickupBranch: + description: "Must be a valid branch id (eg. DK-761501)" + type: string + required: + - cprNumber + - pincode + - preferredPickupBranch + - name + - guardian + Period: + properties: + from: + description: "Open-ended if not set" + type: string + to: + description: "Open-ended if not set" + type: string + Periodical: + properties: + displayText: + description: "A representation of the periodica volume information that is suitable for display" + type: string + volume: + type: string + volumeNumber: + type: string + volumeYear: + type: string + required: + - displayText + PeriodicalReservation: + properties: + volume: + type: string + volumeNumber: + type: string + volumeYear: + type: string + PincodeChange: + properties: + libraryCardNumber: + description: "Identifies the libraryCard for which the pincode is to be changed.\n This can be either a physical card or the CPR number, that is used as a libraryCard" + type: string + pincode: + description: "The new pincode for the libraryCard" + type: string + required: + - pincode + - libraryCardNumber + RenewedLoanV2: + properties: + loanDetails: + $ref: "#/definitions/LoanDetailsV2" + description: "The loan that was attempted renewed" + renewalStatus: + description: "indicates if renewal was succesful or denied - including the reason for denial." + items: + type: string + type: array + required: + - loanDetails + - renewalStatus + ReservationDetails: + properties: + dateOfReservation: + type: string + expiryDate: + description: "The date when the patron is no longer interested in the reserved material" + type: string + ilBibliographicRecord: + $ref: "#/definitions/ILLBibliographicRecord" + description: "Additional bibliographic information for inter-library loans" + loanType: + type: string + numberInQueue: + description: "The number in the reservation queue." + format: int32 + type: integer + periodical: + $ref: "#/definitions/Periodical" + description: "Present if material is a periodical" + pickupBranch: + description: "ISIL-number of pickup branch" + type: string + pickupDeadline: + description: "Set if reserved material is available for loan" + type: string + pickupNumber: + description: "The reservation number. Will be present if the reservation is ready for pickup (the state is 'readyForPickup')" + type: string + recordId: + description: "The FAUST number" + type: string + reservationId: + description: "Identifies the reservation for use when updating or deleting the reservation" + format: int64 + type: integer + state: + type: string + required: + - recordId + - pickupBranch + - expiryDate + - reservationId + - loanType + - dateOfReservation + - state + ReservationDetailsV2: + properties: + dateOfReservation: + type: string + expiryDate: + description: "The date when the patron is no longer interested in the reserved material" + type: string + ilBibliographicRecord: + $ref: "#/definitions/ILLBibliographicRecord" + description: "Additional bibliographic information for inter-library loans" + numberInQueue: + description: "The number in the reservation queue." + format: int32 + type: integer + periodical: + $ref: "#/definitions/Periodical" + description: "Present if material is a periodical" + pickupBranch: + description: "ISIL-number of pickup branch" + type: string + pickupDeadline: + description: "Set if reserved material is available for loan" + type: string + pickupNumber: + description: "The reservation number. Will be present if the reservation is ready for pickup (the state is 'readyForPickup')" + type: string + recordId: + description: "The FAUST number" + type: string + reservationId: + description: "Identifies the reservation for use when updating or deleting the reservation" + format: int64 + type: integer + reservationType: + type: string + state: + type: string + transactionId: + description: "Identifies the transaction of reservations" + type: string + required: + - pickupBranch + - dateOfReservation + - transactionId + - recordId + - expiryDate + - reservationId + - reservationType + - state + ReservationResponseV2: + properties: + reservationResults: + description: "Result of each reservation" + items: + $ref: "#/definitions/ReservationResultV2" + type: array + success: + description: "True if all reservation were create successfully otherwise false" + type: boolean + required: + - success + - reservationResults + ReservationResult: + properties: + periodical: + $ref: "#/definitions/PeriodicalReservation" + description: "Periodical information of the reservation" + recordId: + description: "Recordid of the record to reserve" + type: string + reservationDetails: + $ref: "#/definitions/ReservationDetails" + description: "The reservation data as returned by the create/update operation" + result: + description: "The reservation result" + type: string + required: + - recordId + - result + ReservationResultV2: + properties: + periodical: + $ref: "#/definitions/PeriodicalReservation" + description: "Periodical information of the reservation" + recordId: + description: "Recordid of the record to reserve" + type: string + reservationDetails: + $ref: "#/definitions/ReservationDetailsV2" + description: "The reservation data as returned by the create/update operation" + result: + description: "The reservation result" + type: string + required: + - recordId + - result + UpdateGuardianRequest: + properties: + cprNumber: + description: "If patronId is provided, this field will be ignored" + type: string + guardian: + $ref: "#/definitions/Guardian" + patronId: + format: int64 + type: integer + required: + - guardian + UpdatePatronRequestV4: + properties: + patron: + $ref: "#/definitions/PatronSettingsV4" + description: "Set this if patron details are to be changed" + pincodeChange: + $ref: "#/definitions/PincodeChange" + description: "Set this if pincode is to be changed" + UpdateReservation: + properties: + expiryDate: + description: "The date where the patron is no longer interested in the reserved material.\n If not set, a date will be calculated from the libraries default interest period" + type: string + pickupBranch: + description: "ISIL-number of pickup branch.\n If not set, will default to patrons preferred pickup branch" + type: string + reservationId: + description: "Identifies the reservation" + format: int64 + type: integer + required: + - reservationId + UpdateReservationBatch: + properties: + reservations: + items: + $ref: "#/definitions/UpdateReservation" + type: array + required: + - reservations diff --git a/src/core/fbs/fbs.ts b/src/core/fbs/fbs.ts index 0a7bcc97dd..146bc5f3dd 100644 --- a/src/core/fbs/fbs.ts +++ b/src/core/fbs/fbs.ts @@ -1,49 +1,46 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 */ -import { - useQuery, - useMutation, - UseQueryOptions, - UseMutationOptions, - QueryFunction, +import { useMutation, useQuery } from "react-query"; +import type { MutationFunction, - UseQueryResult, - QueryKey + QueryFunction, + QueryKey, + UseMutationOptions, + UseMutationResult, + UseQueryOptions, + UseQueryResult } from "react-query"; import type { AgencyBranch, - GetBranchesParams, - DeleteReservationsParams, - ReservationDetails, + AuthenticatedPatronV4, + AuthenticatedPatronV6, + AvailabilityV3, + CreatePatronRequestV3, CreateReservationBatch, - UpdateReservationBatch, - ReservationDetailsV2, - ReservationResponseV2, CreateReservationBatchV2, - AvailabilityV3, - GetAvailabilityV3Params, - HoldingsForBibliographicalRecordV3, - GetHoldingsV3Params, + DeleteReservationsParams, FeeV2, + GetAvailabilityV3Params, + GetBranchesParams, GetFeesV2Params, - AuthenticatedPatronV4, - CreatePatronRequestV3, + GetHoldingsV3Params, + HoldingsForBibliographicalRecordV3, + LoanV2, PatronWithGuardianRequest, - UpdateGuardianRequest, RenewedLoanV2, - LoanV2, - AuthenticatedPatronV6, - UpdatePatronRequestV4 + ReservationDetails, + ReservationDetailsV2, + ReservationResponseV2, + UpdateGuardianRequest, + UpdatePatronRequestV4, + UpdateReservationBatch } from "./model"; -import { fetcher, ErrorType, BodyType } from "./mutator/fetcher"; - -type AwaitedInput = PromiseLike | T; - -type Awaited = O extends AwaitedInput ? T : never; +import { fetcher } from "./mutator/fetcher"; +import type { ErrorType, BodyType } from "./mutator/fetcher"; /** * @@ -58,23 +55,20 @@ export const getBranches = ( ) => { return fetcher({ url: `/external/v1/agencyid/branches`, - method: "get", - signal, - params + method: "GET", + params, + signal }); }; -export const getGetBranchesQueryKey = (params?: GetBranchesParams) => [ - `/external/v1/agencyid/branches`, - ...(params ? [params] : []) -]; - -export type GetBranchesQueryResult = NonNullable< - Awaited> ->; -export type GetBranchesQueryError = ErrorType; +export const getGetBranchesQueryKey = (params?: GetBranchesParams) => { + return [ + `/external/v1/agencyid/branches`, + ...(params ? [params] : []) + ] as const; +}; -export const useGetBranches = < +export const getGetBranchesQueryOptions = < TData = Awaited>, TError = ErrorType >( @@ -86,7 +80,7 @@ export const useGetBranches = < TData >; } -): UseQueryResult & { queryKey: QueryKey } => { +) => { const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetBranchesQueryKey(params); @@ -95,63 +89,114 @@ export const useGetBranches = < signal }) => getBranches(params, signal); - const query = useQuery< + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, TError, TData - >(queryKey, queryFn, queryOptions); + > & { queryKey: QueryKey }; +}; + +export type GetBranchesQueryResult = NonNullable< + Awaited> +>; +export type GetBranchesQueryError = ErrorType; + +/** + * @summary Get branches for an agency. + */ +export const useGetBranches = < + TData = Awaited>, + TError = ErrorType +>( + params?: GetBranchesParams, + options?: { + query?: UseQueryOptions< + Awaited>, + TError, + TData + >; + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getGetBranchesQueryOptions(params, options); - return { - queryKey, - ...query + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey; }; + + query.queryKey = queryOptions.queryKey; + + return query; }; /** * @summary Delete existing reservations. */ -export const deleteReservations = (params?: DeleteReservationsParams) => { +export const deleteReservations = (params: DeleteReservationsParams) => { return fetcher({ url: `/external/v1/agencyid/patrons/patronid/reservations`, - method: "delete", + method: "DELETE", params }); }; -export type DeleteReservationsMutationResult = NonNullable< - Awaited> ->; - -export type DeleteReservationsMutationError = ErrorType; - -export const useDeleteReservations = < - TError = ErrorType, +export const getDeleteReservationsMutationOptions = < + TError = ErrorType, TContext = unknown >(options?: { mutation?: UseMutationOptions< Awaited>, TError, - { params?: DeleteReservationsParams }, + { params: DeleteReservationsParams }, TContext >; -}) => { +}): UseMutationOptions< + Awaited>, + TError, + { params: DeleteReservationsParams }, + TContext +> => { const { mutation: mutationOptions } = options ?? {}; const mutationFn: MutationFunction< Awaited>, - { params?: DeleteReservationsParams } + { params: DeleteReservationsParams } > = (props) => { const { params } = props ?? {}; return deleteReservations(params); }; - return useMutation< + return { mutationFn, ...mutationOptions }; +}; + +export type DeleteReservationsMutationResult = NonNullable< + Awaited> +>; + +export type DeleteReservationsMutationError = ErrorType; + +/** + * @summary Delete existing reservations. + */ +export const useDeleteReservations = < + TError = ErrorType, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< Awaited>, TError, - { params?: DeleteReservationsParams }, + { params: DeleteReservationsParams }, TContext - >(mutationFn, mutationOptions); + >; +}): UseMutationResult< + Awaited>, + TError, + { params: DeleteReservationsParams }, + TContext +> => { + const mutationOptions = getDeleteReservationsMutationOptions(options); + + return useMutation(mutationOptions); }; /** @@ -183,21 +228,16 @@ export const useDeleteReservations = < export const getReservations = (signal?: AbortSignal) => { return fetcher({ url: `/external/v1/agencyid/patrons/patronid/reservations`, - method: "get", + method: "GET", signal }); }; -export const getGetReservationsQueryKey = () => [ - `/external/v1/agencyid/patrons/patronid/reservations` -]; - -export type GetReservationsQueryResult = NonNullable< - Awaited> ->; -export type GetReservationsQueryError = ErrorType; +export const getGetReservationsQueryKey = () => { + return [`/external/v1/agencyid/patrons/patronid/reservations`] as const; +}; -export const useGetReservations = < +export const getGetReservationsQueryOptions = < TData = Awaited>, TError = ErrorType >(options?: { @@ -206,7 +246,7 @@ export const useGetReservations = < TError, TData >; -}): UseQueryResult & { queryKey: QueryKey } => { +}) => { const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetReservationsQueryKey(); @@ -215,16 +255,40 @@ export const useGetReservations = < signal }) => getReservations(signal); - const query = useQuery< + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey }; +}; + +export type GetReservationsQueryResult = NonNullable< + Awaited> +>; +export type GetReservationsQueryError = ErrorType; + +/** + * @summary Get all unfulfilled reservations made by the patron (DEPRECATED). + */ +export const useGetReservations = < + TData = Awaited>, + TError = ErrorType +>(options?: { + query?: UseQueryOptions< Awaited>, TError, TData - >(queryKey, queryFn, queryOptions); + >; +}): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getGetReservationsQueryOptions(options); - return { - queryKey, - ...query + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey; }; + + query.queryKey = queryOptions.queryKey; + + return query; }; /** @@ -259,20 +323,13 @@ export const addReservationsDeprecated = ( ) => { return fetcher({ url: `/external/v1/agencyid/patrons/patronid/reservations`, - method: "post", + method: "POST", headers: { "Content-Type": "application/json" }, data: createReservationBatch }); }; -export type AddReservationsDeprecatedMutationResult = NonNullable< - Awaited> ->; -export type AddReservationsDeprecatedMutationBody = - BodyType; -export type AddReservationsDeprecatedMutationError = ErrorType; - -export const useAddReservationsDeprecated = < +export const getAddReservationsDeprecatedMutationOptions = < TError = ErrorType, TContext = unknown >(options?: { @@ -282,7 +339,12 @@ export const useAddReservationsDeprecated = < { data: BodyType }, TContext >; -}) => { +}): UseMutationOptions< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { const { mutation: mutationOptions } = options ?? {}; const mutationFn: MutationFunction< @@ -294,12 +356,38 @@ export const useAddReservationsDeprecated = < return addReservationsDeprecated(data); }; - return useMutation< + return { mutationFn, ...mutationOptions }; +}; + +export type AddReservationsDeprecatedMutationResult = NonNullable< + Awaited> +>; +export type AddReservationsDeprecatedMutationBody = + BodyType; +export type AddReservationsDeprecatedMutationError = ErrorType; + +/** + * @summary Create new reservations for the patron (DEPRECATED). + */ +export const useAddReservationsDeprecated = < + TError = ErrorType, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< Awaited>, TError, { data: BodyType }, TContext - >(mutationFn, mutationOptions); + >; +}): UseMutationResult< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { + const mutationOptions = getAddReservationsDeprecatedMutationOptions(options); + + return useMutation(mutationOptions); }; /** @@ -329,19 +417,13 @@ export const updateReservations = ( ) => { return fetcher({ url: `/external/v1/agencyid/patrons/patronid/reservations`, - method: "put", + method: "PUT", headers: { "Content-Type": "application/json" }, data: updateReservationBatch }); }; -export type UpdateReservationsMutationResult = NonNullable< - Awaited> ->; -export type UpdateReservationsMutationBody = BodyType; -export type UpdateReservationsMutationError = ErrorType; - -export const useUpdateReservations = < +export const getUpdateReservationsMutationOptions = < TError = ErrorType, TContext = unknown >(options?: { @@ -351,7 +433,12 @@ export const useUpdateReservations = < { data: BodyType }, TContext >; -}) => { +}): UseMutationOptions< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { const { mutation: mutationOptions } = options ?? {}; const mutationFn: MutationFunction< @@ -363,12 +450,37 @@ export const useUpdateReservations = < return updateReservations(data); }; - return useMutation< + return { mutationFn, ...mutationOptions }; +}; + +export type UpdateReservationsMutationResult = NonNullable< + Awaited> +>; +export type UpdateReservationsMutationBody = BodyType; +export type UpdateReservationsMutationError = ErrorType; + +/** + * @summary Update existing reservations. + */ +export const useUpdateReservations = < + TError = ErrorType, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< Awaited>, TError, { data: BodyType }, TContext - >(mutationFn, mutationOptions); + >; +}): UseMutationResult< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { + const mutationOptions = getUpdateReservationsMutationOptions(options); + + return useMutation(mutationOptions); }; /** @@ -402,21 +514,16 @@ export const useUpdateReservations = < export const getReservationsV2 = (signal?: AbortSignal) => { return fetcher({ url: `/external/v1/agencyid/patrons/patronid/reservations/v2`, - method: "get", + method: "GET", signal }); }; -export const getGetReservationsV2QueryKey = () => [ - `/external/v1/agencyid/patrons/patronid/reservations/v2` -]; - -export type GetReservationsV2QueryResult = NonNullable< - Awaited> ->; -export type GetReservationsV2QueryError = ErrorType; +export const getGetReservationsV2QueryKey = () => { + return [`/external/v1/agencyid/patrons/patronid/reservations/v2`] as const; +}; -export const useGetReservationsV2 = < +export const getGetReservationsV2QueryOptions = < TData = Awaited>, TError = ErrorType >(options?: { @@ -425,7 +532,7 @@ export const useGetReservationsV2 = < TError, TData >; -}): UseQueryResult & { queryKey: QueryKey } => { +}) => { const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetReservationsV2QueryKey(); @@ -434,16 +541,40 @@ export const useGetReservationsV2 = < Awaited> > = ({ signal }) => getReservationsV2(signal); - const query = useQuery< + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey }; +}; + +export type GetReservationsV2QueryResult = NonNullable< + Awaited> +>; +export type GetReservationsV2QueryError = ErrorType; + +/** + * @summary Get all unfulfilled reservations made by the patron. + */ +export const useGetReservationsV2 = < + TData = Awaited>, + TError = ErrorType +>(options?: { + query?: UseQueryOptions< Awaited>, TError, TData - >(queryKey, queryFn, queryOptions); + >; +}): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getGetReservationsV2QueryOptions(options); - return { - queryKey, - ...query + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey; }; + + query.queryKey = queryOptions.queryKey; + + return query; }; /** @@ -509,19 +640,13 @@ export const addReservationsV2 = ( ) => { return fetcher({ url: `/external/v1/agencyid/patrons/patronid/reservations/v2`, - method: "post", + method: "POST", headers: { "Content-Type": "application/json" }, data: createReservationBatchV2 }); }; -export type AddReservationsV2MutationResult = NonNullable< - Awaited> ->; -export type AddReservationsV2MutationBody = BodyType; -export type AddReservationsV2MutationError = ErrorType; - -export const useAddReservationsV2 = < +export const getAddReservationsV2MutationOptions = < TError = ErrorType, TContext = unknown >(options?: { @@ -531,7 +656,12 @@ export const useAddReservationsV2 = < { data: BodyType }, TContext >; -}) => { +}): UseMutationOptions< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { const { mutation: mutationOptions } = options ?? {}; const mutationFn: MutationFunction< @@ -543,12 +673,37 @@ export const useAddReservationsV2 = < return addReservationsV2(data); }; - return useMutation< + return { mutationFn, ...mutationOptions }; +}; + +export type AddReservationsV2MutationResult = NonNullable< + Awaited> +>; +export type AddReservationsV2MutationBody = BodyType; +export type AddReservationsV2MutationError = ErrorType; + +/** + * @summary Create new reservations for the patron. + */ +export const useAddReservationsV2 = < + TError = ErrorType, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< Awaited>, TError, { data: BodyType }, TContext - >(mutationFn, mutationOptions); + >; +}): UseMutationResult< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { + const mutationOptions = getAddReservationsV2MutationOptions(options); + + return useMutation(mutationOptions); }; /** @@ -557,34 +712,31 @@ export const useAddReservationsV2 = < * @summary Get availability of bibliographical records. */ export const getAvailabilityV3 = ( - params?: GetAvailabilityV3Params, + params: GetAvailabilityV3Params, signal?: AbortSignal ) => { return fetcher({ url: `/external/agencyid/catalog/availability/v3`, - method: "get", - signal, - params + method: "GET", + params, + signal }); }; export const getGetAvailabilityV3QueryKey = ( - params?: GetAvailabilityV3Params -) => [ - `/external/agencyid/catalog/availability/v3`, - ...(params ? [params] : []) -]; - -export type GetAvailabilityV3QueryResult = NonNullable< - Awaited> ->; -export type GetAvailabilityV3QueryError = ErrorType; + params: GetAvailabilityV3Params +) => { + return [ + `/external/agencyid/catalog/availability/v3`, + ...(params ? [params] : []) + ] as const; +}; -export const useGetAvailabilityV3 = < +export const getGetAvailabilityV3QueryOptions = < TData = Awaited>, TError = ErrorType >( - params?: GetAvailabilityV3Params, + params: GetAvailabilityV3Params, options?: { query?: UseQueryOptions< Awaited>, @@ -592,7 +744,7 @@ export const useGetAvailabilityV3 = < TData >; } -): UseQueryResult & { queryKey: QueryKey } => { +) => { const { query: queryOptions } = options ?? {}; const queryKey = @@ -602,51 +754,75 @@ export const useGetAvailabilityV3 = < Awaited> > = ({ signal }) => getAvailabilityV3(params, signal); - const query = useQuery< + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, TError, TData - >(queryKey, queryFn, queryOptions); - - return { - queryKey, - ...query - }; + > & { queryKey: QueryKey }; }; +export type GetAvailabilityV3QueryResult = NonNullable< + Awaited> +>; +export type GetAvailabilityV3QueryError = ErrorType; + /** - * + * @summary Get availability of bibliographical records. + */ +export const useGetAvailabilityV3 = < + TData = Awaited>, + TError = ErrorType +>( + params: GetAvailabilityV3Params, + options?: { + query?: UseQueryOptions< + Awaited>, + TError, + TData + >; + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getGetAvailabilityV3QueryOptions(params, options); + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey; + }; + + query.queryKey = queryOptions.queryKey; + + return query; +}; + +/** + * Returns an array of holdings for each bibliographical record. The holdings lists the materials on each placement, and whether they are available on-shelf or lent out. * @summary Get placement holdings for bibliographical records. */ export const getHoldingsV3 = ( - params?: GetHoldingsV3Params, + params: GetHoldingsV3Params, signal?: AbortSignal ) => { return fetcher({ url: `/external/agencyid/catalog/holdings/v3`, - method: "get", - signal, - params + method: "GET", + params, + signal }); }; -export const getGetHoldingsV3QueryKey = (params?: GetHoldingsV3Params) => [ - `/external/agencyid/catalog/holdings/v3`, - ...(params ? [params] : []) -]; - -export type GetHoldingsV3QueryResult = NonNullable< - Awaited> ->; -export type GetHoldingsV3QueryError = ErrorType; +export const getGetHoldingsV3QueryKey = (params: GetHoldingsV3Params) => { + return [ + `/external/agencyid/catalog/holdings/v3`, + ...(params ? [params] : []) + ] as const; +}; -export const useGetHoldingsV3 = < +export const getGetHoldingsV3QueryOptions = < TData = Awaited>, TError = ErrorType >( - params?: GetHoldingsV3Params, + params: GetHoldingsV3Params, options?: { query?: UseQueryOptions< Awaited>, @@ -654,7 +830,7 @@ export const useGetHoldingsV3 = < TData >; } -): UseQueryResult & { queryKey: QueryKey } => { +) => { const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetHoldingsV3QueryKey(params); @@ -663,16 +839,43 @@ export const useGetHoldingsV3 = < signal }) => getHoldingsV3(params, signal); - const query = useQuery< + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, TError, TData - >(queryKey, queryFn, queryOptions); + > & { queryKey: QueryKey }; +}; + +export type GetHoldingsV3QueryResult = NonNullable< + Awaited> +>; +export type GetHoldingsV3QueryError = ErrorType; + +/** + * @summary Get placement holdings for bibliographical records. + */ +export const useGetHoldingsV3 = < + TData = Awaited>, + TError = ErrorType +>( + params: GetHoldingsV3Params, + options?: { + query?: UseQueryOptions< + Awaited>, + TError, + TData + >; + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getGetHoldingsV3QueryOptions(params, options); - return { - queryKey, - ...query + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey; }; + + query.queryKey = queryOptions.queryKey; + + return query; }; /** @@ -692,30 +895,27 @@ export const useGetHoldingsV3 = < important that unrecognized types are treated as 'other'.

* @summary List of fees in FBS for the patron with all available information about the fee. */ -export const getFeesV2 = (params?: GetFeesV2Params, signal?: AbortSignal) => { +export const getFeesV2 = (params: GetFeesV2Params, signal?: AbortSignal) => { return fetcher({ url: `/external/agencyid/patron/patronid/fees/v2`, - method: "get", - signal, - params + method: "GET", + params, + signal }); }; -export const getGetFeesV2QueryKey = (params?: GetFeesV2Params) => [ - `/external/agencyid/patron/patronid/fees/v2`, - ...(params ? [params] : []) -]; - -export type GetFeesV2QueryResult = NonNullable< - Awaited> ->; -export type GetFeesV2QueryError = ErrorType; +export const getGetFeesV2QueryKey = (params: GetFeesV2Params) => { + return [ + `/external/agencyid/patron/patronid/fees/v2`, + ...(params ? [params] : []) + ] as const; +}; -export const useGetFeesV2 = < +export const getGetFeesV2QueryOptions = < TData = Awaited>, TError = ErrorType >( - params?: GetFeesV2Params, + params: GetFeesV2Params, options?: { query?: UseQueryOptions< Awaited>, @@ -723,7 +923,7 @@ export const useGetFeesV2 = < TData >; } -): UseQueryResult & { queryKey: QueryKey } => { +) => { const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetFeesV2QueryKey(params); @@ -732,16 +932,43 @@ export const useGetFeesV2 = < signal }) => getFeesV2(params, signal); - const query = useQuery>, TError, TData>( - queryKey, - queryFn, - queryOptions - ); + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey }; +}; - return { - queryKey, - ...query +export type GetFeesV2QueryResult = NonNullable< + Awaited> +>; +export type GetFeesV2QueryError = ErrorType; + +/** + * @summary List of fees in FBS for the patron with all available information about the fee. + */ +export const useGetFeesV2 = < + TData = Awaited>, + TError = ErrorType +>( + params: GetFeesV2Params, + options?: { + query?: UseQueryOptions< + Awaited>, + TError, + TData + >; + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getGetFeesV2QueryOptions(params, options); + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey; }; + + query.queryKey = queryOptions.queryKey; + + return query; }; /** @@ -768,19 +995,13 @@ export const createV4 = ( ) => { return fetcher({ url: `/external/agencyid/patrons/v4`, - method: "post", + method: "POST", headers: { "Content-Type": "application/json" }, data: createPatronRequestV3 }); }; -export type CreateV4MutationResult = NonNullable< - Awaited> ->; -export type CreateV4MutationBody = BodyType; -export type CreateV4MutationError = ErrorType; - -export const useCreateV4 = < +export const getCreateV4MutationOptions = < TError = ErrorType, TContext = unknown >(options?: { @@ -790,7 +1011,12 @@ export const useCreateV4 = < { data: BodyType }, TContext >; -}) => { +}): UseMutationOptions< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { const { mutation: mutationOptions } = options ?? {}; const mutationFn: MutationFunction< @@ -802,12 +1028,37 @@ export const useCreateV4 = < return createV4(data); }; - return useMutation< + return { mutationFn, ...mutationOptions }; +}; + +export type CreateV4MutationResult = NonNullable< + Awaited> +>; +export type CreateV4MutationBody = BodyType; +export type CreateV4MutationError = ErrorType; + +/** + * @summary Create a new patron who is a person. + */ +export const useCreateV4 = < + TError = ErrorType, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< Awaited>, TError, { data: BodyType }, TContext - >(mutationFn, mutationOptions); + >; +}): UseMutationResult< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { + const mutationOptions = getCreateV4MutationOptions(options); + + return useMutation(mutationOptions); }; /** @@ -828,20 +1079,13 @@ export const createWithGuardian = ( ) => { return fetcher({ url: `/external/agencyid/patrons/withGuardian/v1`, - method: "post", + method: "POST", headers: { "Content-Type": "application/json" }, data: patronWithGuardianRequest }); }; -export type CreateWithGuardianMutationResult = NonNullable< - Awaited> ->; -export type CreateWithGuardianMutationBody = - BodyType; -export type CreateWithGuardianMutationError = ErrorType; - -export const useCreateWithGuardian = < +export const getCreateWithGuardianMutationOptions = < TError = ErrorType, TContext = unknown >(options?: { @@ -851,7 +1095,12 @@ export const useCreateWithGuardian = < { data: BodyType }, TContext >; -}) => { +}): UseMutationOptions< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { const { mutation: mutationOptions } = options ?? {}; const mutationFn: MutationFunction< @@ -863,12 +1112,38 @@ export const useCreateWithGuardian = < return createWithGuardian(data); }; - return useMutation< + return { mutationFn, ...mutationOptions }; +}; + +export type CreateWithGuardianMutationResult = NonNullable< + Awaited> +>; +export type CreateWithGuardianMutationBody = + BodyType; +export type CreateWithGuardianMutationError = ErrorType; + +/** + * @summary Creates a person patron with a guardian (eg A financial responsible). + */ +export const useCreateWithGuardian = < + TError = ErrorType, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< Awaited>, TError, { data: BodyType }, TContext - >(mutationFn, mutationOptions); + >; +}): UseMutationResult< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { + const mutationOptions = getCreateWithGuardianMutationOptions(options); + + return useMutation(mutationOptions); }; /** @@ -889,19 +1164,13 @@ export const updateGuardian = ( ) => { return fetcher({ url: `/external/agencyid/patrons/withGuardian/v1`, - method: "put", + method: "PUT", headers: { "Content-Type": "application/json" }, data: updateGuardianRequest }); }; -export type UpdateGuardianMutationResult = NonNullable< - Awaited> ->; -export type UpdateGuardianMutationBody = BodyType; -export type UpdateGuardianMutationError = ErrorType; - -export const useUpdateGuardian = < +export const getUpdateGuardianMutationOptions = < TError = ErrorType, TContext = unknown >(options?: { @@ -911,7 +1180,12 @@ export const useUpdateGuardian = < { data: BodyType }, TContext >; -}) => { +}): UseMutationOptions< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { const { mutation: mutationOptions } = options ?? {}; const mutationFn: MutationFunction< @@ -923,12 +1197,37 @@ export const useUpdateGuardian = < return updateGuardian(data); }; - return useMutation< + return { mutationFn, ...mutationOptions }; +}; + +export type UpdateGuardianMutationResult = NonNullable< + Awaited> +>; +export type UpdateGuardianMutationBody = BodyType; +export type UpdateGuardianMutationError = ErrorType; + +/** + * @summary Updates a person patron's guardian (eg A financial responsible). + */ +export const useUpdateGuardian = < + TError = ErrorType, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< Awaited>, TError, { data: BodyType }, TContext - >(mutationFn, mutationOptions); + >; +}): UseMutationResult< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { + const mutationOptions = getUpdateGuardianMutationOptions(options); + + return useMutation(mutationOptions); }; /** @@ -963,22 +1262,16 @@ export const useUpdateGuardian = <

* @summary Renew loans. */ -export const renewLoansV2 = (renewLoansV2Body: number[]) => { +export const renewLoansV2 = (renewLoansV2Body: BodyType) => { return fetcher({ url: `/external/agencyid/patrons/patronid/loans/renew/v2`, - method: "post", + method: "POST", headers: { "Content-Type": "application/json" }, data: renewLoansV2Body }); }; -export type RenewLoansV2MutationResult = NonNullable< - Awaited> ->; -export type RenewLoansV2MutationBody = BodyType; -export type RenewLoansV2MutationError = ErrorType; - -export const useRenewLoansV2 = < +export const getRenewLoansV2MutationOptions = < TError = ErrorType, TContext = unknown >(options?: { @@ -988,7 +1281,12 @@ export const useRenewLoansV2 = < { data: BodyType }, TContext >; -}) => { +}): UseMutationOptions< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { const { mutation: mutationOptions } = options ?? {}; const mutationFn: MutationFunction< @@ -1000,12 +1298,37 @@ export const useRenewLoansV2 = < return renewLoansV2(data); }; - return useMutation< + return { mutationFn, ...mutationOptions }; +}; + +export type RenewLoansV2MutationResult = NonNullable< + Awaited> +>; +export type RenewLoansV2MutationBody = BodyType; +export type RenewLoansV2MutationError = ErrorType; + +/** + * @summary Renew loans. + */ +export const useRenewLoansV2 = < + TError = ErrorType, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< Awaited>, TError, { data: BodyType }, TContext - >(mutationFn, mutationOptions); + >; +}): UseMutationResult< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { + const mutationOptions = getRenewLoansV2MutationOptions(options); + + return useMutation(mutationOptions); }; /** @@ -1044,21 +1367,16 @@ export const useRenewLoansV2 = < export const getLoansV2 = (signal?: AbortSignal) => { return fetcher({ url: `/external/agencyid/patrons/patronid/loans/v2`, - method: "get", + method: "GET", signal }); }; -export const getGetLoansV2QueryKey = () => [ - `/external/agencyid/patrons/patronid/loans/v2` -]; - -export type GetLoansV2QueryResult = NonNullable< - Awaited> ->; -export type GetLoansV2QueryError = ErrorType; +export const getGetLoansV2QueryKey = () => { + return [`/external/agencyid/patrons/patronid/loans/v2`] as const; +}; -export const useGetLoansV2 = < +export const getGetLoansV2QueryOptions = < TData = Awaited>, TError = ErrorType >(options?: { @@ -1067,7 +1385,7 @@ export const useGetLoansV2 = < TError, TData >; -}): UseQueryResult & { queryKey: QueryKey } => { +}) => { const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetLoansV2QueryKey(); @@ -1076,16 +1394,40 @@ export const useGetLoansV2 = < signal }) => getLoansV2(signal); - const query = useQuery>, TError, TData>( - queryKey, - queryFn, - queryOptions - ); + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey }; +}; + +export type GetLoansV2QueryResult = NonNullable< + Awaited> +>; +export type GetLoansV2QueryError = ErrorType; - return { - queryKey, - ...query +/** + * @summary Get list of current loans by the patron. + */ +export const useGetLoansV2 = < + TData = Awaited>, + TError = ErrorType +>(options?: { + query?: UseQueryOptions< + Awaited>, + TError, + TData + >; +}): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getGetLoansV2QueryOptions(options); + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey; }; + + query.queryKey = queryOptions.queryKey; + + return query; }; /** @@ -1106,21 +1448,16 @@ export const useGetLoansV2 = < export const getPatronInformationByPatronIdV2 = (signal?: AbortSignal) => { return fetcher({ url: `/external/agencyid/patrons/patronid/v2`, - method: "get", + method: "GET", signal }); }; -export const getGetPatronInformationByPatronIdV2QueryKey = () => [ - `/external/agencyid/patrons/patronid/v2` -]; - -export type GetPatronInformationByPatronIdV2QueryResult = NonNullable< - Awaited> ->; -export type GetPatronInformationByPatronIdV2QueryError = ErrorType; +export const getGetPatronInformationByPatronIdV2QueryKey = () => { + return [`/external/agencyid/patrons/patronid/v2`] as const; +}; -export const useGetPatronInformationByPatronIdV2 = < +export const getGetPatronInformationByPatronIdV2QueryOptions = < TData = Awaited>, TError = ErrorType >( @@ -1129,24 +1466,48 @@ export const useGetPatronInformationByPatronIdV2 = < TError, TData > -): UseQueryResult & { queryKey: QueryKey } => { +) => { const queryKey = queryOptions?.queryKey ?? getGetPatronInformationByPatronIdV2QueryKey(); const queryFn: QueryFunction< Awaited> - > = ({ signal }) => getPatronInformationByPatronIdV2(); + > = ({ signal }) => getPatronInformationByPatronIdV2(signal); - const query = useQuery< + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, TError, TData - >(queryKey, queryFn, queryOptions); + > & { queryKey: QueryKey }; +}; + +export type GetPatronInformationByPatronIdV2QueryResult = NonNullable< + Awaited> +>; +export type GetPatronInformationByPatronIdV2QueryError = ErrorType; - return { - queryKey, - ...query +/** + * @summary Returns the patron details + */ +export const useGetPatronInformationByPatronIdV2 = < + TData = Awaited>, + TError = ErrorType +>( + queryOptions?: UseQueryOptions< + Awaited>, + TError, + TData + > +): UseQueryResult & { queryKey: QueryKey } => { + const options = getGetPatronInformationByPatronIdV2QueryOptions(queryOptions); + + const query = useQuery(options) as UseQueryResult & { + queryKey: QueryKey; }; + + query.queryKey = options.queryKey; + + return query; }; /** @@ -1172,19 +1533,13 @@ export const updateV5 = ( ) => { return fetcher({ url: `/external/agencyid/patrons/patronid/v5`, - method: "put", + method: "PUT", headers: { "Content-Type": "application/json" }, data: updatePatronRequestV4 }); }; -export type UpdateV5MutationResult = NonNullable< - Awaited> ->; -export type UpdateV5MutationBody = BodyType; -export type UpdateV5MutationError = ErrorType; - -export const useUpdateV5 = < +export const getUpdateV5MutationOptions = < TError = ErrorType, TContext = unknown >(options?: { @@ -1194,7 +1549,12 @@ export const useUpdateV5 = < { data: BodyType }, TContext >; -}) => { +}): UseMutationOptions< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { const { mutation: mutationOptions } = options ?? {}; const mutationFn: MutationFunction< @@ -1206,10 +1566,35 @@ export const useUpdateV5 = < return updateV5(data); }; - return useMutation< + return { mutationFn, ...mutationOptions }; +}; + +export type UpdateV5MutationResult = NonNullable< + Awaited> +>; +export type UpdateV5MutationBody = BodyType; +export type UpdateV5MutationError = ErrorType; + +/** + * @summary Update information about the patron. + */ +export const useUpdateV5 = < + TError = ErrorType, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< Awaited>, TError, { data: BodyType }, TContext - >(mutationFn, mutationOptions); + >; +}): UseMutationResult< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { + const mutationOptions = getUpdateV5MutationOptions(options); + + return useMutation(mutationOptions); }; diff --git a/src/core/fbs/model/address.ts b/src/core/fbs/model/address.ts index 652ead100c..d49eee4d3c 100644 --- a/src/core/fbs/model/address.ts +++ b/src/core/fbs/model/address.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/addressV2.ts b/src/core/fbs/model/addressV2.ts index 1648656f29..83c0983e16 100644 --- a/src/core/fbs/model/addressV2.ts +++ b/src/core/fbs/model/addressV2.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/agencyBranch.ts b/src/core/fbs/model/agencyBranch.ts index 2167f21533..b128a97776 100644 --- a/src/core/fbs/model/agencyBranch.ts +++ b/src/core/fbs/model/agencyBranch.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/agencyDepartment.ts b/src/core/fbs/model/agencyDepartment.ts index 55df921e20..125397ac6b 100644 --- a/src/core/fbs/model/agencyDepartment.ts +++ b/src/core/fbs/model/agencyDepartment.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/agencyLocation.ts b/src/core/fbs/model/agencyLocation.ts index adfe2d03cd..cdbc024790 100644 --- a/src/core/fbs/model/agencyLocation.ts +++ b/src/core/fbs/model/agencyLocation.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/agencySublocation.ts b/src/core/fbs/model/agencySublocation.ts index 3287b2fcd0..b86b4ea72e 100644 --- a/src/core/fbs/model/agencySublocation.ts +++ b/src/core/fbs/model/agencySublocation.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/authenticatedPatronV4.ts b/src/core/fbs/model/authenticatedPatronV4.ts index 8977be1e25..34b6364295 100644 --- a/src/core/fbs/model/authenticatedPatronV4.ts +++ b/src/core/fbs/model/authenticatedPatronV4.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/authenticatedPatronV6.ts b/src/core/fbs/model/authenticatedPatronV6.ts index dc794be596..979e922174 100644 --- a/src/core/fbs/model/authenticatedPatronV6.ts +++ b/src/core/fbs/model/authenticatedPatronV6.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/authenticatedPatronV6AuthenticateStatus.ts b/src/core/fbs/model/authenticatedPatronV6AuthenticateStatus.ts index 9a66d11d71..f45f68a1bd 100644 --- a/src/core/fbs/model/authenticatedPatronV6AuthenticateStatus.ts +++ b/src/core/fbs/model/authenticatedPatronV6AuthenticateStatus.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/availabilityV3.ts b/src/core/fbs/model/availabilityV3.ts index 96c17ccb2d..c106b74a40 100644 --- a/src/core/fbs/model/availabilityV3.ts +++ b/src/core/fbs/model/availabilityV3.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/blockStatus.ts b/src/core/fbs/model/blockStatus.ts index e2b1e27965..ca17083159 100644 --- a/src/core/fbs/model/blockStatus.ts +++ b/src/core/fbs/model/blockStatus.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/booking.ts b/src/core/fbs/model/booking.ts index a188b3bca1..cec6bdfc95 100644 --- a/src/core/fbs/model/booking.ts +++ b/src/core/fbs/model/booking.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/bookingInfo.ts b/src/core/fbs/model/bookingInfo.ts index 48323d4d32..26a70edda1 100644 --- a/src/core/fbs/model/bookingInfo.ts +++ b/src/core/fbs/model/bookingInfo.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/createBooking.ts b/src/core/fbs/model/createBooking.ts index e492846151..402aac12eb 100644 --- a/src/core/fbs/model/createBooking.ts +++ b/src/core/fbs/model/createBooking.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/createPatronRequestV3.ts b/src/core/fbs/model/createPatronRequestV3.ts index 0409a43fe6..fb086c4d92 100644 --- a/src/core/fbs/model/createPatronRequestV3.ts +++ b/src/core/fbs/model/createPatronRequestV3.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/createReservation.ts b/src/core/fbs/model/createReservation.ts index dca5326364..07beb7a46d 100644 --- a/src/core/fbs/model/createReservation.ts +++ b/src/core/fbs/model/createReservation.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/createReservationBatch.ts b/src/core/fbs/model/createReservationBatch.ts index 0f73f52a2a..d24926de16 100644 --- a/src/core/fbs/model/createReservationBatch.ts +++ b/src/core/fbs/model/createReservationBatch.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/createReservationBatchV2.ts b/src/core/fbs/model/createReservationBatchV2.ts index 2e4641bb9f..5722600226 100644 --- a/src/core/fbs/model/createReservationBatchV2.ts +++ b/src/core/fbs/model/createReservationBatchV2.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/deleteReservationsParams.ts b/src/core/fbs/model/deleteReservationsParams.ts index e6a99c3ddf..8458e1b08b 100644 --- a/src/core/fbs/model/deleteReservationsParams.ts +++ b/src/core/fbs/model/deleteReservationsParams.ts @@ -1,8 +1,13 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 */ -export type DeleteReservationsParams = { reservationid: number[] }; +export type DeleteReservationsParams = { + /** + * a list of reservation ids for reservations that are to be deleted + */ + reservationid: number[]; +}; diff --git a/src/core/fbs/model/feeMaterial.ts b/src/core/fbs/model/feeMaterial.ts index 961968a73d..8d4450b6c4 100644 --- a/src/core/fbs/model/feeMaterial.ts +++ b/src/core/fbs/model/feeMaterial.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/feeMaterialV2.ts b/src/core/fbs/model/feeMaterialV2.ts index 21f426aa7d..235533a233 100644 --- a/src/core/fbs/model/feeMaterialV2.ts +++ b/src/core/fbs/model/feeMaterialV2.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/feeV2.ts b/src/core/fbs/model/feeV2.ts index 4390805fd3..19f9e1015d 100644 --- a/src/core/fbs/model/feeV2.ts +++ b/src/core/fbs/model/feeV2.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/getAvailabilityV3Params.ts b/src/core/fbs/model/getAvailabilityV3Params.ts index a1bff83afe..2310c054a8 100644 --- a/src/core/fbs/model/getAvailabilityV3Params.ts +++ b/src/core/fbs/model/getAvailabilityV3Params.ts @@ -1,11 +1,17 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 */ export type GetAvailabilityV3Params = { + /** + * list of record ids + */ recordid: string[]; + /** + * Identifies the branchIds which are excluded from the result + */ exclude?: string[]; }; diff --git a/src/core/fbs/model/getBranchesParams.ts b/src/core/fbs/model/getBranchesParams.ts index 3ba9469599..e28881907d 100644 --- a/src/core/fbs/model/getBranchesParams.ts +++ b/src/core/fbs/model/getBranchesParams.ts @@ -1,8 +1,13 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 */ -export type GetBranchesParams = { exclude?: string[] }; +export type GetBranchesParams = { + /** + * Identifies the branchIds which are excluded from the result + */ + exclude?: string[]; +}; diff --git a/src/core/fbs/model/getFeesV2Params.ts b/src/core/fbs/model/getFeesV2Params.ts index 0de7683865..606bcda7df 100644 --- a/src/core/fbs/model/getFeesV2Params.ts +++ b/src/core/fbs/model/getFeesV2Params.ts @@ -1,11 +1,19 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 */ export type GetFeesV2Params = { + /** + * true if all paid/unpaid fees should be included, false if only unpaid fees should + be included; default=false + */ includepaid: boolean; + /** + * true if fees that are not payable through a CMS system should be included (for read + only access); default=false + */ includenonpayable: boolean; }; diff --git a/src/core/fbs/model/getHoldingsV3Params.ts b/src/core/fbs/model/getHoldingsV3Params.ts index 3e36599200..9cec7878b0 100644 --- a/src/core/fbs/model/getHoldingsV3Params.ts +++ b/src/core/fbs/model/getHoldingsV3Params.ts @@ -1,8 +1,17 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 */ -export type GetHoldingsV3Params = { recordid: string[]; exclude?: string[] }; +export type GetHoldingsV3Params = { + /** + * Identifies the bibliographical records - The FAUST number. + */ + recordid: string[]; + /** + * Identifies the branchIds which are excluded from the result + */ + exclude?: string[]; +}; diff --git a/src/core/fbs/model/guardian.ts b/src/core/fbs/model/guardian.ts index a35ebb11ff..053046a9ba 100644 --- a/src/core/fbs/model/guardian.ts +++ b/src/core/fbs/model/guardian.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/holdings.ts b/src/core/fbs/model/holdings.ts index 50c521203c..21ab55c429 100644 --- a/src/core/fbs/model/holdings.ts +++ b/src/core/fbs/model/holdings.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/holdingsForBibliographicalRecordV3.ts b/src/core/fbs/model/holdingsForBibliographicalRecordV3.ts index a6b226a952..4eaf02e099 100644 --- a/src/core/fbs/model/holdingsForBibliographicalRecordV3.ts +++ b/src/core/fbs/model/holdingsForBibliographicalRecordV3.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/holdingsV3.ts b/src/core/fbs/model/holdingsV3.ts index 796812b3f7..22981ccc51 100644 --- a/src/core/fbs/model/holdingsV3.ts +++ b/src/core/fbs/model/holdingsV3.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/iLLBibliographicRecord.ts b/src/core/fbs/model/iLLBibliographicRecord.ts index 1fcfcc949c..451280906a 100644 --- a/src/core/fbs/model/iLLBibliographicRecord.ts +++ b/src/core/fbs/model/iLLBibliographicRecord.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/index.ts b/src/core/fbs/model/index.ts index 849c5d4068..e41e120c5f 100644 --- a/src/core/fbs/model/index.ts +++ b/src/core/fbs/model/index.ts @@ -1,60 +1,67 @@ +/** + * Generated by orval v6.26.0 🍺 + * Do not edit manually. + * FBS Adapter + * OpenAPI spec version: 1.0 + */ + export * from "./address"; +export * from "./addressV2"; +export * from "./agencyBranch"; export * from "./agencyDepartment"; export * from "./agencyLocation"; +export * from "./agencySublocation"; +export * from "./authenticatedPatronV4"; +export * from "./authenticatedPatronV6"; export * from "./authenticatedPatronV6AuthenticateStatus"; -export * from "./booking"; export * from "./availabilityV3"; +export * from "./blockStatus"; +export * from "./booking"; +export * from "./bookingInfo"; export * from "./createBooking"; -export * from "./createReservation"; export * from "./createPatronRequestV3"; -export * from "./authenticatedPatronV6"; -export * from "./blockStatus"; -export * from "./feeV2"; -export * from "./feeMaterialV2"; +export * from "./createReservation"; export * from "./createReservationBatch"; -export * from "./agencyBranch"; export * from "./createReservationBatchV2"; +export * from "./deleteReservationsParams"; +export * from "./feeMaterial"; +export * from "./feeMaterialV2"; +export * from "./feeV2"; +export * from "./getAvailabilityV3Params"; +export * from "./getBranchesParams"; +export * from "./getFeesV2Params"; +export * from "./getHoldingsV3Params"; export * from "./guardian"; +export * from "./holdings"; export * from "./holdingsForBibliographicalRecordV3"; -export * from "./loanDetailsV2"; export * from "./holdingsV3"; export * from "./iLLBibliographicRecord"; -export * from "./material"; export * from "./loanDetails"; +export * from "./loanDetailsV2"; export * from "./loanV2"; +export * from "./material"; +export * from "./materialGroup"; export * from "./materialV3"; export * from "./patron"; -export * from "./agencySublocation"; -export * from "./materialGroup"; +export * from "./patronGroup"; export * from "./patronSettings"; export * from "./patronSettingsV3"; -export * from "./holdings"; +export * from "./patronSettingsV4"; export * from "./patronV3"; export * from "./patronV4"; +export * from "./patronV5"; +export * from "./patronWithGuardianRequest"; export * from "./period"; -export * from "./patronSettingsV4"; -export * from "./authenticatedPatronV4"; -export * from "./feeMaterial"; +export * from "./periodical"; export * from "./periodicalReservation"; -export * from "./bookingInfo"; -export * from "./patronGroup"; +export * from "./pincodeChange"; +export * from "./renewedLoanV2"; export * from "./reservationDetails"; +export * from "./reservationDetailsV2"; export * from "./reservationResponseV2"; -export * from "./addressV2"; export * from "./reservationResult"; -export * from "./patronV5"; +export * from "./reservationResultV2"; export * from "./updateGuardianRequest"; -export * from "./updateReservationBatch"; -export * from "./reservationDetailsV2"; -export * from "./getAvailabilityV3Params"; -export * from "./pincodeChange"; -export * from "./patronWithGuardianRequest"; -export * from "./updateReservation"; -export * from "./periodical"; -export * from "./getHoldingsV3Params"; -export * from "./renewedLoanV2"; -export * from "./getFeesV2Params"; -export * from "./getBranchesParams"; export * from "./updatePatronRequestV4"; -export * from "./reservationResultV2"; -export * from "./deleteReservationsParams"; +export * from "./updateReservation"; +export * from "./updateReservationBatch"; diff --git a/src/core/fbs/model/loanDetails.ts b/src/core/fbs/model/loanDetails.ts index db689d2457..9e6f0429e7 100644 --- a/src/core/fbs/model/loanDetails.ts +++ b/src/core/fbs/model/loanDetails.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/loanDetailsV2.ts b/src/core/fbs/model/loanDetailsV2.ts index 2e79494c6f..335f9d0586 100644 --- a/src/core/fbs/model/loanDetailsV2.ts +++ b/src/core/fbs/model/loanDetailsV2.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/loanV2.ts b/src/core/fbs/model/loanV2.ts index b9544a87c8..d449e678b2 100644 --- a/src/core/fbs/model/loanV2.ts +++ b/src/core/fbs/model/loanV2.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/material.ts b/src/core/fbs/model/material.ts index 527b60ca61..5cfe05d0ca 100644 --- a/src/core/fbs/model/material.ts +++ b/src/core/fbs/model/material.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/materialGroup.ts b/src/core/fbs/model/materialGroup.ts index 566bb0eaf8..fce4c3da89 100644 --- a/src/core/fbs/model/materialGroup.ts +++ b/src/core/fbs/model/materialGroup.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/materialV3.ts b/src/core/fbs/model/materialV3.ts index bbd7830fa8..4abff76662 100644 --- a/src/core/fbs/model/materialV3.ts +++ b/src/core/fbs/model/materialV3.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/patron.ts b/src/core/fbs/model/patron.ts index ba14641c37..0a03876858 100644 --- a/src/core/fbs/model/patron.ts +++ b/src/core/fbs/model/patron.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/patronGroup.ts b/src/core/fbs/model/patronGroup.ts index ca63200c03..71bc73d8b8 100644 --- a/src/core/fbs/model/patronGroup.ts +++ b/src/core/fbs/model/patronGroup.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/patronSettings.ts b/src/core/fbs/model/patronSettings.ts index 868350f7f0..d6adcee884 100644 --- a/src/core/fbs/model/patronSettings.ts +++ b/src/core/fbs/model/patronSettings.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/patronSettingsV3.ts b/src/core/fbs/model/patronSettingsV3.ts index e7e04c3337..5c547c9b68 100644 --- a/src/core/fbs/model/patronSettingsV3.ts +++ b/src/core/fbs/model/patronSettingsV3.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/patronSettingsV4.ts b/src/core/fbs/model/patronSettingsV4.ts index bdf5edc199..087a63d39d 100644 --- a/src/core/fbs/model/patronSettingsV4.ts +++ b/src/core/fbs/model/patronSettingsV4.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/patronV3.ts b/src/core/fbs/model/patronV3.ts index 5d4b051d76..a5bdb95e8c 100644 --- a/src/core/fbs/model/patronV3.ts +++ b/src/core/fbs/model/patronV3.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/patronV4.ts b/src/core/fbs/model/patronV4.ts index 0e7e5b5416..182105782a 100644 --- a/src/core/fbs/model/patronV4.ts +++ b/src/core/fbs/model/patronV4.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/patronV5.ts b/src/core/fbs/model/patronV5.ts index 319d93bbdc..afa97f7aaa 100644 --- a/src/core/fbs/model/patronV5.ts +++ b/src/core/fbs/model/patronV5.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/patronWithGuardianRequest.ts b/src/core/fbs/model/patronWithGuardianRequest.ts index f6fbabdcc5..92f76fd891 100644 --- a/src/core/fbs/model/patronWithGuardianRequest.ts +++ b/src/core/fbs/model/patronWithGuardianRequest.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/period.ts b/src/core/fbs/model/period.ts index a80faf2efc..c2cb1134a5 100644 --- a/src/core/fbs/model/period.ts +++ b/src/core/fbs/model/period.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/periodical.ts b/src/core/fbs/model/periodical.ts index 5a06a581bc..93d36b53f7 100644 --- a/src/core/fbs/model/periodical.ts +++ b/src/core/fbs/model/periodical.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/periodicalReservation.ts b/src/core/fbs/model/periodicalReservation.ts index 06c877bf48..5f028cd9b7 100644 --- a/src/core/fbs/model/periodicalReservation.ts +++ b/src/core/fbs/model/periodicalReservation.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/pincodeChange.ts b/src/core/fbs/model/pincodeChange.ts index d8be595dc8..5508228811 100644 --- a/src/core/fbs/model/pincodeChange.ts +++ b/src/core/fbs/model/pincodeChange.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/renewedLoanV2.ts b/src/core/fbs/model/renewedLoanV2.ts index 74a6b98de9..7867cc8e9a 100644 --- a/src/core/fbs/model/renewedLoanV2.ts +++ b/src/core/fbs/model/renewedLoanV2.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/reservationDetails.ts b/src/core/fbs/model/reservationDetails.ts index 50a497437d..7efa942efb 100644 --- a/src/core/fbs/model/reservationDetails.ts +++ b/src/core/fbs/model/reservationDetails.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/reservationDetailsV2.ts b/src/core/fbs/model/reservationDetailsV2.ts index adf1215be0..0c86aaeee7 100644 --- a/src/core/fbs/model/reservationDetailsV2.ts +++ b/src/core/fbs/model/reservationDetailsV2.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/reservationResponseV2.ts b/src/core/fbs/model/reservationResponseV2.ts index 067fadc003..aafe8460b8 100644 --- a/src/core/fbs/model/reservationResponseV2.ts +++ b/src/core/fbs/model/reservationResponseV2.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/reservationResult.ts b/src/core/fbs/model/reservationResult.ts index c01918115a..cc0cf8ecc8 100644 --- a/src/core/fbs/model/reservationResult.ts +++ b/src/core/fbs/model/reservationResult.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/reservationResultV2.ts b/src/core/fbs/model/reservationResultV2.ts index fb0e1afc86..475a1fb5d0 100644 --- a/src/core/fbs/model/reservationResultV2.ts +++ b/src/core/fbs/model/reservationResultV2.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/updateGuardianRequest.ts b/src/core/fbs/model/updateGuardianRequest.ts index 0456dfd789..c4161c7b86 100644 --- a/src/core/fbs/model/updateGuardianRequest.ts +++ b/src/core/fbs/model/updateGuardianRequest.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/updatePatronRequestV4.ts b/src/core/fbs/model/updatePatronRequestV4.ts index fd9bb9198b..e61234d3b0 100644 --- a/src/core/fbs/model/updatePatronRequestV4.ts +++ b/src/core/fbs/model/updatePatronRequestV4.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/updateReservation.ts b/src/core/fbs/model/updateReservation.ts index bdeecba690..658603ac95 100644 --- a/src/core/fbs/model/updateReservation.ts +++ b/src/core/fbs/model/updateReservation.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/model/updateReservationBatch.ts b/src/core/fbs/model/updateReservationBatch.ts index 45fc71569b..6cfc2e734c 100644 --- a/src/core/fbs/model/updateReservationBatch.ts +++ b/src/core/fbs/model/updateReservationBatch.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * FBS Adapter * OpenAPI spec version: 1.0 diff --git a/src/core/fbs/mutator/fetcher.ts b/src/core/fbs/mutator/fetcher.ts index e12ec6ef11..934640c774 100644 --- a/src/core/fbs/mutator/fetcher.ts +++ b/src/core/fbs/mutator/fetcher.ts @@ -16,7 +16,7 @@ export const fetcher = async ({ data }: { url: string; - method: "get" | "post" | "put" | "delete" | "patch" | "head"; + method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD"; headers?: object; params?: unknown; data?: BodyType; From 71da25aac26b4f18d796a46a73ecbc08d3454e9a Mon Sep 17 00:00:00 2001 From: Kasper Birch Date: Tue, 9 Apr 2024 11:51:41 +0200 Subject: [PATCH 2/3] Update `orval` Publizon client and execute `yarn codegen:client:publizon` - Incorporated a command to remove existing files in `src/core/publizon/model/*.*` before the execution of the `"codegen:client:publizon"` script. - Updated fetcher methods to use uppercase naming convention. --- package.json | 2 +- src/core/publizon/model/apiResponseCode.ts | 2 +- src/core/publizon/model/apiResult.ts | 3 +- src/core/publizon/model/bookTypes.ts | 2 +- src/core/publizon/model/checklistItem.ts | 6 +- src/core/publizon/model/checklistResult.ts | 6 +- .../publizon/model/contentLoanStatusEnum.ts | 2 +- src/core/publizon/model/createLoanResult.ts | 8 +- src/core/publizon/model/fileExtensionType.ts | 2 +- src/core/publizon/model/friendlyCardResult.ts | 6 +- .../publizon/model/getV1UserLoansParams.ts | 9 +- src/core/publizon/model/identifierTypeEnum.ts | 2 +- src/core/publizon/model/index.ts | 51 +- src/core/publizon/model/libraryBook.ts | 7 +- src/core/publizon/model/libraryData.ts | 6 +- .../publizon/model/libraryProductCategory.ts | 6 +- .../model/libraryProductContributor.ts | 7 +- .../model/libraryProductExternalId.ts | 5 +- src/core/publizon/model/libraryProfile.ts | 25 +- src/core/publizon/model/loan.ts | 15 +- src/core/publizon/model/loanListResult.ts | 10 +- src/core/publizon/model/loanResult.ts | 9 +- src/core/publizon/model/loanStatusItem.ts | 5 +- .../publizon/model/loanStatusListResult.ts | 6 +- src/core/publizon/model/loanStatusResult.ts | 8 +- .../model/postV1UserLoansIdentifierParams.ts | 2 +- src/core/publizon/model/product.ts | 46 +- src/core/publizon/model/productListResult.ts | 4 +- src/core/publizon/model/productResult.ts | 3 +- src/core/publizon/model/reservation.ts | 16 +- src/core/publizon/model/reservationInput.ts | 4 +- .../publizon/model/reservationListResult.ts | 4 +- src/core/publizon/model/testCard.ts | 3 +- src/core/publizon/model/userData.ts | 13 +- src/core/publizon/mutator/fetcher.ts | 2 +- src/core/publizon/publizon.ts | 875 +++++++++++++----- 36 files changed, 816 insertions(+), 366 deletions(-) diff --git a/package.json b/package.json index 0e1fd2f20f..053848d26a 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "codegen:rest-services": "orval", "codegen:client:fbs": "rm -rf src/core/fbs/model/*.* && orval --project fbsAdapter", "codegen:client:cover": "orval --project coverService", - "codegen:client:publizon": "orval --project publizonAdapter", + "codegen:client:publizon": "rm -rf src/core/publizon/model/*.* && orval --project publizonAdapter", "codegen:client:dpl-cms": "rm -rf src/core/dpl-cms/model/*.* && orval --project dplCms", "post-process-generated-graphql": "ts-node ./scripts/post-process-generated-graphql.ts" }, diff --git a/src/core/publizon/model/apiResponseCode.ts b/src/core/publizon/model/apiResponseCode.ts index 7d821fa33a..6d96e31d1d 100644 --- a/src/core/publizon/model/apiResponseCode.ts +++ b/src/core/publizon/model/apiResponseCode.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. diff --git a/src/core/publizon/model/apiResult.ts b/src/core/publizon/model/apiResult.ts index 80d8973157..da3c9a19c5 100644 --- a/src/core/publizon/model/apiResult.ts +++ b/src/core/publizon/model/apiResult.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -13,5 +13,6 @@ import type { ApiResponseCode } from "./apiResponseCode"; */ export interface ApiResult { code?: ApiResponseCode; + /** @nullable */ message?: string | null; } diff --git a/src/core/publizon/model/bookTypes.ts b/src/core/publizon/model/bookTypes.ts index d97440eaee..5ae6e8a95f 100644 --- a/src/core/publizon/model/bookTypes.ts +++ b/src/core/publizon/model/bookTypes.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. diff --git a/src/core/publizon/model/checklistItem.ts b/src/core/publizon/model/checklistItem.ts index 57721df5d2..1a698b7cdf 100644 --- a/src/core/publizon/model/checklistItem.ts +++ b/src/core/publizon/model/checklistItem.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -12,6 +12,8 @@ Orders/loans created in test environment will not be invoiced. Please request a */ export interface ChecklistItem { createdDateUtc?: string; - productTitle?: string | null; + /** @nullable */ identifier?: string | null; + /** @nullable */ + productTitle?: string | null; } diff --git a/src/core/publizon/model/checklistResult.ts b/src/core/publizon/model/checklistResult.ts index c1814553d3..4027c97941 100644 --- a/src/core/publizon/model/checklistResult.ts +++ b/src/core/publizon/model/checklistResult.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -16,6 +16,8 @@ import type { ChecklistItem } from "./checklistItem"; */ export interface ChecklistResult { code?: ApiResponseCode; - message?: string | null; + /** @nullable */ items?: ChecklistItem[] | null; + /** @nullable */ + message?: string | null; } diff --git a/src/core/publizon/model/contentLoanStatusEnum.ts b/src/core/publizon/model/contentLoanStatusEnum.ts index 05a5dc038a..b72d0eaed7 100644 --- a/src/core/publizon/model/contentLoanStatusEnum.ts +++ b/src/core/publizon/model/contentLoanStatusEnum.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. diff --git a/src/core/publizon/model/createLoanResult.ts b/src/core/publizon/model/createLoanResult.ts index a7ca15dcc3..37f568c981 100644 --- a/src/core/publizon/model/createLoanResult.ts +++ b/src/core/publizon/model/createLoanResult.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -10,8 +10,10 @@ import type { ApiResponseCode } from "./apiResponseCode"; export interface CreateLoanResult { code?: ApiResponseCode; - message?: string | null; expirationDateUtc?: string; - orderNumber?: string | null; + /** @nullable */ + message?: string | null; orderId?: string; + /** @nullable */ + orderNumber?: string | null; } diff --git a/src/core/publizon/model/fileExtensionType.ts b/src/core/publizon/model/fileExtensionType.ts index 13a90b4e6b..2fb61e5c68 100644 --- a/src/core/publizon/model/fileExtensionType.ts +++ b/src/core/publizon/model/fileExtensionType.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. diff --git a/src/core/publizon/model/friendlyCardResult.ts b/src/core/publizon/model/friendlyCardResult.ts index e8b5ccbd63..649e8cdc03 100644 --- a/src/core/publizon/model/friendlyCardResult.ts +++ b/src/core/publizon/model/friendlyCardResult.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -10,6 +10,8 @@ import type { ApiResponseCode } from "./apiResponseCode"; export interface FriendlyCardResult { code?: ApiResponseCode; - message?: string | null; + /** @nullable */ friendlyCardNumber?: string | null; + /** @nullable */ + message?: string | null; } diff --git a/src/core/publizon/model/getV1UserLoansParams.ts b/src/core/publizon/model/getV1UserLoansParams.ts index e614253097..0f1f47c107 100644 --- a/src/core/publizon/model/getV1UserLoansParams.ts +++ b/src/core/publizon/model/getV1UserLoansParams.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -8,4 +8,9 @@ Orders/loans created in test environment will not be invoiced. Please request a */ import type { BookTypes } from "./bookTypes"; -export type GetV1UserLoansParams = { bookType?: BookTypes }; +export type GetV1UserLoansParams = { + /** + * 0 = Ebook, 1 = Audio + */ + bookType?: BookTypes; +}; diff --git a/src/core/publizon/model/identifierTypeEnum.ts b/src/core/publizon/model/identifierTypeEnum.ts index fcba664d69..b3b4154e7b 100644 --- a/src/core/publizon/model/identifierTypeEnum.ts +++ b/src/core/publizon/model/identifierTypeEnum.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. diff --git a/src/core/publizon/model/index.ts b/src/core/publizon/model/index.ts index 39acfc1cd4..dd63840abe 100644 --- a/src/core/publizon/model/index.ts +++ b/src/core/publizon/model/index.ts @@ -1,32 +1,41 @@ -export * from "./checklistResult"; -export * from "./contentLoanStatusEnum"; -export * from "./identifierTypeEnum"; -export * from "./bookTypes"; +/** + * Generated by orval v6.26.0 🍺 + * Do not edit manually. + * Publizon Library API + * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. +Orders/loans created in test environment will not be invoiced. Please request a new license key for the production environment when you're ready to go live. + * OpenAPI spec version: 1 + */ + export * from "./apiResponseCode"; -export * from "./fileExtensionType"; export * from "./apiResult"; -export * from "./libraryProductContributor"; -export * from "./createLoanResult"; +export * from "./bookTypes"; export * from "./checklistItem"; -export * from "./libraryProductCategory"; -export * from "./libraryBook"; +export * from "./checklistResult"; +export * from "./contentLoanStatusEnum"; +export * from "./createLoanResult"; +export * from "./fileExtensionType"; export * from "./friendlyCardResult"; -export * from "./loanListResult"; -export * from "./reservation"; -export * from "./product"; -export * from "./loan"; +export * from "./getV1UserLoansParams"; +export * from "./identifierTypeEnum"; +export * from "./libraryBook"; +export * from "./libraryData"; +export * from "./libraryProductCategory"; +export * from "./libraryProductContributor"; export * from "./libraryProductExternalId"; -export * from "./productListResult"; -export * from "./loanStatusListResult"; +export * from "./libraryProfile"; +export * from "./loan"; +export * from "./loanListResult"; export * from "./loanResult"; export * from "./loanStatusItem"; -export * from "./userData"; +export * from "./loanStatusListResult"; export * from "./loanStatusResult"; -export * from "./libraryData"; +export * from "./postV1UserLoansIdentifierParams"; +export * from "./product"; +export * from "./productListResult"; +export * from "./productResult"; +export * from "./reservation"; export * from "./reservationInput"; -export * from "./libraryProfile"; export * from "./reservationListResult"; -export * from "./productResult"; -export * from "./getV1UserLoansParams"; export * from "./testCard"; -export * from "./postV1UserLoansIdentifierParams"; +export * from "./userData"; diff --git a/src/core/publizon/model/libraryBook.ts b/src/core/publizon/model/libraryBook.ts index d88af7ef1c..1d2dbca40e 100644 --- a/src/core/publizon/model/libraryBook.ts +++ b/src/core/publizon/model/libraryBook.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -9,8 +9,11 @@ Orders/loans created in test environment will not be invoiced. Please request a import type { IdentifierTypeEnum } from "./identifierTypeEnum"; export interface LibraryBook { + /** @nullable */ identifier?: string | null; identifierType?: IdentifierTypeEnum; - title?: string | null; + /** @nullable */ publishersName?: string | null; + /** @nullable */ + title?: string | null; } diff --git a/src/core/publizon/model/libraryData.ts b/src/core/publizon/model/libraryData.ts index 78289bbcf8..2940e50e80 100644 --- a/src/core/publizon/model/libraryData.ts +++ b/src/core/publizon/model/libraryData.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -9,7 +9,7 @@ Orders/loans created in test environment will not be invoiced. Please request a export interface LibraryData { loanDurationDays?: number; - maxConcurrentEbookLoansPerBorrower?: number; - maxConcurrentAudiobookLoansPerBorrower?: number; maxAmountPerMonth?: number; + maxConcurrentAudiobookLoansPerBorrower?: number; + maxConcurrentEbookLoansPerBorrower?: number; } diff --git a/src/core/publizon/model/libraryProductCategory.ts b/src/core/publizon/model/libraryProductCategory.ts index 653bd30f06..c700064fc0 100644 --- a/src/core/publizon/model/libraryProductCategory.ts +++ b/src/core/publizon/model/libraryProductCategory.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -8,6 +8,8 @@ Orders/loans created in test environment will not be invoiced. Please request a */ export interface LibraryProductCategory { - description?: string | null; + /** @nullable */ code?: string | null; + /** @nullable */ + description?: string | null; } diff --git a/src/core/publizon/model/libraryProductContributor.ts b/src/core/publizon/model/libraryProductContributor.ts index aa92bff3d9..38bd7fa1fd 100644 --- a/src/core/publizon/model/libraryProductContributor.ts +++ b/src/core/publizon/model/libraryProductContributor.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -8,7 +8,10 @@ Orders/loans created in test environment will not be invoiced. Please request a */ export interface LibraryProductContributor { - type?: string | null; + /** @nullable */ firstName?: string | null; + /** @nullable */ lastName?: string | null; + /** @nullable */ + type?: string | null; } diff --git a/src/core/publizon/model/libraryProductExternalId.ts b/src/core/publizon/model/libraryProductExternalId.ts index 6494315689..ae62abda9a 100644 --- a/src/core/publizon/model/libraryProductExternalId.ts +++ b/src/core/publizon/model/libraryProductExternalId.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -9,6 +9,7 @@ Orders/loans created in test environment will not be invoiced. Please request a import type { IdentifierTypeEnum } from "./identifierTypeEnum"; export interface LibraryProductExternalId { - idType?: IdentifierTypeEnum; + /** @nullable */ id?: string | null; + idType?: IdentifierTypeEnum; } diff --git a/src/core/publizon/model/libraryProfile.ts b/src/core/publizon/model/libraryProfile.ts index c9f40cb775..53eb0e022b 100644 --- a/src/core/publizon/model/libraryProfile.ts +++ b/src/core/publizon/model/libraryProfile.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -9,20 +9,25 @@ Orders/loans created in test environment will not be invoiced. Please request a import type { TestCard } from "./testCard"; export interface LibraryProfile { + audioLoanDurationInDays?: number; + ebookLoanDurationInDays?: number; id?: number; - name?: string | null; + /** @nullable */ isilNumber?: string | null; - ebookLoanDurationInDays?: number; - maxEbookAmountPerMonth?: number; - maxEbookAmountPerMonthNotificationThreshold?: number | null; - maxConcurrentEbookLoansPerBorrower?: number; - maxConcurrentEbookReservationsPerBorrower?: number; - maxEbookCancellationsPerMonth?: number; - audioLoanDurationInDays?: number; maxAudioAmountPerMonth?: number; + /** @nullable */ maxAudioAmountPerMonthNotificationThreshold?: number | null; + maxAudioCancellationsPerMonth?: number; maxConcurrentAudioLoansPerBorrower?: number; maxConcurrentAudioReservationsPerBorrower?: number; - maxAudioCancellationsPerMonth?: number; + maxConcurrentEbookLoansPerBorrower?: number; + maxConcurrentEbookReservationsPerBorrower?: number; + maxEbookAmountPerMonth?: number; + /** @nullable */ + maxEbookAmountPerMonthNotificationThreshold?: number | null; + maxEbookCancellationsPerMonth?: number; + /** @nullable */ + name?: string | null; + /** @nullable */ testCards?: TestCard[] | null; } diff --git a/src/core/publizon/model/loan.ts b/src/core/publizon/model/loan.ts index 17fdb9ad1f..d613f6444a 100644 --- a/src/core/publizon/model/loan.ts +++ b/src/core/publizon/model/loan.ts @@ -1,20 +1,21 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. Orders/loans created in test environment will not be invoiced. Please request a new license key for the production environment when you're ready to go live. * OpenAPI spec version: 1 */ -import type { LibraryBook } from "./libraryBook"; import type { FileExtensionType } from "./fileExtensionType"; +import type { LibraryBook } from "./libraryBook"; export interface Loan { - orderId?: string; - orderNumber?: string | null; - orderDateUtc?: string; - loanExpireDateUtc?: string; + fileExtensionType?: FileExtensionType; isSubscriptionLoan?: boolean; libraryBook?: LibraryBook; - fileExtensionType?: FileExtensionType; + loanExpireDateUtc?: string; + orderDateUtc?: string; + orderId?: string; + /** @nullable */ + orderNumber?: string | null; } diff --git a/src/core/publizon/model/loanListResult.ts b/src/core/publizon/model/loanListResult.ts index fefd77f63b..387f8f11de 100644 --- a/src/core/publizon/model/loanListResult.ts +++ b/src/core/publizon/model/loanListResult.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -7,14 +7,16 @@ Orders/loans created in test environment will not be invoiced. Please request a * OpenAPI spec version: 1 */ import type { ApiResponseCode } from "./apiResponseCode"; -import type { Loan } from "./loan"; import type { LibraryData } from "./libraryData"; +import type { Loan } from "./loan"; import type { UserData } from "./userData"; export interface LoanListResult { code?: ApiResponseCode; - message?: string | null; - loans?: Loan[] | null; libraryData?: LibraryData; + /** @nullable */ + loans?: Loan[] | null; + /** @nullable */ + message?: string | null; userData?: UserData; } diff --git a/src/core/publizon/model/loanResult.ts b/src/core/publizon/model/loanResult.ts index 446faa3ab2..fcc851e0bf 100644 --- a/src/core/publizon/model/loanResult.ts +++ b/src/core/publizon/model/loanResult.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -7,14 +7,15 @@ Orders/loans created in test environment will not be invoiced. Please request a * OpenAPI spec version: 1 */ import type { ApiResponseCode } from "./apiResponseCode"; -import type { Loan } from "./loan"; import type { LibraryData } from "./libraryData"; +import type { Loan } from "./loan"; import type { UserData } from "./userData"; export interface LoanResult { code?: ApiResponseCode; - message?: string | null; - loan?: Loan; libraryData?: LibraryData; + loan?: Loan; + /** @nullable */ + message?: string | null; userData?: UserData; } diff --git a/src/core/publizon/model/loanStatusItem.ts b/src/core/publizon/model/loanStatusItem.ts index d730ca9f69..5810816270 100644 --- a/src/core/publizon/model/loanStatusItem.ts +++ b/src/core/publizon/model/loanStatusItem.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -9,7 +9,8 @@ Orders/loans created in test environment will not be invoiced. Please request a import type { ContentLoanStatusEnum } from "./contentLoanStatusEnum"; export interface LoanStatusItem { + /** @nullable */ + identifier?: string | null; loanStatus?: ContentLoanStatusEnum; onChecklist?: boolean; - identifier?: string | null; } diff --git a/src/core/publizon/model/loanStatusListResult.ts b/src/core/publizon/model/loanStatusListResult.ts index 23c2daf532..d63c16b67e 100644 --- a/src/core/publizon/model/loanStatusListResult.ts +++ b/src/core/publizon/model/loanStatusListResult.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -11,6 +11,8 @@ import type { LoanStatusItem } from "./loanStatusItem"; export interface LoanStatusListResult { code?: ApiResponseCode; - message?: string | null; + /** @nullable */ items?: LoanStatusItem[] | null; + /** @nullable */ + message?: string | null; } diff --git a/src/core/publizon/model/loanStatusResult.ts b/src/core/publizon/model/loanStatusResult.ts index bbf8ad873a..073132f3dc 100644 --- a/src/core/publizon/model/loanStatusResult.ts +++ b/src/core/publizon/model/loanStatusResult.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -11,8 +11,10 @@ import type { ContentLoanStatusEnum } from "./contentLoanStatusEnum"; export interface LoanStatusResult { code?: ApiResponseCode; - message?: string | null; + /** @nullable */ + identifier?: string | null; loanStatus?: ContentLoanStatusEnum; + /** @nullable */ + message?: string | null; onChecklist?: boolean; - identifier?: string | null; } diff --git a/src/core/publizon/model/postV1UserLoansIdentifierParams.ts b/src/core/publizon/model/postV1UserLoansIdentifierParams.ts index 04087fdfbb..6bfb126c51 100644 --- a/src/core/publizon/model/postV1UserLoansIdentifierParams.ts +++ b/src/core/publizon/model/postV1UserLoansIdentifierParams.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. diff --git a/src/core/publizon/model/product.ts b/src/core/publizon/model/product.ts index ef551b2689..907ed5269e 100644 --- a/src/core/publizon/model/product.ts +++ b/src/core/publizon/model/product.ts @@ -1,34 +1,46 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. Orders/loans created in test environment will not be invoiced. Please request a new license key for the production environment when you're ready to go live. * OpenAPI spec version: 1 */ -import type { LibraryProductExternalId } from "./libraryProductExternalId"; import type { LibraryProductContributor } from "./libraryProductContributor"; +import type { LibraryProductExternalId } from "./libraryProductExternalId"; import type { LibraryProductCategory } from "./libraryProductCategory"; export interface Product { + /** @nullable */ + contributors?: LibraryProductContributor[] | null; + costFree?: boolean; + /** @nullable */ + coverUri?: string | null; createdUtc?: string; - updatedUtc?: string; - title?: string | null; + /** @nullable */ + description?: string | null; + /** @nullable */ + durationInSeconds?: number | null; + externalProductId?: LibraryProductExternalId; + fileSizeInBytes?: number; + /** @nullable */ + format?: string | null; + /** @nullable */ + internalProductId?: string | null; isActive?: boolean; + /** @nullable */ languageCode?: string | null; - coverUri?: string | null; - thumbnailUri?: string | null; - sampleUri?: string | null; + /** @nullable */ + productCategories?: LibraryProductCategory[] | null; productType?: number; - externalProductId?: LibraryProductExternalId; - internalProductId?: string | null; - contributors?: LibraryProductContributor[] | null; - format?: string | null; - fileSizeInBytes?: number; - durationInSeconds?: number | null; - publisher?: string | null; publicationDate?: string; - description?: string | null; - productCategories?: LibraryProductCategory[] | null; - costFree?: boolean; + /** @nullable */ + publisher?: string | null; + /** @nullable */ + sampleUri?: string | null; + /** @nullable */ + thumbnailUri?: string | null; + /** @nullable */ + title?: string | null; + updatedUtc?: string; } diff --git a/src/core/publizon/model/productListResult.ts b/src/core/publizon/model/productListResult.ts index f816719905..f1c51b493c 100644 --- a/src/core/publizon/model/productListResult.ts +++ b/src/core/publizon/model/productListResult.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -16,6 +16,8 @@ import type { Product } from "./product"; */ export interface ProductListResult { code?: ApiResponseCode; + /** @nullable */ message?: string | null; + /** @nullable */ products?: Product[] | null; } diff --git a/src/core/publizon/model/productResult.ts b/src/core/publizon/model/productResult.ts index b8c4f63be6..2a6af7f7cf 100644 --- a/src/core/publizon/model/productResult.ts +++ b/src/core/publizon/model/productResult.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -14,6 +14,7 @@ import type { Product } from "./product"; */ export interface ProductResult { code?: ApiResponseCode; + /** @nullable */ message?: string | null; product?: Product; } diff --git a/src/core/publizon/model/reservation.ts b/src/core/publizon/model/reservation.ts index e9b1010b1c..75f0a4309f 100644 --- a/src/core/publizon/model/reservation.ts +++ b/src/core/publizon/model/reservation.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -11,11 +11,15 @@ Orders/loans created in test environment will not be invoiced. Please request a * Reservation item. */ export interface Reservation { - productId?: string; - identifier?: string | null; createdDateUtc?: string; - status?: number; - productTitle?: string | null; - expireDateUtc?: string | null; + /** @nullable */ expectedRedeemDateUtc?: string | null; + /** @nullable */ + expireDateUtc?: string | null; + /** @nullable */ + identifier?: string | null; + productId?: string; + /** @nullable */ + productTitle?: string | null; + status?: number; } diff --git a/src/core/publizon/model/reservationInput.ts b/src/core/publizon/model/reservationInput.ts index 85a87dcdf5..a883f129e7 100644 --- a/src/core/publizon/model/reservationInput.ts +++ b/src/core/publizon/model/reservationInput.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -11,6 +11,8 @@ Orders/loans created in test environment will not be invoiced. Please request a * Data used to create/update a reservation. */ export interface ReservationInput { + /** @nullable */ email?: string | null; + /** @nullable */ phoneNumber?: string | null; } diff --git a/src/core/publizon/model/reservationListResult.ts b/src/core/publizon/model/reservationListResult.ts index fc32645236..437b9ab386 100644 --- a/src/core/publizon/model/reservationListResult.ts +++ b/src/core/publizon/model/reservationListResult.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -16,6 +16,8 @@ import type { Reservation } from "./reservation"; */ export interface ReservationListResult { code?: ApiResponseCode; + /** @nullable */ message?: string | null; + /** @nullable */ reservations?: Reservation[] | null; } diff --git a/src/core/publizon/model/testCard.ts b/src/core/publizon/model/testCard.ts index 0b75da931e..53417c7abf 100644 --- a/src/core/publizon/model/testCard.ts +++ b/src/core/publizon/model/testCard.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -8,5 +8,6 @@ Orders/loans created in test environment will not be invoiced. Please request a */ export interface TestCard { + /** @nullable */ testCardNumber?: string | null; } diff --git a/src/core/publizon/model/userData.ts b/src/core/publizon/model/userData.ts index dc3d4c72e7..a2c3cd4df3 100644 --- a/src/core/publizon/model/userData.ts +++ b/src/core/publizon/model/userData.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. @@ -8,12 +8,13 @@ Orders/loans created in test environment will not be invoiced. Please request a */ export interface UserData { - totalLoans?: number; - totalEbookLoans?: number; - totalAudioLoans?: number; - ebookLoansRemaining?: number; audiobookLoansRemaining?: number; - ebookLoanAvailableUtc?: string; audioLoanAvailableUtc?: string; + ebookLoanAvailableUtc?: string; + ebookLoansRemaining?: number; + /** @nullable */ friendlyCardNumber?: string | null; + totalAudioLoans?: number; + totalEbookLoans?: number; + totalLoans?: number; } diff --git a/src/core/publizon/mutator/fetcher.ts b/src/core/publizon/mutator/fetcher.ts index 63b1c2e970..c4965da64b 100644 --- a/src/core/publizon/mutator/fetcher.ts +++ b/src/core/publizon/mutator/fetcher.ts @@ -15,7 +15,7 @@ export const fetcher = async ({ data }: { url: string; - method: "get" | "post" | "put" | "delete" | "patch" | "head"; + method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD"; headers?: object; params?: unknown; data?: BodyType; diff --git a/src/core/publizon/publizon.ts b/src/core/publizon/publizon.ts index b8be5f38f1..6cae42e572 100644 --- a/src/core/publizon/publizon.ts +++ b/src/core/publizon/publizon.ts @@ -1,43 +1,40 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * Publizon Library API * Pubhub exists in two separate environments, each with their own server, code and database. Please use the web service located at library-api.qa.pubhub.dk when developing and testing. Orders/loans created in test environment will not be invoiced. Please request a new license key for the production environment when you're ready to go live. * OpenAPI spec version: 1 */ -import { - useQuery, - useMutation, - UseQueryOptions, - UseMutationOptions, - QueryFunction, +import { useMutation, useQuery } from "react-query"; +import type { MutationFunction, - UseQueryResult, - QueryKey + QueryFunction, + QueryKey, + UseMutationOptions, + UseMutationResult, + UseQueryOptions, + UseQueryResult } from "react-query"; import type { - FriendlyCardResult, ApiResult, ChecklistResult, + CreateLoanResult, + FriendlyCardResult, + GetV1UserLoansParams, LibraryProfile, LoanListResult, - GetV1UserLoansParams, LoanResult, - CreateLoanResult, - PostV1UserLoansIdentifierParams, - LoanStatusResult, LoanStatusListResult, - ProductResult, + LoanStatusResult, + PostV1UserLoansIdentifierParams, ProductListResult, - ReservationListResult, - ReservationInput + ProductResult, + ReservationInput, + ReservationListResult } from "./model"; -import { fetcher, ErrorType, BodyType } from "./mutator/fetcher"; - -type AwaitedInput = PromiseLike | T; - -type Awaited = O extends AwaitedInput ? T : never; +import { fetcher } from "./mutator/fetcher"; +import type { ErrorType, BodyType } from "./mutator/fetcher"; /** * Sample **request**: @@ -51,21 +48,16 @@ type Awaited = O extends AwaitedInput ? T : never; export const getV1UserCardnumberFriendly = (signal?: AbortSignal) => { return fetcher({ url: `/v1/user/cardnumber/friendly`, - method: "get", + method: "GET", signal }); }; -export const getGetV1UserCardnumberFriendlyQueryKey = () => [ - `/v1/user/cardnumber/friendly` -]; - -export type GetV1UserCardnumberFriendlyQueryResult = NonNullable< - Awaited> ->; -export type GetV1UserCardnumberFriendlyQueryError = ErrorType; +export const getGetV1UserCardnumberFriendlyQueryKey = () => { + return [`/v1/user/cardnumber/friendly`] as const; +}; -export const useGetV1UserCardnumberFriendly = < +export const getGetV1UserCardnumberFriendlyQueryOptions = < TData = Awaited>, TError = ErrorType >(options?: { @@ -74,7 +66,7 @@ export const useGetV1UserCardnumberFriendly = < TError, TData >; -}): UseQueryResult & { queryKey: QueryKey } => { +}) => { const { query: queryOptions } = options ?? {}; const queryKey = @@ -84,16 +76,40 @@ export const useGetV1UserCardnumberFriendly = < Awaited> > = ({ signal }) => getV1UserCardnumberFriendly(signal); - const query = useQuery< + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, TError, TData - >(queryKey, queryFn, queryOptions); + > & { queryKey: QueryKey }; +}; - return { - queryKey, - ...query +export type GetV1UserCardnumberFriendlyQueryResult = NonNullable< + Awaited> +>; +export type GetV1UserCardnumberFriendlyQueryError = ErrorType; + +/** + * @summary Gets the user's friendly card number. + */ +export const useGetV1UserCardnumberFriendly = < + TData = Awaited>, + TError = ErrorType +>(options?: { + query?: UseQueryOptions< + Awaited>, + TError, + TData + >; +}): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getGetV1UserCardnumberFriendlyQueryOptions(options); + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey; }; + + query.queryKey = queryOptions.queryKey; + + return query; }; /** @@ -102,19 +118,16 @@ export const useGetV1UserCardnumberFriendly = < export const getV1UserChecklist = (signal?: AbortSignal) => { return fetcher({ url: `/v1/user/checklist`, - method: "get", + method: "GET", signal }); }; -export const getGetV1UserChecklistQueryKey = () => [`/v1/user/checklist`]; - -export type GetV1UserChecklistQueryResult = NonNullable< - Awaited> ->; -export type GetV1UserChecklistQueryError = ErrorType; +export const getGetV1UserChecklistQueryKey = () => { + return [`/v1/user/checklist`] as const; +}; -export const useGetV1UserChecklist = < +export const getGetV1UserChecklistQueryOptions = < TData = Awaited>, TError = ErrorType >(options?: { @@ -123,7 +136,7 @@ export const useGetV1UserChecklist = < TError, TData >; -}): UseQueryResult & { queryKey: QueryKey } => { +}) => { const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetV1UserChecklistQueryKey(); @@ -132,16 +145,40 @@ export const useGetV1UserChecklist = < Awaited> > = ({ signal }) => getV1UserChecklist(signal); - const query = useQuery< + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey }; +}; + +export type GetV1UserChecklistQueryResult = NonNullable< + Awaited> +>; +export type GetV1UserChecklistQueryError = ErrorType; + +/** + * @summary List all checklist items of the user. + */ +export const useGetV1UserChecklist = < + TData = Awaited>, + TError = ErrorType +>(options?: { + query?: UseQueryOptions< Awaited>, TError, TData - >(queryKey, queryFn, queryOptions); + >; +}): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getGetV1UserChecklistQueryOptions(options); - return { - queryKey, - ...query + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey; }; + + query.queryKey = queryOptions.queryKey; + + return query; }; /** @@ -150,17 +187,11 @@ export const useGetV1UserChecklist = < export const postV1UserChecklistIdentifier = (identifier: string) => { return fetcher({ url: `/v1/user/checklist/${identifier}`, - method: "post" + method: "POST" }); }; -export type PostV1UserChecklistIdentifierMutationResult = NonNullable< - Awaited> ->; - -export type PostV1UserChecklistIdentifierMutationError = ErrorType; - -export const usePostV1UserChecklistIdentifier = < +export const getPostV1UserChecklistIdentifierMutationOptions = < TError = ErrorType, TContext = unknown >(options?: { @@ -170,7 +201,12 @@ export const usePostV1UserChecklistIdentifier = < { identifier: string }, TContext >; -}) => { +}): UseMutationOptions< + Awaited>, + TError, + { identifier: string }, + TContext +> => { const { mutation: mutationOptions } = options ?? {}; const mutationFn: MutationFunction< @@ -182,12 +218,38 @@ export const usePostV1UserChecklistIdentifier = < return postV1UserChecklistIdentifier(identifier); }; - return useMutation< + return { mutationFn, ...mutationOptions }; +}; + +export type PostV1UserChecklistIdentifierMutationResult = NonNullable< + Awaited> +>; + +export type PostV1UserChecklistIdentifierMutationError = ErrorType; + +/** + * @summary Add a book to the user's checklist. + */ +export const usePostV1UserChecklistIdentifier = < + TError = ErrorType, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< Awaited>, TError, { identifier: string }, TContext - >(mutationFn, mutationOptions); + >; +}): UseMutationResult< + Awaited>, + TError, + { identifier: string }, + TContext +> => { + const mutationOptions = + getPostV1UserChecklistIdentifierMutationOptions(options); + + return useMutation(mutationOptions); }; /** @@ -196,17 +258,11 @@ export const usePostV1UserChecklistIdentifier = < export const deleteV1UserChecklistIdentifier = (identifier: string) => { return fetcher({ url: `/v1/user/checklist/${identifier}`, - method: "delete" + method: "DELETE" }); }; -export type DeleteV1UserChecklistIdentifierMutationResult = NonNullable< - Awaited> ->; - -export type DeleteV1UserChecklistIdentifierMutationError = ErrorType; - -export const useDeleteV1UserChecklistIdentifier = < +export const getDeleteV1UserChecklistIdentifierMutationOptions = < TError = ErrorType, TContext = unknown >(options?: { @@ -216,7 +272,12 @@ export const useDeleteV1UserChecklistIdentifier = < { identifier: string }, TContext >; -}) => { +}): UseMutationOptions< + Awaited>, + TError, + { identifier: string }, + TContext +> => { const { mutation: mutationOptions } = options ?? {}; const mutationFn: MutationFunction< @@ -228,30 +289,53 @@ export const useDeleteV1UserChecklistIdentifier = < return deleteV1UserChecklistIdentifier(identifier); }; - return useMutation< + return { mutationFn, ...mutationOptions }; +}; + +export type DeleteV1UserChecklistIdentifierMutationResult = NonNullable< + Awaited> +>; + +export type DeleteV1UserChecklistIdentifierMutationError = ErrorType; + +/** + * @summary Delete a book from the user's checklist. + */ +export const useDeleteV1UserChecklistIdentifier = < + TError = ErrorType, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< Awaited>, TError, { identifier: string }, TContext - >(mutationFn, mutationOptions); + >; +}): UseMutationResult< + Awaited>, + TError, + { identifier: string }, + TContext +> => { + const mutationOptions = + getDeleteV1UserChecklistIdentifierMutationOptions(options); + + return useMutation(mutationOptions); }; export const getV1LibraryProfile = (signal?: AbortSignal) => { return fetcher({ url: `/v1/library/profile`, - method: "get", + method: "GET", signal }); }; -export const getGetV1LibraryProfileQueryKey = () => [`/v1/library/profile`]; - -export type GetV1LibraryProfileQueryResult = NonNullable< - Awaited> ->; -export type GetV1LibraryProfileQueryError = ErrorType; +export const getGetV1LibraryProfileQueryKey = () => { + return [`/v1/library/profile`] as const; +}; -export const useGetV1LibraryProfile = < +export const getGetV1LibraryProfileQueryOptions = < TData = Awaited>, TError = ErrorType >(options?: { @@ -260,7 +344,7 @@ export const useGetV1LibraryProfile = < TError, TData >; -}): UseQueryResult & { queryKey: QueryKey } => { +}) => { const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetV1LibraryProfileQueryKey(); @@ -269,16 +353,37 @@ export const useGetV1LibraryProfile = < Awaited> > = ({ signal }) => getV1LibraryProfile(signal); - const query = useQuery< + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, TError, TData - >(queryKey, queryFn, queryOptions); + > & { queryKey: QueryKey }; +}; - return { - queryKey, - ...query +export type GetV1LibraryProfileQueryResult = NonNullable< + Awaited> +>; +export type GetV1LibraryProfileQueryError = ErrorType; + +export const useGetV1LibraryProfile = < + TData = Awaited>, + TError = ErrorType +>(options?: { + query?: UseQueryOptions< + Awaited>, + TError, + TData + >; +}): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getGetV1LibraryProfileQueryOptions(options); + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey; }; + + query.queryKey = queryOptions.queryKey; + + return query; }; /** @@ -290,23 +395,17 @@ export const getV1UserLoans = ( ) => { return fetcher({ url: `/v1/user/loans`, - method: "get", - signal, - params + method: "GET", + params, + signal }); }; -export const getGetV1UserLoansQueryKey = (params?: GetV1UserLoansParams) => [ - `/v1/user/loans`, - ...(params ? [params] : []) -]; - -export type GetV1UserLoansQueryResult = NonNullable< - Awaited> ->; -export type GetV1UserLoansQueryError = ErrorType; +export const getGetV1UserLoansQueryKey = (params?: GetV1UserLoansParams) => { + return [`/v1/user/loans`, ...(params ? [params] : [])] as const; +}; -export const useGetV1UserLoans = < +export const getGetV1UserLoansQueryOptions = < TData = Awaited>, TError = ErrorType >( @@ -318,7 +417,7 @@ export const useGetV1UserLoans = < TData >; } -): UseQueryResult & { queryKey: QueryKey } => { +) => { const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetV1UserLoansQueryKey(params); @@ -327,16 +426,43 @@ export const useGetV1UserLoans = < signal }) => getV1UserLoans(params, signal); - const query = useQuery< + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, TError, TData - >(queryKey, queryFn, queryOptions); + > & { queryKey: QueryKey }; +}; - return { - queryKey, - ...query +export type GetV1UserLoansQueryResult = NonNullable< + Awaited> +>; +export type GetV1UserLoansQueryError = ErrorType; + +/** + * @summary Lists all active loans of the user. + */ +export const useGetV1UserLoans = < + TData = Awaited>, + TError = ErrorType +>( + params?: GetV1UserLoansParams, + options?: { + query?: UseQueryOptions< + Awaited>, + TError, + TData + >; + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getGetV1UserLoansQueryOptions(params, options); + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey; }; + + query.queryKey = queryOptions.queryKey; + + return query; }; /** @@ -348,21 +474,16 @@ export const getV1UserLoansIdentifier = ( ) => { return fetcher({ url: `/v1/user/loans/${identifier}`, - method: "get", + method: "GET", signal }); }; -export const getGetV1UserLoansIdentifierQueryKey = (identifier: string) => [ - `/v1/user/loans/${identifier}` -]; - -export type GetV1UserLoansIdentifierQueryResult = NonNullable< - Awaited> ->; -export type GetV1UserLoansIdentifierQueryError = ErrorType; +export const getGetV1UserLoansIdentifierQueryKey = (identifier: string) => { + return [`/v1/user/loans/${identifier}`] as const; +}; -export const useGetV1UserLoansIdentifier = < +export const getGetV1UserLoansIdentifierQueryOptions = < TData = Awaited>, TError = ErrorType >( @@ -374,7 +495,7 @@ export const useGetV1UserLoansIdentifier = < TData >; } -): UseQueryResult & { queryKey: QueryKey } => { +) => { const { query: queryOptions } = options ?? {}; const queryKey = @@ -384,16 +505,51 @@ export const useGetV1UserLoansIdentifier = < Awaited> > = ({ signal }) => getV1UserLoansIdentifier(identifier, signal); - const query = useQuery< + return { + queryKey, + queryFn, + enabled: !!identifier, + ...queryOptions + } as UseQueryOptions< Awaited>, TError, TData - >(queryKey, queryFn, { enabled: !!identifier, ...queryOptions }); + > & { queryKey: QueryKey }; +}; - return { - queryKey, - ...query +export type GetV1UserLoansIdentifierQueryResult = NonNullable< + Awaited> +>; +export type GetV1UserLoansIdentifierQueryError = ErrorType; + +/** + * @summary Gets details of a specific loan. + */ +export const useGetV1UserLoansIdentifier = < + TData = Awaited>, + TError = ErrorType +>( + identifier: string, + options?: { + query?: UseQueryOptions< + Awaited>, + TError, + TData + >; + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getGetV1UserLoansIdentifierQueryOptions( + identifier, + options + ); + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey; }; + + query.queryKey = queryOptions.queryKey; + + return query; }; /** @@ -405,18 +561,12 @@ export const postV1UserLoansIdentifier = ( ) => { return fetcher({ url: `/v1/user/loans/${identifier}`, - method: "post", + method: "POST", params }); }; -export type PostV1UserLoansIdentifierMutationResult = NonNullable< - Awaited> ->; - -export type PostV1UserLoansIdentifierMutationError = ErrorType; - -export const usePostV1UserLoansIdentifier = < +export const getPostV1UserLoansIdentifierMutationOptions = < TError = ErrorType, TContext = unknown >(options?: { @@ -426,7 +576,12 @@ export const usePostV1UserLoansIdentifier = < { identifier: string; params?: PostV1UserLoansIdentifierParams }, TContext >; -}) => { +}): UseMutationOptions< + Awaited>, + TError, + { identifier: string; params?: PostV1UserLoansIdentifierParams }, + TContext +> => { const { mutation: mutationOptions } = options ?? {}; const mutationFn: MutationFunction< @@ -438,15 +593,40 @@ export const usePostV1UserLoansIdentifier = < return postV1UserLoansIdentifier(identifier, params); }; - return useMutation< - Awaited>, - TError, - { identifier: string; params?: PostV1UserLoansIdentifierParams }, - TContext - >(mutationFn, mutationOptions); + return { mutationFn, ...mutationOptions }; }; -/** +export type PostV1UserLoansIdentifierMutationResult = NonNullable< + Awaited> +>; + +export type PostV1UserLoansIdentifierMutationError = ErrorType; + +/** + * @summary Creates a new loan. + */ +export const usePostV1UserLoansIdentifier = < + TError = ErrorType, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { identifier: string; params?: PostV1UserLoansIdentifierParams }, + TContext + >; +}): UseMutationResult< + Awaited>, + TError, + { identifier: string; params?: PostV1UserLoansIdentifierParams }, + TContext +> => { + const mutationOptions = getPostV1UserLoansIdentifierMutationOptions(options); + + return useMutation(mutationOptions); +}; + +/** * @summary Get loan status of a specific product. */ export const getV1LoanstatusIdentifier = ( @@ -455,21 +635,16 @@ export const getV1LoanstatusIdentifier = ( ) => { return fetcher({ url: `/v1/loanstatus/${identifier}`, - method: "get", + method: "GET", signal }); }; -export const getGetV1LoanstatusIdentifierQueryKey = (identifier: string) => [ - `/v1/loanstatus/${identifier}` -]; - -export type GetV1LoanstatusIdentifierQueryResult = NonNullable< - Awaited> ->; -export type GetV1LoanstatusIdentifierQueryError = ErrorType; +export const getGetV1LoanstatusIdentifierQueryKey = (identifier: string) => { + return [`/v1/loanstatus/${identifier}`] as const; +}; -export const useGetV1LoanstatusIdentifier = < +export const getGetV1LoanstatusIdentifierQueryOptions = < TData = Awaited>, TError = ErrorType >( @@ -479,45 +654,72 @@ export const useGetV1LoanstatusIdentifier = < TError, TData > -): UseQueryResult & { queryKey: QueryKey } => { +) => { const queryKey = queryOptions?.queryKey ?? getGetV1LoanstatusIdentifierQueryKey(identifier); const queryFn: QueryFunction< Awaited> - > = ({ signal }) => getV1LoanstatusIdentifier(identifier); + > = ({ signal }) => getV1LoanstatusIdentifier(identifier, signal); - const query = useQuery< + return { + queryKey, + queryFn, + enabled: !!identifier, + ...queryOptions + } as UseQueryOptions< Awaited>, TError, TData - >(queryKey, queryFn, { enabled: !!identifier, ...queryOptions }); + > & { queryKey: QueryKey }; +}; - return { - queryKey, - ...query +export type GetV1LoanstatusIdentifierQueryResult = NonNullable< + Awaited> +>; +export type GetV1LoanstatusIdentifierQueryError = ErrorType; + +/** + * @summary Get loan status of a specific product. + */ +export const useGetV1LoanstatusIdentifier = < + TData = Awaited>, + TError = ErrorType +>( + identifier: string, + queryOptions?: UseQueryOptions< + Awaited>, + TError, + TData + > +): UseQueryResult & { queryKey: QueryKey } => { + const options = getGetV1LoanstatusIdentifierQueryOptions( + identifier, + queryOptions + ); + + const query = useQuery(options) as UseQueryResult & { + queryKey: QueryKey; }; + + query.queryKey = options.queryKey; + + return query; }; /** * @summary Get loan status of all products. */ -export const postV1Loanstatus = (postV1LoanstatusBody: string[]) => { +export const postV1Loanstatus = (postV1LoanstatusBody: BodyType) => { return fetcher({ url: `/v1/loanstatus`, - method: "post", + method: "POST", headers: { "Content-Type": "application/json" }, data: postV1LoanstatusBody }); }; -export type PostV1LoanstatusMutationResult = NonNullable< - Awaited> ->; -export type PostV1LoanstatusMutationBody = BodyType; -export type PostV1LoanstatusMutationError = ErrorType; - -export const usePostV1Loanstatus = < +export const getPostV1LoanstatusMutationOptions = < TError = ErrorType, TContext = unknown >(options?: { @@ -527,7 +729,12 @@ export const usePostV1Loanstatus = < { data: BodyType }, TContext >; -}) => { +}): UseMutationOptions< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { const { mutation: mutationOptions } = options ?? {}; const mutationFn: MutationFunction< @@ -539,12 +746,37 @@ export const usePostV1Loanstatus = < return postV1Loanstatus(data); }; - return useMutation< + return { mutationFn, ...mutationOptions }; +}; + +export type PostV1LoanstatusMutationResult = NonNullable< + Awaited> +>; +export type PostV1LoanstatusMutationBody = BodyType; +export type PostV1LoanstatusMutationError = ErrorType; + +/** + * @summary Get loan status of all products. + */ +export const usePostV1Loanstatus = < + TError = ErrorType, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< Awaited>, TError, { data: BodyType }, TContext - >(mutationFn, mutationOptions); + >; +}): UseMutationResult< + Awaited>, + TError, + { data: BodyType }, + TContext +> => { + const mutationOptions = getPostV1LoanstatusMutationOptions(options); + + return useMutation(mutationOptions); }; /** @@ -556,21 +788,16 @@ export const getV1ProductsIdentifier = ( ) => { return fetcher({ url: `/v1/products/${identifier}`, - method: "get", + method: "GET", signal }); }; -export const getGetV1ProductsIdentifierQueryKey = (identifier: string) => [ - `/v1/products/${identifier}` -]; - -export type GetV1ProductsIdentifierQueryResult = NonNullable< - Awaited> ->; -export type GetV1ProductsIdentifierQueryError = ErrorType; +export const getGetV1ProductsIdentifierQueryKey = (identifier: string) => { + return [`/v1/products/${identifier}`] as const; +}; -export const useGetV1ProductsIdentifier = < +export const getGetV1ProductsIdentifierQueryOptions = < TData = Awaited>, TError = ErrorType >( @@ -582,7 +809,7 @@ export const useGetV1ProductsIdentifier = < TData >; } -): UseQueryResult & { queryKey: QueryKey } => { +) => { const { query: queryOptions } = options ?? {}; const queryKey = @@ -592,16 +819,51 @@ export const useGetV1ProductsIdentifier = < Awaited> > = ({ signal }) => getV1ProductsIdentifier(identifier, signal); - const query = useQuery< + return { + queryKey, + queryFn, + enabled: !!identifier, + ...queryOptions + } as UseQueryOptions< Awaited>, TError, TData - >(queryKey, queryFn, { enabled: !!identifier, ...queryOptions }); + > & { queryKey: QueryKey }; +}; - return { - queryKey, - ...query +export type GetV1ProductsIdentifierQueryResult = NonNullable< + Awaited> +>; +export type GetV1ProductsIdentifierQueryError = ErrorType; + +/** + * @summary Get a specific product. + */ +export const useGetV1ProductsIdentifier = < + TData = Awaited>, + TError = ErrorType +>( + identifier: string, + options?: { + query?: UseQueryOptions< + Awaited>, + TError, + TData + >; + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getGetV1ProductsIdentifierQueryOptions( + identifier, + options + ); + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey; }; + + query.queryKey = queryOptions.queryKey; + + return query; }; /** @@ -610,19 +872,16 @@ export const useGetV1ProductsIdentifier = < export const getV1Products = (signal?: AbortSignal) => { return fetcher({ url: `/v1/products`, - method: "get", + method: "GET", signal }); }; -export const getGetV1ProductsQueryKey = () => [`/v1/products`]; - -export type GetV1ProductsQueryResult = NonNullable< - Awaited> ->; -export type GetV1ProductsQueryError = ErrorType; +export const getGetV1ProductsQueryKey = () => { + return [`/v1/products`] as const; +}; -export const useGetV1Products = < +export const getGetV1ProductsQueryOptions = < TData = Awaited>, TError = ErrorType >(options?: { @@ -631,7 +890,7 @@ export const useGetV1Products = < TError, TData >; -}): UseQueryResult & { queryKey: QueryKey } => { +}) => { const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetV1ProductsQueryKey(); @@ -640,16 +899,40 @@ export const useGetV1Products = < signal }) => getV1Products(signal); - const query = useQuery< + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, TError, TData - >(queryKey, queryFn, queryOptions); + > & { queryKey: QueryKey }; +}; - return { - queryKey, - ...query +export type GetV1ProductsQueryResult = NonNullable< + Awaited> +>; +export type GetV1ProductsQueryError = ErrorType; + +/** + * @summary List all products. + */ +export const useGetV1Products = < + TData = Awaited>, + TError = ErrorType +>(options?: { + query?: UseQueryOptions< + Awaited>, + TError, + TData + >; +}): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getGetV1ProductsQueryOptions(options); + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey; }; + + query.queryKey = queryOptions.queryKey; + + return query; }; /** @@ -658,19 +941,16 @@ export const useGetV1Products = < export const getV1UserReservations = (signal?: AbortSignal) => { return fetcher({ url: `/v1/user/reservations`, - method: "get", + method: "GET", signal }); }; -export const getGetV1UserReservationsQueryKey = () => [`/v1/user/reservations`]; - -export type GetV1UserReservationsQueryResult = NonNullable< - Awaited> ->; -export type GetV1UserReservationsQueryError = ErrorType; +export const getGetV1UserReservationsQueryKey = () => { + return [`/v1/user/reservations`] as const; +}; -export const useGetV1UserReservations = < +export const getGetV1UserReservationsQueryOptions = < TData = Awaited>, TError = ErrorType >(options?: { @@ -679,7 +959,7 @@ export const useGetV1UserReservations = < TError, TData >; -}): UseQueryResult & { queryKey: QueryKey } => { +}) => { const { query: queryOptions } = options ?? {}; const queryKey = queryOptions?.queryKey ?? getGetV1UserReservationsQueryKey(); @@ -688,16 +968,40 @@ export const useGetV1UserReservations = < Awaited> > = ({ signal }) => getV1UserReservations(signal); - const query = useQuery< + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, TError, TData - >(queryKey, queryFn, queryOptions); + > & { queryKey: QueryKey }; +}; - return { - queryKey, - ...query +export type GetV1UserReservationsQueryResult = NonNullable< + Awaited> +>; +export type GetV1UserReservationsQueryError = ErrorType; + +/** + * @summary Lists all reservations of the user. + */ +export const useGetV1UserReservations = < + TData = Awaited>, + TError = ErrorType +>(options?: { + query?: UseQueryOptions< + Awaited>, + TError, + TData + >; +}): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getGetV1UserReservationsQueryOptions(options); + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey; }; + + query.queryKey = queryOptions.queryKey; + + return query; }; /** @@ -709,20 +1013,13 @@ export const postV1UserReservationsIdentifier = ( ) => { return fetcher({ url: `/v1/user/reservations/${identifier}`, - method: "post", + method: "POST", headers: { "Content-Type": "application/json" }, data: reservationInput }); }; -export type PostV1UserReservationsIdentifierMutationResult = NonNullable< - Awaited> ->; -export type PostV1UserReservationsIdentifierMutationBody = - BodyType; -export type PostV1UserReservationsIdentifierMutationError = ErrorType; - -export const usePostV1UserReservationsIdentifier = < +export const getPostV1UserReservationsIdentifierMutationOptions = < TError = ErrorType, TContext = unknown >(options?: { @@ -732,7 +1029,12 @@ export const usePostV1UserReservationsIdentifier = < { identifier: string; data: BodyType }, TContext >; -}) => { +}): UseMutationOptions< + Awaited>, + TError, + { identifier: string; data: BodyType }, + TContext +> => { const { mutation: mutationOptions } = options ?? {}; const mutationFn: MutationFunction< @@ -744,12 +1046,39 @@ export const usePostV1UserReservationsIdentifier = < return postV1UserReservationsIdentifier(identifier, data); }; - return useMutation< + return { mutationFn, ...mutationOptions }; +}; + +export type PostV1UserReservationsIdentifierMutationResult = NonNullable< + Awaited> +>; +export type PostV1UserReservationsIdentifierMutationBody = + BodyType; +export type PostV1UserReservationsIdentifierMutationError = ErrorType; + +/** + * @summary Creates a new reservation. + */ +export const usePostV1UserReservationsIdentifier = < + TError = ErrorType, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< Awaited>, TError, { identifier: string; data: BodyType }, TContext - >(mutationFn, mutationOptions); + >; +}): UseMutationResult< + Awaited>, + TError, + { identifier: string; data: BodyType }, + TContext +> => { + const mutationOptions = + getPostV1UserReservationsIdentifierMutationOptions(options); + + return useMutation(mutationOptions); }; /** @@ -761,20 +1090,13 @@ export const patchV1UserReservationsIdentifier = ( ) => { return fetcher({ url: `/v1/user/reservations/${identifier}`, - method: "patch", + method: "PATCH", headers: { "Content-Type": "application/json" }, data: reservationInput }); }; -export type PatchV1UserReservationsIdentifierMutationResult = NonNullable< - Awaited> ->; -export type PatchV1UserReservationsIdentifierMutationBody = - BodyType; -export type PatchV1UserReservationsIdentifierMutationError = ErrorType; - -export const usePatchV1UserReservationsIdentifier = < +export const getPatchV1UserReservationsIdentifierMutationOptions = < TError = ErrorType, TContext = unknown >(options?: { @@ -784,7 +1106,12 @@ export const usePatchV1UserReservationsIdentifier = < { identifier: string; data: BodyType }, TContext >; -}) => { +}): UseMutationOptions< + Awaited>, + TError, + { identifier: string; data: BodyType }, + TContext +> => { const { mutation: mutationOptions } = options ?? {}; const mutationFn: MutationFunction< @@ -796,12 +1123,39 @@ export const usePatchV1UserReservationsIdentifier = < return patchV1UserReservationsIdentifier(identifier, data); }; - return useMutation< + return { mutationFn, ...mutationOptions }; +}; + +export type PatchV1UserReservationsIdentifierMutationResult = NonNullable< + Awaited> +>; +export type PatchV1UserReservationsIdentifierMutationBody = + BodyType; +export type PatchV1UserReservationsIdentifierMutationError = ErrorType; + +/** + * @summary Updates the phone number and email address of a specific reservation. + */ +export const usePatchV1UserReservationsIdentifier = < + TError = ErrorType, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< Awaited>, TError, { identifier: string; data: BodyType }, TContext - >(mutationFn, mutationOptions); + >; +}): UseMutationResult< + Awaited>, + TError, + { identifier: string; data: BodyType }, + TContext +> => { + const mutationOptions = + getPatchV1UserReservationsIdentifierMutationOptions(options); + + return useMutation(mutationOptions); }; /** @@ -810,18 +1164,11 @@ export const usePatchV1UserReservationsIdentifier = < export const deleteV1UserReservationsIdentifier = (identifier: string) => { return fetcher({ url: `/v1/user/reservations/${identifier}`, - method: "delete" + method: "DELETE" }); }; -export type DeleteV1UserReservationsIdentifierMutationResult = NonNullable< - Awaited> ->; - -export type DeleteV1UserReservationsIdentifierMutationError = - ErrorType; - -export const useDeleteV1UserReservationsIdentifier = < +export const getDeleteV1UserReservationsIdentifierMutationOptions = < TError = ErrorType, TContext = unknown >(options?: { @@ -831,7 +1178,12 @@ export const useDeleteV1UserReservationsIdentifier = < { identifier: string }, TContext >; -}) => { +}): UseMutationOptions< + Awaited>, + TError, + { identifier: string }, + TContext +> => { const { mutation: mutationOptions } = options ?? {}; const mutationFn: MutationFunction< @@ -843,10 +1195,37 @@ export const useDeleteV1UserReservationsIdentifier = < return deleteV1UserReservationsIdentifier(identifier); }; - return useMutation< + return { mutationFn, ...mutationOptions }; +}; + +export type DeleteV1UserReservationsIdentifierMutationResult = NonNullable< + Awaited> +>; + +export type DeleteV1UserReservationsIdentifierMutationError = + ErrorType; + +/** + * @summary Cancels a reservation. + */ +export const useDeleteV1UserReservationsIdentifier = < + TError = ErrorType, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< Awaited>, TError, { identifier: string }, TContext - >(mutationFn, mutationOptions); + >; +}): UseMutationResult< + Awaited>, + TError, + { identifier: string }, + TContext +> => { + const mutationOptions = + getDeleteV1UserReservationsIdentifierMutationOptions(options); + + return useMutation(mutationOptions); }; From 56636c474780e88b2cb9c0fc61be576f217d7278 Mon Sep 17 00:00:00 2001 From: Kasper Birch Date: Tue, 9 Apr 2024 13:33:55 +0200 Subject: [PATCH 3/3] Update `orval` Cover client and execute `yarn codegen:client:cover` - Incorporated a command to remove existing files in `src/core/cover-service-api/model/*.*` before the execution of the `"codegen:client:cover"` script. - Updated fetcher methods to use uppercase naming convention. - Add new url for the Cover API spec --- orval.config.ts | 2 +- package.json | 2 +- src/core/cover-service-api/cover-service.ts | 81 ++++++++++++------- src/core/cover-service-api/model/cover.ts | 6 +- .../cover-service-api/model/coverImageUrls.ts | 10 ++- src/core/cover-service-api/model/coverType.ts | 2 +- .../model/getCoverCollectionParams.ts | 25 +++++- .../model/getCoverCollectionSizesItem.ts | 6 +- .../model/getCoverCollectionType.ts | 2 +- src/core/cover-service-api/model/imageUrl.ts | 5 +- .../cover-service-api/model/imageUrlSize.ts | 6 +- src/core/cover-service-api/model/index.ts | 17 +++- src/core/cover-service-api/mutator/fetcher.ts | 2 +- 13 files changed, 117 insertions(+), 49 deletions(-) diff --git a/orval.config.ts b/orval.config.ts index bfa00e4550..b25e6f6426 100644 --- a/orval.config.ts +++ b/orval.config.ts @@ -45,7 +45,7 @@ export default defineConfig({ prettier: true }, input: { - target: "https://cover.dandigbib.org/api/v2/spec.yaml", + target: "https://cover.dandigbib.org/spec.yaml", converterOptions: { indent: 2 } diff --git a/package.json b/package.json index 053848d26a..71f0337ffb 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "codegen:dbc:gateway": "CODEGEN_SCHEMA_PROFILE=next graphql-codegen -r dotenv/config --config dbc-gateway.codegen.yml", "codegen:rest-services": "orval", "codegen:client:fbs": "rm -rf src/core/fbs/model/*.* && orval --project fbsAdapter", - "codegen:client:cover": "orval --project coverService", + "codegen:client:cover": "rm -rf src/core/cover-service-api/model/*.* && orval --project coverService", "codegen:client:publizon": "rm -rf src/core/publizon/model/*.* && orval --project publizonAdapter", "codegen:client:dpl-cms": "rm -rf src/core/dpl-cms/model/*.* && orval --project dplCms", "post-process-generated-graphql": "ts-node ./scripts/post-process-generated-graphql.ts" diff --git a/src/core/cover-service-api/cover-service.ts b/src/core/cover-service-api/cover-service.ts index 00b437081c..63a637ac3a 100644 --- a/src/core/cover-service-api/cover-service.ts +++ b/src/core/cover-service-api/cover-service.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * DDF Cover Service * This service provides covers for library materials indexed by isbn, issn, faust, pid. @@ -8,50 +8,44 @@ 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, - UseQueryOptions, +import { useQuery } from "react-query"; +import type { QueryFunction, - UseQueryResult, - QueryKey + QueryKey, + UseQueryOptions, + UseQueryResult } from "react-query"; import type { Cover, GetCoverCollectionParams } from "./model"; -import { fetcher, ErrorType, BodyType } from "./mutator/fetcher"; - -type AwaitedInput = PromiseLike | T; - -type Awaited = O extends AwaitedInput ? 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({ url: `/api/v2/covers`, - method: "get", - signal, - params + method: "GET", + params, + signal }); }; export const getGetCoverCollectionQueryKey = ( - params?: GetCoverCollectionParams -) => [`/api/v2/covers`, ...(params ? [params] : [])]; - -export type GetCoverCollectionQueryResult = NonNullable< - Awaited> ->; -export type GetCoverCollectionQueryError = ErrorType; + params: GetCoverCollectionParams +) => { + return [`/api/v2/covers`, ...(params ? [params] : [])] as const; +}; -export const useGetCoverCollection = < +export const getGetCoverCollectionQueryOptions = < TData = Awaited>, TError = ErrorType >( - params?: GetCoverCollectionParams, + params: GetCoverCollectionParams, options?: { query?: UseQueryOptions< Awaited>, @@ -59,7 +53,7 @@ export const useGetCoverCollection = < TData >; } -): UseQueryResult & { queryKey: QueryKey } => { +) => { const { query: queryOptions } = options ?? {}; const queryKey = @@ -69,14 +63,41 @@ export const useGetCoverCollection = < Awaited> > = ({ signal }) => getCoverCollection(params, signal); - const query = useQuery< + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< Awaited>, TError, TData - >(queryKey, queryFn, queryOptions); + > & { queryKey: QueryKey }; +}; + +export type GetCoverCollectionQueryResult = NonNullable< + Awaited> +>; +export type GetCoverCollectionQueryError = ErrorType; - return { - queryKey, - ...query +/** + * @summary Search multiple covers + */ +export const useGetCoverCollection = < + TData = Awaited>, + TError = ErrorType +>( + params: GetCoverCollectionParams, + options?: { + query?: UseQueryOptions< + Awaited>, + TError, + TData + >; + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getGetCoverCollectionQueryOptions(params, options); + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey; }; + + query.queryKey = queryOptions.queryKey; + + return query; }; diff --git a/src/core/cover-service-api/model/cover.ts b/src/core/cover-service-api/model/cover.ts index 45e031d806..4e7f2f3506 100644 --- a/src/core/cover-service-api/model/cover.ts +++ b/src/core/cover-service-api/model/cover.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * DDF Cover Service * This service provides covers for library materials indexed by isbn, issn, faust, pid. @@ -8,11 +8,11 @@ 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 type { CoverType } from "./coverType"; import type { CoverImageUrls } from "./coverImageUrls"; +import type { CoverType } from "./coverType"; export interface Cover { id?: string; - type?: CoverType; imageUrls?: CoverImageUrls; + type?: CoverType; } diff --git a/src/core/cover-service-api/model/coverImageUrls.ts b/src/core/cover-service-api/model/coverImageUrls.ts index 756069ec8e..a8a3c980d4 100644 --- a/src/core/cover-service-api/model/coverImageUrls.ts +++ b/src/core/cover-service-api/model/coverImageUrls.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * DDF Cover Service * This service provides covers for library materials indexed by isbn, issn, faust, pid. @@ -12,8 +12,12 @@ import type { ImageUrl } from "./imageUrl"; export type CoverImageUrls = { default?: ImageUrl; + large?: ImageUrl; + medium?: ImageUrl; + "medium-large"?: ImageUrl; original?: ImageUrl; small?: ImageUrl; - medium?: ImageUrl; - large?: ImageUrl; + "small-medium"?: ImageUrl; + "x-small"?: ImageUrl; + "xx-small"?: ImageUrl; }; diff --git a/src/core/cover-service-api/model/coverType.ts b/src/core/cover-service-api/model/coverType.ts index f2c4089a35..ed31984dd9 100644 --- a/src/core/cover-service-api/model/coverType.ts +++ b/src/core/cover-service-api/model/coverType.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * DDF Cover Service * This service provides covers for library materials indexed by isbn, issn, faust, pid. diff --git a/src/core/cover-service-api/model/getCoverCollectionParams.ts b/src/core/cover-service-api/model/getCoverCollectionParams.ts index 0ff8d5cd79..95282f4569 100644 --- a/src/core/cover-service-api/model/getCoverCollectionParams.ts +++ b/src/core/cover-service-api/model/getCoverCollectionParams.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * DDF Cover Service * This service provides covers for library materials indexed by isbn, issn, faust, pid. @@ -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[]; }; diff --git a/src/core/cover-service-api/model/getCoverCollectionSizesItem.ts b/src/core/cover-service-api/model/getCoverCollectionSizesItem.ts index 20d20fc247..659123cec7 100644 --- a/src/core/cover-service-api/model/getCoverCollectionSizesItem.ts +++ b/src/core/cover-service-api/model/getCoverCollectionSizesItem.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * DDF Cover Service * This service provides covers for library materials indexed by isbn, issn, faust, pid. @@ -16,7 +16,11 @@ export type GetCoverCollectionSizesItem = export const GetCoverCollectionSizesItem = { default: "default", original: "original", + "xx-small": "xx-small", + "x-small": "x-small", small: "small", + "small-medium": "small-medium", medium: "medium", + "medium-large": "medium-large", large: "large" } as const; diff --git a/src/core/cover-service-api/model/getCoverCollectionType.ts b/src/core/cover-service-api/model/getCoverCollectionType.ts index e2aa21baff..091c5e1820 100644 --- a/src/core/cover-service-api/model/getCoverCollectionType.ts +++ b/src/core/cover-service-api/model/getCoverCollectionType.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * DDF Cover Service * This service provides covers for library materials indexed by isbn, issn, faust, pid. diff --git a/src/core/cover-service-api/model/imageUrl.ts b/src/core/cover-service-api/model/imageUrl.ts index 8d1039c93c..30864ca974 100644 --- a/src/core/cover-service-api/model/imageUrl.ts +++ b/src/core/cover-service-api/model/imageUrl.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * DDF Cover Service * This service provides covers for library materials indexed by isbn, issn, faust, pid. @@ -11,7 +11,8 @@ Authentication is done via OAuth2 against auth.dbc.dk. To obtain a valid token f import type { ImageUrlSize } from "./imageUrlSize"; export interface ImageUrl { - url?: string | null; format?: string; size?: ImageUrlSize; + /** @nullable */ + url?: string | null; } diff --git a/src/core/cover-service-api/model/imageUrlSize.ts b/src/core/cover-service-api/model/imageUrlSize.ts index 7effdd0de4..0e2032b1b2 100644 --- a/src/core/cover-service-api/model/imageUrlSize.ts +++ b/src/core/cover-service-api/model/imageUrlSize.ts @@ -1,5 +1,5 @@ /** - * Generated by orval v6.8.1 🍺 + * Generated by orval v6.26.0 🍺 * Do not edit manually. * DDF Cover Service * This service provides covers for library materials indexed by isbn, issn, faust, pid. @@ -15,7 +15,11 @@ export type ImageUrlSize = typeof ImageUrlSize[keyof typeof ImageUrlSize]; export const ImageUrlSize = { default: "default", original: "original", + "xx-small": "xx-small", + "x-small": "x-small", small: "small", + "small-medium": "small-medium", medium: "medium", + "medium-large": "medium-large", large: "large" } as const; diff --git a/src/core/cover-service-api/model/index.ts b/src/core/cover-service-api/model/index.ts index f4cdce67e4..43260a83b0 100644 --- a/src/core/cover-service-api/model/index.ts +++ b/src/core/cover-service-api/model/index.ts @@ -1,8 +1,19 @@ +/** + * Generated by orval v6.26.0 🍺 + * 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"; diff --git a/src/core/cover-service-api/mutator/fetcher.ts b/src/core/cover-service-api/mutator/fetcher.ts index 4ed1be77e4..034691a181 100644 --- a/src/core/cover-service-api/mutator/fetcher.ts +++ b/src/core/cover-service-api/mutator/fetcher.ts @@ -14,7 +14,7 @@ export const fetcher = async ({ data }: { url: string; - method: "get" | "post" | "put" | "delete" | "patch" | "head"; + method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD"; params?: unknown; data?: BodyType; signal?: AbortSignal;