chore: Add the wrapperData, bound effects, and sdk

This commit is contained in:
BluJ
2023-04-13 14:44:17 -06:00
parent cff86718f8
commit c9a1c45930
11 changed files with 134 additions and 25 deletions

View File

@@ -231,12 +231,22 @@ export type Effects = {
progress: () => Promise<number>;
};
getServiceConfig(options?: {
/** Get a value in a json like data, can be observed and subscribed */
getWrapperData(options?: {
/** If there is no packageId it is assumed the current package */
packageId?: string;
/** The path defaults to root level, using the [JsonPath](https://jsonpath.com/) */
path?: string;
callback?: (config: unknown, previousConfig: unknown) => void;
callback: (config: unknown, previousConfig: unknown) => void;
}): Promise<unknown>;
/** Used to store values that can be accessed and subscribed to */
setWrapperData(options?: {
/** Sets the value for the wrapper at the path, it will override, using the [JsonPath](https://jsonpath.com/) */
path?: string;
value: unknown;
}): Promise<void>;
getLocalHostname(): Promise<string>;
getIPHostname(): Promise<string>;
/** Get the address for another service for tor interfaces */
@@ -334,6 +344,9 @@ export type Effects = {
status: HealthStatus;
message?: string;
}): Promise<void>;
restart(): void;
shutdown(): void;
};
/* rsync options: https://linux.die.net/man/1/rsync