felixriddle.pid-discovery
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -5,3 +5,13 @@ /** | ||
declare function updateAppInfo(): Promise<Response>; | ||
interface AppInfo { | ||
name: string; | ||
pid: number; | ||
appType: string; | ||
url: string; | ||
} | ||
/** | ||
* More configurable option to insert process information | ||
*/ | ||
declare function upsertProcessInfo(appInfo: AppInfo): Promise<Response>; | ||
export { updateAppInfo }; | ||
export { type AppInfo, updateAppInfo, upsertProcessInfo }; |
@@ -53,3 +53,4 @@ "use strict"; | ||
__export(src_exports, { | ||
updateAppInfo: () => updateAppInfo | ||
updateAppInfo: () => updateAppInfo, | ||
upsertProcessInfo: () => upsertProcessInfo | ||
}); | ||
@@ -81,6 +82,26 @@ module.exports = __toCommonJS(src_exports); | ||
} | ||
function upsertProcessInfo(appInfo) { | ||
return __async(this, null, function* () { | ||
const url = `http://localhost:24000`; | ||
const headers = { | ||
"Content-Type": "application/json" | ||
}; | ||
const data = { | ||
name: appInfo.name, | ||
pid: appInfo.pid, | ||
appType: appInfo.appType, | ||
url: appInfo.url | ||
}; | ||
return yield fetch(`${url}/process`, { | ||
method: "POST", | ||
headers, | ||
body: JSON.stringify(data) | ||
}); | ||
}); | ||
} | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
updateAppInfo | ||
updateAppInfo, | ||
upsertProcessInfo | ||
}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "felixriddle.pid-discovery", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Used with 'app-manager' to update the pid in the database", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
12409
186
4