-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9626f7e
commit f556068
Showing
8 changed files
with
250 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
libs/shinkai-node-state/src/v2/queries/getRecurringTaskNextExecutionTime/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { getRecurringTasksExecutionTime as getRecurringTaskExecutionTimeApi } from '@shinkai_network/shinkai-message-ts/api/recurring-tasks/index'; | ||
|
||
import type { GetRecurringTasksNextExecutionTimeInput } from './types'; | ||
|
||
export const getRecurringTasksExecutionTime = async ({ | ||
nodeAddress, | ||
token, | ||
}: GetRecurringTasksNextExecutionTimeInput) => { | ||
const result = await getRecurringTaskExecutionTimeApi(nodeAddress, token); | ||
return result; | ||
}; |
8 changes: 8 additions & 0 deletions
8
libs/shinkai-node-state/src/v2/queries/getRecurringTaskNextExecutionTime/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Token } from '@shinkai_network/shinkai-message-ts/api/general/types'; | ||
import { GetRecurringTaskResponse } from '@shinkai_network/shinkai-message-ts/api/recurring-tasks/types'; | ||
|
||
export type GetRecurringTasksNextExecutionTimeInput = Token & { | ||
nodeAddress: string; | ||
}; | ||
|
||
export type GetRecurringTasksNextExecutionTimeOutput = GetRecurringTaskResponse; |
15 changes: 15 additions & 0 deletions
15
.../src/v2/queries/getRecurringTaskNextExecutionTime/useGetRecurringTaskNextExecutionTime.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
import { FunctionKeyV2 } from '../../constants'; | ||
import { getRecurringTasksExecutionTime } from './index'; | ||
import { GetRecurringTasksNextExecutionTimeInput } from './types'; | ||
|
||
export const useGetRecurringTaskNextExecutionTime = ( | ||
input: GetRecurringTasksNextExecutionTimeInput, | ||
) => { | ||
const response = useQuery({ | ||
queryKey: [FunctionKeyV2.GET_RECURRING_TASK, input], | ||
queryFn: () => getRecurringTasksExecutionTime(input), | ||
}); | ||
return response; | ||
}; |
Oops, something went wrong.