@agora-server/contract 0.10.0 → 0.12.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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/schemas.d.ts +24 -10
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +17 -12
- package/dist/social.d.ts +267 -0
- package/dist/social.d.ts.map +1 -0
- package/dist/social.js +166 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/schemas.d.ts
CHANGED
|
@@ -471,6 +471,16 @@ export declare const refreshSchema: z.ZodObject<{
|
|
|
471
471
|
}, {
|
|
472
472
|
refreshToken: string;
|
|
473
473
|
}>;
|
|
474
|
+
export declare const grantRoleSchema: z.ZodObject<{
|
|
475
|
+
userId: z.ZodString;
|
|
476
|
+
role: z.ZodEnum<["owner", "admin", "steward"]>;
|
|
477
|
+
}, "strip", z.ZodTypeAny, {
|
|
478
|
+
role: "admin" | "owner" | "steward";
|
|
479
|
+
userId: string;
|
|
480
|
+
}, {
|
|
481
|
+
role: "admin" | "owner" | "steward";
|
|
482
|
+
userId: string;
|
|
483
|
+
}>;
|
|
474
484
|
export declare const signOutSchema: z.ZodObject<{
|
|
475
485
|
refreshToken: z.ZodOptional<z.ZodString>;
|
|
476
486
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -505,21 +515,31 @@ export declare const verifyEmailSchema: z.ZodObject<{
|
|
|
505
515
|
tokenHash: string;
|
|
506
516
|
type?: "email" | "signup" | "recovery" | undefined;
|
|
507
517
|
}>;
|
|
518
|
+
export declare const resetPasswordSchema: z.ZodObject<{
|
|
519
|
+
token: z.ZodString;
|
|
520
|
+
newPassword: z.ZodString;
|
|
521
|
+
}, "strip", z.ZodTypeAny, {
|
|
522
|
+
newPassword: string;
|
|
523
|
+
token: string;
|
|
524
|
+
}, {
|
|
525
|
+
newPassword: string;
|
|
526
|
+
token: string;
|
|
527
|
+
}>;
|
|
508
528
|
export declare const externalUserSchema: z.ZodEffects<z.ZodObject<{
|
|
509
529
|
userJwt: z.ZodOptional<z.ZodString>;
|
|
510
530
|
token: z.ZodOptional<z.ZodString>;
|
|
511
531
|
}, "strip", z.ZodTypeAny, {
|
|
512
|
-
userJwt?: string | undefined;
|
|
513
532
|
token?: string | undefined;
|
|
514
|
-
}, {
|
|
515
533
|
userJwt?: string | undefined;
|
|
534
|
+
}, {
|
|
516
535
|
token?: string | undefined;
|
|
517
|
-
}>, {
|
|
518
536
|
userJwt?: string | undefined;
|
|
537
|
+
}>, {
|
|
519
538
|
token?: string | undefined;
|
|
520
|
-
}, {
|
|
521
539
|
userJwt?: string | undefined;
|
|
540
|
+
}, {
|
|
522
541
|
token?: string | undefined;
|
|
542
|
+
userJwt?: string | undefined;
|
|
523
543
|
}>;
|
|
524
544
|
export declare const signTestingJwtSchema: z.ZodObject<{
|
|
525
545
|
privateKey: z.ZodString;
|
|
@@ -563,8 +583,6 @@ export declare const webhookConfigSchema: z.ZodObject<{
|
|
|
563
583
|
}>;
|
|
564
584
|
export declare const DEFAULT_MODERATION_CATEGORIES: readonly ["fake-news", "conspiracy", "racism", "alcohol-promotion", "drug-promotion", "foul-language", "harassment", "hate-promotion", "sexual", "violence-promotion", "self-harm", "spam", "illicit", "pii"];
|
|
565
585
|
export declare const moderatorConfigSchema: z.ZodObject<{
|
|
566
|
-
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
567
|
-
secret: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
568
586
|
blockAutoActionThreshold: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
569
587
|
reviewAutoActionThreshold: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
570
588
|
llmProvider: z.ZodOptional<z.ZodNullable<z.ZodEnum<["openai", "anthropic"]>>>;
|
|
@@ -574,8 +592,6 @@ export declare const moderatorConfigSchema: z.ZodObject<{
|
|
|
574
592
|
llmMaxTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
575
593
|
categories: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
576
594
|
}, "strip", z.ZodTypeAny, {
|
|
577
|
-
url?: string | null | undefined;
|
|
578
|
-
secret?: string | null | undefined;
|
|
579
595
|
blockAutoActionThreshold?: number | null | undefined;
|
|
580
596
|
reviewAutoActionThreshold?: number | null | undefined;
|
|
581
597
|
llmProvider?: "openai" | "anthropic" | null | undefined;
|
|
@@ -585,8 +601,6 @@ export declare const moderatorConfigSchema: z.ZodObject<{
|
|
|
585
601
|
llmMaxTokens?: number | null | undefined;
|
|
586
602
|
categories?: string[] | null | undefined;
|
|
587
603
|
}, {
|
|
588
|
-
url?: string | null | undefined;
|
|
589
|
-
secret?: string | null | undefined;
|
|
590
604
|
blockAutoActionThreshold?: number | null | undefined;
|
|
591
605
|
reviewAutoActionThreshold?: number | null | undefined;
|
|
592
606
|
llmProvider?: "openai" | "anthropic" | null | undefined;
|
package/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BAA6B,+MAehC,CAAC;AASX,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAShC,CAAC;AAKH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;EAMlC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;EAK/B,CAAC;AAGH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;EAOnC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;EAEnC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;EAKmD,CAAC;AAQzF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKqD,CAAC;AAEpF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;EAE0D,CAAC;AAEzF,eAAO,MAAM,qBAAqB;;;;;;EAEhC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;EAGtC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;EAE/B,CAAC;AAGH,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC"}
|
package/dist/schemas.js
CHANGED
|
@@ -178,7 +178,7 @@ export const createReportSchema = z.object({
|
|
|
178
178
|
});
|
|
179
179
|
// ─── auth ──────────────────────────────────────────────────────────────────
|
|
180
180
|
export const signUpSchema = z.object({
|
|
181
|
-
email: z.string().email(),
|
|
181
|
+
email: z.string().email().max(254),
|
|
182
182
|
password: z.string().min(8).max(128),
|
|
183
183
|
name: z.string().max(120).optional(),
|
|
184
184
|
username: z.string().min(1).max(60).optional(),
|
|
@@ -190,6 +190,10 @@ export const signInSchema = z.object({
|
|
|
190
190
|
export const refreshSchema = z.object({
|
|
191
191
|
refreshToken: z.string().min(1),
|
|
192
192
|
});
|
|
193
|
+
export const grantRoleSchema = z.object({
|
|
194
|
+
userId: z.string().uuid(),
|
|
195
|
+
role: z.enum(["owner", "admin", "steward"]),
|
|
196
|
+
});
|
|
193
197
|
export const signOutSchema = z.object({
|
|
194
198
|
refreshToken: z.string().min(1).optional(),
|
|
195
199
|
});
|
|
@@ -198,12 +202,16 @@ export const changePasswordSchema = z.object({
|
|
|
198
202
|
newPassword: z.string().min(8).max(128),
|
|
199
203
|
});
|
|
200
204
|
export const emailSchema = z.object({
|
|
201
|
-
email: z.string().email(),
|
|
205
|
+
email: z.string().email().max(254),
|
|
202
206
|
});
|
|
203
207
|
export const verifyEmailSchema = z.object({
|
|
204
208
|
tokenHash: z.string().min(1),
|
|
205
209
|
type: z.enum(["signup", "email", "recovery"]).optional(),
|
|
206
210
|
});
|
|
211
|
+
export const resetPasswordSchema = z.object({
|
|
212
|
+
token: z.string().min(1),
|
|
213
|
+
newPassword: z.string().min(8).max(128),
|
|
214
|
+
});
|
|
207
215
|
export const externalUserSchema = z
|
|
208
216
|
.object({
|
|
209
217
|
// The SDK posts `userJwt`; `token` kept as a legacy alias.
|
|
@@ -241,17 +249,14 @@ export const DEFAULT_MODERATION_CATEGORIES = [
|
|
|
241
249
|
"illicit",
|
|
242
250
|
"pii",
|
|
243
251
|
];
|
|
244
|
-
// The
|
|
245
|
-
//
|
|
246
|
-
// - the
|
|
247
|
-
// separate from the project's (external) webhook notifier;
|
|
248
|
-
// - the block/review auto-action thresholds + LLM-provider tuning the moderator overlays on its env defaults;
|
|
252
|
+
// The services/scorer integration (PATCH /settings/moderator). Per-project tuning the scorer overlays
|
|
253
|
+
// on its env defaults:
|
|
254
|
+
// - the block/review auto-action thresholds + LLM-provider tuning;
|
|
249
255
|
// - the per-project moderation category list (`categories`).
|
|
250
|
-
//
|
|
251
|
-
//
|
|
256
|
+
// (Scoring transport is the scorer's pgmq enqueue — there is no per-project notifier URL/secret.)
|
|
257
|
+
// Every field is nullish: omit to leave unchanged, null to clear (→ the scorer's env default /
|
|
258
|
+
// the seed categories). `llmApiKey` is write-only (GET exposes only hasLlmApiKey).
|
|
252
259
|
export const moderatorConfigSchema = z.object({
|
|
253
|
-
url: z.string().url().nullish(),
|
|
254
|
-
secret: z.string().min(1).nullish(),
|
|
255
260
|
blockAutoActionThreshold: z.number().min(0).max(1).nullish(),
|
|
256
261
|
reviewAutoActionThreshold: z.number().min(0).max(1).nullish(),
|
|
257
262
|
llmProvider: z.enum(["openai", "anthropic"]).nullish(),
|
|
@@ -261,7 +266,7 @@ export const moderatorConfigSchema = z.object({
|
|
|
261
266
|
llmMaxTokens: z.number().int().positive().nullish(),
|
|
262
267
|
categories: z.array(z.string().trim().min(1).max(64)).max(100).nullish(),
|
|
263
268
|
});
|
|
264
|
-
// ─── automated moderation (
|
|
269
|
+
// ─── automated moderation (services/scorer) ────────────────────────────────
|
|
265
270
|
// Body for the moderator's on-demand POST /moderation/analyze (admin "Re-analyze"). The admin
|
|
266
271
|
// already has the content loaded, so it passes the text directly along with what's being judged.
|
|
267
272
|
export const moderationAnalyzeSchema = z.object({
|
package/dist/social.d.ts
ADDED
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const SOCIAL_PRIVACY_TIERS: readonly ["community", "corporate"];
|
|
3
|
+
export type SocialPrivacyTier = (typeof SOCIAL_PRIVACY_TIERS)[number];
|
|
4
|
+
export declare const CORPORATE_ONLY_FLAGS: readonly ["influenceScoresEnabled", "siloDetectionEnabled", "engagementScoresEnabled", "frictionAnalyticsEnabled", "readReceiptsAllowed"];
|
|
5
|
+
export type CorporateOnlyFlag = (typeof CORPORATE_ONLY_FLAGS)[number];
|
|
6
|
+
export interface ResolvedSocialConfig {
|
|
7
|
+
privacyTier: SocialPrivacyTier;
|
|
8
|
+
graphEnabled: boolean;
|
|
9
|
+
weatherEnabled: boolean;
|
|
10
|
+
constellationEnabled: boolean;
|
|
11
|
+
constellationKFloor: number;
|
|
12
|
+
neighborhoodEnabled: boolean;
|
|
13
|
+
/** When true, a member's Neighborhood also includes people they've recently *interacted* with (not
|
|
14
|
+
* just follows/connections). Default false — the project-wide default; a member can override it for
|
|
15
|
+
* their own view via the endpoint's `?includeInteractions=` query param. */
|
|
16
|
+
neighborhoodIncludeInteractions: boolean;
|
|
17
|
+
influenceScoresEnabled: boolean;
|
|
18
|
+
siloDetectionEnabled: boolean;
|
|
19
|
+
engagementScoresEnabled: boolean;
|
|
20
|
+
frictionVisibleToStewards: boolean;
|
|
21
|
+
frictionAnalyticsEnabled: boolean;
|
|
22
|
+
readAffinityEnabled: boolean;
|
|
23
|
+
readReceiptsAllowed: boolean;
|
|
24
|
+
warmthHalfLifeDays: number;
|
|
25
|
+
frictionHalfLifeDays: number;
|
|
26
|
+
}
|
|
27
|
+
export declare const SOCIAL_TIER_DEFAULTS: Record<SocialPrivacyTier, ResolvedSocialConfig>;
|
|
28
|
+
export declare const socialConfigSchema: z.ZodObject<{
|
|
29
|
+
privacyTier: z.ZodOptional<z.ZodNullable<z.ZodEnum<["community", "corporate"]>>>;
|
|
30
|
+
graphEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
31
|
+
weatherEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
32
|
+
constellationEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
33
|
+
constellationKFloor: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
34
|
+
neighborhoodEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
35
|
+
neighborhoodIncludeInteractions: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
36
|
+
influenceScoresEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
37
|
+
siloDetectionEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
38
|
+
engagementScoresEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
39
|
+
frictionVisibleToStewards: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
40
|
+
frictionAnalyticsEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
41
|
+
readAffinityEnabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
42
|
+
readReceiptsAllowed: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
43
|
+
warmthHalfLifeDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
44
|
+
frictionHalfLifeDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
influenceScoresEnabled?: boolean | null | undefined;
|
|
47
|
+
siloDetectionEnabled?: boolean | null | undefined;
|
|
48
|
+
engagementScoresEnabled?: boolean | null | undefined;
|
|
49
|
+
frictionAnalyticsEnabled?: boolean | null | undefined;
|
|
50
|
+
readReceiptsAllowed?: boolean | null | undefined;
|
|
51
|
+
privacyTier?: "community" | "corporate" | null | undefined;
|
|
52
|
+
graphEnabled?: boolean | null | undefined;
|
|
53
|
+
weatherEnabled?: boolean | null | undefined;
|
|
54
|
+
constellationEnabled?: boolean | null | undefined;
|
|
55
|
+
constellationKFloor?: number | null | undefined;
|
|
56
|
+
neighborhoodEnabled?: boolean | null | undefined;
|
|
57
|
+
neighborhoodIncludeInteractions?: boolean | null | undefined;
|
|
58
|
+
frictionVisibleToStewards?: boolean | null | undefined;
|
|
59
|
+
readAffinityEnabled?: boolean | null | undefined;
|
|
60
|
+
warmthHalfLifeDays?: number | null | undefined;
|
|
61
|
+
frictionHalfLifeDays?: number | null | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
influenceScoresEnabled?: boolean | null | undefined;
|
|
64
|
+
siloDetectionEnabled?: boolean | null | undefined;
|
|
65
|
+
engagementScoresEnabled?: boolean | null | undefined;
|
|
66
|
+
frictionAnalyticsEnabled?: boolean | null | undefined;
|
|
67
|
+
readReceiptsAllowed?: boolean | null | undefined;
|
|
68
|
+
privacyTier?: "community" | "corporate" | null | undefined;
|
|
69
|
+
graphEnabled?: boolean | null | undefined;
|
|
70
|
+
weatherEnabled?: boolean | null | undefined;
|
|
71
|
+
constellationEnabled?: boolean | null | undefined;
|
|
72
|
+
constellationKFloor?: number | null | undefined;
|
|
73
|
+
neighborhoodEnabled?: boolean | null | undefined;
|
|
74
|
+
neighborhoodIncludeInteractions?: boolean | null | undefined;
|
|
75
|
+
frictionVisibleToStewards?: boolean | null | undefined;
|
|
76
|
+
readAffinityEnabled?: boolean | null | undefined;
|
|
77
|
+
warmthHalfLifeDays?: number | null | undefined;
|
|
78
|
+
frictionHalfLifeDays?: number | null | undefined;
|
|
79
|
+
}>;
|
|
80
|
+
export type SocialConfigPatch = z.infer<typeof socialConfigSchema>;
|
|
81
|
+
/** The tier that results from applying `patch` over the currently-stored tier.
|
|
82
|
+
* `privacyTier: null` in a patch clears the override → community default. */
|
|
83
|
+
export declare function resultingSocialTier(patch: {
|
|
84
|
+
privacyTier?: SocialPrivacyTier | null | undefined;
|
|
85
|
+
}, currentTier: SocialPrivacyTier): SocialPrivacyTier;
|
|
86
|
+
/** Reject-on-write: keys in `patch` that the RESULTING tier (after applying the patch's own
|
|
87
|
+
* privacyTier, if any) forbids. Empty array = OK. Pass the currently-STORED tier — the
|
|
88
|
+
* current-vs-resulting derivation happens here so call sites can't get it wrong. */
|
|
89
|
+
export declare function forbiddenSocialKeys(patch: Partial<Record<string, unknown>> & {
|
|
90
|
+
privacyTier?: SocialPrivacyTier | null;
|
|
91
|
+
}, currentTier: SocialPrivacyTier): string[];
|
|
92
|
+
/** Clamp-on-read: overlay stored jsonb onto tier defaults, neutralizing anything the tier forbids. */
|
|
93
|
+
export declare function resolveSocialConfig(raw: unknown): ResolvedSocialConfig;
|
|
94
|
+
export declare const WEATHER_BANDS: readonly ["quiet", "stormy", "overcast", "fine", "sunny"];
|
|
95
|
+
export type WeatherBand = (typeof WEATHER_BANDS)[number];
|
|
96
|
+
export interface SocialWeather {
|
|
97
|
+
/** Mean S_p over the project; null when the graph has no interactions yet. 0..1 rounded to 2dp
|
|
98
|
+
* is a runtime convention of the server's weather computation, not enforced by this type. */
|
|
99
|
+
value: number | null;
|
|
100
|
+
/** Bucketed label, never null. "quiet" is ONLY the no-data sentinel (value === null); a low
|
|
101
|
+
* score with data is "stormy". Band moves with hysteresis — see apps/api lib/social-weather. */
|
|
102
|
+
band: WeatherBand;
|
|
103
|
+
/** value(now) − value(as of 7 days ago), 3dp; null when either window has no data. */
|
|
104
|
+
trend: number | null;
|
|
105
|
+
/** ISO timestamp of computation (results are cached ~1h server-side). */
|
|
106
|
+
asOf: string;
|
|
107
|
+
}
|
|
108
|
+
export declare const NEIGHBORHOOD_TIE_KINDS: readonly ["follow", "connection", "interaction"];
|
|
109
|
+
export type NeighborhoodTieKind = (typeof NEIGHBORHOOD_TIE_KINDS)[number];
|
|
110
|
+
export interface NeighborhoodTie {
|
|
111
|
+
/** The friend's profile id (= the graph User id). */
|
|
112
|
+
userId: string;
|
|
113
|
+
username: string | null;
|
|
114
|
+
name: string | null;
|
|
115
|
+
avatar: string | null;
|
|
116
|
+
/** Dyadic brightness B(me, them) in [0.15, 1], rounded to 2dp. This is the caller's *tie* warmth —
|
|
117
|
+
* NOT the friend's global S_p, which is never exposed to a member. */
|
|
118
|
+
brightness: number;
|
|
119
|
+
/** Which relationship(s) make this person a tie: a follow, a (mutual) connection, and/or recent
|
|
120
|
+
* interaction. A pair whose only edge is friction never appears (friction isn't structure). */
|
|
121
|
+
tieKinds: NeighborhoodTieKind[];
|
|
122
|
+
}
|
|
123
|
+
export interface SocialNeighborhood {
|
|
124
|
+
/** The caller's ties, brightest-first. */
|
|
125
|
+
ties: NeighborhoodTie[];
|
|
126
|
+
/** The effective tie-set rule for this response: when true, interaction-only ties are included
|
|
127
|
+
* (not just follows/connections). Echoes the resolved query-param-or-project-default so a client
|
|
128
|
+
* can reflect the actual state of its toggle. */
|
|
129
|
+
includesInteractions: boolean;
|
|
130
|
+
/** ISO timestamp of computation. */
|
|
131
|
+
asOf: string;
|
|
132
|
+
}
|
|
133
|
+
export declare const BLOB_SIZE_BUCKETS: readonly ["5–9", "10–19", "20–49", "50–99", "100+"];
|
|
134
|
+
export type BlobSizeBucket = (typeof BLOB_SIZE_BUCKETS)[number];
|
|
135
|
+
export interface ConstellationBlob {
|
|
136
|
+
/** Bucketed member count — coarse on purpose (one of the §12 protections). Never an exact size. */
|
|
137
|
+
size: BlobSizeBucket;
|
|
138
|
+
/** Warmth tint, banded (reuses the Weather band scale). Warmth-only — friction never renders here. */
|
|
139
|
+
warmth: WeatherBand;
|
|
140
|
+
}
|
|
141
|
+
export interface SocialConstellation {
|
|
142
|
+
/** The community's blobs, shuffled — there is NO stable identity or ordering across epochs. Blobs
|
|
143
|
+
* carry no ids, names, or member lists; a cluster smaller than the k-anonymity floor is omitted. */
|
|
144
|
+
blobs: ConstellationBlob[];
|
|
145
|
+
/** ISO timestamp of the materialized snapshot, or null when none has been computed yet ("forming"). */
|
|
146
|
+
asOf: string | null;
|
|
147
|
+
/** Which clustering produced this snapshot (transparency): GDS Louvain, the by-space fallback, or
|
|
148
|
+
* null when not yet materialized. */
|
|
149
|
+
method: "louvain" | "space" | null;
|
|
150
|
+
}
|
|
151
|
+
export declare const SOCIAL_ANALYTICS_REPORTS: readonly ["influence", "silos", "engagement"];
|
|
152
|
+
export type SocialAnalyticsReport = (typeof SOCIAL_ANALYTICS_REPORTS)[number];
|
|
153
|
+
export interface InfluenceMember {
|
|
154
|
+
/** Profile id (= the graph User id). */
|
|
155
|
+
userId: string;
|
|
156
|
+
username: string | null;
|
|
157
|
+
name: string | null;
|
|
158
|
+
avatar: string | null;
|
|
159
|
+
/** GDS PageRank centrality — overall influence across the interaction/structural graph. */
|
|
160
|
+
pageRank: number;
|
|
161
|
+
/** GDS betweenness centrality — how often this person sits on shortest paths (a bridge/broker). */
|
|
162
|
+
betweenness: number;
|
|
163
|
+
}
|
|
164
|
+
export interface SocialInfluence {
|
|
165
|
+
/** Informal leaders, highest PageRank first. */
|
|
166
|
+
leaders: InfluenceMember[];
|
|
167
|
+
/** Bridge people, highest betweenness first. */
|
|
168
|
+
bridges: InfluenceMember[];
|
|
169
|
+
/** ISO timestamp of the materialized snapshot, or null when none has been computed yet. */
|
|
170
|
+
asOf: string | null;
|
|
171
|
+
}
|
|
172
|
+
export interface SiloMember {
|
|
173
|
+
userId: string;
|
|
174
|
+
username: string | null;
|
|
175
|
+
name: string | null;
|
|
176
|
+
avatar: string | null;
|
|
177
|
+
}
|
|
178
|
+
export interface SiloSpace {
|
|
179
|
+
spaceId: string;
|
|
180
|
+
name: string | null;
|
|
181
|
+
/** How many of this silo's members belong to the space — the mapping that labels the cluster. */
|
|
182
|
+
memberCount: number;
|
|
183
|
+
}
|
|
184
|
+
export interface Silo {
|
|
185
|
+
/** Stable only WITHIN a snapshot (the GDS community id); no identity across epochs. */
|
|
186
|
+
id: string;
|
|
187
|
+
/** Exact member count — operator view, no bucketing and no suppression. */
|
|
188
|
+
size: number;
|
|
189
|
+
members: SiloMember[];
|
|
190
|
+
/** The spaces this silo concentrates in, most-represented first — the human label for the cluster. */
|
|
191
|
+
spaces: SiloSpace[];
|
|
192
|
+
}
|
|
193
|
+
export interface SocialSilos {
|
|
194
|
+
silos: Silo[];
|
|
195
|
+
asOf: string | null;
|
|
196
|
+
}
|
|
197
|
+
export declare const CHURN_RISK_BANDS: readonly ["none", "watch", "at-risk"];
|
|
198
|
+
export type ChurnRiskBand = (typeof CHURN_RISK_BANDS)[number];
|
|
199
|
+
export interface EngagementMember {
|
|
200
|
+
userId: string;
|
|
201
|
+
username: string | null;
|
|
202
|
+
name: string | null;
|
|
203
|
+
avatar: string | null;
|
|
204
|
+
/** Current mean inbound brightness S_p (warmth this person receives) — the latest snapshot's value. */
|
|
205
|
+
sP: number;
|
|
206
|
+
/** Trailing per-snapshot S_p series, oldest→newest (one point per weekly epoch in the window). */
|
|
207
|
+
trend: number[];
|
|
208
|
+
/** sP(current) − sP(window start); negative = cooling. */
|
|
209
|
+
delta: number;
|
|
210
|
+
/** Banded churn risk derived from the trend's relative decline over the window. */
|
|
211
|
+
churnRisk: ChurnRiskBand;
|
|
212
|
+
}
|
|
213
|
+
export interface SocialEngagement {
|
|
214
|
+
members: EngagementMember[];
|
|
215
|
+
asOf: string | null;
|
|
216
|
+
}
|
|
217
|
+
export declare const SOCIAL_ANALYTICS_RECOMPUTE_TARGETS: readonly ["influence", "silos", "engagement", "all"];
|
|
218
|
+
export declare const socialAnalyticsRecomputeSchema: z.ZodObject<{
|
|
219
|
+
report: z.ZodOptional<z.ZodNullable<z.ZodEnum<["influence", "silos", "engagement", "all"]>>>;
|
|
220
|
+
}, "strip", z.ZodTypeAny, {
|
|
221
|
+
report?: "influence" | "silos" | "engagement" | "all" | null | undefined;
|
|
222
|
+
}, {
|
|
223
|
+
report?: "influence" | "silos" | "engagement" | "all" | null | undefined;
|
|
224
|
+
}>;
|
|
225
|
+
export type SocialAnalyticsRecompute = z.infer<typeof socialAnalyticsRecomputeSchema>;
|
|
226
|
+
export interface ReadReceiptRecorded {
|
|
227
|
+
recorded: boolean;
|
|
228
|
+
/** ISO timestamp the read was recorded/refreshed. */
|
|
229
|
+
readAt: string;
|
|
230
|
+
}
|
|
231
|
+
export interface ReceiptAnnouncement {
|
|
232
|
+
/** The announcement entity (post) id. */
|
|
233
|
+
entityId: string;
|
|
234
|
+
/** The entity's title, hydrated fresh at read; null when the post has no title. */
|
|
235
|
+
title: string | null;
|
|
236
|
+
/** ISO creation timestamp of the post. */
|
|
237
|
+
createdAt: string;
|
|
238
|
+
/** Distinct active space members who have read this post. */
|
|
239
|
+
readerCount: number;
|
|
240
|
+
/** readerCount / memberCount in [0,1], 2dp — the share of the space that has seen this post. */
|
|
241
|
+
coverage: number;
|
|
242
|
+
}
|
|
243
|
+
export interface ReceiptSpace {
|
|
244
|
+
spaceId: string;
|
|
245
|
+
name: string | null;
|
|
246
|
+
/** Active members of the space — the coverage denominator. */
|
|
247
|
+
memberCount: number;
|
|
248
|
+
/** Recent posts in the space, newest first. */
|
|
249
|
+
announcements: ReceiptAnnouncement[];
|
|
250
|
+
}
|
|
251
|
+
export interface SocialReadReceipts {
|
|
252
|
+
spaces: ReceiptSpace[];
|
|
253
|
+
/** ISO timestamp of the (live) computation. */
|
|
254
|
+
asOf: string;
|
|
255
|
+
}
|
|
256
|
+
/** Coverage = distinct member readers / active members, clamped to [0,1] and rounded to 2dp.
|
|
257
|
+
* Zero members → 0 (no denominator). Pure so it's unit-testable and identical on both sides. */
|
|
258
|
+
export declare function readReceiptCoverage(readerCount: number, memberCount: number): number;
|
|
259
|
+
export declare const readReceiptsToggleSchema: z.ZodObject<{
|
|
260
|
+
enabled: z.ZodBoolean;
|
|
261
|
+
}, "strip", z.ZodTypeAny, {
|
|
262
|
+
enabled: boolean;
|
|
263
|
+
}, {
|
|
264
|
+
enabled: boolean;
|
|
265
|
+
}>;
|
|
266
|
+
export type ReadReceiptsToggle = z.infer<typeof readReceiptsToggleSchema>;
|
|
267
|
+
//# sourceMappingURL=social.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"social.d.ts","sourceRoot":"","sources":["../src/social.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,oBAAoB,qCAAsC,CAAC;AACxE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAItE,eAAO,MAAM,oBAAoB,2IAMvB,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,iBAAiB,CAAC;IAC/B,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,OAAO,CAA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WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,aAAa,EAAE,mBAAmB,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;CACd;AAED;iGACiG;AACjG,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAIpF;AAGD,eAAO,MAAM,wBAAwB;;;;;;EAEnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
package/dist/social.js
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// ── Social graph config (projects.social_config jsonb) ──────────────────────────────────────────
|
|
3
|
+
// The community↔corporate privacy switch — see docs/SOCIAL-GRAPH.md §5 and docs/AGORA-CORP.md §4.
|
|
4
|
+
// The tier selects DEFAULTS; stored keys override within what the tier allows. Two enforcement
|
|
5
|
+
// points, both server-side: forbiddenSocialKeys() rejects disallowed writes (400), and
|
|
6
|
+
// resolveSocialConfig() clamps at read time (defense-in-depth for stale flags left behind by a
|
|
7
|
+
// corporate→community switch). Fail closed: garbage resolves to community defaults.
|
|
8
|
+
export const SOCIAL_PRIVACY_TIERS = ["community", "corporate"];
|
|
9
|
+
// Flags that may only be true under the corporate tier. INVARIANT (docs/AGORA-CORP.md §4): the
|
|
10
|
+
// k-anonymity floor is NOT in this list — no tier relaxes it below 5.
|
|
11
|
+
export const CORPORATE_ONLY_FLAGS = [
|
|
12
|
+
"influenceScoresEnabled",
|
|
13
|
+
"siloDetectionEnabled",
|
|
14
|
+
"engagementScoresEnabled",
|
|
15
|
+
"frictionAnalyticsEnabled",
|
|
16
|
+
"readReceiptsAllowed",
|
|
17
|
+
];
|
|
18
|
+
const COMMUNITY_DEFAULTS = {
|
|
19
|
+
privacyTier: "community",
|
|
20
|
+
graphEnabled: true,
|
|
21
|
+
weatherEnabled: true,
|
|
22
|
+
constellationEnabled: true,
|
|
23
|
+
constellationKFloor: 5,
|
|
24
|
+
neighborhoodEnabled: true,
|
|
25
|
+
neighborhoodIncludeInteractions: false,
|
|
26
|
+
influenceScoresEnabled: false,
|
|
27
|
+
siloDetectionEnabled: false,
|
|
28
|
+
engagementScoresEnabled: false,
|
|
29
|
+
frictionVisibleToStewards: true,
|
|
30
|
+
frictionAnalyticsEnabled: false,
|
|
31
|
+
readAffinityEnabled: true,
|
|
32
|
+
readReceiptsAllowed: false,
|
|
33
|
+
warmthHalfLifeDays: 30,
|
|
34
|
+
frictionHalfLifeDays: 14,
|
|
35
|
+
};
|
|
36
|
+
export const SOCIAL_TIER_DEFAULTS = {
|
|
37
|
+
community: COMMUNITY_DEFAULTS,
|
|
38
|
+
corporate: {
|
|
39
|
+
...COMMUNITY_DEFAULTS,
|
|
40
|
+
privacyTier: "corporate",
|
|
41
|
+
influenceScoresEnabled: true,
|
|
42
|
+
siloDetectionEnabled: true,
|
|
43
|
+
engagementScoresEnabled: true,
|
|
44
|
+
frictionAnalyticsEnabled: true,
|
|
45
|
+
readReceiptsAllowed: true,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
// PATCH body (admin Settings → Social Graph). Every field nullish: omit = leave unchanged,
|
|
49
|
+
// null = clear the override (→ tier default). Mirrors moderatorConfigSchema.
|
|
50
|
+
export const socialConfigSchema = z.object({
|
|
51
|
+
privacyTier: z.enum(SOCIAL_PRIVACY_TIERS).nullish(),
|
|
52
|
+
graphEnabled: z.boolean().nullish(),
|
|
53
|
+
weatherEnabled: z.boolean().nullish(),
|
|
54
|
+
constellationEnabled: z.boolean().nullish(),
|
|
55
|
+
// LOCKSTEP: schema write bounds (5–1000) must stay aligned with resolver read bounds (intIn 1–1000 + Math.max(5)); change both together.
|
|
56
|
+
constellationKFloor: z.number().int().min(5).max(1000).nullish(),
|
|
57
|
+
neighborhoodEnabled: z.boolean().nullish(),
|
|
58
|
+
neighborhoodIncludeInteractions: z.boolean().nullish(),
|
|
59
|
+
influenceScoresEnabled: z.boolean().nullish(),
|
|
60
|
+
siloDetectionEnabled: z.boolean().nullish(),
|
|
61
|
+
engagementScoresEnabled: z.boolean().nullish(),
|
|
62
|
+
frictionVisibleToStewards: z.boolean().nullish(),
|
|
63
|
+
frictionAnalyticsEnabled: z.boolean().nullish(),
|
|
64
|
+
readAffinityEnabled: z.boolean().nullish(),
|
|
65
|
+
readReceiptsAllowed: z.boolean().nullish(),
|
|
66
|
+
warmthHalfLifeDays: z.number().int().min(1).max(365).nullish(),
|
|
67
|
+
frictionHalfLifeDays: z.number().int().min(1).max(365).nullish(),
|
|
68
|
+
});
|
|
69
|
+
/** The tier that results from applying `patch` over the currently-stored tier.
|
|
70
|
+
* `privacyTier: null` in a patch clears the override → community default. */
|
|
71
|
+
export function resultingSocialTier(patch, currentTier) {
|
|
72
|
+
if (patch.privacyTier === null)
|
|
73
|
+
return "community";
|
|
74
|
+
return patch.privacyTier ?? currentTier;
|
|
75
|
+
}
|
|
76
|
+
/** Reject-on-write: keys in `patch` that the RESULTING tier (after applying the patch's own
|
|
77
|
+
* privacyTier, if any) forbids. Empty array = OK. Pass the currently-STORED tier — the
|
|
78
|
+
* current-vs-resulting derivation happens here so call sites can't get it wrong. */
|
|
79
|
+
export function forbiddenSocialKeys(patch, currentTier) {
|
|
80
|
+
const tier = resultingSocialTier(patch, currentTier);
|
|
81
|
+
if (tier === "corporate")
|
|
82
|
+
return [];
|
|
83
|
+
return CORPORATE_ONLY_FLAGS.filter((k) => patch[k] === true);
|
|
84
|
+
}
|
|
85
|
+
const bool = (v, d) => (typeof v === "boolean" ? v : d);
|
|
86
|
+
const intIn = (v, d, min, max) => typeof v === "number" && Number.isInteger(v) && v >= min && v <= max ? v : d;
|
|
87
|
+
/** Clamp-on-read: overlay stored jsonb onto tier defaults, neutralizing anything the tier forbids. */
|
|
88
|
+
export function resolveSocialConfig(raw) {
|
|
89
|
+
const r = (raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {});
|
|
90
|
+
const tier = SOCIAL_PRIVACY_TIERS.includes(r.privacyTier)
|
|
91
|
+
? r.privacyTier
|
|
92
|
+
: "community";
|
|
93
|
+
const d = SOCIAL_TIER_DEFAULTS[tier];
|
|
94
|
+
const cfg = {
|
|
95
|
+
privacyTier: tier,
|
|
96
|
+
graphEnabled: bool(r.graphEnabled, d.graphEnabled),
|
|
97
|
+
weatherEnabled: bool(r.weatherEnabled, d.weatherEnabled),
|
|
98
|
+
constellationEnabled: bool(r.constellationEnabled, d.constellationEnabled),
|
|
99
|
+
// LOCKSTEP: resolver read bounds (1–1000 + Math.max(5)) must stay aligned with schema write bounds (min 5, max 1000); change both together.
|
|
100
|
+
// The k-floor clamps UP only — a stored value below 5 is raised, never honored.
|
|
101
|
+
constellationKFloor: Math.max(5, intIn(r.constellationKFloor, d.constellationKFloor, 1, 1000)),
|
|
102
|
+
neighborhoodEnabled: bool(r.neighborhoodEnabled, d.neighborhoodEnabled),
|
|
103
|
+
neighborhoodIncludeInteractions: bool(r.neighborhoodIncludeInteractions, d.neighborhoodIncludeInteractions),
|
|
104
|
+
influenceScoresEnabled: bool(r.influenceScoresEnabled, d.influenceScoresEnabled),
|
|
105
|
+
siloDetectionEnabled: bool(r.siloDetectionEnabled, d.siloDetectionEnabled),
|
|
106
|
+
engagementScoresEnabled: bool(r.engagementScoresEnabled, d.engagementScoresEnabled),
|
|
107
|
+
frictionVisibleToStewards: bool(r.frictionVisibleToStewards, d.frictionVisibleToStewards),
|
|
108
|
+
frictionAnalyticsEnabled: bool(r.frictionAnalyticsEnabled, d.frictionAnalyticsEnabled),
|
|
109
|
+
readAffinityEnabled: bool(r.readAffinityEnabled, d.readAffinityEnabled),
|
|
110
|
+
readReceiptsAllowed: bool(r.readReceiptsAllowed, d.readReceiptsAllowed),
|
|
111
|
+
warmthHalfLifeDays: intIn(r.warmthHalfLifeDays, d.warmthHalfLifeDays, 1, 365),
|
|
112
|
+
frictionHalfLifeDays: intIn(r.frictionHalfLifeDays, d.frictionHalfLifeDays, 1, 365),
|
|
113
|
+
};
|
|
114
|
+
if (tier === "community") {
|
|
115
|
+
for (const k of CORPORATE_ONLY_FLAGS)
|
|
116
|
+
cfg[k] = false;
|
|
117
|
+
}
|
|
118
|
+
return cfg;
|
|
119
|
+
}
|
|
120
|
+
// ── Community Weather (GET /v7/:projectId/social/weather) ───────────────────────────────────────
|
|
121
|
+
// One aggregate scalar — the only place friction shows publicly, as a dip in collective climate
|
|
122
|
+
// (docs/AGORA-SOCIAL.md §5). Safe to publish per the magnitude-regime theorem: friction big enough
|
|
123
|
+
// to move this number involves too many people to single anyone out.
|
|
124
|
+
export const WEATHER_BANDS = ["quiet", "stormy", "overcast", "fine", "sunny"];
|
|
125
|
+
// ── Neighborhood (GET /v7/:projectId/social/neighborhood) ───────────────────────────────────────
|
|
126
|
+
// The most personal Garden lens (docs/AGORA-SOCIAL.md): zoom to YOURSELF — your own named ties, each
|
|
127
|
+
// rendered with its DYADIC brightness B(me, them). Self-view only. The brightness is *your tie's*
|
|
128
|
+
// warmth, NEVER the friend's global score — the asymmetry rule that closes the friction side-channel
|
|
129
|
+
// (cheat-sheet #6). Friction only DIMS an existing tie (FLOOR-bounded, so dim = friction-or-loneliness,
|
|
130
|
+
// unreadable); it never creates one.
|
|
131
|
+
export const NEIGHBORHOOD_TIE_KINDS = ["follow", "connection", "interaction"];
|
|
132
|
+
// ── Constellation (GET /v7/:projectId/social/constellation) ─────────────────────────────────────
|
|
133
|
+
// The anonymous *shape* of the community (docs/AGORA-SOCIAL.md, §12): cluster blobs — size + warmth
|
|
134
|
+
// tint only, NEVER individual nodes. k-anonymity (clusters below the floor are suppressed), no
|
|
135
|
+
// persistent blob identity (re-clustered fresh each epoch, shuffled), warmth-only (friction never
|
|
136
|
+
// renders as structure). Materialized on a slow seasonal cadence (never per-load — §12), so the read
|
|
137
|
+
// just returns the latest snapshot.
|
|
138
|
+
export const BLOB_SIZE_BUCKETS = ["5–9", "10–19", "20–49", "50–99", "100+"];
|
|
139
|
+
// ── Admin Analytics (corporate tier · operator-only · NAMED) ────────────────────────────────────
|
|
140
|
+
// The corporate counterpart to the Garden (docs/AGORA-CORP.md; docs/SOCIAL-GRAPH.md §7 Phase 4).
|
|
141
|
+
// Unlike the member-facing lenses these NAME real people — the operator is the accountable employer,
|
|
142
|
+
// so the temporal-anonymity protections do NOT apply. Each report is corporate-tier-only, gated by its
|
|
143
|
+
// CORPORATE_ONLY_FLAG (`influenceScoresEnabled` / `siloDetectionEnabled` / `engagementScoresEnabled`),
|
|
144
|
+
// which the community tier forces off. Materialized on a slow (weekly) cadence plus an operator-forced
|
|
145
|
+
// recompute; the reads return the latest snapshot, names hydrated fresh so they never go stale.
|
|
146
|
+
export const SOCIAL_ANALYTICS_REPORTS = ["influence", "silos", "engagement"];
|
|
147
|
+
// Engagement — per-person warmth-RECEIVED (S_p) with a churn-risk trend. GET /admin/social/engagement.
|
|
148
|
+
export const CHURN_RISK_BANDS = ["none", "watch", "at-risk"];
|
|
149
|
+
// POST /admin/social/recompute — operator-forced, synchronous re-materialization. The body selects a
|
|
150
|
+
// single report or "all" (default); the request blocks while GDS runs over the whole graph.
|
|
151
|
+
export const SOCIAL_ANALYTICS_RECOMPUTE_TARGETS = [...SOCIAL_ANALYTICS_REPORTS, "all"];
|
|
152
|
+
export const socialAnalyticsRecomputeSchema = z.object({
|
|
153
|
+
report: z.enum(SOCIAL_ANALYTICS_RECOMPUTE_TARGETS).nullish(),
|
|
154
|
+
});
|
|
155
|
+
/** Coverage = distinct member readers / active members, clamped to [0,1] and rounded to 2dp.
|
|
156
|
+
* Zero members → 0 (no denominator). Pure so it's unit-testable and identical on both sides. */
|
|
157
|
+
export function readReceiptCoverage(readerCount, memberCount) {
|
|
158
|
+
if (memberCount <= 0)
|
|
159
|
+
return 0;
|
|
160
|
+
const c = Math.min(1, Math.max(0, readerCount / memberCount));
|
|
161
|
+
return Math.round(c * 100) / 100;
|
|
162
|
+
}
|
|
163
|
+
// PATCH /admin/social/read-receipts/spaces/:spaceId — operator flips a single space's opt-in.
|
|
164
|
+
export const readReceiptsToggleSchema = z.object({
|
|
165
|
+
enabled: z.boolean(),
|
|
166
|
+
});
|
package/dist/types.d.ts
CHANGED
|
@@ -94,6 +94,8 @@ export interface AuthUser extends User {
|
|
|
94
94
|
}[];
|
|
95
95
|
authMethods: string[];
|
|
96
96
|
isOperator: boolean;
|
|
97
|
+
isProjectOwner: boolean;
|
|
98
|
+
isProjectAdmin: boolean;
|
|
97
99
|
isSteward: boolean;
|
|
98
100
|
}
|
|
99
101
|
export type ReportTargetType = "entity" | "comment" | "message";
|
|
@@ -122,6 +124,8 @@ export interface AuthContext {
|
|
|
122
124
|
userId: string;
|
|
123
125
|
role: "admin" | "moderator" | "visitor";
|
|
124
126
|
isOperator: boolean;
|
|
127
|
+
isProjectOwner: boolean;
|
|
128
|
+
isProjectAdmin: boolean;
|
|
125
129
|
isSteward: boolean;
|
|
126
130
|
}
|
|
127
131
|
export type ModerationVerdict = "allow" | "block" | "review";
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnE,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;IACxC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,E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