feat: adding background jobs ui page and apis - requires user is_admin to be set to true

This commit is contained in:
allanice001
2025-11-04 23:52:37 +00:00
parent 91686c1ea4
commit c41af60b26
97 changed files with 11135 additions and 138 deletions

View File

@@ -13,16 +13,33 @@
*/
import * as runtime from "../runtime";
import type { DtoAnnotationResponse } from "../models/index";
import type {
DtoAnnotationResponse,
DtoCreateAnnotationRequest,
DtoUpdateAnnotationRequest,
} from "../models/index";
import {
DtoAnnotationResponseFromJSON,
DtoAnnotationResponseToJSON,
DtoCreateAnnotationRequestFromJSON,
DtoCreateAnnotationRequestToJSON,
DtoUpdateAnnotationRequestFromJSON,
DtoUpdateAnnotationRequestToJSON,
} from "../models/index";
export interface CreateAnnotationRequest {
body: DtoCreateAnnotationRequest;
xOrgID?: string;
}
export interface DeleteAnnotationRequest {
id: string;
xOrgID?: string;
}
export interface GetAnnotationRequest {
id: string;
xOrgID?: string;
include?: string;
}
export interface ListAnnotationsRequest {
@@ -32,10 +49,165 @@ export interface ListAnnotationsRequest {
q?: string;
}
export interface UpdateAnnotationRequest {
id: string;
body: DtoUpdateAnnotationRequest;
xOrgID?: string;
}
/**
*
*/
export class AnnotationsApi extends runtime.BaseAPI {
/**
* Creates an annotation.
* Create annotation (org scoped)
*/
async createAnnotationRaw(
requestParameters: CreateAnnotationRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoAnnotationResponse>> {
if (requestParameters["body"] == null) {
throw new runtime.RequiredError(
"body",
'Required parameter "body" was null or undefined when calling createAnnotation().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/annotations`;
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: DtoCreateAnnotationRequestToJSON(requestParameters["body"]),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoAnnotationResponseFromJSON(jsonValue),
);
}
/**
* Creates an annotation.
* Create annotation (org scoped)
*/
async createAnnotation(
requestParameters: CreateAnnotationRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoAnnotationResponse> {
const response = await this.createAnnotationRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Permanently deletes the annotation.
* Delete annotation (org scoped)
*/
async deleteAnnotationRaw(
requestParameters: DeleteAnnotationRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<string>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling deleteAnnotation().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/annotations/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
if (this.isJsonMime(response.headers.get("content-type"))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
* Permanently deletes the annotation.
* Delete annotation (org scoped)
*/
async deleteAnnotation(
requestParameters: DeleteAnnotationRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<string> {
const response = await this.deleteAnnotationRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Returns one annotation. Add `include=node_pools` to include node pools.
* Get annotation by ID (org scoped)
@@ -53,10 +225,6 @@ export class AnnotationsApi extends runtime.BaseAPI {
const queryParameters: any = {};
if (requestParameters["include"] != null) {
queryParameters["include"] = requestParameters["include"];
}
const headerParameters: runtime.HTTPHeaders = {};
if (requestParameters["xOrgID"] != null) {
@@ -188,4 +356,88 @@ export class AnnotationsApi extends runtime.BaseAPI {
);
return await response.value();
}
/**
* Partially update annotation fields.
* Update annotation (org scoped)
*/
async updateAnnotationRaw(
requestParameters: UpdateAnnotationRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoAnnotationResponse>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling updateAnnotation().',
);
}
if (requestParameters["body"] == null) {
throw new runtime.RequiredError(
"body",
'Required parameter "body" was null or undefined when calling updateAnnotation().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (requestParameters["xOrgID"] != null) {
headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]);
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-KEY"] =
await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["X-ORG-SECRET"] =
await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication
}
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/annotations/{id}`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "PATCH",
headers: headerParameters,
query: queryParameters,
body: DtoUpdateAnnotationRequestToJSON(requestParameters["body"]),
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoAnnotationResponseFromJSON(jsonValue),
);
}
/**
* Partially update annotation fields.
* Update annotation (org scoped)
*/
async updateAnnotation(
requestParameters: UpdateAnnotationRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoAnnotationResponse> {
const response = await this.updateAnnotationRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
}

View File

@@ -0,0 +1,356 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from "../runtime";
import type { DtoJob, DtoPageJob, DtoQueueInfo } from "../models/index";
import {
DtoJobFromJSON,
DtoJobToJSON,
DtoPageJobFromJSON,
DtoPageJobToJSON,
DtoQueueInfoFromJSON,
DtoQueueInfoToJSON,
} from "../models/index";
export interface AdminCancelArcherJobRequest {
id: string;
}
export interface AdminEnqueueArcherJobRequest {
body: object;
}
export interface AdminListArcherJobsRequest {
status?: AdminListArcherJobsStatusEnum;
queue?: string;
q?: string;
page?: number;
pageSize?: number;
}
export interface AdminRetryArcherJobRequest {
id: string;
}
/**
*
*/
export class ArcherAdminApi extends runtime.BaseAPI {
/**
* Set job status to canceled if cancellable. For running jobs, this only affects future picks; wire to Archer if you need active kill.
* Cancel an Archer job (admin)
*/
async adminCancelArcherJobRaw(
requestParameters: AdminCancelArcherJobRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoJob>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling adminCancelArcherJob().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/admin/archer/jobs/{id}/cancel`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoJobFromJSON(jsonValue),
);
}
/**
* Set job status to canceled if cancellable. For running jobs, this only affects future picks; wire to Archer if you need active kill.
* Cancel an Archer job (admin)
*/
async adminCancelArcherJob(
requestParameters: AdminCancelArcherJobRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoJob> {
const response = await this.adminCancelArcherJobRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Create a job immediately or schedule it for the future via `run_at`.
* Enqueue a new Archer job (admin)
*/
async adminEnqueueArcherJobRaw(
requestParameters: AdminEnqueueArcherJobRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoJob>> {
if (requestParameters["body"] == null) {
throw new runtime.RequiredError(
"body",
'Required parameter "body" was null or undefined when calling adminEnqueueArcherJob().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters["Content-Type"] = "application/json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/admin/archer/jobs`;
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: requestParameters["body"] as any,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoJobFromJSON(jsonValue),
);
}
/**
* Create a job immediately or schedule it for the future via `run_at`.
* Enqueue a new Archer job (admin)
*/
async adminEnqueueArcherJob(
requestParameters: AdminEnqueueArcherJobRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoJob> {
const response = await this.adminEnqueueArcherJobRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Paginated background jobs with optional filters. Search `q` may match id, type, error, payload (implementation-dependent).
* List Archer jobs (admin)
*/
async adminListArcherJobsRaw(
requestParameters: AdminListArcherJobsRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoPageJob>> {
const queryParameters: any = {};
if (requestParameters["status"] != null) {
queryParameters["status"] = requestParameters["status"];
}
if (requestParameters["queue"] != null) {
queryParameters["queue"] = requestParameters["queue"];
}
if (requestParameters["q"] != null) {
queryParameters["q"] = requestParameters["q"];
}
if (requestParameters["page"] != null) {
queryParameters["page"] = requestParameters["page"];
}
if (requestParameters["pageSize"] != null) {
queryParameters["page_size"] = requestParameters["pageSize"];
}
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/admin/archer/jobs`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoPageJobFromJSON(jsonValue),
);
}
/**
* Paginated background jobs with optional filters. Search `q` may match id, type, error, payload (implementation-dependent).
* List Archer jobs (admin)
*/
async adminListArcherJobs(
requestParameters: AdminListArcherJobsRequest = {},
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoPageJob> {
const response = await this.adminListArcherJobsRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
/**
* Summary metrics per queue (pending, running, failed, scheduled).
* List Archer queues (admin)
*/
async adminListArcherQueuesRaw(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<Array<DtoQueueInfo>>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/admin/archer/queues`;
const response = await this.request(
{
path: urlPath,
method: "GET",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
jsonValue.map(DtoQueueInfoFromJSON),
);
}
/**
* Summary metrics per queue (pending, running, failed, scheduled).
* List Archer queues (admin)
*/
async adminListArcherQueues(
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<Array<DtoQueueInfo>> {
const response = await this.adminListArcherQueuesRaw(initOverrides);
return await response.value();
}
/**
* Marks the job retriable (DB flip). Swap this for an Archer admin call if you expose one.
* Retry a failed/canceled Archer job (admin)
*/
async adminRetryArcherJobRaw(
requestParameters: AdminRetryArcherJobRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<runtime.ApiResponse<DtoJob>> {
if (requestParameters["id"] == null) {
throw new runtime.RequiredError(
"id",
'Required parameter "id" was null or undefined when calling adminRetryArcherJob().',
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] =
await this.configuration.apiKey("Authorization"); // BearerAuth authentication
}
let urlPath = `/admin/archer/jobs/{id}/retry`;
urlPath = urlPath.replace(
`{${"id"}}`,
encodeURIComponent(String(requestParameters["id"])),
);
const response = await this.request(
{
path: urlPath,
method: "POST",
headers: headerParameters,
query: queryParameters,
},
initOverrides,
);
return new runtime.JSONApiResponse(response, (jsonValue) =>
DtoJobFromJSON(jsonValue),
);
}
/**
* Marks the job retriable (DB flip). Swap this for an Archer admin call if you expose one.
* Retry a failed/canceled Archer job (admin)
*/
async adminRetryArcherJob(
requestParameters: AdminRetryArcherJobRequest,
initOverrides?: RequestInit | runtime.InitOverrideFunction,
): Promise<DtoJob> {
const response = await this.adminRetryArcherJobRaw(
requestParameters,
initOverrides,
);
return await response.value();
}
}
/**
* @export
*/
export const AdminListArcherJobsStatusEnum = {
queued: "queued",
running: "running",
succeeded: "succeeded",
failed: "failed",
canceled: "canceled",
retrying: "retrying",
scheduled: "scheduled",
} as const;
export type AdminListArcherJobsStatusEnum =
(typeof AdminListArcherJobsStatusEnum)[keyof typeof AdminListArcherJobsStatusEnum];

View File

@@ -1,6 +1,7 @@
/* tslint:disable */
/* eslint-disable */
export * from "./AnnotationsApi";
export * from "./ArcherAdminApi";
export * from "./AuthApi";
export * from "./HealthApi";
export * from "./LabelsApi";

View File

@@ -0,0 +1,82 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from "../runtime";
/**
*
* @export
* @interface DtoCreateAnnotationRequest
*/
export interface DtoCreateAnnotationRequest {
/**
*
* @type {string}
* @memberof DtoCreateAnnotationRequest
*/
key?: string;
/**
*
* @type {string}
* @memberof DtoCreateAnnotationRequest
*/
value?: string;
}
/**
* Check if a given object implements the DtoCreateAnnotationRequest interface.
*/
export function instanceOfDtoCreateAnnotationRequest(
value: object,
): value is DtoCreateAnnotationRequest {
return true;
}
export function DtoCreateAnnotationRequestFromJSON(
json: any,
): DtoCreateAnnotationRequest {
return DtoCreateAnnotationRequestFromJSONTyped(json, false);
}
export function DtoCreateAnnotationRequestFromJSONTyped(
json: any,
ignoreDiscriminator: boolean,
): DtoCreateAnnotationRequest {
if (json == null) {
return json;
}
return {
key: json["key"] == null ? undefined : json["key"],
value: json["value"] == null ? undefined : json["value"],
};
}
export function DtoCreateAnnotationRequestToJSON(
json: any,
): DtoCreateAnnotationRequest {
return DtoCreateAnnotationRequestToJSONTyped(json, false);
}
export function DtoCreateAnnotationRequestToJSONTyped(
value?: DtoCreateAnnotationRequest | null,
ignoreDiscriminator: boolean = false,
): any {
if (value == null) {
return value;
}
return {
key: value["key"],
value: value["value"],
};
}

159
sdk/ts/src/models/DtoJob.ts Normal file
View File

@@ -0,0 +1,159 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from "../runtime";
import type { DtoJobStatus } from "./DtoJobStatus";
import {
DtoJobStatusFromJSON,
DtoJobStatusFromJSONTyped,
DtoJobStatusToJSON,
DtoJobStatusToJSONTyped,
} from "./DtoJobStatus";
/**
*
* @export
* @interface DtoJob
*/
export interface DtoJob {
/**
* example: 0
* @type {number}
* @memberof DtoJob
*/
attempts?: number;
/**
* example: 2025-11-04T09:30:00Z
* @type {string}
* @memberof DtoJob
*/
created_at?: string;
/**
* example: 01HF7SZK8Z8WG1M3J7S2Z8M2N6
* @type {string}
* @memberof DtoJob
*/
id?: string;
/**
* example: dial tcp: i/o timeout
* @type {string}
* @memberof DtoJob
*/
last_error?: string;
/**
* example: 3
* @type {number}
* @memberof DtoJob
*/
max_attempts?: number;
/**
* arbitrary JSON payload
* @type {object}
* @memberof DtoJob
*/
payload?: object;
/**
* example: default
* @type {string}
* @memberof DtoJob
*/
queue?: string;
/**
* example: 2025-11-05T08:00:00Z
* @type {string}
* @memberof DtoJob
*/
run_at?: string;
/**
* enum: queued,running,succeeded,failed,canceled,retrying,scheduled
* example: queued
* @type {DtoJobStatus}
* @memberof DtoJob
*/
status?: DtoJobStatus;
/**
* example: email.send
* @type {string}
* @memberof DtoJob
*/
type?: string;
/**
* example: 2025-11-04T09:31:00Z
* @type {string}
* @memberof DtoJob
*/
updated_at?: string;
}
/**
* Check if a given object implements the DtoJob interface.
*/
export function instanceOfDtoJob(value: object): value is DtoJob {
return true;
}
export function DtoJobFromJSON(json: any): DtoJob {
return DtoJobFromJSONTyped(json, false);
}
export function DtoJobFromJSONTyped(
json: any,
ignoreDiscriminator: boolean,
): DtoJob {
if (json == null) {
return json;
}
return {
attempts: json["attempts"] == null ? undefined : json["attempts"],
created_at: json["created_at"] == null ? undefined : json["created_at"],
id: json["id"] == null ? undefined : json["id"],
last_error: json["last_error"] == null ? undefined : json["last_error"],
max_attempts:
json["max_attempts"] == null ? undefined : json["max_attempts"],
payload: json["payload"] == null ? undefined : json["payload"],
queue: json["queue"] == null ? undefined : json["queue"],
run_at: json["run_at"] == null ? undefined : json["run_at"],
status:
json["status"] == null ? undefined : DtoJobStatusFromJSON(json["status"]),
type: json["type"] == null ? undefined : json["type"],
updated_at: json["updated_at"] == null ? undefined : json["updated_at"],
};
}
export function DtoJobToJSON(json: any): DtoJob {
return DtoJobToJSONTyped(json, false);
}
export function DtoJobToJSONTyped(
value?: DtoJob | null,
ignoreDiscriminator: boolean = false,
): any {
if (value == null) {
return value;
}
return {
attempts: value["attempts"],
created_at: value["created_at"],
id: value["id"],
last_error: value["last_error"],
max_attempts: value["max_attempts"],
payload: value["payload"],
queue: value["queue"],
run_at: value["run_at"],
status: DtoJobStatusToJSON(value["status"]),
type: value["type"],
updated_at: value["updated_at"],
};
}

View File

@@ -0,0 +1,61 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
*/
export const DtoJobStatus = {
StatusQueued: "queued",
StatusRunning: "running",
StatusSucceeded: "succeeded",
StatusFailed: "failed",
StatusCanceled: "canceled",
StatusRetrying: "retrying",
StatusScheduled: "scheduled",
} as const;
export type DtoJobStatus = (typeof DtoJobStatus)[keyof typeof DtoJobStatus];
export function instanceOfDtoJobStatus(value: any): boolean {
for (const key in DtoJobStatus) {
if (Object.prototype.hasOwnProperty.call(DtoJobStatus, key)) {
if (DtoJobStatus[key as keyof typeof DtoJobStatus] === value) {
return true;
}
}
}
return false;
}
export function DtoJobStatusFromJSON(json: any): DtoJobStatus {
return DtoJobStatusFromJSONTyped(json, false);
}
export function DtoJobStatusFromJSONTyped(
json: any,
ignoreDiscriminator: boolean,
): DtoJobStatus {
return json as DtoJobStatus;
}
export function DtoJobStatusToJSON(value?: DtoJobStatus | null): any {
return value as any;
}
export function DtoJobStatusToJSONTyped(
value: any,
ignoreDiscriminator: boolean,
): DtoJobStatus {
return value as DtoJobStatus;
}

View File

@@ -0,0 +1,106 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from "../runtime";
import type { DtoJob } from "./DtoJob";
import {
DtoJobFromJSON,
DtoJobFromJSONTyped,
DtoJobToJSON,
DtoJobToJSONTyped,
} from "./DtoJob";
/**
*
* @export
* @interface DtoPageJob
*/
export interface DtoPageJob {
/**
*
* @type {Array<DtoJob>}
* @memberof DtoPageJob
*/
items?: Array<DtoJob>;
/**
* example: 1
* @type {number}
* @memberof DtoPageJob
*/
page?: number;
/**
* example: 25
* @type {number}
* @memberof DtoPageJob
*/
page_size?: number;
/**
* example: 120
* @type {number}
* @memberof DtoPageJob
*/
total?: number;
}
/**
* Check if a given object implements the DtoPageJob interface.
*/
export function instanceOfDtoPageJob(value: object): value is DtoPageJob {
return true;
}
export function DtoPageJobFromJSON(json: any): DtoPageJob {
return DtoPageJobFromJSONTyped(json, false);
}
export function DtoPageJobFromJSONTyped(
json: any,
ignoreDiscriminator: boolean,
): DtoPageJob {
if (json == null) {
return json;
}
return {
items:
json["items"] == null
? undefined
: (json["items"] as Array<any>).map(DtoJobFromJSON),
page: json["page"] == null ? undefined : json["page"],
page_size: json["page_size"] == null ? undefined : json["page_size"],
total: json["total"] == null ? undefined : json["total"],
};
}
export function DtoPageJobToJSON(json: any): DtoPageJob {
return DtoPageJobToJSONTyped(json, false);
}
export function DtoPageJobToJSONTyped(
value?: DtoPageJob | null,
ignoreDiscriminator: boolean = false,
): any {
if (value == null) {
return value;
}
return {
items:
value["items"] == null
? undefined
: (value["items"] as Array<any>).map(DtoJobToJSON),
page: value["page"],
page_size: value["page_size"],
total: value["total"],
};
}

View File

@@ -0,0 +1,100 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from "../runtime";
/**
*
* @export
* @interface DtoQueueInfo
*/
export interface DtoQueueInfo {
/**
* example: 5
* @type {number}
* @memberof DtoQueueInfo
*/
failed?: number;
/**
* example: default
* @type {string}
* @memberof DtoQueueInfo
*/
name?: string;
/**
* example: 42
* @type {number}
* @memberof DtoQueueInfo
*/
pending?: number;
/**
* example: 3
* @type {number}
* @memberof DtoQueueInfo
*/
running?: number;
/**
* example: 7
* @type {number}
* @memberof DtoQueueInfo
*/
scheduled?: number;
}
/**
* Check if a given object implements the DtoQueueInfo interface.
*/
export function instanceOfDtoQueueInfo(value: object): value is DtoQueueInfo {
return true;
}
export function DtoQueueInfoFromJSON(json: any): DtoQueueInfo {
return DtoQueueInfoFromJSONTyped(json, false);
}
export function DtoQueueInfoFromJSONTyped(
json: any,
ignoreDiscriminator: boolean,
): DtoQueueInfo {
if (json == null) {
return json;
}
return {
failed: json["failed"] == null ? undefined : json["failed"],
name: json["name"] == null ? undefined : json["name"],
pending: json["pending"] == null ? undefined : json["pending"],
running: json["running"] == null ? undefined : json["running"],
scheduled: json["scheduled"] == null ? undefined : json["scheduled"],
};
}
export function DtoQueueInfoToJSON(json: any): DtoQueueInfo {
return DtoQueueInfoToJSONTyped(json, false);
}
export function DtoQueueInfoToJSONTyped(
value?: DtoQueueInfo | null,
ignoreDiscriminator: boolean = false,
): any {
if (value == null) {
return value;
}
return {
failed: value["failed"],
name: value["name"],
pending: value["pending"],
running: value["running"],
scheduled: value["scheduled"],
};
}

View File

@@ -0,0 +1,82 @@
/* tslint:disable */
/* eslint-disable */
/**
* AutoGlue API
* API for managing K3s clusters across cloud providers
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from "../runtime";
/**
*
* @export
* @interface DtoUpdateAnnotationRequest
*/
export interface DtoUpdateAnnotationRequest {
/**
*
* @type {string}
* @memberof DtoUpdateAnnotationRequest
*/
key?: string;
/**
*
* @type {string}
* @memberof DtoUpdateAnnotationRequest
*/
value?: string;
}
/**
* Check if a given object implements the DtoUpdateAnnotationRequest interface.
*/
export function instanceOfDtoUpdateAnnotationRequest(
value: object,
): value is DtoUpdateAnnotationRequest {
return true;
}
export function DtoUpdateAnnotationRequestFromJSON(
json: any,
): DtoUpdateAnnotationRequest {
return DtoUpdateAnnotationRequestFromJSONTyped(json, false);
}
export function DtoUpdateAnnotationRequestFromJSONTyped(
json: any,
ignoreDiscriminator: boolean,
): DtoUpdateAnnotationRequest {
if (json == null) {
return json;
}
return {
key: json["key"] == null ? undefined : json["key"],
value: json["value"] == null ? undefined : json["value"],
};
}
export function DtoUpdateAnnotationRequestToJSON(
json: any,
): DtoUpdateAnnotationRequest {
return DtoUpdateAnnotationRequestToJSONTyped(json, false);
}
export function DtoUpdateAnnotationRequestToJSONTyped(
value?: DtoUpdateAnnotationRequest | null,
ignoreDiscriminator: boolean = false,
): any {
if (value == null) {
return value;
}
return {
key: value["key"],
value: value["value"],
};
}

View File

@@ -64,6 +64,12 @@ export interface HandlersMeResponse {
* @memberof HandlersMeResponse
*/
id?: string;
/**
*
* @type {boolean}
* @memberof HandlersMeResponse
*/
is_admin?: boolean;
/**
*
* @type {boolean}
@@ -121,6 +127,7 @@ export function HandlersMeResponseFromJSONTyped(
? undefined
: (json["emails"] as Array<any>).map(ModelsUserEmailFromJSON),
id: json["id"] == null ? undefined : json["id"],
is_admin: json["is_admin"] == null ? undefined : json["is_admin"],
is_disabled: json["is_disabled"] == null ? undefined : json["is_disabled"],
organizations:
json["organizations"] == null
@@ -157,6 +164,7 @@ export function HandlersMeResponseToJSONTyped(
? undefined
: (value["emails"] as Array<any>).map(ModelsUserEmailToJSON),
id: value["id"],
is_admin: value["is_admin"],
is_disabled: value["is_disabled"],
organizations:
value["organizations"] == null

View File

@@ -43,6 +43,12 @@ export interface ModelsUser {
* @memberof ModelsUser
*/
id?: string;
/**
*
* @type {boolean}
* @memberof ModelsUser
*/
is_admin?: boolean;
/**
*
* @type {boolean}
@@ -88,6 +94,7 @@ export function ModelsUserFromJSONTyped(
display_name:
json["display_name"] == null ? undefined : json["display_name"],
id: json["id"] == null ? undefined : json["id"],
is_admin: json["is_admin"] == null ? undefined : json["is_admin"],
is_disabled: json["is_disabled"] == null ? undefined : json["is_disabled"],
primary_email:
json["primary_email"] == null ? undefined : json["primary_email"],
@@ -116,6 +123,7 @@ export function ModelsUserToJSONTyped(
: value["created_at"].toISOString(),
display_name: value["display_name"],
id: value["id"],
is_admin: value["is_admin"],
is_disabled: value["is_disabled"],
primary_email: value["primary_email"],
updated_at:

View File

@@ -2,20 +2,26 @@
/* eslint-disable */
export * from "./DtoAnnotationResponse";
export * from "./DtoAuthStartResponse";
export * from "./DtoCreateAnnotationRequest";
export * from "./DtoCreateLabelRequest";
export * from "./DtoCreateSSHRequest";
export * from "./DtoCreateServerRequest";
export * from "./DtoCreateTaintRequest";
export * from "./DtoJWK";
export * from "./DtoJWKS";
export * from "./DtoJob";
export * from "./DtoJobStatus";
export * from "./DtoLabelResponse";
export * from "./DtoLogoutRequest";
export * from "./DtoPageJob";
export * from "./DtoQueueInfo";
export * from "./DtoRefreshRequest";
export * from "./DtoServerResponse";
export * from "./DtoSshResponse";
export * from "./DtoSshRevealResponse";
export * from "./DtoTaintResponse";
export * from "./DtoTokenPair";
export * from "./DtoUpdateAnnotationRequest";
export * from "./DtoUpdateLabelRequest";
export * from "./DtoUpdateServerRequest";
export * from "./DtoUpdateTaintRequest";