@company-semantics/contracts 1.22.0 → 1.24.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,6 +1,6 @@
1
1
  {
2
2
  "name": "@company-semantics/contracts",
3
- "version": "1.22.0",
3
+ "version": "1.24.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -115,15 +115,15 @@
115
115
  "zod": "^4.4.3"
116
116
  },
117
117
  "devDependencies": {
118
- "@types/node": "^25.6.0",
118
+ "@types/node": "^25.7.0",
119
119
  "husky": "^9.1.7",
120
- "lint-staged": "^16.4.0",
120
+ "lint-staged": "^17.0.4",
121
121
  "markdownlint-cli2": "^0.22.1",
122
122
  "openapi-typescript": "^7.13.0",
123
123
  "tsx": "^4.21.0",
124
124
  "typescript": "^5",
125
- "vitest": "^4.1.5",
126
- "yaml": "^2.8.4"
125
+ "vitest": "^4.1.6",
126
+ "yaml": "^2.9.0"
127
127
  },
128
128
  "pnpm": {
129
129
  "overrides": {
@@ -1368,6 +1368,40 @@ export interface paths {
1368
1368
  patch: operations["reorderCompanyMdContextBankItem"];
1369
1369
  trace?: never;
1370
1370
  };
1371
+ "/api/company-md/docs/{parentSlug}/context-bank/upload": {
1372
+ parameters: {
1373
+ query?: never;
1374
+ header?: never;
1375
+ path?: never;
1376
+ cookie?: never;
1377
+ };
1378
+ get?: never;
1379
+ put?: never;
1380
+ /** Upload a file to the context bank for a parent doc and enqueue extraction */
1381
+ post: operations["uploadCompanyMdContextBankFile"];
1382
+ delete?: never;
1383
+ options?: never;
1384
+ head?: never;
1385
+ patch?: never;
1386
+ trace?: never;
1387
+ };
1388
+ "/api/company-md/docs/{slug}/context-bank/retry": {
1389
+ parameters: {
1390
+ query?: never;
1391
+ header?: never;
1392
+ path?: never;
1393
+ cookie?: never;
1394
+ };
1395
+ get?: never;
1396
+ put?: never;
1397
+ /** Retry extraction for a context-bank doc */
1398
+ post: operations["retryCompanyMdContextBankExtraction"];
1399
+ delete?: never;
1400
+ options?: never;
1401
+ head?: never;
1402
+ patch?: never;
1403
+ trace?: never;
1404
+ };
1371
1405
  "/api/company-md/docs/{slug}/sharing": {
1372
1406
  parameters: {
1373
1407
  query?: never;
@@ -2186,7 +2220,7 @@ export interface components {
2186
2220
  initials: string;
2187
2221
  };
2188
2222
  /** Format: uuid */
2189
- orgId: string;
2223
+ activeOrgId: string;
2190
2224
  orgName: string | null;
2191
2225
  orgSlug: string;
2192
2226
  plan: string;
@@ -5685,6 +5719,73 @@ export interface operations {
5685
5719
  };
5686
5720
  };
5687
5721
  };
5722
+ uploadCompanyMdContextBankFile: {
5723
+ parameters: {
5724
+ query?: never;
5725
+ header?: never;
5726
+ path: {
5727
+ parentSlug: string;
5728
+ };
5729
+ cookie?: never;
5730
+ };
5731
+ requestBody: {
5732
+ content: {
5733
+ "multipart/form-data": {
5734
+ [key: string]: unknown;
5735
+ };
5736
+ };
5737
+ };
5738
+ responses: {
5739
+ /** @description Context-bank doc created and extraction enqueued */
5740
+ 202: {
5741
+ headers: {
5742
+ [name: string]: unknown;
5743
+ };
5744
+ content?: never;
5745
+ };
5746
+ /** @description Unsupported MIME type */
5747
+ 415: {
5748
+ headers: {
5749
+ [name: string]: unknown;
5750
+ };
5751
+ content?: never;
5752
+ };
5753
+ /** @description Empty document or scanned PDF */
5754
+ 422: {
5755
+ headers: {
5756
+ [name: string]: unknown;
5757
+ };
5758
+ content?: never;
5759
+ };
5760
+ };
5761
+ };
5762
+ retryCompanyMdContextBankExtraction: {
5763
+ parameters: {
5764
+ query?: never;
5765
+ header?: never;
5766
+ path: {
5767
+ slug: string;
5768
+ };
5769
+ cookie?: never;
5770
+ };
5771
+ requestBody?: never;
5772
+ responses: {
5773
+ /** @description Retry enqueued */
5774
+ 202: {
5775
+ headers: {
5776
+ [name: string]: unknown;
5777
+ };
5778
+ content?: never;
5779
+ };
5780
+ /** @description Retry limit exceeded or invalid slug */
5781
+ 422: {
5782
+ headers: {
5783
+ [name: string]: unknown;
5784
+ };
5785
+ content?: never;
5786
+ };
5787
+ };
5788
+ };
5688
5789
  getCompanyMdDocSharing: {
5689
5790
  parameters: {
5690
5791
  query?: never;
@@ -60,3 +60,17 @@ export type {
60
60
  BannerDismissedListResponse,
61
61
  BannerDismissResponse,
62
62
  } from './schemas';
63
+
64
+ // People Org Chart (GET /api/users/org-chart)
65
+ export {
66
+ ReportingRelationshipTypeSchema,
67
+ PeopleOrgChartNodeSchema,
68
+ PeopleOrgChartEdgeSchema,
69
+ PeopleOrgChartResponseSchema,
70
+ } from './people-org-chart';
71
+ export type {
72
+ ReportingRelationshipType,
73
+ PeopleOrgChartNode,
74
+ PeopleOrgChartEdge,
75
+ PeopleOrgChartResponse,
76
+ } from './people-org-chart';
@@ -0,0 +1,58 @@
1
+ /**
2
+ * People Org Chart Response Schemas
3
+ *
4
+ * Zod response schemas for GET /api/users/org-chart — the people-org-chart
5
+ * view rendered from the settings page Structure → Org chart drill-down.
6
+ *
7
+ * Nodes are users (with optional avatar + job title); edges encode
8
+ * person-to-person reporting lines from the `user_reporting` table.
9
+ *
10
+ * Person-level reporting is intentionally distinct from
11
+ * `org_unit_relationships.type = 'reports_to'` (unit-to-unit graph overlay,
12
+ * ADR-BE-120). Tree traversal must never consult either.
13
+ */
14
+ import { z } from 'zod';
15
+
16
+ // ---------------------------------------------------------------------------
17
+ // Reporting Relationship Type
18
+ // ---------------------------------------------------------------------------
19
+
20
+ export const ReportingRelationshipTypeSchema = z.enum(['solid', 'dotted']);
21
+ export type ReportingRelationshipType = z.infer<typeof ReportingRelationshipTypeSchema>;
22
+
23
+ // ---------------------------------------------------------------------------
24
+ // Node — a person in the chart
25
+ // ---------------------------------------------------------------------------
26
+
27
+ export const PeopleOrgChartNodeSchema = z.object({
28
+ id: z.string().uuid(),
29
+ fullName: z.string(),
30
+ jobTitle: z.string().nullable(),
31
+ slackAvatarUrl: z.string().nullable(),
32
+ primaryUnitId: z.string().uuid().nullable(),
33
+ });
34
+
35
+ export type PeopleOrgChartNode = z.infer<typeof PeopleOrgChartNodeSchema>;
36
+
37
+ // ---------------------------------------------------------------------------
38
+ // Edge — a reporting line between two people
39
+ // ---------------------------------------------------------------------------
40
+
41
+ export const PeopleOrgChartEdgeSchema = z.object({
42
+ reportUserId: z.string().uuid(),
43
+ managerUserId: z.string().uuid(),
44
+ relationshipType: ReportingRelationshipTypeSchema,
45
+ });
46
+
47
+ export type PeopleOrgChartEdge = z.infer<typeof PeopleOrgChartEdgeSchema>;
48
+
49
+ // ---------------------------------------------------------------------------
50
+ // GET /api/users/org-chart
51
+ // ---------------------------------------------------------------------------
52
+
53
+ export const PeopleOrgChartResponseSchema = z.object({
54
+ nodes: z.array(PeopleOrgChartNodeSchema),
55
+ edges: z.array(PeopleOrgChartEdgeSchema),
56
+ });
57
+
58
+ export type PeopleOrgChartResponse = z.infer<typeof PeopleOrgChartResponseSchema>;
@@ -39,7 +39,9 @@ export const MeResponseSchema = z.object({
39
39
  primaryUnitId: z.string().nullable(),
40
40
  slackUserId: z.string().nullable(),
41
41
  avatar: ResolvedAvatarSchema,
42
- orgId: z.string().uuid(),
42
+ // Single canonical active-org field (PRD-00582 api/me-remove-orgid).
43
+ // Replaces the deprecated `orgId` alias from the dual-field transition.
44
+ activeOrgId: z.string().uuid(),
43
45
  orgName: z.string().nullable(),
44
46
  orgSlug: z.string(),
45
47
  plan: z.string(),
@@ -66,6 +66,12 @@ export type UserIdentity = {
66
66
  */
67
67
  nameSource: NameSource;
68
68
 
69
+ /**
70
+ * Free-text job title displayed in the people org chart and team views.
71
+ * Optional; not authoritative for role/RBAC.
72
+ */
73
+ jobTitle?: string | null;
74
+
69
75
  /** When the identity was created */
70
76
  createdAt: ISODateString;
71
77