Revert "deploy"

This reverts commit c763f72132.
This commit is contained in:
rca 2024-07-16 05:20:25 +09:00
parent 2cf5ca3b39
commit bae37bc706
5 changed files with 325 additions and 85 deletions

191
lambda/custom/index.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,16 @@
{
"name": "@amzn/hello-world",
"version": "1.2.0",
"description": "alexa utility for quickly building skills",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Amazon Alexa",
"license": "Apache License",
"dependencies": {
"ask-sdk-core": "^2.7.0",
"ask-sdk-model": "^1.19.0",
"aws-sdk": "^2.326.0"
}
}

File diff suppressed because one or more lines are too long

View File

@ -1 +1,28 @@
{"name":"@amzn/hello-world","description":"alexa utility for quickly building skills","version":"1.2.0","main":"index.js","license":"Apache License","dependencies":{"@types/node":"^20.14.10","@types/webpack":"^5.28.5","@types/webpack-node-externals":"^3.0.4","ask-sdk-core":"^2.7.0","ask-sdk-model":"^1.19.0","aws-sdk":"^2.326.0","pjson":"^1.0.9","ts-loader":"^9.5.1","ts-node":"^10.9.2","typescript":"^5.5.3","webpack":"^5.93.0","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"}}
{
"name": "@amzn/hello-world",
"version": "1.2.0",
"description": "alexa utility for quickly building skills",
"main": "index.js",
"scripts": {
"build": "webpack --config webpack.config.ts",
"pjson": "ts-node ./src/tools/gen-package-json.ts > ./lambda/custom/package.json",
"clean": "rm -rf ./lambda/custom/*"
},
"author": "Amazon Alexa",
"license": "Apache License",
"dependencies": {
"@types/node": "^20.14.10",
"@types/webpack": "^5.28.5",
"@types/webpack-node-externals": "^3.0.4",
"ask-sdk-core": "^2.7.0",
"ask-sdk-model": "^1.19.0",
"aws-sdk": "^2.326.0",
"pjson": "^1.0.9",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"typescript": "^5.5.3",
"webpack": "^5.93.0",
"webpack-cli": "^5.1.4",
"webpack-node-externals": "^3.0.0"
}
}

19
lambda/utils.js Normal file
View File

@ -0,0 +1,19 @@
const AWS = require('aws-sdk');
const s3SigV4Client = new AWS.S3({
signatureVersion: 'v4',
region: process.env.S3_PERSISTENCE_REGION
});
module.exports.getS3PreSignedUrl = function getS3PreSignedUrl(s3ObjectKey) {
const bucketName = process.env.S3_PERSISTENCE_BUCKET;
const s3PreSignedUrl = s3SigV4Client.getSignedUrl('getObject', {
Bucket: bucketName,
Key: s3ObjectKey,
Expires: 60*1 // the Expires is capped for 1 minute
});
console.log(`Util.s3PreSignedUrl: ${s3ObjectKey} URL ${s3PreSignedUrl}`);
return s3PreSignedUrl;
}