azure-functions-cli 1.0.0-beta.93 → 5.0.0-preview.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +263 -156
- package/lib/copy-metadata.js +9 -0
- package/lib/install.js +151 -0
- package/lib/main.js +42 -26
- package/npm-shrinkwrap.json +97 -0
- package/package.json +40 -20
- package/assets/azure-functions-logo-color-raster.png +0 -0
- package/bin/ARMClient.Authentication.dll +0 -0
- package/bin/ARMClient.Library.dll +0 -0
- package/bin/Autofac.Integration.WebApi.dll +0 -0
- package/bin/Autofac.dll +0 -0
- package/bin/Colors.Net.dll +0 -0
- package/bin/DocumentDB.Spatial.Sql.dll +0 -0
- package/bin/EdgeJs.dll +0 -0
- package/bin/FSharp.Compiler.Service.MSBuild.v12.dll +0 -0
- package/bin/FSharp.Compiler.Service.dll +0 -0
- package/bin/FSharp.Core.dll +0 -0
- package/bin/FluentCommandLineParser.dll +0 -0
- package/bin/Humanizer.dll +0 -0
- package/bin/Ignite.SharpNetSH.dll +0 -0
- package/bin/Microsoft.AspNet.WebHooks.Common.dll +0 -0
- package/bin/Microsoft.AspNet.WebHooks.Receivers.Azure.dll +0 -0
- package/bin/Microsoft.AspNet.WebHooks.Receivers.Bitbucket.dll +0 -0
- package/bin/Microsoft.AspNet.WebHooks.Receivers.Dropbox.dll +0 -0
- package/bin/Microsoft.AspNet.WebHooks.Receivers.DynamicsCRM.dll +0 -0
- package/bin/Microsoft.AspNet.WebHooks.Receivers.Generic.dll +0 -0
- package/bin/Microsoft.AspNet.WebHooks.Receivers.GitHub.dll +0 -0
- package/bin/Microsoft.AspNet.WebHooks.Receivers.Instagram.dll +0 -0
- package/bin/Microsoft.AspNet.WebHooks.Receivers.MailChimp.dll +0 -0
- package/bin/Microsoft.AspNet.WebHooks.Receivers.Pusher.dll +0 -0
- package/bin/Microsoft.AspNet.WebHooks.Receivers.Salesforce.dll +0 -0
- package/bin/Microsoft.AspNet.WebHooks.Receivers.Slack.dll +0 -0
- package/bin/Microsoft.AspNet.WebHooks.Receivers.Stripe.dll +0 -0
- package/bin/Microsoft.AspNet.WebHooks.Receivers.Trello.dll +0 -0
- package/bin/Microsoft.AspNet.WebHooks.Receivers.WordPress.dll +0 -0
- package/bin/Microsoft.AspNet.WebHooks.Receivers.dll +0 -0
- package/bin/Microsoft.AspNetCore.Cryptography.Internal.dll +0 -0
- package/bin/Microsoft.AspNetCore.DataProtection.Abstractions.dll +0 -0
- package/bin/Microsoft.AspNetCore.DataProtection.dll +0 -0
- package/bin/Microsoft.AspNetCore.Hosting.Abstractions.dll +0 -0
- package/bin/Microsoft.AspNetCore.Hosting.Server.Abstractions.dll +0 -0
- package/bin/Microsoft.AspNetCore.Http.Abstractions.dll +0 -0
- package/bin/Microsoft.AspNetCore.Http.Features.dll +0 -0
- package/bin/Microsoft.AspNetCore.WebUtilities.dll +0 -0
- package/bin/Microsoft.Azure.ApiHub.Sdk.dll +0 -0
- package/bin/Microsoft.Azure.Documents.Client.dll +0 -0
- package/bin/Microsoft.Azure.Documents.ServiceInterop.dll +0 -0
- package/bin/Microsoft.Azure.KeyVault.Core.dll +0 -0
- package/bin/Microsoft.Azure.NotificationHubs.dll +0 -0
- package/bin/Microsoft.Azure.WebJobs.Extensions.ApiHub.dll +0 -0
- package/bin/Microsoft.Azure.WebJobs.Extensions.BotFramework.dll +0 -0
- package/bin/Microsoft.Azure.WebJobs.Extensions.DocumentDB.dll +0 -0
- package/bin/Microsoft.Azure.WebJobs.Extensions.MobileApps.dll +0 -0
- package/bin/Microsoft.Azure.WebJobs.Extensions.NotificationHubs.dll +0 -0
- package/bin/Microsoft.Azure.WebJobs.Extensions.SendGrid.dll +0 -0
- package/bin/Microsoft.Azure.WebJobs.Extensions.Twilio.dll +0 -0
- package/bin/Microsoft.Azure.WebJobs.Extensions.dll +0 -0
- package/bin/Microsoft.Azure.WebJobs.Host.dll +0 -0
- package/bin/Microsoft.Azure.WebJobs.Logging.dll +0 -0
- package/bin/Microsoft.Azure.WebJobs.Script.Extensibility.dll +0 -0
- package/bin/Microsoft.Azure.WebJobs.Script.WebHost.dll +0 -0
- package/bin/Microsoft.Azure.WebJobs.Script.dll +0 -0
- package/bin/Microsoft.Azure.WebJobs.ServiceBus.dll +0 -0
- package/bin/Microsoft.Azure.WebJobs.dll +0 -0
- package/bin/Microsoft.Azure.WebSites.DataProtection.dll +0 -0
- package/bin/Microsoft.Bot.Connector.DirectLine.dll +0 -0
- package/bin/Microsoft.CodeAnalysis.CSharp.Scripting.dll +0 -0
- package/bin/Microsoft.CodeAnalysis.CSharp.dll +0 -0
- package/bin/Microsoft.CodeAnalysis.Scripting.dll +0 -0
- package/bin/Microsoft.CodeAnalysis.dll +0 -0
- package/bin/Microsoft.Data.Edm.dll +0 -0
- package/bin/Microsoft.Data.OData.dll +0 -0
- package/bin/Microsoft.Data.Services.Client.dll +0 -0
- package/bin/Microsoft.Extensions.Configuration.Abstractions.dll +0 -0
- package/bin/Microsoft.Extensions.DependencyInjection.Abstractions.dll +0 -0
- package/bin/Microsoft.Extensions.DependencyInjection.dll +0 -0
- package/bin/Microsoft.Extensions.FileProviders.Abstractions.dll +0 -0
- package/bin/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
- package/bin/Microsoft.Extensions.Options.dll +0 -0
- package/bin/Microsoft.Extensions.Primitives.dll +0 -0
- package/bin/Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll +0 -0
- package/bin/Microsoft.IdentityModel.Clients.ActiveDirectory.dll +0 -0
- package/bin/Microsoft.Rest.ClientRuntime.dll +0 -0
- package/bin/Microsoft.ServiceBus.Messaging.EventProcessorHost.dll +0 -0
- package/bin/Microsoft.ServiceBus.dll +0 -0
- package/bin/Microsoft.WindowsAzure.Configuration.dll +0 -0
- package/bin/Microsoft.WindowsAzure.Mobile.Ext.dll +0 -0
- package/bin/Microsoft.WindowsAzure.Mobile.dll +0 -0
- package/bin/Microsoft.WindowsAzure.Storage.dll +0 -0
- package/bin/NCrontab.dll +0 -0
- package/bin/Newtonsoft.Json.dll +0 -0
- package/bin/NuGet.Frameworks.dll +0 -0
- package/bin/NuGet.LibraryModel.dll +0 -0
- package/bin/NuGet.Versioning.dll +0 -0
- package/bin/NuGet.exe +0 -0
- package/bin/RestSharp.dll +0 -0
- package/bin/SendGrid.CSharp.HTTP.Client.dll +0 -0
- package/bin/SendGrid.SmtpApi.dll +0 -0
- package/bin/SendGrid.dll +0 -0
- package/bin/System.AppContext.dll +0 -0
- package/bin/System.Buffers.dll +0 -0
- package/bin/System.Collections.Immutable.dll +0 -0
- package/bin/System.Console.dll +0 -0
- package/bin/System.Diagnostics.FileVersionInfo.dll +0 -0
- package/bin/System.Diagnostics.StackTrace.dll +0 -0
- package/bin/System.IO.Abstractions.dll +0 -0
- package/bin/System.IO.FileSystem.Primitives.dll +0 -0
- package/bin/System.IO.FileSystem.dll +0 -0
- package/bin/System.Net.Http.Extensions.dll +0 -0
- package/bin/System.Net.Http.Formatting.dll +0 -0
- package/bin/System.Net.Http.Primitives.dll +0 -0
- package/bin/System.Reflection.Metadata.dll +0 -0
- package/bin/System.Security.Cryptography.Algorithms.dll +0 -0
- package/bin/System.Security.Cryptography.Encoding.dll +0 -0
- package/bin/System.Security.Cryptography.Primitives.dll +0 -0
- package/bin/System.Security.Cryptography.X509Certificates.dll +0 -0
- package/bin/System.Spatial.dll +0 -0
- package/bin/System.Text.Encoding.CodePages.dll +0 -0
- package/bin/System.Text.Encodings.Web.dll +0 -0
- package/bin/System.Threading.Tasks.Dataflow.dll +0 -0
- package/bin/System.Threading.Thread.dll +0 -0
- package/bin/System.ValueTuple.dll +0 -0
- package/bin/System.Web.Cors.dll +0 -0
- package/bin/System.Web.Http.Cors.dll +0 -0
- package/bin/System.Web.Http.SelfHost.dll +0 -0
- package/bin/System.Web.Http.WebHost.dll +0 -0
- package/bin/System.Web.Http.dll +0 -0
- package/bin/System.Xml.XPath.XDocument.dll +0 -0
- package/bin/System.Xml.XPath.dll +0 -0
- package/bin/System.Xml.XmlDocument.dll +0 -0
- package/bin/Twilio.Api.dll +0 -0
- package/bin/azurefunctions/functions.js +0 -129
- package/bin/azurefunctions/http/request.js +0 -8
- package/bin/azurefunctions/http/response.js +0 -78
- package/bin/edge/double_edge.js +0 -49
- package/bin/edge/edge.js +0 -172
- package/bin/edge/x64/edge_nativeclr.node +0 -0
- package/bin/edge/x64/node.dll +0 -0
- package/bin/edge/x86/edge_nativeclr.node +0 -0
- package/bin/edge/x86/node.dll +0 -0
- package/bin/func.exe +0 -0
- package/bin/func.exe.config +0 -96
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
// Copyright (c) .NET Foundation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License. See License.txt in the project root for license information.
|
|
3
|
-
|
|
4
|
-
var util = require('util');
|
|
5
|
-
var process = require('process');
|
|
6
|
-
var request = require('./http/request');
|
|
7
|
-
var response = require('./http/response');
|
|
8
|
-
|
|
9
|
-
module.exports = {
|
|
10
|
-
globalInitialization: globalInitialization,
|
|
11
|
-
clearRequireCache: clearRequireCache,
|
|
12
|
-
createFunction: createFunction
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function globalInitialization(context, callback) {
|
|
16
|
-
process.on('uncaughtException', function (err) {
|
|
17
|
-
context.handleUncaughtException(err.stack);
|
|
18
|
-
});
|
|
19
|
-
callback();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function clearRequireCache(context, callback) {
|
|
23
|
-
Object.keys(require.cache).forEach(function (key) {
|
|
24
|
-
delete require.cache[key];
|
|
25
|
-
});
|
|
26
|
-
callback();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function createFunction(f) {
|
|
30
|
-
return function (context, callback) {
|
|
31
|
-
// TEMP HACK: workaround for https://github.com/tjanczuk/edge/issues/325
|
|
32
|
-
setImmediate(() => { });
|
|
33
|
-
|
|
34
|
-
f = getEntryPoint(f, context);
|
|
35
|
-
|
|
36
|
-
// configure loggers
|
|
37
|
-
var origLog = context.log;
|
|
38
|
-
var logLevel = function (traceLevel) {
|
|
39
|
-
return function () {
|
|
40
|
-
var message = util.format.apply(null, arguments);
|
|
41
|
-
origLog({ lvl: traceLevel, msg: message });
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
// set default log to 'info'
|
|
45
|
-
var log = logLevel(3);
|
|
46
|
-
['error', 'warn', 'info', 'verbose'].forEach((level, index) => {
|
|
47
|
-
var traceLevel = index + 1;
|
|
48
|
-
log[level] = logLevel(traceLevel);
|
|
49
|
-
});
|
|
50
|
-
context.log = log;
|
|
51
|
-
|
|
52
|
-
context.done = function (err, result) {
|
|
53
|
-
if (context._done) {
|
|
54
|
-
if (context._promise) {
|
|
55
|
-
context.log("Error: Choose either to return a promise or call 'done'. Do not use both in your script.");
|
|
56
|
-
} else {
|
|
57
|
-
context.log("Error: 'done' has already been called. Please check your script for extraneous calls to 'done'.");
|
|
58
|
-
}
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
context._done = true;
|
|
62
|
-
|
|
63
|
-
if (err) {
|
|
64
|
-
callback(err);
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
var values = {};
|
|
68
|
-
if (context.res && context.bindings.res === undefined) {
|
|
69
|
-
context.bindings.res = context.res;
|
|
70
|
-
}
|
|
71
|
-
for (var name in context.bindings) {
|
|
72
|
-
values[name] = context.bindings[name];
|
|
73
|
-
}
|
|
74
|
-
context.bind(values, function (err) {
|
|
75
|
-
callback(err, result);
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
var inputs = context._inputs;
|
|
81
|
-
inputs.unshift(context);
|
|
82
|
-
delete context._inputs;
|
|
83
|
-
|
|
84
|
-
var lowercaseTrigger = context._triggerType && context._triggerType.toLowerCase();
|
|
85
|
-
switch (lowercaseTrigger) {
|
|
86
|
-
case "httptrigger":
|
|
87
|
-
context.req = request(context);
|
|
88
|
-
context.res = response(context);
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
delete context._triggerType;
|
|
92
|
-
|
|
93
|
-
var result = f.apply(null, inputs);
|
|
94
|
-
if (result && util.isFunction(result.then)) {
|
|
95
|
-
context._promise = true;
|
|
96
|
-
result.then((result) => context.done(null, result))
|
|
97
|
-
.catch((err) => context.done(err));
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function getEntryPoint(f, context) {
|
|
103
|
-
if (util.isObject(f)) {
|
|
104
|
-
if (context._entryPoint) {
|
|
105
|
-
// the module exports multiple functions
|
|
106
|
-
// and an explicit entry point was named
|
|
107
|
-
f = f[context._entryPoint];
|
|
108
|
-
delete context._entryPoint;
|
|
109
|
-
}
|
|
110
|
-
else if (Object.keys(f).length == 1) {
|
|
111
|
-
// a single named function was exported
|
|
112
|
-
var name = Object.keys(f)[0];
|
|
113
|
-
f = f[name];
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
// finally, see if there is an exported function named
|
|
117
|
-
// 'run' or 'index' by convention
|
|
118
|
-
f = f.run || f.index;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (!util.isFunction(f)) {
|
|
123
|
-
throw "Unable to determine function entry point. If multiple functions are exported, " +
|
|
124
|
-
"you must indicate the entry point, either by naming it 'run' or 'index', or by naming it " +
|
|
125
|
-
"explicitly via the 'entryPoint' metadata property.";
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return f;
|
|
129
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// Copyright (c) .NET Foundation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License. See License.txt in the project root for license information.
|
|
3
|
-
|
|
4
|
-
module.exports = (context) => {
|
|
5
|
-
var req = context.req;
|
|
6
|
-
req.get = (field) => req.headers[field.toLowerCase()];
|
|
7
|
-
return req;
|
|
8
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
// Copyright (c) .NET Foundation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License. See License.txt in the project root for license information.
|
|
3
|
-
|
|
4
|
-
module.exports = (context) => {
|
|
5
|
-
var res = {
|
|
6
|
-
headers: {},
|
|
7
|
-
body: undefined,
|
|
8
|
-
|
|
9
|
-
// functions methods
|
|
10
|
-
raw: (body) => {
|
|
11
|
-
res.isRaw = true;
|
|
12
|
-
return res.send(body);
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
// node httpResponse methods
|
|
16
|
-
setHeader: (field, val) => {
|
|
17
|
-
res.headers[field.toLowerCase()] = val;
|
|
18
|
-
return res;
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
getHeader: (field) => {
|
|
22
|
-
return res.headers[field.toLowerCase()];
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
removeHeader: (field) => {
|
|
26
|
-
delete res.headers[field.toLowerCase()];
|
|
27
|
-
return res;
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
end: (body) => {
|
|
31
|
-
if (body !== undefined) {
|
|
32
|
-
res.body = body;
|
|
33
|
-
}
|
|
34
|
-
setContentType(res);
|
|
35
|
-
context.done();
|
|
36
|
-
return res;
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
// express methods
|
|
40
|
-
status: (statusCode) => {
|
|
41
|
-
res.statusCode = statusCode;
|
|
42
|
-
return res;
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
sendStatus: (statusCode) => {
|
|
46
|
-
return res.status(statusCode)
|
|
47
|
-
.end();
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
type: (type) => {
|
|
51
|
-
return res.set('content-type', type);
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
json: (body) => {
|
|
55
|
-
return res.type('application/json')
|
|
56
|
-
.send(body);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
res.send = res.end;
|
|
61
|
-
res.header = res.set = res.setHeader;
|
|
62
|
-
res.get = res.getHeader;
|
|
63
|
-
|
|
64
|
-
return res;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
function setContentType(res) {
|
|
68
|
-
if (res.body !== undefined) {
|
|
69
|
-
if (res.get('content-type')) {
|
|
70
|
-
// use user defined content type, if exists
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (Buffer.isBuffer(res.body)) {
|
|
75
|
-
res.type('application/octet-stream');
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
package/bin/edge/double_edge.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// Fix #176 for GUI applications on Windows
|
|
2
|
-
try {
|
|
3
|
-
var stdout = process.stdout;
|
|
4
|
-
}
|
|
5
|
-
catch (e) {
|
|
6
|
-
// This is a Windows GUI application without stdout and stderr defined.
|
|
7
|
-
// Define process.stdout and process.stderr so that all output is discarded.
|
|
8
|
-
(function () {
|
|
9
|
-
var stream = require('stream');
|
|
10
|
-
var NullStream = function (o) {
|
|
11
|
-
stream.Writable.call(this);
|
|
12
|
-
this._write = function (c, e, cb) { cb && cb(); };
|
|
13
|
-
}
|
|
14
|
-
require('util').inherits(NullStream, stream.Writable);
|
|
15
|
-
var nullStream = new NullStream();
|
|
16
|
-
process.__defineGetter__('stdout', function () { return nullStream; });
|
|
17
|
-
process.__defineGetter__('stderr', function () { return nullStream; });
|
|
18
|
-
})();
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
process.env['EDGE_NATIVE'] = process.env['EDGE_NATIVE'] ||
|
|
22
|
-
__dirname + (process.arch === 'x64' ? '\\x64\\edge_nativeclr.node' : '\\x86\\edge_nativeclr.node');
|
|
23
|
-
|
|
24
|
-
var edge = require('./edge.js');
|
|
25
|
-
|
|
26
|
-
var initialize = edge.func({
|
|
27
|
-
assemblyFile: __dirname + '\\..\\EdgeJs.dll',
|
|
28
|
-
typeName: 'EdgeJs.Edge',
|
|
29
|
-
methodName: 'InitializeInternal'
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
var compileFunc = function (data, callback) {
|
|
33
|
-
var wrapper = '(function () { ' + data + ' })';
|
|
34
|
-
var funcFactory = eval(wrapper);
|
|
35
|
-
var func = funcFactory();
|
|
36
|
-
if (typeof func !== 'function') {
|
|
37
|
-
throw new Error('Node.js code must return an instance of a JavaScript function. '
|
|
38
|
-
+ 'Please use `return` statement to return a function.');
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
callback(null, func);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
initialize(compileFunc, function (error, data) {
|
|
45
|
-
if (error) throw error;
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
// prevent the V8 thread from exiting for the lifetime of the CLR application
|
|
49
|
-
setInterval(function () {}, 3600000);
|
package/bin/edge/edge.js
DELETED
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
var fs = require('fs')
|
|
2
|
-
, path = require('path')
|
|
3
|
-
, builtEdge = path.resolve(__dirname, '../build/Release/' + (process.env.EDGE_USE_CORECLR || !fs.existsSync(path.resolve(__dirname, '../build/Release/edge_nativeclr.node')) ? 'edge_coreclr.node' : 'edge_nativeclr.node'))
|
|
4
|
-
, edge;
|
|
5
|
-
|
|
6
|
-
var versionMap = [
|
|
7
|
-
[ /^0\.8\./, '0.8.22' ],
|
|
8
|
-
[ /^0\.10\./, '0.10.0' ],
|
|
9
|
-
[ /^0\.12\./, '0.12.0' ],
|
|
10
|
-
[ /^4\./, '4.1.1' ],
|
|
11
|
-
[ /^5\./, '5.1.0' ],
|
|
12
|
-
[ /^6\./, '6.4.0' ],
|
|
13
|
-
];
|
|
14
|
-
|
|
15
|
-
function determineVersion() {
|
|
16
|
-
for (var i in versionMap) {
|
|
17
|
-
if (process.versions.node.match(versionMap[i][0])) {
|
|
18
|
-
return versionMap[i][1];
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
throw new Error('The edge module has not been pre-compiled for node.js version ' + process.version +
|
|
23
|
-
'. You must build a custom version of edge.node. Please refer to https://github.com/tjanczuk/edge ' +
|
|
24
|
-
'for building instructions.');
|
|
25
|
-
}
|
|
26
|
-
var edgeNative;
|
|
27
|
-
if (process.env.EDGE_NATIVE) {
|
|
28
|
-
edgeNative = process.env.EDGE_NATIVE;
|
|
29
|
-
}
|
|
30
|
-
else if (fs.existsSync(builtEdge)) {
|
|
31
|
-
edgeNative = builtEdge;
|
|
32
|
-
}
|
|
33
|
-
else if (process.platform === 'win32') {
|
|
34
|
-
edgeNative = path.resolve(__dirname, './native/' + process.platform + '/' + process.arch + '/' + determineVersion() + '/' + (process.env.EDGE_USE_CORECLR ? 'edge_coreclr' : 'edge_nativeclr'));
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
throw new Error('The edge native module is not available at ' + builtEdge
|
|
38
|
-
+ '. You can use EDGE_NATIVE environment variable to provide alternate location of edge.node. '
|
|
39
|
-
+ 'If you need to build edge.node, follow build instructions for your platform at https://github.com/tjanczuk/edge');
|
|
40
|
-
}
|
|
41
|
-
if (process.env.EDGE_DEBUG) {
|
|
42
|
-
console.log('Load edge native library from: ' + edgeNative);
|
|
43
|
-
}
|
|
44
|
-
if (edgeNative.match(/edge_coreclr\.node$/i)) {
|
|
45
|
-
// Propagate the choice between desktop and coreclr to edge-cs; this is used in deciding
|
|
46
|
-
// how to compile literal C# at https://github.com/tjanczuk/edge-cs/blob/master/lib/edge-cs.js
|
|
47
|
-
process.env.EDGE_USE_CORECLR = 1;
|
|
48
|
-
}
|
|
49
|
-
if (process.env.EDGE_USE_CORECLR && !process.env.EDGE_BOOTSTRAP_DIR && fs.existsSync(path.join(__dirname, 'bootstrap', 'bin', 'Release', 'netcoreapp1.0', 'bootstrap.dll'))) {
|
|
50
|
-
process.env.EDGE_BOOTSTRAP_DIR = path.join(__dirname, 'bootstrap', 'bin', 'Release', 'netcoreapp1.0');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
process.env.EDGE_NATIVE = edgeNative;
|
|
54
|
-
edge = require(edgeNative);
|
|
55
|
-
|
|
56
|
-
exports.func = function(language, options) {
|
|
57
|
-
if (!options) {
|
|
58
|
-
options = language;
|
|
59
|
-
language = 'cs';
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (typeof options === 'string') {
|
|
63
|
-
if (options.match(/\.dll$/i)) {
|
|
64
|
-
options = { assemblyFile: options };
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
options = { source: options };
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
else if (typeof options === 'function') {
|
|
71
|
-
var originalPrepareStackTrace = Error.prepareStackTrace;
|
|
72
|
-
var stack;
|
|
73
|
-
try {
|
|
74
|
-
Error.prepareStackTrace = function(error, stack) {
|
|
75
|
-
return stack;
|
|
76
|
-
};
|
|
77
|
-
stack = new Error().stack;
|
|
78
|
-
}
|
|
79
|
-
finally
|
|
80
|
-
{
|
|
81
|
-
Error.prepareStackTrace = originalPrepareStackTrace;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
options = { source: options, jsFileName: stack[1].getFileName(), jsLineNumber: stack[1].getLineNumber() };
|
|
85
|
-
}
|
|
86
|
-
else if (typeof options !== 'object') {
|
|
87
|
-
throw new Error('Specify the source code as string or provide an options object.');
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if (typeof language !== 'string') {
|
|
91
|
-
throw new Error('The first argument must be a string identifying the language compiler to use.');
|
|
92
|
-
}
|
|
93
|
-
else if (!options.assemblyFile) {
|
|
94
|
-
var compilerName = 'edge-' + language.toLowerCase();
|
|
95
|
-
var compiler;
|
|
96
|
-
try {
|
|
97
|
-
compiler = require(compilerName);
|
|
98
|
-
}
|
|
99
|
-
catch (e) {
|
|
100
|
-
throw new Error("Unsupported language '" + language + "'. To compile script in language '" + language +
|
|
101
|
-
"' an npm module '" + compilerName + "' must be installed.");
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
try {
|
|
105
|
-
options.compiler = compiler.getCompiler();
|
|
106
|
-
}
|
|
107
|
-
catch (e) {
|
|
108
|
-
throw new Error("The '" + compilerName + "' module required to compile the '" + language + "' language " +
|
|
109
|
-
"does not contain getCompiler() function.");
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (typeof options.compiler !== 'string') {
|
|
113
|
-
throw new Error("The '" + compilerName + "' module required to compile the '" + language + "' language " +
|
|
114
|
-
"did not specify correct compiler package name or assembly.");
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (process.env.EDGE_USE_CORECLR) {
|
|
118
|
-
options.bootstrapDependencyManifest = compiler.getBootstrapDependencyManifest();
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (!options.assemblyFile && !options.source) {
|
|
123
|
-
throw new Error('Provide DLL or source file name or .NET script literal as a string parmeter, or specify an options object '+
|
|
124
|
-
'with assemblyFile or source string property.');
|
|
125
|
-
}
|
|
126
|
-
else if (options.assemblyFile && options.source) {
|
|
127
|
-
throw new Error('Provide either an asseblyFile or source property, but not both.');
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (typeof options.source === 'function') {
|
|
131
|
-
var match = options.source.toString().match(/[^]*\/\*([^]*)\*\/\s*\}$/);
|
|
132
|
-
if (match) {
|
|
133
|
-
options.source = match[1];
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
throw new Error('If .NET source is provided as JavaScript function, function body must be a /* ... */ comment.');
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (options.references !== undefined) {
|
|
141
|
-
if (!Array.isArray(options.references)) {
|
|
142
|
-
throw new Error('The references property must be an array of strings.');
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
options.references.forEach(function (ref) {
|
|
146
|
-
if (typeof ref !== 'string') {
|
|
147
|
-
throw new Error('The references property must be an array of strings.');
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (options.assemblyFile) {
|
|
153
|
-
if (!options.typeName) {
|
|
154
|
-
var matched = options.assemblyFile.match(/([^\\\/]+)\.dll$/i);
|
|
155
|
-
if (!matched) {
|
|
156
|
-
throw new Error('Unable to determine the namespace name based on assembly file name. ' +
|
|
157
|
-
'Specify typeName parameter as a namespace qualified CLR type name of the application class.');
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
options.typeName = matched[1] + '.Startup';
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
else if (!options.typeName) {
|
|
164
|
-
options.typeName = "Startup";
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
if (!options.methodName) {
|
|
168
|
-
options.methodName = 'Invoke';
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return edge.initializeClrFunc(options);
|
|
172
|
-
};
|
|
Binary file
|
package/bin/edge/x64/node.dll
DELETED
|
Binary file
|
|
Binary file
|
package/bin/edge/x86/node.dll
DELETED
|
Binary file
|
package/bin/func.exe
DELETED
|
Binary file
|
package/bin/func.exe.config
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<configuration>
|
|
3
|
-
<startup>
|
|
4
|
-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
|
|
5
|
-
</startup>
|
|
6
|
-
<runtime>
|
|
7
|
-
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
|
8
|
-
<dependentAssembly>
|
|
9
|
-
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
|
10
|
-
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
|
11
|
-
</dependentAssembly>
|
|
12
|
-
<dependentAssembly>
|
|
13
|
-
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
|
14
|
-
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
|
|
15
|
-
</dependentAssembly>
|
|
16
|
-
<dependentAssembly>
|
|
17
|
-
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
|
18
|
-
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
|
|
19
|
-
</dependentAssembly>
|
|
20
|
-
<dependentAssembly>
|
|
21
|
-
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
|
22
|
-
<bindingRedirect oldVersion="0.0.0.0-7.2.1.0" newVersion="7.2.1.0" />
|
|
23
|
-
</dependentAssembly>
|
|
24
|
-
<dependentAssembly>
|
|
25
|
-
<assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
|
26
|
-
<bindingRedirect oldVersion="0.0.0.0-4.2.29.0" newVersion="4.2.29.0" />
|
|
27
|
-
</dependentAssembly>
|
|
28
|
-
<dependentAssembly>
|
|
29
|
-
<assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
|
30
|
-
<bindingRedirect oldVersion="0.0.0.0-5.8.1.0" newVersion="5.8.1.0" />
|
|
31
|
-
</dependentAssembly>
|
|
32
|
-
<dependentAssembly>
|
|
33
|
-
<assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
|
34
|
-
<bindingRedirect oldVersion="0.0.0.0-5.8.1.0" newVersion="5.8.1.0" />
|
|
35
|
-
</dependentAssembly>
|
|
36
|
-
<dependentAssembly>
|
|
37
|
-
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
|
38
|
-
<bindingRedirect oldVersion="0.0.0.0-5.8.1.0" newVersion="5.8.1.0" />
|
|
39
|
-
</dependentAssembly>
|
|
40
|
-
<dependentAssembly>
|
|
41
|
-
<assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
|
42
|
-
<bindingRedirect oldVersion="0.0.0.0-1.4.1.0" newVersion="1.4.1.0" />
|
|
43
|
-
</dependentAssembly>
|
|
44
|
-
<dependentAssembly>
|
|
45
|
-
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
|
46
|
-
<bindingRedirect oldVersion="0.0.0.0-1.2.1.0" newVersion="1.2.1.0" />
|
|
47
|
-
</dependentAssembly>
|
|
48
|
-
<dependentAssembly>
|
|
49
|
-
<assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
|
50
|
-
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
|
51
|
-
</dependentAssembly>
|
|
52
|
-
<dependentAssembly>
|
|
53
|
-
<assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
|
54
|
-
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
|
55
|
-
</dependentAssembly>
|
|
56
|
-
<dependentAssembly>
|
|
57
|
-
<assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
|
58
|
-
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
|
59
|
-
</dependentAssembly>
|
|
60
|
-
<dependentAssembly>
|
|
61
|
-
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" culture="neutral" />
|
|
62
|
-
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
|
|
63
|
-
</dependentAssembly>
|
|
64
|
-
</assemblyBinding>
|
|
65
|
-
</runtime>
|
|
66
|
-
<system.serviceModel>
|
|
67
|
-
<extensions>
|
|
68
|
-
<!-- In this extension section we are introducing all known service bus extensions. User can remove the ones they don't need. -->
|
|
69
|
-
<behaviorExtensions>
|
|
70
|
-
<add name="connectionStatusBehavior" type="Microsoft.ServiceBus.Configuration.ConnectionStatusElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
|
71
|
-
<add name="transportClientEndpointBehavior" type="Microsoft.ServiceBus.Configuration.TransportClientEndpointBehaviorElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
|
72
|
-
<add name="serviceRegistrySettings" type="Microsoft.ServiceBus.Configuration.ServiceRegistrySettingsElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
|
73
|
-
</behaviorExtensions>
|
|
74
|
-
<bindingElementExtensions>
|
|
75
|
-
<add name="netMessagingTransport" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingTransportExtensionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
|
76
|
-
<add name="tcpRelayTransport" type="Microsoft.ServiceBus.Configuration.TcpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
|
77
|
-
<add name="httpRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
|
78
|
-
<add name="httpsRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpsRelayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
|
79
|
-
<add name="onewayRelayTransport" type="Microsoft.ServiceBus.Configuration.RelayedOnewayTransportElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
|
80
|
-
</bindingElementExtensions>
|
|
81
|
-
<bindingExtensions>
|
|
82
|
-
<add name="basicHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.BasicHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
|
83
|
-
<add name="webHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WebHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
|
84
|
-
<add name="ws2007HttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WS2007HttpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
|
85
|
-
<add name="netTcpRelayBinding" type="Microsoft.ServiceBus.Configuration.NetTcpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
|
86
|
-
<add name="netOnewayRelayBinding" type="Microsoft.ServiceBus.Configuration.NetOnewayRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
|
87
|
-
<add name="netEventRelayBinding" type="Microsoft.ServiceBus.Configuration.NetEventRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
|
88
|
-
<add name="netMessagingBinding" type="Microsoft.ServiceBus.Messaging.Configuration.NetMessagingBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
|
89
|
-
</bindingExtensions>
|
|
90
|
-
</extensions>
|
|
91
|
-
</system.serviceModel>
|
|
92
|
-
<appSettings>
|
|
93
|
-
<!-- Service Bus specific app setings for messaging connections -->
|
|
94
|
-
<add key="Microsoft.ServiceBus.ConnectionString" value="Endpoint=sb://[your namespace].servicebus.windows.net;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=[your secret]" />
|
|
95
|
-
</appSettings>
|
|
96
|
-
</configuration>
|