airtable-ts-codegen 1.1.0 → 1.2.0
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/dist/jsTypeForAirtableType.js +10 -25
- package/package.json +2 -2
|
@@ -16,7 +16,15 @@ const jsTypeForAirtableType = (field) => {
|
|
|
16
16
|
case 'richText':
|
|
17
17
|
case 'singleSelect':
|
|
18
18
|
case 'externalSyncSource':
|
|
19
|
+
case 'aiText':
|
|
20
|
+
case 'singleCollaborator':
|
|
21
|
+
case 'createdBy':
|
|
22
|
+
case 'lastModifiedBy':
|
|
23
|
+
case 'barcode':
|
|
24
|
+
case 'button':
|
|
19
25
|
return 'string';
|
|
26
|
+
case 'multipleAttachments':
|
|
27
|
+
case 'multipleCollaborators':
|
|
20
28
|
case 'multipleRecordLinks':
|
|
21
29
|
case 'multipleSelects':
|
|
22
30
|
return 'string[]';
|
|
@@ -49,32 +57,9 @@ const jsTypeForAirtableType = (field) => {
|
|
|
49
57
|
return `${innerType} | null`;
|
|
50
58
|
}
|
|
51
59
|
throw new Error(`Invalid ${field.type} field (no options.result): ${field.id}`);
|
|
52
|
-
// Special cases we don't yet support; for now, skip these fields
|
|
53
|
-
// case 'aiText':
|
|
54
|
-
// return 'AiTextObject';
|
|
55
|
-
// case 'singleCollaborator':
|
|
56
|
-
// case 'createdBy':
|
|
57
|
-
// case 'lastModifiedBy':
|
|
58
|
-
// return 'CollaboratorObject';
|
|
59
|
-
// case 'multipleCollaborators':
|
|
60
|
-
// return 'CollaboratorObject[]';
|
|
61
|
-
// case 'multipleAttachments':
|
|
62
|
-
// return 'AttachmentObject[]';
|
|
63
|
-
// case 'barcode':
|
|
64
|
-
// return 'BarcodeObject';
|
|
65
|
-
// case 'button':
|
|
66
|
-
// return 'ButtonObject';
|
|
67
|
-
case 'aiText':
|
|
68
|
-
case 'singleCollaborator':
|
|
69
|
-
case 'createdBy':
|
|
70
|
-
case 'lastModifiedBy':
|
|
71
|
-
case 'multipleCollaborators':
|
|
72
|
-
case 'multipleAttachments':
|
|
73
|
-
case 'barcode':
|
|
74
|
-
case 'button':
|
|
75
|
-
return null;
|
|
76
60
|
default:
|
|
77
|
-
|
|
61
|
+
console.warn(`Could not convert Airtable type '${field.type}' to a TypeScript type for field ${field.id}`);
|
|
62
|
+
return null;
|
|
78
63
|
}
|
|
79
64
|
};
|
|
80
65
|
exports.jsTypeForAirtableType = jsTypeForAirtableType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "airtable-ts-codegen",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Autogenerate TypeScript definitions for your Airtable base",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Adam Jones (domdomegg)",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@tsconfig/node-lts": "^20.1.3",
|
|
35
35
|
"@types/diacritics": "^1.3.3",
|
|
36
36
|
"@types/node": "^20.12.8",
|
|
37
|
-
"airtable-ts": "^1.
|
|
37
|
+
"airtable-ts": "^1.4.0",
|
|
38
38
|
"eslint": "^8.57.0",
|
|
39
39
|
"eslint-config-domdomegg": "^1.2.3",
|
|
40
40
|
"tsconfig-domdomegg": "^1.0.0",
|