0.15.2 • Published 11 months ago

@blackglory/refile-js v0.15.2

Weekly downloads
96
License
MIT
Repository
github
Last release
11 months ago

refile-js

Install

npm install --save @blackglory/refile-js
# or
yarn add @blackglory/refile-js

API

getFileHash

function getFileHash(blobOrFilename: Blob | string): Promise<string>

RefileClient

interface IFileInfo {
  hash: string
  location: string | null
  references: number
}

interface IRefileClientOptions {
  server: string
  basicAuth?: {
    username: string
    password: string
  }
  keepalive?: boolean
  timeout?: number
}

interface IRefileClientRequestOptions {
  signal?: AbortSignal
  keepalive?: boolean
  timeout?: number | false
}

class RefileClient {
  constructor(options: IRefileClientOptions)

  uploadFile(
    blobOrFilename: Blob | string
  , options?: IRefileClientRequestOptions
  ): Promise<void>

  getFileInfo(hash: string, options?: IRefileClientRequestOptions): Promise<IFileInfo>

  getFileLocation(
    hash: string
  , options?: IRefileClientRequestOptions
  ): Promise<string | undefined>

  setReference(
    namespace: string
  , itemId: string
  , fileHash: string
  , options?: IRefileClientRequestOptions
  ): Promise<void>

  removeReference(
    namespace: string
  , itemId: string
  , fileHash: string
  , options?: IRefileClientRequestOptions
  ): Promise<void>

  removeReferencesByItemId(
    namespace: string
  , itemId: string
  , options?: IRefileClientRequestOptions
  ): Promise<void>

  removeReferencesByNamespace(
    namespace: string
  , options?: IRefileClientRequestOptions
  ): Promise<void>

  getAllNamespaces(options?: IRefileClientRequestOptions): Promise<string[]>

  getAllItemIds(namespace: string, options?: IRefileClientRequestOptions): Promise<string[]>

  getFileHashesByItemId(
    namespace: string
  , itemId: string
  , options?: IRefileClientRequestOptions
  ): Promise<string[]>

  getItemIdsByFileHash(
    fileHash: string
  , namespace: string
  , options?: IRefileClientRequestOptions
  ): Promise<string[]>

  collectGarbage(options?: IRefileClientRequestOptions): Promise<void>
}
0.15.2

11 months ago

0.15.1

1 year ago

0.13.0

1 year ago

0.13.1

1 year ago

0.15.0

1 year ago

0.14.0

1 year ago

0.11.0

2 years ago

0.11.1

2 years ago

0.11.2

2 years ago

0.11.3

1 year ago

0.12.0

1 year ago

0.10.5

2 years ago

0.10.6

2 years ago

0.10.3

2 years ago

0.10.4

2 years ago

0.10.2

2 years ago

0.10.1

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.10.0

2 years ago

0.9.0

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.5.0

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.4.11

3 years ago

0.4.12

3 years ago

0.4.8

3 years ago

0.4.10

3 years ago

0.4.7

3 years ago

0.4.6

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.12

3 years ago

0.1.11

3 years ago

0.1.10

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.9

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago