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.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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[]> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// Services
|
||||
|
||||
|
||||
// Functions
|
||||
|
||||
export async function print(client: FluenceClient, str: string, config?: {ttl?: number}): Promise<void> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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[]> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// Services
|
||||
|
||||
//NodeIdGetter
|
||||
//defaultId = "somesrv"
|
||||
|
||||
//get: () => {name:string;peerId:string}
|
||||
//END NodeIdGetter
|
||||
|
||||
|
||||
|
||||
// Functions
|
||||
|
||||
export async function getAliasedData(client: FluenceClient, config?: {ttl?: number}): Promise<string> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// Services
|
||||
|
||||
|
||||
// Functions
|
||||
|
||||
export async function print(client: FluenceClient, str: string, config?: {ttl?: number}): Promise<void> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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[]> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// Services
|
||||
|
||||
//TestSrv
|
||||
//defaultId = "test-service-id"
|
||||
|
||||
//str: () => string
|
||||
//END TestSrv
|
||||
|
||||
|
||||
|
||||
// Functions
|
||||
|
||||
export async function testFunc(client: FluenceClient, config?: {ttl?: number}): Promise<string> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// Services
|
||||
|
||||
|
||||
// Functions
|
||||
|
||||
export async function print(client: FluenceClient, str: string, config?: {ttl?: number}): Promise<void> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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;
|
||||
const promise = new Promise<string>((resolve, reject) => {
|
||||
const promise = new Promise<[string, number]>((resolve, reject) => {
|
||||
const r = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
.withRawScript(
|
||||
`
|
||||
(xor
|
||||
(seq
|
||||
(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
|
||||
(call %init_peer_id% ("callbackSrv" "response") ["str"])
|
||||
(call %init_peer_id% ("callbackSrv" "response") [str n])
|
||||
(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) => {
|
||||
const [res] = args;
|
||||
resolve(res);
|
||||
let opt: any = args;
|
||||
|
||||
return resolve(opt);
|
||||
});
|
||||
|
||||
h.onEvent('errorHandlingSrv', 'error', (args) => {
|
||||
@ -61,3 +88,81 @@ export async function tupleFunc(client: FluenceClient, config?: {ttl?: number}):
|
||||
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.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// Services
|
||||
|
||||
|
||||
// Functions
|
||||
|
||||
export async function getPeerExternalAddresses(client: FluenceClient, otherNodePeerId: string, config?: {ttl?: number}): Promise<string[]> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// Services
|
||||
|
||||
//OpA
|
||||
//defaultId = "pop"
|
||||
|
||||
//get_str: () => string
|
||||
//END OpA
|
||||
|
||||
|
||||
|
||||
// Functions
|
||||
|
||||
export async function get_results(client: FluenceClient, config?: {ttl?: number}): Promise<string[]> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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[]> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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[]> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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> {
|
||||
let request: RequestFlow;
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.13-SNAPSHOT
|
||||
* Aqua version: 0.1.14-SNAPSHOT
|
||||
*
|
||||
*/
|
||||
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';
|
||||
|
||||
|
||||
// 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[]}> {
|
||||
let request: RequestFlow;
|
||||
|
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 {literalCall} from "./examples/returnLiteralCall";
|
||||
import {multiReturnCall} from "./examples/multiReturnCall";
|
||||
import {declareCall} from "./examples/declareCall";
|
||||
let deepEqual = require('deep-equal')
|
||||
|
||||
function checkCall(name: string, actual: any, expected: any, callBackOnError: () => void) {
|
||||
@ -146,6 +147,9 @@ const main = async () => {
|
||||
// multiReturn.aqua
|
||||
let multiReturnResult = await multiReturnCall(client)
|
||||
|
||||
// declare.aqua
|
||||
let declareResult = await declareCall(client)
|
||||
|
||||
await client.disconnect();
|
||||
|
||||
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("declareResult", declareResult, 'declare all foodeclare all barsmall_foo', cb)
|
||||
|
||||
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'
|
||||
}, cb)
|
||||
|
Reference in New Issue
Block a user