@company-semantics/contracts 1.5.0 → 1.6.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.5.0",
3
+ "version": "1.6.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED — do not edit. Run pnpm generate:spec-hash to regenerate.
2
- export const SPEC_HASH = '9740ec13f6ea' as const;
3
- export const SPEC_HASH_FULL = '9740ec13f6ea493d93a5b3cf1e8d7f6b0a1130a0e85846a446fe74aaa7a40fde' as const;
2
+ export const SPEC_HASH = '7b6ec46c4d6a' as const;
3
+ export const SPEC_HASH_FULL = '7b6ec46c4d6a112a9b133ad9e815f994f456ec3de2c4ff255fe12ce201445ea8' as const;
@@ -1501,6 +1501,23 @@ export interface paths {
1501
1501
  patch?: never;
1502
1502
  trace?: never;
1503
1503
  };
1504
+ "/api/org-units/{unitId}/reorder": {
1505
+ parameters: {
1506
+ query?: never;
1507
+ header?: never;
1508
+ path?: never;
1509
+ cookie?: never;
1510
+ };
1511
+ get?: never;
1512
+ put?: never;
1513
+ /** Reorder a unit within its current parent (sibling reorder) */
1514
+ post: operations["reorderOrgUnit"];
1515
+ delete?: never;
1516
+ options?: never;
1517
+ head?: never;
1518
+ patch?: never;
1519
+ trace?: never;
1520
+ };
1504
1521
  "/api/org-units/{unitId}/archive": {
1505
1522
  parameters: {
1506
1523
  query?: never;
@@ -5598,6 +5615,36 @@ export interface operations {
5598
5615
  };
5599
5616
  };
5600
5617
  };
