fix(tools): handle binary file downloads in tool execution #850
ci.yaml
on: pull_request
coverage
deploy-coverage
0s
Annotations
11 errors
|
lint
Process completed with exit code 1.
|
|
[root] src/rpc-client.test.ts > should omit defender_config from payload when not provided:
src/rpc-client.test.ts#L161
TypeCheckError: Property 'data' does not exist on type 'BinaryDownloadResult | { [x string] unknown; next? string | null | undefined; data? Record<string, unknown> | Record<string, unknown>[] | null | undefined; }'.
Property 'data' does not exist on type 'BinaryDownloadResult'.
❯ src/rpc-client.test.ts:161:19
|
|
[root] src/rpc-client.test.ts > should forward defender_config in request payload:
src/rpc-client.test.ts#L146
TypeCheckError: Property 'data' does not exist on type 'BinaryDownloadResult | { [x string] unknown; next? string | null | undefined; data? Record<string, unknown> | Record<string, unknown>[] | null | undefined; }'.
Property 'data' does not exist on type 'BinaryDownloadResult'.
❯ src/rpc-client.test.ts:146:18
|
|
[root] src/rpc-client.test.ts > should send x-account-id as HTTP header:
src/rpc-client.test.ts#L129
TypeCheckError: Property 'data' does not exist on type 'BinaryDownloadResult | { [x string] unknown; next? string | null | undefined; data? Record<string, unknown> | Record<string, unknown>[] | null | undefined; }'.
Property 'data' does not exist on type 'BinaryDownloadResult'.
❯ src/rpc-client.test.ts:129:18
|
|
[root] src/rpc-client.test.ts > should handle list actions with array data:
src/rpc-client.test.ts#L67
TypeCheckError: Property 'data' does not exist on type 'BinaryDownloadResult | { [x string] unknown; next? string | null | undefined; data? Record<string, unknown> | Record<string, unknown>[] | null | undefined; }'.
Property 'data' does not exist on type 'BinaryDownloadResult'.
❯ src/rpc-client.test.ts:67:18
|
|
[root] src/rpc-client.test.ts > should handle list actions with array data:
src/rpc-client.test.ts#L66
TypeCheckError: Property 'data' does not exist on type 'BinaryDownloadResult | { [x string] unknown; next? string | null | undefined; data? Record<string, unknown> | Record<string, unknown>[] | null | undefined; }'.
Property 'data' does not exist on type 'BinaryDownloadResult'.
❯ src/rpc-client.test.ts:66:32
|
|
[root] src/rpc-client.test.ts > should send correct payload structure:
src/rpc-client.test.ts#L44
TypeCheckError: Property 'data' does not exist on type 'BinaryDownloadResult | { [x string] unknown; next? string | null | undefined; data? Record<string, unknown> | Record<string, unknown>[] | null | undefined; }'.
Property 'data' does not exist on type 'BinaryDownloadResult'.
❯ src/rpc-client.test.ts:44:18
|
|
[root] src/rpc-client.test.ts > should successfully execute an RPC action:
src/rpc-client.test.ts#L23
TypeCheckError: Property 'data' does not exist on type 'BinaryDownloadResult | { [x string] unknown; next? string | null | undefined; data? Record<string, unknown> | Record<string, unknown>[] | null | undefined; }'.
Property 'data' does not exist on type 'BinaryDownloadResult'.
❯ src/rpc-client.test.ts:23:18
|
|
[root] src/requestBuilder.test.ts > RequestBuilder - binary file downloads > treats a response with no Content-Type as opaque bytes, not JSON:
src/requestBuilder.test.ts#L895
TypeCheckError: Conversion of type 'string | number | boolean | JsonValue[] | readonly JsonValue[] | (string & { [x string] JsonValue; } & { [x string] JsonValue | undefined; }) | ... 30 more ... | null' to type 'Buffer<ArrayBufferLike>' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Type 'readonly JsonValue[] & JsonValue[]' is missing the following properties from type 'Buffer<ArrayBufferLike>' subarray, write, toJSON, equals, and 73 more.
❯ src/requestBuilder.test.ts:895:11
|
|
[root] src/requestBuilder.test.ts > RequestBuilder - binary file downloads > returns bytes with fileName null when there is no Content-Disposition:
src/requestBuilder.test.ts#L844
TypeCheckError: Conversion of type 'string | number | boolean | JsonValue[] | readonly JsonValue[] | (string & { [x string] JsonValue; } & { [x string] JsonValue | undefined; }) | ... 30 more ... | null' to type 'Buffer<ArrayBufferLike>' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Type 'readonly JsonValue[] & JsonValue[]' is missing the following properties from type 'Buffer<ArrayBufferLike>' subarray, write, toJSON, equals, and 73 more.
❯ src/requestBuilder.test.ts:844:11
|
|
[root] src/requestBuilder.test.ts > RequestBuilder - binary file downloads > returns raw bytes + metadata for a non-JSON (binary) response:
src/requestBuilder.test.ts#L821
TypeCheckError: Conversion of type 'string | number | boolean | JsonValue[] | readonly JsonValue[] | (string & { [x string] JsonValue; } & { [x string] JsonValue | undefined; }) | ... 30 more ... | null' to type 'Buffer<ArrayBufferLike>' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Type 'readonly JsonValue[] & JsonValue[]' is missing the following properties from type 'Buffer<ArrayBufferLike>' subarray, write, toJSON, equals, and 73 more.
❯ src/requestBuilder.test.ts:821:11
|