Fix types

This commit is contained in:
Akim Mamedov 2023-11-17 19:09:23 +07:00
parent 5b3fe66d8c
commit c3eba6a73c
3 changed files with 11 additions and 4 deletions

View File

@ -264,6 +264,8 @@ export interface ServiceDef {
* List of functions which the service consists of * List of functions which the service consists of
*/ */
functions: functions:
| LabeledProductType<ArrowType<LabeledProductType<SimpleTypes>>> | LabeledProductType<
ArrowType<LabeledProductType<SimpleTypes> | UnlabeledProductType>
>
| NilType; | NilType;
} }

View File

@ -22,6 +22,7 @@ import {
NonArrowSimpleType, NonArrowSimpleType,
ScalarType, ScalarType,
SimpleTypes, SimpleTypes,
UnlabeledProductType,
} from "@fluencelabs/interfaces"; } from "@fluencelabs/interfaces";
import { ParticleContext } from "../jsServiceHost/interfaces.js"; import { ParticleContext } from "../jsServiceHost/interfaces.js";
@ -203,7 +204,9 @@ export function js2aqua(
export const wrapFunction = ( export const wrapFunction = (
func: ServiceImpl[string], func: ServiceImpl[string],
schema: ArrowWithoutCallbacks | ArrowType<LabeledProductType<SimpleTypes>>, schema:
| ArrowWithoutCallbacks
| ArrowType<LabeledProductType<SimpleTypes> | UnlabeledProductType>,
): ServiceImpl[string] => { ): ServiceImpl[string] => {
return async (...args) => { return async (...args) => {
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions // eslint-disable-next-line @typescript-eslint/consistent-type-assertions

View File

@ -548,7 +548,7 @@ export abstract class FluencePeer {
) == null ) == null
) { ) {
// try to finish script if fire-and-forget enabled // try to finish script if fire-and-forget enabled
item.onSuccess({}); item.onSuccess(null);
} }
}) })
.catch((e: unknown) => { .catch((e: unknown) => {
@ -638,7 +638,9 @@ export abstract class FluencePeer {
) == null ) == null
) { ) {
// try to finish script if fire-and-forget enabled // try to finish script if fire-and-forget enabled
item.onSuccess({}); setTimeout(() => {
item.onSuccess(null);
}, 0);
} }
} }