@company-semantics/contracts 6.1.0 → 6.3.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 +1 -1
- package/src/api/generated-spec-hash.ts +2 -2
- package/src/api/generated.ts +94 -0
- package/src/email/__tests__/registry.test.ts +7 -1
- package/src/email/registry.ts +6 -0
- package/src/email/types.ts +15 -0
- package/src/generated/openapi-routes.ts +1 -0
- package/src/org/schemas.ts +5 -0
package/package.json
CHANGED
|
@@ -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 = '22781c2b738f' as const;
|
|
3
|
+
export const SPEC_HASH_FULL = '22781c2b738fdbdb0833b50ceab729227eccb7c54176ee35a373cc903d536b6c' as const;
|
package/src/api/generated.ts
CHANGED
|
@@ -1198,6 +1198,23 @@ export interface paths {
|
|
|
1198
1198
|
patch?: never;
|
|
1199
1199
|
trace?: never;
|
|
1200
1200
|
};
|
|
1201
|
+
"/api/capabilities": {
|
|
1202
|
+
parameters: {
|
|
1203
|
+
query?: never;
|
|
1204
|
+
header?: never;
|
|
1205
|
+
path?: never;
|
|
1206
|
+
cookie?: never;
|
|
1207
|
+
};
|
|
1208
|
+
/** Get the viewer resolved mutation capabilities */
|
|
1209
|
+
get: operations["getMutationCapabilities"];
|
|
1210
|
+
put?: never;
|
|
1211
|
+
post?: never;
|
|
1212
|
+
delete?: never;
|
|
1213
|
+
options?: never;
|
|
1214
|
+
head?: never;
|
|
1215
|
+
patch?: never;
|
|
1216
|
+
trace?: never;
|
|
1217
|
+
};
|
|
1201
1218
|
"/api/company-md/tree": {
|
|
1202
1219
|
parameters: {
|
|
1203
1220
|
query?: never;
|
|
@@ -3551,6 +3568,63 @@ export interface components {
|
|
|
3551
3568
|
/** @constant */
|
|
3552
3569
|
status: "cancelled";
|
|
3553
3570
|
};
|
|
3571
|
+
CapabilitiesResponse: {
|
|
3572
|
+
profile?: {
|
|
3573
|
+
fullName: {
|
|
3574
|
+
/** @enum {string} */
|
|
3575
|
+
state: "editable" | "locked";
|
|
3576
|
+
/** @enum {string} */
|
|
3577
|
+
reason?: "sso" | "rbac";
|
|
3578
|
+
requiredScope?: string;
|
|
3579
|
+
};
|
|
3580
|
+
preferredName: {
|
|
3581
|
+
/** @enum {string} */
|
|
3582
|
+
state: "editable" | "locked";
|
|
3583
|
+
/** @enum {string} */
|
|
3584
|
+
reason?: "sso" | "rbac";
|
|
3585
|
+
requiredScope?: string;
|
|
3586
|
+
};
|
|
3587
|
+
};
|
|
3588
|
+
org?: {
|
|
3589
|
+
name: {
|
|
3590
|
+
/** @enum {string} */
|
|
3591
|
+
state: "editable" | "locked";
|
|
3592
|
+
/** @enum {string} */
|
|
3593
|
+
reason?: "sso" | "rbac";
|
|
3594
|
+
requiredScope?: string;
|
|
3595
|
+
};
|
|
3596
|
+
};
|
|
3597
|
+
orgUnit?: {
|
|
3598
|
+
/** @enum {string} */
|
|
3599
|
+
manage: "allowed" | "blocked";
|
|
3600
|
+
};
|
|
3601
|
+
actions?: {
|
|
3602
|
+
members: {
|
|
3603
|
+
invite: {
|
|
3604
|
+
/** @enum {string} */
|
|
3605
|
+
state: "allowed" | "blocked";
|
|
3606
|
+
requiredScope?: string;
|
|
3607
|
+
};
|
|
3608
|
+
remove: {
|
|
3609
|
+
/** @enum {string} */
|
|
3610
|
+
state: "allowed" | "blocked";
|
|
3611
|
+
requiredScope?: string;
|
|
3612
|
+
};
|
|
3613
|
+
changeRole: {
|
|
3614
|
+
/** @enum {string} */
|
|
3615
|
+
state: "allowed" | "blocked";
|
|
3616
|
+
requiredScope?: string;
|
|
3617
|
+
};
|
|
3618
|
+
};
|
|
3619
|
+
orgAdmins: {
|
|
3620
|
+
manage: {
|
|
3621
|
+
/** @enum {string} */
|
|
3622
|
+
state: "allowed" | "blocked";
|
|
3623
|
+
requiredScope?: string;
|
|
3624
|
+
};
|
|
3625
|
+
};
|
|
3626
|
+
};
|
|
3627
|
+
};
|
|
3554
3628
|
CompanyMdListResponse: {
|
|
3555
3629
|
items: {
|
|
3556
3630
|
id: string;
|
|
@@ -6497,6 +6571,26 @@ export interface operations {
|
|
|
6497
6571
|
};
|
|
6498
6572
|
};
|
|
6499
6573
|
};
|
|
6574
|
+
getMutationCapabilities: {
|
|
6575
|
+
parameters: {
|
|
6576
|
+
query?: never;
|
|
6577
|
+
header?: never;
|
|
6578
|
+
path?: never;
|
|
6579
|
+
cookie?: never;
|
|
6580
|
+
};
|
|
6581
|
+
requestBody?: never;
|
|
6582
|
+
responses: {
|
|
6583
|
+
/** @description Resolved mutation capabilities for the current viewer + org */
|
|
6584
|
+
200: {
|
|
6585
|
+
headers: {
|
|
6586
|
+
[name: string]: unknown;
|
|
6587
|
+
};
|
|
6588
|
+
content: {
|
|
6589
|
+
"application/json": components["schemas"]["CapabilitiesResponse"];
|
|
6590
|
+
};
|
|
6591
|
+
};
|
|
6592
|
+
};
|
|
6593
|
+
};
|
|
6500
6594
|
getCompanyMdTree: {
|
|
6501
6595
|
parameters: {
|
|
6502
6596
|
query?: {
|
|
@@ -22,6 +22,12 @@ describe('EMAIL_KINDS golden snapshot', () => {
|
|
|
22
22
|
plainTextRequired: true,
|
|
23
23
|
htmlSupported: true,
|
|
24
24
|
},
|
|
25
|
+
'org.leadership_granted': {
|
|
26
|
+
kind: 'org.leadership_granted',
|
|
27
|
+
subject: "You've been added to a team",
|
|
28
|
+
plainTextRequired: true,
|
|
29
|
+
htmlSupported: true,
|
|
30
|
+
},
|
|
25
31
|
'security.alert': {
|
|
26
32
|
kind: 'security.alert',
|
|
27
33
|
subject: 'Security alert for your account',
|
|
@@ -95,7 +101,7 @@ describe('getEmailKindDefinition', () => {
|
|
|
95
101
|
})
|
|
96
102
|
|
|
97
103
|
describe('isValidEmailKind', () => {
|
|
98
|
-
it('returns true for all
|
|
104
|
+
it('returns true for all valid email kinds', () => {
|
|
99
105
|
for (const kind of Object.keys(EMAIL_KINDS)) {
|
|
100
106
|
expect(isValidEmailKind(kind)).toBe(true)
|
|
101
107
|
}
|
package/src/email/registry.ts
CHANGED
|
@@ -76,6 +76,12 @@ export const EMAIL_KINDS = {
|
|
|
76
76
|
plainTextRequired: true,
|
|
77
77
|
htmlSupported: true,
|
|
78
78
|
},
|
|
79
|
+
'org.leadership_granted': {
|
|
80
|
+
kind: 'org.leadership_granted',
|
|
81
|
+
subject: "You've been added to a team",
|
|
82
|
+
plainTextRequired: true,
|
|
83
|
+
htmlSupported: true,
|
|
84
|
+
},
|
|
79
85
|
'security.alert': {
|
|
80
86
|
kind: 'security.alert',
|
|
81
87
|
subject: 'Security alert for your account',
|
package/src/email/types.ts
CHANGED
|
@@ -27,6 +27,7 @@ export type EmailKind =
|
|
|
27
27
|
| 'auth.otp'
|
|
28
28
|
| 'auth.magic_link' // future
|
|
29
29
|
| 'org.invite' // future
|
|
30
|
+
| 'org.leadership_granted'
|
|
30
31
|
| 'security.alert' // future
|
|
31
32
|
| 'chat.shared'
|
|
32
33
|
|
|
@@ -58,6 +59,20 @@ export interface EmailPayloads {
|
|
|
58
59
|
acceptUrl: string
|
|
59
60
|
expiresInDays: number
|
|
60
61
|
}
|
|
62
|
+
'org.leadership_granted': {
|
|
63
|
+
/** Display name of the person who granted access */
|
|
64
|
+
granterName: string
|
|
65
|
+
/** Display name of the recipient (optional; falls back to a neutral greeting) */
|
|
66
|
+
recipientName?: string
|
|
67
|
+
/** Name of the org unit / team the access applies to */
|
|
68
|
+
unitName: string
|
|
69
|
+
/** Human-readable role label the recipient was given */
|
|
70
|
+
roleLabel: 'Leader' | 'Delegate'
|
|
71
|
+
/** Full URL to view the org unit in the app */
|
|
72
|
+
ctaUrl: string
|
|
73
|
+
/** Optional message from the granter, shown in the email and recorded with the grant */
|
|
74
|
+
message?: string
|
|
75
|
+
}
|
|
61
76
|
'security.alert': {
|
|
62
77
|
/** Type of security alert */
|
|
63
78
|
alertType: 'excessive_otp_requests' | 'unusual_login_location'
|
|
@@ -10,6 +10,7 @@ export const openApiRoutes = {
|
|
|
10
10
|
'/api/account/sessions': ['GET'],
|
|
11
11
|
'/api/account/sessions/{sessionId}': ['DELETE'],
|
|
12
12
|
'/api/auth/consent/grant': ['POST'],
|
|
13
|
+
'/api/capabilities': ['GET'],
|
|
13
14
|
'/api/chats': ['GET', 'POST'],
|
|
14
15
|
'/api/chats/by-interaction/{interactionId}': ['GET'],
|
|
15
16
|
'/api/chats/events': ['GET'],
|
package/src/org/schemas.ts
CHANGED
|
@@ -912,6 +912,11 @@ export const CreateDelegationRequestSchema = z.object({
|
|
|
912
912
|
* UI captures a date and sends end-of-day in the user's timezone.
|
|
913
913
|
*/
|
|
914
914
|
expiresAt: z.string().datetime().nullable().optional(),
|
|
915
|
+
/**
|
|
916
|
+
* When true, the granted user is emailed a notification (carrying `note` as
|
|
917
|
+
* the message). Not persisted — it only gates the side-effect email.
|
|
918
|
+
*/
|
|
919
|
+
notify: z.boolean().optional().default(false),
|
|
915
920
|
});
|
|
916
921
|
export type CreateDelegationRequest = z.infer<typeof CreateDelegationRequestSchema>;
|
|
917
922
|
|