(desktop)
Desktop app endpoints
- checkUpdate - Check for desktop app updates
- downloadUpdate - Download desktop app update artifact
Returns the latest desktop app version info in Tauri updater format. Download URLs are rewritten to proxy through this API.
import { Midday } from "@midday-ai/sdk";
const midday = new Midday({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const result = await midday.desktop.checkUpdate();
console.log(result);
}
run();The standalone function version of this method:
import { MiddayCore } from "@midday-ai/sdk/core.js";
import { desktopCheckUpdate } from "@midday-ai/sdk/funcs/desktopCheckUpdate.js";
// Use `MiddayCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const midday = new MiddayCore({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const res = await desktopCheckUpdate(midday);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("desktopCheckUpdate failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.CheckDesktopUpdateResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.CheckDesktopUpdateBadGatewayError | 502 | application/json |
| errors.APIError | 4XX, 5XX | */* |
Proxies the download of a desktop app update artifact from GitHub releases. Only URLs pointing to the midday-ai/midday repository are accepted.
import { Midday } from "@midday-ai/sdk";
const midday = new Midday({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const result = await midday.desktop.downloadUpdate({
url: "https://github.com/midday-ai/midday/releases/download/midday-v1.0.0/Midday.app.tar.gz",
});
console.log(result);
}
run();The standalone function version of this method:
import { MiddayCore } from "@midday-ai/sdk/core.js";
import { desktopDownloadUpdate } from "@midday-ai/sdk/funcs/desktopDownloadUpdate.js";
// Use `MiddayCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const midday = new MiddayCore({
security: {
oauth2: process.env["MIDDAY_OAUTH2"] ?? "",
},
});
async function run() {
const res = await desktopDownloadUpdate(midday, {
url: "https://github.com/midday-ai/midday/releases/download/midday-v1.0.0/Midday.app.tar.gz",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("desktopDownloadUpdate failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.DownloadDesktopUpdateRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<ReadableStream>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.DownloadDesktopUpdateBadRequestError | 400 | application/json |
| errors.DownloadDesktopUpdateBadGatewayError | 502 | application/json |
| errors.APIError | 4XX, 5XX | */* |