easy-airtable-api 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -17
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/requests.d.ts +25 -16
- package/lib/requests.js +101 -43
- package/lib/types/records.d.ts +5 -8
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,47 +1,99 @@
|
|
|
1
1
|
# Easy Airtable API
|
|
2
2
|
|
|
3
|
-
This is
|
|
3
|
+
This is intended as a more accessible and user-friendly alternative to the official Airtable Node.js library.
|
|
4
4
|
|
|
5
|
-
My focus
|
|
5
|
+
My focus has been on delivering an enhanced experience by utilizing types and simplifying the process of retrieving and modifying records through some helpful functions.
|
|
6
6
|
|
|
7
|
-
Currently, this project is
|
|
8
|
-
|
|
9
|
-
More to come soon.
|
|
7
|
+
Currently, this project is in its early stages and requires significant development. Nonetheless, most methods to retrieve and update records have already been implemented.
|
|
10
8
|
|
|
11
9
|
## Install
|
|
12
10
|
|
|
13
|
-
```
|
|
11
|
+
```bash
|
|
14
12
|
npm install easy-airtable-api
|
|
15
13
|
```
|
|
16
14
|
|
|
15
|
+
```bash
|
|
16
|
+
bun add easy-airtable-api
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## How to Use
|
|
20
|
+
|
|
21
|
+
### Get a Single Record
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
type Fields = {
|
|
25
|
+
Name?: string;
|
|
26
|
+
Notes?: string;
|
|
27
|
+
Status?: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const record = await getRecord<Fields>({
|
|
31
|
+
apiKey: 'apiKey',
|
|
32
|
+
baseId: 'baseId',
|
|
33
|
+
tableId: 'tableId',
|
|
34
|
+
recordId: 'recordId',
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Get Multiple Records
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
type Fields = {
|
|
42
|
+
Name?: string;
|
|
43
|
+
Notes?: string;
|
|
44
|
+
Status?: string;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const records = await getRecords<Fields>({
|
|
48
|
+
apiKey: 'apiKey',
|
|
49
|
+
baseId: 'baseId',
|
|
50
|
+
tableId: 'tableId',
|
|
51
|
+
options: {
|
|
52
|
+
maxRecords: 500,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
17
57
|
## Changelog
|
|
18
58
|
|
|
59
|
+
### 0.0.8
|
|
60
|
+
|
|
61
|
+
- Implemented the updateRecords method.
|
|
62
|
+
- Implemented the updateRecordsUpsert method.
|
|
63
|
+
- Added a delay when executing many requests in succession.
|
|
64
|
+
- Fixed the updateRecord and updateRecords methods to return correct field types.
|
|
65
|
+
|
|
66
|
+
### 0.0.7
|
|
67
|
+
|
|
68
|
+
- Added all available options for updateRecords.
|
|
69
|
+
- Modified the getRecords function to automatically retrieve all records.
|
|
70
|
+
|
|
19
71
|
### 0.0.6
|
|
20
72
|
|
|
21
|
-
-
|
|
22
|
-
-
|
|
73
|
+
- Added all available options for updateRecord.
|
|
74
|
+
- Corrected the path to index.d.ts.
|
|
23
75
|
|
|
24
76
|
### 0.0.5
|
|
25
77
|
|
|
26
|
-
-
|
|
78
|
+
- Discontinued CJS build, supporting only ESM for now.
|
|
27
79
|
|
|
28
80
|
### 0.0.4
|
|
29
81
|
|
|
30
|
-
-
|
|
31
|
-
-
|
|
82
|
+
- Exported all available methods.
|
|
83
|
+
- Restructured the lib folder to eliminate duplicate types.
|
|
32
84
|
|
|
33
85
|
### 0.0.3
|
|
34
86
|
|
|
35
|
-
- ESM & CJS builds.
|
|
36
|
-
-
|
|
37
|
-
-
|
|
87
|
+
- Supported both ESM & CJS builds.
|
|
88
|
+
- Enhanced server error handling.
|
|
89
|
+
- Introduced generic field types.
|
|
38
90
|
|
|
39
91
|
### 0.0.2
|
|
40
92
|
|
|
41
|
-
-
|
|
93
|
+
- Developed basic request functions to retrieve or update records.
|
|
42
94
|
- Added type definitions for requests and fields.
|
|
43
|
-
-
|
|
95
|
+
- Conducted basic tests to verify the core functionality of the library.
|
|
44
96
|
|
|
45
97
|
### 0.0.1
|
|
46
98
|
|
|
47
|
-
-
|
|
99
|
+
- Initial project setup with no real functionality implemented.
|
package/lib/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { getRecord, getRecords, updateRecord, updateRecords,
|
|
1
|
+
export { getRecord, getRecords, updateRecord, updateRecords, updateRecordsUpsert, } from './requests.js';
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { getRecord, getRecords, updateRecord, updateRecords,
|
|
1
|
+
export { getRecord, getRecords, updateRecord, updateRecords, updateRecordsUpsert, } from './requests.js';
|
package/lib/requests.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AirtableRecord, GetRecordsQueryParameters
|
|
1
|
+
import { AirtableRecord, GetRecordsQueryParameters } from './types/records';
|
|
2
2
|
export declare function getRecord<Fields>({ apiKey, baseId, tableId, recordId, }: {
|
|
3
3
|
apiKey: string;
|
|
4
4
|
baseId: string;
|
|
@@ -16,7 +16,7 @@ export declare function updateRecord<Fields>({ apiKey, baseId, tableId, recordId
|
|
|
16
16
|
baseId: string;
|
|
17
17
|
tableId: string;
|
|
18
18
|
recordId: string;
|
|
19
|
-
fields:
|
|
19
|
+
fields: Fields;
|
|
20
20
|
options?: {
|
|
21
21
|
typecast?: boolean;
|
|
22
22
|
returnFieldsByFieldId?: boolean;
|
|
@@ -29,23 +29,32 @@ export declare function updateRecords<Fields>({ apiKey, baseId, tableId, records
|
|
|
29
29
|
tableId: string;
|
|
30
30
|
records: {
|
|
31
31
|
id: string;
|
|
32
|
-
fields:
|
|
32
|
+
fields: Fields;
|
|
33
33
|
}[];
|
|
34
|
-
options?:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
export declare function replaceRecords<Fields>({ apiKey, baseId, tableId, records, }: {
|
|
34
|
+
options?: {
|
|
35
|
+
typecast?: boolean;
|
|
36
|
+
returnFieldsByFieldId?: boolean;
|
|
37
|
+
overwriteFieldsNotSpecified?: boolean;
|
|
38
|
+
};
|
|
39
|
+
}): Promise<{
|
|
40
|
+
records: AirtableRecord<Fields>[];
|
|
41
|
+
}>;
|
|
42
|
+
export declare function updateRecordsUpsert<Fields>({ apiKey, baseId, tableId, records, options, }: {
|
|
44
43
|
apiKey: string;
|
|
45
44
|
baseId: string;
|
|
46
45
|
tableId: string;
|
|
47
46
|
records: {
|
|
48
|
-
id
|
|
49
|
-
fields:
|
|
47
|
+
id?: string;
|
|
48
|
+
fields: Fields;
|
|
50
49
|
}[];
|
|
51
|
-
|
|
50
|
+
options?: {
|
|
51
|
+
fieldsToMergeOn: string[];
|
|
52
|
+
typecast?: boolean;
|
|
53
|
+
returnFieldsByFieldId?: boolean;
|
|
54
|
+
overwriteFieldsNotSpecified?: boolean;
|
|
55
|
+
};
|
|
56
|
+
}): Promise<{
|
|
57
|
+
createdRecords: string[];
|
|
58
|
+
updatedRecords: string[];
|
|
59
|
+
records: AirtableRecord<Fields>[];
|
|
60
|
+
}>;
|
package/lib/requests.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { request } from 'https';
|
|
2
2
|
import { URL } from 'url';
|
|
3
|
+
import { delay } from './utils';
|
|
3
4
|
export async function getRecord({ apiKey, baseId, tableId, recordId, }) {
|
|
4
5
|
return await airtableRequest({
|
|
5
6
|
apiKey,
|
|
@@ -10,15 +11,39 @@ export async function getRecord({ apiKey, baseId, tableId, recordId, }) {
|
|
|
10
11
|
});
|
|
11
12
|
}
|
|
12
13
|
export async function getRecords({ apiKey, baseId, tableId, options, }) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
validateGetRecordsOptions(options);
|
|
15
|
+
let records = [];
|
|
16
|
+
let currentOffset;
|
|
17
|
+
do {
|
|
18
|
+
const requestBody = currentOffset
|
|
19
|
+
? { ...options, offset: currentOffset }
|
|
20
|
+
: options;
|
|
21
|
+
const response = await airtableRequest({
|
|
22
|
+
apiKey,
|
|
23
|
+
baseId,
|
|
24
|
+
tableId,
|
|
25
|
+
endpoint: '/listRecords',
|
|
26
|
+
method: 'POST',
|
|
27
|
+
body: requestBody,
|
|
28
|
+
});
|
|
29
|
+
records = records.concat(response.records);
|
|
30
|
+
currentOffset = response.offset;
|
|
31
|
+
if (currentOffset)
|
|
32
|
+
await delay(500);
|
|
33
|
+
} while (currentOffset);
|
|
34
|
+
return records;
|
|
35
|
+
}
|
|
36
|
+
function validateGetRecordsOptions(options) {
|
|
37
|
+
if (!options)
|
|
38
|
+
return;
|
|
39
|
+
if (options.cellFormat === 'string') {
|
|
40
|
+
if (!options.timeZone || !options.userLocale) {
|
|
41
|
+
throw new Error('The timeZone and userLocale parameters are required when using string as the cellFormat.');
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (!options.maxRecords) {
|
|
45
|
+
options.maxRecords = 100;
|
|
46
|
+
}
|
|
22
47
|
}
|
|
23
48
|
export async function updateRecord({ apiKey, baseId, tableId, recordId, fields, options, }) {
|
|
24
49
|
return await airtableRequest({
|
|
@@ -38,37 +63,70 @@ export async function updateRecords({ apiKey, baseId, tableId, records, options,
|
|
|
38
63
|
if (!Array.isArray(records) || records.length === 0) {
|
|
39
64
|
throw new Error('The records array is empty or not provided. Please provide a non-empty array of records to update.');
|
|
40
65
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
66
|
+
const chunkSize = 10;
|
|
67
|
+
const chunks = [];
|
|
68
|
+
for (let i = 0; i < records.length; i += chunkSize) {
|
|
69
|
+
chunks.push(records.slice(i, i + chunkSize));
|
|
70
|
+
}
|
|
71
|
+
let combinedResults = [];
|
|
72
|
+
for (const chunk of chunks) {
|
|
73
|
+
const result = await airtableRequest({
|
|
74
|
+
apiKey,
|
|
75
|
+
baseId,
|
|
76
|
+
tableId,
|
|
77
|
+
endpoint: '/',
|
|
78
|
+
method: options?.overwriteFieldsNotSpecified === true ? 'PUT' : 'PATCH',
|
|
79
|
+
body: {
|
|
80
|
+
records: chunk,
|
|
81
|
+
typecast: options?.typecast ?? false,
|
|
82
|
+
returnFieldsByFieldId: options?.returnFieldsByFieldId ?? false,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
combinedResults = combinedResults.concat(result.records);
|
|
86
|
+
await delay(500);
|
|
87
|
+
}
|
|
88
|
+
return { records: combinedResults };
|
|
59
89
|
}
|
|
60
|
-
export async function
|
|
90
|
+
export async function updateRecordsUpsert({ apiKey, baseId, tableId, records, options, }) {
|
|
61
91
|
if (!Array.isArray(records) || records.length === 0) {
|
|
62
|
-
throw new Error('The records array is empty or not provided. Please provide a non-empty array of records to
|
|
92
|
+
throw new Error('The records array is empty or not provided. Please provide a non-empty array of records to update.');
|
|
63
93
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
94
|
+
if (!Array.isArray(options?.fieldsToMergeOn) ||
|
|
95
|
+
options?.fieldsToMergeOn.length === 0) {
|
|
96
|
+
throw new Error('fieldsToMergeOn must be an array of strings.');
|
|
97
|
+
}
|
|
98
|
+
const chunkSize = 10;
|
|
99
|
+
const chunks = [];
|
|
100
|
+
for (let i = 0; i < records.length; i += chunkSize) {
|
|
101
|
+
chunks.push(records.slice(i, i + chunkSize));
|
|
102
|
+
}
|
|
103
|
+
let allCreatedRecords = [];
|
|
104
|
+
let allUpdatedRecords = [];
|
|
105
|
+
let allRecords = [];
|
|
106
|
+
for (const chunk of chunks) {
|
|
107
|
+
const result = await airtableRequest({
|
|
108
|
+
apiKey,
|
|
109
|
+
baseId,
|
|
110
|
+
tableId,
|
|
111
|
+
endpoint: '/',
|
|
112
|
+
method: options?.overwriteFieldsNotSpecified === true ? 'PUT' : 'PATCH',
|
|
113
|
+
body: {
|
|
114
|
+
records: chunk,
|
|
115
|
+
typecast: options?.typecast ?? false,
|
|
116
|
+
returnFieldsByFieldId: options?.returnFieldsByFieldId ?? false,
|
|
117
|
+
performUpsert: { fieldsToMergeOn: options.fieldsToMergeOn },
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
allCreatedRecords = allCreatedRecords.concat(result.createdRecords);
|
|
121
|
+
allUpdatedRecords = allUpdatedRecords.concat(result.updatedRecords);
|
|
122
|
+
allRecords = allRecords.concat(result.records);
|
|
123
|
+
await delay(500);
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
createdRecords: allCreatedRecords,
|
|
127
|
+
updatedRecords: allUpdatedRecords,
|
|
128
|
+
records: allRecords,
|
|
129
|
+
};
|
|
72
130
|
}
|
|
73
131
|
async function airtableRequest(request) {
|
|
74
132
|
const { apiKey, baseId, tableId, endpoint, method, body, apiURL } = request;
|
|
@@ -96,23 +154,23 @@ function validateResponse(response) {
|
|
|
96
154
|
if (statusCode === 200)
|
|
97
155
|
return;
|
|
98
156
|
if (statusCode === 401)
|
|
99
|
-
throw new Error('
|
|
157
|
+
throw new Error('Incorrect API Key.');
|
|
100
158
|
else if (statusCode === 403)
|
|
101
159
|
throw new Error('Not authorized.');
|
|
102
160
|
else if (statusCode === 404)
|
|
103
|
-
throw new Error('Table or
|
|
161
|
+
throw new Error('Table or record not found.');
|
|
104
162
|
else if (statusCode === 413)
|
|
105
|
-
throw new Error('Request body is too large');
|
|
163
|
+
throw new Error('Request body is too large.');
|
|
106
164
|
else if (statusCode === 422) {
|
|
107
165
|
throw new Error('Operation cannot be processed. Do the field names match?');
|
|
108
166
|
}
|
|
109
167
|
else if (statusCode === 429) {
|
|
110
|
-
throw new Error('Too many
|
|
168
|
+
throw new Error('Too many requests to the Airtable server.');
|
|
111
169
|
}
|
|
112
170
|
else if (statusCode === 500)
|
|
113
|
-
throw new Error('Airtable
|
|
171
|
+
throw new Error('Airtable server error.');
|
|
114
172
|
else if (statusCode === 503)
|
|
115
|
-
throw new Error('Airtable
|
|
173
|
+
throw new Error('Airtable service unavailable.');
|
|
116
174
|
throw new Error('Unexpected error.');
|
|
117
175
|
}
|
|
118
176
|
async function apiRequest({ url, method, apiKey, body, }) {
|
package/lib/types/records.d.ts
CHANGED
|
@@ -4,11 +4,10 @@ export type AirtableRecord<Fields = DefaultFieldsType> = {
|
|
|
4
4
|
fields: Fields;
|
|
5
5
|
};
|
|
6
6
|
type DefaultFieldsType = {
|
|
7
|
-
[key: string]:
|
|
7
|
+
[key: string]: any;
|
|
8
8
|
};
|
|
9
9
|
type BaseId = string;
|
|
10
10
|
type TableIdOrName = string;
|
|
11
|
-
type Timezone = string;
|
|
12
11
|
type SortDirection = 'asc' | 'desc';
|
|
13
12
|
type CellFormat = 'json' | 'string';
|
|
14
13
|
type RecordMetadataOptions = 'commentCount';
|
|
@@ -17,8 +16,8 @@ interface SortObject {
|
|
|
17
16
|
direction?: SortDirection;
|
|
18
17
|
}
|
|
19
18
|
export interface GetRecordsQueryParameters {
|
|
20
|
-
timeZone?:
|
|
21
|
-
userLocale?:
|
|
19
|
+
timeZone?: Timezones;
|
|
20
|
+
userLocale?: UserLocales;
|
|
22
21
|
pageSize?: number;
|
|
23
22
|
maxRecords?: number;
|
|
24
23
|
offset?: string;
|
|
@@ -93,10 +92,6 @@ export interface CreateRecordsRequestBody {
|
|
|
93
92
|
returnFieldsByFieldId?: boolean;
|
|
94
93
|
typecast?: boolean;
|
|
95
94
|
}
|
|
96
|
-
export type UpdateRecordsRequestOptions = {
|
|
97
|
-
typecast?: boolean;
|
|
98
|
-
returnFieldsByFieldId?: boolean;
|
|
99
|
-
};
|
|
100
95
|
export interface CreateRecordResponse {
|
|
101
96
|
id: string;
|
|
102
97
|
createdTime: string;
|
|
@@ -128,4 +123,6 @@ export interface SingleDeleteRecordResponse {
|
|
|
128
123
|
id: string;
|
|
129
124
|
deleted: true;
|
|
130
125
|
}
|
|
126
|
+
export type Timezones = 'Africa/Abidjan' | 'Africa/Accra' | 'Africa/Algiers' | 'Africa/Bissau' | 'Africa/Cairo' | 'Africa/Casablanca' | 'Africa/Ceuta' | 'Africa/El_Aaiun' | 'Africa/Johannesburg' | 'Africa/Khartoum' | 'Africa/Lagos' | 'Africa/Maputo' | 'Africa/Monrovia' | 'Africa/Nairobi' | 'Africa/Ndjamena' | 'Africa/Tripoli' | 'Africa/Tunis' | 'Africa/Windhoek' | 'America/Adak' | 'America/Anchorage' | 'America/Araguaina' | 'America/Argentina/Buenos_Aires' | 'America/Argentina/Catamarca' | 'America/Argentina/Cordoba' | 'America/Argentina/Jujuy' | 'America/Argentina/La_Rioja' | 'America/Argentina/Mendoza' | 'America/Argentina/Rio_Gallegos' | 'America/Argentina/Salta' | 'America/Argentina/San_Juan' | 'America/Argentina/San_Luis' | 'America/Argentina/Tucuman' | 'America/Argentina/Ushuaia' | 'America/Asuncion' | 'America/Atikokan' | 'America/Bahia' | 'America/Bahia_Banderas' | 'America/Barbados' | 'America/Belem' | 'America/Belize' | 'America/Blanc-Sablon' | 'America/Boa_Vista' | 'America/Bogota' | 'America/Boise' | 'America/Cambridge_Bay' | 'America/Campo_Grande' | 'America/Cancun' | 'America/Caracas' | 'America/Cayenne' | 'America/Chicago' | 'America/Chihuahua' | 'America/Costa_Rica' | 'America/Creston' | 'America/Cuiaba' | 'America/Curacao' | 'America/Danmarkshavn' | 'America/Dawson' | 'America/Dawson_Creek' | 'America/Denver' | 'America/Detroit' | 'America/Edmonton' | 'America/Eirunepe' | 'America/El_Salvador' | 'America/Fort_Nelson' | 'America/Fortaleza' | 'America/Glace_Bay' | 'America/Godthab' | 'America/Goose_Bay' | 'America/Grand_Turk' | 'America/Guatemala' | 'America/Guayaquil' | 'America/Guyana' | 'America/Halifax' | 'America/Havana' | 'America/Hermosillo' | 'America/Indiana/Indianapolis' | 'America/Indiana/Knox' | 'America/Indiana/Marengo' | 'America/Indiana/Petersburg' | 'America/Indiana/Tell_City' | 'America/Indiana/Vevay' | 'America/Indiana/Vincennes' | 'America/Indiana/Winamac' | 'America/Inuvik' | 'America/Iqaluit' | 'America/Jamaica' | 'America/Juneau' | 'America/Kentucky/Louisville' | 'America/Kentucky/Monticello' | 'America/La_Paz' | 'America/Lima' | 'America/Los_Angeles' | 'America/Maceio' | 'America/Managua' | 'America/Manaus' | 'America/Martinique' | 'America/Matamoros' | 'America/Mazatlan' | 'America/Menominee' | 'America/Merida' | 'America/Metlakatla' | 'America/Mexico_City' | 'America/Miquelon' | 'America/Moncton' | 'America/Monterrey' | 'America/Montevideo' | 'America/Nassau' | 'America/New_York' | 'America/Nipigon' | 'America/Nome' | 'America/Noronha' | 'America/North_Dakota/Beulah' | 'America/North_Dakota/Center' | 'America/North_Dakota/New_Salem' | 'America/Ojinaga' | 'America/Panama' | 'America/Pangnirtung' | 'America/Paramaribo' | 'America/Phoenix' | 'America/Port-au-Prince' | 'America/Port_of_Spain' | 'America/Porto_Velho' | 'America/Puerto_Rico' | 'America/Rainy_River' | 'America/Rankin_Inlet' | 'America/Recife' | 'America/Regina' | 'America/Resolute' | 'America/Rio_Branco' | 'America/Santarem' | 'America/Santiago' | 'America/Santo_Domingo' | 'America/Sao_Paulo' | 'America/Scoresbysund' | 'America/Sitka' | 'America/St_Johns' | 'America/Swift_Current' | 'America/Tegucigalpa' | 'America/Thule' | 'America/Thunder_Bay' | 'America/Tijuana' | 'America/Toronto' | 'America/Vancouver' | 'America/Whitehorse' | 'America/Winnipeg' | 'America/Yakutat' | 'America/Yellowknife' | 'Antarctica/Casey' | 'Antarctica/Davis' | 'Antarctica/DumontDUrville' | 'Antarctica/Macquarie' | 'Antarctica/Mawson' | 'Antarctica/Palmer' | 'Antarctica/Rothera' | 'Antarctica/Syowa' | 'Antarctica/Troll' | 'Antarctica/Vostok' | 'Asia/Almaty' | 'Asia/Amman' | 'Asia/Anadyr' | 'Asia/Aqtau' | 'Asia/Aqtobe' | 'Asia/Ashgabat' | 'Asia/Baghdad' | 'Asia/Baku' | 'Asia/Bangkok' | 'Asia/Barnaul' | 'Asia/Beirut' | 'Asia/Bishkek' | 'Asia/Brunei' | 'Asia/Chita' | 'Asia/Choibalsan' | 'Asia/Colombo' | 'Asia/Damascus' | 'Asia/Dhaka' | 'Asia/Dili' | 'Asia/Dubai' | 'Asia/Dushanbe' | 'Asia/Gaza' | 'Asia/Hebron' | 'Asia/Ho_Chi_Minh' | 'Asia/Hong_Kong' | 'Asia/Hovd' | 'Asia/Irkutsk' | 'Asia/Jakarta' | 'Asia/Jayapura' | 'Asia/Jerusalem' | 'Asia/Kabul' | 'Asia/Kamchatka' | 'Asia/Karachi' | 'Asia/Kathmandu' | 'Asia/Khandyga' | 'Asia/Kolkata' | 'Asia/Krasnoyarsk' | 'Asia/Kuala_Lumpur' | 'Asia/Kuching' | 'Asia/Macau' | 'Asia/Magadan' | 'Asia/Makassar' | 'Asia/Manila' | 'Asia/Nicosia' | 'Asia/Novokuznetsk' | 'Asia/Novosibirsk' | 'Asia/Omsk' | 'Asia/Oral' | 'Asia/Pontianak' | 'Asia/Pyongyang' | 'Asia/Qatar' | 'Asia/Qyzylorda' | 'Asia/Rangoon' | 'Asia/Riyadh' | 'Asia/Sakhalin' | 'Asia/Samarkand' | 'Asia/Seoul' | 'Asia/Shanghai' | 'Asia/Singapore' | 'Asia/Srednekolymsk' | 'Asia/Taipei' | 'Asia/Tashkent' | 'Asia/Tbilisi' | 'Asia/Tehran' | 'Asia/Thimphu' | 'Asia/Tokyo' | 'Asia/Tomsk' | 'Asia/Ulaanbaatar' | 'Asia/Urumqi' | 'Asia/Ust-Nera' | 'Asia/Vladivostok' | 'Asia/Yakutsk' | 'Asia/Yekaterinburg' | 'Asia/Yerevan' | 'Atlantic/Azores' | 'Atlantic/Bermuda' | 'Atlantic/Canary' | 'Atlantic/Cape_Verde' | 'Atlantic/Faroe' | 'Atlantic/Madeira' | 'Atlantic/Reykjavik' | 'Atlantic/South_Georgia' | 'Atlantic/Stanley' | 'Australia/Adelaide' | 'Australia/Brisbane' | 'Australia/Broken_Hill' | 'Australia/Currie' | 'Australia/Darwin' | 'Australia/Eucla' | 'Australia/Hobart' | 'Australia/Lindeman' | 'Australia/Lord_Howe' | 'Australia/Melbourne' | 'Australia/Perth' | 'Australia/Sydney' | 'GMT' | 'Europe/Amsterdam' | 'Europe/Andorra' | 'Europe/Astrakhan' | 'Europe/Athens' | 'Europe/Belgrade' | 'Europe/Berlin' | 'Europe/Brussels' | 'Europe/Bucharest' | 'Europe/Budapest' | 'Europe/Chisinau' | 'Europe/Copenhagen' | 'Europe/Dublin' | 'Europe/Gibraltar' | 'Europe/Helsinki' | 'Europe/Istanbul' | 'Europe/Kaliningrad' | 'Europe/Kiev' | 'Europe/Kirov' | 'Europe/Lisbon' | 'Europe/London' | 'Europe/Luxembourg' | 'Europe/Madrid' | 'Europe/Malta' | 'Europe/Minsk' | 'Europe/Monaco' | 'Europe/Moscow' | 'Europe/Oslo' | 'Europe/Paris' | 'Europe/Prague' | 'Europe/Riga' | 'Europe/Rome' | 'Europe/Samara' | 'Europe/Simferopol' | 'Europe/Sofia' | 'Europe/Stockholm' | 'Europe/Tallinn' | 'Europe/Tirane' | 'Europe/Ulyanovsk' | 'Europe/Uzhgorod' | 'Europe/Vienna' | 'Europe/Vilnius' | 'Europe/Volgograd' | 'Europe/Warsaw' | 'Europe/Zaporozhye' | 'Europe/Zurich' | 'Indian/Chagos' | 'Indian/Christmas' | 'Indian/Cocos' | 'Indian/Kerguelen' | 'Indian/Mahe' | 'Indian/Maldives' | 'Indian/Mauritius' | 'Indian/Reunion' | 'Pacific/Apia' | 'Pacific/Auckland' | 'Pacific/Bougainville' | 'Pacific/Chatham' | 'Pacific/Chuuk' | 'Pacific/Easter' | 'Pacific/Efate' | 'Pacific/Enderbury' | 'Pacific/Fakaofo' | 'Pacific/Fiji' | 'Pacific/Funafuti' | 'Pacific/Galapagos' | 'Pacific/Gambier' | 'Pacific/Guadalcanal' | 'Pacific/Guam' | 'Pacific/Honolulu' | 'Pacific/Kiritimati' | 'Pacific/Kosrae' | 'Pacific/Kwajalein' | 'Pacific/Majuro' | 'Pacific/Marquesas' | 'Pacific/Nauru' | 'Pacific/Niue' | 'Pacific/Norfolk' | 'Pacific/Noumea' | 'Pacific/Pago_Pago' | 'Pacific/Palau' | 'Pacific/Pitcairn' | 'Pacific/Pohnpei' | 'Pacific/Port_Moresby' | 'Pacific/Rarotonga' | 'Pacific/Tahiti' | 'Pacific/Tarawa' | 'Pacific/Tongatapu' | 'Pacific/Wake' | 'Pacific/Wallis';
|
|
127
|
+
type UserLocales = 'af' | 'ar-ma' | 'ar-sa' | 'ar-tn' | 'ar' | 'az' | 'be' | 'bg' | 'bn' | 'bo' | 'br' | 'bs' | 'ca' | 'cs' | 'cv' | 'cy' | 'da' | 'de-at' | 'de' | 'el' | 'en-au' | 'en-ca' | 'en-gb' | 'en-ie' | 'en-nz' | 'eo' | 'es' | 'et' | 'eu' | 'fa' | 'fi' | 'fo' | 'fr-ca' | 'fr-ch' | 'fr' | 'fy' | 'gl' | 'he' | 'hi' | 'hr' | 'hu' | 'hy-am' | 'id' | 'is' | 'it' | 'ja' | 'jv' | 'ka' | 'km' | 'ko' | 'lb' | 'lt' | 'lv' | 'me' | 'mk' | 'ml' | 'mr' | 'ms' | 'my' | 'nb' | 'ne' | 'nl' | 'nn' | 'pl' | 'pt-br' | 'pt' | 'ro' | 'ru' | 'si' | 'sk' | 'sl' | 'sq' | 'sr-cyrl' | 'sr' | 'sv' | 'ta' | 'th' | 'tl-ph' | 'tr' | 'tzl' | 'tzm-latn' | 'tzm' | 'uk' | 'uz' | 'vi' | 'zh-cn' | 'zh-tw';
|
|
131
128
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easy-airtable-api",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "An easy way to connect to Airtable via their API.",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
"build": "rm -r ./lib && tsc",
|
|
16
16
|
"publish": "npm publish",
|
|
17
17
|
"lint": "eslint 'src/**/*.{ts,tsx}'",
|
|
18
|
-
"test": "vitest"
|
|
18
|
+
"test": "vitest",
|
|
19
|
+
"testGetRecords": "vitest get-records.test.ts",
|
|
20
|
+
"testUpdateRecords": "vitest update-records.test.ts"
|
|
19
21
|
},
|
|
20
22
|
"keywords": [
|
|
21
23
|
"airtable"
|