(params: { apiKey?: string })
| 97 | * always carry full `{metadata, data}` payload objects that {@link decodePayload} understands. |
| 98 | */ |
| 99 | export function temporalRequestHeaders(params: { apiKey?: string }): Record<string, string> { |
| 100 | const headers: Record<string, string> = { |
| 101 | 'Content-Type': 'application/json', |
| 102 | Accept: 'application/json+no-payload-shorthand', |
| 103 | } |
| 104 | if (params.apiKey) headers.Authorization = `Bearer ${params.apiKey.trim()}` |
| 105 | return headers |
| 106 | } |
| 107 | |
| 108 | /** Encodes a single JSON value as a Temporal `json/plain` payload. */ |
| 109 | export function encodePayload(value: unknown): TemporalPayload { |
no outgoing calls
no test coverage detected