diff --git a/react-ui/.gitignore b/react-ui/.gitignore index bccd6e5910f4a7e3158b0306ac0907bf5ac3f703..e7d84c03a537a988b548e3c0b70740193ba90d25 100644 --- a/react-ui/.gitignore +++ b/react-ui/.gitignore @@ -9,7 +9,7 @@ /coverage # api -/src/api +/src/api/** # production /build diff --git a/react-ui/package.json b/react-ui/package.json index 5d920f15fb68cbce95b645cb896522d0e8dfe866..f2d15cd7c6906633d2ef4660011aa8affde59c78 100644 --- a/react-ui/package.json +++ b/react-ui/package.json @@ -23,7 +23,8 @@ "start": "vite", "build": "tsc && vite build", "test": "react-scripts test", - "build::api": "./scripts/build-api.sh", + "build::api_old": "./scripts/build-api.sh", + "build::api": "npx @rtk-query/codegen-openapi ./scripts/openapi-config.json", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "lint::fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix" }, @@ -48,6 +49,7 @@ "proxy": "http://localhost:55055", "devDependencies": { "@babel/runtime": "^7.21.5", + "@rtk-query/codegen-openapi": "^1.2.0", "@types/react": "^18.2.66", "@types/react-dom": "^18.2.22", "@typescript-eslint/eslint-plugin": "^7.2.0", diff --git a/react-ui/scripts/build-api.sh b/react-ui/scripts/build-api.sh index 76454bb069245947a0b6622445d93a955177e74c..710affc436958f6a423f8c778b49ae15cb212f75 100755 --- a/react-ui/scripts/build-api.sh +++ b/react-ui/scripts/build-api.sh @@ -7,4 +7,4 @@ API_PATH=/api/openapiv2 OUTPUT=${PROJECT_NAME}/src/api docker run -i --rm \ - -v ${PROJECT_ROOT}:/local openapitools/openapi-generator-cli generate -i /local${API_PATH}/gosdn_northbound.swagger.json -g typescript -o /local/${OUTPUT} \ No newline at end of file + -v ${PROJECT_ROOT}:/local openapitools/openapi-generator-cli generate -i /local${API_PATH}/gosdn_northbound.swagger.json -g typescript-redux-query -o /local/${OUTPUT} \ No newline at end of file diff --git a/react-ui/scripts/openapi-config.json b/react-ui/scripts/openapi-config.json new file mode 100644 index 0000000000000000000000000000000000000000..1aa05ba6e2c88b5e1f153c2b9f3d0a0581aef6be --- /dev/null +++ b/react-ui/scripts/openapi-config.json @@ -0,0 +1,8 @@ +{ + "schemaFile": "../../api/openapiv2/gosdn_northbound.swagger.json", + "apiFile": "../src/stores/api.store.ts", + "apiImport": "emptySplitApi", + "outputFile": "../src/api/api.ts", + "exportName": "api", + "hooks": true +} \ No newline at end of file diff --git a/react-ui/scripts/openapitools.json b/react-ui/scripts/openapitools.json deleted file mode 100644 index 33e1ba3d4d06e22e3e1df69c7f692dcf3cd70075..0000000000000000000000000000000000000000 --- a/react-ui/scripts/openapitools.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "$schema": "../node_modules/@openapitools/openapi-generator-cli/config.schema.json", - "spaces": 2, - "generator-cli": { - "version": "4.3.1", - "storageDir": "~/my/custom/storage/dir", // optional - "generators": { // optional - "v2.0": { // any name you like (just printed to the console log or reference it using --generator-key) - "generatorName": "typescript-angular", - "output": "#{cwd}/output/v2.0/#{ext}/#{name}", - "glob": "examples/v2.0/{json,yaml}/*.{json,yaml}", - "additionalProperties": { - "ngVersion": "6.1.7", - "npmName": "restClient", - "supportsES6": "true", - "npmVersion": "6.9.0", - "withInterfaces": true - } - }, - "v3.0": { // any name you like (just printed to the console log or reference it using --generator-key) - "generatorName": "typescript-fetch", - "output": "#{cwd}/output/v3.0/#{ext}/#{name}", - "glob": "examples/v3.0/petstore.{json,yaml}" - } - } - } - } \ No newline at end of file diff --git a/react-ui/scripts/test.ts b/react-ui/scripts/test.ts new file mode 100644 index 0000000000000000000000000000000000000000..775438e48f3bf4c6eb4258efaadf01953b07c9a9 --- /dev/null +++ b/react-ui/scripts/test.ts @@ -0,0 +1,1208 @@ +import { emptySplitApi as api } from '../src/stores/api.store' +const injectedRtkApi = api.injectEndpoints({ + endpoints: (build) => ({ + appServiceDeregister: build.mutation< + AppServiceDeregisterApiResponse, + AppServiceDeregisterApiArg + >({ + query: (queryArg) => ({ + url: `/deregister`, + method: 'POST', + body: queryArg.appAppDeregisterRequest, + }), + }), + configurationManagementServiceExportSdnConfig: build.query< + ConfigurationManagementServiceExportSdnConfigApiResponse, + ConfigurationManagementServiceExportSdnConfigApiArg + >({ + query: (queryArg) => ({ + url: `/export/${queryArg.pid}`, + params: { timestamp: queryArg.timestamp }, + }), + }), + configurationManagementServiceImportSdnConfig: build.mutation< + ConfigurationManagementServiceImportSdnConfigApiResponse, + ConfigurationManagementServiceImportSdnConfigApiArg + >({ + query: (queryArg) => ({ + url: `/import/${queryArg.pid}`, + method: 'POST', + params: { + timestamp: queryArg.timestamp, + sdnConfigData: queryArg.sdnConfigData, + }, + }), + }), + authServiceLogin: build.mutation< + AuthServiceLoginApiResponse, + AuthServiceLoginApiArg + >({ + query: (queryArg) => ({ + url: `/login`, + method: 'POST', + body: queryArg.rbacLoginRequest, + }), + }), + authServiceLogout: build.mutation< + AuthServiceLogoutApiResponse, + AuthServiceLogoutApiArg + >({ + query: (queryArg) => ({ + url: `/logout/${queryArg.username}`, + method: 'POST', + params: { timestamp: queryArg.timestamp }, + }), + }), + networkElementServiceUpdate: build.mutation< + NetworkElementServiceUpdateApiResponse, + NetworkElementServiceUpdateApiArg + >({ + query: (queryArg) => ({ + url: `/network-element/update`, + method: 'POST', + body: queryArg.networkelementUpdateNetworkElementRequest, + }), + }), + pndServiceGetPnd: build.query< + PndServiceGetPndApiResponse, + PndServiceGetPndApiArg + >({ + query: (queryArg) => ({ + url: `/pnd/${queryArg.pid}`, + params: { timestamp: queryArg.timestamp }, + }), + }), + pndServiceGetPndList: build.query< + PndServiceGetPndListApiResponse, + PndServiceGetPndListApiArg + >({ + query: (queryArg) => ({ + url: `/pnds`, + params: { timestamp: queryArg.timestamp }, + }), + }), + pndServiceCreatePndList: build.mutation< + PndServiceCreatePndListApiResponse, + PndServiceCreatePndListApiArg + >({ + query: (queryArg) => ({ + url: `/pnds`, + method: 'POST', + body: queryArg.pndCreatePndListRequest, + }), + }), + pndServiceDeletePnd: build.mutation< + PndServiceDeletePndApiResponse, + PndServiceDeletePndApiArg + >({ + query: (queryArg) => ({ + url: `/pnds/${queryArg.pid}`, + method: 'DELETE', + params: { timestamp: queryArg.timestamp }, + }), + }), + networkElementServiceGetChangeList: build.query< + NetworkElementServiceGetChangeListApiResponse, + NetworkElementServiceGetChangeListApiArg + >({ + query: (queryArg) => ({ + url: `/pnds/${queryArg.pid}/changes`, + params: { timestamp: queryArg.timestamp }, + }), + }), + networkElementServiceSetChangeList: build.mutation< + NetworkElementServiceSetChangeListApiResponse, + NetworkElementServiceSetChangeListApiArg + >({ + query: (queryArg) => ({ + url: `/pnds/${queryArg.pid}/changes`, + method: 'POST', + body: queryArg.networkElementServiceSetChangeListBody, + }), + }), + networkElementServiceGetChange: build.query< + NetworkElementServiceGetChangeApiResponse, + NetworkElementServiceGetChangeApiArg + >({ + query: (queryArg) => ({ + url: `/pnds/${queryArg.pid}/changes/${queryArg.cuid}`, + params: { timestamp: queryArg.timestamp }, + }), + }), + networkElementServiceGet: build.query< + NetworkElementServiceGetApiResponse, + NetworkElementServiceGetApiArg + >({ + query: (queryArg) => ({ + url: `/pnds/${queryArg.pid}/mne/${queryArg.mneid}`, + params: { timestamp: queryArg.timestamp }, + }), + }), + networkElementServiceGetAllFlattened: build.query< + NetworkElementServiceGetAllFlattenedApiResponse, + NetworkElementServiceGetAllFlattenedApiArg + >({ + query: (queryArg) => ({ + url: `/pnds/${queryArg.pid}/mnes`, + params: { timestamp: queryArg.timestamp }, + }), + }), + networkElementServiceAddList: build.mutation< + NetworkElementServiceAddListApiResponse, + NetworkElementServiceAddListApiArg + >({ + query: (queryArg) => ({ + url: `/pnds/${queryArg.pid}/mnes`, + method: 'POST', + body: queryArg.networkElementServiceAddListBody, + }), + }), + networkElementServiceSetPathList: build.mutation< + NetworkElementServiceSetPathListApiResponse, + NetworkElementServiceSetPathListApiArg + >({ + query: (queryArg) => ({ + url: `/pnds/${queryArg.pid}/mnes/paths`, + method: 'POST', + body: queryArg.networkElementServiceSetPathListBody, + }), + }), + networkElementServiceDelete: build.mutation< + NetworkElementServiceDeleteApiResponse, + NetworkElementServiceDeleteApiArg + >({ + query: (queryArg) => ({ + url: `/pnds/${queryArg.pid}/mnes/${queryArg.mneid}`, + method: 'DELETE', + params: { timestamp: queryArg.timestamp }, + }), + }), + networkElementServiceGetIntendedPath: build.query< + NetworkElementServiceGetIntendedPathApiResponse, + NetworkElementServiceGetIntendedPathApiArg + >({ + query: (queryArg) => ({ + url: `/pnds/${queryArg.pid}/mnes/${queryArg.mneid}/intendedpaths/${queryArg.intendedPath}`, + params: { timestamp: queryArg.timestamp }, + }), + }), + networkElementServiceGetPath: build.query< + NetworkElementServiceGetPathApiResponse, + NetworkElementServiceGetPathApiArg + >({ + query: (queryArg) => ({ + url: `/pnds/${queryArg.pid}/mnes/${queryArg.mneid}/paths/${queryArg.path}`, + params: { timestamp: queryArg.timestamp }, + }), + }), + appServiceRegister: build.mutation< + AppServiceRegisterApiResponse, + AppServiceRegisterApiArg + >({ + query: (queryArg) => ({ + url: `/register`, + method: 'POST', + body: queryArg.appAppRegisterRequest, + }), + }), + roleServiceGetRoles: build.query< + RoleServiceGetRolesApiResponse, + RoleServiceGetRolesApiArg + >({ + query: (queryArg) => ({ + url: `/roles`, + params: { timestamp: queryArg.timestamp }, + }), + }), + roleServiceCreateRoles: build.mutation< + RoleServiceCreateRolesApiResponse, + RoleServiceCreateRolesApiArg + >({ + query: (queryArg) => ({ + url: `/roles/create`, + method: 'POST', + body: queryArg.rbacCreateRolesRequest, + }), + }), + roleServiceDeleteRoles: build.mutation< + RoleServiceDeleteRolesApiResponse, + RoleServiceDeleteRolesApiArg + >({ + query: (queryArg) => ({ + url: `/roles/delete`, + method: 'DELETE', + params: { + timestamp: queryArg.timestamp, + roleName: queryArg.roleName, + }, + }), + }), + roleServiceDeletePermissionsForRole: build.mutation< + RoleServiceDeletePermissionsForRoleApiResponse, + RoleServiceDeletePermissionsForRoleApiArg + >({ + query: (queryArg) => ({ + url: `/roles/delete/permissions`, + method: 'DELETE', + params: { + timestamp: queryArg.timestamp, + roleName: queryArg.roleName, + permissionsToDelete: queryArg.permissionsToDelete, + }, + }), + }), + roleServiceGetRole: build.query< + RoleServiceGetRoleApiResponse, + RoleServiceGetRoleApiArg + >({ + query: (queryArg) => ({ + url: `/roles/get`, + params: { + timestamp: queryArg.timestamp, + roleName: queryArg.roleName, + id: queryArg.id, + }, + }), + }), + roleServiceUpdateRoles: build.mutation< + RoleServiceUpdateRolesApiResponse, + RoleServiceUpdateRolesApiArg + >({ + query: (queryArg) => ({ + url: `/roles/update`, + method: 'POST', + body: queryArg.rbacUpdateRolesRequest, + }), + }), + routingTableServiceGetRoutes: build.query< + RoutingTableServiceGetRoutesApiResponse, + RoutingTableServiceGetRoutesApiArg + >({ + query: (queryArg) => ({ + url: `/routing`, + params: { timestamp: queryArg.timestamp }, + }), + }), + routingTableServiceAddRoutingTable: build.mutation< + RoutingTableServiceAddRoutingTableApiResponse, + RoutingTableServiceAddRoutingTableApiArg + >({ + query: (queryArg) => ({ + url: `/routing/create`, + method: 'POST', + body: queryArg.topologyAddRoutingTableRequest, + }), + }), + routingTableServiceDeleteRoute: build.mutation< + RoutingTableServiceDeleteRouteApiResponse, + RoutingTableServiceDeleteRouteApiArg + >({ + query: (queryArg) => ({ + url: `/routing/delete`, + method: 'DELETE', + params: { timestamp: queryArg.timestamp, id: queryArg.id }, + }), + }), + topologyServiceGetTopology: build.query< + TopologyServiceGetTopologyApiResponse, + TopologyServiceGetTopologyApiArg + >({ + query: (queryArg) => ({ + url: `/topology`, + params: { timestamp: queryArg.timestamp }, + }), + }), + topologyServiceAddLink: build.mutation< + TopologyServiceAddLinkApiResponse, + TopologyServiceAddLinkApiArg + >({ + query: (queryArg) => ({ + url: `/topology/create`, + method: 'POST', + body: queryArg.topologyAddLinkRequest, + }), + }), + topologyServiceDeleteLink: build.mutation< + TopologyServiceDeleteLinkApiResponse, + TopologyServiceDeleteLinkApiArg + >({ + query: (queryArg) => ({ + url: `/topology/delete`, + method: 'DELETE', + params: { timestamp: queryArg.timestamp, id: queryArg.id }, + }), + }), + topologyServiceUpdateLink: build.mutation< + TopologyServiceUpdateLinkApiResponse, + TopologyServiceUpdateLinkApiArg + >({ + query: (queryArg) => ({ + url: `/topology/update`, + method: 'POST', + body: queryArg.topologyUpdateLinkRequest, + }), + }), + userServiceGetUsers: build.query< + UserServiceGetUsersApiResponse, + UserServiceGetUsersApiArg + >({ + query: (queryArg) => ({ + url: `/users`, + params: { timestamp: queryArg.timestamp }, + }), + }), + userServiceCreateUsers: build.mutation< + UserServiceCreateUsersApiResponse, + UserServiceCreateUsersApiArg + >({ + query: (queryArg) => ({ + url: `/users/create`, + method: 'POST', + body: queryArg.rbacCreateUsersRequest, + }), + }), + userServiceDeleteUsers: build.mutation< + UserServiceDeleteUsersApiResponse, + UserServiceDeleteUsersApiArg + >({ + query: (queryArg) => ({ + url: `/users/delete`, + method: 'DELETE', + params: { + timestamp: queryArg.timestamp, + username: queryArg.username, + }, + }), + }), + userServiceGetUser: build.query< + UserServiceGetUserApiResponse, + UserServiceGetUserApiArg + >({ + query: (queryArg) => ({ + url: `/users/get`, + params: { + timestamp: queryArg.timestamp, + name: queryArg.name, + id: queryArg.id, + }, + }), + }), + userServiceUpdateUsers: build.mutation< + UserServiceUpdateUsersApiResponse, + UserServiceUpdateUsersApiArg + >({ + query: (queryArg) => ({ + url: `/users/update`, + method: 'POST', + body: queryArg.rbacUpdateUsersRequest, + }), + }), + }), + overrideExisting: false, +}) +export { injectedRtkApi as api } +export type AppServiceDeregisterApiResponse = + /** status 200 A successful response. */ AppAppDeregisterResponse +export type AppServiceDeregisterApiArg = { + appAppDeregisterRequest: AppAppDeregisterRequest +} +export type ConfigurationManagementServiceExportSdnConfigApiResponse = + /** status 200 A successful response. */ ConfigurationmanagementExportSdnConfigResponse +export type ConfigurationManagementServiceExportSdnConfigApiArg = { + pid: string + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string +} +export type ConfigurationManagementServiceImportSdnConfigApiResponse = + /** status 200 A successful response. */ ConfigurationmanagementImportSdnConfigResponse +export type ConfigurationManagementServiceImportSdnConfigApiArg = { + pid: string + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + sdnConfigData?: string +} +export type AuthServiceLoginApiResponse = + /** status 200 A successful response. */ RbacLoginResponse +export type AuthServiceLoginApiArg = { + rbacLoginRequest: Login +} +export type AuthServiceLogoutApiResponse = + /** status 200 A successful response. */ RbacLogoutResponse +export type AuthServiceLogoutApiArg = { + username: string + timestamp?: string +} +export type NetworkElementServiceUpdateApiResponse = + /** status 200 A successful response. */ NetworkelementUpdateNetworkElementResponse +export type NetworkElementServiceUpdateApiArg = { + networkelementUpdateNetworkElementRequest: TodoChangeNameToFitTheRest +} +export type PndServiceGetPndApiResponse = + /** status 200 A successful response. */ PndGetPndResponse +export type PndServiceGetPndApiArg = { + pid: string + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string +} +export type PndServiceGetPndListApiResponse = + /** status 200 A successful response. */ PndGetPndListResponse +export type PndServiceGetPndListApiArg = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string +} +export type PndServiceCreatePndListApiResponse = + /** status 200 A successful response. */ PndCreatePndListResponse +export type PndServiceCreatePndListApiArg = { + pndCreatePndListRequest: PndCreatePndListRequest +} +export type PndServiceDeletePndApiResponse = + /** status 200 A successful response. */ PndDeletePndResponse +export type PndServiceDeletePndApiArg = { + pid: string + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string +} +export type NetworkElementServiceGetChangeListApiResponse = + /** status 200 A successful response. */ NetworkelementGetChangeListResponse +export type NetworkElementServiceGetChangeListApiArg = { + pid: string + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string +} +export type NetworkElementServiceSetChangeListApiResponse = + /** status 200 A successful response. */ NetworkelementSetChangeListResponse +export type NetworkElementServiceSetChangeListApiArg = { + pid: string + networkElementServiceSetChangeListBody: NetworkElementServiceSetChangeListBody +} +export type NetworkElementServiceGetChangeApiResponse = + /** status 200 A successful response. */ NetworkelementGetChangeResponse +export type NetworkElementServiceGetChangeApiArg = { + pid: string + cuid: string[] + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string +} +export type NetworkElementServiceGetApiResponse = + /** status 200 A successful response. */ GosdnnetworkelementGetResponse +export type NetworkElementServiceGetApiArg = { + pid: string + mneid: string + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string +} +export type NetworkElementServiceGetAllFlattenedApiResponse = + /** status 200 A successful response. */ NetworkelementGetAllFlattenedResponse +export type NetworkElementServiceGetAllFlattenedApiArg = { + pid: string + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string +} +export type NetworkElementServiceAddListApiResponse = + /** status 200 A successful response. */ NetworkelementAddListResponse +export type NetworkElementServiceAddListApiArg = { + pid: string + networkElementServiceAddListBody: NetworkElementServiceAddListBody +} +export type NetworkElementServiceSetPathListApiResponse = + /** status 200 A successful response. */ NetworkelementSetPathListResponse +export type NetworkElementServiceSetPathListApiArg = { + pid: string + networkElementServiceSetPathListBody: NetworkElementServiceSetPathListBody +} +export type NetworkElementServiceDeleteApiResponse = + /** status 200 A successful response. */ GosdnnetworkelementDeleteResponse +export type NetworkElementServiceDeleteApiArg = { + pid: string + mneid: string + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string +} +export type NetworkElementServiceGetIntendedPathApiResponse = + /** status 200 A successful response. */ NetworkelementGetIntendedPathResponse +export type NetworkElementServiceGetIntendedPathApiArg = { + pid: string + mneid: string + intendedPath: string + timestamp?: string +} +export type NetworkElementServiceGetPathApiResponse = + /** status 200 A successful response. */ NetworkelementGetPathResponse +export type NetworkElementServiceGetPathApiArg = { + pid: string + mneid: string + path: string + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string +} +export type AppServiceRegisterApiResponse = + /** status 200 A successful response. */ AppAppRegisterResponse +export type AppServiceRegisterApiArg = { + appAppRegisterRequest: AppAppRegisterRequest +} +export type RoleServiceGetRolesApiResponse = + /** status 200 A successful response. */ RbacGetRolesResponse +export type RoleServiceGetRolesApiArg = { + timestamp?: string +} +export type RoleServiceCreateRolesApiResponse = + /** status 200 A successful response. */ RbacCreateRolesResponse +export type RoleServiceCreateRolesApiArg = { + rbacCreateRolesRequest: CreateRoles +} +export type RoleServiceDeleteRolesApiResponse = + /** status 200 A successful response. */ RbacDeleteRolesResponse +export type RoleServiceDeleteRolesApiArg = { + timestamp?: string + roleName?: string[] +} +export type RoleServiceDeletePermissionsForRoleApiResponse = + /** status 200 A successful response. */ RbacDeletePermissionsForRoleResponse +export type RoleServiceDeletePermissionsForRoleApiArg = { + timestamp?: string + roleName?: string + permissionsToDelete?: string[] +} +export type RoleServiceGetRoleApiResponse = + /** status 200 A successful response. */ RbacGetRoleResponse +export type RoleServiceGetRoleApiArg = { + timestamp?: string + roleName?: string + id?: string +} +export type RoleServiceUpdateRolesApiResponse = + /** status 200 A successful response. */ RbacUpdateRolesResponse +export type RoleServiceUpdateRolesApiArg = { + rbacUpdateRolesRequest: UpdateRoles +} +export type RoutingTableServiceGetRoutesApiResponse = + /** status 200 A successful response. */ TopologyGetRoutesResponse +export type RoutingTableServiceGetRoutesApiArg = { + timestamp?: string +} +export type RoutingTableServiceAddRoutingTableApiResponse = + /** status 200 A successful response. */ TopologyAddRoutingTableResponse +export type RoutingTableServiceAddRoutingTableApiArg = { + topologyAddRoutingTableRequest: TopologyAddRoutingTableRequest +} +export type RoutingTableServiceDeleteRouteApiResponse = + /** status 200 A successful response. */ TopologyDeleteRoutesResponse +export type RoutingTableServiceDeleteRouteApiArg = { + timestamp?: string + id?: string +} +export type TopologyServiceGetTopologyApiResponse = + /** status 200 A successful response. */ TopologyGetTopologyResponse +export type TopologyServiceGetTopologyApiArg = { + timestamp?: string +} +export type TopologyServiceAddLinkApiResponse = + /** status 200 A successful response. */ TopologyAddLinkResponse +export type TopologyServiceAddLinkApiArg = { + topologyAddLinkRequest: TopologyAddLinkRequest +} +export type TopologyServiceDeleteLinkApiResponse = + /** status 200 A successful response. */ TopologyDeleteLinkResponse +export type TopologyServiceDeleteLinkApiArg = { + timestamp?: string + id?: string +} +export type TopologyServiceUpdateLinkApiResponse = + /** status 200 A successful response. */ TopologyUpdateLinkResponse +export type TopologyServiceUpdateLinkApiArg = { + topologyUpdateLinkRequest: TopologyUpdateLinkRequest +} +export type UserServiceGetUsersApiResponse = + /** status 200 A successful response. */ RbacGetUsersResponse +export type UserServiceGetUsersApiArg = { + timestamp?: string +} +export type UserServiceCreateUsersApiResponse = + /** status 200 A successful response. */ RbacCreateUsersResponse +export type UserServiceCreateUsersApiArg = { + rbacCreateUsersRequest: CreateUsers +} +export type UserServiceDeleteUsersApiResponse = + /** status 200 A successful response. */ RbacDeleteUsersResponse +export type UserServiceDeleteUsersApiArg = { + timestamp?: string + username?: string[] +} +export type UserServiceGetUserApiResponse = + /** status 200 A successful response. */ RbacGetUserResponse +export type UserServiceGetUserApiArg = { + timestamp?: string + /** TODO(faseid): reconsider if this is necessary as required, but id is not? */ + name?: string + id?: string +} +export type UserServiceUpdateUsersApiResponse = + /** status 200 A successful response. */ RbacUpdateUsersResponse +export type UserServiceUpdateUsersApiArg = { + rbacUpdateUsersRequest: UpdateUsers +} +export type AppAppDeregisterResponse = { + timestamp?: string +} +export type ProtobufAny = { + /** A URL/resource name that uniquely identifies the type of the serialized + protocol buffer message. This string must contain at least + one "/" character. The last segment of the URL's path must represent + the fully qualified name of the type (as in + `path/google.protobuf.Duration`). The name should be in a canonical form + (e.g., leading "." is not accepted). + + In practice, teams usually precompile into the binary all types that they + expect it to use in the context of Any. However, for URLs which use the + scheme `http`, `https`, or no scheme, one can optionally set up a type + server that maps type URLs to message definitions as follows: + + * If no scheme is provided, `https` is assumed. + * An HTTP GET on the URL must yield a [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in the official + protobuf release, and it is not used for type URLs beginning with + type.googleapis.com. As of May 2023, there are no widely used type server + implementations and no plans to implement one. + + Schemes other than `http`, `https` (or the empty scheme) might be + used with implementation specific semantics. */ + '@type'?: string + [key: string]: any +} +export type GooglerpcStatus = { + code?: number + message?: string + details?: ProtobufAny[] +} +export type AppAppDeregisterRequest = { + timestamp?: string + appname?: string +} +export type ConfigurationmanagementExportSdnConfigResponse = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + sdnConfigData?: string +} +export type ConfigurationmanagementImportSdnConfigResponse = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string +} +export type RbacLoginResponse = { + timestamp?: string + token?: string +} +export type Login = { + timestamp?: string + username?: string + pwd?: string +} +export type RbacLogoutResponse = { + timestamp?: string +} +export type NetworkelementUpdateNetworkElementResponse = { + timestamp?: string +} +export type PluginRegistryManifest = { + name?: string + firmware?: string + author?: string + version?: string +} +export type PluginRegistryPlugin = { + id?: string + manifest?: PluginRegistryManifest +} +export type GnmiPathElem = { + /** The name of the element in the path. */ + name?: string + /** Map of key (attribute) name to value. */ + key?: { + [key: string]: string + } +} +export type GnmiPath = { + /** Elements of the path are no longer encoded as a string, but rather within + the elem field as a PathElem message. */ + element?: string[] + /** Label to disambiguate path. */ + origin?: string + /** Elements of the path. */ + elem?: GnmiPathElem[] + target?: string +} +export type EncodingDefinesTheValueEncodingFormatsThatAreSupportedByTheGNmiProtocolTheseEncodingsAreUsedByBothTheClientWhenSendingSetMessagesToModifyTheStateOfTheTargetAndTheTargetWhenSerializingDataToBeReturnedToTheClientInBothSubscribeAndGetRpCsReferenceGNmiSpecificationSection23 = + 'JSON' | 'BYTES' | 'PROTO' | 'ASCII' | 'JSON_IETF' +export type GnmiValue = { + /** Value of the variable being transmitted. */ + value?: string + type?: EncodingDefinesTheValueEncodingFormatsThatAreSupportedByTheGNmiProtocolTheseEncodingsAreUsedByBothTheClientWhenSendingSetMessagesToModifyTheStateOfTheTargetAndTheTargetWhenSerializingDataToBeReturnedToTheClientInBothSubscribeAndGetRpCsReferenceGNmiSpecificationSection23 +} +export type GnmiDecimal64 = { + /** Set of digits. */ + digits?: string + /** Number of digits following the decimal point. */ + precision?: number +} +export type GnmiScalarArray = { + /** The set of elements within the array. Each TypedValue message should + specify only elements that have a field identifier of 1-7 (i.e., the + values are scalar values). */ + element?: GnmiTypedValue[] +} +export type GnmiTypedValue = { + /** String value. */ + stringVal?: string + /** Integer value. */ + intVal?: string + /** Unsigned integer value. */ + uintVal?: string + /** Bool value. */ + boolVal?: boolean + /** Arbitrary byte sequence value. */ + bytesVal?: string + /** Floating point value. */ + floatVal?: number + decimalVal?: GnmiDecimal64 + leaflistVal?: GnmiScalarArray + anyVal?: ProtobufAny + /** JSON-encoded text. */ + jsonVal?: string + /** JSON-encoded text per RFC7951. */ + jsonIetfVal?: string + /** Arbitrary ASCII text. */ + asciiVal?: string + /** Protobuf binary encoded bytes. The message type is not included. + See the specification at + github.com/openconfig/reference/blob/master/rpc/gnmi/protobuf-vals.md + for a complete specification. */ + protoBytes?: string +} +export type UpdateIsAReUsableMessageThatIsUsedToStoreAParticularPathValuePairReferenceGNmiSpecificationSection21 = + { + path?: GnmiPath + value?: GnmiValue + val?: GnmiTypedValue + /** Number of coalesced duplicates. */ + duplicates?: number + } +export type NotificationIsAReUsableMessageThatIsUsedToEncodeDataFromTheTargetToTheClientANotificationCarriesTwoTypesOfChangesToTheDataTreeDeletedValuesDeleteASetOfPathsThatHaveBeenRemovedFromTheDataTreeUpdatedValuesUpdateASetOfPathValuePairsIndicatingThePathWhoseValueHasChangedInTheDataTreeReferenceGNmiSpecificationSection21 = + { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + prefix?: GnmiPath + alias?: string + /** Data elements that have changed values. */ + update?: UpdateIsAReUsableMessageThatIsUsedToStoreAParticularPathValuePairReferenceGNmiSpecificationSection21[] + /** Data elements that have been deleted. */ + delete?: GnmiPath[] + /** This notification contains a set of paths that are always updated together + referenced by a globally unique prefix. */ + atomic?: boolean + } +export type TransportGnmiTransportOption = { + compression?: string + grpcDialOptions?: { + [key: string]: string + } + token?: string + encoding?: EncodingDefinesTheValueEncodingFormatsThatAreSupportedByTheGNmiProtocolTheseEncodingsAreUsedByBothTheClientWhenSendingSetMessagesToModifyTheStateOfTheTargetAndTheTargetWhenSerializingDataToBeReturnedToTheClientInBothSubscribeAndGetRpCsReferenceGNmiSpecificationSection23 +} +export type TransportRestconfTransportOption = object +export type ChangedAccordingToStyleGuideHttpsDocsBufBuildBestPracticesStyleGuideEnums = + + | 'TYPE_UNSPECIFIED' + | 'TYPE_OPENCONFIG' + | 'TYPE_CONTAINERISED' + | 'TYPE_PLUGIN' +export type TransportTransportOption = { + address?: string + username?: string + password?: string + tls?: boolean + gnmiTransportOption?: TransportGnmiTransportOption + restconfTransportOption?: TransportRestconfTransportOption + type?: ChangedAccordingToStyleGuideHttpsDocsBufBuildBestPracticesStyleGuideEnums +} +export type ConflictMetadata = { + resourceVersion?: string +} +export type NetworkelementManagedNetworkElement = { + id?: string + name?: string + model?: string + plugin?: PluginRegistryPlugin + mneNotification?: NotificationIsAReUsableMessageThatIsUsedToEncodeDataFromTheTargetToTheClientANotificationCarriesTwoTypesOfChangesToTheDataTreeDeletedValuesDeleteASetOfPathsThatHaveBeenRemovedFromTheDataTreeUpdatedValuesUpdateASetOfPathValuePairsIndicatingThePathWhoseValueHasChangedInTheDataTreeReferenceGNmiSpecificationSection21[] + transportAddress?: string + transportOption?: TransportTransportOption + metadata?: ConflictMetadata + associatedPnd?: string + gnmiSubscribePaths?: string[] +} +export type TodoChangeNameToFitTheRest = { + timestamp?: string + networkElement?: NetworkelementManagedNetworkElement +} +export type PndPrincipalNetworkDomain = { + id?: string + name?: string + description?: string +} +export type PndGetPndResponse = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + pnd?: PndPrincipalNetworkDomain +} +export type PndGetPndListResponse = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + pnd?: PndPrincipalNetworkDomain[] +} +export type PndCreatePndListResponse = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string +} +export type PndPndCreateProperties = { + name?: string + description?: string +} +export type PndCreatePndListRequest = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + pnd?: PndPndCreateProperties[] +} +export type PndDeletePndResponse = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string +} +export type NetworkelementChangeState = + | 'CHANGE_STATE_UNSPECIFIED' + | 'CHANGE_STATE_PENDING' + | 'CHANGE_STATE_COMMITTED' + | 'CHANGE_STATE_CONFIRMED' + | 'CHANGE_STATE_INCONSISTENT' +export type NetworkelementChange = { + id?: string + age?: string + state?: NetworkelementChangeState + diff?: NotificationIsAReUsableMessageThatIsUsedToEncodeDataFromTheTargetToTheClientANotificationCarriesTwoTypesOfChangesToTheDataTreeDeletedValuesDeleteASetOfPathsThatHaveBeenRemovedFromTheDataTreeUpdatedValuesUpdateASetOfPathValuePairsIndicatingThePathWhoseValueHasChangedInTheDataTreeReferenceGNmiSpecificationSection21 +} +export type NetworkelementGetChangeListResponse = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + pnd?: PndPrincipalNetworkDomain + change?: NetworkelementChange[] +} +export type GosdnnetworkelementSetResponse = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + id?: string +} +export type NetworkelementSetChangeListResponse = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + responses?: GosdnnetworkelementSetResponse[] +} +export type GosdnnetworkelementOperation = + | 'OPERATION_UNSPECIFIED' + | 'OPERATION_CREATE' + | 'OPERATION_COMMIT' + | 'OPERATION_CONFIRM' +export type NetworkelementSetChange = { + cuid?: string + op?: GosdnnetworkelementOperation +} +export type NetworkElementServiceSetChangeListBody = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + change?: NetworkelementSetChange[] +} +export type NetworkelementGetChangeResponse = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + pnd?: PndPrincipalNetworkDomain + change?: NetworkelementChange[] +} +export type GosdnnetworkelementGetResponse = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + pnd?: PndPrincipalNetworkDomain + mne?: NetworkelementManagedNetworkElement +} +export type NetworkelementFlattenedManagedNetworkElement = { + id?: string + name?: string + pid?: string + pluginid?: string +} +export type NetworkelementGetAllFlattenedResponse = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + pnd?: PndPrincipalNetworkDomain + mne?: NetworkelementFlattenedManagedNetworkElement[] +} +export type NetworkelementAddListResponse = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + responses?: GosdnnetworkelementSetResponse[] +} +export type NetworkelementSetMne = { + address?: string + pid?: string + pluginId?: string + mneName?: string + transportOption?: TransportTransportOption + gnmiSubscribePaths?: string[] + mneId?: string +} +export type NetworkElementServiceAddListBody = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + mne?: NetworkelementSetMne[] +} +export type NetworkelementSetPathListResponse = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + responses?: GosdnnetworkelementSetResponse[] +} +export type NetworkelementApiOperation = + | 'API_OPERATION_UNSPECIFIED' + | 'API_OPERATION_UPDATE' + | 'API_OPERATION_REPLACE' + | 'API_OPERATION_DELETE' +export type NetworkelementChangeRequest = { + mneid?: string + path?: GnmiPath + value?: GnmiTypedValue + apiOp?: NetworkelementApiOperation +} +export type NetworkElementServiceSetPathListBody = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + changeRequest?: NetworkelementChangeRequest[] +} +export type GosdnnetworkelementDeleteResponse = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string +} +export type NetworkelementGetIntendedPathResponse = { + timestamp?: string + pnd?: PndPrincipalNetworkDomain + mneNotification?: NotificationIsAReUsableMessageThatIsUsedToEncodeDataFromTheTargetToTheClientANotificationCarriesTwoTypesOfChangesToTheDataTreeDeletedValuesDeleteASetOfPathsThatHaveBeenRemovedFromTheDataTreeUpdatedValuesUpdateASetOfPathValuePairsIndicatingThePathWhoseValueHasChangedInTheDataTreeReferenceGNmiSpecificationSection21[] +} +export type NetworkelementGetPathResponse = { + /** Timestamp in nanoseconds since Epoch. */ + timestamp?: string + pnd?: PndPrincipalNetworkDomain + mneNotification?: NotificationIsAReUsableMessageThatIsUsedToEncodeDataFromTheTargetToTheClientANotificationCarriesTwoTypesOfChangesToTheDataTreeDeletedValuesDeleteASetOfPathsThatHaveBeenRemovedFromTheDataTreeUpdatedValuesUpdateASetOfPathValuePairsIndicatingThePathWhoseValueHasChangedInTheDataTreeReferenceGNmiSpecificationSection21[] +} +export type AppAppRegisterResponse = { + timestamp?: string + queueconnection?: string +} +export type AppAppRegisterRequest = { + timestamp?: string + appname?: string + token?: string +} +export type GosdnrbacRole = { + id?: string + name?: string + description?: string + permissions?: string[] +} +export type RbacGetRolesResponse = { + timestamp?: string + roles?: GosdnrbacRole[] +} +export type RbacCreateRolesResponse = { + timestamp?: string +} +export type CreateRoles = { + timestamp?: string + roles?: GosdnrbacRole[] +} +export type RbacDeleteRolesResponse = { + timestamp?: string +} +export type RbacDeletePermissionsForRoleResponse = { + timestamp?: string +} +export type RbacGetRoleResponse = { + timestamp?: string + role?: GosdnrbacRole +} +export type RbacUpdateRolesResponse = { + timestamp?: string +} +export type UpdateRoles = { + timestamp?: string + roles?: GosdnrbacRole[] +} +export type TopologyRoute = { + id?: string + targetIPRange?: string + nextHopIP?: string + portID?: string + metric?: string +} +export type TopologyRoutingTable = { + id?: string + nodeID?: string + routes?: TopologyRoute[] + metadata?: ConflictMetadata +} +export type TopologyGetRoutesResponse = { + timestamp?: string + routingTables?: TopologyRoutingTable[] +} +export type TopologyAddRoutingTableResponse = { + timestamp?: string +} +export type TopologyAddRoutingTableRequest = { + timestamp?: string + routingTable?: TopologyRoutingTable +} +export type TopologyDeleteRoutesResponse = { + timestamp?: string +} +export type TopologyNode = { + id?: string + name?: string + metadata?: ConflictMetadata +} +export type GosdntopologyConfiguration = { + ip?: string + prefixLength?: string +} +export type TopologyPort = { + id?: string + name?: string + configuration?: GosdntopologyConfiguration + metadata?: ConflictMetadata +} +export type TopologyLink = { + id?: string + name?: string + sourceNode?: TopologyNode + targetNode?: TopologyNode + sourcePort?: TopologyPort + targetPort?: TopologyPort + metadata?: ConflictMetadata +} +export type TopologyTopology = { + links?: TopologyLink[] +} +export type TopologyGetTopologyResponse = { + timestamp?: string + toplogy?: TopologyTopology +} +export type TopologyAddLinkResponse = { + timestamp?: string +} +export type TopologyAddLinkRequest = { + timestamp?: string + link?: TopologyLink +} +export type TopologyDeleteLinkResponse = { + timestamp?: string +} +export type TopologyUpdateLinkResponse = { + timestamp?: string +} +export type TopologyUpdateLinkRequest = { + timestamp?: string + link?: TopologyLink +} +export type RbacUser = { + id?: string + name?: string + roles?: { + [key: string]: string + } + password?: string + token?: string + metadata?: ConflictMetadata +} +export type RbacGetUsersResponse = { + timestamp?: string + user?: RbacUser[] +} +export type RbacCreateUsersResponse = { + timestamp?: string +} +export type CreateUsers = { + timestamp?: string + user?: RbacUser[] +} +export type RbacDeleteUsersResponse = { + timestamp?: string +} +export type RbacGetUserResponse = { + timestamp?: string + user?: RbacUser +} +export type RbacUpdateUsersResponse = { + timestamp?: string +} +export type RbacUpdateUser = { + id?: string + name?: string + roles?: { + [key: string]: string + } + password?: string + token?: string + metadata?: ConflictMetadata +} +export type UpdateUsers = { + timestamp?: string + user?: RbacUpdateUser[] +} +export const { + useAppServiceDeregisterMutation, + useConfigurationManagementServiceExportSdnConfigQuery, + useConfigurationManagementServiceImportSdnConfigMutation, + useAuthServiceLoginMutation, + useAuthServiceLogoutMutation, + useNetworkElementServiceUpdateMutation, + usePndServiceGetPndQuery, + usePndServiceGetPndListQuery, + usePndServiceCreatePndListMutation, + usePndServiceDeletePndMutation, + useNetworkElementServiceGetChangeListQuery, + useNetworkElementServiceSetChangeListMutation, + useNetworkElementServiceGetChangeQuery, + useNetworkElementServiceGetQuery, + useNetworkElementServiceGetAllFlattenedQuery, + useNetworkElementServiceAddListMutation, + useNetworkElementServiceSetPathListMutation, + useNetworkElementServiceDeleteMutation, + useNetworkElementServiceGetIntendedPathQuery, + useNetworkElementServiceGetPathQuery, + useAppServiceRegisterMutation, + useRoleServiceGetRolesQuery, + useRoleServiceCreateRolesMutation, + useRoleServiceDeleteRolesMutation, + useRoleServiceDeletePermissionsForRoleMutation, + useRoleServiceGetRoleQuery, + useRoleServiceUpdateRolesMutation, + useRoutingTableServiceGetRoutesQuery, + useRoutingTableServiceAddRoutingTableMutation, + useRoutingTableServiceDeleteRouteMutation, + useTopologyServiceGetTopologyQuery, + useTopologyServiceAddLinkMutation, + useTopologyServiceDeleteLinkMutation, + useTopologyServiceUpdateLinkMutation, + useUserServiceGetUsersQuery, + useUserServiceCreateUsersMutation, + useUserServiceDeleteUsersMutation, + useUserServiceGetUserQuery, + useUserServiceUpdateUsersMutation, +} = injectedRtkApi diff --git a/react-ui/src/index.tsx b/react-ui/src/index.tsx index db0b8276640ebd69ba33010e0ea8897803570d9f..6c95d80aa9d64d71f05bcc41c5deb3a27bde5530 100644 --- a/react-ui/src/index.tsx +++ b/react-ui/src/index.tsx @@ -10,13 +10,12 @@ import { import './index.scss' import Landingpage from './pages/landingpage/landingpage' import LoginPage from './pages/login/login' -import initStore from './stores/api.store' import './i18n/config' import { I18nextProvider } from 'react-i18next' import i18next from 'i18next' - -initStore() +import { Provider } from 'react-redux' +import { store } from './stores' const root = ReactDOM.createRoot(document.getElementById('root') as Container) @@ -34,8 +33,10 @@ const router = createBrowserRouter( root.render( <React.StrictMode> - <I18nextProvider i18n={i18next}> - <RouterProvider router={router} /> - </I18nextProvider> + <Provider store={store}> + <I18nextProvider i18n={i18next}> + <RouterProvider router={router} /> + </I18nextProvider> + </Provider> </React.StrictMode> ) diff --git a/react-ui/src/pages/login/login.tsx b/react-ui/src/pages/login/login.tsx index 7eb213e78b5310ed31e8e2dd5c753aa44d0371f8..ffe8928e3c78ca4fc172a26a49451ca8aae434a6 100644 --- a/react-ui/src/pages/login/login.tsx +++ b/react-ui/src/pages/login/login.tsx @@ -2,43 +2,42 @@ import { Button, Col, Container, Form, Image, Row } from 'react-bootstrap' import { useTranslation } from 'react-i18next' import './login.scss' -import { AuthServiceApiAuthServiceLoginRequest } from '@api/types/ObjectParamAPI' import logo from '@assets/logo.svg' import React, { useRef } from 'react' -import { AuthServiceApi, RbacLoginRequest, RbacLoginResponse, createConfiguration } from '@api/index' +import { AuthServiceLoginApiArg, useAuthServiceLoginMutation } from '@api/api' const LoginPage = () => { const { t } = useTranslation('common') const usernameRef = useRef<HTMLInputElement>(null) const passwordRef = useRef<HTMLInputElement>(null) - const getAuthPayload = (): RbacLoginRequest => { + const getAuthPayload = (): AuthServiceLoginApiArg => { const username = usernameRef.current?.value const password = passwordRef.current?.value // TODO check values - const payload: RbacLoginRequest = { - username: username, - pwd: password, - timestamp: new Date().toString(), + const payload: AuthServiceLoginApiArg = { + rbacLoginRequest: { + username: username, + pwd: password, + timestamp: new Date().getTime().toString(), + } } return payload; } + const [ + sendLogin, + ] = useAuthServiceLoginMutation() + const login = (event: React.FormEvent<HTMLFormElement>) => { event.preventDefault() - const configuration = createConfiguration(); - const apiInstance = new AuthServiceApi(configuration); - const payload = getAuthPayload(); - - - apiInstance.authServiceLogin(payload).then((response:RbacLoginResponse) => { - console.log('API called successfully. Returned data: ' + response); - }).catch((error:any) => console.error(error)); - + sendLogin(payload).unwrap() + .then((payload) => console.log('fulfilled', payload)) + .catch((error) => console.error('rejected', error)); } return ( diff --git a/react-ui/src/setupProxy.js b/react-ui/src/setupProxy.js deleted file mode 100644 index afeb740de5511bb4932ca047be310a2723f4c400..0000000000000000000000000000000000000000 --- a/react-ui/src/setupProxy.js +++ /dev/null @@ -1,11 +0,0 @@ -const { createProxyMiddleware } = require('http-proxy-middleware'); - -module.exports = function(app) { - app.use( - '/api', - createProxyMiddleware({ - target: 'http://127.0.0.1:8089', - changeOrigin: true, - }) - ); -}; \ No newline at end of file diff --git a/react-ui/src/stores/api.store.ts b/react-ui/src/stores/api.store.ts index 2ae49c72448d0db533e6d6ea463de6d914c52b63..5f9077aeee82b2a8cf455919e7149a8242f8af3c 100644 --- a/react-ui/src/stores/api.store.ts +++ b/react-ui/src/stores/api.store.ts @@ -1,18 +1,7 @@ -import { combineReducers } from 'redux' -import userReducer from './slices/user.reducer' -import { configureStore } from '@reduxjs/toolkit' +import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react' -const getReducers = () => { - return combineReducers({ - userReducer, - }) -} - -const initStore = () => { - return configureStore({ - reducer: getReducers(), - }) -} - -//export type RootState = ReturnType<typeof store.getState> -export default initStore +// initialize an empty api service that we'll inject endpoints into later as needed +export const emptySplitApi = createApi({ + baseQuery: fetchBaseQuery({ baseUrl: '/api' }), + endpoints: () => ({}), +}) \ No newline at end of file diff --git a/react-ui/src/stores/index.ts b/react-ui/src/stores/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..299595f1802db355d17d927103cb89b997908a85 --- /dev/null +++ b/react-ui/src/stores/index.ts @@ -0,0 +1,23 @@ +import { combineReducers } from 'redux' +import userReducer from './slices/user.reducer' +import { configureStore } from '@reduxjs/toolkit' +import { emptySplitApi } from './api.store' +import { setupListeners } from '@reduxjs/toolkit/query' + +const getReducers = () => { + return combineReducers({ + userReducer, + [emptySplitApi.reducerPath]: emptySplitApi.reducer + }) +} + + +export const store = configureStore({ + reducer: getReducers(), + middleware: (getDefaultMiddleware) => + getDefaultMiddleware().concat(emptySplitApi.middleware), +}) + +setupListeners(store.dispatch) + +//export type RootState = ReturnType<typeof store.getState> \ No newline at end of file diff --git a/react-ui/tsconfig.json b/react-ui/tsconfig.json index 977976c0fd56e2e64d54b2cb64029f976586c9c8..4230ee19f5767e3d1e8b83d1ac3bf93d837fae96 100644 --- a/react-ui/tsconfig.json +++ b/react-ui/tsconfig.json @@ -29,7 +29,7 @@ "include": [ "src/**/*.d.ts", "src/**/*.ts", - "src/**/*.tsx", + "src/**/*.tsx", "src/stores/api.store.ts", "scripts/test.ts", ], //"references": [{ "path": "./tsconfig.node.json" }] } \ No newline at end of file diff --git a/react-ui/tsconfig.node.json b/react-ui/tsconfig.node.json index d5ed4eaa8aa19f19ecb77d7a31605ad4cac7e020..9357c44f34dccfa514fb7eed37c70d57d691bc70 100644 --- a/react-ui/tsconfig.node.json +++ b/react-ui/tsconfig.node.json @@ -2,7 +2,7 @@ "compilerOptions": { "composite": true, "skipLibCheck": true, - "module": "ESNext", + "module": "ES2020", "moduleResolution": "bundler", "allowSyntheticDefaultImports": true, "strict": true diff --git a/react-ui/vite.config.mjs b/react-ui/vite.config.mjs index 7aa8ebc5a1e5ebb3644ced38979ed5f439743862..4d70f80f3717896675c6d9dd05fae891d9bfebd0 100644 --- a/react-ui/vite.config.mjs +++ b/react-ui/vite.config.mjs @@ -8,10 +8,10 @@ export default defineConfig({ port: 3000, proxy: { '/api': { - target: 'https://localhost:8089', + target: 'http://127.0.0.1:8080', changeOrigin: true, - secure: false, - ws: true, + secure: false, + rewrite: (path) => path.replace(/^\/api/, ''), configure: (proxy, _options) => { proxy.on('error', (err, _req, _res) => { console.log('proxy error', err); diff --git a/react-ui/yarn.lock b/react-ui/yarn.lock index e37ab2beeac02ed4ef507abf3a9c593793d2b05f..914516cda0c7df6a01c01e1c3be488caf795d6cd 100644 --- a/react-ui/yarn.lock +++ b/react-ui/yarn.lock @@ -29,6 +29,38 @@ jsonpointer "^5.0.0" leven "^3.1.0" +"@apidevtools/json-schema-ref-parser@9.0.6": + version "9.0.6" + resolved "https://registry.yarnpkg.com/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.6.tgz#5d9000a3ac1fd25404da886da6b266adcd99cf1c" + integrity sha512-M3YgsLjI0lZxvrpeGVk9Ap032W6TPQkH6pRAZz81Ac3WUNF79VQooAFnp8umjvVzUmD93NkogxEwbSce7qMsUg== + dependencies: + "@jsdevtools/ono" "^7.1.3" + call-me-maybe "^1.0.1" + js-yaml "^3.13.1" + +"@apidevtools/openapi-schemas@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz#9fa08017fb59d80538812f03fc7cac5992caaa17" + integrity sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ== + +"@apidevtools/swagger-methods@^3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz#b789a362e055b0340d04712eafe7027ddc1ac267" + integrity sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg== + +"@apidevtools/swagger-parser@^10.0.2", "@apidevtools/swagger-parser@^10.1.0": + version "10.1.0" + resolved "https://registry.yarnpkg.com/@apidevtools/swagger-parser/-/swagger-parser-10.1.0.tgz#a987d71e5be61feb623203be0c96e5985b192ab6" + integrity sha512-9Kt7EuS/7WbMAUv2gSziqjvxwDbFSg3Xeyfuj5laUODX8o/k/CpsAKiQ8W7/R88eXFTMbJYg6+7uAmOWNKmwnw== + dependencies: + "@apidevtools/json-schema-ref-parser" "9.0.6" + "@apidevtools/openapi-schemas" "^2.1.0" + "@apidevtools/swagger-methods" "^3.0.2" + "@jsdevtools/ono" "^7.1.3" + ajv "^8.6.3" + ajv-draft-04 "^1.0.0" + call-me-maybe "^1.0.1" + "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.23.5", "@babel/code-frame@^7.24.2", "@babel/code-frame@^7.8.3": version "7.24.2" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.2.tgz#718b4b19841809a58b29b68cde80bc5e1aa6d9ae" @@ -1625,6 +1657,11 @@ resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f" integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== +"@exodus/schemasafe@^1.0.0-rc.2": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@exodus/schemasafe/-/schemasafe-1.3.0.tgz#731656abe21e8e769a7f70a4d833e6312fe59b7f" + integrity sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw== + "@humanwhocodes/config-array@^0.11.14": version "0.11.14" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b" @@ -1948,6 +1985,11 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jsdevtools/ono@^7.1.3": + version "7.1.3" + resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" + integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== + "@leichtgewicht/ip-codec@^2.0.1": version "2.0.5" resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz#4fc56c15c580b9adb7dc3c333a134e540b44bfb1" @@ -2165,6 +2207,19 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz#5d694d345ce36b6ecf657349e03eb87297e68da4" integrity sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g== +"@rtk-query/codegen-openapi@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@rtk-query/codegen-openapi/-/codegen-openapi-1.2.0.tgz#2c63cbbd80382c4ba6c9fab5e9004efb43637de3" + integrity sha512-Sru3aPHyFC0Tb7jeFh/kVMGBdQUcofb9frrHhjNSRLEoJWsG9fjaioUx3nPT5HZVbdAvAFF4xMWFQNfgJBrAGw== + dependencies: + "@apidevtools/swagger-parser" "^10.0.2" + commander "^6.2.0" + oazapfts "^4.8.0" + prettier "^2.2.1" + semver "^7.3.5" + swagger2openapi "^7.0.4" + typescript "^5.0.0" + "@rushstack/eslint-patch@^1.1.0": version "1.10.3" resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.10.3.tgz#391d528054f758f81e53210f1a1eebcf1a8b1d20" @@ -3109,6 +3164,11 @@ agent-base@6: dependencies: debug "4" +ajv-draft-04@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz#3b64761b268ba0b9e668f0b41ba53fce0ad77fc8" + integrity sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw== + ajv-formats@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" @@ -3148,6 +3208,16 @@ ajv@^8.0.0, ajv@^8.6.0, ajv@^8.9.0: require-from-string "^2.0.2" uri-js "^4.4.1" +ajv@^8.6.3: + version "8.15.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.15.0.tgz#d918c661e3e820bbbc65a320e182ee56a1aa978a" + integrity sha512-15BTtQUOsSrmHCy+B4VnAiJAJxJ8IFgu6fcjFQF3jQYZ78nLSQthlFg4ehp+NLIyfvFgOlxNsjKIEhydtFPVHQ== + dependencies: + fast-deep-equal "^3.1.3" + fast-uri "^2.3.0" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + ansi-escapes@^4.2.1, ansi-escapes@^4.3.1: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -3699,6 +3769,11 @@ call-bind@^1.0.2, call-bind@^1.0.5, call-bind@^1.0.6, call-bind@^1.0.7: get-intrinsic "^1.2.4" set-function-length "^1.2.1" +call-me-maybe@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.2.tgz#03f964f19522ba643b1b0693acb9152fe2074baa" + integrity sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ== + callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -3838,6 +3913,15 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -3908,6 +3992,11 @@ commander@^4.0.0: resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== +commander@^6.2.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" + integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA== + commander@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" @@ -4796,6 +4885,11 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" +es6-promise@^3.2.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613" + integrity sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg== + esbuild@^0.20.1: version "0.20.2" resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.20.2.tgz#9d6b2386561766ee6b5a55196c6d766d28c87ea1" @@ -5297,6 +5391,16 @@ fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== +fast-safe-stringify@^2.0.7: + version "2.1.1" + resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" + integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== + +fast-uri@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-2.3.0.tgz#bdae493942483d299e7285dcb4627767d42e2793" + integrity sha512-eel5UKGn369gGEWOqBShmFJWfq/xSJvsgDzgLYC845GneayWvXBf0lJCBn5qTABfewy1ZDPoaR5OZCP+kssfuw== + fastq@^1.6.0: version "1.17.1" resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.17.1.tgz#2a523f07a4e7b1e81a42b91b8bf2254107753b47" @@ -5881,6 +5985,11 @@ http-proxy@^1.18.1: follow-redirects "^1.0.0" requires-port "^1.0.0" +http2-client@^1.2.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/http2-client/-/http2-client-1.3.5.tgz#20c9dc909e3cc98284dd20af2432c524086df181" + integrity sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA== + https-proxy-agent@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" @@ -7362,7 +7471,7 @@ minimatch@^9.0.1, minimatch@^9.0.4: dependencies: brace-expansion "^2.0.1" -minimist@^1.2.0, minimist@^1.2.6: +minimist@^1.2.0, minimist@^1.2.6, minimist@^1.2.8: version "1.2.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== @@ -7444,6 +7553,20 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" +node-fetch-h2@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/node-fetch-h2/-/node-fetch-h2-2.3.0.tgz#c6188325f9bd3d834020bf0f2d6dc17ced2241ac" + integrity sha512-ofRW94Ab0T4AOh5Fk8t0h8OBWrmjb0SSB20xh1H8YnPV9EJ+f5AMoYSUQ2zgJ4Iq2HAK0I2l5/Nequ8YzFS3Hg== + dependencies: + http2-client "^1.2.5" + +node-fetch@^2.6.1: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + node-forge@^1: version "1.3.1" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" @@ -7454,6 +7577,13 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== +node-readfiles@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/node-readfiles/-/node-readfiles-0.2.0.tgz#dbbd4af12134e2e635c245ef93ffcf6f60673a5d" + integrity sha512-SU00ZarexNlE4Rjdm83vglt5Y9yiQ+XI1XpflWlb7q7UTN1JUItm69xMeiQCTxtTfnzt+83T8Cx+vI2ED++VDA== + dependencies: + es6-promise "^3.2.1" + node-releases@^2.0.14: version "2.0.14" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" @@ -7500,6 +7630,63 @@ nwsapi@^2.2.0: resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.10.tgz#0b77a68e21a0b483db70b11fad055906e867cda8" integrity sha512-QK0sRs7MKv0tKe1+5uZIQk/C8XGza4DAnztJG8iD+TpJIORARrCxczA738awHrZoHeTjSSoHqao2teO0dC/gFQ== +oas-kit-common@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/oas-kit-common/-/oas-kit-common-1.0.8.tgz#6d8cacf6e9097967a4c7ea8bcbcbd77018e1f535" + integrity sha512-pJTS2+T0oGIwgjGpw7sIRU8RQMcUoKCDWFLdBqKB2BNmGpbBMH2sdqAaOXUg8OzonZHU0L7vfJu1mJFEiYDWOQ== + dependencies: + fast-safe-stringify "^2.0.7" + +oas-linter@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/oas-linter/-/oas-linter-3.2.2.tgz#ab6a33736313490659035ca6802dc4b35d48aa1e" + integrity sha512-KEGjPDVoU5K6swgo9hJVA/qYGlwfbFx+Kg2QB/kd7rzV5N8N5Mg6PlsoCMohVnQmo+pzJap/F610qTodKzecGQ== + dependencies: + "@exodus/schemasafe" "^1.0.0-rc.2" + should "^13.2.1" + yaml "^1.10.0" + +oas-resolver@^2.5.6: + version "2.5.6" + resolved "https://registry.yarnpkg.com/oas-resolver/-/oas-resolver-2.5.6.tgz#10430569cb7daca56115c915e611ebc5515c561b" + integrity sha512-Yx5PWQNZomfEhPPOphFbZKi9W93CocQj18NlD2Pa4GWZzdZpSJvYwoiuurRI7m3SpcChrnO08hkuQDL3FGsVFQ== + dependencies: + node-fetch-h2 "^2.3.0" + oas-kit-common "^1.0.8" + reftools "^1.1.9" + yaml "^1.10.0" + yargs "^17.0.1" + +oas-schema-walker@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/oas-schema-walker/-/oas-schema-walker-1.1.5.tgz#74c3cd47b70ff8e0b19adada14455b5d3ac38a22" + integrity sha512-2yucenq1a9YPmeNExoUa9Qwrt9RFkjqaMAA1X+U7sbb0AqBeTIdMHky9SQQ6iN94bO5NW0W4TRYXerG+BdAvAQ== + +oas-validator@^5.0.8: + version "5.0.8" + resolved "https://registry.yarnpkg.com/oas-validator/-/oas-validator-5.0.8.tgz#387e90df7cafa2d3ffc83b5fb976052b87e73c28" + integrity sha512-cu20/HE5N5HKqVygs3dt94eYJfBi0TsZvPVXDhbXQHiEityDN+RROTleefoKRKKJ9dFAF2JBkDHgvWj0sjKGmw== + dependencies: + call-me-maybe "^1.0.1" + oas-kit-common "^1.0.8" + oas-linter "^3.2.2" + oas-resolver "^2.5.6" + oas-schema-walker "^1.1.5" + reftools "^1.1.9" + should "^13.2.1" + yaml "^1.10.0" + +oazapfts@^4.8.0: + version "4.12.0" + resolved "https://registry.yarnpkg.com/oazapfts/-/oazapfts-4.12.0.tgz#8a86c5fe5a1237b16b05d06d05815cffa2a2b949" + integrity sha512-hNKRG4eLYceuJuqDDx7Uqsi8p3j5k83gNKSo2qnUOTiiU03sCQOjXxOqCXDbzRcuDFyK94+1PBIpotK4NoxIjw== + dependencies: + "@apidevtools/swagger-parser" "^10.1.0" + lodash "^4.17.21" + minimist "^1.2.8" + swagger2openapi "^7.0.8" + typescript "^5.2.2" + object-assign@^4.0.1, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -8413,7 +8600,7 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^2.0.0: +prettier@^2.0.0, prettier@^2.2.1: version "2.8.8" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== @@ -8845,6 +9032,11 @@ reflect.getprototypeof@^1.0.4: globalthis "^1.0.3" which-builtin-type "^1.1.3" +reftools@^1.1.9: + version "1.1.9" + resolved "https://registry.yarnpkg.com/reftools/-/reftools-1.1.9.tgz#e16e19f662ccd4648605312c06d34e5da3a2b77e" + integrity sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w== + regenerate-unicode-properties@^10.1.0: version "10.1.1" resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.1.tgz#6b0e05489d9076b04c436f318d9b067bba459480" @@ -9301,6 +9493,50 @@ shell-quote@^1.7.3, shell-quote@^1.8.1: resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.8.1.tgz#6dbf4db75515ad5bac63b4f1894c3a154c766680" integrity sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA== +should-equal@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/should-equal/-/should-equal-2.0.0.tgz#6072cf83047360867e68e98b09d71143d04ee0c3" + integrity sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA== + dependencies: + should-type "^1.4.0" + +should-format@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/should-format/-/should-format-3.0.3.tgz#9bfc8f74fa39205c53d38c34d717303e277124f1" + integrity sha512-hZ58adtulAk0gKtua7QxevgUaXTTXxIi8t41L3zo9AHvjXO1/7sdLECuHeIN2SRtYXpNkmhoUP2pdeWgricQ+Q== + dependencies: + should-type "^1.3.0" + should-type-adaptors "^1.0.1" + +should-type-adaptors@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz#401e7f33b5533033944d5cd8bf2b65027792e27a" + integrity sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA== + dependencies: + should-type "^1.3.0" + should-util "^1.0.0" + +should-type@^1.3.0, should-type@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/should-type/-/should-type-1.4.0.tgz#0756d8ce846dfd09843a6947719dfa0d4cff5cf3" + integrity sha512-MdAsTu3n25yDbIe1NeN69G4n6mUnJGtSJHygX3+oN0ZbO3DTiATnf7XnYJdGT42JCXurTb1JI0qOBR65shvhPQ== + +should-util@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/should-util/-/should-util-1.0.1.tgz#fb0d71338f532a3a149213639e2d32cbea8bcb28" + integrity sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g== + +should@^13.2.1: + version "13.2.3" + resolved "https://registry.yarnpkg.com/should/-/should-13.2.3.tgz#96d8e5acf3e97b49d89b51feaa5ae8d07ef58f10" + integrity sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ== + dependencies: + should-equal "^2.0.0" + should-format "^3.0.3" + should-type "^1.4.0" + should-type-adaptors "^1.0.1" + should-util "^1.0.0" + side-channel@^1.0.4, side-channel@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" @@ -9484,7 +9720,7 @@ string-natural-compare@^3.0.1: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -9714,6 +9950,23 @@ svgo@^2.7.0: picocolors "^1.0.0" stable "^0.1.8" +swagger2openapi@^7.0.4, swagger2openapi@^7.0.8: + version "7.0.8" + resolved "https://registry.yarnpkg.com/swagger2openapi/-/swagger2openapi-7.0.8.tgz#12c88d5de776cb1cbba758994930f40ad0afac59" + integrity sha512-upi/0ZGkYgEcLeGieoz8gT74oWHA0E7JivX7aN9mAf+Tc7BQoRBvnIGHoPDw+f9TXTW4s6kGYCZJtauP6OYp7g== + dependencies: + call-me-maybe "^1.0.1" + node-fetch "^2.6.1" + node-fetch-h2 "^2.3.0" + node-readfiles "^0.2.0" + oas-kit-common "^1.0.8" + oas-resolver "^2.5.6" + oas-schema-walker "^1.1.5" + oas-validator "^5.0.8" + reftools "^1.1.9" + yaml "^1.10.0" + yargs "^17.0.1" + symbol-tree@^3.2.4: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" @@ -9885,6 +10138,11 @@ tr46@^2.1.0: dependencies: punycode "^2.1.1" +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + tryer@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.1.tgz#f2c85406800b9b0f74c9f7465b81eaad241252f8" @@ -10020,7 +10278,7 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@^5.2.2: +typescript@^5.0.0, typescript@^5.2.2: version "5.4.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== @@ -10251,6 +10509,11 @@ web-vitals@^2.1.4: resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-2.1.4.tgz#76563175a475a5e835264d373704f9dde718290c" integrity sha512-sVWcwhU5mX6crfI5Vd2dC4qchyTqxV8URinzt25XqVh+bHEPGH4C3NPrNionCP7Obx59wrYEbNlw4Z8sjALzZg== +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" @@ -10403,6 +10666,14 @@ whatwg-mimetype@^2.3.0: resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + whatwg-url@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" @@ -10737,6 +11008,11 @@ yargs-parser@^20.2.2: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== +yargs-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== + yargs@^16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" @@ -10750,6 +11026,19 @@ yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" +yargs@^17.0.1: + version "17.7.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" + integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== + dependencies: + cliui "^8.0.1" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.1.1" + yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"