mirror of
https://github.com/fluencelabs/aqua-playground
synced 2025-06-20 17:46:44 +00:00
update compiled, add declare\import tests
This commit is contained in:
11
aqua/examples/imports_exports/declare.aqua
Normal file
11
aqua/examples/imports_exports/declare.aqua
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
module FooBars declares decl_foo, decl_bar, SuperFoo
|
||||||
|
|
||||||
|
service SuperFoo("super_foo"):
|
||||||
|
small_foo() -> string
|
||||||
|
|
||||||
|
|
||||||
|
func decl_foo() -> string:
|
||||||
|
<- "declare all foo"
|
||||||
|
|
||||||
|
func decl_bar() -> string:
|
||||||
|
<- "declare all bar"
|
13
aqua/examples/imports_exports/imports.aqua
Normal file
13
aqua/examples/imports_exports/imports.aqua
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import decl_foo, decl_bar from "declare.aqua"
|
||||||
|
use SuperFoo from "declare.aqua" as Declare
|
||||||
|
|
||||||
|
service StringService("string_service"):
|
||||||
|
concat(a: string, b: string) -> string
|
||||||
|
|
||||||
|
func concat_foobars() -> string:
|
||||||
|
res1 <- decl_foo()
|
||||||
|
res2 <- decl_bar()
|
||||||
|
res3 <- StringService.concat(res1, res2)
|
||||||
|
res4 <- Declare.SuperFoo.small_foo()
|
||||||
|
res5 <- StringService.concat(res3, res4)
|
||||||
|
<- res5
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,18 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//OpHa
|
||||||
|
//defaultId = "op"
|
||||||
|
|
||||||
|
//array: (a: string, b: string) => string[]
|
||||||
|
//identity: (a: string) => string
|
||||||
|
//END OpHa
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function doSmth(client: FluenceClient, arg: {value:string}, config?: {ttl?: number}): Promise<string[]> {
|
export async function doSmth(client: FluenceClient, arg: {value:string}, config?: {ttl?: number}): Promise<string[]> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -69,4 +81,4 @@ export async function doSmth(client: FluenceClient, arg: {value:string}, config?
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,10 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function print(client: FluenceClient, str: string, config?: {ttl?: number}): Promise<void> {
|
export async function print(client: FluenceClient, str: string, config?: {ttl?: number}): Promise<void> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -138,4 +142,4 @@ h.on('callbackSrv', 'c', (args) => {return c(args[0]);});
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return Promise.race([promise, Promise.resolve()]);
|
return Promise.race([promise, Promise.resolve()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,102 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//Srv
|
||||||
|
//defaultId = "srv"
|
||||||
|
|
||||||
|
//add_alias: (alias: string, service_id: string) => void
|
||||||
|
//create: (blueprint_id: string) => string
|
||||||
|
//get_interface: (service_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list: () => {blueprint_id:string;id:string;owner_id:string}[]
|
||||||
|
//remove: (service_id: string) => void
|
||||||
|
//resolve_alias: (alias: string) => string
|
||||||
|
//END Srv
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Peer
|
||||||
|
//defaultId = "peer"
|
||||||
|
|
||||||
|
//connect: (id: string, multiaddrs: string[] | null) => boolean
|
||||||
|
//get_contact: (peer: string) => {addresses:string[];peer_id:string}
|
||||||
|
//identify: () => {external_addresses:string[]}
|
||||||
|
//is_connected: (peer: string) => boolean
|
||||||
|
//timestamp_ms: () => number
|
||||||
|
//timestamp_sec: () => number
|
||||||
|
//END Peer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Op
|
||||||
|
//defaultId = "op"
|
||||||
|
|
||||||
|
//array: (a: string, b: string | null, c: string | null, d: string | null) => string[]
|
||||||
|
//array_length: (array: string[]) => number
|
||||||
|
//bytes_from_b58: (b: string) => number[]
|
||||||
|
//bytes_to_b58: (bs: number[]) => string
|
||||||
|
//concat: (a: string[], b: string[] | null, c: string[] | null, d: string[] | null) => string[]
|
||||||
|
//concat_strings: (a: string, b: string) => string
|
||||||
|
//identity: (s: string | null) => string | null
|
||||||
|
//noop: () => void
|
||||||
|
//sha256_string: (s: string) => string
|
||||||
|
//string_from_b58: (b: string) => string
|
||||||
|
//string_to_b58: (s: string) => string
|
||||||
|
//END Op
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Kademlia
|
||||||
|
//defaultId = "kad"
|
||||||
|
|
||||||
|
//merge: (target: string, left: string[], right: string[], count: number | null) => string[]
|
||||||
|
//neighborhood: (key: string, already_hashed: boolean | null, count: number | null) => string[]
|
||||||
|
//END Kademlia
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Script
|
||||||
|
//defaultId = "script"
|
||||||
|
|
||||||
|
//add: (air_script: string, interval: string | null) => string
|
||||||
|
//list: () => {failures:number;id:string;interval:string;owner:string;src:string}
|
||||||
|
//remove: (script_id: string) => boolean
|
||||||
|
//END Script
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//CoService
|
||||||
|
//defaultId = "coservice-id"
|
||||||
|
|
||||||
|
//call: () => string
|
||||||
|
//END CoService
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Dist
|
||||||
|
//defaultId = "dist"
|
||||||
|
|
||||||
|
//add_blueprint: (blueprint: {dependencies:string[];name:string}) => string
|
||||||
|
//add_module: (wasm_b56_content: number[], conf: {name:string}) => string
|
||||||
|
//add_module_from_vault: (path: string, config: {name:string}) => string
|
||||||
|
//default_module_config: (module_name: string) => {name:string}
|
||||||
|
//get_interface: (module_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list_blueprints: () => {dependencies:string[];id:string;name:string}[]
|
||||||
|
//list_modules: () => {config:{name:string};hash:string;name:string}[]
|
||||||
|
//make_blueprint: (name: string, dependencies: string[]) => {dependencies:string[];name:string}
|
||||||
|
//make_module_config: (name: string, mem_pages_count: number | null, logger_enabled: boolean | null, preopened_files: string[] | null, envs: string[][] | null, mapped_dirs: string[][] | null, mounted_binaries: string[][] | null, logging_mask: number | null) => {name:string}
|
||||||
|
//END Dist
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function coFunc(client: FluenceClient, node: string, c: (arg0: {external_addresses:string[]}) => void, config?: {ttl?: number}): Promise<void> {
|
export async function coFunc(client: FluenceClient, node: string, c: (arg0: {external_addresses:string[]}) => void, config?: {ttl?: number}): Promise<void> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -81,4 +177,4 @@ h.on('callbackSrv', 'c', (args) => {c(args[0]); return {};});
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return Promise.race([promise, Promise.resolve()]);
|
return Promise.race([promise, Promise.resolve()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,130 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//Srv
|
||||||
|
//defaultId = "srv"
|
||||||
|
|
||||||
|
//add_alias: (alias: string, service_id: string) => void
|
||||||
|
//create: (blueprint_id: string) => string
|
||||||
|
//get_interface: (service_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list: () => {blueprint_id:string;id:string;owner_id:string}[]
|
||||||
|
//remove: (service_id: string) => void
|
||||||
|
//resolve_alias: (alias: string) => string
|
||||||
|
//END Srv
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//TestS
|
||||||
|
//defaultId = "some-id"
|
||||||
|
|
||||||
|
//multiline: (a: string, b: string, c: boolean) => string
|
||||||
|
//t: (arg0: string) => string
|
||||||
|
//END TestS
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Peer
|
||||||
|
//defaultId = "peer"
|
||||||
|
|
||||||
|
//connect: (id: string, multiaddrs: string[] | null) => boolean
|
||||||
|
//get_contact: (peer: string) => {addresses:string[];peer_id:string}
|
||||||
|
//identify: () => {external_addresses:string[]}
|
||||||
|
//is_connected: (peer: string) => boolean
|
||||||
|
//timestamp_ms: () => number
|
||||||
|
//timestamp_sec: () => number
|
||||||
|
//END Peer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//StringExtra
|
||||||
|
//defaultId = "service-id"
|
||||||
|
|
||||||
|
//addNameToHello: (arg0: string) => string
|
||||||
|
//END StringExtra
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Op
|
||||||
|
//defaultId = "op"
|
||||||
|
|
||||||
|
//array: (a: string, b: string | null, c: string | null, d: string | null) => string[]
|
||||||
|
//array_length: (array: string[]) => number
|
||||||
|
//bytes_from_b58: (b: string) => number[]
|
||||||
|
//bytes_to_b58: (bs: number[]) => string
|
||||||
|
//concat: (a: string[], b: string[] | null, c: string[] | null, d: string[] | null) => string[]
|
||||||
|
//concat_strings: (a: string, b: string) => string
|
||||||
|
//identity: (s: string | null) => string | null
|
||||||
|
//noop: () => void
|
||||||
|
//sha256_string: (s: string) => string
|
||||||
|
//string_from_b58: (b: string) => string
|
||||||
|
//string_to_b58: (s: string) => string
|
||||||
|
//END Op
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Script
|
||||||
|
//defaultId = "script"
|
||||||
|
|
||||||
|
//add: (air_script: string, interval: string | null) => string
|
||||||
|
//list: () => {failures:number;id:string;interval:string;owner:string;src:string}
|
||||||
|
//remove: (script_id: string) => boolean
|
||||||
|
//END Script
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//TestSrv
|
||||||
|
//defaultId = "test-service-id"
|
||||||
|
|
||||||
|
//str: () => string
|
||||||
|
//END TestSrv
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Dist
|
||||||
|
//defaultId = "dist"
|
||||||
|
|
||||||
|
//add_blueprint: (blueprint: {dependencies:string[];name:string}) => string
|
||||||
|
//add_module: (wasm_b56_content: number[], conf: {name:string}) => string
|
||||||
|
//add_module_from_vault: (path: string, config: {name:string}) => string
|
||||||
|
//default_module_config: (module_name: string) => {name:string}
|
||||||
|
//get_interface: (module_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list_blueprints: () => {dependencies:string[];id:string;name:string}[]
|
||||||
|
//list_modules: () => {config:{name:string};hash:string;name:string}[]
|
||||||
|
//make_blueprint: (name: string, dependencies: string[]) => {dependencies:string[];name:string}
|
||||||
|
//make_module_config: (name: string, mem_pages_count: number | null, logger_enabled: boolean | null, preopened_files: string[] | null, envs: string[][] | null, mapped_dirs: string[][] | null, mounted_binaries: string[][] | null, logging_mask: number | null) => {name:string}
|
||||||
|
//END Dist
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Kademlia
|
||||||
|
//defaultId = "kad"
|
||||||
|
|
||||||
|
//merge: (target: string, left: string[], right: string[], count: number | null) => string[]
|
||||||
|
//neighborhood: (key: string, already_hashed: boolean | null, count: number | null) => string[]
|
||||||
|
//END Kademlia
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Println
|
||||||
|
//defaultId = "println-service-id"
|
||||||
|
|
||||||
|
//print: (arg0: string) => void
|
||||||
|
//END Println
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function helloWorld(client: FluenceClient, name: string, config?: {ttl?: number}): Promise<string> {
|
export async function helloWorld(client: FluenceClient, name: string, config?: {ttl?: number}): Promise<string> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -325,4 +449,4 @@ h.on('getDataSrv', 'str', () => {return str;});
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,111 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//Srv
|
||||||
|
//defaultId = "srv"
|
||||||
|
|
||||||
|
//add_alias: (alias: string, service_id: string) => void
|
||||||
|
//create: (blueprint_id: string) => string
|
||||||
|
//get_interface: (service_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list: () => {blueprint_id:string;id:string;owner_id:string}[]
|
||||||
|
//remove: (service_id: string) => void
|
||||||
|
//resolve_alias: (alias: string) => string
|
||||||
|
//END Srv
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Peer
|
||||||
|
//defaultId = "peer"
|
||||||
|
|
||||||
|
//connect: (id: string, multiaddrs: string[] | null) => boolean
|
||||||
|
//get_contact: (peer: string) => {addresses:string[];peer_id:string}
|
||||||
|
//identify: () => {external_addresses:string[]}
|
||||||
|
//is_connected: (peer: string) => boolean
|
||||||
|
//timestamp_ms: () => number
|
||||||
|
//timestamp_sec: () => number
|
||||||
|
//END Peer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//OpO
|
||||||
|
//defaultId = "op"
|
||||||
|
|
||||||
|
//identity: (arg0: string) => string
|
||||||
|
//END OpO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Op
|
||||||
|
//defaultId = "op"
|
||||||
|
|
||||||
|
//array: (a: string, b: string | null, c: string | null, d: string | null) => string[]
|
||||||
|
//array_length: (array: string[]) => number
|
||||||
|
//bytes_from_b58: (b: string) => number[]
|
||||||
|
//bytes_to_b58: (bs: number[]) => string
|
||||||
|
//concat: (a: string[], b: string[] | null, c: string[] | null, d: string[] | null) => string[]
|
||||||
|
//concat_strings: (a: string, b: string) => string
|
||||||
|
//identity: (s: string | null) => string | null
|
||||||
|
//noop: () => void
|
||||||
|
//sha256_string: (s: string) => string
|
||||||
|
//string_from_b58: (b: string) => string
|
||||||
|
//string_to_b58: (s: string) => string
|
||||||
|
//END Op
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Kademlia
|
||||||
|
//defaultId = "kad"
|
||||||
|
|
||||||
|
//merge: (target: string, left: string[], right: string[], count: number | null) => string[]
|
||||||
|
//neighborhood: (key: string, already_hashed: boolean | null, count: number | null) => string[]
|
||||||
|
//END Kademlia
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Dist
|
||||||
|
//defaultId = "dist"
|
||||||
|
|
||||||
|
//add_blueprint: (blueprint: {dependencies:string[];name:string}) => string
|
||||||
|
//add_module: (wasm_b56_content: number[], conf: {name:string}) => string
|
||||||
|
//add_module_from_vault: (path: string, config: {name:string}) => string
|
||||||
|
//default_module_config: (module_name: string) => {name:string}
|
||||||
|
//get_interface: (module_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list_blueprints: () => {dependencies:string[];id:string;name:string}[]
|
||||||
|
//list_modules: () => {config:{name:string};hash:string;name:string}[]
|
||||||
|
//make_blueprint: (name: string, dependencies: string[]) => {dependencies:string[];name:string}
|
||||||
|
//make_module_config: (name: string, mem_pages_count: number | null, logger_enabled: boolean | null, preopened_files: string[] | null, envs: string[][] | null, mapped_dirs: string[][] | null, mounted_binaries: string[][] | null, logging_mask: number | null) => {name:string}
|
||||||
|
//END Dist
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Getter
|
||||||
|
//defaultId = "test"
|
||||||
|
|
||||||
|
//createStr: (arg0: number) => string
|
||||||
|
//END Getter
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Script
|
||||||
|
//defaultId = "script"
|
||||||
|
|
||||||
|
//add: (air_script: string, interval: string | null) => string
|
||||||
|
//list: () => {failures:number;id:string;interval:string;owner:string;src:string}
|
||||||
|
//remove: (script_id: string) => boolean
|
||||||
|
//END Script
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function callConstant(client: FluenceClient, config?: {ttl?: number}): Promise<string[]> {
|
export async function callConstant(client: FluenceClient, config?: {ttl?: number}): Promise<string[]> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -66,4 +171,4 @@ export async function callConstant(client: FluenceClient, config?: {ttl?: number
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,17 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//NodeIdGetter
|
||||||
|
//defaultId = "somesrv"
|
||||||
|
|
||||||
|
//get: () => {name:string;peerId:string}
|
||||||
|
//END NodeIdGetter
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function getAliasedData(client: FluenceClient, config?: {ttl?: number}): Promise<string> {
|
export async function getAliasedData(client: FluenceClient, config?: {ttl?: number}): Promise<string> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -63,4 +74,4 @@ export async function getAliasedData(client: FluenceClient, config?: {ttl?: numb
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,36 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//Peer
|
||||||
|
//defaultId = "peer"
|
||||||
|
|
||||||
|
//is_connected: (arg0: string) => boolean
|
||||||
|
//END Peer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Op
|
||||||
|
//defaultId = "op"
|
||||||
|
|
||||||
|
//identity: () => void
|
||||||
|
//END Op
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Test
|
||||||
|
//defaultId = "test"
|
||||||
|
|
||||||
|
//doSomething: () => boolean
|
||||||
|
//getUserList: () => {name:string;peer_id:string;relay_id:string}[]
|
||||||
|
//END Test
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function betterMessage(client: FluenceClient, relay: string, config?: {ttl?: number}): Promise<void> {
|
export async function betterMessage(client: FluenceClient, relay: string, config?: {ttl?: number}): Promise<void> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -79,4 +109,4 @@ export async function betterMessage(client: FluenceClient, relay: string, config
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return Promise.race([promise, Promise.resolve()]);
|
return Promise.race([promise, Promise.resolve()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,102 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//Srv
|
||||||
|
//defaultId = "srv"
|
||||||
|
|
||||||
|
//add_alias: (alias: string, service_id: string) => void
|
||||||
|
//create: (blueprint_id: string) => string
|
||||||
|
//get_interface: (service_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list: () => {blueprint_id:string;id:string;owner_id:string}[]
|
||||||
|
//remove: (service_id: string) => void
|
||||||
|
//resolve_alias: (alias: string) => string
|
||||||
|
//END Srv
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Return
|
||||||
|
//defaultId = "returnService"
|
||||||
|
|
||||||
|
//run: (arg0: {external_addresses:string[]}) => void
|
||||||
|
//END Return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Peer
|
||||||
|
//defaultId = "peer"
|
||||||
|
|
||||||
|
//connect: (id: string, multiaddrs: string[] | null) => boolean
|
||||||
|
//get_contact: (peer: string) => {addresses:string[];peer_id:string}
|
||||||
|
//identify: () => {external_addresses:string[]}
|
||||||
|
//is_connected: (peer: string) => boolean
|
||||||
|
//timestamp_ms: () => number
|
||||||
|
//timestamp_sec: () => number
|
||||||
|
//END Peer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Op
|
||||||
|
//defaultId = "op"
|
||||||
|
|
||||||
|
//array: (a: string, b: string | null, c: string | null, d: string | null) => string[]
|
||||||
|
//array_length: (array: string[]) => number
|
||||||
|
//bytes_from_b58: (b: string) => number[]
|
||||||
|
//bytes_to_b58: (bs: number[]) => string
|
||||||
|
//concat: (a: string[], b: string[] | null, c: string[] | null, d: string[] | null) => string[]
|
||||||
|
//concat_strings: (a: string, b: string) => string
|
||||||
|
//identity: (s: string | null) => string | null
|
||||||
|
//noop: () => void
|
||||||
|
//sha256_string: (s: string) => string
|
||||||
|
//string_from_b58: (b: string) => string
|
||||||
|
//string_to_b58: (s: string) => string
|
||||||
|
//END Op
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Kademlia
|
||||||
|
//defaultId = "kad"
|
||||||
|
|
||||||
|
//merge: (target: string, left: string[], right: string[], count: number | null) => string[]
|
||||||
|
//neighborhood: (key: string, already_hashed: boolean | null, count: number | null) => string[]
|
||||||
|
//END Kademlia
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Script
|
||||||
|
//defaultId = "script"
|
||||||
|
|
||||||
|
//add: (air_script: string, interval: string | null) => string
|
||||||
|
//list: () => {failures:number;id:string;interval:string;owner:string;src:string}
|
||||||
|
//remove: (script_id: string) => boolean
|
||||||
|
//END Script
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Dist
|
||||||
|
//defaultId = "dist"
|
||||||
|
|
||||||
|
//add_blueprint: (blueprint: {dependencies:string[];name:string}) => string
|
||||||
|
//add_module: (wasm_b56_content: number[], conf: {name:string}) => string
|
||||||
|
//add_module_from_vault: (path: string, config: {name:string}) => string
|
||||||
|
//default_module_config: (module_name: string) => {name:string}
|
||||||
|
//get_interface: (module_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list_blueprints: () => {dependencies:string[];id:string;name:string}[]
|
||||||
|
//list_modules: () => {config:{name:string};hash:string;name:string}[]
|
||||||
|
//make_blueprint: (name: string, dependencies: string[]) => {dependencies:string[];name:string}
|
||||||
|
//make_module_config: (name: string, mem_pages_count: number | null, logger_enabled: boolean | null, preopened_files: string[] | null, envs: string[][] | null, mapped_dirs: string[][] | null, mounted_binaries: string[][] | null, logging_mask: number | null) => {name:string}
|
||||||
|
//END Dist
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function test(client: FluenceClient, node: string, config?: {ttl?: number}): Promise<void> {
|
export async function test(client: FluenceClient, node: string, config?: {ttl?: number}): Promise<void> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -71,4 +167,4 @@ export async function test(client: FluenceClient, node: string, config?: {ttl?:
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return Promise.race([promise, Promise.resolve()]);
|
return Promise.race([promise, Promise.resolve()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,10 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function print(client: FluenceClient, str: string, config?: {ttl?: number}): Promise<void> {
|
export async function print(client: FluenceClient, str: string, config?: {ttl?: number}): Promise<void> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -176,4 +180,4 @@ h.on('callbackSrv', 'c', (args) => {c(args[0]); return {};});
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return Promise.race([promise, Promise.resolve()]);
|
return Promise.race([promise, Promise.resolve()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,102 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//Srv
|
||||||
|
//defaultId = "srv"
|
||||||
|
|
||||||
|
//add_alias: (alias: string, service_id: string) => void
|
||||||
|
//create: (blueprint_id: string) => string
|
||||||
|
//get_interface: (service_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list: () => {blueprint_id:string;id:string;owner_id:string}[]
|
||||||
|
//remove: (service_id: string) => void
|
||||||
|
//resolve_alias: (alias: string) => string
|
||||||
|
//END Srv
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Op2
|
||||||
|
//defaultId = "op"
|
||||||
|
|
||||||
|
//identity: (s: number) => void
|
||||||
|
//END Op2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Peer
|
||||||
|
//defaultId = "peer"
|
||||||
|
|
||||||
|
//connect: (id: string, multiaddrs: string[] | null) => boolean
|
||||||
|
//get_contact: (peer: string) => {addresses:string[];peer_id:string}
|
||||||
|
//identify: () => {external_addresses:string[]}
|
||||||
|
//is_connected: (peer: string) => boolean
|
||||||
|
//timestamp_ms: () => number
|
||||||
|
//timestamp_sec: () => number
|
||||||
|
//END Peer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Op
|
||||||
|
//defaultId = "op"
|
||||||
|
|
||||||
|
//array: (a: string, b: string | null, c: string | null, d: string | null) => string[]
|
||||||
|
//array_length: (array: string[]) => number
|
||||||
|
//bytes_from_b58: (b: string) => number[]
|
||||||
|
//bytes_to_b58: (bs: number[]) => string
|
||||||
|
//concat: (a: string[], b: string[] | null, c: string[] | null, d: string[] | null) => string[]
|
||||||
|
//concat_strings: (a: string, b: string) => string
|
||||||
|
//identity: (s: string | null) => string | null
|
||||||
|
//noop: () => void
|
||||||
|
//sha256_string: (s: string) => string
|
||||||
|
//string_from_b58: (b: string) => string
|
||||||
|
//string_to_b58: (s: string) => string
|
||||||
|
//END Op
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Kademlia
|
||||||
|
//defaultId = "kad"
|
||||||
|
|
||||||
|
//merge: (target: string, left: string[], right: string[], count: number | null) => string[]
|
||||||
|
//neighborhood: (key: string, already_hashed: boolean | null, count: number | null) => string[]
|
||||||
|
//END Kademlia
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Script
|
||||||
|
//defaultId = "script"
|
||||||
|
|
||||||
|
//add: (air_script: string, interval: string | null) => string
|
||||||
|
//list: () => {failures:number;id:string;interval:string;owner:string;src:string}
|
||||||
|
//remove: (script_id: string) => boolean
|
||||||
|
//END Script
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Dist
|
||||||
|
//defaultId = "dist"
|
||||||
|
|
||||||
|
//add_blueprint: (blueprint: {dependencies:string[];name:string}) => string
|
||||||
|
//add_module: (wasm_b56_content: number[], conf: {name:string}) => string
|
||||||
|
//add_module_from_vault: (path: string, config: {name:string}) => string
|
||||||
|
//default_module_config: (module_name: string) => {name:string}
|
||||||
|
//get_interface: (module_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list_blueprints: () => {dependencies:string[];id:string;name:string}[]
|
||||||
|
//list_modules: () => {config:{name:string};hash:string;name:string}[]
|
||||||
|
//make_blueprint: (name: string, dependencies: string[]) => {dependencies:string[];name:string}
|
||||||
|
//make_module_config: (name: string, mem_pages_count: number | null, logger_enabled: boolean | null, preopened_files: string[] | null, envs: string[][] | null, mapped_dirs: string[][] | null, mounted_binaries: string[][] | null, logging_mask: number | null) => {name:string}
|
||||||
|
//END Dist
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function getTwoResults(client: FluenceClient, relay: string, config?: {ttl?: number}): Promise<number[]> {
|
export async function getTwoResults(client: FluenceClient, relay: string, config?: {ttl?: number}): Promise<number[]> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -104,4 +200,4 @@ export async function getTwoResults(client: FluenceClient, relay: string, config
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,17 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//TestSrv
|
||||||
|
//defaultId = "test-service-id"
|
||||||
|
|
||||||
|
//str: () => string
|
||||||
|
//END TestSrv
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function testFunc(client: FluenceClient, config?: {ttl?: number}): Promise<string> {
|
export async function testFunc(client: FluenceClient, config?: {ttl?: number}): Promise<string> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -63,4 +74,4 @@ export async function testFunc(client: FluenceClient, config?: {ttl?: number}):
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,17 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//StringExtra
|
||||||
|
//defaultId = "service-id"
|
||||||
|
|
||||||
|
//addNameToHello: (arg0: string) => string
|
||||||
|
//END StringExtra
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function helloWorld(client: FluenceClient, name: string, config?: {ttl?: number}): Promise<string> {
|
export async function helloWorld(client: FluenceClient, name: string, config?: {ttl?: number}): Promise<string> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -66,4 +77,4 @@ export async function helloWorld(client: FluenceClient, name: string, config?: {
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,10 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function print(client: FluenceClient, str: string, config?: {ttl?: number}): Promise<void> {
|
export async function print(client: FluenceClient, str: string, config?: {ttl?: number}): Promise<void> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -166,4 +170,4 @@ export async function ifElseNumCall(client: FluenceClient, condition: number, co
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return Promise.race([promise, Promise.resolve()]);
|
return Promise.race([promise, Promise.resolve()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,19 +11,45 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
export async function tupleFunc(client: FluenceClient, config?: {ttl?: number}): Promise<string> {
|
//GetStr
|
||||||
|
//defaultId = "multiret-test"
|
||||||
|
|
||||||
|
//retStr: (arg0: string) => string
|
||||||
|
//END GetStr
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//GetNum
|
||||||
|
//defaultId = "multiret-num"
|
||||||
|
|
||||||
|
//retNum: () => number
|
||||||
|
//END GetNum
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
|
export async function tupleFunc(client: FluenceClient, config?: {ttl?: number}): Promise<[string, number]> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
const promise = new Promise<string>((resolve, reject) => {
|
const promise = new Promise<[string, number]>((resolve, reject) => {
|
||||||
const r = new RequestFlowBuilder()
|
const r = new RequestFlowBuilder()
|
||||||
.disableInjections()
|
.disableInjections()
|
||||||
.withRawScript(
|
.withRawScript(
|
||||||
`
|
`
|
||||||
(xor
|
(xor
|
||||||
(seq
|
(seq
|
||||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
(seq
|
||||||
|
(seq
|
||||||
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
|
(call %init_peer_id% ("multiret-test" "retStr") ["some-str"] str)
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("multiret-num" "retNum") [] n)
|
||||||
|
)
|
||||||
(xor
|
(xor
|
||||||
(call %init_peer_id% ("callbackSrv" "response") ["str"])
|
(call %init_peer_id% ("callbackSrv" "response") [str n])
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -38,8 +64,9 @@ export async function tupleFunc(client: FluenceClient, config?: {ttl?: number}):
|
|||||||
});
|
});
|
||||||
|
|
||||||
h.onEvent('callbackSrv', 'response', (args) => {
|
h.onEvent('callbackSrv', 'response', (args) => {
|
||||||
const [res] = args;
|
let opt: any = args;
|
||||||
resolve(res);
|
|
||||||
|
return resolve(opt);
|
||||||
});
|
});
|
||||||
|
|
||||||
h.onEvent('errorHandlingSrv', 'error', (args) => {
|
h.onEvent('errorHandlingSrv', 'error', (args) => {
|
||||||
@ -60,4 +87,82 @@ export async function tupleFunc(client: FluenceClient, config?: {ttl?: number}):
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export async function multiReturnFunc(client: FluenceClient, somethingToReturn: number[], smthOption: string | null, config?: {ttl?: number}): Promise<[string[], number, string, number[], string | null, number]> {
|
||||||
|
let request: RequestFlow;
|
||||||
|
const promise = new Promise<[string[], number, string, number[], string | null, number]>((resolve, reject) => {
|
||||||
|
const r = new RequestFlowBuilder()
|
||||||
|
.disableInjections()
|
||||||
|
.withRawScript(
|
||||||
|
`
|
||||||
|
(xor
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "somethingToReturn") [] somethingToReturn)
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "smthOption") [] smthOption)
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("multiret-test" "retStr") ["some-str"] $res)
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("multiret-test" "retStr") ["random-str"] $res)
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("multiret-test" "retStr") ["some-str"] str)
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("multiret-num" "retNum") [] n)
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("op" "identity") [str] $res)
|
||||||
|
)
|
||||||
|
(xor
|
||||||
|
(call %init_peer_id% ("callbackSrv" "response") [$res 5 "some-str" somethingToReturn smthOption n])
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||||
|
)
|
||||||
|
|
||||||
|
`,
|
||||||
|
)
|
||||||
|
.configHandler((h) => {
|
||||||
|
h.on('getDataSrv', '-relay-', () => {
|
||||||
|
return client.relayPeerId!;
|
||||||
|
});
|
||||||
|
h.on('getDataSrv', 'somethingToReturn', () => {return somethingToReturn;});
|
||||||
|
h.on('getDataSrv', 'smthOption', () => {return smthOption === null ? [] : [smthOption];});
|
||||||
|
h.onEvent('callbackSrv', 'response', (args) => {
|
||||||
|
let opt: any = args;
|
||||||
|
|
||||||
|
if(Array.isArray(opt[4])) {
|
||||||
|
if (opt[4].length === 0) { opt[4] = null; }
|
||||||
|
else {opt[4] = opt[4][0]; }
|
||||||
|
}
|
||||||
|
return resolve(opt);
|
||||||
|
});
|
||||||
|
|
||||||
|
h.onEvent('errorHandlingSrv', 'error', (args) => {
|
||||||
|
// assuming error is the single argument
|
||||||
|
const [err] = args;
|
||||||
|
reject(err);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.handleScriptError(reject)
|
||||||
|
.handleTimeout(() => {
|
||||||
|
reject('Request timed out for multiReturnFunc');
|
||||||
|
})
|
||||||
|
if(config && config.ttl) {
|
||||||
|
r.withTTL(config.ttl)
|
||||||
|
}
|
||||||
|
request = r.build();
|
||||||
|
});
|
||||||
|
await client.initiateFlow(request!);
|
||||||
|
return promise;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,102 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//Srv
|
||||||
|
//defaultId = "srv"
|
||||||
|
|
||||||
|
//add_alias: (alias: string, service_id: string) => void
|
||||||
|
//create: (blueprint_id: string) => string
|
||||||
|
//get_interface: (service_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list: () => {blueprint_id:string;id:string;owner_id:string}[]
|
||||||
|
//remove: (service_id: string) => void
|
||||||
|
//resolve_alias: (alias: string) => string
|
||||||
|
//END Srv
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Peer
|
||||||
|
//defaultId = "peer"
|
||||||
|
|
||||||
|
//connect: (id: string, multiaddrs: string[] | null) => boolean
|
||||||
|
//get_contact: (peer: string) => {addresses:string[];peer_id:string}
|
||||||
|
//identify: () => {external_addresses:string[]}
|
||||||
|
//is_connected: (peer: string) => boolean
|
||||||
|
//timestamp_ms: () => number
|
||||||
|
//timestamp_sec: () => number
|
||||||
|
//END Peer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//OpH
|
||||||
|
//defaultId = "opa"
|
||||||
|
|
||||||
|
//identity: (s: string) => string
|
||||||
|
//END OpH
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Op
|
||||||
|
//defaultId = "op"
|
||||||
|
|
||||||
|
//array: (a: string, b: string | null, c: string | null, d: string | null) => string[]
|
||||||
|
//array_length: (array: string[]) => number
|
||||||
|
//bytes_from_b58: (b: string) => number[]
|
||||||
|
//bytes_to_b58: (bs: number[]) => string
|
||||||
|
//concat: (a: string[], b: string[] | null, c: string[] | null, d: string[] | null) => string[]
|
||||||
|
//concat_strings: (a: string, b: string) => string
|
||||||
|
//identity: (s: string | null) => string | null
|
||||||
|
//noop: () => void
|
||||||
|
//sha256_string: (s: string) => string
|
||||||
|
//string_from_b58: (b: string) => string
|
||||||
|
//string_to_b58: (s: string) => string
|
||||||
|
//END Op
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Kademlia
|
||||||
|
//defaultId = "kad"
|
||||||
|
|
||||||
|
//merge: (target: string, left: string[], right: string[], count: number | null) => string[]
|
||||||
|
//neighborhood: (key: string, already_hashed: boolean | null, count: number | null) => string[]
|
||||||
|
//END Kademlia
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Script
|
||||||
|
//defaultId = "script"
|
||||||
|
|
||||||
|
//add: (air_script: string, interval: string | null) => string
|
||||||
|
//list: () => {failures:number;id:string;interval:string;owner:string;src:string}
|
||||||
|
//remove: (script_id: string) => boolean
|
||||||
|
//END Script
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Dist
|
||||||
|
//defaultId = "dist"
|
||||||
|
|
||||||
|
//add_blueprint: (blueprint: {dependencies:string[];name:string}) => string
|
||||||
|
//add_module: (wasm_b56_content: number[], conf: {name:string}) => string
|
||||||
|
//add_module_from_vault: (path: string, config: {name:string}) => string
|
||||||
|
//default_module_config: (module_name: string) => {name:string}
|
||||||
|
//get_interface: (module_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list_blueprints: () => {dependencies:string[];id:string;name:string}[]
|
||||||
|
//list_modules: () => {config:{name:string};hash:string;name:string}[]
|
||||||
|
//make_blueprint: (name: string, dependencies: string[]) => {dependencies:string[];name:string}
|
||||||
|
//make_module_config: (name: string, mem_pages_count: number | null, logger_enabled: boolean | null, preopened_files: string[] | null, envs: string[][] | null, mapped_dirs: string[][] | null, mounted_binaries: string[][] | null, logging_mask: number | null) => {name:string}
|
||||||
|
//END Dist
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function a(client: FluenceClient, b: string, config?: {ttl?: number}): Promise<string> {
|
export async function a(client: FluenceClient, b: string, config?: {ttl?: number}): Promise<string> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -123,4 +219,4 @@ export async function d(client: FluenceClient, e: string, config?: {ttl?: number
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,10 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function getPeerExternalAddresses(client: FluenceClient, otherNodePeerId: string, config?: {ttl?: number}): Promise<string[]> {
|
export async function getPeerExternalAddresses(client: FluenceClient, otherNodePeerId: string, config?: {ttl?: number}): Promise<string[]> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -163,4 +167,4 @@ h.on('getDataSrv', 'viaNode', () => {return viaNode;});
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,104 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//Srv
|
||||||
|
//defaultId = "srv"
|
||||||
|
|
||||||
|
//add_alias: (alias: string, service_id: string) => void
|
||||||
|
//create: (blueprint_id: string) => string
|
||||||
|
//get_interface: (service_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list: () => {blueprint_id:string;id:string;owner_id:string}[]
|
||||||
|
//remove: (service_id: string) => void
|
||||||
|
//resolve_alias: (alias: string) => string
|
||||||
|
//END Srv
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Op
|
||||||
|
//defaultId = "op"
|
||||||
|
|
||||||
|
//array: (a: string, b: string | null, c: string | null, d: string | null) => string[]
|
||||||
|
//array_length: (array: string[]) => number
|
||||||
|
//bytes_from_b58: (b: string) => number[]
|
||||||
|
//bytes_to_b58: (bs: number[]) => string
|
||||||
|
//concat: (a: string[], b: string[] | null, c: string[] | null, d: string[] | null) => string[]
|
||||||
|
//concat_strings: (a: string, b: string) => string
|
||||||
|
//identity: (s: string | null) => string | null
|
||||||
|
//noop: () => void
|
||||||
|
//sha256_string: (s: string) => string
|
||||||
|
//string_from_b58: (b: string) => string
|
||||||
|
//string_to_b58: (s: string) => string
|
||||||
|
//END Op
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Kademlia
|
||||||
|
//defaultId = "kad"
|
||||||
|
|
||||||
|
//merge: (target: string, left: string[], right: string[], count: number | null) => string[]
|
||||||
|
//neighborhood: (key: string, already_hashed: boolean | null, count: number | null) => string[]
|
||||||
|
//END Kademlia
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Script
|
||||||
|
//defaultId = "script"
|
||||||
|
|
||||||
|
//add: (air_script: string, interval: string | null) => string
|
||||||
|
//list: () => {failures:number;id:string;interval:string;owner:string;src:string}
|
||||||
|
//remove: (script_id: string) => boolean
|
||||||
|
//END Script
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Dist
|
||||||
|
//defaultId = "dist"
|
||||||
|
|
||||||
|
//add_blueprint: (blueprint: {dependencies:string[];name:string}) => string
|
||||||
|
//add_module: (wasm_b56_content: number[], conf: {name:string}) => string
|
||||||
|
//add_module_from_vault: (path: string, config: {name:string}) => string
|
||||||
|
//default_module_config: (module_name: string) => {name:string}
|
||||||
|
//get_interface: (module_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list_blueprints: () => {dependencies:string[];id:string;name:string}[]
|
||||||
|
//list_modules: () => {config:{name:string};hash:string;name:string}[]
|
||||||
|
//make_blueprint: (name: string, dependencies: string[]) => {dependencies:string[];name:string}
|
||||||
|
//make_module_config: (name: string, mem_pages_count: number | null, logger_enabled: boolean | null, preopened_files: string[] | null, envs: string[][] | null, mapped_dirs: string[][] | null, mounted_binaries: string[][] | null, logging_mask: number | null) => {name:string}
|
||||||
|
//END Dist
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Peer
|
||||||
|
//defaultId = "peer"
|
||||||
|
|
||||||
|
//connect: (id: string, multiaddrs: string[] | null) => boolean
|
||||||
|
//get_contact: (peer: string) => {addresses:string[];peer_id:string}
|
||||||
|
//identify: () => {external_addresses:string[]}
|
||||||
|
//is_connected: (peer: string) => boolean
|
||||||
|
//timestamp_ms: () => number
|
||||||
|
//timestamp_sec: () => number
|
||||||
|
//END Peer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//SomeS
|
||||||
|
//defaultId = "test2"
|
||||||
|
|
||||||
|
//getStr: (arg0: string | null) => string | null
|
||||||
|
//getStr1: () => string | null
|
||||||
|
//getStr2: (arg0: string) => string
|
||||||
|
//END SomeS
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function useOptional(client: FluenceClient, opt: string | null, config?: {ttl?: number}): Promise<string> {
|
export async function useOptional(client: FluenceClient, opt: string | null, config?: {ttl?: number}): Promise<string> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -190,4 +288,4 @@ export async function returnNone(client: FluenceClient, config?: {ttl?: number})
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,102 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//Srv
|
||||||
|
//defaultId = "srv"
|
||||||
|
|
||||||
|
//add_alias: (alias: string, service_id: string) => void
|
||||||
|
//create: (blueprint_id: string) => string
|
||||||
|
//get_interface: (service_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list: () => {blueprint_id:string;id:string;owner_id:string}[]
|
||||||
|
//remove: (service_id: string) => void
|
||||||
|
//resolve_alias: (alias: string) => string
|
||||||
|
//END Srv
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Peer
|
||||||
|
//defaultId = "peer"
|
||||||
|
|
||||||
|
//connect: (id: string, multiaddrs: string[] | null) => boolean
|
||||||
|
//get_contact: (peer: string) => {addresses:string[];peer_id:string}
|
||||||
|
//identify: () => {external_addresses:string[]}
|
||||||
|
//is_connected: (peer: string) => boolean
|
||||||
|
//timestamp_ms: () => number
|
||||||
|
//timestamp_sec: () => number
|
||||||
|
//END Peer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Op
|
||||||
|
//defaultId = "op"
|
||||||
|
|
||||||
|
//array: (a: string, b: string | null, c: string | null, d: string | null) => string[]
|
||||||
|
//array_length: (array: string[]) => number
|
||||||
|
//bytes_from_b58: (b: string) => number[]
|
||||||
|
//bytes_to_b58: (bs: number[]) => string
|
||||||
|
//concat: (a: string[], b: string[] | null, c: string[] | null, d: string[] | null) => string[]
|
||||||
|
//concat_strings: (a: string, b: string) => string
|
||||||
|
//identity: (s: string | null) => string | null
|
||||||
|
//noop: () => void
|
||||||
|
//sha256_string: (s: string) => string
|
||||||
|
//string_from_b58: (b: string) => string
|
||||||
|
//string_to_b58: (s: string) => string
|
||||||
|
//END Op
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//ParService
|
||||||
|
//defaultId = "parservice-id"
|
||||||
|
|
||||||
|
//call: () => string
|
||||||
|
//END ParService
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Kademlia
|
||||||
|
//defaultId = "kad"
|
||||||
|
|
||||||
|
//merge: (target: string, left: string[], right: string[], count: number | null) => string[]
|
||||||
|
//neighborhood: (key: string, already_hashed: boolean | null, count: number | null) => string[]
|
||||||
|
//END Kademlia
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Script
|
||||||
|
//defaultId = "script"
|
||||||
|
|
||||||
|
//add: (air_script: string, interval: string | null) => string
|
||||||
|
//list: () => {failures:number;id:string;interval:string;owner:string;src:string}
|
||||||
|
//remove: (script_id: string) => boolean
|
||||||
|
//END Script
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Dist
|
||||||
|
//defaultId = "dist"
|
||||||
|
|
||||||
|
//add_blueprint: (blueprint: {dependencies:string[];name:string}) => string
|
||||||
|
//add_module: (wasm_b56_content: number[], conf: {name:string}) => string
|
||||||
|
//add_module_from_vault: (path: string, config: {name:string}) => string
|
||||||
|
//default_module_config: (module_name: string) => {name:string}
|
||||||
|
//get_interface: (module_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list_blueprints: () => {dependencies:string[];id:string;name:string}[]
|
||||||
|
//list_modules: () => {config:{name:string};hash:string;name:string}[]
|
||||||
|
//make_blueprint: (name: string, dependencies: string[]) => {dependencies:string[];name:string}
|
||||||
|
//make_module_config: (name: string, mem_pages_count: number | null, logger_enabled: boolean | null, preopened_files: string[] | null, envs: string[][] | null, mapped_dirs: string[][] | null, mounted_binaries: string[][] | null, logging_mask: number | null) => {name:string}
|
||||||
|
//END Dist
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function parFunc(client: FluenceClient, node: string, c: (arg0: {external_addresses:string[]}) => void, config?: {ttl?: number}): Promise<void> {
|
export async function parFunc(client: FluenceClient, node: string, c: (arg0: {external_addresses:string[]}) => void, config?: {ttl?: number}): Promise<void> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -78,4 +174,4 @@ h.on('callbackSrv', 'c', (args) => {c(args[0]); return {};});
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return Promise.race([promise, Promise.resolve()]);
|
return Promise.race([promise, Promise.resolve()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,17 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//AquaDHT
|
||||||
|
//defaultId = "test-dht"
|
||||||
|
|
||||||
|
//put_host_value: (key: string, value: string, service_id: string[]) => string
|
||||||
|
//END AquaDHT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function putHostValue(client: FluenceClient, key: string, value: string, service_id: string | null, config?: {ttl?: number}): Promise<string> {
|
export async function putHostValue(client: FluenceClient, key: string, value: string, service_id: string | null, config?: {ttl?: number}): Promise<string> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -131,4 +142,4 @@ export async function create_client_util(client: FluenceClient, service_id: stri
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,17 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//Println
|
||||||
|
//defaultId = "println-service-id"
|
||||||
|
|
||||||
|
//print: (arg0: string) => void
|
||||||
|
//END Println
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function print(client: FluenceClient, str: string, config?: {ttl?: number}): Promise<void> {
|
export async function print(client: FluenceClient, str: string, config?: {ttl?: number}): Promise<void> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -56,4 +67,4 @@ export async function print(client: FluenceClient, str: string, config?: {ttl?:
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return Promise.race([promise, Promise.resolve()]);
|
return Promise.race([promise, Promise.resolve()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,17 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//OpA
|
||||||
|
//defaultId = "pop"
|
||||||
|
|
||||||
|
//get_str: () => string
|
||||||
|
//END OpA
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function get_results(client: FluenceClient, config?: {ttl?: number}): Promise<string[]> {
|
export async function get_results(client: FluenceClient, config?: {ttl?: number}): Promise<string[]> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -69,4 +80,4 @@ export async function get_results(client: FluenceClient, config?: {ttl?: number}
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,17 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//Stringer
|
||||||
|
//defaultId = "stringer-id"
|
||||||
|
|
||||||
|
//returnString: (arg0: string) => string
|
||||||
|
//END Stringer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function checkStreams(client: FluenceClient, ch: string[], config?: {ttl?: number}): Promise<string[]> {
|
export async function checkStreams(client: FluenceClient, ch: string[], config?: {ttl?: number}): Promise<string[]> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -77,4 +88,4 @@ export async function checkStreams(client: FluenceClient, ch: string[], config?:
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,17 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//TestService
|
||||||
|
//defaultId = "test-service"
|
||||||
|
|
||||||
|
//get_records: (key: string) => string[]
|
||||||
|
//END TestService
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function append_records(client: FluenceClient, peer: string, srum: string[][], config?: {ttl?: number}): Promise<void> {
|
export async function append_records(client: FluenceClient, peer: string, srum: string[][], config?: {ttl?: number}): Promise<void> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -125,4 +136,4 @@ export async function retrieve_records(client: FluenceClient, peer: string, conf
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,17 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//DTGetter
|
||||||
|
//defaultId = "get-dt"
|
||||||
|
|
||||||
|
//get_dt: (s: string) => {field:string}
|
||||||
|
//END DTGetter
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function use_name1(client: FluenceClient, name: string, config?: {ttl?: number}): Promise<string> {
|
export async function use_name1(client: FluenceClient, name: string, config?: {ttl?: number}): Promise<string> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -138,4 +149,4 @@ export async function use_name2(client: FluenceClient, name: string, config?: {t
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,26 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//Testo
|
||||||
|
//defaultId = "testo"
|
||||||
|
|
||||||
|
//getString: (arg0: string) => string
|
||||||
|
//END Testo
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//LocalPrint
|
||||||
|
//defaultId = "lp"
|
||||||
|
|
||||||
|
//print: (arg0: string) => void
|
||||||
|
//END LocalPrint
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function topologyTest(client: FluenceClient, me: string, myRelay: string, friend: string, friendRelay: string, config?: {ttl?: number}): Promise<string> {
|
export async function topologyTest(client: FluenceClient, me: string, myRelay: string, friend: string, friendRelay: string, config?: {ttl?: number}): Promise<string> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -108,4 +128,4 @@ h.on('getDataSrv', 'friendRelay', () => {return friendRelay;});
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,111 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//Srv
|
||||||
|
//defaultId = "srv"
|
||||||
|
|
||||||
|
//add_alias: (alias: string, service_id: string) => void
|
||||||
|
//create: (blueprint_id: string) => string
|
||||||
|
//get_interface: (service_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list: () => {blueprint_id:string;id:string;owner_id:string}[]
|
||||||
|
//remove: (service_id: string) => void
|
||||||
|
//resolve_alias: (alias: string) => string
|
||||||
|
//END Srv
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Peer
|
||||||
|
//defaultId = "peer"
|
||||||
|
|
||||||
|
//connect: (id: string, multiaddrs: string[] | null) => boolean
|
||||||
|
//get_contact: (peer: string) => {addresses:string[];peer_id:string}
|
||||||
|
//identify: () => {external_addresses:string[]}
|
||||||
|
//is_connected: (peer: string) => boolean
|
||||||
|
//timestamp_ms: () => number
|
||||||
|
//timestamp_sec: () => number
|
||||||
|
//END Peer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Op
|
||||||
|
//defaultId = "op"
|
||||||
|
|
||||||
|
//array: (a: string, b: string | null, c: string | null, d: string | null) => string[]
|
||||||
|
//array_length: (array: string[]) => number
|
||||||
|
//bytes_from_b58: (b: string) => number[]
|
||||||
|
//bytes_to_b58: (bs: number[]) => string
|
||||||
|
//concat: (a: string[], b: string[] | null, c: string[] | null, d: string[] | null) => string[]
|
||||||
|
//concat_strings: (a: string, b: string) => string
|
||||||
|
//identity: (s: string | null) => string | null
|
||||||
|
//noop: () => void
|
||||||
|
//sha256_string: (s: string) => string
|
||||||
|
//string_from_b58: (b: string) => string
|
||||||
|
//string_to_b58: (s: string) => string
|
||||||
|
//END Op
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Script
|
||||||
|
//defaultId = "script"
|
||||||
|
|
||||||
|
//add: (air_script: string, interval: string | null) => string
|
||||||
|
//list: () => {failures:number;id:string;interval:string;owner:string;src:string}
|
||||||
|
//remove: (script_id: string) => boolean
|
||||||
|
//END Script
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Unexisted
|
||||||
|
//defaultId = "unex"
|
||||||
|
|
||||||
|
//getStr: () => string
|
||||||
|
//END Unexisted
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Dist
|
||||||
|
//defaultId = "dist"
|
||||||
|
|
||||||
|
//add_blueprint: (blueprint: {dependencies:string[];name:string}) => string
|
||||||
|
//add_module: (wasm_b56_content: number[], conf: {name:string}) => string
|
||||||
|
//add_module_from_vault: (path: string, config: {name:string}) => string
|
||||||
|
//default_module_config: (module_name: string) => {name:string}
|
||||||
|
//get_interface: (module_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list_blueprints: () => {dependencies:string[];id:string;name:string}[]
|
||||||
|
//list_modules: () => {config:{name:string};hash:string;name:string}[]
|
||||||
|
//make_blueprint: (name: string, dependencies: string[]) => {dependencies:string[];name:string}
|
||||||
|
//make_module_config: (name: string, mem_pages_count: number | null, logger_enabled: boolean | null, preopened_files: string[] | null, envs: string[][] | null, mapped_dirs: string[][] | null, mounted_binaries: string[][] | null, logging_mask: number | null) => {name:string}
|
||||||
|
//END Dist
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Kademlia
|
||||||
|
//defaultId = "kad"
|
||||||
|
|
||||||
|
//merge: (target: string, left: string[], right: string[], count: number | null) => string[]
|
||||||
|
//neighborhood: (key: string, already_hashed: boolean | null, count: number | null) => string[]
|
||||||
|
//END Kademlia
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//OpA
|
||||||
|
//defaultId = "op"
|
||||||
|
|
||||||
|
//identity: (s: string) => string
|
||||||
|
//END OpA
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function tryCatchTest(client: FluenceClient, node_id: string, config?: {ttl?: number}): Promise<string[]> {
|
export async function tryCatchTest(client: FluenceClient, node_id: string, config?: {ttl?: number}): Promise<string[]> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -87,4 +192,4 @@ export async function tryCatchTest(client: FluenceClient, node_id: string, confi
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,26 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//Unexisted
|
||||||
|
//defaultId = "unex"
|
||||||
|
|
||||||
|
//getStr: () => string
|
||||||
|
//END Unexisted
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//OpE
|
||||||
|
//defaultId = "op"
|
||||||
|
|
||||||
|
//identity: (s: string) => string
|
||||||
|
//END OpE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function tryOtherwiseTest(client: FluenceClient, node_id: string, config?: {ttl?: number}): Promise<string> {
|
export async function tryOtherwiseTest(client: FluenceClient, node_id: string, config?: {ttl?: number}): Promise<string> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -81,4 +101,4 @@ export async function tryOtherwiseTest(client: FluenceClient, node_id: string, c
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* 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
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.1.13-SNAPSHOT
|
* Aqua version: 0.1.14-SNAPSHOT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||||
@ -11,6 +11,102 @@ import { RequestFlowBuilder } from '@fluencelabs/fluence/dist/api.unstable';
|
|||||||
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||||
|
|
||||||
|
|
||||||
|
// Services
|
||||||
|
|
||||||
|
//Srv
|
||||||
|
//defaultId = "srv"
|
||||||
|
|
||||||
|
//add_alias: (alias: string, service_id: string) => void
|
||||||
|
//create: (blueprint_id: string) => string
|
||||||
|
//get_interface: (service_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list: () => {blueprint_id:string;id:string;owner_id:string}[]
|
||||||
|
//remove: (service_id: string) => void
|
||||||
|
//resolve_alias: (alias: string) => string
|
||||||
|
//END Srv
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//CustomId
|
||||||
|
//defaultId = "cid"
|
||||||
|
|
||||||
|
//id: (s: string) => string
|
||||||
|
//END CustomId
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Peer
|
||||||
|
//defaultId = "peer"
|
||||||
|
|
||||||
|
//connect: (id: string, multiaddrs: string[] | null) => boolean
|
||||||
|
//get_contact: (peer: string) => {addresses:string[];peer_id:string}
|
||||||
|
//identify: () => {external_addresses:string[]}
|
||||||
|
//is_connected: (peer: string) => boolean
|
||||||
|
//timestamp_ms: () => number
|
||||||
|
//timestamp_sec: () => number
|
||||||
|
//END Peer
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Op
|
||||||
|
//defaultId = "op"
|
||||||
|
|
||||||
|
//array: (a: string, b: string | null, c: string | null, d: string | null) => string[]
|
||||||
|
//array_length: (array: string[]) => number
|
||||||
|
//bytes_from_b58: (b: string) => number[]
|
||||||
|
//bytes_to_b58: (bs: number[]) => string
|
||||||
|
//concat: (a: string[], b: string[] | null, c: string[] | null, d: string[] | null) => string[]
|
||||||
|
//concat_strings: (a: string, b: string) => string
|
||||||
|
//identity: (s: string | null) => string | null
|
||||||
|
//noop: () => void
|
||||||
|
//sha256_string: (s: string) => string
|
||||||
|
//string_from_b58: (b: string) => string
|
||||||
|
//string_to_b58: (s: string) => string
|
||||||
|
//END Op
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Kademlia
|
||||||
|
//defaultId = "kad"
|
||||||
|
|
||||||
|
//merge: (target: string, left: string[], right: string[], count: number | null) => string[]
|
||||||
|
//neighborhood: (key: string, already_hashed: boolean | null, count: number | null) => string[]
|
||||||
|
//END Kademlia
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Script
|
||||||
|
//defaultId = "script"
|
||||||
|
|
||||||
|
//add: (air_script: string, interval: string | null) => string
|
||||||
|
//list: () => {failures:number;id:string;interval:string;owner:string;src:string}
|
||||||
|
//remove: (script_id: string) => boolean
|
||||||
|
//END Script
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Dist
|
||||||
|
//defaultId = "dist"
|
||||||
|
|
||||||
|
//add_blueprint: (blueprint: {dependencies:string[];name:string}) => string
|
||||||
|
//add_module: (wasm_b56_content: number[], conf: {name:string}) => string
|
||||||
|
//add_module_from_vault: (path: string, config: {name:string}) => string
|
||||||
|
//default_module_config: (module_name: string) => {name:string}
|
||||||
|
//get_interface: (module_id: string) => {function_signatures:{arguments:string[][];name:string;output_types:string[]}[];record_types:{fields:string[][];id:number;name:string}[]}
|
||||||
|
//list_blueprints: () => {dependencies:string[];id:string;name:string}[]
|
||||||
|
//list_modules: () => {config:{name:string};hash:string;name:string}[]
|
||||||
|
//make_blueprint: (name: string, dependencies: string[]) => {dependencies:string[];name:string}
|
||||||
|
//make_module_config: (name: string, mem_pages_count: number | null, logger_enabled: boolean | null, preopened_files: string[] | null, envs: string[][] | null, mapped_dirs: string[][] | null, mounted_binaries: string[][] | null, logging_mask: number | null) => {name:string}
|
||||||
|
//END Dist
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Functions
|
||||||
|
|
||||||
export async function viaArr(client: FluenceClient, node_id: string, viaAr: string[], config?: {ttl?: number}): Promise<{external_addresses:string[]}> {
|
export async function viaArr(client: FluenceClient, node_id: string, viaAr: string[], config?: {ttl?: number}): Promise<{external_addresses:string[]}> {
|
||||||
let request: RequestFlow;
|
let request: RequestFlow;
|
||||||
@ -321,4 +417,4 @@ h.on('getDataSrv', 'viaOpt', () => {return viaOpt === null ? [] : [viaOpt];});
|
|||||||
await client.initiateFlow(request!);
|
await client.initiateFlow(request!);
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
src/examples/declareCall.ts
Normal file
14
src/examples/declareCall.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import {FluenceClient, registerServiceFunction} from "@fluencelabs/fluence";
|
||||||
|
import {concat_foobars} from "../compiled/examples/imports_exports/imports";
|
||||||
|
|
||||||
|
export async function declareCall(client: FluenceClient) {
|
||||||
|
registerServiceFunction(client, "super_foo", "small_foo", (args: any[], _) => {
|
||||||
|
return "small_foo"
|
||||||
|
})
|
||||||
|
|
||||||
|
registerServiceFunction(client, "string_service", "concat", (args: any[], _) => {
|
||||||
|
return args[0] + args[1]
|
||||||
|
})
|
||||||
|
|
||||||
|
return await concat_foobars(client)
|
||||||
|
}
|
@ -28,6 +28,7 @@ import {streamResultsCall} from "./examples/streamResultsCall";
|
|||||||
import {pushToStreamCall} from "./examples/pushToStreamCall";
|
import {pushToStreamCall} from "./examples/pushToStreamCall";
|
||||||
import {literalCall} from "./examples/returnLiteralCall";
|
import {literalCall} from "./examples/returnLiteralCall";
|
||||||
import {multiReturnCall} from "./examples/multiReturnCall";
|
import {multiReturnCall} from "./examples/multiReturnCall";
|
||||||
|
import {declareCall} from "./examples/declareCall";
|
||||||
let deepEqual = require('deep-equal')
|
let deepEqual = require('deep-equal')
|
||||||
|
|
||||||
function checkCall(name: string, actual: any, expected: any, callBackOnError: () => void) {
|
function checkCall(name: string, actual: any, expected: any, callBackOnError: () => void) {
|
||||||
@ -146,6 +147,9 @@ const main = async () => {
|
|||||||
// multiReturn.aqua
|
// multiReturn.aqua
|
||||||
let multiReturnResult = await multiReturnCall(client)
|
let multiReturnResult = await multiReturnCall(client)
|
||||||
|
|
||||||
|
// declare.aqua
|
||||||
|
let declareResult = await declareCall(client)
|
||||||
|
|
||||||
await client.disconnect();
|
await client.disconnect();
|
||||||
|
|
||||||
let success = true;
|
let success = true;
|
||||||
@ -203,6 +207,8 @@ const main = async () => {
|
|||||||
|
|
||||||
checkCall("multiReturnResult", multiReturnResult, [ [ 'some-str', 'random-str', 'some-str' ], 5, 'some-str', [ 1, 2 ], null, 10], cb)
|
checkCall("multiReturnResult", multiReturnResult, [ [ 'some-str', 'random-str', 'some-str' ], 5, 'some-str', [ 1, 2 ], null, 10], cb)
|
||||||
|
|
||||||
|
checkCall("declareResult", declareResult, 'declare all foodeclare all barsmall_foo', cb)
|
||||||
|
|
||||||
checkCallBy("tryCatchCall", tryCatchResult, (res) => {
|
checkCallBy("tryCatchCall", tryCatchResult, (res) => {
|
||||||
return (res[0] as string).includes("Error: Service with id 'unex' not found") && res[1] === '/ip4/164.90.171.139/tcp/7770'
|
return (res[0] as string).includes("Error: Service with id 'unex' not found") && res[1] === '/ip4/164.90.171.139/tcp/7770'
|
||||||
}, cb)
|
}, cb)
|
||||||
|
Reference in New Issue
Block a user