@company-semantics/contracts 1.16.0 → 1.17.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
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admin What-If Simulator — request/response schemas.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the Fastify schema for `POST /api/admin/authz/simulate`. The endpoint
|
|
5
|
+
* is read-only and returns the full structured AuthDecision verbatim, so that
|
|
6
|
+
* admins can debug denials by reading evaluator name + reason rather than
|
|
7
|
+
* guessing. See PRD-00544 and feedback_decision_logic_must_be_visible.md.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
|
|
11
|
+
export const SimulateRequest = z.object({
|
|
12
|
+
actor: z.object({
|
|
13
|
+
type: z.enum(['user', 'agent']),
|
|
14
|
+
id: z.string().uuid(),
|
|
15
|
+
}),
|
|
16
|
+
scope: z.string(),
|
|
17
|
+
resource_kind: z.enum(['system', 'org', 'team', 'member', 'doc']),
|
|
18
|
+
resource_id: z.string().uuid().optional(),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type SimulateRequest = z.infer<typeof SimulateRequest>;
|
|
22
|
+
|
|
23
|
+
export const SimulateResponse = z.discriminatedUnion('allow', [
|
|
24
|
+
z.object({
|
|
25
|
+
allow: z.literal(true),
|
|
26
|
+
matched_grant: z.unknown(),
|
|
27
|
+
evaluator_name: z.string().optional(),
|
|
28
|
+
evaluator_reason: z.string().optional(),
|
|
29
|
+
}),
|
|
30
|
+
z.object({
|
|
31
|
+
allow: z.literal(false),
|
|
32
|
+
deny_reasons: z.array(z.unknown()),
|
|
33
|
+
missing: z.object({
|
|
34
|
+
scope: z.string().optional(),
|
|
35
|
+
suggested_role: z.string().optional(),
|
|
36
|
+
}),
|
|
37
|
+
}),
|
|
38
|
+
]);
|
|
39
|
+
|
|
40
|
+
export type SimulateResponse = z.infer<typeof SimulateResponse>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admin Direct Grants — request/response schemas.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the Fastify schemas for `POST /api/admin/grants/direct` and the
|
|
5
|
+
* persisted grant row. `granted_by` is intentionally absent from the create
|
|
6
|
+
* body — it is set by the server from the authenticated actor (see PRD-00544
|
|
7
|
+
* direct-grant-audit-trail and the `direct-grant-audit` CI guard).
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
|
|
11
|
+
export const DirectGrantCreate = z.object({
|
|
12
|
+
subject_id: z.string().uuid(),
|
|
13
|
+
scope_pattern: z.string(),
|
|
14
|
+
resource_filter: z.record(z.string(), z.unknown()).optional(),
|
|
15
|
+
expires_at: z.string().datetime().optional(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type DirectGrantCreate = z.infer<typeof DirectGrantCreate>;
|
|
19
|
+
|
|
20
|
+
export const DirectGrant = z.object({
|
|
21
|
+
id: z.string().uuid(),
|
|
22
|
+
org_id: z.string().uuid(),
|
|
23
|
+
subject_id: z.string().uuid(),
|
|
24
|
+
scope_pattern: z.string(),
|
|
25
|
+
source: z.literal('direct'),
|
|
26
|
+
granted_by: z.string().uuid(),
|
|
27
|
+
granted_at: z.string().datetime(),
|
|
28
|
+
expires_at: z.string().datetime().nullable(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export type DirectGrant = z.infer<typeof DirectGrant>;
|
|
@@ -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 = '6edfe6e7117c' as const;
|
|
3
|
+
export const SPEC_HASH_FULL = '6edfe6e7117c49e81cd7cad51ac9cd5c6f4c9e18cf7a37ff82a5630855404a00' as const;
|
package/src/api/generated.ts
CHANGED
|
@@ -72,6 +72,26 @@ export interface paths {
|
|
|
72
72
|
patch?: never;
|
|
73
73
|
trace?: never;
|
|
74
74
|
};
|
|
75
|
+
"/api/auth/consent/grant": {
|
|
76
|
+
parameters: {
|
|
77
|
+
query?: never;
|
|
78
|
+
header?: never;
|
|
79
|
+
path?: never;
|
|
80
|
+
cookie?: never;
|
|
81
|
+
};
|
|
82
|
+
get?: never;
|
|
83
|
+
put?: never;
|
|
84
|
+
/**
|
|
85
|
+
* Grant incremental consent for a write action
|
|
86
|
+
* @description Records per-(user, org, action) consent for a registered write action. Idempotent: regranting an already-active consent re-emits the audit event but does not create a duplicate row.
|
|
87
|
+
*/
|
|
88
|
+
post: operations["grantIncrementalConsent"];
|
|
89
|
+
delete?: never;
|
|
90
|
+
options?: never;
|
|
91
|
+
head?: never;
|
|
92
|
+
patch?: never;
|
|
93
|
+
trace?: never;
|
|
94
|
+
};
|
|
75
95
|
"/api/me": {
|
|
76
96
|
parameters: {
|
|
77
97
|
query?: never;
|
|
@@ -2036,6 +2056,15 @@ export interface components {
|
|
|
2036
2056
|
/** @constant */
|
|
2037
2057
|
ok: true;
|
|
2038
2058
|
};
|
|
2059
|
+
ConsentGrantResponse: {
|
|
2060
|
+
/** @constant */
|
|
2061
|
+
ok: true;
|
|
2062
|
+
/** Format: date-time */
|
|
2063
|
+
grantedAt: string;
|
|
2064
|
+
};
|
|
2065
|
+
ConsentGrantRequest: {
|
|
2066
|
+
actionId: string;
|
|
2067
|
+
};
|
|
2039
2068
|
MeResponse: {
|
|
2040
2069
|
/** Format: uuid */
|
|
2041
2070
|
userId: string;
|
|
@@ -3552,6 +3581,63 @@ export interface operations {
|
|
|
3552
3581
|
};
|
|
3553
3582
|
};
|
|
3554
3583
|
};
|
|
3584
|
+
grantIncrementalConsent: {
|
|
3585
|
+
parameters: {
|
|
3586
|
+
query?: never;
|
|
3587
|
+
header?: never;
|
|
3588
|
+
path?: never;
|
|
3589
|
+
cookie?: never;
|
|
3590
|
+
};
|
|
3591
|
+
requestBody: {
|
|
3592
|
+
content: {
|
|
3593
|
+
"application/json": components["schemas"]["ConsentGrantRequest"];
|
|
3594
|
+
};
|
|
3595
|
+
};
|
|
3596
|
+
responses: {
|
|
3597
|
+
/** @description Consent granted */
|
|
3598
|
+
200: {
|
|
3599
|
+
headers: {
|
|
3600
|
+
[name: string]: unknown;
|
|
3601
|
+
};
|
|
3602
|
+
content: {
|
|
3603
|
+
"application/json": components["schemas"]["ConsentGrantResponse"];
|
|
3604
|
+
};
|
|
3605
|
+
};
|
|
3606
|
+
/** @description Invalid or unregistered actionId */
|
|
3607
|
+
400: {
|
|
3608
|
+
headers: {
|
|
3609
|
+
[name: string]: unknown;
|
|
3610
|
+
};
|
|
3611
|
+
content: {
|
|
3612
|
+
"application/json": {
|
|
3613
|
+
error: string;
|
|
3614
|
+
message: string;
|
|
3615
|
+
};
|
|
3616
|
+
};
|
|
3617
|
+
};
|
|
3618
|
+
/** @description Not authenticated */
|
|
3619
|
+
401: {
|
|
3620
|
+
headers: {
|
|
3621
|
+
[name: string]: unknown;
|
|
3622
|
+
};
|
|
3623
|
+
content?: never;
|
|
3624
|
+
};
|
|
3625
|
+
/** @description CSRF token missing or invalid */
|
|
3626
|
+
403: {
|
|
3627
|
+
headers: {
|
|
3628
|
+
[name: string]: unknown;
|
|
3629
|
+
};
|
|
3630
|
+
content?: never;
|
|
3631
|
+
};
|
|
3632
|
+
/** @description Rate limit exceeded */
|
|
3633
|
+
429: {
|
|
3634
|
+
headers: {
|
|
3635
|
+
[name: string]: unknown;
|
|
3636
|
+
};
|
|
3637
|
+
content?: never;
|
|
3638
|
+
};
|
|
3639
|
+
};
|
|
3640
|
+
};
|
|
3555
3641
|
getCurrentUser: {
|
|
3556
3642
|
parameters: {
|
|
3557
3643
|
query?: never;
|
|
@@ -9,6 +9,7 @@ export const openApiRoutes = {
|
|
|
9
9
|
'/api/account/deletion-eligibility': ['GET'],
|
|
10
10
|
'/api/account/sessions': ['GET'],
|
|
11
11
|
'/api/account/sessions/{sessionId}': ['DELETE'],
|
|
12
|
+
'/api/auth/consent/grant': ['POST'],
|
|
12
13
|
'/api/chats': ['GET', 'POST'],
|
|
13
14
|
'/api/chats/by-interaction/{interactionId}': ['GET'],
|
|
14
15
|
'/api/chats/events': ['GET'],
|
|
@@ -47,7 +48,8 @@ export const openApiRoutes = {
|
|
|
47
48
|
'/api/internal-admin/impersonate/start': ['POST'],
|
|
48
49
|
'/api/me': ['GET'],
|
|
49
50
|
'/api/org-units': ['POST'],
|
|
50
|
-
'/api/org-units/
|
|
51
|
+
'/api/org-units/tree': ['GET'],
|
|
52
|
+
'/api/org-units/{unitId}': ['GET', 'PATCH'],
|
|
51
53
|
'/api/org-units/{unitId}/ancestors': ['GET'],
|
|
52
54
|
'/api/org-units/{unitId}/archive': ['POST'],
|
|
53
55
|
'/api/org-units/{unitId}/children': ['GET'],
|
|
@@ -73,7 +75,7 @@ export const openApiRoutes = {
|
|
|
73
75
|
'/api/orgs/{orgId}/billing': ['GET'],
|
|
74
76
|
'/api/orgs/{orgId}/budget-config': ['GET', 'PUT'],
|
|
75
77
|
'/api/orgs/{orgId}/level-config': ['GET', 'PUT'],
|
|
76
|
-
'/api/
|
|
78
|
+
'/api/rbac/roles': ['GET'],
|
|
77
79
|
'/api/scope/check': ['GET'],
|
|
78
80
|
'/api/scope/check-batch': ['POST'],
|
|
79
81
|
'/api/shared/{token}': ['GET'],
|
|
@@ -103,7 +105,7 @@ export const openApiRoutes = {
|
|
|
103
105
|
'/api/workspace/invites/validate': ['GET'],
|
|
104
106
|
'/api/workspace/invites/{id}': ['DELETE'],
|
|
105
107
|
'/api/workspace/members': ['GET'],
|
|
106
|
-
'/api/workspace/members/{id}': ['DELETE'],
|
|
108
|
+
'/api/workspace/members/{id}': ['DELETE', 'GET'],
|
|
107
109
|
'/api/workspace/members/{id}/role': ['PATCH'],
|
|
108
110
|
'/api/workspace/name': ['PATCH'],
|
|
109
111
|
'/api/workspace/resolve-path': ['POST'],
|