@dereekb/firebase 13.9.0 → 13.10.1
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/index.cjs.js +19 -10
- package/index.esm.js +19 -10
- package/package.json +10 -10
- package/src/lib/client/function/function.d.ts +5 -0
- package/src/lib/client/function/function.factory.d.ts +5 -0
- package/src/lib/client/function/model.function.factory.d.ts +5 -0
- package/src/lib/common/auth/auth.d.ts +14 -0
- package/src/lib/common/development/function.d.ts +5 -0
- package/src/lib/common/firestore/accessor/document.d.ts +8 -0
- package/src/lib/common/firestore/collection/collection.d.ts +15 -0
- package/src/lib/common/firestore/driver/driver.d.ts +5 -0
- package/src/lib/common/firestore/query/constraint.d.ts +5 -0
- package/src/lib/common/storage/driver/accessor.d.ts +13 -0
- package/src/lib/common/storage/driver/driver.d.ts +5 -0
- package/src/lib/common/storage/storage.d.ts +5 -0
- package/src/lib/common/storage/types.d.ts +29 -0
- package/src/lib/model/notification/notification.api.d.ts +2 -2
- package/src/lib/model/notification/notification.d.ts +103 -0
- package/src/lib/model/notification/notification.id.d.ts +10 -0
- package/src/lib/model/notification/notification.message.d.ts +10 -0
- package/src/lib/model/notification/notification.task.subtask.d.ts +4 -0
- package/src/lib/model/oidcmodel/oidcmodel.api.d.ts +2 -2
- package/src/lib/model/oidcmodel/oidcmodel.d.ts +21 -1
- package/src/lib/model/oidcmodel/oidcmodel.id.d.ts +5 -0
- package/src/lib/model/oidcmodel/oidcmodel.interaction.d.ts +14 -0
- package/src/lib/model/storagefile/storagefile.d.ts +68 -1
- package/src/lib/model/storagefile/storagefile.id.d.ts +10 -0
- package/src/lib/model/storagefile/storagefile.upload.d.ts +5 -0
- package/src/lib/model/storagefile/storagefile.upload.determiner.d.ts +4 -0
- package/src/lib/model/system/system.d.ts +13 -0
- package/test/index.cjs.js +1 -0
- package/test/index.esm.js +1 -0
- package/test/package.json +9 -9
|
@@ -30,6 +30,8 @@ import { type NotificationItem } from './notification.item';
|
|
|
30
30
|
* Used by both client and server code to access notification documents.
|
|
31
31
|
*
|
|
32
32
|
* @see `NotificationServerActions` in `@dereekb/firebase-server/model` for server-side action processing
|
|
33
|
+
*
|
|
34
|
+
* @dbxModelGroup Notification
|
|
33
35
|
*/
|
|
34
36
|
export declare abstract class NotificationFirestoreCollections {
|
|
35
37
|
abstract readonly notificationUserCollection: NotificationUserFirestoreCollection;
|
|
@@ -54,6 +56,8 @@ export interface InitializedNotificationModel {
|
|
|
54
56
|
* True if this model needs to be sync'd/initialized with the original model.
|
|
55
57
|
*
|
|
56
58
|
* Is set false if/when "fi" is set true.
|
|
59
|
+
*
|
|
60
|
+
* @dbxModelVariable needsSync
|
|
57
61
|
*/
|
|
58
62
|
s?: Maybe<NeedsSyncBoolean>;
|
|
59
63
|
/**
|
|
@@ -62,6 +66,8 @@ export interface InitializedNotificationModel {
|
|
|
62
66
|
* This is for cases where the model cannot be properly initiialized.
|
|
63
67
|
*
|
|
64
68
|
* NOTE: The server can also be configured to automatically delete these models instead of marking them as invalid.
|
|
69
|
+
*
|
|
70
|
+
* @dbxModelVariable flaggedInvalid
|
|
65
71
|
*/
|
|
66
72
|
fi?: Maybe<SavedToFirestoreIfTrue>;
|
|
67
73
|
}
|
|
@@ -79,10 +85,14 @@ export declare const notificationUserIdentity: import("../..").RootFirestoreMode
|
|
|
79
85
|
*
|
|
80
86
|
* @see {@link NotificationBoxRecipient} for the per-box recipient entry that mirrors these configs
|
|
81
87
|
* @see `NotificationServerActions.updateNotificationUser` in `@dereekb/firebase-server/model` for server-side sync logic
|
|
88
|
+
*
|
|
89
|
+
* @dbxModel
|
|
82
90
|
*/
|
|
83
91
|
export interface NotificationUser extends UserRelated, UserRelatedById {
|
|
84
92
|
/**
|
|
85
93
|
* Notification box IDs this user is subscribed to. Managed by the server — not directly editable by clients.
|
|
94
|
+
*
|
|
95
|
+
* @dbxModelVariable boxes
|
|
86
96
|
*/
|
|
87
97
|
b: NotificationBoxId[];
|
|
88
98
|
/**
|
|
@@ -93,28 +103,38 @@ export interface NotificationUser extends UserRelated, UserRelatedById {
|
|
|
93
103
|
* Exclusions are synced to the corresponding `bc` configs, which then propagate to the NotificationBoxes.
|
|
94
104
|
*
|
|
95
105
|
* Non-matching entries (where the user isn't associated with a matching box) are automatically removed.
|
|
106
|
+
*
|
|
107
|
+
* @dbxModelVariable boxExclusions
|
|
96
108
|
*/
|
|
97
109
|
x: NotificationBoxSendExclusionList;
|
|
98
110
|
/**
|
|
99
111
|
* Global config override. Overrides all other configs (both per-box `bc` and direct/default `dc`) at send time.
|
|
100
112
|
*
|
|
101
113
|
* Unlike `dc`/`bc`, changes to `gc` are NOT copied to other config fields — they apply as a final override during notification delivery.
|
|
114
|
+
*
|
|
115
|
+
* @dbxModelVariable globalConfig
|
|
102
116
|
*/
|
|
103
117
|
gc: NotificationUserDefaultNotificationBoxRecipientConfig;
|
|
104
118
|
/**
|
|
105
119
|
* Direct/default config. Used when a recipient is added ad-hoc (by uid) to a notification that isn't associated with any of their subscribed boxes.
|
|
106
120
|
*
|
|
107
121
|
* Acts as the fallback config when no per-box config (`bc`) matches.
|
|
122
|
+
*
|
|
123
|
+
* @dbxModelVariable defaultConfig
|
|
108
124
|
*/
|
|
109
125
|
dc: NotificationUserDefaultNotificationBoxRecipientConfig;
|
|
110
126
|
/**
|
|
111
127
|
* Per-box recipient configurations. Each entry corresponds to one of the user's subscribed notification boxes.
|
|
112
128
|
*
|
|
113
129
|
* These configs are synced bidirectionally with the {@link NotificationBoxRecipient} entries on the corresponding {@link NotificationBox}.
|
|
130
|
+
*
|
|
131
|
+
* @dbxModelVariable boxConfigs
|
|
114
132
|
*/
|
|
115
133
|
bc: NotificationUserNotificationBoxRecipientConfig[];
|
|
116
134
|
/**
|
|
117
135
|
* Whether one or more configs need to be synced to their corresponding NotificationBox recipients.
|
|
136
|
+
*
|
|
137
|
+
* @dbxModelVariable needsConfigSync
|
|
118
138
|
*/
|
|
119
139
|
ns?: Maybe<NeedsSyncBoolean>;
|
|
120
140
|
}
|
|
@@ -168,34 +188,50 @@ export declare const NOTIFICATION_SUMMARY_EMBEDDED_NOTIFICATION_ITEM_MESSAGE_MAX
|
|
|
168
188
|
* Items are capped at {@link NOTIFICATION_SUMMARY_ITEM_LIMIT} entries.
|
|
169
189
|
*
|
|
170
190
|
* Implements {@link InitializedNotificationModel} — requires server-side initialization to populate the owner (`o`) field.
|
|
191
|
+
*
|
|
192
|
+
* @dbxModel
|
|
171
193
|
*/
|
|
172
194
|
export interface NotificationSummary extends InitializedNotificationModel {
|
|
173
195
|
/**
|
|
174
196
|
* Creation date of this summary document.
|
|
197
|
+
*
|
|
198
|
+
* @dbxModelVariable createdAt
|
|
175
199
|
*/
|
|
176
200
|
cat: Date;
|
|
177
201
|
/**
|
|
178
202
|
* Model key of the model this summary represents (e.g., `'project/abc123'`).
|
|
203
|
+
*
|
|
204
|
+
* @dbxModelVariable modelKey
|
|
179
205
|
*/
|
|
180
206
|
m: FirestoreModelKey;
|
|
181
207
|
/**
|
|
182
208
|
* Owner model key. Set to a dummy value on creation and populated during server-side initialization.
|
|
209
|
+
*
|
|
210
|
+
* @dbxModelVariable ownerKey
|
|
183
211
|
*/
|
|
184
212
|
o: FirestoreModelKey;
|
|
185
213
|
/**
|
|
186
214
|
* Embedded notification items, sorted ascending by date (newest at end).
|
|
215
|
+
*
|
|
216
|
+
* @dbxModelVariable notifications
|
|
187
217
|
*/
|
|
188
218
|
n: NotificationItem[];
|
|
189
219
|
/**
|
|
190
220
|
* Timestamp of the most recently added notification item.
|
|
221
|
+
*
|
|
222
|
+
* @dbxModelVariable lastNotificationAt
|
|
191
223
|
*/
|
|
192
224
|
lat?: Maybe<Date>;
|
|
193
225
|
/**
|
|
194
226
|
* Timestamp of when the user last read this summary. Items with dates after this are considered unread.
|
|
227
|
+
*
|
|
228
|
+
* @dbxModelVariable lastReadAt
|
|
195
229
|
*/
|
|
196
230
|
rat?: Maybe<Date>;
|
|
197
231
|
/**
|
|
198
232
|
* Whether this summary needs server-side sync/initialization with its source model.
|
|
233
|
+
*
|
|
234
|
+
* @dbxModelVariable needsSync
|
|
199
235
|
*/
|
|
200
236
|
s?: Maybe<NeedsSyncBoolean>;
|
|
201
237
|
}
|
|
@@ -246,39 +282,55 @@ export declare const notificationBoxIdentity: import("../..").RootFirestoreModel
|
|
|
246
282
|
*
|
|
247
283
|
* @see {@link NotificationBoxRecipient} for per-recipient configuration embedded in this document
|
|
248
284
|
* @see `NotificationServerActions.createNotificationBox` in `@dereekb/firebase-server/model` for creation logic
|
|
285
|
+
*
|
|
286
|
+
* @dbxModel
|
|
249
287
|
*/
|
|
250
288
|
export interface NotificationBox extends InitializedNotificationModel {
|
|
251
289
|
/**
|
|
252
290
|
* Creation date of this NotificationBox document.
|
|
291
|
+
*
|
|
292
|
+
* @dbxModelVariable createdAt
|
|
253
293
|
*/
|
|
254
294
|
cat: Date;
|
|
255
295
|
/**
|
|
256
296
|
* Model key of the model this box is assigned to (e.g., `'project/abc123'`).
|
|
297
|
+
*
|
|
298
|
+
* @dbxModelVariable modelKey
|
|
257
299
|
*/
|
|
258
300
|
m: FirestoreModelKey;
|
|
259
301
|
/**
|
|
260
302
|
* Owner model key. Set to a dummy value on creation and populated during server-side initialization.
|
|
303
|
+
*
|
|
304
|
+
* @dbxModelVariable ownerKey
|
|
261
305
|
*/
|
|
262
306
|
o: FirestoreModelKey;
|
|
263
307
|
/**
|
|
264
308
|
* Embedded recipient entries. Each entry represents a user who can receive notifications from this box.
|
|
265
309
|
*
|
|
266
310
|
* Synced from the corresponding {@link NotificationUser} `bc` configs.
|
|
311
|
+
*
|
|
312
|
+
* @dbxModelVariable recipients
|
|
267
313
|
*/
|
|
268
314
|
r: NotificationBoxRecipient[];
|
|
269
315
|
/**
|
|
270
316
|
* Year-week code of the latest {@link NotificationWeek} subcollection document.
|
|
317
|
+
*
|
|
318
|
+
* @dbxModelVariable latestWeek
|
|
271
319
|
*/
|
|
272
320
|
w: YearWeekCode;
|
|
273
321
|
/**
|
|
274
322
|
* Whether this box needs server-side sync/initialization with its source model.
|
|
275
323
|
* Cleared when `fi` is set true (flagged invalid).
|
|
324
|
+
*
|
|
325
|
+
* @dbxModelVariable needsSync
|
|
276
326
|
*/
|
|
277
327
|
s?: Maybe<NeedsSyncBoolean>;
|
|
278
328
|
/**
|
|
279
329
|
* Flagged invalid — set when the box cannot be properly initialized (e.g., source model deleted).
|
|
280
330
|
*
|
|
281
331
|
* The server can be configured to either flag or auto-delete invalid boxes.
|
|
332
|
+
*
|
|
333
|
+
* @dbxModelVariable flaggedInvalid
|
|
282
334
|
*/
|
|
283
335
|
fi?: Maybe<SavedToFirestoreIfTrue>;
|
|
284
336
|
}
|
|
@@ -426,27 +478,42 @@ export declare enum NotificationRecipientSendFlag {
|
|
|
426
478
|
export interface NotificationSendFlags {
|
|
427
479
|
/**
|
|
428
480
|
* Text/SMS send state.
|
|
481
|
+
*
|
|
482
|
+
* @dbxModelVariable textSendState
|
|
429
483
|
*/
|
|
430
484
|
ts: NotificationSendState;
|
|
431
485
|
/**
|
|
432
486
|
* Email send state.
|
|
487
|
+
*
|
|
488
|
+
* @dbxModelVariable emailSendState
|
|
433
489
|
*/
|
|
434
490
|
es: NotificationSendState;
|
|
435
491
|
/**
|
|
436
492
|
* Push notification send state.
|
|
493
|
+
*
|
|
494
|
+
* @dbxModelVariable pushSendState
|
|
437
495
|
*/
|
|
438
496
|
ps: NotificationSendState;
|
|
439
497
|
/**
|
|
440
498
|
* In-app notification summary send state (delivery to {@link NotificationSummary}).
|
|
499
|
+
*
|
|
500
|
+
* @dbxModelVariable summarySendState
|
|
441
501
|
*/
|
|
442
502
|
ns: NotificationSendState;
|
|
443
503
|
/**
|
|
444
504
|
* Recipient send flag controlling who receives this notification and whether it should be archived to {@link NotificationWeek} after delivery.
|
|
505
|
+
*
|
|
506
|
+
* @dbxModelVariable recipientSendFlag
|
|
445
507
|
*/
|
|
446
508
|
rf?: Maybe<NotificationRecipientSendFlag>;
|
|
447
509
|
}
|
|
448
510
|
/**
|
|
449
511
|
* Arbitrary unique string that denotes checkpoint progress for a multi-step task.
|
|
512
|
+
*
|
|
513
|
+
* @semanticType
|
|
514
|
+
* @semanticTopic identifier
|
|
515
|
+
* @semanticTopic string
|
|
516
|
+
* @semanticTopic dereekb-firebase:notification
|
|
450
517
|
*/
|
|
451
518
|
export type NotificationTaskCheckpointString = string;
|
|
452
519
|
/**
|
|
@@ -458,16 +525,22 @@ export type NotificationTaskCheckpointString = string;
|
|
|
458
525
|
export interface NotificationSendCheckpoints {
|
|
459
526
|
/**
|
|
460
527
|
* Phone numbers that have already received the text/SMS for this notification.
|
|
528
|
+
*
|
|
529
|
+
* @dbxModelVariable textRecipients
|
|
461
530
|
*/
|
|
462
531
|
tsr: E164PhoneNumber[];
|
|
463
532
|
/**
|
|
464
533
|
* Email addresses that have already received the email for this notification.
|
|
534
|
+
*
|
|
535
|
+
* @dbxModelVariable emailRecipients
|
|
465
536
|
*/
|
|
466
537
|
esr: EmailAddress[];
|
|
467
538
|
/**
|
|
468
539
|
* Completed checkpoint strings for multi-step task notifications.
|
|
469
540
|
*
|
|
470
541
|
* @see {@link NotificationTaskCheckpointString}
|
|
542
|
+
*
|
|
543
|
+
* @dbxModelVariable taskCheckpoints
|
|
471
544
|
*/
|
|
472
545
|
tpr: NotificationTaskCheckpointString[];
|
|
473
546
|
}
|
|
@@ -484,18 +557,26 @@ export interface NotificationSendCheckpoints {
|
|
|
484
557
|
* @see {@link NotificationSendFlags} for per-channel delivery state
|
|
485
558
|
* @see {@link NotificationSendCheckpoints} for idempotent retry tracking
|
|
486
559
|
* @see `NotificationServerActions.sendQueuedNotifications` in `@dereekb/firebase-server/model` for the send pipeline
|
|
560
|
+
*
|
|
561
|
+
* @dbxModel
|
|
487
562
|
*/
|
|
488
563
|
export interface Notification extends NotificationSendFlags, NotificationSendCheckpoints {
|
|
489
564
|
/**
|
|
490
565
|
* Creation timestamp.
|
|
566
|
+
*
|
|
567
|
+
* @dbxModelVariable createdAt
|
|
491
568
|
*/
|
|
492
569
|
cat: Date;
|
|
493
570
|
/**
|
|
494
571
|
* Send type controlling how this notification interacts with its parent NotificationBox.
|
|
572
|
+
*
|
|
573
|
+
* @dbxModelVariable sendType
|
|
495
574
|
*/
|
|
496
575
|
st: NotificationSendType;
|
|
497
576
|
/**
|
|
498
577
|
* Embedded notification content (subject, message, template type, metadata).
|
|
578
|
+
*
|
|
579
|
+
* @dbxModelVariable notificationItem
|
|
499
580
|
*/
|
|
500
581
|
n: NotificationItem;
|
|
501
582
|
/**
|
|
@@ -504,12 +585,16 @@ export interface Notification extends NotificationSendFlags, NotificationSendChe
|
|
|
504
585
|
* Any `NotificationBoxRecipientTemplateConfig` values on these recipients affect opt-in/opt-out resolution.
|
|
505
586
|
* For example, setting `st: true` opts a user into text/SMS for this notification's template type,
|
|
506
587
|
* unless overridden by the user's own {@link NotificationUser} config.
|
|
588
|
+
*
|
|
589
|
+
* @dbxModelVariable recipients
|
|
507
590
|
*/
|
|
508
591
|
r: NotificationRecipientWithConfig[];
|
|
509
592
|
/**
|
|
510
593
|
* Explicit opt-in send only. When true, only sends to users who have explicitly opted in for each channel.
|
|
511
594
|
*
|
|
512
595
|
* Overrides the system-level default for this notification's template type.
|
|
596
|
+
*
|
|
597
|
+
* @dbxModelVariable optInSendOnly
|
|
513
598
|
*/
|
|
514
599
|
ois?: Maybe<SavedToFirestoreIfTrue>;
|
|
515
600
|
/**
|
|
@@ -517,6 +602,8 @@ export interface Notification extends NotificationSendFlags, NotificationSendChe
|
|
|
517
602
|
* (still respects explicit opt-outs).
|
|
518
603
|
*
|
|
519
604
|
* Overrides the system-level default for this notification's template type.
|
|
605
|
+
*
|
|
606
|
+
* @dbxModelVariable optInTextSend
|
|
520
607
|
*/
|
|
521
608
|
ots?: Maybe<SavedToFirestoreIfFalse>;
|
|
522
609
|
/**
|
|
@@ -524,22 +611,30 @@ export interface Notification extends NotificationSendFlags, NotificationSendChe
|
|
|
524
611
|
*
|
|
525
612
|
* Also serves as a lock mechanism: during active sending, `sat` is pushed forward by a few minutes
|
|
526
613
|
* and the attempt counter is incremented, preventing concurrent send attempts.
|
|
614
|
+
*
|
|
615
|
+
* @dbxModelVariable sendAt
|
|
527
616
|
*/
|
|
528
617
|
sat: Date;
|
|
529
618
|
/**
|
|
530
619
|
* Total error attempt count. Incremented only when sending encounters an error (not on success).
|
|
620
|
+
*
|
|
621
|
+
* @dbxModelVariable attempts
|
|
531
622
|
*/
|
|
532
623
|
a: number;
|
|
533
624
|
/**
|
|
534
625
|
* Current task attempt count for the active checkpoint. Incremented on delay or failure responses.
|
|
535
626
|
*
|
|
536
627
|
* Reset to 0 when a checkpoint completes successfully or when a new checkpoint begins.
|
|
628
|
+
*
|
|
629
|
+
* @dbxModelVariable taskAttempts
|
|
537
630
|
*/
|
|
538
631
|
at?: Maybe<number>;
|
|
539
632
|
/**
|
|
540
633
|
* Delivery complete flag. When true, content has been delivered and is ready to archive to {@link NotificationWeek}.
|
|
541
634
|
*
|
|
542
635
|
* For task-type notifications this is always false — tasks are deleted upon completion instead of archived.
|
|
636
|
+
*
|
|
637
|
+
* @dbxModelVariable done
|
|
543
638
|
*/
|
|
544
639
|
d: boolean;
|
|
545
640
|
/**
|
|
@@ -548,6 +643,8 @@ export interface Notification extends NotificationSendFlags, NotificationSendChe
|
|
|
548
643
|
* When true, the server re-reads the document and compares `cat` before committing a task step.
|
|
549
644
|
* If `cat` has changed (indicating the task was replaced), the step is abandoned silently.
|
|
550
645
|
* This prevents stale task executions when a unique task ID is reused.
|
|
646
|
+
*
|
|
647
|
+
* @dbxModelVariable uniqueTask
|
|
551
648
|
*/
|
|
552
649
|
ut?: Maybe<SavedToFirestoreIfTrue>;
|
|
553
650
|
}
|
|
@@ -615,14 +712,20 @@ export declare const NOTIFICATION_WEEK_NOTIFICATION_ITEM_LIMIT = 5000;
|
|
|
615
712
|
* a {@link Notification} completes delivery and is cleaned up. Capped at {@link NOTIFICATION_WEEK_NOTIFICATION_ITEM_LIMIT} items.
|
|
616
713
|
*
|
|
617
714
|
* Used for historical browsing of past notifications per box.
|
|
715
|
+
*
|
|
716
|
+
* @dbxModel
|
|
618
717
|
*/
|
|
619
718
|
export interface NotificationWeek {
|
|
620
719
|
/**
|
|
621
720
|
* Year-week code identifying this week. Matches the document ID.
|
|
721
|
+
*
|
|
722
|
+
* @dbxModelVariable yearWeek
|
|
622
723
|
*/
|
|
623
724
|
w: YearWeekCode;
|
|
624
725
|
/**
|
|
625
726
|
* Archived notification items delivered during this week.
|
|
727
|
+
*
|
|
728
|
+
* @dbxModelVariable notifications
|
|
626
729
|
*/
|
|
627
730
|
n: NotificationItem[];
|
|
628
731
|
}
|
|
@@ -150,12 +150,22 @@ export declare const DEFAULT_NOTIFICATION_TASK_NOTIFICATION_MODEL_KEY: Firestore
|
|
|
150
150
|
* Types are generally intended to be handled case-insensitively by notification services.
|
|
151
151
|
*
|
|
152
152
|
* Ideally type values are shorter to reduce database size impact.
|
|
153
|
+
*
|
|
154
|
+
* @semanticType
|
|
155
|
+
* @semanticTopic identifier
|
|
156
|
+
* @semanticTopic string
|
|
157
|
+
* @semanticTopic dereekb-firebase:notification
|
|
153
158
|
*/
|
|
154
159
|
export type NotificationTemplateType = string;
|
|
155
160
|
/**
|
|
156
161
|
* Task type identifier of the notification, which is used to pass this task to the appropriate handler.
|
|
157
162
|
*
|
|
158
163
|
* Ideally type values are shorter to reduce database size impact.
|
|
164
|
+
*
|
|
165
|
+
* @semanticType
|
|
166
|
+
* @semanticTopic identifier
|
|
167
|
+
* @semanticTopic string
|
|
168
|
+
* @semanticTopic dereekb-firebase:notification
|
|
159
169
|
*/
|
|
160
170
|
export type NotificationTaskType = string;
|
|
161
171
|
/**
|
|
@@ -27,10 +27,20 @@ export interface NotificationMessageInputContext {
|
|
|
27
27
|
* Arbitrary key used by the sending configuration service for choosing a pre-configured entity.
|
|
28
28
|
*
|
|
29
29
|
* Typically used for customizing the "from" or "replyTo" addresses while maintaining a separation of concerns.
|
|
30
|
+
*
|
|
31
|
+
* @semanticType
|
|
32
|
+
* @semanticTopic identifier
|
|
33
|
+
* @semanticTopic string
|
|
34
|
+
* @semanticTopic dereekb-firebase:notification
|
|
30
35
|
*/
|
|
31
36
|
export type NotificationMessageEntityKey = string;
|
|
32
37
|
/**
|
|
33
38
|
* Arbitrary template name/key that is used to configure which template to use by the sending service.
|
|
39
|
+
*
|
|
40
|
+
* @semanticType
|
|
41
|
+
* @semanticTopic identifier
|
|
42
|
+
* @semanticTopic string
|
|
43
|
+
* @semanticTopic dereekb-firebase:notification
|
|
34
44
|
*/
|
|
35
45
|
export type NotificationSendMessageTemplateName = string;
|
|
36
46
|
/**
|
|
@@ -15,6 +15,10 @@ import { type NotificationItemMetadata } from './notification.item';
|
|
|
15
15
|
import { type NotificationTaskServiceHandleNotificationTaskResult } from './notification.task';
|
|
16
16
|
/**
|
|
17
17
|
* Discriminator string that routes the subtask to the correct processing configuration.
|
|
18
|
+
*
|
|
19
|
+
* @semanticType
|
|
20
|
+
* @semanticTopic string
|
|
21
|
+
* @semanticTopic dereekb-firebase:notification
|
|
18
22
|
*/
|
|
19
23
|
export type NotificationTaskSubtaskTarget = string;
|
|
20
24
|
/**
|
|
@@ -69,13 +69,13 @@ export interface UpdateOidcClientParams extends UpdateOidcClientFieldParams, Tar
|
|
|
69
69
|
}
|
|
70
70
|
export declare const updateOidcClientParamsType: Type<UpdateOidcClientParams>;
|
|
71
71
|
export type RotateOidcClientSecretParams = TargetModelParams;
|
|
72
|
-
export declare const rotateOidcClientSecretParamsType:
|
|
72
|
+
export declare const rotateOidcClientSecretParamsType: import("arktype/internal/variants/object.ts").ObjectType<TargetModelParams, {}>;
|
|
73
73
|
export type RotateOidcClientSecretResult = Pick<CreateOidcClientResult, 'client_id' | 'client_secret'>;
|
|
74
74
|
/**
|
|
75
75
|
* Parameters for revoking/deleting an OAuth client.
|
|
76
76
|
*/
|
|
77
77
|
export type DeleteOidcClientParams = TargetModelParams;
|
|
78
|
-
export declare const deleteOidcClientParamsType:
|
|
78
|
+
export declare const deleteOidcClientParamsType: import("arktype/internal/variants/object.ts").ObjectType<TargetModelParams, {}>;
|
|
79
79
|
/**
|
|
80
80
|
* Custom (non-CRUD) function type map for OIDC.
|
|
81
81
|
*/
|
|
@@ -12,6 +12,8 @@ export type OidcModelTypes = typeof oidcEntryIdentity;
|
|
|
12
12
|
* Used by both client and server code to access oidc model documents.
|
|
13
13
|
*
|
|
14
14
|
* @see `OidcModelServerActions` in `@dereekb/firebase-server/oidc` for server-side action processing
|
|
15
|
+
*
|
|
16
|
+
* @dbxModelGroup OidcModel
|
|
15
17
|
*/
|
|
16
18
|
export declare abstract class OidcModelFirestoreCollections {
|
|
17
19
|
abstract readonly oidcEntryCollection: OidcEntryFirestoreCollection;
|
|
@@ -27,7 +29,7 @@ export declare const oidcEntryIdentity: import("../..").RootFirestoreModelIdenti
|
|
|
27
29
|
*
|
|
28
30
|
* Used as the discriminator in the {@link OidcEntry.type} field.
|
|
29
31
|
*/
|
|
30
|
-
export type OidcEntryType = 'Session' | 'AccessToken' | 'AuthorizationCode' | 'RefreshToken' | 'DeviceCode' | 'ClientCredentials' | 'Client' | 'InitialAccessToken' | 'RegistrationAccessToken' | 'Interaction' | 'ReplayDetection' | 'PushedAuthorizationRequest' | 'Grant' | 'BackchannelAuthenticationRequest' | string;
|
|
32
|
+
export type OidcEntryType = 'Session' | 'AccessToken' | 'AuthorizationCode' | 'RefreshToken' | 'DeviceCode' | 'ClientCredentials' | 'Client' | 'InitialAccessToken' | 'RegistrationAccessToken' | 'Interaction' | 'ReplayDetection' | 'PushedAuthorizationRequest' | 'Grant' | 'BackchannelAuthenticationRequest' | (string & {});
|
|
31
33
|
/**
|
|
32
34
|
* Type value for Client adapter entries.
|
|
33
35
|
*/
|
|
@@ -42,10 +44,14 @@ export declare const OIDC_ENTRY_CLIENT_TYPE: OidcEntryType;
|
|
|
42
44
|
*
|
|
43
45
|
* The {@link o} ownership field enables Firestore security rules to restrict reads to the owning user
|
|
44
46
|
* (used primarily for Client entries so users can query their own registered OAuth clients).
|
|
47
|
+
*
|
|
48
|
+
* @dbxModel
|
|
45
49
|
*/
|
|
46
50
|
export interface OidcEntry {
|
|
47
51
|
/**
|
|
48
52
|
* The oidc-provider model type (e.g., 'Session', 'AccessToken', 'Client').
|
|
53
|
+
*
|
|
54
|
+
* @dbxModelVariable type
|
|
49
55
|
*/
|
|
50
56
|
type: OidcEntryType;
|
|
51
57
|
/**
|
|
@@ -53,6 +59,8 @@ export interface OidcEntry {
|
|
|
53
59
|
*
|
|
54
60
|
* The payload structure varies by model type. Sensitive fields may be
|
|
55
61
|
* selectively encrypted (prefixed with `$`) when encryption is configured.
|
|
62
|
+
*
|
|
63
|
+
* @dbxModelVariable payload
|
|
56
64
|
*/
|
|
57
65
|
payload: JsonSerializableObject;
|
|
58
66
|
/**
|
|
@@ -60,26 +68,38 @@ export interface OidcEntry {
|
|
|
60
68
|
*
|
|
61
69
|
* Set to the Firebase Auth UID of the user who created this entry.
|
|
62
70
|
* Used primarily on Client entries to allow users to query their own OAuth clients.
|
|
71
|
+
*
|
|
72
|
+
* @dbxModelVariable ownerKey
|
|
63
73
|
*/
|
|
64
74
|
o?: Maybe<FirebaseAuthOwnershipKey>;
|
|
65
75
|
/**
|
|
66
76
|
* User identifier. Extracted from the payload for indexed queries.
|
|
77
|
+
*
|
|
78
|
+
* @dbxModelVariable uid
|
|
67
79
|
*/
|
|
68
80
|
uid?: Maybe<FirebaseAuthUserId>;
|
|
69
81
|
/**
|
|
70
82
|
* Grant identifier for revocation support. Extracted from the payload for indexed queries.
|
|
83
|
+
*
|
|
84
|
+
* @dbxModelVariable grantId
|
|
71
85
|
*/
|
|
72
86
|
grantId?: Maybe<string>;
|
|
73
87
|
/**
|
|
74
88
|
* User code for device flow. Extracted from the payload for indexed queries.
|
|
89
|
+
*
|
|
90
|
+
* @dbxModelVariable userCode
|
|
75
91
|
*/
|
|
76
92
|
userCode?: Maybe<string>;
|
|
77
93
|
/**
|
|
78
94
|
* Epoch timestamp when this entry was consumed. Extracted from the payload for indexed queries.
|
|
95
|
+
*
|
|
96
|
+
* @dbxModelVariable consumedAt
|
|
79
97
|
*/
|
|
80
98
|
consumed?: Maybe<number>;
|
|
81
99
|
/**
|
|
82
100
|
* When this entry expires.
|
|
101
|
+
*
|
|
102
|
+
* @dbxModelVariable expiresAt
|
|
83
103
|
*/
|
|
84
104
|
expiresAt?: Maybe<Date>;
|
|
85
105
|
}
|
|
@@ -14,5 +14,10 @@ export type OidcEntryId = FirestoreModelId;
|
|
|
14
14
|
export type OidcEntryKey = FirestoreModelKey;
|
|
15
15
|
/**
|
|
16
16
|
* Unique client identifier for an OIDC client registration.
|
|
17
|
+
*
|
|
18
|
+
* @semanticType
|
|
19
|
+
* @semanticTopic identifier
|
|
20
|
+
* @semanticTopic string
|
|
21
|
+
* @semanticTopic dereekb-firebase:oidc
|
|
17
22
|
*/
|
|
18
23
|
export type OidcEntryClientId = string;
|
|
@@ -5,6 +5,11 @@ import { type LabeledValue, type LabeledValueWithDescription } from '@dereekb/ut
|
|
|
5
5
|
* Generated by the provider when user interaction is needed (login/consent).
|
|
6
6
|
* Used to look up the interaction session via cookies and to build
|
|
7
7
|
* backend interaction endpoint URLs (e.g., `/interaction/${uid}/login`).
|
|
8
|
+
*
|
|
9
|
+
* @semanticType
|
|
10
|
+
* @semanticTopic identifier
|
|
11
|
+
* @semanticTopic string
|
|
12
|
+
* @semanticTopic dereekb-firebase:oidc
|
|
8
13
|
*/
|
|
9
14
|
export type OidcInteractionUid = string;
|
|
10
15
|
/**
|
|
@@ -17,6 +22,10 @@ export type OidcInteractionUid = string;
|
|
|
17
22
|
* ```typescript
|
|
18
23
|
* type MyScopes = 'openid' | 'profile' | 'email';
|
|
19
24
|
* ```
|
|
25
|
+
*
|
|
26
|
+
* @semanticType
|
|
27
|
+
* @semanticTopic string
|
|
28
|
+
* @semanticTopic dereekb-firebase:oidc
|
|
20
29
|
*/
|
|
21
30
|
export type OidcScope = string;
|
|
22
31
|
/**
|
|
@@ -27,6 +36,11 @@ export type OidcScopeDetails<T extends OidcScope = OidcScope> = LabeledValueWith
|
|
|
27
36
|
* A redirect URI registered to an OIDC client.
|
|
28
37
|
*
|
|
29
38
|
* Must be a valid absolute URL (e.g. `https://myapp.example.com/callback`).
|
|
39
|
+
*
|
|
40
|
+
* @semanticType
|
|
41
|
+
* @semanticTopic url
|
|
42
|
+
* @semanticTopic string
|
|
43
|
+
* @semanticTopic dereekb-firebase:oidc
|
|
30
44
|
*/
|
|
31
45
|
export type OidcRedirectUri = string;
|
|
32
46
|
/**
|