feat: Move id

This commit is contained in:
Wanjohi
2025-10-27 08:39:50 +03:00
parent e9dd18818b
commit 13cb3f15a7
6 changed files with 11 additions and 5 deletions

View File

@@ -1,10 +1,11 @@
import { z } from "zod";
import { Identifier } from "../id.js";
import { Examples } from "../examples.js";
export namespace App {
export const Info = z
.object({
id: z.string().meta({
id: Identifier.schema("app").meta({
description: "The unique identifier of the App",
example: Examples.App.id,
}),

View File

@@ -1,6 +1,7 @@
import { z } from "zod/v4";
import { eq } from "drizzle-orm";
import { fn } from "../utils/fn.js";
import { Identifier } from "../id.js";
import { Examples } from "../examples.js";
import { Database } from "../drizzle/index.js";
import { apiPersonalTokenTable } from "./api.sql.js";
@@ -8,7 +9,7 @@ import { apiPersonalTokenTable } from "./api.sql.js";
export namespace Personal {
export const Info = z
.object({
id: z.string().meta({
id: Identifier.schema("apiPersonal").meta({
description: "The unique identifier of the personal access token",
example: Examples.Token.id,
}),

View File

@@ -1,4 +1,4 @@
import { Identifier } from "./id/index.js";
import { Identifier } from "./id.js";
export namespace Examples {
export const Id = (prefix: keyof typeof Identifier.prefixes) =>
@@ -42,6 +42,10 @@ export namespace Examples {
created: new Date("2024-06-29 19:36:19.000"),
};
export const Session = {
id: Id("session"),
};
export const App = {
id: Id("app"),
secret: "sec_******XXXX",

View File

@@ -1,8 +1,8 @@
import { z } from "zod/v4";
import { fn } from "../utils/fn.js";
import { Actor } from "../actor.js";
import { Identifier } from "../id.js";
import { Examples } from "../examples.js";
import { Identifier } from "../id/index.js";
import { eq, isNull, and } from "drizzle-orm";
import { Database } from "../drizzle/index.js";
import { Limitations, steamTable } from "./steam.sql.js";

View File

@@ -1,9 +1,9 @@
import { z } from "zod/v4";
import { fn } from "../utils/fn.js";
import { Identifier } from "../id.js";
import { userTable } from "./user.sql.js";
import { Examples } from "../examples.js";
import { Polar } from "../polar/index.js";
import { Identifier } from "../id/index.js";
import { Database } from "../drizzle/index.js";
import { eq, and, isNotNull } from "drizzle-orm";