@company-semantics/contracts 0.133.0 → 0.134.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/org/schemas.ts +1 -0
- package/src/resource-keys.ts +8 -8
package/package.json
CHANGED
package/src/org/schemas.ts
CHANGED
|
@@ -49,6 +49,7 @@ export type WorkspaceAccessResponse = z.infer<typeof WorkspaceAccessResponseSche
|
|
|
49
49
|
export const WorkspaceOverviewSchema = z.object({
|
|
50
50
|
id: z.string(),
|
|
51
51
|
name: z.string(),
|
|
52
|
+
slug: z.string(),
|
|
52
53
|
type: z.enum(['personal', 'shared']),
|
|
53
54
|
logoUrl: z.string().nullable(),
|
|
54
55
|
owner: WorkspaceOwnerSchema,
|
package/src/resource-keys.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type ResourceKey =
|
|
|
18
18
|
| { type: 'team'; orgId: string; teamId: string }
|
|
19
19
|
| { type: 'department'; orgId: string; departmentId: string }
|
|
20
20
|
| { type: 'chat'; orgId: string; chatId: string }
|
|
21
|
-
| { type: '
|
|
21
|
+
| { type: 'companyMdDoc'; orgId: string; slug: string }
|
|
22
22
|
| { type: 'companyMdContextBank'; orgId: string; slug: string }
|
|
23
23
|
| { type: 'workspace'; orgId: string }
|
|
24
24
|
| { type: 'workspaceDomains'; orgId: string }
|
|
@@ -27,7 +27,7 @@ export type ResourceKey =
|
|
|
27
27
|
| { type: 'aiUsage'; orgId: string }
|
|
28
28
|
| { type: 'deletionEligibility'; orgId: string }
|
|
29
29
|
| { type: 'transferOwnership'; orgId: string }
|
|
30
|
-
| { type: '
|
|
30
|
+
| { type: 'companyMdDocs'; orgId: string }
|
|
31
31
|
// User-scoped
|
|
32
32
|
| { type: 'dismissedBanners'; userId: string }
|
|
33
33
|
| { type: 'userOrgs'; userId: string }
|
|
@@ -53,7 +53,7 @@ export function resolveScope(context: {
|
|
|
53
53
|
const ORG_SCOPED_TYPES = [
|
|
54
54
|
'members', 'departments', 'chats', 'teams', 'integrations', 'invites',
|
|
55
55
|
'auditEvents', 'timeline', 'workspace', 'workspaceDomains', 'authSettings',
|
|
56
|
-
'billing', 'aiUsage', 'deletionEligibility', 'transferOwnership', '
|
|
56
|
+
'billing', 'aiUsage', 'deletionEligibility', 'transferOwnership', 'companyMdDocs',
|
|
57
57
|
] as const;
|
|
58
58
|
|
|
59
59
|
const USER_SCOPED_TYPES = ['dismissedBanners', 'userOrgs', 'sessions', 'viewer'] as const;
|
|
@@ -78,7 +78,7 @@ export function toQueryKey(key: ResourceKey): readonly string[] {
|
|
|
78
78
|
return [key.type, key.orgId, key.departmentId] as const;
|
|
79
79
|
case 'chat':
|
|
80
80
|
return [key.type, key.orgId, key.chatId] as const;
|
|
81
|
-
case '
|
|
81
|
+
case 'companyMdDoc':
|
|
82
82
|
case 'companyMdContextBank':
|
|
83
83
|
return [key.type, key.orgId, key.slug] as const;
|
|
84
84
|
|
|
@@ -105,7 +105,7 @@ export function toQueryKey(key: ResourceKey): readonly string[] {
|
|
|
105
105
|
case 'aiUsage':
|
|
106
106
|
case 'deletionEligibility':
|
|
107
107
|
case 'transferOwnership':
|
|
108
|
-
case '
|
|
108
|
+
case 'companyMdDocs':
|
|
109
109
|
return [key.type, key.orgId] as const;
|
|
110
110
|
|
|
111
111
|
default: {
|
|
@@ -132,7 +132,7 @@ export function fromQueryKey(queryKey: readonly string[]): ResourceKey {
|
|
|
132
132
|
team: 'teamId',
|
|
133
133
|
department: 'departmentId',
|
|
134
134
|
chat: 'chatId',
|
|
135
|
-
|
|
135
|
+
companyMdDoc: 'slug',
|
|
136
136
|
companyMdContextBank: 'slug',
|
|
137
137
|
};
|
|
138
138
|
|
|
@@ -170,8 +170,8 @@ export const resourceRelationships: Record<string, string[]> = {
|
|
|
170
170
|
chat: ['chats'],
|
|
171
171
|
teams: ['team'],
|
|
172
172
|
team: ['teams'],
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
companyMdDocs: ['companyMdDoc'],
|
|
174
|
+
companyMdDoc: ['companyMdDocs'],
|
|
175
175
|
};
|
|
176
176
|
|
|
177
177
|
/**
|