@timothyw/pat-common 1.0.141 → 1.0.143

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.
@@ -43,7 +43,7 @@ export declare const notificationTemplateIdSchema: z.ZodEffects<z.ZodString, Not
43
43
  export type NotificationTemplateId = string & {
44
44
  readonly __brand: "NotificationTemplateId";
45
45
  };
46
- export declare const notificationSyncIdSchema: z.ZodEffects<z.ZodString, NotificationSyncId, string>;
46
+ export declare const notificationDesyncIdSchema: z.ZodEffects<z.ZodString, NotificationSyncId, string>;
47
47
  export type NotificationSyncId = string & {
48
48
  readonly __brand: "NotificationSyncId";
49
49
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.notificationSyncIdSchema = exports.notificationTemplateIdSchema = exports.habitEntryIdSchema = exports.habitIdSchema = exports.listItemIdSchema = exports.listIdSchema = exports.thoughtIdSchema = exports.personNoteIdSchema = exports.personIdSchema = exports.itemIdSchema = exports.authIdSchema = exports.userIdSchema = void 0;
3
+ exports.notificationDesyncIdSchema = exports.notificationTemplateIdSchema = exports.habitEntryIdSchema = exports.habitIdSchema = exports.listItemIdSchema = exports.listIdSchema = exports.thoughtIdSchema = exports.personNoteIdSchema = 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);
@@ -13,4 +13,4 @@ exports.listItemIdSchema = zod_1.z.string().transform((val) => val);
13
13
  exports.habitIdSchema = zod_1.z.string().transform((val) => val);
14
14
  exports.habitEntryIdSchema = zod_1.z.string().transform((val) => val);
15
15
  exports.notificationTemplateIdSchema = zod_1.z.string().transform((val) => val);
16
- exports.notificationSyncIdSchema = zod_1.z.string().transform((val) => val);
16
+ exports.notificationDesyncIdSchema = zod_1.z.string().transform((val) => val);
@@ -119,8 +119,9 @@ export declare const notificationTemplateSchema: z.ZodObject<{
119
119
  active: boolean;
120
120
  variantData?: any;
121
121
  }>;
