change fluence-js to js-client.node

This commit is contained in:
DieMyst 2023-02-21 11:25:00 +04:00
parent 06b0e86e3e
commit 638fa0250c
106 changed files with 12626 additions and 4491 deletions

16
jest.config.cjs Normal file
View File

@ -0,0 +1,16 @@
module.exports = {
testEnvironment: 'node',
extensionsToTreatAsEsm: ['.ts'],
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
},
],
},
testPathIgnorePatterns: ['dist'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
};

View File

@ -1,4 +0,0 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};

12082
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -5,19 +5,19 @@
"typescript",
"template"
],
"type": "module",
"author": "FluenceLabs (https://github.com/fluencelabs)",
"license": "MIT",
"main": "dist/index.js",
"bin": {
"fldist": "./dist/index.js"
},
"types": "dist/index.d.ts",
"files": [
"dist/"
"dist/",
"src/"
],
"scripts": {
"build": "tsc",
"test": "jest",
"test": "node --loader ts-node/esm ./src/__test__/examples.spec.ts",
"test:jest": "NODE_OPTIONS=--experimental-vm-modules npx jest --detectOpenHandles",
"examples": "jest",
"pubsub": "node -r ts-node/register src/pubsub.ts",
"exec": "npm run compile-aqua && npm run prettify-compiled && node -r ts-node/register src/index.ts",
@ -32,17 +32,16 @@
"@fluencelabs/aqua": "=0.9.4",
"@fluencelabs/aqua-dht": "0.2.5",
"@fluencelabs/aqua-lib": "0.6.0",
"@fluencelabs/avm": "0.35.3",
"@types/jest": "27.5.2",
"@types/jest": "29.4.0",
"jest": "29.4.1",
"ts-jest": "29.0.5",
"@types/node": "18.11.18",
"jest": "27.5.1",
"js-base64": "3.7.4",
"ts-jest": "27.1.5",
"ts-node": "10.9.1",
"typescript": "4.9.4"
"typescript": "4.9.5"
},
"dependencies": {
"@fluencelabs/fluence": "0.28.0",
"@fluencelabs/js-client.node": "0.6.4",
"@fluencelabs/js-client.api": "0.11.3",
"@fluencelabs/fluence-network-environment": "1.0.14",
"deep-equal": "2.2.0"
},

View File

