/
types.gen.ts
1823 lines (1814 loc) · 47.3 KB
/
types.gen.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Do not modify this file!
// It was generated by the command "yarn codegen".
// Instead update the code generation logic or the OpenAPI document.
export interface AggregatedHistogramValue {
aggregate: 'histogram';
/** List (array) of buckets to use for histogram aggregates. */
buckets: {
start: number;
count: number;
}[];
/** @example 50 */
interval: number;
/** @example duration */
property: string;
}
export interface AggregatedNumberValue {
/** @example avg */
aggregate: 'avg' | 'min' | 'max' | 'count' | 'sum';
/**
* The property the aggregate was calculated from
* @example duration
*/
property?: string;
/**
* Value returned by the aggregate function
* @example 0.2
*/
value?: number;
}
export interface AggregatedResultItem {
aggregates: AggregatedValueItem[];
/** @example {"name":"PumpName1","tag":"tag01"} */
group?: Record<string, string | number | boolean>;
/** The type of instance */
instanceType: InstanceType;
}
export interface AggregatedResultItemCollection {
items: AggregatedResultItem[];
}
export type AggregatedValueItem =
| AggregatedNumberValue
| AggregatedHistogramValue;
/**
* An aggregate. It consists of a name, an aggregator function, and the field to use for the function.
*/
export type AggregationDefinition =
| AvgAggregateFunctionV3
| CountAggregateFunctionV3
| MinAggregateFunctionV3
| MaxAggregateFunctionV3
| SumAggregateFunctionV3
| HistogramAggregateFunctionV3;
export type AggregationRequest = ViewAggregationRequest;
export type AggregationResponse = AggregatedResultItemCollection & {
typing?: TypeInformation;
};
/**
* Calculates the average from the data stored by the specified property. This aggregation uses an average mean calculation, and not an integral mean.
*/
export interface AvgAggregateFunctionV3 {
avg: {
property: string;
};
}
/**
* An external-id reference to an existing CDF resource type item, such as a time series.
An example could be that for an existing time series stored in the CDF time series resource type with the
external-id 21PT0293, then the value would be set to "21PT029", and the type would be set to "timeseries". There
are no referential integrity guarantees for this, and the client should handle if the time series has been removed
or the client may not have access to it.
Currently, time series, sequence and file references are supported.
*/
export interface CDFExternalIdReference {
/**
* Specifies that the data type is a list of values.
*
*/
list?: boolean;
type: 'timeseries' | 'file' | 'sequence';
}
/**
* Defines an aggregation request. This will let you group, and aggregate supported data types. The request supports filters, and allows optional search matching.
*/
export interface CommonAggregationRequest {
aggregates?: AggregationDefinition[];
/** A filter Domain Specific Language (DSL) used to create advanced filter queries. */
filter?: FilterDefinition;
/**
* The selection of fields to group the results by when doing aggregations. You can specify up to 5 items
* to group by.
*
* When you do not specify any aggregates, the fields listed in the `groupBy` clause will return the unique
* values stored for each field.
*/
groupBy?: string[];
/**
* Limit the number of results returned. The default limit is currently at 100 items.
* @min 1
* @max 1000
*/
limit?: number;
/** Optional list (array) of properties you want to apply the query above to. If you do not list any properties, you search through text fields by default. */
properties?: string[];
/** Optional query string. The API will parse the query string, and use it to match the text properties on elements to use for the aggregate(s). */
query?: string;
}
/**
* Reference to an existing container
*/
export interface ContainerReference {
/** External-id of the container */
externalId: DMSExternalId;
/** Id of the space hosting (containing) the container */
space: SpaceSpecification;
type: 'container';
}
export interface ContainsAllFilterV3 {
/** Matches items where the property contains all the given values. Only apply this filter to multivalued properties. */
containsAll: {
property: DMSFilterProperty;
values: FilterValueList;
};
}
export interface ContainsAnyFilterV3 {
/** Matches items where the property contains one or more of the given values. Only apply this filter to multivalued properties. */
containsAny: {
property: DMSFilterProperty;
values: FilterValueList;
};
}
export interface CorePropertyDefinition {
/** When set to ```true```, the API will increment the property based on its highest current value (max value). You can only use this functionality to increment properties of type `int32` or `int64`. If the property has a different data type, the API will return an error. */
autoIncrement?: boolean;
/**
* Default value to use when you do not specify a value for the property. The default value must be of the same type as what you defined for the property itself.
*
* We do not currently support using default values for array/list types.
*/
defaultValue?: string | number | boolean | object;
/** Description of the content and suggested use for this property. */
description?: string;
/** Readable property name. */
name?: string;
/** Does this property need to be set to a value, or not? */
nullable?: boolean;
}
/**
* Counts the number of items. When you specify a property, it returns the number of non-null values for that property.
*/
export interface CountAggregateFunctionV3 {
count: {
property?: string;
};
}
/**
* Cursor for paging through results.
*/
export interface Cursor {
/** @example 4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo */
cursor?: string;
}
/**
* Build a new query by combining other queries, using boolean operators. We support the `and`, `or`, and
`not` boolean operators.
*/
export type DataModelsBoolFilter =
| {
and: FilterDefinition[];
}
| {
or: FilterDefinition[];
}
| {
not: FilterDefinition;
};
/**
* Leaf filter
*/
export type DataModelsLeafFilter =
| EqualsFilterV3
| InFilterV3
| RangeFilterV3
| PrefixFilterV3
| DMSExistsFilter
| ContainsAnyFilterV3
| ContainsAllFilterV3
| MatchAllFilter
| DataModelsNestedFilter
| OverlapsFilterV3
| HasExistingDataFilterV3;
export interface DataModelsNestedFilter {
/**
* Use `nested` to apply the properties of the direct relation as the filter. `scope` specifies the direct
* relation property you want use as the filtering property.
*
* Example:
* ```
* {
* "nested": {
* "scope": ["some", "direct_relation", "property"],
* "filter": {
* "equals": {
* "property": ["node", "name"],
* "value": "ACME"
* }
* }
* }
* }
*/
nested: {
scope: string[];
filter: FilterDefinition;
};
}
/**
* Direct node relation
*/
export interface DirectNodeRelation {
/** The (optional) required type for the node the direct relation points to. If specified, the node must exist before the direct relation is referenced and of the specified type. If no container specification is used, the node will be auto created with the built-in ```node``` container type, and it does not explicitly have to be created before the node that references it. */
container?: ContainerReference;
type: 'direct';
}
/**
* Reference to the node pointed to by the direct relation. The reference consists of a space and an external-id.
*/
export interface DirectRelationReference {
externalId: NodeOrEdgeExternalId;
space: SpaceSpecification;
}
export interface DMSExistsFilter {
/**
* Will match items that have a value in the specified property.
*
*/
exists: {
property: DMSFilterProperty;
};
}
/**
* @pattern ^[a-zA-Z]([a-zA-Z0-9_]{0,253}[a-zA-Z0-9])?$
*/
export type DMSExternalId = string;
/**
* Property you want to filter. Use a list of strings to specify nested properties.
<u>Example:</u>
You have the object
```
{
"room": {
"id": "b53"
},
"roomId": "a23"
}
```
Use `["room", "id"]` to return the value in the nested `id` property, which is a part of the `room` object.
You can also read the value(s) in the standalone property `roomId` with `["roomId"]`.
*/
export type DMSFilterProperty = string[];
/**
* @pattern ^[a-zA-Z0-9]([.a-zA-Z0-9_-]{0,41}[a-zA-Z0-9])?$
*/
export type DMSVersion = string;
/**
* Edge
*/
export interface EdgeDefinition {
/** The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. */
createdTime: EpochTimestamp;
/** Timestamp when the edge was soft deleted. Note that deleted edges are filtered out of query results, but present in sync results. This means that this value will only be present in sync results. */
deletedTime?: EpochTimestamp;
/** Reference to the node pointed to by the direct relation. The reference consists of a space and an external-id. */
endNode: DirectRelationReference;
/** Unique identifier for the edge. Can also be a null character. */
externalId: NodeOrEdgeExternalId;
instanceType: 'edge';
/** The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. */
lastUpdatedTime: EpochTimestamp;
/** Spaces for the requested view and its containers */
properties?: Record<string, ViewOrContainer>;
/** Id of the space the edge belongs to */
space: SpaceSpecification;
/** Reference to the node pointed to by the direct relation. The reference consists of a space and an external-id. */
startNode: DirectRelationReference;
/** Edge type */
type: DirectRelationReference;
/** Current version of the edge */
version: number;
}
/**
* Property values for the identified/specified view or container
*/
export interface EdgeOrNodeData {
/** Group of property values indexed by a local unique identifier. The identifier has to have a length of between 1 and 255 characters. It must also match the pattern ```^[a-zA-Z0-9][a-zA-Z0-9_-]{0,253}[a-zA-Z0-9]?$``` , and it cannot be any of the following reserved identifiers: ```space```, ```externalId```, ```createdTime```, ```lastUpdatedTime```, ```deletedTime```, and ```extensions```. The maximum number of properties depends on your subscription, and is by default 100. */
properties?: PropertyValueGroupV3;
/** Reference to a view, or a container */
source: SourceReference;
}
/**
* Edge to create or update
*/
export interface EdgeWrite {
/** Reference to the node pointed to by the direct relation. The reference consists of a space and an external-id. */
endNode: DirectRelationReference;
/** Fail the ingestion request if the edge's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the edge (for the specified container or view). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. */
existingVersion?: number;
/** Unique alphanumeric identifier for the edge */
externalId: NodeOrEdgeExternalId;
instanceType: 'edge';
/** Properties to write to in a view or container, for the edge. */
sources?: EdgeOrNodeData[];
/** Id of the space that the edge belongs to. This id cannot be updated. */
space: SpaceSpecification;
/** Reference to the node pointed to by the direct relation. The reference consists of a space and an external-id. */
startNode: DirectRelationReference;
/** Edge type (direct relation) */
type: DirectRelationReference;
}
/**
* The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds.
* @format int64
* @min 0
*/
export type EpochTimestamp = number;
export interface EqualsFilterV3 {
/** Matches items that contain the exact value in the provided property. */
equals: {
property: DMSFilterProperty;
value: FilterValue;
};
}
/**
* A filter Domain Specific Language (DSL) used to create advanced filter queries.
* @example {"and":[{"in":{"property":["tag"],"values":[10011,10011]}},{"range":{"property":["weight"],"gte":0}}]}
*/
export type FilterDefinition = DataModelsBoolFilter | DataModelsLeafFilter;
export type FilterValue = RawPropertyValueV3 | ReferencedPropertyValueV3;
export type FilterValueList =
| RawPropertyValueListV3
| ReferencedPropertyValueV3;
export type FilterValueRange = RangeValue | ReferencedPropertyValueV3;
export interface HasExistingDataFilterV3 {
/** Matches items where data is present in the referenced views, or containers. */
hasData: SourceReference[];
}
/**
* A histogram aggregator function. This function will generate a histogram from the values of the specified property. It uses the specified interval as defined in your `interval` argument.
*/
export interface HistogramAggregateFunctionV3 {
histogram: {
property: string;
interval: number;
};
}
/**
* Should we return property type information as part of the result?
*/
export type IncludeTyping = boolean;
export interface InFilterV3 {
/** Matches items where the property **exactly** matches one of the given values. You can only apply this filter to properties containing a single value. */
in: {
property: DMSFilterProperty;
values: FilterValueList;
};
}
/**
* The type of instance
*/
export type InstanceType = 'node' | 'edge';
export interface LimitWithDefault1000 {
/**
* Limits the number of results to return.
* @min 1
* @max 1000
*/
limit?: number;
}
export interface ListOfSpaceExternalIdsRequestWithTyping {
/** Should we return property type information as part of the result? */
includeTyping?: IncludeTyping;
items: {
instanceType: InstanceType;
externalId: NodeOrEdgeExternalId;
space: SpaceSpecification;
}[];
/** Retrieve properties from the listed - by reference - views. */
sources?: SourceSelectorWithoutPropertiesV3;
}
export interface MatchAllFilter {
/** All the listed items must match the clause. */
matchAll: object;
}
/**
* The function will calculate, and return, the highest - max - value for the property.
*/
export interface MaxAggregateFunctionV3 {
max: {
property: string;
};
}
/**
* The function will calculate, and return, the lowest - min - value for a property.
*/
export interface MinAggregateFunctionV3 {
min: {
property: string;
};
}
/**
* The cursor value used to return (paginate to) the next page of results, when more data is available.
*/
export type NextCursorV3 = string;
export interface NodeAndEdgeCollectionResponseV3Response {
/** List of nodes and edges */
items: NodeOrEdge[];
/** Spaces for the requested view and containers */
typing?: TypeInformationOuter;
}
export interface NodeAndEdgeCollectionResponseWithCursorV3Response {
/** List of nodes and edges */
items: NodeOrEdge[];
/** The cursor value used to return (paginate to) the next page of results, when more data is available. */
nextCursor?: NextCursorV3;
/** Spaces for the requested view and containers */
typing?: TypeInformationOuter;
}
export interface NodeAndEdgeCreateCollection {
/** Should we create missing target nodes of direct relations? If the target-container constraint has been specified for a direct relation, the target node cannot be auto-created. If you want to point direct relations to a space where you have only read access, this option must be set to false. */
autoCreateDirectRelations?: boolean;
/** Should we create missing end nodes for edges when ingesting? By default, the end node of an edge must exist before we can ingest the edge. */
autoCreateEndNodes?: boolean;
/** Should we create missing start nodes for edges when ingesting? By default, the start node of an edge must exist before we can ingest the edge. */
autoCreateStartNodes?: boolean;
/** List of nodes and edges to create/update */
items: NodeOrEdgeCreate[];
/** How do we behave when a property value exists? Do we replace all matching and existing values with the supplied values (`true`)? Or should we merge in new values for properties together with the existing values (`false`)? Note: This setting applies for all nodes or edges specified in the ingestion call. */
replace?: boolean;
/** If existingVersion is specified on any of the nodes/edges in the input, the default behaviour is that the entire ingestion will fail when version conflicts occur. If skipOnVersionConflict is set to true, items with version conflicts will be skipped instead. If no version is specified for nodes/edges, it will do the write directly. */
skipOnVersionConflict?: boolean;
}
/**
* Node
*/
export interface NodeDefinition {
/** The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. */
createdTime: EpochTimestamp;
/** Timestamp when the node was soft deleted. Note that deleted nodes are filtered out of query results, but present in sync results. This means that this value will only be present in sync results. */
deletedTime?: EpochTimestamp;
/** Unique identifier for the node */
externalId: NodeOrEdgeExternalId;
instanceType: 'node';
/** The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. */
lastUpdatedTime: EpochTimestamp;
/** Spaces for the requested view and its containers */
properties?: Record<string, ViewOrContainer>;
/** Id of the space that the node belongs to */
space: SpaceSpecification;
/** Node type */
type?: DirectRelationReference;
/** Current version of the node */
version: number;
}
export type NodeOrEdge = NodeDefinition | EdgeDefinition;
export type NodeOrEdgeCreate = NodeWrite | EdgeWrite;
export interface NodeOrEdgeDeleteRequest {
items: {
instanceType: 'node' | 'edge';
externalId: NodeOrEdgeExternalId;
space: SpaceSpecification;
}[];
}
export interface NodeOrEdgeDeleteResponse {
items: {
instanceType: 'node' | 'edge';
externalId: NodeOrEdgeExternalId;
space: SpaceSpecification;
}[];
}
/**
* @pattern ^[^\\x00]{1,255}$
*/
export type NodeOrEdgeExternalId = string;
export type NodeOrEdgeListRequestV3 = {
includeTyping?: IncludeTyping;
sources?: SourceSelectorWithoutPropertiesV3;
instanceType?: InstanceType;
} & Cursor &
LimitWithDefault1000 &
SortV3 & {
filter?: FilterDefinition;
};
/**
* Searching nodes or edges using properties from a view
*/
export type NodeOrEdgeSearchRequest = SearchRequestV3;
/**
* Node to create or update
*/
export interface NodeWrite {
/** Fail the ingestion request if the node's version is greater than or equal to this value. If no existingVersion is specified, the ingestion will always overwrite any existing data for the edge (for the specified container or view). If existingVersion is set to 0, the upsert will behave as an insert, so it will fail the bulk if the item already exists. If skipOnVersionConflict is set on the ingestion request, then the item will be skipped instead of failing the ingestion request. */
existingVersion?: number;
/** Unique identifier for the node */
externalId: NodeOrEdgeExternalId;
instanceType: 'node';
/** List of source properties to write. The properties are from the view and/or the container(s) making up this node. */
sources?: EdgeOrNodeData[];
/** Id of the space that the node belongs to. This space-id cannot be updated. */
space: SpaceSpecification;
/** Node type (direct relation) */
type?: DirectRelationReference;
}
export interface OverlapsFilterV3 {
/** Matches items where the range made up of the two properties overlap with the provided range. */
overlaps: {
startProperty: DMSFilterProperty;
endProperty: DMSFilterProperty;
gte?: FilterValueRange;
gt?: FilterValueRange;
lte?: FilterValueRange;
lt?: FilterValueRange;
};
}
/**
* A parameterized value
*/
export interface ParameterizedPropertyValueV3 {
parameter: string;
}
export interface PrefixFilterV3 {
/** Matches items that have the prefix in the identified property. This filter is only supported for single value text properties. */
prefix: {
property: DMSFilterProperty;
value: string | ParameterizedPropertyValueV3;
};
}
/**
* Primitive types for the property.
We expect dates to be in the ISO-8601 format, while timestamps are expected to be an epoch value with
millisecond precision. JSON values have to be valid JSON fragments. The maximum allowed size for a JSON
object is 40960 bytes. The maximum allowed length of a key is 128, while the maximum allowed size of a value
is 10240 bytes and you can have up to 256 key-value pairs.
*/
export interface PrimitiveProperty {
/**
* Specifies that the data type is a list of values.
*
*/
list?: boolean;
type:
| 'boolean'
| 'float32'
| 'float64'
| 'int32'
| 'int64'
| 'timestamp'
| 'date'
| 'json';
}
/**
* @pattern ^[a-zA-Z]([a-zA-Z0-9_]{0,253}[a-zA-Z0-9])?$
*/
export type PropertyIdentifierV3 = string;
export interface PropertySortV3 {
direction?: 'ascending' | 'descending';
nullsFirst?: boolean;
/**
* Property you want to filter. Use a list of strings to specify nested properties.
*
* <u>Example:</u>
* You have the object
* ```
* {
* "room": {
* "id": "b53"
* },
* "roomId": "a23"
* }
* Use `["room", "id"]` to return the value in the nested `id` property, which is a part of the `room` object.
* You can also read the value(s) in the standalone property `roomId` with `["roomId"]`.
*/
property: DMSFilterProperty;
}
/**
* Group of property values indexed by a local unique identifier. The identifier has to have a length of between 1 and 255 characters. It must also match the pattern ```^[a-zA-Z0-9][a-zA-Z0-9_-]{0,253}[a-zA-Z0-9]?$``` , and it cannot be any of the following reserved identifiers: ```space```, ```externalId```, ```createdTime```, ```lastUpdatedTime```, ```deletedTime```, and ```extensions```. The maximum number of properties depends on your subscription, and is by default 100.
*/
export type PropertyValueGroupV3 = Record<string, RawPropertyValueV3>;
export interface QueryEdgeTableExpressionV3 {
edges: {
from?: string;
chainTo?: TableExpressionChainToDefinition;
maxDistance?: number;
direction?: 'outwards' | 'inwards';
filter?: TableExpressionFilterDefinition;
nodeFilter?: TableExpressionFilterDefinition;
terminationFilter?: TableExpressionFilterDefinition;
limitEach?: number;
};
limit?: number;
postSort?: PropertySortV3[];
sort?: PropertySortV3[];
}
/**
* Find the common elements in the returned result set. Excludes the elements from the optional `except` result set.
*/
export interface QueryIntersectionTableExpressionV3 {
except?: string[];
intersection: (QuerySetOperationTableExpressionV3 | string)[];
limit?: number;
}
export interface QueryNodeTableExpressionV3 {
limit?: number;
nodes: {
from?: string;
chainTo?: TableExpressionChainToDefinition;
through?: ViewPropertyReference;
direction?: 'outwards' | 'inwards';
filter?: TableExpressionFilterDefinition;
};
sort?: PropertySortV3[];
}
export interface QueryRequest {
/** Cursors returned from the previous query request. These cursors match the result set expressions you specified in the ```with``` clause for the query. */
cursors?: Record<string, NextCursorV3>;
/** Values in filters can be parameterised. Parameters are provided as part of the query object, and referenced in the filter itself. */
parameters?: Record<string, RawPropertyValueV3>;
select: Record<string, QuerySelectV3>;
with: Record<string, QueryTableExpressionV3>;
}
export interface QueryResponse {
items: Record<string, NodeOrEdge[]>;
nextCursor: Record<string, NextCursorV3>;
}
/**
* Define which view to return properties for, and the properties to return. Up to 10 views can be specified per query.
*/
export interface QuerySelectV3 {
limit?: number;
sort?: PropertySortV3[];
sources?: SourceSelectorV3;
}
export type QuerySetOperationTableExpressionV3 =
| QueryUnionAllTableExpressionV3
| QueryUnionTableExpressionV3
| QueryIntersectionTableExpressionV3;
export type QueryTableExpressionV3 =
| QueryNodeTableExpressionV3
| QueryEdgeTableExpressionV3
| QuerySetOperationTableExpressionV3;
/**
* Return the union of the specified result sets. We will remove the results that match the optional exception
result sets. Note: The operation may return duplicate results since we do not perform deduplication.
*/
export interface QueryUnionAllTableExpressionV3 {
except?: string[];
limit?: number;
unionAll: (QuerySetOperationTableExpressionV3 | string)[];
}
/**
* Return the union of the specified result sets. We will remove the results that match the optional
exception result sets. But this operation does not result in duplicate results as it performs
deduplication.
Note: You should use the `unionAll` operation whenever possible. Using it enables a built-in optimization.
I.e. `A unionAll B` with `limit: n` will execute set operation B, if and only if, A returns less than
n records.
*/
export interface QueryUnionTableExpressionV3 {
except?: string[];
limit?: number;
union: (QuerySetOperationTableExpressionV3 | string)[];
}
export interface RangeFilterV3 {
/**
* Matches items that contain terms within the provided range.
*
* The range must include both an upper and a lower bound. It is not permitted to specify both inclusive
* and exclusive bounds together. E.g. `gte` and `gt`.
* `gte`: Greater than or equal to.
* `gt`: Greater than.
* `lte`: Less than or equal to.
* `lt`: Less than.
*/
range: {
property: DMSFilterProperty;
gte?: FilterValueRange;
gt?: FilterValueRange;
lte?: FilterValueRange;
lt?: FilterValueRange;
};
}
/**
* Value you wish to find in the provided property using a range clause.
*/
export type RangeValue = string | number | number;
/**
* A list of values
*/
export type RawPropertyValueListV3 = (string | number | boolean | object)[];
/**
* A value matching the data type of the defined property
*/
export type RawPropertyValueV3 =
| string
| number
| boolean
| object
| string[]
| boolean[]
| number[]
| object[];
/**
* A property reference value
*/
export interface ReferencedPropertyValueV3 {
property: string[];
}
export type SearchRequestV3 = {
view: ViewReference;
query?: string;
instanceType?: InstanceType;
properties?: string[];
filter?: FilterDefinition;
} & LimitWithDefault1000;
/**
* Edge
*/
export interface SlimEdgeDefinition {
/** The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. */
createdTime: EpochTimestamp;
/** Unique alphanumeric identifier for the edge */
externalId: NodeOrEdgeExternalId;
instanceType: 'edge';
/** The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. */
lastUpdatedTime: EpochTimestamp;
/** Id of the space that the edge belongs to */
space: SpaceSpecification;
/** Current version of the edge */
version: number;
/** Whether or not the edge was modified by this ingestion. We only update the edges if the input differs from the existing state. */
wasModified: boolean;
}
export interface SlimNodeAndEdgeCollectionResponse {
/** List of nodes and edges that were created or updated */
items: SlimNodeOrEdge[];
}
/**
* Node
*/
export interface SlimNodeDefinition {
/** The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. */
createdTime: EpochTimestamp;
/** Unique identifier for the node */
externalId: NodeOrEdgeExternalId;
instanceType: 'node';
/** The number of milliseconds since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC), minus leap seconds. */
lastUpdatedTime: EpochTimestamp;
/** Id of the space that the node belongs to */
space: SpaceSpecification;
/** Current version of the node */
version: number;
/** Whether or not the node was modified by this ingestion. We only update the nodes if the input differs from the existing state. */
wasModified: boolean;
}
export type SlimNodeOrEdge = SlimNodeDefinition | SlimEdgeDefinition;
export interface SortV3 {
sort?: PropertySortV3[];
}
/**
* Reference to a view, or a container
*/
export type SourceReference = ViewReference | ContainerReference;
export type SourceSelectorV3 = {
source: ViewReference;
properties: string[];
}[];
/**
* Retrieve properties from the listed - by reference - views.
*/
export type SourceSelectorWithoutPropertiesV3 = {
source: ViewReference;
}[];
/**
* @pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,41}[a-zA-Z0-9]?$
*/
export type SpaceSpecification = string;
/**
* Calculates the sum from the values of the specified property.
*/
export interface SumAggregateFunctionV3 {
sum: {
property: string;
};
}
/**
* The synchronization query to use when we listen for changes to edges. The edges must also match the specified filter.
*/
export interface SyncEdgeTableExpressionV3 {
edges: {
from?: string;
chainTo?: TableExpressionChainToDefinition;
maxDistance?: number;
direction?: 'outwards' | 'inwards';
filter?: TableExpressionFilterDefinition;
nodeFilter?: TableExpressionFilterDefinition;
terminationFilter?: TableExpressionFilterDefinition;
};
limit?: number;
}
/**
* The synchronization query to use when we listen for changes to nodes. The nodes must also match the specified filter.
*/
export interface SyncNodeTableExpressionV3 {
limit?: number;
nodes: {
from?: string;
chainTo?: TableExpressionChainToDefinition;
through?: ViewPropertyReference;
direction?: 'outwards' | 'inwards';
filter?: TableExpressionFilterDefinition;
};
}
export interface SyncRequest {
/** Cursors returned from the previous sync request. These cursors match the result set expressions you specified in the ```with``` clause for the sync. */
cursors?: Record<string, NextCursorV3>;
/** Parameters to return */
parameters?: Record<string, RawPropertyValueV3>;
select: Record<string, SyncSelectV3>;
with: Record<string, SyncTableExpressionV3>;
}
/**
* Specify the container or view to return properties for. Also specify the properties for those containers/views to return. Up to 10 views can be specified.
*/
export interface SyncSelectV3 {
sources?: SourceSelectorV3;
}
export type SyncTableExpressionV3 =
| SyncNodeTableExpressionV3
| SyncEdgeTableExpressionV3;
/**
* Control which side of the edge to chain to. This option is only applicable if the view referenced in the `from` field consists of edges.
- `source` will chain to `start` if you're following edges outwards i.e `direction=outwards`. If you're following edges inwards i.e `direction=inwards`, it will chain to `end`.
- `destination (default)` will chain to `end` if you're following edges outwards i.e `direction=outwards`. If you're following edges inwards i.e `direction=inwards`, it will chain to `start`.
*/
export type TableExpressionChainToDefinition = 'source' | 'destination';
export interface TableExpressionContainsAllFilterV3 {
/** Matches items where the property contains all the given values. Only apply this filter to multivalued properties. */
containsAll: {
property: DMSFilterProperty;
values: TableExpressionFilterValueList;
};
}
export interface TableExpressionContainsAnyFilterV3 {
/** Matches items where the property contains one or more of the given values. Only apply this filter to multivalued properties. */
containsAny: {
property: DMSFilterProperty;
values: TableExpressionFilterValueList;
};
}
/**
* Build a new query by combining other queries, using boolean operators. We support the `and`, `or`, and
`not` boolean operators.
*/
export type TableExpressionDataModelsBoolFilter =
| {
and: TableExpressionFilterDefinition[];
}
| {
or: TableExpressionFilterDefinition[];
}
| {
not: TableExpressionFilterDefinition;
};
export interface TableExpressionEqualsFilterV3 {
/** Matches items that contain the exact value in the provided property. */
equals: {
property: DMSFilterProperty;
value: TableExpressionFilterValue;
};
}
/**
* A filter Domain Specific Language (DSL) used to create advanced filter queries.
* @example {"and":[{"in":{"property":["tag"],"values":[10011,10011]}},{"range":{"property":["weight"],"gte":0}}]}
*/
export type TableExpressionFilterDefinition =
| TableExpressionDataModelsBoolFilter
| TableExpressionLeafFilter;
export type TableExpressionFilterValue =
| RawPropertyValueV3
| ParameterizedPropertyValueV3
| ReferencedPropertyValueV3;
export type TableExpressionFilterValueList =
| RawPropertyValueListV3
| ParameterizedPropertyValueV3
| ReferencedPropertyValueV3;
export type TableExpressionFilterValueRange =
| RangeValue
| ParameterizedPropertyValueV3
| ReferencedPropertyValueV3;
export interface TableExpressionInFilterV3 {
/** Matches items where the property **exactly** matches one of the given values. You can only apply this filter to properties containing a single value. */
in: {
property: DMSFilterProperty;
values: TableExpressionFilterValueList;
};
}
/**
* Leaf filter
*/
export type TableExpressionLeafFilter =
| TableExpressionEqualsFilterV3
| TableExpressionInFilterV3
| TableExpressionRangeFilterV3
| TableExpressionPrefixFilterV3
| DMSExistsFilter
| TableExpressionContainsAnyFilterV3
| TableExpressionContainsAllFilterV3
| MatchAllFilter
| DataModelsNestedFilter
| TableExpressionOverlapsFilterV3
| HasExistingDataFilterV3;
export interface TableExpressionOverlapsFilterV3 {
/** Matches items where the range made up of the two properties overlap with the provided range. */
overlaps: {
startProperty: DMSFilterProperty;
endProperty: DMSFilterProperty;
gte?: TableExpressionFilterValueRange;
gt?: TableExpressionFilterValueRange;
lte?: TableExpressionFilterValueRange;
lt?: TableExpressionFilterValueRange;
};
}
export interface TableExpressionPrefixFilterV3 {
/** Matches items that have the prefix in the identified property. */
prefix: {
property: DMSFilterProperty;
value: TableExpressionFilterValue;
};
}
export interface TableExpressionRangeFilterV3 {
/**
* Matches items that contain terms within the provided range.
*
* The range must include both an upper and a lower bound. It is not permitted to specify both inclusive
* and exclusive bounds together. E.g. `gte` and `gt`.
* `gte`: Greater than or equal to.
* `gt`: Greater than.
* `lte`: Less than or equal to.
* `lt`: Less than.
*/
range: {
property: DMSFilterProperty;
gte?: TableExpressionFilterValueRange;
gt?: TableExpressionFilterValueRange;
lte?: TableExpressionFilterValueRange;
lt?: TableExpressionFilterValueRange;
};
}
/**
* Text type
*/
export interface TextProperty {
/** Collation - the set of language specific rules - used when sorting text fields */
collation?:
| 'ucs_basic'
| 'und'
| 'af'
| 'af-NA'
| 'af-ZA'
| 'agq'
| 'agq-CM'
| 'ak'
| 'ak-GH'
| 'am'
| 'am-ET'
| 'ar'
| 'ar-001'
| 'ar-AE'
| 'ar-BH'
| 'ar-DJ'
| 'ar-DZ'
| 'ar-EG'
| 'ar-EH'
| 'ar-ER'
| 'ar-IL'
| 'ar-IQ'
| 'ar-JO'
| 'ar-KM'
| 'ar-KW'
| 'ar-LB'
| 'ar-LY'
| 'ar-MA'
| 'ar-MR'
| 'ar-OM'