@timothyw/pat-common 1.0.121 → 1.0.123
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/notification-entity-registry.d.ts +77 -0
- package/dist/notification-entity-registry.js +212 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/notification-entity-config.d.ts +157 -0
- package/dist/types/notification-entity-config.js +28 -0
- package/dist/types/notifications-types.d.ts +23 -64
- package/dist/types/notifications-types.js +17 -17
- package/package.json +1 -1
- package/src/index.ts +2 -1
- package/src/notification-entity-registry.ts +241 -0
- package/src/types/index.ts +2 -2
- package/src/types/notification-entity-config.ts +78 -0
- package/src/types/notifications-types.ts +18 -20
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { NotificationEntityConfig, ParentResolutionResult } from './types/notification-entity-config';
|
|
2
|
+
/**
|
|
3
|
+
* Registry for managing notification entity configurations and parent resolution
|
|
4
|
+
*/
|
|
5
|
+
export declare class NotificationEntityRegistry {
|
|
6
|
+
private static instance;
|
|
7
|
+
private entityConfigs;
|
|
8
|
+
private constructor();
|
|
9
|
+
/**
|
|
10
|
+
* Get the singleton instance
|
|
11
|
+
*/
|
|
12
|
+
static getInstance(): NotificationEntityRegistry;
|
|
13
|
+
/**
|
|
14
|
+
* Register a new entity configuration
|
|
15
|
+
*/
|
|
16
|
+
registerEntity(config: NotificationEntityConfig): void;
|
|
17
|
+
/**
|
|
18
|
+
* Get configuration for an entity type
|
|
19
|
+
*/
|
|
20
|
+
getEntityConfig(entityType: string): NotificationEntityConfig | null;
|
|
21
|
+
/**
|
|
22
|
+
* Get all registered entity types
|
|
23
|
+
*/
|
|
24
|
+
getEntityTypes(): string[];
|
|
25
|
+
/**
|
|
26
|
+
* Get all entity configurations
|
|
27
|
+
*/
|
|
28
|
+
getAllConfigs(): NotificationEntityConfig[];
|
|
29
|
+
/**
|
|
30
|
+
* Resolve the parent type for a specific entity instance
|
|
31
|
+
*/
|
|
32
|
+
resolveParent(entityType: string, entityData: any): ParentResolutionResult | null;
|
|
33
|
+
/**
|
|
34
|
+
* Check if an entity type supports dynamic parent resolution
|
|
35
|
+
*/
|
|
36
|
+
isDynamicParentType(entityType: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Get the parent property name for dynamic resolution
|
|
39
|
+
*/
|
|
40
|
+
getParentProperty(entityType: string): string | null;
|
|
41
|
+
/**
|
|
42
|
+
* Get display name for an entity type
|
|
43
|
+
*/
|
|
44
|
+
getDisplayName(entityType: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Get icon for an entity type
|
|
47
|
+
*/
|
|
48
|
+
getIcon(entityType: string): string | null;
|
|
49
|
+
/**
|
|
50
|
+
* Check if entity type exists
|
|
51
|
+
*/
|
|
52
|
+
hasEntityType(entityType: string): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Remove an entity configuration
|
|
55
|
+
*/
|
|
56
|
+
unregisterEntity(entityType: string): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Clear all configurations
|
|
59
|
+
*/
|
|
60
|
+
clear(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Resolve static parent type
|
|
63
|
+
*/
|
|
64
|
+
private resolveStaticParent;
|
|
65
|
+
/**
|
|
66
|
+
* Resolve dynamic parent type based on entity data
|
|
67
|
+
*/
|
|
68
|
+
private resolveDynamicParent;
|
|
69
|
+
/**
|
|
70
|
+
* Register default entity configurations
|
|
71
|
+
*/
|
|
72
|
+
private registerDefaultEntities;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Convenience function to get the singleton instance
|
|
76
|
+
*/
|
|
77
|
+
export declare function getNotificationEntityRegistry(): NotificationEntityRegistry;
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationEntityRegistry = void 0;
|
|
4
|
+
exports.getNotificationEntityRegistry = getNotificationEntityRegistry;
|
|
5
|
+
/**
|
|
6
|
+
* Registry for managing notification entity configurations and parent resolution
|
|
7
|
+
*/
|
|
8
|
+
class NotificationEntityRegistry {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.entityConfigs = new Map();
|
|
11
|
+
// Initialize with default configurations
|
|
12
|
+
this.registerDefaultEntities();
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Get the singleton instance
|
|
16
|
+
*/
|
|
17
|
+
static getInstance() {
|
|
18
|
+
if (!NotificationEntityRegistry.instance) {
|
|
19
|
+
NotificationEntityRegistry.instance = new NotificationEntityRegistry();
|
|
20
|
+
}
|
|
21
|
+
return NotificationEntityRegistry.instance;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Register a new entity configuration
|
|
25
|
+
*/
|
|
26
|
+
registerEntity(config) {
|
|
27
|
+
this.entityConfigs.set(config.entityType, config);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get configuration for an entity type
|
|
31
|
+
*/
|
|
32
|
+
getEntityConfig(entityType) {
|
|
33
|
+
return this.entityConfigs.get(entityType) || null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get all registered entity types
|
|
37
|
+
*/
|
|
38
|
+
getEntityTypes() {
|
|
39
|
+
return Array.from(this.entityConfigs.keys());
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get all entity configurations
|
|
43
|
+
*/
|
|
44
|
+
getAllConfigs() {
|
|
45
|
+
return Array.from(this.entityConfigs.values());
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Resolve the parent type for a specific entity instance
|
|
49
|
+
*/
|
|
50
|
+
resolveParent(entityType, entityData) {
|
|
51
|
+
const config = this.entityConfigs.get(entityType);
|
|
52
|
+
if (!config) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const resolver = config.parentResolver;
|
|
56
|
+
if (resolver.type === 'static') {
|
|
57
|
+
return this.resolveStaticParent(resolver);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return this.resolveDynamicParent(resolver, entityData);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Check if an entity type supports dynamic parent resolution
|
|
65
|
+
*/
|
|
66
|
+
isDynamicParentType(entityType) {
|
|
67
|
+
const config = this.entityConfigs.get(entityType);
|
|
68
|
+
return config?.parentResolver.type === 'dynamic' || false;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get the parent property name for dynamic resolution
|
|
72
|
+
*/
|
|
73
|
+
getParentProperty(entityType) {
|
|
74
|
+
const config = this.entityConfigs.get(entityType);
|
|
75
|
+
if (config?.parentResolver.type === 'dynamic') {
|
|
76
|
+
return config.parentResolver.parentProperty;
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Get display name for an entity type
|
|
82
|
+
*/
|
|
83
|
+
getDisplayName(entityType) {
|
|
84
|
+
const config = this.entityConfigs.get(entityType);
|
|
85
|
+
return config?.displayName || entityType;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get icon for an entity type
|
|
89
|
+
*/
|
|
90
|
+
getIcon(entityType) {
|
|
91
|
+
const config = this.entityConfigs.get(entityType);
|
|
92
|
+
return config?.icon || null;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Check if entity type exists
|
|
96
|
+
*/
|
|
97
|
+
hasEntityType(entityType) {
|
|
98
|
+
return this.entityConfigs.has(entityType);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Remove an entity configuration
|
|
102
|
+
*/
|
|
103
|
+
unregisterEntity(entityType) {
|
|
104
|
+
return this.entityConfigs.delete(entityType);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Clear all configurations
|
|
108
|
+
*/
|
|
109
|
+
clear() {
|
|
110
|
+
this.entityConfigs.clear();
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Resolve static parent type
|
|
114
|
+
*/
|
|
115
|
+
resolveStaticParent(resolver) {
|
|
116
|
+
return {
|
|
117
|
+
parentType: resolver.parentType,
|
|
118
|
+
isDynamic: false
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Resolve dynamic parent type based on entity data
|
|
123
|
+
*/
|
|
124
|
+
resolveDynamicParent(resolver, entityData) {
|
|
125
|
+
const propertyValue = entityData?.[resolver.parentProperty];
|
|
126
|
+
if (propertyValue && typeof propertyValue === 'string' && propertyValue.trim()) {
|
|
127
|
+
// Use the property value to construct the parent type
|
|
128
|
+
const parentType = resolver.parentTypePrefix + propertyValue.trim();
|
|
129
|
+
return {
|
|
130
|
+
parentType,
|
|
131
|
+
isDynamic: true,
|
|
132
|
+
resolvedProperty: propertyValue.trim(),
|
|
133
|
+
usedFallback: false
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
// Fall back to default parent
|
|
137
|
+
return {
|
|
138
|
+
parentType: resolver.fallbackParent,
|
|
139
|
+
isDynamic: true,
|
|
140
|
+
usedFallback: true
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Register default entity configurations
|
|
145
|
+
*/
|
|
146
|
+
registerDefaultEntities() {
|
|
147
|
+
// Agenda Panel (dynamic parent for agenda items based on category)
|
|
148
|
+
this.registerEntity({
|
|
149
|
+
entityType: 'agenda_panel',
|
|
150
|
+
parentResolver: {
|
|
151
|
+
type: 'static',
|
|
152
|
+
parentType: 'agenda_panel' // Panel level templates
|
|
153
|
+
},
|
|
154
|
+
displayName: 'Agenda Panel',
|
|
155
|
+
icon: 'calendar',
|
|
156
|
+
description: 'Default agenda panel templates'
|
|
157
|
+
});
|
|
158
|
+
// Agenda Item (dynamic parent based on category)
|
|
159
|
+
this.registerEntity({
|
|
160
|
+
entityType: 'agenda_item',
|
|
161
|
+
parentResolver: {
|
|
162
|
+
type: 'dynamic',
|
|
163
|
+
parentProperty: 'category',
|
|
164
|
+
parentTypePrefix: 'agenda_category_',
|
|
165
|
+
fallbackParent: 'agenda_panel'
|
|
166
|
+
},
|
|
167
|
+
displayName: 'Agenda Item',
|
|
168
|
+
icon: 'calendar',
|
|
169
|
+
description: 'Individual agenda item notifications'
|
|
170
|
+
});
|
|
171
|
+
// Habits Panel (static parent for habits)
|
|
172
|
+
this.registerEntity({
|
|
173
|
+
entityType: 'habits_panel',
|
|
174
|
+
parentResolver: {
|
|
175
|
+
type: 'static',
|
|
176
|
+
parentType: 'habits_panel'
|
|
177
|
+
},
|
|
178
|
+
displayName: 'Habits Panel',
|
|
179
|
+
icon: 'fitness',
|
|
180
|
+
description: 'Default habits panel templates'
|
|
181
|
+
});
|
|
182
|
+
// Habit (static parent - all habits inherit from habits panel)
|
|
183
|
+
this.registerEntity({
|
|
184
|
+
entityType: 'habit',
|
|
185
|
+
parentResolver: {
|
|
186
|
+
type: 'static',
|
|
187
|
+
parentType: 'habits_panel'
|
|
188
|
+
},
|
|
189
|
+
displayName: 'Habit',
|
|
190
|
+
icon: 'fitness',
|
|
191
|
+
description: 'Individual habit notifications'
|
|
192
|
+
});
|
|
193
|
+
// Inbox Panel (no parent - top level)
|
|
194
|
+
this.registerEntity({
|
|
195
|
+
entityType: 'inbox_panel',
|
|
196
|
+
parentResolver: {
|
|
197
|
+
type: 'static',
|
|
198
|
+
parentType: '' // No parent - this is a top-level entity
|
|
199
|
+
},
|
|
200
|
+
displayName: 'Inbox Panel',
|
|
201
|
+
icon: 'mail',
|
|
202
|
+
description: 'Inbox notifications'
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
exports.NotificationEntityRegistry = NotificationEntityRegistry;
|
|
207
|
+
/**
|
|
208
|
+
* Convenience function to get the singleton instance
|
|
209
|
+
*/
|
|
210
|
+
function getNotificationEntityRegistry() {
|
|
211
|
+
return NotificationEntityRegistry.getInstance();
|
|
212
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export * from './id-types';
|
|
|
6
6
|
export * from './people-types';
|
|
7
7
|
export * from './lists-types';
|
|
8
8
|
export * from './notifications-types';
|
|
9
|
+
export * from './notification-entity-config';
|
|
9
10
|
export * from './auth-types';
|
|
10
11
|
export * from './user-types';
|
|
11
12
|
export * from './program-config-types';
|
|
12
|
-
export * from './misc';
|
package/dist/types/index.js
CHANGED
|
@@ -22,7 +22,7 @@ __exportStar(require("./id-types"), exports);
|
|
|
22
22
|
__exportStar(require("./people-types"), exports);
|
|
23
23
|
__exportStar(require("./lists-types"), exports);
|
|
24
24
|
__exportStar(require("./notifications-types"), exports);
|
|
25
|
+
__exportStar(require("./notification-entity-config"), exports);
|
|
25
26
|
__exportStar(require("./auth-types"), exports);
|
|
26
27
|
__exportStar(require("./user-types"), exports);
|
|
27
28
|
__exportStar(require("./program-config-types"), exports);
|
|
28
|
-
__exportStar(require("./misc"), exports);
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Static parent resolver - entity always inherits from the same parent type
|
|
4
|
+
*/
|
|
5
|
+
export interface StaticParentResolver {
|
|
6
|
+
type: 'static';
|
|
7
|
+
parentType: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Dynamic parent resolver - parent determined by entity properties
|
|
11
|
+
*/
|
|
12
|
+
export interface DynamicParentResolver {
|
|
13
|
+
type: 'dynamic';
|
|
14
|
+
parentProperty: string;
|
|
15
|
+
parentTypePrefix: string;
|
|
16
|
+
fallbackParent: string;
|
|
17
|
+
}
|
|
18
|
+
export type ParentResolver = StaticParentResolver | DynamicParentResolver;
|
|
19
|
+
/**
|
|
20
|
+
* Configuration for a notification entity type
|
|
21
|
+
*/
|
|
22
|
+
export interface NotificationEntityConfig {
|
|
23
|
+
entityType: string;
|
|
24
|
+
parentResolver: ParentResolver;
|
|
25
|
+
displayName: string;
|
|
26
|
+
icon?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Result of parent resolution for a specific entity instance
|
|
31
|
+
*/
|
|
32
|
+
export interface ParentResolutionResult {
|
|
33
|
+
parentType: string;
|
|
34
|
+
isDynamic: boolean;
|
|
35
|
+
resolvedProperty?: string;
|
|
36
|
+
usedFallback?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Zod schemas for validation
|
|
40
|
+
*/
|
|
41
|
+
export declare const staticParentResolverSchema: z.ZodObject<{
|
|
42
|
+
type: z.ZodLiteral<"static">;
|
|
43
|
+
parentType: z.ZodString;
|
|
44
|
+
}, "strip", z.ZodTypeAny, {
|
|
45
|
+
type: "static";
|
|
46
|
+
parentType: string;
|
|
47
|
+
}, {
|
|
48
|
+
type: "static";
|
|
49
|
+
parentType: string;
|
|
50
|
+
}>;
|
|
51
|
+
export declare const dynamicParentResolverSchema: z.ZodObject<{
|
|
52
|
+
type: z.ZodLiteral<"dynamic">;
|
|
53
|
+
parentProperty: z.ZodString;
|
|
54
|
+
parentTypePrefix: z.ZodString;
|
|
55
|
+
fallbackParent: z.ZodString;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
type: "dynamic";
|
|
58
|
+
parentProperty: string;
|
|
59
|
+
parentTypePrefix: string;
|
|
60
|
+
fallbackParent: string;
|
|
61
|
+
}, {
|
|
62
|
+
type: "dynamic";
|
|
63
|
+
parentProperty: string;
|
|
64
|
+
parentTypePrefix: string;
|
|
65
|
+
fallbackParent: string;
|
|
66
|
+
}>;
|
|
67
|
+
export declare const parentResolverSchema: z.ZodUnion<[z.ZodObject<{
|
|
68
|
+
type: z.ZodLiteral<"static">;
|
|
69
|
+
parentType: z.ZodString;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
type: "static";
|
|
72
|
+
parentType: string;
|
|
73
|
+
}, {
|
|
74
|
+
type: "static";
|
|
75
|
+
parentType: string;
|
|
76
|
+
}>, z.ZodObject<{
|
|
77
|
+
type: z.ZodLiteral<"dynamic">;
|
|
78
|
+
parentProperty: z.ZodString;
|
|
79
|
+
parentTypePrefix: z.ZodString;
|
|
80
|
+
fallbackParent: z.ZodString;
|
|
81
|
+
}, "strip", z.ZodTypeAny, {
|
|
82
|
+
type: "dynamic";
|
|
83
|
+
parentProperty: string;
|
|
84
|
+
parentTypePrefix: string;
|
|
85
|
+
fallbackParent: string;
|
|
86
|
+
}, {
|
|
87
|
+
type: "dynamic";
|
|
88
|
+
parentProperty: string;
|
|
89
|
+
parentTypePrefix: string;
|
|
90
|
+
fallbackParent: string;
|
|
91
|
+
}>]>;
|
|
92
|
+
export declare const notificationEntityConfigSchema: z.ZodObject<{
|
|
93
|
+
entityType: z.ZodString;
|
|
94
|
+
parentResolver: z.ZodUnion<[z.ZodObject<{
|
|
95
|
+
type: z.ZodLiteral<"static">;
|
|
96
|
+
parentType: z.ZodString;
|
|
97
|
+
}, "strip", z.ZodTypeAny, {
|
|
98
|
+
type: "static";
|
|
99
|
+
parentType: string;
|
|
100
|
+
}, {
|
|
101
|
+
type: "static";
|
|
102
|
+
parentType: string;
|
|
103
|
+
}>, z.ZodObject<{
|
|
104
|
+
type: z.ZodLiteral<"dynamic">;
|
|
105
|
+
parentProperty: z.ZodString;
|
|
106
|
+
parentTypePrefix: z.ZodString;
|
|
107
|
+
fallbackParent: z.ZodString;
|
|
108
|
+
}, "strip", z.ZodTypeAny, {
|
|
109
|
+
type: "dynamic";
|
|
110
|
+
parentProperty: string;
|
|
111
|
+
parentTypePrefix: string;
|
|
112
|
+
fallbackParent: string;
|
|
113
|
+
}, {
|
|
114
|
+
type: "dynamic";
|
|
115
|
+
parentProperty: string;
|
|
116
|
+
parentTypePrefix: string;
|
|
117
|
+
fallbackParent: string;
|
|
118
|
+
}>]>;
|
|
119
|
+
displayName: z.ZodString;
|
|
120
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
121
|
+
description: z.ZodOptional<z.ZodString>;
|
|
122
|
+
}, "strip", z.ZodTypeAny, {
|
|
123
|
+
entityType: string;
|
|
124
|
+
parentResolver: {
|
|
125
|
+
type: "static";
|
|
126
|
+
parentType: string;
|
|
127
|
+
} | {
|
|
128
|
+
type: "dynamic";
|
|
129
|
+
parentProperty: string;
|
|
130
|
+
parentTypePrefix: string;
|
|
131
|
+
fallbackParent: string;
|
|
132
|
+
};
|
|
133
|
+
displayName: string;
|
|
134
|
+
description?: string | undefined;
|
|
135
|
+
icon?: string | undefined;
|
|
136
|
+
}, {
|
|
137
|
+
entityType: string;
|
|
138
|
+
parentResolver: {
|
|
139
|
+
type: "static";
|
|
140
|
+
parentType: string;
|
|
141
|
+
} | {
|
|
142
|
+
type: "dynamic";
|
|
143
|
+
parentProperty: string;
|
|
144
|
+
parentTypePrefix: string;
|
|
145
|
+
fallbackParent: string;
|
|
146
|
+
};
|
|
147
|
+
displayName: string;
|
|
148
|
+
description?: string | undefined;
|
|
149
|
+
icon?: string | undefined;
|
|
150
|
+
}>;
|
|
151
|
+
/**
|
|
152
|
+
* Type exports
|
|
153
|
+
*/
|
|
154
|
+
export type StaticParentResolverData = z.infer<typeof staticParentResolverSchema>;
|
|
155
|
+
export type DynamicParentResolverData = z.infer<typeof dynamicParentResolverSchema>;
|
|
156
|
+
export type ParentResolverData = z.infer<typeof parentResolverSchema>;
|
|
157
|
+
export type NotificationEntityConfigData = z.infer<typeof notificationEntityConfigSchema>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.notificationEntityConfigSchema = exports.parentResolverSchema = exports.dynamicParentResolverSchema = exports.staticParentResolverSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Zod schemas for validation
|
|
7
|
+
*/
|
|
8
|
+
exports.staticParentResolverSchema = zod_1.z.object({
|
|
9
|
+
type: zod_1.z.literal('static'),
|
|
10
|
+
parentType: zod_1.z.string()
|
|
11
|
+
});
|
|
12
|
+
exports.dynamicParentResolverSchema = zod_1.z.object({
|
|
13
|
+
type: zod_1.z.literal('dynamic'),
|
|
14
|
+
parentProperty: zod_1.z.string(),
|
|
15
|
+
parentTypePrefix: zod_1.z.string(),
|
|
16
|
+
fallbackParent: zod_1.z.string()
|
|
17
|
+
});
|
|
18
|
+
exports.parentResolverSchema = zod_1.z.union([
|
|
19
|
+
exports.staticParentResolverSchema,
|
|
20
|
+
exports.dynamicParentResolverSchema
|
|
21
|
+
]);
|
|
22
|
+
exports.notificationEntityConfigSchema = zod_1.z.object({
|
|
23
|
+
entityType: zod_1.z.string(),
|
|
24
|
+
parentResolver: exports.parentResolverSchema,
|
|
25
|
+
displayName: zod_1.z.string(),
|
|
26
|
+
icon: zod_1.z.string().optional(),
|
|
27
|
+
description: zod_1.z.string().optional()
|
|
28
|
+
});
|