@company-semantics/contracts 9.2.0 → 10.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/index.ts +0 -1
- package/src/resource-keys.ts +0 -28
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/resource-keys.ts
CHANGED
|
@@ -251,34 +251,6 @@ export function fromQueryKey(queryKey: readonly string[]): ResourceKey {
|
|
|
251
251
|
throw new Error(`Unknown resource type in query key: '${type}'`);
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
/**
|
|
255
|
-
* Bidirectional resource relationships.
|
|
256
|
-
* TanStack does NOT support prefix matching across different key shapes.
|
|
257
|
-
* When invalidating a collection, we must also invalidate related identity entries (and vice versa).
|
|
258
|
-
*/
|
|
259
|
-
export const resourceRelationships: Record<string, string[]> = {
|
|
260
|
-
members: ["member"],
|
|
261
|
-
member: ["members"],
|
|
262
|
-
departments: ["department"],
|
|
263
|
-
department: ["departments"],
|
|
264
|
-
chats: ["chat"],
|
|
265
|
-
chat: ["chats"],
|
|
266
|
-
teams: ["team"],
|
|
267
|
-
team: ["teams"],
|
|
268
|
-
companyMdDocs: ["companyMdDoc"],
|
|
269
|
-
companyMdDoc: ["companyMdDocs"],
|
|
270
|
-
// OrgUnit: reparent/create/archive invalidates the tree view of the whole org;
|
|
271
|
-
// membership mutations invalidate the unit + its memberships list.
|
|
272
|
-
orgTree: ["orgUnit", "orgUnitChildren", "orgUnitAncestors"],
|
|
273
|
-
orgUnit: ["orgTree"],
|
|
274
|
-
orgUnitChildren: ["orgTree"],
|
|
275
|
-
orgUnitAncestors: ["orgTree"],
|
|
276
|
-
// Subtree manage is driven by memberships (ADR-BE-151); mutating memberships
|
|
277
|
-
// invalidates both the direct roster and the effective-managers read.
|
|
278
|
-
orgUnitMemberships: ["orgUnit", "orgUnitPermissions"],
|
|
279
|
-
orgUnitPermissions: ["orgUnitMemberships"],
|
|
280
|
-
};
|
|
281
|
-
|
|
282
254
|
/**
|
|
283
255
|
* Strict predicate for matching resource keys.
|
|
284
256
|
* Compares type + scope fields exactly. No partial matching. No loose comparisons.
|