@company-semantics/contracts 0.148.0 → 1.0.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/api/generated-spec-hash.ts +2 -2
- package/src/api/generated.ts +5 -726
- package/src/content/index.ts +1 -9
- package/src/content/schemas.ts +6 -106
- package/src/index.ts +0 -7
- package/src/org/company-md.ts +3 -17
- package/src/org/index.ts +0 -21
- package/src/org/sharing.ts +8 -8
- package/src/org/departments.ts +0 -47
- package/src/org/teams.ts +0 -47
package/package.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// AUTO-GENERATED — do not edit. Run pnpm generate:spec-hash to regenerate.
|
|
2
|
-
export const SPEC_HASH = '
|
|
3
|
-
export const SPEC_HASH_FULL = '
|
|
2
|
+
export const SPEC_HASH = 'af4199988265' as const;
|
|
3
|
+
export const SPEC_HASH_FULL = 'af4199988265ad0b2a80b107680fa1bbd60043ebcc0ccad9b9245f9a0358f661' as const;
|
package/src/api/generated.ts
CHANGED
|
@@ -1433,200 +1433,6 @@ export interface paths {
|
|
|
1433
1433
|
patch?: never;
|
|
1434
1434
|
trace?: never;
|
|
1435
1435
|
};
|
|
1436
|
-
"/api/teams": {
|
|
1437
|
-
parameters: {
|
|
1438
|
-
query?: never;
|
|
1439
|
-
header?: never;
|
|
1440
|
-
path?: never;
|
|
1441
|
-
cookie?: never;
|
|
1442
|
-
};
|
|
1443
|
-
/** List teams */
|
|
1444
|
-
get: operations["listTeams"];
|
|
1445
|
-
put?: never;
|
|
1446
|
-
/** Create team */
|
|
1447
|
-
post: operations["createTeam"];
|
|
1448
|
-
delete?: never;
|
|
1449
|
-
options?: never;
|
|
1450
|
-
head?: never;
|
|
1451
|
-
patch?: never;
|
|
1452
|
-
trace?: never;
|
|
1453
|
-
};
|
|
1454
|
-
"/api/teams/{teamId}": {
|
|
1455
|
-
parameters: {
|
|
1456
|
-
query?: never;
|
|
1457
|
-
header?: never;
|
|
1458
|
-
path?: never;
|
|
1459
|
-
cookie?: never;
|
|
1460
|
-
};
|
|
1461
|
-
/** Get team */
|
|
1462
|
-
get: operations["getTeam"];
|
|
1463
|
-
/** Update team */
|
|
1464
|
-
put: operations["updateTeam"];
|
|
1465
|
-
post?: never;
|
|
1466
|
-
/** Delete team */
|
|
1467
|
-
delete: operations["deleteTeam"];
|
|
1468
|
-
options?: never;
|
|
1469
|
-
head?: never;
|
|
1470
|
-
patch?: never;
|
|
1471
|
-
trace?: never;
|
|
1472
|
-
};
|
|
1473
|
-
"/api/teams/{teamId}/order": {
|
|
1474
|
-
parameters: {
|
|
1475
|
-
query?: never;
|
|
1476
|
-
header?: never;
|
|
1477
|
-
path?: never;
|
|
1478
|
-
cookie?: never;
|
|
1479
|
-
};
|
|
1480
|
-
get?: never;
|
|
1481
|
-
put?: never;
|
|
1482
|
-
post?: never;
|
|
1483
|
-
delete?: never;
|
|
1484
|
-
options?: never;
|
|
1485
|
-
head?: never;
|
|
1486
|
-
/** Set order key for a single team */
|
|
1487
|
-
patch: operations["reorderTeamItem"];
|
|
1488
|
-
trace?: never;
|
|
1489
|
-
};
|
|
1490
|
-
"/api/teams/{teamId}/members": {
|
|
1491
|
-
parameters: {
|
|
1492
|
-
query?: never;
|
|
1493
|
-
header?: never;
|
|
1494
|
-
path?: never;
|
|
1495
|
-
cookie?: never;
|
|
1496
|
-
};
|
|
1497
|
-
get?: never;
|
|
1498
|
-
put?: never;
|
|
1499
|
-
/** Add team member */
|
|
1500
|
-
post: operations["addTeamMember"];
|
|
1501
|
-
delete?: never;
|
|
1502
|
-
options?: never;
|
|
1503
|
-
head?: never;
|
|
1504
|
-
patch?: never;
|
|
1505
|
-
trace?: never;
|
|
1506
|
-
};
|
|
1507
|
-
"/api/teams/{teamId}/members/{userId}": {
|
|
1508
|
-
parameters: {
|
|
1509
|
-
query?: never;
|
|
1510
|
-
header?: never;
|
|
1511
|
-
path?: never;
|
|
1512
|
-
cookie?: never;
|
|
1513
|
-
};
|
|
1514
|
-
get?: never;
|
|
1515
|
-
put?: never;
|
|
1516
|
-
post?: never;
|
|
1517
|
-
/** Remove team member */
|
|
1518
|
-
delete: operations["removeTeamMember"];
|
|
1519
|
-
options?: never;
|
|
1520
|
-
head?: never;
|
|
1521
|
-
patch?: never;
|
|
1522
|
-
trace?: never;
|
|
1523
|
-
};
|
|
1524
|
-
"/api/teams/{teamId}/members/{userId}/role": {
|
|
1525
|
-
parameters: {
|
|
1526
|
-
query?: never;
|
|
1527
|
-
header?: never;
|
|
1528
|
-
path?: never;
|
|
1529
|
-
cookie?: never;
|
|
1530
|
-
};
|
|
1531
|
-
get?: never;
|
|
1532
|
-
/** Update team member role */
|
|
1533
|
-
put: operations["updateTeamMemberRole"];
|
|
1534
|
-
post?: never;
|
|
1535
|
-
delete?: never;
|
|
1536
|
-
options?: never;
|
|
1537
|
-
head?: never;
|
|
1538
|
-
patch?: never;
|
|
1539
|
-
trace?: never;
|
|
1540
|
-
};
|
|
1541
|
-
"/api/departments": {
|
|
1542
|
-
parameters: {
|
|
1543
|
-
query?: never;
|
|
1544
|
-
header?: never;
|
|
1545
|
-
path?: never;
|
|
1546
|
-
cookie?: never;
|
|
1547
|
-
};
|
|
1548
|
-
/** List departments */
|
|
1549
|
-
get: operations["listDepartments"];
|
|
1550
|
-
put?: never;
|
|
1551
|
-
/** Create department */
|
|
1552
|
-
post: operations["createDepartment"];
|
|
1553
|
-
delete?: never;
|
|
1554
|
-
options?: never;
|
|
1555
|
-
head?: never;
|
|
1556
|
-
patch?: never;
|
|
1557
|
-
trace?: never;
|
|
1558
|
-
};
|
|
1559
|
-
"/api/departments/{id}": {
|
|
1560
|
-
parameters: {
|
|
1561
|
-
query?: never;
|
|
1562
|
-
header?: never;
|
|
1563
|
-
path?: never;
|
|
1564
|
-
cookie?: never;
|
|
1565
|
-
};
|
|
1566
|
-
/** Get department */
|
|
1567
|
-
get: operations["getDepartment"];
|
|
1568
|
-
put?: never;
|
|
1569
|
-
post?: never;
|
|
1570
|
-
/** Delete department */
|
|
1571
|
-
delete: operations["deleteDepartment"];
|
|
1572
|
-
options?: never;
|
|
1573
|
-
head?: never;
|
|
1574
|
-
/** Update department */
|
|
1575
|
-
patch: operations["updateDepartment"];
|
|
1576
|
-
trace?: never;
|
|
1577
|
-
};
|
|
1578
|
-
"/api/departments/{id}/order": {
|
|
1579
|
-
parameters: {
|
|
1580
|
-
query?: never;
|
|
1581
|
-
header?: never;
|
|
1582
|
-
path?: never;
|
|
1583
|
-
cookie?: never;
|
|
1584
|
-
};
|
|
1585
|
-
get?: never;
|
|
1586
|
-
put?: never;
|
|
1587
|
-
post?: never;
|
|
1588
|
-
delete?: never;
|
|
1589
|
-
options?: never;
|
|
1590
|
-
head?: never;
|
|
1591
|
-
/** Set order key for a single department */
|
|
1592
|
-
patch: operations["reorderDepartmentItem"];
|
|
1593
|
-
trace?: never;
|
|
1594
|
-
};
|
|
1595
|
-
"/api/departments/{id}/members": {
|
|
1596
|
-
parameters: {
|
|
1597
|
-
query?: never;
|
|
1598
|
-
header?: never;
|
|
1599
|
-
path?: never;
|
|
1600
|
-
cookie?: never;
|
|
1601
|
-
};
|
|
1602
|
-
/** List department members */
|
|
1603
|
-
get: operations["listDepartmentMembers"];
|
|
1604
|
-
put?: never;
|
|
1605
|
-
/** Add department member */
|
|
1606
|
-
post: operations["addDepartmentMember"];
|
|
1607
|
-
delete?: never;
|
|
1608
|
-
options?: never;
|
|
1609
|
-
head?: never;
|
|
1610
|
-
patch?: never;
|
|
1611
|
-
trace?: never;
|
|
1612
|
-
};
|
|
1613
|
-
"/api/departments/{id}/members/{userId}": {
|
|
1614
|
-
parameters: {
|
|
1615
|
-
query?: never;
|
|
1616
|
-
header?: never;
|
|
1617
|
-
path?: never;
|
|
1618
|
-
cookie?: never;
|
|
1619
|
-
};
|
|
1620
|
-
get?: never;
|
|
1621
|
-
put?: never;
|
|
1622
|
-
post?: never;
|
|
1623
|
-
/** Remove department member */
|
|
1624
|
-
delete: operations["removeDepartmentMember"];
|
|
1625
|
-
options?: never;
|
|
1626
|
-
head?: never;
|
|
1627
|
-
patch?: never;
|
|
1628
|
-
trace?: never;
|
|
1629
|
-
};
|
|
1630
1436
|
"/api/org-units": {
|
|
1631
1437
|
parameters: {
|
|
1632
1438
|
query?: never;
|
|
@@ -2935,20 +2741,14 @@ export interface components {
|
|
|
2935
2741
|
/** @enum {string} */
|
|
2936
2742
|
level: "root" | "department" | "team" | "context";
|
|
2937
2743
|
parentId: string | null;
|
|
2938
|
-
department: string | null;
|
|
2939
|
-
departmentId: string | null;
|
|
2940
2744
|
/** @enum {string} */
|
|
2941
2745
|
visibility: "public" | "private";
|
|
2942
|
-
|
|
2943
|
-
id: string;
|
|
2944
|
-
name: string;
|
|
2945
|
-
} | null;
|
|
2746
|
+
owningUnitId: string | null;
|
|
2946
2747
|
/** @enum {string} */
|
|
2947
2748
|
type: "company" | "department" | "team" | "cross_team" | "doc" | "goal" | "source" | "map" | "context_bank";
|
|
2948
2749
|
canEdit: boolean;
|
|
2949
2750
|
memberCount: number;
|
|
2950
2751
|
description?: string;
|
|
2951
|
-
departmentIds?: string[];
|
|
2952
2752
|
orderKey?: string;
|
|
2953
2753
|
}[];
|
|
2954
2754
|
nextCursor: string | null;
|
|
@@ -2960,16 +2760,11 @@ export interface components {
|
|
|
2960
2760
|
title: string;
|
|
2961
2761
|
/** @enum {string} */
|
|
2962
2762
|
level: "root" | "department" | "team" | "context";
|
|
2963
|
-
department: string | null;
|
|
2964
|
-
departmentId: string | null;
|
|
2965
2763
|
content: string;
|
|
2966
2764
|
/** @enum {string} */
|
|
2967
2765
|
visibility: "public" | "private";
|
|
2968
2766
|
parentId: string | null;
|
|
2969
|
-
|
|
2970
|
-
id: string;
|
|
2971
|
-
name: string;
|
|
2972
|
-
} | null;
|
|
2767
|
+
owningUnitId: string | null;
|
|
2973
2768
|
owner: {
|
|
2974
2769
|
id: string;
|
|
2975
2770
|
name: string;
|
|
@@ -3039,7 +2834,7 @@ export interface components {
|
|
|
3039
2834
|
sharingPolicy: "restricted" | "org_read" | "org_comment" | "org_edit";
|
|
3040
2835
|
acl: {
|
|
3041
2836
|
/** @enum {string} */
|
|
3042
|
-
principalType: "user" | "
|
|
2837
|
+
principalType: "user" | "unit";
|
|
3043
2838
|
principalId: string;
|
|
3044
2839
|
principalName: string;
|
|
3045
2840
|
/** @enum {string} */
|
|
@@ -3055,7 +2850,7 @@ export interface components {
|
|
|
3055
2850
|
level: "none" | "viewer" | "commenter" | "editor";
|
|
3056
2851
|
reasons: {
|
|
3057
2852
|
/** @enum {string} */
|
|
3058
|
-
source: "org_rbac" | "sharing_policy" | "
|
|
2853
|
+
source: "org_rbac" | "sharing_policy" | "unit_baseline" | "acl_grant" | "doc_ownership";
|
|
3059
2854
|
detail: string;
|
|
3060
2855
|
}[];
|
|
3061
2856
|
canShare: boolean;
|
|
@@ -3067,7 +2862,7 @@ export interface components {
|
|
|
3067
2862
|
};
|
|
3068
2863
|
AddCompanyMdAclRequest: {
|
|
3069
2864
|
/** @enum {string} */
|
|
3070
|
-
principalType: "user" | "
|
|
2865
|
+
principalType: "user" | "unit";
|
|
3071
2866
|
principalId: string;
|
|
3072
2867
|
/** @enum {string} */
|
|
3073
2868
|
accessLevel: "viewer" | "commenter" | "editor";
|
|
@@ -3076,86 +2871,6 @@ export interface components {
|
|
|
3076
2871
|
/** @enum {string} */
|
|
3077
2872
|
accessLevel: "viewer" | "commenter" | "editor";
|
|
3078
2873
|
};
|
|
3079
|
-
TeamListResponse: {
|
|
3080
|
-
teams: {
|
|
3081
|
-
id: string;
|
|
3082
|
-
name: string;
|
|
3083
|
-
slug: string;
|
|
3084
|
-
description: string | null;
|
|
3085
|
-
memberCount: number;
|
|
3086
|
-
/** @enum {string} */
|
|
3087
|
-
scope: "department" | "cross_department" | "org";
|
|
3088
|
-
department: {
|
|
3089
|
-
id: string;
|
|
3090
|
-
name: string;
|
|
3091
|
-
slug: string;
|
|
3092
|
-
} | null;
|
|
3093
|
-
homeDepartment: {
|
|
3094
|
-
id: string;
|
|
3095
|
-
name: string;
|
|
3096
|
-
slug: string;
|
|
3097
|
-
} | null;
|
|
3098
|
-
orderKey: string;
|
|
3099
|
-
}[];
|
|
3100
|
-
};
|
|
3101
|
-
TeamResponse: {
|
|
3102
|
-
id: string;
|
|
3103
|
-
name: string;
|
|
3104
|
-
slug: string;
|
|
3105
|
-
description: string | null;
|
|
3106
|
-
memberCount: number;
|
|
3107
|
-
/** @enum {string} */
|
|
3108
|
-
scope: "department" | "cross_department" | "org";
|
|
3109
|
-
department: {
|
|
3110
|
-
id: string;
|
|
3111
|
-
name: string;
|
|
3112
|
-
slug: string;
|
|
3113
|
-
} | null;
|
|
3114
|
-
homeDepartment: {
|
|
3115
|
-
id: string;
|
|
3116
|
-
name: string;
|
|
3117
|
-
slug: string;
|
|
3118
|
-
} | null;
|
|
3119
|
-
orderKey: string;
|
|
3120
|
-
/** @enum {string} */
|
|
3121
|
-
syncMode: "manual_only" | "synced_readonly" | "synced_with_overrides";
|
|
3122
|
-
members: {
|
|
3123
|
-
userId: string;
|
|
3124
|
-
name: string;
|
|
3125
|
-
email: string;
|
|
3126
|
-
/** @enum {string} */
|
|
3127
|
-
role: "member" | "manager" | "owner";
|
|
3128
|
-
joinedAt: string;
|
|
3129
|
-
}[];
|
|
3130
|
-
};
|
|
3131
|
-
DepartmentListResponse: {
|
|
3132
|
-
departments: {
|
|
3133
|
-
id: string;
|
|
3134
|
-
name: string;
|
|
3135
|
-
slug: string;
|
|
3136
|
-
description: string | null;
|
|
3137
|
-
memberCount: number;
|
|
3138
|
-
orderKey: string;
|
|
3139
|
-
}[];
|
|
3140
|
-
};
|
|
3141
|
-
DepartmentResponse: {
|
|
3142
|
-
id: string;
|
|
3143
|
-
name: string;
|
|
3144
|
-
slug: string;
|
|
3145
|
-
description: string | null;
|
|
3146
|
-
/** @enum {string} */
|
|
3147
|
-
syncMode: "manual_only" | "scim" | "hris";
|
|
3148
|
-
memberCount: number;
|
|
3149
|
-
members: {
|
|
3150
|
-
userId: string;
|
|
3151
|
-
name: string;
|
|
3152
|
-
email: string;
|
|
3153
|
-
/** @enum {string} */
|
|
3154
|
-
role: "member" | "manager" | "owner";
|
|
3155
|
-
joinedAt: string;
|
|
3156
|
-
}[];
|
|
3157
|
-
orderKey: string;
|
|
3158
|
-
};
|
|
3159
2874
|
OrgUnitResponse: {
|
|
3160
2875
|
unit: {
|
|
3161
2876
|
/** Format: uuid */
|
|
@@ -5690,442 +5405,6 @@ export interface operations {
|
|
|
5690
5405
|
};
|
|
5691
5406
|
};
|
|
5692
5407
|
};
|
|
5693
|
-
listTeams: {
|
|
5694
|
-
parameters: {
|
|
5695
|
-
query?: never;
|
|
5696
|
-
header?: never;
|
|
5697
|
-
path?: never;
|
|
5698
|
-
cookie?: never;
|
|
5699
|
-
};
|
|
5700
|
-
requestBody?: never;
|
|
5701
|
-
responses: {
|
|
5702
|
-
/** @description Team list */
|
|
5703
|
-
200: {
|
|
5704
|
-
headers: {
|
|
5705
|
-
[name: string]: unknown;
|
|
5706
|
-
};
|
|
5707
|
-
content: {
|
|
5708
|
-
"application/json": components["schemas"]["TeamListResponse"];
|
|
5709
|
-
};
|
|
5710
|
-
};
|
|
5711
|
-
};
|
|
5712
|
-
};
|
|
5713
|
-
createTeam: {
|
|
5714
|
-
parameters: {
|
|
5715
|
-
query?: never;
|
|
5716
|
-
header?: never;
|
|
5717
|
-
path?: never;
|
|
5718
|
-
cookie?: never;
|
|
5719
|
-
};
|
|
5720
|
-
requestBody: {
|
|
5721
|
-
content: {
|
|
5722
|
-
"application/json": {
|
|
5723
|
-
name: string;
|
|
5724
|
-
description?: string;
|
|
5725
|
-
};
|
|
5726
|
-
};
|
|
5727
|
-
};
|
|
5728
|
-
responses: {
|
|
5729
|
-
/** @description Team created */
|
|
5730
|
-
201: {
|
|
5731
|
-
headers: {
|
|
5732
|
-
[name: string]: unknown;
|
|
5733
|
-
};
|
|
5734
|
-
content: {
|
|
5735
|
-
"application/json": components["schemas"]["TeamResponse"];
|
|
5736
|
-
};
|
|
5737
|
-
};
|
|
5738
|
-
};
|
|
5739
|
-
};
|
|
5740
|
-
getTeam: {
|
|
5741
|
-
parameters: {
|
|
5742
|
-
query?: never;
|
|
5743
|
-
header?: never;
|
|
5744
|
-
path: {
|
|
5745
|
-
teamId: string;
|
|
5746
|
-
};
|
|
5747
|
-
cookie?: never;
|
|
5748
|
-
};
|
|
5749
|
-
requestBody?: never;
|
|
5750
|
-
responses: {
|
|
5751
|
-
/** @description Team details */
|
|
5752
|
-
200: {
|
|
5753
|
-
headers: {
|
|
5754
|
-
[name: string]: unknown;
|
|
5755
|
-
};
|
|
5756
|
-
content: {
|
|
5757
|
-
"application/json": components["schemas"]["TeamResponse"];
|
|
5758
|
-
};
|
|
5759
|
-
};
|
|
5760
|
-
};
|
|
5761
|
-
};
|
|
5762
|
-
updateTeam: {
|
|
5763
|
-
parameters: {
|
|
5764
|
-
query?: never;
|
|
5765
|
-
header?: never;
|
|
5766
|
-
path: {
|
|
5767
|
-
teamId: string;
|
|
5768
|
-
};
|
|
5769
|
-
cookie?: never;
|
|
5770
|
-
};
|
|
5771
|
-
requestBody: {
|
|
5772
|
-
content: {
|
|
5773
|
-
"application/json": {
|
|
5774
|
-
name?: string;
|
|
5775
|
-
description?: string;
|
|
5776
|
-
};
|
|
5777
|
-
};
|
|
5778
|
-
};
|
|
5779
|
-
responses: {
|
|
5780
|
-
/** @description Updated team */
|
|
5781
|
-
200: {
|
|
5782
|
-
headers: {
|
|
5783
|
-
[name: string]: unknown;
|
|
5784
|
-
};
|
|
5785
|
-
content: {
|
|
5786
|
-
"application/json": components["schemas"]["TeamResponse"];
|
|
5787
|
-
};
|
|
5788
|
-
};
|
|
5789
|
-
};
|
|
5790
|
-
};
|
|
5791
|
-
deleteTeam: {
|
|
5792
|
-
parameters: {
|
|
5793
|
-
query?: never;
|
|
5794
|
-
header?: never;
|
|
5795
|
-
path: {
|
|
5796
|
-
teamId: string;
|
|
5797
|
-
};
|
|
5798
|
-
cookie?: never;
|
|
5799
|
-
};
|
|
5800
|
-
requestBody?: never;
|
|
5801
|
-
responses: {
|
|
5802
|
-
/** @description Team deleted */
|
|
5803
|
-
204: {
|
|
5804
|
-
headers: {
|
|
5805
|
-
[name: string]: unknown;
|
|
5806
|
-
};
|
|
5807
|
-
content?: never;
|
|
5808
|
-
};
|
|
5809
|
-
};
|
|
5810
|
-
};
|
|
5811
|
-
reorderTeamItem: {
|
|
5812
|
-
parameters: {
|
|
5813
|
-
query?: never;
|
|
5814
|
-
header?: never;
|
|
5815
|
-
path: {
|
|
5816
|
-
teamId: string;
|
|
5817
|
-
};
|
|
5818
|
-
cookie?: never;
|
|
5819
|
-
};
|
|
5820
|
-
requestBody?: never;
|
|
5821
|
-
responses: {
|
|
5822
|
-
/** @description Order key updated */
|
|
5823
|
-
204: {
|
|
5824
|
-
headers: {
|
|
5825
|
-
[name: string]: unknown;
|
|
5826
|
-
};
|
|
5827
|
-
content?: never;
|
|
5828
|
-
};
|
|
5829
|
-
/** @description Invalid order key */
|
|
5830
|
-
400: {
|
|
5831
|
-
headers: {
|
|
5832
|
-
[name: string]: unknown;
|
|
5833
|
-
};
|
|
5834
|
-
content?: never;
|
|
5835
|
-
};
|
|
5836
|
-
/** @description Order key collision */
|
|
5837
|
-
409: {
|
|
5838
|
-
headers: {
|
|
5839
|
-
[name: string]: unknown;
|
|
5840
|
-
};
|
|
5841
|
-
content?: never;
|
|
5842
|
-
};
|
|
5843
|
-
};
|
|
5844
|
-
};
|
|
5845
|
-
addTeamMember: {
|
|
5846
|
-
parameters: {
|
|
5847
|
-
query?: never;
|
|
5848
|
-
header?: never;
|
|
5849
|
-
path: {
|
|
5850
|
-
teamId: string;
|
|
5851
|
-
};
|
|
5852
|
-
cookie?: never;
|
|
5853
|
-
};
|
|
5854
|
-
requestBody: {
|
|
5855
|
-
content: {
|
|
5856
|
-
"application/json": {
|
|
5857
|
-
/** Format: uuid */
|
|
5858
|
-
userId: string;
|
|
5859
|
-
/** @enum {string} */
|
|
5860
|
-
role?: "owner" | "manager" | "member";
|
|
5861
|
-
};
|
|
5862
|
-
};
|
|
5863
|
-
};
|
|
5864
|
-
responses: {
|
|
5865
|
-
/** @description Member added */
|
|
5866
|
-
201: {
|
|
5867
|
-
headers: {
|
|
5868
|
-
[name: string]: unknown;
|
|
5869
|
-
};
|
|
5870
|
-
content?: never;
|
|
5871
|
-
};
|
|
5872
|
-
};
|
|
5873
|
-
};
|
|
5874
|
-
removeTeamMember: {
|
|
5875
|
-
parameters: {
|
|
5876
|
-
query?: never;
|
|
5877
|
-
header?: never;
|
|
5878
|
-
path: {
|
|
5879
|
-
teamId: string;
|
|
5880
|
-
userId: string;
|
|
5881
|
-
};
|
|
5882
|
-
cookie?: never;
|
|
5883
|
-
};
|
|
5884
|
-
requestBody?: never;
|
|
5885
|
-
responses: {
|
|
5886
|
-
/** @description Member removed */
|
|
5887
|
-
204: {
|
|
5888
|
-
headers: {
|
|
5889
|
-
[name: string]: unknown;
|
|
5890
|
-
};
|
|
5891
|
-
content?: never;
|
|
5892
|
-
};
|
|
5893
|
-
};
|
|
5894
|
-
};
|
|
5895
|
-
updateTeamMemberRole: {
|
|
5896
|
-
parameters: {
|
|
5897
|
-
query?: never;
|
|
5898
|
-
header?: never;
|
|
5899
|
-
path: {
|
|
5900
|
-
teamId: string;
|
|
5901
|
-
userId: string;
|
|
5902
|
-
};
|
|
5903
|
-
cookie?: never;
|
|
5904
|
-
};
|
|
5905
|
-
requestBody: {
|
|
5906
|
-
content: {
|
|
5907
|
-
"application/json": {
|
|
5908
|
-
/** @enum {string} */
|
|
5909
|
-
role: "owner" | "manager" | "member";
|
|
5910
|
-
};
|
|
5911
|
-
};
|
|
5912
|
-
};
|
|
5913
|
-
responses: {
|
|
5914
|
-
/** @description Role updated */
|
|
5915
|
-
200: {
|
|
5916
|
-
headers: {
|
|
5917
|
-
[name: string]: unknown;
|
|
5918
|
-
};
|
|
5919
|
-
content?: never;
|
|
5920
|
-
};
|
|
5921
|
-
};
|
|
5922
|
-
};
|
|
5923
|
-
listDepartments: {
|
|
5924
|
-
parameters: {
|
|
5925
|
-
query?: never;
|
|
5926
|
-
header?: never;
|
|
5927
|
-
path?: never;
|
|
5928
|
-
cookie?: never;
|
|
5929
|
-
};
|
|
5930
|
-
requestBody?: never;
|
|
5931
|
-
responses: {
|
|
5932
|
-
/** @description Department list */
|
|
5933
|
-
200: {
|
|
5934
|
-
headers: {
|
|
5935
|
-
[name: string]: unknown;
|
|
5936
|
-
};
|
|
5937
|
-
content: {
|
|
5938
|
-
"application/json": components["schemas"]["DepartmentListResponse"];
|
|
5939
|
-
};
|
|
5940
|
-
};
|
|
5941
|
-
};
|
|
5942
|
-
};
|
|
5943
|
-
createDepartment: {
|
|
5944
|
-
parameters: {
|
|
5945
|
-
query?: never;
|
|
5946
|
-
header?: never;
|
|
5947
|
-
path?: never;
|
|
5948
|
-
cookie?: never;
|
|
5949
|
-
};
|
|
5950
|
-
requestBody: {
|
|
5951
|
-
content: {
|
|
5952
|
-
"application/json": {
|
|
5953
|
-
name: string;
|
|
5954
|
-
description?: string;
|
|
5955
|
-
};
|
|
5956
|
-
};
|
|
5957
|
-
};
|
|
5958
|
-
responses: {
|
|
5959
|
-
/** @description Department created */
|
|
5960
|
-
201: {
|
|
5961
|
-
headers: {
|
|
5962
|
-
[name: string]: unknown;
|
|
5963
|
-
};
|
|
5964
|
-
content: {
|
|
5965
|
-
"application/json": components["schemas"]["DepartmentResponse"];
|
|
5966
|
-
};
|
|
5967
|
-
};
|
|
5968
|
-
};
|
|
5969
|
-
};
|
|
5970
|
-
getDepartment: {
|
|
5971
|
-
parameters: {
|
|
5972
|
-
query?: never;
|
|
5973
|
-
header?: never;
|
|
5974
|
-
path: {
|
|
5975
|
-
id: string;
|
|
5976
|
-
};
|
|
5977
|
-
cookie?: never;
|
|
5978
|
-
};
|
|
5979
|
-
requestBody?: never;
|
|
5980
|
-
responses: {
|
|
5981
|
-
/** @description Department details */
|
|
5982
|
-
200: {
|
|
5983
|
-
headers: {
|
|
5984
|
-
[name: string]: unknown;
|
|
5985
|
-
};
|
|
5986
|
-
content: {
|
|
5987
|
-
"application/json": components["schemas"]["DepartmentResponse"];
|
|
5988
|
-
};
|
|
5989
|
-
};
|
|
5990
|
-
};
|
|
5991
|
-
};
|
|
5992
|
-
deleteDepartment: {
|
|
5993
|
-
parameters: {
|
|
5994
|
-
query?: never;
|
|
5995
|
-
header?: never;
|
|
5996
|
-
path: {
|
|
5997
|
-
id: string;
|
|
5998
|
-
};
|
|
5999
|
-
cookie?: never;
|
|
6000
|
-
};
|
|
6001
|
-
requestBody?: never;
|
|
6002
|
-
responses: {
|
|
6003
|
-
/** @description Department deleted */
|
|
6004
|
-
204: {
|
|
6005
|
-
headers: {
|
|
6006
|
-
[name: string]: unknown;
|
|
6007
|
-
};
|
|
6008
|
-
content?: never;
|
|
6009
|
-
};
|
|
6010
|
-
};
|
|
6011
|
-
};
|
|
6012
|
-
updateDepartment: {
|
|
6013
|
-
parameters: {
|
|
6014
|
-
query?: never;
|
|
6015
|
-
header?: never;
|
|
6016
|
-
path: {
|
|
6017
|
-
id: string;
|
|
6018
|
-
};
|
|
6019
|
-
cookie?: never;
|
|
6020
|
-
};
|
|
6021
|
-
requestBody?: never;
|
|
6022
|
-
responses: {
|
|
6023
|
-
/** @description Updated department */
|
|
6024
|
-
200: {
|
|
6025
|
-
headers: {
|
|
6026
|
-
[name: string]: unknown;
|
|
6027
|
-
};
|
|
6028
|
-
content: {
|
|
6029
|
-
"application/json": components["schemas"]["DepartmentResponse"];
|
|
6030
|
-
};
|
|
6031
|
-
};
|
|
6032
|
-
};
|
|
6033
|
-
};
|
|
6034
|
-
reorderDepartmentItem: {
|
|
6035
|
-
parameters: {
|
|
6036
|
-
query?: never;
|
|
6037
|
-
header?: never;
|
|
6038
|
-
path: {
|
|
6039
|
-
id: string;
|
|
6040
|
-
};
|
|
6041
|
-
cookie?: never;
|
|
6042
|
-
};
|
|
6043
|
-
requestBody?: never;
|
|
6044
|
-
responses: {
|
|
6045
|
-
/** @description Order key updated */
|
|
6046
|
-
204: {
|
|
6047
|
-
headers: {
|
|
6048
|
-
[name: string]: unknown;
|
|
6049
|
-
};
|
|
6050
|
-
content?: never;
|
|
6051
|
-
};
|
|
6052
|
-
/** @description Invalid order key */
|
|
6053
|
-
400: {
|
|
6054
|
-
headers: {
|
|
6055
|
-
[name: string]: unknown;
|
|
6056
|
-
};
|
|
6057
|
-
content?: never;
|
|
6058
|
-
};
|
|
6059
|
-
/** @description Order key collision */
|
|
6060
|
-
409: {
|
|
6061
|
-
headers: {
|
|
6062
|
-
[name: string]: unknown;
|
|
6063
|
-
};
|
|
6064
|
-
content?: never;
|
|
6065
|
-
};
|
|
6066
|
-
};
|
|
6067
|
-
};
|
|
6068
|
-
listDepartmentMembers: {
|
|
6069
|
-
parameters: {
|
|
6070
|
-
query?: never;
|
|
6071
|
-
header?: never;
|
|
6072
|
-
path: {
|
|
6073
|
-
id: string;
|
|
6074
|
-
};
|
|
6075
|
-
cookie?: never;
|
|
6076
|
-
};
|
|
6077
|
-
requestBody?: never;
|
|
6078
|
-
responses: {
|
|
6079
|
-
/** @description Department member list */
|
|
6080
|
-
200: {
|
|
6081
|
-
headers: {
|
|
6082
|
-
[name: string]: unknown;
|
|
6083
|
-
};
|
|
6084
|
-
content?: never;
|
|
6085
|
-
};
|
|
6086
|
-
};
|
|
6087
|
-
};
|
|
6088
|
-
addDepartmentMember: {
|
|
6089
|
-
parameters: {
|
|
6090
|
-
query?: never;
|
|
6091
|
-
header?: never;
|
|
6092
|
-
path: {
|
|
6093
|
-
id: string;
|
|
6094
|
-
};
|
|
6095
|
-
cookie?: never;
|
|
6096
|
-
};
|
|
6097
|
-
requestBody?: never;
|
|
6098
|
-
responses: {
|
|
6099
|
-
/** @description Member added */
|
|
6100
|
-
201: {
|
|
6101
|
-
headers: {
|
|
6102
|
-
[name: string]: unknown;
|
|
6103
|
-
};
|
|
6104
|
-
content?: never;
|
|
6105
|
-
};
|
|
6106
|
-
};
|
|
6107
|
-
};
|
|
6108
|
-
removeDepartmentMember: {
|
|
6109
|
-
parameters: {
|
|
6110
|
-
query?: never;
|
|
6111
|
-
header?: never;
|
|
6112
|
-
path: {
|
|
6113
|
-
id: string;
|
|
6114
|
-
userId: string;
|
|
6115
|
-
};
|
|
6116
|
-
cookie?: never;
|
|
6117
|
-
};
|
|
6118
|
-
requestBody?: never;
|
|
6119
|
-
responses: {
|
|
6120
|
-
/** @description Member removed */
|
|
6121
|
-
204: {
|
|
6122
|
-
headers: {
|
|
6123
|
-
[name: string]: unknown;
|
|
6124
|
-
};
|
|
6125
|
-
content?: never;
|
|
6126
|
-
};
|
|
6127
|
-
};
|
|
6128
|
-
};
|
|
6129
5408
|
createOrgUnit: {
|
|
6130
5409
|
parameters: {
|
|
6131
5410
|
query?: never;
|
package/src/content/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Content Domain Barrel
|
|
3
3
|
*
|
|
4
|
-
* Re-exports content response schemas for company-md
|
|
4
|
+
* Re-exports content response schemas for company-md and drive.
|
|
5
5
|
* Import from '@company-semantics/contracts/content'.
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -21,14 +21,6 @@ export type {
|
|
|
21
21
|
CompanyMdSettingsResponse,
|
|
22
22
|
} from './schemas';
|
|
23
23
|
|
|
24
|
-
// Team response schemas (PRD-00448)
|
|
25
|
-
export { TeamListResponseSchema, TeamResponseSchema } from './schemas';
|
|
26
|
-
export type { TeamListResponse, TeamResponse } from './schemas';
|
|
27
|
-
|
|
28
|
-
// Department response schemas (PRD-00448)
|
|
29
|
-
export { DepartmentListResponseSchema, DepartmentResponseSchema } from './schemas';
|
|
30
|
-
export type { DepartmentListResponse, DepartmentResponse } from './schemas';
|
|
31
|
-
|
|
32
24
|
// Drive response schemas (PRD-00448)
|
|
33
25
|
export { DriveFileListResponseSchema, DriveFileContentResponseSchema } from './schemas';
|
|
34
26
|
export type { DriveFileListResponse, DriveFileContentResponse } from './schemas';
|
package/src/content/schemas.ts
CHANGED
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
* Content Domain Response Schemas
|
|
3
3
|
*
|
|
4
4
|
* Zod response schemas for content and org structure endpoints.
|
|
5
|
-
* Canonical location for runtime validation of company-md
|
|
6
|
-
* department, and drive API responses.
|
|
5
|
+
* Canonical location for runtime validation of company-md and drive API responses.
|
|
7
6
|
*
|
|
8
7
|
* Covers:
|
|
9
8
|
* - company-md.ts (GET /api/company-md/tree, GET /api/company-md/docs/:slug, etc.)
|
|
10
9
|
* - company-md-sharing.ts (GET /api/company-md/docs/:slug/sharing)
|
|
11
|
-
* - teams.ts (GET /api/teams, GET /api/teams/:teamId, etc.)
|
|
12
|
-
* - departments.ts (GET /api/departments, GET /api/departments/:id, etc.)
|
|
13
10
|
* - drive.ts (GET /api/drive/files, GET /api/drive/files/recent, etc.)
|
|
14
11
|
*/
|
|
15
12
|
import { z } from 'zod';
|
|
@@ -19,11 +16,6 @@ import { CursorPageSchema } from '../api/primitives';
|
|
|
19
16
|
// Company.md Sub-schemas
|
|
20
17
|
// ---------------------------------------------------------------------------
|
|
21
18
|
|
|
22
|
-
const CompanyMdOwningTeamSchema = z.object({
|
|
23
|
-
id: z.string(),
|
|
24
|
-
name: z.string(),
|
|
25
|
-
});
|
|
26
|
-
|
|
27
19
|
const CompanyMdPersonSchema = z.object({
|
|
28
20
|
id: z.string(),
|
|
29
21
|
name: z.string(),
|
|
@@ -46,16 +38,13 @@ const CompanyMdTreeNodeSchema = z.object({
|
|
|
46
38
|
title: z.string(),
|
|
47
39
|
level: z.enum(['root', 'department', 'team', 'context']),
|
|
48
40
|
parentId: z.string().nullable(),
|
|
49
|
-
department: z.string().nullable(),
|
|
50
|
-
departmentId: z.string().nullable(),
|
|
51
41
|
visibility: z.enum(['public', 'private']),
|
|
52
|
-
|
|
42
|
+
owningUnitId: z.string().nullable(),
|
|
53
43
|
type: z.enum(['company', 'department', 'team', 'cross_team', 'doc', 'goal', 'source', 'map', 'context_bank']),
|
|
54
44
|
canEdit: z.boolean(),
|
|
55
45
|
memberCount: z.number().int(),
|
|
56
46
|
description: z.string().optional(),
|
|
57
|
-
|
|
58
|
-
/** Fractional-index key for ordered entity wrappers (dept/team/context). */
|
|
47
|
+
/** Fractional-index key for ordered entity wrappers (unit/context). */
|
|
59
48
|
orderKey: z.string().optional(),
|
|
60
49
|
});
|
|
61
50
|
|
|
@@ -72,12 +61,10 @@ export const CompanyMdDocResponseSchema = z.object({
|
|
|
72
61
|
slug: z.string(),
|
|
73
62
|
title: z.string(),
|
|
74
63
|
level: z.enum(['root', 'department', 'team', 'context']),
|
|
75
|
-
department: z.string().nullable(),
|
|
76
|
-
departmentId: z.string().nullable(),
|
|
77
64
|
content: z.string(),
|
|
78
65
|
visibility: z.enum(['public', 'private']),
|
|
79
66
|
parentId: z.string().nullable(),
|
|
80
|
-
|
|
67
|
+
owningUnitId: z.string().nullable(),
|
|
81
68
|
owner: CompanyMdPersonSchema.nullable(),
|
|
82
69
|
coOwners: z.array(CompanyMdPersonSchema),
|
|
83
70
|
canEdit: z.boolean(),
|
|
@@ -95,7 +82,7 @@ export const CompanyMdDocResponseSchema = z.object({
|
|
|
95
82
|
// ---------------------------------------------------------------------------
|
|
96
83
|
|
|
97
84
|
const AclEntrySchema = z.object({
|
|
98
|
-
principalType: z.enum(['user', '
|
|
85
|
+
principalType: z.enum(['user', 'unit']),
|
|
99
86
|
principalId: z.string(),
|
|
100
87
|
principalName: z.string(),
|
|
101
88
|
accessLevel: z.enum(['viewer', 'commenter', 'editor']),
|
|
@@ -104,7 +91,7 @@ const AclEntrySchema = z.object({
|
|
|
104
91
|
});
|
|
105
92
|
|
|
106
93
|
const AccessReasonSchema = z.object({
|
|
107
|
-
source: z.enum(['org_rbac', 'sharing_policy', '
|
|
94
|
+
source: z.enum(['org_rbac', 'sharing_policy', 'unit_baseline', 'acl_grant', 'doc_ownership']),
|
|
108
95
|
detail: z.string(),
|
|
109
96
|
});
|
|
110
97
|
|
|
@@ -149,89 +136,6 @@ export const CompanyMdSettingsResponseSchema = z.object({
|
|
|
149
136
|
levelLabels: CompanyMdLevelLabelsSchema,
|
|
150
137
|
});
|
|
151
138
|
|
|
152
|
-
// ---------------------------------------------------------------------------
|
|
153
|
-
// Team Sub-schemas
|
|
154
|
-
// ---------------------------------------------------------------------------
|
|
155
|
-
|
|
156
|
-
const TeamMemberSchema = z.object({
|
|
157
|
-
userId: z.string(),
|
|
158
|
-
name: z.string(),
|
|
159
|
-
email: z.string(),
|
|
160
|
-
role: z.enum(['member', 'manager', 'owner']),
|
|
161
|
-
joinedAt: z.string(),
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
const TeamSummarySchema = z.object({
|
|
165
|
-
id: z.string(),
|
|
166
|
-
name: z.string(),
|
|
167
|
-
slug: z.string(),
|
|
168
|
-
description: z.string().nullable(),
|
|
169
|
-
memberCount: z.number().int(),
|
|
170
|
-
scope: z.enum(['department', 'cross_department', 'org']),
|
|
171
|
-
department: z.object({ id: z.string(), name: z.string(), slug: z.string() }).nullable(),
|
|
172
|
-
homeDepartment: z.object({ id: z.string(), name: z.string(), slug: z.string() }).nullable(),
|
|
173
|
-
/** Fractional-index key used by drag-to-reorder. Backend always returns this. */
|
|
174
|
-
orderKey: z.string(),
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
// ---------------------------------------------------------------------------
|
|
178
|
-
// Team HTTP Response Schemas
|
|
179
|
-
// ---------------------------------------------------------------------------
|
|
180
|
-
|
|
181
|
-
/** Response for GET /api/teams */
|
|
182
|
-
export const TeamListResponseSchema = z.object({
|
|
183
|
-
teams: z.array(TeamSummarySchema),
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
/** Response for GET /api/teams/:teamId */
|
|
187
|
-
export const TeamResponseSchema = TeamSummarySchema.extend({
|
|
188
|
-
syncMode: z.enum(['manual_only', 'synced_readonly', 'synced_with_overrides']),
|
|
189
|
-
members: z.array(TeamMemberSchema),
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
// ---------------------------------------------------------------------------
|
|
193
|
-
// Department Sub-schemas
|
|
194
|
-
// ---------------------------------------------------------------------------
|
|
195
|
-
|
|
196
|
-
const DepartmentMemberSchema = z.object({
|
|
197
|
-
userId: z.string(),
|
|
198
|
-
name: z.string(),
|
|
199
|
-
email: z.string(),
|
|
200
|
-
role: z.enum(['member', 'manager', 'owner']),
|
|
201
|
-
joinedAt: z.string(),
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
const DepartmentSummarySchema = z.object({
|
|
205
|
-
id: z.string(),
|
|
206
|
-
name: z.string(),
|
|
207
|
-
slug: z.string(),
|
|
208
|
-
description: z.string().nullable(),
|
|
209
|
-
memberCount: z.number().int(),
|
|
210
|
-
/** Fractional-index key used by drag-to-reorder. Backend always returns this. */
|
|
211
|
-
orderKey: z.string(),
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
// ---------------------------------------------------------------------------
|
|
215
|
-
// Department HTTP Response Schemas
|
|
216
|
-
// ---------------------------------------------------------------------------
|
|
217
|
-
|
|
218
|
-
/** Response for GET /api/departments */
|
|
219
|
-
export const DepartmentListResponseSchema = z.object({
|
|
220
|
-
departments: z.array(DepartmentSummarySchema),
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
/** Response for GET /api/departments/:id */
|
|
224
|
-
export const DepartmentResponseSchema = z.object({
|
|
225
|
-
id: z.string(),
|
|
226
|
-
name: z.string(),
|
|
227
|
-
slug: z.string(),
|
|
228
|
-
description: z.string().nullable(),
|
|
229
|
-
syncMode: z.enum(['manual_only', 'scim', 'hris']),
|
|
230
|
-
memberCount: z.number().int(),
|
|
231
|
-
members: z.array(DepartmentMemberSchema),
|
|
232
|
-
orderKey: z.string(),
|
|
233
|
-
});
|
|
234
|
-
|
|
235
139
|
// ---------------------------------------------------------------------------
|
|
236
140
|
// Drive Sub-schemas
|
|
237
141
|
// ---------------------------------------------------------------------------
|
|
@@ -279,9 +183,5 @@ export type CompanyMdDocResponse = z.infer<typeof CompanyMdDocResponseSchema>;
|
|
|
279
183
|
export type CompanyMdShareResponse = z.infer<typeof CompanyMdShareResponseSchema>;
|
|
280
184
|
export type CompanyMdContextBankResponse = z.infer<typeof CompanyMdContextBankResponseSchema>;
|
|
281
185
|
export type CompanyMdSettingsResponse = z.infer<typeof CompanyMdSettingsResponseSchema>;
|
|
282
|
-
export type TeamListResponse = z.infer<typeof TeamListResponseSchema>;
|
|
283
|
-
export type TeamResponse = z.infer<typeof TeamResponseSchema>;
|
|
284
|
-
export type DepartmentListResponse = z.infer<typeof DepartmentListResponseSchema>;
|
|
285
|
-
export type DepartmentResponse = z.infer<typeof DepartmentResponseSchema>;
|
|
286
186
|
export type DriveFileListResponse = z.infer<typeof DriveFileListResponseSchema>;
|
|
287
187
|
export type DriveFileContentResponse = z.infer<typeof DriveFileContentResponseSchema>;
|
package/src/index.ts
CHANGED
|
@@ -294,13 +294,6 @@ export type {
|
|
|
294
294
|
CompanyMdTreeNode,
|
|
295
295
|
CompanyMdDoc,
|
|
296
296
|
CompanyMdContextBankItem,
|
|
297
|
-
TeamDepartmentRole,
|
|
298
|
-
TeamDepartmentMembership,
|
|
299
|
-
// Team types (PRD-00306)
|
|
300
|
-
TeamMembershipRole,
|
|
301
|
-
TeamSyncMode,
|
|
302
|
-
Team,
|
|
303
|
-
TeamMember,
|
|
304
297
|
// Sharing and ACL types (PRD-00306)
|
|
305
298
|
AccessLevel,
|
|
306
299
|
SharePolicy,
|
package/src/org/company-md.ts
CHANGED
|
@@ -12,14 +12,6 @@ export type CompanyMdDocLevel = 'root' | 'department' | 'team' | 'context';
|
|
|
12
12
|
|
|
13
13
|
export type CompanyMdNodeType = 'company' | 'department' | 'team' | 'cross_team' | 'doc' | 'goal' | 'source' | 'map' | 'context_bank';
|
|
14
14
|
|
|
15
|
-
export type TeamDepartmentRole = 'owner' | 'participant' | 'supporting';
|
|
16
|
-
|
|
17
|
-
export interface TeamDepartmentMembership {
|
|
18
|
-
readonly teamId: string;
|
|
19
|
-
readonly departmentId: string;
|
|
20
|
-
readonly role: TeamDepartmentRole;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
15
|
export interface CompanyMdSource {
|
|
24
16
|
readonly label: string;
|
|
25
17
|
readonly sourceType: 'meeting' | 'document' | 'conversation' | 'manual';
|
|
@@ -37,13 +29,9 @@ export interface CompanyMdNodeIdentity {
|
|
|
37
29
|
readonly title: string;
|
|
38
30
|
readonly level: CompanyMdDocLevel;
|
|
39
31
|
readonly parentId: string | null;
|
|
40
|
-
/** Department name (backwards-compat) */
|
|
41
|
-
readonly department: string | null;
|
|
42
|
-
/** Structured department reference */
|
|
43
|
-
readonly departmentId: string | null;
|
|
44
32
|
readonly visibility: CompanyMdVisibility;
|
|
45
|
-
/** Owning
|
|
46
|
-
readonly
|
|
33
|
+
/** Owning org_unit. Null for root docs or when the owning unit has been archived. */
|
|
34
|
+
readonly owningUnitId: string | null;
|
|
47
35
|
}
|
|
48
36
|
|
|
49
37
|
export interface CompanyMdTreeNode extends CompanyMdNodeIdentity {
|
|
@@ -51,11 +39,9 @@ export interface CompanyMdTreeNode extends CompanyMdNodeIdentity {
|
|
|
51
39
|
readonly canEdit: boolean;
|
|
52
40
|
readonly memberCount: number;
|
|
53
41
|
readonly description?: string;
|
|
54
|
-
/** Department IDs this node is associated with (for cross-team projections). */
|
|
55
|
-
readonly departmentIds?: readonly string[];
|
|
56
42
|
/**
|
|
57
43
|
* Fractional-index key for stable ordering. Present on ordered entity
|
|
58
|
-
* wrappers (
|
|
44
|
+
* wrappers (units, context docs); absent on wrappers for
|
|
59
45
|
* unordered types.
|
|
60
46
|
*/
|
|
61
47
|
readonly orderKey?: string;
|
package/src/org/index.ts
CHANGED
|
@@ -94,8 +94,6 @@ export type {
|
|
|
94
94
|
CompanyMdDocRelations,
|
|
95
95
|
CompanyMdDoc,
|
|
96
96
|
CompanyMdContextBankItem,
|
|
97
|
-
TeamDepartmentRole,
|
|
98
|
-
TeamDepartmentMembership,
|
|
99
97
|
// Level labels settings types (PRD-00453)
|
|
100
98
|
CompanyMdLevelLabels,
|
|
101
99
|
CompanyMdSettings,
|
|
@@ -103,25 +101,6 @@ export type {
|
|
|
103
101
|
|
|
104
102
|
export { DEFAULT_LEVEL_LABELS } from './company-md';
|
|
105
103
|
|
|
106
|
-
// Team types (PRD-00306)
|
|
107
|
-
export type {
|
|
108
|
-
TeamMembershipRole,
|
|
109
|
-
TeamSyncMode,
|
|
110
|
-
TeamScope,
|
|
111
|
-
Team,
|
|
112
|
-
TeamMember,
|
|
113
|
-
} from './teams';
|
|
114
|
-
|
|
115
|
-
// Department types (org hierarchy rationalization)
|
|
116
|
-
export type {
|
|
117
|
-
DepartmentMembershipRole,
|
|
118
|
-
DepartmentSyncMode,
|
|
119
|
-
UserScope,
|
|
120
|
-
Department,
|
|
121
|
-
DepartmentMember,
|
|
122
|
-
DepartmentDetail,
|
|
123
|
-
} from './departments';
|
|
124
|
-
|
|
125
104
|
// Sharing and ACL types (PRD-00306)
|
|
126
105
|
export type {
|
|
127
106
|
AccessLevel,
|
package/src/org/sharing.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type AccessLevel = 'viewer' | 'commenter' | 'editor';
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Document sharing policy.
|
|
9
|
-
* - restricted: Only explicit ACL + owning
|
|
9
|
+
* - restricted: Only explicit ACL + owning unit + org admins
|
|
10
10
|
* - org_read: All org members can view
|
|
11
11
|
* - org_comment: All org members can comment
|
|
12
12
|
* - org_edit: All org members can edit (does NOT imply canShare)
|
|
@@ -14,7 +14,7 @@ export type AccessLevel = 'viewer' | 'commenter' | 'editor';
|
|
|
14
14
|
export type SharePolicy = 'restricted' | 'org_read' | 'org_comment' | 'org_edit';
|
|
15
15
|
|
|
16
16
|
export interface AclEntry {
|
|
17
|
-
readonly principalType: 'user' | '
|
|
17
|
+
readonly principalType: 'user' | 'unit';
|
|
18
18
|
readonly principalId: string;
|
|
19
19
|
readonly principalName: string;
|
|
20
20
|
readonly accessLevel: AccessLevel;
|
|
@@ -26,7 +26,7 @@ export interface AclEntry {
|
|
|
26
26
|
* Source of an access grant.
|
|
27
27
|
* Used in EffectiveAccess.reasons and EvaluationStep.source.
|
|
28
28
|
*/
|
|
29
|
-
export type AccessSource = 'org_rbac' | 'sharing_policy' | '
|
|
29
|
+
export type AccessSource = 'org_rbac' | 'sharing_policy' | 'unit_baseline' | 'acl_grant' | 'doc_ownership';
|
|
30
30
|
|
|
31
31
|
export interface AccessReason {
|
|
32
32
|
readonly source: AccessSource;
|
|
@@ -37,11 +37,11 @@ export interface AccessReason {
|
|
|
37
37
|
* Effective access for a user on a document.
|
|
38
38
|
*
|
|
39
39
|
* INVARIANTS:
|
|
40
|
-
* - canShare is granted ONLY by: doc ownership,
|
|
41
|
-
* or org-level org.manage_goals / org.
|
|
40
|
+
* - canShare is granted ONLY by: doc ownership, ownership of the owning unit,
|
|
41
|
+
* or org-level org.manage_goals / org.manage_company_md.
|
|
42
42
|
* - canShare is NEVER granted by ACL entries or sharing policy.
|
|
43
43
|
* - org_edit via sharing policy does NOT imply canShare.
|
|
44
|
-
* -
|
|
44
|
+
* - Unit membership grants baseline access ONLY to resources owned by that unit.
|
|
45
45
|
*/
|
|
46
46
|
export interface EffectiveAccess {
|
|
47
47
|
readonly level: 'none' | AccessLevel;
|
|
@@ -84,10 +84,10 @@ export interface ShareState {
|
|
|
84
84
|
*/
|
|
85
85
|
export interface PermissionAuditEntry {
|
|
86
86
|
readonly action: 'granted' | 'revoked' | 'updated';
|
|
87
|
-
readonly resourceType: 'goals_doc' | '
|
|
87
|
+
readonly resourceType: 'goals_doc' | 'unit';
|
|
88
88
|
readonly resourceId: string;
|
|
89
89
|
readonly resourceName: string;
|
|
90
|
-
readonly principalType: 'user' | '
|
|
90
|
+
readonly principalType: 'user' | 'unit';
|
|
91
91
|
readonly principalId: string;
|
|
92
92
|
readonly principalName: string;
|
|
93
93
|
readonly detail: string;
|
package/src/org/departments.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Department Domain Types
|
|
3
|
-
*
|
|
4
|
-
* Vocabulary types for the org hierarchy: Company > Departments > Teams > Members.
|
|
5
|
-
* Shared between backend (persistence/service) and app (UI rendering).
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export type DepartmentMembershipRole = 'member' | 'manager' | 'owner';
|
|
9
|
-
|
|
10
|
-
export type DepartmentSyncMode = 'manual_only' | 'scim' | 'hris';
|
|
11
|
-
|
|
12
|
-
export type TeamScope = 'department' | 'cross_department' | 'org';
|
|
13
|
-
|
|
14
|
-
export type UserScope = 'department' | 'org';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Department read model for list views.
|
|
18
|
-
*/
|
|
19
|
-
export interface Department {
|
|
20
|
-
readonly id: string;
|
|
21
|
-
readonly name: string;
|
|
22
|
-
readonly slug: string;
|
|
23
|
-
readonly description: string | null;
|
|
24
|
-
readonly memberCount: number;
|
|
25
|
-
/** Fractional-index key used by drag-to-reorder. Backend always returns this. */
|
|
26
|
-
readonly orderKey: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Department member within a department detail view.
|
|
31
|
-
*/
|
|
32
|
-
export interface DepartmentMember {
|
|
33
|
-
readonly userId: string;
|
|
34
|
-
readonly name: string;
|
|
35
|
-
readonly email: string;
|
|
36
|
-
readonly role: DepartmentMembershipRole;
|
|
37
|
-
readonly joinedAt: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Full department detail view including members.
|
|
42
|
-
* Returned by GET /api/departments/:id.
|
|
43
|
-
*/
|
|
44
|
-
export interface DepartmentDetail extends Department {
|
|
45
|
-
readonly members: ReadonlyArray<DepartmentMember>;
|
|
46
|
-
readonly syncMode: DepartmentSyncMode;
|
|
47
|
-
}
|
package/src/org/teams.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Team membership role.
|
|
3
|
-
* Privilege order: owner > manager > member.
|
|
4
|
-
* Effective role = max(role by privilege) across all active rows for a (team_id, user_id) pair.
|
|
5
|
-
* Rows with status != 'active' are ignored.
|
|
6
|
-
*/
|
|
7
|
-
export type TeamMembershipRole = 'member' | 'manager' | 'owner';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Team membership sync mode.
|
|
11
|
-
* - manual_only: All in-app membership mutations allowed
|
|
12
|
-
* - synced_readonly: Rejects all in-app membership changes (external source is authority)
|
|
13
|
-
* - synced_with_overrides: Allows manual additions; sync-sourced rows are read-only
|
|
14
|
-
*/
|
|
15
|
-
export type TeamSyncMode = 'manual_only' | 'synced_readonly' | 'synced_with_overrides';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Team scope — discriminates the organizational scope of a team.
|
|
19
|
-
*/
|
|
20
|
-
export type { TeamScope } from './departments';
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Team read model for list views.
|
|
24
|
-
*/
|
|
25
|
-
export interface Team {
|
|
26
|
-
readonly id: string;
|
|
27
|
-
readonly name: string;
|
|
28
|
-
readonly slug: string;
|
|
29
|
-
readonly description: string | null;
|
|
30
|
-
readonly memberCount: number;
|
|
31
|
-
readonly scope: import('./departments').TeamScope;
|
|
32
|
-
readonly department: { readonly id: string; readonly name: string; readonly slug: string } | null;
|
|
33
|
-
readonly homeDepartment: { readonly id: string; readonly name: string; readonly slug: string } | null;
|
|
34
|
-
/** Fractional-index key used by drag-to-reorder. Backend always returns this. */
|
|
35
|
-
readonly orderKey: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Team member within a team detail view.
|
|
40
|
-
*/
|
|
41
|
-
export interface TeamMember {
|
|
42
|
-
readonly userId: string;
|
|
43
|
-
readonly name: string;
|
|
44
|
-
readonly email: string;
|
|
45
|
-
readonly role: TeamMembershipRole;
|
|
46
|
-
readonly joinedAt: string;
|
|
47
|
-
}
|