@timothyw/pat-common 1.0.40 → 1.0.41

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.
@@ -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
  }>;
@@ -2,4 +2,5 @@ export * from './api';
2
2
  export * from './models';
3
3
  export * from './auth-tokens';
4
4
  export * from './id-types';
5
+ export * from './misc-types';
5
6
  export * from './socket-message-types';
@@ -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,5 @@
1
+ import { z } from "zod";
2
+ export type DateString = string & {
3
+ readonly __brand: "DateString";
4
+ };
5
+ export declare const dateSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>;
@@ -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));
@@ -1,4 +1,5 @@
1
1
  export * from './auth-data';
2
+ export * from './habit-data';
2
3
  export * from './item-data';
3
4
  export * from './person-data';
4
5
  export * from './program-config';
@@ -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);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@timothyw/pat-common",
3
3
  "description": "",
4
4
  "author": "Timothy Washburn",
5
- "version": "1.0.40",
5
+ "version": "1.0.41",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
@@ -2,4 +2,5 @@ export * from './api'
2
2
  export * from './models'
3
3
  export * from './auth-tokens'
4
4
  export * from './id-types'
5
+ export * from './misc-types'
5
6
  export * from './socket-message-types'
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+
3
+ export type DateString = string & { readonly __brand: "DateString" };
4
+ export const dateSchema = z.string()
5
+ .refine(val => !isNaN(Date.parse(val)), {
6
+ message: "Invalid date string",
7
+ })
8
+ .transform(val => new Date(val));
@@ -1,4 +1,5 @@
1
1
  export * from './auth-data';
2
+ export * from './habit-data';
2
3
  export * from './item-data';
3
4
  export * from './person-data';
4
5
  export * from './program-config';