mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 14:17:32 +00:00
Merge branch 'main' into main
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
# @zitadel/client
|
# @zitadel/client
|
||||||
|
|
||||||
|
## 1.0.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 4fa22c0: fix export for grpcweb transport
|
||||||
|
|
||||||
## 1.0.4
|
## 1.0.4
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@zitadel/client",
|
"name": "@zitadel/client",
|
||||||
"version": "1.0.4",
|
"version": "1.0.5",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
@@ -31,6 +31,11 @@
|
|||||||
"types": "./dist/node.d.ts",
|
"types": "./dist/node.d.ts",
|
||||||
"import": "./dist/node.js",
|
"import": "./dist/node.js",
|
||||||
"require": "./dist/node.cjs"
|
"require": "./dist/node.cjs"
|
||||||
|
},
|
||||||
|
"./web": {
|
||||||
|
"types": "./dist/web.d.ts",
|
||||||
|
"import": "./dist/web.js",
|
||||||
|
"require": "./dist/web.cjs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
import { createGrpcTransport, GrpcTransportOptions } from "@connectrpc/connect-node";
|
import { createGrpcTransport, GrpcTransportOptions } from "@connectrpc/connect-node";
|
||||||
import { createGrpcWebTransport } from "@connectrpc/connect-web";
|
|
||||||
import { importPKCS8, SignJWT } from "jose";
|
import { importPKCS8, SignJWT } from "jose";
|
||||||
import { NewAuthorizationBearerInterceptor } from "./interceptors.js";
|
import { NewAuthorizationBearerInterceptor } from "./interceptors.js";
|
||||||
|
|
||||||
@@ -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({
|
export async function newSystemToken({
|
||||||
audience,
|
audience,
|
||||||
subject,
|
subject,
|
||||||
|
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";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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";
|
import { defineConfig, Options } from "tsup";
|
||||||
|
|
||||||
export default defineConfig((options: Options) => ({
|
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"],
|
format: ["esm", "cjs"],
|
||||||
treeshake: false,
|
treeshake: false,
|
||||||
splitting: true,
|
splitting: true,
|
||||||
|
Reference in New Issue
Block a user