@bunizao/contracts 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/admin.d.ts +3 -1
- package/dist/index.js +2 -0
- package/dist/listening.d.ts +15 -0
- package/dist/notify.d.ts +14 -0
- package/dist/notify.js +3 -1
- package/package.json +1 -1
package/dist/admin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ClientFingerprint, CommentAuthAtWrite, CommentClaimMethod, CommentsMode, CommentStatus, CommentSurface, Interaction } from './comments';
|
|
2
2
|
import type { MessageLocale, MessageState } from './messages';
|
|
3
|
-
import type { DeliveryMode, NotifyAuditEventType, NotifyChannel, SubscriberRecord, SubscriberStatus } from './notify';
|
|
3
|
+
import type { DeliveryMode, NotifyAuditEventType, NotifyChannel, SubscriberRecord, SubscriberStatus, SubscriptionSource } from './notify';
|
|
4
4
|
export interface SubscriberChannelCount {
|
|
5
5
|
total: number;
|
|
6
6
|
pendingCount: number;
|
|
@@ -24,6 +24,8 @@ export interface SubscriberListResult {
|
|
|
24
24
|
activeCount: number;
|
|
25
25
|
unsubscribedCount: number;
|
|
26
26
|
channelCounts?: SubscriberChannelCounts;
|
|
27
|
+
/** Acquisition counts, kept separate from the subscribed channels. */
|
|
28
|
+
acquisitionCounts?: Record<SubscriptionSource | 'unknown', SubscriberChannelCount>;
|
|
27
29
|
}
|
|
28
30
|
export interface AuditEntry {
|
|
29
31
|
id: number;
|
package/dist/index.js
CHANGED
|
@@ -131,6 +131,7 @@ var MOOD_AI_MODELS = ["gpt-5.5", "gpt-5", "claude-sonnet-4.6"];
|
|
|
131
131
|
var MOOD_COMMENT_ORIGINS = ["telegram", "web"];
|
|
132
132
|
// src/notify.ts
|
|
133
133
|
var NOTIFY_CHANNELS = ["mood", "blog", "privacy", "announcement"];
|
|
134
|
+
var SUBSCRIPTION_SOURCES = ["desk", "blog", "mood"];
|
|
134
135
|
// src/routes.ts
|
|
135
136
|
var API_PREFIX = "/api";
|
|
136
137
|
var HEALTH_PATH = "/health";
|
|
@@ -319,6 +320,7 @@ export {
|
|
|
319
320
|
READER_RESEND_PATH,
|
|
320
321
|
READER_VERIFY_OUTCOMES,
|
|
321
322
|
READER_VERIFY_PATH,
|
|
323
|
+
SUBSCRIPTION_SOURCES,
|
|
322
324
|
TELEGRAM_OPS_BASE_PATH,
|
|
323
325
|
TELEGRAM_OPS_BROADCASTS_PATH,
|
|
324
326
|
TELEGRAM_OPS_BROADCAST_CHANNELS,
|
package/dist/listening.d.ts
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/** Site playback totals in a rolling seven-day window, not Apple Music history. */
|
|
2
|
+
export interface ListeningStats {
|
|
3
|
+
generatedAt: string;
|
|
4
|
+
window: {
|
|
5
|
+
from: string;
|
|
6
|
+
to: string;
|
|
7
|
+
};
|
|
8
|
+
totals: {
|
|
9
|
+
plays: number;
|
|
10
|
+
};
|
|
11
|
+
topArtist: {
|
|
12
|
+
name: string;
|
|
13
|
+
plays: number;
|
|
14
|
+
} | null;
|
|
15
|
+
}
|
|
1
16
|
export interface ListeningAccent {
|
|
2
17
|
hue: number;
|
|
3
18
|
chromaLight: number;
|
package/dist/notify.d.ts
CHANGED
|
@@ -4,6 +4,16 @@ export type DeliveryMode = 'immediate' | 'every_5h' | 'daily';
|
|
|
4
4
|
export type NotifyChannel = 'mood' | 'blog' | 'privacy' | 'announcement';
|
|
5
5
|
export type NotifyAuditEventType = 'subscribe_requested' | 'subscription_confirmed' | 'unsubscribed' | 'email_change_requested' | 'email_changed' | 'admin_create' | 'admin_update' | 'admin_delete' | 'admin_resend_confirm' | 'broadcast_sent';
|
|
6
6
|
export declare const NOTIFY_CHANNELS: readonly NotifyChannel[];
|
|
7
|
+
export declare const SUBSCRIPTION_SOURCES: readonly ['desk', 'blog', 'mood'];
|
|
8
|
+
export type SubscriptionSource = (typeof SUBSCRIPTION_SOURCES)[number];
|
|
9
|
+
/** Public counts of active, confirmed, deliverable email subscriptions. */
|
|
10
|
+
export interface SubscriberCounts {
|
|
11
|
+
generatedAt: string;
|
|
12
|
+
channels: {
|
|
13
|
+
blog: number;
|
|
14
|
+
mood: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
7
17
|
/** Optional risk evidence preserves compatibility with existing clients. */
|
|
8
18
|
export interface SubscribeRequest extends ClientEvidence {
|
|
9
19
|
email: string;
|
|
@@ -14,6 +24,8 @@ export interface SubscribeRequest extends ClientEvidence {
|
|
|
14
24
|
dailyHour?: number;
|
|
15
25
|
website?: string;
|
|
16
26
|
dwellToken?: string;
|
|
27
|
+
/** First subscription surface. Unknown values are ignored by the server. */
|
|
28
|
+
source?: SubscriptionSource;
|
|
17
29
|
}
|
|
18
30
|
export interface SubscriberRecord {
|
|
19
31
|
email: string;
|
|
@@ -32,6 +44,8 @@ export interface SubscriberRecord {
|
|
|
32
44
|
updatedAt: string;
|
|
33
45
|
confirmedAt?: string;
|
|
34
46
|
lastConfirmSentAt?: string;
|
|
47
|
+
/** First recorded subscription surface; absent for historical subscribers. */
|
|
48
|
+
source?: SubscriptionSource;
|
|
35
49
|
}
|
|
36
50
|
export interface RetryRecord {
|
|
37
51
|
postId: string;
|
package/dist/notify.js
CHANGED