@timothyw/pat-common 1.0.32 → 1.0.34
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/api/index.d.ts +2 -1
- package/dist/types/api/index.js +2 -1
- package/dist/types/api/tasks/complete-task-types.d.ts +20 -0
- package/dist/types/api/tasks/complete-task-types.js +7 -0
- package/dist/types/api/tasks/create-task-list-types.d.ts +17 -0
- package/dist/types/api/tasks/create-task-list-types.js +7 -0
- package/dist/types/api/tasks/create-task-types.d.ts +28 -0
- package/dist/types/api/tasks/create-task-types.js +10 -0
- package/dist/types/api/tasks/get-task-lists-types.d.ts +8 -0
- package/dist/types/api/tasks/get-task-lists-types.js +2 -0
- package/dist/types/api/tasks/get-tasks-types.d.ts +11 -0
- package/dist/types/api/tasks/get-tasks-types.js +2 -0
- package/dist/types/api/tasks/index.d.ts +7 -0
- package/dist/types/api/tasks/index.js +23 -0
- package/dist/types/api/tasks/update-task-list-types.d.ts +17 -0
- package/dist/types/api/tasks/update-task-list-types.js +7 -0
- package/dist/types/api/tasks/update-task-types.d.ts +29 -0
- package/dist/types/api/tasks/update-task-types.js +11 -0
- package/dist/types/api/thoughts/create-thought-types.d.ts +15 -0
- package/dist/types/api/thoughts/create-thought-types.js +7 -0
- package/dist/types/api/thoughts/delete-thought-types.d.ts +3 -0
- package/dist/types/api/thoughts/delete-thought-types.js +2 -0
- package/dist/types/api/thoughts/get-thoughts-types.d.ts +6 -0
- package/dist/types/api/thoughts/get-thoughts-types.js +2 -0
- package/dist/types/api/thoughts/index.d.ts +4 -0
- package/dist/types/api/thoughts/index.js +20 -0
- package/dist/types/api/thoughts/update-thought-types.d.ts +15 -0
- package/dist/types/api/thoughts/update-thought-types.js +7 -0
- package/dist/types/id-types.d.ts +8 -0
- package/dist/types/id-types.js +3 -1
- package/dist/types/models/index.d.ts +1 -0
- package/dist/types/models/index.js +1 -0
- package/dist/types/models/task-data.d.ts +18 -0
- package/dist/types/models/task-data.js +2 -0
- package/dist/types/socket-message-types.d.ts +4 -1
- package/package.json +1 -1
- package/src/types/api/index.ts +2 -1
- package/src/types/api/tasks/complete-task-types.ts +19 -0
- package/src/types/api/tasks/create-task-list-types.ts +16 -0
- package/src/types/api/tasks/create-task-types.ts +22 -0
- package/src/types/api/tasks/get-task-lists-types.ts +8 -0
- package/src/types/api/tasks/get-tasks-types.ts +11 -0
- package/src/types/api/tasks/index.ts +7 -0
- package/src/types/api/tasks/update-task-list-types.ts +16 -0
- package/src/types/api/tasks/update-task-types.ts +23 -0
- package/src/types/id-types.ts +7 -1
- package/src/types/models/index.ts +1 -0
- package/src/types/models/task-data.ts +20 -0
- package/src/types/socket-message-types.ts +5 -1
- /package/src/types/api/{thoguhts → thoughts}/create-thought-types.ts +0 -0
- /package/src/types/api/{thoguhts → thoughts}/delete-thought-types.ts +0 -0
- /package/src/types/api/{thoguhts → thoughts}/get-thoughts-types.ts +0 -0
- /package/src/types/api/{thoguhts → thoughts}/index.ts +0 -0
- /package/src/types/api/{thoguhts → thoughts}/update-thought-types.ts +0 -0
package/dist/types/api/index.js
CHANGED
|
@@ -18,4 +18,5 @@ __exportStar(require("./account"), exports);
|
|
|
18
18
|
__exportStar(require("./auth"), exports);
|
|
19
19
|
__exportStar(require("./items"), exports);
|
|
20
20
|
__exportStar(require("./people"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
21
|
+
__exportStar(require("./tasks"), exports);
|
|
22
|
+
__exportStar(require("./thoughts"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const completeTaskRequestSchema: z.ZodObject<{
|
|
3
|
+
completed: z.ZodBoolean;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
completed: boolean;
|
|
6
|
+
}, {
|
|
7
|
+
completed: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
export type CompleteTaskRequest = z.infer<typeof completeTaskRequestSchema>;
|
|
10
|
+
export interface CompleteTaskResponse {
|
|
11
|
+
task: {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
notes?: string;
|
|
15
|
+
completed: boolean;
|
|
16
|
+
taskListId: string;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const createTaskListRequestSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
name: string;
|
|
6
|
+
}, {
|
|
7
|
+
name: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type CreateTaskListRequest = z.infer<typeof createTaskListRequestSchema>;
|
|
10
|
+
export interface CreateTaskListResponse {
|
|
11
|
+
taskList: {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const createTaskRequestSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
5
|
+
taskListId: z.ZodEffects<z.ZodString, import("../../id-types").TaskListId, string>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
name: string;
|
|
8
|
+
taskListId: string & {
|
|
9
|
+
readonly __brand: "TaskListId";
|
|
10
|
+
};
|
|
11
|
+
notes?: string | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
name: string;
|
|
14
|
+
taskListId: string;
|
|
15
|
+
notes?: string | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
export type CreateTaskRequest = z.infer<typeof createTaskRequestSchema>;
|
|
18
|
+
export interface CreateTaskResponse {
|
|
19
|
+
task: {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
notes?: string;
|
|
23
|
+
completed: boolean;
|
|
24
|
+
taskListId: string;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTaskRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const id_types_1 = require("../../id-types");
|
|
6
|
+
exports.createTaskRequestSchema = zod_1.z.object({
|
|
7
|
+
name: zod_1.z.string().min(1),
|
|
8
|
+
notes: zod_1.z.string().optional(),
|
|
9
|
+
taskListId: id_types_1.taskListIdSchema
|
|
10
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './complete-task-types';
|
|
2
|
+
export * from './create-task-types';
|
|
3
|
+
export * from './get-tasks-types';
|
|
4
|
+
export * from './update-task-types';
|
|
5
|
+
export * from './create-task-list-types';
|
|
6
|
+
export * from './update-task-list-types';
|
|
7
|
+
export * from './get-task-lists-types';
|
|
@@ -0,0 +1,23 @@
|
|
|
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("./complete-task-types"), exports);
|
|
18
|
+
__exportStar(require("./create-task-types"), exports);
|
|
19
|
+
__exportStar(require("./get-tasks-types"), exports);
|
|
20
|
+
__exportStar(require("./update-task-types"), exports);
|
|
21
|
+
__exportStar(require("./create-task-list-types"), exports);
|
|
22
|
+
__exportStar(require("./update-task-list-types"), exports);
|
|
23
|
+
__exportStar(require("./get-task-lists-types"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const updateTaskListRequestSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodOptional<z.ZodString>;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
name?: string | undefined;
|
|
6
|
+
}, {
|
|
7
|
+
name?: string | undefined;
|
|
8
|
+
}>;
|
|
9
|
+
export type UpdateTaskListRequest = z.infer<typeof updateTaskListRequestSchema>;
|
|
10
|
+
export interface UpdateTaskListResponse {
|
|
11
|
+
taskList: {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const updateTaskRequestSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodOptional<z.ZodString>;
|
|
4
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
5
|
+
completed: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
taskListId: z.ZodOptional<z.ZodEffects<z.ZodString, import("../../id-types").TaskListId, string>>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
name?: string | undefined;
|
|
9
|
+
completed?: boolean | undefined;
|
|
10
|
+
notes?: string | undefined;
|
|
11
|
+
taskListId?: import("../../id-types").TaskListId | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
name?: string | undefined;
|
|
14
|
+
completed?: boolean | undefined;
|
|
15
|
+
notes?: string | undefined;
|
|
16
|
+
taskListId?: string | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export type UpdateTaskRequest = z.infer<typeof updateTaskRequestSchema>;
|
|
19
|
+
export interface UpdateTaskResponse {
|
|
20
|
+
task: {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
notes?: string;
|
|
24
|
+
completed: boolean;
|
|
25
|
+
taskListId: string;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
updatedAt: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateTaskRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const id_types_1 = require("../../id-types");
|
|
6
|
+
exports.updateTaskRequestSchema = zod_1.z.object({
|
|
7
|
+
name: zod_1.z.string().min(1).optional(),
|
|
8
|
+
notes: zod_1.z.string().optional(),
|
|
9
|
+
completed: zod_1.z.boolean().optional(),
|
|
10
|
+
taskListId: id_types_1.taskListIdSchema.optional()
|
|
11
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const createThoughtRequestSchema: z.ZodObject<{
|
|
3
|
+
content: z.ZodString;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
content: string;
|
|
6
|
+
}, {
|
|
7
|
+
content: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type CreateThoughtRequest = z.infer<typeof createThoughtRequestSchema>;
|
|
10
|
+
export interface CreateThoughtResponse {
|
|
11
|
+
thought: {
|
|
12
|
+
id: string;
|
|
13
|
+
content: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./create-thought-types"), exports);
|
|
18
|
+
__exportStar(require("./delete-thought-types"), exports);
|
|
19
|
+
__exportStar(require("./get-thoughts-types"), exports);
|
|
20
|
+
__exportStar(require("./update-thought-types"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const updateThoughtRequestSchema: z.ZodObject<{
|
|
3
|
+
content: z.ZodString;
|
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
|
5
|
+
content: string;
|
|
6
|
+
}, {
|
|
7
|
+
content: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type UpdateThoughtRequest = z.infer<typeof updateThoughtRequestSchema>;
|
|
10
|
+
export interface UpdateThoughtResponse {
|
|
11
|
+
thought: {
|
|
12
|
+
id: string;
|
|
13
|
+
content: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
package/dist/types/id-types.d.ts
CHANGED
|
@@ -19,3 +19,11 @@ 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 taskIdSchema: z.ZodEffects<z.ZodString, TaskId, string>;
|
|
23
|
+
export type TaskId = string & {
|
|
24
|
+
readonly __brand: "TaskId";
|
|
25
|
+
};
|
|
26
|
+
export declare const taskListIdSchema: z.ZodEffects<z.ZodString, TaskListId, string>;
|
|
27
|
+
export type TaskListId = string & {
|
|
28
|
+
readonly __brand: "TaskListId";
|
|
29
|
+
};
|
package/dist/types/id-types.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.thoughtIdSchema = exports.personIdSchema = exports.itemIdSchema = exports.authIdSchema = exports.userIdSchema = void 0;
|
|
3
|
+
exports.taskListIdSchema = exports.taskIdSchema = 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
|
+
exports.taskListIdSchema = zod_1.z.string().transform((val) => val);
|
|
@@ -18,5 +18,6 @@ __exportStar(require("./auth-data"), exports);
|
|
|
18
18
|
__exportStar(require("./item-data"), exports);
|
|
19
19
|
__exportStar(require("./person-data"), exports);
|
|
20
20
|
__exportStar(require("./program-config"), exports);
|
|
21
|
+
__exportStar(require("./task-data"), exports);
|
|
21
22
|
__exportStar(require("./thought-data"), exports);
|
|
22
23
|
__exportStar(require("./user-data"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TaskId, TaskListId, UserId } from "../id-types";
|
|
2
|
+
export interface TaskData {
|
|
3
|
+
_id: TaskId;
|
|
4
|
+
userId: UserId;
|
|
5
|
+
createdAt: Date;
|
|
6
|
+
updatedAt: Date;
|
|
7
|
+
name: string;
|
|
8
|
+
notes?: string;
|
|
9
|
+
completed: boolean;
|
|
10
|
+
taskListId: TaskListId;
|
|
11
|
+
}
|
|
12
|
+
export interface TaskListData {
|
|
13
|
+
_id: TaskListId;
|
|
14
|
+
userId: UserId;
|
|
15
|
+
createdAt: Date;
|
|
16
|
+
updatedAt: Date;
|
|
17
|
+
name: string;
|
|
18
|
+
}
|
package/package.json
CHANGED
package/src/types/api/index.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const completeTaskRequestSchema = z.object({
|
|
4
|
+
completed: z.boolean()
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
export type CompleteTaskRequest = z.infer<typeof completeTaskRequestSchema>;
|
|
8
|
+
|
|
9
|
+
export interface CompleteTaskResponse {
|
|
10
|
+
task: {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
notes?: string;
|
|
14
|
+
completed: boolean;
|
|
15
|
+
taskListId: string;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const createTaskListRequestSchema = z.object({
|
|
4
|
+
name: z.string().min(1)
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
export type CreateTaskListRequest = z.infer<typeof createTaskListRequestSchema>;
|
|
8
|
+
|
|
9
|
+
export interface CreateTaskListResponse {
|
|
10
|
+
taskList: {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
updatedAt: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { taskListIdSchema } from '../../id-types';
|
|
3
|
+
|
|
4
|
+
export const createTaskRequestSchema = z.object({
|
|
5
|
+
name: z.string().min(1),
|
|
6
|
+
notes: z.string().optional(),
|
|
7
|
+
taskListId: taskListIdSchema
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type CreateTaskRequest = z.infer<typeof createTaskRequestSchema>;
|
|
11
|
+
|
|
12
|
+
export interface CreateTaskResponse {
|
|
13
|
+
task: {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
notes?: string;
|
|
17
|
+
completed: boolean;
|
|
18
|
+
taskListId: string;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
updatedAt: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './complete-task-types';
|
|
2
|
+
export * from './create-task-types';
|
|
3
|
+
export * from './get-tasks-types';
|
|
4
|
+
export * from './update-task-types';
|
|
5
|
+
export * from './create-task-list-types';
|
|
6
|
+
export * from './update-task-list-types';
|
|
7
|
+
export * from './get-task-lists-types';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const updateTaskListRequestSchema = z.object({
|
|
4
|
+
name: z.string().min(1).optional()
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
export type UpdateTaskListRequest = z.infer<typeof updateTaskListRequestSchema>;
|
|
8
|
+
|
|
9
|
+
export interface UpdateTaskListResponse {
|
|
10
|
+
taskList: {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
updatedAt: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { taskListIdSchema } from '../../id-types';
|
|
3
|
+
|
|
4
|
+
export const updateTaskRequestSchema = z.object({
|
|
5
|
+
name: z.string().min(1).optional(),
|
|
6
|
+
notes: z.string().optional(),
|
|
7
|
+
completed: z.boolean().optional(),
|
|
8
|
+
taskListId: taskListIdSchema.optional()
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type UpdateTaskRequest = z.infer<typeof updateTaskRequestSchema>;
|
|
12
|
+
|
|
13
|
+
export interface UpdateTaskResponse {
|
|
14
|
+
task: {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
notes?: string;
|
|
18
|
+
completed: boolean;
|
|
19
|
+
taskListId: string;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
updatedAt: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
package/src/types/id-types.ts
CHANGED
|
@@ -13,4 +13,10 @@ export const personIdSchema = z.string().transform((val): PersonId => val as Per
|
|
|
13
13
|
export type PersonId = string & { readonly __brand: "PersonId" };
|
|
14
14
|
|
|
15
15
|
export const thoughtIdSchema = z.string().transform((val): ThoughtId => val as ThoughtId);
|
|
16
|
-
export type ThoughtId = string & { readonly __brand: "ThoughtId" };
|
|
16
|
+
export type ThoughtId = string & { readonly __brand: "ThoughtId" };
|
|
17
|
+
|
|
18
|
+
export const taskIdSchema = z.string().transform((val): TaskId => val as TaskId);
|
|
19
|
+
export type TaskId = string & { readonly __brand: "TaskId" };
|
|
20
|
+
|
|
21
|
+
export const taskListIdSchema = z.string().transform((val): TaskListId => val as TaskListId);
|
|
22
|
+
export type TaskListId = string & { readonly __brand: "TaskListId" };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TaskId, TaskListId, UserId } from "../id-types";
|
|
2
|
+
|
|
3
|
+
export interface TaskData {
|
|
4
|
+
_id: TaskId;
|
|
5
|
+
userId: UserId;
|
|
6
|
+
createdAt: Date;
|
|
7
|
+
updatedAt: Date;
|
|
8
|
+
name: string;
|
|
9
|
+
notes?: string;
|
|
10
|
+
completed: boolean;
|
|
11
|
+
taskListId: TaskListId;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface TaskListData {
|
|
15
|
+
_id: TaskListId;
|
|
16
|
+
userId: UserId;
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
updatedAt: Date;
|
|
19
|
+
name: string;
|
|
20
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|