cloudrail-si
Advanced tools
Comparing version 2.21.8 to 2.21.9
# CloudRail SI Node.JS SDK changelog | ||
* **2.21.9** | ||
* Business Cloud Storage : Implement listFilesWithPrefix method . | ||
* Minor fixes for Google Drive API. | ||
* **2.21.8** | ||
@@ -4,0 +9,0 @@ * Google Cloud Platform: Implement missing paging in listFiles() method |
@@ -56,3 +56,3 @@ { | ||
"engineStrict": true, | ||
"version": "2.21.8", | ||
"version": "2.21.9", | ||
"main": "index.js", | ||
@@ -59,0 +59,0 @@ "typings": "index.d.ts", |
@@ -113,3 +113,3 @@ "use strict"; | ||
["create", "$P1", "Array"], | ||
["callFunc", "listFilesChunk", "$P0", "$L1", "$P2.name", "$L0"], | ||
["callFunc", "listFilesChunk", "$P0", "$L1", "$P2.name", "$L0", null], | ||
["set", "$L0", null], | ||
@@ -135,2 +135,32 @@ ["size", "$L2", "$L1.children"], | ||
], | ||
"listFilesWithPrefix": [ | ||
["callFunc", "checkBucket", "$P0", "$P2"], | ||
["callFunc", "checkPrefix", "$P0", "$P3"], | ||
["create", "$P1", "Array"], | ||
["callFunc", "listFilesChunk", "$P0", "$L1", "$P2.name", "$L0", "$P3"], | ||
["set", "$L0", null], | ||
["size", "$L2", "$L1.children"], | ||
["create", "$L3", "Number", 0], | ||
["if<than", "$L3", "$L2", 13], | ||
["get", "$L4", "$L1.children", "$L3"], | ||
["if==than", "$L4.name", "NextContinuationToken", 1], | ||
["set", "$L0", "$L4.text"], | ||
["if==than", "$L4.name", "Contents", 7], | ||
["create", "$L5", "BusinessFileMetaData"], | ||
["set", "$L5.fileName", "$L4.children.0.text"], | ||
["set", "$L5.fileID", "$L4.children.0.text"], | ||
["math.add", "$L5.size", "$L4.children.3.text", 0], | ||
["create", "$L6", "Date", "$L4.children.1.text"], | ||
["set", "$L5.lastModified", "$L6.time"], | ||
["push", "$P1", "$L5"], | ||
["math.add", "$L3", "$L3", 1], | ||
["jumpRel", -14], | ||
["if!=than", "$L0", null, 1], | ||
["jumpRel", -20] | ||
], | ||
"checkPrefix": [ | ||
["if==than", "$P1", null, 2], | ||
["create", "$L1", "Error", "Prefix supplied is null", "IllegalArgument"], | ||
["throwError", "$L1"] | ||
], | ||
"getFileMetadata": [ | ||
@@ -476,5 +506,10 @@ ["callFunc", "checkBucket", "$P0", "$P2"], | ||
["string.concat", "$L0.url", "https://", "$P2", ".", "$P0.baseUrl", "?list-type=2"], | ||
["if!=than", "$P3", null, 2], | ||
["if!=than", "$P3", null, 3], | ||
["string.urlEncode", "$L1", "$P3"], | ||
["string.concat", "$L0.url", "$L0.url", "&continuation-token=", "$L1"], | ||
["string.concat", "$L2", "$L0.url", "&continuation-token=", "$L1"], | ||
["string.concat", "$L0.url", "$L2"], | ||
["if!=than", "$P4", null, 3], | ||
["string.urlEncode", "$L1", "$P4"], | ||
["string.concat", "$L3", "$L0.url", "&prefix=", "$L1"], | ||
["string.concat", "$L0.url", "$L3"], | ||
["create", "$L1", "Object"], | ||
@@ -496,2 +531,5 @@ ["set", "$L0.requestHeaders", "$L1"], | ||
["push", "$L12", "list-type"], | ||
["if!=than", "$P4", null, 2], | ||
["push", "$L12", "prefix"], | ||
["set", "$L11.prefix", "$P4"], | ||
["callFunc", "signRequest", "$P0", "$L0", "$L11", "$L12", "$L10", "$L1.x-amz-content-sha256"], | ||
@@ -702,2 +740,17 @@ ["http.requestCall", "$L2", "$L0"], | ||
}; | ||
AmazonS3.prototype.listFilesWithPrefix = function (bucket, prefix, callback) { | ||
Statistics_1.Statistics.addCall("AmazonS3", "listFilesWithPrefix"); | ||
var ip = new Interpreter_1.Interpreter(new Sandbox_1.Sandbox(SERVICE_CODE, this.persistentStorage, this.instanceDependencyStorage)); | ||
ip.callFunction("listFilesWithPrefix", this.interpreterStorage, null, bucket, prefix).then(function () { | ||
Helper_1.Helper.checkSandboxError(ip, "AmazonS3", "listFilesWithPrefix"); | ||
}).then(function () { | ||
var res; | ||
res = ip.getParameter(1); | ||
if (callback != null && typeof callback === "function") | ||
callback(undefined, res); | ||
}, function (err) { | ||
if (callback != null && typeof callback === "function") | ||
callback(err); | ||
}); | ||
}; | ||
AmazonS3.prototype.uploadFile = function (bucket, name, stream, size, callback) { | ||
@@ -704,0 +757,0 @@ Statistics_1.Statistics.addCall("AmazonS3", "uploadFile"); |
@@ -209,2 +209,52 @@ "use strict"; | ||
], | ||
"Storage:listFilesWithPrefix": [ | ||
["callFunc", "checkBucket", "$P0", "$P2"], | ||
["callFunc", "checkPrefix", "$P0", "$P3"], | ||
["callFunc", "checkAuthentication", "$P0"], | ||
["create", "$L4", "Object"], | ||
["set", "$L4", "application/x-www-form-urlencoded", "Content-Type"], | ||
["set", "$L4", "$S0.authorizationToken", "Authorization"], | ||
["string.concat", "$L9", "{\"bucketId\":\"", "$P2.identifier", "\"", ",", "\"maxFileCount\":", 1000, ",", "\"prefix\":\"", "$P3", "\"", "}"], | ||
["size", "$L10", "$L9"], | ||
["string.concat", "$L4.Content-Length", "$L10"], | ||
["create", "$L5", "Object"], | ||
["string.concat", "$L0", "$S0.apiUrl", "/b2api/v1/b2_list_file_names"], | ||
["set", "$L5.url", "$L0"], | ||
["set", "$L5.method", "POST"], | ||
["set", "$L5.requestHeaders", "$L4"], | ||
["stream.stringToStream", "$L9", "$L9"], | ||
["set", "$L5.requestBody", "$L9"], | ||
["http.requestCall", "$L6", "$L5"], | ||
["callFunc", "checkHttpErrors", "$P0", "$L6", "authentication", 200], | ||
["create", "$L14", "Array"], | ||
["stream.streamToString", "$L12", "$L6.responseBody"], | ||
["json.parse", "$L12", "$L12"], | ||
["size", "$L10", "$L12.files"], | ||
["if!=than", "$L10", 0, 9], | ||
["math.add", "$L10", "$L10", -1], | ||
["create", "$L13", "BusinessFileMetaData"], | ||
["get", "$L15", "$L12.files", "$L10"], | ||
["set", "$L13.fileID", "$L15.fileId"], | ||
["set", "$L13.fileName", "$L15.fileName"], | ||
["set", "$L13.lastModified", "$L15.uploadTimestamp"], | ||
["set", "$L13.size", "$L15.contentLength"], | ||
["push", "$L14", "$L13"], | ||
["jumpRel", -10], | ||
["if!=than", "$L12.nextFileName", null, 9], | ||
["string.concat", "$L9", "{\"bucketId\":\"", "$P2.identifier", "\"", ",", "\"maxFileCount\":", 1000, ",", "\"startFileName\":", "\"", "$L12.nextFileName", "\"", "}"], | ||
["size", "$L10", "$L9"], | ||
["string.concat", "$L4.Content-Length", "$L10"], | ||
["set", "$L5.requestHeaders", "$L4"], | ||
["stream.stringToStream", "$L9", "$L9"], | ||
["set", "$L5.requestBody", "$L9"], | ||
["http.requestCall", "$L6", "$L5"], | ||
["callFunc", "checkHttpErrors", "$P0", "$L6", "authentication", 200], | ||
["jumpRel", -23], | ||
["set", "$P1", "$L14"] | ||
], | ||
"checkPrefix": [ | ||
["if==than", "$P1", null, 2], | ||
["create", "$L1", "Error", "Prefix supplied is null", "IllegalArgument"], | ||
["throwError", "$L1"] | ||
], | ||
"Storage:deleteFile": [ | ||
@@ -467,2 +517,17 @@ ["callFunc", "Storage:getFileMetadata", "$P0", "$L0", "$P2", "$P1"], | ||
}; | ||
Backblaze.prototype.listFilesWithPrefix = function (bucket, prefix, callback) { | ||
Statistics_1.Statistics.addCall("Backblaze", "listFilesWithPrefix"); | ||
var ip = new Interpreter_1.Interpreter(new Sandbox_1.Sandbox(SERVICE_CODE, this.persistentStorage, this.instanceDependencyStorage)); | ||
ip.callFunction("Storage:listFilesWithPrefix", this.interpreterStorage, null, bucket, prefix).then(function () { | ||
Helper_1.Helper.checkSandboxError(ip, "Backblaze", "listFilesWithPrefix"); | ||
}).then(function () { | ||
var res; | ||
res = ip.getParameter(1); | ||
if (callback != null && typeof callback === "function") | ||
callback(undefined, res); | ||
}, function (err) { | ||
if (callback != null && typeof callback === "function") | ||
callback(err); | ||
}); | ||
}; | ||
Backblaze.prototype.uploadFile = function (bucket, name, stream, size, callback) { | ||
@@ -469,0 +534,0 @@ Statistics_1.Statistics.addCall("Backblaze", "uploadFile"); |
@@ -101,2 +101,38 @@ "use strict"; | ||
], | ||
"listFilesWithPrefix": [ | ||
["callFunc", "checkBucket", "$P0", "$P2"], | ||
["callFunc", "checkPrefix", "$P0", "$P3"], | ||
["callFunc", "checkAuthentication", "$P0"], | ||
["create", "$L0", "Object"], | ||
["set", "$L0.method", "GET"], | ||
["string.concat", "$L0.url", "$P0.storageBase", "/b/", "$P2.name", "/o?maxResults=1000", "&prefix=", "$P3"], | ||
["create", "$L0.requestHeaders", "Object"], | ||
["string.concat", "$L0.requestHeaders.Authorization", "Bearer ", "$P0.accessToken"], | ||
["http.requestCall", "$L1", "$L0"], | ||
["callFunc", "validateResponse", "$P0", "$L1"], | ||
["json.parse", "$L2", "$L1.responseBody"], | ||
["create", "$P1", "Array"], | ||
["size", "$L3", "$L2.items"], | ||
["create", "$L4", "Number"], | ||
["if<than", "$L4", "$L3", 6], | ||
["get", "$L5", "$L2.items", "$L4"], | ||
["if==than", "$L5.timeDeleted", null, 2], | ||
["callFunc", "makeMeta", "$P0", "$L6", "$L5"], | ||
["push", "$P1", "$L6"], | ||
["math.add", "$L4", "$L4", 1], | ||
["jumpRel", -7], | ||
["if!=than", "$L2.nextPageToken", null, 7], | ||
["string.concat", "$L0.url", "$P0.storageBase", "/b/", "$P2.name", "/o?maxResults=1000", "&pageToken=", "$L2.nextPageToken"], | ||
["create", "$L0.requestHeaders", "Object"], | ||
["string.concat", "$L0.requestHeaders.Authorization", "Bearer ", "$P0.accessToken"], | ||
["http.requestCall", "$L1", "$L0"], | ||
["callFunc", "validateResponse", "$P0", "$L1"], | ||
["json.parse", "$L2", "$L1.responseBody"], | ||
["jumpRel", -17] | ||
], | ||
"checkPrefix": [ | ||
["if==than", "$P1", null, 2], | ||
["create", "$L1", "Error", "Prefix supplied is null", "IllegalArgument"], | ||
["throwError", "$L1"] | ||
], | ||
"getFileMetadata": [ | ||
@@ -384,2 +420,17 @@ ["callFunc", "checkBucket", "$P0", "$P2"], | ||
}; | ||
GoogleCloudPlatform.prototype.listFilesWithPrefix = function (bucket, prefix, callback) { | ||
Statistics_1.Statistics.addCall("GoogleCloudPlatform", "listFilesWithPrefix"); | ||
var ip = new Interpreter_1.Interpreter(new Sandbox_1.Sandbox(SERVICE_CODE, this.persistentStorage, this.instanceDependencyStorage)); | ||
ip.callFunction("listFilesWithPrefix", this.interpreterStorage, null, bucket, prefix).then(function () { | ||
Helper_1.Helper.checkSandboxError(ip, "GoogleCloudPlatform", "listFilesWithPrefix"); | ||
}).then(function () { | ||
var res; | ||
res = ip.getParameter(1); | ||
if (callback != null && typeof callback === "function") | ||
callback(undefined, res); | ||
}, function (err) { | ||
if (callback != null && typeof callback === "function") | ||
callback(err); | ||
}); | ||
}; | ||
GoogleCloudPlatform.prototype.uploadFile = function (bucket, name, stream, size, callback) { | ||
@@ -386,0 +437,0 @@ Statistics_1.Statistics.addCall("GoogleCloudPlatform", "uploadFile"); |
@@ -222,2 +222,54 @@ "use strict"; | ||
], | ||
"Storage:listFilesWithPrefix": [ | ||
["callFunc", "checkBucket", "$P0", "$P2"], | ||
["callFunc", "checkPrefix", "$P0", "$P3"], | ||
["create", "$L1", "Date"], | ||
["create", "$L4", "Object"], | ||
["set", "$L4", "$L1.rfcTime1123", "x-ms-date"], | ||
["set", "$L4", "2016-05-31", "x-ms-version"], | ||
["create", "$L3", "String"], | ||
["string.concat", "$L3", "/", "$P0.accountName", "/", "$P2.name", "\ncomp:list", "\nprefix:", "$P3", "\nrestype:directory"], | ||
["create", "$L2", "String"], | ||
["callFunc", "signedString", "$L2", "GET", "", "$L4", "$L3", "$P0"], | ||
["string.concat", "$L2", "SharedKey ", "$P0.accountName", ":", "$L2"], | ||
["set", "$L4", "$L2", "Authorization"], | ||
["create", "$L5", "Object"], | ||
["string.concat", "$L0", "https://", "$P0.accountName", ".file.core.windows.net/", "$P2.name", "?comp=list&prefix=", "$P3", "&restype=directory"], | ||
["set", "$L5.url", "$L0"], | ||
["set", "$L5.method", "GET"], | ||
["set", "$L5.requestHeaders", "$L4"], | ||
["http.requestCall", "$L6", "$L5"], | ||
["callFunc", "checkHttpErrors", "$P0", "$L6", "authentication", 200], | ||
["create", "$L14", "Array"], | ||
["stream.streamToString", "$L12", "$L6.responseBody"], | ||
["xml.parse", "$L12", "$L12"], | ||
["size", "$L10", "$L12.children.1.children"], | ||
["if!=than", "$L10", 0, 20], | ||
["math.add", "$L10", "$L10", -1], | ||
["create", "$L13", "BusinessFileMetaData"], | ||
["get", "$L15", "$L12.children.1.children", "$L10"], | ||
["if==than", "$L15.name", "Directory", 8], | ||
["create", "$L20", "String"], | ||
["string.concat", "$L20", "$L15.children.0.text", "/"], | ||
["set", "$L13.fileName", "$L20"], | ||
["size", "$L16", "$L15.children.1.children"], | ||
["if!=than", "$L16", 0, 2], | ||
["math.add", "$L11", "$L15.children.1.children.0.text", 0], | ||
["set", "$L13.size", "$L11"], | ||
["push", "$L14", "$L13"], | ||
["if==than", "$L15.name", "File", 6], | ||
["set", "$L13.fileName", "$L15.children.0.text"], | ||
["size", "$L16", "$L15.children.1.children"], | ||
["if!=than", "$L16", 0, 2], | ||
["math.add", "$L11", "$L15.children.1.children.0.text", 0], | ||
["set", "$L13.size", "$L11"], | ||
["push", "$L14", "$L13"], | ||
["jumpRel", -21], | ||
["set", "$P1", "$L14"] | ||
], | ||
"checkPrefix": [ | ||
["if==than", "$P1", null, 2], | ||
["create", "$L1", "Error", "Prefix supplied is null", "IllegalArgument"], | ||
["throwError", "$L1"] | ||
], | ||
"getSubDirectories": [ | ||
@@ -647,2 +699,17 @@ ["create", "$L1", "Date"], | ||
}; | ||
MicrosoftAzure.prototype.listFilesWithPrefix = function (bucket, prefix, callback) { | ||
Statistics_1.Statistics.addCall("MicrosoftAzure", "listFilesWithPrefix"); | ||
var ip = new Interpreter_1.Interpreter(new Sandbox_1.Sandbox(SERVICE_CODE, this.persistentStorage, this.instanceDependencyStorage)); | ||
ip.callFunction("Storage:listFilesWithPrefix", this.interpreterStorage, null, bucket, prefix).then(function () { | ||
Helper_1.Helper.checkSandboxError(ip, "MicrosoftAzure", "listFilesWithPrefix"); | ||
}).then(function () { | ||
var res; | ||
res = ip.getParameter(1); | ||
if (callback != null && typeof callback === "function") | ||
callback(undefined, res); | ||
}, function (err) { | ||
if (callback != null && typeof callback === "function") | ||
callback(err); | ||
}); | ||
}; | ||
MicrosoftAzure.prototype.uploadFile = function (bucket, name, stream, size, callback) { | ||
@@ -649,0 +716,0 @@ Statistics_1.Statistics.addCall("MicrosoftAzure", "uploadFile"); |
@@ -140,2 +140,39 @@ "use strict"; | ||
], | ||
"Storage:listFilesWithPrefix": [ | ||
["callFunc", "checkBucket", "$P0", "$P2"], | ||
["callFunc", "checkPrefix", "$P0", "$P3"], | ||
["callFunc", "checkAuthentication", "$P0"], | ||
["create", "$L4", "Object"], | ||
["set", "$L4", "application/x-www-form-urlencoded", "Content-Type"], | ||
["set", "$L4", "$S0.authorizationToken", "X-Auth-Token"], | ||
["create", "$L5", "Object"], | ||
["string.concat", "$L10", "$S0.publicURL", "/", "$P2.name", "?format=json"], | ||
["if!=than", "$P3", null, 2], | ||
["string.concat", "$L2", "$L10", "&prefix=", "$P3"], | ||
["set", "$L10", "$L2"], | ||
["set", "$L5.url", "$L10"], | ||
["set", "$L5.method", "GET"], | ||
["set", "$L5.requestHeaders", "$L4"], | ||
["http.requestCall", "$L6", "$L5"], | ||
["callFunc", "checkHttpErrors", "$P0", "$L6", "authentication", 200], | ||
["create", "$L14", "Array"], | ||
["stream.streamToString", "$L12", "$L6.responseBody"], | ||
["json.parse", "$L12", "$L12"], | ||
["size", "$L10", "$L12"], | ||
["if!=than", "$L10", 0, 8], | ||
["math.add", "$L10", "$L10", -1], | ||
["create", "$L13", "BusinessFileMetaData"], | ||
["get", "$L15", "$L12", "$L10"], | ||
["set", "$L13.fileID", "$L15.hash"], | ||
["set", "$L13.fileName", "$L15.name"], | ||
["set", "$L13.size", "$L15.bytes"], | ||
["push", "$L14", "$L13"], | ||
["jumpRel", -9], | ||
["set", "$P1", "$L14"] | ||
], | ||
"checkPrefix": [ | ||
["if==than", "$P1", null, 2], | ||
["create", "$L1", "Error", "Prefix supplied is null", "IllegalArgument"], | ||
["throwError", "$L1"] | ||
], | ||
"Storage:getFileMetadata": [ | ||
@@ -444,2 +481,17 @@ ["callFunc", "checkBucket", "$P0", "$P2"], | ||
}; | ||
Rackspace.prototype.listFilesWithPrefix = function (bucket, prefix, callback) { | ||
Statistics_1.Statistics.addCall("Rackspace", "listFilesWithPrefix"); | ||
var ip = new Interpreter_1.Interpreter(new Sandbox_1.Sandbox(SERVICE_CODE, this.persistentStorage, this.instanceDependencyStorage)); | ||
ip.callFunction("Storage:listFilesWithPrefix", this.interpreterStorage, null, bucket, prefix).then(function () { | ||
Helper_1.Helper.checkSandboxError(ip, "Rackspace", "listFilesWithPrefix"); | ||
}).then(function () { | ||
var res; | ||
res = ip.getParameter(1); | ||
if (callback != null && typeof callback === "function") | ||
callback(undefined, res); | ||
}, function (err) { | ||
if (callback != null && typeof callback === "function") | ||
callback(err); | ||
}); | ||
}; | ||
Rackspace.prototype.uploadFile = function (bucket, name, stream, size, callback) { | ||
@@ -446,0 +498,0 @@ Statistics_1.Statistics.addCall("Rackspace", "uploadFile"); |
@@ -250,2 +250,17 @@ "use strict"; | ||
}; | ||
Yelp.prototype.advancedRequest = function (specification, callback) { | ||
Statistics_1.Statistics.addCall("Yelp", "advancedRequest"); | ||
var ip = new Interpreter_1.Interpreter(new Sandbox_1.Sandbox(SERVICE_CODE, this.persistentStorage, this.instanceDependencyStorage)); | ||
ip.callFunction("AdvancedRequestSupporter:advancedRequest", this.interpreterStorage, null, specification).then(function () { | ||
Helper_1.Helper.checkSandboxError(ip, "Yelp", "advancedRequest"); | ||
}).then(function () { | ||
var res; | ||
res = ip.getParameter(1); | ||
if (callback != null && typeof callback === "function") | ||
callback(undefined, res); | ||
}, function (err) { | ||
if (callback != null && typeof callback === "function") | ||
callback(err); | ||
}); | ||
}; | ||
Yelp.prototype.saveAsString = function () { | ||
@@ -252,0 +267,0 @@ Statistics_1.Statistics.addCall("Yelp", "saveAsString"); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1547658
31827