diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index b0b7e03..7fc4f21 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -21,7 +21,7 @@ jobs: - name: Checkout threatmap uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: - repository: threatmap/threatmap + repository: threatcode/threatmap ref: ${{ env.THREATMAP_REF }} path: ./threatmap token: ${{ env.THREATMAP_GITHUB_TOKEN }} diff --git a/.github/workflows/publish-release-github.yml b/.github/workflows/publish-release-github.yml index e961383..6fc7a6e 100644 --- a/.github/workflows/publish-release-github.yml +++ b/.github/workflows/publish-release-github.yml @@ -37,7 +37,7 @@ jobs: - name: Checkout immutable release tag uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: - repository: threatmap/threatmap + repository: threatcode/threatmap ref: ${{ env.RELEASE_REF }} fetch-depth: 0 fetch-tags: true diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 9aa85e1..42bd76c 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -37,7 +37,7 @@ jobs: - name: Checkout immutable release tag uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: - repository: threatmap/threatmap + repository: threatcode/threatmap ref: ${{ env.RELEASE_REF }} fetch-depth: 0 fetch-tags: true diff --git a/knip.config.ts b/knip.config.ts index 506dfd9..053c8fe 100644 --- a/knip.config.ts +++ b/knip.config.ts @@ -11,8 +11,10 @@ const config: KnipConfig = { "packages/sdk/sdk-workflow/**", "packages/ui/tokens/src/__generated__/**", "packages/ui/tokens/src/vendor/**", + "packages/plugins/*/backend/src/types.ts", ], workspaces: { + "packages/sdk/sdk-client": { project: ["src/**/*.ts!", "tests/**/*.ts!"], ignore: ["src/**/__generated__/**"], diff --git a/packages/plugins/autorize/backend/src/api/index.ts b/packages/plugins/autorize/backend/src/api/index.ts new file mode 100644 index 0000000..bb858f9 --- /dev/null +++ b/packages/plugins/autorize/backend/src/api/index.ts @@ -0,0 +1,155 @@ +import type { + RequestResponseResult, + TemplateExportData, +} from "../../../src/export.js"; +import type { APIResult, Config, Template } from "../../../src/index.js"; +import type { AutorizeStore } from "../stores/autorizeStore.js"; +import type { BackendSDK } from "../types.js"; + +const ok = (value: T): APIResult => ({ kind: "Ok", value }); +const err = (error: string): APIResult => ({ kind: "Error", error }); + +export const apiGetTemplates = + (store: AutorizeStore) => (): APIResult => + ok(store.listTemplates()); + +export const apiGetTemplate = + (store: AutorizeStore) => + (_sdk: BackendSDK, id: number): APIResult