Expand scoped demo analysis access
This commit is contained in:
@@ -29,21 +29,21 @@ export const detectionApi = {
|
||||
getYoloPreflight: (params: { tile_manifest_path?: string | null; check_model_load?: boolean | null; model_asset_id?: string | null } = {}): Promise<YoloPreflightResponse> =>
|
||||
apiGet<YoloPreflightResponse>(`/api/v1/detection/yolo/preflight${queryString(params)}`),
|
||||
run: (payload: DetectionRunRequest): Promise<DetectionRunResponse> =>
|
||||
apiPost<DetectionRunResponse>('/api/v1/detection/run', payload),
|
||||
apiPost<DetectionRunResponse>(`/api/v1/detection/run?project_id=${encodeURIComponent(payload.project_id)}`, payload),
|
||||
listRuns: (params: { project_id?: string | null; dataset_id?: string | null } = {}): Promise<DetectionRunListResponse> =>
|
||||
apiGet<DetectionRunListResponse>(`/api/v1/detection/runs${queryString(params)}`),
|
||||
getRun: (analysisRunId: string): Promise<DetectionRunRead> =>
|
||||
apiGet<DetectionRunRead>(`/api/v1/detection/runs/${analysisRunId}`),
|
||||
listDetections: (
|
||||
analysisRunId: string,
|
||||
params: { dataset_id?: string | null; class_name?: string | null; min_confidence?: number | null } = {},
|
||||
params: { project_id: string; dataset_id?: string | null; class_name?: string | null; min_confidence?: number | null },
|
||||
): Promise<DetectionListResponse> =>
|
||||
apiGet<DetectionListResponse>(`/api/v1/detection/runs/${analysisRunId}/detections${queryString(params)}`),
|
||||
getRunGeoJson: (
|
||||
analysisRunId: string,
|
||||
params: { class_name?: string | null; min_confidence?: number | null } = {},
|
||||
params: { project_id: string; class_name?: string | null; min_confidence?: number | null },
|
||||
): Promise<GeoJSON.FeatureCollection> =>
|
||||
apiGet<GeoJSON.FeatureCollection>(`/api/v1/detection/runs/${analysisRunId}/geojson${queryString(params)}`),
|
||||
compareWithReference: (analysisRunId: string, payload: DetectionQaRequest): Promise<DetectionQaResult> =>
|
||||
apiPost<DetectionQaResult>(`/api/v1/detection/runs/${analysisRunId}/qa/reference`, payload),
|
||||
compareWithReference: (analysisRunId: string, projectId: string, payload: DetectionQaRequest): Promise<DetectionQaResult> =>
|
||||
apiPost<DetectionQaResult>(`/api/v1/detection/runs/${analysisRunId}/qa/reference?project_id=${encodeURIComponent(projectId)}`, payload),
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import type {
|
||||
|
||||
export const exportsApi = {
|
||||
exportGeojson: (
|
||||
projectId: string,
|
||||
payload:
|
||||
| {
|
||||
dataset_id?: string
|
||||
@@ -24,18 +25,20 @@ export const exportsApi = {
|
||||
| string,
|
||||
): Promise<ExportCreateResponse> => {
|
||||
const body = typeof payload === 'string' ? { dataset_id: payload, export_kind: 'dataset' } : payload
|
||||
return apiPost<ExportCreateResponse>(`/api/v1/exports/geojson`, body)
|
||||
return apiPost<ExportCreateResponse>(`/api/v1/exports/geojson?project_id=${encodeURIComponent(projectId)}`, body)
|
||||
},
|
||||
exportProjectMetadata: (projectId: string, name?: string): Promise<ExportCreateResponse> =>
|
||||
apiPost<ExportCreateResponse>(`/api/v1/exports/metadata`, { project_id: projectId, name }),
|
||||
apiPost<ExportCreateResponse>(`/api/v1/exports/metadata?project_id=${encodeURIComponent(projectId)}`, { project_id: projectId, name }),
|
||||
exportProjectReport: (projectId: string, name?: string): Promise<ExportCreateResponse> =>
|
||||
apiPost<ExportCreateResponse>(`/api/v1/exports/report`, { project_id: projectId, name }),
|
||||
apiPost<ExportCreateResponse>(`/api/v1/exports/report?project_id=${encodeURIComponent(projectId)}`, { project_id: projectId, name }),
|
||||
exportMapResult: (payload: MapResultExportRequest): Promise<ExportCreateResponse> =>
|
||||
apiPost<ExportCreateResponse>(`/api/v1/exports/map-result`, payload),
|
||||
apiPost<ExportCreateResponse>(`/api/v1/exports/map-result?project_id=${encodeURIComponent(payload.project_id)}`, payload),
|
||||
listProjectExports: (projectId: string): Promise<ExportListResponse> =>
|
||||
apiGet<ExportListResponse>(`/api/v1/exports/projects/${projectId}/exports`),
|
||||
getExport: (exportId: string): Promise<ExportRead> => apiGet<ExportRead>(`/api/v1/exports/${exportId}`),
|
||||
getContent: (exportId: string): Promise<ExportContentResponse> =>
|
||||
apiGet<ExportContentResponse>(`/api/v1/exports/${exportId}/content`),
|
||||
downloadUrl: (exportId: string): string => apiUrl(`/api/v1/exports/${exportId}/download`),
|
||||
apiGet<ExportListResponse>(`/api/v1/exports/projects/${projectId}/exports?project_id=${encodeURIComponent(projectId)}`),
|
||||
getExport: (projectId: string, exportId: string): Promise<ExportRead> =>
|
||||
apiGet<ExportRead>(`/api/v1/exports/${exportId}?project_id=${encodeURIComponent(projectId)}`),
|
||||
getContent: (projectId: string, exportId: string): Promise<ExportContentResponse> =>
|
||||
apiGet<ExportContentResponse>(`/api/v1/exports/${exportId}/content?project_id=${encodeURIComponent(projectId)}`),
|
||||
downloadUrl: (projectId: string, exportId: string): string =>
|
||||
apiUrl(`/api/v1/exports/${exportId}/download?project_id=${encodeURIComponent(projectId)}`),
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ import type {
|
||||
} from '../../types'
|
||||
|
||||
export const qaApi = {
|
||||
runQa: (payload: QaComparisonRequest): Promise<JobRead> =>
|
||||
apiPost<JobRead>('/api/v1/qa/detections-vs-reference', payload),
|
||||
runQa: (projectId: string, payload: QaComparisonRequest): Promise<JobRead> =>
|
||||
apiPost<JobRead>(`/api/v1/qa/detections-vs-reference?project_id=${encodeURIComponent(projectId)}`, payload),
|
||||
listQualityChecks: (projectId: string): Promise<QualityCheckListResponse> =>
|
||||
apiGet<QualityCheckListResponse>(`/api/v1/projects/${projectId}/quality-checks`),
|
||||
getQualityEvidenceGeoJson: (projectId: string, qualityCheckId: string): Promise<QualityEvidenceGeoJsonResponse> =>
|
||||
|
||||
@@ -24,21 +24,21 @@ function queryString(params: Record<string, string | number | null | undefined>)
|
||||
export const segmentationApi = {
|
||||
listModels: (): Promise<SegmentationModelsResponse> => apiGet<SegmentationModelsResponse>('/api/v1/segmentation/models'),
|
||||
run: (payload: SegmentationRunRequest): Promise<SegmentationRunResponse> =>
|
||||
apiPost<SegmentationRunResponse>('/api/v1/segmentation/run', payload),
|
||||
apiPost<SegmentationRunResponse>(`/api/v1/segmentation/run?project_id=${encodeURIComponent(payload.project_id)}`, payload),
|
||||
listRuns: (params: { project_id?: string | null; dataset_id?: string | null } = {}): Promise<SegmentationRunListResponse> =>
|
||||
apiGet<SegmentationRunListResponse>(`/api/v1/segmentation/runs${queryString(params)}`),
|
||||
getRun: (analysisRunId: string): Promise<SegmentationRunRead> =>
|
||||
apiGet<SegmentationRunRead>(`/api/v1/segmentation/runs/${analysisRunId}`),
|
||||
listSegmentations: (
|
||||
analysisRunId: string,
|
||||
params: { dataset_id?: string | null; class_name?: string | null; min_confidence?: number | null } = {},
|
||||
params: { project_id: string; dataset_id?: string | null; class_name?: string | null; min_confidence?: number | null },
|
||||
): Promise<SegmentationListResponse> =>
|
||||
apiGet<SegmentationListResponse>(`/api/v1/segmentation/runs/${analysisRunId}/segmentations${queryString(params)}`),
|
||||
getRunGeoJson: (
|
||||
analysisRunId: string,
|
||||
params: { class_name?: string | null; min_confidence?: number | null } = {},
|
||||
params: { project_id: string; class_name?: string | null; min_confidence?: number | null },
|
||||
): Promise<GeoJSON.FeatureCollection> =>
|
||||
apiGet<GeoJSON.FeatureCollection>(`/api/v1/segmentation/runs/${analysisRunId}/geojson${queryString(params)}`),
|
||||
compareWithReference: (analysisRunId: string, payload: SegmentationQaRequest): Promise<SegmentationQaResult> =>
|
||||
apiPost<SegmentationQaResult>(`/api/v1/segmentation/runs/${analysisRunId}/qa/reference`, payload),
|
||||
compareWithReference: (analysisRunId: string, projectId: string, payload: SegmentationQaRequest): Promise<SegmentationQaResult> =>
|
||||
apiPost<SegmentationQaResult>(`/api/v1/segmentation/runs/${analysisRunId}/qa/reference?project_id=${encodeURIComponent(projectId)}`, payload),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user