@company-semantics/contracts 0.63.0 → 0.65.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 +6 -1
- package/src/org/types.ts +42 -0
- package/src/usage/types.ts +55 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -223,9 +223,14 @@ 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,
|
|
226
231
|
} from './org/index'
|
|
227
232
|
|
|
228
|
-
export { ROLE_DISPLAY_MAP, WORKSPACE_CAPABILITIES, ROLE_CAPABILITY_MAP, VIEW_SCOPE_MAP, getViewScope } from './org/index'
|
|
233
|
+
export { ROLE_DISPLAY_MAP, WORKSPACE_CAPABILITIES, ROLE_CAPABILITY_MAP, VIEW_SCOPE_MAP, getViewScope, TRANSFER_RESPONSIBILITIES } from './org/index'
|
|
229
234
|
|
|
230
235
|
// View authorization types (Phase 5 - ADR-APP-013)
|
|
231
236
|
export type { AuthorizableView } from './org/index'
|
|
@@ -414,3 +419,15 @@ export type {
|
|
|
414
419
|
} from './impersonation'
|
|
415
420
|
|
|
416
421
|
export { RESTRICTED_IMPERSONATION_ACTIONS } from './impersonation'
|
|
422
|
+
|
|
423
|
+
// Usage tracking types (internal admin)
|
|
424
|
+
// @see PRD-00166 for design rationale
|
|
425
|
+
export type {
|
|
426
|
+
AiFeature,
|
|
427
|
+
UsageSummary,
|
|
428
|
+
DailyUsage,
|
|
429
|
+
UsageByModel,
|
|
430
|
+
UsageByFeature,
|
|
431
|
+
UsageByUser,
|
|
432
|
+
OrgUsageResponse,
|
|
433
|
+
} from './usage/types'
|
package/src/org/index.ts
CHANGED
|
@@ -38,9 +38,14 @@ 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,
|
|
41
46
|
} from './types';
|
|
42
47
|
|
|
43
|
-
export { ROLE_DISPLAY_MAP } from './types';
|
|
48
|
+
export { ROLE_DISPLAY_MAP, TRANSFER_RESPONSIBILITIES } from './types';
|
|
44
49
|
|
|
45
50
|
// Workspace capability types (Phase 3)
|
|
46
51
|
export type { WorkspaceCapability } from './capabilities';
|
package/src/org/types.ts
CHANGED
|
@@ -386,6 +386,48 @@ 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
|
+
|
|
389
431
|
/**
|
|
390
432
|
* Status of an integration request from a member.
|
|
391
433
|
*/
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Usage Tracking Types (v1)
|
|
3
|
+
* Internal admin usage visibility. Not org-facing in v1.
|
|
4
|
+
* See PRD-00166 for design rationale and invariants.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export type AiFeature = 'chat' | 'chat_title' | 'ingest_summarize' | 'ingest_embedding';
|
|
8
|
+
|
|
9
|
+
export interface UsageSummary {
|
|
10
|
+
totalTokens: number;
|
|
11
|
+
totalInputTokens: number;
|
|
12
|
+
totalOutputTokens: number;
|
|
13
|
+
estimatedCostUsd: string;
|
|
14
|
+
requestCount: number;
|
|
15
|
+
periodStart: string; // UTC ISO8601
|
|
16
|
+
periodEnd: string; // UTC ISO8601
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface DailyUsage {
|
|
20
|
+
date: string; // YYYY-MM-DD
|
|
21
|
+
totalTokens: number;
|
|
22
|
+
estimatedCostUsd: string;
|
|
23
|
+
requestCount: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface UsageByModel {
|
|
27
|
+
model: string;
|
|
28
|
+
provider: string;
|
|
29
|
+
totalTokens: number;
|
|
30
|
+
estimatedCostUsd: string;
|
|
31
|
+
requestCount: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface UsageByFeature {
|
|
35
|
+
feature: AiFeature;
|
|
36
|
+
totalTokens: number;
|
|
37
|
+
estimatedCostUsd: string;
|
|
38
|
+
requestCount: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface UsageByUser {
|
|
42
|
+
userId: string;
|
|
43
|
+
email: string;
|
|
44
|
+
totalTokens: number;
|
|
45
|
+
estimatedCostUsd: string;
|
|
46
|
+
requestCount: number;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface OrgUsageResponse {
|
|
50
|
+
summary: UsageSummary;
|
|
51
|
+
daily: DailyUsage[];
|
|
52
|
+
byModel: UsageByModel[];
|
|
53
|
+
byFeature: UsageByFeature[];
|
|
54
|
+
topUsers: UsageByUser[];
|
|
55
|
+
}
|