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.
@@ -0,0 +1,23 @@
1
+ import { access } from 'node:fs/promises';
2
+ import { resolve } from 'node:path';
3
+ import { buildAirtableTypes } from './build.js';
4
+ import { writeAtomic } from './write-atomic.js';
5
+ async function defaultOutputPath() {
6
+ try {
7
+ await access(resolve('src'));
8
+ return './src/airtable.generated.ts';
9
+ }
10
+ catch {
11
+ return './airtable.generated.ts';
12
+ }
13
+ }
14
+ export async function generateAirtableTypes(options) {
15
+ const result = await buildAirtableTypes(options);
16
+ const outputPath = options.output ?? (await defaultOutputPath());
17
+ const writtenPath = await writeAtomic(outputPath, result.content);
18
+ return {
19
+ outputPath: writtenPath,
20
+ tablesGenerated: result.tablesGenerated,
21
+ warnings: result.warnings,
22
+ };
23
+ }
@@ -0,0 +1,7 @@
1
+ export declare function toPascalCase(value: string): string;
2
+ export declare function toSafeConstKey(value: string): string;
3
+ export declare function makeUniquePascalNames<T extends {
4
+ id: string;
5
+ name: string;
6
+ }>(items: T[]): Map<string, string>;
7
+ export declare function quotePropertyKey(value: string): string;
@@ -0,0 +1,51 @@
1
+ const NON_IDENTIFIER = /[^a-zA-Z0-9_$]+/g;
2
+ const MULTIPLE_UNDERSCORES = /_+/g;
3
+ function suffixFromId(id) {
4
+ return id.replace(/[^a-zA-Z0-9]/g, '').slice(-6) || 'Id';
5
+ }
6
+ export function toPascalCase(value) {
7
+ const normalized = value
8
+ .replace(NON_IDENTIFIER, ' ')
9
+ .trim()
10
+ .split(/\s+/)
11
+ .filter(Boolean)
12
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
13
+ .join('');
14
+ if (!normalized)
15
+ return 'Generated';
16
+ if (/^[0-9]/.test(normalized))
17
+ return `T${normalized}`;
18
+ return normalized;
19
+ }
20
+ export function toSafeConstKey(value) {
21
+ const normalized = value
22
+ .replace(NON_IDENTIFIER, '_')
23
+ .replace(MULTIPLE_UNDERSCORES, '_')
24
+ .replace(/^_+|_+$/g, '');
25
+ if (!normalized)
26
+ return 'generated';
27
+ if (/^[0-9]/.test(normalized))
28
+ return `_${normalized}`;
29
+ return normalized;
30
+ }
31
+ export function makeUniquePascalNames(items) {
32
+ const result = new Map();
33
+ const counts = new Map();
34
+ items.forEach((item) => {
35
+ const base = toPascalCase(item.name);
36
+ const count = counts.get(base) ?? 0;
37
+ counts.set(base, count + 1);
38
+ });
39
+ items.forEach((item) => {
40
+ const base = toPascalCase(item.name);
41
+ if ((counts.get(base) ?? 0) === 1) {
42
+ result.set(item.id, base);
43
+ return;
44
+ }
45
+ result.set(item.id, `${base}_${suffixFromId(item.id)}`);
46
+ });
47
+ return result;
48
+ }
49
+ export function quotePropertyKey(value) {
50
+ return JSON.stringify(value);
51
+ }
@@ -0,0 +1,3 @@
1
+ export { buildAirtableTypes } from './build.js';
2
+ export { generateAirtableTypes } from './generate.js';
3
+ export type { AirtableCodegenResult, AirtableSchemaSource, CreateRequiredMode, EnumMode, GenerateAirtableTypesOptions, GenerateAirtableTypesResult, SchemaMode, UnknownFieldBehavior, } from './types.js';
@@ -0,0 +1,2 @@
1
+ export { buildAirtableTypes } from './build.js';
2
+ export { generateAirtableTypes } from './generate.js';
@@ -0,0 +1,3 @@
1
+ import type { AirtableBaseSchema } from '../types/metadata.js';
2
+ import type { AirtableSchemaSource } from './types.js';
3
+ export declare function loadSchema(source: AirtableSchemaSource): Promise<AirtableBaseSchema>;
@@ -0,0 +1,28 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { resolve } from 'node:path';
3
+ import { getBaseSchema } from '../requests.js';
4
+ import { isRecord } from './utils.js';
5
+ function isAirtableBaseSchema(value) {
6
+ if (!isRecord(value))
7
+ return false;
8
+ return Array.isArray(value.tables);
9
+ }
10
+ export async function loadSchema(source) {
11
+ if ('schema' in source) {
12
+ return source.schema;
13
+ }
14
+ if ('schemaPath' in source) {
15
+ const filePath = resolve(source.schemaPath);
16
+ const content = await readFile(filePath, 'utf8');
17
+ const parsed = JSON.parse(content);
18
+ if (!isAirtableBaseSchema(parsed)) {
19
+ throw new Error(`Schema file at ${filePath} is not a valid Airtable base schema.`);
20
+ }
21
+ return parsed;
22
+ }
23
+ const token = source.accessToken || source.apiKey;
24
+ if (!token) {
25
+ throw new Error('An Airtable access token is required when loading schema from the Airtable metadata API.');
26
+ }
27
+ return getBaseSchema({ apiKey: token, baseId: source.baseId });
28
+ }
@@ -0,0 +1,31 @@
1
+ import type { AirtableFieldSchema } from '../types/metadata.js';
2
+ import type { EnumMode, NormalizedField, UnknownFieldBehavior } from './types.js';
3
+ export declare function mapFieldTypes({ field, enumMode, unknownFieldBehavior, }: {
4
+ field: AirtableFieldSchema;
5
+ enumMode: EnumMode;
6
+ unknownFieldBehavior: UnknownFieldBehavior;
7
+ }): {
8
+ read: {
9
+ type: string;
10
+ warning?: string;
11
+ };
12
+ create?: {
13
+ type: string;
14
+ warning?: string;
15
+ };
16
+ update?: {
17
+ type: string;
18
+ warning?: string;
19
+ };
20
+ readonly: boolean;
21
+ computed: boolean;
22
+ linkedTableId?: string;
23
+ enumTypeAlias?: string;
24
+ };
25
+ export declare function mapFieldToNormalizedField({ field, enumMode, unknownFieldBehavior, tsKey, tsTypeName, }: {
26
+ field: AirtableFieldSchema;
27
+ enumMode: EnumMode;
28
+ unknownFieldBehavior: UnknownFieldBehavior;
29
+ tsKey: string;
30
+ tsTypeName: string;
31
+ }): NormalizedField;
@@ -0,0 +1,278 @@
1
+ import { getChoices, getRecordValue, stringifyUnion } from './utils.js';
2
+ const READONLY_FIELD_TYPES = new Set([
3
+ 'aiText',
4
+ 'autoNumber',
5
+ 'button',
6
+ 'count',
7
+ 'createdBy',
8
+ 'createdTime',
9
+ 'formula',
10
+ 'lastModifiedBy',
11
+ 'lastModifiedTime',
12
+ 'lookup',
13
+ 'rollup',
14
+ 'syncSource',
15
+ ]);
16
+ const COMPUTED_FIELD_TYPES = new Set([
17
+ 'aiText',
18
+ 'autoNumber',
19
+ 'button',
20
+ 'count',
21
+ 'formula',
22
+ 'lookup',
23
+ 'rollup',
24
+ 'syncSource',
25
+ ]);
26
+ function resolveUnknown(field, unknownFieldBehavior, reason) {
27
+ const warning = reason
28
+ ? `${field.name}: ${reason}`
29
+ : `${field.name}: unsupported Airtable field type ${field.type}`;
30
+ if (unknownFieldBehavior === 'error') {
31
+ throw new Error(warning);
32
+ }
33
+ return { type: 'unknown', warning };
34
+ }
35
+ function resolveUnknownArray(field, unknownFieldBehavior, reason) {
36
+ const resolved = resolveUnknown(field, unknownFieldBehavior, reason);
37
+ return {
38
+ type: 'unknown[]',
39
+ warning: resolved.warning,
40
+ };
41
+ }
42
+ function buildEnumType(field, enumMode) {
43
+ const choices = getChoices(field.options);
44
+ if (!choices?.length)
45
+ return undefined;
46
+ const literals = stringifyUnion(choices.map((choice) => choice.name));
47
+ if (enumMode === 'literal')
48
+ return literals;
49
+ if (enumMode === 'broad')
50
+ return 'string';
51
+ return `${literals} | (string & {})`;
52
+ }
53
+ function mapResultDescriptor(descriptor, field, enumMode, unknownFieldBehavior) {
54
+ const resultType = getRecordValue(descriptor, 'type');
55
+ if (!resultType) {
56
+ return resolveUnknown(field, unknownFieldBehavior, 'metadata result type is missing');
57
+ }
58
+ const nestedField = {
59
+ ...field,
60
+ type: resultType,
61
+ options: getRecordValue(descriptor, 'options'),
62
+ };
63
+ return mapFieldTypes({
64
+ field: nestedField,
65
+ enumMode,
66
+ unknownFieldBehavior,
67
+ }).read;
68
+ }
69
+ export function mapFieldTypes({ field, enumMode, unknownFieldBehavior, }) {
70
+ const readonly = READONLY_FIELD_TYPES.has(field.type);
71
+ const computed = COMPUTED_FIELD_TYPES.has(field.type);
72
+ const linkedTableId = getRecordValue(field.options, 'linkedTableId');
73
+ switch (field.type) {
74
+ case 'singleLineText':
75
+ case 'multilineText':
76
+ case 'richText':
77
+ case 'email':
78
+ case 'url':
79
+ case 'phoneNumber':
80
+ case 'date':
81
+ case 'dateTime':
82
+ return {
83
+ read: { type: 'string' },
84
+ create: { type: 'string' },
85
+ update: { type: 'string' },
86
+ readonly,
87
+ computed,
88
+ };
89
+ case 'aiText':
90
+ return {
91
+ read: { type: 'string' },
92
+ readonly,
93
+ computed,
94
+ };
95
+ case 'number':
96
+ case 'currency':
97
+ case 'percent':
98
+ case 'rating':
99
+ case 'duration':
100
+ return {
101
+ read: { type: 'number' },
102
+ create: { type: 'number' },
103
+ update: { type: 'number' },
104
+ readonly,
105
+ computed,
106
+ };
107
+ case 'checkbox':
108
+ return {
109
+ read: { type: 'boolean' },
110
+ create: { type: 'boolean' },
111
+ update: { type: 'boolean' },
112
+ readonly,
113
+ computed,
114
+ };
115
+ case 'singleSelect': {
116
+ const enumType = buildEnumType(field, enumMode) ?? 'string';
117
+ return {
118
+ read: { type: enumType },
119
+ create: { type: enumType },
120
+ update: { type: enumType },
121
+ readonly,
122
+ computed,
123
+ enumTypeAlias: enumType,
124
+ };
125
+ }
126
+ case 'multipleSelects': {
127
+ const enumType = buildEnumType(field, enumMode) ?? 'string';
128
+ return {
129
+ read: { type: `Array<${enumType}>` },
130
+ create: { type: `Array<${enumType}>` },
131
+ update: { type: `Array<${enumType}>` },
132
+ readonly,
133
+ computed,
134
+ enumTypeAlias: enumType,
135
+ };
136
+ }
137
+ case 'multipleAttachments':
138
+ case 'attachment':
139
+ return {
140
+ read: { type: 'Attachment[]' },
141
+ create: { type: 'AttachmentWrite[]' },
142
+ update: { type: 'AttachmentWrite[]' },
143
+ readonly,
144
+ computed,
145
+ };
146
+ case 'singleCollaborator':
147
+ return {
148
+ read: { type: 'Collaborator' },
149
+ create: { type: 'Collaborator' },
150
+ update: { type: 'Collaborator' },
151
+ readonly,
152
+ computed,
153
+ };
154
+ case 'multipleCollaborators':
155
+ return {
156
+ read: { type: 'Collaborator[]' },
157
+ create: { type: 'Collaborator[]' },
158
+ update: { type: 'Collaborator[]' },
159
+ readonly,
160
+ computed,
161
+ };
162
+ case 'multipleRecordLinks':
163
+ case 'linkToAnotherRecord':
164
+ return {
165
+ read: { type: 'string[]' },
166
+ create: { type: 'string[]' },
167
+ update: { type: 'string[]' },
168
+ readonly,
169
+ computed,
170
+ linkedTableId,
171
+ };
172
+ case 'barcode':
173
+ return {
174
+ read: { type: 'Barcode' },
175
+ create: { type: 'Barcode' },
176
+ update: { type: 'Barcode' },
177
+ readonly,
178
+ computed,
179
+ };
180
+ case 'createdTime':
181
+ case 'lastModifiedTime':
182
+ return {
183
+ read: { type: 'string' },
184
+ readonly,
185
+ computed,
186
+ };
187
+ case 'createdBy':
188
+ case 'lastModifiedBy':
189
+ return {
190
+ read: { type: 'Collaborator' },
191
+ readonly,
192
+ computed,
193
+ };
194
+ case 'button':
195
+ return {
196
+ read: { type: 'ButtonFieldValue' },
197
+ readonly,
198
+ computed,
199
+ };
200
+ case 'count':
201
+ case 'autoNumber':
202
+ return {
203
+ read: { type: 'number' },
204
+ readonly,
205
+ computed,
206
+ };
207
+ case 'formula': {
208
+ const result = mapResultDescriptor(getRecordValue(field.options, 'result'), field, enumMode, unknownFieldBehavior);
209
+ return {
210
+ read: result,
211
+ readonly,
212
+ computed,
213
+ };
214
+ }
215
+ case 'rollup': {
216
+ const result = getRecordValue(field.options, 'result');
217
+ const mapped = result
218
+ ? mapResultDescriptor(result, field, enumMode, unknownFieldBehavior)
219
+ : resolveUnknown(field, unknownFieldBehavior, 'rollup result metadata is missing');
220
+ return {
221
+ read: mapped,
222
+ readonly,
223
+ computed,
224
+ };
225
+ }
226
+ case 'lookup': {
227
+ const result = getRecordValue(field.options, 'result');
228
+ const mapped = result
229
+ ? mapResultDescriptor(result, field, enumMode, unknownFieldBehavior)
230
+ : resolveUnknownArray(field, unknownFieldBehavior, 'lookup result metadata is missing');
231
+ return {
232
+ read: mapped.type === 'unknown'
233
+ ? { ...mapped, type: 'unknown[]' }
234
+ : { ...mapped, type: `Array<${mapped.type}>` },
235
+ readonly,
236
+ computed,
237
+ };
238
+ }
239
+ default: {
240
+ const unknown = resolveUnknown(field, unknownFieldBehavior);
241
+ return {
242
+ read: unknown,
243
+ create: readonly ? undefined : unknown,
244
+ update: readonly ? undefined : unknown,
245
+ readonly,
246
+ computed,
247
+ };
248
+ }
249
+ }
250
+ }
251
+ export function mapFieldToNormalizedField({ field, enumMode, unknownFieldBehavior, tsKey, tsTypeName, }) {
252
+ const mapped = mapFieldTypes({
253
+ field,
254
+ enumMode,
255
+ unknownFieldBehavior,
256
+ });
257
+ const warnings = [
258
+ mapped.read.warning,
259
+ mapped.create?.warning,
260
+ mapped.update?.warning,
261
+ ].filter((warning) => Boolean(warning));
262
+ return {
263
+ id: field.id,
264
+ name: field.name,
265
+ tsKey,
266
+ tsTypeName,
267
+ airtableType: field.type,
268
+ readonly: mapped.readonly,
269
+ computed: mapped.computed,
270
+ readType: mapped.read.type,
271
+ createType: mapped.create?.type,
272
+ updateType: mapped.update?.type,
273
+ linkedTableId: mapped.linkedTableId,
274
+ enumTypeAlias: mapped.enumTypeAlias,
275
+ warnings,
276
+ options: field.options,
277
+ };
278
+ }
@@ -0,0 +1,11 @@
1
+ import type { AirtableBaseSchema } from '../types/metadata.js';
2
+ import type { EnumMode, NormalizedBase, UnknownFieldBehavior } from './types.js';
3
+ export declare function normalizeSchema({ schema, tableNameOrId, enumMode, unknownFieldBehavior, }: {
4
+ schema: AirtableBaseSchema;
5
+ tableNameOrId?: string | string[];
6
+ enumMode: EnumMode;
7
+ unknownFieldBehavior: UnknownFieldBehavior;
8
+ }): {
9
+ normalizedBase: NormalizedBase;
10
+ warnings: string[];
11
+ };
@@ -0,0 +1,61 @@
1
+ import { makeUniquePascalNames, toPascalCase } from './identifiers.js';
2
+ import { mapFieldToNormalizedField } from './map-field.js';
3
+ import { compareByNameThenId, ensureArray } from './utils.js';
4
+ export function normalizeSchema({ schema, tableNameOrId, enumMode, unknownFieldBehavior, }) {
5
+ const filters = new Set(ensureArray(tableNameOrId));
6
+ const selectedTables = [...schema.tables]
7
+ .filter((table) => {
8
+ if (!filters.size)
9
+ return true;
10
+ return filters.has(table.id) || filters.has(table.name);
11
+ })
12
+ .sort(compareByNameThenId);
13
+ if (!selectedTables.length) {
14
+ throw new Error('No Airtable tables matched the requested tableNameOrId filter.');
15
+ }
16
+ const warnings = [];
17
+ const tableNames = makeUniquePascalNames(selectedTables);
18
+ const sanitizedTableNameCounts = new Map();
19
+ selectedTables.forEach((table) => {
20
+ const baseName = toPascalCase(table.name);
21
+ sanitizedTableNameCounts.set(baseName, (sanitizedTableNameCounts.get(baseName) ?? 0) + 1);
22
+ });
23
+ const tables = selectedTables.map((table) => {
24
+ const tsName = tableNames.get(table.id) ?? table.name;
25
+ if ((sanitizedTableNameCounts.get(toPascalCase(table.name)) ?? 0) > 1) {
26
+ warnings.push(`Table name collision detected for ${table.name}. Generated type name ${tsName} includes a stable suffix.`);
27
+ }
28
+ const fieldNames = makeUniquePascalNames(table.fields);
29
+ const sanitizedFieldNameCounts = new Map();
30
+ table.fields.forEach((field) => {
31
+ const baseName = toPascalCase(field.name);
32
+ sanitizedFieldNameCounts.set(baseName, (sanitizedFieldNameCounts.get(baseName) ?? 0) + 1);
33
+ });
34
+ const fields = table.fields.map((field) => {
35
+ const fieldTsName = fieldNames.get(field.id) ?? field.name;
36
+ const normalizedField = mapFieldToNormalizedField({
37
+ field,
38
+ enumMode,
39
+ unknownFieldBehavior,
40
+ tsKey: field.name,
41
+ tsTypeName: `${tsName}${fieldTsName}`,
42
+ });
43
+ if ((sanitizedFieldNameCounts.get(toPascalCase(field.name)) ?? 0) > 1) {
44
+ warnings.push(`Field name collision detected for ${table.name}.${field.name}. Generated helper type name ${normalizedField.tsTypeName} includes a stable suffix.`);
45
+ }
46
+ warnings.push(...normalizedField.warnings.map((warning) => `${table.name}.${warning}`));
47
+ return normalizedField;
48
+ });
49
+ return {
50
+ id: table.id,
51
+ name: table.name,
52
+ tsName,
53
+ primaryFieldId: table.primaryFieldId,
54
+ fields,
55
+ };
56
+ });
57
+ return {
58
+ normalizedBase: { tables },
59
+ warnings: [...new Set(warnings)],
60
+ };
61
+ }
@@ -0,0 +1,62 @@
1
+ import type { AirtableBaseSchema } from '../types/metadata.js';
2
+ export type AirtableSchemaSource = {
3
+ baseId: string;
4
+ accessToken?: string;
5
+ apiKey?: string;
6
+ } | {
7
+ schemaPath: string;
8
+ } | {
9
+ schema: AirtableBaseSchema;
10
+ };
11
+ export type EnumMode = 'literal' | 'hybrid' | 'broad';
12
+ export type CreateRequiredMode = 'allOptional' | 'primaryField';
13
+ export type UnknownFieldBehavior = 'unknown' | 'error';
14
+ export type SchemaMode = 'read' | 'write' | 'full';
15
+ export interface GenerateAirtableTypesOptions {
16
+ source: AirtableSchemaSource;
17
+ output?: string;
18
+ tableNameOrId?: string | string[];
19
+ enumMode?: EnumMode;
20
+ createRequiredMode?: CreateRequiredMode;
21
+ unknownFieldBehavior?: UnknownFieldBehavior;
22
+ includeTableIds?: boolean;
23
+ includeFieldIds?: boolean;
24
+ schemaMode?: SchemaMode;
25
+ format?: boolean;
26
+ }
27
+ export interface AirtableCodegenResult {
28
+ content: string;
29
+ tablesGenerated: number;
30
+ warnings: string[];
31
+ }
32
+ export interface GenerateAirtableTypesResult {
33
+ outputPath: string;
34
+ tablesGenerated: number;
35
+ warnings: string[];
36
+ }
37
+ export interface NormalizedBase {
38
+ tables: NormalizedTable[];
39
+ }
40
+ export interface NormalizedTable {
41
+ id: string;
42
+ name: string;
43
+ tsName: string;
44
+ primaryFieldId: string;
45
+ fields: NormalizedField[];
46
+ }
47
+ export interface NormalizedField {
48
+ id: string;
49
+ name: string;
50
+ tsKey: string;
51
+ tsTypeName: string;
52
+ airtableType: string;
53
+ readonly: boolean;
54
+ computed: boolean;
55
+ readType: string;
56
+ createType?: string;
57
+ updateType?: string;
58
+ enumTypeAlias?: string;
59
+ linkedTableId?: string;
60
+ warnings: string[];
61
+ options?: Record<string, unknown>;
62
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ export declare function compareByNameThenId(left: {
2
+ name: string;
3
+ id: string;
4
+ }, right: {
5
+ name: string;
6
+ id: string;
7
+ }): number;
8
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
9
+ export declare function getRecordValue<T = unknown>(value: unknown, key: string): T | undefined;
10
+ export declare function getChoices(options: unknown): {
11
+ name: string;
12
+ }[] | undefined;
13
+ export declare function stringifyUnion(values: string[]): string;
14
+ export declare function ensureArray<T>(value: T | T[] | undefined): T[];
@@ -0,0 +1,30 @@
1
+ export function compareByNameThenId(left, right) {
2
+ return left.name.localeCompare(right.name) || left.id.localeCompare(right.id);
3
+ }
4
+ export function isRecord(value) {
5
+ return typeof value === 'object' && value !== null;
6
+ }
7
+ export function getRecordValue(value, key) {
8
+ if (!isRecord(value) || !(key in value))
9
+ return undefined;
10
+ return value[key];
11
+ }
12
+ export function getChoices(options) {
13
+ const choices = getRecordValue(options, 'choices');
14
+ if (!choices)
15
+ return undefined;
16
+ const validChoices = choices
17
+ .filter(isRecord)
18
+ .map((choice) => getRecordValue(choice, 'name'))
19
+ .filter((choice) => Boolean(choice))
20
+ .map((name) => ({ name }));
21
+ return validChoices.length ? validChoices : undefined;
22
+ }
23
+ export function stringifyUnion(values) {
24
+ return values.map((value) => JSON.stringify(value)).join(' | ');
25
+ }
26
+ export function ensureArray(value) {
27
+ if (value === undefined)
28
+ return [];
29
+ return Array.isArray(value) ? value : [value];
30
+ }
@@ -0,0 +1 @@
1
+ export declare function writeAtomic(outputPath: string, content: string): Promise<string>;
@@ -0,0 +1,11 @@
1
+ import { mkdir, rename, writeFile } from 'node:fs/promises';
2
+ import { dirname, resolve } from 'node:path';
3
+ export async function writeAtomic(outputPath, content) {
4
+ const resolvedPath = resolve(outputPath);
5
+ const parentDirectory = dirname(resolvedPath);
6
+ const temporaryPath = `${resolvedPath}.tmp-${process.pid}-${Date.now()}`;
7
+ await mkdir(parentDirectory, { recursive: true });
8
+ await writeFile(temporaryPath, content, 'utf8');
9
+ await rename(temporaryPath, resolvedPath);
10
+ return resolvedPath;
11
+ }
package/lib/index.d.ts CHANGED
@@ -1 +1,3 @@
1
- export { getRecord, getRecords, updateRecord, updateRecords, updateRecordsUpsert, deleteRecords, generateTypeScriptDefinitions, } from './requests.js';
1
+ export { getRecord, getRecords, createRecord, createRecords, updateRecord, updateRecords, updateRecordsUpsert, deleteRecords, } from './records.js';
2
+ export type { AirtableRecord } from './types/records.js';
3
+ export type { Attachment, AttachmentWrite, Collaborator, } from './types/fields.js';
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- export { getRecord, getRecords, updateRecord, updateRecords, updateRecordsUpsert, deleteRecords, generateTypeScriptDefinitions, } from './requests.js';
1
+ export { getRecord, getRecords, createRecord, createRecords, updateRecord, updateRecords, updateRecordsUpsert, deleteRecords, } from './records.js';