-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4369c11
commit ac1afd7
Showing
13 changed files
with
874 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
openapi: 3.0.1 | ||
info: | ||
version: 1.0.1 | ||
title: IO FIMS - Backend API | ||
servers: | ||
- url: https://api-app.io.pagopa.it/api/v1/fims | ||
security: | ||
- Bearer: [] | ||
|
||
paths: | ||
/accesses: | ||
get: | ||
summary: Get access history | ||
description: Get the access history for the specified user | ||
operationId: getAccessHistory | ||
parameters: | ||
- in: query | ||
name: page | ||
schema: | ||
type: string | ||
description: The page identifier | ||
- in: header | ||
name: Accept-Language | ||
required: false | ||
schema: | ||
type: string | ||
responses: | ||
"200": | ||
description: An access history page | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/AccessHistoryPage" | ||
"400": | ||
description: Validation error | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/ProblemJson" | ||
"500": | ||
description: Internal server error | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/ProblemJson" | ||
|
||
/export-requests: | ||
post: | ||
summary: Request export | ||
description: Request the export of the access history for the specified user | ||
operationId: requestExport | ||
responses: | ||
"202": | ||
description: The export request has been accepted | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/ExportRequest" | ||
"409": | ||
description: The export request has already been requested | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/ProblemJson" | ||
"400": | ||
description: Validation error | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/ProblemJson" | ||
"500": | ||
description: Internal server error | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/ProblemJson" | ||
|
||
components: | ||
securitySchemes: | ||
Bearer: | ||
type: apiKey | ||
name: Authorization | ||
in: header | ||
|
||
schemas: | ||
Timestamp: | ||
$ref: "https://raw.githubusercontent.com/pagopa/io-functions-commons/v26.3.0/openapi/definitions.yaml#/Timestamp" | ||
|
||
ProblemJson: | ||
$ref: "https://raw.githubusercontent.com/pagopa/io-functions-commons/v26.3.0/openapi/definitions.yaml#/ProblemJson" | ||
|
||
Redirect: | ||
type: object | ||
properties: | ||
display_name: | ||
type: string | ||
uri: | ||
type: string | ||
format: uri | ||
required: | ||
- display_name | ||
- uri | ||
|
||
Access: | ||
type: object | ||
properties: | ||
id: | ||
type: string | ||
format: ulid | ||
redirect: | ||
$ref: "#/components/schemas/Redirect" | ||
service_id: | ||
type: string | ||
format: ulid | ||
timestamp: | ||
$ref: "#/components/schemas/Timestamp" | ||
required: | ||
- id | ||
- redirect | ||
- service_id | ||
- timestamp | ||
|
||
AccessHistoryPage: | ||
type: object | ||
properties: | ||
data: | ||
type: array | ||
items: | ||
$ref: "#/components/schemas/Access" | ||
next: | ||
type: string | ||
required: | ||
- data | ||
|
||
ExportRequest: | ||
type: object | ||
properties: | ||
id: | ||
type: string | ||
format: ulid | ||
required: | ||
- id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import nodeFetch from "node-fetch"; | ||
import { Client, createClient } from "../../generated/io-fims-api/client"; | ||
|
||
export function IoFimsAPIClient( | ||
token: string, | ||
baseUrl: string, | ||
basePath: string, | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
fetchApi: typeof fetch = nodeFetch as any as typeof fetch | ||
): Client<"FunctionsKey"> { | ||
return createClient<"FunctionsKey">({ | ||
basePath, | ||
baseUrl, | ||
fetchApi, | ||
withDefaults: (op) => (params) => | ||
op({ | ||
...params, | ||
FunctionsKey: token, | ||
}), | ||
}); | ||
} | ||
|
||
export type IoFimsAPIClient = typeof IoFimsAPIClient; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.