mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2025-06-26 14:21:32 +00:00
fix relative paths in import statement (#30)
* Fix relative paths in import statement * Fix types in builtins for better compatibility
This commit is contained in:
@ -14,10 +14,14 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { RequestFlow } from './RequestFlow';
|
|
||||||
import { ModuleConfig } from './moduleConfig';
|
import { ModuleConfig } from './moduleConfig';
|
||||||
import { RequestFlowBuilder } from './RequestFlowBuilder';
|
import { RequestFlowBuilder } from './RequestFlowBuilder';
|
||||||
import { FluenceClient } from 'src/api.unstable';
|
import { FluenceClient as Unstable } from '../api.unstable';
|
||||||
|
import { FluenceClient as Stable } from '..';
|
||||||
|
|
||||||
|
// HACK:: A little hack to supress compiler errors in proto-distributor.
|
||||||
|
// Will be wiped out when the HLL is ready
|
||||||
|
type FluenceClient = Unstable | Stable;
|
||||||
|
|
||||||
const nodeIdentityCall = (client: FluenceClient): string => {
|
const nodeIdentityCall = (client: FluenceClient): string => {
|
||||||
return `(call "${client.relayPeerId}" ("op" "identity") [])`;
|
return `(call "${client.relayPeerId}" ("op" "identity") [])`;
|
||||||
@ -60,7 +64,7 @@ const requestResponse = async <T>(
|
|||||||
.withVariables(data)
|
.withVariables(data)
|
||||||
.withTTL(ttl)
|
.withTTL(ttl)
|
||||||
.buildAsFetch<any[]>('_callback', name);
|
.buildAsFetch<any[]>('_callback', name);
|
||||||
await client.initiateFlow(request);
|
await (client as any).initiateFlow(request);
|
||||||
const res = await promise;
|
const res = await promise;
|
||||||
return handleResponse(res);
|
return handleResponse(res);
|
||||||
};
|
};
|
||||||
@ -87,7 +91,7 @@ export const getModules = async (client: FluenceClient, ttl?: number): Promise<s
|
|||||||
})
|
})
|
||||||
.withTTL(ttl)
|
.withTTL(ttl)
|
||||||
.buildAsFetch<[string[]]>('_callback', callbackFn);
|
.buildAsFetch<[string[]]>('_callback', callbackFn);
|
||||||
client.initiateFlow(req);
|
(client as any).initiateFlow(req);
|
||||||
|
|
||||||
const [res] = await promise;
|
const [res] = await promise;
|
||||||
return res;
|
return res;
|
||||||
@ -127,7 +131,7 @@ export const getInterfaces = async (client: FluenceClient, ttl?: number): Promis
|
|||||||
.withTTL(ttl)
|
.withTTL(ttl)
|
||||||
.buildAsFetch<[string[]]>('_callback', callbackFn);
|
.buildAsFetch<[string[]]>('_callback', callbackFn);
|
||||||
|
|
||||||
client.initiateFlow(req);
|
(client as any).initiateFlow(req);
|
||||||
|
|
||||||
const [res] = await promise;
|
const [res] = await promise;
|
||||||
return res;
|
return res;
|
||||||
@ -180,7 +184,7 @@ export const uploadModule = async (
|
|||||||
.withTTL(ttl)
|
.withTTL(ttl)
|
||||||
.buildAsFetch<[string[]]>('_callback', 'getModules');
|
.buildAsFetch<[string[]]>('_callback', 'getModules');
|
||||||
|
|
||||||
await client.initiateFlow(req);
|
await (client as any).initiateFlow(req);
|
||||||
await promise;
|
await promise;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user