forked from aws/aws-toolkit-vscode
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a new template for invoking a lambda with a payload, included V…
…ue.js for clientside parts of project, add an ExtensionUtilities class, and refactored some of the client portions.
- Loading branch information
1 parent
0f436f4
commit 4325484
Showing
14 changed files
with
399 additions
and
24 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
out | ||
node_modules | ||
.DS_Store | ||
.vscode-test/ | ||
*.vsix |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
'use strict'; | ||
/* | ||
This script is called from npm run compile. | ||
It adds clientside libraries to ./media/libs. | ||
*/ | ||
const fs = require('fs-extra'); | ||
const path = require('path'); | ||
const _ = require('lodash'); | ||
|
||
const DEPS = [{ | ||
name: 'vue.min.js', | ||
path: 'vue/dist/vue.min.js' | ||
} | ||
]; | ||
const workingDir = path.join(__dirname, '..'); | ||
const nodeModulesDir = path.join(workingDir, 'node_modules'); | ||
const libraryDir = path.join(workingDir, 'media', 'libs'); | ||
(async () => { | ||
const work = []; | ||
_.forEach(DEPS, (dep) => { | ||
const depPath = path.join(nodeModulesDir, dep.path); | ||
console.log(`Copying ${depPath} to ${libraryDir}`); | ||
work.push(fs.copy(depPath, path.join(libraryDir, dep.name))); | ||
}); | ||
try { | ||
await Promise.all(work); | ||
console.log('Successfully copied all clientside dependencies.'); | ||
} catch (e) { | ||
console.error('Error when copying clientside dependencies.'); | ||
console.error(e); | ||
} | ||
})(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
console.log('Loaded!'); | ||
(function () { | ||
const vscode = acquireVsCodeApi(); | ||
const app = new Vue({ | ||
el: '#app', | ||
data: { | ||
selectedSampleRequest: {}, | ||
sampleText: "" | ||
}, | ||
mounted() { | ||
this.$nextTick(function () { | ||
window.addEventListener('message', this.handleMessageReceived); | ||
}) | ||
}, | ||
methods: { | ||
newSelection: function () { | ||
vscode.postMessage({ | ||
command: 'sampleRequestSelected', | ||
value: this.selectedSampleRequest | ||
}) | ||
}, | ||
handleMessageReceived: function (e) { | ||
const message = event.data; | ||
console.log(message.command); | ||
console.log(message.sample); | ||
switch (message.command) { | ||
case 'loadedSample': | ||
this.loadSampleText(message.sample); | ||
break; | ||
} | ||
}, | ||
loadSampleText: function (txt) { | ||
this.sampleText = txt; | ||
}, | ||
sendInput: function() { | ||
console.log(this.sampleText); | ||
vscode.postMessage({ | ||
command: 'invokeLambda', | ||
value: this.sampleText | ||
}) | ||
} | ||
} | ||
}); | ||
})(); |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<requests> | ||
<request category="AWS"> | ||
<name>API Gateway AWS Proxy</name> | ||
<filename>APIGatewayAWSProxy.json</filename> | ||
</request> | ||
<request category="AWS"> | ||
<name>API Gateway Authorizer</name> | ||
<filename>APIGatewayAuthorizer.json</filename> | ||
</request> | ||
<request category="AWS"> | ||
<name>Rekognition S3 Request</name> | ||
<filename>RekognitionS3Request.json</filename> | ||
</request> | ||
<request category="AWS"> | ||
<name>CodeCommit</name> | ||
<filename>CodeCommit.json</filename> | ||
</request> | ||
<request category="AWS"> | ||
<name>CloudFormation Create Request</name> | ||
<filename>CloudFormationCreateRequest.json</filename> | ||
</request> | ||
<request category="AWS"> | ||
<name>SES Email Receiving</name> | ||
<filename>SESEmailReceiving.json</filename> | ||
</request> | ||
<request category="AWS"> | ||
<name>Scheduled Event</name> | ||
<filename>ScheduledEvent.json</filename> | ||
</request> | ||
<request category="AWS"> | ||
<name>CloudWatch Logs</name> | ||
<filename>CloudWatchLogs.json</filename> | ||
</request> | ||
<request category="AWS"> | ||
<name>SNS</name> | ||
<filename>SNS.json</filename> | ||
</request> | ||
<request category="AWS"> | ||
<name>DynamoDB Update</name> | ||
<filename>DynamoDBUpdate.json</filename> | ||
</request> | ||
<request category="AWS"> | ||
<name>Cognito Sync Trigger</name> | ||
<filename>CognitoSyncTrigger.json</filename> | ||
</request> | ||
<request category="AWS"> | ||
<name>Kinesis</name> | ||
<filename>Kinesis.json</filename> | ||
</request> | ||
<request category="AWS"> | ||
<name>Kinesis Firehose</name> | ||
<filename>KinesisFirehose.json</filename> | ||
</request> | ||
<request category="AWS"> | ||
<name>S3 Put</name> | ||
<filename>S3Put.json</filename> | ||
</request> | ||
<request category="AWS"> | ||
<name>S3 Delete</name> | ||
<filename>S3Delete.json</filename> | ||
</request> | ||
<request category="AWS"> | ||
<name>AWS Config Periodic Rule</name> | ||
<filename>AWSConfigPeriodicRule.json</filename> | ||
</request> | ||
<request category="AWS"> | ||
<name>AWS Config Change Trigger Rule</name> | ||
<filename>AWSConfigChangeTriggerRule.json</filename> | ||
</request> | ||
<request category="Lex"> | ||
<name>Lex Book Car</name> | ||
<filename>LexBookCar.json</filename> | ||
</request> | ||
<request category="Lex"> | ||
<name>Lex Book Hotel</name> | ||
<filename>LexBookHotel.json</filename> | ||
</request> | ||
<request category="Lex"> | ||
<name>Order Flowers</name> | ||
<filename>OrderFlowers.json</filename> | ||
</request> | ||
<request category="Alexa"> | ||
<name>Alexa Start Session</name> | ||
<filename>AlexaStartSession.json</filename> | ||
</request> | ||
<request category="Alexa"> | ||
<name>Alexa End Session</name> | ||
<filename>AlexaEndSession.json</filename> | ||
</request> | ||
<request category="Alexa"> | ||
<name>Alexa Smart Home - Control</name> | ||
<filename>AlexaSmartHomeControl.json</filename> | ||
</request> | ||
<request category="Alexa"> | ||
<name>Alexa Intent - MyColorIs</name> | ||
<filename>AlexaIntentMyColorIs.json</filename> | ||
</request> | ||
<request category="Common"> | ||
<name>Hello World</name> | ||
<filename>HelloWorld.json</filename> | ||
</request> | ||
<request category="Common"> | ||
<name>Mobile Backend</name> | ||
<filename>MobileBackend.json</filename> | ||
</request> | ||
</requests> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
'use strict'; | ||
import { hostedFilesBaseUrl } from "../shared/constants"; | ||
|
||
export const blueprintsManifestPath: string = 'LambdaSampleFunctions/NETCore/msbuild-v4/vs-lambda-blueprint-manifest.xml'; | ||
export const sampleRequestBase: string = 'LambdaSampleFunctions/SampleRequests'; | ||
export const sampleRequestPath: string = `${hostedFilesBaseUrl}${sampleRequestBase}/`; | ||
export const sampleRequestManifestPath: string = `${hostedFilesBaseUrl}${sampleRequestBase}/manifest.xml`; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export class SampleRequest { | ||
public name: string | undefined; | ||
public filename: string | undefined; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import * as vscode from 'vscode'; | ||
export class ScriptResource { | ||
public Uri: vscode.Uri | undefined; | ||
public Nonce: string | undefined; | ||
} |
Oops, something went wrong.