From 719e8d0a791337168147dcbe463b8efa83f8e947 Mon Sep 17 00:00:00 2001 From: aericio <16523741+Aericio@users.noreply.github.com> Date: Tue, 28 May 2024 17:09:30 -1000 Subject: [PATCH] chore(package.json): add exports field --- dist/lib/schema.d.ts | 176 ----------------------------------------- dist/lib/schema.js | 34 -------- dist/lib/schema.js.map | 2 +- dist/lib/types.d.ts | 172 ++++++++++++++++++++++++++++++++++++++++ dist/lib/types.js | 29 +++++++ dist/lib/types.js.map | 2 +- package.json | 18 +++++ src/lib/schema.ts | 44 ----------- src/lib/types.ts | 34 ++++++++ 9 files changed, 255 insertions(+), 256 deletions(-) diff --git a/dist/lib/schema.d.ts b/dist/lib/schema.d.ts index 78cd462..f0b05ae 100644 --- a/dist/lib/schema.d.ts +++ b/dist/lib/schema.d.ts @@ -1,7 +1,3 @@ -import { z } from "zod"; -/** - * Players Schema - */ export declare const players: import("drizzle-orm/pg-core").PgTableWithColumns<{ name: "players"; schema: undefined; @@ -93,35 +89,6 @@ export declare const players: import("drizzle-orm/pg-core").PgTableWithColumns<{ }; dialect: "pg"; }>; -export declare const PlayerSchema: z.ZodObject<{ - uuid: z.ZodString; - username: z.ZodString; - rank: z.ZodString; - equipped_avatar_id: z.ZodString; - equipped_avatar_name: z.ZodString; - created_at: z.ZodOptional; - updated_at: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - uuid: string; - username: string; - rank: string; - equipped_avatar_id: string; - equipped_avatar_name: string; - created_at?: Date | undefined; - updated_at?: Date | undefined; -}, { - uuid: string; - username: string; - rank: string; - equipped_avatar_id: string; - equipped_avatar_name: string; - created_at?: Date | undefined; - updated_at?: Date | undefined; -}>; -export type PlayerSchema = z.infer; -/** - * Cosmetics Schema - */ export declare const cosmetics: import("drizzle-orm/pg-core").PgTableWithColumns<{ name: "cosmetics"; schema: undefined; @@ -320,146 +287,3 @@ export declare const cosmetics: import("drizzle-orm/pg-core").PgTableWithColumns }; dialect: "pg"; }>; -export declare const CosmeticSchema: z.ZodObject<{ - id: z.ZodString; - title: z.ZodObject<{ - neutral: z.ZodString; - }, "strip", z.ZodString, z.objectOutputType<{ - neutral: z.ZodString; - }, z.ZodString, "strip">, z.objectInputType<{ - neutral: z.ZodString; - }, z.ZodString, "strip">>; - description: z.ZodObject<{ - neutral: z.ZodString; - }, "strip", z.ZodString, z.objectOutputType<{ - neutral: z.ZodString; - }, z.ZodString, "strip">, z.objectInputType<{ - neutral: z.ZodString; - }, z.ZodString, "strip">>; - creation_date: z.ZodDate; - last_modified: z.ZodDate; - start_date: z.ZodNullable; - end_date: z.ZodNullable; - thumbnail: z.ZodString; - images: z.ZodArray, "many">; - avg_rating: z.ZodNumber; - ratings: z.ZodObject<{ - Average: z.ZodDefault; - TotalCount: z.ZodDefault; - Count5Star: z.ZodDefault; - Count4Star: z.ZodDefault; - Count3Star: z.ZodDefault; - Count2Star: z.ZodDefault; - Count1Star: z.ZodDefault; - }, "strip", z.ZodTypeAny, { - Average: number; - TotalCount: number; - Count5Star: number; - Count4Star: number; - Count3Star: number; - Count2Star: number; - Count1Star: number; - }, { - Average?: number | undefined; - TotalCount?: number | undefined; - Count5Star?: number | undefined; - Count4Star?: number | undefined; - Count3Star?: number | undefined; - Count2Star?: number | undefined; - Count1Star?: number | undefined; - }>; - price: z.ZodNumber; - manual_tags: z.ZodArray; - row_created: z.ZodOptional; - row_updated: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - id: string; - title: { - neutral: string; - } & { - [k: string]: string; - }; - description: { - neutral: string; - } & { - [k: string]: string; - }; - creation_date: Date; - last_modified: Date; - start_date: Date | null; - end_date: Date | null; - thumbnail: string; - images: { - Id: string; - Tag: string; - Type: string; - Url: string; - }[]; - avg_rating: number; - ratings: { - Average: number; - TotalCount: number; - Count5Star: number; - Count4Star: number; - Count3Star: number; - Count2Star: number; - Count1Star: number; - }; - price: number; - manual_tags: string[]; - row_created?: Date | undefined; - row_updated?: Date | undefined; -}, { - id: string; - title: { - neutral: string; - } & { - [k: string]: string; - }; - description: { - neutral: string; - } & { - [k: string]: string; - }; - creation_date: Date; - last_modified: Date; - start_date: Date | null; - end_date: Date | null; - thumbnail: string; - images: { - Id: string; - Tag: string; - Type: string; - Url: string; - }[]; - avg_rating: number; - ratings: { - Average?: number | undefined; - TotalCount?: number | undefined; - Count5Star?: number | undefined; - Count4Star?: number | undefined; - Count3Star?: number | undefined; - Count2Star?: number | undefined; - Count1Star?: number | undefined; - }; - price: number; - manual_tags: string[]; - row_created?: Date | undefined; - row_updated?: Date | undefined; -}>; -export type CosmeticSchema = z.infer; diff --git a/dist/lib/schema.js b/dist/lib/schema.js index 2eed382..587e27f 100644 --- a/dist/lib/schema.js +++ b/dist/lib/schema.js @@ -1,10 +1,5 @@ import { integer, json, pgTable, real, text, timestamp, } from "drizzle-orm/pg-core"; -import { CosmeticImage, CosmeticLocalizedString, CosmeticRating, } from "./types"; import { sql } from "drizzle-orm"; -import { z } from "zod"; -/** - * Players Schema - */ export const players = pgTable("players", { uuid: text("uuid").primaryKey().notNull(), username: text("username").notNull(), @@ -14,18 +9,6 @@ export const players = pgTable("players", { created_at: timestamp("created_at").defaultNow(), updated_at: timestamp("updated_at").defaultNow(), }); -export const PlayerSchema = z.object({ - uuid: z.string(), - username: z.string(), - rank: z.string(), - equipped_avatar_id: z.string(), - equipped_avatar_name: z.string(), - created_at: z.date().optional(), - updated_at: z.date().optional(), -}); -/** - * Cosmetics Schema - */ export const cosmetics = pgTable("cosmetics", { id: text("id").primaryKey().notNull(), title: json("title").notNull(), @@ -45,21 +28,4 @@ export const cosmetics = pgTable("cosmetics", { row_created: timestamp("row_created").defaultNow(), row_updated: timestamp("row_updated").defaultNow(), }); -export const CosmeticSchema = z.object({ - id: z.string(), - title: CosmeticLocalizedString, - description: CosmeticLocalizedString, - creation_date: z.date(), - last_modified: z.date(), - start_date: z.date().nullable(), - end_date: z.date().nullable(), - thumbnail: z.string(), - images: z.array(CosmeticImage), - avg_rating: z.number(), - ratings: CosmeticRating, - price: z.number(), - manual_tags: z.array(z.string()), - row_created: z.date().optional(), - row_updated: z.date().optional(), -}); //# sourceMappingURL=schema.js.map \ No newline at end of file diff --git a/dist/lib/schema.js.map b/dist/lib/schema.js.map index fb78f23..f399413 100644 --- a/dist/lib/schema.js.map +++ b/dist/lib/schema.js.map @@ -1 +1 @@ -{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/lib/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,SAAS,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,cAAc,GACf,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE;IACxC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE;IACzC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE;IACpC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;IAC5B,kBAAkB,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IACjE,oBAAoB,EAAE,IAAI,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IACrE,UAAU,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,UAAU,EAAE;IAChD,UAAU,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,UAAU,EAAE;CACjD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,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B,KAAK,EAAE;SACP,OAAO,CAAC,GAAG,CAAA,iBAAiB,CAAC;IAChC,WAAW,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC,UAAU,EAAE;IAClD,WAAW,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC,UAAU,EAAE;CACnD,CAAC,CAAC"} \ No newline at end of file diff --git a/dist/lib/types.d.ts b/dist/lib/types.d.ts index 82e3b80..ff996f0 100644 --- a/dist/lib/types.d.ts +++ b/dist/lib/types.d.ts @@ -1,4 +1,33 @@ import { z } from "zod"; +/** + * Player Types + */ +export declare const PlayerSchema: z.ZodObject<{ + uuid: z.ZodString; + username: z.ZodString; + rank: z.ZodString; + equipped_avatar_id: z.ZodString; + equipped_avatar_name: z.ZodString; + created_at: z.ZodOptional; + updated_at: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + uuid: string; + username: string; + rank: string; + equipped_avatar_id: string; + equipped_avatar_name: string; + created_at?: Date | undefined; + updated_at?: Date | undefined; +}, { + uuid: string; + username: string; + rank: string; + equipped_avatar_id: string; + equipped_avatar_name: string; + created_at?: Date | undefined; + updated_at?: Date | undefined; +}>; +export type PlayerSchema = z.infer; /** * Cosmetic Types */ @@ -53,3 +82,146 @@ export declare const CosmeticRating: z.ZodObject<{ Count1Star?: number | undefined; }>; export type CosmeticRating = z.infer; +export declare const CosmeticSchema: z.ZodObject<{ + id: z.ZodString; + title: z.ZodObject<{ + neutral: z.ZodString; + }, "strip", z.ZodString, z.objectOutputType<{ + neutral: z.ZodString; + }, z.ZodString, "strip">, z.objectInputType<{ + neutral: z.ZodString; + }, z.ZodString, "strip">>; + description: z.ZodObject<{ + neutral: z.ZodString; + }, "strip", z.ZodString, z.objectOutputType<{ + neutral: z.ZodString; + }, z.ZodString, "strip">, z.objectInputType<{ + neutral: z.ZodString; + }, z.ZodString, "strip">>; + creation_date: z.ZodDate; + last_modified: z.ZodDate; + start_date: z.ZodNullable; + end_date: z.ZodNullable; + thumbnail: z.ZodString; + images: z.ZodArray, "many">; + avg_rating: z.ZodNumber; + ratings: z.ZodObject<{ + Average: z.ZodDefault; + TotalCount: z.ZodDefault; + Count5Star: z.ZodDefault; + Count4Star: z.ZodDefault; + Count3Star: z.ZodDefault; + Count2Star: z.ZodDefault; + Count1Star: z.ZodDefault; + }, "strip", z.ZodTypeAny, { + Average: number; + TotalCount: number; + Count5Star: number; + Count4Star: number; + Count3Star: number; + Count2Star: number; + Count1Star: number; + }, { + Average?: number | undefined; + TotalCount?: number | undefined; + Count5Star?: number | undefined; + Count4Star?: number | undefined; + Count3Star?: number | undefined; + Count2Star?: number | undefined; + Count1Star?: number | undefined; + }>; + price: z.ZodNumber; + manual_tags: z.ZodArray; + row_created: z.ZodOptional; + row_updated: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + id: string; + title: { + neutral: string; + } & { + [k: string]: string; + }; + description: { + neutral: string; + } & { + [k: string]: string; + }; + creation_date: Date; + last_modified: Date; + start_date: Date | null; + end_date: Date | null; + thumbnail: string; + images: { + Id: string; + Tag: string; + Type: string; + Url: string; + }[]; + avg_rating: number; + ratings: { + Average: number; + TotalCount: number; + Count5Star: number; + Count4Star: number; + Count3Star: number; + Count2Star: number; + Count1Star: number; + }; + price: number; + manual_tags: string[]; + row_created?: Date | undefined; + row_updated?: Date | undefined; +}, { + id: string; + title: { + neutral: string; + } & { + [k: string]: string; + }; + description: { + neutral: string; + } & { + [k: string]: string; + }; + creation_date: Date; + last_modified: Date; + start_date: Date | null; + end_date: Date | null; + thumbnail: string; + images: { + Id: string; + Tag: string; + Type: string; + Url: string; + }[]; + avg_rating: number; + ratings: { + Average?: number | undefined; + TotalCount?: number | undefined; + Count5Star?: number | undefined; + Count4Star?: number | undefined; + Count3Star?: number | undefined; + Count2Star?: number | undefined; + Count1Star?: number | undefined; + }; + price: number; + manual_tags: string[]; + row_created?: Date | undefined; + row_updated?: Date | undefined; +}>; +export type CosmeticSchema = z.infer; diff --git a/dist/lib/types.js b/dist/lib/types.js index 720fc1c..56bd791 100644 --- a/dist/lib/types.js +++ b/dist/lib/types.js @@ -1,4 +1,16 @@ import { z } from "zod"; +/** + * Player Types + */ +export const PlayerSchema = z.object({ + uuid: z.string(), + username: z.string(), + rank: z.string(), + equipped_avatar_id: z.string(), + equipped_avatar_name: z.string(), + created_at: z.date().optional(), + updated_at: z.date().optional(), +}); /** * Cosmetic Types */ @@ -23,4 +35,21 @@ export const CosmeticRating = z.object({ Count2Star: CosmeticRatingDefaultNumber, Count1Star: CosmeticRatingDefaultNumber, }); +export const CosmeticSchema = z.object({ + id: z.string(), + title: CosmeticLocalizedString, + description: CosmeticLocalizedString, + creation_date: z.date(), + last_modified: z.date(), + start_date: z.date().nullable(), + end_date: z.date().nullable(), + thumbnail: z.string(), + images: z.array(CosmeticImage), + avg_rating: z.number(), + ratings: CosmeticRating, + price: z.number(), + manual_tags: z.array(z.string()), + row_created: z.date().optional(), + row_updated: z.date().optional(), +}); //# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/dist/lib/types.js.map b/dist/lib/types.js.map index ad9b87f..e084454 100644 --- a/dist/lib/types.js.map +++ b/dist/lib/types.js.map @@ -1 +1 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC;IACN,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC;KACD,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AAKxB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;CAChB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E;CACjC,CAAC,CAAC"} \ No newline at end of file diff --git a/package.json b/package.json index 7231fbb..cb8e4d4 100644 --- a/package.json +++ b/package.json @@ -22,5 +22,23 @@ "eslint-plugin-prettier": "^5.1.3", "prettier": "^3.2.5", "typescript": "^5.4.5" + }, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./database": { + "types": "./dist/lib/database.d.ts", + "default": "./dist/lib/database.js" + }, + "./tables": { + "types": "./dist/lib/tables.d.ts", + "default": "./dist/lib/tables.js" + }, + "./types": { + "types": "./dist/lib/types.d.ts", + "default": "./dist/lib/types.js" + } } } diff --git a/src/lib/schema.ts b/src/lib/schema.ts index 97849a8..56e899a 100644 --- a/src/lib/schema.ts +++ b/src/lib/schema.ts @@ -6,17 +6,7 @@ import { text, timestamp, } from "drizzle-orm/pg-core"; -import { - CosmeticImage, - CosmeticLocalizedString, - CosmeticRating, -} from "./types"; import { sql } from "drizzle-orm"; -import { z } from "zod"; - -/** - * Players Schema - */ export const players = pgTable("players", { uuid: text("uuid").primaryKey().notNull(), @@ -28,21 +18,6 @@ export const players = pgTable("players", { updated_at: timestamp("updated_at").defaultNow(), }); -export const PlayerSchema = z.object({ - uuid: z.string(), - username: z.string(), - rank: z.string(), - equipped_avatar_id: z.string(), - equipped_avatar_name: z.string(), - created_at: z.date().optional(), - updated_at: z.date().optional(), -}); -export type PlayerSchema = z.infer; - -/** - * Cosmetics Schema - */ - export const cosmetics = pgTable("cosmetics", { id: text("id").primaryKey().notNull(), title: json("title").notNull(), @@ -62,22 +37,3 @@ export const cosmetics = pgTable("cosmetics", { row_created: timestamp("row_created").defaultNow(), row_updated: timestamp("row_updated").defaultNow(), }); - -export const CosmeticSchema = z.object({ - id: z.string(), - title: CosmeticLocalizedString, - description: CosmeticLocalizedString, - creation_date: z.date(), - last_modified: z.date(), - start_date: z.date().nullable(), - end_date: z.date().nullable(), - thumbnail: z.string(), - images: z.array(CosmeticImage), - avg_rating: z.number(), - ratings: CosmeticRating, - price: z.number(), - manual_tags: z.array(z.string()), - row_created: z.date().optional(), - row_updated: z.date().optional(), -}); -export type CosmeticSchema = z.infer; diff --git a/src/lib/types.ts b/src/lib/types.ts index 76f0662..6d7b2ba 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -1,5 +1,20 @@ import { z } from "zod"; +/** + * Player Types + */ + +export const PlayerSchema = z.object({ + uuid: z.string(), + username: z.string(), + rank: z.string(), + equipped_avatar_id: z.string(), + equipped_avatar_name: z.string(), + created_at: z.date().optional(), + updated_at: z.date().optional(), +}); +export type PlayerSchema = z.infer; + /** * Cosmetic Types */ @@ -33,3 +48,22 @@ export const CosmeticRating = z.object({ Count1Star: CosmeticRatingDefaultNumber, }); export type CosmeticRating = z.infer; + +export const CosmeticSchema = z.object({ + id: z.string(), + title: CosmeticLocalizedString, + description: CosmeticLocalizedString, + creation_date: z.date(), + last_modified: z.date(), + start_date: z.date().nullable(), + end_date: z.date().nullable(), + thumbnail: z.string(), + images: z.array(CosmeticImage), + avg_rating: z.number(), + ratings: CosmeticRating, + price: z.number(), + manual_tags: z.array(z.string()), + row_created: z.date().optional(), + row_updated: z.date().optional(), +}); +export type CosmeticSchema = z.infer;