diff --git a/packages/stable/src/api/groups/groupsApi.ts b/packages/stable/src/api/groups/groupsApi.ts index b297598d19..2e51d25da2 100644 --- a/packages/stable/src/api/groups/groupsApi.ts +++ b/packages/stable/src/api/groups/groupsApi.ts @@ -4,7 +4,6 @@ import { BaseResourceAPI } from '@cognite/sdk-core'; import type { CogniteInternalId, Group, - GroupServiceAccount, GroupSpec, ItemsWrapper, ListGroups, @@ -62,58 +61,4 @@ export class GroupsAPI extends BaseResourceAPI { public delete = (ids: CogniteInternalId[]): Promise => { return super.deleteEndpoint(ids); }; - - /** - * [List service accounts in a group](https://doc.cognitedata.com/api/v1/#operation/getMembersOfGroups) - * - * ```js - * const serviceAccounts = await client.groups.listServiceAccounts(921923342342323); - * ``` - */ - public listServiceAccounts = async ( - groupId: CogniteInternalId - ): Promise => { - const path = this.encodeServiceAccountUrl(groupId); - const response = await this.get>(path); - return this.addToMapAndReturn(response.data.items, response); - }; - - /** - * [Add service accounts to a group](https://doc.cognitedata.com/api/v1/#operation/addServiceAccountsToGroup) - * - * ```js - * await client.groups.addServiceAccounts(921923342342323, [123312763989213, 23232789217132]); - * ``` - */ - public addServiceAccounts = async ( - groupId: CogniteInternalId, - serviceAccountIds: CogniteInternalId[] - ): Promise => { - const path = this.encodeServiceAccountUrl(groupId); - const response = await this.post(path, { - data: { items: serviceAccountIds }, - }); - return this.addToMapAndReturn({}, response); - }; - - /** - * [Remove service accounts from a group](https://doc.cognitedata.com/api/v1/#operation/removeServiceAccountsFromGroup) - * - * ```js - * await client.groups.removeServiceAccounts(921923342342323, [123312763989213, 23232789217132]); - * ``` - */ - public removeServiceAccounts = async ( - groupId: CogniteInternalId, - serviceAccountIds: CogniteInternalId[] - ): Promise => { - const path = `${this.encodeServiceAccountUrl(groupId)}/remove`; - const response = await this.post(path, { - data: { items: serviceAccountIds }, - }); - return this.addToMapAndReturn({}, response); - }; - - private encodeServiceAccountUrl = (groupId: number) => - this.url(`${groupId}/serviceaccounts`); } diff --git a/packages/stable/src/api/serviceAccounts/serviceAccountsApi.ts b/packages/stable/src/api/serviceAccounts/serviceAccountsApi.ts deleted file mode 100644 index 099fefeadc..0000000000 --- a/packages/stable/src/api/serviceAccounts/serviceAccountsApi.ts +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2020 Cognite AS - -import { BaseResourceAPI } from '@cognite/sdk-core'; -import type { - CogniteInternalId, - ItemsWrapper, - ServiceAccount, - ServiceAccountInput, -} from '../../types'; - -export class ServiceAccountsAPI extends BaseResourceAPI { - /** - * @hidden - */ - protected getDateProps() { - return this.pickDateProps(['items'], ['deletedTime']); - } - - /** - * [Create service accounts](https://doc.cognitedata.com/api/v1/#operation/createServiceAccounts) - * - * ```js - * const serviceAccounts = [ - * { name: 'Data extractor' }, - * { name: 'Monitor', groups: [123, 456] }, - * ]; - * const createdServiceAccounts = await client.serviceAccounts.create(serviceAccounts); - * ``` - */ - public create = (items: ServiceAccountInput[]): Promise => { - return this.createEndpoint(items); - }; - - /** - * [List all service accounts](https://doc.cognitedata.com/api/v1/#operation/getServiceAccounts) - * - * ```js - * const serviceaccounts = await client.serviceAccounts.list(); - * ``` - */ - public list = async (): Promise => { - const path = this.url(); - const response = await this.get>(path); - return this.addToMapAndReturn(response.data.items, response); - }; - - /** - * [Delete service accounts](https://doc.cognitedata.com/api/v1/#operation/deleteServiceAccounts) - * - * ```js - * await client.serviceAccounts.delete([123, 456]); - * ``` - */ - public delete = (ids: CogniteInternalId[]): Promise => { - return super.deleteEndpoint(ids); - }; -} diff --git a/packages/stable/src/cogniteClient.ts b/packages/stable/src/cogniteClient.ts index bb2dc28813..1688266e0b 100644 --- a/packages/stable/src/cogniteClient.ts +++ b/packages/stable/src/cogniteClient.ts @@ -30,7 +30,6 @@ import { RawAPI } from './api/raw/rawApi'; import { RelationshipsApi } from './api/relationships/relationshipsApi'; import { SecurityCategoriesAPI } from './api/securityCategories/securityCategoriesApi'; import { SequencesAPI } from './api/sequences/sequencesApi'; -import { ServiceAccountsAPI } from './api/serviceAccounts/serviceAccountsApi'; import { SpacesAPI } from './api/spaces/spacesApi'; import { TemplateGraphQlApi, @@ -80,9 +79,6 @@ export default class CogniteClient extends BaseCogniteClient { public get securityCategories() { return accessApi(this.securityCategoriesApi); } - public get serviceAccounts() { - return accessApi(this.serviceAccountsApi); - } public get models3D() { return accessApi(this.models3DApi); } @@ -190,7 +186,6 @@ export default class CogniteClient extends BaseCogniteClient { private projectsApi?: ProjectsAPI; private groupsApi?: GroupsAPI; private securityCategoriesApi?: SecurityCategoriesAPI; - private serviceAccountsApi?: ServiceAccountsAPI; private models3DApi?: Models3DAPI; private relationshipsApi?: RelationshipsApi; private entityMatchingApi?: EntityMatchingApi; @@ -239,10 +234,6 @@ export default class CogniteClient extends BaseCogniteClient { SecurityCategoriesAPI, 'securitycategories' ); - this.serviceAccountsApi = this.apiFactory( - ServiceAccountsAPI, - 'serviceaccounts' - ); this.models3DApi = this.apiFactory(Models3DAPI, models3DPath); this.relationshipsApi = this.apiFactory(RelationshipsApi, 'relationships'); this.entityMatchingApi = this.apiFactory( diff --git a/packages/stable/src/index.ts b/packages/stable/src/index.ts index 69be380e60..2f24240803 100644 --- a/packages/stable/src/index.ts +++ b/packages/stable/src/index.ts @@ -40,7 +40,6 @@ export { RelationshipsApi } from './api/relationships/relationshipsApi'; export { SecurityCategoriesAPI } from './api/securityCategories/securityCategoriesApi'; export { SequenceRowsAPI } from './api/sequences/sequenceRowsApi'; export { SequencesAPI } from './api/sequences/sequencesApi'; -export { ServiceAccountsAPI } from './api/serviceAccounts/serviceAccountsApi'; export { SyntheticTimeSeriesAPI } from './api/timeSeries/syntheticTimeSeriesApi'; export { TimeSeriesAPI } from './api/timeSeries/timeSeriesApi'; export * from './api/templates'; diff --git a/packages/stable/src/types.ts b/packages/stable/src/types.ts index ce0675e293..4c33af963a 100644 --- a/packages/stable/src/types.ts +++ b/packages/stable/src/types.ts @@ -1374,27 +1374,6 @@ export function isManagedExternallyGroup( */ export type GroupName = string; -export interface GroupServiceAccount { - /** - * Unique name of the service account - * @example some-internal-service@apple.com - */ - name: string; - id: CogniteInternalId; - /** - * List of group ids - */ - groups: CogniteInternalId[]; - /** - * If this service account has been logically deleted - */ - isDeleted: boolean; - /** - * Time of deletion - */ - deletedTime?: Date; -} - /** * ID of the group in the source. If this is the same ID as a group in the IDP, a user in that group will implicitly be a part of this group as well. * @example b7c9a5a4-99c2-4785-bed3-5e6ad9a78603 @@ -2273,30 +2252,6 @@ export const SequenceValueType = { */ export type SequenceValueType = 'STRING' | 'DOUBLE' | 'LONG'; -export interface ServiceAccount { - name: ServiceAccountName; - groups?: Groups; - id: CogniteInternalId; - /** - * If this service account has been logically deleted - */ - isDeleted?: boolean; - /** - * Time of deletion - */ - deletedTime?: Date; -} - -export interface ServiceAccountInput { - name: ServiceAccountName; - groups?: Groups; -} - -/** - * Unique name of the service account - */ -export type ServiceAccountName = string; - export interface SetField { set: T; }