-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpersona-detection.interface.ts
More file actions
82 lines (69 loc) · 2.06 KB
/
persona-detection.interface.ts
File metadata and controls
82 lines (69 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT
import type { Account } from './account.interface';
import type { PersonaType } from './persona.interface';
export interface PersonaDetectionRequest {
username: string;
email: string;
}
export interface PersonaDetectionResponse {
projects: PersonaDetectionProject[];
error: PersonaDetectionError | null;
}
export interface PersonaDetectionProject {
project_uid: string;
project_slug: string;
detections: PersonaDetection[];
}
export interface PersonaDetection {
source: string;
extra?: Record<string, unknown>;
}
export interface PersonaDetectionError {
code: string;
message: string;
}
export interface EnrichedPersonaProject {
projectUid: string;
projectSlug: string;
projectName: string | null;
parentProjectUid: string | null;
isFoundation: boolean;
logoUrl: string | null;
description: string | null;
detections: PersonaDetection[];
personas: PersonaType[];
}
export interface PersonaProject {
projectUid: string;
projectSlug: string;
projectName: string | null;
}
export interface PersonaDetections {
personaProjects: Partial<Record<PersonaType, PersonaProject[]>>;
personas: PersonaType[];
projects: EnrichedPersonaProject[];
organizations: Account[];
error: string | null;
}
export interface PersonaApiResponse extends PersonaDetections {
/** Writer on the tenant root project — bypasses nav persona filtering. Request-scoped, not cached. */
isRootWriter: boolean;
}
export interface SsrPersonaResult {
persona: PersonaType;
personas: PersonaType[];
organizations?: Account[];
projects?: EnrichedPersonaProject[];
personaProjects?: Partial<Record<PersonaType, PersonaProject[]>>;
}
/** Stores in-flight promise to collapse concurrent lookups. */
export interface AffiliatedProjectUidsCacheEntry {
promise: Promise<string[]>;
expiresAt: number;
}
/** Stores in-flight promise to collapse concurrent lookups. */
export interface PersonaApiResponseCacheEntry {
promise: Promise<PersonaDetections>;
expiresAt: number;
}