@company-semantics/contracts 1.17.0 → 1.18.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.
|
|
3
|
+
"version": "1.18.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -112,17 +112,17 @@
|
|
|
112
112
|
"node": "22.x"
|
|
113
113
|
},
|
|
114
114
|
"dependencies": {
|
|
115
|
-
"zod": "^4.
|
|
115
|
+
"zod": "^4.4.1"
|
|
116
116
|
},
|
|
117
117
|
"devDependencies": {
|
|
118
118
|
"@types/node": "^25.6.0",
|
|
119
119
|
"husky": "^9.1.7",
|
|
120
120
|
"lint-staged": "^16.4.0",
|
|
121
|
-
"markdownlint-cli2": "^0.22.
|
|
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.
|
|
125
|
+
"vitest": "^4.1.5",
|
|
126
126
|
"yaml": "^2.8.3"
|
|
127
127
|
},
|
|
128
128
|
"pnpm": {
|
|
@@ -29,9 +29,14 @@ export {
|
|
|
29
29
|
ImpersonationSessionResponseSchema,
|
|
30
30
|
ImpersonationSessionNullableResponseSchema,
|
|
31
31
|
EndImpersonationResponseSchema,
|
|
32
|
+
ImpersonationSessionWireDtoSchema,
|
|
32
33
|
} from './schemas'
|
|
33
34
|
|
|
34
35
|
export type {
|
|
35
36
|
ImpersonationSessionResponse,
|
|
36
37
|
EndImpersonationResponse,
|
|
38
|
+
ImpersonationSessionWireDtoParsed,
|
|
37
39
|
} from './schemas'
|
|
40
|
+
|
|
41
|
+
// Wire DTO for SSE projection (PRD-00557 F5)
|
|
42
|
+
export type { ImpersonationSessionWireDto } from '../impersonation-events'
|
|
@@ -36,5 +36,24 @@ export const EndImpersonationResponseSchema = z.object({
|
|
|
36
36
|
ok: z.literal(true),
|
|
37
37
|
})
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Wire-only DTO for SSE snapshot/started events (PRD-00557 F5).
|
|
41
|
+
*
|
|
42
|
+
* .strict() rejects extraneous keys so a backend regression that leaks
|
|
43
|
+
* reason / reasonHash / ipAddress / userAgent is caught at the contract
|
|
44
|
+
* boundary, not at the network. This complements the type-level
|
|
45
|
+
* narrowing in src/impersonation-events.ts.
|
|
46
|
+
*/
|
|
47
|
+
export const ImpersonationSessionWireDtoSchema = z
|
|
48
|
+
.object({
|
|
49
|
+
id: z.string(),
|
|
50
|
+
targetUserId: z.string(),
|
|
51
|
+
startedAt: z.string().datetime({ offset: true }),
|
|
52
|
+
expiresAt: z.string().datetime({ offset: true }),
|
|
53
|
+
endedAt: z.string().datetime({ offset: true }).nullable(),
|
|
54
|
+
})
|
|
55
|
+
.strict()
|
|
56
|
+
|
|
39
57
|
export type ImpersonationSessionResponse = z.infer<typeof ImpersonationSessionResponseSchema>
|
|
40
58
|
export type EndImpersonationResponse = z.infer<typeof EndImpersonationResponseSchema>
|
|
59
|
+
export type ImpersonationSessionWireDtoParsed = z.infer<typeof ImpersonationSessionWireDtoSchema>
|
|
@@ -7,7 +7,19 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { BaseEvent } from './chat/types'
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Minimal projection of an impersonation session for over-the-wire delivery.
|
|
13
|
+
* Excludes reason, reasonHash, ipAddress, userAgent — those stay server-side
|
|
14
|
+
* (PRD-00557 F5: type-impossible wire exposure of admin-private fields).
|
|
15
|
+
*/
|
|
16
|
+
export interface ImpersonationSessionWireDto {
|
|
17
|
+
readonly id: string
|
|
18
|
+
readonly targetUserId: string
|
|
19
|
+
readonly startedAt: string
|
|
20
|
+
readonly expiresAt: string
|
|
21
|
+
readonly endedAt: string | null
|
|
22
|
+
}
|
|
11
23
|
|
|
12
24
|
/**
|
|
13
25
|
* Sent as the first frame on SSE connection.
|
|
@@ -17,7 +29,7 @@ import type { ImpersonationSession } from './impersonation'
|
|
|
17
29
|
export interface ImpersonationSessionSnapshotEvent extends BaseEvent {
|
|
18
30
|
type: 'impersonation.session.snapshot'
|
|
19
31
|
data: {
|
|
20
|
-
session:
|
|
32
|
+
session: ImpersonationSessionWireDto | null
|
|
21
33
|
}
|
|
22
34
|
}
|
|
23
35
|
|
|
@@ -25,7 +37,7 @@ export interface ImpersonationSessionSnapshotEvent extends BaseEvent {
|
|
|
25
37
|
export interface ImpersonationSessionStartedEvent extends BaseEvent {
|
|
26
38
|
type: 'impersonation.session.started'
|
|
27
39
|
data: {
|
|
28
|
-
session:
|
|
40
|
+
session: ImpersonationSessionWireDto
|
|
29
41
|
}
|
|
30
42
|
}
|
|
31
43
|
|