@timothyw/pat-common 1.0.40 → 1.0.42
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/types/api/habits/create-habit-entry-types.d.ts +9 -8
- package/dist/types/api/habits/create-habit-entry-types.js +3 -2
- package/dist/types/api/tasks/update-task-types.d.ts +2 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/misc-types.d.ts +5 -0
- package/dist/types/misc-types.js +9 -0
- package/dist/types/models/index.d.ts +1 -0
- package/dist/types/models/index.js +1 -0
- package/dist/utils/date-utils.d.ts +2 -0
- package/dist/utils/date-utils.js +7 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +17 -0
- package/package.json +1 -1
- package/src/index.ts +2 -1
- package/src/types/api/habits/create-habit-entry-types.ts +6 -5
- package/src/types/index.ts +1 -0
- package/src/types/misc-types.ts +8 -0
- package/src/types/models/index.ts +1 -0
- package/src/utils/date-utils.ts +5 -0
- package/src/utils/index.ts +1 -0
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./enums"), exports);
|
|
18
18
|
__exportStar(require("./types"), exports);
|
|
19
|
+
__exportStar(require("./utils"), exports);
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { DateString } from "../../misc-types";
|
|
3
|
+
import { HabitWithEntries } from "../../models";
|
|
3
4
|
export declare const createHabitEntryRequestSchema: z.ZodObject<{
|
|
4
|
-
date: z.
|
|
5
|
-
status: z.ZodEnum<["completed", "excused"
|
|
5
|
+
date: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>;
|
|
6
|
+
status: z.ZodEnum<["completed", "excused"]>;
|
|
6
7
|
}, "strip", z.ZodTypeAny, {
|
|
7
|
-
status: "completed" | "excused"
|
|
8
|
+
status: "completed" | "excused";
|
|
8
9
|
date: Date;
|
|
9
10
|
}, {
|
|
10
|
-
status: "completed" | "excused"
|
|
11
|
-
date:
|
|
11
|
+
status: "completed" | "excused";
|
|
12
|
+
date: string;
|
|
12
13
|
}>;
|
|
13
14
|
export interface CreateHabitEntryRequest {
|
|
14
|
-
date:
|
|
15
|
-
status: 'completed' | 'excused'
|
|
15
|
+
date: DateString;
|
|
16
|
+
status: 'completed' | 'excused';
|
|
16
17
|
}
|
|
17
18
|
export interface CreateHabitEntryResponse {
|
|
18
19
|
habit: HabitWithEntries;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createHabitEntryRequestSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const misc_types_1 = require("../../misc-types");
|
|
5
6
|
exports.createHabitEntryRequestSchema = zod_1.z.object({
|
|
6
|
-
date:
|
|
7
|
-
status: zod_1.z.enum(['completed', 'excused'
|
|
7
|
+
date: misc_types_1.dateSchema,
|
|
8
|
+
status: zod_1.z.enum(['completed', 'excused'])
|
|
8
9
|
});
|
|
@@ -6,13 +6,13 @@ export declare const updateTaskRequestSchema: z.ZodObject<{
|
|
|
6
6
|
completed: z.ZodOptional<z.ZodBoolean>;
|
|
7
7
|
taskListId: z.ZodOptional<z.ZodEffects<z.ZodString, TaskListId, string>>;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
name?: string | undefined;
|
|
10
9
|
completed?: boolean | undefined;
|
|
10
|
+
name?: string | undefined;
|
|
11
11
|
notes?: string | undefined;
|
|
12
12
|
taskListId?: TaskListId | undefined;
|
|
13
13
|
}, {
|
|
14
|
-
name?: string | undefined;
|
|
15
14
|
completed?: boolean | undefined;
|
|
15
|
+
name?: string | undefined;
|
|
16
16
|
notes?: string | undefined;
|
|
17
17
|
taskListId?: string | undefined;
|
|
18
18
|
}>;
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -18,4 +18,5 @@ __exportStar(require("./api"), exports);
|
|
|
18
18
|
__exportStar(require("./models"), exports);
|
|
19
19
|
__exportStar(require("./auth-tokens"), exports);
|
|
20
20
|
__exportStar(require("./id-types"), exports);
|
|
21
|
+
__exportStar(require("./misc-types"), exports);
|
|
21
22
|
__exportStar(require("./socket-message-types"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dateSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.dateSchema = zod_1.z.string()
|
|
6
|
+
.refine(val => !isNaN(Date.parse(val)), {
|
|
7
|
+
message: "Invalid date string",
|
|
8
|
+
})
|
|
9
|
+
.transform(val => new Date(val));
|
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./auth-data"), exports);
|
|
18
|
+
__exportStar(require("./habit-data"), exports);
|
|
18
19
|
__exportStar(require("./item-data"), exports);
|
|
19
20
|
__exportStar(require("./person-data"), exports);
|
|
20
21
|
__exportStar(require("./program-config"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './date-utils';
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./date-utils"), exports);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { dateSchema, DateString } from "../../misc-types";
|
|
3
|
+
import { HabitWithEntries } from "../../models";
|
|
3
4
|
|
|
4
5
|
export const createHabitEntryRequestSchema = z.object({
|
|
5
|
-
date:
|
|
6
|
-
status: z.enum(['completed', 'excused'
|
|
6
|
+
date: dateSchema,
|
|
7
|
+
status: z.enum(['completed', 'excused'])
|
|
7
8
|
});
|
|
8
9
|
|
|
9
10
|
export interface CreateHabitEntryRequest {
|
|
10
|
-
date:
|
|
11
|
-
status: 'completed' | 'excused'
|
|
11
|
+
date: DateString;
|
|
12
|
+
status: 'completed' | 'excused';
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export interface CreateHabitEntryResponse {
|
package/src/types/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './date-utils'
|