@ttt-productions/notification-core 0.12.0 → 0.13.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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/react/components/NotificationList.d.ts +1 -1
- package/dist/react/components/NotificationList.d.ts.map +1 -1
- package/dist/react/components/NotificationList.js +11 -7
- package/dist/react/components/NotificationList.js.map +1 -1
- package/dist/react/hooks/useArchiveAllNotifications.d.ts +19 -8
- package/dist/react/hooks/useArchiveAllNotifications.d.ts.map +1 -1
- package/dist/react/hooks/useArchiveAllNotifications.js +54 -31
- package/dist/react/hooks/useArchiveAllNotifications.js.map +1 -1
- package/dist/types.d.ts +70 -27
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { NotificationDoc, PendingNotification, NotificationCategoryConfig, NotificationTypeConfig, NotificationSystemConfig, UseActiveNotificationsOptions, UseUnreadCountOptions, UseArchiveNotificationOptions, UseArchiveAllNotificationsOptions,
|
|
1
|
+
export type { NotificationDoc, PendingNotification, NotificationCategoryConfig, NotificationTypeConfig, NotificationSystemConfig, UseActiveNotificationsOptions, UseUnreadCountOptions, UseArchiveNotificationOptions, UseArchiveAllNotificationsOptions, ArchiveAllJobStatus, EnqueueArchiveAllResult, ArchiveAllJobSnapshot, ArchiveAllPollResult, NotificationListProps, NotificationEmptyStateProps, NotificationUnreadBadgeProps, } from './types.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACxB,6BAA6B,EAC7B,qBAAqB,EACrB,6BAA6B,EAC7B,iCAAiC,EACjC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,EACxB,6BAA6B,EAC7B,qBAAqB,EACrB,6BAA6B,EAC7B,iCAAiC,EACjC,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,YAAY,CAAC"}
|
|
@@ -2,5 +2,5 @@ import type { NotificationListProps } from '../../types.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Scrollable list of active notifications with click-to-archive and clear-all.
|
|
4
4
|
*/
|
|
5
|
-
export declare function NotificationList({ config, userId, category, onNotificationClick, archiveFn,
|
|
5
|
+
export declare function NotificationList({ config, userId, category, onNotificationClick, archiveFn, enqueueArchiveAllFn, getArchiveAllStatusFn, onClearAll, refetchInterval, emptyText, }: NotificationListProps): import("react").JSX.Element;
|
|
6
6
|
//# sourceMappingURL=NotificationList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationList.d.ts","sourceRoot":"","sources":["../../../src/react/components/NotificationList.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAmB,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE7E;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,MAAM,EACN,QAAQ,EACR,mBAAmB,EACnB,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"NotificationList.d.ts","sourceRoot":"","sources":["../../../src/react/components/NotificationList.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAmB,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE7E;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,MAAM,EACN,QAAQ,EACR,mBAAmB,EACnB,SAAS,EACT,mBAAmB,EACnB,qBAAqB,EACrB,UAAU,EACV,eAAe,EACf,SAAS,GACV,EAAE,qBAAqB,+BA+IvB"}
|
|
@@ -10,7 +10,7 @@ import { formatRelativeTime } from './relative-time.js';
|
|
|
10
10
|
/**
|
|
11
11
|
* Scrollable list of active notifications with click-to-archive and clear-all.
|
|
12
12
|
*/
|
|
13
|
-
export function NotificationList({ config, userId, category, onNotificationClick, archiveFn,
|
|
13
|
+
export function NotificationList({ config, userId, category, onNotificationClick, archiveFn, enqueueArchiveAllFn, getArchiveAllStatusFn, onClearAll, refetchInterval, emptyText, }) {
|
|
14
14
|
const { data: notifications, isLoading, hasNextPage, nextPage, } = useActiveNotifications({
|
|
15
15
|
config,
|
|
16
16
|
userId,
|
|
@@ -25,7 +25,8 @@ export function NotificationList({ config, userId, category, onNotificationClick
|
|
|
25
25
|
const archiveAllMutation = useArchiveAllNotifications({
|
|
26
26
|
userId,
|
|
27
27
|
category,
|
|
28
|
-
|
|
28
|
+
enqueueArchiveAllFn,
|
|
29
|
+
getArchiveAllStatusFn,
|
|
29
30
|
});
|
|
30
31
|
const handleNotificationClick = useCallback(async (notification) => {
|
|
31
32
|
try {
|
|
@@ -36,9 +37,11 @@ export function NotificationList({ config, userId, category, onNotificationClick
|
|
|
36
37
|
}
|
|
37
38
|
onNotificationClick(notification);
|
|
38
39
|
}, [archiveMutation, onNotificationClick]);
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
//
|
|
40
|
+
// Surface a failed/incomplete clear instead of swallowing it. `onClearAll` (and the tray-closing
|
|
41
|
+
// side effects the app wires to it) fires ONLY when the server job fully drained the category —
|
|
42
|
+
// otherwise the user keeps the "notifications remain — try again" affordance. The poller resolves
|
|
43
|
+
// with an explicit terminal result (`complete` | `incomplete` | `failed`) and only rejects on a
|
|
44
|
+
// hard enqueue/poll throw.
|
|
42
45
|
const [clearIncomplete, setClearIncomplete] = useState(false);
|
|
43
46
|
const handleClearAll = useCallback(async () => {
|
|
44
47
|
setClearIncomplete(false);
|
|
@@ -47,12 +50,13 @@ export function NotificationList({ config, userId, category, onNotificationClick
|
|
|
47
50
|
result = await archiveAllMutation.mutateAsync();
|
|
48
51
|
}
|
|
49
52
|
catch {
|
|
50
|
-
// Hard failure: do not fire onClearAll; surface the retry affordance.
|
|
53
|
+
// Hard failure (enqueue/poll threw): do not fire onClearAll; surface the retry affordance.
|
|
51
54
|
setClearIncomplete(true);
|
|
52
55
|
return;
|
|
53
56
|
}
|
|
54
57
|
if (!result.complete) {
|
|
55
|
-
//
|
|
58
|
+
// Job terminated without fully draining the category (incomplete/failed) — keep the
|
|
59
|
+
// notifications and prompt a retry.
|
|
56
60
|
setClearIncomplete(true);
|
|
57
61
|
return;
|
|
58
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationList.js","sourceRoot":"","sources":["../../../src/react/components/NotificationList.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGxD;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAC/B,MAAM,EACN,MAAM,EACN,QAAQ,EACR,mBAAmB,EACnB,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"NotificationList.js","sourceRoot":"","sources":["../../../src/react/components/NotificationList.tsx"],"names":[],"mappings":"AAAA,YAAY,CAA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Y,CAAC,SAAS,CAAC,GACvC,IACF,EACL,YAAY,CAAC,KAAK,GAAG,CAAC,IAAI,CACzB,cAAK,SAAS,EAAC,gBAAgB,YAC7B,MAAC,KAAK,IAAC,OAAO,EAAC,WAAW,uBAAG,YAAY,CAAC,KAAK,IAAS,GACpD,CACP,KA1BI,YAAY,CAAC,EAAE,CA2BhB,CACP,CAAC,EACD,WAAW,IAAI,CACd,cAAK,SAAS,EAAC,iBAAiB,YAC9B,KAAC,MAAM,IAAC,OAAO,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,QAAQ,0BAE1C,GACL,CACP,IACA,CACJ,GACK,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,22 +1,33 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ArchiveAllPollResult, UseArchiveAllNotificationsOptions } from '../../types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Trigger + poll a SERVER-OWNED archive-all job for one notification category.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* This is a THIN STATUS POLLER, not a client loop. It:
|
|
6
|
+
* 1. enqueues ONE server job via `enqueueArchiveAllFn(category)` (the category — the tab the tray
|
|
7
|
+
* was invoked on — flows into the job, preserving per-tab scoping: the worker archives ONLY
|
|
8
|
+
* that category's active cards, never all tabs);
|
|
9
|
+
* 2. polls `getArchiveAllStatusFn(jobId)` until the job reaches a terminal state
|
|
10
|
+
* (`complete` | `incomplete` | `failed`);
|
|
11
|
+
* 3. resolves an {@link ArchiveAllPollResult} the caller gates side effects on, and invalidates
|
|
12
|
+
* the read keys on a completed drain.
|
|
13
|
+
*
|
|
14
|
+
* All paging + ownership-checked per-card deletion happen server-side. The hook performs no client
|
|
15
|
+
* Firestore writes and never chains archive calls. The generic package hardcodes no callable name —
|
|
16
|
+
* the app injects both adapters.
|
|
8
17
|
*
|
|
9
18
|
* @example
|
|
10
19
|
* ```tsx
|
|
11
|
-
* const
|
|
20
|
+
* const enqueue = httpsCallable(functions, 'enqueueArchiveAll');
|
|
21
|
+
* const getStatus = httpsCallable(functions, 'getArchiveAllStatus');
|
|
12
22
|
* const archiveAll = useArchiveAllNotifications({
|
|
13
23
|
* userId: user.uid,
|
|
14
24
|
* category: 'user',
|
|
15
|
-
*
|
|
25
|
+
* enqueueArchiveAllFn: (category) => enqueue({ category }).then((r) => r.data),
|
|
26
|
+
* getArchiveAllStatusFn: (jobId) => getStatus({ jobId }).then((r) => r.data),
|
|
16
27
|
* });
|
|
17
28
|
*
|
|
18
29
|
* archiveAll.mutate();
|
|
19
30
|
* ```
|
|
20
31
|
*/
|
|
21
|
-
export declare function useArchiveAllNotifications({ userId, category,
|
|
32
|
+
export declare function useArchiveAllNotifications({ userId, category, enqueueArchiveAllFn, getArchiveAllStatusFn, pollIntervalMs, maxPolls, invalidateKeys, }: UseArchiveAllNotificationsOptions): import("@tanstack/react-query").UseMutationResult<ArchiveAllPollResult, Error, void, unknown>;
|
|
22
33
|
//# sourceMappingURL=useArchiveAllNotifications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useArchiveAllNotifications.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/useArchiveAllNotifications.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"useArchiveAllNotifications.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/useArchiveAllNotifications.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,oBAAoB,EACpB,iCAAiC,EAClC,MAAM,gBAAgB,CAAC;AASxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,MAAM,EACN,QAAQ,EACR,mBAAmB,EACnB,qBAAqB,EACrB,cAAyC,EACzC,QAA4B,EAC5B,cAAc,GACf,EAAE,iCAAiC,iGAqDnC"}
|
|
@@ -1,25 +1,41 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
3
|
+
const DEFAULT_POLL_INTERVAL_MS = 1500;
|
|
4
|
+
const DEFAULT_MAX_POLLS = 120; // ~3 min at the default interval
|
|
5
|
+
function sleep(ms) {
|
|
6
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
7
|
+
}
|
|
3
8
|
/**
|
|
4
|
-
*
|
|
9
|
+
* Trigger + poll a SERVER-OWNED archive-all job for one notification category.
|
|
10
|
+
*
|
|
11
|
+
* This is a THIN STATUS POLLER, not a client loop. It:
|
|
12
|
+
* 1. enqueues ONE server job via `enqueueArchiveAllFn(category)` (the category — the tab the tray
|
|
13
|
+
* was invoked on — flows into the job, preserving per-tab scoping: the worker archives ONLY
|
|
14
|
+
* that category's active cards, never all tabs);
|
|
15
|
+
* 2. polls `getArchiveAllStatusFn(jobId)` until the job reaches a terminal state
|
|
16
|
+
* (`complete` | `incomplete` | `failed`);
|
|
17
|
+
* 3. resolves an {@link ArchiveAllPollResult} the caller gates side effects on, and invalidates
|
|
18
|
+
* the read keys on a completed drain.
|
|
5
19
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* app
|
|
20
|
+
* All paging + ownership-checked per-card deletion happen server-side. The hook performs no client
|
|
21
|
+
* Firestore writes and never chains archive calls. The generic package hardcodes no callable name —
|
|
22
|
+
* the app injects both adapters.
|
|
9
23
|
*
|
|
10
24
|
* @example
|
|
11
25
|
* ```tsx
|
|
12
|
-
* const
|
|
26
|
+
* const enqueue = httpsCallable(functions, 'enqueueArchiveAll');
|
|
27
|
+
* const getStatus = httpsCallable(functions, 'getArchiveAllStatus');
|
|
13
28
|
* const archiveAll = useArchiveAllNotifications({
|
|
14
29
|
* userId: user.uid,
|
|
15
30
|
* category: 'user',
|
|
16
|
-
*
|
|
31
|
+
* enqueueArchiveAllFn: (category) => enqueue({ category }).then((r) => r.data),
|
|
32
|
+
* getArchiveAllStatusFn: (jobId) => getStatus({ jobId }).then((r) => r.data),
|
|
17
33
|
* });
|
|
18
34
|
*
|
|
19
35
|
* archiveAll.mutate();
|
|
20
36
|
* ```
|
|
21
37
|
*/
|
|
22
|
-
export function useArchiveAllNotifications({ userId, category,
|
|
38
|
+
export function useArchiveAllNotifications({ userId, category, enqueueArchiveAllFn, getArchiveAllStatusFn, pollIntervalMs = DEFAULT_POLL_INTERVAL_MS, maxPolls = DEFAULT_MAX_POLLS, invalidateKeys, }) {
|
|
23
39
|
const queryClient = useQueryClient();
|
|
24
40
|
const defaultInvalidateKeys = [
|
|
25
41
|
['notifications', 'active', category, userId],
|
|
@@ -27,37 +43,44 @@ export function useArchiveAllNotifications({ userId, category, archiveAllFn, inv
|
|
|
27
43
|
['notifications', 'history', category, userId],
|
|
28
44
|
];
|
|
29
45
|
return useMutation({
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
// gates side effects on (it is NOT a plain success — see ArchiveAllLoopResult).
|
|
46
|
+
// Server-owned archive-all: enqueue ONE job scoped to `category`, then poll its status until it
|
|
47
|
+
// reaches a terminal state. No browser loop, no chain of archive transactions. The mutation
|
|
48
|
+
// resolves with an explicit terminal result (never throws for an incomplete drain) — `complete`
|
|
49
|
+
// is the load-bearing flag callers gate post-clear side effects on.
|
|
35
50
|
mutationFn: async () => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
const { jobId } = await enqueueArchiveAllFn(category);
|
|
52
|
+
// Poll until terminal or until the guard bound is hit. A job that never terminates resolves
|
|
53
|
+
// `incomplete` (mirrors the old loop's honest "some remain" result) rather than hanging. The
|
|
54
|
+
// first poll happens immediately so a fast/already-complete job resolves without a delay.
|
|
55
|
+
let lastArchived = 0;
|
|
56
|
+
for (let poll = 0; poll < maxPolls; poll += 1) {
|
|
57
|
+
const snap = await getArchiveAllStatusFn(jobId);
|
|
58
|
+
lastArchived = snap.archived ?? 0;
|
|
59
|
+
if (snap.state === 'complete') {
|
|
60
|
+
return { status: 'complete', category, archived: lastArchived, complete: true };
|
|
61
|
+
}
|
|
62
|
+
if (snap.state === 'incomplete') {
|
|
63
|
+
return { status: 'incomplete', category, archived: lastArchived, complete: false };
|
|
64
|
+
}
|
|
65
|
+
if (snap.state === 'failed') {
|
|
66
|
+
return { status: 'failed', category, archived: lastArchived, complete: false, error: snap.error };
|
|
67
|
+
}
|
|
68
|
+
// Still in-progress — wait before the next poll unless this was the last allowed poll.
|
|
69
|
+
if (poll < maxPolls - 1)
|
|
70
|
+
await sleep(pollIntervalMs);
|
|
50
71
|
}
|
|
51
|
-
//
|
|
52
|
-
|
|
53
|
-
// incomplete result, never a plain success.
|
|
54
|
-
return { archived, hasMore, complete: !hasMore };
|
|
72
|
+
// Guard: the job never reached a terminal state within the poll budget — report incomplete.
|
|
73
|
+
return { status: 'incomplete', category, archived: lastArchived, complete: false };
|
|
55
74
|
},
|
|
56
|
-
onSuccess: () => {
|
|
75
|
+
onSuccess: (result) => {
|
|
76
|
+
// Only a completed drain changed the active set; still invalidate on an incomplete drain since
|
|
77
|
+
// SOME cards were archived. A hard enqueue/poll failure rejects the mutation (onError), so this
|
|
78
|
+
// never runs for `failed`.
|
|
57
79
|
const keysToInvalidate = invalidateKeys ?? defaultInvalidateKeys;
|
|
58
80
|
keysToInvalidate.forEach((key) => {
|
|
59
81
|
queryClient.invalidateQueries({ queryKey: [...key], exact: false });
|
|
60
82
|
});
|
|
83
|
+
void result;
|
|
61
84
|
},
|
|
62
85
|
});
|
|
63
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useArchiveAllNotifications.js","sourceRoot":"","sources":["../../../src/react/hooks/useArchiveAllNotifications.ts"],"names":[],"mappings":"AAAA,YAAY,C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OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC/B,WAAW,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;YACtE,CAAC,CAAC,CAAC;YACH,KAAK,MAAM,CAAC;QACd,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -168,42 +168,79 @@ export interface UseArchiveNotificationOptions {
|
|
|
168
168
|
invalidateKeys?: readonly unknown[][];
|
|
169
169
|
}
|
|
170
170
|
/**
|
|
171
|
-
*
|
|
172
|
-
* cap and the caller's active set was NOT fully drained — `useArchiveAllNotifications` loops the
|
|
173
|
-
* adapter until `hasMore` is false so "Clear All" actually clears all (I3).
|
|
171
|
+
* Terminal + transient states of a server-owned archive-all job, as surfaced to the UI.
|
|
174
172
|
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
173
|
+
* - `idle` — nothing enqueued yet (initial / reset state).
|
|
174
|
+
* - `enqueuing` — the enqueue adapter is in flight (job not yet acknowledged).
|
|
175
|
+
* - `in-progress` — the job is enqueued/running; the worker is still draining the category.
|
|
176
|
+
* - `complete` — TERMINAL: the worker fully drained the category's active set.
|
|
177
|
+
* - `incomplete` — TERMINAL: the job stopped without draining everything (e.g. hit its own
|
|
178
|
+
* bound / a non-advanceable card). The tray keeps a "some remain — try again"
|
|
179
|
+
* affordance, mirroring the old loop's incomplete result.
|
|
180
|
+
* - `failed` — TERMINAL: the enqueue call threw, or the job dead-lettered / reported failure.
|
|
178
181
|
*/
|
|
179
|
-
export
|
|
180
|
-
|
|
181
|
-
|
|
182
|
+
export type ArchiveAllJobStatus = 'idle' | 'enqueuing' | 'in-progress' | 'complete' | 'incomplete' | 'failed';
|
|
183
|
+
/**
|
|
184
|
+
* Result of the INJECTED enqueue adapter — triggers exactly one server-owned archive-all job for
|
|
185
|
+
* the given category and returns immediately with the job's id (idempotent per user+category+request
|
|
186
|
+
* on the app side). The app wires this to its `httpsCallable(functions, 'enqueueArchiveAll')`
|
|
187
|
+
* (or equivalent); the generic package never names the callable.
|
|
188
|
+
*/
|
|
189
|
+
export interface EnqueueArchiveAllResult {
|
|
190
|
+
/** Server job id the poller then polls via the status adapter. */
|
|
191
|
+
jobId: string;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Snapshot of a server-owned archive-all job, returned by the INJECTED status-query adapter.
|
|
195
|
+
* The poller maps `state` → {@link ArchiveAllJobStatus} and stops polling on any terminal state.
|
|
196
|
+
* `category` echoes the tab/category the job was enqueued for so the UI can assert per-tab scoping.
|
|
197
|
+
*/
|
|
198
|
+
export interface ArchiveAllJobSnapshot {
|
|
199
|
+
/** Job lifecycle state as owned by the server worker. */
|
|
200
|
+
state: 'in-progress' | 'complete' | 'incomplete' | 'failed';
|
|
201
|
+
/** The notification category/tab this job is scoped to (must match the enqueue category). */
|
|
202
|
+
category: string;
|
|
203
|
+
/** Cards archived so far (monotonic); optional progress for the UI. */
|
|
204
|
+
archived?: number;
|
|
205
|
+
/** Human-readable failure reason when `state === 'failed'` (optional). */
|
|
206
|
+
error?: string;
|
|
182
207
|
}
|
|
183
208
|
/**
|
|
184
|
-
* Aggregate result
|
|
185
|
-
* load-bearing completion contract
|
|
186
|
-
*
|
|
187
|
-
* guard tripped (a pass archived nothing yet still reported `hasMore`, e.g. a generation-less head
|
|
188
|
-
* card that can't advance) or the per-mutation pass bound was hit with `hasMore` still `true`.
|
|
189
|
-
* Callers MUST gate post-clear side effects (closing the tray, `onClearAll`) on `complete`, not on
|
|
190
|
-
* mere resolution — the mutation resolves on an incomplete drain rather than throwing.
|
|
209
|
+
* Aggregate result the poller resolves with once the job reaches a terminal state.
|
|
210
|
+
* `complete` is the load-bearing completion contract (true ONLY when the whole category was
|
|
211
|
+
* drained), preserved from the old loop so callers gate side effects the same way.
|
|
191
212
|
*/
|
|
192
|
-
export interface
|
|
213
|
+
export interface ArchiveAllPollResult {
|
|
214
|
+
status: Extract<ArchiveAllJobStatus, 'complete' | 'incomplete' | 'failed'>;
|
|
215
|
+
category: string;
|
|
193
216
|
archived: number;
|
|
194
|
-
hasMore: boolean;
|
|
195
217
|
complete: boolean;
|
|
218
|
+
error?: string;
|
|
196
219
|
}
|
|
197
220
|
export interface UseArchiveAllNotificationsOptions {
|
|
198
221
|
userId: string;
|
|
199
222
|
category: string;
|
|
200
223
|
/**
|
|
201
|
-
* App-supplied adapter that
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
224
|
+
* App-supplied adapter that ENQUEUES one server-owned archive-all job scoped to `category` and
|
|
225
|
+
* returns its `jobId`. The `category` is passed so the app callable can carry the tab/source into
|
|
226
|
+
* the job (per-tab scoping is REQUIRED — the worker archives only that category's active cards).
|
|
227
|
+
* Typically `(category) => enqueueArchiveAll({ category })` over an `httpsCallable`.
|
|
228
|
+
*/
|
|
229
|
+
enqueueArchiveAllFn: (category: string) => Promise<EnqueueArchiveAllResult>;
|
|
230
|
+
/**
|
|
231
|
+
* App-supplied adapter that returns the current {@link ArchiveAllJobSnapshot} for a job id — the
|
|
232
|
+
* hook polls it until the job reaches a terminal state. Typically
|
|
233
|
+
* `(jobId) => getArchiveAllStatus({ jobId })` over an `httpsCallable`, or a Firestore read of the
|
|
234
|
+
* job doc. No client Firestore writes.
|
|
205
235
|
*/
|
|
206
|
-
|
|
236
|
+
getArchiveAllStatusFn: (jobId: string) => Promise<ArchiveAllJobSnapshot>;
|
|
237
|
+
/** Poll interval in ms while the job is in-progress (default 1500). */
|
|
238
|
+
pollIntervalMs?: number;
|
|
239
|
+
/**
|
|
240
|
+
* Max number of status polls before the poller gives up and resolves `incomplete` (guards a job
|
|
241
|
+
* that never reaches a terminal state — default 120, i.e. ~3 min at the default interval).
|
|
242
|
+
*/
|
|
243
|
+
maxPolls?: number;
|
|
207
244
|
invalidateKeys?: readonly unknown[][];
|
|
208
245
|
}
|
|
209
246
|
export interface NotificationListProps {
|
|
@@ -217,11 +254,17 @@ export interface NotificationListProps {
|
|
|
217
254
|
*/
|
|
218
255
|
archiveFn: (notificationId: string) => Promise<unknown>;
|
|
219
256
|
/**
|
|
220
|
-
* Adapter that
|
|
221
|
-
* `
|
|
222
|
-
*
|
|
257
|
+
* Adapter that ENQUEUES one server-owned archive-all job scoped to `category` and returns its
|
|
258
|
+
* `jobId`. Passed straight through to `useArchiveAllNotifications`; the app wires it to its
|
|
259
|
+
* enqueue callable. Per-tab scoping: the category flows through to the job.
|
|
260
|
+
*/
|
|
261
|
+
enqueueArchiveAllFn: (category: string) => Promise<EnqueueArchiveAllResult>;
|
|
262
|
+
/**
|
|
263
|
+
* Adapter that returns the current status snapshot for an archive-all `jobId`. Passed straight
|
|
264
|
+
* through to `useArchiveAllNotifications`, which polls it until the job is terminal; the app wires
|
|
265
|
+
* it to its status callable / job-doc read.
|
|
223
266
|
*/
|
|
224
|
-
|
|
267
|
+
getArchiveAllStatusFn: (jobId: string) => Promise<ArchiveAllJobSnapshot>;
|
|
225
268
|
onClearAll?: () => void;
|
|
226
269
|
refetchInterval?: number;
|
|
227
270
|
emptyText?: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IAGjB,4DAA4D;IAC5D,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAG5B,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;IAGhB,gCAA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wB,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttt-productions/notification-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Shared notification system for TTT Productions apps — active/history two-tier architecture with dedup, batch processing, and themed UI components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|