-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
11 changed files
with
40 additions
and
150 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,8 @@ | ||
import { HttpService } from '@dbc-tech/http-kit' | ||
import { ActionStepTokenClient } from './types/action-step-auth.type' | ||
import { ActionStepData } from './dtos/actions.dto' | ||
import { ActionIds } from './dtos/action-ids.dto' | ||
import { CreateFileNotes } from './dtos/create-file-notes.dto' | ||
import { actionsClient } from './api/actions' | ||
|
||
export const actionStepClient = (auth: ActionStepTokenClient) => { | ||
const http = new HttpService( | ||
auth.apiapi_url, | ||
async () => (await auth.token()).access_token, | ||
) | ||
export const actionStepClient = (tokenClient: ActionStepTokenClient) => { | ||
return { | ||
getActions: async (id: string): Promise<ActionStepData> => { | ||
const response = await http.getJson<ActionStepData>(`rest/actions/${id}`) | ||
return response.data | ||
}, | ||
getLatestActions: async (pageSize: number): Promise<ActionIds> => { | ||
const response = await http.getJson<ActionIds>( | ||
`rest/actions?sort=-id&pageSize=${pageSize}&fields=id`, | ||
) | ||
return response.data | ||
}, | ||
createFileNotes: async (filenotes: CreateFileNotes): Promise<unknown> => { | ||
const response = await http.postJson<unknown>(`rest/filenotes`, filenotes) | ||
return response.data | ||
}, | ||
actions: actionsClient(tokenClient), | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export * from './actions' | ||
export * from './actions-schema' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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