This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!bin/bash | |
# BrowserStack SSH Tunnel Setup | |
# Find key by logging into BrowserStack --> finding command line setup info | |
KEY=[YOUR_KEY_HERE] | |
# Add internal hosts here | |
INTERNAL_HOSTS=stgwebus | |
# Change argument to add +1 internal host: ${host}.[hostname].com,80,0,${host}.example.com,443,1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Lambda 1 - arv-foo | |
// Synchronous fn that will back API Gateway endpoint. | |
const AWS = require('aws-sdk'); | |
const lambda = new AWS.Lambda(); | |
const getRandomInt = (max) => Math.floor(Math.random() * Math.floor(max)); | |
exports.handler = async (event, context) => { | |
console.log("event:", event) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"action_id": "44f40b4a-65e9-479a-b2bf-40ec57111c88", | |
"interaction_id": "667187cd-55b8-4eb7-8476-7a76564587d4", | |
"project": { | |
"id": "4c267d96-2fe6-4764-8d8a-a33849cd05d8" | |
}, | |
"resource": { | |
"id": "3188b2f6-214d-480b-b8e2-0b985039b079", | |
"type": "asset" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AWS = require('aws-sdk'); | |
const fetch = require('node-fetch'); | |
async function fetchAsset (id) { | |
const token = process.env.FRAMEIO_TOKEN; | |
let url = `http://api.frame.io/v2/assets/${id}`; | |
let requestOptions = { | |
method: 'GET', | |
headers: { | |
'Content-Type': 'application/json', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { fetchAsset, invokeLambda } = require('./modules/api'); | |
exports.handler = async function (event, context) { | |
// Save the X-ray Trace ID and and this Lambda's function name. | |
// We'll pass them to our second 'file handler' Lambda. | |
const firstLambdaTraceID = process.env._X_AMZN_TRACE_ID; | |
const caller = context.functionName; | |
let id = JSON.parse(event.body).resource.id; | |
let { url, name} = await fetchAsset(id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { s3Uploader } = require('./modules/api'); | |
exports.handler = async (event) => { | |
let { caller, firstLambdaTraceID, url, name } = event; | |
// Logs for convenient searching in X-Ray and CloudWatch | |
console.log(`Second Lambda trace ID: ${process.env._X_AMZN_TRACE_ID}`); | |
console.log(`Called by ${caller} with trace ID: ${firstLambdaTraceID}. Begin uploading ${name}...`); | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note: this sample code is in the process of being re-written | |
// and assumes a client SDK is available to wrap API requests | |
// such as createFolder(). The intent is simply to provide | |
// convenience methods, but you can also write your own API requests | |
// as shown in this example: https://github.com/Frameio/custom-actions-example-app/blob/ks/DEVREL-589/examples/custom-action-offload-to-s3/modules/api.js | |
const apiClient = require('./api/client.js') | |
const template = require('./templates/onlineTemplate.json') | |
function createProject(name, teamId) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Grade", | |
"type": "project", | |
"folders": [ | |
{ | |
"name": "Online", | |
"type": "folder" | |
}, | |
{ |
OlderNewer