-
Service
↳
default
- CreateRepo
- DeleteRepo
- DeleteRequest
- GetData
- GetDataset
- GetDatasetTagsByType
- GetDatasets
- GetHeaders
- GetMetrics
- GetModel
- GetModelTagsByType
- GetModels
- GetRequest
- GetSpace
- GetSpaces
- MoveRepo
- PatchRequest
- PostRequest
- PutRequest
- UpdateRepoVisibility
- UploadFile
- WhoAmI
- getUri
• new default(accessToken?
, transformHeaders?
, baseUrl?
)
Name | Type | Default value |
---|---|---|
accessToken? |
string |
undefined |
transformHeaders |
(headers : Headers ) => Headers |
undefined |
baseUrl |
string |
'https://huggingface.co/api' |
Service.constructor
• Optional
accessToken: string
Service.accessToken
• Readonly
baseUrl: string
= 'https://huggingface.co/api'
Service.baseUrl
• transformHeaders: (headers
: Headers
) => Headers
▸ (headers
): Headers
Name | Type |
---|---|
headers |
Headers |
Headers
Service.transformHeaders
▸ CreateRepo(data
): ResponseType
<any
>
Name | Type |
---|---|
data |
any |
ResponseType
<any
>
▸ DeleteRepo(data
): ResponseType
<any
>
Name | Type |
---|---|
data |
any |
ResponseType
<any
>
▸ DeleteRequest(uri
, body
, params?
): Promise
<any
>
Name | Type |
---|---|
uri |
string |
body |
any |
params? |
Params |
Promise
<any
>
Service.DeleteRequest
▸ Protected
GetData(response
): Promise
<{ data
: Promise
<unknown
> ; nextUrl
: undefined
| string
; total
: null
| string
}>
Name | Type |
---|---|
response |
Response |
Promise
<{ data
: Promise
<unknown
> ; nextUrl
: undefined
| string
; total
: null
| string
}>
Service.GetData
▸ GetDataset(datasetId
, params?
): ResponseType
<Dataset
>
Name | Type |
---|---|
datasetId |
string |
params? |
Params |
ResponseType
<Dataset
>
▸ GetDatasetTagsByType(): ResponseType
<Tag
[]>
ResponseType
<Tag
[]>
▸ GetDatasets(params?
): ResponseType
<Dataset
[]>
Name | Type |
---|---|
params? |
Params |
ResponseType
<Dataset
[]>
▸ Protected
GetHeaders(): Headers
Headers
Service.GetHeaders
▸ GetMetrics(): ResponseType
<Metric
[]>
ResponseType
<Metric
[]>
▸ GetModel(modelId
, params?
): ResponseType
<Model
>
Name | Type |
---|---|
modelId |
string |
params? |
Params |
ResponseType
<Model
>
▸ GetModelTagsByType(): ResponseType
<Tag
[]>
ResponseType
<Tag
[]>
▸ GetModels(params?
): ResponseType
<Model
[]>
Name | Type |
---|---|
params? |
Params |
ResponseType
<Model
[]>
▸ GetRequest(uri
, params?
): Promise
<any
>
Name | Type |
---|---|
uri |
string |
params? |
Params |
Promise
<any
>
Service.GetRequest
▸ GetSpace(spaceId
, params?
): ResponseType
<Space
>
Name | Type |
---|---|
spaceId |
string |
params? |
Params |
ResponseType
<Space
>
▸ GetSpaces(params?
): ResponseType
<Space
[]>
Name | Type |
---|---|
params? |
Params |
ResponseType
<Space
[]>
▸ MoveRepo(data
): ResponseType
<any
>
Name | Type |
---|---|
data |
any |
ResponseType
<any
>
▸ PatchRequest(uri
, body
, params?
): Promise
<any
>
Name | Type |
---|---|
uri |
string |
body |
any |
params? |
Params |
Promise
<any
>
Service.PatchRequest
▸ PostRequest(uri
, body
, params?
): Promise
<any
>
Name | Type |
---|---|
uri |
string |
body |
any |
params? |
Params |
Promise
<any
>
Service.PostRequest
▸ PutRequest(uri
, body
, params?
): Promise
<any
>
Name | Type |
---|---|
uri |
string |
body |
any |
params? |
Params |
Promise
<any
>
Service.PutRequest
▸ UpdateRepoVisibility(type
, repo_id
, data
): ResponseType
<any
>
Name | Type |
---|---|
type |
string |
repo_id |
string |
data |
Object |
data.private |
any |
ResponseType
<any
>
▸ UploadFile(type
, repo_id
, revision
, path_in_repo
, data
): ResponseType
<any
>
Name | Type |
---|---|
type |
string |
repo_id |
string |
revision |
any |
path_in_repo |
string |
data |
any |
ResponseType
<any
>
▸ WhoAmI(): ResponseType
<User
>
ResponseType
<User
>
▸ Protected
getUri(uri
, params?
): string
Name | Type |
---|---|
uri |
string |
params |
Params |
string
Service.getUri