@company-semantics/contracts 1.4.0 → 1.5.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,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 = '9740ec13f6ea' as const;
|
|
3
|
+
export const SPEC_HASH_FULL = '9740ec13f6ea493d93a5b3cf1e8d7f6b0a1130a0e85846a446fe74aaa7a40fde' as const;
|
package/src/api/generated.ts
CHANGED
|
@@ -1571,6 +1571,23 @@ export interface paths {
|
|
|
1571
1571
|
patch?: never;
|
|
1572
1572
|
trace?: never;
|
|
1573
1573
|
};
|
|
1574
|
+
"/api/org-units/{unitId}/permissions": {
|
|
1575
|
+
parameters: {
|
|
1576
|
+
query?: never;
|
|
1577
|
+
header?: never;
|
|
1578
|
+
path?: never;
|
|
1579
|
+
cookie?: never;
|
|
1580
|
+
};
|
|
1581
|
+
/** List effective managers of an org unit (direct + inherited) */
|
|
1582
|
+
get: operations["listOrgUnitPermissions"];
|
|
1583
|
+
put?: never;
|
|
1584
|
+
post?: never;
|
|
1585
|
+
delete?: never;
|
|
1586
|
+
options?: never;
|
|
1587
|
+
head?: never;
|
|
1588
|
+
patch?: never;
|
|
1589
|
+
trace?: never;
|
|
1590
|
+
};
|
|
1574
1591
|
"/api/org-units/{unitId}/memberships": {
|
|
1575
1592
|
parameters: {
|
|
1576
1593
|
query?: never;
|
|
@@ -3095,6 +3112,19 @@ export interface components {
|
|
|
3095
3112
|
updatedAt: string;
|
|
3096
3113
|
}[];
|
|
3097
3114
|
};
|
|
3115
|
+
ListOrgUnitPermissionsResponse: {
|
|
3116
|
+
/** Format: uuid */
|
|
3117
|
+
unitId: string;
|
|
3118
|
+
entries: {
|
|
3119
|
+
/** Format: uuid */
|
|
3120
|
+
userId: string;
|
|
3121
|
+
/** @enum {string} */
|
|
3122
|
+
membershipRole: "member" | "manager" | "owner";
|
|
3123
|
+
/** Format: uuid */
|
|
3124
|
+
inheritedFromUnitId: string;
|
|
3125
|
+
inheritedFromUnitName: string;
|
|
3126
|
+
}[];
|
|
3127
|
+
};
|
|
3098
3128
|
OrgUnitMembershipListResponse: {
|
|
3099
3129
|
/** Format: uuid */
|
|
3100
3130
|
unitId: string;
|
|
@@ -5729,6 +5759,28 @@ export interface operations {
|
|
|
5729
5759
|
};
|
|
5730
5760
|
};
|
|
5731
5761
|
};
|
|
5762
|
+
listOrgUnitPermissions: {
|
|
5763
|
+
parameters: {
|
|
5764
|
+
query?: never;
|
|
5765
|
+
header?: never;
|
|
5766
|
+
path: {
|
|
5767
|
+
unitId: string;
|
|
5768
|
+
};
|
|
5769
|
+
cookie?: never;
|
|
5770
|
+
};
|
|
5771
|
+
requestBody?: never;
|
|
5772
|
+
responses: {
|
|
5773
|
+
/** @description Effective managers inherited via ltree `path @>` */
|
|
5774
|
+
200: {
|
|
5775
|
+
headers: {
|
|
5776
|
+
[name: string]: unknown;
|
|
5777
|
+
};
|
|
5778
|
+
content: {
|
|
5779
|
+
"application/json": components["schemas"]["ListOrgUnitPermissionsResponse"];
|
|
5780
|
+
};
|
|
5781
|
+
};
|
|
5782
|
+
};
|
|
5783
|
+
};
|
|
5732
5784
|
listOrgUnitMemberships: {
|
|
5733
5785
|
parameters: {
|
|
5734
5786
|
query?: never;
|
package/src/resource-keys.ts
CHANGED
|
@@ -35,6 +35,7 @@ export type ResourceKey =
|
|
|
35
35
|
| { type: 'orgUnitChildren'; orgId: string; unitId: string }
|
|
36
36
|
| { type: 'orgUnitAncestors'; orgId: string; unitId: string }
|
|
37
37
|
| { type: 'orgUnitMemberships'; orgId: string; unitId: string }
|
|
38
|
+
| { type: 'orgUnitPermissions'; orgId: string; unitId: string }
|
|
38
39
|
// User-scoped
|
|
39
40
|
| { type: 'dismissedBanners'; userId: string }
|
|
40
41
|
| { type: 'userOrgs'; userId: string }
|
|
@@ -95,6 +96,7 @@ export function toQueryKey(key: ResourceKey): readonly string[] {
|
|
|
95
96
|
case 'orgUnitChildren':
|
|
96
97
|
case 'orgUnitAncestors':
|
|
97
98
|
case 'orgUnitMemberships':
|
|
99
|
+
case 'orgUnitPermissions':
|
|
98
100
|
return [key.type, key.orgId, key.unitId] as const;
|
|
99
101
|
|
|
100
102
|
// User-scoped
|
|
@@ -155,6 +157,7 @@ export function fromQueryKey(queryKey: readonly string[]): ResourceKey {
|
|
|
155
157
|
orgUnitChildren: 'unitId',
|
|
156
158
|
orgUnitAncestors: 'unitId',
|
|
157
159
|
orgUnitMemberships: 'unitId',
|
|
160
|
+
orgUnitPermissions: 'unitId',
|
|
158
161
|
};
|
|
159
162
|
|
|
160
163
|
if (type in identityFields) {
|
|
@@ -199,7 +202,10 @@ export const resourceRelationships: Record<string, string[]> = {
|
|
|
199
202
|
orgUnit: ['orgTree'],
|
|
200
203
|
orgUnitChildren: ['orgTree'],
|
|
201
204
|
orgUnitAncestors: ['orgTree'],
|
|
202
|
-
|
|
205
|
+
// Subtree manage is driven by memberships (ADR-BE-151); mutating memberships
|
|
206
|
+
// invalidates both the direct roster and the effective-managers read.
|
|
207
|
+
orgUnitMemberships: ['orgUnit', 'orgUnitPermissions'],
|
|
208
|
+
orgUnitPermissions: ['orgUnitMemberships'],
|
|
203
209
|
};
|
|
204
210
|
|
|
205
211
|
/**
|