@company-semantics/contracts 0.115.1 → 0.117.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 +5 -1
- package/src/api/generated-spec-hash.ts +2 -2
- package/src/api/generated.ts +13 -4
- package/src/api/index.ts +4 -0
- package/src/api/primitives.ts +23 -0
- package/src/org/company-md.ts +19 -0
- package/src/org/index.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@company-semantics/contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.117.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -48,6 +48,10 @@
|
|
|
48
48
|
"types": "./src/chat/index.ts",
|
|
49
49
|
"default": "./src/chat/index.ts"
|
|
50
50
|
},
|
|
51
|
+
"./api": {
|
|
52
|
+
"types": "./src/api/index.ts",
|
|
53
|
+
"default": "./src/api/index.ts"
|
|
54
|
+
},
|
|
51
55
|
"./schemas/guard-result.schema.json": "./schemas/guard-result.schema.json"
|
|
52
56
|
},
|
|
53
57
|
"types": "./src/index.ts",
|
|
@@ -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 = 'd4f412a26098' as const;
|
|
3
|
+
export const SPEC_HASH_FULL = 'd4f412a26098e42f4578da215bc71e3960ed6850e2482e8de7c1a38f785c2cf6' as const;
|
package/src/api/generated.ts
CHANGED
|
@@ -2244,18 +2244,26 @@ export interface components {
|
|
|
2244
2244
|
MeResponse: {
|
|
2245
2245
|
/** Format: uuid */
|
|
2246
2246
|
userId: string;
|
|
2247
|
-
|
|
2248
|
-
|
|
2247
|
+
/** Format: email */
|
|
2248
|
+
email: string;
|
|
2249
2249
|
fullName: string;
|
|
2250
2250
|
preferredName?: string | null;
|
|
2251
|
-
/** @description Computed at read time (preferredName ??
|
|
2251
|
+
/** @description Computed at read time (preferredName ?? fullName) */
|
|
2252
2252
|
displayName: string;
|
|
2253
|
+
/** @enum {string} */
|
|
2254
|
+
nameSource: "self" | "sso";
|
|
2255
|
+
nameEditable: boolean;
|
|
2256
|
+
primaryDepartmentId: string | null;
|
|
2257
|
+
slackUserId: string | null;
|
|
2258
|
+
avatar: components["schemas"]["ResolvedAvatar"];
|
|
2253
2259
|
/** Format: uuid */
|
|
2254
2260
|
orgId: string;
|
|
2255
|
-
orgName
|
|
2261
|
+
orgName: string | null;
|
|
2256
2262
|
orgSlug: string;
|
|
2257
2263
|
/** @enum {string} */
|
|
2258
2264
|
plan: "free" | "pro" | "enterprise";
|
|
2265
|
+
hasMultipleOrgs: boolean;
|
|
2266
|
+
isInternalAdmin: boolean;
|
|
2259
2267
|
};
|
|
2260
2268
|
/** @description At least one field must be provided */
|
|
2261
2269
|
ProfileUpdateRequest: {
|
|
@@ -2905,6 +2913,7 @@ export interface components {
|
|
|
2905
2913
|
id: string;
|
|
2906
2914
|
name: string;
|
|
2907
2915
|
type: components["schemas"]["OrgType"];
|
|
2916
|
+
logoUrl: string | null;
|
|
2908
2917
|
owner: {
|
|
2909
2918
|
/** Format: uuid */
|
|
2910
2919
|
id: string;
|
package/src/api/index.ts
CHANGED
|
@@ -10,3 +10,7 @@ export type { paths, components, operations } from './generated'
|
|
|
10
10
|
|
|
11
11
|
// Spec hash (from openapi/backend.yaml SHA-256)
|
|
12
12
|
export { SPEC_HASH, SPEC_HASH_FULL } from './generated-spec-hash'
|
|
13
|
+
|
|
14
|
+
// Reusable API primitive schemas (CursorPage, ErrorResponse)
|
|
15
|
+
export { CursorPageSchema, ErrorResponseSchema } from './primitives'
|
|
16
|
+
export type { CursorPage, ErrorResponse } from './primitives'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/** Generic factory for cursor-paginated responses. */
|
|
4
|
+
export function CursorPageSchema<T extends z.ZodTypeAny>(itemSchema: T) {
|
|
5
|
+
return z.object({
|
|
6
|
+
items: z.array(itemSchema),
|
|
7
|
+
nextCursor: z.string().nullable(),
|
|
8
|
+
hasMore: z.boolean(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Standard error envelope — matches backend StandardErrorResponse. */
|
|
13
|
+
export const ErrorResponseSchema = z.object({
|
|
14
|
+
error: z.object({
|
|
15
|
+
code: z.string(),
|
|
16
|
+
message: z.string(),
|
|
17
|
+
retryable: z.boolean(),
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// Inferred types
|
|
22
|
+
export type CursorPage<T> = { items: T[]; nextCursor: string | null; hasMore: boolean };
|
|
23
|
+
export type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
|
package/src/org/company-md.ts
CHANGED
|
@@ -76,6 +76,25 @@ export interface CompanyMdDocRelations {
|
|
|
76
76
|
|
|
77
77
|
export type CompanyMdDoc = CompanyMdDocCore & CompanyMdDocCollaborators & CompanyMdDocRelations;
|
|
78
78
|
|
|
79
|
+
export interface CompanyMdLevelLabels {
|
|
80
|
+
/** L1 label — defaults to org name */
|
|
81
|
+
readonly root: string;
|
|
82
|
+
/** L2 label — defaults to 'Department' */
|
|
83
|
+
readonly department: string;
|
|
84
|
+
/** L3 label — defaults to 'Team' */
|
|
85
|
+
readonly team: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface CompanyMdSettings {
|
|
89
|
+
readonly levelLabels: CompanyMdLevelLabels;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** System defaults for level labels. L1 (root) is set per-org at read time. */
|
|
93
|
+
export const DEFAULT_LEVEL_LABELS: Omit<CompanyMdLevelLabels, 'root'> = {
|
|
94
|
+
department: 'Department',
|
|
95
|
+
team: 'Team',
|
|
96
|
+
} as const;
|
|
97
|
+
|
|
79
98
|
/**
|
|
80
99
|
* A context bank item — a company.md doc associated with one or more parent nodes.
|
|
81
100
|
* Context bank files can belong to company, department, or team levels.
|
package/src/org/index.ts
CHANGED
|
@@ -96,8 +96,13 @@ export type {
|
|
|
96
96
|
CompanyMdContextBankItem,
|
|
97
97
|
TeamDepartmentRole,
|
|
98
98
|
TeamDepartmentMembership,
|
|
99
|
+
// Level labels settings types (PRD-00453)
|
|
100
|
+
CompanyMdLevelLabels,
|
|
101
|
+
CompanyMdSettings,
|
|
99
102
|
} from './company-md';
|
|
100
103
|
|
|
104
|
+
export { DEFAULT_LEVEL_LABELS } from './company-md';
|
|
105
|
+
|
|
101
106
|
// Team types (PRD-00306)
|
|
102
107
|
export type {
|
|
103
108
|
TeamMembershipRole,
|