5618
+ reorderOrgUnit: {
5619
+ parameters: {
5620
+ query?: never;
5621
+ header?: never;
5622
+ path: {
5623
+ unitId: string;
5624
+ };
5625
+ cookie?: never;
5626
+ };
5627
+ requestBody: {
5628
+ content: {
5629
+ "application/json": {
5630
+ prevId: string | null;
5631
+ nextId: string | null;
5632
+ orderKey?: string;
5633
+ };
5634
+ };
5635
+ };
5636
+ responses: {
5637
+ /** @description Reordered unit */
5638
+ 200: {
5639
+ headers: {
5640
+ [name: string]: unknown;
5641
+ };
5642
+ content: {
5643
+ "application/json": components["schemas"]["OrgUnitResponse"];
5644
+ };
5645
+ };
5646
+ };
5647
+ };
5601
5648
  archiveOrgUnit: {
5602
5649
  parameters: {
5603
5650
  query?: never;
@@ -4,10 +4,11 @@
4
4
  export const openApiRoutes = {
5
5
  '/ai/chat': ['POST'],
6
6
  '/api/account/cancel-deletion': ['POST'],
7
+ '/api/account/confirm-deletion': ['POST'],
7
8
  '/api/account/delete': ['POST'],
9
+ '/api/account/deletion-eligibility': ['GET'],
8
10
  '/api/account/sessions': ['GET'],
9
11
  '/api/account/sessions/{sessionId}': ['DELETE'],
10
- '/api/capabilities/tools': ['GET'],
11
12
  '/api/chats': ['GET', 'POST'],
12
13
  '/api/chats/by-interaction/{interactionId}': ['GET'],
13
14
  '/api/chats/events': ['GET'],
@@ -17,9 +18,13 @@ export const openApiRoutes = {
17
18
  '/api/chats/{id}/messages': ['POST'],
18
19
  '/api/chats/{id}/messages/{messageId}': ['DELETE'],
19
20
  '/api/chats/{id}/pin': ['DELETE', 'POST'],
21
+ '/api/company-md/context-bank': ['POST'],
20
22
  '/api/company-md/docs/{slug}': ['GET'],
21
23
  '/api/company-md/docs/{slug}/content': ['PUT'],
22
24
  '/api/company-md/docs/{slug}/context-bank': ['GET'],
25
+ '/api/company-md/docs/{slug}/context-bank/associate': ['POST'],
26
+ '/api/company-md/docs/{slug}/context-bank/{contextDocSlug}': ['DELETE'],
27
+ '/api/company-md/docs/{slug}/context-bank/{id}/order': ['PATCH'],
23
28
  '/api/company-md/docs/{slug}/sharing': ['GET'],
24
29
  '/api/company-md/docs/{slug}/sharing/acl': ['POST'],
25
30
  '/api/company-md/docs/{slug}/sharing/acl/{aclId}': ['DELETE', 'PUT'],
@@ -27,10 +32,6 @@ export const openApiRoutes = {
27
32
  '/api/company-md/docs/{slug}/title': ['PUT'],
28
33
  '/api/company-md/extract': ['POST'],
29
34
  '/api/company-md/tree': ['GET'],
30
- '/api/departments': ['GET', 'POST'],
31
- '/api/departments/{id}': ['DELETE', 'GET', 'PATCH'],
32
- '/api/departments/{id}/members': ['GET', 'POST'],
33
- '/api/departments/{id}/members/{userId}': ['DELETE'],
34
35
  '/api/drive/files': ['GET'],
35
36
  '/api/drive/files/recent': ['GET'],
36
37
  '/api/drive/files/{fileId}/content': ['GET'],
@@ -41,8 +42,23 @@ export const openApiRoutes = {
41
42
  '/api/executions/{executionId}/summary': ['GET'],
42
43
  '/api/executions/{executionId}/timeline': ['GET'],
43
44
  '/api/executions/{executionId}/undo': ['POST'],
44
- '/api/integrations/status': ['GET'],
45
+ '/api/internal-admin/impersonate/end': ['POST'],
46
+ '/api/internal-admin/impersonate/session': ['GET'],
47
+ '/api/internal-admin/impersonate/start': ['POST'],
45
48
  '/api/me': ['GET'],
49
+ '/api/org-units': ['POST'],
50
+ '/api/org-units/{unitId}': ['GET'],
51
+ '/api/org-units/{unitId}/ancestors': ['GET'],
52
+ '/api/org-units/{unitId}/archive': ['POST'],
53
+ '/api/org-units/{unitId}/children': ['GET'],
54
+ '/api/org-units/{unitId}/descendants': ['GET'],
55
+ '/api/org-units/{unitId}/memberships': ['GET', 'POST'],
56
+ '/api/org-units/{unitId}/memberships/{userId}': ['DELETE'],
57
+ '/api/org-units/{unitId}/memberships/{userId}/role': ['PUT'],
58
+ '/api/org-units/{unitId}/permissions': ['GET'],
59
+ '/api/org-units/{unitId}/relationships': ['GET', 'POST'],
60
+ '/api/org-units/{unitId}/reorder': ['POST'],
61
+ '/api/org-units/{unitId}/reparent': ['POST'],
46
62
  '/api/org/cancel-deletion': ['POST'],
47
63
  '/api/org/delete': ['POST'],
48
64
  '/api/org/deletion-eligibility': ['GET'],
@@ -56,14 +72,12 @@ export const openApiRoutes = {
56
72
  '/api/orgs/{orgId}/ai-usage': ['GET'],
57
73
  '/api/orgs/{orgId}/billing': ['GET'],
58
74
  '/api/orgs/{orgId}/budget-config': ['GET', 'PUT'],
75
+ '/api/orgs/{orgId}/level-config': ['GET', 'PUT'],
76
+ '/api/orgs/{orgId}/tree': ['GET'],
77
+ '/api/scope/check': ['GET'],
59
78
  '/api/scope/check-batch': ['POST'],
60
79
  '/api/shared/{token}': ['GET'],
61
80
  '/api/shares/{shareId}': ['DELETE', 'PATCH'],
62
- '/api/teams': ['GET', 'POST'],
63
- '/api/teams/{teamId}': ['DELETE', 'GET', 'PUT'],
64
- '/api/teams/{teamId}/members': ['POST'],
65
- '/api/teams/{teamId}/members/{userId}': ['DELETE'],
66
- '/api/teams/{teamId}/members/{userId}/role': ['PUT'],
67
81
  '/api/timeline': ['GET'],
68
82
  '/api/user/active-org': ['POST'],
69
83
  '/api/user/orgs': ['GET'],
@@ -83,6 +97,7 @@ export const openApiRoutes = {
83
97
  '/api/workspace/domains': ['GET', 'POST'],
84
98
  '/api/workspace/domains/{id}': ['DELETE'],
85
99
  '/api/workspace/domains/{id}/verify': ['POST'],
100
+ '/api/workspace/handle': ['PATCH'],
86
101
  '/api/workspace/invites': ['GET', 'POST'],
87
102
  '/api/workspace/invites/accept': ['POST'],
88
103
  '/api/workspace/invites/validate': ['GET'],
@@ -100,8 +115,6 @@ export const openApiRoutes = {
100
115
  '/auth/start': ['POST'],
101
116
  '/auth/verify': ['POST'],
102
117
  '/connect/{provider}': ['GET'],
103
- '/healthz': ['GET'],
104
- '/healthz/details': ['GET'],
105
118
  '/oauth/{provider}/callback': ['GET'],
106
119
  } as const;
107
120
 
@@ -168,7 +168,7 @@ describe('Response schemas', () => {
168
168
  });
169
169
 
170
170
  describe('Enum exhaustiveness', () => {
171
- it('OrgUnitErrorCodeSchema enumerates all 7 known codes', () => {
171
+ it('OrgUnitErrorCodeSchema enumerates all 10 known codes', () => {
172
172
  const codes = [
173
173
  'CYCLE_BLOCKED',
174
174
  'DEPTH_EXCEEDED',
@@ -177,6 +177,9 @@ describe('Enum exhaustiveness', () => {
177
177
  'PARENT_ARCHIVED',
178
178
  'SLUG_TAKEN',
179
179
  'CROSS_ORG_REPARENT',
180
+ 'ORDERKEY_CONFLICT',
181
+ 'SIBLING_NOT_FOUND',
182
+ 'SIBLINGS_DIFFERENT_PARENT',
180
183
  ];
181
184
  for (const code of codes) {
182
185
  expect(() => OrgUnitErrorCodeSchema.parse(code)).not.toThrow();
@@ -63,4 +63,10 @@ export type OrgUnitErrorCode =
63
63
  /** Slug already taken under the target parent. */
64
64
  | 'SLUG_TAKEN'
65
65
  /** Attempted to reparent across orgs (or create with mismatched orgId). */
66
- | 'CROSS_ORG_REPARENT';
66
+ | 'CROSS_ORG_REPARENT'
67
+ /** Reorder: computed order_key collided with an existing sibling; client should re-fetch neighbors and retry. */
68
+ | 'ORDERKEY_CONFLICT'
69
+ /** Reorder: prev or next sibling id does not resolve to a live unit. */
70
+ | 'SIBLING_NOT_FOUND'
71
+ /** Reorder: prev or next sibling belongs to a different parent than the moving unit. */
72
+ | 'SIBLINGS_DIFFERENT_PARENT';
@@ -652,6 +652,9 @@ export const OrgUnitErrorCodeSchema = z.enum([
652
652
  'PARENT_ARCHIVED',
653
653
  'SLUG_TAKEN',
654
654
  'CROSS_ORG_REPARENT',
655
+ 'ORDERKEY_CONFLICT',
656
+ 'SIBLING_NOT_FOUND',
657
+ 'SIBLINGS_DIFFERENT_PARENT',
655
658
  ]);
656
659
 
657
660
  export const OrgUnitSchema = z.object({