@@ -14,12 +14,7 @@ import { ssmJson, ssmYaml } from '../../shared/constants'
14
14
import * as localizedText from '../../shared/localizedText'
15
15
import { getLogger , Logger } from '../../shared/logger'
16
16
import { RegionProvider } from '../../shared/regions/regionProvider'
17
- import {
18
- DefaultPublishSSMDocumentWizardContext ,
19
- PublishSSMDocumentWizard ,
20
- PublishSSMDocumentWizardContext ,
21
- PublishSSMDocumentWizardResponse ,
22
- } from '../wizards/publishDocumentWizard'
17
+ import { PublishSSMDocumentWizard , PublishSSMDocumentWizardResponse } from '../wizards/publishDocumentWizard'
23
18
import * as telemetry from '../../shared/telemetry/telemetry'
24
19
import { Window } from '../../shared/vscode/window'
25
20
import { showConfirmationMessage } from '../util/util'
@@ -56,17 +51,11 @@ export async function publishSSMDocument(awsContext: AwsContext, regionProvider:
56
51
}
57
52
58
53
try {
59
- const wizardContext : PublishSSMDocumentWizardContext = new DefaultPublishSSMDocumentWizardContext (
60
- awsContext ,
61
- regionProvider
62
- )
63
- const wizardResponse : PublishSSMDocumentWizardResponse | undefined = await new PublishSSMDocumentWizard (
64
- wizardContext
65
- ) . run ( )
66
- if ( wizardResponse ?. PublishSsmDocAction == 'Create' ) {
67
- await createDocument ( wizardResponse , textDocument )
68
- } else if ( wizardResponse ?. PublishSsmDocAction == 'Update' ) {
69
- await updateDocument ( wizardResponse , textDocument )
54
+ const response = await new PublishSSMDocumentWizard ( ) . run ( )
55
+ if ( response ?. action == 'Create' ) {
56
+ await createDocument ( response , textDocument )
57
+ } else if ( response ?. action == 'Update' ) {
58
+ await updateDocument ( response , textDocument )
70
59
}
71
60
} catch ( err ) {
72
61
logger . error ( err as Error )
@@ -79,7 +68,7 @@ export async function createDocument(
79
68
client : SsmDocumentClient = globals . toolkitClientBuilder . createSsmClient ( wizardResponse . region )
80
69
) {
81
70
let result : telemetry . Result = 'Succeeded'
82
- const ssmOperation : telemetry . SsmOperation = wizardResponse . PublishSsmDocAction as telemetry . SsmOperation
71
+ const ssmOperation = wizardResponse . action as telemetry . SsmOperation
83
72
84
73
const logger : Logger = getLogger ( )
85
74
logger . info ( `Creating Systems Manager Document '${ wizardResponse . name } '` )
@@ -114,7 +103,7 @@ export async function updateDocument(
114
103
window = Window . vscode ( )
115
104
) {
116
105
let result : telemetry . Result = 'Succeeded'
117
- const ssmOperation : telemetry . SsmOperation = wizardResponse . PublishSsmDocAction as telemetry . SsmOperation
106
+ const ssmOperation = wizardResponse . action as telemetry . SsmOperation
118
107
119
108
const logger : Logger = getLogger ( )
120
109
logger . info ( `Updating Systems Manager Document '${ wizardResponse . name } '` )
0 commit comments