mirror of
https://github.com/fluencelabs/aqua-playground
synced 2025-06-28 18:11:44 +00:00
update aqua cli
This commit is contained in:
6
package-lock.json
generated
6
package-lock.json
generated
@ -5,9 +5,9 @@
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@fluencelabs/aqua-cli": {
|
||||
"version": "0.1.1-94",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-cli/-/aqua-cli-0.1.1-94.tgz",
|
||||
"integrity": "sha512-PPtFFrTOTKB8nwJ0hJX2MSRLCkM1CNi2/vEQ9yks/x2S9/knjNcq+t3pjrmRxH5YSye47GTlMMzVIKLfcRL1sg==",
|
||||
"version": "0.1.1-105",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-cli/-/aqua-cli-0.1.1-105.tgz",
|
||||
"integrity": "sha512-G5TFGzp9AW7oE4jsYOt5685LIFcteSg3uvMH1e6jqMqyAElQZJ1NReZ5cuLHy89x9fp4/kljTxVwra3J31QtrQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@fluencelabs/aquamarine-interpreter": {
|
||||
|
@ -22,7 +22,7 @@
|
||||
"compile-aqua:air": "aqua-cli -i ./aqua/ -o ./compiled-air -a"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@fluencelabs/aqua-cli": "^0.1.1-94",
|
||||
"@fluencelabs/aqua-cli": "^0.1.1-105",
|
||||
"ts-node": "^9.1.1",
|
||||
"typescript": "^4.2.4"
|
||||
},
|
||||
|
@ -3,16 +3,17 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.1-SNAPSHOT
|
||||
* Aqua version: 0.1.1-105
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function id(client: FluenceClient): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -46,7 +47,7 @@ export async function id(client: FluenceClient): Promise<void> {
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
@ -3,16 +3,17 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.1-SNAPSHOT
|
||||
* Aqua version: 0.1.1-105
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function print(client: FluenceClient, str: string): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -49,14 +50,14 @@ export async function print(client: FluenceClient, str: string): Promise<void> {
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function id(client: FluenceClient): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -90,14 +91,14 @@ export async function id(client: FluenceClient): Promise<void> {
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function passFunctionAsArg(client: FluenceClient, node: string, str: string, c: (arg0: string) => string): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -169,7 +170,7 @@ h.on('callbackSrv', 'c', (args) => {return c(args[0]);});
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
@ -3,16 +3,17 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.1-SNAPSHOT
|
||||
* Aqua version: 0.1.1-105
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function helloWorld(client: FluenceClient, name: string): Promise<string> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<string>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -62,14 +63,14 @@ export async function helloWorld(client: FluenceClient, name: string): Promise<s
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return promise;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function print(client: FluenceClient, str: string): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -106,14 +107,14 @@ export async function print(client: FluenceClient, str: string): Promise<void> {
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function id(client: FluenceClient): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -147,14 +148,14 @@ export async function id(client: FluenceClient): Promise<void> {
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function testFunc(client: FluenceClient): Promise<string> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<string>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -201,14 +202,14 @@ export async function testFunc(client: FluenceClient): Promise<string> {
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return promise;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function doStuff(client: FluenceClient, a: string, b: string, c: boolean, d: boolean, e: string[], g: string[], str: string): Promise<string[]> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<string[]>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -350,7 +351,7 @@ h.on('getDataSrv', 'str', () => {return str;});
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return promise;
|
||||
}
|
||||
|
@ -3,16 +3,17 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.1-SNAPSHOT
|
||||
* Aqua version: 0.1.1-105
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function print(client: FluenceClient, str: string): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -49,14 +50,14 @@ export async function print(client: FluenceClient, str: string): Promise<void> {
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function callConstant(client: FluenceClient, cb: (arg0: string) => void): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -110,7 +111,7 @@ export async function callConstant(client: FluenceClient, cb: (arg0: string) =>
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
@ -3,16 +3,17 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.1-SNAPSHOT
|
||||
* Aqua version: 0.1.1-105
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function getAliasedData(client: FluenceClient): Promise<string> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<string>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -59,7 +60,7 @@ export async function getAliasedData(client: FluenceClient): Promise<string> {
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return promise;
|
||||
}
|
||||
|
112
src/compiled/fldist-sample.ts
Normal file
112
src/compiled/fldist-sample.ts
Normal file
@ -0,0 +1,112 @@
|
||||
/**
|
||||
*
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.1-105
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function id(client: FluenceClient): Promise<void> {
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
.withRawScript(
|
||||
`
|
||||
(xor
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("op" "identity") [])
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
|
||||
`,
|
||||
)
|
||||
.configHandler((h) => {
|
||||
h.on('getDataSrv', '-relay-', () => {
|
||||
return client.relayPeerId!;
|
||||
});
|
||||
|
||||
|
||||
h.onEvent('errorHandlingSrv', 'error', (args) => {
|
||||
// assuming error is the single argument
|
||||
const [err] = args;
|
||||
reject(err);
|
||||
});
|
||||
})
|
||||
.handleScriptError(reject)
|
||||
.handleTimeout(() => {
|
||||
reject('Request timed out for id');
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function test(client: FluenceClient, node: string): Promise<void> {
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
.withRawScript(
|
||||
`
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(xor
|
||||
(call node ("peer" "identify") [] res)
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(call %init_peer_id% ("returnService" "run") [res])
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
|
||||
`,
|
||||
)
|
||||
.configHandler((h) => {
|
||||
h.on('getDataSrv', '-relay-', () => {
|
||||
return client.relayPeerId!;
|
||||
});
|
||||
h.on('getDataSrv', 'node', () => {return node;});
|
||||
|
||||
h.onEvent('errorHandlingSrv', 'error', (args) => {
|
||||
// assuming error is the single argument
|
||||
const [err] = args;
|
||||
reject(err);
|
||||
});
|
||||
})
|
||||
.handleScriptError(reject)
|
||||
.handleTimeout(() => {
|
||||
reject('Request timed out for test');
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
@ -3,16 +3,17 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.1-SNAPSHOT
|
||||
* Aqua version: 0.1.1-105
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function print(client: FluenceClient, str: string): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -49,14 +50,14 @@ export async function print(client: FluenceClient, str: string): Promise<void> {
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function id(client: FluenceClient): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -90,14 +91,14 @@ export async function id(client: FluenceClient): Promise<void> {
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function iterateAndPrint(client: FluenceClient, strings: string[]): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -139,14 +140,14 @@ export async function iterateAndPrint(client: FluenceClient, strings: string[]):
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function iterateAndPrintParallel(client: FluenceClient, nodes: string[], c: (arg0: {external_addresses:string[]}) => void): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -213,7 +214,7 @@ h.on('callbackSrv', 'c', (args) => {c(args[0]); return {};});
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
@ -3,16 +3,17 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.1-SNAPSHOT
|
||||
* Aqua version: 0.1.1-105
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function testFunc(client: FluenceClient): Promise<string> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<string>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -59,7 +60,7 @@ export async function testFunc(client: FluenceClient): Promise<string> {
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return promise;
|
||||
}
|
||||
|
@ -3,16 +3,17 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.1-SNAPSHOT
|
||||
* Aqua version: 0.1.1-105
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function helloWorld(client: FluenceClient, name: string): Promise<string> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<string>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -62,7 +63,7 @@ export async function helloWorld(client: FluenceClient, name: string): Promise<s
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return promise;
|
||||
}
|
||||
|
@ -3,16 +3,17 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.1-SNAPSHOT
|
||||
* Aqua version: 0.1.1-105
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function print(client: FluenceClient, str: string): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -49,14 +50,14 @@ export async function print(client: FluenceClient, str: string): Promise<void> {
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function ifElseCall(client: FluenceClient, condition: boolean): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -98,14 +99,14 @@ export async function ifElseCall(client: FluenceClient, condition: boolean): Pro
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function ifElseNumCall(client: FluenceClient, condition: number): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -147,7 +148,7 @@ export async function ifElseNumCall(client: FluenceClient, condition: number): P
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
@ -3,16 +3,17 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.1-SNAPSHOT
|
||||
* Aqua version: 0.1.1-105
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function id(client: FluenceClient): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -46,14 +47,14 @@ export async function id(client: FluenceClient): Promise<void> {
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function getPeerExternalAddresses(client: FluenceClient, otherNodePeerId: string): Promise<string[]> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<string[]>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -118,14 +119,14 @@ export async function getPeerExternalAddresses(client: FluenceClient, otherNodeP
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return promise;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function getDistantAddresses(client: FluenceClient, target: string, viaNode: string): Promise<string[]> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<string[]>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -203,7 +204,7 @@ h.on('getDataSrv', 'viaNode', () => {return viaNode;});
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return promise;
|
||||
}
|
||||
|
@ -3,16 +3,17 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.1-SNAPSHOT
|
||||
* Aqua version: 0.1.1-105
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function id(client: FluenceClient): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -46,14 +47,14 @@ export async function id(client: FluenceClient): Promise<void> {
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function parFunc(client: FluenceClient, node: string, c: (arg0: {external_addresses:string[]}) => void): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -121,7 +122,7 @@ h.on('callbackSrv', 'c', (args) => {c(args[0]); return {};});
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
@ -3,16 +3,17 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.1-SNAPSHOT
|
||||
* Aqua version: 0.1.1-105
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function print(client: FluenceClient, str: string): Promise<void> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -49,7 +50,7 @@ export async function print(client: FluenceClient, str: string): Promise<void> {
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
@ -3,16 +3,17 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.1-SNAPSHOT
|
||||
* Aqua version: 0.1.1-105
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function checkStreams(client: FluenceClient, ch: string[]): Promise<string[]> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<string[]>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -73,7 +74,7 @@ export async function checkStreams(client: FluenceClient, ch: string[]): Promise
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return promise;
|
||||
}
|
||||
|
@ -3,16 +3,17 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.1-SNAPSHOT
|
||||
* Aqua version: 0.1.1-105
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function topologyTest(client: FluenceClient, me: string, myRelay: string, friend: string, friendRelay: string): Promise<string> {
|
||||
let request;
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<string>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
@ -104,7 +105,7 @@ h.on('getDataSrv', 'friendRelay', () => {return friendRelay;});
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request);
|
||||
await client.initiateFlow(request!);
|
||||
return promise;
|
||||
}
|
||||
|
Reference in New Issue
Block a user