Update Types

This commit is contained in:
ingalls
2025-12-01 19:07:17 -07:00
parent ad54e29164
commit 442e0b2d9b
2 changed files with 395 additions and 348 deletions

View File

@@ -40,7 +40,7 @@
<TablerLoading
v-if='loading'
desc='Loading Palettes'
desc='Loading Templates'
/>
<TablerAlert
v-else-if='error'
@@ -48,7 +48,7 @@
/>
<TablerNone
v-else-if='!list.items.length'
label='Palettes'
label='Templates'
:create='false'
/>
<div
@@ -101,7 +101,7 @@
import { ref, watch, onMounted } from 'vue';
import { useRouter } from 'vue-router';
import { std, stdurl, stdclick } from '../../../src/std.ts';
import type { PaletteList, Palette } from '../../../src/types.ts';
import type { MissionTemplateList, MissionTemplate } from '../../../src/types.ts';
import TableHeader from '../util/TableHeader.vue'
import TableFooter from '../util/TableFooter.vue'
import {
@@ -116,7 +116,7 @@ import {
IconRefresh,
} from '@tabler/icons-vue'
type Header = { name: keyof Palette, display: boolean };
type Header = { name: keyof MissionTemplate, display: boolean };
const router = useRouter();
@@ -132,7 +132,7 @@ const paging = ref({
page: 0
});
const list = ref<PaletteList>({
const list = ref<MissionTemplateList>({
total: 0,
items: []
});
@@ -142,14 +142,14 @@ watch(paging.value, async () => {
});
onMounted(async () => {
await listPaletteSchema();
await listMissionTemplateSchema();
await fetchList();
});
async function listPaletteSchema() {
const schema = await std('/api/schema?method=GET&url=/palette');
async function listMissionTemplateSchema() {
const schema = await std('/api/schema?method=GET&url=/template/mission');
const defaults: Array<keyof Palette> = ['name'];
const defaults: Array<keyof MissionTemplate> = ['name'];
header.value = defaults.map((h) => {
return { name: h, display: true };
});
@@ -173,13 +173,13 @@ async function fetchList() {
error.value = undefined;
try {
const url = stdurl('/api/palette');
const url = stdurl('/api/template/mission');
url.searchParams.append('filter', paging.value.filter);
url.searchParams.append('limit', String(paging.value.limit));
url.searchParams.append('page', String(paging.value.page));
url.searchParams.append('sort', paging.value.sort);
list.value = await std(url) as PaletteList;
list.value = await std(url) as MissionTemplateList;
} catch (err) {
error.value = err instanceof Error ? err : new Error(String(err));
} finally {

View File

@@ -4410,6 +4410,9 @@ export interface paths {
milsym?: {
id: string;
};
milicon?: {
id: string;
};
mission?: {
type?: string;
tool?: string;
@@ -4842,6 +4845,9 @@ export interface paths {
milsym?: {
id: string;
};
milicon?: {
id: string;
};
mission?: {
type?: string;
tool?: string;
@@ -5273,6 +5279,9 @@ export interface paths {
milsym?: {
id: string;
};
milicon?: {
id: string;
};
mission?: {
type?: string;
tool?: string;
@@ -5530,6 +5539,9 @@ export interface paths {
milsym?: {
id: string;
};
milicon?: {
id: string;
};
mission?: {
type?: string;
tool?: string;
@@ -5874,6 +5886,9 @@ export interface paths {
milsym?: {
id: string;
};
milicon?: {
id: string;
};
mission?: {
type?: string;
tool?: string;
@@ -6227,6 +6242,9 @@ export interface paths {
milsym?: {
id: string;
};
milicon?: {
id: string;
};
mission?: {
type?: string;
tool?: string;
@@ -15256,340 +15274,6 @@ export interface paths {
patch?: never;
trace?: never;
};
"/api/ldap/channel": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/** List Channels by proxy */
get: {
parameters: {
query: {
/** @description No Description */
agency?: number;
/** @description No Description */
filter: string;
};
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
total: number;
items: {
id: number;
rdn: string;
name: string;
description: unknown;
}[];
};
};
};
/** @description Error Response */
400: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
401: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
404: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
500: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
};
};
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/ldap/user": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/** Create a machine user */
post: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": {
name: string;
description: string;
agency_id: number | null;
channels: {
id: number;
access: "write" | "read" | "duplex";
}[];
};
};
};
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
integrationId?: number;
auth: {
ca?: string[];
/** @description PEM formatted client certificate */
cert: string;
/** @description PEM formatted private key */
key: string;
};
};
};
};
/** @description Error Response */
400: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
401: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
404: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
500: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
};
};
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/ldap/user/{:email}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
/** Reset the password on an existing user and regen a certificate */
put: {
parameters: {
query?: never;
header?: never;
path: {
/** @description No Description */
":email": string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
integrationId?: number;
auth: {
ca?: string[];
/** @description PEM formatted client certificate */
cert: string;
/** @description PEM formatted private key */
key: string;
};
};
};
};
/** @description Error Response */
400: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
401: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
404: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
500: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
};
};
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/iconset": {
parameters: {
query?: never;
@@ -16395,7 +16079,7 @@ export interface paths {
/** @description No Description */
":iconset": string;
/** @description No Description */
":icon": number;
":icon": number | string;
};
cookie?: never;
};
@@ -16887,6 +16571,340 @@ export interface paths {
patch?: never;
trace?: never;
};
"/api/ldap/channel": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/** List Channels by proxy */
get: {
parameters: {
query: {
/** @description No Description */
agency?: number;
/** @description No Description */
filter: string;
};
header?: never;
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
total: number;
items: {
id: number;
rdn: string;
name: string;
description: unknown;
}[];
};
};
};
/** @description Error Response */
400: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
401: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
404: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
500: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
};
};
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/ldap/user": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
put?: never;
/** Create a machine user */
post: {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": {
name: string;
description: string;
agency_id: number | null;
channels: {
id: number;
access: "write" | "read" | "duplex";
}[];
};
};
};
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
integrationId?: number;
auth: {
ca?: string[];
/** @description PEM formatted client certificate */
cert: string;
/** @description PEM formatted private key */
key: string;
};
};
};
};
/** @description Error Response */
400: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
401: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
404: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
500: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
};
};
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/ldap/user/{:email}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
get?: never;
/** Reset the password on an existing user and regen a certificate */
put: {
parameters: {
query?: never;
header?: never;
path: {
/** @description No Description */
":email": string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
integrationId?: number;
auth: {
ca?: string[];
/** @description PEM formatted client certificate */
cert: string;
/** @description PEM formatted private key */
key: string;
};
};
};
};
/** @description Error Response */
400: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
401: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
403: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
404: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
/** @description Error Response */
500: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
status: number;
message: string;
};
};
};
};
};
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/login": {
parameters: {
query?: never;
@@ -17398,6 +17416,9 @@ export interface paths {
milsym?: {
id: string;
};
milicon?: {
id: string;
};
mission?: {
type?: string;
tool?: string;
@@ -17749,6 +17770,9 @@ export interface paths {
milsym?: {
id: string;
};
milicon?: {
id: string;
};
mission?: {
type?: string;
tool?: string;
@@ -18774,10 +18798,15 @@ export interface paths {
path?: never;
cookie?: never;
};
/** Helper API to add a log to a mission */
/** Helper API to list Mission Logs */
get: {
parameters: {
query?: never;
query: {
/** @description The response format to return */
format: "json" | "csv";
/** @description If set, the response will include a Content-Disposition Header */
download: boolean;
};
header?: never;
path: {
/** @description No Description */
@@ -19566,6 +19595,9 @@ export interface paths {
milsym?: {
id: string;
};
milicon?: {
id: string;
};
mission?: {
type?: string;
tool?: string;
@@ -25590,6 +25622,9 @@ export interface paths {
milsym?: {
id: string;
};
milicon?: {
id: string;
};
mission?: {
type?: string;
tool?: string;
@@ -25913,6 +25948,9 @@ export interface paths {
milsym?: {
id: string;
};
milicon?: {
id: string;
};
mission?: {
type?: string;
tool?: string;
@@ -26164,6 +26202,9 @@ export interface paths {
milsym?: {
id: string;
};
milicon?: {
id: string;
};
mission?: {
type?: string;
tool?: string;
@@ -26591,6 +26632,9 @@ export interface paths {
milsym?: {
id: string;
};
milicon?: {
id: string;
};
mission?: {
type?: string;
tool?: string;
@@ -33323,6 +33367,9 @@ export interface paths {
milsym?: {
id: string;
};
milicon?: {
id: string;
};
mission?: {
type?: string;
tool?: string;