Skip to content

Commit cf7cd60

Browse files
committed
[refactor]: update task interfaces and imports to match changes in libs used
- Changed `TaskIO` to `TaskOutput` in `SecFetchTask` for improved type clarity. - Rearranged imports in `ProcessAccessionDocFormTask` for better organization. - Extended `SecFetchAccessionDocTaskInput` to implement `TaskInput` for enhanced functionality. - Updated type definitions in `FetchQuarterlyIndexRangeTask` to use `GraphResult` for better type safety.
1 parent 1bea949 commit cf7cd60

4 files changed

Lines changed: 15 additions & 8 deletions

File tree

src/fetch/SecFetchTask.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// * Licensed under the Apache License, Version 2.0 (the "License"); *
66
// *******************************************************************************
77

8-
import { JobQueueTaskConfig, TaskIO } from "@podley/task-graph";
8+
import { JobQueueTaskConfig, TaskOutput } from "@podley/task-graph";
99
import { FetchTask, FetchTaskInput, FetchTaskOutput } from "@podley/tasks";
1010
import { SecJobQueueName, SecUserAgent } from "../config/Constants";
1111
import { SecFetchJob } from "./SecFetchJob";
@@ -15,7 +15,7 @@ import { SecFetchJob } from "./SecFetchJob";
1515
*/
1616
export class SecFetchTask<
1717
Input extends FetchTaskInput = FetchTaskInput,
18-
Output extends TaskIO = FetchTaskOutput,
18+
Output extends TaskOutput = FetchTaskOutput,
1919
Config extends JobQueueTaskConfig = JobQueueTaskConfig
2020
> extends FetchTask<Input, Output, Config> {
2121
constructor(input: FetchTaskInput = {} as FetchTaskInput, config: Config = {} as Config) {

src/task/forms/ProcessAccessionDocFormTask.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
// *******************************************************************************
77

88
import { IExecuteContext, Task, TaskError, Workflow } from "@podley/task-graph";
9+
import { FetchTaskOutput } from "@podley/tasks";
910
import { Static, TObject, Type } from "@sinclair/typebox";
11+
import { ALL_FORMS_MAP } from "../../sec/forms/all-forms";
12+
import { TypeSecCik } from "../../sec/submissions/EnititySubmissionSchema";
1013
import { query_get, query_run } from "../../util/db";
1114
import { SecFetchAccessionDocTask } from "./SecFetchAccessionDocTask";
12-
import { TypeSecCik } from "../../sec/submissions/EnititySubmissionSchema";
13-
import { FetchTaskOutput } from "@podley/tasks";
14-
import { ALL_FORMS_MAP } from "../../sec/forms/all-forms";
1515

1616
const ProcessAccessionDocFormTaskInputSchema = () =>
1717
Type.Object({

src/task/forms/SecFetchAccessionDocTask.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { TypeSecCik } from "../../sec/submissions/EnititySubmissionSchema";
1212

1313
// NOTE: accession documents are immutable, so we don't need to pass in a date for invalidation
1414

15-
export interface SecFetchAccessionDocTaskInput {
15+
export interface SecFetchAccessionDocTaskInput extends TaskInput {
1616
cik: number;
1717
accessionNumber: string;
1818
fileName: string;

src/task/index/FetchQuarterlyIndexRangeTask.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
// * Licensed under the Apache License, Version 2.0 (the "License"); *
66
// *******************************************************************************
77

8-
import { IExecuteContext, NamedGraphResult, Task, TaskGraph } from "@podley/task-graph";
8+
import {
9+
IExecuteContext,
10+
GraphResult,
11+
Task,
12+
TaskGraph,
13+
GRAPH_RESULT_ARRAY,
14+
} from "@podley/task-graph";
915
import { FetchQuarterlyIndexTask, FetchQuarterlyIndexTaskOutput } from "./FetchQuarterlyIndexTask";
1016
import { TypeSecCik } from "../../sec/submissions/EnititySubmissionSchema";
1117
import { TypeDateTime } from "@podley/util";
@@ -103,7 +109,8 @@ export class FetchQuarterlyIndexRangeTask extends Task<
103109
tasks.addTask(task);
104110
}
105111

106-
const results: NamedGraphResult<FetchQuarterlyIndexTaskOutput> = await tasks.run();
112+
const results: GraphResult<FetchQuarterlyIndexTaskOutput, typeof GRAPH_RESULT_ARRAY> =
113+
await tasks.run();
107114

108115
const updateList: Record<number, string> = {};
109116
for (const result of results) {

0 commit comments

Comments
 (0)