Lambdaパッケージのバージョン差分について

reviver
Tera Contributor

はじめまして

現在ServiceNowを使い始めたばかりです
知見のある皆様へお伺いさせて頂きたく 投稿しました
聞きたい項目は以下の通り

 

ServiceNow クラウド連絡先センター
Amazon Connect - セットアップ手順

上記、セットアップ手順 セットアップS3バケット において Lambdaパッケージをダウンロードしたが、Lambdaの構文が他環境と異なっており、トランスクリプトが有効にならない

現環境(トランスクリプト不稼働)と、他環境(トランスクリプト正常)において 差分を調べたが 原因に辿り着かず 苦慮しています
プラグインの問題なのか、知見をお持ちの方々にお伺いしたい
使っている環境は Washington DC

一部 Lambdaコードを記載します

トランスクリプト正常版 40行目〜
const commonResponseProcessing = function(codePath, httpResponse, responseHandler, e) {
const responseContainer = {};
responseContainer.statusCode = httpResponse.statusCode;
responseContainer.headers = httpResponse.headers;
try {
responseContainer.body = JSON.parse(body);
} catch (jpe) {
responseContainer.body = body;
}
var operationHandlerResponse = JSON.parse(body);
if (typeof operationHandlerResponse.result != 'undefined' &&
typeof operationHandlerResponse.result['interactionTable'] != 'undefined' &&
operationHandlerResponse.result['interactionId'] != null &&
settings.real_time_transcription && settings.real_time_transcription === 'true') {
insertContactIdInteractionIdMapping(operationHandlerResponse, settings);
}

==========
トランスクリプト不稼働版 34行目〜

const post_request = https.request(post_options, function(httpResponse) {
let body = '';
httpResponse.setEncoding('utf8');
httpResponse.on('data', function(chunk) {
body += chunk;
});
const commonResponseProcessing = function(codePath, httpResponse, responseHandler, e) {
const responseContainer = {};
responseContainer.statusCode = httpResponse.statusCode;
responseContainer.headers = httpResponse.headers;
try {
responseContainer.body = JSON.parse(body);
} catch (jpe) {
responseContainer.body = body;
}
var operationHandlerResponse = JSON.parse(body);
if (typeof operationHandlerResponse.result != 'undefined' &&
typeof operationHandlerResponse.result['interactionTable'] != 'undefined' &&
operationHandlerResponse.result['interactionId'] != null &&
snDynamoDbAPI._canUseDynamoDB(operationHandlerResponse, settings)){
snDynamoDbAPI.insertContactIdInteractionIdMapping(debugCtx, settings, operationHandlerResponse, responseHandler);
}
0 REPLIES 0