@company-semantics/contracts 12.1.0 → 13.0.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
package/src/api/generated.ts
CHANGED
|
@@ -718,6 +718,24 @@ export interface paths {
|
|
|
718
718
|
patch: operations["changeMemberRole"];
|
|
719
719
|
trace?: never;
|
|
720
720
|
};
|
|
721
|
+
"/api/workspace/members/{id}/manager": {
|
|
722
|
+
parameters: {
|
|
723
|
+
query?: never;
|
|
724
|
+
header?: never;
|
|
725
|
+
path?: never;
|
|
726
|
+
cookie?: never;
|
|
727
|
+
};
|
|
728
|
+
get?: never;
|
|
729
|
+
put?: never;
|
|
730
|
+
post?: never;
|
|
731
|
+
/** Clear a member's solid-line manager (org-chart reporting edge) */
|
|
732
|
+
delete: operations["clearMemberManager"];
|
|
733
|
+
options?: never;
|
|
734
|
+
head?: never;
|
|
735
|
+
/** Set a member's solid-line manager (org-chart reporting edge) */
|
|
736
|
+
patch: operations["setMemberManager"];
|
|
737
|
+
trace?: never;
|
|
738
|
+
};
|
|
721
739
|
"/api/rbac/roles": {
|
|
722
740
|
parameters: {
|
|
723
741
|
query?: never;
|
|
@@ -3490,6 +3508,17 @@ export interface components {
|
|
|
3490
3508
|
/** @enum {string} */
|
|
3491
3509
|
newRole: "admin" | "member";
|
|
3492
3510
|
};
|
|
3511
|
+
SetMemberManagerResponse: {
|
|
3512
|
+
success: boolean;
|
|
3513
|
+
memberId: string;
|
|
3514
|
+
managerUserId: string | null;
|
|
3515
|
+
relationshipType: string;
|
|
3516
|
+
message: string;
|
|
3517
|
+
};
|
|
3518
|
+
SetMemberManagerRequest: {
|
|
3519
|
+
/** Format: uuid */
|
|
3520
|
+
managerUserId: string;
|
|
3521
|
+
};
|
|
3493
3522
|
RoleCatalogResponse: {
|
|
3494
3523
|
roles: {
|
|
3495
3524
|
name: string;
|
|
@@ -6163,6 +6192,54 @@ export interface operations {
|
|
|
6163
6192
|
};
|
|
6164
6193
|
};
|
|
6165
6194
|
};
|
|
6195
|
+
clearMemberManager: {
|
|
6196
|
+
parameters: {
|
|
6197
|
+
query?: never;
|
|
6198
|
+
header?: never;
|
|
6199
|
+
path: {
|
|
6200
|
+
id: string;
|
|
6201
|
+
};
|
|
6202
|
+
cookie?: never;
|
|
6203
|
+
};
|
|
6204
|
+
requestBody?: never;
|
|
6205
|
+
responses: {
|
|
6206
|
+
/** @description Manager cleared successfully */
|
|
6207
|
+
200: {
|
|
6208
|
+
headers: {
|
|
6209
|
+
[name: string]: unknown;
|
|
6210
|
+
};
|
|
6211
|
+
content: {
|
|
6212
|
+
"application/json": components["schemas"]["SetMemberManagerResponse"];
|
|
6213
|
+
};
|
|
6214
|
+
};
|
|
6215
|
+
};
|
|
6216
|
+
};
|
|
6217
|
+
setMemberManager: {
|
|
6218
|
+
parameters: {
|
|
6219
|
+
query?: never;
|
|
6220
|
+
header?: never;
|
|
6221
|
+
path: {
|
|
6222
|
+
id: string;
|
|
6223
|
+
};
|
|
6224
|
+
cookie?: never;
|
|
6225
|
+
};
|
|
6226
|
+
requestBody: {
|
|
6227
|
+
content: {
|
|
6228
|
+
"application/json": components["schemas"]["SetMemberManagerRequest"];
|
|
6229
|
+
};
|
|
6230
|
+
};
|
|
6231
|
+
responses: {
|
|
6232
|
+
/** @description Manager set successfully */
|
|
6233
|
+
200: {
|
|
6234
|
+
headers: {
|
|
6235
|
+
[name: string]: unknown;
|
|
6236
|
+
};
|
|
6237
|
+
content: {
|
|
6238
|
+
"application/json": components["schemas"]["SetMemberManagerResponse"];
|
|
6239
|
+
};
|
|
6240
|
+
};
|
|
6241
|
+
};
|
|
6242
|
+
};
|
|
6166
6243
|
getRbacRoles: {
|
|
6167
6244
|
parameters: {
|
|
6168
6245
|
query?: never;
|
|
@@ -145,6 +145,7 @@ export const openApiRoutes = {
|
|
|
145
145
|
'/api/workspace/invites/{id}': ['DELETE'],
|
|
146
146
|
'/api/workspace/members': ['GET'],
|
|
147
147
|
'/api/workspace/members/{id}': ['DELETE', 'GET'],
|
|
148
|
+
'/api/workspace/members/{id}/manager': ['DELETE', 'PATCH'],
|
|
148
149
|
'/api/workspace/members/{id}/role': ['PATCH'],
|
|
149
150
|
'/api/workspace/name': ['PATCH'],
|
|
150
151
|
'/api/workspace/organization': ['PATCH'],
|
package/src/org/schemas.ts
CHANGED
|
@@ -73,7 +73,7 @@ const WorkspaceMemberSchema = z.object({
|
|
|
73
73
|
* plain member with no org-chart authority. Render via `orgChartRoleLabel`.
|
|
74
74
|
*/
|
|
75
75
|
role: OrgChartRoleSchema.nullable(),
|
|
76
|
-
/** Raw RBAC role names (e.g. '
|
|
76
|
+
/** Raw RBAC role names (e.g. 'owner', 'admin', 'delegate'). Superset of `role`. */
|
|
77
77
|
roleNames: z.array(z.string()),
|
|
78
78
|
joinedAt: z.string(),
|
|
79
79
|
/** ISO timestamp of last activity; null if never recorded. */
|
|
@@ -165,6 +165,14 @@ export const WorkspaceOverviewSchema = z.object({
|
|
|
165
165
|
type: z.enum(["personal", "shared"]),
|
|
166
166
|
logoUrl: z.string().nullable(),
|
|
167
167
|
owner: WorkspaceOwnerSchema,
|
|
168
|
+
/**
|
|
169
|
+
* Org-configured display title for the `owner` org-chart role
|
|
170
|
+
* (ADR-CONTRACTS-061). Server-resolved: `orgs.owner_title` when set,
|
|
171
|
+
* otherwise the default "CEO". Always present; pass to
|
|
172
|
+
* `orgChartRoleLabel(role, { ownerTitle })` wherever the owner badge or
|
|
173
|
+
* section heading renders. Presentation only — never an authorization input.
|
|
174
|
+
*/
|
|
175
|
+
ownerTitle: z.string(),
|
|
168
176
|
createdAt: z.string(),
|
|
169
177
|
memberCount: z.number(),
|
|
170
178
|
claimable: z.boolean(),
|
|
@@ -455,7 +463,7 @@ export type ChangeMemberRoleResponse = z.infer<
|
|
|
455
463
|
*
|
|
456
464
|
* Distinct from team membership (RBAC scopes) and `primary_unit_id` (home
|
|
457
465
|
* unit): neither of those places a person in the reporting hierarchy.
|
|
458
|
-
* See ADR-BE-
|
|
466
|
+
* See ADR-BE-253.
|
|
459
467
|
*/
|
|
460
468
|
export const SetMemberManagerResponseSchema = z.object({
|
|
461
469
|
success: z.boolean(),
|
|
@@ -22,7 +22,12 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { z } from "zod";
|
|
24
24
|
|
|
25
|
-
export const ORG_CHART_ROLES = [
|
|
25
|
+
export const ORG_CHART_ROLES = [
|
|
26
|
+
"owner",
|
|
27
|
+
"leader",
|
|
28
|
+
"delegate",
|
|
29
|
+
"admin",
|
|
30
|
+
] as const;
|
|
26
31
|
export type OrgChartRole = (typeof ORG_CHART_ROLES)[number];
|
|
27
32
|
|
|
28
33
|
export const OrgChartRoleSchema = z.enum(ORG_CHART_ROLES);
|
|
@@ -30,15 +35,32 @@ export const OrgChartRoleSchema = z.enum(ORG_CHART_ROLES);
|
|
|
30
35
|
/**
|
|
31
36
|
* Human-readable labels for the org-chart role display badge. `null` (no
|
|
32
37
|
* org-chart standing) renders as "Member" via {@link orgChartRoleLabel}.
|
|
38
|
+
*
|
|
39
|
+
* `owner` is the organization's highest-authority individual (the account
|
|
40
|
+
* owner, or a structural leader of the root unit). Its DEFAULT label is
|
|
41
|
+
* "CEO" — what every new org sees — and is org-renamable via the
|
|
42
|
+
* `owner_title` org setting (ADR-CONTRACTS-061); pass the org's resolved
|
|
43
|
+
* title through {@link orgChartRoleLabel}'s `ownerTitle` option to apply it.
|
|
33
44
|
*/
|
|
34
45
|
export const ORG_CHART_ROLE_LABELS: Record<OrgChartRole, string> = {
|
|
35
|
-
|
|
46
|
+
owner: "CEO",
|
|
36
47
|
leader: "Leader",
|
|
37
48
|
delegate: "Delegate",
|
|
38
49
|
admin: "Admin",
|
|
39
50
|
};
|
|
40
51
|
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Display label for a (possibly null) org-chart role; `null` = plain member.
|
|
54
|
+
*
|
|
55
|
+
* `ownerTitle` is the org's configured owner display title
|
|
56
|
+
* (`WorkspaceOverview.ownerTitle`, server-resolved, default "CEO"); it
|
|
57
|
+
* overrides the static label for the `owner` role only.
|
|
58
|
+
*/
|
|
59
|
+
export function orgChartRoleLabel(
|
|
60
|
+
role: OrgChartRole | null,
|
|
61
|
+
opts?: { ownerTitle?: string },
|
|
62
|
+
): string {
|
|
63
|
+
if (role === null) return "Member";
|
|
64
|
+
if (role === "owner" && opts?.ownerTitle) return opts.ownerTitle;
|
|
65
|
+
return ORG_CHART_ROLE_LABELS[role];
|
|
44
66
|
}
|