Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
peintnermax authored Feb 13, 2025
2 parents 72f1b7c + d3a57de commit f0d5d17
Show file tree
Hide file tree
Showing 20 changed files with 101 additions and 76 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/iron
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export ZITADEL_SERVICE_USER_TOKEN=<your service account personal access token he
### Setting up local environment

```sh
# Install dependencies. Developing requires Node.js v16
# Install dependencies. Developing requires Node.js v20
pnpm install

# Generate gRPC stubs
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Login UI.
[![npm package](https://img.shields.io/npm/v/@zitadel/proto.svg?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/package/@zitadel/proto)
[![npm package](https://img.shields.io/npm/v/@zitadel/client.svg?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/package/@zitadel/client)

**⚠️ This repo and packages are in alpha state and subject to change ⚠️**
**⚠️ This repo and packages are in beta state and subject to change ⚠️**

The scope of functionality of this repo and packages is under active development.

Expand Down
2 changes: 1 addition & 1 deletion apps/login/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
"@types/ms": "0.7.34",
"@types/node": "22.9.0",
"@types/node": "^20.17.17",
"@types/react": "19.0.2",
"@types/react-dom": "19.0.2",
"@types/tinycolor2": "1.4.3",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@faker-js/faker": "^9.2.0",
"@changesets/cli": "^2.27.9",
"@playwright/test": "^1.48.2",
"@types/node": "^22.9.0",
"@types/node": "^20.17.17",
"@vitejs/plugin-react": "^4.3.3",
"@zitadel/prettier-config": "workspace:*",
"axios": "^1.7.7",
Expand Down
14 changes: 14 additions & 0 deletions packages/zitadel-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 6 additions & 1 deletion packages/zitadel-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zitadel/client",
"version": "1.0.4",
"version": "1.0.6",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -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": [
Expand Down
4 changes: 2 additions & 2 deletions packages/zitadel-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion packages/zitadel-client/src/interceptors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
15 changes: 1 addition & 14 deletions packages/zitadel-client/src/node.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions packages/zitadel-client/src/v1.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
18 changes: 9 additions & 9 deletions packages/zitadel-client/src/v2.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
6 changes: 3 additions & 3 deletions packages/zitadel-client/src/v3alpha.ts
Original file line number Diff line number Diff line change
@@ -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 changes: 15 additions & 0 deletions packages/zitadel-client/src/web.ts
Original file line number Diff line number Diff line change
@@ -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)],
});
}
2 changes: 1 addition & 1 deletion packages/zitadel-client/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 6 additions & 0 deletions packages/zitadel-proto/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @zitadel/proto

## 1.0.3

### Patch Changes

- 90fbdd1: use node16/nodenext module resolution

## 1.0.2

### Patch Changes
Expand Down
1 change: 1 addition & 0 deletions packages/zitadel-proto/buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ plugins:
include_imports: true
opt:
- json_types=true
- import_extension=js
2 changes: 1 addition & 1 deletion packages/zitadel-proto/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zitadel/proto",
"version": "1.0.2",
"version": "1.0.3",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand Down
6 changes: 1 addition & 5 deletions packages/zitadel-tsconfig/tsup.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "tsup",
"extends": "./node20.json",
"compilerOptions": {
"module": "preserve",
"moduleResolution": "Bundler"
}
"extends": "./node20.json"
}
Loading

0 comments on commit f0d5d17

Please sign in to comment.