New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cloudinary

Package Overview
Dependencies
Maintainers
1
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudinary - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

lib/api.js.map

101

lib/api.js

@@ -1,5 +0,5 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.9.1
(function() {
var Q, call_api, config, https, only, querystring, transformation_string, utils, _,
__slice = [].slice;
var Q, _, call_api, config, https, only, querystring, transformation_string, utils,
slice = [].slice;

@@ -40,7 +40,7 @@ _ = require("underscore");

exports.resources = function(callback, options) {
var resource_type, type, uri, _ref;
var ref, resource_type, type, uri;
if (options == null) {
options = {};
}
resource_type = (_ref = options["resource_type"]) != null ? _ref : "image";
resource_type = (ref = options["resource_type"]) != null ? ref : "image";
type = options["type"];

@@ -58,7 +58,7 @@ uri = ["resources", resource_type];

exports.resources_by_tag = function(tag, callback, options) {
var resource_type, uri, _ref;
var ref, resource_type, uri;
if (options == null) {
options = {};
}
resource_type = (_ref = options["resource_type"]) != null ? _ref : "image";
resource_type = (ref = options["resource_type"]) != null ? ref : "image";
uri = ["resources", resource_type, "tags", tag];

@@ -69,7 +69,7 @@ return call_api("get", uri, only(options, "next_cursor", "max_results", "tags", "context", "direction", "moderations"), callback, options);

exports.resources_by_moderation = function(kind, status, callback, options) {
var resource_type, uri, _ref;
var ref, resource_type, uri;
if (options == null) {
options = {};
}
resource_type = (_ref = options["resource_type"]) != null ? _ref : "image";
resource_type = (ref = options["resource_type"]) != null ? ref : "image";
uri = ["resources", resource_type, "moderations", kind, status];

@@ -80,8 +80,8 @@ return call_api("get", uri, only(options, "next_cursor", "max_results", "tags", "context", "direction", "moderations"), callback, options);

exports.resources_by_ids = function(public_ids, callback, options) {
var params, resource_type, type, uri, _ref, _ref1;
var params, ref, ref1, resource_type, type, uri;
if (options == null) {
options = {};
}
resource_type = (_ref = options["resource_type"]) != null ? _ref : "image";
type = (_ref1 = options["type"]) != null ? _ref1 : "upload";
resource_type = (ref = options["resource_type"]) != null ? ref : "image";
type = (ref1 = options["type"]) != null ? ref1 : "upload";
uri = ["resources", resource_type, type];

@@ -94,8 +94,8 @@ params = only(options, "tags", "context", "moderations");

exports.resource = function(public_id, callback, options) {
var resource_type, type, uri, _ref, _ref1;
var ref, ref1, resource_type, type, uri;
if (options == null) {
options = {};
}
resource_type = (_ref = options["resource_type"]) != null ? _ref : "image";
type = (_ref1 = options["type"]) != null ? _ref1 : "upload";
resource_type = (ref = options["resource_type"]) != null ? ref : "image";
type = (ref1 = options["type"]) != null ? ref1 : "upload";
uri = ["resources", resource_type, type, public_id];

@@ -106,8 +106,8 @@ return call_api("get", uri, only(options, "exif", "colors", "faces", "image_metadata", "pages", "phash", "coordinates", "max_results"), callback, options);

exports.update = function(public_id, callback, options) {
var params, resource_type, type, uri, _ref, _ref1;
var params, ref, ref1, resource_type, type, uri;
if (options == null) {
options = {};
}
resource_type = (_ref = options["resource_type"]) != null ? _ref : "image";
type = (_ref1 = options["type"]) != null ? _ref1 : "upload";
resource_type = (ref = options["resource_type"]) != null ? ref : "image";
type = (ref1 = options["type"]) != null ? ref1 : "upload";
uri = ["resources", resource_type, type, public_id];

@@ -122,8 +122,8 @@ params = utils.updateable_resource_params(options);

exports.delete_resources = function(public_ids, callback, options) {
var resource_type, type, uri, _ref, _ref1;
var ref, ref1, resource_type, type, uri;
if (options == null) {
options = {};
}
resource_type = (_ref = options["resource_type"]) != null ? _ref : "image";
type = (_ref1 = options["type"]) != null ? _ref1 : "upload";
resource_type = (ref = options["resource_type"]) != null ? ref : "image";
type = (ref1 = options["type"]) != null ? ref1 : "upload";
uri = ["resources", resource_type, type];

@@ -136,8 +136,8 @@ return call_api("delete", uri, _.extend({

exports.delete_resources_by_prefix = function(prefix, callback, options) {
var resource_type, type, uri, _ref, _ref1;
var ref, ref1, resource_type, type, uri;
if (options == null) {
options = {};
}
resource_type = (_ref = options["resource_type"]) != null ? _ref : "image";
type = (_ref1 = options["type"]) != null ? _ref1 : "upload";
resource_type = (ref = options["resource_type"]) != null ? ref : "image";
type = (ref1 = options["type"]) != null ? ref1 : "upload";
uri = ["resources", resource_type, type];

@@ -150,7 +150,7 @@ return call_api("delete", uri, _.extend({

exports.delete_resources_by_tag = function(tag, callback, options) {
var resource_type, uri, _ref;
var ref, resource_type, uri;
if (options == null) {
options = {};
}
resource_type = (_ref = options["resource_type"]) != null ? _ref : "image";
resource_type = (ref = options["resource_type"]) != null ? ref : "image";
uri = ["resources", resource_type, "tags", tag];

@@ -161,8 +161,8 @@ return call_api("delete", uri, only(options, "keep_original", "next_cursor", "invalidate"), callback, options);

exports.delete_all_resources = function(callback, options) {
var resource_type, type, uri, _ref, _ref1;
var ref, ref1, resource_type, type, uri;
if (options == null) {
options = {};
}
resource_type = (_ref = options["resource_type"]) != null ? _ref : "image";
type = (_ref1 = options["type"]) != null ? _ref1 : "upload";
resource_type = (ref = options["resource_type"]) != null ? ref : "image";
type = (ref1 = options["type"]) != null ? ref1 : "upload";
uri = ["resources", resource_type, type];

@@ -186,7 +186,7 @@ return call_api("delete", uri, _.extend({

exports.tags = function(callback, options) {
var resource_type, uri, _ref;
var ref, resource_type, uri;
if (options == null) {
options = {};
}
resource_type = (_ref = options["resource_type"]) != null ? _ref : "image";
resource_type = (ref = options["resource_type"]) != null ? ref : "image";
uri = ["tags", resource_type];

@@ -309,7 +309,7 @@ return call_api("get", uri, only(options, "next_cursor", "max_results", "prefix"), callback, options);

exports.only = only = function() {
var hash, key, keys, result, _i, _len;
hash = arguments[0], keys = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
var hash, i, key, keys, len, result;
hash = arguments[0], keys = 2 <= arguments.length ? slice.call(arguments, 1) : [];
result = {};
for (_i = 0, _len = keys.length; _i < _len; _i++) {
key = keys[_i];
for (i = 0, len = keys.length; i < len; i++) {
key = keys[i];
if (hash[key] != null) {

@@ -323,9 +323,9 @@ result[key] = hash[key];

call_api = function(method, uri, params, callback, options) {
var api_key, api_secret, api_url, cloud_name, cloudinary, deferred, handle_response, query_params, request, request_options, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
var api_key, api_secret, api_url, cloud_name, cloudinary, deferred, handle_response, query_params, ref, ref1, ref2, ref3, ref4, ref5, request, request_options;
deferred = Q.defer();
cloudinary = (_ref = (_ref1 = options["upload_prefix"]) != null ? _ref1 : config().upload_prefix) != null ? _ref : "https://api.cloudinary.com";
cloudinary = (ref = (ref1 = options["upload_prefix"]) != null ? ref1 : config().upload_prefix) != null ? ref : "https://api.cloudinary.com";
cloud_name = (function() {
var _ref3;
if ((_ref2 = (_ref3 = options["cloud_name"]) != null ? _ref3 : config().cloud_name) != null) {
return _ref2;
var ref3;
if ((ref2 = (ref3 = options["cloud_name"]) != null ? ref3 : config().cloud_name) != null) {
return ref2;
} else {

@@ -336,5 +336,5 @@ throw "Must supply cloud_name";

api_key = (function() {
var _ref4;
if ((_ref3 = (_ref4 = options["api_key"]) != null ? _ref4 : config().api_key) != null) {
return _ref3;
var ref4;
if ((ref3 = (ref4 = options["api_key"]) != null ? ref4 : config().api_key) != null) {
return ref3;
} else {

@@ -345,5 +345,5 @@ throw "Must supply api_key";

api_secret = (function() {
var _ref5;
if ((_ref4 = (_ref5 = options["api_secret"]) != null ? _ref5 : config().api_secret) != null) {
return _ref4;
var ref5;
if ((ref4 = (ref5 = options["api_secret"]) != null ? ref5 : config().api_secret) != null) {
return ref4;
} else {

@@ -365,4 +365,7 @@ throw "Must supply api_secret";

},
auth: "" + api_key + ":" + api_secret
auth: api_key + ":" + api_secret
});
if (options.agent != null) {
request_options.agent = options.agent;
}
handle_response = function(res) {

@@ -440,3 +443,3 @@ var buffer, err_obj, error;

});
request.setTimeout((_ref5 = options["timeout"]) != null ? _ref5 : 60);
request.setTimeout((ref5 = options["timeout"]) != null ? ref5 : 60);
if (method !== "get") {

@@ -458,1 +461,3 @@ request.write(query_params);

}).call(this);
//# sourceMappingURL=api.js.map

@@ -1,4 +0,4 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.9.1
(function() {
var cloudinary_config, _;
var _, cloudinary_config;

@@ -10,3 +10,3 @@ _ = require("underscore");

module.exports = function(new_config, new_value) {
var cloudinary_url, k, uri, v, _ref;
var cloudinary_url, k, ref, uri, v;
if ((cloudinary_config == null) || new_config === true) {

@@ -24,5 +24,5 @@ cloudinary_url = process.env.CLOUDINARY_URL;

if (uri.query != null) {
_ref = uri.query;
for (k in _ref) {
v = _ref[k];
ref = uri.query;
for (k in ref) {
v = ref[k];
cloudinary_config[k] = v;

@@ -46,1 +46,3 @@ }

}).call(this);
//# sourceMappingURL=config.js.map

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.9.1
(function() {

@@ -76,1 +76,3 @@ var PRELOADED_CLOUDINARY_PATH, PreloadedFile, config, utils;

}).call(this);
//# sourceMappingURL=preloaded_file.js.map

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.9.1
(function() {

@@ -32,1 +32,3 @@ var UploadStream, stream, util;

}).call(this);
//# sourceMappingURL=upload_stream.js.map

@@ -1,4 +0,4 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.9.1
(function() {
var EncodeFieldPart, EncodeFilePart, Q, TEXT_PARAMS, UploadStream, build_upload_params, call_api, call_tags_api, config, fs, https, path, post, utils, _;
var EncodeFieldPart, EncodeFilePart, Q, TEXT_PARAMS, UploadStream, _, build_upload_params, call_api, call_tags_api, config, fs, https, path, post, utils;

@@ -90,3 +90,2 @@ _ = require("underscore");

upload_id: options.upload_id,
upload_id: options.upload_id,
tags: options.tags && utils.build_array(options.tags).join(',')

@@ -168,3 +167,3 @@ }

return call_api("explicit", callback, options, function() {
var _ref;
var ref;
return [

@@ -178,3 +177,3 @@ {

headers: utils.build_custom_headers(options.headers),
tags: (_ref = options.tags) != null ? _ref : utils.build_array(options.tags).join(","),
tags: (ref = options.tags) != null ? ref : utils.build_array(options.tags).join(","),
face_coordinates: options.face_coordinates && utils.encode_double_array(options.face_coordinates),

@@ -227,3 +226,3 @@ custom_coordinates: options.custom_coordinates && utils.encode_double_array(options.custom_coordinates)

return call_api("text", callback, options, function() {
var k, params, _i, _len;
var j, k, len, params;
params = {

@@ -233,4 +232,4 @@ timestamp: utils.timestamp(),

};
for (_i = 0, _len = TEXT_PARAMS.length; _i < _len; _i++) {
k = TEXT_PARAMS[_i];
for (j = 0, len = TEXT_PARAMS.length; j < len; j++) {
k = TEXT_PARAMS[j];
if (options[k] != null) {

@@ -359,6 +358,6 @@ params[k] = options[k];

call_api = function(action, callback, options, get_params) {
var api_url, boundary, deferred, file, handle_response, key, params, post_data, result, unsigned_params, v, value, _i, _len, _ref;
var api_url, boundary, deferred, file, handle_response, j, key, len, params, post_data, ref, result, unsigned_params, v, value;
deferred = Q.defer();
options = _.clone(options);
_ref = get_params.call(), params = _ref[0], unsigned_params = _ref[1], file = _ref[2];
ref = get_params.call(), params = ref[0], unsigned_params = ref[1], file = ref[2];
params = utils.process_request_params(params, options);

@@ -434,4 +433,4 @@ params = _.extend(params, unsigned_params);

if (_.isArray(value)) {
for (_i = 0, _len = value.length; _i < _len; _i++) {
v = value[_i];
for (j = 0, len = value.length; j < len; j++) {
v = value[j];
post_data.push(new Buffer(EncodeFieldPart(boundary, key + "[]", v), 'utf8'));

@@ -452,3 +451,3 @@ }

post = function(url, post_data, boundary, file, callback, options) {
var file_header, file_reader, filename, finish_buffer, i, post_options, post_request, timeout, upload_stream, _i, _ref, _ref1;
var file_header, file_reader, filename, finish_buffer, i, j, post_options, post_request, ref, ref1, timeout, upload_stream;
finish_buffer = new Buffer("--" + boundary + "--", 'ascii');

@@ -467,2 +466,5 @@ if ((file != null) || options.stream) {

});
if (options.agent != null) {
post_options.agent = options.agent;
}
post_request = https.request(post_options, callback);

@@ -488,7 +490,7 @@ upload_stream = new UploadStream({

});
post_request.setTimeout((_ref = options.timeout) != null ? _ref : 60000, function() {
post_request.setTimeout((ref = options.timeout) != null ? ref : 60000, function() {
timeout = true;
return post_request.abort();
});
for (i = _i = 0, _ref1 = post_data.length - 1; 0 <= _ref1 ? _i <= _ref1 : _i >= _ref1; i = 0 <= _ref1 ? ++_i : --_i) {
for (i = j = 0, ref1 = post_data.length - 1; 0 <= ref1 ? j <= ref1 : j >= ref1; i = 0 <= ref1 ? ++j : --j) {
post_request.write(post_data[i]);

@@ -567,7 +569,7 @@ }

exports.image_upload_tag = function(field, options) {
var html_options, tag_options, _ref;
var html_options, ref, tag_options;
if (options == null) {
options = {};
}
html_options = (_ref = options.html) != null ? _ref : {};
html_options = (ref = options.html) != null ? ref : {};
tag_options = _.extend(html_options, {

@@ -595,1 +597,3 @@ type: "file",

}).call(this);
//# sourceMappingURL=uploader.js.map

@@ -1,5 +0,5 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.9.1
(function() {
var CLOUDINARY_JS_CONFIG_PARAMS, DEFAULT_RESPONSIVE_WIDTH_TRANSFORMATION, as_safe_bool, build_array, build_custom_headers, build_eager, config, crc32, crypto, encode_double_array, encode_key_value, finalize_resource_type, finalize_source, generate_transformation_string, option_consume, present, querystring, smart_escape, unsigned_url_prefix, updateable_resource_params, utf8_encode, v1_adapter, v1_result_adapter, _,
__slice = [].slice;
var CLOUDINARY_JS_CONFIG_PARAMS, DEFAULT_RESPONSIVE_WIDTH_TRANSFORMATION, _, as_safe_bool, build_array, build_custom_headers, build_eager, config, crc32, crypto, encode_double_array, encode_key_value, finalize_resource_type, finalize_source, generate_transformation_string, option_consume, present, querystring, smart_escape, unsigned_url_prefix, updateable_resource_params, utf8_encode, v1_adapter, v1_result_adapter,
slice = [].slice;

@@ -22,3 +22,3 @@ _ = require("underscore");

exports.VERSION = "1.1.1";
exports.VERSION = "1.1.2";

@@ -106,9 +106,9 @@ exports.USER_AGENT = "cld-node-" + exports.VERSION;

pairs = (function() {
var _results;
_results = [];
var results;
results = [];
for (k in arg) {
v = arg[k];
_results.push("" + k + "=" + v);
results.push(k + "=" + v);
}
return _results;
return results;
})();

@@ -124,11 +124,11 @@ return pairs.join("|");

return ((function() {
var _i, _len, _ref, _results;
_ref = build_array(transformations);
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
transformation = _ref[_i];
var j, len, ref, results;
ref = build_array(transformations);
results = [];
for (j = 0, len = ref.length; j < len; j++) {
transformation = ref[j];
transformation = _.clone(transformation);
_results.push(_.filter([generate_transformation_string(transformation), transformation.format], present).join("/"));
results.push(_.filter([generate_transformation_string(transformation), transformation.format], present).join("/"));
}
return _results;
return results;
})()).join("|");

@@ -139,22 +139,22 @@ };

var k, v;
if (headers == null) {
return void 0;
} else if (_.isArray(headers)) {
} else if (_.isObject(headers)) {
headers = [
(function() {
var _results;
_results = [];
for (k in headers) {
v = headers[k];
_results.push(k + ": " + v);
}
return _results;
})()
];
} else {
return headers;
switch (false) {
case !(headers == null):
return void 0;
case !_.isArray(headers):
return headers.join("\n");
case !_.isObject(headers):
return [
(function() {
var results;
results = [];
for (k in headers) {
v = headers[k];
results.push(k + ": " + v);
}
return results;
})()
].join("\n");
default:
return headers;
}
return headers.join("\n");
};

@@ -167,12 +167,12 @@

exports.generate_transformation_string = generate_transformation_string = function(options) {
var angle, background, base_transformation, base_transformations, border, color, crop, dpr, effect, flags, has_layer, height, key, named_transformation, no_html_sizes, param, params, responsive_width, responsive_width_transformation, result, short, simple_params, size, transformation, value, width, _ref, _ref1, _ref2, _ref3;
var angle, background, base_transformation, base_transformations, border, color, crop, dpr, effect, flags, has_layer, height, key, named_transformation, no_html_sizes, param, params, ref, ref1, ref2, ref3, responsive_width, responsive_width_transformation, result, short, simple_params, size, transformation, value, width;
if (_.isArray(options)) {
result = (function() {
var _i, _len, _results;
_results = [];
for (_i = 0, _len = options.length; _i < _len; _i++) {
base_transformation = options[_i];
_results.push(generate_transformation_string(_.clone(base_transformation)));
var j, len, results;
results = [];
for (j = 0, len = options.length; j < len; j++) {
base_transformation = options[j];
results.push(generate_transformation_string(_.clone(base_transformation)));
}
return _results;
return results;
})();

@@ -186,3 +186,3 @@ return result.join("/");

if (size) {
_ref1 = (_ref = size.split("x"), width = _ref[0], height = _ref[1], _ref), options["width"] = _ref1[0], options["height"] = _ref1[1];
ref1 = (ref = size.split("x"), width = ref[0], height = ref[1], ref), options["width"] = ref1[0], options["height"] = ref1[1];
}

@@ -223,3 +223,3 @@ has_layer = options.overlay || options.underlay;

value = effect[key];
effect = "" + key + ":" + value;
effect = key + ":" + value;
}

@@ -233,3 +233,3 @@ } else if (_.isArray(effect)) {

if (_.isObject(border)) {
border = "" + ((_ref2 = border.width) != null ? _ref2 : 2) + "px_solid_" + (((_ref3 = border.color) != null ? _ref3 : "black").replace(/^#/, 'rgb:'));
border = ((ref2 = border.width) != null ? ref2 : 2) + "px_solid_" + (((ref3 = border.color) != null ? ref3 : "black").replace(/^#/, 'rgb:'));
} else if ((border != null) && border.toString().match(/^\d+$/)) {

@@ -276,9 +276,9 @@ options.border = border;

params = _.sortBy((function() {
var _results;
_results = [];
var results;
results = [];
for (key in params) {
value = params[key];
_results.push([key, value]);
results.push([key, value]);
}
return _results;
return results;
})(), function(key, value) {

@@ -289,11 +289,11 @@ return key;

transformation = ((function() {
var _i, _len, _results;
_results = [];
for (_i = 0, _len = params.length; _i < _len; _i++) {
param = params[_i];
var j, len, results;
results = [];
for (j = 0, len = params.length; j < len; j++) {
param = params[j];
if (present(_.last(param))) {
_results.push(param.join("_"));
results.push(param.join("_"));
}
}
return _results;
return results;
})()).join(",");

@@ -358,3 +358,3 @@ base_transformations.push(transformation);

exports.url = function(public_id, options) {
var api_secret, cdn_subdomain, cloud_name, cname, format, original_source, prefix, preloaded, private_cdn, resource_type, secure, secure_cdn_subdomain, secure_distribution, shasum, shorten, sign_url, signature, source_to_sign, ssl_detected, to_sign, transformation, type, url, url_suffix, use_root_path, version, _ref, _ref1;
var api_secret, cdn_subdomain, cloud_name, cname, format, original_source, prefix, preloaded, private_cdn, ref, ref1, resource_type, secure, secure_cdn_subdomain, secure_distribution, shasum, shorten, sign_url, signature, source_to_sign, ssl_detected, to_sign, transformation, type, url, url_suffix, use_root_path, version;
if (options == null) {

@@ -399,9 +399,4 @@ options = {};

}
if (!private_cdn) {
if (!!url_suffix) {
throw 'URL Suffix only supported in private CDN';
}
if (use_root_path) {
throw 'Root path only supported in private CDN';
}
if (url_suffix && !private_cdn) {
throw 'URL Suffix only supported in private CDN';
}

@@ -416,4 +411,4 @@ original_source = public_id;

}
_ref = finalize_resource_type(resource_type, type, url_suffix, use_root_path, shorten), resource_type = _ref[0], type = _ref[1];
_ref1 = finalize_source(public_id, format, url_suffix), public_id = _ref1[0], source_to_sign = _ref1[1];
ref = finalize_resource_type(resource_type, type, url_suffix, use_root_path, shorten), resource_type = ref[0], type = ref[1];
ref1 = finalize_source(public_id, format, url_suffix), public_id = ref1[0], source_to_sign = ref1[1];
if (source_to_sign.indexOf("/") > 0 && !source_to_sign.match(/^v[0-9]+/) && !source_to_sign.match(/^https?:\//)) {

@@ -598,3 +593,3 @@ if (version == null) {

exports.api_url = function(action, options) {
var cloud_name, cloudinary, resource_type, _ref, _ref1, _ref2, _ref3;
var cloud_name, cloudinary, ref, ref1, ref2, ref3, resource_type;
if (action == null) {

@@ -606,7 +601,7 @@ action = 'upload';

}
cloudinary = (_ref = (_ref1 = options["upload_prefix"]) != null ? _ref1 : config().upload_prefix) != null ? _ref : "https://api.cloudinary.com";
cloudinary = (ref = (ref1 = options["upload_prefix"]) != null ? ref1 : config().upload_prefix) != null ? ref : "https://api.cloudinary.com";
cloud_name = (function() {
var _ref3;
if ((_ref2 = (_ref3 = options["cloud_name"]) != null ? _ref3 : config().cloud_name) != null) {
return _ref2;
var ref3;
if ((ref2 = (ref3 = options["cloud_name"]) != null ? ref3 : config().cloud_name) != null) {
return ref2;
} else {

@@ -616,3 +611,3 @@ throw "Must supply cloud_name";

})();
resource_type = (_ref3 = options["resource_type"]) != null ? _ref3 : "image";
resource_type = (ref3 = options["resource_type"]) != null ? ref3 : "image";
return [cloudinary, "v1_1", cloud_name, resource_type, action].join("/");

@@ -626,3 +621,3 @@ };

exports.signed_preloaded_image = function(result) {
return "" + result.resource_type + "/upload/v" + result.version + "/" + (_.filter([result.public_id, result.format], present).join(".")) + "#" + result.signature;
return result.resource_type + "/upload/v" + result.version + "/" + (_.filter([result.public_id, result.format], present).join(".")) + "#" + result.signature;
};

@@ -633,11 +628,11 @@

to_sign = _.sortBy((function() {
var _results;
_results = [];
var results;
results = [];
for (k in params_to_sign) {
v = params_to_sign[k];
if (v != null) {
_results.push("" + k + "=" + (build_array(v).join(",")));
results.push(k + "=" + (build_array(v).join(",")));
}
}
return _results;
return results;
})(), _.identity).join("&");

@@ -676,3 +671,3 @@ shasum = crypto.createHash('sha1');

exports.sign_request = function(params, options) {
var api_key, api_secret, _ref, _ref1;
var api_key, api_secret, ref, ref1;
if (options == null) {

@@ -682,5 +677,5 @@ options = {};

api_key = (function() {
var _ref1;
if ((_ref = (_ref1 = options.api_key) != null ? _ref1 : config().api_key) != null) {
return _ref;
var ref1;
if ((ref = (ref1 = options.api_key) != null ? ref1 : config().api_key) != null) {
return ref;
} else {

@@ -691,5 +686,5 @@ throw "Must supply api_key";

api_secret = (function() {
var _ref2;
if ((_ref1 = (_ref2 = options.api_secret) != null ? _ref2 : config().api_secret) != null) {
return _ref1;
var ref2;
if ((ref1 = (ref2 = options.api_secret) != null ? ref2 : config().api_secret) != null) {
return ref1;
} else {

@@ -705,2 +700,26 @@ throw "Must supply api_secret";

exports.webhook_signature = function(data, timestamp, options) {
var api_secret, ref, shasum;
if (options == null) {
options = {};
}
if (!data) {
throw "Must supply data";
}
if (!timestamp) {
throw "Must supply timestamp";
}
api_secret = (function() {
var ref1;
if ((ref = (ref1 = options.api_secret) != null ? ref1 : config().api_secret) != null) {
return ref;
} else {
throw "Must supply api_secret";
}
})();
shasum = crypto.createHash('sha1');
shasum.update(data + timestamp + api_secret);
return shasum.digest('hex');
};
exports.process_request_params = function(params, options) {

@@ -749,11 +768,11 @@ if ((options.unsigned != null) && options.unsigned) {

return ((function() {
var _i, _len, _results;
_results = [];
for (_i = 0, _len = keys.length; _i < _len; _i++) {
key = keys[_i];
var j, len, results;
results = [];
for (j = 0, len = keys.length; j < len; j++) {
key = keys[j];
if (present(options[key])) {
_results.push("" + key + "='" + options[key] + "'");
results.push(key + "='" + options[key] + "'");
}
}
return _results;
return results;
})()).join(" ");

@@ -765,6 +784,6 @@ };

exports.cloudinary_js_config = function() {
var param, params, value, _i, _len;
var j, len, param, params, value;
params = {};
for (_i = 0, _len = CLOUDINARY_JS_CONFIG_PARAMS.length; _i < _len; _i++) {
param = CLOUDINARY_JS_CONFIG_PARAMS[_i];
for (j = 0, len = CLOUDINARY_JS_CONFIG_PARAMS.length; j < len; j++) {
param = CLOUDINARY_JS_CONFIG_PARAMS[j];
value = config()[param];

@@ -795,3 +814,3 @@ if (value != null) {

var args, callback, options, pass_args;
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
pass_args = _.first(args, num_pass_args);

@@ -811,9 +830,9 @@ options = args[num_pass_args];

exports.v1_adapters = function(exports, v1, mapping) {
var name, num_pass_args, _results;
_results = [];
var name, num_pass_args, results;
results = [];
for (name in mapping) {
num_pass_args = mapping[name];
_results.push(exports[name] = v1_adapter(name, num_pass_args, v1));
results.push(exports[name] = v1_adapter(name, num_pass_args, v1));
}
return _results;
return results;
};

@@ -835,1 +854,3 @@

}).call(this);
//# sourceMappingURL=utils.js.map

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.9.1
(function() {

@@ -40,1 +40,3 @@ var api, utils;

}).call(this);
//# sourceMappingURL=api.js.map

@@ -1,4 +0,4 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.9.1
(function() {
var v1, v2, _;
var _, v1, v2;

@@ -18,1 +18,3 @@ v1 = require('../../cloudinary.js');

}).call(this);
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.9.1
(function() {

@@ -39,1 +39,3 @@ var uploader, utils;

}).call(this);
//# sourceMappingURL=uploader.js.map

@@ -5,3 +5,3 @@ {

"description": "Cloudinary NPM for node.js integration",
"version": "1.1.1",
"version": "1.1.2",
"homepage": "http://cloudinary.com",

@@ -18,3 +18,3 @@ "repository": {

"devDependencies": {
"coffee-script": "1.7.x",
"coffee-script": "1.9.x",
"dotenv": "^0.4.0",

@@ -28,3 +28,3 @@ "expect.js": "",

"test": "node_modules/.bin/mocha -R spec --recursive test/",
"compile": "node_modules/.bin/coffee -o lib -c src"
"compile": "node_modules/.bin/coffee --map -o lib -c src"
},

@@ -31,0 +31,0 @@ "optionalDependencies": {},

@@ -66,2 +66,14 @@ Cloudinary

### Overriding the request agent
To override the request agent pass the agent into any method that makes a
request and it will be used instead of the normal https agent. e.g
```js
cloudinary.uploader.upload_stream(
function(result) { console.log(result); },
{ agent: myAgent }
);
```
### Embedding and transforming images

@@ -68,0 +80,0 @@

@@ -32,3 +32,3 @@ var dotenv = require('dotenv');

// Stream upload
var stream = cloudinary.uploader.upload_stream({tags: 'basic_sample'},function(err,image) {
var upload_stream= cloudinary.uploader.upload_stream({tags: 'basic_sample'},function(err,image) {
console.log();

@@ -42,3 +42,3 @@ console.log("** Stream Upload");

});
var file_reader = fs.createReadStream('pizza.jpg', {encoding: 'binary'}).on('data', stream.write).on('end', stream.end);
var file_reader = fs.createReadStream('pizza.jpg').pipe(upload_stream);

@@ -45,0 +45,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc