@airtable/blocks 1.7.0 → 1.9.0-experimental
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 +29 -3
- package/dist/cjs/error_utils.js +17 -0
- package/dist/cjs/models/base.js +16 -11
- package/dist/cjs/models/cursor.js +2 -0
- package/dist/cjs/models/field.js +157 -36
- package/dist/cjs/models/grouped_record_query_result.js +5 -14
- package/dist/cjs/models/linked_records_query_result.js +75 -27
- package/dist/cjs/models/mutation_constants.js +3 -1
- package/dist/cjs/models/mutations.js +70 -178
- package/dist/cjs/models/query_manager.js +327 -0
- package/dist/cjs/models/record.js +308 -55
- package/dist/cjs/models/record_query_result.js +4 -1
- package/dist/cjs/models/record_store.js +554 -765
- package/dist/cjs/models/table.js +22 -19
- package/dist/cjs/models/table_or_view_query_result.js +480 -414
- package/dist/cjs/models/view_data_store.js +243 -269
- package/dist/cjs/private_utils.js +50 -0
- package/dist/cjs/sdk.js +12 -2
- package/dist/cjs/testing/{mock_airtable_interface.js → abstract_mock_airtable_interface.js} +71 -22
- package/dist/cjs/types/block_query_spec.js +85 -0
- package/dist/cjs/types/field.js +1 -0
- package/dist/cjs/types/mutations.js +1 -0
- package/dist/cjs/ui/icon_config.js +6 -2
- package/dist/cjs/ui/use_global_config.js +1 -1
- package/dist/cjs/ui/use_records.js +5 -1
- package/dist/cjs/unstable_testing_utils.js +2 -2
- package/dist/cjs/watchable.js +123 -71
- package/dist/types/src/models/base.d.ts +10 -9
- package/dist/types/src/models/base.d.ts.map +1 -1
- package/dist/types/src/models/cursor.d.ts +2 -0
- package/dist/types/src/models/cursor.d.ts.map +1 -1
- package/dist/types/src/models/field.d.ts +71 -9
- package/dist/types/src/models/field.d.ts.map +1 -1
- package/dist/types/src/models/grouped_record_query_result.d.ts +3 -3
- package/dist/types/src/models/grouped_record_query_result.d.ts.map +1 -1
- package/dist/types/src/models/linked_records_query_result.d.ts.map +1 -1
- package/dist/types/src/models/mutation_constants.d.ts +1 -0
- package/dist/types/src/models/mutation_constants.d.ts.map +1 -1
- package/dist/types/src/models/mutations.d.ts.map +1 -1
- package/dist/types/src/models/query_manager.d.ts +2 -0
- package/dist/types/src/models/query_manager.d.ts.map +1 -0
- package/dist/types/src/models/record.d.ts +12 -3
- package/dist/types/src/models/record.d.ts.map +1 -1
- package/dist/types/src/models/record_query_result.d.ts +3 -2
- package/dist/types/src/models/record_query_result.d.ts.map +1 -1
- package/dist/types/src/models/record_store.d.ts.map +1 -1
- package/dist/types/src/models/table.d.ts +8 -10
- package/dist/types/src/models/table.d.ts.map +1 -1
- package/dist/types/src/models/table_or_view_query_result.d.ts +3 -5
- package/dist/types/src/models/table_or_view_query_result.d.ts.map +1 -1
- package/dist/types/src/models/view_data_store.d.ts +0 -1
- package/dist/types/src/models/view_data_store.d.ts.map +1 -1
- package/dist/types/src/models/view_metadata_query_result.d.ts +1 -1
- package/dist/types/src/models/view_metadata_query_result.d.ts.map +1 -1
- package/dist/types/src/private_utils.d.ts +30 -1
- package/dist/types/src/private_utils.d.ts.map +1 -1
- package/dist/types/src/sdk.d.ts.map +1 -1
- package/dist/types/src/testing/{mock_airtable_interface.d.ts → abstract_mock_airtable_interface.d.ts} +20 -15
- package/dist/types/src/testing/abstract_mock_airtable_interface.d.ts.map +1 -0
- package/dist/types/src/types/airtable_interface.d.ts +45 -21
- package/dist/types/src/types/airtable_interface.d.ts.map +1 -1
- package/dist/types/src/types/block_query_spec.d.ts +139 -0
- package/dist/types/src/types/block_query_spec.d.ts.map +1 -0
- package/dist/types/src/types/field.d.ts +167 -51
- package/dist/types/src/types/field.d.ts.map +1 -1
- package/dist/types/src/types/mutations.d.ts +46 -3
- package/dist/types/src/types/mutations.d.ts.map +1 -1
- package/dist/types/src/types/table.d.ts +0 -2
- package/dist/types/src/types/table.d.ts.map +1 -1
- package/dist/types/src/types/view.d.ts +3 -8
- package/dist/types/src/types/view.d.ts.map +1 -1
- package/dist/types/src/ui/icon_config.d.ts +7 -3
- package/dist/types/src/ui/icon_config.d.ts.map +1 -1
- package/dist/types/src/ui/link.d.ts +1 -1
- package/dist/types/src/ui/link.d.ts.map +1 -1
- package/dist/types/src/ui/use_global_config.d.ts +1 -1
- package/dist/types/src/unstable_testing_utils.d.ts +1 -1
- package/dist/types/src/unstable_testing_utils.d.ts.map +1 -1
- package/dist/types/src/watchable.d.ts.map +1 -1
- package/dist/types/stories/helpers/fake_cell_renderer.d.ts.map +1 -1
- package/dist/types/stories/helpers/field_type.d.ts.map +1 -1
- package/dist/types/stories/helpers/sync_source_options.d.ts +7 -0
- package/dist/types/stories/helpers/sync_source_options.d.ts.map +1 -0
- package/dist/types/test/airtable_interface_mocks/fixture_data.d.ts +121 -0
- package/dist/types/test/airtable_interface_mocks/fixture_data.d.ts.map +1 -0
- package/dist/types/test/airtable_interface_mocks/linked_records.d.ts +2 -2
- package/dist/types/test/airtable_interface_mocks/linked_records.d.ts.map +1 -1
- package/dist/types/test/airtable_interface_mocks/{mock_airtable_interface_internal.d.ts → mock_airtable_interface.d.ts} +26 -18
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface.d.ts.map +1 -0
- package/dist/types/test/airtable_interface_mocks/mock_base_data_stores.d.ts +51 -0
- package/dist/types/test/airtable_interface_mocks/mock_base_data_stores.d.ts.map +1 -0
- package/dist/types/test/airtable_interface_mocks/project_tracker.d.ts +2 -2
- package/dist/types/test/airtable_interface_mocks/project_tracker.d.ts.map +1 -1
- package/dist/types/test/test_helpers.d.ts +2 -0
- package/dist/types/test/test_helpers.d.ts.map +1 -1
- package/package.json +3 -1
- package/dist/types/src/testing/mock_airtable_interface.d.ts.map +0 -1
- package/dist/types/test/airtable_interface_mocks/mock_airtable_interface_internal.d.ts.map +0 -1
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { ObjectMap } from '../private_utils';
|
|
2
|
+
import { TableId } from './table';
|
|
3
|
+
import { ViewId } from './view';
|
|
4
|
+
import { RecordId } from './record';
|
|
5
|
+
import { FieldId } from './field';
|
|
6
|
+
/**
|
|
7
|
+
* Specification for data needed by both the Blocks SDK and the blocks iframe
|
|
8
|
+
* that spans across a few repos and run environments:
|
|
9
|
+
* +--------------------+--------------------+--------------------+
|
|
10
|
+
* | airtable.com | blocks iframe | blocks sdk |
|
|
11
|
+
* +--------------------+--------------------+--------------------+
|
|
12
|
+
* | repo: hyperbase | repo: hyperbase | repo: blocks-sdk |
|
|
13
|
+
* | run: airtable.com | run: iframe | run: iframe |
|
|
14
|
+
* +--------------------+--------------------+--------------------+
|
|
15
|
+
*
|
|
16
|
+
* A BlockQuerySpec has a required `source` and one or more `selection`s.
|
|
17
|
+
* The `source` is a top-level concept that defines where the data comes
|
|
18
|
+
* from, while the `selection`s define desired properties from the data.
|
|
19
|
+
* In other words, think of the data as a tree, the `source` defines the
|
|
20
|
+
* root, and the `selection`s define the branches and leaves.
|
|
21
|
+
*
|
|
22
|
+
* Note that instead of a sub-object `source`, we use `source`-prefixed
|
|
23
|
+
* properties for the same effect. This works around a TypeScript limitation
|
|
24
|
+
* of not being able to discriminate between the unions for BlockQuerySpec.
|
|
25
|
+
*
|
|
26
|
+
* The specification will be used for two parts of the data lifecycle:
|
|
27
|
+
* 1. An initial response, via BlockQuerySpecResponseForAirtableInterface
|
|
28
|
+
* 2. Subsequent updates to keep the date updated, via BlockQueryUpdate
|
|
29
|
+
*
|
|
30
|
+
* NOTE: Keep this in sync with the hyperbase repo's block_query_spec.tsx file!
|
|
31
|
+
*
|
|
32
|
+
* @hidden
|
|
33
|
+
*/
|
|
34
|
+
export declare type BlockQuerySpec = BlockTableQuerySpec | BlockViewQuerySpec;
|
|
35
|
+
/** @hidden */
|
|
36
|
+
export interface BlockTableQuerySpec {
|
|
37
|
+
sourceType: BlockQuerySourceType.TABLE;
|
|
38
|
+
sourceTableId: TableId;
|
|
39
|
+
recordSelection: BlockRecordSelectionSpec;
|
|
40
|
+
}
|
|
41
|
+
/** @hidden */
|
|
42
|
+
export interface BlockViewQuerySpec {
|
|
43
|
+
sourceType: BlockQuerySourceType.VIEW;
|
|
44
|
+
sourceTableId: TableId;
|
|
45
|
+
sourceViewId: ViewId;
|
|
46
|
+
recordSelection?: BlockRecordSelectionSpec;
|
|
47
|
+
viewMetadataSelection?: BlockViewMetadataSelectionSpec;
|
|
48
|
+
}
|
|
49
|
+
/** @hidden */
|
|
50
|
+
export declare enum BlockQuerySourceType {
|
|
51
|
+
TABLE = "table",
|
|
52
|
+
VIEW = "view"
|
|
53
|
+
}
|
|
54
|
+
/** @hidden */
|
|
55
|
+
export interface BlockRecordSelectionSpec {
|
|
56
|
+
readonly fieldSelection: BlockFieldSelectionSpec;
|
|
57
|
+
/** Optionally filter down to more specific recordIds from the source */
|
|
58
|
+
readonly recordIds?: Array<RecordId>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The different ways fields can be queried
|
|
62
|
+
*
|
|
63
|
+
* @hidden
|
|
64
|
+
*/
|
|
65
|
+
export declare enum BlockFieldSelectionSpecType {
|
|
66
|
+
SPECIFIED_FIELDS = "specifiedFields",
|
|
67
|
+
ALL_FIELDS_FROM_TABLE = "allFieldsFromTable"
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Allows querying for all fields, or a specified set of fields. In the latter
|
|
71
|
+
* case, we also allow specifying properties of a record like commentCount and
|
|
72
|
+
* recordCreatedTime that don't have fieldIds (ALL_FIELDS implies including all
|
|
73
|
+
* of these properties).
|
|
74
|
+
*
|
|
75
|
+
* @hidden
|
|
76
|
+
*/
|
|
77
|
+
export declare type BlockFieldSelectionSpec = {
|
|
78
|
+
readonly type: BlockFieldSelectionSpecType.SPECIFIED_FIELDS;
|
|
79
|
+
readonly fieldIds: Array<FieldId>;
|
|
80
|
+
readonly shouldIncludeCommentCount?: boolean;
|
|
81
|
+
readonly shouldIncludeRecordCreatedTime?: boolean;
|
|
82
|
+
} | {
|
|
83
|
+
readonly type: BlockFieldSelectionSpecType.ALL_FIELDS_FROM_TABLE;
|
|
84
|
+
};
|
|
85
|
+
/** @hidden */
|
|
86
|
+
export interface BlockViewMetadataSelectionSpec {
|
|
87
|
+
readonly shouldIncludeVisibleRecordIds?: boolean;
|
|
88
|
+
readonly shouldIncludeFieldOrder?: boolean;
|
|
89
|
+
readonly shouldIncludeGroups?: boolean;
|
|
90
|
+
readonly shouldIncludeGroupingLevels?: boolean;
|
|
91
|
+
readonly shouldIncludeColorsForRecordId?: boolean;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Response recieved from an executed query.
|
|
95
|
+
*
|
|
96
|
+
* @hidden
|
|
97
|
+
*/
|
|
98
|
+
export declare type QuerySpecsResponse = {
|
|
99
|
+
readonly success: true;
|
|
100
|
+
readonly blockQueryId: BlockQueryId;
|
|
101
|
+
} | {
|
|
102
|
+
readonly success: false;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* An id returned from airtable for an active and executing query. If two queries sent
|
|
106
|
+
* to airtable return the same queryId this means the queries are semantically the same.
|
|
107
|
+
* It is however possible for two canonically identical queries to be tracked via two
|
|
108
|
+
* separate blockQueryIds (in the case realtime subscriptions are made with different
|
|
109
|
+
* callbacks).
|
|
110
|
+
*
|
|
111
|
+
* @hidden
|
|
112
|
+
*/
|
|
113
|
+
export declare type BlockQueryId = string;
|
|
114
|
+
/** @hidden */
|
|
115
|
+
export declare enum BlockQuerySubscriptionChangeType {
|
|
116
|
+
ADDED_RECORD_IDS = "addedRecordIds",
|
|
117
|
+
REMOVED_RECORD_IDS = "removedRecordIds",
|
|
118
|
+
MODIFIED_CELL_VALUES_FOR_TABLE = "modifiedCellValuesForTable",
|
|
119
|
+
CHANGED_COLORS_BY_RECORD_ID_FOR_VIEW = "changedColorsByRecordIdForView"
|
|
120
|
+
}
|
|
121
|
+
/** @hidden */
|
|
122
|
+
export declare type BlockQuerySubscriptionChange = {
|
|
123
|
+
type: BlockQuerySubscriptionChangeType.ADDED_RECORD_IDS | BlockQuerySubscriptionChangeType.REMOVED_RECORD_IDS;
|
|
124
|
+
tableId: TableId;
|
|
125
|
+
recordIds: Array<RecordId>;
|
|
126
|
+
} | {
|
|
127
|
+
type: BlockQuerySubscriptionChangeType.MODIFIED_CELL_VALUES_FOR_TABLE;
|
|
128
|
+
tableId: TableId;
|
|
129
|
+
fieldIdsByRecordId: ObjectMap<RecordId, Array<FieldId>>;
|
|
130
|
+
fieldIds: Array<FieldId>;
|
|
131
|
+
} | {
|
|
132
|
+
type: BlockQuerySubscriptionChangeType.CHANGED_COLORS_BY_RECORD_ID_FOR_VIEW;
|
|
133
|
+
tableId: TableId;
|
|
134
|
+
viewId: ViewId;
|
|
135
|
+
recordIds: Array<RecordId>;
|
|
136
|
+
};
|
|
137
|
+
/** @hidden */
|
|
138
|
+
export declare type BlockQuerySubscriptionOnChangeCallback = (changes: Array<BlockQuerySubscriptionChange>) => void;
|
|
139
|
+
//# sourceMappingURL=block_query_spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block_query_spec.d.ts","sourceRoot":"","sources":["../../../../src/types/block_query_spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAO,EAAC,MAAM,EAAC,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAC,QAAQ,EAAC,MAAM,UAAU,CAAC;AAClC,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,oBAAY,cAAc,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;AACtE,cAAc;AACd,MAAM,WAAW,mBAAmB;IAChC,UAAU,EAAE,oBAAoB,CAAC,KAAK,CAAC;IACvC,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,wBAAwB,CAAC;CAC7C;AACD,cAAc;AACd,MAAM,WAAW,kBAAkB;IAC/B,UA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AC,OAAO,EAAE,IAAI,CAAC;IACvB,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;CACvC,GACD;IACI,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;CAC3B,CAAC;AAER;;;;;;;;GAQG;AACH,oBAAY,YAAY,GAAG,MAAM,CAAC;AAElC,cAAc;AACd,oBAAY,gCAAgC;IACxC,gBAAgB,mBAAmB;IACnC,kBAAkB,qBAAqB;IACvC,8BAA8B,+BAA+B;IAC7D,oCAAoC,mCAAmC;CAC1E;AAED,cAAc;AACd,oBAAY,4BAA4B,GAClC;IAII,IAAI,EACE,gCAAgC,CAAC,gBAAgB,GACjD,gCAAgC,CAAC,kBAAkB,CAAC;IAC1D,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;CAC9B,GACD;IAGI,IAAI,EAAE,gCAAgC,CAAC,8BAA8B,CAAC;IACtE,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,EAAE,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACxD,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;CAC5B,GACD;IACI,IAAI,EAAE,gCAAgC,CAAC,oCAAoC,CAAC;IAC5E,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;CAC9B,CAAC;AAER,cAAc;AACd,oBAAY,sCAAsC,GAAG,CACjD,OAAO,EAAE,KAAK,CAAC,4BAA4B,CAAC,KAC3C,IAAI,CAAC"}
|
|
@@ -137,7 +137,7 @@ export declare enum FieldType {
|
|
|
137
137
|
* color?: Color
|
|
138
138
|
* }
|
|
139
139
|
* ```
|
|
140
|
-
* The currently selected
|
|
140
|
+
* The currently selected choice.
|
|
141
141
|
*
|
|
142
142
|
* **Cell write format**
|
|
143
143
|
* ```js
|
|
@@ -170,9 +170,10 @@ export declare enum FieldType {
|
|
|
170
170
|
* >,
|
|
171
171
|
* }
|
|
172
172
|
* ```
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
173
|
+
* The default behavior of calling `updateOptionsAsync` on a `SINGLE_SELECT` field allows
|
|
174
|
+
* choices to be added or updated, but not deleted. Therefore, you should pass all pre-existing
|
|
175
|
+
* choices in `choices` (similar to updating a `MULTIPLE_SELECTS` field type cell value). You can
|
|
176
|
+
* do this by spreading the current choices:
|
|
176
177
|
* ```js
|
|
177
178
|
* const selectField = table.getFieldByName('My select field');
|
|
178
179
|
* await selectField.updateOptionsAsync({
|
|
@@ -180,7 +181,22 @@ export declare enum FieldType {
|
|
|
180
181
|
* ...selectField.options.choices,
|
|
181
182
|
* {name: 'My new choice'},
|
|
182
183
|
* ],
|
|
183
|
-
* })
|
|
184
|
+
* });
|
|
185
|
+
*
|
|
186
|
+
* ```
|
|
187
|
+
*
|
|
188
|
+
* If you want to allow choices to be deleted, you can pass an object with
|
|
189
|
+
* `enableSelectFieldChoiceDeletion: true` as the second argument. By passing this argument,
|
|
190
|
+
* any existing choices which are not passed again via `choices` will be deleted, and any
|
|
191
|
+
* cells which referenced a now-deleted choice will be cleared.
|
|
192
|
+
* ```js
|
|
193
|
+
* const selectField = table.getFieldByName('My select field');
|
|
194
|
+
* await selectField.updateOptionsAsync(
|
|
195
|
+
* {
|
|
196
|
+
* choices: selectField.options.choices.filter((choice) => choice.name !== 'Choice to delete'),
|
|
197
|
+
* },
|
|
198
|
+
* {enableSelectFieldChoiceDeletion: true},
|
|
199
|
+
* );
|
|
184
200
|
*
|
|
185
201
|
* ```
|
|
186
202
|
*/
|
|
@@ -228,9 +244,10 @@ export declare enum FieldType {
|
|
|
228
244
|
* >,
|
|
229
245
|
* }
|
|
230
246
|
* ```
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
247
|
+
* The default behavior of calling `updateOptionsAsync` on a `MULTIPLE_SELECTS` field allows
|
|
248
|
+
* choices to be added or updated, but not deleted. Therefore, you should pass all pre-existing
|
|
249
|
+
* choices in `choices` (similar to updating a `SINGLE_SELECT` field type cell value). You can
|
|
250
|
+
* do this by spreading the current choices:
|
|
234
251
|
* ```js
|
|
235
252
|
* const multipleSelectField = table.getFieldByName('My multiple select field');
|
|
236
253
|
* await multipleSelectField.updateOptionsAsync({
|
|
@@ -238,7 +255,22 @@ export declare enum FieldType {
|
|
|
238
255
|
* ...multipleSelectField.options.choices,
|
|
239
256
|
* {name: 'My new choice'},
|
|
240
257
|
* ],
|
|
241
|
-
* })
|
|
258
|
+
* });
|
|
259
|
+
*
|
|
260
|
+
* ```
|
|
261
|
+
*
|
|
262
|
+
* If you want to allow choices to be deleted, you can pass an object with
|
|
263
|
+
* `enableSelectFieldChoiceDeletion: true` as the second argument. By passing this argument,
|
|
264
|
+
* any existing choices which are not passed again via `choices` will be deleted, and any
|
|
265
|
+
* cells which referenced a now-deleted choice will be cleared.
|
|
266
|
+
* ```js
|
|
267
|
+
* const multipleSelectField = table.getFieldByName('My multiple select field');
|
|
268
|
+
* await multipleSelectField.updateOptionsAsync(
|
|
269
|
+
* {
|
|
270
|
+
* choices: multipleSelectField.options.choices.filter((choice) => choice.name !== 'Choice to delete'),
|
|
271
|
+
* },
|
|
272
|
+
* {enableSelectFieldChoiceDeletion: true},
|
|
273
|
+
* );
|
|
242
274
|
*
|
|
243
275
|
* ```
|
|
244
276
|
*/
|
|
@@ -343,7 +375,7 @@ export declare enum FieldType {
|
|
|
343
375
|
* ...myRecord.getCellValue('myLinkedRecordField'),
|
|
344
376
|
* { id: newForeignRecordIdToLink }
|
|
345
377
|
* ]
|
|
346
|
-
* })
|
|
378
|
+
* });
|
|
347
379
|
* ```
|
|
348
380
|
*
|
|
349
381
|
* Similarly, you can clear the current cell value by passing an empty array, or
|
|
@@ -379,6 +411,11 @@ export declare enum FieldType {
|
|
|
379
411
|
* // Airtable UI (i.e. most recent first)
|
|
380
412
|
* // You generally do not need to rely on this option.
|
|
381
413
|
* isReversed: boolean,
|
|
414
|
+
* // Whether this field prefers to only have a single linked record. While this preference
|
|
415
|
+
* // is enforced in the Airtable UI, it is possible for a field that prefers single linked
|
|
416
|
+
* // records to have multiple record links (for example, via copy-and-paste or programmatic
|
|
417
|
+
* // updates).
|
|
418
|
+
* prefersSingleRecordLink: boolean,
|
|
382
419
|
* }
|
|
383
420
|
* ```
|
|
384
421
|
*
|
|
@@ -390,6 +427,8 @@ export declare enum FieldType {
|
|
|
390
427
|
* // The ID of the view in the linked table to use when showing
|
|
391
428
|
* // a list of records to select from
|
|
392
429
|
* viewIdForRecordSelection?: ViewId,
|
|
430
|
+
* // Note: prefersSingleRecordLink cannot be specified via programmatic field creation
|
|
431
|
+
* // and will be false for fields created within an app
|
|
393
432
|
* }
|
|
394
433
|
* ```
|
|
395
434
|
*
|
|
@@ -421,22 +460,25 @@ export declare enum FieldType {
|
|
|
421
460
|
* **Field options read format**
|
|
422
461
|
* ```js
|
|
423
462
|
* {
|
|
424
|
-
* dateFormat:
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
*
|
|
428
|
-
*
|
|
463
|
+
* dateFormat:
|
|
464
|
+
* | {name: 'local', format: 'l'}
|
|
465
|
+
* | {name: 'friendly', format: 'LL'}
|
|
466
|
+
* | {name: 'us', format: 'M/D/YYYY'}
|
|
467
|
+
* | {name: 'european', format: 'D/M/YYYY'}
|
|
468
|
+
* | {name: 'iso', format: 'YYYY-MM-DD'}
|
|
429
469
|
* }
|
|
430
470
|
* ```
|
|
431
471
|
*
|
|
432
472
|
* **Field options write format**
|
|
433
473
|
* ```js
|
|
434
474
|
* {
|
|
435
|
-
* dateFormat:
|
|
436
|
-
*
|
|
437
|
-
*
|
|
438
|
-
*
|
|
439
|
-
*
|
|
475
|
+
* dateFormat:
|
|
476
|
+
* // Format is optional, but must match name if provided.
|
|
477
|
+
* | {name: 'local', format?: 'l'}
|
|
478
|
+
* | {name: 'friendly', format?: 'LL'}
|
|
479
|
+
* | {name: 'us', format?: 'M/D/YYYY'}
|
|
480
|
+
* | {name: 'european', format?: 'D/M/YYYY'}
|
|
481
|
+
* | {name: 'iso', format?: 'YYYY-MM-DD'}
|
|
440
482
|
* }
|
|
441
483
|
* ```
|
|
442
484
|
*/
|
|
@@ -465,16 +507,15 @@ export declare enum FieldType {
|
|
|
465
507
|
* **Field options read format**
|
|
466
508
|
* ```js
|
|
467
509
|
* {
|
|
468
|
-
* dateFormat:
|
|
469
|
-
*
|
|
470
|
-
*
|
|
471
|
-
*
|
|
472
|
-
*
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
*
|
|
476
|
-
*
|
|
477
|
-
* },
|
|
510
|
+
* dateFormat:
|
|
511
|
+
* | {name: 'local', format: 'l'}
|
|
512
|
+
* | {name: 'friendly', format: 'LL'}
|
|
513
|
+
* | {name: 'us', format: 'M/D/YYYY'}
|
|
514
|
+
* | {name: 'european', format: 'D/M/YYYY'}
|
|
515
|
+
* | {name: 'iso', format: 'YYYY-MM-DD'},
|
|
516
|
+
* timeFormat:
|
|
517
|
+
* | {name: '12hour', format: 'h:mma'}
|
|
518
|
+
* | {name: '24hour', format: 'HH:mm'},
|
|
478
519
|
* timeZone: 'utc' | 'client',
|
|
479
520
|
* }
|
|
480
521
|
* ```
|
|
@@ -482,16 +523,17 @@ export declare enum FieldType {
|
|
|
482
523
|
* **Field options write format**
|
|
483
524
|
* ```js
|
|
484
525
|
* {
|
|
485
|
-
* dateFormat:
|
|
486
|
-
*
|
|
487
|
-
*
|
|
488
|
-
*
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
*
|
|
493
|
-
*
|
|
494
|
-
*
|
|
526
|
+
* dateFormat:
|
|
527
|
+
* // Format is optional, but must match name if provided.
|
|
528
|
+
* | {name: 'local', format?: 'l'}
|
|
529
|
+
* | {name: 'friendly', format?: 'LL'}
|
|
530
|
+
* | {name: 'us', format?: 'M/D/YYYY'}
|
|
531
|
+
* | {name: 'european', format?: 'D/M/YYYY'}
|
|
532
|
+
* | {name: 'iso', format?: 'YYYY-MM-DD'},
|
|
533
|
+
* timeFormat:
|
|
534
|
+
* // Format is optional, but must match name if provided.
|
|
535
|
+
* | {name: '12hour', format?: 'h:mma'}
|
|
536
|
+
* | {name: '24hour', format?: 'HH:mm'},
|
|
495
537
|
* timeZone: 'utc' | 'client',
|
|
496
538
|
* }
|
|
497
539
|
* ```
|
|
@@ -523,7 +565,7 @@ export declare enum FieldType {
|
|
|
523
565
|
* ...myRecord.getCellValue('myAttachmentField'),
|
|
524
566
|
* { url: newAttachmentUrl }
|
|
525
567
|
* ]
|
|
526
|
-
* })
|
|
568
|
+
* });
|
|
527
569
|
* ```
|
|
528
570
|
*
|
|
529
571
|
* Similarly, you can clear the current cell value by passing an empty array, or
|
|
@@ -531,7 +573,13 @@ export declare enum FieldType {
|
|
|
531
573
|
* value.
|
|
532
574
|
*
|
|
533
575
|
* Note: when you pass an existing attachment, you must pass the full attachment
|
|
534
|
-
* object. New attachments only require the `url` property.
|
|
576
|
+
* object. New attachments only require the `url` property. You can optionally
|
|
577
|
+
* pass the \`filename\` property to give it a readable name.
|
|
578
|
+
*
|
|
579
|
+
* Additionally, the Airtable generated attachment URLs do not currently expire,
|
|
580
|
+
* but this will change in the future. If you want to persist the attachments, we
|
|
581
|
+
* recommend downloading them instead of saving the URL. Before this change is
|
|
582
|
+
* rolled out, we will post a more detailed deprecation timeline.
|
|
535
583
|
*
|
|
536
584
|
* **Cell read format**
|
|
537
585
|
* ```js
|
|
@@ -600,11 +648,19 @@ export declare enum FieldType {
|
|
|
600
648
|
/**
|
|
601
649
|
* A checkbox.
|
|
602
650
|
*
|
|
603
|
-
* This field is "true" when checked and
|
|
651
|
+
* This field is "true" when checked and "null" when unchecked.
|
|
604
652
|
*
|
|
605
|
-
* **Cell format**
|
|
653
|
+
* **Cell read format**
|
|
606
654
|
* ```js
|
|
607
|
-
*
|
|
655
|
+
* true | null
|
|
656
|
+
* ```
|
|
657
|
+
*
|
|
658
|
+
* You can write to the cell with "false", but the read value will be still be "null"
|
|
659
|
+
* (unchecked).
|
|
660
|
+
*
|
|
661
|
+
* **Cell write format**
|
|
662
|
+
* ```js
|
|
663
|
+
* boolean | null
|
|
608
664
|
* ```
|
|
609
665
|
*
|
|
610
666
|
* **Field options**
|
|
@@ -1043,7 +1099,43 @@ export declare enum FieldType {
|
|
|
1043
1099
|
* Creating or updating `BUTTON` fields is not supported.
|
|
1044
1100
|
*
|
|
1045
1101
|
*/
|
|
1046
|
-
BUTTON = "button"
|
|
1102
|
+
BUTTON = "button",
|
|
1103
|
+
/**
|
|
1104
|
+
* Shows the name of the source that a record is synced from. This field is only available on
|
|
1105
|
+
* synced tables.
|
|
1106
|
+
*
|
|
1107
|
+
* **Cell read format**
|
|
1108
|
+
* ```js
|
|
1109
|
+
* {
|
|
1110
|
+
* id: string,
|
|
1111
|
+
* name: string,
|
|
1112
|
+
* color?: Color
|
|
1113
|
+
* }
|
|
1114
|
+
* ```
|
|
1115
|
+
*
|
|
1116
|
+
* **Cell write format**
|
|
1117
|
+
*
|
|
1118
|
+
* n/a
|
|
1119
|
+
*
|
|
1120
|
+
* **Field options read format**
|
|
1121
|
+
* ```js
|
|
1122
|
+
* {
|
|
1123
|
+
* choices: Array<{
|
|
1124
|
+
* id: string,
|
|
1125
|
+
* name: string,
|
|
1126
|
+
* color?: {@link Color}, // Color is not provided when field coloring is disabled.
|
|
1127
|
+
* }>,
|
|
1128
|
+
* }
|
|
1129
|
+
* ```
|
|
1130
|
+
* Every choice represents a sync source, and choices are added or removed automatically as
|
|
1131
|
+
* sync sources are added or removed. Choice names and colors are user-configurable.
|
|
1132
|
+
*
|
|
1133
|
+
* **Field options write format**
|
|
1134
|
+
*
|
|
1135
|
+
* Creating or updating `EXTERNAL_SYNC_SOURCE` fields is not supported.
|
|
1136
|
+
*
|
|
1137
|
+
*/
|
|
1138
|
+
EXTERNAL_SYNC_SOURCE = "externalSyncSource"
|
|
1047
1139
|
}
|
|
1048
1140
|
/** @hidden */
|
|
1049
1141
|
export declare type FieldLock = unknown;
|
|
@@ -1100,19 +1192,35 @@ interface LinkedRecordFieldOptions {
|
|
|
1100
1192
|
inverseLinkFieldId?: FieldId;
|
|
1101
1193
|
viewIdForRecordSelection?: ViewId;
|
|
1102
1194
|
isReversed: boolean;
|
|
1195
|
+
prefersSingleRecordLink: boolean;
|
|
1103
1196
|
}
|
|
1104
1197
|
/** @hidden */
|
|
1105
1198
|
interface DateFieldOptions {
|
|
1106
1199
|
dateFormat: {
|
|
1107
|
-
name: 'local'
|
|
1108
|
-
format: 'l'
|
|
1200
|
+
name: 'local';
|
|
1201
|
+
format: 'l';
|
|
1202
|
+
} | {
|
|
1203
|
+
name: 'friendly';
|
|
1204
|
+
format: 'LL';
|
|
1205
|
+
} | {
|
|
1206
|
+
name: 'us';
|
|
1207
|
+
format: 'M/D/YYYY';
|
|
1208
|
+
} | {
|
|
1209
|
+
name: 'european';
|
|
1210
|
+
format: 'D/M/YYYY';
|
|
1211
|
+
} | {
|
|
1212
|
+
name: 'iso';
|
|
1213
|
+
format: 'YYYY-MM-DD';
|
|
1109
1214
|
};
|
|
1110
1215
|
}
|
|
1111
1216
|
/** @hidden */
|
|
1112
1217
|
interface DateTimeFieldOptions extends DateFieldOptions {
|
|
1113
1218
|
timeFormat: {
|
|
1114
|
-
name: '12hour'
|
|
1115
|
-
format: 'h:mma'
|
|
1219
|
+
name: '12hour';
|
|
1220
|
+
format: 'h:mma';
|
|
1221
|
+
} | {
|
|
1222
|
+
name: '24hour';
|
|
1223
|
+
format: 'HH:mm';
|
|
1116
1224
|
};
|
|
1117
1225
|
timeZone: 'utc' | 'client';
|
|
1118
1226
|
}
|
|
@@ -1181,6 +1289,9 @@ interface LastModifiedByFieldOptions extends CreatedByFieldOptions {
|
|
|
1181
1289
|
referencedFieldIds: Array<FieldId>;
|
|
1182
1290
|
}
|
|
1183
1291
|
/** @hidden */
|
|
1292
|
+
interface ExternalSyncSourceFieldOptions extends SelectFieldOptions {
|
|
1293
|
+
}
|
|
1294
|
+
/** @hidden */
|
|
1184
1295
|
interface OptionlessFieldConfig {
|
|
1185
1296
|
type: FieldType.SINGLE_LINE_TEXT | FieldType.EMAIL | FieldType.URL | FieldType.MULTILINE_TEXT | FieldType.PHONE_NUMBER | FieldType.AUTO_NUMBER | FieldType.BARCODE | FieldType.RICH_TEXT | FieldType.BUTTON;
|
|
1186
1297
|
options: null;
|
|
@@ -1280,6 +1391,11 @@ interface LastModifiedByFieldConfig {
|
|
|
1280
1391
|
type: FieldType.LAST_MODIFIED_BY;
|
|
1281
1392
|
options: LastModifiedByFieldOptions;
|
|
1282
1393
|
}
|
|
1394
|
+
/** @hidden */
|
|
1395
|
+
interface ExternalSyncSourceFieldConfig {
|
|
1396
|
+
type: FieldType.EXTERNAL_SYNC_SOURCE;
|
|
1397
|
+
options: ExternalSyncSourceFieldOptions;
|
|
1398
|
+
}
|
|
1283
1399
|
/**
|
|
1284
1400
|
* A type for use with Field objects to make type narrowing FieldOptions easier.
|
|
1285
1401
|
*
|
|
@@ -1294,6 +1410,6 @@ interface LastModifiedByFieldConfig {
|
|
|
1294
1410
|
* }
|
|
1295
1411
|
* return DEFAULT_CHOICES;
|
|
1296
1412
|
*/
|
|
1297
|
-
export declare type FieldConfig = OptionlessFieldConfig | NumericFieldConfig | CurrencyFieldConfig | SelectFieldConfig | CollaboratorFieldConfig | LinkedRecordFieldConfig | DateFieldConfig | DateTimeFieldConfig | AttachmentsFieldConfig | CheckboxFieldConfig | FormulaFieldConfig | CreatedTimeFieldConfig | RollupFieldConfig | CountFieldConfig | LookupFieldConfig | RatingFieldConfig | DurationFieldConfig | LastModifiedTimeFieldConfig | CreatedByFieldConfig | LastModifiedByFieldConfig;
|
|
1413
|
+
export declare type FieldConfig = OptionlessFieldConfig | NumericFieldConfig | CurrencyFieldConfig | SelectFieldConfig | CollaboratorFieldConfig | LinkedRecordFieldConfig | DateFieldConfig | DateTimeFieldConfig | AttachmentsFieldConfig | CheckboxFieldConfig | FormulaFieldConfig | CreatedTimeFieldConfig | RollupFieldConfig | CountFieldConfig | LookupFieldConfig | RatingFieldConfig | DurationFieldConfig | LastModifiedTimeFieldConfig | CreatedByFieldConfig | LastModifiedByFieldConfig | ExternalSyncSourceFieldConfig;
|
|
1298
1414
|
export {};
|
|
1299
1415
|
//# sourceMappingURL=field.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../src/types/field.ts"],"names":[],"mappings":"AAAA,6CAA6C,CAAC,MAAM;AACpD,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAO,EAAC,MAAM,EAAC,MAAM,QAAQ,CAAC;AAE9B,MAAM;AACN,oBAAY,OAAO,GAAG,MAAM,CAAC;AAC7B,cAAc;AACd,oBAAY,iBAAiB,GAAG,MAAM,CAAC;AAEvC;;;;;;;;;;GAUG;AACH,oBAAY,SAAS;IACjB;;;;;;;;;;;OAWG;IACH,gBAAgB,mBAAmB;IACnC;;;;;;;;;;;OAWG;IACH,KAAK,UAAU;IACf;;;;;;;;;;;OAWG;IACH,GAAG,QAAQ;IACX;;;;;;;;;;;;OAYG;IACH,cAAc,kBAAkB;IAChC;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,WAAW;IACjB;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,YAAY;IACnB;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,aAAa;IACrB
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../src/types/field.ts"],"names":[],"mappings":"AAAA,6CAA6C,CAAC,MAAM;AACpD,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAChC,OAAO,EAAC,MAAM,EAAC,MAAM,QAAQ,CAA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BAAkB,CAAC;IACnC,OAAO,EAAE,4BAA4B,CAAC;CACzC;AAED,cAAc;AACd,UAAU,oBAAoB;IAC1B,IAAI,EAAE,SAAS,CAAC,UAAU,CAAC;IAC3B,OAAO,EAAE,qBAAqB,CAAC;CAClC;AAED,cAAc;AACd,UAAU,yBAAyB;IAC/B,IAAI,EAAE,SAAS,CAAC,gBAAgB,CAAC;IACjC,OAAO,EAAE,0BAA0B,CAAC;CACvC;AAED,cAAc;AACd,UAAU,6BAA6B;IACnC,IAAI,EAAE,SAAS,CAAC,oBAAoB,CAAC;IACrC,OAAO,EAAE,8BAA8B,CAAC;CAC3C;AAED;;;;;;;;;;;;;GAaG;AACH,oBAAY,WAAW,GACjB,qBAAqB,GACrB,kBAAkB,GAClB,mBAAmB,GACnB,iBAAiB,GACjB,uBAAuB,GACvB,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,sBAAsB,GACtB,mBAAmB,GACnB,kBAAkB,GAClB,sBAAsB,GACtB,iBAAiB,GACjB,gBAAgB,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,GACnB,2BAA2B,GAC3B,oBAAoB,GACpB,yBAAyB,GACzB,6BAA6B,CAAC"}
|
|
@@ -14,6 +14,7 @@ export declare const MutationTypes: Readonly<{
|
|
|
14
14
|
SET_MULTIPLE_GLOBAL_CONFIG_PATHS: "setMultipleGlobalConfigPaths";
|
|
15
15
|
CREATE_SINGLE_FIELD: "createSingleField";
|
|
16
16
|
UPDATE_SINGLE_FIELD_CONFIG: "updateSingleFieldConfig";
|
|
17
|
+
UPDATE_SINGLE_FIELD_DESCRIPTION: "updateSingleFieldDescription";
|
|
17
18
|
CREATE_SINGLE_TABLE: "createSingleTable";
|
|
18
19
|
UPDATE_VIEW_METADATA: "updateViewMetadata";
|
|
19
20
|
}>;
|
|
@@ -124,6 +125,8 @@ export interface CreateSingleFieldMutation {
|
|
|
124
125
|
readonly name: string;
|
|
125
126
|
/** The configuration for the Field being created */
|
|
126
127
|
readonly config: FieldTypeConfig;
|
|
128
|
+
/** The description for the Field being created */
|
|
129
|
+
readonly description: string | null;
|
|
127
130
|
}
|
|
128
131
|
/** @hidden */
|
|
129
132
|
export interface PartialCreateSingleFieldMutation {
|
|
@@ -132,9 +135,10 @@ export interface PartialCreateSingleFieldMutation {
|
|
|
132
135
|
readonly id: FieldId | undefined;
|
|
133
136
|
readonly name: string | undefined;
|
|
134
137
|
readonly config: FieldTypeConfig | undefined;
|
|
138
|
+
readonly description: string | null | undefined;
|
|
135
139
|
}
|
|
136
140
|
/**
|
|
137
|
-
* The Mutation emitted when the App modifies a {@link Field}.
|
|
141
|
+
* The Mutation emitted when the App modifies the options of a {@link Field}.
|
|
138
142
|
*
|
|
139
143
|
* @docsPath testing/mutations/UpdateSingleFieldConfigMutation
|
|
140
144
|
*/
|
|
@@ -147,6 +151,8 @@ export interface UpdateSingleFieldConfigMutation {
|
|
|
147
151
|
readonly id: FieldId;
|
|
148
152
|
/** The new configuration for the Field being modified */
|
|
149
153
|
readonly config: FieldTypeConfig;
|
|
154
|
+
/** Optional options to affect the behavior of the update */
|
|
155
|
+
readonly opts?: UpdateFieldOptionsOpts;
|
|
150
156
|
}
|
|
151
157
|
/** @hidden */
|
|
152
158
|
export interface PartialUpdateSingleFieldConfigMutation {
|
|
@@ -154,6 +160,41 @@ export interface PartialUpdateSingleFieldConfigMutation {
|
|
|
154
160
|
readonly tableId: TableId | undefined;
|
|
155
161
|
readonly id: FieldId | undefined;
|
|
156
162
|
readonly config: FieldTypeConfig | undefined;
|
|
163
|
+
readonly opts?: UpdateFieldOptionsOpts | undefined;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* The Mutation emitted when the App modifies the description of a {@link Field}.
|
|
167
|
+
*
|
|
168
|
+
* @docsPath testing/mutations/UpdateSingleFieldDescriptionMutation
|
|
169
|
+
*/
|
|
170
|
+
export interface UpdateSingleFieldDescriptionMutation {
|
|
171
|
+
/** This Mutation's [discriminant property](https://www.typescriptlang.org/docs/handbook/2/narrowing.html) */
|
|
172
|
+
readonly type: typeof MutationTypes.UPDATE_SINGLE_FIELD_DESCRIPTION;
|
|
173
|
+
/** The identifier for the Table in which a Field is being modified */
|
|
174
|
+
readonly tableId: TableId;
|
|
175
|
+
/** The identifier for the Field being modified */
|
|
176
|
+
readonly id: FieldId;
|
|
177
|
+
/** The new description for the Field being created */
|
|
178
|
+
readonly description: string | null;
|
|
179
|
+
}
|
|
180
|
+
/** @hidden */
|
|
181
|
+
export interface PartialUpdateSingleFieldDescriptionMutation {
|
|
182
|
+
readonly type: typeof MutationTypes.UPDATE_SINGLE_FIELD_DESCRIPTION;
|
|
183
|
+
readonly tableId: TableId | undefined;
|
|
184
|
+
readonly id: FieldId | undefined;
|
|
185
|
+
readonly description: string | null | undefined;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Options that affect the behavior of an `UpdateSingleFieldConfigMutation`
|
|
189
|
+
*/
|
|
190
|
+
export interface UpdateFieldOptionsOpts {
|
|
191
|
+
/**
|
|
192
|
+
* Allowing select field choices to be deleted is dangerous since any
|
|
193
|
+
* records which use that choice will lose their cell value. By default,
|
|
194
|
+
* calling `updateOptionsAsync` on a select field only allows choices to be
|
|
195
|
+
* added or modified. Passing this option will allow choices to be deleted.
|
|
196
|
+
*/
|
|
197
|
+
enableSelectFieldChoiceDeletion?: boolean;
|
|
157
198
|
}
|
|
158
199
|
/**
|
|
159
200
|
* The Mutation emitted when the App creates a {@link Table}
|
|
@@ -171,6 +212,7 @@ export interface CreateSingleTableMutation {
|
|
|
171
212
|
readonly fields: ReadonlyArray<{
|
|
172
213
|
name: string;
|
|
173
214
|
config: FieldTypeConfig;
|
|
215
|
+
description: string | null;
|
|
174
216
|
}>;
|
|
175
217
|
}
|
|
176
218
|
/** @hidden */
|
|
@@ -181,6 +223,7 @@ export interface PartialCreateSingleTableMutation {
|
|
|
181
223
|
readonly fields: ReadonlyArray<{
|
|
182
224
|
name: string | undefined;
|
|
183
225
|
config: FieldTypeConfig | undefined;
|
|
226
|
+
description: string | null | undefined;
|
|
184
227
|
}> | undefined;
|
|
185
228
|
}
|
|
186
229
|
/**
|
|
@@ -206,9 +249,9 @@ export interface PartialUpdateViewMetadataMutation {
|
|
|
206
249
|
readonly metadata: NormalizedViewMetadata | undefined;
|
|
207
250
|
}
|
|
208
251
|
/** @hidden */
|
|
209
|
-
export declare type Mutation = SetMultipleRecordsCellValuesMutation | DeleteMultipleRecordsMutation | CreateMultipleRecordsMutation | SetMultipleGlobalConfigPathsMutation | CreateSingleFieldMutation | UpdateSingleFieldConfigMutation | CreateSingleTableMutation | UpdateViewMetadataMutation;
|
|
252
|
+
export declare type Mutation = SetMultipleRecordsCellValuesMutation | DeleteMultipleRecordsMutation | CreateMultipleRecordsMutation | SetMultipleGlobalConfigPathsMutation | CreateSingleFieldMutation | UpdateSingleFieldConfigMutation | UpdateSingleFieldDescriptionMutation | CreateSingleTableMutation | UpdateViewMetadataMutation;
|
|
210
253
|
/** @hidden */
|
|
211
|
-
export declare type PartialMutation = PartialSetMultipleRecordsCellValuesMutation | PartialDeleteMultipleRecordsMutation | PartialCreateMultipleRecordsMutation | PartialSetMultipleGlobalConfigPathsMutation | PartialCreateSingleFieldMutation | PartialUpdateSingleFieldConfigMutation | PartialCreateSingleTableMutation | PartialUpdateViewMetadataMutation;
|
|
254
|
+
export declare type PartialMutation = PartialSetMultipleRecordsCellValuesMutation | PartialDeleteMultipleRecordsMutation | PartialCreateMultipleRecordsMutation | PartialSetMultipleGlobalConfigPathsMutation | PartialCreateSingleFieldMutation | PartialUpdateSingleFieldConfigMutation | PartialUpdateSingleFieldDescriptionMutation | PartialCreateSingleTableMutation | PartialUpdateViewMetadataMutation;
|
|
212
255
|
/** */
|
|
213
256
|
export interface SuccessfulPermissionCheckResult {
|
|
214
257
|
/** */
|