@company-semantics/contracts 0.65.0 → 0.67.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/package.json +1 -1
- package/src/index.ts +18 -1
- package/src/org/index.ts +21 -1
- package/src/org/strategy.ts +53 -0
- package/src/org/types.ts +87 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -228,9 +228,26 @@ export type {
|
|
|
228
228
|
TransferStatusResponse,
|
|
229
229
|
TransferAcceptanceView,
|
|
230
230
|
TransferResponsibility,
|
|
231
|
+
// Identity Trust Level types (PRD-00154)
|
|
232
|
+
IdentityTrustLevel,
|
|
233
|
+
TransferEligibilityResult,
|
|
234
|
+
TransferMemberEligibility,
|
|
235
|
+
// Management Tier types (PRD-00155)
|
|
236
|
+
ManagementTier,
|
|
237
|
+
PromotionStatus,
|
|
238
|
+
PromotionRequest,
|
|
239
|
+
PromotionRecord,
|
|
240
|
+
PromotionReadinessResult,
|
|
241
|
+
// Strategy domain types (PRD-00173)
|
|
242
|
+
StrategyVisibility,
|
|
243
|
+
StrategyDocLevel,
|
|
244
|
+
StrategySource,
|
|
245
|
+
StrategyDependency,
|
|
246
|
+
StrategyTreeNode,
|
|
247
|
+
StrategyDoc,
|
|
231
248
|
} from './org/index'
|
|
232
249
|
|
|
233
|
-
export { ROLE_DISPLAY_MAP, WORKSPACE_CAPABILITIES, ROLE_CAPABILITY_MAP, VIEW_SCOPE_MAP, getViewScope, TRANSFER_RESPONSIBILITIES } from './org/index'
|
|
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'
|
|
234
251
|
|
|
235
252
|
// View authorization types (Phase 5 - ADR-APP-013)
|
|
236
253
|
export type { AuthorizableView } from './org/index'
|
package/src/org/index.ts
CHANGED
|
@@ -43,9 +43,19 @@ export type {
|
|
|
43
43
|
TransferStatusResponse,
|
|
44
44
|
TransferAcceptanceView,
|
|
45
45
|
TransferResponsibility,
|
|
46
|
+
// Identity Trust Level types (PRD-00154)
|
|
47
|
+
IdentityTrustLevel,
|
|
48
|
+
TransferEligibilityResult,
|
|
49
|
+
TransferMemberEligibility,
|
|
50
|
+
// Management Tier types (PRD-00155)
|
|
51
|
+
ManagementTier,
|
|
52
|
+
PromotionStatus,
|
|
53
|
+
PromotionRequest,
|
|
54
|
+
PromotionRecord,
|
|
55
|
+
PromotionReadinessResult,
|
|
46
56
|
} from './types';
|
|
47
57
|
|
|
48
|
-
export { ROLE_DISPLAY_MAP, TRANSFER_RESPONSIBILITIES } from './types';
|
|
58
|
+
export { ROLE_DISPLAY_MAP, TRANSFER_RESPONSIBILITIES, IDENTITY_TRUST_LEVEL_LABELS, MANAGEMENT_TIER_LABELS } from './types';
|
|
49
59
|
|
|
50
60
|
// Workspace capability types (Phase 3)
|
|
51
61
|
export type { WorkspaceCapability } from './capabilities';
|
|
@@ -62,3 +72,13 @@ export type {
|
|
|
62
72
|
// View authorization scopes (Phase 5 - ADR-APP-013)
|
|
63
73
|
export type { AuthorizableView } from './view-scopes';
|
|
64
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
|
+
}
|
package/src/org/types.ts
CHANGED
|
@@ -428,6 +428,93 @@ export const TRANSFER_RESPONSIBILITIES = [
|
|
|
428
428
|
|
|
429
429
|
export type TransferResponsibility = (typeof TRANSFER_RESPONSIBILITIES)[number];
|
|
430
430
|
|
|
431
|
+
// =============================================================================
|
|
432
|
+
// Identity Trust Level Types (PRD-00154)
|
|
433
|
+
// Org identity posture for ownership transfer constraints.
|
|
434
|
+
// =============================================================================
|
|
435
|
+
|
|
436
|
+
/** Identity Trust Level — org's identity posture */
|
|
437
|
+
export type IdentityTrustLevel = 'ITL_0' | 'ITL_1' | 'ITL_2';
|
|
438
|
+
|
|
439
|
+
export const IDENTITY_TRUST_LEVEL_LABELS: Record<IdentityTrustLevel, string> = {
|
|
440
|
+
ITL_0: 'No verified domains',
|
|
441
|
+
ITL_1: 'Domain verified',
|
|
442
|
+
ITL_2: 'SSO enforced',
|
|
443
|
+
} as const;
|
|
444
|
+
|
|
445
|
+
/** Transfer eligibility result with ITL context */
|
|
446
|
+
export interface TransferEligibilityResult {
|
|
447
|
+
readonly eligible: boolean;
|
|
448
|
+
readonly itl: IdentityTrustLevel;
|
|
449
|
+
readonly reason?: string;
|
|
450
|
+
readonly domainRequired?: boolean;
|
|
451
|
+
readonly ssoRequired?: boolean;
|
|
452
|
+
readonly lockoutRisk?: boolean;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/** Per-member eligibility for transfer recipient picker */
|
|
456
|
+
export interface TransferMemberEligibility {
|
|
457
|
+
readonly userId: string;
|
|
458
|
+
readonly email: string;
|
|
459
|
+
readonly fullName?: string;
|
|
460
|
+
readonly eligible: boolean;
|
|
461
|
+
readonly reason?: string;
|
|
462
|
+
readonly ssoLinked: boolean;
|
|
463
|
+
readonly domainMatch: boolean;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
// =============================================================================
|
|
467
|
+
// Management Tier Types (PRD-00155)
|
|
468
|
+
// Workspace governance level and promotion ceremony vocabulary.
|
|
469
|
+
// =============================================================================
|
|
470
|
+
|
|
471
|
+
/** Workspace governance level */
|
|
472
|
+
export type ManagementTier = 'grassroots' | 'company_managed';
|
|
473
|
+
|
|
474
|
+
export const MANAGEMENT_TIER_LABELS: Record<ManagementTier, { label: string; description: string }> = {
|
|
475
|
+
grassroots: {
|
|
476
|
+
label: 'Community workspace',
|
|
477
|
+
description: 'Community-originated workspace with no special governance constraints.',
|
|
478
|
+
},
|
|
479
|
+
company_managed: {
|
|
480
|
+
label: 'Company-managed workspace',
|
|
481
|
+
description: 'Domain verified, SSO enforced, ownership formally established.',
|
|
482
|
+
},
|
|
483
|
+
} as const;
|
|
484
|
+
|
|
485
|
+
/** Wizard progress tracking */
|
|
486
|
+
export type PromotionStatus = 'not_started' | 'in_progress' | 'completed';
|
|
487
|
+
|
|
488
|
+
/** Promotion ceremony state */
|
|
489
|
+
export interface PromotionRequest {
|
|
490
|
+
readonly orgId: string;
|
|
491
|
+
readonly promotedBy: string;
|
|
492
|
+
readonly ownershipConfirmed: boolean;
|
|
493
|
+
readonly domainVerified: boolean;
|
|
494
|
+
readonly ssoConfigured: boolean;
|
|
495
|
+
readonly responsibilityAcknowledged: boolean;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/** Audit record for completed promotion */
|
|
499
|
+
export interface PromotionRecord {
|
|
500
|
+
readonly orgId: string;
|
|
501
|
+
readonly promotedAt: string;
|
|
502
|
+
readonly promotedBy: string;
|
|
503
|
+
readonly previousTier: ManagementTier;
|
|
504
|
+
readonly newTier: ManagementTier;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/** Readiness check output */
|
|
508
|
+
export interface PromotionReadinessResult {
|
|
509
|
+
readonly ready: boolean;
|
|
510
|
+
readonly checks: ReadonlyArray<{
|
|
511
|
+
readonly id: string;
|
|
512
|
+
readonly label: string;
|
|
513
|
+
readonly passed: boolean;
|
|
514
|
+
readonly reason?: string;
|
|
515
|
+
}>;
|
|
516
|
+
}
|
|
517
|
+
|
|
431
518
|
/**
|
|
432
519
|
* Status of an integration request from a member.
|
|
433
520
|
*/
|