@timothyw/pat-common 1.0.59 → 1.0.60
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.
package/dist/types/id-types.d.ts
CHANGED
|
@@ -19,11 +19,19 @@ export declare const thoughtIdSchema: z.ZodEffects<z.ZodString, ThoughtId, strin
|
|
|
19
19
|
export type ThoughtId = string & {
|
|
20
20
|
readonly __brand: "ThoughtId";
|
|
21
21
|
};
|
|
22
|
+
export declare const taskListIdSchema: z.ZodEffects<z.ZodString, TaskListId, string>;
|
|
23
|
+
export type TaskListId = string & {
|
|
24
|
+
readonly __brand: "TaskListId";
|
|
25
|
+
};
|
|
22
26
|
export declare const taskIdSchema: z.ZodEffects<z.ZodString, TaskId, string>;
|
|
23
27
|
export type TaskId = string & {
|
|
24
28
|
readonly __brand: "TaskId";
|
|
25
29
|
};
|
|
26
|
-
export declare const
|
|
27
|
-
export type
|
|
28
|
-
readonly __brand: "
|
|
30
|
+
export declare const habitIdSchema: z.ZodEffects<z.ZodString, TaskListId, string>;
|
|
31
|
+
export type HabitId = string & {
|
|
32
|
+
readonly __brand: "HabitId";
|
|
33
|
+
};
|
|
34
|
+
export declare const habitEntryIdSchema: z.ZodEffects<z.ZodString, TaskListId, string>;
|
|
35
|
+
export type HabitEntryId = string & {
|
|
36
|
+
readonly __brand: "HabitEntryId";
|
|
29
37
|
};
|
package/dist/types/id-types.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.habitEntryIdSchema = exports.habitIdSchema = exports.taskIdSchema = exports.taskListIdSchema = exports.thoughtIdSchema = exports.personIdSchema = exports.itemIdSchema = exports.authIdSchema = exports.userIdSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.userIdSchema = zod_1.z.string().transform((val) => val);
|
|
6
6
|
exports.authIdSchema = zod_1.z.string().transform((val) => val);
|
|
7
7
|
exports.itemIdSchema = zod_1.z.string().transform((val) => val);
|
|
8
8
|
exports.personIdSchema = zod_1.z.string().transform((val) => val);
|
|
9
9
|
exports.thoughtIdSchema = zod_1.z.string().transform((val) => val);
|
|
10
|
-
exports.taskIdSchema = zod_1.z.string().transform((val) => val);
|
|
11
10
|
exports.taskListIdSchema = zod_1.z.string().transform((val) => val);
|
|
11
|
+
exports.taskIdSchema = zod_1.z.string().transform((val) => val);
|
|
12
|
+
exports.habitIdSchema = zod_1.z.string().transform((val) => val);
|
|
13
|
+
exports.habitEntryIdSchema = zod_1.z.string().transform((val) => val);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DateOnlyString } from "../misc-types";
|
|
2
|
+
import { HabitEntryId, HabitId, UserId } from "../id-types";
|
|
2
3
|
export declare enum HabitFrequency {
|
|
3
4
|
DAILY = "daily",
|
|
4
5
|
WEEKLY = "weekly",
|
|
@@ -11,7 +12,7 @@ export declare enum HabitEntryStatus {
|
|
|
11
12
|
EXCUSED = "excused"
|
|
12
13
|
}
|
|
13
14
|
export interface HabitEntryData {
|
|
14
|
-
_id:
|
|
15
|
+
_id: HabitEntryId;
|
|
15
16
|
habitId: string;
|
|
16
17
|
date: DateOnlyString;
|
|
17
18
|
status: HabitEntryStatus;
|
|
@@ -19,8 +20,8 @@ export interface HabitEntryData {
|
|
|
19
20
|
updatedAt: Date;
|
|
20
21
|
}
|
|
21
22
|
export interface HabitData {
|
|
22
|
-
_id:
|
|
23
|
-
userId:
|
|
23
|
+
_id: HabitId;
|
|
24
|
+
userId: UserId;
|
|
24
25
|
name: string;
|
|
25
26
|
description?: string;
|
|
26
27
|
notes?: string;
|
package/package.json
CHANGED
package/src/types/id-types.ts
CHANGED
|
@@ -15,8 +15,14 @@ export type PersonId = string & { readonly __brand: "PersonId" };
|
|
|
15
15
|
export const thoughtIdSchema = z.string().transform((val): ThoughtId => val as ThoughtId);
|
|
16
16
|
export type ThoughtId = string & { readonly __brand: "ThoughtId" };
|
|
17
17
|
|
|
18
|
+
export const taskListIdSchema = z.string().transform((val): TaskListId => val as TaskListId);
|
|
19
|
+
export type TaskListId = string & { readonly __brand: "TaskListId" };
|
|
20
|
+
|
|
18
21
|
export const taskIdSchema = z.string().transform((val): TaskId => val as TaskId);
|
|
19
22
|
export type TaskId = string & { readonly __brand: "TaskId" };
|
|
20
23
|
|
|
21
|
-
export const
|
|
22
|
-
export type
|
|
24
|
+
export const habitIdSchema = z.string().transform((val): TaskListId => val as TaskListId);
|
|
25
|
+
export type HabitId = string & { readonly __brand: "HabitId" };
|
|
26
|
+
|
|
27
|
+
export const habitEntryIdSchema = z.string().transform((val): TaskListId => val as TaskListId);
|
|
28
|
+
export type HabitEntryId = string & { readonly __brand: "HabitEntryId" };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DateOnlyString, ToDateString } from "../misc-types";
|
|
2
2
|
import { toDateString } from "../../utils";
|
|
3
|
+
import { HabitEntryId, HabitId, UserId } from "../id-types";
|
|
3
4
|
|
|
4
5
|
export enum HabitFrequency {
|
|
5
6
|
DAILY = 'daily',
|
|
@@ -15,7 +16,7 @@ export enum HabitEntryStatus {
|
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export interface HabitEntryData {
|
|
18
|
-
_id:
|
|
19
|
+
_id: HabitEntryId;
|
|
19
20
|
habitId: string;
|
|
20
21
|
date: DateOnlyString;
|
|
21
22
|
status: HabitEntryStatus;
|
|
@@ -24,8 +25,8 @@ export interface HabitEntryData {
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export interface HabitData {
|
|
27
|
-
_id:
|
|
28
|
-
userId:
|
|
28
|
+
_id: HabitId;
|
|
29
|
+
userId: UserId;
|
|
29
30
|
name: string;
|
|
30
31
|
description?: string;
|
|
31
32
|
notes?: string;
|