rategame-shared 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ import { Timestamp } from "@firebase/firestore";
2
+ import { z } from "zod";
3
+ export declare const firestoreTimestampSchema: z.ZodType<Timestamp, z.ZodTypeDef, Timestamp>;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.firestoreTimestampSchema = void 0;
4
+ const firestore_1 = require("@firebase/firestore");
5
+ const zod_1 = require("zod");
6
+ exports.firestoreTimestampSchema = zod_1.z.instanceof(firestore_1.Timestamp);
@@ -0,0 +1,2 @@
1
+ export * from "./models/user";
2
+ export * from "./schemas/user";
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./models/user"), exports);
18
+ __exportStar(require("./schemas/user"), exports);
@@ -0,0 +1,3 @@
1
+ import { z } from "zod";
2
+ import { userSchema } from "../schemas/user";
3
+ export type User = z.infer<typeof userSchema>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,25 @@
1
+ export declare const userSchema: import("zod").ZodObject<{
2
+ id: import("zod").ZodString;
3
+ email: import("zod").ZodString;
4
+ firstName: import("zod").ZodString;
5
+ lastName: import("zod").ZodString;
6
+ avatarUrl: import("zod").ZodString;
7
+ createdAt: import("zod").ZodType<import("@firebase/firestore").Timestamp, import("zod").ZodTypeDef, import("@firebase/firestore").Timestamp>;
8
+ updatedAt: import("zod").ZodType<import("@firebase/firestore").Timestamp, import("zod").ZodTypeDef, import("@firebase/firestore").Timestamp>;
9
+ }, "strip", import("zod").ZodTypeAny, {
10
+ id: string;
11
+ email: string;
12
+ firstName: string;
13
+ lastName: string;
14
+ avatarUrl: string;
15
+ createdAt: import("@firebase/firestore").Timestamp;
16
+ updatedAt: import("@firebase/firestore").Timestamp;
17
+ }, {
18
+ id: string;
19
+ email: string;
20
+ firstName: string;
21
+ lastName: string;
22
+ avatarUrl: string;
23
+ createdAt: import("@firebase/firestore").Timestamp;
24
+ updatedAt: import("@firebase/firestore").Timestamp;
25
+ }>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.userSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const helpers_1 = require("../helpers");
6
+ exports.userSchema = (0, zod_1.object)({
7
+ id: (0, zod_1.string)(),
8
+ email: (0, zod_1.string)(),
9
+ firstName: (0, zod_1.string)(),
10
+ lastName: (0, zod_1.string)(),
11
+ avatarUrl: (0, zod_1.string)(),
12
+ createdAt: helpers_1.firestoreTimestampSchema,
13
+ updatedAt: helpers_1.firestoreTimestampSchema,
14
+ });
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "rategame-shared",
3
+ "version": "1.0.0",
4
+ "description": "This package contains shared resources for the Rate Game project.",
5
+ "types": "./dist/index.d.ts",
6
+ "main": "./dist/index.js",
7
+ "files": [
8
+ "dist/**"
9
+ ],
10
+ "scripts": {
11
+ "test": "echo \"Error: no test specified\" && exit 1",
12
+ "prepublishOnly": "tsc",
13
+ "build": "tsc"
14
+ },
15
+ "author": "MVP Masters",
16
+ "license": "ISC",
17
+ "dependencies": {
18
+ "@firebase/app": "^0.9.25",
19
+ "@firebase/firestore": "^4.4.0",
20
+ "@firebase/firestore-types": "^3.0.0",
21
+ "@firebase/util": "^1.5.1",
22
+ "lodash": "^4.17.21",
23
+ "moment": "^2.29.4",
24
+ "zod": "^3.22.4"
25
+ },
26
+ "devDependencies": {
27
+ "@types/lodash": "^4.14.197",
28
+ "typescript": "^4.5.2"
29
+ }
30
+ }