Skip to content

Commit

Permalink
v0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasra Kyanzadeh committed Apr 12, 2018
1 parent 1dd8e3f commit 597fdf9
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 146 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v0.5.3
* Fix User-Agent header warnings when running Chrome (#52)
* Fix JSON imports so webpack can bundle

# v0.5.2
* Support for the `cellFormat`, `userLocale`, and `timeZone` parameters

Expand Down
204 changes: 59 additions & 145 deletions build/airtable.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = AirtableError;
'use strict';

var _ = require('lodash');
var internalConfig = require('./internal_config');
var internalConfig = require('./internal_config.json');
var Class = require('./class');
var AirtableError = require('./airtable_error');
var Table = require('./table');
Expand Down Expand Up @@ -101,7 +101,7 @@ Base.createFunctor = function(airtable, baseId) {

module.exports = Base;

},{"./airtable_error":1,"./class":4,"./internal_config":6,"./run_action":10,"./table":11,"lodash":19}],3:[function(require,module,exports){
},{"./airtable_error":1,"./class":4,"./internal_config.json":6,"./run_action":10,"./table":11,"lodash":19}],3:[function(require,module,exports){
'use strict';

/**
Expand Down Expand Up @@ -595,7 +595,7 @@ module.exports = Record;
},{"./callback_to_promise":3,"./class":4,"lodash":19}],10:[function(require,module,exports){
'use strict';

var internalConfig = require('./internal_config');
var internalConfig = require('./internal_config.json');
var objectToQueryParamString = require('./object_to_query_param_string');

// This will become require('xhr') in the browser.
Expand All @@ -604,17 +604,29 @@ var request = require('request');
function runAction(base, method, path, queryParams, bodyData, callback) {
var url = base._airtable._endpointUrl + '/v' + base._airtable._apiVersionMajor + '/' + base._id + path + '?' + objectToQueryParamString(queryParams);

var headers = {
'authorization': 'Bearer ' + base._airtable._apiKey,
'x-api-version': base._airtable._apiVersion,
'x-airtable-application-id': base.getId(),
};

var userAgent = 'Airtable.js';
var isBrowser = typeof window !== 'undefined';
// Some browsers do not allow overriding the user agent.
// https://github.com/Airtable/airtable.js/issues/52
if (isBrowser) {
headers['x-airtable-user-agent'] = userAgent;
} else {
headers['User-Agent'] = userAgent;
}


var options = {
method: method.toUpperCase(),
url: url,
json: true,
timeout: base._airtable.requestTimeout,
headers: {
'authorization': 'Bearer ' + base._airtable._apiKey,
'x-api-version': base._airtable._apiVersion,
'x-airtable-application-id': base.getId(),
'User-Agent': 'Airtable.js',
},
headers: headers,
// agentOptions are ignored when running in the browser.
agentOptions: {
rejectUnauthorized: base._airtable._allowUnauthorizedSsl
Expand Down Expand Up @@ -645,7 +657,7 @@ function runAction(base, method, path, queryParams, bodyData, callback) {

module.exports = runAction;

},{"./internal_config":6,"./object_to_query_param_string":7,"request":20}],11:[function(require,module,exports){
},{"./internal_config.json":6,"./object_to_query_param_string":7,"request":20}],11:[function(require,module,exports){
'use strict';

var _ = require('lodash');
Expand Down Expand Up @@ -2108,7 +2120,7 @@ module.exports = check;
}());

}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"_process":15}],14:[function(require,module,exports){
},{"_process":16}],14:[function(require,module,exports){
// http://wiki.commonjs.org/wiki/Unit_Testing/1.0
//
// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
Expand Down Expand Up @@ -2470,104 +2482,40 @@ var objectKeys = Object.keys || function (obj) {
};

},{"util/":18}],15:[function(require,module,exports){
// shim for using process in browser
var process = module.exports = {};

// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.

var cachedSetTimeout;
var cachedClearTimeout;

function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}


if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
});
};
} else {
// old school shim for old browsers
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
var TempCtor = function () {}
TempCtor.prototype = superCtor.prototype
ctor.prototype = new TempCtor()
ctor.prototype.constructor = ctor
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}


},{}],16:[function(require,module,exports){
// shim for using process in browser

}
var process = module.exports = {};
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;

function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
Expand All @@ -2583,24 +2531,22 @@ function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
var timeout = setTimeout(cleanUpNextTick);
draining = true;

var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
currentQueue[queueIndex].run();
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
clearTimeout(timeout);
}

process.nextTick = function (fun) {
Expand All @@ -2612,7 +2558,7 @@ process.nextTick = function (fun) {
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
setTimeout(drainQueue, 0);
}
};

Expand Down Expand Up @@ -2640,46 +2586,18 @@ process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;

process.listeners = function (name) { return [] }

process.binding = function (name) {
throw new Error('process.binding is not supported');
};

// TODO(shtylman)
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };

},{}],16:[function(require,module,exports){
if (typeof Object.create === 'function') {
// implementation from standard node.js 'util' module
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
}
});
};
} else {
// old school shim for old browsers
module.exports = function inherits(ctor, superCtor) {
ctor.super_ = superCtor
var TempCtor = function () {}
TempCtor.prototype = superCtor.prototype
ctor.prototype = new TempCtor()
ctor.prototype.constructor = ctor
}
}

},{}],17:[function(require,module,exports){
module.exports = function isBuffer(arg) {
return arg && typeof arg === 'object'
Expand Down Expand Up @@ -3277,7 +3195,7 @@ function hasOwnProperty(obj, prop) {
}

}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./support/isBuffer":17,"_process":15,"inherits":16}],19:[function(require,module,exports){
},{"./support/isBuffer":17,"_process":16,"inherits":15}],19:[function(require,module,exports){
(function (global){
/**
* @license
Expand Down Expand Up @@ -10311,20 +10229,16 @@ function noop() {}

},{"global/window":21,"is-function":22,"parse-headers":25,"xtend":26}],21:[function(require,module,exports){
(function (global){
var win;

if (typeof window !== "undefined") {
win = window;
module.exports = window;
} else if (typeof global !== "undefined") {
win = global;
module.exports = global;
} else if (typeof self !== "undefined"){
win = self;
module.exports = self;
} else {
win = {};
module.exports = {};
}

module.exports = win;

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],22:[function(require,module,exports){
module.exports = isFunction
Expand Down Expand Up @@ -10521,4 +10435,4 @@ Airtable.Error = AirtableError;
module.exports = Airtable;

}).call(this,require('_process'))
},{"./airtable_error":1,"./base":2,"./class":4,"./record":9,"./table":11,"_process":15,"assert":14}]},{},["airtable"]);
},{"./airtable_error":1,"./base":2,"./class":4,"./record":9,"./table":11,"_process":16,"assert":14}]},{},["airtable"]);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "airtable",
"version": "0.5.2",
"version": "0.5.3",
"homepage": "https://github.com/airtable/airtable.js",
"repository": "git://github.com/airtable/airtable.js.git",
"private": false,
Expand Down

0 comments on commit 597fdf9

Please sign in to comment.