(options: {
readonly userAgentProduct: string;
readonly version: string;
readonly userAgentSuffix?: string | undefined;
})
| 82 | } |
| 83 | |
| 84 | export function createKimiUserAgent(options: { |
| 85 | readonly userAgentProduct: string; |
| 86 | readonly version: string; |
| 87 | readonly userAgentSuffix?: string | undefined; |
| 88 | }): string { |
| 89 | const product = requiredAsciiHeader(options.userAgentProduct, 'Kimi identity product'); |
| 90 | const version = requiredAsciiHeader(options.version, 'Kimi identity version'); |
| 91 | const suffix = |
| 92 | options.userAgentSuffix === undefined ? undefined : asciiHeader(options.userAgentSuffix, ''); |
| 93 | return suffix === undefined || suffix.length === 0 |
| 94 | ? `${product}/${version}` |
| 95 | : `${product}/${version} (${suffix})`; |
| 96 | } |
| 97 | |
| 98 | export function createKimiDefaultHeaders(options: KimiIdentityOptions): Record<string, string> { |
| 99 | return { |
no test coverage detected