diff --git a/api-docs/openapi/v3_0/linksV1alpha1Api.json b/api-docs/openapi/v3_0/linksV1alpha1Api.json new file mode 100644 index 0000000..4c97b45 --- /dev/null +++ b/api-docs/openapi/v3_0/linksV1alpha1Api.json @@ -0,0 +1,950 @@ +{ + "openapi" : "3.0.1", + "info" : { + "title" : "Halo", + "version" : "2.17.2" + }, + "servers" : [ { + "url" : "http://localhost:31788", + "description" : "Generated server url" + } ], + "security" : [ { + "basicAuth" : [ ], + "bearerAuth" : [ ] + } ], + "paths" : { + "/apis/api.plugin.halo.run/v1alpha1/plugins/PluginLinks/link-detail" : { + "get" : { + "description" : "Get link detail by id", + "operationId" : "GetLinkDetail", + "parameters" : [ { + "description" : "Link url", + "in" : "query", + "name" : "url", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "default" : { + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/LinkDetailDTO" + } + } + }, + "description" : "default response" + } + }, + "tags" : [ "api.plugin.halo.run/v1alpha1/Link" ] + } + }, + "/apis/api.plugin.halo.run/v1alpha1/plugins/PluginLinks/links" : { + "get" : { + "description" : "Lists link by query parameters", + "operationId" : "listLinks", + "parameters" : [ { + "description" : "Keyword to search links under the group", + "in" : "query", + "name" : "keyword", + "schema" : { + "type" : "string" + } + }, { + "description" : "Link group name", + "in" : "query", + "name" : "groupName", + "schema" : { + "type" : "string" + } + }, { + "description" : "Page number. Default is 0.", + "in" : "query", + "name" : "page", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "description" : "Size number. Default is 0.", + "in" : "query", + "name" : "size", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "description" : "Label selector. e.g.: hidden!=true", + "in" : "query", + "name" : "labelSelector", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "description" : "Field selector. e.g.: metadata.name==halo", + "in" : "query", + "name" : "fieldSelector", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "description" : "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "in" : "query", + "name" : "sort", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "default" : { + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/LinkList" + } + } + }, + "description" : "default response" + } + }, + "tags" : [ "api.plugin.halo.run/v1alpha1/Link" ] + } + }, + "/apis/core.halo.run/v1alpha1/linkgroups" : { + "get" : { + "description" : "List LinkGroup", + "operationId" : "listLinkGroup", + "parameters" : [ { + "description" : "Page number. Default is 0.", + "in" : "query", + "name" : "page", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "description" : "Size number. Default is 0.", + "in" : "query", + "name" : "size", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "description" : "Label selector. e.g.: hidden!=true", + "in" : "query", + "name" : "labelSelector", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "description" : "Field selector. e.g.: metadata.name==halo", + "in" : "query", + "name" : "fieldSelector", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "description" : "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "in" : "query", + "name" : "sort", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "200" : { + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/LinkGroupList" + } + } + }, + "description" : "Response linkgroups" + } + }, + "tags" : [ "LinkGroupV1alpha1" ] + }, + "post" : { + "description" : "Create LinkGroup", + "operationId" : "createLinkGroup", + "requestBody" : { + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/LinkGroup" + } + } + }, + "description" : "Fresh linkgroup" + }, + "responses" : { + "200" : { + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/LinkGroup" + } + } + }, + "description" : "Response linkgroups created just now" + } + }, + "tags" : [ "LinkGroupV1alpha1" ] + } + }, + "/apis/core.halo.run/v1alpha1/linkgroups/{name}" : { + "delete" : { + "description" : "Delete LinkGroup", + "operationId" : "deleteLinkGroup", + "parameters" : [ { + "description" : "Name of linkgroup", + "in" : "path", + "name" : "name", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Response linkgroup deleted just now" + } + }, + "tags" : [ "LinkGroupV1alpha1" ] + }, + "get" : { + "description" : "Get LinkGroup", + "operationId" : "getLinkGroup", + "parameters" : [ { + "description" : "Name of linkgroup", + "in" : "path", + "name" : "name", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/LinkGroup" + } + } + }, + "description" : "Response single linkgroup" + } + }, + "tags" : [ "LinkGroupV1alpha1" ] + }, + "patch" : { + "description" : "Patch LinkGroup", + "operationId" : "patchLinkGroup", + "parameters" : [ { + "description" : "Name of linkgroup", + "in" : "path", + "name" : "name", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "content" : { + "application/json-patch+json" : { + "schema" : { + "$ref" : "#/components/schemas/JsonPatch" + } + } + } + }, + "responses" : { + "200" : { + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/LinkGroup" + } + } + }, + "description" : "Response linkgroup patched just now" + } + }, + "tags" : [ "LinkGroupV1alpha1" ] + }, + "put" : { + "description" : "Update LinkGroup", + "operationId" : "updateLinkGroup", + "parameters" : [ { + "description" : "Name of linkgroup", + "in" : "path", + "name" : "name", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/LinkGroup" + } + } + }, + "description" : "Updated linkgroup" + }, + "responses" : { + "200" : { + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/LinkGroup" + } + } + }, + "description" : "Response linkgroups updated just now" + } + }, + "tags" : [ "LinkGroupV1alpha1" ] + } + }, + "/apis/core.halo.run/v1alpha1/links" : { + "get" : { + "description" : "List Link", + "operationId" : "listLink", + "parameters" : [ { + "description" : "Page number. Default is 0.", + "in" : "query", + "name" : "page", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "description" : "Size number. Default is 0.", + "in" : "query", + "name" : "size", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "description" : "Label selector. e.g.: hidden!=true", + "in" : "query", + "name" : "labelSelector", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "description" : "Field selector. e.g.: metadata.name==halo", + "in" : "query", + "name" : "fieldSelector", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "description" : "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.", + "in" : "query", + "name" : "sort", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "200" : { + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/LinkList" + } + } + }, + "description" : "Response links" + } + }, + "tags" : [ "LinkV1alpha1" ] + }, + "post" : { + "description" : "Create Link", + "operationId" : "createLink", + "requestBody" : { + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Link" + } + } + }, + "description" : "Fresh link" + }, + "responses" : { + "200" : { + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Link" + } + } + }, + "description" : "Response links created just now" + } + }, + "tags" : [ "LinkV1alpha1" ] + } + }, + "/apis/core.halo.run/v1alpha1/links/{name}" : { + "delete" : { + "description" : "Delete Link", + "operationId" : "deleteLink", + "parameters" : [ { + "description" : "Name of link", + "in" : "path", + "name" : "name", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "Response link deleted just now" + } + }, + "tags" : [ "LinkV1alpha1" ] + }, + "get" : { + "description" : "Get Link", + "operationId" : "getLink", + "parameters" : [ { + "description" : "Name of link", + "in" : "path", + "name" : "name", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Link" + } + } + }, + "description" : "Response single link" + } + }, + "tags" : [ "LinkV1alpha1" ] + }, + "patch" : { + "description" : "Patch Link", + "operationId" : "patchLink", + "parameters" : [ { + "description" : "Name of link", + "in" : "path", + "name" : "name", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "content" : { + "application/json-patch+json" : { + "schema" : { + "$ref" : "#/components/schemas/JsonPatch" + } + } + } + }, + "responses" : { + "200" : { + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Link" + } + } + }, + "description" : "Response link patched just now" + } + }, + "tags" : [ "LinkV1alpha1" ] + }, + "put" : { + "description" : "Update Link", + "operationId" : "updateLink", + "parameters" : [ { + "description" : "Name of link", + "in" : "path", + "name" : "name", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Link" + } + } + }, + "description" : "Updated link" + }, + "responses" : { + "200" : { + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Link" + } + } + }, + "description" : "Response links updated just now" + } + }, + "tags" : [ "LinkV1alpha1" ] + } + } + }, + "components" : { + "schemas" : { + "AddOperation" : { + "required" : [ "op", "path", "value" ], + "type" : "object", + "properties" : { + "op" : { + "type" : "string", + "enum" : [ "add" ] + }, + "path" : { + "pattern" : "^(/[^/~]*(~[01][^/~]*)*)*$", + "type" : "string", + "description" : "A JSON Pointer path pointing to the location to move/copy from.", + "example" : "/a/b/c" + }, + "value" : { + "description" : "Value can be any JSON value" + } + } + }, + "CopyOperation" : { + "required" : [ "op", "from", "path" ], + "type" : "object", + "properties" : { + "from" : { + "pattern" : "^(/[^/~]*(~[01][^/~]*)*)*$", + "type" : "string", + "description" : "A JSON Pointer path pointing to the location to move/copy from.", + "example" : "/a/b/c" + }, + "op" : { + "type" : "string", + "enum" : [ "copy" ] + }, + "path" : { + "pattern" : "^(/[^/~]*(~[01][^/~]*)*)*$", + "type" : "string", + "description" : "A JSON Pointer path pointing to the location to move/copy from.", + "example" : "/a/b/c" + } + } + }, + "JsonPatch" : { + "minItems" : 1, + "uniqueItems" : true, + "type" : "array", + "description" : "JSON schema for JSONPatch operations", + "items" : { + "oneOf" : [ { + "$ref" : "#/components/schemas/AddOperation" + }, { + "$ref" : "#/components/schemas/ReplaceOperation" + }, { + "$ref" : "#/components/schemas/TestOperation" + }, { + "$ref" : "#/components/schemas/RemoveOperation" + }, { + "$ref" : "#/components/schemas/MoveOperation" + }, { + "$ref" : "#/components/schemas/CopyOperation" + } ] + } + }, + "Link" : { + "required" : [ "apiVersion", "kind", "metadata" ], + "type" : "object", + "properties" : { + "apiVersion" : { + "type" : "string" + }, + "kind" : { + "type" : "string" + }, + "metadata" : { + "$ref" : "#/components/schemas/Metadata" + }, + "spec" : { + "$ref" : "#/components/schemas/LinkSpec" + } + } + }, + "LinkDetailDTO" : { + "required" : [ "title" ], + "type" : "object", + "properties" : { + "description" : { + "type" : "string" + }, + "icon" : { + "type" : "string" + }, + "image" : { + "type" : "string" + }, + "title" : { + "type" : "string" + } + } + }, + "LinkGroup" : { + "required" : [ "apiVersion", "kind", "metadata" ], + "type" : "object", + "properties" : { + "apiVersion" : { + "type" : "string" + }, + "kind" : { + "type" : "string" + }, + "metadata" : { + "$ref" : "#/components/schemas/Metadata" + }, + "spec" : { + "$ref" : "#/components/schemas/LinkGroupSpec" + } + } + }, + "LinkGroupList" : { + "required" : [ "first", "hasNext", "hasPrevious", "items", "last", "page", "size", "total", "totalPages" ], + "type" : "object", + "properties" : { + "first" : { + "type" : "boolean", + "description" : "Indicates whether current page is the first page." + }, + "hasNext" : { + "type" : "boolean", + "description" : "Indicates whether current page has previous page." + }, + "hasPrevious" : { + "type" : "boolean", + "description" : "Indicates whether current page has previous page." + }, + "items" : { + "type" : "array", + "description" : "A chunk of items.", + "items" : { + "$ref" : "#/components/schemas/LinkGroup" + } + }, + "last" : { + "type" : "boolean", + "description" : "Indicates whether current page is the last page." + }, + "page" : { + "type" : "integer", + "description" : "Page number, starts from 1. If not set or equal to 0, it means no pagination.", + "format" : "int32" + }, + "size" : { + "type" : "integer", + "description" : "Size of each page. If not set or equal to 0, it means no pagination.", + "format" : "int32" + }, + "total" : { + "type" : "integer", + "description" : "Total elements.", + "format" : "int64" + }, + "totalPages" : { + "type" : "integer", + "description" : "Indicates total pages.", + "format" : "int64" + } + } + }, + "LinkGroupSpec" : { + "required" : [ "displayName" ], + "type" : "object", + "properties" : { + "displayName" : { + "type" : "string" + }, + "links" : { + "type" : "array", + "description" : "Names of links below this group.", + "deprecated" : true, + "items" : { + "type" : "string", + "description" : "Names of links below this group.", + "deprecated" : true + } + }, + "priority" : { + "type" : "integer", + "format" : "int32" + } + } + }, + "LinkList" : { + "required" : [ "first", "hasNext", "hasPrevious", "items", "last", "page", "size", "total", "totalPages" ], + "type" : "object", + "properties" : { + "first" : { + "type" : "boolean", + "description" : "Indicates whether current page is the first page." + }, + "hasNext" : { + "type" : "boolean", + "description" : "Indicates whether current page has previous page." + }, + "hasPrevious" : { + "type" : "boolean", + "description" : "Indicates whether current page has previous page." + }, + "items" : { + "type" : "array", + "description" : "A chunk of items.", + "items" : { + "$ref" : "#/components/schemas/Link" + } + }, + "last" : { + "type" : "boolean", + "description" : "Indicates whether current page is the last page." + }, + "page" : { + "type" : "integer", + "description" : "Page number, starts from 1. If not set or equal to 0, it means no pagination.", + "format" : "int32" + }, + "size" : { + "type" : "integer", + "description" : "Size of each page. If not set or equal to 0, it means no pagination.", + "format" : "int32" + }, + "total" : { + "type" : "integer", + "description" : "Total elements.", + "format" : "int64" + }, + "totalPages" : { + "type" : "integer", + "description" : "Indicates total pages.", + "format" : "int64" + } + } + }, + "LinkSpec" : { + "required" : [ "displayName", "url" ], + "type" : "object", + "properties" : { + "description" : { + "type" : "string" + }, + "displayName" : { + "type" : "string" + }, + "groupName" : { + "type" : "string" + }, + "logo" : { + "type" : "string" + }, + "priority" : { + "type" : "integer", + "format" : "int32" + }, + "url" : { + "type" : "string" + } + } + }, + "Metadata" : { + "required" : [ "name" ], + "type" : "object", + "properties" : { + "annotations" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "creationTimestamp" : { + "type" : "string", + "format" : "date-time", + "nullable" : true + }, + "deletionTimestamp" : { + "type" : "string", + "format" : "date-time", + "nullable" : true + }, + "finalizers" : { + "uniqueItems" : true, + "type" : "array", + "nullable" : true, + "items" : { + "type" : "string", + "nullable" : true + } + }, + "generateName" : { + "type" : "string", + "description" : "The name field will be generated automatically according to the given generateName field" + }, + "labels" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "name" : { + "type" : "string", + "description" : "Metadata name" + }, + "version" : { + "type" : "integer", + "format" : "int64", + "nullable" : true + } + } + }, + "MoveOperation" : { + "required" : [ "op", "from", "path" ], + "type" : "object", + "properties" : { + "from" : { + "pattern" : "^(/[^/~]*(~[01][^/~]*)*)*$", + "type" : "string", + "description" : "A JSON Pointer path pointing to the location to move/copy from.", + "example" : "/a/b/c" + }, + "op" : { + "type" : "string", + "enum" : [ "move" ] + }, + "path" : { + "pattern" : "^(/[^/~]*(~[01][^/~]*)*)*$", + "type" : "string", + "description" : "A JSON Pointer path pointing to the location to move/copy from.", + "example" : "/a/b/c" + } + } + }, + "RemoveOperation" : { + "required" : [ "op", "path" ], + "type" : "object", + "properties" : { + "op" : { + "type" : "string", + "enum" : [ "remove" ] + }, + "path" : { + "pattern" : "^(/[^/~]*(~[01][^/~]*)*)*$", + "type" : "string", + "description" : "A JSON Pointer path pointing to the location to move/copy from.", + "example" : "/a/b/c" + } + } + }, + "ReplaceOperation" : { + "required" : [ "op", "path", "value" ], + "type" : "object", + "properties" : { + "op" : { + "type" : "string", + "enum" : [ "replace" ] + }, + "path" : { + "pattern" : "^(/[^/~]*(~[01][^/~]*)*)*$", + "type" : "string", + "description" : "A JSON Pointer path pointing to the location to move/copy from.", + "example" : "/a/b/c" + }, + "value" : { + "description" : "Value can be any JSON value" + } + } + }, + "TestOperation" : { + "required" : [ "op", "path", "value" ], + "type" : "object", + "properties" : { + "op" : { + "type" : "string", + "enum" : [ "test" ] + }, + "path" : { + "pattern" : "^(/[^/~]*(~[01][^/~]*)*)*$", + "type" : "string", + "description" : "A JSON Pointer path pointing to the location to move/copy from.", + "example" : "/a/b/c" + }, + "value" : { + "description" : "Value can be any JSON value" + } + } + } + }, + "securitySchemes" : { + "basicAuth" : { + "scheme" : "basic", + "type" : "http" + }, + "bearerAuth" : { + "bearerFormat" : "JWT", + "scheme" : "bearer", + "type" : "http" + } + } + } +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 566d43f..6aed44d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id "com.github.node-gradle.node" version "7.0.2" - id "run.halo.plugin.devtools" version "0.0.9" + id "run.halo.plugin.devtools" version "0.1.1" id "io.freefair.lombok" version "8.0.1" id 'java' } @@ -54,3 +54,25 @@ halo { version = '2.17' debug = true } + +haloPlugin { + openApi { + outputDir = file("$rootDir/api-docs/openapi/v3_0") + groupingRules { + linksV1alpha1Api { + displayName = 'Extension API for Links' + pathsToMatch = [ + '/apis/core.halo.run/v1alpha1/links/**', + '/apis/core.halo.run/v1alpha1/linkgroups/**', + '/apis/api.plugin.halo.run/v1alpha1/plugins/PluginLinks/**' + ] + } + } + groupedApiMappings = [ + '/v3/api-docs/linksV1alpha1Api': 'linksV1alpha1Api.json' + ] + generator { + outputDir = file("${projectDir}/console/src/api/generated") + } + } +} diff --git a/console/src/api/generated/.gitignore b/console/src/api/generated/.gitignore new file mode 100644 index 0000000..149b576 --- /dev/null +++ b/console/src/api/generated/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/console/src/api/generated/.npmignore b/console/src/api/generated/.npmignore new file mode 100644 index 0000000..999d88d --- /dev/null +++ b/console/src/api/generated/.npmignore @@ -0,0 +1 @@ +# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm \ No newline at end of file diff --git a/console/src/api/generated/.openapi-generator-ignore b/console/src/api/generated/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/console/src/api/generated/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/console/src/api/generated/.openapi-generator/FILES b/console/src/api/generated/.openapi-generator/FILES new file mode 100644 index 0000000..2c9e075 --- /dev/null +++ b/console/src/api/generated/.openapi-generator/FILES @@ -0,0 +1,28 @@ +.gitignore +.npmignore +.openapi-generator-ignore +api.ts +api/api-plugin-halo-run-v1alpha1-link-api.ts +api/link-group-v1alpha1-api.ts +api/link-v1alpha1-api.ts +base.ts +common.ts +configuration.ts +git_push.sh +index.ts +models/add-operation.ts +models/copy-operation.ts +models/index.ts +models/json-patch-inner.ts +models/link-detail-dto.ts +models/link-group-list.ts +models/link-group-spec.ts +models/link-group.ts +models/link-list.ts +models/link-spec.ts +models/link.ts +models/metadata.ts +models/move-operation.ts +models/remove-operation.ts +models/replace-operation.ts +models/test-operation.ts diff --git a/console/src/api/generated/.openapi-generator/VERSION b/console/src/api/generated/.openapi-generator/VERSION new file mode 100644 index 0000000..1985849 --- /dev/null +++ b/console/src/api/generated/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.7.0 diff --git a/console/src/api/generated/api.ts b/console/src/api/generated/api.ts new file mode 100644 index 0000000..a7cd4bf --- /dev/null +++ b/console/src/api/generated/api.ts @@ -0,0 +1,20 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +export * from './api/api-plugin-halo-run-v1alpha1-link-api'; +export * from './api/link-group-v1alpha1-api'; +export * from './api/link-v1alpha1-api'; + diff --git a/console/src/api/generated/api/api-plugin-halo-run-v1alpha1-link-api.ts b/console/src/api/generated/api/api-plugin-halo-run-v1alpha1-link-api.ts new file mode 100644 index 0000000..04f6ed3 --- /dev/null +++ b/console/src/api/generated/api/api-plugin-halo-run-v1alpha1-link-api.ts @@ -0,0 +1,320 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { LinkDetailDTO } from '../models'; +// @ts-ignore +import type { LinkList } from '../models'; +/** + * ApiPluginHaloRunV1alpha1LinkApi - axios parameter creator + * @export + */ +export const ApiPluginHaloRunV1alpha1LinkApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Get link detail by id + * @param {string} url Link url + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getLinkDetail: async (url: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'url' is not null or undefined + assertParamExists('getLinkDetail', 'url', url) + const localVarPath = `/apis/api.plugin.halo.run/v1alpha1/plugins/PluginLinks/link-detail`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (url !== undefined) { + localVarQueryParameter['url'] = url; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Lists link by query parameters + * @param {string} [keyword] Keyword to search links under the group + * @param {string} [groupName] Link group name + * @param {number} [page] Page number. Default is 0. + * @param {number} [size] Size number. Default is 0. + * @param {Array} [labelSelector] Label selector. e.g.: hidden!=true + * @param {Array} [fieldSelector] Field selector. e.g.: metadata.name==halo + * @param {Array} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listLinks: async (keyword?: string, groupName?: string, page?: number, size?: number, labelSelector?: Array, fieldSelector?: Array, sort?: Array, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/apis/api.plugin.halo.run/v1alpha1/plugins/PluginLinks/links`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (keyword !== undefined) { + localVarQueryParameter['keyword'] = keyword; + } + + if (groupName !== undefined) { + localVarQueryParameter['groupName'] = groupName; + } + + if (page !== undefined) { + localVarQueryParameter['page'] = page; + } + + if (size !== undefined) { + localVarQueryParameter['size'] = size; + } + + if (labelSelector) { + localVarQueryParameter['labelSelector'] = labelSelector; + } + + if (fieldSelector) { + localVarQueryParameter['fieldSelector'] = fieldSelector; + } + + if (sort) { + localVarQueryParameter['sort'] = sort; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * ApiPluginHaloRunV1alpha1LinkApi - functional programming interface + * @export + */ +export const ApiPluginHaloRunV1alpha1LinkApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ApiPluginHaloRunV1alpha1LinkApiAxiosParamCreator(configuration) + return { + /** + * Get link detail by id + * @param {string} url Link url + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getLinkDetail(url: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getLinkDetail(url, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ApiPluginHaloRunV1alpha1LinkApi.getLinkDetail']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Lists link by query parameters + * @param {string} [keyword] Keyword to search links under the group + * @param {string} [groupName] Link group name + * @param {number} [page] Page number. Default is 0. + * @param {number} [size] Size number. Default is 0. + * @param {Array} [labelSelector] Label selector. e.g.: hidden!=true + * @param {Array} [fieldSelector] Field selector. e.g.: metadata.name==halo + * @param {Array} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listLinks(keyword?: string, groupName?: string, page?: number, size?: number, labelSelector?: Array, fieldSelector?: Array, sort?: Array, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listLinks(keyword, groupName, page, size, labelSelector, fieldSelector, sort, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ApiPluginHaloRunV1alpha1LinkApi.listLinks']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * ApiPluginHaloRunV1alpha1LinkApi - factory interface + * @export + */ +export const ApiPluginHaloRunV1alpha1LinkApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ApiPluginHaloRunV1alpha1LinkApiFp(configuration) + return { + /** + * Get link detail by id + * @param {ApiPluginHaloRunV1alpha1LinkApiGetLinkDetailRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getLinkDetail(requestParameters: ApiPluginHaloRunV1alpha1LinkApiGetLinkDetailRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getLinkDetail(requestParameters.url, options).then((request) => request(axios, basePath)); + }, + /** + * Lists link by query parameters + * @param {ApiPluginHaloRunV1alpha1LinkApiListLinksRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listLinks(requestParameters: ApiPluginHaloRunV1alpha1LinkApiListLinksRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.listLinks(requestParameters.keyword, requestParameters.groupName, requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for getLinkDetail operation in ApiPluginHaloRunV1alpha1LinkApi. + * @export + * @interface ApiPluginHaloRunV1alpha1LinkApiGetLinkDetailRequest + */ +export interface ApiPluginHaloRunV1alpha1LinkApiGetLinkDetailRequest { + /** + * Link url + * @type {string} + * @memberof ApiPluginHaloRunV1alpha1LinkApiGetLinkDetail + */ + readonly url: string +} + +/** + * Request parameters for listLinks operation in ApiPluginHaloRunV1alpha1LinkApi. + * @export + * @interface ApiPluginHaloRunV1alpha1LinkApiListLinksRequest + */ +export interface ApiPluginHaloRunV1alpha1LinkApiListLinksRequest { + /** + * Keyword to search links under the group + * @type {string} + * @memberof ApiPluginHaloRunV1alpha1LinkApiListLinks + */ + readonly keyword?: string + + /** + * Link group name + * @type {string} + * @memberof ApiPluginHaloRunV1alpha1LinkApiListLinks + */ + readonly groupName?: string + + /** + * Page number. Default is 0. + * @type {number} + * @memberof ApiPluginHaloRunV1alpha1LinkApiListLinks + */ + readonly page?: number + + /** + * Size number. Default is 0. + * @type {number} + * @memberof ApiPluginHaloRunV1alpha1LinkApiListLinks + */ + readonly size?: number + + /** + * Label selector. e.g.: hidden!=true + * @type {Array} + * @memberof ApiPluginHaloRunV1alpha1LinkApiListLinks + */ + readonly labelSelector?: Array + + /** + * Field selector. e.g.: metadata.name==halo + * @type {Array} + * @memberof ApiPluginHaloRunV1alpha1LinkApiListLinks + */ + readonly fieldSelector?: Array + + /** + * Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + * @type {Array} + * @memberof ApiPluginHaloRunV1alpha1LinkApiListLinks + */ + readonly sort?: Array +} + +/** + * ApiPluginHaloRunV1alpha1LinkApi - object-oriented interface + * @export + * @class ApiPluginHaloRunV1alpha1LinkApi + * @extends {BaseAPI} + */ +export class ApiPluginHaloRunV1alpha1LinkApi extends BaseAPI { + /** + * Get link detail by id + * @param {ApiPluginHaloRunV1alpha1LinkApiGetLinkDetailRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiPluginHaloRunV1alpha1LinkApi + */ + public getLinkDetail(requestParameters: ApiPluginHaloRunV1alpha1LinkApiGetLinkDetailRequest, options?: RawAxiosRequestConfig) { + return ApiPluginHaloRunV1alpha1LinkApiFp(this.configuration).getLinkDetail(requestParameters.url, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Lists link by query parameters + * @param {ApiPluginHaloRunV1alpha1LinkApiListLinksRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiPluginHaloRunV1alpha1LinkApi + */ + public listLinks(requestParameters: ApiPluginHaloRunV1alpha1LinkApiListLinksRequest = {}, options?: RawAxiosRequestConfig) { + return ApiPluginHaloRunV1alpha1LinkApiFp(this.configuration).listLinks(requestParameters.keyword, requestParameters.groupName, requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(this.axios, this.basePath)); + } +} + diff --git a/console/src/api/generated/api/link-group-v1alpha1-api.ts b/console/src/api/generated/api/link-group-v1alpha1-api.ts new file mode 100644 index 0000000..5653b58 --- /dev/null +++ b/console/src/api/generated/api/link-group-v1alpha1-api.ts @@ -0,0 +1,665 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { JsonPatchInner } from '../models'; +// @ts-ignore +import type { LinkGroup } from '../models'; +// @ts-ignore +import type { LinkGroupList } from '../models'; +/** + * LinkGroupV1alpha1Api - axios parameter creator + * @export + */ +export const LinkGroupV1alpha1ApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Create LinkGroup + * @param {LinkGroup} [linkGroup] Fresh linkgroup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createLinkGroup: async (linkGroup?: LinkGroup, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/apis/core.halo.run/v1alpha1/linkgroups`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(linkGroup, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Delete LinkGroup + * @param {string} name Name of linkgroup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteLinkGroup: async (name: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('deleteLinkGroup', 'name', name) + const localVarPath = `/apis/core.halo.run/v1alpha1/linkgroups/{name}` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get LinkGroup + * @param {string} name Name of linkgroup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getLinkGroup: async (name: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('getLinkGroup', 'name', name) + const localVarPath = `/apis/core.halo.run/v1alpha1/linkgroups/{name}` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * List LinkGroup + * @param {number} [page] Page number. Default is 0. + * @param {number} [size] Size number. Default is 0. + * @param {Array} [labelSelector] Label selector. e.g.: hidden!=true + * @param {Array} [fieldSelector] Field selector. e.g.: metadata.name==halo + * @param {Array} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listLinkGroup: async (page?: number, size?: number, labelSelector?: Array, fieldSelector?: Array, sort?: Array, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/apis/core.halo.run/v1alpha1/linkgroups`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (page !== undefined) { + localVarQueryParameter['page'] = page; + } + + if (size !== undefined) { + localVarQueryParameter['size'] = size; + } + + if (labelSelector) { + localVarQueryParameter['labelSelector'] = labelSelector; + } + + if (fieldSelector) { + localVarQueryParameter['fieldSelector'] = fieldSelector; + } + + if (sort) { + localVarQueryParameter['sort'] = sort; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Patch LinkGroup + * @param {string} name Name of linkgroup + * @param {Array} [jsonPatchInner] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchLinkGroup: async (name: string, jsonPatchInner?: Array, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('patchLinkGroup', 'name', name) + const localVarPath = `/apis/core.halo.run/v1alpha1/linkgroups/{name}` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(jsonPatchInner, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Update LinkGroup + * @param {string} name Name of linkgroup + * @param {LinkGroup} [linkGroup] Updated linkgroup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateLinkGroup: async (name: string, linkGroup?: LinkGroup, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('updateLinkGroup', 'name', name) + const localVarPath = `/apis/core.halo.run/v1alpha1/linkgroups/{name}` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(linkGroup, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * LinkGroupV1alpha1Api - functional programming interface + * @export + */ +export const LinkGroupV1alpha1ApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = LinkGroupV1alpha1ApiAxiosParamCreator(configuration) + return { + /** + * Create LinkGroup + * @param {LinkGroup} [linkGroup] Fresh linkgroup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createLinkGroup(linkGroup?: LinkGroup, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createLinkGroup(linkGroup, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LinkGroupV1alpha1Api.createLinkGroup']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Delete LinkGroup + * @param {string} name Name of linkgroup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteLinkGroup(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteLinkGroup(name, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LinkGroupV1alpha1Api.deleteLinkGroup']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Get LinkGroup + * @param {string} name Name of linkgroup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getLinkGroup(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getLinkGroup(name, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LinkGroupV1alpha1Api.getLinkGroup']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * List LinkGroup + * @param {number} [page] Page number. Default is 0. + * @param {number} [size] Size number. Default is 0. + * @param {Array} [labelSelector] Label selector. e.g.: hidden!=true + * @param {Array} [fieldSelector] Field selector. e.g.: metadata.name==halo + * @param {Array} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listLinkGroup(page?: number, size?: number, labelSelector?: Array, fieldSelector?: Array, sort?: Array, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listLinkGroup(page, size, labelSelector, fieldSelector, sort, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LinkGroupV1alpha1Api.listLinkGroup']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Patch LinkGroup + * @param {string} name Name of linkgroup + * @param {Array} [jsonPatchInner] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async patchLinkGroup(name: string, jsonPatchInner?: Array, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.patchLinkGroup(name, jsonPatchInner, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LinkGroupV1alpha1Api.patchLinkGroup']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Update LinkGroup + * @param {string} name Name of linkgroup + * @param {LinkGroup} [linkGroup] Updated linkgroup + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateLinkGroup(name: string, linkGroup?: LinkGroup, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateLinkGroup(name, linkGroup, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LinkGroupV1alpha1Api.updateLinkGroup']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * LinkGroupV1alpha1Api - factory interface + * @export + */ +export const LinkGroupV1alpha1ApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = LinkGroupV1alpha1ApiFp(configuration) + return { + /** + * Create LinkGroup + * @param {LinkGroupV1alpha1ApiCreateLinkGroupRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createLinkGroup(requestParameters: LinkGroupV1alpha1ApiCreateLinkGroupRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createLinkGroup(requestParameters.linkGroup, options).then((request) => request(axios, basePath)); + }, + /** + * Delete LinkGroup + * @param {LinkGroupV1alpha1ApiDeleteLinkGroupRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteLinkGroup(requestParameters: LinkGroupV1alpha1ApiDeleteLinkGroupRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteLinkGroup(requestParameters.name, options).then((request) => request(axios, basePath)); + }, + /** + * Get LinkGroup + * @param {LinkGroupV1alpha1ApiGetLinkGroupRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getLinkGroup(requestParameters: LinkGroupV1alpha1ApiGetLinkGroupRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getLinkGroup(requestParameters.name, options).then((request) => request(axios, basePath)); + }, + /** + * List LinkGroup + * @param {LinkGroupV1alpha1ApiListLinkGroupRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listLinkGroup(requestParameters: LinkGroupV1alpha1ApiListLinkGroupRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.listLinkGroup(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(axios, basePath)); + }, + /** + * Patch LinkGroup + * @param {LinkGroupV1alpha1ApiPatchLinkGroupRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchLinkGroup(requestParameters: LinkGroupV1alpha1ApiPatchLinkGroupRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.patchLinkGroup(requestParameters.name, requestParameters.jsonPatchInner, options).then((request) => request(axios, basePath)); + }, + /** + * Update LinkGroup + * @param {LinkGroupV1alpha1ApiUpdateLinkGroupRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateLinkGroup(requestParameters: LinkGroupV1alpha1ApiUpdateLinkGroupRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateLinkGroup(requestParameters.name, requestParameters.linkGroup, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for createLinkGroup operation in LinkGroupV1alpha1Api. + * @export + * @interface LinkGroupV1alpha1ApiCreateLinkGroupRequest + */ +export interface LinkGroupV1alpha1ApiCreateLinkGroupRequest { + /** + * Fresh linkgroup + * @type {LinkGroup} + * @memberof LinkGroupV1alpha1ApiCreateLinkGroup + */ + readonly linkGroup?: LinkGroup +} + +/** + * Request parameters for deleteLinkGroup operation in LinkGroupV1alpha1Api. + * @export + * @interface LinkGroupV1alpha1ApiDeleteLinkGroupRequest + */ +export interface LinkGroupV1alpha1ApiDeleteLinkGroupRequest { + /** + * Name of linkgroup + * @type {string} + * @memberof LinkGroupV1alpha1ApiDeleteLinkGroup + */ + readonly name: string +} + +/** + * Request parameters for getLinkGroup operation in LinkGroupV1alpha1Api. + * @export + * @interface LinkGroupV1alpha1ApiGetLinkGroupRequest + */ +export interface LinkGroupV1alpha1ApiGetLinkGroupRequest { + /** + * Name of linkgroup + * @type {string} + * @memberof LinkGroupV1alpha1ApiGetLinkGroup + */ + readonly name: string +} + +/** + * Request parameters for listLinkGroup operation in LinkGroupV1alpha1Api. + * @export + * @interface LinkGroupV1alpha1ApiListLinkGroupRequest + */ +export interface LinkGroupV1alpha1ApiListLinkGroupRequest { + /** + * Page number. Default is 0. + * @type {number} + * @memberof LinkGroupV1alpha1ApiListLinkGroup + */ + readonly page?: number + + /** + * Size number. Default is 0. + * @type {number} + * @memberof LinkGroupV1alpha1ApiListLinkGroup + */ + readonly size?: number + + /** + * Label selector. e.g.: hidden!=true + * @type {Array} + * @memberof LinkGroupV1alpha1ApiListLinkGroup + */ + readonly labelSelector?: Array + + /** + * Field selector. e.g.: metadata.name==halo + * @type {Array} + * @memberof LinkGroupV1alpha1ApiListLinkGroup + */ + readonly fieldSelector?: Array + + /** + * Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + * @type {Array} + * @memberof LinkGroupV1alpha1ApiListLinkGroup + */ + readonly sort?: Array +} + +/** + * Request parameters for patchLinkGroup operation in LinkGroupV1alpha1Api. + * @export + * @interface LinkGroupV1alpha1ApiPatchLinkGroupRequest + */ +export interface LinkGroupV1alpha1ApiPatchLinkGroupRequest { + /** + * Name of linkgroup + * @type {string} + * @memberof LinkGroupV1alpha1ApiPatchLinkGroup + */ + readonly name: string + + /** + * + * @type {Array} + * @memberof LinkGroupV1alpha1ApiPatchLinkGroup + */ + readonly jsonPatchInner?: Array +} + +/** + * Request parameters for updateLinkGroup operation in LinkGroupV1alpha1Api. + * @export + * @interface LinkGroupV1alpha1ApiUpdateLinkGroupRequest + */ +export interface LinkGroupV1alpha1ApiUpdateLinkGroupRequest { + /** + * Name of linkgroup + * @type {string} + * @memberof LinkGroupV1alpha1ApiUpdateLinkGroup + */ + readonly name: string + + /** + * Updated linkgroup + * @type {LinkGroup} + * @memberof LinkGroupV1alpha1ApiUpdateLinkGroup + */ + readonly linkGroup?: LinkGroup +} + +/** + * LinkGroupV1alpha1Api - object-oriented interface + * @export + * @class LinkGroupV1alpha1Api + * @extends {BaseAPI} + */ +export class LinkGroupV1alpha1Api extends BaseAPI { + /** + * Create LinkGroup + * @param {LinkGroupV1alpha1ApiCreateLinkGroupRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LinkGroupV1alpha1Api + */ + public createLinkGroup(requestParameters: LinkGroupV1alpha1ApiCreateLinkGroupRequest = {}, options?: RawAxiosRequestConfig) { + return LinkGroupV1alpha1ApiFp(this.configuration).createLinkGroup(requestParameters.linkGroup, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Delete LinkGroup + * @param {LinkGroupV1alpha1ApiDeleteLinkGroupRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LinkGroupV1alpha1Api + */ + public deleteLinkGroup(requestParameters: LinkGroupV1alpha1ApiDeleteLinkGroupRequest, options?: RawAxiosRequestConfig) { + return LinkGroupV1alpha1ApiFp(this.configuration).deleteLinkGroup(requestParameters.name, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Get LinkGroup + * @param {LinkGroupV1alpha1ApiGetLinkGroupRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LinkGroupV1alpha1Api + */ + public getLinkGroup(requestParameters: LinkGroupV1alpha1ApiGetLinkGroupRequest, options?: RawAxiosRequestConfig) { + return LinkGroupV1alpha1ApiFp(this.configuration).getLinkGroup(requestParameters.name, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * List LinkGroup + * @param {LinkGroupV1alpha1ApiListLinkGroupRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LinkGroupV1alpha1Api + */ + public listLinkGroup(requestParameters: LinkGroupV1alpha1ApiListLinkGroupRequest = {}, options?: RawAxiosRequestConfig) { + return LinkGroupV1alpha1ApiFp(this.configuration).listLinkGroup(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Patch LinkGroup + * @param {LinkGroupV1alpha1ApiPatchLinkGroupRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LinkGroupV1alpha1Api + */ + public patchLinkGroup(requestParameters: LinkGroupV1alpha1ApiPatchLinkGroupRequest, options?: RawAxiosRequestConfig) { + return LinkGroupV1alpha1ApiFp(this.configuration).patchLinkGroup(requestParameters.name, requestParameters.jsonPatchInner, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Update LinkGroup + * @param {LinkGroupV1alpha1ApiUpdateLinkGroupRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LinkGroupV1alpha1Api + */ + public updateLinkGroup(requestParameters: LinkGroupV1alpha1ApiUpdateLinkGroupRequest, options?: RawAxiosRequestConfig) { + return LinkGroupV1alpha1ApiFp(this.configuration).updateLinkGroup(requestParameters.name, requestParameters.linkGroup, options).then((request) => request(this.axios, this.basePath)); + } +} + diff --git a/console/src/api/generated/api/link-v1alpha1-api.ts b/console/src/api/generated/api/link-v1alpha1-api.ts new file mode 100644 index 0000000..0437c06 --- /dev/null +++ b/console/src/api/generated/api/link-v1alpha1-api.ts @@ -0,0 +1,665 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from '../configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; +// @ts-ignore +import type { JsonPatchInner } from '../models'; +// @ts-ignore +import type { Link } from '../models'; +// @ts-ignore +import type { LinkList } from '../models'; +/** + * LinkV1alpha1Api - axios parameter creator + * @export + */ +export const LinkV1alpha1ApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Create Link + * @param {Link} [link] Fresh link + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createLink: async (link?: Link, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/apis/core.halo.run/v1alpha1/links`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(link, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Delete Link + * @param {string} name Name of link + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteLink: async (name: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('deleteLink', 'name', name) + const localVarPath = `/apis/core.halo.run/v1alpha1/links/{name}` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get Link + * @param {string} name Name of link + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getLink: async (name: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('getLink', 'name', name) + const localVarPath = `/apis/core.halo.run/v1alpha1/links/{name}` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * List Link + * @param {number} [page] Page number. Default is 0. + * @param {number} [size] Size number. Default is 0. + * @param {Array} [labelSelector] Label selector. e.g.: hidden!=true + * @param {Array} [fieldSelector] Field selector. e.g.: metadata.name==halo + * @param {Array} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listLink: async (page?: number, size?: number, labelSelector?: Array, fieldSelector?: Array, sort?: Array, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/apis/core.halo.run/v1alpha1/links`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (page !== undefined) { + localVarQueryParameter['page'] = page; + } + + if (size !== undefined) { + localVarQueryParameter['size'] = size; + } + + if (labelSelector) { + localVarQueryParameter['labelSelector'] = labelSelector; + } + + if (fieldSelector) { + localVarQueryParameter['fieldSelector'] = fieldSelector; + } + + if (sort) { + localVarQueryParameter['sort'] = sort; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Patch Link + * @param {string} name Name of link + * @param {Array} [jsonPatchInner] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchLink: async (name: string, jsonPatchInner?: Array, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('patchLink', 'name', name) + const localVarPath = `/apis/core.halo.run/v1alpha1/links/{name}` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(jsonPatchInner, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Update Link + * @param {string} name Name of link + * @param {Link} [link] Updated link + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateLink: async (name: string, link?: Link, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('updateLink', 'name', name) + const localVarPath = `/apis/core.halo.run/v1alpha1/links/{name}` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication basicAuth required + // http basic authentication required + setBasicAuthToObject(localVarRequestOptions, configuration) + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(link, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * LinkV1alpha1Api - functional programming interface + * @export + */ +export const LinkV1alpha1ApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = LinkV1alpha1ApiAxiosParamCreator(configuration) + return { + /** + * Create Link + * @param {Link} [link] Fresh link + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createLink(link?: Link, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createLink(link, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LinkV1alpha1Api.createLink']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Delete Link + * @param {string} name Name of link + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteLink(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteLink(name, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LinkV1alpha1Api.deleteLink']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Get Link + * @param {string} name Name of link + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getLink(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getLink(name, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LinkV1alpha1Api.getLink']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * List Link + * @param {number} [page] Page number. Default is 0. + * @param {number} [size] Size number. Default is 0. + * @param {Array} [labelSelector] Label selector. e.g.: hidden!=true + * @param {Array} [fieldSelector] Field selector. e.g.: metadata.name==halo + * @param {Array} [sort] Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listLink(page?: number, size?: number, labelSelector?: Array, fieldSelector?: Array, sort?: Array, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listLink(page, size, labelSelector, fieldSelector, sort, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LinkV1alpha1Api.listLink']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Patch Link + * @param {string} name Name of link + * @param {Array} [jsonPatchInner] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async patchLink(name: string, jsonPatchInner?: Array, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.patchLink(name, jsonPatchInner, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LinkV1alpha1Api.patchLink']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Update Link + * @param {string} name Name of link + * @param {Link} [link] Updated link + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateLink(name: string, link?: Link, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateLink(name, link, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LinkV1alpha1Api.updateLink']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * LinkV1alpha1Api - factory interface + * @export + */ +export const LinkV1alpha1ApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = LinkV1alpha1ApiFp(configuration) + return { + /** + * Create Link + * @param {LinkV1alpha1ApiCreateLinkRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createLink(requestParameters: LinkV1alpha1ApiCreateLinkRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createLink(requestParameters.link, options).then((request) => request(axios, basePath)); + }, + /** + * Delete Link + * @param {LinkV1alpha1ApiDeleteLinkRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteLink(requestParameters: LinkV1alpha1ApiDeleteLinkRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteLink(requestParameters.name, options).then((request) => request(axios, basePath)); + }, + /** + * Get Link + * @param {LinkV1alpha1ApiGetLinkRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getLink(requestParameters: LinkV1alpha1ApiGetLinkRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getLink(requestParameters.name, options).then((request) => request(axios, basePath)); + }, + /** + * List Link + * @param {LinkV1alpha1ApiListLinkRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listLink(requestParameters: LinkV1alpha1ApiListLinkRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.listLink(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(axios, basePath)); + }, + /** + * Patch Link + * @param {LinkV1alpha1ApiPatchLinkRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchLink(requestParameters: LinkV1alpha1ApiPatchLinkRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.patchLink(requestParameters.name, requestParameters.jsonPatchInner, options).then((request) => request(axios, basePath)); + }, + /** + * Update Link + * @param {LinkV1alpha1ApiUpdateLinkRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateLink(requestParameters: LinkV1alpha1ApiUpdateLinkRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateLink(requestParameters.name, requestParameters.link, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for createLink operation in LinkV1alpha1Api. + * @export + * @interface LinkV1alpha1ApiCreateLinkRequest + */ +export interface LinkV1alpha1ApiCreateLinkRequest { + /** + * Fresh link + * @type {Link} + * @memberof LinkV1alpha1ApiCreateLink + */ + readonly link?: Link +} + +/** + * Request parameters for deleteLink operation in LinkV1alpha1Api. + * @export + * @interface LinkV1alpha1ApiDeleteLinkRequest + */ +export interface LinkV1alpha1ApiDeleteLinkRequest { + /** + * Name of link + * @type {string} + * @memberof LinkV1alpha1ApiDeleteLink + */ + readonly name: string +} + +/** + * Request parameters for getLink operation in LinkV1alpha1Api. + * @export + * @interface LinkV1alpha1ApiGetLinkRequest + */ +export interface LinkV1alpha1ApiGetLinkRequest { + /** + * Name of link + * @type {string} + * @memberof LinkV1alpha1ApiGetLink + */ + readonly name: string +} + +/** + * Request parameters for listLink operation in LinkV1alpha1Api. + * @export + * @interface LinkV1alpha1ApiListLinkRequest + */ +export interface LinkV1alpha1ApiListLinkRequest { + /** + * Page number. Default is 0. + * @type {number} + * @memberof LinkV1alpha1ApiListLink + */ + readonly page?: number + + /** + * Size number. Default is 0. + * @type {number} + * @memberof LinkV1alpha1ApiListLink + */ + readonly size?: number + + /** + * Label selector. e.g.: hidden!=true + * @type {Array} + * @memberof LinkV1alpha1ApiListLink + */ + readonly labelSelector?: Array + + /** + * Field selector. e.g.: metadata.name==halo + * @type {Array} + * @memberof LinkV1alpha1ApiListLink + */ + readonly fieldSelector?: Array + + /** + * Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. + * @type {Array} + * @memberof LinkV1alpha1ApiListLink + */ + readonly sort?: Array +} + +/** + * Request parameters for patchLink operation in LinkV1alpha1Api. + * @export + * @interface LinkV1alpha1ApiPatchLinkRequest + */ +export interface LinkV1alpha1ApiPatchLinkRequest { + /** + * Name of link + * @type {string} + * @memberof LinkV1alpha1ApiPatchLink + */ + readonly name: string + + /** + * + * @type {Array} + * @memberof LinkV1alpha1ApiPatchLink + */ + readonly jsonPatchInner?: Array +} + +/** + * Request parameters for updateLink operation in LinkV1alpha1Api. + * @export + * @interface LinkV1alpha1ApiUpdateLinkRequest + */ +export interface LinkV1alpha1ApiUpdateLinkRequest { + /** + * Name of link + * @type {string} + * @memberof LinkV1alpha1ApiUpdateLink + */ + readonly name: string + + /** + * Updated link + * @type {Link} + * @memberof LinkV1alpha1ApiUpdateLink + */ + readonly link?: Link +} + +/** + * LinkV1alpha1Api - object-oriented interface + * @export + * @class LinkV1alpha1Api + * @extends {BaseAPI} + */ +export class LinkV1alpha1Api extends BaseAPI { + /** + * Create Link + * @param {LinkV1alpha1ApiCreateLinkRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LinkV1alpha1Api + */ + public createLink(requestParameters: LinkV1alpha1ApiCreateLinkRequest = {}, options?: RawAxiosRequestConfig) { + return LinkV1alpha1ApiFp(this.configuration).createLink(requestParameters.link, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Delete Link + * @param {LinkV1alpha1ApiDeleteLinkRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LinkV1alpha1Api + */ + public deleteLink(requestParameters: LinkV1alpha1ApiDeleteLinkRequest, options?: RawAxiosRequestConfig) { + return LinkV1alpha1ApiFp(this.configuration).deleteLink(requestParameters.name, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Get Link + * @param {LinkV1alpha1ApiGetLinkRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LinkV1alpha1Api + */ + public getLink(requestParameters: LinkV1alpha1ApiGetLinkRequest, options?: RawAxiosRequestConfig) { + return LinkV1alpha1ApiFp(this.configuration).getLink(requestParameters.name, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * List Link + * @param {LinkV1alpha1ApiListLinkRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LinkV1alpha1Api + */ + public listLink(requestParameters: LinkV1alpha1ApiListLinkRequest = {}, options?: RawAxiosRequestConfig) { + return LinkV1alpha1ApiFp(this.configuration).listLink(requestParameters.page, requestParameters.size, requestParameters.labelSelector, requestParameters.fieldSelector, requestParameters.sort, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Patch Link + * @param {LinkV1alpha1ApiPatchLinkRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LinkV1alpha1Api + */ + public patchLink(requestParameters: LinkV1alpha1ApiPatchLinkRequest, options?: RawAxiosRequestConfig) { + return LinkV1alpha1ApiFp(this.configuration).patchLink(requestParameters.name, requestParameters.jsonPatchInner, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Update Link + * @param {LinkV1alpha1ApiUpdateLinkRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LinkV1alpha1Api + */ + public updateLink(requestParameters: LinkV1alpha1ApiUpdateLinkRequest, options?: RawAxiosRequestConfig) { + return LinkV1alpha1ApiFp(this.configuration).updateLink(requestParameters.name, requestParameters.link, options).then((request) => request(this.axios, this.basePath)); + } +} + diff --git a/console/src/api/generated/base.ts b/console/src/api/generated/base.ts new file mode 100644 index 0000000..0ba415c --- /dev/null +++ b/console/src/api/generated/base.ts @@ -0,0 +1,86 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from './configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; + +export const BASE_PATH = "http://localhost:31788".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: RawAxiosRequestConfig; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath ?? basePath; + } + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + constructor(public field: string, msg?: string) { + super(msg); + this.name = "RequiredError" + } +} + +interface ServerMap { + [key: string]: { + url: string, + description: string, + }[]; +} + +/** + * + * @export + */ +export const operationServerMap: ServerMap = { +} diff --git a/console/src/api/generated/common.ts b/console/src/api/generated/common.ts new file mode 100644 index 0000000..c8c2b8b --- /dev/null +++ b/console/src/api/generated/common.ts @@ -0,0 +1,150 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/console/src/api/generated/configuration.ts b/console/src/api/generated/configuration.ts new file mode 100644 index 0000000..6583231 --- /dev/null +++ b/console/src/api/generated/configuration.ts @@ -0,0 +1,110 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface ConfigurationParameters { + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + serverIndex?: number; + baseOptions?: any; + formDataCtor?: new () => any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.serverIndex = param.serverIndex; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } +} diff --git a/console/src/api/generated/git_push.sh b/console/src/api/generated/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/console/src/api/generated/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/console/src/api/generated/index.ts b/console/src/api/generated/index.ts new file mode 100644 index 0000000..13dd235 --- /dev/null +++ b/console/src/api/generated/index.ts @@ -0,0 +1,18 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export * from "./api"; +export * from "./configuration"; +export * from "./models"; diff --git a/console/src/api/generated/models/add-operation.ts b/console/src/api/generated/models/add-operation.ts new file mode 100644 index 0000000..6b3bef2 --- /dev/null +++ b/console/src/api/generated/models/add-operation.ts @@ -0,0 +1,49 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface AddOperation + */ +export interface AddOperation { + /** + * + * @type {string} + * @memberof AddOperation + */ + 'op': AddOperationOpEnum; + /** + * A JSON Pointer path pointing to the location to move/copy from. + * @type {string} + * @memberof AddOperation + */ + 'path': string; + /** + * Value can be any JSON value + * @type {any} + * @memberof AddOperation + */ + 'value': any; +} + +export const AddOperationOpEnum = { + Add: 'add' +} as const; + +export type AddOperationOpEnum = typeof AddOperationOpEnum[keyof typeof AddOperationOpEnum]; + + diff --git a/console/src/api/generated/models/copy-operation.ts b/console/src/api/generated/models/copy-operation.ts new file mode 100644 index 0000000..d9a7630 --- /dev/null +++ b/console/src/api/generated/models/copy-operation.ts @@ -0,0 +1,49 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface CopyOperation + */ +export interface CopyOperation { + /** + * A JSON Pointer path pointing to the location to move/copy from. + * @type {string} + * @memberof CopyOperation + */ + 'from': string; + /** + * + * @type {string} + * @memberof CopyOperation + */ + 'op': CopyOperationOpEnum; + /** + * A JSON Pointer path pointing to the location to move/copy from. + * @type {string} + * @memberof CopyOperation + */ + 'path': string; +} + +export const CopyOperationOpEnum = { + Copy: 'copy' +} as const; + +export type CopyOperationOpEnum = typeof CopyOperationOpEnum[keyof typeof CopyOperationOpEnum]; + + diff --git a/console/src/api/generated/models/index.ts b/console/src/api/generated/models/index.ts new file mode 100644 index 0000000..cec14b6 --- /dev/null +++ b/console/src/api/generated/models/index.ts @@ -0,0 +1,15 @@ +export * from './add-operation'; +export * from './copy-operation'; +export * from './json-patch-inner'; +export * from './link'; +export * from './link-detail-dto'; +export * from './link-group'; +export * from './link-group-list'; +export * from './link-group-spec'; +export * from './link-list'; +export * from './link-spec'; +export * from './metadata'; +export * from './move-operation'; +export * from './remove-operation'; +export * from './replace-operation'; +export * from './test-operation'; diff --git a/console/src/api/generated/models/json-patch-inner.ts b/console/src/api/generated/models/json-patch-inner.ts new file mode 100644 index 0000000..96e5596 --- /dev/null +++ b/console/src/api/generated/models/json-patch-inner.ts @@ -0,0 +1,41 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { AddOperation } from './add-operation'; +// May contain unused imports in some cases +// @ts-ignore +import type { CopyOperation } from './copy-operation'; +// May contain unused imports in some cases +// @ts-ignore +import type { MoveOperation } from './move-operation'; +// May contain unused imports in some cases +// @ts-ignore +import type { RemoveOperation } from './remove-operation'; +// May contain unused imports in some cases +// @ts-ignore +import type { ReplaceOperation } from './replace-operation'; +// May contain unused imports in some cases +// @ts-ignore +import type { TestOperation } from './test-operation'; + +/** + * @type JsonPatchInner + * @export + */ +export type JsonPatchInner = AddOperation | CopyOperation | MoveOperation | RemoveOperation | ReplaceOperation | TestOperation; + + diff --git a/console/src/api/generated/models/link-detail-dto.ts b/console/src/api/generated/models/link-detail-dto.ts new file mode 100644 index 0000000..04dcb62 --- /dev/null +++ b/console/src/api/generated/models/link-detail-dto.ts @@ -0,0 +1,48 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface LinkDetailDTO + */ +export interface LinkDetailDTO { + /** + * + * @type {string} + * @memberof LinkDetailDTO + */ + 'description'?: string; + /** + * + * @type {string} + * @memberof LinkDetailDTO + */ + 'icon'?: string; + /** + * + * @type {string} + * @memberof LinkDetailDTO + */ + 'image'?: string; + /** + * + * @type {string} + * @memberof LinkDetailDTO + */ + 'title': string; +} + diff --git a/console/src/api/generated/models/link-group-list.ts b/console/src/api/generated/models/link-group-list.ts new file mode 100644 index 0000000..6ce8d3f --- /dev/null +++ b/console/src/api/generated/models/link-group-list.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { LinkGroup } from './link-group'; + +/** + * + * @export + * @interface LinkGroupList + */ +export interface LinkGroupList { + /** + * Indicates whether current page is the first page. + * @type {boolean} + * @memberof LinkGroupList + */ + 'first': boolean; + /** + * Indicates whether current page has previous page. + * @type {boolean} + * @memberof LinkGroupList + */ + 'hasNext': boolean; + /** + * Indicates whether current page has previous page. + * @type {boolean} + * @memberof LinkGroupList + */ + 'hasPrevious': boolean; + /** + * A chunk of items. + * @type {Array} + * @memberof LinkGroupList + */ + 'items': Array; + /** + * Indicates whether current page is the last page. + * @type {boolean} + * @memberof LinkGroupList + */ + 'last': boolean; + /** + * Page number, starts from 1. If not set or equal to 0, it means no pagination. + * @type {number} + * @memberof LinkGroupList + */ + 'page': number; + /** + * Size of each page. If not set or equal to 0, it means no pagination. + * @type {number} + * @memberof LinkGroupList + */ + 'size': number; + /** + * Total elements. + * @type {number} + * @memberof LinkGroupList + */ + 'total': number; + /** + * Indicates total pages. + * @type {number} + * @memberof LinkGroupList + */ + 'totalPages': number; +} + diff --git a/console/src/api/generated/models/link-group-spec.ts b/console/src/api/generated/models/link-group-spec.ts new file mode 100644 index 0000000..cfe55e4 --- /dev/null +++ b/console/src/api/generated/models/link-group-spec.ts @@ -0,0 +1,43 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface LinkGroupSpec + */ +export interface LinkGroupSpec { + /** + * + * @type {string} + * @memberof LinkGroupSpec + */ + 'displayName': string; + /** + * Names of links below this group. + * @type {Array} + * @memberof LinkGroupSpec + * @deprecated + */ + 'links'?: Array; + /** + * + * @type {number} + * @memberof LinkGroupSpec + */ + 'priority'?: number; +} + diff --git a/console/src/api/generated/models/link-group.ts b/console/src/api/generated/models/link-group.ts new file mode 100644 index 0000000..ee74933 --- /dev/null +++ b/console/src/api/generated/models/link-group.ts @@ -0,0 +1,54 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { LinkGroupSpec } from './link-group-spec'; +// May contain unused imports in some cases +// @ts-ignore +import type { Metadata } from './metadata'; + +/** + * + * @export + * @interface LinkGroup + */ +export interface LinkGroup { + /** + * + * @type {string} + * @memberof LinkGroup + */ + 'apiVersion': string; + /** + * + * @type {string} + * @memberof LinkGroup + */ + 'kind': string; + /** + * + * @type {Metadata} + * @memberof LinkGroup + */ + 'metadata': Metadata; + /** + * + * @type {LinkGroupSpec} + * @memberof LinkGroup + */ + 'spec'?: LinkGroupSpec; +} + diff --git a/console/src/api/generated/models/link-list.ts b/console/src/api/generated/models/link-list.ts new file mode 100644 index 0000000..298e460 --- /dev/null +++ b/console/src/api/generated/models/link-list.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { Link } from './link'; + +/** + * + * @export + * @interface LinkList + */ +export interface LinkList { + /** + * Indicates whether current page is the first page. + * @type {boolean} + * @memberof LinkList + */ + 'first': boolean; + /** + * Indicates whether current page has previous page. + * @type {boolean} + * @memberof LinkList + */ + 'hasNext': boolean; + /** + * Indicates whether current page has previous page. + * @type {boolean} + * @memberof LinkList + */ + 'hasPrevious': boolean; + /** + * A chunk of items. + * @type {Array} + * @memberof LinkList + */ + 'items': Array; + /** + * Indicates whether current page is the last page. + * @type {boolean} + * @memberof LinkList + */ + 'last': boolean; + /** + * Page number, starts from 1. If not set or equal to 0, it means no pagination. + * @type {number} + * @memberof LinkList + */ + 'page': number; + /** + * Size of each page. If not set or equal to 0, it means no pagination. + * @type {number} + * @memberof LinkList + */ + 'size': number; + /** + * Total elements. + * @type {number} + * @memberof LinkList + */ + 'total': number; + /** + * Indicates total pages. + * @type {number} + * @memberof LinkList + */ + 'totalPages': number; +} + diff --git a/console/src/api/generated/models/link-spec.ts b/console/src/api/generated/models/link-spec.ts new file mode 100644 index 0000000..4ff40a6 --- /dev/null +++ b/console/src/api/generated/models/link-spec.ts @@ -0,0 +1,60 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface LinkSpec + */ +export interface LinkSpec { + /** + * + * @type {string} + * @memberof LinkSpec + */ + 'description'?: string; + /** + * + * @type {string} + * @memberof LinkSpec + */ + 'displayName': string; + /** + * + * @type {string} + * @memberof LinkSpec + */ + 'groupName'?: string; + /** + * + * @type {string} + * @memberof LinkSpec + */ + 'logo'?: string; + /** + * + * @type {number} + * @memberof LinkSpec + */ + 'priority'?: number; + /** + * + * @type {string} + * @memberof LinkSpec + */ + 'url': string; +} + diff --git a/console/src/api/generated/models/link.ts b/console/src/api/generated/models/link.ts new file mode 100644 index 0000000..0518969 --- /dev/null +++ b/console/src/api/generated/models/link.ts @@ -0,0 +1,54 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import type { LinkSpec } from './link-spec'; +// May contain unused imports in some cases +// @ts-ignore +import type { Metadata } from './metadata'; + +/** + * + * @export + * @interface Link + */ +export interface Link { + /** + * + * @type {string} + * @memberof Link + */ + 'apiVersion': string; + /** + * + * @type {string} + * @memberof Link + */ + 'kind': string; + /** + * + * @type {Metadata} + * @memberof Link + */ + 'metadata': Metadata; + /** + * + * @type {LinkSpec} + * @memberof Link + */ + 'spec'?: LinkSpec; +} + diff --git a/console/src/api/generated/models/metadata.ts b/console/src/api/generated/models/metadata.ts new file mode 100644 index 0000000..a5f12c7 --- /dev/null +++ b/console/src/api/generated/models/metadata.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface Metadata + */ +export interface Metadata { + /** + * + * @type {{ [key: string]: string; }} + * @memberof Metadata + */ + 'annotations'?: { [key: string]: string; }; + /** + * + * @type {string} + * @memberof Metadata + */ + 'creationTimestamp'?: string | null; + /** + * + * @type {string} + * @memberof Metadata + */ + 'deletionTimestamp'?: string | null; + /** + * + * @type {Array} + * @memberof Metadata + */ + 'finalizers'?: Array | null; + /** + * The name field will be generated automatically according to the given generateName field + * @type {string} + * @memberof Metadata + */ + 'generateName'?: string; + /** + * + * @type {{ [key: string]: string; }} + * @memberof Metadata + */ + 'labels'?: { [key: string]: string; }; + /** + * Metadata name + * @type {string} + * @memberof Metadata + */ + 'name': string; + /** + * + * @type {number} + * @memberof Metadata + */ + 'version'?: number | null; +} + diff --git a/console/src/api/generated/models/move-operation.ts b/console/src/api/generated/models/move-operation.ts new file mode 100644 index 0000000..1cb9a0b --- /dev/null +++ b/console/src/api/generated/models/move-operation.ts @@ -0,0 +1,49 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface MoveOperation + */ +export interface MoveOperation { + /** + * A JSON Pointer path pointing to the location to move/copy from. + * @type {string} + * @memberof MoveOperation + */ + 'from': string; + /** + * + * @type {string} + * @memberof MoveOperation + */ + 'op': MoveOperationOpEnum; + /** + * A JSON Pointer path pointing to the location to move/copy from. + * @type {string} + * @memberof MoveOperation + */ + 'path': string; +} + +export const MoveOperationOpEnum = { + Move: 'move' +} as const; + +export type MoveOperationOpEnum = typeof MoveOperationOpEnum[keyof typeof MoveOperationOpEnum]; + + diff --git a/console/src/api/generated/models/remove-operation.ts b/console/src/api/generated/models/remove-operation.ts new file mode 100644 index 0000000..434ae8d --- /dev/null +++ b/console/src/api/generated/models/remove-operation.ts @@ -0,0 +1,43 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface RemoveOperation + */ +export interface RemoveOperation { + /** + * + * @type {string} + * @memberof RemoveOperation + */ + 'op': RemoveOperationOpEnum; + /** + * A JSON Pointer path pointing to the location to move/copy from. + * @type {string} + * @memberof RemoveOperation + */ + 'path': string; +} + +export const RemoveOperationOpEnum = { + Remove: 'remove' +} as const; + +export type RemoveOperationOpEnum = typeof RemoveOperationOpEnum[keyof typeof RemoveOperationOpEnum]; + + diff --git a/console/src/api/generated/models/replace-operation.ts b/console/src/api/generated/models/replace-operation.ts new file mode 100644 index 0000000..626dd59 --- /dev/null +++ b/console/src/api/generated/models/replace-operation.ts @@ -0,0 +1,49 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface ReplaceOperation + */ +export interface ReplaceOperation { + /** + * + * @type {string} + * @memberof ReplaceOperation + */ + 'op': ReplaceOperationOpEnum; + /** + * A JSON Pointer path pointing to the location to move/copy from. + * @type {string} + * @memberof ReplaceOperation + */ + 'path': string; + /** + * Value can be any JSON value + * @type {any} + * @memberof ReplaceOperation + */ + 'value': any; +} + +export const ReplaceOperationOpEnum = { + Replace: 'replace' +} as const; + +export type ReplaceOperationOpEnum = typeof ReplaceOperationOpEnum[keyof typeof ReplaceOperationOpEnum]; + + diff --git a/console/src/api/generated/models/test-operation.ts b/console/src/api/generated/models/test-operation.ts new file mode 100644 index 0000000..81d3971 --- /dev/null +++ b/console/src/api/generated/models/test-operation.ts @@ -0,0 +1,49 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Halo + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 2.17.2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @interface TestOperation + */ +export interface TestOperation { + /** + * + * @type {string} + * @memberof TestOperation + */ + 'op': TestOperationOpEnum; + /** + * A JSON Pointer path pointing to the location to move/copy from. + * @type {string} + * @memberof TestOperation + */ + 'path': string; + /** + * Value can be any JSON value + * @type {any} + * @memberof TestOperation + */ + 'value': any; +} + +export const TestOperationOpEnum = { + Test: 'test' +} as const; + +export type TestOperationOpEnum = typeof TestOperationOpEnum[keyof typeof TestOperationOpEnum]; + + diff --git a/console/src/api/index.ts b/console/src/api/index.ts new file mode 100644 index 0000000..388c896 --- /dev/null +++ b/console/src/api/index.ts @@ -0,0 +1,13 @@ +import { axiosInstance } from "@halo-dev/api-client"; +import { ApiPluginHaloRunV1alpha1LinkApi, LinkGroupV1alpha1Api, LinkV1alpha1Api } from "./generated"; + +const linksCoreApiClient = { + link: new LinkV1alpha1Api(undefined, "", axiosInstance), + group: new LinkGroupV1alpha1Api(undefined, "", axiosInstance), +}; + +const linksConsoleApiClient = { + link: new ApiPluginHaloRunV1alpha1LinkApi(undefined, "", axiosInstance), +}; + +export { linksConsoleApiClient, linksCoreApiClient }; diff --git a/console/src/components/GroupEditingModal.vue b/console/src/components/GroupEditingModal.vue index 1611464..3395ef2 100644 --- a/console/src/components/GroupEditingModal.vue +++ b/console/src/components/GroupEditingModal.vue @@ -1,6 +1,6 @@