@cognite/sdk-beta
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.3.0](https://github.com/cognitedata/cognite-sdk-js/compare/@cognite/sdk-beta@1.2.0...@cognite/sdk-beta@1.3.0) (2020-11-25) | ||
### Features | ||
* **relationships:** promote new api to stable ([526becc](https://github.com/cognitedata/cognite-sdk-js/commit/526beccaeb95371bc6504da2b434b6095415a878)) | ||
# [1.2.0](https://github.com/cognitedata/cognite-sdk-js/compare/@cognite/sdk-beta@1.1.3...@cognite/sdk-beta@1.2.0) (2020-11-25) | ||
@@ -8,0 +19,0 @@ |
@@ -74,3 +74,3 @@ 'use strict'; | ||
var version="1.2.0"; | ||
var version="1.3.0"; | ||
@@ -240,69 +240,2 @@ // Copyright 2020 Cognite AS | ||
// Copyright 2020 Cognite AS | ||
var RelationshipsApi = /** @class */ (function (_super) { | ||
__extends(RelationshipsApi, _super); | ||
function RelationshipsApi() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
/** | ||
* [Create relationship](https://docs.cognite.com/api/v1/#operation/createRelationships) | ||
* | ||
* ```js | ||
* const relationships = [ | ||
* { | ||
* externalId: 'some_relationship', | ||
* sourceExternalId: 'some_source_external_id', | ||
* sourceType: 'asset' as const, | ||
* targetExternalId: 'some_target_external_id', | ||
* targetType: 'event' as const | ||
* } | ||
* ]; | ||
* const createdRelationships = await client.relationships.create(relationships); | ||
* ``` | ||
*/ | ||
_this.create = function (items) { | ||
return _this.createEndpoint(items); | ||
}; | ||
/** | ||
* [List relationships](https://docs.cognite.com/api/v1/#operation/listRelationships) | ||
* | ||
* ```js | ||
* const relationships = await client.relationships.list({ filter: { createdTime: { min: new Date('1 jan 2018'), max: new Date('1 jan 2019') }}}); | ||
* ``` | ||
*/ | ||
_this.list = function (query) { | ||
return _super.prototype.listEndpoint.call(_this, _this.callListEndpointWithPost, query); | ||
}; | ||
/** | ||
* [Retrieve relationships](https://docs.cognite.com/api/v1/#operation/retrieveRelationships) | ||
* | ||
* ```js | ||
* const relationships = await client.relationships.retrieve([{externalId: 'abc'}, {externalId: 'def'}]); | ||
* ``` | ||
*/ | ||
_this.retrieve = function (ids, params) { | ||
if (params === void 0) { params = {}; } | ||
return _super.prototype.retrieveEndpoint.call(_this, ids, params); | ||
}; | ||
/** | ||
* [Delete relationships](https://doc.cognitedata.com/api/v1/#operation/deleteRelationships) | ||
* | ||
* ```js | ||
* await client.relationships.delete([{externalId: 'abc'}, {externalId: 'def'}]); | ||
* ``` | ||
*/ | ||
_this.delete = function (ids, params) { | ||
if (params === void 0) { params = {}; } | ||
return _super.prototype.deleteEndpoint.call(_this, ids, params); | ||
}; | ||
return _this; | ||
} | ||
/** | ||
* @hidden | ||
*/ | ||
RelationshipsApi.prototype.getDateProps = function () { | ||
return this.pickDateProps(['items'], ['createdTime', 'lastUpdatedTime']); | ||
}; | ||
return RelationshipsApi; | ||
}(sdkCore.BaseResourceAPI)); | ||
// Copyright 2020 Cognite AS | ||
var CogniteClientCleaned = /** @class */ (function (_super) { | ||
@@ -337,9 +270,2 @@ __extends(CogniteClientCleaned, _super); | ||
} | ||
Object.defineProperty(CogniteClient.prototype, "relationships", { | ||
get: function () { | ||
return sdkCore.accessApi(this.relationshipsApi); | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Object.defineProperty(CogniteClient.prototype, "entityMatching", { | ||
@@ -361,3 +287,2 @@ get: function () { | ||
_super.prototype.initAPIs.call(this); | ||
this.relationshipsApi = this.apiFactory(RelationshipsApi, 'relationships'); | ||
this.entityMatchingApi = this.apiFactory(EntityMatchingApi, 'context/entitymatching'); | ||
@@ -397,3 +322,2 @@ }; | ||
exports.EntityMatchingFeatureType = EntityMatchingFeatureType; | ||
exports.RelationshipsApi = RelationshipsApi; | ||
//# sourceMappingURL=index.js.map |
import { ClientOptions, CogniteClient as CogniteClientStable } from '@cognite/sdk'; | ||
import { EntityMatchingApi } from './api/entityMatching/entityMatchingApi'; | ||
import { RelationshipsApi } from './api/relationships/relationshipsApi'; | ||
declare class CogniteClientCleaned extends CogniteClientStable { | ||
} | ||
export default class CogniteClient extends CogniteClientCleaned { | ||
private relationshipsApi?; | ||
private entityMatchingApi?; | ||
@@ -27,3 +25,2 @@ /** | ||
constructor(options: ClientOptions); | ||
get relationships(): RelationshipsApi; | ||
get entityMatching(): EntityMatchingApi; | ||
@@ -30,0 +27,0 @@ protected get version(): string; |
export * from '@cognite/sdk'; | ||
export { default as CogniteClient } from './cogniteClient'; | ||
export * from './api/relationships/relationshipsApi'; | ||
export * from './types'; |
@@ -1,108 +0,2 @@ | ||
import { CogniteExternalId, CogniteInternalId, CreatedAndLastUpdatedTimeFilter, DateRange, FilterQuery, IdEither, Label, Timestamp, Range, LabelFilter, SinglePatchString, CreatedAndLastUpdatedTime } from '@cognite/sdk'; | ||
export declare type RelationshipResourceType = 'asset' | 'timeSeries' | 'file' | 'event' | 'sequence'; | ||
export interface ExternalRelationship { | ||
/** | ||
* External id of the relationship, must be unique within the project | ||
*/ | ||
externalId: CogniteExternalId; | ||
/** | ||
* External id of the CDF resource that constitutes the relationship source | ||
*/ | ||
sourceExternalId: CogniteExternalId; | ||
/** | ||
* Enum: "asset" "timeSeries" "file" "event" "sequence". | ||
* The CDF resource type of the relationship source. Must be one of the specified values. | ||
*/ | ||
sourceType: RelationshipResourceType; | ||
/** | ||
* External id of the CDF resource that constitutes the relationship target. | ||
*/ | ||
targetExternalId: CogniteExternalId; | ||
/** | ||
* Enum: "asset" "timeSeries" "file" "event" "sequence". | ||
* The CDF resource type of the relationship target. Must be one of the specified values. | ||
*/ | ||
targetType: RelationshipResourceType; | ||
/** | ||
* Time when the relationship became active. | ||
* If there is no startTime, relationship is active from the beginning of time until endTime. | ||
*/ | ||
startTime?: Timestamp; | ||
/** | ||
* Time when the relationship became inactive. If there is no endTime, | ||
* relationship is active from startTime until the present or any point in the future. | ||
* If endTime and startTime are set, then endTime must be strictly greater than startTime | ||
*/ | ||
endTime?: Timestamp; | ||
/** | ||
* Confidence value of the existence of this relationship. | ||
* Generated relationships should provide a realistic score on the likelihood of the existence of the relationship. | ||
* Relationships without a confidence value can be interpreted at the discretion of each project. | ||
*/ | ||
confidence?: number; | ||
/** | ||
* The id of the dataset this relationship belongs to | ||
*/ | ||
dataSetId?: CogniteInternalId; | ||
/** | ||
* A list of the labels associated with this resource item | ||
*/ | ||
labels?: Label[]; | ||
} | ||
export interface Relationship extends ExternalRelationship, CreatedAndLastUpdatedTime { | ||
} | ||
export interface RelationshipsFilterRequest extends FilterQuery { | ||
/** | ||
* Filter on relationships with exact match. | ||
* Multiple filter elements in one property, e.g. sourceExternalIds: [ "a", "b" ], | ||
* will return all relationships where the sourceExternalId field is either a or b. | ||
* Filters in multiple properties will return the relationships that match all criteria. | ||
* If the filter is not specified it default to an empty filter. | ||
*/ | ||
filter?: RelationshipsFilter; | ||
} | ||
export interface RelationshipsFilter extends CreatedAndLastUpdatedTimeFilter { | ||
/** | ||
* Include relationships that have any of these values in their sourceExternalId field | ||
*/ | ||
sourceExternalIds?: CogniteExternalId[]; | ||
/** | ||
* Items Enum: "asset" "timeSeries" "file" "event" "sequence". | ||
* Include relationships that have any of these values in their sourceType field | ||
*/ | ||
sourceTypes?: RelationshipResourceType[]; | ||
/** | ||
* Include relationships that have any of these values in their targetExternalId field | ||
*/ | ||
targetExternalIds?: CogniteExternalId[]; | ||
/** | ||
* Items Enum: "asset" "timeSeries" "file" "event" "sequence". | ||
* Include relationships that have any of these values in their targetType field | ||
*/ | ||
targetTypes?: RelationshipResourceType[]; | ||
/** | ||
* Only include relationships that reference these specific dataSet IDs | ||
*/ | ||
dataSetIds?: IdEither[]; | ||
startTime?: DateRange; | ||
endTime?: DateRange; | ||
/** | ||
* Confidence range to filter for | ||
*/ | ||
confidence?: Range<number>; | ||
/** | ||
* Limits results to those active at any point within the given time range, i.e. | ||
* if there is any overlap in the intervals [activeAtTime.min, activeAtTime.max] and [startTime, endTime], | ||
* where both intervals are inclusive. If a relationship does not have a startTime, | ||
* it is regarded as active from the beginning of time by this filter. | ||
* If it does not have an endTime is will be regarded as active until the end of time. | ||
* Similarly, if a min is not supplied to the filter, the min will be implicitly set to the beginning of time, | ||
* and if a max is not supplied, the max will be implicitly set to the end of time. | ||
*/ | ||
activeAtTime?: DateRange; | ||
/** | ||
* Return only the resource matching the specified label constraints | ||
*/ | ||
labels?: LabelFilter; | ||
} | ||
import { CogniteExternalId, CogniteInternalId, FilterQuery, IdEither, SinglePatchString } from '@cognite/sdk'; | ||
export declare type ContextJobStatus = 'QUEUED' | 'RUNNING' | 'COMPLETED' | 'FAILED'; | ||
@@ -109,0 +3,0 @@ export declare const ContextJobStatus: { |
@@ -9,3 +9,3 @@ { | ||
"types": "dist/src/index.d.js", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"scripts": { | ||
@@ -26,3 +26,3 @@ "clean": "rm -rf dist/ docs/ codeSnippets/", | ||
"dependencies": { | ||
"@cognite/sdk": "^3.2.1", | ||
"@cognite/sdk": "^3.3.0", | ||
"@cognite/sdk-core": "^1.0.3" | ||
@@ -33,3 +33,3 @@ }, | ||
}, | ||
"gitHead": "40855ee7f0ac7b939859708f93f1fcd8ea190d3c" | ||
"gitHead": "183fdce9f0d19b585a6059289ee9cea522ca9d04" | ||
} |
@@ -29,4 +29,4 @@ Cognite Javascript SDK beta | ||
See the reference doc of `CogniteClient` [here](https://cognitedata.github.io/cognite-sdk-js/beta/classes/cogniteclientbeta.html). | ||
See the reference doc of `CogniteClient` [here](https://cognitedata.github.io/cognite-sdk-js/beta/classes/_beta_src_cogniteclient_.cogniteclient.html). | ||
The beta API is a superset of stable. See the [stable readme](https://github.com/cognitedata/cognite-sdk-js/blob/master/packages/stable/README.md). |
@@ -10,3 +10,2 @@ // Copyright 2020 Cognite AS | ||
import { EntityMatchingApi } from './api/entityMatching/entityMatchingApi'; | ||
import { RelationshipsApi } from './api/relationships/relationshipsApi'; | ||
@@ -18,3 +17,2 @@ class CogniteClientCleaned extends CogniteClientStable { | ||
export default class CogniteClient extends CogniteClientCleaned { | ||
private relationshipsApi?: RelationshipsApi; | ||
private entityMatchingApi?: EntityMatchingApi; | ||
@@ -43,6 +41,2 @@ | ||
public get relationships() { | ||
return accessApi(this.relationshipsApi); | ||
} | ||
public get entityMatching() { | ||
@@ -59,3 +53,2 @@ return accessApi(this.entityMatchingApi); | ||
this.relationshipsApi = this.apiFactory(RelationshipsApi, 'relationships'); | ||
this.entityMatchingApi = this.apiFactory( | ||
@@ -62,0 +55,0 @@ EntityMatchingApi, |
@@ -5,3 +5,2 @@ // Copyright 2020 Cognite AS | ||
export { default as CogniteClient } from './cogniteClient'; | ||
export * from './api/relationships/relationshipsApi'; | ||
export * from './types'; |
124
src/types.ts
@@ -6,12 +6,5 @@ // Copyright 2020 Cognite AS | ||
CogniteInternalId, | ||
CreatedAndLastUpdatedTimeFilter, | ||
DateRange, | ||
FilterQuery, | ||
IdEither, | ||
Label, | ||
Timestamp, | ||
Range, | ||
LabelFilter, | ||
SinglePatchString, | ||
CreatedAndLastUpdatedTime, | ||
} from '@cognite/sdk'; | ||
@@ -22,119 +15,2 @@ | ||
export type RelationshipResourceType = | ||
| 'asset' | ||
| 'timeSeries' | ||
| 'file' | ||
| 'event' | ||
| 'sequence'; | ||
export interface ExternalRelationship { | ||
/** | ||
* External id of the relationship, must be unique within the project | ||
*/ | ||
externalId: CogniteExternalId; | ||
/** | ||
* External id of the CDF resource that constitutes the relationship source | ||
*/ | ||
sourceExternalId: CogniteExternalId; | ||
/** | ||
* Enum: "asset" "timeSeries" "file" "event" "sequence". | ||
* The CDF resource type of the relationship source. Must be one of the specified values. | ||
*/ | ||
sourceType: RelationshipResourceType; | ||
/** | ||
* External id of the CDF resource that constitutes the relationship target. | ||
*/ | ||
targetExternalId: CogniteExternalId; | ||
/** | ||
* Enum: "asset" "timeSeries" "file" "event" "sequence". | ||
* The CDF resource type of the relationship target. Must be one of the specified values. | ||
*/ | ||
targetType: RelationshipResourceType; | ||
/** | ||
* Time when the relationship became active. | ||
* If there is no startTime, relationship is active from the beginning of time until endTime. | ||
*/ | ||
startTime?: Timestamp; | ||
/** | ||
* Time when the relationship became inactive. If there is no endTime, | ||
* relationship is active from startTime until the present or any point in the future. | ||
* If endTime and startTime are set, then endTime must be strictly greater than startTime | ||
*/ | ||
endTime?: Timestamp; | ||
/** | ||
* Confidence value of the existence of this relationship. | ||
* Generated relationships should provide a realistic score on the likelihood of the existence of the relationship. | ||
* Relationships without a confidence value can be interpreted at the discretion of each project. | ||
*/ | ||
confidence?: number; | ||
/** | ||
* The id of the dataset this relationship belongs to | ||
*/ | ||
dataSetId?: CogniteInternalId; | ||
/** | ||
* A list of the labels associated with this resource item | ||
*/ | ||
labels?: Label[]; | ||
} | ||
export interface Relationship | ||
extends ExternalRelationship, | ||
CreatedAndLastUpdatedTime {} | ||
export interface RelationshipsFilterRequest extends FilterQuery { | ||
/** | ||
* Filter on relationships with exact match. | ||
* Multiple filter elements in one property, e.g. sourceExternalIds: [ "a", "b" ], | ||
* will return all relationships where the sourceExternalId field is either a or b. | ||
* Filters in multiple properties will return the relationships that match all criteria. | ||
* If the filter is not specified it default to an empty filter. | ||
*/ | ||
filter?: RelationshipsFilter; | ||
} | ||
export interface RelationshipsFilter extends CreatedAndLastUpdatedTimeFilter { | ||
/** | ||
* Include relationships that have any of these values in their sourceExternalId field | ||
*/ | ||
sourceExternalIds?: CogniteExternalId[]; | ||
/** | ||
* Items Enum: "asset" "timeSeries" "file" "event" "sequence". | ||
* Include relationships that have any of these values in their sourceType field | ||
*/ | ||
sourceTypes?: RelationshipResourceType[]; | ||
/** | ||
* Include relationships that have any of these values in their targetExternalId field | ||
*/ | ||
targetExternalIds?: CogniteExternalId[]; | ||
/** | ||
* Items Enum: "asset" "timeSeries" "file" "event" "sequence". | ||
* Include relationships that have any of these values in their targetType field | ||
*/ | ||
targetTypes?: RelationshipResourceType[]; | ||
/** | ||
* Only include relationships that reference these specific dataSet IDs | ||
*/ | ||
dataSetIds?: IdEither[]; | ||
startTime?: DateRange; | ||
endTime?: DateRange; | ||
/** | ||
* Confidence range to filter for | ||
*/ | ||
confidence?: Range<number>; | ||
/** | ||
* Limits results to those active at any point within the given time range, i.e. | ||
* if there is any overlap in the intervals [activeAtTime.min, activeAtTime.max] and [startTime, endTime], | ||
* where both intervals are inclusive. If a relationship does not have a startTime, | ||
* it is regarded as active from the beginning of time by this filter. | ||
* If it does not have an endTime is will be regarded as active until the end of time. | ||
* Similarly, if a min is not supplied to the filter, the min will be implicitly set to the beginning of time, | ||
* and if a max is not supplied, the max will be implicitly set to the end of time. | ||
*/ | ||
activeAtTime?: DateRange; | ||
/** | ||
* Return only the resource matching the specified label constraints | ||
*/ | ||
labels?: LabelFilter; | ||
} | ||
export type ContextJobStatus = 'QUEUED' | 'RUNNING' | 'COMPLETED' | 'FAILED'; | ||
@@ -141,0 +17,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
89790
21
1503
Updated@cognite/sdk@^3.3.0