Fix object type

This commit is contained in:
Akim Mamedov 2023-09-18 18:19:13 +07:00
parent 2550588e37
commit 572f1e10e2
2 changed files with 5 additions and 7 deletions

View File

@ -18,10 +18,6 @@ import { ServiceDef } from '@fluencelabs/interfaces';
import { recursiveRenameLaquaProps } from '../utils.js'; import { recursiveRenameLaquaProps } from '../utils.js';
import { TypeGenerator } from './interfaces.js'; import { TypeGenerator } from './interfaces.js';
interface DefaultServiceId {
s_Some__f_value?: string
}
export class ServiceGenerator { export class ServiceGenerator {
constructor( constructor(
private typeGenerator: TypeGenerator private typeGenerator: TypeGenerator
@ -54,8 +50,8 @@ export class ServiceGenerator {
private serviceToJson(service: ServiceDef): string { private serviceToJson(service: ServiceDef): string {
return JSON.stringify({ return JSON.stringify({
...( ...(
(service.defaultServiceId as DefaultServiceId)?.s_Some__f_value service.defaultServiceId.s_Some__f_value
? { defaultServiceId: (service.defaultServiceId as DefaultServiceId).s_Some__f_value } ? { defaultServiceId: service.defaultServiceId.s_Some__f_value }
: {} : {}
), ),
functions: recursiveRenameLaquaProps(service.functions) functions: recursiveRenameLaquaProps(service.functions)

View File

@ -229,7 +229,9 @@ export interface ServiceDef {
/** /**
* Default service id. If the service has no default id the value should be undefined * Default service id. If the service has no default id the value should be undefined
*/ */
defaultServiceId?: {}; defaultServiceId: {
s_Some__f_value?: string
};
/** /**
* List of functions which the service consists of * List of functions which the service consists of