mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2025-06-27 14:51:32 +00:00
* Review fixes * remove logs * Fixes * Todo to remove prefix later * Refactor service signatures * Fixes * Update lock file * Fix lockfile * Update deps * More fixes and renames * Fix compiler * Peer refactoring and cutting onConnectionChange API * Revert deleted API
This commit is contained in:
@ -14,17 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ServiceDef } from "@fluencelabs/interfaces";
|
||||
import { JSONValue, ServiceDef } from "@fluencelabs/interfaces";
|
||||
|
||||
import { recursiveRenameLaquaProps } from "../utils.js";
|
||||
|
||||
import { TypeGenerator } from "./interfaces.js";
|
||||
|
||||
// Actual value of defaultServiceId which comes from aqua-api
|
||||
export interface DefaultServiceId {
|
||||
s_Some__f_value?: string;
|
||||
}
|
||||
|
||||
export function generateServices(
|
||||
typeGenerator: TypeGenerator,
|
||||
services: Record<string, ServiceDef>,
|
||||
@ -68,21 +63,6 @@ function generateRegisterServiceOverload(
|
||||
}
|
||||
|
||||
function serviceToJson(service: ServiceDef): string {
|
||||
return JSON.stringify(
|
||||
{
|
||||
// This assertion is required because aqua-api gives bad types
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
||||
...((service.defaultServiceId as DefaultServiceId).s_Some__f_value != null
|
||||
? {
|
||||
defaultServiceId:
|
||||
// This assertion is required because aqua-api gives bad types
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
||||
(service.defaultServiceId as DefaultServiceId).s_Some__f_value,
|
||||
}
|
||||
: {}),
|
||||
functions: recursiveRenameLaquaProps(service.functions),
|
||||
},
|
||||
null,
|
||||
4,
|
||||
);
|
||||
const record: Record<never, JSONValue> = service;
|
||||
return JSON.stringify(recursiveRenameLaquaProps(record), null, 4);
|
||||
}
|
||||
|
Reference in New Issue
Block a user