-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(aap)!: migrate to the new backend and remove deprecations (#2189)
* feat(aap)!: migrate to the new backend and remove deprecations Signed-off-by: Paul Schultz <pschultz@pobox.com> * update docs Signed-off-by: Paul Schultz <pschultz@pobox.com> * update provider Signed-off-by: Paul Schultz <pschultz@pobox.com> * fix config issues Signed-off-by: Paul Schultz <pschultz@pobox.com> * update dist-dynamic Signed-off-by: Paul Schultz <pschultz@pobox.com> * update exports Signed-off-by: Paul Schultz <pschultz@pobox.com> * fix deps Signed-off-by: Paul Schultz <pschultz@pobox.com> * Update plugins/aap-backend/src/providers/AapResourceEntityProvider.ts Co-authored-by: Kashish Mittal <113269381+04kash@users.noreply.github.com> * update readme Signed-off-by: Paul Schultz <pschultz@pobox.com> --------- Signed-off-by: Paul Schultz <pschultz@pobox.com> Co-authored-by: Kashish Mittal <113269381+04kash@users.noreply.github.com>
- Loading branch information
1 parent
1ea2d5a
commit c6f967b
Showing
18 changed files
with
386 additions
and
405 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { createBackend } from '@backstage/backend-defaults'; | ||
|
||
import { catalogModuleAapResourceEntityProvider } from '../src/module'; | ||
|
||
const backend = createBackend(); | ||
|
||
// api endpoints from here: https://github.com/backstage/backstage/blob/master/plugins/catalog-backend/src/service/createRouter.ts | ||
backend.add(import('@backstage/plugin-catalog-backend/alpha')); | ||
backend.add(catalogModuleAapResourceEntityProvider); | ||
|
||
backend.start(); |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,43 @@ | ||
import { JobTemplates } from './types'; | ||
|
||
export function listJobTemplates( | ||
export async function listJobTemplates( | ||
baseUrl: string, | ||
access_token: string, | ||
): Promise<JobTemplates> { | ||
return fetch(`${baseUrl}/api/v2/job_templates`, { | ||
const res = await fetch(`${baseUrl}/api/v2/job_templates`, { | ||
headers: { | ||
'Content-Type': 'application/json', | ||
Authorization: access_token, | ||
}, | ||
method: 'GET', | ||
}).then(async response => { | ||
if (!response.ok) { | ||
throw new Error(response.statusText); | ||
} | ||
const resData = await response.json(); | ||
return resData.results as Promise<JobTemplates>; | ||
}); | ||
|
||
if (!res.ok) { | ||
throw new Error(res.statusText); | ||
} | ||
|
||
const data = (await res.json()) as { results: JobTemplates }; | ||
|
||
return data.results; | ||
} | ||
|
||
export function listWorkflowJobTemplates( | ||
export async function listWorkflowJobTemplates( | ||
baseUrl: string, | ||
access_token: string, | ||
): Promise<JobTemplates> { | ||
return fetch(`${baseUrl}/api/v2/workflow_job_templates`, { | ||
const res = await fetch(`${baseUrl}/api/v2/workflow_job_templates`, { | ||
headers: { | ||
'Content-Type': 'application/json', | ||
Authorization: access_token, | ||
}, | ||
method: 'GET', | ||
}).then(async response => { | ||
if (!response.ok) { | ||
throw new Error(response.statusText); | ||
} | ||
const resData = await response.json(); | ||
return resData.results as Promise<JobTemplates>; | ||
}); | ||
|
||
if (!res.ok) { | ||
throw new Error(res.statusText); | ||
} | ||
|
||
const data = (await res.json()) as { results: JobTemplates }; | ||
|
||
return data.results; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export * from './clients'; | ||
export { catalogModuleAapResourceEntityProvider as default } from './module'; | ||
export * from './providers'; | ||
export * from './dynamic/index'; |
Oops, something went wrong.