@ -1,20 +1,17 @@
import {getObjAssignCall, getObjCall, getObjRelayCall} from "../examples/objectCall";
jest.retryTimes(1)
import {Fluence, FluencePeer, KeyPair, setLogLevel} from '@fluencelabs/fluence';
import {EphemeralNetwork, defaultConfig} from '@fluencelabs/fluence/dist/internal/ephemeral';
import {registerPrintln} from '../compiled/examples/println';
import {callArrowCall, reproArgsBug426Call} from '../examples/callArrowCall';
import {dataAliasCall} from '../examples/dataAliasCall';
import {onCall} from '../examples/onCall';
import {funcCall} from '../examples/funcCall';
import {helloWorldCall} from '../examples/helloWorldCall';
import {foldBug499Call, foldCall} from '../examples/foldCall';
import {bugNG69Call, ifCall, ifWrapCall} from '../examples/ifCall';
import {parCall, testTimeoutCall} from '../examples/parCall';
import {complexCall} from '../examples/complex';
import {constantsCall, particleTtlAndTimestampCall} from '../examples/constantsCall';
import {Fluence, IFluenceClient} from '@fluencelabs/js-client.api';
import { createClient } from "@fluencelabs/js-client.node"
import {getObjAssignCall, getObjCall, getObjRelayCall} from "../examples/objectCall.js";
import {callArrowCall, reproArgsBug426Call} from '../examples/callArrowCall.js';
import {dataAliasCall} from '../examples/dataAliasCall.js';
import {onCall} from '../examples/onCall.js';
import {funcCall} from '../examples/funcCall.js';
import {registerPrintln} from '../compiled/examples/println.js';
import {helloWorldCall} from '../examples/helloWorldCall.js';
import {foldBug499Call, foldCall} from '../examples/foldCall.js';
import {bugNG69Call, ifCall, ifWrapCall} from '../examples/ifCall.js';
import {parCall, testTimeoutCall} from '../examples/parCall.js';
import {complexCall} from '../examples/complex.js';
import {constantsCall, particleTtlAndTimestampCall} from '../examples/constantsCall.js';
import {
nilLengthCall,
nilLiteralCall,
@ -23,103 +20,86 @@ import {
streamCall,
streamFunctorCall, streamIntFunctorCall, streamJoinCall,
streamReturnFromInnerFunc
} from '../examples/streamCall';
import {topologyBug205Call, topologyBug394Call, topologyBug427Call, topologyCall} from '../examples/topologyCall';
import {foldJoinCall} from '../examples/foldJoinCall';
import {registerHandlers, returnNull, returnOptionalCall, useOptionalCall} from '../examples/useOptionalCall';
import {viaArrCall, viaOptCall, viaOptNullCall, viaStreamCall} from '../examples/viaCall';
import {nestedFuncsCall} from '../examples/nestedFuncsCall';
import {assignmentCall} from '../examples/assignment';
import {tryCatchCall} from '../examples/tryCatchCall';
import {tryOtherwiseCall} from '../examples/tryOtherwiseCall';
import {coCall} from '../examples/coCall';
import {bugLNG60Call, passArgsCall} from '../examples/passArgsCall';
import {streamArgsCall} from '../examples/streamArgsCall';
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';
import {genOptions, genOptionsEmptyString} from '../examples/optionsCall';
import {closuresCall} from '../examples/closures';
import {bugLNG63_2Call, bugLNG63_3Call, bugLNG63Call, streamCanCall} from '../examples/streamCanCall';
import {streamCallbackCall} from '../examples/streamCallback';
import {streamResCall} from '../examples/streamRestrictionsCall';
import {joinIdxCall, joinIdxLocalCall, joinIdxRelayCall} from '../examples/joinCall';
import {recursiveStreamsCall} from '../examples/recursiveStreamsCall';
} from '../examples/streamCall.js';
import {topologyBug205Call, topologyBug394Call, topologyBug427Call, topologyCall} from '../examples/topologyCall.js';
import {foldJoinCall} from '../examples/foldJoinCall.js';
import {registerHandlers, returnNull, returnOptionalCall, useOptionalCall} from '../examples/useOptionalCall.js';
import {viaArrCall, viaOptCall, viaOptNullCall, viaStreamCall} from '../examples/viaCall.js';
import {nestedFuncsCall} from '../examples/nestedFuncsCall.js';
import {assignmentCall} from '../examples/assignment.js';
import {tryCatchCall} from '../examples/tryCatchCall.js';
import {tryOtherwiseCall} from '../examples/tryOtherwiseCall.js';
import {coCall} from '../examples/coCall.js';
import {bugLNG60Call, passArgsCall} from '../examples/passArgsCall.js';
import {streamArgsCall} from '../examples/streamArgsCall.js';
import {streamResultsCall} from '../examples/streamResultsCall.js';
import {pushToStreamCall} from '../examples/pushToStreamCall.js';
import {literalCall} from '../examples/returnLiteralCall.js';
import {multiReturnCall} from '../examples/multiReturnCall.js';
import {declareCall} from '../examples/declareCall.js';
import {genOptions, genOptionsEmptyString} from '../examples/optionsCall.js';
import {closuresCall} from '../examples/closures.js';
import {bugLNG63_2Call, bugLNG63_3Call, bugLNG63Call, streamCanCall} from '../examples/streamCanCall.js';
import {streamCallbackCall} from '../examples/streamCallback.js';
import {streamResCall} from '../examples/streamRestrictionsCall.js';
import {joinIdxCall, joinIdxLocalCall, joinIdxRelayCall} from '../examples/joinCall.js';
import {recursiveStreamsCall} from '../examples/recursiveStreamsCall.js';
import {
arraySugarCall,
bugLNG59Call,
optionSugarCall,
streamSugarCall,
} from '../examples/collectionSugarCall';
import {funcsCall} from '../examples/funcsCall';
import {nestedDataCall} from '../examples/nestedDataCall';
import {mathTest1Call, mathTest2Call} from '../examples/mathCall';
import {lng58Bug} from '../compiled/examples/closures';
import {config, isEphemeral} from '../config';
import {bugLng79Call} from "../examples/canonCall";
} from '../examples/collectionSugarCall.js';
import {funcsCall} from '../examples/funcsCall.js';
import {nestedDataCall} from '../examples/nestedDataCall.js';
import {mathTest1Call, mathTest2Call} from '../examples/mathCall.js';
import {lng58Bug} from '../compiled/examples/closures.js';
import {config, isEphemeral} from '../config.js';
import {bugLng79Call} from "../examples/canonCall.js";
var selfPeerId: string;
var peer2: FluencePeer;
var ephemeralNetwork: EphemeralNetwork;
var peer1: IFluenceClient;
var peer2: IFluenceClient;
export const relay1 = config.relays[0]
const relayPeerId1 = relay1.peerId
export const relay2 = config.relays[1]
const relayPeerId2 = relay2.peerId
// setLogLevel('debug');
async function startEphemeral() {
ephemeralNetwork = new EphemeralNetwork(defaultConfig);
await ephemeralNetwork.up();
const defaultPeer = Fluence.getPeer();
await defaultPeer.init({
KeyPair: await KeyPair.randomEd25519(),
});
const conn = ephemeralNetwork.getRelayConnection(config.relays[0].peerId, defaultPeer);
await defaultPeer.connect(conn);
selfPeerId = defaultPeer.getStatus().peerId;
peer2 = new FluencePeer();
await peer2.init({
KeyPair: await KeyPair.randomEd25519(),
});
const conn2 = ephemeralNetwork.getRelayConnection(config.relays[1].peerId, peer2);
await peer2.connect(conn2);
}
async function stopEphemeral() {
if (ephemeralNetwork) {
await ephemeralNetwork.down();
}
await Fluence.stop();
if (peer2) {
await peer2.stop();
}
}
async function start() {
// await Fluence.start({ connectTo: config.relays[0]});
await Fluence.start({connectTo: config.relays[0], debug: {marineLogLevel: "debug"}});
selfPeerId = Fluence.getStatus().peerId;
console.log("CONNECTING TO FIRST:")
Fluence.onConnectionStateChange((s) => {
console.log(s)
})
await Fluence.connect(relay1)
const cl = await Fluence.getClient();
peer1 = cl;
selfPeerId = cl.getPeerId()
console.log("CONNECTED")
peer2 = new FluencePeer();
await peer2.start({connectTo: config.relays[1]});
peer2 = await createClient()
console.log("CONNECTING TO SECOND:")
peer2.onConnectionStateChange((s) => {
console.log(s)
})
await peer2.connect(relay2)
console.log("CONNECTED")
}
async function stop() {
await Fluence.disconnect();
if (peer2) {
Fluence.stop();
await peer2.stop();
await peer2.disconnect();
}
}
describe('Testing examples', () => {
beforeAll(async () => {
if (isEphemeral) {
await startEphemeral();
} else {
await start();
}
await start();
// this could be called from `println.aqua`
registerPrintln({
@ -127,21 +107,18 @@ describe('Testing examples', () => {
console.dir(arg0);
},
});
});
}, 12000);
afterAll(async () => {
if (isEphemeral) {
await stopEphemeral();
} else {
await stop();
}
await stop();
});
it('callArrow.aqua', async () => {
let callArrowResult = await callArrowCall();
let callArrowResult = await callArrowCall(relayPeerId1);
expect(callArrowResult).toBe('Hello, callArrow call!');
});
}, 10000);
it('callArrow.aqua args bug 426', async () => {
let argResult = await reproArgsBug426Call();
@ -156,7 +133,7 @@ describe('Testing examples', () => {
});
it('fold.aqua', async () => {
let foldCallResult = await foldCall();
let foldCallResult = await foldCall(relayPeerId1);
expect(foldCallResult).toEqual(config.externalAddressesRelay1);
});
@ -170,17 +147,17 @@ describe('Testing examples', () => {
});
it('if.aqua xor wrap', async () => {
let res = await ifWrapCall(peer2.getStatus().relayPeerId);
let res = await ifWrapCall(relay2.peerId);
expect(res).toBe('1x');
});
it('if.aqua bug LNG-69', async () => {
let res = await bugNG69Call(peer2.getStatus().relayPeerId);
let res = await bugNG69Call(relay2.peerId);
expect(res).toBe(true);
});
it(' par.aqua', async () => {
let parCallResult = await parCall();
let parCallResult = await parCall(relayPeerId1);
expect(parCallResult).toBe('hello');
});
@ -205,7 +182,7 @@ describe('Testing examples', () => {
});
it('on.aqua', async () => {
let onCallResult = await onCall();
let onCallResult = await onCall(relayPeerId1);
expect(onCallResult).toEqual(config.externalAddressesRelay1);
});
@ -215,7 +192,7 @@ describe('Testing examples', () => {
});
it('complex.aqua', async () => {
let complexCallResult = await complexCall();
let complexCallResult = await complexCall(selfPeerId, relayPeerId1);
expect(complexCallResult).toEqual(['some str', '3', '1', '4', '1', '1', '3', '2', '4', '2', '2', selfPeerId]);
});
@ -381,25 +358,25 @@ describe('Testing examples', () => {
});
it('topology.aqua', async () => {
let topologyResult = await topologyCall(peer2);
let topologyResult = await topologyCall(peer1, relay1.peerId, peer2, relay2.peerId);
expect(topologyResult).toBe('finish');
});
it('topology.aqua bug 205', async () => {
let topologyResult = await topologyBug205Call(peer2);
const peerId2 = peer2.getStatus().relayPeerId;
let topologyResult = await topologyBug205Call(relay1.peerId, relay2.peerId);
const peerId2 = relay2.peerId;
const res: string[] = [peerId2];
expect(topologyResult).toEqual(res);
});
it('topology.aqua bug 427', async () => {
let topologyResult = await topologyBug427Call(peer2);
let topologyResult = await topologyBug427Call(relay1.peerId, relay2.peerId);
expect(topologyResult).toEqual(['some string', 'some string']);
});
it('topology.aqua bug 394', async () => {
let topologyResult = await topologyBug394Call(peer2);
let topologyResult = await topologyBug394Call(peer1.getPeerId(), relay1.peerId, peer2.getPeerId(), relay2.peerId);
expect(topologyResult).toEqual(selfPeerId);
});
@ -417,7 +394,7 @@ describe('Testing examples', () => {
});
it('foldJoin.aqua', async () => {
let foldJoinResult = await foldJoinCall();
let foldJoinResult = await foldJoinCall(relayPeerId1);
expect(foldJoinResult.length).toBeGreaterThanOrEqual(3);
}, 16000);
@ -438,13 +415,13 @@ describe('Testing examples', () => {
it('via.aqua', async () => {
let res1 = await viaArrCall();
let res2 = await viaOptCall();
let res3 = await viaOptNullCall();
let res4 = await viaStreamCall();
let res2 = await viaOptCall(relayPeerId1);
let res3 = await viaOptNullCall(relayPeerId1);
let res4 = await viaStreamCall(relayPeerId1);
expect(res1).toEqual(res2);
expect(res2).toEqual(res3);
expect(res3).toEqual(res4);
}, 16000);
}, 26000);
it('nestedFuncs.aqua', async () => {
let nestedFuncsResult = await nestedFuncsCall();
@ -460,30 +437,30 @@ describe('Testing examples', () => {
});
});
it('closures.aqua', async () => {
it.skip('closures.aqua', async () => {
let closuresResult = await closuresCall();
let res1 = config.externalAddressesRelay2;
let res2 = ['in', config.externalAddressesRelay2[0]];
expect(closuresResult).toEqual(['in', res1, res1, res2]);
});
}, 60000);
// it('closures.aqua LNG-58 bug', async () => {
// let res = await lng58Bug()
// expect(res).toEqual("ok")
// });
it('assignment.aqua', async () => {
/*it('assignment.aqua', async () => {
let assignmentResult = await assignmentCall();
expect(assignmentResult).toEqual(['abc', 'hello']);
});
it('tryOtherwise.aqua', async () => {
let tryOtherwiseResult = await tryOtherwiseCall();
let tryOtherwiseResult = await tryOtherwiseCall(relayPeerId1);
expect(tryOtherwiseResult).toBe('error');
});
it('tryCatch.aqua', async () => {
let tryCatchResult = await tryCatchCall();
let tryCatchResult = await tryCatchCall(relayPeerId1);
expect(tryCatchResult).toHaveLength(2);
expect(tryCatchResult[0]).toMatch(config.tryCatchError);
expect(tryCatchResult[1]).toBe(config.externalAddressesRelay1[0]);
@ -500,7 +477,7 @@ describe('Testing examples', () => {
});
it('passArgsCall.aqua bugLNG60', async () => {
let result = await bugLNG60Call();
let result = await bugLNG60Call(relayPeerId1);
expect(result).toBe(true);
});
@ -525,19 +502,19 @@ describe('Testing examples', () => {
});
it('join.aqua local', async () => {
let joinLocalCallResult = await joinIdxLocalCall();
let joinLocalCallResult = await joinIdxLocalCall(relayPeerId1);
expect(joinLocalCallResult.length).toBeGreaterThanOrEqual(2);
});
it('join.aqua relay', async () => {
let joinRelayCallResult = await joinIdxRelayCall();
let joinRelayCallResult = await joinIdxRelayCall(relayPeerId1);
expect(joinRelayCallResult.length).toBeGreaterThanOrEqual(2);
});
it('join.aqua network', async () => {
let joinCallResult = await joinIdxCall();
let joinCallResult = await joinIdxCall(relayPeerId1);
expect(joinCallResult.length).toBeGreaterThanOrEqual(2);
}, 16000);
}, 24000);
it('multiReturn.aqua', async () => {
let multiReturnResult = await multiReturnCall();
@ -557,5 +534,5 @@ describe('Testing examples', () => {
it('option_gen.aqua emptyString', async () => {
let optionGenResult = await genOptionsEmptyString();
expect(optionGenResult).toEqual(null);
});
});*/
});

View File

@ -1,103 +0,0 @@
jest.retryTimes(3)
import { krasnodar, stage, testNet } from '@fluencelabs/fluence-network-environment';
const util = require('util');
const exec = util.promisify(require('child_process').exec);
describe('Testing run command', () => {
const addr = krasnodar[4].multiaddr;
const addr2 = krasnodar[1].multiaddr;
const nodeId = krasnodar[5].peerId;
const message = 'hello';
const message2 = 'aaa';
const func = `\"call(\\\"${message}\\\", \\\"${message2}\\\", \\\"${nodeId}\\\")\"`;
const call = `npm run aqua run -- --addr ${addr} -i cli-run-aqua/caller.aqua -m node_modules/ --func ${func}`;
const listBlueprintsCall = `npm run aqua remote list_blueprints -- --addr ${addr}`;
const listModulesCall = `npm run aqua remote list_modules -- --addr ${addr}`;
const listInterfacesCall = `npm run aqua remote list_interfaces -- --addr ${addr}`;
it.skip('run simple command', (done) => {
exec(call, (error, stdout, stderr) => {
if (error) {
console.error(`error: ${error.message}`);
} else if (stderr) {
console.error(`stderr: ${stderr}`);
} else {
// get element before last in output
const result = stdout;
const toCheck = [message, message2].join(',');
const res = result.includes(message) && result.includes(message2);
if (res) {
console.log('Test passed.');
} else {
console.log(`Incorrect message returned. Returned: ${result}. Expected: ${toCheck}`);
}
expect(res).toBeTruthy();
}
done();
});
}, 16000);
it.skip('run listBlueprints', (done) => {
exec(listBlueprintsCall, (error, stdout, stderr) => {
if (error) {
console.error(`error: ${error.message}`);
} else if (stderr) {
console.error(`stderr: ${stderr}`);
} else {
try {
let arr = stdout.split('\n').slice(3);
const result = JSON.parse(arr.join('\n'));
expect(Array.isArray(result)).toBeTruthy();
} catch (e) {
console.error(e);
}
}
done();
});
}, 16000);
it.skip('run listModules', (done) => {
exec(listModulesCall, (error, stdout, stderr) => {
if (error) {
console.error(`error: ${error.message}`);
} else if (stderr) {
console.error(`stderr: ${stderr}`);
} else {
try {
let arr = stdout.split('\n').slice(3);
const result = JSON.parse(arr.join('\n'));
expect(Array.isArray(result)).toBeTruthy();
} catch (e) {
console.error(e);
}
}
done();
});
}, 16000);
it.skip('run listInterfaces', (done) => {
exec(listInterfacesCall, (error, stdout, stderr) => {
if (error) {
console.error(`error: ${error}`);
} else if (stderr) {
console.error(`stderr: ${stderr}`);
} else {
try {
let arr = stdout.split('\n').slice(3);
const result = JSON.parse(arr.join(''));
expect(Array.isArray(result)).toBeTruthy();
} catch (e) {
console.error(e);
}
}
done();
});
}, 16000);
});

View File

@ -1,273 +0,0 @@
/**
*
* 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.9.1-renovate-fluencelabs-fluence-0-x-871e3f3-136-1
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
// Services
// Functions
export function put_value(
initial_peer: string,
value: string,
config?: {ttl?: number}
): Promise<string>;
export function put_value(
peer: FluencePeer,
initial_peer: string,
value: string,
config?: {ttl?: number}
): Promise<string>;
export function put_value(...args: any) {
let script = `
(xor
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(call %init_peer_id% ("getDataSrv" "initial_peer") [] initial_peer)
)
(call %init_peer_id% ("getDataSrv" "value") [] value)
)
(xor
(seq
(seq
(call -relay- ("op" "string_to_b58") [initial_peer] k)
(call -relay- ("kad" "neighborhood") [k [] []] nodes)
)
(par
(fold nodes n-0
(par
(xor
(xor
(seq
(seq
(call n-0 ("peer" "timestamp_sec") [] t)
(call n-0 ("aqua-dht" "register_key") [initial_peer t false 0])
)
(call n-0 ("aqua-dht" "put_value") [initial_peer value t [] [] 0])
)
(call n-0 ("op" "noop") [])
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(next n-0)
)
(never)
)
(null)
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") ["OK"])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 4])
)
`
return callFunction$$(
args,
{
"functionName" : "put_value",
"arrow" : {
"tag" : "arrow",
"domain" : {
"tag" : "labeledProduct",
"fields" : {
"initial_peer" : {
"tag" : "scalar",
"name" : "string"
},
"value" : {
"tag" : "scalar",
"name" : "string"
}
}
},
"codomain" : {
"tag" : "unlabeledProduct",
"items" : [
{
"tag" : "scalar",
"name" : "string"
}
]
}
},
"names" : {
"relay" : "-relay-",
"getDataSrv" : "getDataSrv",
"callbackSrv" : "callbackSrv",
"responseSrv" : "callbackSrv",
"responseFnName" : "response",
"errorHandlingSrv" : "errorHandlingSrv",
"errorFnName" : "error"
}
},
script
)
}
export function registerKeyPutValue(
node_id: string,
key: string,
value: string,
relay_id: string | null,
service_id: string | null,
config?: {ttl?: number}
): Promise<string[]>;
export function registerKeyPutValue(
peer: FluencePeer,
node_id: string,
key: string,
value: string,
relay_id: string | null,
service_id: string | null,
config?: {ttl?: number}
): Promise<string[]>;
export function registerKeyPutValue(...args: any) {
let script = `
(xor
(seq
(seq
(seq
(seq
(seq
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(call %init_peer_id% ("getDataSrv" "node_id") [] node_id)
)
(call %init_peer_id% ("getDataSrv" "key") [] key)
)
(call %init_peer_id% ("getDataSrv" "value") [] value)
)
(call %init_peer_id% ("getDataSrv" "relay_id") [] relay_id)
)
(call %init_peer_id% ("getDataSrv" "service_id") [] service_id)
)
(call %init_peer_id% ("op" "string_to_b58") [key] k)
)
(call %init_peer_id% ("kad" "neighborhood") [k [] []] nodes)
)
(par
(fold nodes n-0
(par
(seq
(call -relay- ("op" "noop") [])
(xor
(call n-0 ("peer" "timestamp_sec") [] t)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
)
(next n-0)
)
(never)
)
(null)
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [nodes])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
)
`
return callFunction$$(
args,
{
"functionName" : "registerKeyPutValue",
"arrow" : {
"tag" : "arrow",
"domain" : {
"tag" : "labeledProduct",
"fields" : {
"node_id" : {
"tag" : "scalar",
"name" : "string"
},
"key" : {
"tag" : "scalar",
"name" : "string"
},
"value" : {
"tag" : "scalar",
"name" : "string"
},
"relay_id" : {
"tag" : "option",
"type" : {
"tag" : "scalar",
"name" : "string"
}
},
"service_id" : {
"tag" : "option",
"type" : {
"tag" : "scalar",
"name" : "string"
}
}
}
},
"codomain" : {
"tag" : "unlabeledProduct",
"items" : [
{
"tag" : "array",
"type" : {
"tag" : "scalar",
"name" : "string"
}
}
]
}
},
"names" : {
"relay" : "-relay-",
"getDataSrv" : "getDataSrv",
"callbackSrv" : "callbackSrv",
"responseSrv" : "callbackSrv",
"responseFnName" : "response",
"errorHandlingSrv" : "errorHandlingSrv",
"errorFnName" : "error"
}
},
script
)
}

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -22,8 +24,8 @@ export interface ComplexServiceDef {
}
export function registerComplexService(service: ComplexServiceDef): void;
export function registerComplexService(serviceId: string, service: ComplexServiceDef): void;
export function registerComplexService(peer: FluencePeer, service: ComplexServiceDef): void;
export function registerComplexService(peer: FluencePeer, serviceId: string, service: ComplexServiceDef): void;
export function registerComplexService(peer: IFluenceClient$$, service: ComplexServiceDef): void;
export function registerComplexService(peer: IFluenceClient$$, serviceId: string, service: ComplexServiceDef): void;
export function registerComplexService(...args: any) {
@ -154,7 +156,7 @@ export function doSmth(
): Promise<DoSmthResult>;
export function doSmth(
peer: FluencePeer,
peer: IFluenceClient$$,
d: DoSmthArgD,
d2: DoSmthArgD2,
sd: DoSmthArgSd,
@ -375,3 +377,5 @@ export function doSmth(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -22,8 +24,8 @@ export interface OpHaDef {
}
export function registerOpHa(service: OpHaDef): void;
export function registerOpHa(serviceId: string, service: OpHaDef): void;
export function registerOpHa(peer: FluencePeer, service: OpHaDef): void;
export function registerOpHa(peer: FluencePeer, serviceId: string, service: OpHaDef): void;
export function registerOpHa(peer: IFluenceClient$$, service: OpHaDef): void;
export function registerOpHa(peer: IFluenceClient$$, serviceId: string, service: OpHaDef): void;
export function registerOpHa(...args: any) {
@ -98,7 +100,7 @@ export function doSmth(
): Promise<string[]>;
export function doSmth(
peer: FluencePeer,
peer: IFluenceClient$$,
arg: DoSmthArgArg,
config?: {ttl?: number}
): Promise<string[]>;
@ -176,3 +178,5 @@ export function doSmth(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -27,7 +29,7 @@ export function passFunctionAsArg(
): Promise<void>;
export function passFunctionAsArg(
peer: FluencePeer,
peer: IFluenceClient$$,
node: string,
str: string,
c: (arg0: string, callParams: CallParams$$<'arg0'>) => string | Promise<string>,
@ -151,7 +153,7 @@ export function reproArgsBug426(
): Promise<void>;
export function reproArgsBug426(
peer: FluencePeer,
peer: IFluenceClient$$,
log: (arg0: string, callParams: CallParams$$<'arg0'>) => void | Promise<void>,
arg: string,
config?: {ttl?: number}
@ -221,3 +223,5 @@ export function reproArgsBug426(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface SerDef {
}
export function registerSer(service: SerDef): void;
export function registerSer(serviceId: string, service: SerDef): void;
export function registerSer(peer: FluencePeer, service: SerDef): void;
export function registerSer(peer: FluencePeer, serviceId: string, service: SerDef): void;
export function registerSer(peer: IFluenceClient$$, service: SerDef): void;
export function registerSer(peer: IFluenceClient$$, serviceId: string, service: SerDef): void;
export function registerSer(...args: any) {
@ -76,7 +78,7 @@ export function bugLng79(
): Promise<number>;
export function bugLng79(
peer: FluencePeer,
peer: IFluenceClient$$,
log: (arg0: string, callParams: CallParams$$<'arg0'>) => void | Promise<void>,
config?: {ttl?: number}
): Promise<number>;
@ -94,42 +96,39 @@ export function bugLng79(...args: any) {
(seq
(seq
(seq
(seq
(call %init_peer_id% ("ser" "getRecord") [] $stream)
(new $stream_test
(call %init_peer_id% ("ser" "getRecord") [] $stream)
(new $stream_test
(seq
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] stream_incr)
(fold $stream s
(call %init_peer_id% ("math" "add") [0 1] stream_incr)
(fold $stream s
(seq
(seq
(seq
(ap s $stream_test)
(canon %init_peer_id% $stream_test #stream_iter_canon)
)
(xor
(match #stream_iter_canon.length stream_incr
(null)
)
(next s)
)
(ap s $stream_test)
(canon %init_peer_id% $stream_test #stream_iter_canon)
)
(xor
(match #stream_iter_canon.length stream_incr
(null)
)
(next s)
)
(never)
)
(never)
)
(canon %init_peer_id% $stream_test #stream_result_canon)
)
(ap #stream_result_canon stream_gate)
(canon %init_peer_id% $stream_test #stream_result_canon)
)
(ap #stream_result_canon stream_gate)
)
)
(ap stream_gate.$.[0]! stream_gate_flat)
)
(null)
)
(call -relay- ("op" "noop") [])
)
(fold stream_gate_flat.$.relay_id! -via-peer-
(fold stream_gate.$.[0].relay_id! -via-peer-
(seq
(call -via-peer- ("op" "noop") [])
(next -via-peer-)
@ -139,8 +138,8 @@ export function bugLng79(...args: any) {
(xor
(seq
(seq
(call stream_gate_flat.$.peer_id! ("math" "add") [1 1] add)
(fold stream_gate_flat.$.relay_id! -via-peer-
(call stream_gate.$.[0].peer_id! ("math" "add") [1 1] add)
(fold stream_gate.$.[0].relay_id! -via-peer-
(seq
(next -via-peer-)
(call -via-peer- ("op" "noop") [])
@ -151,7 +150,7 @@ export function bugLng79(...args: any) {
)
(seq
(seq
(fold stream_gate_flat.$.relay_id! -via-peer-
(fold stream_gate.$.[0].relay_id! -via-peer-
(seq
(call -via-peer- ("op" "noop") [])
(next -via-peer-)
@ -222,3 +221,5 @@ export function bugLng79(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface LocalSrvDef {
}
export function registerLocalSrv(service: LocalSrvDef): void;
export function registerLocalSrv(serviceId: string, service: LocalSrvDef): void;
export function registerLocalSrv(peer: FluencePeer, service: LocalSrvDef): void;
export function registerLocalSrv(peer: FluencePeer, serviceId: string, service: LocalSrvDef): void;
export function registerLocalSrv(peer: IFluenceClient$$, service: LocalSrvDef): void;
export function registerLocalSrv(peer: IFluenceClient$$, serviceId: string, service: LocalSrvDef): void;
export function registerLocalSrv(...args: any) {
@ -58,7 +60,7 @@ export function closureBig(
): Promise<ClosureBigResult>;
export function closureBig(
peer: FluencePeer,
peer: IFluenceClient$$,
peer1: string,
peer2: string,
config?: {ttl?: number}
@ -99,50 +101,47 @@ export function closureBig(...args: any) {
)
(new $p2Id-0
(seq
(seq
(xor
(match "in" "in"
(xor
(seq
(call %init_peer_id% ("op" "identity") ["in"] p2)
(ap p2 $p2Id-0)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
(xor
(match "in" "in"
(xor
(seq
(call %init_peer_id% ("op" "identity") ["in"] p2)
(ap p2 $p2Id-0)
)
)
(seq
(call %init_peer_id% ("peer" "identify") [] p2Info)
(ap p2Info.$.external_addresses.[0]! $p2Id-0)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
)
(new $p2Id-0_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] p2Id-0_incr)
(fold $p2Id-0 s
(seq
(seq
(ap s $p2Id-0_test)
(canon %init_peer_id% $p2Id-0_test #p2Id-0_iter_canon)
)
(xor
(match #p2Id-0_iter_canon.length p2Id-0_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $p2Id-0_test #p2Id-0_result_canon)
)
(ap #p2Id-0_result_canon p2Id-0_gate)
)
(seq
(call %init_peer_id% ("peer" "identify") [] p2Info)
(ap p2Info.$.external_addresses.[0]! $p2Id-0)
)
)
(new $p2Id-0_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] p2Id-0_incr)
(fold $p2Id-0 s
(seq
(seq
(ap s $p2Id-0_test)
(canon %init_peer_id% $p2Id-0_test #p2Id-0_iter_canon)
)
(xor
(match #p2Id-0_iter_canon.length p2Id-0_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $p2Id-0_test #p2Id-0_result_canon)
)
(ap #p2Id-0_result_canon p2Id-0_gate)
)
)
(ap p2Id-0_gate.$.[0]! p2Id-0_gate_flat)
)
)
)
@ -152,56 +151,53 @@ export function closureBig(...args: any) {
(seq
(new $p2Id
(seq
(seq
(xor
(match "on" "in"
(xor
(seq
(call peer2 ("op" "identity") ["on"] p2-0)
(ap p2-0 $p2Id)
)
(seq
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
)
(call -relay- ("op" "noop") [])
)
(xor
(match "on" "in"
(xor
(seq
(call peer2 ("op" "identity") ["on"] p2-0)
(ap p2-0 $p2Id)
)
)
(seq
(call peer2 ("peer" "identify") [] p2Info-0)
(ap p2Info-0.$.external_addresses.[0]! $p2Id)
)
)
(new $p2Id_test
(seq
(seq
(seq
(call peer2 ("math" "add") [0 1] p2Id_incr)
(fold $p2Id s
(seq
(seq
(ap s $p2Id_test)
(canon peer2 $p2Id_test #p2Id_iter_canon)
)
(xor
(match #p2Id_iter_canon.length p2Id_incr
(null)
)
(next s)
)
)
(never)
)
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
)
(canon peer2 $p2Id_test #p2Id_result_canon)
(call -relay- ("op" "noop") [])
)
(ap #p2Id_result_canon p2Id_gate)
)
)
(seq
(call peer2 ("peer" "identify") [] p2Info-0)
(ap p2Info-0.$.external_addresses.[0]! $p2Id)
)
)
(new $p2Id_test
(seq
(seq
(seq
(call peer2 ("math" "add") [0 1] p2Id_incr)
(fold $p2Id s
(seq
(seq
(ap s $p2Id_test)
(canon peer2 $p2Id_test #p2Id_iter_canon)
)
(xor
(match #p2Id_iter_canon.length p2Id_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon peer2 $p2Id_test #p2Id_result_canon)
)
(ap #p2Id_result_canon p2Id_gate)
)
)
(ap p2Id_gate.$.[0]! p2Id_gate_flat)
)
)
(call -relay- ("op" "noop") [])
@ -213,7 +209,7 @@ export function closureBig(...args: any) {
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [p2Id-0_gate_flat p2Id_gate_flat])
(call %init_peer_id% ("callbackSrv" "response") [p2Id-0_gate.$.[0]! p2Id_gate.$.[0]!])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 5])
)
)
@ -274,7 +270,7 @@ export function lng58Bug(
): Promise<string>;
export function lng58Bug(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string>;
@ -287,46 +283,43 @@ export function lng58Bug(...args: any) {
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(new $status
(seq
(seq
(new $avava
(seq
(ap "frerf" $avava)
(ap "ok" $status-0)
)
)
(new $status_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] status_incr)
(fold $status s
(seq
(seq
(ap s $status_test)
(canon %init_peer_id% $status_test #status_iter_canon)
)
(xor
(match #status_iter_canon.length status_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $status_test #status_result_canon)
)
(ap #status_result_canon status_gate)
)
(new $avava
(seq
(ap "frerf" $avava)
(ap "ok" $status-0)
)
)
(new $status_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] status_incr)
(fold $status s
(seq
(seq
(ap s $status_test)
(canon %init_peer_id% $status_test #status_iter_canon)
)
(xor
(match #status_iter_canon.length status_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $status_test #status_result_canon)
)
(ap #status_result_canon status_gate)
)
)
(ap status_gate.$.[0]! status_gate_flat)
)
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [status_gate_flat])
(call %init_peer_id% ("callbackSrv" "response") [status_gate.$.[0]!])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
@ -377,7 +370,7 @@ export function closureIn(
): Promise<string>;
export function closureIn(
peer: FluencePeer,
peer: IFluenceClient$$,
peer1: string,
config?: {ttl?: number}
): Promise<string>;
@ -478,7 +471,7 @@ export function closureOut2(
): Promise<ClosureOut2Result>;
export function closureOut2(
peer: FluencePeer,
peer: IFluenceClient$$,
peer2: string,
config?: {ttl?: number}
): Promise<ClosureOut2Result>;
@ -596,7 +589,7 @@ export function closureOut(
): Promise<ClosureOutResult>;
export function closureOut(
peer: FluencePeer,
peer: IFluenceClient$$,
peer2: string,
config?: {ttl?: number}
): Promise<ClosureOutResult>;
@ -702,3 +695,5 @@ export function closureOut(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface CoServiceDef {
}
export function registerCoService(service: CoServiceDef): void;
export function registerCoService(serviceId: string, service: CoServiceDef): void;
export function registerCoService(peer: FluencePeer, service: CoServiceDef): void;
export function registerCoService(peer: FluencePeer, serviceId: string, service: CoServiceDef): void;
export function registerCoService(peer: IFluenceClient$$, service: CoServiceDef): void;
export function registerCoService(peer: IFluenceClient$$, serviceId: string, service: CoServiceDef): void;
export function registerCoService(...args: any) {
@ -64,7 +66,7 @@ export function coFunc(
): Promise<void>;
export function coFunc(
peer: FluencePeer,
peer: IFluenceClient$$,
node: string,
c: (arg0: { air_version: string; external_addresses: string[]; node_version: string; }, callParams: CallParams$$<'arg0'>) => void | Promise<void>,
config?: {ttl?: number}
@ -178,3 +180,5 @@ export function coFunc(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface GetArrDef {
}
export function registerGetArr(service: GetArrDef): void;
export function registerGetArr(serviceId: string, service: GetArrDef): void;
export function registerGetArr(peer: FluencePeer, service: GetArrDef): void;
export function registerGetArr(peer: FluencePeer, serviceId: string, service: GetArrDef): void;
export function registerGetArr(peer: IFluenceClient$$, service: GetArrDef): void;
export function registerGetArr(peer: IFluenceClient$$, serviceId: string, service: GetArrDef): void;
export function registerGetArr(...args: any) {
@ -64,8 +66,8 @@ export interface OpODef {
}
export function registerOpO(service: OpODef): void;
export function registerOpO(serviceId: string, service: OpODef): void;
export function registerOpO(peer: FluencePeer, service: OpODef): void;
export function registerOpO(peer: FluencePeer, serviceId: string, service: OpODef): void;
export function registerOpO(peer: IFluenceClient$$, service: OpODef): void;
export function registerOpO(peer: IFluenceClient$$, serviceId: string, service: OpODef): void;
export function registerOpO(...args: any) {
@ -113,7 +115,7 @@ export function streamSugar(
): Promise<StreamSugarResult>;
export function streamSugar(
peer: FluencePeer,
peer: IFluenceClient$$,
n: number,
m: number,
config?: {ttl?: number}
@ -248,7 +250,7 @@ export function optionSugar(
): Promise<OptionSugarResult>;
export function optionSugar(
peer: FluencePeer,
peer: IFluenceClient$$,
numSome: number | null,
strSome: string | null,
numNone: number | null,
@ -461,7 +463,7 @@ export function getNeighbours(
): Promise<string[]>;
export function getNeighbours(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string[]>;
@ -528,7 +530,7 @@ export function bugLNG59(
): Promise<string>;
export function bugLNG59(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string>;
@ -542,11 +544,8 @@ export function bugLNG59(...args: any) {
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(call %init_peer_id% ("getArr" "getArr") [] nodes)
)
(ap nodes.$.[1]! nodes_flat)
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(call %init_peer_id% ("getArr" "getArr") [] nodes)
)
(new $array-inline
(seq
@ -567,7 +566,7 @@ export function bugLNG59(...args: any) {
(xor
(seq
(seq
(call nodes_flat ("op" "identity") ["some str"] res)
(call nodes.$.[1]! ("op" "identity") ["some str"] res)
(fold #array-inline-0 -via-peer-
(seq
(next -via-peer-)
@ -644,7 +643,7 @@ export function arraySugar(
): Promise<ArraySugarResult>;
export function arraySugar(
peer: FluencePeer,
peer: IFluenceClient$$,
n: number,
m: number,
config?: {ttl?: number}
@ -766,3 +765,5 @@ export function arraySugar(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -22,8 +24,8 @@ export interface TestSDef {
}
export function registerTestS(service: TestSDef): void;
export function registerTestS(serviceId: string, service: TestSDef): void;
export function registerTestS(peer: FluencePeer, service: TestSDef): void;
export function registerTestS(peer: FluencePeer, serviceId: string, service: TestSDef): void;
export function registerTestS(peer: IFluenceClient$$, service: TestSDef): void;
export function registerTestS(peer: IFluenceClient$$, serviceId: string, service: TestSDef): void;
export function registerTestS(...args: any) {
@ -105,7 +107,7 @@ export function doStuff(
): Promise<string[]>;
export function doStuff(
peer: FluencePeer,
peer: IFluenceClient$$,
a: string,
b: string,
c: boolean,
@ -319,3 +321,5 @@ export function doStuff(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface OpODef {
}
export function registerOpO(service: OpODef): void;
export function registerOpO(serviceId: string, service: OpODef): void;
export function registerOpO(peer: FluencePeer, service: OpODef): void;
export function registerOpO(peer: FluencePeer, serviceId: string, service: OpODef): void;
export function registerOpO(peer: IFluenceClient$$, service: OpODef): void;
export function registerOpO(peer: IFluenceClient$$, serviceId: string, service: OpODef): void;
export function registerOpO(...args: any) {
@ -67,8 +69,8 @@ export interface GetterDef {
}
export function registerGetter(service: GetterDef): void;
export function registerGetter(serviceId: string, service: GetterDef): void;
export function registerGetter(peer: FluencePeer, service: GetterDef): void;
export function registerGetter(peer: FluencePeer, serviceId: string, service: GetterDef): void;
export function registerGetter(peer: IFluenceClient$$, service: GetterDef): void;
export function registerGetter(peer: IFluenceClient$$, serviceId: string, service: GetterDef): void;
export function registerGetter(...args: any) {
@ -113,8 +115,8 @@ export interface OpNDef {
}
export function registerOpN(service: OpNDef): void;
export function registerOpN(serviceId: string, service: OpNDef): void;
export function registerOpN(peer: FluencePeer, service: OpNDef): void;
export function registerOpN(peer: FluencePeer, serviceId: string, service: OpNDef): void;
export function registerOpN(peer: IFluenceClient$$, service: OpNDef): void;
export function registerOpN(peer: IFluenceClient$$, serviceId: string, service: OpNDef): void;
export function registerOpN(...args: any) {
@ -160,7 +162,7 @@ export function compareConstants(
): Promise<void>;
export function compareConstants(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<void>;
@ -220,7 +222,7 @@ export function callConstant(
): Promise<string[]>;
export function callConstant(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string[]>;
@ -298,7 +300,7 @@ export function timestampAndTtl(
): Promise<TimestampAndTtlResult>;
export function timestampAndTtl(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<TimestampAndTtlResult>;
@ -358,3 +360,5 @@ export function timestampAndTtl(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface NodeIdGetterDef {
}
export function registerNodeIdGetter(service: NodeIdGetterDef): void;
export function registerNodeIdGetter(serviceId: string, service: NodeIdGetterDef): void;
export function registerNodeIdGetter(peer: FluencePeer, service: NodeIdGetterDef): void;
export function registerNodeIdGetter(peer: FluencePeer, serviceId: string, service: NodeIdGetterDef): void;
export function registerNodeIdGetter(peer: IFluenceClient$$, service: NodeIdGetterDef): void;
export function registerNodeIdGetter(peer: IFluenceClient$$, serviceId: string, service: NodeIdGetterDef): void;
export function registerNodeIdGetter(...args: any) {
@ -72,7 +74,7 @@ export function getAliasedData(
): Promise<string>;
export function getAliasedData(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string>;
@ -131,3 +133,5 @@ export function getAliasedData(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface OpDef {
}
export function registerOp(service: OpDef): void;
export function registerOp(serviceId: string, service: OpDef): void;
export function registerOp(peer: FluencePeer, service: OpDef): void;
export function registerOp(peer: FluencePeer, serviceId: string, service: OpDef): void;
export function registerOp(peer: IFluenceClient$$, service: OpDef): void;
export function registerOp(peer: IFluenceClient$$, serviceId: string, service: OpDef): void;
export function registerOp(...args: any) {
@ -56,8 +58,8 @@ export interface TestDef {
}
export function registerTest(service: TestDef): void;
export function registerTest(serviceId: string, service: TestDef): void;
export function registerTest(peer: FluencePeer, service: TestDef): void;
export function registerTest(peer: FluencePeer, serviceId: string, service: TestDef): void;
export function registerTest(peer: IFluenceClient$$, service: TestDef): void;
export function registerTest(peer: IFluenceClient$$, serviceId: string, service: TestDef): void;
export function registerTest(...args: any) {
@ -128,8 +130,8 @@ export interface PeerDef {
}
export function registerPeer(service: PeerDef): void;
export function registerPeer(serviceId: string, service: PeerDef): void;
export function registerPeer(peer: FluencePeer, service: PeerDef): void;
export function registerPeer(peer: FluencePeer, serviceId: string, service: PeerDef): void;
export function registerPeer(peer: IFluenceClient$$, service: PeerDef): void;
export function registerPeer(peer: IFluenceClient$$, serviceId: string, service: PeerDef): void;
export function registerPeer(...args: any) {
@ -176,7 +178,7 @@ export function betterMessage(
): Promise<void>;
export function betterMessage(
peer: FluencePeer,
peer: IFluenceClient$$,
relay: string,
config?: {ttl?: number}
): Promise<void>;
@ -250,3 +252,5 @@ export function betterMessage(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,123 +0,0 @@
/**
*
* 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.6.4-SNAPSHOT
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
import {
CallParams,
callFunction,
registerService,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v2';
// Services
export interface ReturnDef {
run: (arg0: { air_version: string; external_addresses: string[]; node_version: string; }, callParams: CallParams<'arg0'>) => void | Promise<void>;
}
export function registerReturn(service: ReturnDef): void;
export function registerReturn(serviceId: string, service: ReturnDef): void;
export function registerReturn(peer: FluencePeer, service: ReturnDef): void;
export function registerReturn(peer: FluencePeer, serviceId: string, service: ReturnDef): void;
export function registerReturn(...args: any) {
registerService(
args,
{
"defaultServiceId" : "returnService",
"functions" : [
{
"functionName" : "run",
"argDefs" : [
{
"name" : "arg0",
"argType" : {
"tag" : "primitive"
}
}
],
"returnType" : {
"tag" : "void"
}
}
]
}
);
}
// Functions
export function test(
node: string,
config?: {ttl?: number}
): Promise<void>;
export function test(
peer: FluencePeer,
node: string,
config?: {ttl?: number}
): Promise<void>;
export function test(...args: any) {
let script = `
(xor
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(call %init_peer_id% ("getDataSrv" "node") [] node)
)
(call -relay- ("op" "noop") [])
)
(xor
(seq
(call node ("peer" "identify") [] res)
(call -relay- ("op" "noop") [])
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
)
(call %init_peer_id% ("returnService" "run") [res])
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
`
return callFunction(
args,
{
"functionName" : "test",
"returnType" : {
"tag" : "void"
},
"argDefs" : [
{
"name" : "node",
"argType" : {
"tag" : "primitive"
}
}
],
"names" : {
"relay" : "-relay-",
"getDataSrv" : "getDataSrv",
"callbackSrv" : "callbackSrv",
"responseSrv" : "callbackSrv",
"responseFnName" : "response",
"errorHandlingSrv" : "errorHandlingSrv",
"errorFnName" : "error"
}
},
script
)
}

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -25,7 +27,7 @@ export function iterateAndPrint(
): Promise<void>;
export function iterateAndPrint(
peer: FluencePeer,
peer: IFluenceClient$$,
strings: string[],
config?: {ttl?: number}
): Promise<void>;
@ -94,7 +96,7 @@ export function iterateAndPrintParallel(
): Promise<void>;
export function iterateAndPrintParallel(
peer: FluencePeer,
peer: IFluenceClient$$,
nodes: string[],
c: (arg0: { air_version: string; external_addresses: string[]; node_version: string; }, callParams: CallParams$$<'arg0'>) => void | Promise<void>,
config?: {ttl?: number}
@ -223,7 +225,7 @@ export function to_i_64(
): Promise<number>;
export function to_i_64(
peer: FluencePeer,
peer: IFluenceClient$$,
i: number,
config?: {ttl?: number}
): Promise<number>;
@ -291,7 +293,7 @@ export function forBug499(
): Promise<number[]>;
export function forBug499(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<number[]>;
@ -371,3 +373,5 @@ export function forBug499(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -25,7 +27,7 @@ export function getTwoResults(
): Promise<number[]>;
export function getTwoResults(
peer: FluencePeer,
peer: IFluenceClient$$,
node: string,
config?: {ttl?: number}
): Promise<number[]>;
@ -228,3 +230,5 @@ export function getTwoResults(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface TestSrvDef {
}
export function registerTestSrv(service: TestSrvDef): void;
export function registerTestSrv(serviceId: string, service: TestSrvDef): void;
export function registerTestSrv(peer: FluencePeer, service: TestSrvDef): void;
export function registerTestSrv(peer: FluencePeer, serviceId: string, service: TestSrvDef): void;
export function registerTestSrv(peer: IFluenceClient$$, service: TestSrvDef): void;
export function registerTestSrv(peer: IFluenceClient$$, serviceId: string, service: TestSrvDef): void;
export function registerTestSrv(...args: any) {
@ -62,7 +64,7 @@ export function testFunc(
): Promise<string>;
export function testFunc(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string>;
@ -118,3 +120,5 @@ export function testFunc(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface ADef {
}
export function registerA(service: ADef): void;
export function registerA(serviceId: string, service: ADef): void;
export function registerA(peer: FluencePeer, service: ADef): void;
export function registerA(peer: FluencePeer, serviceId: string, service: ADef): void;
export function registerA(peer: IFluenceClient$$, service: ADef): void;
export function registerA(peer: IFluenceClient$$, serviceId: string, service: ADef): void;
export function registerA(...args: any) {
@ -69,7 +71,7 @@ export function main(
): Promise<number>;
export function main(
peer: FluencePeer,
peer: IFluenceClient$$,
log: (arg0: string, arg1: number[], callParams: CallParams$$<'arg0' | 'arg1'>) => void | Promise<void>,
config?: {ttl?: number}
): Promise<number>;
@ -284,7 +286,7 @@ export function calc2(
): Promise<number>;
export function calc2(
peer: FluencePeer,
peer: IFluenceClient$$,
log: (arg0: string, arg1: number[], callParams: CallParams$$<'arg0' | 'arg1'>) => void | Promise<void>,
config?: {ttl?: number}
): Promise<number>;
@ -301,9 +303,9 @@ export function calc2(...args: any) {
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(new $array-inline
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(new $array-inline
(seq
(seq
(seq
(seq
@ -323,93 +325,93 @@ export function calc2(...args: any) {
(seq
(seq
(seq
(seq
(ap 0 $array-inline)
(ap 1 $array-inline)
)
(ap 2 $array-inline)
(ap 0 $array-inline)
(ap 1 $array-inline)
)
(ap 3 $array-inline)
(ap 2 $array-inline)
)
(ap 4 $array-inline)
(ap 3 $array-inline)
)
(ap 5 $array-inline)
(ap 4 $array-inline)
)
(ap 6 $array-inline)
(ap 5 $array-inline)
)
(ap 7 $array-inline)
(ap 6 $array-inline)
)
(ap 8 $array-inline)
(ap 7 $array-inline)
)
(ap 9 $array-inline)
(ap 8 $array-inline)
)
(ap 10 $array-inline)
(ap 9 $array-inline)
)
(ap 11 $array-inline)
(ap 10 $array-inline)
)
(ap 12 $array-inline)
(ap 11 $array-inline)
)
(ap 13 $array-inline)
(ap 12 $array-inline)
)
(ap 14 $array-inline)
(ap 13 $array-inline)
)
(ap 15 $array-inline)
(ap 14 $array-inline)
)
(ap 16 $array-inline)
(ap 15 $array-inline)
)
(ap 17 $array-inline)
(ap 16 $array-inline)
)
(ap 18 $array-inline)
(ap 17 $array-inline)
)
(ap 19 $array-inline)
(ap 18 $array-inline)
)
(canon %init_peer_id% $array-inline #array-inline-0)
(ap 19 $array-inline)
)
)
)
(par
(seq
(call %init_peer_id% ("math" "sub") [5 2] sub-0)
(call %init_peer_id% ("math" "mul") [sub-0 3] mul)
)
(seq
(seq
(par
(seq
(call %init_peer_id% ("math" "add") [5 5] add)
(call %init_peer_id% ("a" "getJ") [add] getJ)
)
(seq
(seq
(call %init_peer_id% ("math" "sub") [3 1] sub-2)
(call %init_peer_id% ("math" "pow") [3 sub-2] pow-0)
)
(call %init_peer_id% ("a" "getJ") [pow-0] getJ-0)
)
)
(call %init_peer_id% ("math" "sub") [getJ getJ-0] sub-1)
)
(call %init_peer_id% ("math" "pow") [3 sub-1] pow)
(canon %init_peer_id% $array-inline #array-inline-0)
)
)
)
(call %init_peer_id% ("math" "sub") [mul pow] sub)
(par
(seq
(call %init_peer_id% ("math" "sub") [5 2] sub-0)
(call %init_peer_id% ("math" "mul") [sub-0 3] mul)
)
(seq
(seq
(par
(seq
(call %init_peer_id% ("math" "add") [5 5] add)
(call %init_peer_id% ("a" "getJ") [add] getJ)
)
(seq
(seq
(call %init_peer_id% ("math" "sub") [3 1] sub-2)
(call %init_peer_id% ("math" "pow") [3 sub-2] pow-0)
)
(call %init_peer_id% ("a" "getJ") [pow-0] getJ-0)
)
)
(call %init_peer_id% ("math" "sub") [getJ getJ-0] sub-1)
)
(call %init_peer_id% ("math" "pow") [3 sub-1] pow)
)
)
)
(call %init_peer_id% ("a" "getJ") [sub] num)
)
(par
(call %init_peer_id% ("math" "add") [num num] add-0)
(call %init_peer_id% ("a" "getJ") [num] getJ-1)
(call %init_peer_id% ("math" "sub") [mul pow] sub)
)
(call %init_peer_id% ("a" "getJ") [sub] num)
)
(par
(call %init_peer_id% ("math" "add") [num num] add-0)
(call %init_peer_id% ("a" "getJ") [num] getJ-1)
)
(call %init_peer_id% ("math" "sub") [add-0 getJ-1] sub-4)
)
(call %init_peer_id% ("math" "sub") [sub-4 3] sub-3)
(call %init_peer_id% ("math" "sub") [add-0 getJ-1] sub-4)
)
(ap #array-inline-0.$.[sub-3]! array-inline-0_flat)
(call %init_peer_id% ("math" "sub") [sub-4 3] sub-3)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [array-inline-0_flat])
(seq
(ap #array-inline-0.$.[sub-3]! array-inline-0_flatten)
(call %init_peer_id% ("callbackSrv" "response") [array-inline-0_flatten])
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
@ -480,7 +482,7 @@ export function ifCalc(
): Promise<number>;
export function ifCalc(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<number>;
@ -494,8 +496,8 @@ export function ifCalc(...args: any) {
(new $res
(seq
(seq
(seq
(new $array-inline
(new $array-inline
(seq
(seq
(seq
(seq
@ -515,122 +517,119 @@ export function ifCalc(...args: any) {
(seq
(seq
(seq
(seq
(ap 0 $array-inline)
(ap 1 $array-inline)
)
(ap 2 $array-inline)
(ap 0 $array-inline)
(ap 1 $array-inline)
)
(ap 3 $array-inline)
(ap 2 $array-inline)
)
(ap 4 $array-inline)
(ap 3 $array-inline)
)
(ap 5 $array-inline)
(ap 4 $array-inline)
)
(ap 6 $array-inline)
(ap 5 $array-inline)
)
(ap 7 $array-inline)
(ap 6 $array-inline)
)
(ap 8 $array-inline)
(ap 7 $array-inline)
)
(ap 9 $array-inline)
(ap 8 $array-inline)
)
(ap 10 $array-inline)
(ap 9 $array-inline)
)
(ap 11 $array-inline)
(ap 10 $array-inline)
)
(ap 12 $array-inline)
(ap 11 $array-inline)
)
(ap 13 $array-inline)
(ap 12 $array-inline)
)
(ap 14 $array-inline)
(ap 13 $array-inline)
)
(ap 15 $array-inline)
(ap 14 $array-inline)
)
(ap 16 $array-inline)
(ap 15 $array-inline)
)
(ap 17 $array-inline)
(ap 16 $array-inline)
)
(ap 18 $array-inline)
(ap 17 $array-inline)
)
(ap 19 $array-inline)
(ap 18 $array-inline)
)
(canon %init_peer_id% $array-inline #array-inline-0)
(ap 19 $array-inline)
)
)
(xor
(seq
(seq
(par
(seq
(par
(seq
(call %init_peer_id% ("math" "sub") [8 2] sub)
(call %init_peer_id% ("a" "getJ") [sub] getJ)
)
(seq
(call %init_peer_id% ("math" "rem") [4 2] rem)
(call %init_peer_id% ("a" "getJ") [rem] getJ-0)
)
)
(call %init_peer_id% ("math" "add") [getJ getJ-0] add)
)
(seq
(seq
(seq
(par
(call %init_peer_id% ("math" "sub") [5 3] sub-1)
(call %init_peer_id% ("a" "getJ") [3] getJ-1)
)
(call %init_peer_id% ("math" "add") [sub-1 getJ-1] add-0)
)
(ap #array-inline-0.$.[add-0]! array-inline-0_flatten)
)
(call %init_peer_id% ("math" "sub") [array-inline-0_flatten 2] sub-0)
)
)
(call %init_peer_id% ("cmp" "gt") [add sub-0] gt)
)
(match gt true
(ap 1 $res)
)
)
(ap 2 $res)
(canon %init_peer_id% $array-inline #array-inline-0)
)
)
(new $res_test
(xor
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] res_incr)
(fold $res s
(seq
(par
(seq
(par
(seq
(ap s $res_test)
(canon %init_peer_id% $res_test #res_iter_canon)
(call %init_peer_id% ("math" "sub") [8 2] sub)
(call %init_peer_id% ("a" "getJ") [sub] getJ)
)
(xor
(match #res_iter_canon.length res_incr
(null)
)
(next s)
(seq
(call %init_peer_id% ("math" "rem") [4 2] rem)
(call %init_peer_id% ("a" "getJ") [rem] getJ-0)
)
)
(never)
(call %init_peer_id% ("math" "add") [getJ getJ-0] add)
)
(seq
(seq
(seq
(par
(call %init_peer_id% ("math" "sub") [5 3] sub-1)
(call %init_peer_id% ("a" "getJ") [3] getJ-1)
)
(call %init_peer_id% ("math" "add") [sub-1 getJ-1] add-0)
)
(ap #array-inline-0.$.[add-0]! array-inline-0_flatten)
)
(call %init_peer_id% ("math" "sub") [array-inline-0_flatten 2] sub-0)
)
)
(canon %init_peer_id% $res_test #res_result_canon)
(call %init_peer_id% ("cmp" "gt") [add sub-0] gt)
)
(match gt true
(ap 1 $res)
)
(ap #res_result_canon res_gate)
)
(ap 2 $res)
)
)
(new $res_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] res_incr)
(fold $res s
(seq
(seq
(ap s $res_test)
(canon %init_peer_id% $res_test #res_iter_canon)
)
(xor
(match #res_iter_canon.length res_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $res_test #res_result_canon)
)
(ap #res_result_canon res_gate)
)
)
(ap res_gate.$.[0]! res_gate_flat)
)
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [res_gate_flat])
(call %init_peer_id% ("callbackSrv" "response") [res_gate.$.[0]!])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
@ -681,7 +680,7 @@ export function calc(
): Promise<number>;
export function calc(
peer: FluencePeer,
peer: IFluenceClient$$,
log: (arg0: string, arg1: number[], callParams: CallParams$$<'arg0' | 'arg1'>) => void | Promise<void>,
config?: {ttl?: number}
): Promise<number>;
@ -698,9 +697,9 @@ export function calc(...args: any) {
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(new $array-inline
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(new $array-inline
(seq
(seq
(seq
(seq
@ -720,74 +719,74 @@ export function calc(...args: any) {
(seq
(seq
(seq
(seq
(ap 0 $array-inline)
(ap 1 $array-inline)
)
(ap 2 $array-inline)
(ap 0 $array-inline)
(ap 1 $array-inline)
)
(ap 3 $array-inline)
(ap 2 $array-inline)
)
(ap 4 $array-inline)
(ap 3 $array-inline)
)
(ap 5 $array-inline)
(ap 4 $array-inline)
)
(ap 6 $array-inline)
(ap 5 $array-inline)
)
(ap 7 $array-inline)
(ap 6 $array-inline)
)
(ap 8 $array-inline)
(ap 7 $array-inline)
)
(ap 9 $array-inline)
(ap 8 $array-inline)
)
(ap 10 $array-inline)
(ap 9 $array-inline)
)
(ap 11 $array-inline)
(ap 10 $array-inline)
)
(ap 12 $array-inline)
(ap 11 $array-inline)
)
(ap 13 $array-inline)
(ap 12 $array-inline)
)
(ap 14 $array-inline)
(ap 13 $array-inline)
)
(ap 15 $array-inline)
(ap 14 $array-inline)
)
(ap 16 $array-inline)
(ap 15 $array-inline)
)
(ap 17 $array-inline)
(ap 16 $array-inline)
)
(ap 18 $array-inline)
(ap 17 $array-inline)
)
(ap 19 $array-inline)
(ap 18 $array-inline)
)
(canon %init_peer_id% $array-inline #array-inline-0)
(ap 19 $array-inline)
)
(canon %init_peer_id% $array-inline #array-inline-0)
)
)
(call %init_peer_id% ("math" "sub") [5 2] sub-0)
)
(call %init_peer_id% ("math" "mul") [sub-0 3] mul)
(call %init_peer_id% ("math" "sub") [5 2] sub-0)
)
(call %init_peer_id% ("math" "sub") [mul 3] sub)
)
(call %init_peer_id% ("a" "getJ") [sub] num)
)
(new $array-inline-1
(seq
(ap num $array-inline-1)
(canon %init_peer_id% $array-inline-1 #array-inline-1-0)
(call %init_peer_id% ("math" "mul") [sub-0 3] mul)
)
(call %init_peer_id% ("math" "sub") [mul 3] sub)
)
(call %init_peer_id% ("a" "getJ") [sub] num)
)
(xor
(call %init_peer_id% ("callbackSrv" "log") ["calc 2" #array-inline-1-0])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
(new $array-inline-1
(seq
(ap num $array-inline-1)
(canon %init_peer_id% $array-inline-1 #array-inline-1-0)
)
)
)
(ap #array-inline-0.$.[num]! array-inline-0_flat)
(xor
(call %init_peer_id% ("callbackSrv" "log") ["calc 2" #array-inline-1-0])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [array-inline-0_flat])
(seq
(ap #array-inline-0.$.[num]! array-inline-0_flatten)
(call %init_peer_id% ("callbackSrv" "response") [array-inline-0_flatten])
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
)
@ -850,3 +849,5 @@ export function calc(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface StringExtraDef {
}
export function registerStringExtra(service: StringExtraDef): void;
export function registerStringExtra(serviceId: string, service: StringExtraDef): void;
export function registerStringExtra(peer: FluencePeer, service: StringExtraDef): void;
export function registerStringExtra(peer: FluencePeer, serviceId: string, service: StringExtraDef): void;
export function registerStringExtra(peer: IFluenceClient$$, service: StringExtraDef): void;
export function registerStringExtra(peer: IFluenceClient$$, serviceId: string, service: StringExtraDef): void;
export function registerStringExtra(...args: any) {
@ -69,7 +71,7 @@ export function helloWorld(
): Promise<string>;
export function helloWorld(
peer: FluencePeer,
peer: IFluenceClient$$,
name: string,
config?: {ttl?: number}
): Promise<string>;
@ -132,3 +134,5 @@ export function helloWorld(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface OpRDef {
}
export function registerOpR(service: OpRDef): void;
export function registerOpR(serviceId: string, service: OpRDef): void;
export function registerOpR(peer: FluencePeer, service: OpRDef): void;
export function registerOpR(peer: FluencePeer, serviceId: string, service: OpRDef): void;
export function registerOpR(peer: IFluenceClient$$, service: OpRDef): void;
export function registerOpR(peer: IFluenceClient$$, serviceId: string, service: OpRDef): void;
export function registerOpR(...args: any) {
@ -69,7 +71,7 @@ export function ifCorrectXorWrap(
): Promise<string>;
export function ifCorrectXorWrap(
peer: FluencePeer,
peer: IFluenceClient$$,
node: string,
config?: {ttl?: number}
): Promise<string>;
@ -87,60 +89,57 @@ export function ifCorrectXorWrap(...args: any) {
(new $service_id
(seq
(seq
(seq
(call -relay- ("op" "noop") [])
(xor
(seq
(call node ("op" "identity") ["1234"] res)
(xor
(seq
(match res ""
(ap "0x" $service_id)
)
(call -relay- ("op" "noop") [])
)
(seq
(ap "1x" $service_id)
(call -relay- ("op" "noop") [])
)
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(new $service_id_test
(call -relay- ("op" "noop") [])
(xor
(seq
(seq
(call node ("op" "identity") ["1234"] res)
(xor
(seq
(call %init_peer_id% ("math" "add") [0 1] service_id_incr)
(fold $service_id s
(seq
(seq
(ap s $service_id_test)
(canon %init_peer_id% $service_id_test #service_id_iter_canon)
)
(xor
(match #service_id_iter_canon.length service_id_incr
(null)
)
(next s)
)
)
(never)
(match res ""
(ap "0x" $service_id)
)
(call -relay- ("op" "noop") [])
)
(seq
(ap "1x" $service_id)
(call -relay- ("op" "noop") [])
)
(canon %init_peer_id% $service_id_test #service_id_result_canon)
)
(ap #service_id_result_canon service_id_gate)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(new $service_id_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] service_id_incr)
(fold $service_id s
(seq
(seq
(ap s $service_id_test)
(canon %init_peer_id% $service_id_test #service_id_iter_canon)
)
(xor
(match #service_id_iter_canon.length service_id_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $service_id_test #service_id_result_canon)
)
(ap #service_id_result_canon service_id_gate)
)
)
(ap service_id_gate.$.[0]! service_id_gate_flat)
)
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [service_id_gate_flat])
(call %init_peer_id% ("callbackSrv" "response") [service_id_gate.$.[0]!])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
)
@ -194,7 +193,7 @@ export function ifElseNumCall(
): Promise<void>;
export function ifElseNumCall(
peer: FluencePeer,
peer: IFluenceClient$$,
condition: number,
config?: {ttl?: number}
): Promise<void>;
@ -262,7 +261,7 @@ export function ifElseCall(
): Promise<void>;
export function ifElseCall(
peer: FluencePeer,
peer: IFluenceClient$$,
condition: boolean,
config?: {ttl?: number}
): Promise<void>;
@ -330,7 +329,7 @@ export function bugLNG69(
): Promise<boolean>;
export function bugLNG69(
peer: FluencePeer,
peer: IFluenceClient$$,
other_node: string,
config?: {ttl?: number}
): Promise<boolean>;
@ -422,3 +421,5 @@ export function bugLNG69(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface SuperFooDef {
}
export function registerSuperFoo(service: SuperFooDef): void;
export function registerSuperFoo(serviceId: string, service: SuperFooDef): void;
export function registerSuperFoo(peer: FluencePeer, service: SuperFooDef): void;
export function registerSuperFoo(peer: FluencePeer, serviceId: string, service: SuperFooDef): void;
export function registerSuperFoo(peer: IFluenceClient$$, service: SuperFooDef): void;
export function registerSuperFoo(peer: IFluenceClient$$, serviceId: string, service: SuperFooDef): void;
export function registerSuperFoo(...args: any) {
@ -56,3 +58,5 @@ export function registerSuperFoo(...args: any) {
// Functions
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface MyExportSrvDef {
}
export function registerMyExportSrv(service: MyExportSrvDef): void;
export function registerMyExportSrv(serviceId: string, service: MyExportSrvDef): void;
export function registerMyExportSrv(peer: FluencePeer, service: MyExportSrvDef): void;
export function registerMyExportSrv(peer: FluencePeer, serviceId: string, service: MyExportSrvDef): void;
export function registerMyExportSrv(peer: IFluenceClient$$, service: MyExportSrvDef): void;
export function registerMyExportSrv(peer: IFluenceClient$$, serviceId: string, service: MyExportSrvDef): void;
export function registerMyExportSrv(...args: any) {
@ -62,7 +64,7 @@ export function string_from_lib(
): Promise<string>;
export function string_from_lib(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string>;
@ -115,3 +117,5 @@ export function string_from_lib(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -20,7 +22,7 @@ export interface OneMoreDef {
more_call: (callParams: CallParams$$<null>) => void | Promise<void>;
}
export function registerOneMore(serviceId: string, service: OneMoreDef): void;
export function registerOneMore(peer: FluencePeer, serviceId: string, service: OneMoreDef): void;
export function registerOneMore(peer: IFluenceClient$$, serviceId: string, service: OneMoreDef): void;
export function registerOneMore(...args: any) {
@ -47,3 +49,5 @@ export function registerOneMore(...args: any) {
// Functions
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -24,7 +26,7 @@ export function barfoo(
): Promise<string[]>;
export function barfoo(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string[]>;
@ -102,7 +104,7 @@ export function wrap(
): Promise<string>;
export function wrap(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string>;
@ -161,3 +163,5 @@ export function wrap(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -24,7 +26,7 @@ export function foo_wrapper(
): Promise<string>;
export function foo_wrapper(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string>;
@ -77,3 +79,5 @@ export function foo_wrapper(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface StringServiceDef {
}
export function registerStringService(service: StringServiceDef): void;
export function registerStringService(serviceId: string, service: StringServiceDef): void;
export function registerStringService(peer: FluencePeer, service: StringServiceDef): void;
export function registerStringService(peer: FluencePeer, serviceId: string, service: StringServiceDef): void;
export function registerStringService(peer: IFluenceClient$$, service: StringServiceDef): void;
export function registerStringService(peer: IFluenceClient$$, serviceId: string, service: StringServiceDef): void;
export function registerStringService(...args: any) {
@ -72,7 +74,7 @@ export function concat_foobars(
): Promise<string>;
export function concat_foobars(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string>;
@ -146,3 +148,5 @@ export function concat_foobars(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface SubServiceDef {
}
export function registerSubService(service: SubServiceDef): void;
export function registerSubService(serviceId: string, service: SubServiceDef): void;
export function registerSubService(peer: FluencePeer, service: SubServiceDef): void;
export function registerSubService(peer: FluencePeer, serviceId: string, service: SubServiceDef): void;
export function registerSubService(peer: IFluenceClient$$, service: SubServiceDef): void;
export function registerSubService(peer: IFluenceClient$$, serviceId: string, service: SubServiceDef): void;
export function registerSubService(...args: any) {
@ -78,7 +80,7 @@ export function subImport(
): Promise<SubImportResult>;
export function subImport(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<SubImportResult>;
@ -144,3 +146,5 @@ export function subImport(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -26,7 +28,7 @@ export function joinIdxLocal(
): Promise<string[]>;
export function joinIdxLocal(
peer: FluencePeer,
peer: IFluenceClient$$,
idx: number,
nodes: string[],
config?: {ttl?: number}
@ -158,7 +160,7 @@ export function joinIdxRelay(
): Promise<string[]>;
export function joinIdxRelay(
peer: FluencePeer,
peer: IFluenceClient$$,
idx: number,
nodes: string[],
config?: {ttl?: number}
@ -293,7 +295,7 @@ export function joinIdx(
): Promise<{ air_version: string; external_addresses: string[]; node_version: string; }[]>;
export function joinIdx(
peer: FluencePeer,
peer: IFluenceClient$$,
idx: number,
nodes: string[],
config?: {ttl?: number}
@ -504,3 +506,5 @@ export function joinIdx(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -24,7 +26,7 @@ export function test1(
): Promise<number>;
export function test1(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<number>;
@ -106,7 +108,7 @@ export function test2(
): Promise<number>;
export function test2(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<number>;
@ -201,3 +203,5 @@ export function test2(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface GetStrDef {
}
export function registerGetStr(service: GetStrDef): void;
export function registerGetStr(serviceId: string, service: GetStrDef): void;
export function registerGetStr(peer: FluencePeer, service: GetStrDef): void;
export function registerGetStr(peer: FluencePeer, serviceId: string, service: GetStrDef): void;
export function registerGetStr(peer: IFluenceClient$$, service: GetStrDef): void;
export function registerGetStr(peer: IFluenceClient$$, serviceId: string, service: GetStrDef): void;
export function registerGetStr(...args: any) {
@ -67,8 +69,8 @@ export interface GetNumDef {
}
export function registerGetNum(service: GetNumDef): void;
export function registerGetNum(serviceId: string, service: GetNumDef): void;
export function registerGetNum(peer: FluencePeer, service: GetNumDef): void;
export function registerGetNum(peer: FluencePeer, serviceId: string, service: GetNumDef): void;
export function registerGetNum(peer: IFluenceClient$$, service: GetNumDef): void;
export function registerGetNum(peer: IFluenceClient$$, serviceId: string, service: GetNumDef): void;
export function registerGetNum(...args: any) {
@ -110,7 +112,7 @@ export function multiReturnFunc(
): Promise<MultiReturnFuncResult>;
export function multiReturnFunc(
peer: FluencePeer,
peer: IFluenceClient$$,
somethingToReturn: number[],
smthOption: string | null,
config?: {ttl?: number}
@ -244,7 +246,7 @@ export function tupleFunc(
): Promise<TupleFuncResult>;
export function tupleFunc(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<TupleFuncResult>;
@ -307,3 +309,5 @@ export function tupleFunc(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -22,8 +24,8 @@ export interface TestDef {
}
export function registerTest(service: TestDef): void;
export function registerTest(serviceId: string, service: TestDef): void;
export function registerTest(peer: FluencePeer, service: TestDef): void;
export function registerTest(peer: FluencePeer, serviceId: string, service: TestDef): void;
export function registerTest(peer: IFluenceClient$$, service: TestDef): void;
export function registerTest(peer: IFluenceClient$$, serviceId: string, service: TestDef): void;
export function registerTest(...args: any) {
@ -118,7 +120,7 @@ export function test(
): Promise<TestResult>;
export function test(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<TestResult>;
@ -200,7 +202,7 @@ export function test3(
): Promise<Test3Result>;
export function test3(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<Test3Result>;
@ -265,3 +267,5 @@ export function test3(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface OpHDef {
}
export function registerOpH(service: OpHDef): void;
export function registerOpH(serviceId: string, service: OpHDef): void;
export function registerOpH(peer: FluencePeer, service: OpHDef): void;
export function registerOpH(peer: FluencePeer, serviceId: string, service: OpHDef): void;
export function registerOpH(peer: IFluenceClient$$, service: OpHDef): void;
export function registerOpH(peer: IFluenceClient$$, serviceId: string, service: OpHDef): void;
export function registerOpH(...args: any) {
@ -69,7 +71,7 @@ export function a(
): Promise<string>;
export function a(
peer: FluencePeer,
peer: IFluenceClient$$,
b: string,
config?: {ttl?: number}
): Promise<string>;
@ -141,7 +143,7 @@ export function d(
): Promise<string>;
export function d(
peer: FluencePeer,
peer: IFluenceClient$$,
e: string,
config?: {ttl?: number}
): Promise<string>;
@ -204,3 +206,5 @@ export function d(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,518 +0,0 @@
/**
*
* 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.6.4-SNAPSHOT
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
import {
CallParams,
callFunction,
registerService,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v2';
// Services
export interface MoreMembersDef {
member1: (callParams: CallParams<null>) => void | Promise<void>;
member2: (s1: string, callParams: CallParams<'s1'>) => void | Promise<void>;
member3: (s1: string, s2: string, callParams: CallParams<'s1' | 's2'>) => void | Promise<void>;
member4: (s1: string, s2: string, i: number, callParams: CallParams<'s1' | 's2' | 'i'>) => number | Promise<number>;
member5: (s1: string, s2: string, i: number, callParams: CallParams<'s1' | 's2' | 'i'>) => number | Promise<number>;
}
export function registerMoreMembers(serviceId: string, service: MoreMembersDef): void;
export function registerMoreMembers(peer: FluencePeer, serviceId: string, service: MoreMembersDef): void;
export function registerMoreMembers(...args: any) {
registerService(
args,
{
"functions" : [
{
"functionName" : "member1",
"argDefs" : [
],
"returnType" : {
"tag" : "void"
}
},
{
"functionName" : "member2",
"argDefs" : [
{
"name" : "s1",
"argType" : {
"tag" : "primitive"
}
}
],
"returnType" : {
"tag" : "void"
}
},
{
"functionName" : "member3",
"argDefs" : [
{
"name" : "s1",
"argType" : {
"tag" : "primitive"
}
},
{
"name" : "s2",
"argType" : {
"tag" : "primitive"
}
}
],
"returnType" : {
"tag" : "void"
}
},
{
"functionName" : "member4",
"argDefs" : [
{
"name" : "s1",
"argType" : {
"tag" : "primitive"
}
},
{
"name" : "s2",
"argType" : {
"tag" : "primitive"
}
},
{
"name" : "i",
"argType" : {
"tag" : "primitive"
}
}
],
"returnType" : {
"tag" : "primitive"
}
},
{
"functionName" : "member5",
"argDefs" : [
{
"name" : "s1",
"argType" : {
"tag" : "primitive"
}
},
{
"name" : "s2",
"argType" : {
"tag" : "primitive"
}
},
{
"name" : "i",
"argType" : {
"tag" : "primitive"
}
}
],
"returnType" : {
"tag" : "primitive"
}
}
]
}
);
}
export interface ServiceWithOUTDefaultIdDef {
hello: (s: string, callParams: CallParams<'s'>) => void | Promise<void>;
}
export function registerServiceWithOUTDefaultId(serviceId: string, service: ServiceWithOUTDefaultIdDef): void;
export function registerServiceWithOUTDefaultId(peer: FluencePeer, serviceId: string, service: ServiceWithOUTDefaultIdDef): void;
export function registerServiceWithOUTDefaultId(...args: any) {
registerService(
args,
{
"functions" : [
{
"functionName" : "hello",
"argDefs" : [
{
"name" : "s",
"argType" : {
"tag" : "primitive"
}
}
],
"returnType" : {
"tag" : "void"
}
}
]
}
);
}
export interface ServiceWithDefaultIdDef {
hello: (s: string, callParams: CallParams<'s'>) => void | Promise<void>;
}
export function registerServiceWithDefaultId(service: ServiceWithDefaultIdDef): void;
export function registerServiceWithDefaultId(serviceId: string, service: ServiceWithDefaultIdDef): void;
export function registerServiceWithDefaultId(peer: FluencePeer, service: ServiceWithDefaultIdDef): void;
export function registerServiceWithDefaultId(peer: FluencePeer, serviceId: string, service: ServiceWithDefaultIdDef): void;
export function registerServiceWithDefaultId(...args: any) {
registerService(
args,
{
"defaultServiceId" : "defaultId",
"functions" : [
{
"functionName" : "hello",
"argDefs" : [
{
"name" : "s",
"argType" : {
"tag" : "primitive"
}
}
],
"returnType" : {
"tag" : "void"
}
}
]
}
);
}
// Functions
export function callBackZeroArgs(
callback: (callParams: CallParams<null>) => void | Promise<void>,
config?: {ttl?: number}
): Promise<void>;
export function callBackZeroArgs(
peer: FluencePeer,
callback: (callParams: CallParams<null>) => void | Promise<void>,
config?: {ttl?: number}
): Promise<void>;
export function callBackZeroArgs(...args: any) {
let script = `
(xor
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(xor
(call %init_peer_id% ("callbackSrv" "callback") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
`
return callFunction(
args,
{
"functionName" : "callBackZeroArgs",
"returnType" : {
"tag" : "void"
},
"argDefs" : [
{
"name" : "callback",
"argType" : {
"tag" : "callback",
"callback" : {
"argDefs" : [
],
"returnType" : {
"tag" : "void"
}
}
}
}
],
"names" : {
"relay" : "-relay-",
"getDataSrv" : "getDataSrv",
"callbackSrv" : "callbackSrv",
"responseSrv" : "callbackSrv",
"responseFnName" : "response",
"errorHandlingSrv" : "errorHandlingSrv",
"errorFnName" : "error"
}
},
script
)
}
export function f1(
callback: (arg0: string, arg1: number, callParams: CallParams<'arg0' | 'arg1'>) => void | Promise<void>,
config?: {ttl?: number}
): Promise<void>;
export function f1(
peer: FluencePeer,
callback: (arg0: string, arg1: number, callParams: CallParams<'arg0' | 'arg1'>) => void | Promise<void>,
config?: {ttl?: number}
): Promise<void>;
export function f1(...args: any) {
let script = `
(xor
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(xor
(call %init_peer_id% ("callbackSrv" "callback") ["hello, world" 42])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
`
return callFunction(
args,
{
"functionName" : "f1",
"returnType" : {
"tag" : "void"
},
"argDefs" : [
{
"name" : "callback",
"argType" : {
"tag" : "callback",
"callback" : {
"argDefs" : [
{
"name" : "arg0",
"argType" : {
"tag" : "primitive"
}
},
{
"name" : "arg1",
"argType" : {
"tag" : "primitive"
}
}
],
"returnType" : {
"tag" : "void"
}
}
}
}
],
"names" : {
"relay" : "-relay-",
"getDataSrv" : "getDataSrv",
"callbackSrv" : "callbackSrv",
"responseSrv" : "callbackSrv",
"responseFnName" : "response",
"errorHandlingSrv" : "errorHandlingSrv",
"errorFnName" : "error"
}
},
script
)
}
export function f3(
num: number,
callback: (arg0: string, arg1: number, callParams: CallParams<'arg0' | 'arg1'>) => void | Promise<void>,
config?: {ttl?: number}
): Promise<string>;
export function f3(
peer: FluencePeer,
num: number,
callback: (arg0: string, arg1: number, callParams: CallParams<'arg0' | 'arg1'>) => void | Promise<void>,
config?: {ttl?: number}
): Promise<string>;
export function f3(...args: any) {
let script = `
(xor
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(call %init_peer_id% ("getDataSrv" "num") [] num)
)
(xor
(call %init_peer_id% ("callbackSrv" "callback") ["hello, world" 42])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") ["hello world"])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
)
`
return callFunction(
args,
{
"functionName" : "f3",
"returnType" : {
"tag" : "primitive"
},
"argDefs" : [
{
"name" : "num",
"argType" : {
"tag" : "primitive"
}
},
{
"name" : "callback",
"argType" : {
"tag" : "callback",
"callback" : {
"argDefs" : [
{
"name" : "arg0",
"argType" : {
"tag" : "primitive"
}
},
{
"name" : "arg1",
"argType" : {
"tag" : "primitive"
}
}
],
"returnType" : {
"tag" : "void"
}
}
}
}
],
"names" : {
"relay" : "-relay-",
"getDataSrv" : "getDataSrv",
"callbackSrv" : "callbackSrv",
"responseSrv" : "callbackSrv",
"responseFnName" : "response",
"errorHandlingSrv" : "errorHandlingSrv",
"errorFnName" : "error"
}
},
script
)
}
export function f2(
num: number,
callback: (arg0: string, arg1: number, callParams: CallParams<'arg0' | 'arg1'>) => void | Promise<void>,
config?: {ttl?: number}
): Promise<void>;
export function f2(
peer: FluencePeer,
num: number,
callback: (arg0: string, arg1: number, callParams: CallParams<'arg0' | 'arg1'>) => void | Promise<void>,
config?: {ttl?: number}
): Promise<void>;
export function f2(...args: any) {
let script = `
(xor
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(call %init_peer_id% ("getDataSrv" "num") [] num)
)
(xor
(call %init_peer_id% ("callbackSrv" "callback") ["hello, world" 42])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
`
return callFunction(
args,
{
"functionName" : "f2",
"returnType" : {
"tag" : "void"
},
"argDefs" : [
{
"name" : "num",
"argType" : {
"tag" : "primitive"
}
},
{
"name" : "callback",
"argType" : {
"tag" : "callback",
"callback" : {
"argDefs" : [
{
"name" : "arg0",
"argType" : {
"tag" : "primitive"
}
},
{
"name" : "arg1",
"argType" : {
"tag" : "primitive"
}
}
],
"returnType" : {
"tag" : "void"
}
}
}
}
],
"names" : {
"relay" : "-relay-",
"getDataSrv" : "getDataSrv",
"callbackSrv" : "callbackSrv",
"responseSrv" : "callbackSrv",
"responseFnName" : "response",
"errorHandlingSrv" : "errorHandlingSrv",
"errorFnName" : "error"
}
},
script
)
}

View File

@ -1,136 +0,0 @@
/**
*
* 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.6.4-SNAPSHOT
*
*/
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
import {
CallParams,
callFunction,
registerService,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v2';
// Services
export interface HelloWorldDef {
getNumber: (callParams: CallParams<null>) => number | Promise<number>;
sayHello: (s: string, callParams: CallParams<'s'>) => void | Promise<void>;
}
export function registerHelloWorld(service: HelloWorldDef): void;
export function registerHelloWorld(serviceId: string, service: HelloWorldDef): void;
export function registerHelloWorld(peer: FluencePeer, service: HelloWorldDef): void;
export function registerHelloWorld(peer: FluencePeer, serviceId: string, service: HelloWorldDef): void;
export function registerHelloWorld(...args: any) {
registerService(
args,
{
"defaultServiceId" : "default",
"functions" : [
{
"functionName" : "getNumber",
"argDefs" : [
],
"returnType" : {
"tag" : "primitive"
}
},
{
"functionName" : "sayHello",
"argDefs" : [
{
"name" : "s",
"argType" : {
"tag" : "primitive"
}
}
],
"returnType" : {
"tag" : "void"
}
}
]
}
);
}
// Functions
export function callMeBack(
callback: (arg0: string, arg1: number, callParams: CallParams<'arg0' | 'arg1'>) => void | Promise<void>,
config?: {ttl?: number}
): Promise<void>;
export function callMeBack(
peer: FluencePeer,
callback: (arg0: string, arg1: number, callParams: CallParams<'arg0' | 'arg1'>) => void | Promise<void>,
config?: {ttl?: number}
): Promise<void>;
export function callMeBack(...args: any) {
let script = `
(xor
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(xor
(call %init_peer_id% ("callbackSrv" "callback") ["hello, world" 42])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
`
return callFunction(
args,
{
"functionName" : "callMeBack",
"returnType" : {
"tag" : "void"
},
"argDefs" : [
{
"name" : "callback",
"argType" : {
"tag" : "callback",
"callback" : {
"argDefs" : [
{
"name" : "arg0",
"argType" : {
"tag" : "primitive"
}
},
{
"name" : "arg1",
"argType" : {
"tag" : "primitive"
}
}
],
"returnType" : {
"tag" : "void"
}
}
}
}
],
"names" : {
"relay" : "-relay-",
"getDataSrv" : "getDataSrv",
"callbackSrv" : "callbackSrv",
"responseSrv" : "callbackSrv",
"responseFnName" : "response",
"errorHandlingSrv" : "errorHandlingSrv",
"errorFnName" : "error"
}
},
script
)
}

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -24,7 +26,7 @@ export function getObjRelay(
): Promise<GetObjRelayResult>;
export function getObjRelay(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<GetObjRelayResult>;
@ -35,37 +37,34 @@ export function getObjRelay(...args: any) {
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(xor
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(xor
(seq
(seq
(seq
(seq
(seq
(new $array-inline
(new $array-inline
(seq
(seq
(seq
(seq
(ap "a" $array-inline)
(ap "b" $array-inline)
)
(ap "c" $array-inline)
(ap "a" $array-inline)
(ap "b" $array-inline)
)
(canon -relay- $array-inline #array-inline-0)
(ap "c" $array-inline)
)
(canon -relay- $array-inline #array-inline-0)
)
(call -relay- ("op" "identity") [#array-inline-0] identity)
)
(call -relay- ("json" "obj") ["arr" identity "num" 6] InnerObj_obj)
(call -relay- ("op" "identity") [#array-inline-0] identity)
)
(call -relay- ("json" "obj") ["inner" InnerObj_obj "num" 5 "str" "diff str"] SomeObj_obj)
(call -relay- ("json" "obj") ["arr" identity "num" 6] InnerObj_obj)
)
(call -relay- ("op" "noop") [])
(call -relay- ("json" "obj") ["inner" InnerObj_obj "num" 5 "str" "diff str"] SomeObj_obj)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
(call -relay- ("op" "noop") [])
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
(ap SomeObj_obj SomeObj_obj_flat)
)
(call %init_peer_id% ("json" "puts") [SomeObj_obj "str" "some str"] SomeObj_obj_obj_copy)
)
@ -147,7 +146,7 @@ export function getObj(
): Promise<GetObjResult>;
export function getObj(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<GetObjResult>;
@ -158,9 +157,9 @@ export function getObj(...args: any) {
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(par
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(new $array-inline
(seq
(seq
@ -173,10 +172,10 @@ export function getObj(...args: any) {
(canon %init_peer_id% $array-inline #array-inline-0)
)
)
(call %init_peer_id% ("json" "obj") ["arr" #array-inline-0 "num" 6] InnerObj_obj)
)
(call %init_peer_id% ("json" "obj") ["arr" #array-inline-0 "num" 6] InnerObj_obj)
(call %init_peer_id% ("op" "identity") ["some str"] identity)
)
(call %init_peer_id% ("op" "identity") ["some str"] identity)
)
(call %init_peer_id% ("json" "obj") ["inner" InnerObj_obj "num" 5 "str" identity] SomeObj_obj)
)
@ -258,7 +257,7 @@ export function getObjAssign(
): Promise<GetObjAssignResult>;
export function getObjAssign(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<GetObjAssignResult>;
@ -278,82 +277,70 @@ export function getObjAssign(...args: any) {
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(par
(seq
(new $array-inline
(seq
(seq
(seq
(ap "d" $array-inline)
(ap "e" $array-inline)
)
(ap "f" $array-inline)
)
(canon %init_peer_id% $array-inline #array-inline-0)
)
)
(call %init_peer_id% ("json" "obj") ["arr" #array-inline-0 "num" 7] InnerObj_obj)
)
(call %init_peer_id% ("op" "identity") [5] identity)
)
)
(call %init_peer_id% ("json" "obj") ["inner" InnerObj_obj "num" identity "str" "first str"] SomeObj_obj)
)
(par
(ap SomeObj_obj.$.inner! SomeObj_obj_flat)
(seq
(new $array-inline-1
(seq
(seq
(seq
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(new $array-inline
(seq
(seq
(seq
(ap "d" $array-inline)
(ap "e" $array-inline)
)
(ap "f" $array-inline)
)
(canon %init_peer_id% $array-inline #array-inline-0)
)
)
)
(call %init_peer_id% ("json" "obj") ["arr" #array-inline-0 "num" 7] InnerObj_obj)
)
(call %init_peer_id% ("op" "identity") [5] identity)
)
(call %init_peer_id% ("json" "obj") ["inner" InnerObj_obj "num" identity "str" "first str"] SomeObj_obj)
)
(ap SomeObj_obj SomeObj_obj_flat)
)
(ap SomeObj_obj.$.inner! SomeObj_obj_flat-0)
)
(new $array-inline-1
(seq
(seq
(seq
(ap "a" $array-inline-1)
(ap "b" $array-inline-1)
)
(ap "c" $array-inline-1)
)
(canon %init_peer_id% $array-inline-1 #array-inline-1-0)
(ap "a" $array-inline-1)
(ap "b" $array-inline-1)
)
(ap "c" $array-inline-1)
)
(canon %init_peer_id% $array-inline-1 #array-inline-1-0)
)
(call %init_peer_id% ("json" "puts") [SomeObj_obj.$.inner! "arr" #array-inline-1-0] SomeObj_obj_obj_copy-0)
)
(call %init_peer_id% ("json" "puts") [SomeObj_obj "inner" SomeObj_obj_obj_copy-0 "str" "some str"] SomeObj_obj_obj_copy)
(call %init_peer_id% ("json" "puts") [SomeObj_obj.$.inner! "arr" #array-inline-1-0] SomeObj_obj_obj_copy-0)
)
(ap SomeObj_obj_obj_copy SomeObj_obj_obj_copy_flat)
)
(call %init_peer_id% ("json" "puts") [SomeObj_obj_obj_copy "num" 6] SomeObj_obj_obj_copy_obj_copy)
)
(ap SomeObj_obj_obj_copy_obj_copy.$.inner! SomeObj_obj_obj_copy_obj_copy_flat)
(call %init_peer_id% ("json" "puts") [SomeObj_obj "inner" SomeObj_obj_obj_copy-0 "str" "some str"] SomeObj_obj_obj_copy)
)
(ap SomeObj_obj_obj_copy_obj_copy_flat SomeObj_obj_obj_copy_obj_copy_flat_flat)
(call %init_peer_id% ("json" "puts") [SomeObj_obj_obj_copy "num" 6] SomeObj_obj_obj_copy_obj_copy)
)
(new $array-inline-2
(seq
(ap "g" $array-inline-2)
(canon %init_peer_id% $array-inline-2 #array-inline-2-0)
)
(ap SomeObj_obj_obj_copy_obj_copy.$.inner! SomeObj_obj_obj_copy_obj_copy_flat)
)
(new $array-inline-2
(seq
(ap "g" $array-inline-2)
(canon %init_peer_id% $array-inline-2 #array-inline-2-0)
)
)
(call %init_peer_id% ("json" "puts") [SomeObj_obj_obj_copy_obj_copy_flat "arr" #array-inline-2-0] SomeObj_obj_obj_copy_obj_copy_flat_obj_copy)
)
(ap SomeObj_obj_obj_copy_obj_copy_flat_obj_copy.$.arr! SomeObj_obj_obj_copy_obj_copy_flat_obj_copy_flat)
(call %init_peer_id% ("json" "puts") [SomeObj_obj_obj_copy_obj_copy_flat "arr" #array-inline-2-0] SomeObj_obj_obj_copy_obj_copy_flat_obj_copy)
)
(ap SomeObj_obj_obj_copy_obj_copy_flat_obj_copy_flat SomeObj_obj_obj_copy_obj_copy_flat_obj_copy_flat_flat)
(ap SomeObj_obj_obj_copy_obj_copy_flat_obj_copy.$.arr! SomeObj_obj_obj_copy_obj_copy_flat_obj_copy_flat)
)
(ap SomeObj_obj_obj_copy_obj_copy_flat_obj_copy_flat_flat SomeObj_obj_obj_copy_obj_copy_flat_obj_copy_flat_flat_to_functor)
(ap SomeObj_obj_obj_copy_obj_copy_flat_obj_copy_flat SomeObj_obj_obj_copy_obj_copy_flat_obj_copy_flat_to_functor)
)
(ap SomeObj_obj_obj_copy_obj_copy_flat_obj_copy_flat_flat_to_functor.length SomeObj_obj_obj_copy_obj_copy_flat_obj_copy_flat_flat_length)
(ap SomeObj_obj_obj_copy_obj_copy_flat_obj_copy_flat_to_functor.length SomeObj_obj_obj_copy_obj_copy_flat_obj_copy_flat_length)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [SomeObj_obj SomeObj_obj_obj_copy_obj_copy SomeObj_obj_obj_copy_obj_copy_flat_obj_copy_flat_flat_length])
(call %init_peer_id% ("callbackSrv" "response") [SomeObj_obj SomeObj_obj_obj_copy_obj_copy SomeObj_obj_obj_copy_obj_copy_flat_obj_copy_flat_length])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
@ -457,3 +444,5 @@ export function getObjAssign(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -25,7 +27,7 @@ export function getPeerExternalAddresses(
): Promise<string[]>;
export function getPeerExternalAddresses(
peer: FluencePeer,
peer: IFluenceClient$$,
otherNodePeerId: string,
config?: {ttl?: number}
): Promise<string[]>;
@ -116,7 +118,7 @@ export function getDistantAddresses(
): Promise<string[]>;
export function getDistantAddresses(
peer: FluencePeer,
peer: IFluenceClient$$,
target: string,
viaNode: string,
config?: {ttl?: number}
@ -214,3 +216,5 @@ export function getDistantAddresses(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -24,8 +26,8 @@ export interface SomeSDef {
}
export function registerSomeS(service: SomeSDef): void;
export function registerSomeS(serviceId: string, service: SomeSDef): void;
export function registerSomeS(peer: FluencePeer, service: SomeSDef): void;
export function registerSomeS(peer: FluencePeer, serviceId: string, service: SomeSDef): void;
export function registerSomeS(peer: IFluenceClient$$, service: SomeSDef): void;
export function registerSomeS(peer: IFluenceClient$$, serviceId: string, service: SomeSDef): void;
export function registerSomeS(...args: any) {
@ -134,7 +136,7 @@ export function returnNone(
): Promise<string | null>;
export function returnNone(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string | null>;
@ -210,7 +212,7 @@ export function checkU32AndU8(
): Promise<void>;
export function checkU32AndU8(
peer: FluencePeer,
peer: IFluenceClient$$,
a: number | null,
config?: {ttl?: number}
): Promise<void>;
@ -273,7 +275,7 @@ export function useOptional(
): Promise<string>;
export function useOptional(
peer: FluencePeer,
peer: IFluenceClient$$,
opt: string | null,
config?: {ttl?: number}
): Promise<string>;
@ -286,23 +288,20 @@ export function useOptional(...args: any) {
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(call %init_peer_id% ("getDataSrv" "opt") [] opt)
)
(call %init_peer_id% ("test2" "getStr") [opt] res)
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(call %init_peer_id% ("getDataSrv" "opt") [] opt)
)
(fold opt i-0
(seq
(call %init_peer_id% ("test2" "getStr2") [i-0])
(next i-0)
)
(call %init_peer_id% ("test2" "getStr") [opt] res)
)
(fold opt i-0
(seq
(call %init_peer_id% ("test2" "getStr2") [i-0])
(next i-0)
)
)
(ap res.$.[0]! res_flat)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [res_flat])
(call %init_peer_id% ("callbackSrv" "response") [res.$.[0]!])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
@ -358,7 +357,7 @@ export function returnOptional(
): Promise<string | null>;
export function returnOptional(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string | null>;
@ -417,3 +416,5 @@ export function returnOptional(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface OptionStringDef {
}
export function registerOptionString(service: OptionStringDef): void;
export function registerOptionString(serviceId: string, service: OptionStringDef): void;
export function registerOptionString(peer: FluencePeer, service: OptionStringDef): void;
export function registerOptionString(peer: FluencePeer, serviceId: string, service: OptionStringDef): void;
export function registerOptionString(peer: IFluenceClient$$, service: OptionStringDef): void;
export function registerOptionString(peer: IFluenceClient$$, serviceId: string, service: OptionStringDef): void;
export function registerOptionString(...args: any) {
@ -71,7 +73,7 @@ export function checkEmpty(
): Promise<string>;
export function checkEmpty(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string>;
@ -143,7 +145,7 @@ export function emptyString(
): Promise<string | null>;
export function emptyString(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string | null>;
@ -216,7 +218,7 @@ export function checkNoneEmpty(
): Promise<string>;
export function checkNoneEmpty(
peer: FluencePeer,
peer: IFluenceClient$$,
str: string,
config?: {ttl?: number}
): Promise<string>;
@ -299,7 +301,7 @@ export function stringAsOption(
): Promise<string | null>;
export function stringAsOption(
peer: FluencePeer,
peer: IFluenceClient$$,
str: string,
config?: {ttl?: number}
): Promise<string | null>;
@ -373,3 +375,5 @@ export function stringAsOption(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface ParServiceDef {
}
export function registerParService(service: ParServiceDef): void;
export function registerParService(serviceId: string, service: ParServiceDef): void;
export function registerParService(peer: FluencePeer, service: ParServiceDef): void;
export function registerParService(peer: FluencePeer, serviceId: string, service: ParServiceDef): void;
export function registerParService(peer: IFluenceClient$$, service: ParServiceDef): void;
export function registerParService(peer: IFluenceClient$$, serviceId: string, service: ParServiceDef): void;
export function registerParService(...args: any) {
@ -64,7 +66,7 @@ export function parFunc(
): Promise<void>;
export function parFunc(
peer: FluencePeer,
peer: IFluenceClient$$,
node: string,
c: (arg0: { air_version: string; external_addresses: string[]; node_version: string; }, callParams: CallParams$$<'arg0'>) => void | Promise<void>,
config?: {ttl?: number}
@ -187,7 +189,7 @@ export function testTimeout(
): Promise<string>;
export function testTimeout(
peer: FluencePeer,
peer: IFluenceClient$$,
nodes: string[],
config?: {ttl?: number}
): Promise<string>;
@ -209,137 +211,134 @@ export function testTimeout(...args: any) {
(seq
(seq
(seq
(seq
(call -relay- ("op" "noop") [])
(xor
(par
(fold nodes node-0
(par
(call -relay- ("op" "noop") [])
(xor
(par
(fold nodes node-0
(par
(seq
(seq
(seq
(xor
(call node-0 ("peer" "identify") [] $results)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(call -relay- ("op" "noop") [])
)
(call %init_peer_id% ("op" "noop") [])
)
(next node-0)
)
(never)
)
(null)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
)
(par
(new $results_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [999 1] results_incr)
(fold $results s
(seq
(xor
(call node-0 ("peer" "identify") [] $results)
(seq
(ap s $results_test)
(canon %init_peer_id% $results_test #results_iter_canon)
)
(xor
(match #results_iter_canon.length results_incr
(null)
)
(next s)
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(never)
(call -relay- ("op" "noop") [])
)
(call %init_peer_id% ("op" "noop") [])
)
(canon %init_peer_id% $results_test #results_result_canon)
)
(ap #results_result_canon results_gate)
)
)
(call %init_peer_id% ("peer" "timeout") [400 "timeout"] $timeout)
)
)
(xor
(seq
(canon %init_peer_id% $timeout #timeout_canon)
(match #timeout_canon []
(ap "ok" $status)
)
)
(seq
(new $timeout_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] timeout_incr)
(fold $timeout s
(seq
(seq
(ap s $timeout_test)
(canon %init_peer_id% $timeout_test #timeout_iter_canon)
)
(xor
(match #timeout_iter_canon.length timeout_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $timeout_test #timeout_result_canon)
)
(ap #timeout_result_canon timeout_gate)
)
)
(ap timeout_gate.$.[0]! $status)
)
)
)
(new $status_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] status_incr)
(fold $status s
(seq
(seq
(ap s $status_test)
(canon %init_peer_id% $status_test #status_iter_canon)
)
(xor
(match #status_iter_canon.length status_incr
(null)
)
(next s)
)
(next node-0)
)
(never)
)
(null)
)
(canon %init_peer_id% $status_test #status_result_canon)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
(ap #status_result_canon status_gate)
)
(par
(new $results_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [999 1] results_incr)
(fold $results s
(seq
(seq
(ap s $results_test)
(canon %init_peer_id% $results_test #results_iter_canon)
)
(xor
(match #results_iter_canon.length results_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $results_test #results_result_canon)
)
(ap #results_result_canon results_gate)
)
)
(call %init_peer_id% ("peer" "timeout") [400 "timeout"] $timeout)
)
)
(xor
(seq
(canon %init_peer_id% $timeout #timeout_canon)
(match #timeout_canon []
(ap "ok" $status)
)
)
(seq
(new $timeout_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] timeout_incr)
(fold $timeout s
(seq
(seq
(ap s $timeout_test)
(canon %init_peer_id% $timeout_test #timeout_iter_canon)
)
(xor
(match #timeout_iter_canon.length timeout_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $timeout_test #timeout_result_canon)
)
(ap #timeout_result_canon timeout_gate)
)
)
(ap timeout_gate.$.[0]! $status)
)
)
)
(ap status_gate.$.[0]! status_gate_flat)
(new $status_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] status_incr)
(fold $status s
(seq
(seq
(ap s $status_test)
(canon %init_peer_id% $status_test #status_iter_canon)
)
(xor
(match #status_iter_canon.length status_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $status_test #status_result_canon)
)
(ap #status_result_canon status_gate)
)
)
)
)
)
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [status_gate_flat])
(call %init_peer_id% ("callbackSrv" "response") [status_gate.$.[0]!])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
)
)
@ -387,3 +386,5 @@ export function testTimeout(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface AquaDHTDef {
}
export function registerAquaDHT(service: AquaDHTDef): void;
export function registerAquaDHT(serviceId: string, service: AquaDHTDef): void;
export function registerAquaDHT(peer: FluencePeer, service: AquaDHTDef): void;
export function registerAquaDHT(peer: FluencePeer, serviceId: string, service: AquaDHTDef): void;
export function registerAquaDHT(peer: IFluenceClient$$, service: AquaDHTDef): void;
export function registerAquaDHT(peer: IFluenceClient$$, serviceId: string, service: AquaDHTDef): void;
export function registerAquaDHT(...args: any) {
@ -81,7 +83,7 @@ export function wait(
): Promise<void>;
export function wait(
peer: FluencePeer,
peer: IFluenceClient$$,
successful: boolean[],
n: number,
config?: {ttl?: number}
@ -191,7 +193,7 @@ export function bugLNG60(
): Promise<boolean>;
export function bugLNG60(
peer: FluencePeer,
peer: IFluenceClient$$,
node: string,
config?: {ttl?: number}
): Promise<boolean>;
@ -312,7 +314,7 @@ export function create_client_util(
): Promise<string>;
export function create_client_util(
peer: FluencePeer,
peer: IFluenceClient$$,
service_id: string,
config?: {ttl?: number}
): Promise<string>;
@ -386,7 +388,7 @@ export function putHostValue(
): Promise<string>;
export function putHostValue(
peer: FluencePeer,
peer: IFluenceClient$$,
key: string,
value: string,
service_id: string | null,
@ -468,3 +470,5 @@ export function putHostValue(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface PrintlnDef {
}
export function registerPrintln(service: PrintlnDef): void;
export function registerPrintln(serviceId: string, service: PrintlnDef): void;
export function registerPrintln(peer: FluencePeer, service: PrintlnDef): void;
export function registerPrintln(peer: FluencePeer, serviceId: string, service: PrintlnDef): void;
export function registerPrintln(peer: IFluenceClient$$, service: PrintlnDef): void;
export function registerPrintln(peer: IFluenceClient$$, serviceId: string, service: PrintlnDef): void;
export function registerPrintln(...args: any) {
@ -63,7 +65,7 @@ export function print(
): Promise<void>;
export function print(
peer: FluencePeer,
peer: IFluenceClient$$,
str: string,
config?: {ttl?: number}
): Promise<void>;
@ -114,3 +116,5 @@ export function print(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface OpADef {
}
export function registerOpA(service: OpADef): void;
export function registerOpA(serviceId: string, service: OpADef): void;
export function registerOpA(peer: FluencePeer, service: OpADef): void;
export function registerOpA(peer: FluencePeer, serviceId: string, service: OpADef): void;
export function registerOpA(peer: IFluenceClient$$, service: OpADef): void;
export function registerOpA(peer: IFluenceClient$$, serviceId: string, service: OpADef): void;
export function registerOpA(...args: any) {
@ -62,7 +64,7 @@ export function get_results(
): Promise<string[]>;
export function get_results(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string[]>;
@ -135,3 +137,5 @@ export function get_results(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface YesNoServiceDef {
}
export function registerYesNoService(service: YesNoServiceDef): void;
export function registerYesNoService(serviceId: string, service: YesNoServiceDef): void;
export function registerYesNoService(peer: FluencePeer, service: YesNoServiceDef): void;
export function registerYesNoService(peer: FluencePeer, serviceId: string, service: YesNoServiceDef): void;
export function registerYesNoService(peer: IFluenceClient$$, service: YesNoServiceDef): void;
export function registerYesNoService(peer: IFluenceClient$$, serviceId: string, service: YesNoServiceDef): void;
export function registerYesNoService(...args: any) {
@ -62,7 +64,7 @@ export function recursiveStream(
): Promise<RecursiveStreamResult>;
export function recursiveStream(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<RecursiveStreamResult>;
@ -166,3 +168,5 @@ export function recursiveStream(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -24,7 +26,7 @@ export function returnLiteral(
): Promise<string>;
export function returnLiteral(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string>;
@ -77,3 +79,5 @@ export function returnLiteral(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface StringerDef {
}
export function registerStringer(service: StringerDef): void;
export function registerStringer(serviceId: string, service: StringerDef): void;
export function registerStringer(peer: FluencePeer, service: StringerDef): void;
export function registerStringer(peer: FluencePeer, serviceId: string, service: StringerDef): void;
export function registerStringer(peer: IFluenceClient$$, service: StringerDef): void;
export function registerStringer(peer: IFluenceClient$$, serviceId: string, service: StringerDef): void;
export function registerStringer(...args: any) {
@ -68,7 +70,7 @@ export function returnNone(
): Promise<string | null>;
export function returnNone(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string | null>;
@ -135,12 +137,87 @@ export function returnNone(...args: any) {
export function returnNilLength(
config?: {ttl?: number}
): Promise<number>;
export function returnNilLength(
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<number>;
export function returnNilLength(...args: any) {
let script = `
(xor
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(new $arr
(seq
(seq
(seq
(ap [] literal_ap)
(ap literal_ap literal_props)
)
(ap literal_props literal_props_to_functor)
)
(ap literal_props_to_functor.length literal_props_length)
)
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [literal_props_length])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
`
return callFunction$$(
args,
{
"functionName" : "returnNilLength",
"arrow" : {
"tag" : "arrow",
"domain" : {
"tag" : "labeledProduct",
"fields" : {
}
},
"codomain" : {
"tag" : "unlabeledProduct",
"items" : [
{
"tag" : "scalar",
"name" : "u32"
}
]
}
},
"names" : {
"relay" : "-relay-",
"getDataSrv" : "getDataSrv",
"callbackSrv" : "callbackSrv",
"responseSrv" : "callbackSrv",
"responseFnName" : "response",
"errorHandlingSrv" : "errorHandlingSrv",
"errorFnName" : "error"
}
},
script
)
}
export function stringNone(
config?: {ttl?: number}
): Promise<string | null>;
export function stringNone(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string | null>;
@ -213,7 +290,7 @@ export function streamIntFunctor(
): Promise<string>;
export function streamIntFunctor(
peer: FluencePeer,
peer: IFluenceClient$$,
arr: number[],
config?: {ttl?: number}
): Promise<string>;
@ -232,56 +309,56 @@ export function streamIntFunctor(...args: any) {
(seq
(seq
(seq
(new $array-inline
(seq
(ap "123" $array-inline)
(canon %init_peer_id% $array-inline #array-inline-0)
)
)
(ap #array-inline-0 $stream)
)
(new $stream_test
(seq
(seq
(seq
(new $array-inline
(seq
(ap "123" $array-inline)
(canon %init_peer_id% $array-inline #array-inline-0)
)
)
(ap #array-inline-0 $stream)
)
(new $stream_test
(seq
(call %init_peer_id% ("math" "add") [arr.$.[0]! 1] stream_incr)
(fold $stream s
(seq
(seq
(call %init_peer_id% ("math" "add") [arr.$.[0]! 1] stream_incr)
(fold $stream s
(seq
(seq
(ap s $stream_test)
(canon %init_peer_id% $stream_test #stream_iter_canon)
)
(xor
(match #stream_iter_canon.length stream_incr
(null)
)
(next s)
)
)
(never)
)
(ap s $stream_test)
(canon %init_peer_id% $stream_test #stream_iter_canon)
)
(xor
(match #stream_iter_canon.length stream_incr
(null)
)
(next s)
)
(canon %init_peer_id% $stream_test #stream_result_canon)
)
(ap #stream_result_canon stream_gate)
(never)
)
)
(canon %init_peer_id% $stream_test #stream_result_canon)
)
(ap arr.$.[0]! arr_flat)
(ap #stream_result_canon stream_gate)
)
(ap stream_gate.$.[arr_flat]! stream_gate_flat)
)
(ap arr.$.[0]! arr_flat-0)
)
(ap stream_gate_flat.$.[arr_flat-0]! stream_gate_flat_flat)
(par
(seq
(ap arr.$.[0]! arr_flat)
(call %init_peer_id% ("op" "noop") [])
)
(seq
(ap arr.$.[0]! arr_flat-0)
(call %init_peer_id% ("op" "noop") [])
)
)
)
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [stream_gate_flat_flat])
(call %init_peer_id% ("callbackSrv" "response") [stream_gate.$.[arr_flat].[arr_flat-0]!])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
@ -332,12 +409,76 @@ export function streamIntFunctor(...args: any) {
export function returnNilLiteral(
config?: {ttl?: number}
): Promise<string[]>;
export function returnNilLiteral(
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string[]>;
export function returnNilLiteral(...args: any) {
let script = `
(xor
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(xor
(call %init_peer_id% ("callbackSrv" "response") [[]])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
`
return callFunction$$(
args,
{
"functionName" : "returnNilLiteral",
"arrow" : {
"tag" : "arrow",
"domain" : {
"tag" : "labeledProduct",
"fields" : {
}
},
"codomain" : {
"tag" : "unlabeledProduct",
"items" : [
{
"tag" : "array",
"type" : {
"tag" : "scalar",
"name" : "string"
}
}
]
}
},
"names" : {
"relay" : "-relay-",
"getDataSrv" : "getDataSrv",
"callbackSrv" : "callbackSrv",
"responseSrv" : "callbackSrv",
"responseFnName" : "response",
"errorHandlingSrv" : "errorHandlingSrv",
"errorFnName" : "error"
}
},
script
)
}
export function returnStreamFromFunc(
config?: {ttl?: number}
): Promise<number[]>;
export function returnStreamFromFunc(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<number[]>;
@ -416,7 +557,7 @@ export function returnNil(
): Promise<string[]>;
export function returnNil(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string[]>;
@ -483,7 +624,7 @@ export function stringNil(
): Promise<string[]>;
export function stringNil(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string[]>;
@ -551,7 +692,7 @@ export function checkStreams(
): Promise<string[]>;
export function checkStreams(
peer: FluencePeer,
peer: IFluenceClient$$,
ch: string[],
config?: {ttl?: number}
): Promise<string[]>;
@ -648,7 +789,7 @@ export function streamAssignment(
): Promise<string>;
export function streamAssignment(
peer: FluencePeer,
peer: IFluenceClient$$,
arr: string[],
config?: {ttl?: number}
): Promise<string>;
@ -673,71 +814,59 @@ export function streamAssignment(...args: any) {
(seq
(seq
(seq
(seq
(new $array-inline
(seq
(seq
(seq
(new $array-inline
(seq
(ap 0 $array-inline)
(canon %init_peer_id% $array-inline #array-inline-0)
)
)
(ap #array-inline-0 $stream)
)
(ap arr arr_flat)
)
(ap arr_flat arr_flat_to_functor)
(ap 0 $array-inline)
(canon %init_peer_id% $array-inline #array-inline-0)
)
(ap arr_flat_to_functor.length arr_flat_length)
)
(call %init_peer_id% ("math" "sub") [arr_flat_length 1] sub)
)
(new $stream_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [sub 1] stream_incr)
(fold $stream s
(seq
(seq
(ap s $stream_test)
(canon %init_peer_id% $stream_test #stream_iter_canon)
)
(xor
(match #stream_iter_canon.length stream_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $stream_test #stream_result_canon)
)
(ap #stream_result_canon stream_gate)
)
(ap #array-inline-0 $stream)
)
(ap arr arr_to_functor)
)
(ap arr arr_flat-0)
(ap arr_to_functor.length arr_length)
)
(call %init_peer_id% ("math" "sub") [arr_length 1] sub)
)
(new $stream_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [sub 1] stream_incr)
(fold $stream s
(seq
(seq
(ap s $stream_test)
(canon %init_peer_id% $stream_test #stream_iter_canon)
)
(xor
(match #stream_iter_canon.length stream_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $stream_test #stream_result_canon)
)
(ap #stream_result_canon stream_gate)
)
(ap arr_flat-0 arr_flat-0_to_functor)
)
(ap arr_flat-0_to_functor.length arr_flat-0_length)
)
(call %init_peer_id% ("math" "sub") [arr_flat-0_length 1] sub-0)
(ap arr arr_to_functor-0)
)
(ap stream_gate.$.[sub-0]! stream_gate_flat)
(ap arr_to_functor-0.length arr_length-0)
)
(ap stream_gate_flat.$.[0]! stream_gate_flat_flat)
(call %init_peer_id% ("math" "sub") [arr_length-0 1] sub-0)
)
(ap arr.$.[stream_gate_flat_flat]! arr_flat-1)
(ap stream_gate.$.[sub-0].[0]! stream_gate_flat)
)
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [arr_flat-1])
(call %init_peer_id% ("callbackSrv" "response") [arr.$.[stream_gate_flat]!])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
@ -794,7 +923,7 @@ export function streamFunctor(
): Promise<string>;
export function streamFunctor(
peer: FluencePeer,
peer: IFluenceClient$$,
arr: string[],
config?: {ttl?: number}
): Promise<string>;
@ -818,69 +947,57 @@ export function streamFunctor(...args: any) {
(seq
(seq
(seq
(seq
(new $array-inline
(seq
(seq
(seq
(new $array-inline
(seq
(ap "123" $array-inline)
(canon %init_peer_id% $array-inline #array-inline-0)
)
)
(ap #array-inline-0 $stream)
)
(ap arr arr_flat)
)
(ap arr_flat arr_flat_to_functor)
(ap "123" $array-inline)
(canon %init_peer_id% $array-inline #array-inline-0)
)
(ap arr_flat_to_functor.length arr_flat_length)
)
(call %init_peer_id% ("math" "sub") [arr_flat_length 1] sub)
)
(new $stream_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [sub 1] stream_incr)
(fold $stream s
(seq
(seq
(ap s $stream_test)
(canon %init_peer_id% $stream_test #stream_iter_canon)
)
(xor
(match #stream_iter_canon.length stream_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $stream_test #stream_result_canon)
)
(ap #stream_result_canon stream_gate)
)
(ap #array-inline-0 $stream)
)
(ap arr arr_to_functor)
)
(ap arr arr_flat-0)
(ap arr_to_functor.length arr_length)
)
(call %init_peer_id% ("math" "sub") [arr_length 1] sub)
)
(new $stream_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [sub 1] stream_incr)
(fold $stream s
(seq
(seq
(ap s $stream_test)
(canon %init_peer_id% $stream_test #stream_iter_canon)
)
(xor
(match #stream_iter_canon.length stream_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $stream_test #stream_result_canon)
)
(ap #stream_result_canon stream_gate)
)
(ap arr_flat-0 arr_flat-0_to_functor)
)
(ap arr_flat-0_to_functor.length arr_flat-0_length)
)
(call %init_peer_id% ("math" "sub") [arr_flat-0_length 1] sub-0)
(ap arr arr_to_functor-0)
)
(ap stream_gate.$.[sub-0]! stream_gate_flat)
(ap arr_to_functor-0.length arr_length-0)
)
(ap stream_gate_flat.$.[0]! stream_gate_flat_flat)
(call %init_peer_id% ("math" "sub") [arr_length-0 1] sub-0)
)
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [stream_gate_flat_flat])
(call %init_peer_id% ("callbackSrv" "response") [stream_gate.$.[sub-0].[0]!])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
@ -936,7 +1053,7 @@ export function getStream(
): Promise<number[]>;
export function getStream(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<number[]>;
@ -1016,7 +1133,7 @@ export function streamJoin(
): Promise<string>;
export function streamJoin(
peer: FluencePeer,
peer: IFluenceClient$$,
arr: string[],
config?: {ttl?: number}
): Promise<string>;
@ -1040,80 +1157,68 @@ export function streamJoin(...args: any) {
(seq
(seq
(seq
(seq
(new $array-inline
(seq
(seq
(seq
(new $array-inline
(seq
(seq
(ap "111" $array-inline)
(ap "222" $array-inline)
)
(canon %init_peer_id% $array-inline #array-inline-0)
)
)
(ap #array-inline-0 $streamJ)
)
(new $array-inline-1
(seq
(seq
(ap "333" $array-inline-1)
(ap "444" $array-inline-1)
)
(canon %init_peer_id% $array-inline-1 #array-inline-1-0)
)
)
(ap "111" $array-inline)
(ap "222" $array-inline)
)
(ap #array-inline-1-0 $streamJ)
(canon %init_peer_id% $array-inline #array-inline-0)
)
(ap arr arr_flat)
)
(ap arr_flat arr_flat_to_functor)
(ap #array-inline-0 $streamJ)
)
(ap arr_flat_to_functor.length arr_flat_length)
)
(new $streamJ_test
(seq
(new $array-inline-1
(seq
(seq
(call %init_peer_id% ("math" "add") [arr_flat_length 1] streamJ_incr)
(fold $streamJ s
(seq
(seq
(ap s $streamJ_test)
(canon %init_peer_id% $streamJ_test #streamJ_iter_canon)
)
(xor
(match #streamJ_iter_canon.length streamJ_incr
(null)
)
(next s)
)
)
(never)
)
(ap "333" $array-inline-1)
(ap "444" $array-inline-1)
)
(canon %init_peer_id% $streamJ_test #streamJ_result_canon)
(canon %init_peer_id% $array-inline-1 #array-inline-1-0)
)
(ap #streamJ_result_canon streamJ_gate)
)
)
(ap #array-inline-1-0 $streamJ)
)
(ap arr arr_flat-0)
(ap arr arr_to_functor)
)
(ap arr_to_functor.length arr_length)
)
(new $streamJ_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [arr_length 1] streamJ_incr)
(fold $streamJ s
(seq
(seq
(ap s $streamJ_test)
(canon %init_peer_id% $streamJ_test #streamJ_iter_canon)
)
(xor
(match #streamJ_iter_canon.length streamJ_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $streamJ_test #streamJ_result_canon)
)
(ap #streamJ_result_canon streamJ_gate)
)
(ap arr_flat-0 arr_flat-0_to_functor)
)
(ap arr_flat-0_to_functor.length arr_flat-0_length)
)
(ap streamJ_gate.$.[arr_flat-0_length]! streamJ_gate_flat)
(ap arr arr_to_functor-0)
)
(ap streamJ_gate_flat.$.[1]! streamJ_gate_flat_flat)
(ap arr_to_functor-0.length arr_length-0)
)
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [streamJ_gate_flat_flat])
(call %init_peer_id% ("callbackSrv" "response") [streamJ_gate.$.[arr_length-0].[1]!])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
@ -1161,3 +1266,5 @@ export function streamJoin(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface TestServiceDef {
}
export function registerTestService(service: TestServiceDef): void;
export function registerTestService(serviceId: string, service: TestServiceDef): void;
export function registerTestService(peer: FluencePeer, service: TestServiceDef): void;
export function registerTestService(peer: FluencePeer, serviceId: string, service: TestServiceDef): void;
export function registerTestService(peer: IFluenceClient$$, service: TestServiceDef): void;
export function registerTestService(peer: IFluenceClient$$, serviceId: string, service: TestServiceDef): void;
export function registerTestService(...args: any) {
@ -73,7 +75,7 @@ export function append_records(
): Promise<void>;
export function append_records(
peer: FluencePeer,
peer: IFluenceClient$$,
peer_: string,
srum: string[][],
config?: {ttl?: number}
@ -155,7 +157,7 @@ export function retrieve_records(
): Promise<string[][]>;
export function retrieve_records(
peer: FluencePeer,
peer: IFluenceClient$$,
peer_: string,
config?: {ttl?: number}
): Promise<string[][]>;
@ -232,3 +234,5 @@ export function retrieve_records(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -25,7 +27,7 @@ export function someFunc(
): Promise<void>;
export function someFunc(
peer: FluencePeer,
peer: IFluenceClient$$,
cb: (arg0: string[], callParams: CallParams$$<'arg0'>) => void | Promise<void>,
config?: {ttl?: number}
): Promise<void>;
@ -95,3 +97,5 @@ export function someFunc(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface Op1Def {
}
export function registerOp1(service: Op1Def): void;
export function registerOp1(serviceId: string, service: Op1Def): void;
export function registerOp1(peer: FluencePeer, service: Op1Def): void;
export function registerOp1(peer: FluencePeer, serviceId: string, service: Op1Def): void;
export function registerOp1(peer: IFluenceClient$$, service: Op1Def): void;
export function registerOp1(peer: IFluenceClient$$, serviceId: string, service: Op1Def): void;
export function registerOp1(...args: any) {
@ -71,7 +73,7 @@ export function accumRes(
): Promise<string | null[]>;
export function accumRes(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string | null[]>;
@ -173,7 +175,7 @@ export function toOpt(
): Promise<string | null>;
export function toOpt(
peer: FluencePeer,
peer: IFluenceClient$$,
s: string,
config?: {ttl?: number}
): Promise<string | null>;
@ -255,7 +257,7 @@ export function returnCanStream(
): Promise<string>;
export function returnCanStream(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string>;
@ -268,41 +270,38 @@ export function returnCanStream(...args: any) {
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(new $status
(seq
(seq
(ap "ok" $status)
(new $status_test
(ap "ok" $status)
(new $status_test
(seq
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] status_incr)
(fold $status s
(call %init_peer_id% ("math" "add") [0 1] status_incr)
(fold $status s
(seq
(seq
(seq
(ap s $status_test)
(canon %init_peer_id% $status_test #status_iter_canon)
)
(xor
(match #status_iter_canon.length status_incr
(null)
)
(next s)
)
(ap s $status_test)
(canon %init_peer_id% $status_test #status_iter_canon)
)
(xor
(match #status_iter_canon.length status_incr
(null)
)
(next s)
)
(never)
)
(never)
)
(canon %init_peer_id% $status_test #status_result_canon)
)
(ap #status_result_canon status_gate)
(canon %init_peer_id% $status_test #status_result_canon)
)
(ap #status_result_canon status_gate)
)
)
(ap status_gate.$.[0]! status_gate_flat)
)
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [status_gate_flat])
(call %init_peer_id% ("callbackSrv" "response") [status_gate.$.[0]!])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
@ -352,7 +351,7 @@ export function bugLNG63_2(
): Promise<BugLNG63_2Result>;
export function bugLNG63_2(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<BugLNG63_2Result>;
@ -369,36 +368,33 @@ export function bugLNG63_2(...args: any) {
(seq
(seq
(seq
(seq
(ap "ok" $status)
(new $status_test
(ap "ok" $status)
(new $status_test
(seq
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] status_incr)
(fold $status s
(call %init_peer_id% ("math" "add") [0 1] status_incr)
(fold $status s
(seq
(seq
(seq
(ap s $status_test)
(canon %init_peer_id% $status_test #status_iter_canon)
)
(xor
(match #status_iter_canon.length status_incr
(null)
)
(next s)
)
(ap s $status_test)
(canon %init_peer_id% $status_test #status_iter_canon)
)
(xor
(match #status_iter_canon.length status_incr
(null)
)
(next s)
)
(never)
)
(never)
)
(canon %init_peer_id% $status_test #status_result_canon)
)
(ap #status_result_canon status_gate)
(canon %init_peer_id% $status_test #status_result_canon)
)
(ap #status_result_canon status_gate)
)
)
(ap status_gate.$.[0]! status_gate_flat)
)
(canon %init_peer_id% $status #-status-fix-0)
)
@ -436,7 +432,7 @@ export function bugLNG63_2(...args: any) {
)
(ap status_gate-0.$.[0]! $array-inline)
)
(ap status_gate_flat $array-inline)
(ap status_gate.$.[0]! $array-inline)
)
(canon %init_peer_id% $array-inline #array-inline-0)
)
@ -514,7 +510,7 @@ export function bugLNG63_2(...args: any) {
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [status_gate_flat -status-flat-0 #array-inline-1-0])
(call %init_peer_id% ("callbackSrv" "response") [status_gate.$.[0]! -status-flat-0 #array-inline-1-0])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
@ -578,7 +574,7 @@ export function bugLNG63(
): Promise<string>;
export function bugLNG63(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<string>;
@ -591,41 +587,38 @@ export function bugLNG63(...args: any) {
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(new $status
(seq
(seq
(ap "ok" $status)
(new $status_test
(ap "ok" $status)
(new $status_test
(seq
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] status_incr)
(fold $status s
(call %init_peer_id% ("math" "add") [0 1] status_incr)
(fold $status s
(seq
(seq
(seq
(ap s $status_test)
(canon %init_peer_id% $status_test #status_iter_canon)
)
(xor
(match #status_iter_canon.length status_incr
(null)
)
(next s)
)
(ap s $status_test)
(canon %init_peer_id% $status_test #status_iter_canon)
)
(xor
(match #status_iter_canon.length status_incr
(null)
)
(next s)
)
(never)
)
(never)
)
(canon %init_peer_id% $status_test #status_result_canon)
)
(ap #status_result_canon status_gate)
(canon %init_peer_id% $status_test #status_result_canon)
)
(ap #status_result_canon status_gate)
)
)
(ap status_gate.$.[0]! status_gate_flat)
)
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [status_gate_flat])
(call %init_peer_id% ("callbackSrv" "response") [status_gate.$.[0]!])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
@ -675,7 +668,7 @@ export function returnMultipleStreamResults(
): Promise<ReturnMultipleStreamResultsResult>;
export function returnMultipleStreamResults(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<ReturnMultipleStreamResultsResult>;
@ -692,36 +685,33 @@ export function returnMultipleStreamResults(...args: any) {
(seq
(seq
(seq
(seq
(ap "ok" $status)
(new $status_test
(ap "ok" $status)
(new $status_test
(seq
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] status_incr)
(fold $status s
(call %init_peer_id% ("math" "add") [0 1] status_incr)
(fold $status s
(seq
(seq
(seq
(ap s $status_test)
(canon %init_peer_id% $status_test #status_iter_canon)
)
(xor
(match #status_iter_canon.length status_incr
(null)
)
(next s)
)
(ap s $status_test)
(canon %init_peer_id% $status_test #status_iter_canon)
)
(xor
(match #status_iter_canon.length status_incr
(null)
)
(next s)
)
(never)
)
(never)
)
(canon %init_peer_id% $status_test #status_result_canon)
)
(ap #status_result_canon status_gate)
(canon %init_peer_id% $status_test #status_result_canon)
)
(ap #status_result_canon status_gate)
)
)
(ap status_gate.$.[0]! status_gate_flat)
)
(canon %init_peer_id% $status #-status-fix-0)
)
@ -759,7 +749,7 @@ export function returnMultipleStreamResults(...args: any) {
)
(ap status_gate-0.$.[0]! $array-inline)
)
(ap status_gate_flat $array-inline)
(ap status_gate.$.[0]! $array-inline)
)
(canon %init_peer_id% $array-inline #array-inline-0)
)
@ -837,7 +827,7 @@ export function returnMultipleStreamResults(...args: any) {
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [status_gate_flat -status-flat-0 #array-inline-0 #array-inline-1-0])
(call %init_peer_id% ("callbackSrv" "response") [status_gate.$.[0]! -status-flat-0 #array-inline-0 #array-inline-1-0])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
@ -908,7 +898,7 @@ export function bugLNG63_3(
): Promise<BugLNG63_3Result>;
export function bugLNG63_3(
peer: FluencePeer,
peer: IFluenceClient$$,
config?: {ttl?: number}
): Promise<BugLNG63_3Result>;
@ -927,23 +917,61 @@ export function bugLNG63_3(...args: any) {
(seq
(seq
(seq
(seq
(ap "ok" $status)
(new $status_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] status_incr)
(fold $status s
(seq
(seq
(ap s $status_test)
(canon %init_peer_id% $status_test #status_iter_canon)
)
(xor
(match #status_iter_canon.length status_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $status_test #status_result_canon)
)
(ap #status_result_canon status_gate)
)
)
)
(ap 2 $num)
)
(new $array-inline
(seq
(seq
(seq
(ap "ok" $status)
(new $status_test
(seq
(seq
(canon %init_peer_id% $status #status_canon)
(call %init_peer_id% ("op" "array_length") [#status_canon] array_length)
)
(ap array_length $array-inline)
)
(new $num_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] status_incr)
(fold $status s
(call %init_peer_id% ("math" "add") [0 1] num_incr)
(fold $num s
(seq
(seq
(ap s $status_test)
(canon %init_peer_id% $status_test #status_iter_canon)
(ap s $num_test)
(canon %init_peer_id% $num_test #num_iter_canon)
)
(xor
(match #status_iter_canon.length status_incr
(match #num_iter_canon.length num_incr
(null)
)
(next s)
@ -952,88 +980,44 @@ export function bugLNG63_3(...args: any) {
(never)
)
)
(canon %init_peer_id% $status_test #status_result_canon)
(canon %init_peer_id% $num_test #num_result_canon)
)
(ap #status_result_canon status_gate)
(ap #num_result_canon num_gate)
)
)
)
(ap status_gate.$.[0]! status_gate_flat)
(ap num_gate.$.[0]! $array-inline)
)
(ap 2 $num)
)
(new $array-inline
(seq
(seq
(seq
(seq
(seq
(canon %init_peer_id% $status #status_canon)
(call %init_peer_id% ("op" "array_length") [#status_canon] array_length)
)
(ap array_length $array-inline)
)
(new $num_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] num_incr)
(fold $num s
(seq
(seq
(ap s $num_test)
(canon %init_peer_id% $num_test #num_iter_canon)
)
(xor
(match #num_iter_canon.length num_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $num_test #num_result_canon)
)
(ap #num_result_canon num_gate)
)
)
)
(ap num_gate.$.[0]! $array-inline)
)
(canon %init_peer_id% $array-inline #array-inline-0)
)
)
)
(new $status_test-0
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] status_incr-0)
(fold $status s
(seq
(seq
(ap s $status_test-0)
(canon %init_peer_id% $status_test-0 #status_iter_canon-0)
)
(xor
(match #status_iter_canon-0.length status_incr-0
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $status_test-0 #status_result_canon-0)
)
(ap #status_result_canon-0 status_gate-0)
(canon %init_peer_id% $array-inline #array-inline-0)
)
)
)
(ap status_gate-0.$.[0]! status_gate-0_flat)
(new $status_test-0
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] status_incr-0)
(fold $status s
(seq
(seq
(ap s $status_test-0)
(canon %init_peer_id% $status_test-0 #status_iter_canon-0)
)
(xor
(match #status_iter_canon-0.length status_incr-0
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $status_test-0 #status_result_canon-0)
)
(ap #status_result_canon-0 status_gate-0)
)
)
)
(canon %init_peer_id% $status #status_canon-0)
)
@ -1090,7 +1074,7 @@ export function bugLNG63_3(...args: any) {
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [status_gate-0_flat array_length-0 #array-inline-1-0])
(call %init_peer_id% ("callbackSrv" "response") [status_gate-0.$.[0]! array_length-0 #array-inline-1-0])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
@ -1143,3 +1127,5 @@ export function bugLNG63_3(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -25,7 +27,7 @@ export function streamFold(
): Promise<string[]>;
export function streamFold(
peer: FluencePeer,
peer: IFluenceClient$$,
arr: string[],
config?: {ttl?: number}
): Promise<string[]>;
@ -116,7 +118,7 @@ export function streamRes(
): Promise<StreamResResult>;
export function streamRes(
peer: FluencePeer,
peer: IFluenceClient$$,
arr: string[],
config?: {ttl?: number}
): Promise<StreamResResult>;
@ -213,3 +215,5 @@ export function streamRes(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface DTGetterDef {
}
export function registerDTGetter(service: DTGetterDef): void;
export function registerDTGetter(serviceId: string, service: DTGetterDef): void;
export function registerDTGetter(peer: FluencePeer, service: DTGetterDef): void;
export function registerDTGetter(peer: FluencePeer, serviceId: string, service: DTGetterDef): void;
export function registerDTGetter(peer: IFluenceClient$$, service: DTGetterDef): void;
export function registerDTGetter(peer: IFluenceClient$$, serviceId: string, service: DTGetterDef): void;
export function registerDTGetter(...args: any) {
@ -75,7 +77,7 @@ export function use_name1(
): Promise<string>;
export function use_name1(
peer: FluencePeer,
peer: IFluenceClient$$,
name: string,
config?: {ttl?: number}
): Promise<string>;
@ -150,7 +152,7 @@ export function use_name2(
): Promise<string[]>;
export function use_name2(
peer: FluencePeer,
peer: IFluenceClient$$,
name: string,
config?: {ttl?: number}
): Promise<string[]>;
@ -248,3 +250,5 @@ export function use_name2(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface ConcatSubsDef {
}
export function registerConcatSubs(service: ConcatSubsDef): void;
export function registerConcatSubs(serviceId: string, service: ConcatSubsDef): void;
export function registerConcatSubs(peer: FluencePeer, service: ConcatSubsDef): void;
export function registerConcatSubs(peer: FluencePeer, serviceId: string, service: ConcatSubsDef): void;
export function registerConcatSubs(peer: IFluenceClient$$, service: ConcatSubsDef): void;
export function registerConcatSubs(peer: IFluenceClient$$, serviceId: string, service: ConcatSubsDef): void;
export function registerConcatSubs(...args: any) {
@ -93,7 +95,7 @@ export function subImportUsage(
): Promise<SubImportUsageResult>;
export function subImportUsage(
peer: FluencePeer,
peer: IFluenceClient$$,
s: string,
config?: {ttl?: number}
): Promise<SubImportUsageResult>;
@ -172,3 +174,5 @@ export function subImportUsage(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface IOpDef {
}
export function registerIOp(service: IOpDef): void;
export function registerIOp(serviceId: string, service: IOpDef): void;
export function registerIOp(peer: FluencePeer, service: IOpDef): void;
export function registerIOp(peer: FluencePeer, serviceId: string, service: IOpDef): void;
export function registerIOp(peer: IFluenceClient$$, service: IOpDef): void;
export function registerIOp(peer: IFluenceClient$$, serviceId: string, service: IOpDef): void;
export function registerIOp(...args: any) {
@ -67,8 +69,8 @@ export interface OpopDef {
}
export function registerOpop(service: OpopDef): void;
export function registerOpop(serviceId: string, service: OpopDef): void;
export function registerOpop(peer: FluencePeer, service: OpopDef): void;
export function registerOpop(peer: FluencePeer, serviceId: string, service: OpopDef): void;
export function registerOpop(peer: IFluenceClient$$, service: OpopDef): void;
export function registerOpop(peer: IFluenceClient$$, serviceId: string, service: OpopDef): void;
export function registerOpop(...args: any) {
@ -113,8 +115,8 @@ export interface TestoDef {
}
export function registerTesto(service: TestoDef): void;
export function registerTesto(serviceId: string, service: TestoDef): void;
export function registerTesto(peer: FluencePeer, service: TestoDef): void;
export function registerTesto(peer: FluencePeer, serviceId: string, service: TestoDef): void;
export function registerTesto(peer: IFluenceClient$$, service: TestoDef): void;
export function registerTesto(peer: IFluenceClient$$, serviceId: string, service: TestoDef): void;
export function registerTesto(...args: any) {
@ -159,8 +161,8 @@ export interface LocalPrintDef {
}
export function registerLocalPrint(service: LocalPrintDef): void;
export function registerLocalPrint(serviceId: string, service: LocalPrintDef): void;
export function registerLocalPrint(peer: FluencePeer, service: LocalPrintDef): void;
export function registerLocalPrint(peer: FluencePeer, serviceId: string, service: LocalPrintDef): void;
export function registerLocalPrint(peer: IFluenceClient$$, service: LocalPrintDef): void;
export function registerLocalPrint(peer: IFluenceClient$$, serviceId: string, service: LocalPrintDef): void;
export function registerLocalPrint(...args: any) {
@ -201,7 +203,7 @@ export function topologyBug427(
): Promise<string[]>;
export function topologyBug427(
peer: FluencePeer,
peer: IFluenceClient$$,
peers: string[],
config?: {ttl?: number}
): Promise<string[]>;
@ -340,7 +342,7 @@ export function topologyBug205(
): Promise<string[]>;
export function topologyBug205(
peer: FluencePeer,
peer: IFluenceClient$$,
node_id: string,
n2: string | null,
config?: {ttl?: number}
@ -482,7 +484,7 @@ export function topologyTest(
): Promise<string>;
export function topologyTest(
peer: FluencePeer,
peer: IFluenceClient$$,
me: string,
myRelay: string,
friend: string,
@ -607,7 +609,7 @@ export function topologyBug394(
): Promise<string>;
export function topologyBug394(
peer: FluencePeer,
peer: IFluenceClient$$,
peer_: string,
peer2: string,
peer3: string,
@ -719,3 +721,5 @@ export function topologyBug394(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface UnexistedDef {
}
export function registerUnexisted(service: UnexistedDef): void;
export function registerUnexisted(serviceId: string, service: UnexistedDef): void;
export function registerUnexisted(peer: FluencePeer, service: UnexistedDef): void;
export function registerUnexisted(peer: FluencePeer, serviceId: string, service: UnexistedDef): void;
export function registerUnexisted(peer: IFluenceClient$$, service: UnexistedDef): void;
export function registerUnexisted(peer: IFluenceClient$$, serviceId: string, service: UnexistedDef): void;
export function registerUnexisted(...args: any) {
@ -61,8 +63,8 @@ export interface OpADef {
}
export function registerOpA(service: OpADef): void;
export function registerOpA(serviceId: string, service: OpADef): void;
export function registerOpA(peer: FluencePeer, service: OpADef): void;
export function registerOpA(peer: FluencePeer, serviceId: string, service: OpADef): void;
export function registerOpA(peer: IFluenceClient$$, service: OpADef): void;
export function registerOpA(peer: IFluenceClient$$, serviceId: string, service: OpADef): void;
export function registerOpA(...args: any) {
@ -109,7 +111,7 @@ export function tryCatchTest(
): Promise<string[]>;
export function tryCatchTest(
peer: FluencePeer,
peer: IFluenceClient$$,
node_id: string,
config?: {ttl?: number}
): Promise<string[]>;
@ -204,3 +206,5 @@ export function tryCatchTest(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -21,8 +23,8 @@ export interface UnexistedDef {
}
export function registerUnexisted(service: UnexistedDef): void;
export function registerUnexisted(serviceId: string, service: UnexistedDef): void;
export function registerUnexisted(peer: FluencePeer, service: UnexistedDef): void;
export function registerUnexisted(peer: FluencePeer, serviceId: string, service: UnexistedDef): void;
export function registerUnexisted(peer: IFluenceClient$$, service: UnexistedDef): void;
export function registerUnexisted(peer: IFluenceClient$$, serviceId: string, service: UnexistedDef): void;
export function registerUnexisted(...args: any) {
@ -61,8 +63,8 @@ export interface OpEDef {
}
export function registerOpE(service: OpEDef): void;
export function registerOpE(serviceId: string, service: OpEDef): void;
export function registerOpE(peer: FluencePeer, service: OpEDef): void;
export function registerOpE(peer: FluencePeer, serviceId: string, service: OpEDef): void;
export function registerOpE(peer: IFluenceClient$$, service: OpEDef): void;
export function registerOpE(peer: IFluenceClient$$, serviceId: string, service: OpEDef): void;
export function registerOpE(...args: any) {
@ -109,7 +111,7 @@ export function tryOtherwiseTest(
): Promise<string>;
export function tryOtherwiseTest(
peer: FluencePeer,
peer: IFluenceClient$$,
node_id: string,
config?: {ttl?: number}
): Promise<string>;
@ -127,55 +129,52 @@ export function tryOtherwiseTest(...args: any) {
(new $f
(seq
(seq
(seq
(call -relay- ("op" "noop") [])
(call -relay- ("op" "noop") [])
(xor
(xor
(xor
(seq
(call node_id ("unex" "getStr") [] $f)
(call -relay- ("op" "noop") [])
)
(seq
(call node_id ("op" "identity") ["error"] $f)
(call -relay- ("op" "noop") [])
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(new $f_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] f_incr)
(fold $f s
(seq
(seq
(ap s $f_test)
(canon %init_peer_id% $f_test #f_iter_canon)
)
(xor
(match #f_iter_canon.length f_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $f_test #f_result_canon)
(call node_id ("unex" "getStr") [] $f)
(call -relay- ("op" "noop") [])
)
(seq
(call node_id ("op" "identity") ["error"] $f)
(call -relay- ("op" "noop") [])
)
(ap #f_result_canon f_gate)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
(new $f_test
(seq
(seq
(seq
(call %init_peer_id% ("math" "add") [0 1] f_incr)
(fold $f s
(seq
(seq
(ap s $f_test)
(canon %init_peer_id% $f_test #f_iter_canon)
)
(xor
(match #f_iter_canon.length f_incr
(null)
)
(next s)
)
)
(never)
)
)
(canon %init_peer_id% $f_test #f_result_canon)
)
(ap #f_result_canon f_gate)
)
)
(ap f_gate.$.[0]! f_gate_flat)
)
)
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [f_gate_flat])
(call %init_peer_id% ("callbackSrv" "response") [f_gate.$.[0]!])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
)
@ -220,3 +219,5 @@ export function tryOtherwiseTest(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -1,17 +1,19 @@
/* eslint-disable */
// @ts-nocheck
/**
*
* 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.9.1
* Aqua version: 0.9.4
*
*/
import { FluencePeer } from '@fluencelabs/fluence';
import type { CallParams$$ } from '@fluencelabs/fluence/dist/internal/compilerSupport/v4'
import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';
import {
callFunction$$,
registerService$$,
} from '@fluencelabs/fluence/dist/internal/compilerSupport/v4';
v5_callFunction as callFunction$$,
v5_registerService as registerService$$,
} from '@fluencelabs/js-client.api';
// Services
@ -26,7 +28,7 @@ export function viaArr(
): Promise<ViaArrResult>;
export function viaArr(
peer: FluencePeer,
peer: IFluenceClient$$,
node_id: string,
viaAr: string[],
config?: {ttl?: number}
@ -163,7 +165,7 @@ export function viaStream(
): Promise<ViaStreamResult>;
export function viaStream(
peer: FluencePeer,
peer: IFluenceClient$$,
node_id: string,
viaStr: string[],
config?: {ttl?: number}
@ -312,7 +314,7 @@ export function viaOpt(
): Promise<ViaOptResult>;
export function viaOpt(
peer: FluencePeer,
peer: IFluenceClient$$,
relay: string,
node_id: string,
viaOpt: string | null,
@ -447,3 +449,5 @@ export function viaOpt(...args: any) {
script
)
}
/* eslint-enable */

View File

@ -3,8 +3,7 @@ import {
stage,
testNet,
} from "@fluencelabs/fluence-network-environment";
import { local } from "./local-nodes";
import { defaultConfig } from "@fluencelabs/fluence/dist/internal/ephemeral";
import { local } from "./local-nodes.js";
declare global {
namespace NodeJS {
@ -21,7 +20,7 @@ function setConfig(env) {
case "testnet":
return { config: testNetConfig, isEphemeral: false };
case "ephemeral":
return { config: ephemeralConfig, isEphemeral: true };
return { config: null, isEphemeral: true };
case "local":
return { config: localConfig, isEphemeral: false };
default:
@ -71,16 +70,16 @@ export const testNetConfig = {
"Local service error, ret_code is 1, error message is '\"Service with id 'unex' not found (function getStr)\"'",
};
export const ephemeralConfig = {
relays: defaultConfig.peers.map((x) => ({
peerId: x.peerId,
multiaddr: "dontcare",
})),
externalAddressesRelay1: [],
externalAddressesRelay2: [],
tryCatchError:
"Local service error, ret_code is 1, error message is '\"Service with id 'unex' not found (function getStr)\"'",
};
// export const ephemeralConfig = {
// relays: defaultConfig.peers.map((x) => ({
// peerId: x.peerId,
// multiaddr: "dontcare",
// })),
// externalAddressesRelay1: [],
// externalAddressesRelay2: [],
// tryCatchError:
// "Local service error, ret_code is 1, error message is '\"Service with id 'unex' not found (function getStr)\"'",
// };
export const localConfig = {
relays: local,
@ -100,4 +99,4 @@ export const localConfig = {
"Local service error, ret_code is 1, error message is '\"Service with id 'unex' not found (function getStr)\"'",
};
export const { config, isEphemeral } = setConfig("local");
export const { config, isEphemeral } = setConfig("krasnodar");

View File

@ -1,5 +1,4 @@
import { FluencePeer } from '@fluencelabs/fluence';
import { doSmth } from '../compiled/examples/assignment';
import { doSmth } from '../compiled/examples/assignment.js';
export async function assignmentCall(): Promise<string[]> {
return await doSmth({ value: 'abc' }, { ttl: 6000 });

View File

@ -1,11 +1,11 @@
import { Fluence } from '@fluencelabs/fluence';
import {passFunctionAsArg, reproArgsBug426} from '../compiled/examples/callArrow';
import {passFunctionAsArg, reproArgsBug426} from '../compiled/examples/callArrow.js';
export async function callArrowCall(): Promise<string> {
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
export async function callArrowCall(relayPeerId: string): Promise<string> {
return new Promise<string>((resolve, reject) => {
passFunctionAsArg(relayPeerId, 'callArrow call', (a: string) => {
let result = 'Hello, ' + a + '!';
console.log(result)
resolve(result);
return result;
}, {ttl: 10000});

View File

@ -1,4 +1,4 @@
import {bugLng79, registerSer} from "../compiled/examples/canon";
import {bugLng79, registerSer} from "../compiled/examples/canon.js";
export async function bugLng79Call(pid: string, relay: string): Promise<number> {
registerSer({

View File

@ -6,21 +6,23 @@ import {
registerLocalSrv,
closureOut2,
lng58Bug
} from '../compiled/examples/closures';
import { config } from '../config'
} from '../compiled/examples/closures.js';
import { config } from '../config.js'
const relays = config.relays
export async function closuresCall(): Promise<[string, string[], string[], [string, string]]> {
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
const selfPeerId = Fluence.getPeer().getStatus().peerId;
registerLocalSrv({inside: () => console.log("call inside")})
const resIn = await closureIn(relays[4].peerId, {ttl: 15000})
const resOut = await closureOut(relays[5].peerId, {ttl: 15000})
const resOut2 = await closureOut2(relays[5].peerId, {ttl: 15000})
const resBig = await closureBig(relays[4].peerId, relays[5].peerId, {ttl: 15000})
console.log("closurein")
const resIn = await closureIn(relays[4].peerId, {ttl: 25000})
console.log("closureout")
const resOut = await closureOut(relays[5].peerId, {ttl: 25000})
console.log("closureout2")
const resOut2 = await closureOut2(relays[5].peerId, {ttl: 25000})
console.log("closurebig")
const resBig = await closureBig(relays[4].peerId, relays[5].peerId, {ttl: 25000})
return [resIn, resOut.external_addresses, resOut2.external_addresses, resBig]
}

View File

@ -1,10 +1,9 @@
import { Fluence } from '@fluencelabs/fluence';
import { parFunc } from '../compiled/examples/par';
import { registerCoService } from '../compiled/examples/co';
import { parFunc } from '../compiled/examples/par.js';
import { registerCoService } from '../compiled/examples/co.js';
import {relay1} from "../__test__/examples.spec.js";
export async function coCall(): Promise<string[]> {
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
registerCoService({
call: () => {
return 'hello';
@ -12,7 +11,7 @@ export async function coCall(): Promise<string[]> {
});
return new Promise<string[]>((resolve, reject) => {
parFunc(relayPeerId, (c) => {
parFunc(relay1.peerId, (c) => {
resolve(c.external_addresses);
}, {ttl: 15000});
});

View File

@ -4,7 +4,7 @@ import {
optionSugar,
registerGetArr,
streamSugar
} from "../compiled/examples/collectionSugar";
} from "../compiled/examples/collectionSugar.js";
export async function arraySugarCall(): Promise<[number[], number[]]> {
return await arraySugar(3, 6)

View File

@ -1,9 +1,7 @@
import { Fluence } from '@fluencelabs/fluence';
import { doStuff, registerTestS } from '../compiled/examples/complex';
import { doStuff, registerTestS } from '../compiled/examples/complex.js';
export async function complexCall() {
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
const selfPeerId = Fluence.getPeer().getStatus().peerId;
export async function complexCall(selfPeerId: string, relayPeerId: string) {
registerTestS({
t: (arg0) => {

View File

@ -1,4 +1,4 @@
import {callConstant, registerGetter, timestampAndTtl} from '../compiled/examples/constants';
import {callConstant, registerGetter, timestampAndTtl} from '../compiled/examples/constants.js';
export async function constantsCall(): Promise<string[]> {
registerGetter({

View File

@ -1,5 +1,5 @@
import { FluencePeer } from '@fluencelabs/fluence';
import { getAliasedData, registerNodeIdGetter } from '../compiled/examples/dataAlias';
import { getAliasedData, registerNodeIdGetter } from '../compiled/examples/dataAlias.js';
export async function dataAliasCall() {
registerNodeIdGetter({

View File

@ -1,6 +1,6 @@
import { concat_foobars, registerStringService } from '../compiled/examples/imports_exports/imports';
import { registerMyExportSrv } from '../compiled/examples/imports_exports/exports';
import { registerSuperFoo } from '../compiled/examples/imports_exports/declare';
import { concat_foobars, registerStringService } from '../compiled/examples/imports_exports/imports.js';
import { registerMyExportSrv } from '../compiled/examples/imports_exports/exports.js';
import { registerSuperFoo } from '../compiled/examples/imports_exports/declare.js';
export async function declareCall() {
registerSuperFoo({

View File

@ -1,9 +1,7 @@
import { Fluence } from '@fluencelabs/fluence';
import {forBug499, iterateAndPrint, iterateAndPrintParallel} from '../compiled/examples/fold';
export async function foldCall() {
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
import {forBug499, iterateAndPrint, iterateAndPrintParallel} from '../compiled/examples/fold.js';
export async function foldCall(relayPeerId: string) {
await iterateAndPrint([relayPeerId], {ttl: 10000});
return new Promise<string[]>((resolve, reject) => {

View File

@ -1,7 +1,6 @@
import { Fluence } from '@fluencelabs/fluence';
import { getTwoResults } from '../compiled/examples/foldJoin';
import { getTwoResults } from '../compiled/examples/foldJoin.js';
export async function foldJoinCall(): Promise<number[]> {
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
export async function foldJoinCall(relayPeerId: string): Promise<number[]> {
return await getTwoResults(relayPeerId, {ttl: 16000});
}

View File

@ -1,4 +1,4 @@
import { testFunc, registerTestSrv } from '../compiled/examples/func';
import { testFunc, registerTestSrv } from '../compiled/examples/func.js';
export async function funcCall() {
registerTestSrv({

View File

@ -1,4 +1,4 @@
import {main, registerA, calc, calc2, ifCalc} from '../compiled/examples/funcs';
import {main, registerA, calc, calc2, ifCalc} from '../compiled/examples/funcs.js';
export async function funcsCall() {

View File

@ -1,5 +1,4 @@
import { FluencePeer } from '@fluencelabs/fluence';
import { helloWorld, registerStringExtra } from '../compiled/examples/helloWorld';
import { helloWorld, registerStringExtra } from '../compiled/examples/helloWorld.js';
export async function helloWorldCall() {
// helloWorld.aqua

View File

@ -1,4 +1,4 @@
import {bugLNG69, ifCorrectXorWrap, ifElseCall, ifElseNumCall} from '../compiled/examples/if';
import {bugLNG69, ifCorrectXorWrap, ifElseCall, ifElseNumCall} from '../compiled/examples/if.js';
export async function ifCall() {
await ifElseCall(false);

View File

@ -1,5 +1,5 @@
import { registerOneMore } from '../compiled/examples/imports_exports/gen/OneMore';
import { barfoo, wrap } from '../compiled/examples/imports_exports/import2';
import { registerOneMore } from '../compiled/examples/imports_exports/gen/OneMore.js';
import { barfoo, wrap } from '../compiled/examples/imports_exports/import2.js';
export async function import2Call() {
registerOneMore('hello', {

View File

@ -1,26 +1,23 @@
import {Fluence, FluencePeer} from '@fluencelabs/fluence';
import {joinIdx, joinIdxLocal, joinIdxRelay} from "../compiled/examples/join";
import { config } from '../config';
import {Fluence} from '@fluencelabs/fluence';
import {joinIdx, joinIdxLocal, joinIdxRelay} from "../compiled/examples/join.js";
import { config } from '../config.js';
const relays = config.relays
export async function joinIdxCall() {
export async function joinIdxCall(relayPeerId: string) {
// join.aqua
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
return await joinIdx(1, [relayPeerId, relays[2].peerId, relays[4].peerId, relays[5].peerId], {ttl: 16000});
}
export async function joinIdxLocalCall() {
export async function joinIdxLocalCall(relayPeerId: string) {
// join.aqua
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
return await joinIdxLocal(2, [relayPeerId, relays[2].peerId, relays[4].peerId]);
}
export async function joinIdxRelayCall() {
export async function joinIdxRelayCall(relayPeerId: string) {
// join.aqua
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
return await joinIdxRelay(2, [relayPeerId, relays[2].peerId, relays[4].peerId]);
}

View File

@ -1,4 +1,4 @@
import {test1, test2} from '../compiled/examples/math';
import {test1, test2} from '../compiled/examples/math.js';
export async function mathTest1Call(): Promise<number> {
return await test1();

View File

@ -1,4 +1,4 @@
import { multiReturnFunc, registerGetStr, registerGetNum } from '../compiled/examples/multiReturn';
import { multiReturnFunc, registerGetStr, registerGetNum } from '../compiled/examples/multiReturn.js';
export async function multiReturnCall(): Promise<[string[], number, string, number[], string | null, number]> {
registerGetStr({

View File

@ -1,5 +1,4 @@
import { FluencePeer } from '@fluencelabs/fluence';
import {test, registerTest, TestResult} from '../compiled/examples/nestedData';
import {test, registerTest, TestResult} from '../compiled/examples/nestedData.js';
export async function nestedDataCall(): Promise<TestResult> {
let nested = {

View File

@ -1,5 +1,4 @@
import { FluencePeer } from '@fluencelabs/fluence';
import { d, registerOpH } from '../compiled/examples/nestedFuncs';
import { d, registerOpH } from '../compiled/examples/nestedFuncs.js';
export async function nestedFuncsCall(): Promise<string> {
registerOpH({

View File

@ -1,6 +1,4 @@
// import {getObj, GetObjResult} from "../compiled/examples/object";
import {getObj, getObjAssign, getObjRelay} from "../compiled/examples/object";
import {getObj, getObjAssign, getObjRelay} from "../compiled/examples/object.js";
export async function getObjCall() {
return await getObj();

View File

@ -1,7 +1,6 @@
import { Fluence } from '@fluencelabs/fluence';
import { getPeerExternalAddresses } from '../compiled/examples/on';
import { getPeerExternalAddresses } from '../compiled/examples/on.js';
export async function onCall(): Promise<string[]> {
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
export async function onCall(relayPeerId: string): Promise<string[]> {
return await getPeerExternalAddresses(relayPeerId);
}

View File

@ -1,4 +1,4 @@
import {checkEmpty, checkNoneEmpty, emptyString, registerOptionString} from "../compiled/examples/options/option_gen";
import {checkEmpty, checkNoneEmpty, emptyString, registerOptionString} from "../compiled/examples/options/option_gen.js";
export async function genOptions(): Promise<[string, string]> {
registerOptionString({

View File

@ -1,10 +1,8 @@
import { Fluence } from '@fluencelabs/fluence';
import {parFunc, registerParService, testTimeout} from '../compiled/examples/par';
import {config} from "../config";
export async function parCall() {
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
import {parFunc, registerParService, testTimeout} from '../compiled/examples/par.js';
import {config} from "../config.js";
export async function parCall(relayPeerId: string) {
let promise = new Promise<string>((resolve, reject) => {
registerParService({
call: () => {

View File

@ -1,5 +1,5 @@
import { Fluence } from '@fluencelabs/fluence';
import {bugLNG60, create_client_util, registerAquaDHT} from '../compiled/examples/passArgs';
import {bugLNG60, create_client_util, registerAquaDHT} from '../compiled/examples/passArgs.js';
export async function passArgsCall() {
registerAquaDHT({
@ -11,6 +11,6 @@ export async function passArgsCall() {
return await create_client_util('sid');
}
export async function bugLNG60Call(): Promise<boolean> {
return bugLNG60(Fluence.getPeer().getStatus().relayPeerId, {ttl: 10000})
export async function bugLNG60Call(relayPeerId: string): Promise<boolean> {
return bugLNG60(relayPeerId, {ttl: 10000})
}

View File

@ -1,5 +1,4 @@
import { FluencePeer } from '@fluencelabs/fluence';
import { get_results, registerOpA } from '../compiled/examples/pushToStream';
import { get_results, registerOpA } from '../compiled/examples/pushToStream.js';
export async function pushToStreamCall() {
registerOpA({

View File

@ -1,4 +1,4 @@
import {recursiveStream, registerYesNoService} from "../compiled/examples/recursiveStreams";
import {recursiveStream, registerYesNoService} from "../compiled/examples/recursiveStreams.js";
export async function recursiveStreamsCall(): Promise<[string[], string[]]> {
let i = 0;

View File

@ -1,5 +1,4 @@
import { FluencePeer } from '@fluencelabs/fluence';
import { returnLiteral } from '../compiled/examples/returnLiteral';
import { returnLiteral } from '../compiled/examples/returnLiteral.js';
export async function literalCall() {
return returnLiteral();

View File

@ -1,5 +1,4 @@
import { FluencePeer } from '@fluencelabs/fluence';
import { retrieve_records, registerTestService } from '../compiled/examples/streamArgs';
import { retrieve_records, registerTestService } from '../compiled/examples/streamArgs.js';
export async function streamArgsCall() {
registerTestService({

View File

@ -1,4 +1,3 @@
import { FluencePeer } from '@fluencelabs/fluence';
import {
checkStreams,
registerStringer, returnNilLength, returnNilLiteral,
@ -6,7 +5,7 @@ import {
streamFunctor, streamIntFunctor, streamJoin,
stringNil,
stringNone
} from '../compiled/examples/stream';
} from '../compiled/examples/stream.js';
export async function streamCall() {
registerStringer({

View File

@ -1,4 +1,4 @@
import {someFunc} from "../compiled/examples/streamCallback";
import {someFunc} from "../compiled/examples/streamCallback.js";
export async function streamCallbackCall(): Promise<string[]> {
return new Promise<string[]>((resolve, reject) => {

View File

@ -1,4 +1,4 @@
import {accumRes, bugLNG63, bugLNG63_2, bugLNG63_3} from "../compiled/examples/streamCan";
import {accumRes, bugLNG63, bugLNG63_2, bugLNG63_3} from "../compiled/examples/streamCan.js";
export async function streamCanCall() {
return await accumRes();

View File

@ -1,5 +1,4 @@
import { FluencePeer } from '@fluencelabs/fluence';
import { streamRes } from '../compiled/examples/streamRestriction';
import { streamRes } from '../compiled/examples/streamRestriction.js';
export async function streamResCall(): Promise<any> {
return await streamRes(["a", "b", "c"]);

View File

@ -1,5 +1,4 @@
import { FluencePeer } from '@fluencelabs/fluence';
import { use_name2, registerDTGetter } from '../compiled/examples/streamResults';
import { use_name2, registerDTGetter } from '../compiled/examples/streamResults.js';
export async function streamResultsCall() {
registerDTGetter({

View File

@ -1,5 +1,5 @@
import { registerSubService } from '../compiled/examples/imports_exports/subImport';
import { registerConcatSubs, subImportUsage } from '../compiled/examples/subImportUsage';
import { registerSubService } from '../compiled/examples/imports_exports/subImport.js';
import { registerConcatSubs, subImportUsage } from '../compiled/examples/subImportUsage.js';
export async function subImportCall() {
// helloWorld.aqua

View File

@ -1,46 +1,30 @@
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
import { IFluenceClient } from '@fluencelabs/js-client.api';
import {
topologyTest,
registerTesto,
registerLocalPrint,
topologyBug205,
topologyBug394, topologyBug427
} from '../compiled/examples/topology';
} from '../compiled/examples/topology.js';
export async function topologyBug394Call(peer2: FluencePeer): Promise<string> {
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
const selfPeerId = Fluence.getPeer().getStatus().peerId;
const relayPeerId2 = peer2.getStatus().relayPeerId;
const selfPeerId2 = peer2.getStatus().peerId;
return topologyBug394(relayPeerId, selfPeerId2, relayPeerId2)
export async function topologyBug394Call(peer1: string, relay1: string, peer2: string, relay2: string): Promise<string> {
return topologyBug394(relay1, peer2, relay2)
}
export async function topologyBug205Call(peer2: FluencePeer): Promise<string[]> {
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
const selfPeerId = Fluence.getPeer().getStatus().peerId;
const relayPeerId2 = peer2.getStatus().relayPeerId;
const selfPeerId2 = peer2.getStatus().peerId;
return topologyBug205(relayPeerId, relayPeerId2)
export async function topologyBug205Call(relay1: string, relay2: string): Promise<string[]> {
return topologyBug205(relay1, relay2)
}
export async function topologyBug427Call(peer2: FluencePeer): Promise<string[]> {
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
const relayPeerId2 = peer2.getStatus().relayPeerId;
return topologyBug427([relayPeerId, relayPeerId2])
export async function topologyBug427Call(relay1: string, relay2: string): Promise<string[]> {
return topologyBug427([relay1, relay2])
}
export async function topologyCall(peer2: FluencePeer): Promise<string> {
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
const selfPeerId = Fluence.getPeer().getStatus().peerId;
export async function topologyCall(peer1: IFluenceClient, relay1: string, peer2: IFluenceClient, relay2: string): Promise<string> {
const relayPeerId = relay1;
const selfPeerId = peer1.getPeerId();
const relayPeerId2 = peer2.getStatus().relayPeerId;
const selfPeerId2 = peer2.getStatus().peerId;
const relayPeerId2 = relay2;
const selfPeerId2 = peer2.getPeerId();
registerTesto(peer2, {
getString: (args0) => {

View File

@ -1,7 +1,6 @@
import { Fluence } from '@fluencelabs/fluence';
import { tryCatchTest } from '../compiled/examples/tryCatch';
import { tryCatchTest } from '../compiled/examples/tryCatch.js';
export async function tryCatchCall(): Promise<string[]> {
const relayPeerId = Fluence.getPeer().getStatus().relayPeerId;
export async function tryCatchCall(relayPeerId: string): Promise<string[]> {
return await tryCatchTest(relayPeerId, {ttl: 15000});
}

Some files were not shown because too many files have changed in this diff Show More