Skip to content

Commit a610c76

Browse files
authored
fix: correct naming (#9)
1 parent 94d6e8a commit a610c76

File tree

6 files changed

+344
-3
lines changed

6 files changed

+344
-3
lines changed

api/openapispec/docs.go

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3038,6 +3038,113 @@ const docTemplate = `{
30383038
}
30393039
},
30403040
"/api/v1/stacks/{stackID}/preview": {
3041+
"post": {
3042+
"description": "Preview stack information by stack ID",
3043+
"produces": [
3044+
"application/json"
3045+
],
3046+
"tags": [
3047+
"stack"
3048+
],
3049+
"summary": "Preview stack",
3050+
"operationId": "previewStack",
3051+
"parameters": [
3052+
{
3053+
"type": "integer",
3054+
"description": "Stack ID",
3055+
"name": "stackID",
3056+
"in": "path",
3057+
"required": true
3058+
},
3059+
{
3060+
"description": "The resources to import during the stack preview",
3061+
"name": "importedResources",
3062+
"in": "body",
3063+
"schema": {
3064+
"$ref": "#/definitions/request.StackImportRequest"
3065+
}
3066+
},
3067+
{
3068+
"type": "string",
3069+
"description": "The target workspace to preview the spec in.",
3070+
"name": "workspace",
3071+
"in": "query",
3072+
"required": true
3073+
},
3074+
{
3075+
"type": "boolean",
3076+
"description": "Import existing resources during the stack preview",
3077+
"name": "importResources",
3078+
"in": "query"
3079+
},
3080+
{
3081+
"type": "string",
3082+
"description": "Output format. Choices are: json, default. Default to default output format in Kusion.",
3083+
"name": "output",
3084+
"in": "query"
3085+
},
3086+
{
3087+
"type": "boolean",
3088+
"description": "Show detailed output",
3089+
"name": "detail",
3090+
"in": "query"
3091+
},
3092+
{
3093+
"type": "string",
3094+
"description": "The Spec ID to use for the preview. Default to the last one generated.",
3095+
"name": "specID",
3096+
"in": "query"
3097+
},
3098+
{
3099+
"type": "boolean",
3100+
"description": "Force the preview even when the stack is locked",
3101+
"name": "force",
3102+
"in": "query"
3103+
}
3104+
],
3105+
"responses": {
3106+
"200": {
3107+
"description": "Success",
3108+
"schema": {
3109+
"allOf": [
3110+
{
3111+
"$ref": "#/definitions/handler.Response"
3112+
},
3113+
{
3114+
"type": "object",
3115+
"properties": {
3116+
"data": {
3117+
"$ref": "#/definitions/models.Changes"
3118+
}
3119+
}
3120+
}
3121+
]
3122+
}
3123+
},
3124+
"400": {
3125+
"description": "Bad Request",
3126+
"schema": {}
3127+
},
3128+
"401": {
3129+
"description": "Unauthorized",
3130+
"schema": {}
3131+
},
3132+
"404": {
3133+
"description": "Not Found",
3134+
"schema": {}
3135+
},
3136+
"429": {
3137+
"description": "Too Many Requests",
3138+
"schema": {}
3139+
},
3140+
"500": {
3141+
"description": "Internal Server Error",
3142+
"schema": {}
3143+
}
3144+
}
3145+
}
3146+
},
3147+
"/api/v1/stacks/{stackID}/preview/async": {
30413148
"post": {
30423149
"description": "Start a run and asynchronously preview stack changes by stack ID",
30433150
"produces": [

api/openapispec/swagger.json

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3027,6 +3027,113 @@
30273027
}
30283028
},
30293029
"/api/v1/stacks/{stackID}/preview": {
3030+
"post": {
3031+
"description": "Preview stack information by stack ID",
3032+
"produces": [
3033+
"application/json"
3034+
],
3035+
"tags": [
3036+
"stack"
3037+
],
3038+
"summary": "Preview stack",
3039+
"operationId": "previewStack",
3040+
"parameters": [
3041+
{
3042+
"type": "integer",
3043+
"description": "Stack ID",
3044+
"name": "stackID",
3045+
"in": "path",
3046+
"required": true
3047+
},
3048+
{
3049+
"description": "The resources to import during the stack preview",
3050+
"name": "importedResources",
3051+
"in": "body",
3052+
"schema": {
3053+
"$ref": "#/definitions/request.StackImportRequest"
3054+
}
3055+
},
3056+
{
3057+
"type": "string",
3058+
"description": "The target workspace to preview the spec in.",
3059+
"name": "workspace",
3060+
"in": "query",
3061+
"required": true
3062+
},
3063+
{
3064+
"type": "boolean",
3065+
"description": "Import existing resources during the stack preview",
3066+
"name": "importResources",
3067+
"in": "query"
3068+
},
3069+
{
3070+
"type": "string",
3071+
"description": "Output format. Choices are: json, default. Default to default output format in Kusion.",
3072+
"name": "output",
3073+
"in": "query"
3074+
},
3075+
{
3076+
"type": "boolean",
3077+
"description": "Show detailed output",
3078+
"name": "detail",
3079+
"in": "query"
3080+
},
3081+
{
3082+
"type": "string",
3083+
"description": "The Spec ID to use for the preview. Default to the last one generated.",
3084+
"name": "specID",
3085+
"in": "query"
3086+
},
3087+
{
3088+
"type": "boolean",
3089+
"description": "Force the preview even when the stack is locked",
3090+
"name": "force",
3091+
"in": "query"
3092+
}
3093+
],
3094+
"responses": {
3095+
"200": {
3096+
"description": "Success",
3097+
"schema": {
3098+
"allOf": [
3099+
{
3100+
"$ref": "#/definitions/handler.Response"
3101+
},
3102+
{
3103+
"type": "object",
3104+
"properties": {
3105+
"data": {
3106+
"$ref": "#/definitions/models.Changes"
3107+
}
3108+
}
3109+
}
3110+
]
3111+
}
3112+
},
3113+
"400": {
3114+
"description": "Bad Request",
3115+
"schema": {}
3116+
},
3117+
"401": {
3118+
"description": "Unauthorized",
3119+
"schema": {}
3120+
},
3121+
"404": {
3122+
"description": "Not Found",
3123+
"schema": {}
3124+
},
3125+
"429": {
3126+
"description": "Too Many Requests",
3127+
"schema": {}
3128+
},
3129+
"500": {
3130+
"description": "Internal Server Error",
3131+
"schema": {}
3132+
}
3133+
}
3134+
}
3135+
},
3136+
"/api/v1/stacks/{stackID}/preview/async": {
30303137
"post": {
30313138
"description": "Start a run and asynchronously preview stack changes by stack ID",
30323139
"produces": [

api/openapispec/swagger.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3394,6 +3394,77 @@ paths:
33943394
tags:
33953395
- stack
33963396
/api/v1/stacks/{stackID}/preview:
3397+
post:
3398+
description: Preview stack information by stack ID
3399+
operationId: previewStack
3400+
parameters:
3401+
- description: Stack ID
3402+
in: path
3403+
name: stackID
3404+
required: true
3405+
type: integer
3406+
- description: The resources to import during the stack preview
3407+
in: body
3408+
name: importedResources
3409+
schema:
3410+
$ref: '#/definitions/request.StackImportRequest'
3411+
- description: The target workspace to preview the spec in.
3412+
in: query
3413+
name: workspace
3414+
required: true
3415+
type: string
3416+
- description: Import existing resources during the stack preview
3417+
in: query
3418+
name: importResources
3419+
type: boolean
3420+
- description: 'Output format. Choices are: json, default. Default to default
3421+
output format in Kusion.'
3422+
in: query
3423+
name: output
3424+
type: string
3425+
- description: Show detailed output
3426+
in: query
3427+
name: detail
3428+
type: boolean
3429+
- description: The Spec ID to use for the preview. Default to the last one generated.
3430+
in: query
3431+
name: specID
3432+
type: string
3433+
- description: Force the preview even when the stack is locked
3434+
in: query
3435+
name: force
3436+
type: boolean
3437+
produces:
3438+
- application/json
3439+
responses:
3440+
"200":
3441+
description: Success
3442+
schema:
3443+
allOf:
3444+
- $ref: '#/definitions/handler.Response'
3445+
- properties:
3446+
data:
3447+
$ref: '#/definitions/models.Changes'
3448+
type: object
3449+
"400":
3450+
description: Bad Request
3451+
schema: {}
3452+
"401":
3453+
description: Unauthorized
3454+
schema: {}
3455+
"404":
3456+
description: Not Found
3457+
schema: {}
3458+
"429":
3459+
description: Too Many Requests
3460+
schema: {}
3461+
"500":
3462+
description: Internal Server Error
3463+
schema: {}
3464+
summary: Preview stack
3465+
tags:
3466+
- stack
3467+
/api/v1/stacks/{stackID}/preview/async:
33973468
post:
33983469
description: Start a run and asynchronously preview stack changes by stack ID
33993470
operationId: previewStackAsync

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kusionstack/kusion-api-client-sdk",
3-
"version": "1.1.3",
3+
"version": "1.1.4",
44
"description": "Kusion API Client SDK",
55
"main": "dist/src/client/index.js",
66
"types": "dist/src/client/index.d.ts",

src/client/sdk.gen.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This file is auto-generated by @hey-api/openapi-ts
22

33
import { createClient, createConfig, type OptionsLegacyParser } from '@hey-api/client-fetch';
4-
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';
4+
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, PreviewStackData, PreviewStackError, PreviewStackResponse, 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';
55

66
export const client = createClient(createConfig());
77

@@ -503,14 +503,25 @@ export class StackService {
503503
});
504504
}
505505

506+
/**
507+
* Preview stack
508+
* Preview stack information by stack ID
509+
*/
510+
public static previewStack<ThrowOnError extends boolean = false>(options: OptionsLegacyParser<PreviewStackData, ThrowOnError>) {
511+
return (options?.client ?? client).post<PreviewStackResponse, PreviewStackError, ThrowOnError>({
512+
...options,
513+
url: '/api/v1/stacks/{stackID}/preview'
514+
});
515+
}
516+
506517
/**
507518
* Asynchronously preview stack
508519
* Start a run and asynchronously preview stack changes by stack ID
509520
*/
510521
public static previewStackAsync<ThrowOnError extends boolean = false>(options: OptionsLegacyParser<PreviewStackAsyncData, ThrowOnError>) {
511522
return (options?.client ?? client).post<PreviewStackAsyncResponse, PreviewStackAsyncError, ThrowOnError>({
512523
...options,
513-
url: '/api/v1/stacks/{stackID}/preview'
524+
url: '/api/v1/stacks/{stackID}/preview/async'
514525
});
515526
}
516527

0 commit comments

Comments
 (0)