Skip to content

Commit 2cfdd4f

Browse files
committed
chore: update API specs
1 parent 0e337f1 commit 2cfdd4f

3 files changed

Lines changed: 117 additions & 44 deletions

File tree

client/src/features/dataConnectorsV2/api/data-connectors.api.ts

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ const injectedRtkApi = api.injectEndpoints({
3333
body: queryArg.globalDataConnectorPost,
3434
}),
3535
}),
36+
getDataConnectorLinks: build.query<
37+
GetDataConnectorLinksApiResponse,
38+
GetDataConnectorLinksApiArg
39+
>({
40+
query: (queryArg) => ({
41+
url: `/data_connector_links`,
42+
params: {
43+
params: queryArg.params,
44+
},
45+
}),
46+
}),
3647
getDataConnectorsByDataConnectorId: build.query<
3748
GetDataConnectorsByDataConnectorIdApiResponse,
3849
GetDataConnectorsByDataConnectorIdApiArg
@@ -256,6 +267,12 @@ export type PostDataConnectorsGlobalApiResponse =
256267
export type PostDataConnectorsGlobalApiArg = {
257268
globalDataConnectorPost: GlobalDataConnectorPost;
258269
};
270+
export type GetDataConnectorLinksApiResponse =
271+
/** status 200 The list of data connector links */ DataConnectorToProjectLinksList;
272+
export type GetDataConnectorLinksApiArg = {
273+
/** query parameters */
274+
params?: DataConnectorLinksGetQuery;
275+
};
259276
export type GetDataConnectorsByDataConnectorIdApiResponse =
260277
/** status 200 The data connector */ DataConnectorRead;
261278
export type GetDataConnectorsByDataConnectorIdApiArg = {
@@ -585,6 +602,17 @@ export type GlobalDataConnectorPost = {
585602
export type GlobalDataConnectorPostRead = {
586603
storage: CloudStorageCorePostRead | CloudStorageUrlV2;
587604
};
605+
export type DataConnectorToProjectLink = {
606+
id: Ulid;
607+
data_connector_id: Ulid;
608+
project_id: Ulid;
609+
creation_date: CreationDate;
610+
created_by: UserId;
611+
};
612+
export type DataConnectorToProjectLinksList = DataConnectorToProjectLink[];
613+
export type DataConnectorLinksGetQuery = PaginationRequest & {
614+
doi?: Doi;
615+
};
588616
export type CloudStorageCorePatch = {
589617
storage_type?: StorageType;
590618
configuration?: RCloneConfig;
@@ -625,14 +653,6 @@ export type DataConnectorPermissions = {
625653
/** The user can manage data connector members */
626654
change_membership?: boolean;
627655
};
628-
export type DataConnectorToProjectLink = {
629-
id: Ulid;
630-
data_connector_id: Ulid;
631-
project_id: Ulid;
632-
creation_date: CreationDate;
633-
created_by: UserId;
634-
};
635-
export type DataConnectorToProjectLinksList = DataConnectorToProjectLink[];
636656
export type DataConnectorToProjectLinkPost = {
637657
project_id: Ulid;
638658
};
@@ -687,6 +707,7 @@ export const {
687707
useGetDataConnectorsQuery,
688708
usePostDataConnectorsMutation,
689709
usePostDataConnectorsGlobalMutation,
710+
useGetDataConnectorLinksQuery,
690711
useGetDataConnectorsByDataConnectorIdQuery,
691712
usePatchDataConnectorsByDataConnectorIdMutation,
692713
useDeleteDataConnectorsByDataConnectorIdMutation,

client/src/features/dataConnectorsV2/api/data-connectors.openapi.json

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,79 @@
144144
"tags": ["data_connectors"]
145145
}
146146
},
147+
"/data_connector_links": {
148+
"get": {
149+
"summary": "Get all data connector links",
150+
"parameters": [
151+
{
152+
"in": "query",
153+
"description": "query parameters",
154+
"name": "params",
155+
"style": "form",
156+
"explode": true,
157+
"schema": {
158+
"$ref": "#/components/schemas/DataConnectorLinksGetQuery"
159+
}
160+
}
161+
],
162+
"responses": {
163+
"200": {
164+
"description": "The list of data connector links",
165+
"content": {
166+
"application/json": {
167+
"schema": {
168+
"$ref": "#/components/schemas/DataConnectorToProjectLinksList"
169+
}
170+
}
171+
},
172+
"headers": {
173+
"page": {
174+
"description": "The index of the current page (starting at 1).",
175+
"required": true,
176+
"schema": {
177+
"type": "integer"
178+
}
179+
},
180+
"per-page": {
181+
"description": "The number of items per page.",
182+
"required": true,
183+
"schema": {
184+
"type": "integer"
185+
}
186+
},
187+
"total": {
188+
"description": "The total number of items.",
189+
"required": true,
190+
"schema": {
191+
"type": "integer"
192+
}
193+
},
194+
"total-pages": {
195+
"description": "The total number of pages.",
196+
"required": true,
197+
"schema": {
198+
"type": "integer"
199+
}
200+
}
201+
}
202+
},
203+
"404": {
204+
"description": "The data connector with the given DOI does not exist or user does not have access to it",
205+
"content": {
206+
"application/json": {
207+
"schema": {
208+
"$ref": "#/components/schemas/ErrorResponse"
209+
}
210+
}
211+
}
212+
},
213+
"default": {
214+
"$ref": "#/components/responses/Error"
215+
}
216+
},
217+
"tags": ["data_connectors"]
218+
}
219+
},
147220
"/data_connectors/{data_connector_id}": {
148221
"parameters": [
149222
{
@@ -1525,6 +1598,21 @@
15251598
"description": "A DOI.",
15261599
"example": "10.16904/envidat.33"
15271600
},
1601+
"DataConnectorLinksGetQuery": {
1602+
"description": "Query params for data connectors get request",
1603+
"allOf": [
1604+
{
1605+
"$ref": "#/components/schemas/PaginationRequest"
1606+
},
1607+
{
1608+
"properties": {
1609+
"doi": {
1610+
"$ref": "#/components/schemas/DOI"
1611+
}
1612+
}
1613+
}
1614+
]
1615+
},
15281616
"DataConnectorsGetQuery": {
15291617
"description": "Query params for data connectors get request",
15301618
"allOf": [

client/src/features/projectsV2/api/projectV2.openapi.json

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,42 +1415,6 @@
14151415
"description": "Entity Tag",
14161416
"example": "9EE498F9D565D0C41E511377425F32F3"
14171417
},
1418-
"DataConnectorToProjectLinksList": {
1419-
"description": "A list of links from a data connector to a project",
1420-
"type": "array",
1421-
"items": {
1422-
"$ref": "#/components/schemas/DataConnectorToProjectLink"
1423-
}
1424-
},
1425-
"DataConnectorToProjectLink": {
1426-
"description": "A link from a data connector to a project in Renku 2.0",
1427-
"type": "object",
1428-
"additionalProperties": false,
1429-
"properties": {
1430-
"id": {
1431-
"$ref": "#/components/schemas/Ulid"
1432-
},
1433-
"data_connector_id": {
1434-
"$ref": "#/components/schemas/Ulid"
1435-
},
1436-
"project_id": {
1437-
"$ref": "#/components/schemas/Ulid"
1438-
},
1439-
"creation_date": {
1440-
"$ref": "#/components/schemas/CreationDate"
1441-
},
1442-
"created_by": {
1443-
"$ref": "#/components/schemas/UserId"
1444-
}
1445-
},
1446-
"required": [
1447-
"id",
1448-
"data_connector_id",
1449-
"project_id",
1450-
"creation_date",
1451-
"created_by"
1452-
]
1453-
},
14541418
"ProjectGetQuery": {
14551419
"description": "Query params for project get request",
14561420
"allOf": [

0 commit comments

Comments
 (0)