(input: unknown)
| 299 | } |
| 300 | |
| 301 | function parseExternalInputActor(input: unknown): ParsedExternalInputActor | undefined { |
| 302 | if (!input || typeof input !== "object") { |
| 303 | return undefined; |
| 304 | } |
| 305 | const value = input as Record<string, unknown>; |
| 306 | if (value.actorType !== "user" && value.actorType !== "external_guest") { |
| 307 | return undefined; |
| 308 | } |
| 309 | return { |
| 310 | actorType: value.actorType, |
| 311 | ...(typeof value.userId === "string" ? { userId: value.userId } : {}), |
| 312 | ...(typeof value.externalActorReference === "string" ? { externalActorReference: value.externalActorReference } : {}), |
| 313 | ...(typeof value.externalGuestPermissionProfile === "string" ? { externalGuestPermissionProfile: value.externalGuestPermissionProfile } : {}), |
| 314 | ...(Array.isArray(value.externalGuestRequireIdentityFor) |
| 315 | ? { |
| 316 | externalGuestRequireIdentityFor: value.externalGuestRequireIdentityFor |
| 317 | .filter((item): item is string => typeof item === "string" && item.trim().length > 0), |
| 318 | } |
| 319 | : {}), |
| 320 | ...(typeof value.agentId === "string" ? { agentId: value.agentId } : {}), |
| 321 | ...(typeof value.botBindingId === "string" ? { botBindingId: value.botBindingId } : {}), |
| 322 | }; |
| 323 | } |
| 324 | |
| 325 | function parseWorkspaceDataPolicyDecision(input: unknown): WorkspaceDataPolicyDecision | undefined { |
| 326 | if (!input || typeof input !== "object") { |
no outgoing calls
no test coverage detected