@company-semantics/contracts 0.66.0 → 0.67.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/package.json +1 -1
- package/src/impersonation-events.ts +54 -0
- package/src/index.ts +17 -0
- package/src/org/index.ts +10 -0
- package/src/org/strategy.ts +53 -0
package/package.json
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Impersonation SSE Event Types
|
|
3
|
+
*
|
|
4
|
+
* Real-time push events for impersonation session state changes.
|
|
5
|
+
* Replaces 30-second polling mechanism.
|
|
6
|
+
* Follows the same BaseEvent envelope pattern as chat SSE events.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { BaseEvent } from './chat/types'
|
|
10
|
+
import type { ImpersonationSession } from './impersonation'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Sent as the first frame on SSE connection.
|
|
14
|
+
* Carries the current active session (or null if none).
|
|
15
|
+
* Eliminates need for a separate GET /session request.
|
|
16
|
+
*/
|
|
17
|
+
export interface ImpersonationSessionSnapshotEvent extends BaseEvent {
|
|
18
|
+
type: 'impersonation.session.snapshot'
|
|
19
|
+
data: {
|
|
20
|
+
session: ImpersonationSession | null
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Emitted when a new impersonation session starts (enables multi-tab sync). */
|
|
25
|
+
export interface ImpersonationSessionStartedEvent extends BaseEvent {
|
|
26
|
+
type: 'impersonation.session.started'
|
|
27
|
+
data: {
|
|
28
|
+
session: ImpersonationSession
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Emitted when an admin manually ends an impersonation session. */
|
|
33
|
+
export interface ImpersonationSessionEndedEvent extends BaseEvent {
|
|
34
|
+
type: 'impersonation.session.ended'
|
|
35
|
+
data: {
|
|
36
|
+
sessionId: string
|
|
37
|
+
endedAt: string
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Emitted when enforceExpiry() auto-expires a session. */
|
|
42
|
+
export interface ImpersonationSessionExpiredEvent extends BaseEvent {
|
|
43
|
+
type: 'impersonation.session.expired'
|
|
44
|
+
data: {
|
|
45
|
+
sessionId: string
|
|
46
|
+
expiredAt: string
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type ImpersonationSseEvent =
|
|
51
|
+
| ImpersonationSessionSnapshotEvent
|
|
52
|
+
| ImpersonationSessionStartedEvent
|
|
53
|
+
| ImpersonationSessionEndedEvent
|
|
54
|
+
| ImpersonationSessionExpiredEvent
|
package/src/index.ts
CHANGED
|
@@ -238,6 +238,13 @@ export type {
|
|
|
238
238
|
PromotionRequest,
|
|
239
239
|
PromotionRecord,
|
|
240
240
|
PromotionReadinessResult,
|
|
241
|
+
// Strategy domain types (PRD-00173)
|
|
242
|
+
StrategyVisibility,
|
|
243
|
+
StrategyDocLevel,
|
|
244
|
+
StrategySource,
|
|
245
|
+
StrategyDependency,
|
|
246
|
+
StrategyTreeNode,
|
|
247
|
+
StrategyDoc,
|
|
241
248
|
} from './org/index'
|
|
242
249
|
|
|
243
250
|
export { ROLE_DISPLAY_MAP, WORKSPACE_CAPABILITIES, ROLE_CAPABILITY_MAP, VIEW_SCOPE_MAP, getViewScope, TRANSFER_RESPONSIBILITIES, IDENTITY_TRUST_LEVEL_LABELS, MANAGEMENT_TIER_LABELS } from './org/index'
|
|
@@ -430,6 +437,16 @@ export type {
|
|
|
430
437
|
|
|
431
438
|
export { RESTRICTED_IMPERSONATION_ACTIONS } from './impersonation'
|
|
432
439
|
|
|
440
|
+
// Impersonation SSE event types (real-time push)
|
|
441
|
+
// @see PRD-00176 for design rationale
|
|
442
|
+
export type {
|
|
443
|
+
ImpersonationSessionSnapshotEvent,
|
|
444
|
+
ImpersonationSessionStartedEvent,
|
|
445
|
+
ImpersonationSessionEndedEvent,
|
|
446
|
+
ImpersonationSessionExpiredEvent,
|
|
447
|
+
ImpersonationSseEvent,
|
|
448
|
+
} from './impersonation-events'
|
|
449
|
+
|
|
433
450
|
// Usage tracking types (internal admin)
|
|
434
451
|
// @see PRD-00166 for design rationale
|
|
435
452
|
export type {
|
package/src/org/index.ts
CHANGED
|
@@ -72,3 +72,13 @@ export type {
|
|
|
72
72
|
// View authorization scopes (Phase 5 - ADR-APP-013)
|
|
73
73
|
export type { AuthorizableView } from './view-scopes';
|
|
74
74
|
export { VIEW_SCOPE_MAP, getViewScope } from './view-scopes';
|
|
75
|
+
|
|
76
|
+
// Strategy domain types (PRD-00173)
|
|
77
|
+
export type {
|
|
78
|
+
StrategyVisibility,
|
|
79
|
+
StrategyDocLevel,
|
|
80
|
+
StrategySource,
|
|
81
|
+
StrategyDependency,
|
|
82
|
+
StrategyTreeNode,
|
|
83
|
+
StrategyDoc,
|
|
84
|
+
} from './strategy';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strategy Domain Types
|
|
3
|
+
*
|
|
4
|
+
* Vocabulary types for the Company.md strategy feature.
|
|
5
|
+
* Shared between backend (persistence/service) and app (UI rendering).
|
|
6
|
+
* @see PRD-00173 for design rationale
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export type StrategyVisibility = 'public' | 'private';
|
|
10
|
+
|
|
11
|
+
export type StrategyDocLevel = 'root' | 'department';
|
|
12
|
+
|
|
13
|
+
export interface StrategySource {
|
|
14
|
+
readonly label: string;
|
|
15
|
+
readonly sourceType: 'meeting' | 'document' | 'conversation' | 'manual';
|
|
16
|
+
readonly referencedAt: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface StrategyDependency {
|
|
20
|
+
readonly targetSlug: string;
|
|
21
|
+
readonly description: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface StrategyTreeNode {
|
|
25
|
+
readonly id: string;
|
|
26
|
+
readonly slug: string;
|
|
27
|
+
readonly title: string;
|
|
28
|
+
readonly level: StrategyDocLevel;
|
|
29
|
+
readonly department: string | null;
|
|
30
|
+
readonly visibility: StrategyVisibility;
|
|
31
|
+
readonly canEdit: boolean;
|
|
32
|
+
readonly memberCount: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface StrategyDoc {
|
|
36
|
+
readonly id: string;
|
|
37
|
+
readonly slug: string;
|
|
38
|
+
readonly title: string;
|
|
39
|
+
readonly level: StrategyDocLevel;
|
|
40
|
+
readonly department: string | null;
|
|
41
|
+
readonly content: string;
|
|
42
|
+
readonly visibility: StrategyVisibility;
|
|
43
|
+
readonly parentId: string | null;
|
|
44
|
+
readonly owner: { readonly id: string; readonly name: string } | null;
|
|
45
|
+
readonly coOwners: ReadonlyArray<{ readonly id: string; readonly name: string }>;
|
|
46
|
+
readonly canEdit: boolean;
|
|
47
|
+
readonly inheritsFrom: string | null;
|
|
48
|
+
readonly sources: readonly StrategySource[];
|
|
49
|
+
readonly dependencies: readonly StrategyDependency[];
|
|
50
|
+
readonly members: ReadonlyArray<{ readonly id: string; readonly name: string }>;
|
|
51
|
+
readonly createdAt: string;
|
|
52
|
+
readonly updatedAt: string;
|
|
53
|
+
}
|