feat: remove obsolete packages [fixes DXJ-462] (#337)

* Remove api package

* Not publish interface package

* Refactoring of interface package

* Fix aqua imports

* Change impl of isFluencePeer

* Remove unused property
This commit is contained in:
Akim
2023-09-05 21:38:59 +07:00
committed by GitHub
parent 18a972b573
commit e7e617661f
18 changed files with 597 additions and 1343 deletions

View File

@ -27,7 +27,7 @@
"license": "Apache-2.0",
"dependencies": {
"@chainsafe/libp2p-noise": "13.0.0",
"@fluencelabs/interfaces": "0.8.2",
"@fluencelabs/interfaces": "workspace:*",
"@libp2p/crypto": "2.0.3",
"@libp2p/interface": "0.1.2",
"@libp2p/mplex": "9.0.4",

View File

@ -17,8 +17,12 @@
import type { FnConfig, FunctionCallDef, ServiceDef } from '@fluencelabs/interfaces';
import type { IFluenceClient } from '@fluencelabs/interfaces';
import { getArgumentTypes } from '@fluencelabs/interfaces';
import { isFluencePeer } from '@fluencelabs/interfaces';
import { callAquaFunction, Fluence, registerService } from './index.js';
import { FluencePeer } from './jsPeer/FluencePeer.js';
export const isFluencePeer = (fluencePeerCandidate: unknown): fluencePeerCandidate is IFluenceClient => {
return fluencePeerCandidate instanceof FluencePeer;
};
/**
* Convenience function to support Aqua `func` generation backend

View File

@ -96,14 +96,6 @@ export abstract class FluencePeer {
this._initServices();
}
/**
* Internal contract to cast unknown objects to IFluenceClient.
* If an unknown object has this property then we assume it is in fact a Peer and it implements IFluenceClient
* Check against this variable MUST NOT be coupled with any `FluencePeer` because otherwise it might get bundled
* brining a lot of unnecessary stuff alongside with it
*/
__isFluenceAwesome = true;
async start(): Promise<void> {
log_peer.trace('starting Fluence peer');
if (this.config?.debug?.printParticleId) {

View File

@ -1,6 +1,6 @@
import { it, describe, expect } from 'vitest';
import { isFluencePeer } from '@fluencelabs/interfaces';
import { isFluencePeer } from '../../api.js';
import { mkTestPeer, registerHandlersHelper, withPeer } from '../../util/testUtils.js';
import { handleTimeout } from '../../particle/Particle.js';
import { FluencePeer } from '../FluencePeer.js';