easy-airtable-api 0.1.0 → 0.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +55 -1
  3. package/package.json +5 -2
  4. package/easy-airtable-api-0.1.0.tgz +0 -0
  5. package/lib/bases.d.ts +0 -18
  6. package/lib/bases.js +0 -40
  7. package/lib/cli.d.ts +0 -2
  8. package/lib/cli.js +0 -82
  9. package/lib/codegen/build.d.ts +0 -2
  10. package/lib/codegen/build.js +0 -25
  11. package/lib/codegen/emit-typescript.d.ts +0 -8
  12. package/lib/codegen/emit-typescript.js +0 -117
  13. package/lib/codegen/generate.d.ts +0 -2
  14. package/lib/codegen/generate.js +0 -23
  15. package/lib/codegen/identifiers.d.ts +0 -11
  16. package/lib/codegen/identifiers.js +0 -73
  17. package/lib/codegen/index.d.ts +0 -3
  18. package/lib/codegen/index.js +0 -2
  19. package/lib/codegen/load-schema.d.ts +0 -3
  20. package/lib/codegen/load-schema.js +0 -28
  21. package/lib/codegen/map-field.d.ts +0 -30
  22. package/lib/codegen/map-field.js +0 -296
  23. package/lib/codegen/normalize-schema.d.ts +0 -11
  24. package/lib/codegen/normalize-schema.js +0 -79
  25. package/lib/codegen/types.d.ts +0 -64
  26. package/lib/codegen/types.js +0 -1
  27. package/lib/codegen/utils.d.ts +0 -14
  28. package/lib/codegen/utils.js +0 -30
  29. package/lib/codegen/write-atomic.d.ts +0 -1
  30. package/lib/codegen/write-atomic.js +0 -11
  31. package/lib/index.d.ts +0 -8
  32. package/lib/index.js +0 -3
  33. package/lib/records.d.ts +0 -197
  34. package/lib/records.js +0 -300
  35. package/lib/requests.d.ts +0 -74
  36. package/lib/requests.js +0 -362
  37. package/lib/types/bases.d.ts +0 -31
  38. package/lib/types/bases.js +0 -1
  39. package/lib/types/fields.d.ts +0 -330
  40. package/lib/types/fields.js +0 -1
  41. package/lib/types/metadata.d.ts +0 -24
  42. package/lib/types/metadata.js +0 -1
  43. package/lib/types/records.d.ts +0 -130
  44. package/lib/types/records.js +0 -1
  45. package/lib/types/tables.d.ts +0 -99
  46. package/lib/types/tables.js +0 -1
  47. package/lib/utils.d.ts +0 -4
  48. package/lib/utils.js +0 -19
