From 783913043e55958921b4099c0a648724b68fc2a9 Mon Sep 17 00:00:00 2001 From: Pavel Date: Fri, 5 Mar 2021 16:21:41 +0300 Subject: [PATCH] fix relative paths in import statement (#30) * Fix relative paths in import statement * Fix types in builtins for better compatibility --- src/internal/builtins.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/internal/builtins.ts b/src/internal/builtins.ts index 758dfe999..92d2fb427 100644 --- a/src/internal/builtins.ts +++ b/src/internal/builtins.ts @@ -14,10 +14,14 @@ * limitations under the License. */ -import { RequestFlow } from './RequestFlow'; import { ModuleConfig } from './moduleConfig'; 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 => { return `(call "${client.relayPeerId}" ("op" "identity") [])`; @@ -60,7 +64,7 @@ const requestResponse = async ( .withVariables(data) .withTTL(ttl) .buildAsFetch('_callback', name); - await client.initiateFlow(request); + await (client as any).initiateFlow(request); const res = await promise; return handleResponse(res); }; @@ -87,7 +91,7 @@ export const getModules = async (client: FluenceClient, ttl?: number): Promise('_callback', callbackFn); - client.initiateFlow(req); + (client as any).initiateFlow(req); const [res] = await promise; return res; @@ -127,7 +131,7 @@ export const getInterfaces = async (client: FluenceClient, ttl?: number): Promis .withTTL(ttl) .buildAsFetch<[string[]]>('_callback', callbackFn); - client.initiateFlow(req); + (client as any).initiateFlow(req); const [res] = await promise; return res; @@ -180,7 +184,7 @@ export const uploadModule = async ( .withTTL(ttl) .buildAsFetch<[string[]]>('_callback', 'getModules'); - await client.initiateFlow(req); + await (client as any).initiateFlow(req); await promise; };