@constructive-io/data 0.9.3 → 0.10.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/index.cjs +2055 -137
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +842 -1
- package/dist/index.d.ts +842 -1
- package/dist/index.js +2018 -139
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -39,11 +39,21 @@ interface MetaschemaTable {
|
|
|
39
39
|
i18n?: MetaschemaI18n | null;
|
|
40
40
|
realtime?: MetaschemaRealtime | null;
|
|
41
41
|
scope?: MetaschemaScope | null;
|
|
42
|
+
/** Optional capability: `table` or `view`. */
|
|
43
|
+
kind?: string | null;
|
|
44
|
+
/** Optional capability: table comment. */
|
|
45
|
+
description?: string | null;
|
|
46
|
+
/** Optional capability: whether the table only links rows of two other tables. */
|
|
47
|
+
isJunction?: boolean | null;
|
|
48
|
+
/** Optional capability: the SQL table name (with `schemaName`, the table's physical identity). */
|
|
49
|
+
tableName?: string | null;
|
|
42
50
|
/** @deprecated Legacy pre-July contract field. */
|
|
43
51
|
checkConstraints?: Array<MetaschemaCheckConstraint | null> | null;
|
|
44
52
|
/** @deprecated Legacy pre-July contract field. */
|
|
45
53
|
exclusionConstraints?: Array<MetaschemaExclusionConstraint | null> | null;
|
|
46
54
|
}
|
|
55
|
+
/** Preferred current-contract name. */
|
|
56
|
+
type MetaTable$3 = MetaschemaTable;
|
|
47
57
|
interface MetaschemaTableQuery {
|
|
48
58
|
__typename?: 'MetaQuery';
|
|
49
59
|
all: string;
|
|
@@ -62,6 +72,24 @@ interface MetaschemaField {
|
|
|
62
72
|
isForeignKey?: boolean | null;
|
|
63
73
|
description?: string | null;
|
|
64
74
|
enumValues?: MetaschemaEnum | null;
|
|
75
|
+
/** Optional capability: values the field accepts when the set is fixed. */
|
|
76
|
+
allowedValues?: string[] | null;
|
|
77
|
+
/** Optional capability: whether a create must provide this field. */
|
|
78
|
+
isRequiredOnCreate?: boolean | null;
|
|
79
|
+
/** Optional capability: whether a create may set this field. */
|
|
80
|
+
isWritableOnCreate?: boolean | null;
|
|
81
|
+
/** Optional capability: whether an update may change this field. */
|
|
82
|
+
isWritableOnUpdate?: boolean | null;
|
|
83
|
+
/** Optional capability: whether the database computes the value, so no write may set it. */
|
|
84
|
+
isComputed?: boolean | null;
|
|
85
|
+
/** Optional capability: file column details. */
|
|
86
|
+
file?: MetaschemaFileField | null;
|
|
87
|
+
}
|
|
88
|
+
interface MetaschemaFileField {
|
|
89
|
+
__typename?: 'MetaFileField';
|
|
90
|
+
kind: string;
|
|
91
|
+
isMultiple?: boolean | null;
|
|
92
|
+
filesType?: string | null;
|
|
65
93
|
}
|
|
66
94
|
interface MetaschemaEnum {
|
|
67
95
|
__typename?: 'MetaEnum';
|
|
@@ -87,6 +115,12 @@ interface MetaschemaType {
|
|
|
87
115
|
hasDefault?: boolean | null;
|
|
88
116
|
subtype?: string | null;
|
|
89
117
|
encoding?: MetaschemaScalarEncoding | null;
|
|
118
|
+
/** Optional capability: declared maximum length. */
|
|
119
|
+
maxLength?: number | null;
|
|
120
|
+
/** Optional capability: declared numeric precision. */
|
|
121
|
+
precision?: number | null;
|
|
122
|
+
/** Optional capability: declared numeric scale. */
|
|
123
|
+
scale?: number | null;
|
|
90
124
|
/** @deprecated Legacy pre-July contract field. */
|
|
91
125
|
modifier?: number | null;
|
|
92
126
|
/** @deprecated Legacy pre-July contract field. */
|
|
@@ -186,6 +220,8 @@ interface MetaschemaTableBelongsToRelation {
|
|
|
186
220
|
type?: string | null;
|
|
187
221
|
keys?: Array<MetaschemaField | null> | null;
|
|
188
222
|
references: MetaschemaTableReference;
|
|
223
|
+
/** Optional capability: referenced fields on the other table, in `keys` order. */
|
|
224
|
+
refKeys?: Array<MetaschemaField | null> | null;
|
|
189
225
|
}
|
|
190
226
|
interface MetaschemaTableHasRelation {
|
|
191
227
|
__typename?: 'MetaHasRelation';
|
|
@@ -194,6 +230,8 @@ interface MetaschemaTableHasRelation {
|
|
|
194
230
|
type?: string | null;
|
|
195
231
|
keys?: Array<MetaschemaField | null> | null;
|
|
196
232
|
referencedBy: MetaschemaTableReference;
|
|
233
|
+
/** Optional capability: fields on the related table that point at this table, in `keys` order. */
|
|
234
|
+
remoteKeys?: Array<MetaschemaField | null> | null;
|
|
197
235
|
/** @deprecated Legacy pre-July contract field. */
|
|
198
236
|
foreignKeys?: Array<MetaschemaField | null> | null;
|
|
199
237
|
}
|
|
@@ -214,6 +252,22 @@ interface MetaschemaStorage {
|
|
|
214
252
|
__typename?: 'MetaStorage';
|
|
215
253
|
isFilesTable: boolean;
|
|
216
254
|
isBucketsTable: boolean;
|
|
255
|
+
/** Optional capability: GraphQL type name of the paired files table. */
|
|
256
|
+
filesType?: string | null;
|
|
257
|
+
/** Optional capability: GraphQL type name of the paired buckets table. */
|
|
258
|
+
bucketsType?: string | null;
|
|
259
|
+
/** Optional capability: download-URL field on the files type. */
|
|
260
|
+
downloadUrlField?: string | null;
|
|
261
|
+
/** Optional capability: upload mutation names. */
|
|
262
|
+
upload?: MetaschemaStorageUpload | null;
|
|
263
|
+
}
|
|
264
|
+
interface MetaschemaStorageUpload {
|
|
265
|
+
__typename?: 'MetaStorageUpload';
|
|
266
|
+
mutation?: string | null;
|
|
267
|
+
inputType?: string | null;
|
|
268
|
+
payloadType?: string | null;
|
|
269
|
+
bulkMutation?: string | null;
|
|
270
|
+
requiresOwnerId?: boolean | null;
|
|
217
271
|
}
|
|
218
272
|
interface MetaschemaSearchColumn {
|
|
219
273
|
__typename?: 'MetaSearchColumn';
|
|
@@ -435,6 +489,757 @@ declare function assertMetaQuery(result: MetaQuery | null | undefined): asserts
|
|
|
435
489
|
/** Decode the JSON-string transport used by `MetaSearchConfig.weights`. */
|
|
436
490
|
declare function parseMetaSearchWeights(config: MetaschemaSearchConfig | null | undefined): Record<string, number> | null;
|
|
437
491
|
|
|
492
|
+
/**
|
|
493
|
+
* The normalized table model.
|
|
494
|
+
*
|
|
495
|
+
* One `TableModel` per table, built from two authoritative inputs: `_meta`
|
|
496
|
+
* (keys, constraints, relations, write flags, labels, storage, search) and
|
|
497
|
+
* targeted GraphQL introspection (every name and shape a document uses). Code
|
|
498
|
+
* that reads or writes rows uses this model and never builds a GraphQL name by
|
|
499
|
+
* inflection. Anything the model cannot prove is read-only and carries a
|
|
500
|
+
* human-readable reason.
|
|
501
|
+
*/
|
|
502
|
+
/** Stable table identity: `${schemaName ?? ''}.${name}`. */
|
|
503
|
+
type TableKey = string;
|
|
504
|
+
interface TableModel {
|
|
505
|
+
/** Stable identity: `${schemaName ?? ''}.${name}`. Use this, never `name` alone, for caches and lookups. */
|
|
506
|
+
key: TableKey;
|
|
507
|
+
/** GraphQL type name of one row. */
|
|
508
|
+
name: string;
|
|
509
|
+
/** Database schema that owns the table, or null when the server does not say. */
|
|
510
|
+
schemaName: string | null;
|
|
511
|
+
/** Whether rows come from a table or a view; 'unknown' when the server does not say. */
|
|
512
|
+
kind: 'table' | 'view' | 'unknown';
|
|
513
|
+
/** Table comment, or null. */
|
|
514
|
+
description: string | null;
|
|
515
|
+
/** Every column `_meta` reports, in `_meta` order. Check `readable` before selecting one. */
|
|
516
|
+
columns: readonly ColumnModel[];
|
|
517
|
+
/** GraphQL field names of the primary key, in key order. Empty means no key: rows are read-only. */
|
|
518
|
+
primaryKey: readonly string[];
|
|
519
|
+
/** Relations in `_meta` order: belongsTo, hasOne, hasMany, manyToMany. */
|
|
520
|
+
relations: readonly RelationModel[];
|
|
521
|
+
/** Root operations with their exact field, argument and input names. */
|
|
522
|
+
operations: TableOperations;
|
|
523
|
+
/** Fields that label one record of this table (record title, relation chips, pickers). */
|
|
524
|
+
display: DisplayFieldsModel;
|
|
525
|
+
/** Storage role of this table, or null for an ordinary table. */
|
|
526
|
+
storage: TableStorageModel | null;
|
|
527
|
+
/** Search capabilities, or null when the table has none. */
|
|
528
|
+
search: TableSearchModel | null;
|
|
529
|
+
/** True when the table only links rows of two other tables; null when the server does not say. */
|
|
530
|
+
isJunction: boolean | null;
|
|
531
|
+
/** Why parts of this table are degraded. Each message is safe to show to the user. */
|
|
532
|
+
issues: readonly ModelIssue[];
|
|
533
|
+
}
|
|
534
|
+
/** What a column's values are, independent of how the grid renders them. */
|
|
535
|
+
type ColumnValueKind = 'text' | 'integer' | 'bigint' | 'decimal' | 'float' | 'boolean' | 'uuid' | 'date' | 'time' | 'datetime' | 'interval' | 'json' | 'enum' | 'bitstring' | 'binary' | 'network' | 'geometry' | 'point' | 'vector' | 'fulltext' | 'path' | 'range' | 'composite' | 'file' | 'unknown';
|
|
536
|
+
/** Presentation hint from a known value domain. Never used to decide a write. */
|
|
537
|
+
type ColumnSemantic = 'email' | 'url' | 'hostname' | 'origin' | 'image' | 'upload' | 'attachment' | 'currency';
|
|
538
|
+
interface ColumnModel {
|
|
539
|
+
/** GraphQL field name on the row type. */
|
|
540
|
+
name: string;
|
|
541
|
+
/** Column comment, or null. */
|
|
542
|
+
description: string | null;
|
|
543
|
+
/** Value kind, wire shape and write shape. */
|
|
544
|
+
value: ColumnValueModel;
|
|
545
|
+
/** False when the database requires a value. */
|
|
546
|
+
nullable: boolean;
|
|
547
|
+
/** True when the database supplies a value on insert. */
|
|
548
|
+
hasDefault: boolean;
|
|
549
|
+
/** True when the column is part of the primary key. */
|
|
550
|
+
isPrimaryKey: boolean;
|
|
551
|
+
/** True when the column is part of a foreign key. */
|
|
552
|
+
isForeignKey: boolean;
|
|
553
|
+
/** False when the list document cannot select this column; `readReason` says why. */
|
|
554
|
+
readable: boolean;
|
|
555
|
+
/** Why the column cannot be read, or null when it can. */
|
|
556
|
+
readReason: string | null;
|
|
557
|
+
/** Which writes accept this column, with reasons for the ones that do not. */
|
|
558
|
+
write: ColumnWriteModel;
|
|
559
|
+
/** Exact order-by enum values, or null when the column cannot be sorted. */
|
|
560
|
+
sort: ColumnSortModel | null;
|
|
561
|
+
/** Filter input field and the operators it really has, or null when the column cannot be filtered. */
|
|
562
|
+
filter: ColumnFilterModel | null;
|
|
563
|
+
}
|
|
564
|
+
interface ColumnValueModel {
|
|
565
|
+
/** What the values are. */
|
|
566
|
+
kind: ColumnValueKind;
|
|
567
|
+
/** True when the column holds a list of values. */
|
|
568
|
+
isArray: boolean;
|
|
569
|
+
/** Named GraphQL output type of the column (wrappers removed). */
|
|
570
|
+
typeName: string;
|
|
571
|
+
/** Presentation hint from a known domain, or null. */
|
|
572
|
+
semantic: ColumnSemantic | null;
|
|
573
|
+
/** Fixed option list for enum columns and for text columns with an allowed-values list. `value` is the wire value. */
|
|
574
|
+
options: readonly ColumnOption[] | null;
|
|
575
|
+
/** GraphQL sub-selection for object-typed values (`{ start { value inclusive } end { value inclusive } }`), null for a leaf. */
|
|
576
|
+
selection: string | null;
|
|
577
|
+
/** Shape the write inputs expect for this column, or null when no input accepts it. */
|
|
578
|
+
input: InputValueModel | null;
|
|
579
|
+
/** Declared maximum text length, or null when unbounded or unknown. */
|
|
580
|
+
maxLength: number | null;
|
|
581
|
+
/** Declared numeric precision, or null. */
|
|
582
|
+
precision: number | null;
|
|
583
|
+
/** Declared numeric scale, or null. */
|
|
584
|
+
scale: number | null;
|
|
585
|
+
/**
|
|
586
|
+
* The whole numbers an `integer` column holds, from its Postgres type: a smallint holds
|
|
587
|
+
* -32768..32767 though GraphQL types it `Int` like an int4. Null for other kinds or an
|
|
588
|
+
* unknown type (then the `Int` range applies).
|
|
589
|
+
*/
|
|
590
|
+
integerBounds: {
|
|
591
|
+
min: number;
|
|
592
|
+
max: number;
|
|
593
|
+
} | null;
|
|
594
|
+
/** Declared vector length, or null. */
|
|
595
|
+
dimensions: number | null;
|
|
596
|
+
/** Declared geometry subtype (Point, Polygon, ...), or null. */
|
|
597
|
+
geometrySubtype: string | null;
|
|
598
|
+
/** Declared spatial reference id, or null. */
|
|
599
|
+
srid: number | null;
|
|
600
|
+
/** File column details, or null when the column does not hold files. */
|
|
601
|
+
file: ColumnFileModel | null;
|
|
602
|
+
}
|
|
603
|
+
interface ColumnOption {
|
|
604
|
+
/** Exact value sent to and returned by the API. */
|
|
605
|
+
value: string;
|
|
606
|
+
/** Text to show. Equal to `value` when no label is known. */
|
|
607
|
+
label: string;
|
|
608
|
+
}
|
|
609
|
+
interface ColumnFileModel {
|
|
610
|
+
/** The kind of file column. */
|
|
611
|
+
kind: 'image' | 'upload' | 'attachment';
|
|
612
|
+
/** True when the column holds several files. */
|
|
613
|
+
multiple: boolean;
|
|
614
|
+
/** GraphQL type name of the files table behind the column, or null when it is not known. */
|
|
615
|
+
filesType: string | null;
|
|
616
|
+
}
|
|
617
|
+
/** How one GraphQL input position is shaped. Drives the write codec. */
|
|
618
|
+
interface InputValueModel {
|
|
619
|
+
/** Named GraphQL input type. */
|
|
620
|
+
typeName: string;
|
|
621
|
+
/** Scalar, enum, or input object. */
|
|
622
|
+
shape: 'scalar' | 'enum' | 'object';
|
|
623
|
+
/** True when the input takes a list of values. */
|
|
624
|
+
isList: boolean;
|
|
625
|
+
/** Enum wire values, for `shape: 'enum'`; otherwise null. */
|
|
626
|
+
enumValues: readonly string[] | null;
|
|
627
|
+
/** Input object fields, for `shape: 'object'`; otherwise null. Null for an object nested too deeply to describe. */
|
|
628
|
+
fields: readonly InputFieldModel[] | null;
|
|
629
|
+
}
|
|
630
|
+
interface InputFieldModel {
|
|
631
|
+
/** Input field name. */
|
|
632
|
+
name: string;
|
|
633
|
+
/** True when the field must be provided (non-null without a default). */
|
|
634
|
+
required: boolean;
|
|
635
|
+
/** Shape of the field value. */
|
|
636
|
+
value: InputValueModel;
|
|
637
|
+
}
|
|
638
|
+
interface ColumnWriteModel {
|
|
639
|
+
/** The create input accepts this column. */
|
|
640
|
+
create: boolean;
|
|
641
|
+
/** The update patch accepts this column. */
|
|
642
|
+
update: boolean;
|
|
643
|
+
/** A create must provide a value: the create input requires it and has no default. */
|
|
644
|
+
requiredOnCreate: boolean;
|
|
645
|
+
/** Why a create cannot set this column, or null when it can. */
|
|
646
|
+
createReason: string | null;
|
|
647
|
+
/** Why an update cannot change this column, or null when it can. */
|
|
648
|
+
updateReason: string | null;
|
|
649
|
+
}
|
|
650
|
+
interface ColumnSortModel {
|
|
651
|
+
/** Exact order-by enum value for ascending order. */
|
|
652
|
+
asc: string;
|
|
653
|
+
/** Exact order-by enum value for descending order. */
|
|
654
|
+
desc: string;
|
|
655
|
+
}
|
|
656
|
+
interface ColumnFilterModel {
|
|
657
|
+
/** Field name in the table's filter input. */
|
|
658
|
+
field: string;
|
|
659
|
+
/** Named operator input type for this column. */
|
|
660
|
+
typeName: string;
|
|
661
|
+
/** Operators the operator type really has, with the value shape each one takes. */
|
|
662
|
+
operators: readonly FilterOperatorModel[];
|
|
663
|
+
}
|
|
664
|
+
interface FilterOperatorModel {
|
|
665
|
+
/** Operator field name, for example `equalTo`. */
|
|
666
|
+
name: string;
|
|
667
|
+
/** Shape of the operator value. */
|
|
668
|
+
input: InputValueModel;
|
|
669
|
+
}
|
|
670
|
+
type RelationModelKind = 'belongsTo' | 'hasOne' | 'hasMany' | 'manyToMany';
|
|
671
|
+
interface RelationKeyPair {
|
|
672
|
+
/** Field on this table. */
|
|
673
|
+
local: string;
|
|
674
|
+
/** Field on the related table. */
|
|
675
|
+
remote: string;
|
|
676
|
+
}
|
|
677
|
+
interface RelationJunctionModel {
|
|
678
|
+
/** `TableModel.key` of the junction table. */
|
|
679
|
+
tableKey: TableKey;
|
|
680
|
+
/** GraphQL type name of the junction table. */
|
|
681
|
+
tableName: string;
|
|
682
|
+
/** Junction fields that point at this table, paired with the fields they reference here. */
|
|
683
|
+
left: readonly {
|
|
684
|
+
junction: string;
|
|
685
|
+
local: string;
|
|
686
|
+
}[];
|
|
687
|
+
/** Junction fields that point at the related table, paired with the fields they reference there. */
|
|
688
|
+
right: readonly {
|
|
689
|
+
junction: string;
|
|
690
|
+
remote: string;
|
|
691
|
+
}[];
|
|
692
|
+
/** False when the junction has required fields beyond the two key sets, so a link cannot be created from the two keys alone. */
|
|
693
|
+
pure: boolean;
|
|
694
|
+
/** Required junction fields beyond the two key sets. */
|
|
695
|
+
extraRequiredFields: readonly string[];
|
|
696
|
+
}
|
|
697
|
+
interface RelationTargetModel {
|
|
698
|
+
/** Primary key fields of the related table, in key order; empty when the related records cannot be identified. */
|
|
699
|
+
primaryKey: readonly string[];
|
|
700
|
+
/** Fields that label a related record (the related table's display rule). */
|
|
701
|
+
labelFields: readonly string[];
|
|
702
|
+
}
|
|
703
|
+
interface RelationModel {
|
|
704
|
+
/** Relation kind. */
|
|
705
|
+
kind: RelationModelKind;
|
|
706
|
+
/** GraphQL field on the row that returns the related record(s). */
|
|
707
|
+
fieldName: string;
|
|
708
|
+
/** `TableModel.key` of the related table, or null when it cannot be resolved. */
|
|
709
|
+
targetKey: TableKey | null;
|
|
710
|
+
/** GraphQL type name of the related rows. */
|
|
711
|
+
targetName: string;
|
|
712
|
+
/** What the field returns: one record, a connection (`nodes`, `totalCount`), or a plain list. Meaningful only when `readable`. */
|
|
713
|
+
shape: 'object' | 'connection' | 'list';
|
|
714
|
+
/** False when the list document cannot select this relation; `reason` says why. */
|
|
715
|
+
readable: boolean;
|
|
716
|
+
/** Key pairs. belongsTo: local foreign-key field -> referenced field. hasOne/hasMany: referenced local field -> foreign-key field on the related table. Empty for manyToMany. */
|
|
717
|
+
keys: readonly RelationKeyPair[];
|
|
718
|
+
/** Junction details for manyToMany, otherwise null. */
|
|
719
|
+
junction: RelationJunctionModel | null;
|
|
720
|
+
/** Identity and label fields of related records, selected by the list document. */
|
|
721
|
+
target: RelationTargetModel;
|
|
722
|
+
/** Page size argument of a list relation, or null when the field takes none. */
|
|
723
|
+
pageArg: string | null;
|
|
724
|
+
/** True when a connection relation reports `totalCount`, so a cell can show "+N more". */
|
|
725
|
+
hasTotalCount: boolean;
|
|
726
|
+
/** How this table's filter input filters by this relation, or null when it cannot. */
|
|
727
|
+
filter: RelationFilterModel | null;
|
|
728
|
+
/** False with `reason` when the keys are ambiguous or incomplete. */
|
|
729
|
+
editable: boolean;
|
|
730
|
+
/** False when unlinking would write null into a required field, or the link cannot be removed. */
|
|
731
|
+
unlinkable: boolean;
|
|
732
|
+
/** Why the relation is not editable or not unlinkable, or null. */
|
|
733
|
+
reason: string | null;
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* Filtering rows of this table by a relation, as the filter input really has it:
|
|
737
|
+
* `{ [field]: <conditions on the linked record> }` for a one-record relation,
|
|
738
|
+
* `{ [field]: { [many.some | many.every | many.none]: <conditions> } }` for a to-many one,
|
|
739
|
+
* and `{ [exists]: true | false }` to test whether a linked record exists.
|
|
740
|
+
*/
|
|
741
|
+
interface RelationFilterModel {
|
|
742
|
+
/** Field in this table's filter input. */
|
|
743
|
+
field: string;
|
|
744
|
+
/** Named input type of that field. */
|
|
745
|
+
typeName: string;
|
|
746
|
+
/** Boolean field of this table's filter input that tests whether a linked record exists, or null when absent. */
|
|
747
|
+
exists: string | null;
|
|
748
|
+
/** Quantifier fields of a to-many filter, each taking `recordFilterType`; null for a one-record relation. */
|
|
749
|
+
many: {
|
|
750
|
+
some: string | null;
|
|
751
|
+
every: string | null;
|
|
752
|
+
none: string | null;
|
|
753
|
+
} | null;
|
|
754
|
+
/** Filter input a condition on one linked record uses (the linked table's own filter input), or null when unproven. */
|
|
755
|
+
recordFilterType: string | null;
|
|
756
|
+
}
|
|
757
|
+
/** One GraphQL argument or input field with its exact printed type, for variable definitions. */
|
|
758
|
+
interface ArgumentModel {
|
|
759
|
+
/** Argument name. */
|
|
760
|
+
name: string;
|
|
761
|
+
/** Printed GraphQL type, for example `[UserOrderBy!]`. */
|
|
762
|
+
type: string;
|
|
763
|
+
/** Named type with wrappers removed. */
|
|
764
|
+
typeName: string;
|
|
765
|
+
}
|
|
766
|
+
interface ListOperationModel {
|
|
767
|
+
/** Root query field. */
|
|
768
|
+
field: string;
|
|
769
|
+
/** 'connection' returns `{ nodes totalCount pageInfo }`; 'list' returns a plain array. */
|
|
770
|
+
shape: 'connection' | 'list';
|
|
771
|
+
/** Filter argument, or null when the field cannot be filtered. */
|
|
772
|
+
filter: ArgumentModel | null;
|
|
773
|
+
/** Order-by argument, or null when the field cannot be sorted. */
|
|
774
|
+
orderBy: ArgumentModel | null;
|
|
775
|
+
/** Page size argument, or null. */
|
|
776
|
+
first: ArgumentModel | null;
|
|
777
|
+
/** Offset argument, or null. */
|
|
778
|
+
offset: ArgumentModel | null;
|
|
779
|
+
/** Cursor argument, or null. */
|
|
780
|
+
after: ArgumentModel | null;
|
|
781
|
+
/** True when the connection reports `totalCount`. */
|
|
782
|
+
totalCount: boolean;
|
|
783
|
+
/** True when the connection reports `pageInfo`. */
|
|
784
|
+
pageInfo: boolean;
|
|
785
|
+
/** Logical operators (`and`, `or`, `not`) the filter input has. */
|
|
786
|
+
logicalOperators: readonly ('and' | 'or' | 'not')[];
|
|
787
|
+
}
|
|
788
|
+
interface CreateOperationModel {
|
|
789
|
+
/** Root mutation field. */
|
|
790
|
+
field: string;
|
|
791
|
+
/** The mutation's input argument. */
|
|
792
|
+
input: ArgumentModel;
|
|
793
|
+
/** Field of the input that carries the new record. */
|
|
794
|
+
recordField: string;
|
|
795
|
+
/** Named input type of the record field. */
|
|
796
|
+
recordType: string;
|
|
797
|
+
/** Payload field that returns the created row. */
|
|
798
|
+
payloadField: string;
|
|
799
|
+
}
|
|
800
|
+
interface UpdateOperationModel {
|
|
801
|
+
/** Root mutation field. */
|
|
802
|
+
field: string;
|
|
803
|
+
/** The mutation's input argument. */
|
|
804
|
+
input: ArgumentModel;
|
|
805
|
+
/** Field of the input that carries the changed values. */
|
|
806
|
+
patchField: string;
|
|
807
|
+
/** Named input type of the patch field. */
|
|
808
|
+
patchType: string;
|
|
809
|
+
/** Input fields that identify the row, in primary-key order. */
|
|
810
|
+
keyArgs: readonly string[];
|
|
811
|
+
/** Payload field that returns the updated row. */
|
|
812
|
+
payloadField: string;
|
|
813
|
+
}
|
|
814
|
+
interface DeleteOperationModel {
|
|
815
|
+
/** Root mutation field. */
|
|
816
|
+
field: string;
|
|
817
|
+
/** The mutation's input argument. */
|
|
818
|
+
input: ArgumentModel;
|
|
819
|
+
/** Input fields that identify the row, in primary-key order. */
|
|
820
|
+
keyArgs: readonly string[];
|
|
821
|
+
/** Payload field that returns the deleted row, or null when the payload has none. */
|
|
822
|
+
payloadField: string | null;
|
|
823
|
+
}
|
|
824
|
+
interface TableOperations {
|
|
825
|
+
/** Reading rows. Null when the table has no usable list field (the table cannot load). */
|
|
826
|
+
list: ListOperationModel | null;
|
|
827
|
+
/** Creating a row, or null with an issue. */
|
|
828
|
+
create: CreateOperationModel | null;
|
|
829
|
+
/** Updating a row by its primary key, or null with an issue. */
|
|
830
|
+
update: UpdateOperationModel | null;
|
|
831
|
+
/** Deleting a row by its primary key, or null with an issue. */
|
|
832
|
+
delete: DeleteOperationModel | null;
|
|
833
|
+
}
|
|
834
|
+
interface DisplayFieldsModel {
|
|
835
|
+
/** Fields that label a record, in display order. Empty only for a table with no readable leaf field. */
|
|
836
|
+
fields: readonly string[];
|
|
837
|
+
/** Which step of the display rule chose the fields. */
|
|
838
|
+
source: 'host' | 'name' | 'text' | 'key' | 'none';
|
|
839
|
+
}
|
|
840
|
+
interface TableStorageModel {
|
|
841
|
+
/** 'files' for a storage files table, 'buckets' for a storage buckets table. */
|
|
842
|
+
role: 'files' | 'buckets';
|
|
843
|
+
/** GraphQL type name of the paired files table, or null when the server does not say. */
|
|
844
|
+
filesType: string | null;
|
|
845
|
+
/** GraphQL type name of the paired buckets table, or null when the server does not say. */
|
|
846
|
+
bucketsType: string | null;
|
|
847
|
+
/** Field on the files type that returns a download URL, or null. */
|
|
848
|
+
downloadUrlField: string | null;
|
|
849
|
+
/** Upload mutation names, or null when the server does not say. */
|
|
850
|
+
upload: TableStorageUploadModel | null;
|
|
851
|
+
}
|
|
852
|
+
interface TableStorageUploadModel {
|
|
853
|
+
/** Root mutation for one file. */
|
|
854
|
+
mutation: string | null;
|
|
855
|
+
/** Input type of that mutation. */
|
|
856
|
+
inputType: string | null;
|
|
857
|
+
/** Payload type of that mutation. */
|
|
858
|
+
payloadType: string | null;
|
|
859
|
+
/** Root mutation for several files. */
|
|
860
|
+
bulkMutation: string | null;
|
|
861
|
+
/** Whether the upload input requires an owner id. */
|
|
862
|
+
requiresOwnerId: boolean | null;
|
|
863
|
+
}
|
|
864
|
+
interface TableSearchModel {
|
|
865
|
+
/** Search algorithms active on the table. */
|
|
866
|
+
algorithms: readonly string[];
|
|
867
|
+
/** Searchable columns with their algorithm. */
|
|
868
|
+
columns: readonly {
|
|
869
|
+
name: string;
|
|
870
|
+
algorithm: string;
|
|
871
|
+
}[];
|
|
872
|
+
/** Filter input field for combined search, or null when the filter input has none. */
|
|
873
|
+
unifiedSearchField: string | null;
|
|
874
|
+
/** Per-algorithm score weights, or null. */
|
|
875
|
+
weights: Readonly<Record<string, number>> | null;
|
|
876
|
+
}
|
|
877
|
+
type ModelIssueCode = 'TABLE_NOT_IN_SCHEMA' | 'LIST_UNAVAILABLE' | 'NO_PRIMARY_KEY' | 'CREATE_UNAVAILABLE' | 'UPDATE_UNAVAILABLE' | 'DELETE_UNAVAILABLE' | 'COLUMN_UNREADABLE' | 'COLUMN_UNWRITABLE' | 'COLUMN_UNSORTABLE' | 'RELATION_UNRESOLVED' | 'RELATION_AMBIGUOUS' | 'RELATION_INCOMPLETE' | 'RELATION_UNREADABLE';
|
|
878
|
+
interface ModelIssue {
|
|
879
|
+
/** What the issue affects. */
|
|
880
|
+
scope: 'table' | 'column' | 'relation' | 'operation';
|
|
881
|
+
/** Column or relation field name, the operation name (`list`, `create`, `update`, `delete`), or null for the whole table. */
|
|
882
|
+
target: string | null;
|
|
883
|
+
/** Stable machine-readable code. */
|
|
884
|
+
code: ModelIssueCode;
|
|
885
|
+
/** Human-readable reason, safe to show to the user. */
|
|
886
|
+
message: string;
|
|
887
|
+
}
|
|
888
|
+
/** Host override for the display rule: table key or table name -> label fields, in order. */
|
|
889
|
+
type DisplayFieldOverrides = Readonly<Record<string, readonly string[]>>;
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* `_meta` fields a client may use when the server has them. The required set
|
|
893
|
+
* stays {@link META_CONTRACT_REQUIREMENTS}; everything here is optional, so an
|
|
894
|
+
* older server keeps loading and the query only selects what exists.
|
|
895
|
+
*/
|
|
896
|
+
declare const META_OPTIONAL_CAPABILITIES: {
|
|
897
|
+
readonly metaTable: {
|
|
898
|
+
readonly typeName: "MetaTable";
|
|
899
|
+
readonly fields: readonly ["kind", "description", "isJunction", "tableName"];
|
|
900
|
+
};
|
|
901
|
+
readonly metaField: {
|
|
902
|
+
readonly typeName: "MetaField";
|
|
903
|
+
readonly fields: readonly ["allowedValues", "isRequiredOnCreate", "isWritableOnCreate", "isWritableOnUpdate", "isComputed", "file"];
|
|
904
|
+
};
|
|
905
|
+
readonly metaType: {
|
|
906
|
+
readonly typeName: "MetaType";
|
|
907
|
+
readonly fields: readonly ["maxLength", "precision", "scale"];
|
|
908
|
+
};
|
|
909
|
+
readonly metaBelongsTo: {
|
|
910
|
+
readonly typeName: "MetaBelongsToRelation";
|
|
911
|
+
readonly fields: readonly ["refKeys"];
|
|
912
|
+
};
|
|
913
|
+
readonly metaHas: {
|
|
914
|
+
readonly typeName: "MetaHasRelation";
|
|
915
|
+
readonly fields: readonly ["remoteKeys"];
|
|
916
|
+
};
|
|
917
|
+
readonly metaStorage: {
|
|
918
|
+
readonly typeName: "MetaStorage";
|
|
919
|
+
readonly fields: readonly ["filesType", "bucketsType", "downloadUrlField", "upload"];
|
|
920
|
+
};
|
|
921
|
+
readonly metaFileField: {
|
|
922
|
+
readonly typeName: "MetaFileField";
|
|
923
|
+
readonly fields: readonly ["kind", "isMultiple", "filesType"];
|
|
924
|
+
};
|
|
925
|
+
readonly metaStorageUpload: {
|
|
926
|
+
readonly typeName: "MetaStorageUpload";
|
|
927
|
+
readonly fields: readonly ["mutation", "inputType", "payloadType", "bulkMutation", "requiresOwnerId"];
|
|
928
|
+
};
|
|
929
|
+
};
|
|
930
|
+
type MetaOptionalTypeAlias = keyof typeof META_OPTIONAL_CAPABILITIES;
|
|
931
|
+
type OptionalField<Alias extends MetaOptionalTypeAlias> = (typeof META_OPTIONAL_CAPABILITIES)[Alias]['fields'][number];
|
|
932
|
+
/** The optional `_meta` fields this server has, per Meta type. */
|
|
933
|
+
type MetaCapabilities = {
|
|
934
|
+
readonly [Alias in MetaOptionalTypeAlias]: ReadonlySet<OptionalField<Alias>>;
|
|
935
|
+
};
|
|
936
|
+
/** Contract introspection plus the optional Meta types that only newer servers define. */
|
|
937
|
+
type MetaCapabilityIntrospectionQuery = MetaContractIntrospectionQuery & {
|
|
938
|
+
[Alias in MetaOptionalTypeAlias]?: MetaIntrospectionType | null;
|
|
939
|
+
};
|
|
940
|
+
interface MetaCapabilityAssessment {
|
|
941
|
+
/** Required-contract result, identical to {@link assessMetaContract}. */
|
|
942
|
+
compatibility: MetaContractCompatibility;
|
|
943
|
+
/** Optional fields the server has. */
|
|
944
|
+
capabilities: MetaCapabilities;
|
|
945
|
+
}
|
|
946
|
+
/** One request: the field names of every required and optional Meta type. */
|
|
947
|
+
declare const META_CAPABILITY_INTROSPECTION_SOURCE: string;
|
|
948
|
+
declare const META_CAPABILITY_INTROSPECTION_DOCUMENT: TypedDocumentString<MetaCapabilityIntrospectionQuery, Record<string, never>>;
|
|
949
|
+
/** No optional capability: the selection an older server supports. */
|
|
950
|
+
declare function emptyMetaCapabilities(): MetaCapabilities;
|
|
951
|
+
/** Split a contract introspection result into the required verdict and the optional fields present. */
|
|
952
|
+
declare function assessMetaCapabilities(result: MetaCapabilityIntrospectionQuery | null | undefined): MetaCapabilityAssessment;
|
|
953
|
+
/**
|
|
954
|
+
* Build the `_meta` query text from what the server has. With no optional
|
|
955
|
+
* capability this selects exactly the required contract, so an older server
|
|
956
|
+
* loads unchanged.
|
|
957
|
+
*/
|
|
958
|
+
declare function buildMetaQuerySource(capabilities?: MetaCapabilities): string;
|
|
959
|
+
/** Typed `_meta` document for a capability set. */
|
|
960
|
+
declare function buildMetaDocument(capabilities?: MetaCapabilities): TypedDocumentString<MetaQuery, Record<string, never>>;
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* Targeted GraphQL introspection for the table model.
|
|
964
|
+
*
|
|
965
|
+
* The model never sends the full schema query. It reads the two root types
|
|
966
|
+
* once per schema and then named types with batched `__type(name:)` lookups,
|
|
967
|
+
* fetched lazily for the table being opened. Every result is cached, so later
|
|
968
|
+
* tables reuse the shared types (scalars, operator inputs, page info).
|
|
969
|
+
*/
|
|
970
|
+
/** Executes one GraphQL document. Hosts pass their transport (auth, endpoint). */
|
|
971
|
+
type GraphQLExecutor = <TResult = unknown>(document: string, variables?: Record<string, unknown>) => Promise<TResult>;
|
|
972
|
+
type IntrospectedTypeKind = 'SCALAR' | 'OBJECT' | 'INTERFACE' | 'UNION' | 'ENUM' | 'INPUT_OBJECT' | 'LIST' | 'NON_NULL';
|
|
973
|
+
interface IntrospectedTypeRef {
|
|
974
|
+
kind: IntrospectedTypeKind;
|
|
975
|
+
name: string | null;
|
|
976
|
+
ofType: IntrospectedTypeRef | null;
|
|
977
|
+
}
|
|
978
|
+
interface IntrospectedInputValue {
|
|
979
|
+
name: string;
|
|
980
|
+
defaultValue: string | null;
|
|
981
|
+
type: IntrospectedTypeRef;
|
|
982
|
+
}
|
|
983
|
+
interface IntrospectedField {
|
|
984
|
+
name: string;
|
|
985
|
+
args: readonly IntrospectedInputValue[];
|
|
986
|
+
type: IntrospectedTypeRef;
|
|
987
|
+
}
|
|
988
|
+
interface IntrospectedType {
|
|
989
|
+
kind: IntrospectedTypeKind;
|
|
990
|
+
name: string;
|
|
991
|
+
fields: readonly IntrospectedField[] | null;
|
|
992
|
+
inputFields: readonly IntrospectedInputValue[] | null;
|
|
993
|
+
enumValues: readonly {
|
|
994
|
+
name: string;
|
|
995
|
+
}[] | null;
|
|
996
|
+
}
|
|
997
|
+
interface SchemaRoots {
|
|
998
|
+
query: IntrospectedType | null;
|
|
999
|
+
mutation: IntrospectedType | null;
|
|
1000
|
+
}
|
|
1001
|
+
/** Read access to what has been introspected so far. */
|
|
1002
|
+
interface SchemaTypeIndex {
|
|
1003
|
+
/** The root types, or null before they load. */
|
|
1004
|
+
readonly roots: SchemaRoots | null;
|
|
1005
|
+
/** A named type: `undefined` when not loaded yet, `null` when the schema has no such type. */
|
|
1006
|
+
get(name: string): IntrospectedType | null | undefined;
|
|
1007
|
+
}
|
|
1008
|
+
/** Root query and mutation types with every field and argument. One request per schema. */
|
|
1009
|
+
declare const SCHEMA_ROOTS_SOURCE = "\n\tquery ConstructiveSchemaRoots {\n\t\t__schema {\n\t\t\tqueryType { ...ConstructiveNamedType }\n\t\t\tmutationType { ...ConstructiveNamedType }\n\t\t}\n\t}\n\t\n\tfragment ConstructiveTypeRef on __Type { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name } } } } } } }\n\tfragment ConstructiveNamedType on __Type {\n\t\tkind\n\t\tname\n\t\tfields(includeDeprecated: true) {\n\t\t\tname\n\t\t\targs { name defaultValue type { ...ConstructiveTypeRef } }\n\t\t\ttype { ...ConstructiveTypeRef }\n\t\t}\n\t\tinputFields { name defaultValue type { ...ConstructiveTypeRef } }\n\t\tenumValues(includeDeprecated: true) { name }\n\t}\n\n";
|
|
1010
|
+
/** A batch of `__type(name:)` lookups. Names travel as variables, never inlined. */
|
|
1011
|
+
declare function buildSchemaTypesSource(count: number): string;
|
|
1012
|
+
/** The named type behind wrappers, or null for a malformed reference. */
|
|
1013
|
+
declare function namedTypeOf(ref: IntrospectedTypeRef | null | undefined): {
|
|
1014
|
+
kind: IntrospectedTypeKind;
|
|
1015
|
+
name: string;
|
|
1016
|
+
} | null;
|
|
1017
|
+
/** True when a list wrapper appears anywhere in the reference. */
|
|
1018
|
+
declare function isListTypeRef(ref: IntrospectedTypeRef | null | undefined): boolean;
|
|
1019
|
+
/** True when the outermost wrapper is non-null. */
|
|
1020
|
+
declare function isNonNullTypeRef(ref: IntrospectedTypeRef | null | undefined): boolean;
|
|
1021
|
+
/** Print a type reference in SDL form, for variable definitions. */
|
|
1022
|
+
declare function printTypeRef(ref: IntrospectedTypeRef): string;
|
|
1023
|
+
/** An argument or input field that must be provided: non-null and without a default. */
|
|
1024
|
+
declare function isRequiredInput(value: IntrospectedInputValue): boolean;
|
|
1025
|
+
interface SchemaTypeLoader {
|
|
1026
|
+
/** Everything loaded so far. */
|
|
1027
|
+
readonly index: SchemaTypeIndex;
|
|
1028
|
+
/** Load the root types once; a failed load is retried on the next call. */
|
|
1029
|
+
loadRoots(execute: GraphQLExecutor): Promise<SchemaRoots>;
|
|
1030
|
+
/** Load named types that are neither cached nor in flight, batched into as few requests as possible. */
|
|
1031
|
+
loadTypes(execute: GraphQLExecutor, names: Iterable<string>): Promise<void>;
|
|
1032
|
+
/** True when the name was requested at least once (loaded, missing, or in flight). */
|
|
1033
|
+
wasRequested(name: string): boolean;
|
|
1034
|
+
}
|
|
1035
|
+
/** A per-schema cache of introspected types. Create one per `_meta` result. */
|
|
1036
|
+
declare function createSchemaTypeLoader(): SchemaTypeLoader;
|
|
1037
|
+
|
|
1038
|
+
type TableModelErrorCode = 'TABLE_NOT_FOUND' | 'TABLE_AMBIGUOUS' | 'SCHEMA_UNAVAILABLE' | 'OPERATION_UNAVAILABLE' | 'UNKNOWN_FIELD' | 'FIELD_NOT_WRITABLE' | 'INVALID_VALUE' | 'KEY_INCOMPLETE' | 'SORT_UNAVAILABLE' | 'FILTER_UNAVAILABLE' | 'PAGING_UNAVAILABLE' | 'READ_FAILED'
|
|
1039
|
+
/** An update or delete changed no row: the writer may not change it, or it is gone. */
|
|
1040
|
+
| 'WRITE_NOT_APPLIED';
|
|
1041
|
+
/** A table could not be resolved, or a document or write could not be proven valid. The message is safe to show. */
|
|
1042
|
+
declare class TableModelError extends Error {
|
|
1043
|
+
readonly code: TableModelErrorCode;
|
|
1044
|
+
/** The table the error concerns, when known. */
|
|
1045
|
+
readonly tableKey: TableKey | null;
|
|
1046
|
+
/** Table keys that matched an ambiguous name. */
|
|
1047
|
+
readonly candidates: readonly TableKey[];
|
|
1048
|
+
constructor(code: TableModelErrorCode, message: string, options?: {
|
|
1049
|
+
tableKey?: TableKey | null;
|
|
1050
|
+
candidates?: readonly TableKey[];
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
/** Stable identity of a `_meta` table. */
|
|
1054
|
+
declare function tableKeyOf(table: Pick<MetaschemaTable, 'name' | 'schemaName'>): TableKey;
|
|
1055
|
+
/** The non-null tables of a `_meta` response. */
|
|
1056
|
+
declare function metaTablesOf(meta: MetaQuery | null | undefined): MetaschemaTable[];
|
|
1057
|
+
/**
|
|
1058
|
+
* Find a table by `TableModel.key`, or by bare name as hosts pass it. A name
|
|
1059
|
+
* shared by tables in several schemas is an explicit error listing the keys.
|
|
1060
|
+
*/
|
|
1061
|
+
declare function findMetaTable(tables: readonly MetaschemaTable[], ref: string): MetaschemaTable;
|
|
1062
|
+
/** Resolve a type name to a table key, or null when no single table has that name. */
|
|
1063
|
+
declare function tableKeyForName(tables: readonly MetaschemaTable[], name: string | null | undefined): TableKey | null;
|
|
1064
|
+
|
|
1065
|
+
interface BuildTableModelInput {
|
|
1066
|
+
/** The `_meta` table to model. */
|
|
1067
|
+
table: MetaschemaTable;
|
|
1068
|
+
/** Every `_meta` table: related tables and junctions are read from here. */
|
|
1069
|
+
tables: readonly MetaschemaTable[];
|
|
1070
|
+
/** Introspected types loaded so far, with the root types. */
|
|
1071
|
+
schema: SchemaTypeIndex;
|
|
1072
|
+
/** Host override for the display rule. */
|
|
1073
|
+
displayOverrides?: DisplayFieldOverrides;
|
|
1074
|
+
}
|
|
1075
|
+
interface TableModelBuild {
|
|
1076
|
+
/** The model, degraded where a type was missing or not loaded yet. */
|
|
1077
|
+
model: TableModel;
|
|
1078
|
+
/** Types the build needed but that are not loaded yet. Empty when the model is final. */
|
|
1079
|
+
missingTypes: readonly string[];
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Build one table model from `_meta` and the introspected types loaded so far.
|
|
1083
|
+
* Pure: it never fetches. When `missingTypes` is not empty the caller loads
|
|
1084
|
+
* them and builds again; a model built with types still missing is degraded,
|
|
1085
|
+
* never wrong.
|
|
1086
|
+
*/
|
|
1087
|
+
declare function buildTableModel(input: BuildTableModelInput): TableModelBuild;
|
|
1088
|
+
|
|
1089
|
+
interface ResolveTableModelOptions {
|
|
1090
|
+
/** Host override for the display rule. */
|
|
1091
|
+
displayOverrides?: DisplayFieldOverrides;
|
|
1092
|
+
}
|
|
1093
|
+
interface TableModelResolver {
|
|
1094
|
+
/** The `_meta` tables this resolver models. */
|
|
1095
|
+
readonly tables: readonly MetaschemaTable[];
|
|
1096
|
+
/** Introspected types loaded so far. */
|
|
1097
|
+
readonly schema: SchemaTypeIndex;
|
|
1098
|
+
/**
|
|
1099
|
+
* Model one table, by `TableModel.key` or by bare name. Types are fetched
|
|
1100
|
+
* lazily and shared across tables. Throws `TableModelError` for an unknown or
|
|
1101
|
+
* ambiguous name, or when the schema cannot be introspected.
|
|
1102
|
+
*/
|
|
1103
|
+
resolve(execute: GraphQLExecutor, ref: string, options?: ResolveTableModelOptions): Promise<TableModel>;
|
|
1104
|
+
/** Start loading the root types early, for example alongside the `_meta` request. */
|
|
1105
|
+
prefetch(execute: GraphQLExecutor): Promise<void>;
|
|
1106
|
+
}
|
|
1107
|
+
/**
|
|
1108
|
+
* One resolver per `_meta` result. Its type cache lives as long as that
|
|
1109
|
+
* result, so a schema change (a new `_meta`) starts from fresh types.
|
|
1110
|
+
*/
|
|
1111
|
+
declare function createTableModelResolver(meta: MetaQuery | readonly MetaschemaTable[]): TableModelResolver;
|
|
1112
|
+
|
|
1113
|
+
/** Apply the display rule to a built table model, for example with a different host override. */
|
|
1114
|
+
declare function resolveDisplayFields(table: TableModel, overrides?: DisplayFieldOverrides): DisplayFieldsModel;
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* Document builders. Every name in a document comes from the table model, so
|
|
1118
|
+
* a document the model can build is valid against the schema it was built
|
|
1119
|
+
* from. A request the model cannot prove (an unsortable column, a missing
|
|
1120
|
+
* filter argument) throws `TableModelError` instead of being dropped.
|
|
1121
|
+
*/
|
|
1122
|
+
/** Key under which a list row carries the `totalCount` of each connection relation. */
|
|
1123
|
+
declare const RELATION_TOTAL_COUNTS_KEY = "__relationTotalCounts";
|
|
1124
|
+
/** Key under which a list row carries the error of each cell the API could not serve. */
|
|
1125
|
+
declare const CELL_ERRORS_KEY = "__cellErrors";
|
|
1126
|
+
/** One error of a GraphQL response, as far as the reader needs it. */
|
|
1127
|
+
interface ResponseErrorLike {
|
|
1128
|
+
message?: string;
|
|
1129
|
+
path?: ReadonlyArray<string | number> | null;
|
|
1130
|
+
}
|
|
1131
|
+
/** Default page size of a list relation. */
|
|
1132
|
+
declare const DEFAULT_RELATION_PAGE_SIZE = 20;
|
|
1133
|
+
type SortDirection = 'asc' | 'desc';
|
|
1134
|
+
interface SortSpec {
|
|
1135
|
+
/** Column name. */
|
|
1136
|
+
field: string;
|
|
1137
|
+
direction: SortDirection;
|
|
1138
|
+
}
|
|
1139
|
+
type RowRecord = Record<string, unknown>;
|
|
1140
|
+
/** A key value per primary-key field. */
|
|
1141
|
+
type RowKey = Readonly<Record<string, unknown>>;
|
|
1142
|
+
interface ModelDocument<TData, TVariables extends Record<string, unknown>> {
|
|
1143
|
+
/** The document, typed by its result and variables. */
|
|
1144
|
+
document: TypedDocumentString<TData, TVariables>;
|
|
1145
|
+
/** The same document as text. */
|
|
1146
|
+
source: string;
|
|
1147
|
+
/** Variables to send with it. */
|
|
1148
|
+
variables: TVariables;
|
|
1149
|
+
}
|
|
1150
|
+
interface RelationSelectionOptions {
|
|
1151
|
+
/** Relations to select: every readable one, none, or these field names. Default `'none'`. */
|
|
1152
|
+
relations?: 'all' | 'none' | readonly string[];
|
|
1153
|
+
/** Page size of list relations. Default {@link DEFAULT_RELATION_PAGE_SIZE}. */
|
|
1154
|
+
relationPageSize?: number;
|
|
1155
|
+
}
|
|
1156
|
+
interface ListDocumentOptions extends RelationSelectionOptions {
|
|
1157
|
+
/** Page size. */
|
|
1158
|
+
first?: number;
|
|
1159
|
+
/** Rows to skip. */
|
|
1160
|
+
offset?: number;
|
|
1161
|
+
/** Cursor to start after. */
|
|
1162
|
+
after?: string | null;
|
|
1163
|
+
/** A filter in the server's filter input shape. */
|
|
1164
|
+
where?: Readonly<Record<string, unknown>> | null;
|
|
1165
|
+
/** Sort, first entry first. Each field must be a sortable column. */
|
|
1166
|
+
orderBy?: readonly SortSpec[];
|
|
1167
|
+
/** Select `totalCount` when the connection has it. Default true. */
|
|
1168
|
+
totalCount?: boolean;
|
|
1169
|
+
/** Select `pageInfo` when the connection has it. Default true. */
|
|
1170
|
+
pageInfo?: boolean;
|
|
1171
|
+
/**
|
|
1172
|
+
* Columns to select. The primary key and the local key fields of every
|
|
1173
|
+
* selected relation are always added, so rows keep their identity and their
|
|
1174
|
+
* links. Omitted: every readable column.
|
|
1175
|
+
*/
|
|
1176
|
+
columns?: readonly string[];
|
|
1177
|
+
}
|
|
1178
|
+
interface ListPageInfo {
|
|
1179
|
+
hasNextPage: boolean;
|
|
1180
|
+
hasPreviousPage: boolean;
|
|
1181
|
+
startCursor: string | null;
|
|
1182
|
+
endCursor: string | null;
|
|
1183
|
+
}
|
|
1184
|
+
interface ListResult {
|
|
1185
|
+
/** Rows; connection relations are flattened to arrays, their totals kept under {@link RELATION_TOTAL_COUNTS_KEY}. */
|
|
1186
|
+
rows: RowRecord[];
|
|
1187
|
+
/** Total matching rows, or null when not selected or not available. */
|
|
1188
|
+
totalCount: number | null;
|
|
1189
|
+
/** Page info, or null when not selected or not available. */
|
|
1190
|
+
pageInfo: ListPageInfo | null;
|
|
1191
|
+
}
|
|
1192
|
+
interface ListDocument extends ModelDocument<RowRecord, Record<string, unknown>> {
|
|
1193
|
+
/**
|
|
1194
|
+
* Read the response data. Field errors that belong to one cell of one row
|
|
1195
|
+
* are kept on that row under {@link CELL_ERRORS_KEY}, so the rest of the page
|
|
1196
|
+
* still shows. Any other error throws.
|
|
1197
|
+
*/
|
|
1198
|
+
read(data: unknown, errors?: readonly ResponseErrorLike[]): ListResult;
|
|
1199
|
+
}
|
|
1200
|
+
interface RowDocument extends ModelDocument<RowRecord, Record<string, unknown>> {
|
|
1201
|
+
/** Read the returned row, or null. */
|
|
1202
|
+
read(data: unknown): RowRecord | null;
|
|
1203
|
+
/**
|
|
1204
|
+
* Update and delete: whether the write changed a row. True when the payload returned the
|
|
1205
|
+
* record; false when it came back without one, because no row matched (a row rule hides the
|
|
1206
|
+
* row from this writer, or the row is gone) and the server reports that without an error;
|
|
1207
|
+
* null when the document selects no record and cannot tell.
|
|
1208
|
+
*/
|
|
1209
|
+
applied?(data: unknown): boolean | null;
|
|
1210
|
+
}
|
|
1211
|
+
interface FindOneDocument extends ModelDocument<RowRecord, Record<string, unknown>> {
|
|
1212
|
+
/** Read the row, or null. Like a list read, an error of one cell is kept on the row under {@link CELL_ERRORS_KEY}. */
|
|
1213
|
+
read(data: unknown, errors?: readonly ResponseErrorLike[]): RowRecord | null;
|
|
1214
|
+
}
|
|
1215
|
+
interface MutationDocumentOptions {
|
|
1216
|
+
/** Columns the payload returns. Default: every readable column. */
|
|
1217
|
+
returning?: readonly string[];
|
|
1218
|
+
}
|
|
1219
|
+
/** The error of a cell the API could not serve, or null. */
|
|
1220
|
+
declare function readCellError(row: Readonly<RowRecord> | null | undefined, fieldName: string): string | null;
|
|
1221
|
+
/** The `totalCount` of a connection relation on a list row, or null when it was not selected. */
|
|
1222
|
+
declare function readRelationTotalCount(row: Readonly<RowRecord> | null | undefined, fieldName: string): number | null;
|
|
1223
|
+
/** List rows through the table's list field. */
|
|
1224
|
+
declare function buildListDocument(model: TableModel, options?: ListDocumentOptions): ListDocument;
|
|
1225
|
+
/** Read one row through the list field filtered by its primary key. */
|
|
1226
|
+
declare function buildFindOneDocument(model: TableModel, key: RowKey, options?: RelationSelectionOptions): FindOneDocument;
|
|
1227
|
+
/** Create one row. `values` are encoded by the write codec; unknown or non-writable fields throw. */
|
|
1228
|
+
declare function buildCreateDocument(model: TableModel, values: Readonly<Record<string, unknown>>, options?: MutationDocumentOptions): RowDocument;
|
|
1229
|
+
/** Update one row by its primary key. `patch` is encoded by the write codec. */
|
|
1230
|
+
declare function buildUpdateDocument(model: TableModel, key: RowKey, patch: Readonly<Record<string, unknown>>, options?: MutationDocumentOptions): RowDocument;
|
|
1231
|
+
/** Delete one row by its primary key. */
|
|
1232
|
+
declare function buildDeleteDocument(model: TableModel, key: RowKey): RowDocument;
|
|
1233
|
+
|
|
1234
|
+
/** Encode one column value for a write. Throws `TableModelError` when the column takes no input or the value cannot be encoded. */
|
|
1235
|
+
declare function encodeColumnValue(column: ColumnModel, value: unknown): unknown;
|
|
1236
|
+
/**
|
|
1237
|
+
* Encode a record's values for a create or an update. Every key must be a
|
|
1238
|
+
* column the operation accepts; anything else is an error, never dropped.
|
|
1239
|
+
* `undefined` values are left out.
|
|
1240
|
+
*/
|
|
1241
|
+
declare function encodeWriteValues(model: TableModel, values: Readonly<Record<string, unknown>>, operation: 'create' | 'update'): Record<string, unknown>;
|
|
1242
|
+
|
|
438
1243
|
/**
|
|
439
1244
|
* Core schema types for representing PostGraphile table metadata
|
|
440
1245
|
* These are "clean" versions that remove nullable/undefined complexity
|
|
@@ -928,6 +1733,27 @@ type MetaTableInput = MetaTable$2 | null | undefined;
|
|
|
928
1733
|
*/
|
|
929
1734
|
declare function selectConsoleDataTables(metaTables: readonly MetaTableInput[], options?: SelectConsoleDataTablesOptions): MetaTable$2[];
|
|
930
1735
|
|
|
1736
|
+
/** One table from the platform API: `tables { name category schema { schemaName } }`. */
|
|
1737
|
+
interface PlatformTableCategory {
|
|
1738
|
+
name?: string | null;
|
|
1739
|
+
category?: string | null;
|
|
1740
|
+
schema?: {
|
|
1741
|
+
schemaName?: string | null;
|
|
1742
|
+
} | null;
|
|
1743
|
+
}
|
|
1744
|
+
type TableRole = 'app' | 'system';
|
|
1745
|
+
/** Each catalog table's role, by physical schema and SQL table name. */
|
|
1746
|
+
type TableRoles = ReadonlyMap<string, TableRole>;
|
|
1747
|
+
/** The role of each table the platform catalog lists, for {@link isSystemTable}. */
|
|
1748
|
+
declare function tableRolesFromCatalog(tables: readonly PlatformTableCategory[]): TableRoles;
|
|
1749
|
+
/**
|
|
1750
|
+
* Whether a `_meta` table belongs to a platform module: the catalog files it as a module's, or a
|
|
1751
|
+
* `_meta` fact says so (storage's files and buckets tables, a table scoped to the database itself).
|
|
1752
|
+
* The catalog only adds system tables; without it (or on a server that does not send `tableName`),
|
|
1753
|
+
* the facts alone decide.
|
|
1754
|
+
*/
|
|
1755
|
+
declare function isSystemTable(table: Pick<MetaTable$3, 'schemaName' | 'tableName' | 'storage' | 'scope'>, roles?: TableRoles | null): boolean;
|
|
1756
|
+
|
|
931
1757
|
interface RowIdentityObject {
|
|
932
1758
|
readonly [key: string]: RowIdentityValue;
|
|
933
1759
|
}
|
|
@@ -1847,6 +2673,21 @@ declare function toOrderByTypeName(tableName: string, table?: Table | null): str
|
|
|
1847
2673
|
|
|
1848
2674
|
/** The canonical machine code for any error (`null` when none can be determined). */
|
|
1849
2675
|
declare function getErrorCode(error: unknown): string | null;
|
|
2676
|
+
/**
|
|
2677
|
+
* Server codes that mean the session or its token was rejected. The one list every
|
|
2678
|
+
* transport and `isAuthenticationError` use, so they cannot disagree.
|
|
2679
|
+
*/
|
|
2680
|
+
declare const AUTHENTICATION_ERROR_CODES: readonly string[];
|
|
2681
|
+
/** Whether a machine code (never a message) means the session or its token was rejected. */
|
|
2682
|
+
declare function isAuthenticationCode(code: unknown): boolean;
|
|
2683
|
+
/**
|
|
2684
|
+
* Whether an error means the session ended: an HTTP 401, or a GraphQL error whose
|
|
2685
|
+
* `extensions.code` is one of {@link AUTHENTICATION_ERROR_CODES} (on the error
|
|
2686
|
+
* itself, or on any error of its response, as `errors` or `response.errors`). The
|
|
2687
|
+
* message text is never read, so a permission error whose text mentions
|
|
2688
|
+
* "unauthorized" does not sign anyone out. A `ConstructiveError` counts by its code:
|
|
2689
|
+
* the transports create `UNAUTHENTICATED` only for a 401 or one of those codes.
|
|
2690
|
+
*/
|
|
1850
2691
|
declare function isAuthenticationError(error: unknown): boolean;
|
|
1851
2692
|
/** Whether an error is safe to retry (transient network/timeout/rate-limit). */
|
|
1852
2693
|
declare function isRetryable(error: unknown): boolean;
|
|
@@ -2494,4 +3335,4 @@ declare function buildNodeDataForDataNodeType(dataNodeType: string | undefined,
|
|
|
2494
3335
|
declare function buildNodeData(policyType: string, policyData: Record<string, unknown>): Record<string, unknown>;
|
|
2495
3336
|
declare function groupCrudOperationsByConfig<T extends string>(enabledOperations: T[], operations: Record<T, CrudOperationPolicyConfig>, privilegeMap: Record<T, string>): GroupedCrudPrivileges[];
|
|
2496
3337
|
|
|
2497
|
-
export { type ASTFunctionParams, type ASTNode, CONSTRAINT_MESSAGES, CRUD_OPERATIONS, CRUD_TO_PRIVILEGE, type BelongsToRelation$1 as CleanBelongsToRelation, type CleanField, type HasManyRelation$1 as CleanHasManyRelation, type HasOneRelation$1 as CleanHasOneRelation, type ManyToManyRelation$1 as CleanManyToManyRelation, type Relations$1 as CleanRelations, type CleanTable, type ConnectionResult, type CrudOperation, type CrudOperationPolicyConfig, DATA_NODE_GENERATED_FIELDS, DEFAULT_CONSOLE_APPLICATION_SCOPES, DEFAULT_CRUD_GRANT_PRIVILEGES, type FieldFilter$1 as FieldFilter, type FieldSelection, type FieldSelectionPreset, type Filter$1 as Filter, type FilterOperator$1 as FilterOperator, type GeneratedField, type GraphQLVariableValue, type GraphQLVariables, type GroupedCrudPrivileges, type IQueryBuilder, type IntrospectionQueryResponse, type QueryIntrospectionSchema as IntrospectionSchema, MEMBERSHIP_TYPES, META_CONTRACT_INTROSPECTION_DOCUMENT, META_CONTRACT_INTROSPECTION_SOURCE, META_CONTRACT_REQUIREMENTS, META_CONTRACT_VERSION, META_DOCUMENT, META_QUERY_SOURCE, type MetaBelongsToRelation, type MetaConstraint, type MetaContractCompatibility, MetaContractError, type MetaContractIntrospectionQuery, type MetaContractStatus, type MetaContractTypeAlias, type MetaField$2 as MetaField, type MetaFieldType$2 as MetaFieldType, type MetaForeignConstraint, type MetaHasManyRelation, type MetaHasOneRelation, type MetaManyToManyRelation, type MetaObject, type MetaQuery, type MetaRelations, type MetaSchema, type MetaTable$2 as MetaTable, type MetaType, type Metaschema, type MetaschemaCheckConstraint, type MetaschemaConstraint, type MetaschemaConstraints, type MetaschemaEnum, type MetaschemaExclusionConstraint, type MetaschemaField, type MetaschemaForeignKeyConstraint, type MetaschemaI18n, type MetaschemaI18nField, type MetaschemaIndex, type MetaschemaPrimaryKeyConstraint, type MetaschemaRealtime, type MetaschemaScalarEncoding, type MetaschemaScope, type MetaschemaScopeTier, type MetaschemaSearch, type MetaschemaSearchColumn, type MetaschemaSearchConfig, type MetaschemaStorage, type MetaschemaTable, type MetaschemaTableBelongsToRelation, type MetaschemaTableHasRelation, type MetaschemaTableInflection, type MetaschemaTableManyToManyRelation, type MetaschemaTableQuery, type MetaschemaTableRelation, type MetaschemaType, type MetaschemaUniqueConstraint, type MutationASTParams, type MutationDefinition, type MutationOptions$1 as MutationOptions, type NestedProperties, type ObjectArrayItem, type OrderByItem$1 as OrderByItem, POLICY_PROVISIONING_CONFIG, type PageInfo, type PartialBy, type PolicyFieldComponent, type PolicyFieldOverride, type PolicyFieldType, type PolicyProvisioningCategory, type PolicyProvisioningConfig, type PrepareInputOptions, type MetaField as QBMetaField, type MetaFieldType as QBMetaFieldType, type MetaTable as QBMetaTable, QueryBuilder, type QueryBuilderInstance, type QueryBuilderOptions, type QueryBuilderResult, type QueryDefinition, type QueryFieldSelection, type QueryOptions$1 as QueryOptions, type QueryProperty, type QuerySelectionOptions, type RelationalFilter$1 as RelationalFilter, type RowIdentity, type RowIdentityDefinition, type RowIdentityField, type RowIdentityObject, type RowIdentityResolution, type RowIdentityValue, SCHEMA_INTROSPECTION_QUERY, type ScalarEncodingKind, type SchemaEnumFieldMapping, type SchemaEnumValueToken, type SchemaIntrospectionAnalysis, type SchemaIntrospectionCompatibility, type SchemaIntrospectionCompatibilityStatus, type SelectConsoleDataTablesOptions, type SelectionOptions, type SimpleFieldSelection, type StrictRecord, type TableInflection$1 as TableInflection, type TableOperationNames, type TableQueryNames$1 as TableQueryNames, type TableWriteCapability, type TransformSchemaResult, TypedDocumentString, type ValidationResult, analyzeSchemaIntrospectionCompatibility, asFieldIds, assertMetaContract, assertMetaQuery, assessMetaContract, assessSchemaIntrospectionCompatibility, assessTableWriteCapability, buildCount, buildFindOne, buildNodeData, buildNodeDataForDataNodeType, buildPostGraphileCreate, buildPostGraphileDelete, buildPostGraphileUpdate, buildSelect, buildTypeRegistry, cleanTable, cleanTableToMetaObject, convertFromMetaSchema, convertToSelectionOptions, createASTQueryBuilder, createError, createOne, deleteOne, filterOperations, generateIntrospectionSchema, geometryAst, geometryCollectionAst, geometryPointAst, getAll, getAvailableRelations, getConstraintMessage, getCount, getCustomAst, getCustomAstForCleanField, getCustomOperations, getDataNodeForPolicy, getErrorCode, getFieldsRequiringColumns, getGeneratedFields, getHumanReadableError, getMany, getOne, getPolicyCategory, getPolicyFieldDefaults, getPolicyProvisioningConfig, getRowIdentityDefinition, getSelections, getTableOperationNames, groupCrudOperationsByConfig, hasGeneratedFields, injectSchemaFields, intervalAst, isAuthenticationError, isGraphQLVariableValue, isGraphQLVariables, isIntervalType, isRelationalField, isRetryable, isTableOperation, normalizeInflectionValue, normalizeSchemaEnumInputValues, parseError, parseGraphQLError, parseMetaSearchWeights, patchOne, pgFieldToCamelCase, policyCanBeNodeless, policyRequiresDataNode, prepareCreateInput, prepareMutationInput, preparePatchInput, prepareUpdateInput, requiresSubfieldSelection, resolveRowIdentity, rowIdentityToPrimaryKey, sanitizePolicyData, selectConsoleDataTables, serializeRowIdentity, stripEmpty, toCamelCasePlural, toCamelCaseSingular, toCreateInputTypeName, toCreateMutationName, toDeleteInputTypeName, toDeleteMutationName, toFilterTypeName, toOrderByEnumValue, toOrderByTypeName, toPatchFieldName, toUpdateInputTypeName, toUpdateMutationName, transformSchemaToOperations, validateFieldSelection, validateMetaObject, withRetry };
|
|
3338
|
+
export { type ASTFunctionParams, type ASTNode, AUTHENTICATION_ERROR_CODES, type ArgumentModel, type BuildTableModelInput, CELL_ERRORS_KEY, CONSTRAINT_MESSAGES, CRUD_OPERATIONS, CRUD_TO_PRIVILEGE, type BelongsToRelation$1 as CleanBelongsToRelation, type CleanField, type HasManyRelation$1 as CleanHasManyRelation, type HasOneRelation$1 as CleanHasOneRelation, type ManyToManyRelation$1 as CleanManyToManyRelation, type Relations$1 as CleanRelations, type CleanTable, type ColumnFileModel, type ColumnFilterModel, type ColumnModel, type ColumnOption, type ColumnSemantic, type ColumnSortModel, type ColumnValueKind, type ColumnValueModel, type ColumnWriteModel, type ConnectionResult, type CreateOperationModel, type CrudOperation, type CrudOperationPolicyConfig, DATA_NODE_GENERATED_FIELDS, DEFAULT_CONSOLE_APPLICATION_SCOPES, DEFAULT_CRUD_GRANT_PRIVILEGES, DEFAULT_RELATION_PAGE_SIZE, type DeleteOperationModel, type DisplayFieldOverrides, type DisplayFieldsModel, type FieldFilter$1 as FieldFilter, type FieldSelection, type FieldSelectionPreset, type Filter$1 as Filter, type FilterOperator$1 as FilterOperator, type FilterOperatorModel, type FindOneDocument, type GeneratedField, type GraphQLExecutor, type GraphQLVariableValue, type GraphQLVariables, type GroupedCrudPrivileges, type IQueryBuilder, type InputFieldModel, type InputValueModel, type IntrospectedField, type IntrospectedInputValue, type IntrospectedType, type IntrospectedTypeKind, type IntrospectedTypeRef, type IntrospectionQueryResponse, type QueryIntrospectionSchema as IntrospectionSchema, type ListDocument, type ListDocumentOptions, type ListOperationModel, type ListPageInfo, type ListResult, MEMBERSHIP_TYPES, META_CAPABILITY_INTROSPECTION_DOCUMENT, META_CAPABILITY_INTROSPECTION_SOURCE, META_CONTRACT_INTROSPECTION_DOCUMENT, META_CONTRACT_INTROSPECTION_SOURCE, META_CONTRACT_REQUIREMENTS, META_CONTRACT_VERSION, META_DOCUMENT, META_OPTIONAL_CAPABILITIES, META_QUERY_SOURCE, type MetaBelongsToRelation, type MetaCapabilities, type MetaCapabilityAssessment, type MetaCapabilityIntrospectionQuery, type MetaConstraint, type MetaContractCompatibility, MetaContractError, type MetaContractIntrospectionQuery, type MetaContractStatus, type MetaContractTypeAlias, type MetaField$2 as MetaField, type MetaFieldType$2 as MetaFieldType, type MetaForeignConstraint, type MetaHasManyRelation, type MetaHasOneRelation, type MetaManyToManyRelation, type MetaObject, type MetaOptionalTypeAlias, type MetaQuery, type MetaRelations, type MetaSchema, type MetaTable$2 as MetaTable, type MetaType, type Metaschema, type MetaschemaCheckConstraint, type MetaschemaConstraint, type MetaschemaConstraints, type MetaschemaEnum, type MetaschemaExclusionConstraint, type MetaschemaField, type MetaschemaFileField, type MetaschemaForeignKeyConstraint, type MetaschemaI18n, type MetaschemaI18nField, type MetaschemaIndex, type MetaschemaPrimaryKeyConstraint, type MetaschemaRealtime, type MetaschemaScalarEncoding, type MetaschemaScope, type MetaschemaScopeTier, type MetaschemaSearch, type MetaschemaSearchColumn, type MetaschemaSearchConfig, type MetaschemaStorage, type MetaschemaStorageUpload, type MetaschemaTable, type MetaschemaTableBelongsToRelation, type MetaschemaTableHasRelation, type MetaschemaTableInflection, type MetaschemaTableManyToManyRelation, type MetaschemaTableQuery, type MetaschemaTableRelation, type MetaschemaType, type MetaschemaUniqueConstraint, type ModelDocument, type ModelIssue, type ModelIssueCode, type MutationASTParams, type MutationDefinition, type MutationDocumentOptions, type MutationOptions$1 as MutationOptions, type NestedProperties, type ObjectArrayItem, type OrderByItem$1 as OrderByItem, POLICY_PROVISIONING_CONFIG, type PageInfo, type PartialBy, type PlatformTableCategory, type PolicyFieldComponent, type PolicyFieldOverride, type PolicyFieldType, type PolicyProvisioningCategory, type PolicyProvisioningConfig, type PrepareInputOptions, type MetaField as QBMetaField, type MetaFieldType as QBMetaFieldType, type MetaTable as QBMetaTable, QueryBuilder, type QueryBuilderInstance, type QueryBuilderOptions, type QueryBuilderResult, type QueryDefinition, type QueryFieldSelection, type QueryOptions$1 as QueryOptions, type QueryProperty, type QuerySelectionOptions, RELATION_TOTAL_COUNTS_KEY, type RelationFilterModel, type RelationJunctionModel, type RelationKeyPair, type RelationModel, type RelationModelKind, type RelationSelectionOptions, type RelationTargetModel, type RelationalFilter$1 as RelationalFilter, type ResolveTableModelOptions, type ResponseErrorLike, type RowDocument, type RowIdentity, type RowIdentityDefinition, type RowIdentityField, type RowIdentityObject, type RowIdentityResolution, type RowIdentityValue, type RowKey, type RowRecord, SCHEMA_INTROSPECTION_QUERY, SCHEMA_ROOTS_SOURCE, type ScalarEncodingKind, type SchemaEnumFieldMapping, type SchemaEnumValueToken, type SchemaIntrospectionAnalysis, type SchemaIntrospectionCompatibility, type SchemaIntrospectionCompatibilityStatus, type SchemaRoots, type SchemaTypeIndex, type SchemaTypeLoader, type SelectConsoleDataTablesOptions, type SelectionOptions, type SimpleFieldSelection, type SortDirection, type SortSpec, type StrictRecord, type TableInflection$1 as TableInflection, type TableKey, type TableModel, type TableModelBuild, TableModelError, type TableModelErrorCode, type TableModelResolver, type TableOperationNames, type TableOperations, type TableQueryNames$1 as TableQueryNames, type TableRole, type TableRoles, type TableSearchModel, type TableStorageModel, type TableStorageUploadModel, type TableWriteCapability, type TransformSchemaResult, TypedDocumentString, type UpdateOperationModel, type ValidationResult, analyzeSchemaIntrospectionCompatibility, asFieldIds, assertMetaContract, assertMetaQuery, assessMetaCapabilities, assessMetaContract, assessSchemaIntrospectionCompatibility, assessTableWriteCapability, buildCount, buildCreateDocument, buildDeleteDocument, buildFindOne, buildFindOneDocument, buildListDocument, buildMetaDocument, buildMetaQuerySource, buildNodeData, buildNodeDataForDataNodeType, buildPostGraphileCreate, buildPostGraphileDelete, buildPostGraphileUpdate, buildSchemaTypesSource, buildSelect, buildTableModel, buildTypeRegistry, buildUpdateDocument, cleanTable, cleanTableToMetaObject, convertFromMetaSchema, convertToSelectionOptions, createASTQueryBuilder, createError, createOne, createSchemaTypeLoader, createTableModelResolver, deleteOne, emptyMetaCapabilities, encodeColumnValue, encodeWriteValues, filterOperations, findMetaTable, generateIntrospectionSchema, geometryAst, geometryCollectionAst, geometryPointAst, getAll, getAvailableRelations, getConstraintMessage, getCount, getCustomAst, getCustomAstForCleanField, getCustomOperations, getDataNodeForPolicy, getErrorCode, getFieldsRequiringColumns, getGeneratedFields, getHumanReadableError, getMany, getOne, getPolicyCategory, getPolicyFieldDefaults, getPolicyProvisioningConfig, getRowIdentityDefinition, getSelections, getTableOperationNames, groupCrudOperationsByConfig, hasGeneratedFields, injectSchemaFields, intervalAst, isAuthenticationCode, isAuthenticationError, isGraphQLVariableValue, isGraphQLVariables, isIntervalType, isListTypeRef, isNonNullTypeRef, isRelationalField, isRequiredInput, isRetryable, isSystemTable, isTableOperation, metaTablesOf, namedTypeOf, normalizeInflectionValue, normalizeSchemaEnumInputValues, parseError, parseGraphQLError, parseMetaSearchWeights, patchOne, pgFieldToCamelCase, policyCanBeNodeless, policyRequiresDataNode, prepareCreateInput, prepareMutationInput, preparePatchInput, prepareUpdateInput, printTypeRef, readCellError, readRelationTotalCount, requiresSubfieldSelection, resolveDisplayFields, resolveRowIdentity, rowIdentityToPrimaryKey, sanitizePolicyData, selectConsoleDataTables, serializeRowIdentity, stripEmpty, tableKeyForName, tableKeyOf, tableRolesFromCatalog, toCamelCasePlural, toCamelCaseSingular, toCreateInputTypeName, toCreateMutationName, toDeleteInputTypeName, toDeleteMutationName, toFilterTypeName, toOrderByEnumValue, toOrderByTypeName, toPatchFieldName, toUpdateInputTypeName, toUpdateMutationName, transformSchemaToOperations, validateFieldSelection, validateMetaObject, withRetry };
|