@@ -1,330 +0,0 @@
1
- type AIState = 'empty' | 'loading' | 'generated' | 'error';
2
- export interface AICell {
3
- state: AIState;
4
- isStale: boolean;
5
- value: string | null;
6
- errorType?: string;
7
- }
8
- export interface AIFieldTypeAndOptions {
9
- type: 'aiText';
10
- options: {
11
- prompt?: (string | {
12
- field: {
13
- fieldId: string;
14
- referencedFieldIds?: string[];
15
- };
16
- })[];
17
- };
18
- }
19
- export interface AttachmentWrite {
20
- url: string;
21
- filename?: string;
22
- id?: string;
23
- }
24
- export interface AttachmentFieldTypeAndOptions {
25
- type: 'multipleAttachments';
26
- options: {
27
- isReversed: boolean;
28
- };
29
- }
30
- export type AutoNumberCell = number;
31
- export interface AutoNumberFieldTypeAndOptions {
32
- type: 'autoNumber';
33
- }
34
- export interface BarcodeCell {
35
- type?: string;
36
- text: string;
37
- }
38
- export interface BarcodeWrite {
39
- text: string;
40
- type?: string;
41
- }
42
- export type Barcode = BarcodeCell;
43
- export interface BarcodeFieldTypeAndOptions {
44
- type: 'barcode';
45
- }
46
- export interface ButtonCell {
47
- label: string;
48
- url: string | null;
49
- }
50
- export type ButtonFieldValue = ButtonCell;
51
- export interface ButtonFieldTypeAndOptions {
52
- type: 'button';
53
- }
54
- export type CheckboxCellV1 = true | 'empty';
55
- export type CheckboxCellV2 = true | null;
56
- export interface CheckboxFieldTypeAndOptions {
57
- type: 'checkbox';
58
- options: {
59
- color: 'yellowBright' | 'orangeBright' | 'redBright' | 'pinkBright' | 'purpleBright' | 'blueBright' | 'cyanBright' | 'tealBright' | 'greenBright' | 'grayBright';
60
- icon: 'check' | 'xCheckbox' | 'star' | 'heart' | 'thumbsUp' | 'flag' | 'dot';
61
- };
62
- }
63
- export interface CollaboratorCell {
64
- id: string;
65
- email?: string;
66
- name?: string;
67
- profilePicUrl?: string;
68
- }
69
- export interface CollaboratorWrite {
70
- id: string;
71
- email?: string;
72
- }
73
- export interface SingleCollaboratorFieldTypeAndOptions {
74
- type: 'singleCollaborator';
75
- options: Record<string, never>;
76
- }
77
- export type CountCell = number;
78
- export interface CountFieldTypeAndOptions {
79
- type: 'count';
80
- options: {
81
- isValid: boolean;
82
- recordLinkFieldId?: string | null;
83
- };
84
- }
85
- export type CreatedByCell = CollaboratorCell;
86
- export interface CreatedByFieldTypeAndOptions {
87
- type: 'createdBy';
88
- }
89
- export type CreatedTimeCell = string;
90
- export interface CreatedTimeFieldTypeAndOptions {
91
- type: 'createdTime';
92
- options: {
93
- result?: unknown;
94
- };
95
- }
96
- export type CurrencyCell = number;
97
- export interface CurrencyFieldTypeAndOptions {
98
- type: 'currency';
99
- options: {
100
- precision: number;
101
- symbol: string;
102
- };
103
- }
104
- export type DateCell = string;
105
- export interface DateFormatOptions {
106
- format: 'l' | 'LL' | 'M/D/YYYY' | 'D/M/YYYY' | 'YYYY-MM-DD';
107
- name: 'local' | 'friendly' | 'us' | 'european' | 'iso';
108
- }
109
- export interface DateFieldTypeAndOptions {
110
- type: 'date';
111
- options: {
112
- dateFormat: DateFormatOptions;
113
- };
114
- }
115
- export type DateTimeCell = string;
116
- export interface TimeFormatOptions {
117
- format: 'h:mma' | 'HH:mm' | undefined;
118
- name: '12hour' | '24hour';
119
- }
120
- export interface DateTimeFieldTypeAndOptions {
121
- type: 'dateTime';
122
- options: {
123
- timeZone: string;
124
- dateFormat: DateFormatOptions;
125
- timeFormat: TimeFormatOptions;
126
- };
127
- }
128
- export type DurationCell = number;
129
- export interface DurationFieldTypeAndOptions {
130
- type: 'duration';
131
- options: {
132
- durationFormat: 'h:mm' | 'h:mm:ss' | 'h:mm:ss.S' | 'h:mm:ss.SS' | 'h:mm:ss.SSS';
133
- };
134
- }
135
- export type EmailCell = string;
136
- export interface EmailFieldTypeAndOptions {
137
- type: 'email';
138
- }
139
- export type FormulaCell = string | number;
140
- export interface FormulaFieldTypeAndOptions {
141
- type: 'formula';
142
- options: {
143
- formula: string;
144
- isValid: boolean;
145
- referencedFieldIds: string[] | null;
146
- result: unknown;
147
- };
148
- }
149
- export type LastModifiedByCell = {
150
- id: string;
151
- email?: string;
152
- name?: string;
153
- profilePicUrl?: string;
154
- };
155
- export interface LastModifiedByFieldTypeAndOptions {
156
- type: 'lastModifiedBy';
157
- }
158
- export type LastModifiedTimeCell = string;
159
- export interface LastModifiedTimeFieldTypeAndOptions {
160
- type: 'lastModifiedTime';
161
- options: {
162
- isValid: boolean;
163
- referencedFieldIds: string[] | null;
164
- result: unknown;
165
- };
166
- }
167
- export type LinkToAnotherRecordCellV1 = string[];
168
- export type LinkToAnotherRecordCellV2 = {
169
- id: string;
170
- name: string;
171
- }[];
172
- export interface LinkToAnotherRecordFieldTypeAndOptions {
173
- type: 'multipleRecordLinks';
174
- options: {
175
- isReversed: boolean;
176
- linkedTableId: string;
177
- prefersSingleRecordLink: boolean;
178
- inverseLinkFieldId?: string;
179
- viewIdForRecordSelection?: string;
180
- };
181
- }
182
- export type LongTextCell = string;
183
- export interface LongTextFieldTypeAndOptions {
184
- type: 'multilineText';
185
- }
186
- export type LookupCellV1 = (number | string | boolean | unknown)[];
187
- export type LookupCellV2 = {
188
- valuesByLinkedRecordId: {
189
- [key: string]: unknown[];
190
- };
191
- linkedRecordIds: string[];
192
- };
193
- export interface LookupFieldTypeAndOptions {
194
- type: 'lookup';
195
- options: {
196
- fieldIdInLinkedTable: string | null;
197
- isValid: boolean;
198
- recordLinkFieldId: string | null;
199
- result: unknown;
200
- };
201
- }
202
- export type Collaborator = CollaboratorCell;
203
- export type Collaborators = Collaborator[];
204
- export type ChoiceColor = 'blueLight2' | 'cyanLight2' | 'tealLight2' | 'greenLight2' | 'yellowLight2' | 'orangeLight2' | 'redLight2' | 'pinkLight2' | 'purpleLight2' | 'grayLight2' | 'blueLight1' | 'cyanLight1' | 'tealLight1' | 'greenLight1' | 'yellowLight1' | 'orangeLight1' | 'redLight1' | 'pinkLight1' | 'purpleLight1' | 'grayLight1' | 'blueBright' | 'cyanBright' | 'tealBright' | 'greenBright' | 'yellowBright' | 'orangeBright' | 'redBright' | 'pinkBright' | 'purpleBright' | 'grayBright' | 'blueDark1' | 'cyanDark1' | 'tealDark1' | 'greenDark1' | 'yellowDark1' | 'orangeDark1' | 'redDark1' | 'pinkDark1' | 'purpleDark1' | 'grayDark1';
205
- export type Choice = {
206
- id: string;
207
- color?: ChoiceColor;
208
- name: string;
209
- };
210
- export type SelectOptions = {
211
- choices: Choice[];
212
- };
213
- export type RatingColor = 'yellowBright' | 'orangeBright' | 'redBright' | 'pinkBright' | 'purpleBright' | 'blueBright' | 'cyanBright' | 'tealBright' | 'greenBright' | 'grayBright';
214
- export type RatingIcon = 'star' | 'heart' | 'thumbsUp' | 'flag' | 'dot';
215
- export type RatingOptions = {
216
- color: RatingColor;
217
- icon: RatingIcon;
218
- max: number;
219
- };
220
- export type RollupOptions = {
221
- fieldIdInLinkedTable?: string;
222
- recordLinkFieldId?: string;
223
- result?: unknown;
224
- isValid?: boolean;
225
- referencedFieldIds?: string[];
226
- };
227
- export type ExternalSyncChoice = {
228
- id: string;
229
- color?: ChoiceColor;
230
- name: string;
231
- };
232
- export type ExternalSyncOptions = {
233
- choices: ExternalSyncChoice[];
234
- };
235
- export type SingleLineText = string | null;
236
- export type MultilineText = string | null;
237
- export type RichText = string;
238
- export type SingleSelect = string;
239
- export type MultipleSelects = string[];
240
- export type MultipleLookupValues = string[];
241
- export type Checkbox = boolean;
242
- export type AirtableUrl = string | null;
243
- export type AirtableEmail = string;
244
- export type AirtableInteger = number | null;
245
- export type Count = number;
246
- export type Duration = number;
247
- export type Formula = string | string[] | number;
248
- export type MultipleRecordLinks = string[];
249
- export type MultipleAttachments = Attachment[];
250
- export type FormulaSingleReturn = string | number;
251
- export type Rollup = string | number;
252
- export type AutoNumber = number;
253
- export type AirtableButton = ButtonCell;
254
- export type LastModifiedTime = string;
255
- export type CreatedTime = string;
256
- export type DateTime = string;
257
- export type PhoneNumber = string;
258
- export type Currency = number;
259
- export type Percent = number;
260
- export interface Attachment {
261
- id: string;
262
- url: string;
263
- filename: string;
264
- size: number;
265
- type: string;
266
- thumbnails?: {
267
- small?: Thumbnail;
268
- large?: Thumbnail;
269
- full?: Thumbnail;
270
- };
271
- }
272
- export interface Thumbnail {
273
- url: string;
274
- width: number;
275
- height: number;
276
- }
277
- export type UpserptRecords = {
278
- records: {
279
- id: string;
280
- createdTime: string;
281
- fields: unknown;
282
- }[];
283
- updatedRecords: string[];
284
- createdRecords: string[];
285
- };
286
- export interface UpdateRecordsBody {
287
- typecast: boolean;
288
- records: UpdateRecords;
289
- }
290
- export interface UpdateRecordsBodyUpsert extends UpdateRecordsBody {
291
- performUpsert: {
292
- fieldsToMergeOn: FieldsToMergeOn;
293
- };
294
- }
295
- export type BaseId = string;
296
- export type TableId = string;
297
- export type FieldsToMergeOn = string[];
298
- export type ApiRequest = {
299
- method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
300
- url: string;
301
- apiKey: string;
302
- body?: RequestBody;
303
- };
304
- export type RequestMethods = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
305
- export interface RequestMethodProps {
306
- url: string;
307
- apiKey: string;
308
- body?: RequestBody;
309
- }
310
- export type RequestBody = unknown;
311
- export interface AirtableRecordRequest {
312
- baseId: string;
313
- tableId: string;
314
- atId?: string;
315
- body: RequestBody;
316
- }
317
- export interface UpdateAirtableRecordRequest {
318
- atId?: string;
319
- baseId: string;
320
- tableId: string;
321
- body?: RequestBody;
322
- }
323
- export interface RequestBodyWebsiteInfos {
324
- fields: unknown;
325
- }
326
- export type UpdateRecord = {
327
- fields: unknown;
328
- };
329
- export type UpdateRecords = UpdateRecord[];
330
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,24 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,130 +0,0 @@
1
- export type AirtableRecord<Fields = DefaultFieldsType> = {
2
- id: string;
3
- createdTime: string;
4
- fields: Fields;
5
- };
6
- type DefaultFieldsType = {
7
- [key: string]: unknown;
8
- };
9
- type BaseId = string;
10
- type TableIdOrName = string;
11
- type SortDirection = 'asc' | 'desc';
12
- type CellFormat = 'json' | 'string';
13
- type RecordMetadataOptions = 'commentCount';
14
- interface SortObject {
15
- field: string;
16
- direction?: SortDirection;
17
- }
18
- export interface GetRecordsQueryParameters {
19
- timeZone?: Timezones;
20
- userLocale?: UserLocales;
21
- pageSize?: number;
22
- maxRecords?: number;
23
- offset?: string;
24
- view?: string;
25
- sort?: SortObject[];
26
- filterByFormula?: string;
27
- cellFormat?: CellFormat;
28
- fields?: string[];
29
- returnFieldsByFieldId?: boolean;
30
- recordMetadata?: RecordMetadataOptions[];
31
- requestInterval?: number;
32
- }
33
- export type GeneratedRecordFieldsCompatibleGetRecordsOptions = Omit<GetRecordsQueryParameters, 'cellFormat' | 'returnFieldsByFieldId'> & {
34
- cellFormat?: 'json';
35
- returnFieldsByFieldId?: false;
36
- };
37
- type RecordField = {
38
- [key: string]: unknown;
39
- };
40
- export interface AirtableBaseRecord {
41
- id: string;
42
- createdTime: string;
43
- fields: RecordField;
44
- }
45
- export interface ListRecordsResponse {
46
- offset?: string;
47
- records: AirtableBaseRecord[];
48
- }
49
- export interface GetRecordQueryParameters {
50
- cellFormat?: CellFormat;
51
- returnFieldsByFieldId?: boolean;
52
- }
53
- export type GeneratedRecordFieldsCompatibleGetRecordOptions = Omit<GetRecordQueryParameters, 'cellFormat' | 'returnFieldsByFieldId'> & {
54
- cellFormat?: 'json';
55
- returnFieldsByFieldId?: false;
56
- };
57
- export interface GetRecordPathParameters {
58
- baseId: BaseId;
59
- tableIdOrName: TableIdOrName;
60
- recordId: string;
61
- }
62
- export interface UpdatePathParameters {
63
- baseId: BaseId;
64
- tableIdOrName: TableIdOrName;
65
- }
66
- export interface PerformUpsert {
67
- fieldsToMergeOn: string[];
68
- }
69
- export interface UpdateRecordsRequestBody {
70
- performUpsert?: PerformUpsert;
71
- returnFieldsByFieldId?: boolean;
72
- typecast?: boolean;
73
- records: AirtableBaseRecord[];
74
- }
75
- export interface UpsertResponse {
76
- createdRecords: string[];
77
- updatedRecords: string[];
78
- records: AirtableBaseRecord[];
79
- }
80
- export interface UpdateRecordPathParameters {
81
- baseId: BaseId;
82
- tableIdOrName: TableIdOrName;
83
- recordId: string;
84
- }
85
- export interface UpdateRecordRequestBody {
86
- typecast?: boolean;
87
- fields: RecordField;
88
- }
89
- export interface UpdateRecordResponse {
90
- id: string;
91
- createdTime: string;
92
- fields: RecordField;
93
- }
94
- export interface CreateRecordsPathParameters {
95
- baseId: BaseId;
96
- tableIdOrName: TableIdOrName;
97
- }
98
- export interface CreateRecordsRequestBody {
99
- fields?: RecordField;
100
- records?: AirtableBaseRecord[];
101
- returnFieldsByFieldId?: boolean;
102
- typecast?: boolean;
103
- }
104
- export interface CreateRecordResponse {
105
- id: string;
106
- createdTime: string;
107
- fields: RecordField;
108
- }
109
- export interface CreateRecordsResponse {
110
- records: CreateRecordResponse[];
111
- }
112
- export interface DeleteRecordsPathParameters {
113
- baseId: BaseId;
114
- tableIdOrName: TableIdOrName;
115
- }
116
- export interface DeleteRecordResponse {
117
- id: string;
118
- deleted: true;
119
- }
120
- export interface DeleteRecordsResponse {
121
- records: DeleteRecordResponse[];
122
- }
123
- export interface DeleteRecordPathParameters {
124
- baseId: BaseId;
125
- tableIdOrName: TableIdOrName;
126
- recordId: string;
127
- }
128
- 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';
129
- 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';
130
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,99 +0,0 @@
1
- export type UpserptRecords = {
2
- records: {
3
- id: string;
4
- createdTime: string;
5
- fields: unknown;
6
- }[];
7
- updatedRecords: string[];
8
- createdRecords: string[];
9
- };
10
- export interface UpdateRecordsBody<Fields> {
11
- typecast: boolean;
12
- records: UpdateRecords<Fields>;
13
- }
14
- export interface UpdateRecordsBodyUpsert<Fields> extends UpdateRecordsBody<Fields> {
15
- performUpsert: {
16
- fieldsToMergeOn: FieldsToMergeOn;
17
- };
18
- }
19
- export type BaseId = string;
20
- export type TableId = string;
21
- export type FieldsToMergeOn = string[];
22
- export type ApiRequest = {
23
- url: string;
24
- method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
25
- apiKey: string;
26
- body?: RequestBody;
27
- };
28
- export type RequestMethods = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
29
- export interface RequestMethodProps {
30
- url: string;
31
- apiKey: string;
32
- body?: RequestBody;
33
- }
34
- export type RequestBody = unknown;
35
- export interface AirtableRecordRequest {
36
- baseId: string;
37
- tableId: string;
38
- atId?: string;
39
- body: RequestBody;
40
- }
41
- export interface UpdateAirtableRecordRequest {
42
- atId?: string;
43
- baseId: string;
44
- tableId: string;
45
- body?: RequestBody;
46
- }
47
- export interface RequestBodyWebsiteInfos {
48
- fields: unknown;
49
- }
50
- export type UpdateRecord<Fields> = {
51
- fields: Fields;
52
- };
53
- export type UpdateRecords<Fields> = UpdateRecord<Fields>[];
54
- type FieldType = 'singleLineText' | 'checkbox';
55
- type TableFieldOptions = {
56
- color?: string;
57
- icon?: string;
58
- };
59
- type FieldConfig = {
60
- id?: string;
61
- name: string;
62
- description?: string;
63
- type: FieldType;
64
- options?: TableFieldOptions;
65
- };
66
- export type BaseTableDetails = {
67
- name: string;
68
- description?: string;
69
- };
70
- export type TableConfig = {
71
- name: string;
72
- description?: string;
73
- fields: FieldConfig[];
74
- };
75
- type ViewType = 'grid' | 'form' | 'calendar' | 'gallery' | 'kanban' | 'timeline' | 'block';
76
- export type View = {
77
- id: string;
78
- name: string;
79
- type: ViewType;
80
- visibleFieldIds?: string[];
81
- };
82
- export type TableModel = {
83
- id: string;
84
- primaryFieldId: string;
85
- name: string;
86
- description?: string;
87
- fields: FieldConfig[];
88
- views: View[];
89
- };
90
- export type UpdateTableRequestBody = {
91
- name?: string;
92
- description?: string;
93
- };
94
- export type CreateTableRequestBody = {
95
- name: string;
96
- description?: string;
97
- fields: FieldConfig[];
98
- };
99
- export {};
@@ -1 +0,0 @@
1
- export {};
package/lib/utils.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { UpdateRecords } from './types/fields.js';
2
- export declare function getArrayInChunks(records: UpdateRecords): Promise<import("./types/fields.js").UpdateRecord[][]>;
3
- export declare function getErrorMessage(error: Error | unknown): string;
4
- export declare function delay(ms?: number): Promise<unknown>;
package/lib/utils.js DELETED
@@ -1,19 +0,0 @@
1
- export async function getArrayInChunks(records) {
2
- const chunks = [];
3
- const chunkSize = 10;
4
- for (let i = 0; i < records.length; i += chunkSize) {
5
- const chunk = records.slice(i, i + chunkSize);
6
- chunks.push(chunk);
7
- }
8
- return chunks;
9
- }
10
- export function getErrorMessage(error) {
11
- if (error instanceof Error)
12
- return error.message;
13
- return String(error);
14
- }
15
- export async function delay(ms = 0) {
16
- if (!ms || typeof ms !== 'number' || ms <= 0)
17
- return;
18
- return await new Promise((resolve) => setTimeout(resolve, ms));
19
- }