Skip to content

Commit

Permalink
Fix TS issues (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
Siegrift authored Sep 24, 2024
1 parent 3a5d349 commit 4c12bd9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/airnode-feed/src/api-requests/data-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { buildAndExecuteRequest, extractAndEncodeResponse } from '@api3/airnode-
import type * as node from '@api3/airnode-node';
import { getReservedParameters } from '@api3/airnode-node/dist/src/adapters/http/parameters';
import { preProcessEndpointParameters, type EndpointParameters, postProcessResponse } from '@api3/commons';
import type { OIS, Endpoint as OisEndpoint } from '@api3/ois';
import type { Endpoint, OIS, Endpoint as OisEndpoint } from '@api3/ois';
import { go, goSync } from '@api3/promise-utils';
import { isEmpty, isNil } from 'lodash';

Expand Down Expand Up @@ -61,7 +61,7 @@ export const makeTemplateRequests = async (signedApiUpdate: SignedApiUpdate): Pr
const operationTemplate = templates[operationTemplateId]!;
const operationEndpoint = endpoints[operationTemplate.endpointId]!;
const ois = oises.find((o) => o.title === operationEndpoint.oisTitle)!;
const operationOisEndpoint = ois.endpoints.find((e) => e.name === operationEndpoint.endpointName)!;
const operationOisEndpoint = ois.endpoints.find((e: Endpoint) => e.name === operationEndpoint.endpointName)!;
const endpointParameters = operationTemplate.parameters.reduce((acc, parameter) => {
return {
...acc,
Expand All @@ -84,7 +84,7 @@ export const makeTemplateRequests = async (signedApiUpdate: SignedApiUpdate): Pr
const templateResponsePromises = templateIds.map(async (templateId) => {
const template = templates[templateId]!;
const endpoint = endpoints[template.endpointId]!;
const oisEndpoint = ois.endpoints.find((e) => e.name === endpoint.endpointName)!;
const oisEndpoint = ois.endpoints.find((e: Endpoint) => e.name === endpoint.endpointName)!;

const endpointParameters = template.parameters.reduce((acc, parameter) => {
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/airnode-feed/src/validation/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export const signedApisSchema = z
}
});

export const oisesSchema = z.array(oisSchema);
export const oisesSchema = z.array(oisSchema as any); // Casting to "any" because TS falsely complains.

export const apisCredentialsSchema = z.array(config.apiCredentialsSchema);

Expand Down

0 comments on commit 4c12bd9

Please sign in to comment.