From 572f1e10e2416f13d7e2aaa02113a6369d6cdbe3 Mon Sep 17 00:00:00 2001 From: Akim Mamedov Date: Mon, 18 Sep 2023 18:19:13 +0700 Subject: [PATCH] Fix object type --- packages/core/aqua-to-js-compiler/src/generate/service.ts | 8 ++------ .../interfaces/src/compilerSupport/aquaTypeDefinitions.ts | 4 +++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/core/aqua-to-js-compiler/src/generate/service.ts b/packages/core/aqua-to-js-compiler/src/generate/service.ts index e52cf6b2..6653148d 100644 --- a/packages/core/aqua-to-js-compiler/src/generate/service.ts +++ b/packages/core/aqua-to-js-compiler/src/generate/service.ts @@ -18,10 +18,6 @@ import { ServiceDef } from '@fluencelabs/interfaces'; import { recursiveRenameLaquaProps } from '../utils.js'; import { TypeGenerator } from './interfaces.js'; -interface DefaultServiceId { - s_Some__f_value?: string -} - export class ServiceGenerator { constructor( private typeGenerator: TypeGenerator @@ -54,8 +50,8 @@ export class ServiceGenerator { private serviceToJson(service: ServiceDef): string { return JSON.stringify({ ...( - (service.defaultServiceId as DefaultServiceId)?.s_Some__f_value - ? { defaultServiceId: (service.defaultServiceId as DefaultServiceId).s_Some__f_value } + service.defaultServiceId.s_Some__f_value + ? { defaultServiceId: service.defaultServiceId.s_Some__f_value } : {} ), functions: recursiveRenameLaquaProps(service.functions) diff --git a/packages/core/interfaces/src/compilerSupport/aquaTypeDefinitions.ts b/packages/core/interfaces/src/compilerSupport/aquaTypeDefinitions.ts index ac59ed91..0e215d92 100644 --- a/packages/core/interfaces/src/compilerSupport/aquaTypeDefinitions.ts +++ b/packages/core/interfaces/src/compilerSupport/aquaTypeDefinitions.ts @@ -229,7 +229,9 @@ export interface ServiceDef { /** * 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