@company-semantics/contracts 0.33.0 → 0.34.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 +10 -0
- package/src/org/README.md +25 -0
- package/src/org/index.ts +14 -0
- package/src/org/types.ts +49 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -112,6 +112,16 @@ export { deriveFullName, resolveDisplayName } from './identity/index'
|
|
|
112
112
|
// Auth domain types
|
|
113
113
|
export { OTPErrorCode } from './auth/index'
|
|
114
114
|
|
|
115
|
+
// Organization domain types
|
|
116
|
+
// @see ADR-BE-XXX for design rationale (Personal vs Shared Organization Model)
|
|
117
|
+
export type {
|
|
118
|
+
OrgType,
|
|
119
|
+
ExecutionScope,
|
|
120
|
+
OrganizationInfo,
|
|
121
|
+
OwnershipTransferRequest,
|
|
122
|
+
OwnershipTransferStatus,
|
|
123
|
+
} from './org/index'
|
|
124
|
+
|
|
115
125
|
// MCP tool discovery types
|
|
116
126
|
// @see company-semantics-backend/src/interfaces/mcp/ for implementation
|
|
117
127
|
export type {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# org/
|
|
2
|
+
|
|
3
|
+
Organization domain vocabulary types for the personal → shared organization model.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Shared type vocabulary for organization ownership, type classification, and transfer workflows.
|
|
8
|
+
|
|
9
|
+
## Invariants
|
|
10
|
+
|
|
11
|
+
- `OrgType` and `ExecutionScope` are exhaustive union types (no 'unknown' or catch-all)
|
|
12
|
+
- All types are vocabulary-only (no runtime behavior, no business logic)
|
|
13
|
+
- Structural details (like `ownerUserId`) remain in backend; only public-facing fields here
|
|
14
|
+
|
|
15
|
+
## Public API
|
|
16
|
+
|
|
17
|
+
- `OrgType` - 'personal' | 'shared' organization classification
|
|
18
|
+
- `ExecutionScope` - 'self' | 'org' execution identity scope
|
|
19
|
+
- `OrganizationInfo` - Public organization details for API responses
|
|
20
|
+
- `OwnershipTransferRequest` - Transfer initiation payload
|
|
21
|
+
- `OwnershipTransferStatus` - Pending transfer status
|
|
22
|
+
|
|
23
|
+
## Dependencies
|
|
24
|
+
|
|
25
|
+
None. This is a leaf vocabulary module.
|
package/src/org/index.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Organization Types Barrel
|
|
3
|
+
*
|
|
4
|
+
* Re-exports organization vocabulary types.
|
|
5
|
+
* Import from '@company-semantics/contracts' (root).
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export type {
|
|
9
|
+
OrgType,
|
|
10
|
+
ExecutionScope,
|
|
11
|
+
OrganizationInfo,
|
|
12
|
+
OwnershipTransferRequest,
|
|
13
|
+
OwnershipTransferStatus,
|
|
14
|
+
} from './types';
|
package/src/org/types.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Organization Types
|
|
3
|
+
*
|
|
4
|
+
* Vocabulary types for the personal → shared organization model.
|
|
5
|
+
* @see ADR-BE-XXX (Personal vs Shared Organization Model)
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Organization type distinguishes personal workspaces from shared organizations.
|
|
10
|
+
* - 'personal': Single-user workspace, owned by creator, claimable
|
|
11
|
+
* - 'shared': Multi-user organization, owned by one user, not claimable
|
|
12
|
+
*/
|
|
13
|
+
export type OrgType = 'personal' | 'shared';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Execution scope determines whose identity is used when executing actions.
|
|
17
|
+
* - 'self': Actions execute under the connecting user's identity only
|
|
18
|
+
* - 'org': Actions execute on behalf of the organization (shared access)
|
|
19
|
+
*/
|
|
20
|
+
export type ExecutionScope = 'self' | 'org';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Public organization information suitable for API responses.
|
|
24
|
+
* Does not include sensitive fields like ownerUserId.
|
|
25
|
+
*/
|
|
26
|
+
export interface OrganizationInfo {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
slug: string;
|
|
30
|
+
type: OrgType;
|
|
31
|
+
claimable: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Request payload for initiating ownership transfer.
|
|
36
|
+
*/
|
|
37
|
+
export interface OwnershipTransferRequest {
|
|
38
|
+
newOwnerEmail: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Status of pending ownership transfer for an organization.
|
|
43
|
+
*/
|
|
44
|
+
export interface OwnershipTransferStatus {
|
|
45
|
+
pending: boolean;
|
|
46
|
+
newOwnerEmail?: string;
|
|
47
|
+
requestedAt?: string;
|
|
48
|
+
expiresAt?: string;
|
|
49
|
+
}
|