forked from janus-idp/backstage-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create router in BE based on openapi spec #45
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,217 @@ | ||
import type { | ||
AxiosRequestConfig, | ||
OpenAPIClient, | ||
OperationResponse, | ||
Parameters, | ||
UnknownParamsObject, | ||
} from 'openapi-client-axios'; | ||
|
||
declare namespace Components { | ||
namespace Schemas { | ||
export interface Action { | ||
id: string; | ||
title: string; | ||
url: string; | ||
} | ||
export interface CreateBody { | ||
origin: string; | ||
title: string; | ||
message?: string; | ||
actions?: { | ||
title: string; | ||
url: string; | ||
}[]; | ||
topic?: string; | ||
targetUsers?: string[]; | ||
targetGroups?: string[]; | ||
} | ||
export interface Notification { | ||
id: string; | ||
created: string; // date-time | ||
readByUser: boolean; | ||
isSystem: boolean; | ||
origin: string; | ||
title: string; | ||
message?: string; | ||
topic?: string; | ||
actions: Action[]; | ||
} | ||
export type Notifications = Notification[]; | ||
} | ||
} | ||
declare namespace Paths { | ||
namespace CreateNotification { | ||
export type RequestBody = Components.Schemas.CreateBody; | ||
namespace Responses { | ||
export interface $200 { | ||
/** | ||
* example: | ||
* bc9f19de-8b7b-49a8-9262-c5036a1ed35e | ||
*/ | ||
messageId: string; | ||
} | ||
} | ||
} | ||
namespace GetNotifications { | ||
namespace Parameters { | ||
export type ContainsText = string; | ||
export type CreatedAfter = string; // date-time | ||
export type MessageScope = 'all' | 'user' | 'system'; | ||
export type OrderBy = | ||
| 'title' | ||
| 'message' | ||
| 'created' | ||
| 'topic' | ||
| 'origin'; | ||
export type OrderByDirec = 'asc' | 'desc'; | ||
export type PageNumber = number; | ||
export type PageSize = number; | ||
export type Read = boolean; | ||
export type User = string; | ||
} | ||
export interface QueryParameters { | ||
pageSize?: Parameters.PageSize; | ||
pageNumber?: Parameters.PageNumber; | ||
orderBy?: Parameters.OrderBy; | ||
orderByDirec?: Parameters.OrderByDirec; | ||
containsText?: Parameters.ContainsText; | ||
createdAfter?: Parameters.CreatedAfter /* date-time */; | ||
messageScope?: Parameters.MessageScope; | ||
user?: Parameters.User; | ||
read?: Parameters.Read; | ||
} | ||
namespace Responses { | ||
export type $200 = Components.Schemas.Notifications; | ||
} | ||
} | ||
namespace GetNotificationsCount { | ||
namespace Parameters { | ||
export type ContainsText = string; | ||
export type CreatedAfter = string; // date-time | ||
export type MessageScope = 'all' | 'user' | 'system'; | ||
export type Read = boolean; | ||
export type User = string; | ||
} | ||
export interface QueryParameters { | ||
containsText?: Parameters.ContainsText; | ||
createdAfter?: Parameters.CreatedAfter /* date-time */; | ||
messageScope?: Parameters.MessageScope; | ||
user?: Parameters.User; | ||
read?: Parameters.Read; | ||
} | ||
namespace Responses { | ||
export interface $200 { | ||
count: number; | ||
} | ||
} | ||
} | ||
namespace SetRead { | ||
namespace Parameters { | ||
export type MessageId = string; | ||
export type Read = boolean; | ||
export type User = string; | ||
} | ||
export interface QueryParameters { | ||
messageId: Parameters.MessageId; | ||
user: Parameters.User; | ||
read: Parameters.Read; | ||
} | ||
namespace Responses { | ||
export interface $200 {} | ||
} | ||
} | ||
} | ||
|
||
export interface OperationMethods { | ||
/** | ||
* getNotifications - Gets notifications | ||
* | ||
* Gets notifications | ||
*/ | ||
'getNotifications'( | ||
parameters?: Parameters<Paths.GetNotifications.QueryParameters> | null, | ||
data?: any, | ||
config?: AxiosRequestConfig, | ||
): OperationResponse<Paths.GetNotifications.Responses.$200>; | ||
/** | ||
* createNotification - Create notification | ||
* | ||
* Create notification | ||
*/ | ||
'createNotification'( | ||
parameters?: Parameters<UnknownParamsObject> | null, | ||
data?: Paths.CreateNotification.RequestBody, | ||
config?: AxiosRequestConfig, | ||
): OperationResponse<Paths.CreateNotification.Responses.$200>; | ||
/** | ||
* getNotificationsCount - Get notifications count | ||
* | ||
* Gets notifications count | ||
*/ | ||
'getNotificationsCount'( | ||
parameters?: Parameters<Paths.GetNotificationsCount.QueryParameters> | null, | ||
data?: any, | ||
config?: AxiosRequestConfig, | ||
): OperationResponse<Paths.GetNotificationsCount.Responses.$200>; | ||
/** | ||
* setRead - Set notification as read/unread | ||
* | ||
* Set notification as read/unread | ||
*/ | ||
'setRead'( | ||
parameters?: Parameters<Paths.SetRead.QueryParameters> | null, | ||
data?: any, | ||
config?: AxiosRequestConfig, | ||
): OperationResponse<Paths.SetRead.Responses.$200>; | ||
} | ||
|
||
export interface PathsDictionary { | ||
['/notifications']: { | ||
/** | ||
* createNotification - Create notification | ||
* | ||
* Create notification | ||
*/ | ||
'post'( | ||
parameters?: Parameters<UnknownParamsObject> | null, | ||
data?: Paths.CreateNotification.RequestBody, | ||
config?: AxiosRequestConfig, | ||
): OperationResponse<Paths.CreateNotification.Responses.$200>; | ||
/** | ||
* getNotifications - Gets notifications | ||
* | ||
* Gets notifications | ||
*/ | ||
'get'( | ||
parameters?: Parameters<Paths.GetNotifications.QueryParameters> | null, | ||
data?: any, | ||
config?: AxiosRequestConfig, | ||
): OperationResponse<Paths.GetNotifications.Responses.$200>; | ||
}; | ||
['/notifications/count']: { | ||
/** | ||
* getNotificationsCount - Get notifications count | ||
* | ||
* Gets notifications count | ||
*/ | ||
'get'( | ||
parameters?: Parameters<Paths.GetNotificationsCount.QueryParameters> | null, | ||
data?: any, | ||
config?: AxiosRequestConfig, | ||
): OperationResponse<Paths.GetNotificationsCount.Responses.$200>; | ||
}; | ||
['/notifications/read']: { | ||
/** | ||
* setRead - Set notification as read/unread | ||
* | ||
* Set notification as read/unread | ||
*/ | ||
'put'( | ||
parameters?: Parameters<Paths.SetRead.QueryParameters> | null, | ||
data?: any, | ||
config?: AxiosRequestConfig, | ||
): OperationResponse<Paths.SetRead.Responses.$200>; | ||
}; | ||
} | ||
|
||
export type Client = OpenAPIClient<OperationMethods, PathsDictionary>; |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to double-check: is this file generated without any further manual change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course