From 5f1de58d0ded8bb6a2c96736e37c45f3d6eccfeb Mon Sep 17 00:00:00 2001 From: Yang Yang Date: Fri, 27 Dec 2024 17:14:05 +0800 Subject: [PATCH] feat: add pagination for kusion server entities (#4) --- api/openapispec/docs.go | 1114 ++++++++++++++++++++++++++++++++-- api/openapispec/swagger.json | 1114 ++++++++++++++++++++++++++++++++-- api/openapispec/swagger.yaml | 628 +++++++++++++++++-- package.json | 4 +- src/client/schemas.gen.ts | 283 ++++++++- src/client/sdk.gen.ts | 10 +- src/client/types.gen.ts | 433 +++++++++++-- 7 files changed, 3331 insertions(+), 255 deletions(-) diff --git a/api/openapispec/docs.go b/api/openapispec/docs.go index 2c96038..86bb756 100644 --- a/api/openapispec/docs.go +++ b/api/openapispec/docs.go @@ -26,11 +26,37 @@ const docTemplate = `{ ], "summary": "List backends", "operationId": "listBackend", + "parameters": [ + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" + } + ], "responses": { "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Backend" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.PaginatedBackendResponse" + } + } + } + ] } }, "400": { @@ -83,7 +109,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Backend" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Backend" + } + } + } + ] } }, "400": { @@ -133,7 +171,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Backend" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Backend" + } + } + } + ] } }, "400": { @@ -193,7 +243,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Backend" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Backend" + } + } + } + ] } }, "400": { @@ -241,7 +303,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -290,16 +364,37 @@ const docTemplate = `{ "description": "Module name to filter module list by. Default to all modules.", "name": "moduleName", "in": "query" + }, + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" } ], "responses": { "200": { "description": "Success", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.Module" - } + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.PaginatedModuleResponse" + } + } + } + ] } }, "400": { @@ -352,7 +447,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Module" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Module" + } + } + } + ] } }, "400": { @@ -402,7 +509,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Module" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Module" + } + } + } + ] } }, "400": { @@ -462,7 +581,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Module" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Module" + } + } + } + ] } }, "400": { @@ -510,7 +641,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -547,14 +690,37 @@ const docTemplate = `{ ], "summary": "List organizations", "operationId": "listOrganization", + "parameters": [ + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" + } + ], "responses": { "200": { "description": "Success", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.Organization" - } + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.PaginatedOrganizationResponse" + } + } + } + ] } }, "400": { @@ -607,7 +773,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Organization" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Organization" + } + } + } + ] } }, "400": { @@ -657,7 +835,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Organization" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Organization" + } + } + } + ] } }, "400": { @@ -717,7 +907,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Organization" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Organization" + } + } + } + ] } }, "400": { @@ -765,7 +967,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -814,16 +1028,40 @@ const docTemplate = `{ "description": "Project name to filter project list by. This should only return one result if set.", "name": "name", "in": "query" + }, + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" } ], "responses": { "200": { "description": "Success", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.Project" - } + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/response.PaginatedProjectResponse" + } + } + } + } + ] } }, "400": { @@ -876,7 +1114,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Project" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Project" + } + } + } + ] } }, "400": { @@ -926,7 +1176,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Project" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Project" + } + } + } + ] } }, "400": { @@ -986,7 +1248,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Project" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Project" + } + } + } + ] } }, "400": { @@ -1034,7 +1308,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -1071,11 +1357,40 @@ const docTemplate = `{ ], "summary": "List resource", "operationId": "listResource", + "parameters": [ + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" + } + ], "responses": { "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Resource" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/response.PaginatedResourceResponse" + } + } + } + } + ] } }, "400": { @@ -1125,7 +1440,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.ResourceGraph" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.ResourceGraph" + } + } + } + ] } }, "400": { @@ -1175,7 +1502,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Resource" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Resource" + } + } + } + ] } }, "400": { @@ -1263,6 +1602,18 @@ const docTemplate = `{ "name": "status", "in": "query" }, + { + "type": "integer", + "description": "StackID to filter runs by. Default to all", + "name": "stackID", + "in": "query" + }, + { + "type": "string", + "description": "Workspace to filter runs by. Default to all", + "name": "workspace", + "in": "query" + }, { "type": "string", "description": "StartTime to filter runs by. Default to all. Format: RFC3339", @@ -1274,16 +1625,37 @@ const docTemplate = `{ "description": "EndTime to filter runs by. Default to all. Format: RFC3339", "name": "endTime", "in": "query" + }, + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" } ], "responses": { "200": { "description": "Success", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.Stack" - } + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.PaginatedRunResponse" + } + } + } + ] } }, "400": { @@ -1333,7 +1705,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Run" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Run" + } + } + } + ] } }, "400": { @@ -1383,7 +1767,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Run" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object" + } + } + } + ] } }, "400": { @@ -1426,13 +1822,37 @@ const docTemplate = `{ "description": "Source name to filter source list by. Default to all sources.", "name": "sourceName", "in": "query" + }, + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" } ], "responses": { "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Source" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.PaginatedSourceResponse" + } + } + } + ] } }, "400": { @@ -1485,7 +1905,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Source" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Source" + } + } + } + ] } }, "400": { @@ -1535,7 +1967,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Source" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Source" + } + } + } + ] } }, "400": { @@ -1595,7 +2039,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Source" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Source" + } + } + } + ] } }, "400": { @@ -1643,7 +2099,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Source" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -1710,16 +2178,37 @@ const docTemplate = `{ "description": "Environment to filter stacks by. Default to all", "name": "env", "in": "query" + }, + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" } ], "responses": { "200": { "description": "Success", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.Stack" - } + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.PaginatedStackResponse" + } + } + } + ] } }, "400": { @@ -1784,7 +2273,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Stack" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Stack" + } + } + } + ] } }, "400": { @@ -1834,7 +2335,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Stack" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Stack" + } + } + } + ] } }, "400": { @@ -1894,7 +2407,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Stack" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Stack" + } + } + } + ] } }, "400": { @@ -1942,7 +2467,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -2031,7 +2568,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -2120,7 +2669,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Run" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Run" + } + } + } + ] } }, "400": { @@ -2189,7 +2750,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -2258,7 +2831,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Run" + } + } + } + ] } }, "400": { @@ -2327,7 +2912,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/kusionstack_io_kusion_pkg_apis_api_kusion_io_v1.Spec" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/kusionstack_io_kusion_pkg_apis_api_kusion_io_v1.Spec" + } + } + } + ] } }, "400": { @@ -2396,7 +2993,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/kusionstack_io_kusion_pkg_apis_api_kusion_io_v1.Spec" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Run" + } + } + } + ] } }, "400": { @@ -2491,7 +3100,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Run" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Run" + } + } + } + ] } }, "400": { @@ -2528,11 +3149,37 @@ const docTemplate = `{ ], "summary": "List workspaces", "operationId": "listWorkspace", + "parameters": [ + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" + } + ], "responses": { "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Workspace" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.PaginatedWorkspaceResponse" + } + } + } + ] } }, "400": { @@ -2585,7 +3232,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Workspace" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Workspace" + } + } + } + ] } }, "400": { @@ -2690,7 +3349,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Workspace" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Workspace" + } + } + } + ] } }, "400": { @@ -2750,7 +3421,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Workspace" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Workspace" + } + } + } + ] } }, "400": { @@ -2798,7 +3481,19 @@ const docTemplate = `{ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -3052,18 +3747,18 @@ const docTemplate = `{ "constant.SourceProviderType": { "type": "string", "enum": [ + "git", "git", "github", "oci", - "local", - "git" + "local" ], "x-enum-varnames": [ + "DefaultSourceType", "SourceProviderTypeGit", "SourceProviderTypeGithub", "SourceProviderTypeOCI", - "SourceProviderTypeLocal", - "DefaultSourceType" + "SourceProviderTypeLocal" ] }, "constant.StackState": { @@ -3174,6 +3869,46 @@ const docTemplate = `{ } } }, + "entity.ModuleWithVersion": { + "type": "object", + "properties": { + "description": { + "description": "Description is a human-readable description of the module.", + "type": "string" + }, + "doc": { + "description": "Doc is the documentation URL of the module.", + "allOf": [ + { + "$ref": "#/definitions/url.URL" + } + ] + }, + "name": { + "description": "Name is the module name.", + "type": "string" + }, + "owners": { + "description": "Owners is a list of owners for the module.", + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "description": "URL is the module oci artifact registry URL.", + "allOf": [ + { + "$ref": "#/definitions/url.URL" + } + ] + }, + "version": { + "description": "Version is the module oci artifact version.", + "type": "string" + } + } + }, "entity.Organization": { "type": "object", "properties": { @@ -3690,6 +4425,65 @@ const docTemplate = `{ } } }, + "handler.Duration": { + "type": "integer", + "enum": [ + -9223372036854775808, + 9223372036854775807, + 1, + 1000, + 1000000, + 1000000000, + 60000000000, + 3600000000000 + ], + "x-enum-varnames": [ + "minDuration", + "maxDuration", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute", + "Hour" + ] + }, + "handler.Response": { + "type": "object", + "properties": { + "costTime": { + "description": "Time taken for the request.", + "allOf": [ + { + "$ref": "#/definitions/handler.Duration" + } + ] + }, + "data": { + "description": "Data payload." + }, + "endTime": { + "description": "Request end time.", + "type": "string" + }, + "message": { + "description": "Descriptive message.", + "type": "string" + }, + "startTime": { + "description": "Request start time.", + "type": "string" + }, + "success": { + "description": "Indicates success status.", + "type": "boolean" + }, + "traceID": { + "description": "Trace identifier.", + "type": "string" + } + } + }, "kusionstack_io_kusion_pkg_apis_api_kusion_io_v1.AWSProvider": { "type": "object", "properties": { @@ -4700,6 +5494,192 @@ const docTemplate = `{ } } }, + "response.PaginatedBackendResponse": { + "type": "object", + "properties": { + "backends": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Backend" + } + }, + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "response.PaginatedModuleResponse": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "modules": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Module" + } + }, + "modulesWithVersion": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.ModuleWithVersion" + } + }, + "pageSize": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "response.PaginatedOrganizationResponse": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "organizations": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Organization" + } + }, + "pageSize": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "response.PaginatedProjectResponse": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "projects": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Project" + } + }, + "total": { + "type": "integer" + } + } + }, + "response.PaginatedResourceResponse": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Resource" + } + }, + "total": { + "type": "integer" + } + } + }, + "response.PaginatedRunResponse": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "runs": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Run" + } + }, + "total": { + "type": "integer" + } + } + }, + "response.PaginatedSourceResponse": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "sources": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Source" + } + }, + "total": { + "type": "integer" + } + } + }, + "response.PaginatedStackResponse": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "stacks": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Stack" + } + }, + "total": { + "type": "integer" + } + } + }, + "response.PaginatedWorkspaceResponse": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "workspaces": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Workspace" + } + } + } + }, "url.URL": { "type": "object", "properties": { diff --git a/api/openapispec/swagger.json b/api/openapispec/swagger.json index 9249841..fdd7021 100644 --- a/api/openapispec/swagger.json +++ b/api/openapispec/swagger.json @@ -15,11 +15,37 @@ ], "summary": "List backends", "operationId": "listBackend", + "parameters": [ + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" + } + ], "responses": { "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Backend" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.PaginatedBackendResponse" + } + } + } + ] } }, "400": { @@ -72,7 +98,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Backend" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Backend" + } + } + } + ] } }, "400": { @@ -122,7 +160,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Backend" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Backend" + } + } + } + ] } }, "400": { @@ -182,7 +232,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Backend" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Backend" + } + } + } + ] } }, "400": { @@ -230,7 +292,19 @@ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -279,16 +353,37 @@ "description": "Module name to filter module list by. Default to all modules.", "name": "moduleName", "in": "query" + }, + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" } ], "responses": { "200": { "description": "Success", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.Module" - } + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.PaginatedModuleResponse" + } + } + } + ] } }, "400": { @@ -341,7 +436,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Module" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Module" + } + } + } + ] } }, "400": { @@ -391,7 +498,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Module" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Module" + } + } + } + ] } }, "400": { @@ -451,7 +570,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Module" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Module" + } + } + } + ] } }, "400": { @@ -499,7 +630,19 @@ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -536,14 +679,37 @@ ], "summary": "List organizations", "operationId": "listOrganization", + "parameters": [ + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" + } + ], "responses": { "200": { "description": "Success", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.Organization" - } + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.PaginatedOrganizationResponse" + } + } + } + ] } }, "400": { @@ -596,7 +762,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Organization" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Organization" + } + } + } + ] } }, "400": { @@ -646,7 +824,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Organization" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Organization" + } + } + } + ] } }, "400": { @@ -706,7 +896,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Organization" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Organization" + } + } + } + ] } }, "400": { @@ -754,7 +956,19 @@ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -803,16 +1017,40 @@ "description": "Project name to filter project list by. This should only return one result if set.", "name": "name", "in": "query" + }, + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" } ], "responses": { "200": { "description": "Success", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.Project" - } + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/response.PaginatedProjectResponse" + } + } + } + } + ] } }, "400": { @@ -865,7 +1103,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Project" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Project" + } + } + } + ] } }, "400": { @@ -915,7 +1165,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Project" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Project" + } + } + } + ] } }, "400": { @@ -975,7 +1237,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Project" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Project" + } + } + } + ] } }, "400": { @@ -1023,7 +1297,19 @@ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -1060,11 +1346,40 @@ ], "summary": "List resource", "operationId": "listResource", + "parameters": [ + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" + } + ], "responses": { "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Resource" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/response.PaginatedResourceResponse" + } + } + } + } + ] } }, "400": { @@ -1114,7 +1429,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.ResourceGraph" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.ResourceGraph" + } + } + } + ] } }, "400": { @@ -1164,7 +1491,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Resource" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Resource" + } + } + } + ] } }, "400": { @@ -1252,6 +1591,18 @@ "name": "status", "in": "query" }, + { + "type": "integer", + "description": "StackID to filter runs by. Default to all", + "name": "stackID", + "in": "query" + }, + { + "type": "string", + "description": "Workspace to filter runs by. Default to all", + "name": "workspace", + "in": "query" + }, { "type": "string", "description": "StartTime to filter runs by. Default to all. Format: RFC3339", @@ -1263,16 +1614,37 @@ "description": "EndTime to filter runs by. Default to all. Format: RFC3339", "name": "endTime", "in": "query" + }, + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" } ], "responses": { "200": { "description": "Success", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.Stack" - } + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.PaginatedRunResponse" + } + } + } + ] } }, "400": { @@ -1322,7 +1694,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Run" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Run" + } + } + } + ] } }, "400": { @@ -1372,7 +1756,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Run" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "object" + } + } + } + ] } }, "400": { @@ -1415,13 +1811,37 @@ "description": "Source name to filter source list by. Default to all sources.", "name": "sourceName", "in": "query" + }, + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" } ], "responses": { "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Source" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.PaginatedSourceResponse" + } + } + } + ] } }, "400": { @@ -1474,7 +1894,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Source" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Source" + } + } + } + ] } }, "400": { @@ -1524,7 +1956,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Source" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Source" + } + } + } + ] } }, "400": { @@ -1584,7 +2028,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Source" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Source" + } + } + } + ] } }, "400": { @@ -1632,7 +2088,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Source" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -1699,16 +2167,37 @@ "description": "Environment to filter stacks by. Default to all", "name": "env", "in": "query" + }, + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" } ], "responses": { "200": { "description": "Success", "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/entity.Stack" - } + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.PaginatedStackResponse" + } + } + } + ] } }, "400": { @@ -1773,7 +2262,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Stack" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Stack" + } + } + } + ] } }, "400": { @@ -1823,7 +2324,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Stack" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Stack" + } + } + } + ] } }, "400": { @@ -1883,7 +2396,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Stack" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Stack" + } + } + } + ] } }, "400": { @@ -1931,7 +2456,19 @@ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -2020,7 +2557,19 @@ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -2109,7 +2658,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Run" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Run" + } + } + } + ] } }, "400": { @@ -2178,7 +2739,19 @@ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -2247,7 +2820,19 @@ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Run" + } + } + } + ] } }, "400": { @@ -2316,7 +2901,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/kusionstack_io_kusion_pkg_apis_api_kusion_io_v1.Spec" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/kusionstack_io_kusion_pkg_apis_api_kusion_io_v1.Spec" + } + } + } + ] } }, "400": { @@ -2385,7 +2982,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/kusionstack_io_kusion_pkg_apis_api_kusion_io_v1.Spec" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Run" + } + } + } + ] } }, "400": { @@ -2480,7 +3089,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Run" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Run" + } + } + } + ] } }, "400": { @@ -2517,11 +3138,37 @@ ], "summary": "List workspaces", "operationId": "listWorkspace", + "parameters": [ + { + "type": "integer", + "description": "The current page to fetch. Default to 1", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "The size of the page. Default to 10", + "name": "pageSize", + "in": "query" + } + ], "responses": { "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Workspace" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/response.PaginatedWorkspaceResponse" + } + } + } + ] } }, "400": { @@ -2574,7 +3221,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Workspace" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Workspace" + } + } + } + ] } }, "400": { @@ -2679,7 +3338,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Workspace" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Workspace" + } + } + } + ] } }, "400": { @@ -2739,7 +3410,19 @@ "200": { "description": "Success", "schema": { - "$ref": "#/definitions/entity.Workspace" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "$ref": "#/definitions/entity.Workspace" + } + } + } + ] } }, "400": { @@ -2787,7 +3470,19 @@ "200": { "description": "Success", "schema": { - "type": "string" + "allOf": [ + { + "$ref": "#/definitions/handler.Response" + }, + { + "type": "object", + "properties": { + "data": { + "type": "string" + } + } + } + ] } }, "400": { @@ -3041,18 +3736,18 @@ "constant.SourceProviderType": { "type": "string", "enum": [ + "git", "git", "github", "oci", - "local", - "git" + "local" ], "x-enum-varnames": [ + "DefaultSourceType", "SourceProviderTypeGit", "SourceProviderTypeGithub", "SourceProviderTypeOCI", - "SourceProviderTypeLocal", - "DefaultSourceType" + "SourceProviderTypeLocal" ] }, "constant.StackState": { @@ -3163,6 +3858,46 @@ } } }, + "entity.ModuleWithVersion": { + "type": "object", + "properties": { + "description": { + "description": "Description is a human-readable description of the module.", + "type": "string" + }, + "doc": { + "description": "Doc is the documentation URL of the module.", + "allOf": [ + { + "$ref": "#/definitions/url.URL" + } + ] + }, + "name": { + "description": "Name is the module name.", + "type": "string" + }, + "owners": { + "description": "Owners is a list of owners for the module.", + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "description": "URL is the module oci artifact registry URL.", + "allOf": [ + { + "$ref": "#/definitions/url.URL" + } + ] + }, + "version": { + "description": "Version is the module oci artifact version.", + "type": "string" + } + } + }, "entity.Organization": { "type": "object", "properties": { @@ -3679,6 +4414,65 @@ } } }, + "handler.Duration": { + "type": "integer", + "enum": [ + -9223372036854775808, + 9223372036854775807, + 1, + 1000, + 1000000, + 1000000000, + 60000000000, + 3600000000000 + ], + "x-enum-varnames": [ + "minDuration", + "maxDuration", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute", + "Hour" + ] + }, + "handler.Response": { + "type": "object", + "properties": { + "costTime": { + "description": "Time taken for the request.", + "allOf": [ + { + "$ref": "#/definitions/handler.Duration" + } + ] + }, + "data": { + "description": "Data payload." + }, + "endTime": { + "description": "Request end time.", + "type": "string" + }, + "message": { + "description": "Descriptive message.", + "type": "string" + }, + "startTime": { + "description": "Request start time.", + "type": "string" + }, + "success": { + "description": "Indicates success status.", + "type": "boolean" + }, + "traceID": { + "description": "Trace identifier.", + "type": "string" + } + } + }, "kusionstack_io_kusion_pkg_apis_api_kusion_io_v1.AWSProvider": { "type": "object", "properties": { @@ -4689,6 +5483,192 @@ } } }, + "response.PaginatedBackendResponse": { + "type": "object", + "properties": { + "backends": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Backend" + } + }, + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "response.PaginatedModuleResponse": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "modules": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Module" + } + }, + "modulesWithVersion": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.ModuleWithVersion" + } + }, + "pageSize": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "response.PaginatedOrganizationResponse": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "organizations": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Organization" + } + }, + "pageSize": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "response.PaginatedProjectResponse": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "projects": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Project" + } + }, + "total": { + "type": "integer" + } + } + }, + "response.PaginatedResourceResponse": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Resource" + } + }, + "total": { + "type": "integer" + } + } + }, + "response.PaginatedRunResponse": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "runs": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Run" + } + }, + "total": { + "type": "integer" + } + } + }, + "response.PaginatedSourceResponse": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "sources": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Source" + } + }, + "total": { + "type": "integer" + } + } + }, + "response.PaginatedStackResponse": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "stacks": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Stack" + } + }, + "total": { + "type": "integer" + } + } + }, + "response.PaginatedWorkspaceResponse": { + "type": "object", + "properties": { + "currentPage": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "workspaces": { + "type": "array", + "items": { + "$ref": "#/definitions/entity.Workspace" + } + } + } + }, "url.URL": { "type": "object", "properties": { diff --git a/api/openapispec/swagger.yaml b/api/openapispec/swagger.yaml index 4fa85f1..6dd47b0 100644 --- a/api/openapispec/swagger.yaml +++ b/api/openapispec/swagger.yaml @@ -30,17 +30,17 @@ definitions: constant.SourceProviderType: enum: - git + - git - github - oci - local - - git type: string x-enum-varnames: + - DefaultSourceType - SourceProviderTypeGit - SourceProviderTypeGithub - SourceProviderTypeOCI - SourceProviderTypeLocal - - DefaultSourceType constant.StackState: enum: - UnSynced @@ -124,6 +124,31 @@ definitions: - $ref: '#/definitions/url.URL' description: URL is the module oci artifact registry URL. type: object + entity.ModuleWithVersion: + properties: + description: + description: Description is a human-readable description of the module. + type: string + doc: + allOf: + - $ref: '#/definitions/url.URL' + description: Doc is the documentation URL of the module. + name: + description: Name is the module name. + type: string + owners: + description: Owners is a list of owners for the module. + items: + type: string + type: array + url: + allOf: + - $ref: '#/definitions/url.URL' + description: URL is the module oci artifact registry URL. + version: + description: Version is the module oci artifact version. + type: string + type: object entity.Organization: properties: creationTimestamp: @@ -482,6 +507,50 @@ definitions: description: UpdateTimestamp is the timestamp of the updated for the workspace. type: string type: object + handler.Duration: + enum: + - -9223372036854775808 + - 9223372036854775807 + - 1 + - 1000 + - 1000000 + - 1000000000 + - 60000000000 + - 3600000000000 + type: integer + x-enum-varnames: + - minDuration + - maxDuration + - Nanosecond + - Microsecond + - Millisecond + - Second + - Minute + - Hour + handler.Response: + properties: + costTime: + allOf: + - $ref: '#/definitions/handler.Duration' + description: Time taken for the request. + data: + description: Data payload. + endTime: + description: Request end time. + type: string + message: + description: Descriptive message. + type: string + startTime: + description: Request start time. + type: string + success: + description: Indicates success status. + type: boolean + traceID: + description: Trace identifier. + type: string + type: object kusionstack_io_kusion_pkg_apis_api_kusion_io_v1.AWSProvider: properties: profile: @@ -1198,6 +1267,127 @@ definitions: description: SecretStore represents a secure external location for storing secrets. type: object + response.PaginatedBackendResponse: + properties: + backends: + items: + $ref: '#/definitions/entity.Backend' + type: array + currentPage: + type: integer + pageSize: + type: integer + total: + type: integer + type: object + response.PaginatedModuleResponse: + properties: + currentPage: + type: integer + modules: + items: + $ref: '#/definitions/entity.Module' + type: array + modulesWithVersion: + items: + $ref: '#/definitions/entity.ModuleWithVersion' + type: array + pageSize: + type: integer + total: + type: integer + type: object + response.PaginatedOrganizationResponse: + properties: + currentPage: + type: integer + organizations: + items: + $ref: '#/definitions/entity.Organization' + type: array + pageSize: + type: integer + total: + type: integer + type: object + response.PaginatedProjectResponse: + properties: + currentPage: + type: integer + pageSize: + type: integer + projects: + items: + $ref: '#/definitions/entity.Project' + type: array + total: + type: integer + type: object + response.PaginatedResourceResponse: + properties: + currentPage: + type: integer + pageSize: + type: integer + resources: + items: + $ref: '#/definitions/entity.Resource' + type: array + total: + type: integer + type: object + response.PaginatedRunResponse: + properties: + currentPage: + type: integer + pageSize: + type: integer + runs: + items: + $ref: '#/definitions/entity.Run' + type: array + total: + type: integer + type: object + response.PaginatedSourceResponse: + properties: + currentPage: + type: integer + pageSize: + type: integer + sources: + items: + $ref: '#/definitions/entity.Source' + type: array + total: + type: integer + type: object + response.PaginatedStackResponse: + properties: + currentPage: + type: integer + pageSize: + type: integer + stacks: + items: + $ref: '#/definitions/entity.Stack' + type: array + total: + type: integer + type: object + response.PaginatedWorkspaceResponse: + properties: + currentPage: + type: integer + pageSize: + type: integer + total: + type: integer + workspaces: + items: + $ref: '#/definitions/entity.Workspace' + type: array + type: object url.URL: properties: forceQuery: @@ -1243,13 +1433,27 @@ paths: get: description: List all backends operationId: listBackend + parameters: + - description: The current page to fetch. Default to 1 + in: query + name: page + type: integer + - description: The size of the page. Default to 10 + in: query + name: pageSize + type: integer produces: - application/json responses: "200": description: Success schema: - $ref: '#/definitions/entity.Backend' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/response.PaginatedBackendResponse' + type: object "400": description: Bad Request schema: {} @@ -1286,7 +1490,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Backend' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Backend' + type: object "400": description: Bad Request schema: {} @@ -1321,7 +1530,12 @@ paths: "200": description: Success schema: - type: string + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + type: string + type: object "400": description: Bad Request schema: {} @@ -1355,7 +1569,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Backend' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Backend' + type: object "400": description: Bad Request schema: {} @@ -1397,7 +1616,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Backend' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Backend' + type: object "400": description: Bad Request schema: {} @@ -1429,15 +1653,26 @@ paths: in: query name: moduleName type: string + - description: The current page to fetch. Default to 1 + in: query + name: page + type: integer + - description: The size of the page. Default to 10 + in: query + name: pageSize + type: integer produces: - application/json responses: "200": description: Success schema: - items: - $ref: '#/definitions/entity.Module' - type: array + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/response.PaginatedModuleResponse' + type: object "400": description: Bad Request schema: {} @@ -1474,7 +1709,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Module' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Module' + type: object "400": description: Bad Request schema: {} @@ -1509,7 +1749,12 @@ paths: "200": description: Success schema: - type: string + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + type: string + type: object "400": description: Bad Request schema: {} @@ -1543,7 +1788,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Module' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Module' + type: object "400": description: Bad Request schema: {} @@ -1585,7 +1835,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Module' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Module' + type: object "400": description: Bad Request schema: {} @@ -1608,15 +1863,27 @@ paths: get: description: List all organizations operationId: listOrganization + parameters: + - description: The current page to fetch. Default to 1 + in: query + name: page + type: integer + - description: The size of the page. Default to 10 + in: query + name: pageSize + type: integer produces: - application/json responses: "200": description: Success schema: - items: - $ref: '#/definitions/entity.Organization' - type: array + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/response.PaginatedOrganizationResponse' + type: object "400": description: Bad Request schema: {} @@ -1653,7 +1920,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Organization' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Organization' + type: object "400": description: Bad Request schema: {} @@ -1688,7 +1960,12 @@ paths: "200": description: Success schema: - type: string + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + type: string + type: object "400": description: Bad Request schema: {} @@ -1722,7 +1999,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Organization' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Organization' + type: object "400": description: Bad Request schema: {} @@ -1764,7 +2046,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Organization' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Organization' + type: object "400": description: Bad Request schema: {} @@ -1797,15 +2084,28 @@ paths: in: query name: name type: string + - description: The current page to fetch. Default to 1 + in: query + name: page + type: integer + - description: The size of the page. Default to 10 + in: query + name: pageSize + type: integer produces: - application/json responses: "200": description: Success schema: - items: - $ref: '#/definitions/entity.Project' - type: array + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + items: + $ref: '#/definitions/response.PaginatedProjectResponse' + type: array + type: object "400": description: Bad Request schema: {} @@ -1842,7 +2142,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Project' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Project' + type: object "400": description: Bad Request schema: {} @@ -1877,7 +2182,12 @@ paths: "200": description: Success schema: - type: string + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + type: string + type: object "400": description: Bad Request schema: {} @@ -1911,7 +2221,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Project' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Project' + type: object "400": description: Bad Request schema: {} @@ -1953,7 +2268,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Project' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Project' + type: object "400": description: Bad Request schema: {} @@ -1976,13 +2296,29 @@ paths: get: description: List resource information operationId: listResource + parameters: + - description: The current page to fetch. Default to 1 + in: query + name: page + type: integer + - description: The size of the page. Default to 10 + in: query + name: pageSize + type: integer produces: - application/json responses: "200": description: Success schema: - $ref: '#/definitions/entity.Resource' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + items: + $ref: '#/definitions/response.PaginatedResourceResponse' + type: array + type: object "400": description: Bad Request schema: {} @@ -2017,7 +2353,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Resource' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Resource' + type: object "400": description: Bad Request schema: {} @@ -2052,7 +2393,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.ResourceGraph' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.ResourceGraph' + type: object "400": description: Bad Request schema: {} @@ -2110,6 +2456,14 @@ paths: type: string name: status type: array + - description: StackID to filter runs by. Default to all + in: query + name: stackID + type: integer + - description: Workspace to filter runs by. Default to all + in: query + name: workspace + type: string - description: 'StartTime to filter runs by. Default to all. Format: RFC3339' in: query name: startTime @@ -2118,15 +2472,26 @@ paths: in: query name: endTime type: string + - description: The current page to fetch. Default to 1 + in: query + name: page + type: integer + - description: The size of the page. Default to 10 + in: query + name: pageSize + type: integer produces: - application/json responses: "200": description: Success schema: - items: - $ref: '#/definitions/entity.Stack' - type: array + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/response.PaginatedRunResponse' + type: object "400": description: Bad Request schema: {} @@ -2161,7 +2526,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Run' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Run' + type: object "400": description: Bad Request schema: {} @@ -2196,7 +2566,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Run' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + type: object + type: object "400": description: Bad Request schema: {} @@ -2224,13 +2599,26 @@ paths: in: query name: sourceName type: string + - description: The current page to fetch. Default to 1 + in: query + name: page + type: integer + - description: The size of the page. Default to 10 + in: query + name: pageSize + type: integer produces: - application/json responses: "200": description: Success schema: - $ref: '#/definitions/entity.Source' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/response.PaginatedSourceResponse' + type: object "400": description: Bad Request schema: {} @@ -2267,7 +2655,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Source' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Source' + type: object "400": description: Bad Request schema: {} @@ -2302,7 +2695,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Source' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + type: string + type: object "400": description: Bad Request schema: {} @@ -2336,7 +2734,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Source' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Source' + type: object "400": description: Bad Request schema: {} @@ -2378,7 +2781,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Source' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Source' + type: object "400": description: Bad Request schema: {} @@ -2422,15 +2830,26 @@ paths: in: query name: env type: string + - description: The current page to fetch. Default to 1 + in: query + name: page + type: integer + - description: The size of the page. Default to 10 + in: query + name: pageSize + type: integer produces: - application/json responses: "200": description: Success schema: - items: - $ref: '#/definitions/entity.Stack' - type: array + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/response.PaginatedStackResponse' + type: object "400": description: Bad Request schema: {} @@ -2477,7 +2896,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Stack' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Stack' + type: object "400": description: Bad Request schema: {} @@ -2512,7 +2936,12 @@ paths: "200": description: Success schema: - type: string + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + type: string + type: object "400": description: Bad Request schema: {} @@ -2546,7 +2975,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Stack' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Stack' + type: object "400": description: Bad Request schema: {} @@ -2588,7 +3022,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Stack' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Stack' + type: object "400": description: Bad Request schema: {} @@ -2651,7 +3090,12 @@ paths: "200": description: Success schema: - type: string + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + type: string + type: object "400": description: Bad Request schema: {} @@ -2714,7 +3158,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Run' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Run' + type: object "400": description: Bad Request schema: {} @@ -2763,7 +3212,12 @@ paths: "200": description: Success schema: - type: string + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + type: string + type: object "400": description: Bad Request schema: {} @@ -2813,7 +3267,12 @@ paths: "200": description: Success schema: - type: string + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Run' + type: object "400": description: Bad Request schema: {} @@ -2862,7 +3321,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/kusionstack_io_kusion_pkg_apis_api_kusion_io_v1.Spec' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/kusionstack_io_kusion_pkg_apis_api_kusion_io_v1.Spec' + type: object "400": description: Bad Request schema: {} @@ -2911,7 +3375,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/kusionstack_io_kusion_pkg_apis_api_kusion_io_v1.Spec' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Run' + type: object "400": description: Bad Request schema: {} @@ -2977,7 +3446,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Run' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Run' + type: object "400": description: Bad Request schema: {} @@ -3000,13 +3474,27 @@ paths: get: description: List all workspaces operationId: listWorkspace + parameters: + - description: The current page to fetch. Default to 1 + in: query + name: page + type: integer + - description: The size of the page. Default to 10 + in: query + name: pageSize + type: integer produces: - application/json responses: "200": description: Success schema: - $ref: '#/definitions/entity.Workspace' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/response.PaginatedWorkspaceResponse' + type: object "400": description: Bad Request schema: {} @@ -3043,7 +3531,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Workspace' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Workspace' + type: object "400": description: Bad Request schema: {} @@ -3078,7 +3571,12 @@ paths: "200": description: Success schema: - type: string + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + type: string + type: object "400": description: Bad Request schema: {} @@ -3112,7 +3610,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Workspace' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Workspace' + type: object "400": description: Bad Request schema: {} @@ -3154,7 +3657,12 @@ paths: "200": description: Success schema: - $ref: '#/definitions/entity.Workspace' + allOf: + - $ref: '#/definitions/handler.Response' + - properties: + data: + $ref: '#/definitions/entity.Workspace' + type: object "400": description: Bad Request schema: {} diff --git a/package.json b/package.json index 44ad803..27e20a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kusionstack/kusion-api-client-sdk", - "version": "1.0.2", + "version": "1.0.3", "description": "Kusion API Client SDK", "main": "dist/src/client/index.js", "types": "dist/src/client/index.d.ts", @@ -46,4 +46,4 @@ "publishConfig": { "access": "public" } -} +} \ No newline at end of file diff --git a/src/client/schemas.gen.ts b/src/client/schemas.gen.ts index 5cf780f..605213b 100644 --- a/src/client/schemas.gen.ts +++ b/src/client/schemas.gen.ts @@ -13,9 +13,9 @@ export const constant_RunTypeSchema = { } as const; export const constant_SourceProviderTypeSchema = { - enum: ['git', 'github', 'oci', 'local', 'git'], + enum: ['git', 'git', 'github', 'oci', 'local'], type: 'string', - 'x-enum-varnames': ['SourceProviderTypeGit', 'SourceProviderTypeGithub', 'SourceProviderTypeOCI', 'SourceProviderTypeLocal', 'DefaultSourceType'] + 'x-enum-varnames': ['DefaultSourceType', 'SourceProviderTypeGit', 'SourceProviderTypeGithub', 'SourceProviderTypeOCI', 'SourceProviderTypeLocal'] } as const; export const constant_StackStateSchema = { @@ -97,6 +97,47 @@ export const entity_ModuleSchema = { type: 'object' } as const; +export const entity_ModuleWithVersionSchema = { + properties: { + description: { + description: 'Description is a human-readable description of the module.', + type: 'string' + }, + doc: { + allOf: [ + { + '$ref': '#/definitions/url.URL' + } + ], + description: 'Doc is the documentation URL of the module.' + }, + name: { + description: 'Name is the module name.', + type: 'string' + }, + owners: { + description: 'Owners is a list of owners for the module.', + items: { + type: 'string' + }, + type: 'array' + }, + url: { + allOf: [ + { + '$ref': '#/definitions/url.URL' + } + ], + description: 'URL is the module oci artifact registry URL.' + }, + version: { + description: 'Version is the module oci artifact version.', + type: 'string' + } + }, + type: 'object' +} as const; + export const entity_OrganizationSchema = { properties: { creationTimestamp: { @@ -623,6 +664,49 @@ export const entity_WorkspaceSchema = { type: 'object' } as const; +export const handler_DurationSchema = { + enum: [-9223372036854776000, 9223372036854776000, 1, 1000, 1000000, 1000000000, 60000000000, 3600000000000], + type: 'integer', + 'x-enum-varnames': ['minDuration', 'maxDuration', 'Nanosecond', 'Microsecond', 'Millisecond', 'Second', 'Minute', 'Hour'] +} as const; + +export const handler_ResponseSchema = { + properties: { + costTime: { + allOf: [ + { + '$ref': '#/definitions/handler.Duration' + } + ], + description: 'Time taken for the request.' + }, + data: { + description: 'Data payload.' + }, + endTime: { + description: 'Request end time.', + type: 'string' + }, + message: { + description: 'Descriptive message.', + type: 'string' + }, + startTime: { + description: 'Request start time.', + type: 'string' + }, + success: { + description: 'Indicates success status.', + type: 'boolean' + }, + traceID: { + description: 'Trace identifier.', + type: 'string' + } + }, + type: 'object' +} as const; + export const kusionstack_io_kusion_pkg_apis_api_kusion_io_v1_AWSProviderSchema = { properties: { profile: { @@ -1607,6 +1691,201 @@ export const request_WorkspaceConfigsSchema = { type: 'object' } as const; +export const response_PaginatedBackendResponseSchema = { + properties: { + backends: { + items: { + '$ref': '#/definitions/entity.Backend' + }, + type: 'array' + }, + currentPage: { + type: 'integer' + }, + pageSize: { + type: 'integer' + }, + total: { + type: 'integer' + } + }, + type: 'object' +} as const; + +export const response_PaginatedModuleResponseSchema = { + properties: { + currentPage: { + type: 'integer' + }, + modules: { + items: { + '$ref': '#/definitions/entity.Module' + }, + type: 'array' + }, + modulesWithVersion: { + items: { + '$ref': '#/definitions/entity.ModuleWithVersion' + }, + type: 'array' + }, + pageSize: { + type: 'integer' + }, + total: { + type: 'integer' + } + }, + type: 'object' +} as const; + +export const response_PaginatedOrganizationResponseSchema = { + properties: { + currentPage: { + type: 'integer' + }, + organizations: { + items: { + '$ref': '#/definitions/entity.Organization' + }, + type: 'array' + }, + pageSize: { + type: 'integer' + }, + total: { + type: 'integer' + } + }, + type: 'object' +} as const; + +export const response_PaginatedProjectResponseSchema = { + properties: { + currentPage: { + type: 'integer' + }, + pageSize: { + type: 'integer' + }, + projects: { + items: { + '$ref': '#/definitions/entity.Project' + }, + type: 'array' + }, + total: { + type: 'integer' + } + }, + type: 'object' +} as const; + +export const response_PaginatedResourceResponseSchema = { + properties: { + currentPage: { + type: 'integer' + }, + pageSize: { + type: 'integer' + }, + resources: { + items: { + '$ref': '#/definitions/entity.Resource' + }, + type: 'array' + }, + total: { + type: 'integer' + } + }, + type: 'object' +} as const; + +export const response_PaginatedRunResponseSchema = { + properties: { + currentPage: { + type: 'integer' + }, + pageSize: { + type: 'integer' + }, + runs: { + items: { + '$ref': '#/definitions/entity.Run' + }, + type: 'array' + }, + total: { + type: 'integer' + } + }, + type: 'object' +} as const; + +export const response_PaginatedSourceResponseSchema = { + properties: { + currentPage: { + type: 'integer' + }, + pageSize: { + type: 'integer' + }, + sources: { + items: { + '$ref': '#/definitions/entity.Source' + }, + type: 'array' + }, + total: { + type: 'integer' + } + }, + type: 'object' +} as const; + +export const response_PaginatedStackResponseSchema = { + properties: { + currentPage: { + type: 'integer' + }, + pageSize: { + type: 'integer' + }, + stacks: { + items: { + '$ref': '#/definitions/entity.Stack' + }, + type: 'array' + }, + total: { + type: 'integer' + } + }, + type: 'object' +} as const; + +export const response_PaginatedWorkspaceResponseSchema = { + properties: { + currentPage: { + type: 'integer' + }, + pageSize: { + type: 'integer' + }, + total: { + type: 'integer' + }, + workspaces: { + items: { + '$ref': '#/definitions/entity.Workspace' + }, + type: 'array' + } + }, + type: 'object' +} as const; + export const url_URLSchema = { properties: { forceQuery: { diff --git a/src/client/sdk.gen.ts b/src/client/sdk.gen.ts index d5e4493..b155c83 100644 --- a/src/client/sdk.gen.ts +++ b/src/client/sdk.gen.ts @@ -1,7 +1,7 @@ // This file is auto-generated by @hey-api/openapi-ts import { createClient, createConfig, type OptionsLegacyParser } from '@hey-api/client-fetch'; -import type { ListBackendError, ListBackendResponse, CreateBackendData, CreateBackendError, CreateBackendResponse, DeleteBackendData, DeleteBackendError, DeleteBackendResponse, GetBackendData, GetBackendError, GetBackendResponse, UpdateBackendData, UpdateBackendError, UpdateBackendResponse, GetEndpointsError, GetEndpointsResponse, ListModuleData, ListModuleError, ListModuleResponse, CreateModuleData, CreateModuleError, CreateModuleResponse, DeleteModuleData, DeleteModuleError, DeleteModuleResponse, GetModuleData, GetModuleError, GetModuleResponse, UpdateModuleData, UpdateModuleError, UpdateModuleResponse, ListOrganizationError, ListOrganizationResponse, CreateOrganizationData, CreateOrganizationError, CreateOrganizationResponse, DeleteOrganizationData, DeleteOrganizationError, DeleteOrganizationResponse, GetOrganizationData, GetOrganizationError, GetOrganizationResponse, UpdateOrganizationData, UpdateOrganizationError, UpdateOrganizationResponse, ListProjectData, ListProjectError, ListProjectResponse, CreateProjectData, CreateProjectError, CreateProjectResponse, DeleteProjectData, DeleteProjectError, DeleteProjectResponse, GetProjectData, GetProjectError, GetProjectResponse, UpdateProjectData, UpdateProjectError, UpdateProjectResponse, ListResourceError, ListResourceResponse, GetResourceData, GetResourceError, GetResourceResponse, GetResourceGraphData, GetResourceGraphError, GetResourceGraphResponse, GetRunData, GetRunError, GetRunResponse, GetRunResultData, GetRunResultError, GetRunResultResponse, ListSourceData, ListSourceError, ListSourceResponse, CreateSourceData, CreateSourceError, CreateSourceResponse, DeleteSourceData, DeleteSourceError, DeleteSourceResponse, GetSourceData, GetSourceError, GetSourceResponse, UpdateSourceData, UpdateSourceError, UpdateSourceResponse, ListRunData, ListRunError, ListRunResponse, ListStackData, ListStackError, ListStackResponse, CreateStackData, CreateStackError, CreateStackResponse, DeleteStackData, DeleteStackError, DeleteStackResponse, GetStackData, GetStackError, GetStackResponse, UpdateStackData, UpdateStackError, UpdateStackResponse, ApplyStackData, ApplyStackError, ApplyStackResponse, ApplyStackAsyncData, ApplyStackAsyncError, ApplyStackAsyncResponse, DestroyStackData, DestroyStackError, DestroyStackResponse, DestroyStackAsyncData, DestroyStackAsyncError, DestroyStackAsyncResponse, GenerateStackData, GenerateStackError, GenerateStackResponse, GenerateStackAsyncData, GenerateStackAsyncError, GenerateStackAsyncResponse, PreviewStackAsyncData, PreviewStackAsyncError, PreviewStackAsyncResponse, ListWorkspaceError, ListWorkspaceResponse, CreateWorkspaceData, CreateWorkspaceError, CreateWorkspaceResponse, DeleteWorkspaceData, DeleteWorkspaceError, DeleteWorkspaceResponse, GetWorkspaceData, GetWorkspaceError, GetWorkspaceResponse, UpdateWorkspaceData, UpdateWorkspaceError, UpdateWorkspaceResponse, GetWorkspaceConfigsData, GetWorkspaceConfigsError, GetWorkspaceConfigsResponse, UpdateWorkspaceConfigsData, UpdateWorkspaceConfigsError, UpdateWorkspaceConfigsResponse, CreateWorkspaceModDepsData, CreateWorkspaceModDepsError, CreateWorkspaceModDepsResponse, ValidateWorkspaceConfigsData, ValidateWorkspaceConfigsError, ValidateWorkspaceConfigsResponse } from './types.gen'; +import type { ListBackendData, ListBackendError, ListBackendResponse, CreateBackendData, CreateBackendError, CreateBackendResponse, DeleteBackendData, DeleteBackendError, DeleteBackendResponse, GetBackendData, GetBackendError, GetBackendResponse, UpdateBackendData, UpdateBackendError, UpdateBackendResponse, GetEndpointsError, GetEndpointsResponse, ListModuleData, ListModuleError, ListModuleResponse, CreateModuleData, CreateModuleError, CreateModuleResponse, DeleteModuleData, DeleteModuleError, DeleteModuleResponse, GetModuleData, GetModuleError, GetModuleResponse, UpdateModuleData, UpdateModuleError, UpdateModuleResponse, ListOrganizationData, ListOrganizationError, ListOrganizationResponse, CreateOrganizationData, CreateOrganizationError, CreateOrganizationResponse, DeleteOrganizationData, DeleteOrganizationError, DeleteOrganizationResponse, GetOrganizationData, GetOrganizationError, GetOrganizationResponse, UpdateOrganizationData, UpdateOrganizationError, UpdateOrganizationResponse, ListProjectData, ListProjectError, ListProjectResponse, CreateProjectData, CreateProjectError, CreateProjectResponse, DeleteProjectData, DeleteProjectError, DeleteProjectResponse, GetProjectData, GetProjectError, GetProjectResponse, UpdateProjectData, UpdateProjectError, UpdateProjectResponse, ListResourceData, ListResourceError, ListResourceResponse, GetResourceData, GetResourceError, GetResourceResponse, GetResourceGraphData, GetResourceGraphError, GetResourceGraphResponse, GetRunData, GetRunError, GetRunResponse, GetRunResultData, GetRunResultError, GetRunResultResponse, ListSourceData, ListSourceError, ListSourceResponse, CreateSourceData, CreateSourceError, CreateSourceResponse, DeleteSourceData, DeleteSourceError, DeleteSourceResponse, GetSourceData, GetSourceError, GetSourceResponse, UpdateSourceData, UpdateSourceError, UpdateSourceResponse, ListRunData, ListRunError, ListRunResponse, ListStackData, ListStackError, ListStackResponse, CreateStackData, CreateStackError, CreateStackResponse, DeleteStackData, DeleteStackError, DeleteStackResponse, GetStackData, GetStackError, GetStackResponse, UpdateStackData, UpdateStackError, UpdateStackResponse, ApplyStackData, ApplyStackError, ApplyStackResponse, ApplyStackAsyncData, ApplyStackAsyncError, ApplyStackAsyncResponse, DestroyStackData, DestroyStackError, DestroyStackResponse, DestroyStackAsyncData, DestroyStackAsyncError, DestroyStackAsyncResponse, GenerateStackData, GenerateStackError, GenerateStackResponse, GenerateStackAsyncData, GenerateStackAsyncError, GenerateStackAsyncResponse, PreviewStackAsyncData, PreviewStackAsyncError, PreviewStackAsyncResponse, ListWorkspaceData, ListWorkspaceError, ListWorkspaceResponse, CreateWorkspaceData, CreateWorkspaceError, CreateWorkspaceResponse, DeleteWorkspaceData, DeleteWorkspaceError, DeleteWorkspaceResponse, GetWorkspaceData, GetWorkspaceError, GetWorkspaceResponse, UpdateWorkspaceData, UpdateWorkspaceError, UpdateWorkspaceResponse, GetWorkspaceConfigsData, GetWorkspaceConfigsError, GetWorkspaceConfigsResponse, UpdateWorkspaceConfigsData, UpdateWorkspaceConfigsError, UpdateWorkspaceConfigsResponse, CreateWorkspaceModDepsData, CreateWorkspaceModDepsError, CreateWorkspaceModDepsResponse, ValidateWorkspaceConfigsData, ValidateWorkspaceConfigsError, ValidateWorkspaceConfigsResponse } from './types.gen'; export const client = createClient(createConfig()); @@ -10,7 +10,7 @@ export class BackendService { * List backends * List all backends */ - public static listBackend(options?: OptionsLegacyParser) { + public static listBackend(options?: OptionsLegacyParser) { return (options?.client ?? client).get({ ...options, url: '/api/v1/backends' @@ -140,7 +140,7 @@ export class OrganizationService { * List organizations * List all organizations */ - public static listOrganization(options?: OptionsLegacyParser) { + public static listOrganization(options?: OptionsLegacyParser) { return (options?.client ?? client).get({ ...options, url: '/api/v1/orgs' @@ -256,7 +256,7 @@ export class ResourceService { * List resource * List resource information */ - public static listResource(options?: OptionsLegacyParser) { + public static listResource(options?: OptionsLegacyParser) { return (options?.client ?? client).get({ ...options, url: '/api/v1/resources' @@ -521,7 +521,7 @@ export class WorkspaceService { * List workspaces * List all workspaces */ - public static listWorkspace(options?: OptionsLegacyParser) { + public static listWorkspace(options?: OptionsLegacyParser) { return (options?.client ?? client).get({ ...options, url: '/api/v1/workspaces' diff --git a/src/client/types.gen.ts b/src/client/types.gen.ts index 2287820..9da8bf9 100644 --- a/src/client/types.gen.ts +++ b/src/client/types.gen.ts @@ -17,10 +17,10 @@ export enum constant_RunType { } export enum constant_SourceProviderType { - SourceProviderTypeGit = 'git', - SourceProviderTypeGithub = 'github', - SourceProviderTypeOCI = 'oci', - SourceProviderTypeLocal = 'local' + DefaultSourceType = 'git', + SourceProviderTypeGit = 'github', + SourceProviderTypeGithub = 'oci', + SourceProviderTypeOCI = 'local' } export enum constant_StackState { @@ -94,6 +94,33 @@ export type entity_Module = { url?: (url_URL); }; +export type entity_ModuleWithVersion = { + /** + * Description is a human-readable description of the module. + */ + description?: string; + /** + * Doc is the documentation URL of the module. + */ + doc?: (url_URL); + /** + * Name is the module name. + */ + name?: string; + /** + * Owners is a list of owners for the module. + */ + owners?: Array<(string)>; + /** + * URL is the module oci artifact registry URL. + */ + url?: (url_URL); + /** + * Version is the module oci artifact version. + */ + version?: string; +}; + export type entity_Organization = { /** * CreationTimestamp is the timestamp of the created for the organization. @@ -491,6 +518,48 @@ export type entity_Workspace = { updateTimestamp?: string; }; +export enum handler_Duration { + minDuration = -9223372036854776000, + maxDuration = 9223372036854776000, + Nanosecond = 1, + Microsecond = 1000, + Millisecond = 1000000, + Second = 1000000000, + Minute = 60000000000, + Hour = 3600000000000 +} + +export type handler_Response = { + /** + * Time taken for the request. + */ + costTime?: (handler_Duration); + /** + * Data payload. + */ + data?: unknown; + /** + * Request end time. + */ + endTime?: string; + /** + * Descriptive message. + */ + message?: string; + /** + * Request start time. + */ + startTime?: string; + /** + * Indicates success status. + */ + success?: boolean; + /** + * Trace identifier. + */ + traceID?: string; +}; + export type kusionstack_io_kusion_pkg_apis_api_kusion_io_v1_AlicloudProvider = { /** * Alicloud Region to be used to interact with Alicloud Secrets Manager. @@ -1169,6 +1238,70 @@ export type request_WorkspaceConfigs = { secretStore?: (kusionstack_io_kusion_pkg_apis_api_kusion_io_v1_SecretStore); }; +export type response_PaginatedBackendResponse = { + backends?: Array; + currentPage?: number; + pageSize?: number; + total?: number; +}; + +export type response_PaginatedModuleResponse = { + currentPage?: number; + modules?: Array; + modulesWithVersion?: Array; + pageSize?: number; + total?: number; +}; + +export type response_PaginatedOrganizationResponse = { + currentPage?: number; + organizations?: Array; + pageSize?: number; + total?: number; +}; + +export type response_PaginatedProjectResponse = { + currentPage?: number; + pageSize?: number; + projects?: Array; + total?: number; +}; + +export type response_PaginatedResourceResponse = { + currentPage?: number; + pageSize?: number; + resources?: Array; + total?: number; +}; + +export type response_PaginatedRunResponse = { + currentPage?: number; + pageSize?: number; + runs?: Array; + total?: number; +}; + +export type response_PaginatedSourceResponse = { + currentPage?: number; + pageSize?: number; + sources?: Array; + total?: number; +}; + +export type response_PaginatedStackResponse = { + currentPage?: number; + pageSize?: number; + stacks?: Array; + total?: number; +}; + +export type response_PaginatedWorkspaceResponse = { + currentPage?: number; + pageSize?: number; + total?: number; + workspaces?: Array; +}; + export type url_URL = { /** * append a query ('?') even if RawQuery is empty @@ -1215,7 +1348,22 @@ export type url_URL = { export type url_Userinfo = unknown; -export type ListBackendResponse = (entity_Backend); +export type ListBackendData = { + query?: { + /** + * The current page to fetch. Default to 1 + */ + page?: number; + /** + * The size of the page. Default to 10 + */ + pageSize?: number; + }; +}; + +export type ListBackendResponse = ((handler_Response & { + data?: response_PaginatedBackendResponse; +})); export type ListBackendError = (unknown); @@ -1226,7 +1374,9 @@ export type CreateBackendData = { body: request_CreateBackendRequest; }; -export type CreateBackendResponse = (entity_Backend); +export type CreateBackendResponse = ((handler_Response & { + data?: entity_Backend; +})); export type CreateBackendError = (unknown); @@ -1239,7 +1389,9 @@ export type DeleteBackendData = { }; }; -export type DeleteBackendResponse = (string); +export type DeleteBackendResponse = ((handler_Response & { + data?: string; +})); export type DeleteBackendError = (unknown); @@ -1252,7 +1404,9 @@ export type GetBackendData = { }; }; -export type GetBackendResponse = (entity_Backend); +export type GetBackendResponse = ((handler_Response & { + data?: entity_Backend; +})); export type GetBackendError = (unknown); @@ -1269,7 +1423,9 @@ export type UpdateBackendData = { }; }; -export type UpdateBackendResponse = (entity_Backend); +export type UpdateBackendResponse = ((handler_Response & { + data?: entity_Backend; +})); export type UpdateBackendError = (unknown); @@ -1283,6 +1439,14 @@ export type ListModuleData = { * Module name to filter module list by. Default to all modules. */ moduleName?: string; + /** + * The current page to fetch. Default to 1 + */ + page?: number; + /** + * The size of the page. Default to 10 + */ + pageSize?: number; /** * Workspace ID to filter module list by. Default to all workspaces. */ @@ -1290,7 +1454,9 @@ export type ListModuleData = { }; }; -export type ListModuleResponse = (Array); +export type ListModuleResponse = ((handler_Response & { + data?: response_PaginatedModuleResponse; +})); export type ListModuleError = (unknown); @@ -1301,7 +1467,9 @@ export type CreateModuleData = { body: request_CreateModuleRequest; }; -export type CreateModuleResponse = (entity_Module); +export type CreateModuleResponse = ((handler_Response & { + data?: entity_Module; +})); export type CreateModuleError = (unknown); @@ -1314,7 +1482,9 @@ export type DeleteModuleData = { }; }; -export type DeleteModuleResponse = (string); +export type DeleteModuleResponse = ((handler_Response & { + data?: string; +})); export type DeleteModuleError = (unknown); @@ -1327,7 +1497,9 @@ export type GetModuleData = { }; }; -export type GetModuleResponse = (entity_Module); +export type GetModuleResponse = ((handler_Response & { + data?: entity_Module; +})); export type GetModuleError = (unknown); @@ -1344,11 +1516,28 @@ export type UpdateModuleData = { }; }; -export type UpdateModuleResponse = (entity_Module); +export type UpdateModuleResponse = ((handler_Response & { + data?: entity_Module; +})); export type UpdateModuleError = (unknown); -export type ListOrganizationResponse = (Array); +export type ListOrganizationData = { + query?: { + /** + * The current page to fetch. Default to 1 + */ + page?: number; + /** + * The size of the page. Default to 10 + */ + pageSize?: number; + }; +}; + +export type ListOrganizationResponse = ((handler_Response & { + data?: response_PaginatedOrganizationResponse; +})); export type ListOrganizationError = (unknown); @@ -1359,7 +1548,9 @@ export type CreateOrganizationData = { body: request_CreateOrganizationRequest; }; -export type CreateOrganizationResponse = (entity_Organization); +export type CreateOrganizationResponse = ((handler_Response & { + data?: entity_Organization; +})); export type CreateOrganizationError = (unknown); @@ -1372,7 +1563,9 @@ export type DeleteOrganizationData = { }; }; -export type DeleteOrganizationResponse = (string); +export type DeleteOrganizationResponse = ((handler_Response & { + data?: string; +})); export type DeleteOrganizationError = (unknown); @@ -1385,7 +1578,9 @@ export type GetOrganizationData = { }; }; -export type GetOrganizationResponse = (entity_Organization); +export type GetOrganizationResponse = ((handler_Response & { + data?: entity_Organization; +})); export type GetOrganizationError = (unknown); @@ -1402,7 +1597,9 @@ export type UpdateOrganizationData = { }; }; -export type UpdateOrganizationResponse = (entity_Organization); +export type UpdateOrganizationResponse = ((handler_Response & { + data?: entity_Organization; +})); export type UpdateOrganizationError = (unknown); @@ -1416,10 +1613,20 @@ export type ListProjectData = { * OrganizationID to filter project list by. Default to all projects. */ orgID?: number; + /** + * The current page to fetch. Default to 1 + */ + page?: number; + /** + * The size of the page. Default to 10 + */ + pageSize?: number; }; }; -export type ListProjectResponse = (Array); +export type ListProjectResponse = ((handler_Response & { + data?: Array; +})); export type ListProjectError = (unknown); @@ -1430,7 +1637,9 @@ export type CreateProjectData = { body: request_CreateProjectRequest; }; -export type CreateProjectResponse = (entity_Project); +export type CreateProjectResponse = ((handler_Response & { + data?: entity_Project; +})); export type CreateProjectError = (unknown); @@ -1443,7 +1652,9 @@ export type DeleteProjectData = { }; }; -export type DeleteProjectResponse = (string); +export type DeleteProjectResponse = ((handler_Response & { + data?: string; +})); export type DeleteProjectError = (unknown); @@ -1456,7 +1667,9 @@ export type GetProjectData = { }; }; -export type GetProjectResponse = (entity_Project); +export type GetProjectResponse = ((handler_Response & { + data?: entity_Project; +})); export type GetProjectError = (unknown); @@ -1473,11 +1686,28 @@ export type UpdateProjectData = { }; }; -export type UpdateProjectResponse = (entity_Project); +export type UpdateProjectResponse = ((handler_Response & { + data?: entity_Project; +})); export type UpdateProjectError = (unknown); -export type ListResourceResponse = (entity_Resource); +export type ListResourceData = { + query?: { + /** + * The current page to fetch. Default to 1 + */ + page?: number; + /** + * The size of the page. Default to 10 + */ + pageSize?: number; + }; +}; + +export type ListResourceResponse = ((handler_Response & { + data?: Array; +})); export type ListResourceError = (unknown); @@ -1490,7 +1720,9 @@ export type GetResourceData = { }; }; -export type GetResourceResponse = (entity_Resource); +export type GetResourceResponse = ((handler_Response & { + data?: entity_Resource; +})); export type GetResourceError = (unknown); @@ -1503,7 +1735,9 @@ export type GetResourceGraphData = { }; }; -export type GetResourceGraphResponse = (entity_ResourceGraph); +export type GetResourceGraphResponse = ((handler_Response & { + data?: entity_ResourceGraph; +})); export type GetResourceGraphError = (unknown); @@ -1516,7 +1750,9 @@ export type GetRunData = { }; }; -export type GetRunResponse = (entity_Run); +export type GetRunResponse = ((handler_Response & { + data?: entity_Run; +})); export type GetRunError = (unknown); @@ -1529,12 +1765,22 @@ export type GetRunResultData = { }; }; -export type GetRunResultResponse = (entity_Run); +export type GetRunResultResponse = ((handler_Response & { + data?: unknown; +})); export type GetRunResultError = (unknown); export type ListSourceData = { query?: { + /** + * The current page to fetch. Default to 1 + */ + page?: number; + /** + * The size of the page. Default to 10 + */ + pageSize?: number; /** * Source name to filter source list by. Default to all sources. */ @@ -1542,7 +1788,9 @@ export type ListSourceData = { }; }; -export type ListSourceResponse = (entity_Source); +export type ListSourceResponse = ((handler_Response & { + data?: response_PaginatedSourceResponse; +})); export type ListSourceError = (unknown); @@ -1553,7 +1801,9 @@ export type CreateSourceData = { body: request_CreateSourceRequest; }; -export type CreateSourceResponse = (entity_Source); +export type CreateSourceResponse = ((handler_Response & { + data?: entity_Source; +})); export type CreateSourceError = (unknown); @@ -1566,7 +1816,9 @@ export type DeleteSourceData = { }; }; -export type DeleteSourceResponse = (entity_Source); +export type DeleteSourceResponse = ((handler_Response & { + data?: string; +})); export type DeleteSourceError = (unknown); @@ -1579,7 +1831,9 @@ export type GetSourceData = { }; }; -export type GetSourceResponse = (entity_Source); +export type GetSourceResponse = ((handler_Response & { + data?: entity_Source; +})); export type GetSourceError = (unknown); @@ -1596,7 +1850,9 @@ export type UpdateSourceData = { }; }; -export type UpdateSourceResponse = (entity_Source); +export type UpdateSourceResponse = ((handler_Response & { + data?: entity_Source; +})); export type UpdateSourceError = (unknown); @@ -1618,6 +1874,14 @@ export type ListRunData = { * OrgID to filter runs by. Default to all */ orgID?: number; + /** + * The current page to fetch. Default to 1 + */ + page?: number; + /** + * The size of the page. Default to 10 + */ + pageSize?: number; /** * ProjectID to filter runs by. Default to all */ @@ -1626,6 +1890,10 @@ export type ListRunData = { * ProjectName to filter runs by. Default to all */ projectName?: string; + /** + * StackID to filter runs by. Default to all + */ + stackID?: number; /** * StartTime to filter runs by. Default to all. Format: RFC3339 */ @@ -1638,10 +1906,16 @@ export type ListRunData = { * RunType to filter runs by. Default to all */ type?: Array; + /** + * Workspace to filter runs by. Default to all + */ + workspace?: string; }; }; -export type ListRunResponse = (Array); +export type ListRunResponse = ((handler_Response & { + data?: response_PaginatedRunResponse; +})); export type ListRunError = (unknown); @@ -1659,6 +1933,14 @@ export type ListStackData = { * OrgID to filter stacks by. Default to all */ orgID?: number; + /** + * The current page to fetch. Default to 1 + */ + page?: number; + /** + * The size of the page. Default to 10 + */ + pageSize?: number; /** * ProjectID to filter stacks by. Default to all */ @@ -1670,7 +1952,9 @@ export type ListStackData = { }; }; -export type ListStackResponse = (Array); +export type ListStackResponse = ((handler_Response & { + data?: response_PaginatedStackResponse; +})); export type ListStackError = (unknown); @@ -1691,7 +1975,9 @@ export type CreateStackData = { }; }; -export type CreateStackResponse = (entity_Stack); +export type CreateStackResponse = ((handler_Response & { + data?: entity_Stack; +})); export type CreateStackError = (unknown); @@ -1704,7 +1990,9 @@ export type DeleteStackData = { }; }; -export type DeleteStackResponse = (string); +export type DeleteStackResponse = ((handler_Response & { + data?: string; +})); export type DeleteStackError = (unknown); @@ -1717,7 +2005,9 @@ export type GetStackData = { }; }; -export type GetStackResponse = (entity_Stack); +export type GetStackResponse = ((handler_Response & { + data?: entity_Stack; +})); export type GetStackError = (unknown); @@ -1734,7 +2024,9 @@ export type UpdateStackData = { }; }; -export type UpdateStackResponse = (entity_Stack); +export type UpdateStackResponse = ((handler_Response & { + data?: entity_Stack; +})); export type UpdateStackError = (unknown); @@ -1773,7 +2065,9 @@ export type ApplyStackData = { }; }; -export type ApplyStackResponse = (string); +export type ApplyStackResponse = ((handler_Response & { + data?: string; +})); export type ApplyStackError = (unknown); @@ -1812,7 +2106,9 @@ export type ApplyStackAsyncData = { }; }; -export type ApplyStackAsyncResponse = (entity_Run); +export type ApplyStackAsyncResponse = ((handler_Response & { + data?: entity_Run; +})); export type ApplyStackAsyncError = (unknown); @@ -1839,7 +2135,9 @@ export type DestroyStackData = { }; }; -export type DestroyStackResponse = (string); +export type DestroyStackResponse = ((handler_Response & { + data?: string; +})); export type DestroyStackError = (unknown); @@ -1866,7 +2164,9 @@ export type DestroyStackAsyncData = { }; }; -export type DestroyStackAsyncResponse = (string); +export type DestroyStackAsyncResponse = ((handler_Response & { + data?: entity_Run; +})); export type DestroyStackAsyncError = (unknown); @@ -1893,7 +2193,9 @@ export type GenerateStackData = { }; }; -export type GenerateStackResponse = (kusionstack_io_kusion_pkg_apis_api_kusion_io_v1_Spec); +export type GenerateStackResponse = ((handler_Response & { + data?: kusionstack_io_kusion_pkg_apis_api_kusion_io_v1_Spec; +})); export type GenerateStackError = (unknown); @@ -1920,7 +2222,9 @@ export type GenerateStackAsyncData = { }; }; -export type GenerateStackAsyncResponse = (kusionstack_io_kusion_pkg_apis_api_kusion_io_v1_Spec); +export type GenerateStackAsyncResponse = ((handler_Response & { + data?: entity_Run; +})); export type GenerateStackAsyncError = (unknown); @@ -1963,11 +2267,28 @@ export type PreviewStackAsyncData = { }; }; -export type PreviewStackAsyncResponse = (entity_Run); +export type PreviewStackAsyncResponse = ((handler_Response & { + data?: entity_Run; +})); export type PreviewStackAsyncError = (unknown); -export type ListWorkspaceResponse = (entity_Workspace); +export type ListWorkspaceData = { + query?: { + /** + * The current page to fetch. Default to 1 + */ + page?: number; + /** + * The size of the page. Default to 10 + */ + pageSize?: number; + }; +}; + +export type ListWorkspaceResponse = ((handler_Response & { + data?: response_PaginatedWorkspaceResponse; +})); export type ListWorkspaceError = (unknown); @@ -1978,7 +2299,9 @@ export type CreateWorkspaceData = { body: request_CreateWorkspaceRequest; }; -export type CreateWorkspaceResponse = (entity_Workspace); +export type CreateWorkspaceResponse = ((handler_Response & { + data?: entity_Workspace; +})); export type CreateWorkspaceError = (unknown); @@ -1991,7 +2314,9 @@ export type DeleteWorkspaceData = { }; }; -export type DeleteWorkspaceResponse = (string); +export type DeleteWorkspaceResponse = ((handler_Response & { + data?: string; +})); export type DeleteWorkspaceError = (unknown); @@ -2004,7 +2329,9 @@ export type GetWorkspaceData = { }; }; -export type GetWorkspaceResponse = (entity_Workspace); +export type GetWorkspaceResponse = ((handler_Response & { + data?: entity_Workspace; +})); export type GetWorkspaceError = (unknown); @@ -2021,7 +2348,9 @@ export type UpdateWorkspaceData = { }; }; -export type UpdateWorkspaceResponse = (entity_Workspace); +export type UpdateWorkspaceResponse = ((handler_Response & { + data?: entity_Workspace; +})); export type UpdateWorkspaceError = (unknown);