diff --git a/build/airtable.browser.js b/build/airtable.browser.js index a21733b9..a126e3bc 100644 --- a/build/airtable.browser.js +++ b/build/airtable.browser.js @@ -445,7 +445,7 @@ module.exports = objectToQueryParamString; },{"lodash/isArray":79,"lodash/isNil":85,"lodash/keys":93}],12:[function(require,module,exports){ "use strict"; -module.exports = "0.12.2"; +module.exports = "0.12.3"; },{}],13:[function(require,module,exports){ "use strict"; diff --git a/package-lock.json b/package-lock.json index 85c84689..d9d7d8ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "airtable", - "version": "0.12.2", + "version": "0.12.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "airtable", - "version": "0.12.1", + "version": "0.12.3", "license": "MIT", "dependencies": { "@types/node": ">=8.0.0 <15", diff --git a/package.json b/package.json index e28fd761..6117cb4b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "airtable", - "version": "0.12.2", + "version": "0.12.3", "license": "MIT", "homepage": "https://github.com/airtable/airtable.js", "repository": "git://github.com/airtable/airtable.js.git", diff --git a/src/ai_text.ts b/src/ai_text.ts new file mode 100644 index 00000000..55d72afd --- /dev/null +++ b/src/ai_text.ts @@ -0,0 +1,6 @@ +export interface AiTextResult { + state: 'empty' | 'loading' | 'generated' | 'error'; + isStale: boolean; + value?: string; + errorType?: string; +} diff --git a/src/barcode.ts b/src/barcode.ts new file mode 100644 index 00000000..aadc06d2 --- /dev/null +++ b/src/barcode.ts @@ -0,0 +1,4 @@ +export interface Barcode { + type?: string; + text?: string; +} \ No newline at end of file diff --git a/src/button.ts b/src/button.ts new file mode 100644 index 00000000..e722160b --- /dev/null +++ b/src/button.ts @@ -0,0 +1,4 @@ +export interface Button { + label: string; + url?: string; +} \ No newline at end of file diff --git a/src/collaborator.ts b/src/collaborator.ts index 932fa8bb..aff87208 100644 --- a/src/collaborator.ts +++ b/src/collaborator.ts @@ -1,5 +1,6 @@ export interface Collaborator { id: string; - email: string; - name: string; + email?: string; + name?: string; + profilePicUrl?: string; } diff --git a/src/field_set.ts b/src/field_set.ts index 8a5e79c6..a51ed4fb 100644 --- a/src/field_set.ts +++ b/src/field_set.ts @@ -1,14 +1,56 @@ import {Collaborator} from './collaborator'; import {Attachment} from './attachment'; +import {Barcode} from './barcode'; +import {Button} from './button'; +import {SyncSource} from './sync_source'; +import {AiTextResult} from './ai_text'; +// Built from https://airtable.com/developers/web/api/field-model +// AI Text: AiTextResult +// Attachment: Attachment +// Auto number: number +// Barcode: Barcode +// Button: Button +// Checkbox: boolean +// Collaborator: Collaborator +// Count: number +// Created by: Collaborator +// Created time: string +// Currency: number +// Date: string +// Date and time: string +// Duration: number +// Email: string +// Formula: string | number +// Last modified by: +// Last modified time: string +// Link to another record: string[] +// Long text: string +// Lookup: FieldValue[] +// Multiple collaborator: Collaborator[] +// Multiple select: string[] +// Number: number +// Percent: number +// Phone: string +// Rating: number +// Rich text: string +// Rollup: ReadonlyArray | string | number +// Single line text: string +// Single select: string +// Sync source: SyncSource +// Url: string +export type FieldValue = + undefined | + string | + number | + boolean | + AiTextResult | + Barcode | + Button | + Collaborator | + SyncSource | + ReadonlyArray | + ReadonlyArray; export interface FieldSet { - [key: string]: - | undefined - | string - | number - | boolean - | Collaborator - | ReadonlyArray - | ReadonlyArray - | ReadonlyArray; + [key: string]: FieldValue; } diff --git a/src/sync_source.ts b/src/sync_source.ts new file mode 100644 index 00000000..71364811 --- /dev/null +++ b/src/sync_source.ts @@ -0,0 +1,5 @@ +export interface SyncSource { + id: string; + name: string; + color?: string; +} \ No newline at end of file diff --git a/test/test_files/airtable.browser.js b/test/test_files/airtable.browser.js index a21733b9..a126e3bc 100644 --- a/test/test_files/airtable.browser.js +++ b/test/test_files/airtable.browser.js @@ -445,7 +445,7 @@ module.exports = objectToQueryParamString; },{"lodash/isArray":79,"lodash/isNil":85,"lodash/keys":93}],12:[function(require,module,exports){ "use strict"; -module.exports = "0.12.2"; +module.exports = "0.12.3"; },{}],13:[function(require,module,exports){ "use strict";