/
types.ts
3560 lines (3109 loc) · 91.8 KB
/
types.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
// Copyright 2020 Cognite AS
import {
CogniteExternalId,
CogniteInternalId,
Cursor,
ExternalId,
FilterQuery,
IdEither,
InternalId,
Limit,
} from '@cognite/sdk-core';
import { AnnotationData } from './api/annotations/types.gen';
export {
ListResponse,
CursorResponse,
ItemsResponse,
ItemsWrapper,
FilterQuery,
Cursor,
Limit,
IdEither,
InternalId,
ExternalId,
CogniteExternalId,
CogniteInternalId,
LogoutUrl,
LogoutUrlResponse,
CursorAndAsyncIterator,
CogniteAsyncIterator,
AutoPagingEachHandler,
AutoPagingEach,
AutoPagingToArrayOptions,
AutoPagingToArray,
} from '@cognite/sdk-core';
export * from './exports.gen';
export * from './api/geospatial/types';
export interface Acl<ActionsType, ScopeType> {
actions: ActionsType[];
scope: ScopeType;
}
export type Acl3D = Acl<AclAction3D, AclScope3D>;
export type AclAction3D = READ | CREATE | UPDATE | DELETE;
export type AclActionAnalytics = READ | EXECUTE | LIST;
export type AclActionApiKeys = LIST | CREATE | DELETE;
export type AclActionAssets = READ | WRITE;
export type AclActionDataSets = READ | WRITE | OWNER;
export type AclActionEvents = READ | WRITE;
export type AclActionFiles = READ | WRITE;
export type AclActionGroups = LIST | READ | CREATE | UPDATE | DELETE;
export type AclActionProjects = LIST | READ | CREATE | UPDATE;
export type AclActionRaw = READ | WRITE | LIST;
export type AclActionSecurityCategories = MEMBEROF | LIST | CREATE | DELETE;
export type AclActionSequences = READ | WRITE;
export type AclActionTemplateGroups = READ | WRITE;
export type AclActionTemplateInstances = READ | WRITE;
export type AclActionTimeseries = READ | WRITE;
export type AclActionUsers = LIST | CREATE | DELETE;
export type AclAnalytics = Acl<AclActionAnalytics, AclScopeAnalytics>;
export type AclApiKeys = Acl<AclActionApiKeys, AclScopeApiKeys>;
export type AclAssets = Acl<AclActionAssets, AclScopeAssets>;
export type AclDataSets = Acl<AclActionDataSets, AclScopeDatasets>;
export type AclEvents = Acl<AclActionEvents, AclScopeEvents>;
export type AclFiles = Acl<AclActionFiles, AclScopeFiles>;
export type AclGroups = Acl<AclActionGroups, AclScopeGroups>;
export type AclProjects = Acl<AclActionProjects, AclScopeProjects>;
export type AclRaw = Acl<AclActionRaw, AclScopeRaw>;
export type AclScope3D = AclScopeAll;
export type AclTemplateGroups = Acl<
AclActionTemplateGroups,
AclScopeTemplateGroups
>;
export type AclTemplateInstances = Acl<
AclActionTemplateInstances,
AclScopeTemplateInstances
>;
export interface AclScopeAll {
all: {};
}
export interface AclScopeIds {
idScope: {
ids: CogniteInternalId[];
};
}
export type AclScopeAnalytics = AclScopeAll;
export type AclScopeApiKeys = AclScopeAll | AclScopeCurrentUser;
export type AclScopeAssets = AclScopeAll | AclScopeDatasetsIds;
export interface AclScopeAssetsId {
assetIdScope: {
subtreeIds: CogniteInternalId[];
};
}
export interface AclScopeCurrentUser {
currentuserscope: {};
}
export type AclScopeDatasets = AclScopeAll | AclScopeIds;
export interface AclScopeDatasetsIds {
datasetScope: {
ids: CogniteInternalId[];
};
}
export type AclScopeEvents = AclScopeAll | AclScopeDatasetsIds;
export type AclScopeFiles = AclScopeAll | AclScopeDatasetsIds;
export type AclScopeGroups = AclScopeAll | AclScopeCurrentUser;
export type AclScopeProjects = AclScopeAll;
export type AclScopeRaw = AclScopeAll;
export type AclScopeSecurityCategories = AclScopeAll;
export type AclScopeSequences = AclScopeAll | AclScopeDatasetsIds;
export type AclScopeTemplateGroups = AclScopeAll | AclScopeDatasetsIds;
export type AclScopeTemplateInstances = AclScopeAll | AclScopeDatasetsIds;
export interface AclScopeTimeSeriesAssetRootIds {
assetRootIdScope: {
rootIds: CogniteInternalId[];
};
}
export type AclScopeTimeseries =
| AclScopeAll
| AclScopeAssetsId
| AclScopeTimeSeriesAssetRootIds
| AclScopeDatasetsIds;
export type AclScopeUsers = AclScopeAll;
export type AclSecurityCategories = Acl<
AclActionSecurityCategories,
AclScopeSecurityCategories
>;
export type AclSequences = Acl<AclActionSequences, AclScopeSequences>;
export type AclTimeseries = Acl<AclActionTimeseries, AclScopeTimeseries>;
export type AclUsers = Acl<AclActionUsers, AclScopeUsers>;
export type Aggregate =
| 'average'
| 'max'
| 'min'
| 'count'
| 'sum'
| 'interpolation'
| 'stepInterpolation'
| 'totalVariation'
| 'continuousVariance'
| 'discreteVariance';
export interface ApiKeyListScope {
/**
* Only available with users:list acl, returns all api keys for this project.
*/
all?: boolean;
/**
* Get api keys for a specific service account, only available to admin users.
*/
serviceAccountId?: CogniteInternalId;
/**
* Whether to include deleted api keys
*/
includeDeleted?: boolean;
}
export interface ApiKeyObject {
/**
* Internal id for the api key
*/
id: CogniteInternalId;
/**
* Id of the service account
*/
serviceAccountId: CogniteInternalId;
createdTime: Date;
/**
* The status of the api key
*/
status: 'ACTIVE' | 'DELETED';
}
export interface ApiKeyRequest {
serviceAccountId: CogniteInternalId;
}
export type ArrayPatchString =
| { set: string[] }
| { add?: string[]; remove?: string[] };
export type ArrayPatchLong =
| { set: number[] }
| { add?: number[]; remove?: number[] };
export type ArrayPatchClaimNames =
| { set: ClaimName[] }
| { add?: ClaimName[]; remove?: ClaimName[] };
export interface Asset
extends ExternalAsset,
AssetInternalId,
CreatedAndLastUpdatedTime {
/**
* The id of the root for the tree this asset belongs to
*/
rootId: CogniteInternalId;
/**
* Aggregated metrics of the asset
*/
aggregates?: AssetAggregateResult;
/**
* The parent's externalId if defined
*/
parentExternalId?: CogniteExternalId;
}
export interface AggregateResponse {
/**
* Size of the aggregation group
*/
count: number;
}
export interface UniqueValuesAggregateResponse extends AggregateResponse {
/**
* A unique value from the requested field
*/
value: string | number;
}
/**
* Response from asset aggregate endpoint
*/
export type AssetAggregate = AggregateResponse;
/**
* Response from event aggregate endpoint
*/
export type EventAggregate = AggregateResponse;
/**
* Response from file aggregate endpoint
*/
export type FileAggregate = AggregateResponse;
/**
* Response from sequence aggregate endpoint
*/
export type SequenceAggregate = AggregateResponse;
/**
* Response from timeseries aggregate endpoint
*/
export type TimeseriesAggregate = AggregateResponse;
/**
* Query schema for asset aggregate endpoint
*/
export interface AssetAggregateQuery {
/**
* Filter on assets with strict matching.
*/
filter?: AssetFilterProps;
}
/**
* Query schema for files aggregate endpoint
*/
export interface FileAggregateQuery {
/**
* Filter on files with strict matching.
*/
filter?: FileFilterProps;
}
/**
* Query schema for timeseries aggregate endpoint
*/
export interface TimeseriesAggregateQuery {
/**
* Filter on timeseries with strict matching.
*/
filter?: TimeseriesFilter;
}
export interface AssetAggregateResult {
/**
* Number of direct descendants for the asset
*/
childCount?: number;
/**
* Asset path depth (number of levels below root node).
*/
depth?: number;
/**
* IDs of assets on the path to the asset.
*/
path?: AssetIdEither[];
}
export type AssetAggregatedProperty = 'childCount' | 'path' | 'depth';
export type AssetChange = AssetChangeById | AssetChangeByExternalId;
export interface AssetChangeByExternalId extends AssetPatch, ExternalId {}
export interface AssetChangeById extends AssetPatch, InternalId {}
/**
* Description of asset.
*/
export type AssetDescription = string;
export type AssetExternalId = ExternalId;
/**
* Filter on assets with exact match
*/
export interface AssetFilter extends Limit {
filter?: AssetFilterProps;
}
export interface AssetFilterProps {
name?: AssetName;
/**
* Return only the direct descendants of the specified assets.
*/
parentIds?: CogniteInternalId[];
/**
* Return only the direct descendants of the specified assets.
*/
parentExternalIds?: CogniteExternalId[];
rootIds?: IdEither[];
/**
* Only include assets that reference these specific dataSet IDs
*/
dataSetIds?: IdEither[];
/**
* Only include assets in subtrees rooted at the specified assets.
* If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.
*/
assetSubtreeIds?: IdEither[];
/**
* Return only the assets matching the specified label constraints.
*/
labels?: LabelFilter;
metadata?: Metadata;
source?: AssetSource;
createdTime?: DateRange;
lastUpdatedTime?: DateRange;
/**
* Filtered assets are root assets or not
*/
root?: boolean;
externalIdPrefix?: ExternalIdPrefix;
}
export type AssetIdEither = IdEither;
export type AssetInternalId = InternalId;
export interface AssetListScope extends AssetFilter, FilterQuery {
/**
* Set of aggregated properties to include
*/
aggregatedProperties?: AssetAggregatedProperty[];
partition?: Partition;
}
export interface AssetMapping3D extends AssetMapping3DBase {
/**
* A number describing the position of this node in the 3D hierarchy, starting from 0.
* The tree is traversed in a depth-first order.
*/
treeIndex: number;
/**
* The number of nodes in the subtree of this node (this number included the node itself).
*/
subtreeSize: number;
}
export interface AssetMapping3DBase {
/**
* The ID of the node.
*/
nodeId: CogniteInternalId;
/**
* The ID of the associated asset (Cognite's Assets API).
*/
assetId: CogniteInternalId;
}
export interface AssetMappings3DListFilter extends FilterQuery {
nodeId?: CogniteInternalId;
assetId?: CogniteInternalId;
/**
* If given, only return asset mappings for assets whose bounding box intersects the given bounding box.
*/
intersectsBoundingBox?: BoundingBox3D;
}
export interface AssetMappings3DAssetFilter {
assetIds: CogniteInternalId[];
}
export interface AssetMappings3DNodeFilter {
nodeIds: CogniteInternalId[];
}
export interface AssetMappings3DTreeIndexFilter {
treeIndexes: CogniteInternalId[];
}
export interface Filter3DAssetMappingsQuery extends FilterQuery {
/**
* A filter for either `assetIds`, `nodeIds` or `treeIndices`.
*/
filter?:
| AssetMappings3DAssetFilter
| AssetMappings3DNodeFilter
| AssetMappings3DTreeIndexFilter;
}
/**
* Name of asset. Often referred to as tag.
*/
export type AssetName = string;
export interface AssetPatch {
update: {
externalId?: SinglePatchString;
name?: SinglePatchRequiredString;
description?: SinglePatchString;
dataSetId?: NullableSinglePatchLong;
metadata?: MetadataPatch;
labels?: LabelsPatch;
source?: SinglePatchString;
};
}
export interface AssetRetrieveParams extends IgnoreUnknownIds {
/**
* Set of aggregated properties to include
*/
aggregatedProperties?: AssetAggregatedProperty[];
}
export interface AssetSearchFilter extends AssetFilter {
search?: {
name?: AssetName;
query?: AssetName | AssetDescription;
description?: AssetDescription;
};
}
/**
* The source of this asset
*/
export type AssetSource = string;
/**
* Data specific to Azure AD authentication
*/
export interface AzureADConfiguration {
/**
* Azure application ID. You get this when creating the Azure app.
*/
appId?: string;
/**
* Azure application secret. You get this when creating the Azure app.
*/
appSecret?: string;
/**
* Azure tenant ID.
*/
tenantId?: string;
/**
* Resource to grant access to. This is usually (always?) 00000002-0000-0000-c000-000000000000
*/
appResourceId?: string;
}
/**
* The bounding box of the subtree with this sector as the root sector.
* Is null if there are no geometries in the subtree.
*/
export interface BoundingBox3D {
/**
* The minimal coordinates of the bounding box.
*/
min: Tuple3<number>;
/**
* The maximal coordinates of the bounding box.
*/
max: Tuple3<number>;
}
export type CREATE = 'CREATE';
export type CogniteCapability = SingleCogniteCapability[];
export interface CogniteEvent
extends ExternalEvent,
InternalId,
CreatedAndLastUpdatedTime {}
export type CreateAssetMapping3D = AssetMapping3DBase;
export interface CreateModel3D {
/**
* The name of the model.
*/
name: string;
metadata?: Metadata;
dataSetId?: number;
}
export interface CreateRevision3D {
/**
* True if the revision is marked as published.
*/
published?: boolean;
/**
* Global rotation to be applied to the entire model.
* The rotation is expressed by Euler angles in radians and in XYZ order.
*/
rotation?: Tuple3<number>;
camera?: RevisionCameraProperties;
/**
* The file id to a file uploaded to Cognite's Files API.
* Can only be set on revision creation, and can never be updated. _Only FBX files are supported_.
*/
fileId: CogniteInternalId;
metadata?: Metadata;
}
export interface CreatedAndLastUpdatedTime {
lastUpdatedTime: Date;
createdTime: Date;
}
export interface CreatedAndLastUpdatedTimeFilter {
lastUpdatedTime?: DateRange;
createdTime?: DateRange;
}
export type DELETE = 'DELETE';
export interface DataIds {
items?: AssetIdEither[];
}
export interface DataSet
extends ExternalDataSet,
InternalId,
CreatedAndLastUpdatedTime {
writeProtected: DataSetWriteProtected;
}
/**
* Response from dataset aggregate endpoint
*/
export interface DataSetAggregate {
/**
* Size of the aggregation group
*/
count: number;
}
/**
* Query schema for datasets aggregate endpoint
*/
export interface DataSetAggregateQuery {
/**
* Filter on datasets with strict matching.
*/
filter?: DataSetFilter;
}
export type DataSetChange = DataSetChangeById | DataSetChangeByExternalId;
export interface DataSetChangeByExternalId extends DataSetPatch, ExternalId {}
export interface DataSetChangeById extends DataSetPatch, InternalId {}
export type Label = ExternalId;
export type LabelFilter = LabelContainsAnyFilter | LabelContainsAllFilter;
export interface LabelContainsAnyFilter {
containsAny: Label[];
}
export interface LabelContainsAllFilter {
containsAll: Label[];
}
export interface LabelsPatch {
/**
* A list of labels to add to the resource
*/
add?: Label[];
/**
* A list of labels to remove to the resource
*/
remove?: Label[];
}
export interface ExternalLabelDefinition extends Label {
/**
* Name of the label.
*/
name: string;
/**
* Description of the label.
*/
description?: string;
}
export interface LabelDefinition extends ExternalLabelDefinition {
createdTime: Date;
}
export interface LabelDefinitionFilter {
/**
* Returns the label definitions matching that name.
*/
name?: string;
/**
* Filter external ids starting with the prefix specified
*/
externalIdPrefix?: ExternalIdPrefix;
}
export interface LabelDefinitionFilterRequest extends FilterQuery {
filter?: LabelDefinitionFilter;
}
/**
* Filter on data sets with exact match
*/
export interface DataSetFilter extends CreatedAndLastUpdatedTimeFilter {
metadata?: Metadata;
externalIdPrefix?: ExternalIdPrefix;
writeProtected?: DataSetWriteProtected;
}
export interface DataSetFilterRequest extends FilterQuery {
filter?: DataSetFilter;
}
export interface DataSetPatch {
update: {
externalId?: SinglePatchString;
name?: SinglePatchString;
description?: SinglePatchString;
metadata?: MetadataPatch;
writeProtected?: SetField<boolean>;
};
}
/**
* Write-protected data sets impose additional restrictions on write access to resources inside a data set which can help ensuring data integrity of the data set.
* For write-protected data set in addition to a writing capability that has given resource data in scope, principal must be an owners of the data set.
* Note that this does not affect any security categories set for given resource data, both security category membership and data set ownership is required in such case
*/
export type DataSetWriteProtected = boolean;
export interface DatapointsDeleteRange {
/**
* The timestamp of first datapoint to delete
*/
inclusiveBegin: Timestamp;
/**
* If set, the timestamp of first datapoint after inclusiveBegin to not delete. If not set, only deletes the datapoint at inclusiveBegin.
*/
exclusiveEnd?: Timestamp;
}
export type DatapointsDeleteRequest =
| (InternalId & DatapointsDeleteRange)
| (ExternalId & DatapointsDeleteRange);
export interface DatapointAggregates extends DatapointsMetadata {
isString: false;
/**
* Whether the timeseries is a step series or not
*/
isStep: boolean;
datapoints: DatapointAggregate[];
/**
* The physical unit of the time series (reference to unit catalog). Replaced with target unit if data points were converted.
*/
unitExternalId?: CogniteExternalId;
}
export type Datapoints = StringDatapoints | DoubleDatapoints;
export interface DoubleDatapoints extends DatapointsMetadata {
isString: false;
/**
* Whether the timeseries is a step series or not
*/
isStep?: boolean;
/**
* The list of datapoints
*/
datapoints: DoubleDatapoint[];
/**
* The physical unit of the time series (reference to unit catalog). Replaced with target unit if data points were converted.
*/
unitExternalId?: CogniteExternalId;
}
export interface StringDatapoints extends DatapointsMetadata {
isString: true;
/**
* The list of datapoints
*/
datapoints: StringDatapoint[];
}
export interface ExternalDatapoints {
datapoints: ExternalDatapoint[];
}
export interface DatapointsMetadata extends InternalId {
/**
* External id of the timeseries the datapoints belong to.
*/
externalId?: CogniteExternalId;
/**
* Whether or not the datapoints are string values.
*/
isString: boolean;
/**
* Name of the physical unit of the time series
*/
unit?: string;
}
export interface DatapointsMultiQuery extends DatapointsMultiQueryBase {
items: DatapointsQuery[];
}
export interface DatapointsMonthlyGranularityMultiQuery
extends Omit<DatapointsMultiQueryBase, 'granularity'> {
items: DatapointsQuery[];
}
export interface DatapointsMultiQueryBase extends Limit, IgnoreUnknownIds {
/**
* Get datapoints after this time. Format is N[timeunit]-ago where timeunit is w,d,h,m,s. Example: '2d-ago' will get everything that is up to 2 days old. Can also send in a Date object. Note that when using aggregates, the start time will be rounded down to a whole granularity unit (in UTC timezone). For granularity 2d it will be rounded to 0:00 AM on the same day, for 3h it will be rounded to the start of the hour, etc.
*/
start?: string | Timestamp;
/**
* Get datapoints up to this time. Same format as for start. Note that when using aggregates, the end will be rounded up such that the last aggregate represents a full aggregation interval containing the original end, where the interval is the granularity unit times the granularity multiplier. For granularity 2d, the aggregation interval is 2 days, if end was originally 3 days after the start, it will be rounded to 4 days after the start.
*/
end?: string | Timestamp;
/**
* The aggregates to be returned. This value overrides top-level default aggregates list when set. Specify all aggregates to be retrieved here. Specify empty array if this sub-query needs to return datapoints without aggregation.
*/
aggregates?: Aggregate[];
/**
* The time granularity size and unit to aggregate over.
*/
granularity?: string;
/**
* Whether to include the last datapoint before the requested time period,and the first one after the requested period. This can be useful for interpolating data. Not available for aggregates.
*/
includeOutsidePoints?: boolean;
}
export type ExternalDatapointsQuery =
| ExternalDatapointId
| ExternalDatapointExternalId;
export interface ExternalDatapointExternalId
extends ExternalDatapoints,
ExternalId {}
export interface ExternalDatapointId extends ExternalDatapoints, InternalId {}
export type DatapointsQuery = DatapointsQueryId | DatapointsQueryExternalId;
export interface DatapointsQueryExternalId
extends DatapointsQueryProperties,
ExternalId {}
export interface DatapointsQueryId
extends DatapointsQueryProperties,
InternalId {}
export interface DatapointsQueryProperties extends Limit {
/**
* Get datapoints after this time. Format is N[timeunit]-ago where timeunit is w,d,h,m,s. Example: '2d-ago' will get everything that is up to 2 days old. Can also send in Date object. Note that when using aggregates, the start time will be rounded down to a whole granularity unit (in UTC timezone). For granularity 2d it will be rounded to 0:00 AM on the same day, for 3h it will be rounded to the start of the hour, etc.
*/
start?: string | Timestamp;
/**
* Get datapoints up to this time. Same format as for start. Note that when using aggregates, the end will be rounded up such that the last aggregate represents a full aggregation interval containing the original end, where the interval is the granularity unit times the granularity multiplier. For granularity 2d, the aggregation interval is 2 days, if end was originally 3 days after the start, it will be rounded to 4 days after the start.
*/
end?: string | Timestamp;
/**
* The aggregates to be returned. Use default if null. An empty string must be sent to get raw data if the default is a set of aggregates.
*/
aggregates?: Aggregate[];
/**
* The granularity size and granularity of the aggregates (2h)
*/
granularity?: string;
/**
* Whether to include the last datapoint before the requested time period,and the first one after the requested period. This can be useful for interpolating data. Not available for aggregates.
*/
includeOutsidePoints?: boolean;
/**
* The unit externalId of the data points returned.
* If the time series does not have a unitExternalId that
* can be converted to the targetUnit,
* an error will be returned. Cannot be used with targetUnitSystem.
*/
targetUnit?: CogniteExternalId;
/**
* The unit system of the data points returned. Cannot be used with targetUnit.
*/
targetUnitSystem?: CogniteExternalId;
}
export type DateRange = Range<Timestamp>;
/**
* A default group for all project users. Can be used to establish default capabilities. WARNING: this group may be logically deleted
*/
export type DefaultGroupId = number;
export type DeleteAssetMapping3D = AssetMapping3DBase;
export type EXECUTE = 'EXECUTE';
/**
* Query schema for event aggregate endpoint
*/
export interface EventAggregateQuery {
/**
* Filter on events with strict matching.
*/
filter?: EventFilter;
}
export interface EventUniqueValuesAggregate extends EventAggregateQuery {
/**
* The field name(s) to apply the aggregation on. Currently limited to one field.
*/
fields: ('type' | 'subtype' | 'dataSetId')[];
}
export type EventChange = EventChangeById | EventChangeByExternalId;
export interface EventChangeByExternalId extends EventPatch, ExternalId {}
export interface EventChangeById extends EventPatch, InternalId {}
export interface EventFilter extends CreatedAndLastUpdatedTimeFilter {
startTime?: DateRange;
/**
* Date range for event end time.
* To filter ongoing events {isNull: true} should be provided instead of Date range
*/
endTime?: NullableProperty<DateRange>;
/**
* Event is considered active from its startTime to endTime inclusive. If startTime is null, event is never active. If endTime is null, event is active from startTime onwards. activeAtTime filter will match all events that are active at some point from min to max, from min, or to max, depending on which of min and max parameters are specified.
*/
activeAtTime?: DateRange;
metadata?: Metadata;
/**
* Asset IDs of related equipment that this event relates to.
*/
assetIds?: CogniteInternalId[];
/**
* Asset External IDs of related equipment that this event relates to.
*/
assetExternalIds?: CogniteExternalId[];
/**
* Only include events that reference these specific dataSet IDs
*/
dataSetIds?: IdEither[];
/**
* Only include events that have a related asset in a subtree rooted at any of these assetIds.
* If the total size of the given subtrees exceeds 100,000 assets, an error will be returned.
*/
assetSubtreeIds?: IdEither[];
/**
* Filter by event source
*/
source?: string;
/**
* Filter by event type
*/
type?: string;
/**
* Filter by event subtype
*/
subtype?: string;
externalIdPrefix?: ExternalIdPrefix;
}
export interface EventFilterRequest extends FilterQuery {
filter?: EventFilter;
sort?: EventSort;
partition?: Partition;
}
export interface EventPatch {
update: {
externalId?: SinglePatchString;
startTime?: SinglePatchDate;
endTime?: SinglePatchDate;
description?: SinglePatchString;
metadata?: MetadataPatch;
assetIds?: ArrayPatchLong;
dataSetId?: NullableSinglePatchLong;
source?: SinglePatchString;
type?: SinglePatchString;
subtype?: SinglePatchString;
};
}
export interface EventSearch {
description?: string;
}
export interface EventSearchRequest extends Limit {
filter?: EventFilter;
search?: EventSearch;
}
/**
* Sort by selected fields.
* Only sorting on 1 field is currently supported.
* Partitions are done independently of sorting, there is no guarantee on sort order between elements from different partitions.
*/
export interface EventSort {
startTime?: SortOrder;
endTime?: SortOrder;
createdTime?: SortOrder;
lastUpdatedTime?: SortOrder;
}
export interface ExternalAsset {
externalId?: CogniteExternalId;