Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(stable): generate latest types & add types for instances - 02.07.2024 #1120

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,795 changes: 3,542 additions & 253 deletions packages/stable/src/.cognite-openapi-snapshot.json

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions packages/stable/src/api/annotations/types.gen.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions packages/stable/src/api/instances/codegen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"service": "models/instances",
"filter": {
"serviceName": "models/instances"
},
"inlinedSchemas": {
"autoNameRequest": true
}
}
29 changes: 12 additions & 17 deletions packages/stable/src/api/instances/instancesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { BaseResourceAPI, CDFHttpClient, MetadataMap } from '@cognite/sdk-core';
import {
AggregationResponse,
ListOfSpaceExternalIdsRequestWithTyping,
NodeAndEdgeCollectionResponseV3Response,
NodeAndEdgeCollectionResponseWithCursorV3Response,
NodeAndEdgeCreateCollection,
NodeOrEdge,
Expand All @@ -15,7 +14,9 @@ import {
QueryResponse,
SlimNodeAndEdgeCollectionResponse,
SyncRequest,
ViewAggregationRequest,
SearchResponse,
ByIdsResponse,
AggregationRequest,
} from './types.gen';

export class InstancesAPI extends BaseResourceAPI<NodeOrEdge> {
Expand Down Expand Up @@ -47,13 +48,10 @@ export class InstancesAPI extends BaseResourceAPI<NodeOrEdge> {
*/
public search = async (
params: NodeOrEdgeSearchRequest
): Promise<NodeAndEdgeCollectionResponseV3Response> => {
const response = await this.post<NodeAndEdgeCollectionResponseV3Response>(
this.searchUrl,
{
data: params,
}
);
): Promise<SearchResponse> => {
const response = await this.post<SearchResponse>(this.searchUrl, {
data: params,
});
return response.data;
};

Expand Down Expand Up @@ -121,13 +119,10 @@ export class InstancesAPI extends BaseResourceAPI<NodeOrEdge> {
*/
public retrieve = async (
params: ListOfSpaceExternalIdsRequestWithTyping
): Promise<NodeAndEdgeCollectionResponseV3Response> => {
const response = await this.post<NodeAndEdgeCollectionResponseV3Response>(
this.byIdsUrl,
{
data: params,
}
);
): Promise<ByIdsResponse> => {
const response = await this.post<ByIdsResponse>(this.byIdsUrl, {
data: params,
});
return response.data;
};

Expand Down Expand Up @@ -214,7 +209,7 @@ export class InstancesAPI extends BaseResourceAPI<NodeOrEdge> {
* ```
*/
public aggregate = async (
params: ViewAggregationRequest
params: AggregationRequest
): Promise<AggregationResponse> => {
const response = await this.post<AggregationResponse>(this.aggregateUrl, {
data: params,
Expand Down
Loading
Loading