mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2025-05-12 17:37:12 +00:00
Fix types
This commit is contained in:
parent
5b3fe66d8c
commit
c3eba6a73c
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user