function addDeployNotificationsHandler()

in src/main.ts [112:132]


function addDeployNotificationsHandler(client: SqlOpsDataClient, commandObserver: CommandObserver) {
    const queryCompleteType: NotificationType<string, any> = new NotificationType('query/deployComplete');
	client.onNotification(queryCompleteType, (data: any) => {
        if (!data.batchSummaries.some(s => s.hasError)) {
            commandObserver.logToOutputChannel(localize('extension.DeployCompleted', 'Deployment completed successfully.'));
        }
    });

    const queryMessageType: NotificationType<string, any> = new NotificationType('query/deployMessage');
    client.onNotification(queryMessageType, (data: any) => {
        var messageText = data.message.isError ? localize('extension.deployErrorMessage', "Error: {0}", data.message.message) : localize('extension.deployMessage', "{0}", data.message.message);
        commandObserver.logToOutputChannel(messageText);
    });

    const queryBatchStartType: NotificationType<string, any> = new NotificationType('query/deployBatchStart');
    client.onNotification(queryBatchStartType, (data: any) => {
        if (data.batchSummary.selection) {
            commandObserver.logToOutputChannel(localize('extension.runQueryBatchStartMessage', "\nStarted executing query at {0}", data.batchSummary.selection.startLine + 1));
        }
    });
}