122
- export declare const notificationSyncSchema: z.ZodObject<{
122
+ export declare const notificationDesyncSchema: z.ZodObject<{
123
123
  _id: z.ZodEffects<z.ZodString, import("./id-types").NotificationSyncId, string>;
124
+ userId: z.ZodEffects<z.ZodString, import("./id-types").UserId, string>;
124
125
  targetId: z.ZodString;
125
126
  createdAt: z.ZodDate;
126
127
  updatedAt: z.ZodDate;
@@ -130,11 +131,15 @@ export declare const notificationSyncSchema: z.ZodObject<{
130
131
  };
131
132
  createdAt: Date;
132
133
  updatedAt: Date;
134
+ userId: string & {
135
+ readonly __brand: "UserId";
136
+ };
133
137
  targetId: string;
134
138
  }, {
135
139
  _id: string;
136
140
  createdAt: Date;
137
141
  updatedAt: Date;
142
+ userId: string;
138
143
  targetId: string;
139
144
  }>;
140
145
  export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
@@ -266,7 +271,7 @@ export declare const setEntitySyncRequestSchema: z.ZodObject<{
266
271
  synced: boolean;
267
272
  }>;
268
273
  export type NotificationTemplateData = z.infer<typeof notificationTemplateSchema>;
269
- export type NotificationSyncData = z.infer<typeof notificationSyncSchema>;
274
+ export type NotificationDesyncData = z.infer<typeof notificationDesyncSchema>;
270
275
  export type CreateNotificationTemplateRequest = z.infer<typeof createNotificationTemplateRequestSchema>;
271
276
  export type UpdateNotificationTemplateRequest = z.infer<typeof updateNotificationTemplateRequestSchema>;
272
277
  export type GetEntitySyncRequest = z.infer<typeof getEntitySyncRequestSchema>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setEntitySyncRequestSchema = exports.getEntitySyncRequestSchema = exports.updateNotificationTemplateRequestSchema = exports.createNotificationTemplateRequestSchema = exports.notificationSyncSchema = exports.notificationTemplateSchema = exports.notificationSchedulerDataSchema = exports.NotificationVariantType = exports.NotificationSchedulerType = exports.NotificationEntityType = exports.NotificationTemplateLevel = void 0;
3
+ exports.setEntitySyncRequestSchema = exports.getEntitySyncRequestSchema = exports.updateNotificationTemplateRequestSchema = exports.createNotificationTemplateRequestSchema = exports.notificationDesyncSchema = exports.notificationTemplateSchema = exports.notificationSchedulerDataSchema = exports.NotificationVariantType = exports.NotificationSchedulerType = exports.NotificationEntityType = exports.NotificationTemplateLevel = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const id_types_1 = require("./id-types");
6
6
  var NotificationTemplateLevel;
@@ -48,8 +48,9 @@ exports.notificationTemplateSchema = zod_1.z.object({
48
48
  createdAt: zod_1.z.date(),
49
49
  updatedAt: zod_1.z.date()
50
50
  });
51
- exports.notificationSyncSchema = zod_1.z.object({
52
- _id: id_types_1.notificationSyncIdSchema,
51
+ exports.notificationDesyncSchema = zod_1.z.object({
52
+ _id: id_types_1.notificationDesyncIdSchema,
53
+ userId: id_types_1.userIdSchema,
53
54
  targetId: zod_1.z.string(),
54
55
  createdAt: zod_1.z.date(),
55
56
  updatedAt: zod_1.z.date()
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.141",
5
+ "version": "1.0.143",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
@@ -33,5 +33,5 @@ export type HabitEntryId = string & { readonly __brand: "HabitEntryId" };
33
33
  export const notificationTemplateIdSchema = z.string().transform((val): NotificationTemplateId => val as NotificationTemplateId);
34
34
  export type NotificationTemplateId = string & { readonly __brand: "NotificationTemplateId" };
35
35
 
36
- export const notificationSyncIdSchema = z.string().transform((val): NotificationSyncId => val as NotificationSyncId);
36
+ export const notificationDesyncIdSchema = z.string().transform((val): NotificationSyncId => val as NotificationSyncId);
37
37
  export type NotificationSyncId = string & { readonly __brand: "NotificationSyncId" };
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { notificationTemplateIdSchema, notificationSyncIdSchema, userIdSchema } from './id-types';
2
+ import { notificationTemplateIdSchema, notificationDesyncIdSchema, userIdSchema } from './id-types';
3
3
  import { Serialized } from '../utils';
4
4
 
5
5
  export interface NotificationContext<T = any> {
@@ -57,8 +57,9 @@ export const notificationTemplateSchema = z.object({
57
57
  updatedAt: z.date()
58
58
  });
59
59
 
60
- export const notificationSyncSchema = z.object({
61
- _id: notificationSyncIdSchema,
60
+ export const notificationDesyncSchema = z.object({
61
+ _id: notificationDesyncIdSchema,
62
+ userId: userIdSchema,
62
63
  targetId: z.string(),
63
64
  createdAt: z.date(),
64
65
  updatedAt: z.date()
@@ -91,7 +92,7 @@ export const setEntitySyncRequestSchema = z.object({
91
92
  });
92
93
 
93
94
  export type NotificationTemplateData = z.infer<typeof notificationTemplateSchema>;
94
- export type NotificationSyncData = z.infer<typeof notificationSyncSchema>;
95
+ export type NotificationDesyncData = z.infer<typeof notificationDesyncSchema>;
95
96
 
96
97
  export type CreateNotificationTemplateRequest = z.infer<typeof createNotificationTemplateRequestSchema>;
97
98
  export type UpdateNotificationTemplateRequest = z.infer<typeof updateNotificationTemplateRequestSchema>;