easy-airtable-api 0.0.14 → 0.0.16
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/CHANGELOG.md +79 -0
- package/README.md +252 -74
- package/lib/cli.d.ts +2 -0
- package/lib/cli.js +82 -0
- package/lib/codegen/build.d.ts +2 -0
- package/lib/codegen/build.js +25 -0
- package/lib/codegen/emit-typescript.d.ts +8 -0
- package/lib/codegen/emit-typescript.js +104 -0
- package/lib/codegen/generate.d.ts +2 -0
- package/lib/codegen/generate.js +23 -0
- package/lib/codegen/identifiers.d.ts +7 -0
- package/lib/codegen/identifiers.js +51 -0
- package/lib/codegen/index.d.ts +3 -0
- package/lib/codegen/index.js +2 -0
- package/lib/codegen/load-schema.d.ts +3 -0
- package/lib/codegen/load-schema.js +28 -0
- package/lib/codegen/map-field.d.ts +31 -0
- package/lib/codegen/map-field.js +278 -0
- package/lib/codegen/normalize-schema.d.ts +11 -0
- package/lib/codegen/normalize-schema.js +61 -0
- package/lib/codegen/types.d.ts +62 -0
- package/lib/codegen/types.js +1 -0
- package/lib/codegen/utils.d.ts +14 -0
- package/lib/codegen/utils.js +30 -0
- package/lib/codegen/write-atomic.d.ts +1 -0
- package/lib/codegen/write-atomic.js +11 -0
- package/lib/index.d.ts +3 -1
- package/lib/index.js +1 -1
- package/lib/records.d.ts +96 -0
- package/lib/records.js +211 -0
- package/lib/requests.d.ts +8 -89
- package/lib/requests.js +13 -215
- package/lib/types/fields.d.ts +8 -8
- package/lib/types/metadata.d.ts +24 -0
- package/lib/types/metadata.js +1 -0
- package/lib/types/records.d.ts +1 -4
- package/lib/utils.d.ts +2 -2
- package/lib/utils.js +2 -0
- package/package.json +14 -6
package/lib/types/fields.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ export interface CollaboratorCell {
|
|
|
62
62
|
}
|
|
63
63
|
export interface SingleCollaboratorFieldTypeAndOptions {
|
|
64
64
|
type: 'singleCollaborator';
|
|
65
|
-
options:
|
|
65
|
+
options: Record<string, never>;
|
|
66
66
|
}
|
|
67
67
|
export type CountCell = number;
|
|
68
68
|
export interface CountFieldTypeAndOptions {
|
|
@@ -80,7 +80,7 @@ export type CreatedTimeCell = string;
|
|
|
80
80
|
export interface CreatedTimeFieldTypeAndOptions {
|
|
81
81
|
type: 'createdTime';
|
|
82
82
|
options: {
|
|
83
|
-
result?:
|
|
83
|
+
result?: unknown;
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
export type CurrencyCell = number;
|
|
@@ -133,7 +133,7 @@ export interface FormulaFieldTypeAndOptions {
|
|
|
133
133
|
formula: string;
|
|
134
134
|
isValid: boolean;
|
|
135
135
|
referencedFieldIds: string[] | null;
|
|
136
|
-
result:
|
|
136
|
+
result: unknown;
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
139
|
export type LastModifiedByCell = {
|
|
@@ -151,7 +151,7 @@ export interface LastModifiedTimeFieldTypeAndOptions {
|
|
|
151
151
|
options: {
|
|
152
152
|
isValid: boolean;
|
|
153
153
|
referencedFieldIds: string[] | null;
|
|
154
|
-
result:
|
|
154
|
+
result: unknown;
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
157
|
export type LinkToAnotherRecordCellV1 = string[];
|
|
@@ -173,10 +173,10 @@ export type LongTextCell = string;
|
|
|
173
173
|
export interface LongTextFieldTypeAndOptions {
|
|
174
174
|
type: 'multilineText';
|
|
175
175
|
}
|
|
176
|
-
export type LookupCellV1 = (number | string | boolean |
|
|
176
|
+
export type LookupCellV1 = (number | string | boolean | unknown)[];
|
|
177
177
|
export type LookupCellV2 = {
|
|
178
178
|
valuesByLinkedRecordId: {
|
|
179
|
-
[key: string]:
|
|
179
|
+
[key: string]: unknown[];
|
|
180
180
|
};
|
|
181
181
|
linkedRecordIds: string[];
|
|
182
182
|
};
|
|
@@ -186,7 +186,7 @@ export interface LookupFieldTypeAndOptions {
|
|
|
186
186
|
fieldIdInLinkedTable: string | null;
|
|
187
187
|
isValid: boolean;
|
|
188
188
|
recordLinkFieldId: string | null;
|
|
189
|
-
result:
|
|
189
|
+
result: unknown;
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
192
|
export type Collaborator = {
|
|
@@ -215,7 +215,7 @@ export type RatingOptions = {
|
|
|
215
215
|
export type RollupOptions = {
|
|
216
216
|
fieldIdInLinkedTable?: string;
|
|
217
217
|
recordLinkFieldId?: string;
|
|
218
|
-
result?:
|
|
218
|
+
result?: unknown;
|
|
219
219
|
isValid?: boolean;
|
|
220
220
|
referencedFieldIds?: string[];
|
|
221
221
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type AirtableFieldOptions = Record<string, unknown>;
|
|
2
|
+
export interface AirtableFieldSchema {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
options?: AirtableFieldOptions;
|
|
8
|
+
}
|
|
9
|
+
export interface AirtableViewSchema {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
type: string;
|
|
13
|
+
}
|
|
14
|
+
export interface AirtableTableSchema {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
primaryFieldId: string;
|
|
19
|
+
fields: AirtableFieldSchema[];
|
|
20
|
+
views?: AirtableViewSchema[];
|
|
21
|
+
}
|
|
22
|
+
export interface AirtableBaseSchema {
|
|
23
|
+
tables: AirtableTableSchema[];
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/types/records.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type AirtableRecord<Fields = DefaultFieldsType> = {
|
|
|
4
4
|
fields: Fields;
|
|
5
5
|
};
|
|
6
6
|
type DefaultFieldsType = {
|
|
7
|
-
[key: string]:
|
|
7
|
+
[key: string]: unknown;
|
|
8
8
|
};
|
|
9
9
|
type BaseId = string;
|
|
10
10
|
type TableIdOrName = string;
|
|
@@ -105,9 +105,6 @@ export interface DeleteRecordsPathParameters {
|
|
|
105
105
|
baseId: BaseId;
|
|
106
106
|
tableIdOrName: TableIdOrName;
|
|
107
107
|
}
|
|
108
|
-
export interface DeleteRecordsQueryParameters {
|
|
109
|
-
records: string[];
|
|
110
|
-
}
|
|
111
108
|
export interface DeleteRecordResponse {
|
|
112
109
|
id: string;
|
|
113
110
|
deleted: true;
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UpdateRecords } from './types/fields';
|
|
2
|
-
export declare function getArrayInChunks(records: UpdateRecords): Promise<import("./types/fields").UpdateRecord[][]>;
|
|
1
|
+
import { UpdateRecords } from './types/fields.js';
|
|
2
|
+
export declare function getArrayInChunks(records: UpdateRecords): Promise<import("./types/fields.js").UpdateRecord[][]>;
|
|
3
3
|
export declare function getErrorMessage(error: Error | unknown): string;
|
|
4
4
|
export declare function delay(ms?: number): Promise<unknown>;
|
package/lib/utils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easy-airtable-api",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "Lightweight TypeScript-first Airtable client with metadata-based type generation.",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
+
"types": "./lib/index.d.ts",
|
|
10
11
|
"import": "./lib/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./codegen": {
|
|
14
|
+
"types": "./lib/codegen/index.d.ts",
|
|
15
|
+
"import": "./lib/codegen/index.js"
|
|
11
16
|
}
|
|
12
17
|
},
|
|
18
|
+
"bin": {
|
|
19
|
+
"easy-airtable-api": "./lib/cli.js"
|
|
20
|
+
},
|
|
13
21
|
"scripts": {
|
|
14
22
|
"watch": "tsc --watch",
|
|
15
23
|
"build": "rm -r ./lib && tsc",
|
|
16
24
|
"publish": "npm publish",
|
|
17
25
|
"lint": "eslint 'src/**/*.{ts,tsx}'",
|
|
18
|
-
"test": "
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
26
|
+
"test": "npm run test:codegen",
|
|
27
|
+
"test:codegen": "vitest run tests/codegen.test.ts",
|
|
28
|
+
"test:integration": "RUN_AIRTABLE_INTEGRATION_TESTS=true vitest run tests/get-record.test.ts tests/get-records.test.ts tests/create-records.test.ts tests/update-records.test.ts tests/delete-records.test.ts",
|
|
29
|
+
"test:all": "vitest run"
|
|
22
30
|
},
|
|
23
31
|
"keywords": [
|
|
24
32
|
"airtable"
|