@app-vitals/agent-admin 1.73.0 → 1.74.0
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/openapi.platform.json +199 -0
- package/package.json +2 -2
- package/prisma/client/internal/class.ts +4 -4
- package/prisma/client/internal/prismaNamespace.ts +4 -0
- package/prisma/client/internal/prismaNamespaceBrowser.ts +4 -0
- package/prisma/client/models/AgentMember.ts +36 -1
- package/prisma/client/models/ChatThreadWatch.ts +29 -1
- package/prisma/client/models/PushSubscription.ts +29 -1
- package/prisma/client/models/UserNotificationPrefs.ts +29 -1
- package/prisma/migrations/20261118000000_add_member_id_columns/migration.sql +14 -0
- package/prisma/schema/schema.prisma +5 -0
- package/src/admin-boot.ts +13 -0
- package/src/admin-dev-login.smoke.test.ts +1 -0
- package/src/admin-local-agent.smoke.test.ts +9 -1
- package/src/admin-spec.ts +17 -0
- package/src/admin-ui.fixtures.ts +1 -0
- package/src/admin-ui.smoke.test.ts +57 -8
- package/src/agent-cron-run-stats.smoke.test.ts +1 -0
- package/src/agent-members.unit.test.ts +6 -1
- package/src/agents-api.smoke.test.ts +5 -0
- package/src/api.smoke.test.ts +1 -0
- package/src/chat.smoke.test.ts +2 -0
- package/src/openapi-schemas.ts +31 -0
- package/src/principal-lookup.ts +67 -0
- package/src/principal-lookup.unit.test.ts +104 -0
- package/src/principals-api.integration.test.ts +115 -0
- package/src/principals-api.ts +142 -0
- package/src/principals-api.unit.test.ts +83 -0
- package/src/slack-provisioning.integration.test.ts +1 -0
|
@@ -31,6 +31,7 @@ export type PushSubscriptionMinAggregateOutputType = {
|
|
|
31
31
|
p256dh: string | null
|
|
32
32
|
auth: string | null
|
|
33
33
|
detailOptIn: string | null
|
|
34
|
+
memberId: string | null
|
|
34
35
|
createdAt: Date | null
|
|
35
36
|
updatedAt: Date | null
|
|
36
37
|
}
|
|
@@ -42,6 +43,7 @@ export type PushSubscriptionMaxAggregateOutputType = {
|
|
|
42
43
|
p256dh: string | null
|
|
43
44
|
auth: string | null
|
|
44
45
|
detailOptIn: string | null
|
|
46
|
+
memberId: string | null
|
|
45
47
|
createdAt: Date | null
|
|
46
48
|
updatedAt: Date | null
|
|
47
49
|
}
|
|
@@ -53,6 +55,7 @@ export type PushSubscriptionCountAggregateOutputType = {
|
|
|
53
55
|
p256dh: number
|
|
54
56
|
auth: number
|
|
55
57
|
detailOptIn: number
|
|
58
|
+
memberId: number
|
|
56
59
|
createdAt: number
|
|
57
60
|
updatedAt: number
|
|
58
61
|
_all: number
|
|
@@ -66,6 +69,7 @@ export type PushSubscriptionMinAggregateInputType = {
|
|
|
66
69
|
p256dh?: true
|
|
67
70
|
auth?: true
|
|
68
71
|
detailOptIn?: true
|
|
72
|
+
memberId?: true
|
|
69
73
|
createdAt?: true
|
|
70
74
|
updatedAt?: true
|
|
71
75
|
}
|
|
@@ -77,6 +81,7 @@ export type PushSubscriptionMaxAggregateInputType = {
|
|
|
77
81
|
p256dh?: true
|
|
78
82
|
auth?: true
|
|
79
83
|
detailOptIn?: true
|
|
84
|
+
memberId?: true
|
|
80
85
|
createdAt?: true
|
|
81
86
|
updatedAt?: true
|
|
82
87
|
}
|
|
@@ -88,6 +93,7 @@ export type PushSubscriptionCountAggregateInputType = {
|
|
|
88
93
|
p256dh?: true
|
|
89
94
|
auth?: true
|
|
90
95
|
detailOptIn?: true
|
|
96
|
+
memberId?: true
|
|
91
97
|
createdAt?: true
|
|
92
98
|
updatedAt?: true
|
|
93
99
|
_all?: true
|
|
@@ -172,6 +178,7 @@ export type PushSubscriptionGroupByOutputType = {
|
|
|
172
178
|
p256dh: string
|
|
173
179
|
auth: string
|
|
174
180
|
detailOptIn: string
|
|
181
|
+
memberId: string | null
|
|
175
182
|
createdAt: Date
|
|
176
183
|
updatedAt: Date
|
|
177
184
|
_count: PushSubscriptionCountAggregateOutputType | null
|
|
@@ -204,6 +211,7 @@ export type PushSubscriptionWhereInput = {
|
|
|
204
211
|
p256dh?: Prisma.StringFilter<"PushSubscription"> | string
|
|
205
212
|
auth?: Prisma.StringFilter<"PushSubscription"> | string
|
|
206
213
|
detailOptIn?: Prisma.StringFilter<"PushSubscription"> | string
|
|
214
|
+
memberId?: Prisma.StringNullableFilter<"PushSubscription"> | string | null
|
|
207
215
|
createdAt?: Prisma.DateTimeFilter<"PushSubscription"> | Date | string
|
|
208
216
|
updatedAt?: Prisma.DateTimeFilter<"PushSubscription"> | Date | string
|
|
209
217
|
}
|
|
@@ -215,6 +223,7 @@ export type PushSubscriptionOrderByWithRelationInput = {
|
|
|
215
223
|
p256dh?: Prisma.SortOrder
|
|
216
224
|
auth?: Prisma.SortOrder
|
|
217
225
|
detailOptIn?: Prisma.SortOrder
|
|
226
|
+
memberId?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
218
227
|
createdAt?: Prisma.SortOrder
|
|
219
228
|
updatedAt?: Prisma.SortOrder
|
|
220
229
|
}
|
|
@@ -229,6 +238,7 @@ export type PushSubscriptionWhereUniqueInput = Prisma.AtLeast<{
|
|
|
229
238
|
p256dh?: Prisma.StringFilter<"PushSubscription"> | string
|
|
230
239
|
auth?: Prisma.StringFilter<"PushSubscription"> | string
|
|
231
240
|
detailOptIn?: Prisma.StringFilter<"PushSubscription"> | string
|
|
241
|
+
memberId?: Prisma.StringNullableFilter<"PushSubscription"> | string | null
|
|
232
242
|
createdAt?: Prisma.DateTimeFilter<"PushSubscription"> | Date | string
|
|
233
243
|
updatedAt?: Prisma.DateTimeFilter<"PushSubscription"> | Date | string
|
|
234
244
|
}, "id" | "endpoint">
|
|
@@ -240,6 +250,7 @@ export type PushSubscriptionOrderByWithAggregationInput = {
|
|
|
240
250
|
p256dh?: Prisma.SortOrder
|
|
241
251
|
auth?: Prisma.SortOrder
|
|
242
252
|
detailOptIn?: Prisma.SortOrder
|
|
253
|
+
memberId?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
243
254
|
createdAt?: Prisma.SortOrder
|
|
244
255
|
updatedAt?: Prisma.SortOrder
|
|
245
256
|
_count?: Prisma.PushSubscriptionCountOrderByAggregateInput
|
|
@@ -257,6 +268,7 @@ export type PushSubscriptionScalarWhereWithAggregatesInput = {
|
|
|
257
268
|
p256dh?: Prisma.StringWithAggregatesFilter<"PushSubscription"> | string
|
|
258
269
|
auth?: Prisma.StringWithAggregatesFilter<"PushSubscription"> | string
|
|
259
270
|
detailOptIn?: Prisma.StringWithAggregatesFilter<"PushSubscription"> | string
|
|
271
|
+
memberId?: Prisma.StringNullableWithAggregatesFilter<"PushSubscription"> | string | null
|
|
260
272
|
createdAt?: Prisma.DateTimeWithAggregatesFilter<"PushSubscription"> | Date | string
|
|
261
273
|
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"PushSubscription"> | Date | string
|
|
262
274
|
}
|
|
@@ -268,6 +280,7 @@ export type PushSubscriptionCreateInput = {
|
|
|
268
280
|
p256dh: string
|
|
269
281
|
auth: string
|
|
270
282
|
detailOptIn?: string
|
|
283
|
+
memberId?: string | null
|
|
271
284
|
createdAt?: Date | string
|
|
272
285
|
updatedAt?: Date | string
|
|
273
286
|
}
|
|
@@ -279,6 +292,7 @@ export type PushSubscriptionUncheckedCreateInput = {
|
|
|
279
292
|
p256dh: string
|
|
280
293
|
auth: string
|
|
281
294
|
detailOptIn?: string
|
|
295
|
+
memberId?: string | null
|
|
282
296
|
createdAt?: Date | string
|
|
283
297
|
updatedAt?: Date | string
|
|
284
298
|
}
|
|
@@ -290,6 +304,7 @@ export type PushSubscriptionUpdateInput = {
|
|
|
290
304
|
p256dh?: Prisma.StringFieldUpdateOperationsInput | string
|
|
291
305
|
auth?: Prisma.StringFieldUpdateOperationsInput | string
|
|
292
306
|
detailOptIn?: Prisma.StringFieldUpdateOperationsInput | string
|
|
307
|
+
memberId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
293
308
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
294
309
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
295
310
|
}
|
|
@@ -301,6 +316,7 @@ export type PushSubscriptionUncheckedUpdateInput = {
|
|
|
301
316
|
p256dh?: Prisma.StringFieldUpdateOperationsInput | string
|
|
302
317
|
auth?: Prisma.StringFieldUpdateOperationsInput | string
|
|
303
318
|
detailOptIn?: Prisma.StringFieldUpdateOperationsInput | string
|
|
319
|
+
memberId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
304
320
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
305
321
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
306
322
|
}
|
|
@@ -312,6 +328,7 @@ export type PushSubscriptionCreateManyInput = {
|
|
|
312
328
|
p256dh: string
|
|
313
329
|
auth: string
|
|
314
330
|
detailOptIn?: string
|
|
331
|
+
memberId?: string | null
|
|
315
332
|
createdAt?: Date | string
|
|
316
333
|
updatedAt?: Date | string
|
|
317
334
|
}
|
|
@@ -323,6 +340,7 @@ export type PushSubscriptionUpdateManyMutationInput = {
|
|
|
323
340
|
p256dh?: Prisma.StringFieldUpdateOperationsInput | string
|
|
324
341
|
auth?: Prisma.StringFieldUpdateOperationsInput | string
|
|
325
342
|
detailOptIn?: Prisma.StringFieldUpdateOperationsInput | string
|
|
343
|
+
memberId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
326
344
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
327
345
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
328
346
|
}
|
|
@@ -334,6 +352,7 @@ export type PushSubscriptionUncheckedUpdateManyInput = {
|
|
|
334
352
|
p256dh?: Prisma.StringFieldUpdateOperationsInput | string
|
|
335
353
|
auth?: Prisma.StringFieldUpdateOperationsInput | string
|
|
336
354
|
detailOptIn?: Prisma.StringFieldUpdateOperationsInput | string
|
|
355
|
+
memberId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
337
356
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
338
357
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
339
358
|
}
|
|
@@ -345,6 +364,7 @@ export type PushSubscriptionCountOrderByAggregateInput = {
|
|
|
345
364
|
p256dh?: Prisma.SortOrder
|
|
346
365
|
auth?: Prisma.SortOrder
|
|
347
366
|
detailOptIn?: Prisma.SortOrder
|
|
367
|
+
memberId?: Prisma.SortOrder
|
|
348
368
|
createdAt?: Prisma.SortOrder
|
|
349
369
|
updatedAt?: Prisma.SortOrder
|
|
350
370
|
}
|
|
@@ -356,6 +376,7 @@ export type PushSubscriptionMaxOrderByAggregateInput = {
|
|
|
356
376
|
p256dh?: Prisma.SortOrder
|
|
357
377
|
auth?: Prisma.SortOrder
|
|
358
378
|
detailOptIn?: Prisma.SortOrder
|
|
379
|
+
memberId?: Prisma.SortOrder
|
|
359
380
|
createdAt?: Prisma.SortOrder
|
|
360
381
|
updatedAt?: Prisma.SortOrder
|
|
361
382
|
}
|
|
@@ -367,6 +388,7 @@ export type PushSubscriptionMinOrderByAggregateInput = {
|
|
|
367
388
|
p256dh?: Prisma.SortOrder
|
|
368
389
|
auth?: Prisma.SortOrder
|
|
369
390
|
detailOptIn?: Prisma.SortOrder
|
|
391
|
+
memberId?: Prisma.SortOrder
|
|
370
392
|
createdAt?: Prisma.SortOrder
|
|
371
393
|
updatedAt?: Prisma.SortOrder
|
|
372
394
|
}
|
|
@@ -380,6 +402,7 @@ export type PushSubscriptionSelect<ExtArgs extends runtime.Types.Extensions.Inte
|
|
|
380
402
|
p256dh?: boolean
|
|
381
403
|
auth?: boolean
|
|
382
404
|
detailOptIn?: boolean
|
|
405
|
+
memberId?: boolean
|
|
383
406
|
createdAt?: boolean
|
|
384
407
|
updatedAt?: boolean
|
|
385
408
|
}, ExtArgs["result"]["pushSubscription"]>
|
|
@@ -391,6 +414,7 @@ export type PushSubscriptionSelectCreateManyAndReturn<ExtArgs extends runtime.Ty
|
|
|
391
414
|
p256dh?: boolean
|
|
392
415
|
auth?: boolean
|
|
393
416
|
detailOptIn?: boolean
|
|
417
|
+
memberId?: boolean
|
|
394
418
|
createdAt?: boolean
|
|
395
419
|
updatedAt?: boolean
|
|
396
420
|
}, ExtArgs["result"]["pushSubscription"]>
|
|
@@ -402,6 +426,7 @@ export type PushSubscriptionSelectUpdateManyAndReturn<ExtArgs extends runtime.Ty
|
|
|
402
426
|
p256dh?: boolean
|
|
403
427
|
auth?: boolean
|
|
404
428
|
detailOptIn?: boolean
|
|
429
|
+
memberId?: boolean
|
|
405
430
|
createdAt?: boolean
|
|
406
431
|
updatedAt?: boolean
|
|
407
432
|
}, ExtArgs["result"]["pushSubscription"]>
|
|
@@ -413,11 +438,12 @@ export type PushSubscriptionSelectScalar = {
|
|
|
413
438
|
p256dh?: boolean
|
|
414
439
|
auth?: boolean
|
|
415
440
|
detailOptIn?: boolean
|
|
441
|
+
memberId?: boolean
|
|
416
442
|
createdAt?: boolean
|
|
417
443
|
updatedAt?: boolean
|
|
418
444
|
}
|
|
419
445
|
|
|
420
|
-
export type PushSubscriptionOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "userEmail" | "endpoint" | "p256dh" | "auth" | "detailOptIn" | "createdAt" | "updatedAt", ExtArgs["result"]["pushSubscription"]>
|
|
446
|
+
export type PushSubscriptionOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "userEmail" | "endpoint" | "p256dh" | "auth" | "detailOptIn" | "memberId" | "createdAt" | "updatedAt", ExtArgs["result"]["pushSubscription"]>
|
|
421
447
|
|
|
422
448
|
export type $PushSubscriptionPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
|
423
449
|
name: "PushSubscription"
|
|
@@ -429,6 +455,7 @@ export type $PushSubscriptionPayload<ExtArgs extends runtime.Types.Extensions.In
|
|
|
429
455
|
p256dh: string
|
|
430
456
|
auth: string
|
|
431
457
|
detailOptIn: string
|
|
458
|
+
memberId: string | null
|
|
432
459
|
createdAt: Date
|
|
433
460
|
updatedAt: Date
|
|
434
461
|
}, ExtArgs["result"]["pushSubscription"]>
|
|
@@ -860,6 +887,7 @@ export interface PushSubscriptionFieldRefs {
|
|
|
860
887
|
readonly p256dh: Prisma.FieldRef<"PushSubscription", 'String'>
|
|
861
888
|
readonly auth: Prisma.FieldRef<"PushSubscription", 'String'>
|
|
862
889
|
readonly detailOptIn: Prisma.FieldRef<"PushSubscription", 'String'>
|
|
890
|
+
readonly memberId: Prisma.FieldRef<"PushSubscription", 'String'>
|
|
863
891
|
readonly createdAt: Prisma.FieldRef<"PushSubscription", 'DateTime'>
|
|
864
892
|
readonly updatedAt: Prisma.FieldRef<"PushSubscription", 'DateTime'>
|
|
865
893
|
}
|
|
@@ -39,6 +39,7 @@ export type UserNotificationPrefsMinAggregateOutputType = {
|
|
|
39
39
|
autoFollowSessions: boolean | null
|
|
40
40
|
reminderHourLocal: number | null
|
|
41
41
|
autoFollowSince: Date | null
|
|
42
|
+
memberId: string | null
|
|
42
43
|
createdAt: Date | null
|
|
43
44
|
updatedAt: Date | null
|
|
44
45
|
}
|
|
@@ -48,6 +49,7 @@ export type UserNotificationPrefsMaxAggregateOutputType = {
|
|
|
48
49
|
autoFollowSessions: boolean | null
|
|
49
50
|
reminderHourLocal: number | null
|
|
50
51
|
autoFollowSince: Date | null
|
|
52
|
+
memberId: string | null
|
|
51
53
|
createdAt: Date | null
|
|
52
54
|
updatedAt: Date | null
|
|
53
55
|
}
|
|
@@ -57,6 +59,7 @@ export type UserNotificationPrefsCountAggregateOutputType = {
|
|
|
57
59
|
autoFollowSessions: number
|
|
58
60
|
reminderHourLocal: number
|
|
59
61
|
autoFollowSince: number
|
|
62
|
+
memberId: number
|
|
60
63
|
createdAt: number
|
|
61
64
|
updatedAt: number
|
|
62
65
|
_all: number
|
|
@@ -76,6 +79,7 @@ export type UserNotificationPrefsMinAggregateInputType = {
|
|
|
76
79
|
autoFollowSessions?: true
|
|
77
80
|
reminderHourLocal?: true
|
|
78
81
|
autoFollowSince?: true
|
|
82
|
+
memberId?: true
|
|
79
83
|
createdAt?: true
|
|
80
84
|
updatedAt?: true
|
|
81
85
|
}
|
|
@@ -85,6 +89,7 @@ export type UserNotificationPrefsMaxAggregateInputType = {
|
|
|
85
89
|
autoFollowSessions?: true
|
|
86
90
|
reminderHourLocal?: true
|
|
87
91
|
autoFollowSince?: true
|
|
92
|
+
memberId?: true
|
|
88
93
|
createdAt?: true
|
|
89
94
|
updatedAt?: true
|
|
90
95
|
}
|
|
@@ -94,6 +99,7 @@ export type UserNotificationPrefsCountAggregateInputType = {
|
|
|
94
99
|
autoFollowSessions?: true
|
|
95
100
|
reminderHourLocal?: true
|
|
96
101
|
autoFollowSince?: true
|
|
102
|
+
memberId?: true
|
|
97
103
|
createdAt?: true
|
|
98
104
|
updatedAt?: true
|
|
99
105
|
_all?: true
|
|
@@ -190,6 +196,7 @@ export type UserNotificationPrefsGroupByOutputType = {
|
|
|
190
196
|
autoFollowSessions: boolean
|
|
191
197
|
reminderHourLocal: number
|
|
192
198
|
autoFollowSince: Date | null
|
|
199
|
+
memberId: string | null
|
|
193
200
|
createdAt: Date
|
|
194
201
|
updatedAt: Date
|
|
195
202
|
_count: UserNotificationPrefsCountAggregateOutputType | null
|
|
@@ -222,6 +229,7 @@ export type UserNotificationPrefsWhereInput = {
|
|
|
222
229
|
autoFollowSessions?: Prisma.BoolFilter<"UserNotificationPrefs"> | boolean
|
|
223
230
|
reminderHourLocal?: Prisma.IntFilter<"UserNotificationPrefs"> | number
|
|
224
231
|
autoFollowSince?: Prisma.DateTimeNullableFilter<"UserNotificationPrefs"> | Date | string | null
|
|
232
|
+
memberId?: Prisma.StringNullableFilter<"UserNotificationPrefs"> | string | null
|
|
225
233
|
createdAt?: Prisma.DateTimeFilter<"UserNotificationPrefs"> | Date | string
|
|
226
234
|
updatedAt?: Prisma.DateTimeFilter<"UserNotificationPrefs"> | Date | string
|
|
227
235
|
}
|
|
@@ -231,6 +239,7 @@ export type UserNotificationPrefsOrderByWithRelationInput = {
|
|
|
231
239
|
autoFollowSessions?: Prisma.SortOrder
|
|
232
240
|
reminderHourLocal?: Prisma.SortOrder
|
|
233
241
|
autoFollowSince?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
242
|
+
memberId?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
234
243
|
createdAt?: Prisma.SortOrder
|
|
235
244
|
updatedAt?: Prisma.SortOrder
|
|
236
245
|
}
|
|
@@ -243,6 +252,7 @@ export type UserNotificationPrefsWhereUniqueInput = Prisma.AtLeast<{
|
|
|
243
252
|
autoFollowSessions?: Prisma.BoolFilter<"UserNotificationPrefs"> | boolean
|
|
244
253
|
reminderHourLocal?: Prisma.IntFilter<"UserNotificationPrefs"> | number
|
|
245
254
|
autoFollowSince?: Prisma.DateTimeNullableFilter<"UserNotificationPrefs"> | Date | string | null
|
|
255
|
+
memberId?: Prisma.StringNullableFilter<"UserNotificationPrefs"> | string | null
|
|
246
256
|
createdAt?: Prisma.DateTimeFilter<"UserNotificationPrefs"> | Date | string
|
|
247
257
|
updatedAt?: Prisma.DateTimeFilter<"UserNotificationPrefs"> | Date | string
|
|
248
258
|
}, "userEmail">
|
|
@@ -252,6 +262,7 @@ export type UserNotificationPrefsOrderByWithAggregationInput = {
|
|
|
252
262
|
autoFollowSessions?: Prisma.SortOrder
|
|
253
263
|
reminderHourLocal?: Prisma.SortOrder
|
|
254
264
|
autoFollowSince?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
265
|
+
memberId?: Prisma.SortOrderInput | Prisma.SortOrder
|
|
255
266
|
createdAt?: Prisma.SortOrder
|
|
256
267
|
updatedAt?: Prisma.SortOrder
|
|
257
268
|
_count?: Prisma.UserNotificationPrefsCountOrderByAggregateInput
|
|
@@ -269,6 +280,7 @@ export type UserNotificationPrefsScalarWhereWithAggregatesInput = {
|
|
|
269
280
|
autoFollowSessions?: Prisma.BoolWithAggregatesFilter<"UserNotificationPrefs"> | boolean
|
|
270
281
|
reminderHourLocal?: Prisma.IntWithAggregatesFilter<"UserNotificationPrefs"> | number
|
|
271
282
|
autoFollowSince?: Prisma.DateTimeNullableWithAggregatesFilter<"UserNotificationPrefs"> | Date | string | null
|
|
283
|
+
memberId?: Prisma.StringNullableWithAggregatesFilter<"UserNotificationPrefs"> | string | null
|
|
272
284
|
createdAt?: Prisma.DateTimeWithAggregatesFilter<"UserNotificationPrefs"> | Date | string
|
|
273
285
|
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"UserNotificationPrefs"> | Date | string
|
|
274
286
|
}
|
|
@@ -278,6 +290,7 @@ export type UserNotificationPrefsCreateInput = {
|
|
|
278
290
|
autoFollowSessions?: boolean
|
|
279
291
|
reminderHourLocal?: number
|
|
280
292
|
autoFollowSince?: Date | string | null
|
|
293
|
+
memberId?: string | null
|
|
281
294
|
createdAt?: Date | string
|
|
282
295
|
updatedAt?: Date | string
|
|
283
296
|
}
|
|
@@ -287,6 +300,7 @@ export type UserNotificationPrefsUncheckedCreateInput = {
|
|
|
287
300
|
autoFollowSessions?: boolean
|
|
288
301
|
reminderHourLocal?: number
|
|
289
302
|
autoFollowSince?: Date | string | null
|
|
303
|
+
memberId?: string | null
|
|
290
304
|
createdAt?: Date | string
|
|
291
305
|
updatedAt?: Date | string
|
|
292
306
|
}
|
|
@@ -296,6 +310,7 @@ export type UserNotificationPrefsUpdateInput = {
|
|
|
296
310
|
autoFollowSessions?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
297
311
|
reminderHourLocal?: Prisma.IntFieldUpdateOperationsInput | number
|
|
298
312
|
autoFollowSince?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
|
313
|
+
memberId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
299
314
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
300
315
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
301
316
|
}
|
|
@@ -305,6 +320,7 @@ export type UserNotificationPrefsUncheckedUpdateInput = {
|
|
|
305
320
|
autoFollowSessions?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
306
321
|
reminderHourLocal?: Prisma.IntFieldUpdateOperationsInput | number
|
|
307
322
|
autoFollowSince?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
|
323
|
+
memberId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
308
324
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
309
325
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
310
326
|
}
|
|
@@ -314,6 +330,7 @@ export type UserNotificationPrefsCreateManyInput = {
|
|
|
314
330
|
autoFollowSessions?: boolean
|
|
315
331
|
reminderHourLocal?: number
|
|
316
332
|
autoFollowSince?: Date | string | null
|
|
333
|
+
memberId?: string | null
|
|
317
334
|
createdAt?: Date | string
|
|
318
335
|
updatedAt?: Date | string
|
|
319
336
|
}
|
|
@@ -323,6 +340,7 @@ export type UserNotificationPrefsUpdateManyMutationInput = {
|
|
|
323
340
|
autoFollowSessions?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
324
341
|
reminderHourLocal?: Prisma.IntFieldUpdateOperationsInput | number
|
|
325
342
|
autoFollowSince?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
|
343
|
+
memberId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
326
344
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
327
345
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
328
346
|
}
|
|
@@ -332,6 +350,7 @@ export type UserNotificationPrefsUncheckedUpdateManyInput = {
|
|
|
332
350
|
autoFollowSessions?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
|
333
351
|
reminderHourLocal?: Prisma.IntFieldUpdateOperationsInput | number
|
|
334
352
|
autoFollowSince?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
|
353
|
+
memberId?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
|
335
354
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
336
355
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
337
356
|
}
|
|
@@ -341,6 +360,7 @@ export type UserNotificationPrefsCountOrderByAggregateInput = {
|
|
|
341
360
|
autoFollowSessions?: Prisma.SortOrder
|
|
342
361
|
reminderHourLocal?: Prisma.SortOrder
|
|
343
362
|
autoFollowSince?: Prisma.SortOrder
|
|
363
|
+
memberId?: Prisma.SortOrder
|
|
344
364
|
createdAt?: Prisma.SortOrder
|
|
345
365
|
updatedAt?: Prisma.SortOrder
|
|
346
366
|
}
|
|
@@ -354,6 +374,7 @@ export type UserNotificationPrefsMaxOrderByAggregateInput = {
|
|
|
354
374
|
autoFollowSessions?: Prisma.SortOrder
|
|
355
375
|
reminderHourLocal?: Prisma.SortOrder
|
|
356
376
|
autoFollowSince?: Prisma.SortOrder
|
|
377
|
+
memberId?: Prisma.SortOrder
|
|
357
378
|
createdAt?: Prisma.SortOrder
|
|
358
379
|
updatedAt?: Prisma.SortOrder
|
|
359
380
|
}
|
|
@@ -363,6 +384,7 @@ export type UserNotificationPrefsMinOrderByAggregateInput = {
|
|
|
363
384
|
autoFollowSessions?: Prisma.SortOrder
|
|
364
385
|
reminderHourLocal?: Prisma.SortOrder
|
|
365
386
|
autoFollowSince?: Prisma.SortOrder
|
|
387
|
+
memberId?: Prisma.SortOrder
|
|
366
388
|
createdAt?: Prisma.SortOrder
|
|
367
389
|
updatedAt?: Prisma.SortOrder
|
|
368
390
|
}
|
|
@@ -378,6 +400,7 @@ export type UserNotificationPrefsSelect<ExtArgs extends runtime.Types.Extensions
|
|
|
378
400
|
autoFollowSessions?: boolean
|
|
379
401
|
reminderHourLocal?: boolean
|
|
380
402
|
autoFollowSince?: boolean
|
|
403
|
+
memberId?: boolean
|
|
381
404
|
createdAt?: boolean
|
|
382
405
|
updatedAt?: boolean
|
|
383
406
|
}, ExtArgs["result"]["userNotificationPrefs"]>
|
|
@@ -387,6 +410,7 @@ export type UserNotificationPrefsSelectCreateManyAndReturn<ExtArgs extends runti
|
|
|
387
410
|
autoFollowSessions?: boolean
|
|
388
411
|
reminderHourLocal?: boolean
|
|
389
412
|
autoFollowSince?: boolean
|
|
413
|
+
memberId?: boolean
|
|
390
414
|
createdAt?: boolean
|
|
391
415
|
updatedAt?: boolean
|
|
392
416
|
}, ExtArgs["result"]["userNotificationPrefs"]>
|
|
@@ -396,6 +420,7 @@ export type UserNotificationPrefsSelectUpdateManyAndReturn<ExtArgs extends runti
|
|
|
396
420
|
autoFollowSessions?: boolean
|
|
397
421
|
reminderHourLocal?: boolean
|
|
398
422
|
autoFollowSince?: boolean
|
|
423
|
+
memberId?: boolean
|
|
399
424
|
createdAt?: boolean
|
|
400
425
|
updatedAt?: boolean
|
|
401
426
|
}, ExtArgs["result"]["userNotificationPrefs"]>
|
|
@@ -405,11 +430,12 @@ export type UserNotificationPrefsSelectScalar = {
|
|
|
405
430
|
autoFollowSessions?: boolean
|
|
406
431
|
reminderHourLocal?: boolean
|
|
407
432
|
autoFollowSince?: boolean
|
|
433
|
+
memberId?: boolean
|
|
408
434
|
createdAt?: boolean
|
|
409
435
|
updatedAt?: boolean
|
|
410
436
|
}
|
|
411
437
|
|
|
412
|
-
export type UserNotificationPrefsOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"userEmail" | "autoFollowSessions" | "reminderHourLocal" | "autoFollowSince" | "createdAt" | "updatedAt", ExtArgs["result"]["userNotificationPrefs"]>
|
|
438
|
+
export type UserNotificationPrefsOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"userEmail" | "autoFollowSessions" | "reminderHourLocal" | "autoFollowSince" | "memberId" | "createdAt" | "updatedAt", ExtArgs["result"]["userNotificationPrefs"]>
|
|
413
439
|
|
|
414
440
|
export type $UserNotificationPrefsPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
|
415
441
|
name: "UserNotificationPrefs"
|
|
@@ -419,6 +445,7 @@ export type $UserNotificationPrefsPayload<ExtArgs extends runtime.Types.Extensio
|
|
|
419
445
|
autoFollowSessions: boolean
|
|
420
446
|
reminderHourLocal: number
|
|
421
447
|
autoFollowSince: Date | null
|
|
448
|
+
memberId: string | null
|
|
422
449
|
createdAt: Date
|
|
423
450
|
updatedAt: Date
|
|
424
451
|
}, ExtArgs["result"]["userNotificationPrefs"]>
|
|
@@ -848,6 +875,7 @@ export interface UserNotificationPrefsFieldRefs {
|
|
|
848
875
|
readonly autoFollowSessions: Prisma.FieldRef<"UserNotificationPrefs", 'Boolean'>
|
|
849
876
|
readonly reminderHourLocal: Prisma.FieldRef<"UserNotificationPrefs", 'Int'>
|
|
850
877
|
readonly autoFollowSince: Prisma.FieldRef<"UserNotificationPrefs", 'DateTime'>
|
|
878
|
+
readonly memberId: Prisma.FieldRef<"UserNotificationPrefs", 'String'>
|
|
851
879
|
readonly createdAt: Prisma.FieldRef<"UserNotificationPrefs", 'DateTime'>
|
|
852
880
|
readonly updatedAt: Prisma.FieldRef<"UserNotificationPrefs", 'DateTime'>
|
|
853
881
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
-- ACM-1.1: nullable memberId (AccountMember.id) on the email-keyed per-user
|
|
2
|
+
-- tables. Additive only: no defaults, no constraints, no index, no backfill;
|
|
3
|
+
-- the email columns are untouched.
|
|
4
|
+
-- AlterTable
|
|
5
|
+
ALTER TABLE "AgentMember" ADD COLUMN "memberId" TEXT;
|
|
6
|
+
|
|
7
|
+
-- AlterTable
|
|
8
|
+
ALTER TABLE "ChatThreadWatch" ADD COLUMN "memberId" TEXT;
|
|
9
|
+
|
|
10
|
+
-- AlterTable
|
|
11
|
+
ALTER TABLE "PushSubscription" ADD COLUMN "memberId" TEXT;
|
|
12
|
+
|
|
13
|
+
-- AlterTable
|
|
14
|
+
ALTER TABLE "UserNotificationPrefs" ADD COLUMN "memberId" TEXT;
|
|
@@ -264,6 +264,8 @@ model AgentMember {
|
|
|
264
264
|
id String @id @default(cuid())
|
|
265
265
|
agentId String
|
|
266
266
|
email String
|
|
267
|
+
// ACM-1.1: AccountMember.id, additive/nullable; email column stays the key until backfilled.
|
|
268
|
+
memberId String?
|
|
267
269
|
createdAt DateTime @default(now())
|
|
268
270
|
agent Agent @relation(fields: [agentId], references: [id], onDelete: Cascade)
|
|
269
271
|
|
|
@@ -653,6 +655,7 @@ model PushSubscription {
|
|
|
653
655
|
p256dh String // base64url of the UA public key
|
|
654
656
|
auth String // base64url of the UA auth secret
|
|
655
657
|
detailOptIn String @default("generic") // user opt-in: generic | title | preview
|
|
658
|
+
memberId String? // ACM-1.1: AccountMember.id, additive/nullable
|
|
656
659
|
createdAt DateTime @default(now())
|
|
657
660
|
updatedAt DateTime @updatedAt
|
|
658
661
|
|
|
@@ -671,6 +674,7 @@ model ChatThreadWatch {
|
|
|
671
674
|
userEmail String
|
|
672
675
|
threadId String
|
|
673
676
|
agentId String
|
|
677
|
+
memberId String? // ACM-1.1: AccountMember.id, additive/nullable
|
|
674
678
|
createdAt DateTime @default(now())
|
|
675
679
|
updatedAt DateTime @updatedAt
|
|
676
680
|
|
|
@@ -700,6 +704,7 @@ model UserNotificationPrefs {
|
|
|
700
704
|
autoFollowSessions Boolean @default(true)
|
|
701
705
|
reminderHourLocal Int @default(9)
|
|
702
706
|
autoFollowSince DateTime?
|
|
707
|
+
memberId String? // ACM-1.1: AccountMember.id, additive/nullable
|
|
703
708
|
createdAt DateTime @default(now())
|
|
704
709
|
updatedAt DateTime @updatedAt
|
|
705
710
|
}
|
package/src/admin-boot.ts
CHANGED
|
@@ -115,6 +115,8 @@ import {
|
|
|
115
115
|
createGithubSync,
|
|
116
116
|
} from "./github-installation-wiring.ts";
|
|
117
117
|
|
|
118
|
+
import { PrincipalLookupService } from "./principal-lookup.ts";
|
|
119
|
+
import { createPrincipalsApp } from "./principals-api.ts";
|
|
118
120
|
import { HttpGoogleAuthClient } from "./google-auth-client.ts";
|
|
119
121
|
import { HttpChatClient } from "./http-chat-client.ts";
|
|
120
122
|
import { HttpOktaAuthClient } from "./okta-auth-client.ts";
|
|
@@ -605,6 +607,17 @@ export async function startAdmin(
|
|
|
605
607
|
}),
|
|
606
608
|
);
|
|
607
609
|
|
|
610
|
+
// 3b'. Principals lookup API — /principals/* — admin-only (ACM-1.1)
|
|
611
|
+
root.route(
|
|
612
|
+
"/",
|
|
613
|
+
createPrincipalsApp({
|
|
614
|
+
lookup: new PrincipalLookupService(prisma),
|
|
615
|
+
sessionSecret,
|
|
616
|
+
adminApiKeys,
|
|
617
|
+
agentTokenService,
|
|
618
|
+
}),
|
|
619
|
+
);
|
|
620
|
+
|
|
608
621
|
// 3b''. Agent templates API — /templates/* — admin or account-scoped (ATP-1.3)
|
|
609
622
|
const templateService = new AgentTemplateService(
|
|
610
623
|
prisma,
|
|
@@ -234,6 +234,7 @@ function makeMockDeps(overrides?: Partial<AdminUIDeps>): AdminUIDeps {
|
|
|
234
234
|
id: "m1",
|
|
235
235
|
agentId,
|
|
236
236
|
email,
|
|
237
|
+
memberId: null,
|
|
237
238
|
createdAt: new Date(),
|
|
238
239
|
}),
|
|
239
240
|
remove: async () => {},
|
|
@@ -538,13 +539,20 @@ describe("admin UI — new local agent create flow", () => {
|
|
|
538
539
|
...makeMockDeps().agentMemberService,
|
|
539
540
|
add: async (agentId: string, email: string) => {
|
|
540
541
|
addCalls.push({ agentId, email });
|
|
541
|
-
return {
|
|
542
|
+
return {
|
|
543
|
+
id: "m1",
|
|
544
|
+
agentId,
|
|
545
|
+
email,
|
|
546
|
+
memberId: null,
|
|
547
|
+
createdAt: new Date(),
|
|
548
|
+
};
|
|
542
549
|
},
|
|
543
550
|
listByAgentId: async () =>
|
|
544
551
|
addCalls.map((c) => ({
|
|
545
552
|
id: "m1",
|
|
546
553
|
agentId: c.agentId,
|
|
547
554
|
email: c.email,
|
|
555
|
+
memberId: null,
|
|
548
556
|
createdAt: new Date(),
|
|
549
557
|
})),
|
|
550
558
|
},
|
package/src/admin-spec.ts
CHANGED
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
} from "./agents-api.ts";
|
|
27
27
|
import { createAgentRuntimeApp } from "./api.ts";
|
|
28
28
|
import { createGithubEnterpriseApp } from "./github-enterprise-api.ts";
|
|
29
|
+
import { createPrincipalsApp } from "./principals-api.ts";
|
|
29
30
|
|
|
30
31
|
/** The admin OpenAPI document shape the spec builders and generators share. */
|
|
31
32
|
export interface AdminOpenApiDocument {
|
|
@@ -207,6 +208,21 @@ export function buildPlatformAdminSpec(): AdminOpenApiDocument {
|
|
|
207
208
|
mergedPaths[path] = def as Record<string, unknown>;
|
|
208
209
|
}
|
|
209
210
|
|
|
211
|
+
// ACM-1.1: the /principals lookup routes live in their own app (mounted at
|
|
212
|
+
// the root in admin-boot.ts); fold their paths and schemas in.
|
|
213
|
+
const principalsSpec = createPrincipalsApp({
|
|
214
|
+
lookup: {} as never,
|
|
215
|
+
sessionSecret: SESSION_SECRET,
|
|
216
|
+
adminApiKeys,
|
|
217
|
+
agentTokenService: { validate: async () => null },
|
|
218
|
+
}).getOpenAPI31Document({
|
|
219
|
+
openapi: "3.1.0",
|
|
220
|
+
info: { title: "principals (internal)", version: "0.1.0" },
|
|
221
|
+
});
|
|
222
|
+
for (const [path, def] of Object.entries(principalsSpec.paths ?? {})) {
|
|
223
|
+
mergedPaths[path] = def as Record<string, unknown>;
|
|
224
|
+
}
|
|
225
|
+
|
|
210
226
|
return {
|
|
211
227
|
...adminSpec,
|
|
212
228
|
paths: mergedPaths,
|
|
@@ -217,6 +233,7 @@ export function buildPlatformAdminSpec(): AdminOpenApiDocument {
|
|
|
217
233
|
...(runtimeSpec.components?.schemas ?? {}),
|
|
218
234
|
...(gheSpec.components?.schemas ?? {}),
|
|
219
235
|
...(templatesSpec.components?.schemas ?? {}),
|
|
236
|
+
...(principalsSpec.components?.schemas ?? {}),
|
|
220
237
|
},
|
|
221
238
|
},
|
|
222
239
|
};
|