機械翻訳について

ログイン・エージェントのユーザー名の取得

TypeScriptの例を次に示します:

/// <reference path="uiEventsFramework.d.ts"/>
     
const frameworkProvider: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');      
const globalContext: IGlobalContext = await frameworkProvider.getGlobalContext();
const requestObject: IOperationRequest = frameworkProvider.requestHelper.createPublishRequest('GetAgentInfo') as CX_SVC_UI_EVENTS_FRAMEWORK.IOperationRequest; 
globalContext.publish(requestObject).then((message: IOperationResponse) => { 
 	const response: IGetAgentInfoResponse = message as IGetAgentInfoResponse;
	console.log(response.getUserName()); // usage of getUserName
});

JavaScriptの例を次に示します:

const frameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');
const globalContext = await frameworkProvider.getGlobalContext();
const requestObject = frameworkProvider.requestHelper.createPublishRequest('GetAgentInfo');
globalContext.publish(requestObject).then((response) => {
	console.log(response.getUserName());
});