@company-semantics/contracts 0.64.0 → 0.66.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@company-semantics/contracts",
3
- "version": "0.64.0",
3
+ "version": "0.66.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/src/index.ts CHANGED
@@ -223,9 +223,24 @@ export type {
223
223
  WorkspaceSettingsOverview,
224
224
  IntegrationRequestStatus,
225
225
  IntegrationRequest,
226
+ // Ownership transfer DTOs (PRD-00153)
227
+ TransferInitiateRequest,
228
+ TransferStatusResponse,
229
+ TransferAcceptanceView,
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,
226
241
  } from './org/index'
227
242
 
228
- export { ROLE_DISPLAY_MAP, WORKSPACE_CAPABILITIES, ROLE_CAPABILITY_MAP, VIEW_SCOPE_MAP, getViewScope } from './org/index'
243
+ 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'
229
244
 
230
245
  // View authorization types (Phase 5 - ADR-APP-013)
231
246
  export type { AuthorizableView } from './org/index'
package/src/org/index.ts CHANGED
@@ -38,9 +38,24 @@ export type {
38
38
  WorkspaceSettingsOverview,
39
39
  IntegrationRequestStatus,
40
40
  IntegrationRequest,
41
+ // Ownership transfer DTOs (PRD-00153)
42
+ TransferInitiateRequest,
43
+ TransferStatusResponse,
44
+ TransferAcceptanceView,
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,
41
56
  } from './types';
42
57
 
43
- export { ROLE_DISPLAY_MAP } from './types';
58
+ export { ROLE_DISPLAY_MAP, TRANSFER_RESPONSIBILITIES, IDENTITY_TRUST_LEVEL_LABELS, MANAGEMENT_TIER_LABELS } from './types';
44
59
 
45
60
  // Workspace capability types (Phase 3)
46
61
  export type { WorkspaceCapability } from './capabilities';
package/src/org/types.ts CHANGED
@@ -386,6 +386,135 @@ export interface WorkspaceSettingsOverview extends WorkspaceInfoOverview {
386
386
  };
387
387
  }
388
388
 
389
+ // =============================================================================
390
+ // Ownership Transfer DTOs (PRD-00153)
391
+ // Rich types for the transfer UI flows, supplementing OwnershipTransferRequest
392
+ // and OwnershipTransferStatus above.
393
+ // =============================================================================
394
+
395
+ /** Request body for initiating ownership transfer (extends existing to include optional note). */
396
+ export interface TransferInitiateRequest {
397
+ readonly newOwnerEmail: string;
398
+ readonly note?: string;
399
+ }
400
+
401
+ /** Response for transfer status queries — extends existing OwnershipTransferStatus. */
402
+ export interface TransferStatusResponse {
403
+ readonly pending: boolean;
404
+ readonly newOwnerEmail?: string;
405
+ readonly note?: string;
406
+ readonly requestedAt?: string;
407
+ readonly expiresAt?: string;
408
+ readonly initiatorName?: string;
409
+ }
410
+
411
+ /** Read-only view for the transfer acceptance page. */
412
+ export interface TransferAcceptanceView {
413
+ readonly workspaceName: string;
414
+ readonly initiatorName: string;
415
+ readonly initiatorEmail: string;
416
+ readonly note?: string;
417
+ readonly expiresAt: string;
418
+ readonly token: string;
419
+ }
420
+
421
+ /** Responsibility checklist items shown on the acceptance page. */
422
+ export const TRANSFER_RESPONSIBILITIES = [
423
+ 'You will become the sole owner of this workspace',
424
+ 'You will be responsible for billing and compliance',
425
+ 'The current owner will be downgraded to admin',
426
+ 'This action cannot be undone without a new transfer',
427
+ ] as const;
428
+
429
+ export type TransferResponsibility = (typeof TRANSFER_RESPONSIBILITIES)[number];
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
+
389
518
  /**
390
519
  * Status of an integration request from a member.
391
520
  */