mirror of
https://github.com/r-ca/kidshift-skills.git
synced 2024-10-26 01:24:03 +00:00
parent
2cf5ca3b39
commit
bae37bc706
191
lambda/custom/index.js
Normal file
191
lambda/custom/index.js
Normal file
File diff suppressed because one or more lines are too long
16
lambda/custom/package.json
Normal file
16
lambda/custom/package.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
153
lambda/index.js
153
lambda/index.js
File diff suppressed because one or more lines are too long
|
@ -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
19
lambda/utils.js
Normal 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;
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user