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
*/
functions:
| LabeledProductType<ArrowType<LabeledProductType<SimpleTypes>>>
| LabeledProductType<
ArrowType<LabeledProductType<SimpleTypes> | UnlabeledProductType>
>
| NilType;
}

View File

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

View File

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