feat(js-client)!: Move to new js-client interface (#855)

* js-client.api -> js.client

* fix types

* Update js-client

* Remove redundant connect

* Set latest js-client
This commit is contained in:
Akim 2023-08-25 15:39:10 +07:00 committed by GitHub
parent 2a0b207633
commit 0f9ede09fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 370 additions and 26707 deletions

View File

@ -102,8 +102,7 @@ jobs:
with:
dependencies: |
{
"@fluencelabs/js-client.node": "${{ fromJson(inputs.js-client-snapshots)['js-client.node'] }}",
"@fluencelabs/js-client.api": "${{ fromJson(inputs.js-client-snapshots)['js-client.api'] }}"
"@fluencelabs/js-client": "${{ fromJson(inputs.js-client-snapshots)['js-client'] }}"
}
- run: pnpm install --no-frozen-lockfile

View File

@ -21,13 +21,13 @@ object Header {
val callParams =
if (isJs) ""
else
"import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client.api';"
"import type { IFluenceClient as IFluenceClient$$, CallParams as CallParams$$ } from '@fluencelabs/js-client';"
s"""$callParams
|import {
| v5_callFunction as callFunction$$$$,
| v5_registerService as registerService$$$$,
|} from '@fluencelabs/js-client.api';
|} from '@fluencelabs/js-client';
""".stripMargin
}

File diff suppressed because it is too large Load Diff

View File

@ -41,8 +41,7 @@
},
"dependencies": {
"@fluencelabs/fluence-network-environment": "1.1.2",
"@fluencelabs/js-client.api": "0.12.1",
"@fluencelabs/js-client.node": "0.7.1",
"@fluencelabs/js-client": "0.1.0",
"deep-equal": "2.2.1",
"loglevel": "1.8.1"
},

View File

@ -1,5 +1,4 @@
import { Fluence, IFluenceClient, createClient } from '@fluencelabs/js-client.api';
import '@fluencelabs/js-client.node';
import { Fluence, IFluenceClient, createClient } from '@fluencelabs/js-client';
import { getObjAssignCall, getObjCall, getObjRelayCall } from '../examples/objectCall.js';
import { callArrowCall, reproArgsBug426Call } from '../examples/callArrowCall.js';
import { dataAliasCall } from '../examples/dataAliasCall.js';
@ -88,18 +87,17 @@ async function start() {
Fluence.onConnectionStateChange((s) => {
console.log(s);
});
await Fluence.connect(relay1);
await Fluence.connect(relay1, {});
const cl = await Fluence.getClient();
peer1 = cl;
selfPeerId = cl.getPeerId();
console.log('CONNECTED');
peer2 = await createClient(relay2);
peer2 = await createClient(relay2, {});
console.log('CONNECTING TO SECOND:');
peer2.onConnectionStateChange((s) => {
console.log(s);
});
await peer2.connect();
console.log('CONNECTED');
}

View File

@ -1,4 +1,4 @@
import {IFluenceClient} from '@fluencelabs/js-client.api';
import {IFluenceClient} from '@fluencelabs/js-client';
import {registerTest, onPropagate, nestedOnPropagate, seqOnPropagate} from "../compiled/examples/onErrorPropagation.js"
export async function onPropagateCall(peer2: IFluenceClient, relay2: string): Promise<number> {

View File

@ -1,4 +1,4 @@
import { IFluenceClient } from '@fluencelabs/js-client.api';
import { IFluenceClient } from '@fluencelabs/js-client';
import {
topologyTest,
registerTesto,

1057
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff