-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a067cf6
commit ea646e0
Showing
46 changed files
with
844 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import {AllocationsOptions} from '../options'; | ||
import {AllocationResult} from '../results'; | ||
|
||
export interface IIpfsAllocationsApi { | ||
list(options: AllocationsOptions): Promise<AllocationResult>; | ||
|
||
get(cid: string): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import {PeerInfo, VersionResult} from '../results'; | ||
import {AddOptions} from '../options'; | ||
import {IIpfsPeersApi} from './IIpfsPeersApi'; | ||
import {IIpfsPinsApi} from './IIpfsPinsApi'; | ||
import {IIpfsAllocationsApi} from './IIpfsAllocationsApi'; | ||
|
||
export interface IIpfsClusterApi { | ||
readonly peers: IIpfsPeersApi; | ||
readonly pins: IIpfsPinsApi; | ||
readonly allocations: IIpfsAllocationsApi; | ||
|
||
/** | ||
* Cluster peer information | ||
* @return {Promise<PeerInfo>} | ||
*/ | ||
id(): Promise<PeerInfo>; | ||
|
||
/** | ||
* Cluster version | ||
*/ | ||
version(): Promise<VersionResult>; | ||
|
||
/** | ||
* Add content to the cluster. | ||
* @param data | ||
* @param {AddOptions} options | ||
* @return {Promise<void>} | ||
*/ | ||
add(data: any, options: AddOptions): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {PeerListResult, RemovePeerResult} from './IpfsPeersApi'; | ||
|
||
export interface IIpfsPeersApi { | ||
/** | ||
* Cluster peers. | ||
*/ | ||
list(): Promise<PeerListResult>; | ||
|
||
/** | ||
* Remove a peer. | ||
* @param {string} peerId | ||
*/ | ||
remove(peerId: string): Promise<RemovePeerResult>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {PinOptions, PinStatusOptions} from '../options'; | ||
|
||
export interface IIpfsPinsApi { | ||
/** | ||
* Local status of all tracked CIDs. | ||
*/ | ||
list(): void; | ||
|
||
status(cid: string, options?: PinStatusOptions): any; | ||
|
||
add(cid: string, options: PinOptions): any; | ||
|
||
remove(cid: string): Promise<any>; | ||
|
||
recover(cid?: string): void; | ||
|
||
update(from: string, to: string, options: PinOptions): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
export type {IpfsPeersApi} from './IpfsPeersApi'; | ||
export type {IIpfsPeersApi} from './IIpfsPeersApi'; | ||
export {IpfsClusterApi} from './IpfsClusterApi'; | ||
export type {IIpfsClusterApi} from './IIpfsClusterApi'; | ||
export type {IpfsAllocationsApi} from './IpfsAllocationsApi'; | ||
export type {IIpfsAllocationsApi} from './IIpfsAllocationsApi'; | ||
export type {IpfsPinsApi} from './IpfsPinsApi'; | ||
export type {IIpfsPinsApi} from './IIpfsPinsApi'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'jsdom', | ||
preset: 'ts-jest', | ||
testEnvironment: 'jsdom', | ||
coveragePathIgnorePatterns: [ | ||
"<rootDir>/testing/" | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export {MockIpfsClusterApi} from './mock/MockIpfsClusterApi' | ||
export {MockIpfsClient} from './mock/MockIpfsClient' | ||
export {MemoryConfigurationStore} from './service/MemoryConfigurationStore' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import {AllocationResult, AllocationsOptions, IIpfsAllocationsApi} from 'ipfs-cluster-api'; | ||
|
||
export class MockIpfsAllocationsApi implements IIpfsAllocationsApi { | ||
get(cid: string): void { | ||
} | ||
|
||
list(options: AllocationsOptions): Promise<AllocationResult> { | ||
return Promise.resolve([]); | ||
} | ||
|
||
} |
Oops, something went wrong.