fix: support passing arguments when pushing a service
Some checks failed
gitea-sync/antos/pipeline/head There was a failure building this commit

This commit is contained in:
DanyLE 2023-06-06 21:53:22 +02:00
parent 6895b94c7d
commit 185dce4d7f
3 changed files with 8 additions and 5 deletions

5
d.ts/antos.d.ts vendored
View File

@ -1191,9 +1191,10 @@ declare namespace OS {
*
* @export
* @param {string} ph
* @param {AppArgumentsType[]} [params] service arguments
* @returns {Promise<PM.ProcessType>}
*/
function pushService(ph: string): Promise<PM.ProcessType>;
function pushService(ph: string, params?: AppArgumentsType[]): Promise<PM.ProcessType>;
/**
* Synchronously start a list of services
*
@ -10802,7 +10803,7 @@ declare namespace OS {
* @export
* @param {string} app class name string
* @param {ProcessTypeClass} cls prototype class
* @param {GUI.AppArgumentsType[]} [args] process arguments
* @param {AppArgumentsType[]} [args] process arguments
* @returns {Promise<ProcessType>} a promise on the created process
*/
function createProcess(app: string, cls: ModelTypeClass, args?: AppArgumentsType[]): Promise<ProcessType>;

View File

@ -644,9 +644,10 @@ namespace OS {
*
* @export
* @param {string} ph
* @param {AppArgumentsType[]} [params] service arguments
* @returns {Promise<PM.ProcessType>}
*/
export function pushService(ph: string): Promise<PM.ProcessType> {
export function pushService(ph: string, params?: AppArgumentsType[]): Promise<PM.ProcessType> {
return new Promise(async function (resolve, reject) {
const arr = ph.split("/");
const srv = arr[1];
@ -662,7 +663,8 @@ namespace OS {
}
const d = await PM.createProcess(
srv,
application[srv]
application[srv],
params
);
return resolve(d);
}

View File

@ -35,7 +35,7 @@ namespace OS {
* @export
* @param {string} app class name string
* @param {ProcessTypeClass} cls prototype class
* @param {GUI.AppArgumentsType[]} [args] process arguments
* @param {AppArgumentsType[]} [args] process arguments
* @returns {Promise<ProcessType>} a promise on the created process
*/
export function createProcess(