mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 08:32:39 +00:00
Merge branch 'main' into dev
This commit is contained in:
@@ -1,5 +1,19 @@
|
||||
# @zitadel/client
|
||||
|
||||
## 1.0.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 90fbdd1: use node16/nodenext module resolution
|
||||
- Updated dependencies [90fbdd1]
|
||||
- @zitadel/proto@1.0.3
|
||||
|
||||
## 1.0.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 4fa22c0: fix export for grpcweb transport
|
||||
|
||||
## 1.0.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@zitadel/client",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.6",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@@ -31,6 +31,11 @@
|
||||
"types": "./dist/node.d.ts",
|
||||
"import": "./dist/node.js",
|
||||
"require": "./dist/node.cjs"
|
||||
},
|
||||
"./web": {
|
||||
"types": "./dist/web.d.ts",
|
||||
"import": "./dist/web.js",
|
||||
"require": "./dist/web.cjs"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export { createClientFor, toDate } from "./helpers";
|
||||
export { NewAuthorizationBearerInterceptor } from "./interceptors";
|
||||
export { createClientFor, toDate } from "./helpers.js";
|
||||
export { NewAuthorizationBearerInterceptor } from "./interceptors.js";
|
||||
|
||||
// TODO: Move this to `./protobuf.ts` and export it from there
|
||||
export { create, fromJson, toJson } from "@bufbuild/protobuf";
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Int32Value } from "@bufbuild/protobuf/wkt";
|
||||
import { compileService } from "@bufbuild/protocompile";
|
||||
import { createRouterTransport, HandlerContext } from "@connectrpc/connect";
|
||||
import { describe, expect, test, vitest } from "vitest";
|
||||
import { NewAuthorizationBearerInterceptor } from "./interceptors";
|
||||
import { NewAuthorizationBearerInterceptor } from "./interceptors.js";
|
||||
|
||||
const TestService = compileService(`
|
||||
syntax = "proto3";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { createGrpcTransport, GrpcTransportOptions } from "@connectrpc/connect-node";
|
||||
import { createGrpcWebTransport } from "@connectrpc/connect-web";
|
||||
import { importPKCS8, SignJWT } from "jose";
|
||||
import { NewAuthorizationBearerInterceptor } from "./interceptors";
|
||||
import { NewAuthorizationBearerInterceptor } from "./interceptors.js";
|
||||
|
||||
/**
|
||||
* Create a server transport using grpc with the given token and configuration options.
|
||||
@@ -15,18 +14,6 @@ export function createServerTransport(token: string, opts: GrpcTransportOptions)
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a client transport using grpc web with the given token and configuration options.
|
||||
* @param token
|
||||
* @param opts
|
||||
*/
|
||||
export function createClientTransport(token: string, opts: GrpcTransportOptions) {
|
||||
return createGrpcWebTransport({
|
||||
...opts,
|
||||
interceptors: [...(opts.interceptors || []), NewAuthorizationBearerInterceptor(token)],
|
||||
});
|
||||
}
|
||||
|
||||
export async function newSystemToken({
|
||||
audience,
|
||||
subject,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { createClientFor } from "./helpers";
|
||||
import { createClientFor } from "./helpers.js";
|
||||
|
||||
import { AdminService } from "@zitadel/proto/zitadel/admin_pb";
|
||||
import { AuthService } from "@zitadel/proto/zitadel/auth_pb";
|
||||
import { ManagementService } from "@zitadel/proto/zitadel/management_pb";
|
||||
import { SystemService } from "@zitadel/proto/zitadel/system_pb";
|
||||
import { AdminService } from "@zitadel/proto/zitadel/admin_pb.js";
|
||||
import { AuthService } from "@zitadel/proto/zitadel/auth_pb.js";
|
||||
import { ManagementService } from "@zitadel/proto/zitadel/management_pb.js";
|
||||
import { SystemService } from "@zitadel/proto/zitadel/system_pb.js";
|
||||
|
||||
export const createAdminServiceClient = createClientFor(AdminService);
|
||||
export const createAuthServiceClient = createClientFor(AuthService);
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
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 { 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";
|
||||
import { SettingsService } from "@zitadel/proto/zitadel/settings/v2/settings_service_pb";
|
||||
import { UserService } from "@zitadel/proto/zitadel/user/v2/user_service_pb";
|
||||
import { FeatureService } from "@zitadel/proto/zitadel/feature/v2/feature_service_pb.js";
|
||||
import { IdentityProviderService } from "@zitadel/proto/zitadel/idp/v2/idp_service_pb.js";
|
||||
import { RequestContextSchema } from "@zitadel/proto/zitadel/object/v2/object_pb.js";
|
||||
import { OIDCService } from "@zitadel/proto/zitadel/oidc/v2/oidc_service_pb.js";
|
||||
import { OrganizationService } from "@zitadel/proto/zitadel/org/v2/org_service_pb.js";
|
||||
import { SessionService } from "@zitadel/proto/zitadel/session/v2/session_service_pb.js";
|
||||
import { SettingsService } from "@zitadel/proto/zitadel/settings/v2/settings_service_pb.js";
|
||||
import { UserService } from "@zitadel/proto/zitadel/user/v2/user_service_pb.js";
|
||||
|
||||
import { createClientFor } from "./helpers";
|
||||
import { createClientFor } from "./helpers.js";
|
||||
|
||||
export const createUserServiceClient = createClientFor(UserService);
|
||||
export const createSettingsServiceClient = createClientFor(SettingsService);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ZITADELUsers } from "@zitadel/proto/zitadel/resources/user/v3alpha/user_service_pb";
|
||||
import { ZITADELUserSchemas } from "@zitadel/proto/zitadel/resources/userschema/v3alpha/user_schema_service_pb";
|
||||
import { createClientFor } from "./helpers";
|
||||
import { ZITADELUsers } from "@zitadel/proto/zitadel/resources/user/v3alpha/user_service_pb.js";
|
||||
import { ZITADELUserSchemas } from "@zitadel/proto/zitadel/resources/userschema/v3alpha/user_schema_service_pb.js";
|
||||
import { createClientFor } from "./helpers.js";
|
||||
|
||||
export const createUserSchemaServiceClient = createClientFor(ZITADELUserSchemas);
|
||||
export const createUserServiceClient = createClientFor(ZITADELUsers);
|
||||
|
||||
15
packages/zitadel-client/src/web.ts
Normal file
15
packages/zitadel-client/src/web.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { GrpcTransportOptions } from "@connectrpc/connect-node";
|
||||
import { createGrpcWebTransport } from "@connectrpc/connect-web";
|
||||
import { NewAuthorizationBearerInterceptor } from "./interceptors.js";
|
||||
|
||||
/**
|
||||
* Create a client transport using grpc web with the given token and configuration options.
|
||||
* @param token
|
||||
* @param opts
|
||||
*/
|
||||
export function createClientTransport(token: string, opts: GrpcTransportOptions) {
|
||||
return createGrpcWebTransport({
|
||||
...opts,
|
||||
interceptors: [...(opts.interceptors || []), NewAuthorizationBearerInterceptor(token)],
|
||||
});
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { defineConfig, Options } from "tsup";
|
||||
|
||||
export default defineConfig((options: Options) => ({
|
||||
entry: ["src/index.ts", "src/v1.ts", "src/v2.ts", "src/v3alpha.ts", "src/node.ts"],
|
||||
entry: ["src/index.ts", "src/v1.ts", "src/v2.ts", "src/v3alpha.ts", "src/node.ts", "src/web.ts"],
|
||||
format: ["esm", "cjs"],
|
||||
treeshake: false,
|
||||
splitting: true,
|
||||
|
||||
Reference in New Issue
Block a user