From a901f22d0f9d2fa2dd7eb2e4e1e7a52e52b13232 Mon Sep 17 00:00:00 2001 From: JB Bakst Date: Mon, 15 Jan 2018 15:49:27 -0800 Subject: [PATCH] v0.5.2 --- CHANGELOG.md | 3 + build/airtable.browser.js | 186 ++++++++++++++++++++++++++++++-------- package.json | 2 +- 3 files changed, 153 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15bb9b6e..187793f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# v0.5.2 + * Support for the `cellFormat`, `userLocale`, and `timeZone` parameters + # v0.5.1 * Improved handling of unexpected server errors diff --git a/build/airtable.browser.js b/build/airtable.browser.js index 4dc0d1eb..70d5a7f6 100644 --- a/build/airtable.browser.js +++ b/build/airtable.browser.js @@ -444,6 +444,20 @@ Query.paramValidators = { view: check(_.isString, 'the value for `view` should be a string'), + + cellFormat: + check(function(cellFormat) { + return ( + _.isString(cellFormat) && + _.contains(['json', 'string'], cellFormat) + ); + }, 'the value for `cellFormat` should be "json" or "string"'), + + timeZone: + check(_.isString, 'the value for `timeZone` should be a string'), + + userLocale: + check(_.isString, 'the value for `userLocale` should be a string'), }; /** @@ -2094,7 +2108,7 @@ module.exports = check; }()); }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":16}],14:[function(require,module,exports){ +},{"_process":15}],14:[function(require,module,exports){ // http://wiki.commonjs.org/wiki/Unit_Testing/1.0 // // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! @@ -2456,40 +2470,104 @@ var objectKeys = Object.keys || function (obj) { }; },{"util/":18}],15:[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 - } +// 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); + } + } -},{}],16:[function(require,module,exports){ -// shim for using process in browser -var process = module.exports = {}; +} +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); + } + } + + + +} 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); @@ -2505,7 +2583,7 @@ function drainQueue() { if (draining) { return; } - var timeout = setTimeout(cleanUpNextTick); + var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; @@ -2513,14 +2591,16 @@ function drainQueue() { currentQueue = queue; queue = []; while (++queueIndex < len) { - currentQueue[queueIndex].run(); + if (currentQueue) { + currentQueue[queueIndex].run(); + } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; - clearTimeout(timeout); + runClearTimeout(timeout); } process.nextTick = function (fun) { @@ -2532,7 +2612,7 @@ process.nextTick = function (fun) { } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { - setTimeout(drainQueue, 0); + runTimeout(drainQueue); } }; @@ -2560,18 +2640,46 @@ 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' @@ -3169,7 +3277,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":16,"inherits":15}],19:[function(require,module,exports){ +},{"./support/isBuffer":17,"_process":15,"inherits":16}],19:[function(require,module,exports){ (function (global){ /** * @license @@ -10203,16 +10311,20 @@ 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") { - module.exports = window; + win = window; } else if (typeof global !== "undefined") { - module.exports = global; + win = global; } else if (typeof self !== "undefined"){ - module.exports = self; + win = self; } else { - module.exports = {}; + win = {}; } +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 @@ -10409,4 +10521,4 @@ Airtable.Error = AirtableError; module.exports = Airtable; }).call(this,require('_process')) -},{"./airtable_error":1,"./base":2,"./class":4,"./record":9,"./table":11,"_process":16,"assert":14}]},{},["airtable"]); +},{"./airtable_error":1,"./base":2,"./class":4,"./record":9,"./table":11,"_process":15,"assert":14}]},{},["airtable"]); diff --git a/package.json b/package.json index deefe081..c83daa54 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "airtable", - "version": "0.5.1", + "version": "0.5.2", "homepage": "https://github.com/airtable/airtable.js", "repository": "git://github.com/airtable/airtable.js.git", "private": false,