Comparing version 0.1.19 to 0.2.0
@@ -6,3 +6,3 @@ 'use strict'; | ||
var Class = require('./class'); | ||
var Application = require('./application'); | ||
var Base = require('./base'); | ||
var Table = require('./table'); | ||
@@ -25,4 +25,4 @@ var Record = require('./record'); | ||
app: function(applicationId) { | ||
return Application.createFunctor(this, applicationId); | ||
base: function(baseId) { | ||
return Base.createFunctor(this, baseId); | ||
} | ||
@@ -47,10 +47,10 @@ }); | ||
Airtable.app = function(appId) { | ||
return new Airtable().app(appId); | ||
Airtable.base = function(baseId) { | ||
return new Airtable().base(baseId); | ||
} | ||
Airtable.Application = Application; | ||
Airtable.Base = Base; | ||
Airtable.Record = Record; | ||
Airtable.Table = Table; | ||
module.exports = Airtable; | ||
module.exports = Airtable; |
@@ -37,3 +37,3 @@ 'use strict'; | ||
this._table._application.runAction('patch', '/' + this._table._urlEncodedNameOrId() + '/' + this.id, {}, updateBody, function(err, response, results) { | ||
this._table._base.runAction('patch', '/' + this._table._urlEncodedNameOrId() + '/' + this.id, {}, updateBody, function(err, response, results) { | ||
if (err) { done(err); return; } | ||
@@ -54,3 +54,3 @@ | ||
}, opts); | ||
this._table._application.runAction('put', '/' + this._table._urlEncodedNameOrId() + '/' + this.id, {}, updateBody, function(err, response, results) { | ||
this._table._base.runAction('put', '/' + this._table._urlEncodedNameOrId() + '/' + this.id, {}, updateBody, function(err, response, results) { | ||
if (err) { done(err); return; } | ||
@@ -64,3 +64,3 @@ | ||
var that = this; | ||
this._table._application.runAction('del', '/' + this._table._urlEncodedNameOrId() + '/' + this.id, {}, {}, function(err, response, results) { | ||
this._table._base.runAction('del', '/' + this._table._urlEncodedNameOrId() + '/' + this.id, {}, {}, function(err, response, results) { | ||
if (err) { done(err); return; } | ||
@@ -74,3 +74,3 @@ | ||
var that = this; | ||
this._table._application.runAction('get', '/' + this._table._urlEncodedNameOrId() + '/' + this.id, {}, {}, function(err, response, results) { | ||
this._table._base.runAction('get', '/' + this._table._urlEncodedNameOrId() + '/' + this.id, {}, {}, function(err, response, results) { | ||
if (err) { done(err); return; } | ||
@@ -77,0 +77,0 @@ |
@@ -13,4 +13,4 @@ 'use strict'; | ||
var Table = Class.extend({ | ||
init: function(application, tableId, tableName) { | ||
this._application = application; | ||
init: function(base, tableId, tableName) { | ||
this._base = base; | ||
assert(tableId || tableName, 'Table name or table ID is require'); | ||
@@ -43,3 +43,3 @@ this.id = tableId; | ||
var requestData = _.extend({fields: recordData}, optionalParameters); | ||
this._application.runAction('post', '/' + that._urlEncodedNameOrId() + '/', {}, requestData, function(err, resp, body) { | ||
this._base.runAction('post', '/' + that._urlEncodedNameOrId() + '/', {}, requestData, function(err, resp, body) { | ||
if (err) { done(err); return; } | ||
@@ -76,3 +76,3 @@ | ||
function(next) { | ||
that._application.runAction('get', '/' + that._urlEncodedNameOrId() + '/', listRecordsParameters, {}, next); | ||
that._base.runAction('get', '/' + that._urlEncodedNameOrId() + '/', listRecordsParameters, {}, next); | ||
}, | ||
@@ -79,0 +79,0 @@ function(response, results, next) { |
{ | ||
"name": "airtable", | ||
"version": "0.1.19", | ||
"version": "0.2.0", | ||
"homepage": "https://github.com/airtable/airtable.js", | ||
@@ -5,0 +5,0 @@ "repository": "git://github.com/airtable/airtable.js.git", |
@@ -11,3 +11,3 @@ The awesome Airtable javascript library. It's official. | ||
other words, Airtable API is your own RESTful API for your | ||
application. | ||
base. | ||
@@ -40,3 +40,3 @@ We hope you find it fun and easy! | ||
Go to https://airtable.com/api to see the interactive API documentation for your Airtable applications. It'll have examples for all operations you can perform against your apps. | ||
Go to https://airtable.com/api to see the interactive API documentation for your Airtable bases. It'll have examples for all operations you can perform against your bases. | ||
@@ -43,0 +43,0 @@ # What happened to the tests? |
448
20050