cloudrail-si
Advanced tools
Comparing version 0.0.4 to 2.4.0
"use strict"; | ||
class InternalError extends Error { | ||
constructor(message) { | ||
var newMessage = "Whoops, an internal error has occured which you probably cannot fix. " + | ||
var newMessage = "An internal error has occured which you probably cannot fix. " + | ||
"We'd very much appreciate it if you would report it to the CloudRail team. The error message is:\n" + message; | ||
@@ -6,0 +6,0 @@ super(newMessage); |
"use strict"; | ||
class UserError extends Error { | ||
constructor(message) { | ||
var newMessage = "Oh noes, an error occured and it is your fault! This is what went wrong:\n" + message; | ||
var newMessage = "An error occured that you should be able to fix. The error message is:\n" + message; | ||
super(newMessage); | ||
@@ -6,0 +6,0 @@ } |
@@ -37,5 +37,5 @@ { | ||
"engineStrict": true, | ||
"version": "0.0.4", | ||
"version": "2.4.0", | ||
"main": "index.js", | ||
"typings": "index.d.ts" | ||
} |
@@ -57,10 +57,12 @@ <p align="center"> | ||
cs.createFolder("/TestFolder"); // <--- | ||
let fileStream = fs.createReadStream("UserData.csv"); | ||
let size = fs.statSync("UserData.csv").size; | ||
cs.upload("/TestFolder/Data.csv", fileStream, size, false, (err) => { // <--- | ||
cs.createFolder("/TestFolder", (err) => { // <--- | ||
if (err) throw err; | ||
console.log("Upload successfully finished"); | ||
let fileStream = fs.createReadStream("UserData.csv"); | ||
let size = fs.statSync("UserData.csv").size; | ||
cs.upload("/TestFolder/Data.csv", fileStream, size, false, (err) => { // <--- | ||
if (err) throw err; | ||
console.log("Upload successfully finished"); | ||
}); | ||
}); | ||
```` | ||
@@ -252,2 +254,7 @@ --- | ||
```` | ||
## Examples | ||
Check out https://github.com/CloudRail/cloudrail-si-node-sdk/tree/master/examples for examples of how to e.g. implement a redirectReceiver and more complex use cases. | ||
## Get Updates | ||
@@ -254,0 +261,0 @@ |
@@ -22,4 +22,4 @@ "use strict"; | ||
let redirectReceiver = environment.instanceDependencyStorage["redirectReceiver"]; | ||
if (!redirectReceiver) | ||
throw new UserError_1.UserError("This service needs the RedirectReceiver to not be null"); | ||
if (!redirectReceiver || typeof redirectReceiver !== "function") | ||
throw new UserError_1.UserError("This service needs the RedirectReceiver to be implemented as a function. Have a look at our examples and documentation if you are unsure how to do that."); | ||
return new Promise(resolve => { | ||
@@ -26,0 +26,0 @@ redirectReceiver(urlStr, environment.saveStateToString(), resolve); |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -451,2 +452,3 @@ "CloudStorage:getUserLogin": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("Box"); | ||
this.interpreterStorage["clientId"] = clientId; | ||
@@ -453,0 +455,0 @@ this.interpreterStorage["clientSecret"] = clientSecret; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -399,2 +400,3 @@ "CloudStorage:getUserLogin": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("Dropbox"); | ||
this.interpreterStorage["clientId"] = clientId; | ||
@@ -401,0 +403,0 @@ this.interpreterStorage["clientSecret"] = clientSecret; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -172,2 +173,3 @@ "Authenticating:login": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("Facebook"); | ||
this.interpreterStorage["clientID"] = clientID; | ||
@@ -174,0 +176,0 @@ this.interpreterStorage["clientSecret"] = clientSecret; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -216,2 +217,3 @@ "init": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("Foursquare"); | ||
this.interpreterStorage["clientID"] = clientID; | ||
@@ -218,0 +220,0 @@ this.interpreterStorage["clientSecret"] = clientSecret; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -142,2 +143,3 @@ "getGHIdentifier": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("GitHub"); | ||
this.interpreterStorage["clientId"] = clientId; | ||
@@ -144,0 +146,0 @@ this.interpreterStorage["clientSecret"] = clientSecret; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -776,2 +777,3 @@ "CloudStorage:getUserLogin": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("GoogleDrive"); | ||
this.interpreterStorage["clientID"] = clientID; | ||
@@ -778,0 +780,0 @@ this.interpreterStorage["clientSecret"] = clientSecret; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -203,2 +204,3 @@ "init": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("GooglePlaces"); | ||
this.interpreterStorage["apiKey"] = apiKey; | ||
@@ -205,0 +207,0 @@ let ip = new Interpreter_1.Interpreter(new Sandbox_1.Sandbox(SERVICE_CODE, this.persistentStorage, this.instanceDependencyStorage)); |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -154,2 +155,3 @@ "Authenticating:login": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("GooglePlus"); | ||
this.interpreterStorage["clientID"] = clientID; | ||
@@ -156,0 +158,0 @@ this.interpreterStorage["clientSecret"] = clientSecret; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -121,2 +122,3 @@ "Authenticating:login": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("Instagram"); | ||
this.interpreterStorage["clientID"] = clientID; | ||
@@ -123,0 +125,0 @@ this.interpreterStorage["clientSecret"] = clientSecret; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -144,2 +145,3 @@ "getLIIdentifier": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("LinkedIn"); | ||
this.interpreterStorage["clientID"] = clientID; | ||
@@ -146,0 +148,0 @@ this.interpreterStorage["clientSecret"] = clientSecret; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -158,2 +159,3 @@ "sendMJEMail": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("MailJet"); | ||
this.interpreterStorage["clientID"] = clientID; | ||
@@ -160,0 +162,0 @@ this.interpreterStorage["clientSecret"] = clientSecret; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -135,2 +136,3 @@ "Authenticating:login": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("MicrosoftLive"); | ||
this.interpreterStorage["clientID"] = clientID; | ||
@@ -137,0 +139,0 @@ this.interpreterStorage["clientSecret"] = clientSecret; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -114,2 +115,3 @@ "SendNexmoSMS": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("Nexmo"); | ||
this.interpreterStorage["clientID"] = clientID; | ||
@@ -116,0 +118,0 @@ this.interpreterStorage["clientSecret"] = clientSecret; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -530,2 +531,3 @@ "CloudStorage:getUserLogin": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("OneDrive"); | ||
this.interpreterStorage["clientID"] = clientID; | ||
@@ -532,0 +534,0 @@ this.interpreterStorage["clientSecret"] = clientSecret; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -468,4 +469,4 @@ "init": [ | ||
["set", "$L3.billing_address", "$L5"], | ||
["set", "$L5.line1", "$P2.address.addressLine1"], | ||
["set", "$L5.line2", "$P2.address.addressLine2"], | ||
["set", "$L5.line1", "$P2.address.line1"], | ||
["set", "$L5.line2", "$P2.address.line2"], | ||
["set", "$L5.city", "$P2.address.city"], | ||
@@ -686,9 +687,15 @@ ["set", "$L5.country_code", "$P2.address.country"], | ||
["set", "$L18", null], | ||
["if!=than", "$L17", null, 7], | ||
["if!=than", "$L17", null, 13], | ||
["create", "$L18", "Address"], | ||
["set", "$L18.addressLine1", "$L17.line1"], | ||
["set", "$L18.addressLine2", "$L17.line2"], | ||
["if!=than", "$L17.line1", null, 1], | ||
["set", "$L18.line1", "$L17.line1"], | ||
["if!=than", "$L17.line2", null, 1], | ||
["set", "$L18.line2", "$L17.line2"], | ||
["if!=than", "$L17.country_code", null, 1], | ||
["set", "$L18.country", "$L17.country_code"], | ||
["if!=than", "$L17.city", null, 1], | ||
["set", "$L18.city", "$L17.city"], | ||
["if!=than", "$L17.postal_code", null, 1], | ||
["set", "$L18.postalCode", "$L17.postal_code"], | ||
["if!=than", "$L17.state", null, 1], | ||
["set", "$L18.state", "$L17.state"], | ||
@@ -705,2 +712,3 @@ ["create", "$P1", "CreditCard", "$L13", "$L12", "$L11", "$L10", "$L9", "$L15", "$L16", "$L18"] | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("PayPal"); | ||
this.interpreterStorage["useSandbox"] = useSandbox ? 1 : 0; | ||
@@ -707,0 +715,0 @@ this.interpreterStorage["clientId"] = clientId; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -160,2 +161,3 @@ "sendEmail": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("SendGrid"); | ||
this.interpreterStorage["username"] = username; | ||
@@ -162,0 +164,0 @@ this.interpreterStorage["password"] = password; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -100,2 +101,3 @@ "Authenticating:login": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("Slack"); | ||
this.interpreterStorage["clientId"] = clientId; | ||
@@ -102,0 +104,0 @@ this.interpreterStorage["clientSecret"] = clientSecret; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -274,8 +275,14 @@ "createCharge": [ | ||
["string.concat", "$L0", "$L0", "source[cvc]=", "$P2.cvc", "&"], | ||
["if!=than", "$P2.address", null, 6], | ||
["if!=than", "$P2.address", null, 12], | ||
["if!=than", "$P2.address.city", null, 1], | ||
["string.concat", "$L0", "$L0", "source[address_city]=", "$P2.address.city", "&"], | ||
["if!=than", "$P2.address.country", null, 1], | ||
["string.concat", "$L0", "$L0", "source[address_country]=", "$P2.address.country", "&"], | ||
["if!=than", "$P2.address.line1", null, 1], | ||
["string.concat", "$L0", "$L0", "source[address_line1]=", "$P2.address.line1", "&"], | ||
["if!=than", "$P2.address.line2", null, 1], | ||
["string.concat", "$L0", "$L0", "source[address_line2]=", "$P2.address.line2", "&"], | ||
["if!=than", "$P2.address.state", null, 1], | ||
["string.concat", "$L0", "$L0", "source[address_state]=", "$P2.address.state", "&"], | ||
["if!=than", "$P2.address.postalCode", null, 1], | ||
["string.concat", "$L0", "$L0", "source[address_zip]=", "$P2.address.postalCode", "&"], | ||
@@ -305,3 +312,3 @@ ["if==than", "$P2.firstName", null, 1], | ||
"retrieveSource": [ | ||
["string.concat", "$L16", "XXXXXXXXXXXX", "$P2.last4"], | ||
["string.concat", "$L16", "xxxxxxxxxxxx", "$P2.last4"], | ||
["set", "$L17", "$P2.exp_month"], | ||
@@ -333,13 +340,11 @@ ["set", "$L18", "$P2.exp_year"], | ||
["set", "$L7.country", "$P2.address_country"], | ||
["if!=than", "$P2.source.address_city", null, 1], | ||
["set", "$L7.city", "$P2.source.address_city"], | ||
["if!=than", "$P2.source.address_city", null, 1], | ||
["if!=than", "$P2.address_city", null, 1], | ||
["set", "$L7.city", "$P2.address_city"], | ||
["if!=than", "$P2.source.address_state", null, 1], | ||
["if!=than", "$P2.address_state", null, 1], | ||
["set", "$L7.state", "$P2.address_state"], | ||
["if!=than", "$P2.source.address_line1", null, 1], | ||
["if!=than", "$P2.address_line1", null, 1], | ||
["set", "$L7.line1", "$P2.address_line1"], | ||
["if!=than", "$P2.source.address_line2", null, 1], | ||
["if!=than", "$P2.address_line2", null, 1], | ||
["set", "$L7.line2", "$P2.address_line2"], | ||
["if!=than", "$P2.source.address_zip", null, 1], | ||
["if!=than", "$P2.address_zip", null, 1], | ||
["set", "$L7.postalCode", "$P2.address_zip"], | ||
@@ -524,2 +529,3 @@ ["create", "$L1", "CreditCard", null, "$L17", "$L18", "$L16", "$L19", "$L20", "$L21", "$L7"], | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("Stripe"); | ||
this.interpreterStorage["secretKey"] = secretKey; | ||
@@ -526,0 +532,0 @@ let ip = new Interpreter_1.Interpreter(new Sandbox_1.Sandbox(SERVICE_CODE, this.persistentStorage, this.instanceDependencyStorage)); |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -112,2 +113,3 @@ "sendSMSTW": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("Twilio"); | ||
this.interpreterStorage["accountSid"] = accountSid; | ||
@@ -114,0 +116,0 @@ this.interpreterStorage["authToken"] = authToken; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -259,2 +260,3 @@ "Authenticating:login": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("Twitter"); | ||
this.interpreterStorage["clientID"] = clientID; | ||
@@ -261,0 +263,0 @@ this.interpreterStorage["clientSecret"] = clientSecret; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -200,2 +201,3 @@ "getYUIdentifier": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("Yahoo"); | ||
this.interpreterStorage["clientId"] = clientId; | ||
@@ -202,0 +204,0 @@ this.interpreterStorage["clientSecret"] = clientSecret; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const DetailErrors_1 = require("../errors/DetailErrors"); | ||
const InitSelfTest_1 = require("../servicecode/InitSelfTest"); | ||
const SERVICE_CODE = { | ||
@@ -285,2 +286,3 @@ "init": [ | ||
}; | ||
InitSelfTest_1.InitSelfTest.initTest("Yelp"); | ||
this.interpreterStorage["consumerKey"] = consumerKey; | ||
@@ -287,0 +289,0 @@ this.interpreterStorage["consumerSecret"] = consumerSecret; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
AI-detected potential security risk
Supply chain riskAI has determined that this package may contain potential security issues or vulnerabilities.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
892981
101
18792
1
278
1
4