mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-11 20:42:16 +00:00
chore: upgrade buf connect v2
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import type { DescService } from "@bufbuild/protobuf";
|
||||
import { Timestamp, timestampDate } from "@bufbuild/protobuf/wkt";
|
||||
import { createPromiseClient, Transport } from "@connectrpc/connect";
|
||||
import { createClient, Transport } from "@connectrpc/connect";
|
||||
|
||||
export function createClientFor<TService extends DescService>(service: TService) {
|
||||
return (transport: Transport) => createPromiseClient(service, transport);
|
||||
return (transport: Transport) => createClient(service, transport);
|
||||
}
|
||||
|
||||
export function toDate(timestamp: Timestamp | undefined): Date | undefined {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { create } from "@bufbuild/protobuf";
|
||||
import { FeatureService } from "@zitadel/proto/zitadel/feature/v2/feature_service_pb";
|
||||
import { IdentityProviderService } from "@zitadel/proto/zitadel/idp/v2/idp_service_pb";
|
||||
import { RequestContext } from "@zitadel/proto/zitadel/object/v2/object_pb";
|
||||
import { RequestContextSchema } from "@zitadel/proto/zitadel/object/v2/object_pb";
|
||||
import { OIDCService } from "@zitadel/proto/zitadel/oidc/v2/oidc_service_pb";
|
||||
import { OrganizationService } from "@zitadel/proto/zitadel/org/v2/org_service_pb";
|
||||
import { SessionService } from "@zitadel/proto/zitadel/session/v2/session_service_pb";
|
||||
@@ -17,8 +18,8 @@ export const createOrganizationServiceClient = createClientFor(OrganizationServi
|
||||
export const createFeatureServiceClient = createClientFor(FeatureService);
|
||||
export const createIdpServiceClient = createClientFor(IdentityProviderService);
|
||||
|
||||
export function makeReqCtx(orgId: string | undefined): Partial<RequestContext> {
|
||||
return {
|
||||
export function makeReqCtx(orgId: string | undefined) {
|
||||
return create(RequestContextSchema, {
|
||||
resourceOwner: orgId ? { case: "orgId", value: orgId } : { case: "instance", value: true },
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user