Files
zitadel/console/src/app/services/webkeys.service.ts
T
c46fd01947 fix(packages): cjs, and module resolution fix (#10322)
This PR introduces CJS support for @zitadel/client and @zitadel/proto
from https://github.com/zitadel/zitadel/pull/10290
and fixes a module resolution error of @zitadel/client

---------

Co-authored-by: reluc <[email protected]>
2025-07-25 11:42:48 +00:00

34 lines
1.0 KiB
TypeScript

import { Injectable } from '@angular/core';
import { GrpcService } from './grpc.service';
import type { MessageInitShape } from '@bufbuild/protobuf';
import {
DeleteWebKeyResponse,
ListWebKeysResponse,
CreateWebKeyRequestSchema,
CreateWebKeyResponse,
ActivateWebKeyResponse,
} from '@zitadel/proto/zitadel/webkey/v2beta/webkey_service_pb';
@Injectable({
providedIn: 'root',
})
export class WebKeysService {
constructor(private readonly grpcService: GrpcService) {}
public ListWebKeys(): Promise<ListWebKeysResponse> {
return this.grpcService.webKey['listWebKeys']({});
}
public DeleteWebKey(id: string): Promise<DeleteWebKeyResponse> {
return this.grpcService.webKey['deleteWebKey']({ id });
}
public CreateWebKey(req: MessageInitShape<typeof CreateWebKeyRequestSchema>): Promise<CreateWebKeyResponse> {
return this.grpcService.webKey['createWebKey'](req);
}
public ActivateWebKey(id: string): Promise<ActivateWebKeyResponse> {
return this.grpcService.webKey['activateWebKey']({ id });
}
}