diff --git a/lib/facts/blob-service.js b/lib/facts/blob-service.js --- a/lib/facts/blob-service.js +++ b/lib/facts/blob-service.js @@ -2,16 +2,21 @@ import { isDev } from '../utils/dev-utils.js'; -type BlobServicePath = '/blob/:blobHash' | '/blob' | '/holders'; - -export type BlobServiceHTTPEndpoint = { - +path: BlobServicePath, - +method: 'GET' | 'POST' | 'PUT' | 'DELETE', +type BlobHTTPEndpoints = { + GET_BLOB: { +path: '/blob/:blobHash', +method: 'GET' }, + ASSIGN_HOLDER: { +path: '/blob', +method: 'POST' }, + ASSIGN_MULTIPLE_HOLDERS: { +path: '/holders', +method: 'POST' }, + UPLOAD_BLOB: { +path: '/blob', +method: 'PUT' }, + DELETE_BLOB: { +path: '/blob', +method: 'DELETE' }, + REMOVE_MULTIPLE_HOLDERS: { +path: '/holders', +method: 'DELETE' }, }; +export type BlobServiceHTTPEndpoint = + BlobHTTPEndpoints[$Keys]; + type BlobServiceConfig = { +url: string, - +httpEndpoints: { +[endpoint: string]: BlobServiceHTTPEndpoint }, + +httpEndpoints: BlobHTTPEndpoints, }; const httpEndpoints = Object.freeze({