feat: react zitadel
This commit is contained in:
4
modules/account/client.ts
Normal file
4
modules/account/client.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export const account = {
|
||||
create: (await import("./routes/create/spec.ts")).default,
|
||||
get: (await import("./routes/get/spec.ts")).default,
|
||||
};
|
||||
14
modules/account/package.json
Normal file
14
modules/account/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "@module/account",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"./server": "./server.ts",
|
||||
"./client": "./client.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@platform/relay": "workspace:*",
|
||||
"zod": "4.1.12"
|
||||
}
|
||||
}
|
||||
5
modules/account/routes/create/handle.ts
Normal file
5
modules/account/routes/create/handle.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import route from "./spec.ts";
|
||||
|
||||
export default route.handle(async ({ body }) => {
|
||||
console.log(body);
|
||||
});
|
||||
13
modules/account/routes/create/spec.ts
Normal file
13
modules/account/routes/create/spec.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { route } from "@platform/relay";
|
||||
import z from "zod";
|
||||
|
||||
export default route.post("/api/v1/account").body(
|
||||
z.strictObject({
|
||||
tenantId: z.uuid().describe("Tenant identifier the account belongs to"),
|
||||
userId: z.uuid().describe("User identifier the account belongs to"),
|
||||
account: z.strictObject({
|
||||
type: z.string().describe("Type of account being created"),
|
||||
number: z.number().describe("Unique account identifier to create for the account"),
|
||||
}),
|
||||
}),
|
||||
);
|
||||
5
modules/account/routes/get/handle.ts
Normal file
5
modules/account/routes/get/handle.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import route from "./spec.ts";
|
||||
|
||||
export default route.handle(async ({ params }) => {
|
||||
console.log(params);
|
||||
});
|
||||
6
modules/account/routes/get/spec.ts
Normal file
6
modules/account/routes/get/spec.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { route } from "@platform/relay";
|
||||
import z from "zod";
|
||||
|
||||
export default route.get("/api/v1/account/:number").params({
|
||||
number: z.number().describe("Account number to retrieve"),
|
||||
});
|
||||
0
modules/account/server.ts
Normal file
0
modules/account/server.ts
Normal file
Reference in New Issue
Block a user