feat: add governed nationwide AOI orchestration and CUDA enforcement
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { apiGet, apiPost, apiPut } from './client'
|
||||
import type { AoiOperation, AoiOperationListResponse, AoiOperationPartition } from '../../types'
|
||||
|
||||
export const aoiOperationsApi = {
|
||||
list: (projectId: string): Promise<AoiOperationListResponse> =>
|
||||
apiGet(`/api/v1/projects/${projectId}/aoi-operations`),
|
||||
get: (projectId: string, operationId: string): Promise<AoiOperation> =>
|
||||
apiGet(`/api/v1/projects/${projectId}/aoi-operations/${operationId}`),
|
||||
create: (projectId: string, payload: Record<string, unknown>): Promise<AoiOperation> =>
|
||||
apiPost(`/api/v1/projects/${projectId}/aoi-operations`, payload),
|
||||
executeNext: (projectId: string, operationId: string): Promise<AoiOperation> =>
|
||||
apiPost(`/api/v1/projects/${projectId}/aoi-operations/${operationId}/execute-next`, {}),
|
||||
checkpoint: (projectId: string, operationId: string, partitionId: string, checkpoint: Record<string, unknown>): Promise<AoiOperationPartition> =>
|
||||
apiPut(`/api/v1/projects/${projectId}/aoi-operations/${operationId}/partitions/${partitionId}/checkpoint`, { checkpoint_json: checkpoint }),
|
||||
}
|
||||
@@ -56,6 +56,16 @@ export async function apiPatch<T>(path: string, body?: object): Promise<T> {
|
||||
return parseResponse<T>(response);
|
||||
}
|
||||
|
||||
export async function apiPut<T>(path: string, body?: object): Promise<T> {
|
||||
const response = await fetch(apiUrl(path), {
|
||||
method: "PUT",
|
||||
credentials: "same-origin",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: body ? JSON.stringify(body) : undefined,
|
||||
});
|
||||
return parseResponse<T>(response);
|
||||
}
|
||||
|
||||
export async function apiDelete<T>(path: string): Promise<T> {
|
||||
const response = await fetch(apiUrl(path), {
|
||||
method: "DELETE",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export { areasApi } from './areas'
|
||||
export { aoiOperationsApi } from './aoiOperations'
|
||||
export { analysisApi } from './analysis'
|
||||
export { assistantApi } from './assistant'
|
||||
export { datasetsApi } from './datasets'
|
||||
|
||||
Reference in New Issue
Block a user