chore: Add allDevices query resolver, update Zabbix device query handling, and enhance schema with DeviceConfig and WidgetPreview types

This commit is contained in:
Andreas Hilbig 2026-01-20 17:10:08 +01:00
parent c1035cd614
commit e641f8e610
7 changed files with 200 additions and 33 deletions

39
.idea/workspace.xml generated
View file

@ -4,8 +4,14 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="d7a71994-2699-4ae4-9fd2-ee13b7f33d35" name="Changes" comment="chore: Update `tags` field schema to use `DeviceConfig`, enhance `isDevice` type check, and adjust IntelliJ workspace"> <list default="true" id="d7a71994-2699-4ae4-9fd2-ee13b7f33d35" name="Changes" comment="chore: Enhance schema with `DeviceConfig` tags resolver and update IntelliJ workspace adjustments">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/schema/devices.graphql" beforeDir="false" afterPath="$PROJECT_DIR$/schema/devices.graphql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/schema/queries.graphql" beforeDir="false" afterPath="$PROJECT_DIR$/schema/queries.graphql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/api/resolvers.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/api/resolvers.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/datasources/zabbix-hosts.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/datasources/zabbix-hosts.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/datasources/zabbix-request.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/datasources/zabbix-request.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/schema/generated/graphql.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/schema/generated/graphql.ts" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -46,7 +52,7 @@
"NIXITCH_NIX_PROFILES": "", "NIXITCH_NIX_PROFILES": "",
"NIXITCH_NIX_REMOTE": "", "NIXITCH_NIX_REMOTE": "",
"NIXITCH_NIX_USER_PROFILE_DIR": "", "NIXITCH_NIX_USER_PROFILE_DIR": "",
"Node.js.index.ts.executor": "Run", "Node.js.index.ts.executor": "Debug",
"RunOnceActivity.MCP Project settings loaded": "true", "RunOnceActivity.MCP Project settings loaded": "true",
"RunOnceActivity.ShowReadmeOnStart": "true", "RunOnceActivity.ShowReadmeOnStart": "true",
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true", "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
@ -64,6 +70,7 @@
"node.js.selected.package.tslint": "(autodetect)", "node.js.selected.package.tslint": "(autodetect)",
"nodejs_interpreter_path": "wsl://Ubuntu@/home/ahilbig/.nvm/versions/node/v24.12.0/bin/node", "nodejs_interpreter_path": "wsl://Ubuntu@/home/ahilbig/.nvm/versions/node/v24.12.0/bin/node",
"nodejs_package_manager_path": "npm", "nodejs_package_manager_path": "npm",
"npm.codegen.executor": "Run",
"npm.compile.executor": "Run", "npm.compile.executor": "Run",
"npm.copy-schema.executor": "Run", "npm.copy-schema.executor": "Run",
"npm.prod.executor": "Run", "npm.prod.executor": "Run",
@ -152,7 +159,8 @@
<updated>1768273021451</updated> <updated>1768273021451</updated>
<workItem from="1768273025985" duration="11343000" /> <workItem from="1768273025985" duration="11343000" />
<workItem from="1768380302361" duration="9751000" /> <workItem from="1768380302361" duration="9751000" />
<workItem from="1768551040782" duration="5628000" /> <workItem from="1768551040782" duration="6556000" />
<workItem from="1768913192173" duration="7156000" />
</task> </task>
<task id="LOCAL-00001" summary="chore: Update IntelliJ workspace settings and add GitHub Actions workflow for Docker deployment"> <task id="LOCAL-00001" summary="chore: Update IntelliJ workspace settings and add GitHub Actions workflow for Docker deployment">
<option name="closed" value="true" /> <option name="closed" value="true" />
@ -258,7 +266,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1768591454965</updated> <updated>1768591454965</updated>
</task> </task>
<option name="localTasksCounter" value="14" /> <task id="LOCAL-00014" summary="chore: Enhance schema with `DeviceConfig` tags resolver and update IntelliJ workspace adjustments">
<option name="closed" value="true" />
<created>1768592274523</created>
<option name="number" value="00014" />
<option name="presentableId" value="LOCAL-00014" />
<option name="project" value="LOCAL" />
<updated>1768592274523</updated>
</task>
<option name="localTasksCounter" value="15" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@ -291,6 +307,19 @@
<MESSAGE value="chore: Use DeviceConfig type instead of JSONObject scalar for tags - attribute of devices" /> <MESSAGE value="chore: Use DeviceConfig type instead of JSONObject scalar for tags - attribute of devices" />
<MESSAGE value="chore: Use DeviceConfig type instead of JSONObject scalar for tags - attribute of devices " /> <MESSAGE value="chore: Use DeviceConfig type instead of JSONObject scalar for tags - attribute of devices " />
<MESSAGE value="chore: Update `tags` field schema to use `DeviceConfig`, enhance `isDevice` type check, and adjust IntelliJ workspace" /> <MESSAGE value="chore: Update `tags` field schema to use `DeviceConfig`, enhance `isDevice` type check, and adjust IntelliJ workspace" />
<option name="LAST_COMMIT_MESSAGE" value="chore: Update `tags` field schema to use `DeviceConfig`, enhance `isDevice` type check, and adjust IntelliJ workspace" /> <MESSAGE value="chore: Enhance schema with `DeviceConfig` tags resolver and update IntelliJ workspace adjustments" />
<option name="LAST_COMMIT_MESSAGE" value="chore: Enhance schema with `DeviceConfig` tags resolver and update IntelliJ workspace adjustments" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="javascript">
<url>file://$PROJECT_DIR$/src/datasources/zabbix-hosts.ts</url>
<line>149</line>
<properties lambdaOrdinal="-1" />
<option name="timeStamp" value="1" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component> </component>
</project> </project>

View file

@ -78,3 +78,4 @@ type GenericDevice implements Host & Device {
tags: DeviceConfig tags: DeviceConfig
state: GenericDeviceState state: GenericDeviceState
} }

View file

@ -34,6 +34,16 @@ type Query {
allHosts(name_pattern: String = "", filter_host: String = null, hostids: Int, allHosts(name_pattern: String = "", filter_host: String = null, hostids: Int,
groupids:[Int!] = null, with_items: Boolean = false, tag_deviceType:[String]=[], tag_hostType:[String!]): [Host] groupids:[Int!] = null, with_items: Boolean = false, tag_deviceType:[String]=[], tag_hostType:[String!]): [Host]
"""
Get all devices + corresponding items. Devices are modelled as hosts having a device type + a state.
If with_items==true only hosts with attached items are delivered
name_pattern: If provided this will perform a LIKE "%…%" search on the name attribute within the database.
Authentication: By zbx_session - cookie or zabbix-auth-token - header
"""
allDevices(name_pattern: String = "", filter_host: String = null, hostids: Int,
groupids:[Int!] = null, with_items: Boolean = false, tag_deviceType:[String]=[], tag_hostType:[String!]): [Device]
""" """
Get all host groups. Get all host groups.
If with_hosts==true only groups with attached hosts are delivered. If with_hosts==true only groups with attached hosts are delivered.

View file

@ -1,4 +1,5 @@
import { import {
Device,
DeviceCommunicationType, DeviceCommunicationType,
DeviceStatus, DeviceStatus,
Host, Host,
@ -6,7 +7,7 @@ import {
MutationImportHostGroupsArgs, MutationImportHostGroupsArgs,
MutationImportHostsArgs, MutationImportHostsArgs,
MutationImportUserRightsArgs, MutationImportUserRightsArgs,
Permission, Permission, QueryAllDevicesArgs,
QueryAllHostGroupsArgs, QueryAllHostGroupsArgs,
QueryAllHostsArgs, QueryAllHostsArgs,
QueryExportHostValueHistoryArgs, QueryExportHostValueHistoryArgs,
@ -21,7 +22,11 @@ import {HostImporter} from "../execution/host_importer.js";
import {HostValueExporter} from "../execution/host_exporter.js"; import {HostValueExporter} from "../execution/host_exporter.js";
import {logger} from "../logging/logger.js"; import {logger} from "../logging/logger.js";
import {ParsedArgs, ZabbixRequest} from "../datasources/zabbix-request.js"; import {ParsedArgs, ZabbixRequest} from "../datasources/zabbix-request.js";
import {ZabbixCreateHostRequest, ZabbixQueryHostsRequestWithItemsAndInventory,} from "../datasources/zabbix-hosts.js"; import {
ZabbixCreateHostRequest,
ZabbixQueryDevices, ZabbixQueryDevicesArgs,
ZabbixQueryHostsRequestWithItemsAndInventory,
} from "../datasources/zabbix-hosts.js";
import {ZabbixQueryHostgroupsParams, ZabbixQueryHostgroupsRequest} from "../datasources/zabbix-hostgroups.js"; import {ZabbixQueryHostgroupsParams, ZabbixQueryHostgroupsRequest} from "../datasources/zabbix-hostgroups.js";
import { import {
ZabbixExportUserGroupArgs, ZabbixExportUserGroupArgs,
@ -82,7 +87,17 @@ export function createResolvers(): Resolvers {
dataSources.zabbixAPI, new ParsedArgs(args) dataSources.zabbixAPI, new ParsedArgs(args)
) )
}, },
allDevices: async (_parent: any, args: QueryAllDevicesArgs, {
zabbixAuthToken,
cookie, dataSources
}: any) => {
args.tag_hostType ??= [ZABBIX_EDGE_DEVICE_BASE_GROUP];
return await new ZabbixQueryDevices(zabbixAuthToken, cookie)
.executeRequestThrowError(
dataSources.zabbixAPI, new ZabbixQueryDevicesArgs(args)
)
},
allHostGroups: async (_parent: any, args: QueryAllHostGroupsArgs, { allHostGroups: async (_parent: any, args: QueryAllHostGroupsArgs, {
zabbixAuthToken, zabbixAuthToken,
cookie cookie
@ -179,6 +194,19 @@ export function createResolvers(): Resolvers {
return "GenericDevice" return "GenericDevice"
} }
}, },
Device: {
// @ts-ignore
__resolveType: function (host: Device, _context, info ): string {
const deviceType = host.deviceType!;
logger.info(`checking host ${host.name} for deviceType - found ${deviceType}`);
let interfaceType: GraphQLInterfaceType = (info.returnType instanceof GraphQLList ?
info.returnType.ofType : info.returnType) as GraphQLInterfaceType
if (info.schema.getImplementations(interfaceType).objects.some((impl: { name: string; }) => impl.name === deviceType)) {
return deviceType;
}
return "GenericDevice"
}
},
Inventory: { Inventory: {
/* /*

View file

@ -1,4 +1,4 @@
import {CreateHostResponse, Host, ZabbixHost} from "../schema/generated/graphql.js"; import {CreateHostResponse, Device, Host, ZabbixHost} from "../schema/generated/graphql.js";
import {ZabbixAPI} from "./zabbix-api.js"; import {ZabbixAPI} from "./zabbix-api.js";
import { import {
isZabbixErrorResult, isZabbixErrorResult,
@ -9,16 +9,17 @@ import {
ZabbixResult ZabbixResult
} from "./zabbix-request.js"; } from "./zabbix-request.js";
import {ZabbixHistoryGetParams, ZabbixQueryHistoryRequest} from "./zabbix-history.js"; import {ZabbixHistoryGetParams, ZabbixQueryHistoryRequest} from "./zabbix-history.js";
import {isArray} from "node:util";
export class ZabbixQueryHostsGenericRequest<T extends ZabbixResult> extends ZabbixRequest<T> { export class ZabbixQueryHostsGenericRequest<T extends ZabbixResult, A extends ParsedArgs = ParsedArgs> extends ZabbixRequest<T, A> {
public static PATH = "host.get"; public static PATH = "host.get";
constructor(path: string, authToken?: string | null, cookie?: string | null) { constructor(path: string, authToken?: string | null, cookie?: string | null) {
super(path, authToken, cookie); super(path, authToken, cookie);
} }
createZabbixParams(args?: ParsedArgs): ZabbixParams { createZabbixParams(args?: A): ZabbixParams {
return { return {
...super.createZabbixParams(args), ...super.createZabbixParams(args),
selectParentTemplates: [ selectParentTemplates: [
@ -63,12 +64,12 @@ export class ZabbixQueryHostsMetaRequest extends ZabbixQueryHostsGenericRequest<
} }
export class ZabbixQueryHostsGenericRequestWithItems<T extends ZabbixResult> extends ZabbixQueryHostsGenericRequest<T> { export class ZabbixQueryHostsGenericRequestWithItems<T extends ZabbixResult, A extends ParsedArgs = ParsedArgs> extends ZabbixQueryHostsGenericRequest<T, A> {
constructor(path: string, authToken?: string | null, cookie?: string) { constructor(path: string, authToken?: string | null, cookie?: string) {
super(path, authToken, cookie); super(path, authToken, cookie);
} }
createZabbixParams(args?: ParsedArgs): ZabbixParams { createZabbixParams(args?: A): ZabbixParams {
return { return {
...super.createZabbixParams(args), ...super.createZabbixParams(args),
selectItems: [ selectItems: [
@ -93,7 +94,7 @@ export class ZabbixQueryHostsGenericRequestWithItems<T extends ZabbixResult> ext
}; };
} }
async executeRequestReturnError(zabbixAPI: ZabbixAPI, args?: ParsedArgs): Promise<ZabbixErrorResult | T> { async executeRequestReturnError(zabbixAPI: ZabbixAPI, args?: A): Promise<ZabbixErrorResult | T> {
let result = await super.executeRequestReturnError(zabbixAPI, args); let result = await super.executeRequestReturnError(zabbixAPI, args);
if (result && !isZabbixErrorResult(result)) { if (result && !isZabbixErrorResult(result)) {
@ -123,12 +124,12 @@ export class ZabbixQueryHostsGenericRequestWithItems<T extends ZabbixResult> ext
} }
} }
export class ZabbixQueryHostsGenericRequestWithItemsAndInventory<T extends ZabbixResult> extends ZabbixQueryHostsGenericRequestWithItems<T> { export class ZabbixQueryHostsGenericRequestWithItemsAndInventory<T extends ZabbixResult, A extends ParsedArgs = ParsedArgs> extends ZabbixQueryHostsGenericRequestWithItems<T, A> {
constructor(path: string, authToken?: string | null, cookie?: string) { constructor(path: string, authToken?: string | null, cookie?: string) {
super(path, authToken, cookie); super(path, authToken, cookie);
} }
createZabbixParams(args?: ParsedArgs): ZabbixParams { createZabbixParams(args?: A): ZabbixParams {
return { return {
...super.createZabbixParams(args), ...super.createZabbixParams(args),
selectInventory: [ selectInventory: [
@ -144,6 +145,22 @@ export class ZabbixQueryHostsRequestWithItemsAndInventory extends ZabbixQueryHos
} }
} }
export class ZabbixQueryDevicesArgs extends ParsedArgs {
constructor(public args?: any) {
if (!args?.tag_deviceType ||
(Array.isArray(args.tag_deviceType) && !args.tag_deviceType.length)) {
args.tag_deviceType_exists = true;
}
super(args);
}
}
export class ZabbixQueryDevices extends ZabbixQueryHostsGenericRequestWithItemsAndInventory<Device[], ZabbixQueryDevicesArgs> {
constructor(authToken?: string | null, cookie?: string) {
super("host.get.with_items", authToken, cookie);
}
}
const isZabbixCreateHostInputParams = (value: ZabbixParams): value is ZabbixCreateHostInputParams => "host" in value && !!value.host; const isZabbixCreateHostInputParams = (value: ZabbixParams): value is ZabbixCreateHostInputParams => "host" in value && !!value.host;
export interface ZabbixCreateHostInputParams extends ZabbixParams { export interface ZabbixCreateHostInputParams extends ZabbixParams {

View file

@ -28,7 +28,7 @@ export interface ZabbixParams {
} }
export interface ZabbixWithTagsParams extends ZabbixParams { export interface ZabbixWithTagsParams extends ZabbixParams {
tags?: { tag: string; operator: number; value: any; }[] tags?: { tag: string; operator: number; value?: any; }[]
} }
export class ParsedArgs { export class ParsedArgs {
@ -72,12 +72,18 @@ export class ParsedArgs {
} }
delete args.groupidsbase delete args.groupidsbase
} }
let filterTagStatements: { tag: string; operator: number; value: any; }[] = [] let filterTagStatements: { tag: string; operator: number; value?: any; }[] = []
let filterStatements = {} let filterStatements = {}
for (let argsKey in args) { for (let argsKey in args) {
// @ts-ignore // @ts-ignore
let argsValue = args[argsKey] let argsValue = args[argsKey]
if (argsKey.startsWith("tag_") && argsValue !== null) { if (argsKey.startsWith("tag_")) {
if (argsKey.endsWith("_exists")) {
filterTagStatements.push({
"tag": argsKey.slice(4, -7),
"operator": argsValue ? 4 : 5
})
} else if (argsValue !== null) {
let argsArray = Array.isArray(argsValue) ? argsValue : [argsValue] let argsArray = Array.isArray(argsValue) ? argsValue : [argsValue]
argsArray.forEach((tagValue) => { argsArray.forEach((tagValue) => {
filterTagStatements.push({ filterTagStatements.push({
@ -86,6 +92,8 @@ export class ParsedArgs {
"value": tagValue, "value": tagValue,
}) })
}) })
}
// @ts-ignore // @ts-ignore
delete args[argsKey] delete args[argsKey]
} }
@ -121,9 +129,9 @@ export class ParsedArgs {
if (this.name_pattern) { if (this.name_pattern) {
if ("search" in result) { if ("search" in result) {
(<any> result.search).name = this.name_pattern (<any>result.search).name = this.name_pattern
} else { } else {
(<any> result).search = { (<any>result).search = {
name: this.name_pattern, name: this.name_pattern,
} }
} }
@ -184,7 +192,6 @@ export class ZabbixRequest<T extends ZabbixResult, A extends ParsedArgs = Parsed
} }
async prepare(zabbixAPI: ZabbixAPI, _args?: A): Promise<T | ZabbixErrorResult | undefined> { async prepare(zabbixAPI: ZabbixAPI, _args?: A): Promise<T | ZabbixErrorResult | undefined> {
// If prepare returns something else than undefined, the execution will be skipped and the // If prepare returns something else than undefined, the execution will be skipped and the
// result returned // result returned

View file

@ -93,11 +93,16 @@ export interface Device {
hostid: Scalars['ID']['output']; hostid: Scalars['ID']['output'];
name?: Maybe<Scalars['String']['output']>; name?: Maybe<Scalars['String']['output']>;
state?: Maybe<DeviceState>; state?: Maybe<DeviceState>;
tags?: Maybe<Scalars['JSONObject']['output']>; tags?: Maybe<DeviceConfig>;
} }
export { DeviceCommunicationType }; export { DeviceCommunicationType };
export interface DeviceConfig {
__typename?: 'DeviceConfig';
deviceWidgetPreview?: Maybe<WidgetPreview>;
}
export interface DeviceState { export interface DeviceState {
operational?: Maybe<OperationalDeviceData>; operational?: Maybe<OperationalDeviceData>;
} }
@ -145,6 +150,17 @@ export interface DeviceValueMessage {
value?: Maybe<DeviceValue>; value?: Maybe<DeviceValue>;
} }
export interface DisplayFieldSpec {
__typename?: 'DisplayFieldSpec';
emptyValue?: Maybe<Scalars['String']['output']>;
g_unit_transform?: Maybe<Scalars['String']['output']>;
g_value_transform?: Maybe<Scalars['String']['output']>;
key?: Maybe<Scalars['String']['output']>;
unit?: Maybe<Scalars['String']['output']>;
unit_font_size?: Maybe<Scalars['String']['output']>;
value_font_size?: Maybe<Scalars['String']['output']>;
}
export interface Error { export interface Error {
code?: Maybe<Scalars['Int']['output']>; code?: Maybe<Scalars['Int']['output']>;
data?: Maybe<Scalars['JSONObject']['output']>; data?: Maybe<Scalars['JSONObject']['output']>;
@ -168,7 +184,7 @@ export interface GenericDevice extends Device, Host {
hostid: Scalars['ID']['output']; hostid: Scalars['ID']['output'];
name?: Maybe<Scalars['String']['output']>; name?: Maybe<Scalars['String']['output']>;
state?: Maybe<GenericDeviceState>; state?: Maybe<GenericDeviceState>;
tags?: Maybe<Scalars['JSONObject']['output']>; tags?: Maybe<DeviceConfig>;
} }
export interface GenericDeviceState extends DeviceState { export interface GenericDeviceState extends DeviceState {
@ -200,7 +216,6 @@ export interface Host {
hostgroups?: Maybe<Array<HostGroup>>; hostgroups?: Maybe<Array<HostGroup>>;
hostid: Scalars['ID']['output']; hostid: Scalars['ID']['output'];
name?: Maybe<Scalars['String']['output']>; name?: Maybe<Scalars['String']['output']>;
tags?: Maybe<Scalars['JSONObject']['output']>;
} }
export interface HostGroup { export interface HostGroup {
@ -322,6 +337,14 @@ export interface PermissionRequest {
export interface Query { export interface Query {
__typename?: 'Query'; __typename?: 'Query';
/**
* Get all devices + corresponding items. Devices are modelled as hosts having a device type + a state.
* If with_items==true only hosts with attached items are delivered
* name_pattern: If provided this will perform a LIKE "%…%" search on the name attribute within the database.
*
* Authentication: By zbx_session - cookie or zabbix-auth-token - header
*/
allDevices?: Maybe<Array<Maybe<Device>>>;
/** /**
* Get all host groups. * Get all host groups.
* If with_hosts==true only groups with attached hosts are delivered. * If with_hosts==true only groups with attached hosts are delivered.
@ -388,6 +411,17 @@ export interface Query {
} }
export interface QueryAllDevicesArgs {
filter_host?: InputMaybe<Scalars['String']['input']>;
groupids?: InputMaybe<Array<Scalars['Int']['input']>>;
hostids?: InputMaybe<Scalars['Int']['input']>;
name_pattern?: InputMaybe<Scalars['String']['input']>;
tag_deviceType?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
tag_hostType?: InputMaybe<Array<Scalars['String']['input']>>;
with_items?: InputMaybe<Scalars['Boolean']['input']>;
}
export interface QueryAllHostGroupsArgs { export interface QueryAllHostGroupsArgs {
search_name?: InputMaybe<Scalars['String']['input']>; search_name?: InputMaybe<Scalars['String']['input']>;
with_hosts?: InputMaybe<Scalars['Boolean']['input']>; with_hosts?: InputMaybe<Scalars['Boolean']['input']>;
@ -564,6 +598,14 @@ export interface UserRoleRulesInput {
ui_default_access?: InputMaybe<Scalars['Int']['input']>; ui_default_access?: InputMaybe<Scalars['Int']['input']>;
} }
export interface WidgetPreview {
__typename?: 'WidgetPreview';
BOTTOM_LEFT?: Maybe<DisplayFieldSpec>;
BOTTOM_RIGHT?: Maybe<DisplayFieldSpec>;
TOP_LEFT?: Maybe<DisplayFieldSpec>;
TOP_RIGHT?: Maybe<DisplayFieldSpec>;
}
export interface ZabbixGroupRight { export interface ZabbixGroupRight {
__typename?: 'ZabbixGroupRight'; __typename?: 'ZabbixGroupRight';
id: Scalars['Int']['output']; id: Scalars['Int']['output'];
@ -710,10 +752,12 @@ export type ResolversTypes = {
DateTime: ResolverTypeWrapper<Scalars['DateTime']['output']>; DateTime: ResolverTypeWrapper<Scalars['DateTime']['output']>;
Device: ResolverTypeWrapper<ResolversInterfaceTypes<ResolversTypes>['Device']>; Device: ResolverTypeWrapper<ResolversInterfaceTypes<ResolversTypes>['Device']>;
DeviceCommunicationType: DeviceCommunicationType; DeviceCommunicationType: DeviceCommunicationType;
DeviceConfig: ResolverTypeWrapper<DeviceConfig>;
DeviceState: ResolverTypeWrapper<ResolversInterfaceTypes<ResolversTypes>['DeviceState']>; DeviceState: ResolverTypeWrapper<ResolversInterfaceTypes<ResolversTypes>['DeviceState']>;
DeviceStatus: DeviceStatus; DeviceStatus: DeviceStatus;
DeviceValue: ResolverTypeWrapper<ResolversInterfaceTypes<ResolversTypes>['DeviceValue']>; DeviceValue: ResolverTypeWrapper<ResolversInterfaceTypes<ResolversTypes>['DeviceValue']>;
DeviceValueMessage: ResolverTypeWrapper<ResolversInterfaceTypes<ResolversTypes>['DeviceValueMessage']>; DeviceValueMessage: ResolverTypeWrapper<ResolversInterfaceTypes<ResolversTypes>['DeviceValueMessage']>;
DisplayFieldSpec: ResolverTypeWrapper<DisplayFieldSpec>;
Error: ResolverTypeWrapper<ResolversInterfaceTypes<ResolversTypes>['Error']>; Error: ResolverTypeWrapper<ResolversInterfaceTypes<ResolversTypes>['Error']>;
ErrorPayload: ResolverTypeWrapper<ErrorPayload>; ErrorPayload: ResolverTypeWrapper<ErrorPayload>;
Float: ResolverTypeWrapper<Scalars['Float']['output']>; Float: ResolverTypeWrapper<Scalars['Float']['output']>;
@ -755,6 +799,7 @@ export type ResolversTypes = {
UserRoleRuleInput: UserRoleRuleInput; UserRoleRuleInput: UserRoleRuleInput;
UserRoleRules: ResolverTypeWrapper<UserRoleRules>; UserRoleRules: ResolverTypeWrapper<UserRoleRules>;
UserRoleRulesInput: UserRoleRulesInput; UserRoleRulesInput: UserRoleRulesInput;
WidgetPreview: ResolverTypeWrapper<WidgetPreview>;
ZabbixGroupRight: ResolverTypeWrapper<ZabbixGroupRight>; ZabbixGroupRight: ResolverTypeWrapper<ZabbixGroupRight>;
ZabbixGroupRightInput: ZabbixGroupRightInput; ZabbixGroupRightInput: ZabbixGroupRightInput;
ZabbixHost: ResolverTypeWrapper<Omit<ZabbixHost, 'items'> & { items?: Maybe<Array<ResolversTypes['ZabbixItem']>> }>; ZabbixHost: ResolverTypeWrapper<Omit<ZabbixHost, 'items'> & { items?: Maybe<Array<ResolversTypes['ZabbixItem']>> }>;
@ -771,9 +816,11 @@ export type ResolversParentTypes = {
CreateHostResponse: CreateHostResponse; CreateHostResponse: CreateHostResponse;
DateTime: Scalars['DateTime']['output']; DateTime: Scalars['DateTime']['output'];
Device: ResolversInterfaceTypes<ResolversParentTypes>['Device']; Device: ResolversInterfaceTypes<ResolversParentTypes>['Device'];
DeviceConfig: DeviceConfig;
DeviceState: ResolversInterfaceTypes<ResolversParentTypes>['DeviceState']; DeviceState: ResolversInterfaceTypes<ResolversParentTypes>['DeviceState'];
DeviceValue: ResolversInterfaceTypes<ResolversParentTypes>['DeviceValue']; DeviceValue: ResolversInterfaceTypes<ResolversParentTypes>['DeviceValue'];
DeviceValueMessage: ResolversInterfaceTypes<ResolversParentTypes>['DeviceValueMessage']; DeviceValueMessage: ResolversInterfaceTypes<ResolversParentTypes>['DeviceValueMessage'];
DisplayFieldSpec: DisplayFieldSpec;
Error: ResolversInterfaceTypes<ResolversParentTypes>['Error']; Error: ResolversInterfaceTypes<ResolversParentTypes>['Error'];
ErrorPayload: ErrorPayload; ErrorPayload: ErrorPayload;
Float: Scalars['Float']['output']; Float: Scalars['Float']['output'];
@ -812,6 +859,7 @@ export type ResolversParentTypes = {
UserRoleRuleInput: UserRoleRuleInput; UserRoleRuleInput: UserRoleRuleInput;
UserRoleRules: UserRoleRules; UserRoleRules: UserRoleRules;
UserRoleRulesInput: UserRoleRulesInput; UserRoleRulesInput: UserRoleRulesInput;
WidgetPreview: WidgetPreview;
ZabbixGroupRight: ZabbixGroupRight; ZabbixGroupRight: ZabbixGroupRight;
ZabbixGroupRightInput: ZabbixGroupRightInput; ZabbixGroupRightInput: ZabbixGroupRightInput;
ZabbixHost: Omit<ZabbixHost, 'items'> & { items?: Maybe<Array<ResolversParentTypes['ZabbixItem']>> }; ZabbixHost: Omit<ZabbixHost, 'items'> & { items?: Maybe<Array<ResolversParentTypes['ZabbixItem']>> };
@ -854,11 +902,16 @@ export type DeviceResolvers<ContextType = any, ParentType extends ResolversParen
hostid?: Resolver<ResolversTypes['ID'], ParentType, ContextType>; hostid?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
name?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>; name?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
state?: Resolver<Maybe<ResolversTypes['DeviceState']>, ParentType, ContextType>; state?: Resolver<Maybe<ResolversTypes['DeviceState']>, ParentType, ContextType>;
tags?: Resolver<Maybe<ResolversTypes['JSONObject']>, ParentType, ContextType>; tags?: Resolver<Maybe<ResolversTypes['DeviceConfig']>, ParentType, ContextType>;
}; };
export type DeviceCommunicationTypeResolvers = EnumResolverSignature<{ DATABASE_MONITOR?: any, DEPENDANT_ITEM?: any, HTTP_AGENT?: any, IPMI_AGENT?: any, JMX_AGENT?: any, SIMPLE_CHECK?: any, SIMULATOR_CALCULATED?: any, SIMULATOR_JAVASCRIPT?: any, SNMP_AGENT?: any, SNMP_TRAP?: any, ZABBIX_AGENT?: any, ZABBIX_AGENT_ACTIVE?: any, ZABBIX_INTERNAL_ITEM?: any, ZABBIX_TRAP?: any }, ResolversTypes['DeviceCommunicationType']>; export type DeviceCommunicationTypeResolvers = EnumResolverSignature<{ DATABASE_MONITOR?: any, DEPENDANT_ITEM?: any, HTTP_AGENT?: any, IPMI_AGENT?: any, JMX_AGENT?: any, SIMPLE_CHECK?: any, SIMULATOR_CALCULATED?: any, SIMULATOR_JAVASCRIPT?: any, SNMP_AGENT?: any, SNMP_TRAP?: any, ZABBIX_AGENT?: any, ZABBIX_AGENT_ACTIVE?: any, ZABBIX_INTERNAL_ITEM?: any, ZABBIX_TRAP?: any }, ResolversTypes['DeviceCommunicationType']>;
export type DeviceConfigResolvers<ContextType = any, ParentType extends ResolversParentTypes['DeviceConfig'] = ResolversParentTypes['DeviceConfig']> = {
deviceWidgetPreview?: Resolver<Maybe<ResolversTypes['WidgetPreview']>, ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};
export type DeviceStateResolvers<ContextType = any, ParentType extends ResolversParentTypes['DeviceState'] = ResolversParentTypes['DeviceState']> = { export type DeviceStateResolvers<ContextType = any, ParentType extends ResolversParentTypes['DeviceState'] = ResolversParentTypes['DeviceState']> = {
__resolveType: TypeResolveFn<'GenericDeviceState', ParentType, ContextType>; __resolveType: TypeResolveFn<'GenericDeviceState', ParentType, ContextType>;
operational?: Resolver<Maybe<ResolversTypes['OperationalDeviceData']>, ParentType, ContextType>; operational?: Resolver<Maybe<ResolversTypes['OperationalDeviceData']>, ParentType, ContextType>;
@ -881,6 +934,17 @@ export type DeviceValueMessageResolvers<ContextType = any, ParentType extends Re
value?: Resolver<Maybe<ResolversTypes['DeviceValue']>, ParentType, ContextType>; value?: Resolver<Maybe<ResolversTypes['DeviceValue']>, ParentType, ContextType>;
}; };
export type DisplayFieldSpecResolvers<ContextType = any, ParentType extends ResolversParentTypes['DisplayFieldSpec'] = ResolversParentTypes['DisplayFieldSpec']> = {
emptyValue?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
g_unit_transform?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
g_value_transform?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
key?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
unit?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
unit_font_size?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
value_font_size?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};
export type ErrorResolvers<ContextType = any, ParentType extends ResolversParentTypes['Error'] = ResolversParentTypes['Error']> = { export type ErrorResolvers<ContextType = any, ParentType extends ResolversParentTypes['Error'] = ResolversParentTypes['Error']> = {
__resolveType: TypeResolveFn<'ApiError', ParentType, ContextType>; __resolveType: TypeResolveFn<'ApiError', ParentType, ContextType>;
code?: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>; code?: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;
@ -902,7 +966,7 @@ export type GenericDeviceResolvers<ContextType = any, ParentType extends Resolve
hostid?: Resolver<ResolversTypes['ID'], ParentType, ContextType>; hostid?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
name?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>; name?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
state?: Resolver<Maybe<ResolversTypes['GenericDeviceState']>, ParentType, ContextType>; state?: Resolver<Maybe<ResolversTypes['GenericDeviceState']>, ParentType, ContextType>;
tags?: Resolver<Maybe<ResolversTypes['JSONObject']>, ParentType, ContextType>; tags?: Resolver<Maybe<ResolversTypes['DeviceConfig']>, ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
}; };
@ -931,7 +995,6 @@ export type HostResolvers<ContextType = any, ParentType extends ResolversParentT
hostgroups?: Resolver<Maybe<Array<ResolversTypes['HostGroup']>>, ParentType, ContextType>; hostgroups?: Resolver<Maybe<Array<ResolversTypes['HostGroup']>>, ParentType, ContextType>;
hostid?: Resolver<ResolversTypes['ID'], ParentType, ContextType>; hostid?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
name?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>; name?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
tags?: Resolver<Maybe<ResolversTypes['JSONObject']>, ParentType, ContextType>;
}; };
export type HostGroupResolvers<ContextType = any, ParentType extends ResolversParentTypes['HostGroup'] = ResolversParentTypes['HostGroup']> = { export type HostGroupResolvers<ContextType = any, ParentType extends ResolversParentTypes['HostGroup'] = ResolversParentTypes['HostGroup']> = {
@ -998,6 +1061,7 @@ export type OperationalDeviceDataResolvers<ContextType = any, ParentType extends
export type PermissionResolvers = EnumResolverSignature<{ DENY?: any, READ?: any, READ_WRITE?: any }, ResolversTypes['Permission']>; export type PermissionResolvers = EnumResolverSignature<{ DENY?: any, READ?: any, READ_WRITE?: any }, ResolversTypes['Permission']>;
export type QueryResolvers<ContextType = any, ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']> = { export type QueryResolvers<ContextType = any, ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']> = {
allDevices?: Resolver<Maybe<Array<Maybe<ResolversTypes['Device']>>>, ParentType, ContextType, RequireFields<QueryAllDevicesArgs, 'filter_host' | 'groupids' | 'name_pattern' | 'tag_deviceType' | 'with_items'>>;
allHostGroups?: Resolver<Maybe<Array<Maybe<ResolversTypes['HostGroup']>>>, ParentType, ContextType, RequireFields<QueryAllHostGroupsArgs, 'with_hosts'>>; allHostGroups?: Resolver<Maybe<Array<Maybe<ResolversTypes['HostGroup']>>>, ParentType, ContextType, RequireFields<QueryAllHostGroupsArgs, 'with_hosts'>>;
allHosts?: Resolver<Maybe<Array<Maybe<ResolversTypes['Host']>>>, ParentType, ContextType, RequireFields<QueryAllHostsArgs, 'filter_host' | 'groupids' | 'name_pattern' | 'tag_deviceType' | 'with_items'>>; allHosts?: Resolver<Maybe<Array<Maybe<ResolversTypes['Host']>>>, ParentType, ContextType, RequireFields<QueryAllHostsArgs, 'filter_host' | 'groupids' | 'name_pattern' | 'tag_deviceType' | 'with_items'>>;
apiVersion?: Resolver<ResolversTypes['String'], ParentType, ContextType>; apiVersion?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
@ -1081,6 +1145,14 @@ export type UserRoleRulesResolvers<ContextType = any, ParentType extends Resolve
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>; __isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
}; };
export type WidgetPreviewResolvers<ContextType = any, ParentType extends ResolversParentTypes['WidgetPreview'] = ResolversParentTypes['WidgetPreview']> = {
BOTTOM_LEFT?: Resolver<Maybe<ResolversTypes['DisplayFieldSpec']>, ParentType, ContextType>;
BOTTOM_RIGHT?: Resolver<Maybe<ResolversTypes['DisplayFieldSpec']>, ParentType, ContextType>;
TOP_LEFT?: Resolver<Maybe<ResolversTypes['DisplayFieldSpec']>, ParentType, ContextType>;
TOP_RIGHT?: Resolver<Maybe<ResolversTypes['DisplayFieldSpec']>, ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};
export type ZabbixGroupRightResolvers<ContextType = any, ParentType extends ResolversParentTypes['ZabbixGroupRight'] = ResolversParentTypes['ZabbixGroupRight']> = { export type ZabbixGroupRightResolvers<ContextType = any, ParentType extends ResolversParentTypes['ZabbixGroupRight'] = ResolversParentTypes['ZabbixGroupRight']> = {
id?: Resolver<ResolversTypes['Int'], ParentType, ContextType>; id?: Resolver<ResolversTypes['Int'], ParentType, ContextType>;
name?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>; name?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
@ -1124,10 +1196,12 @@ export type Resolvers<ContextType = any> = {
DateTime?: GraphQLScalarType; DateTime?: GraphQLScalarType;
Device?: DeviceResolvers<ContextType>; Device?: DeviceResolvers<ContextType>;
DeviceCommunicationType?: DeviceCommunicationTypeResolvers; DeviceCommunicationType?: DeviceCommunicationTypeResolvers;
DeviceConfig?: DeviceConfigResolvers<ContextType>;
DeviceState?: DeviceStateResolvers<ContextType>; DeviceState?: DeviceStateResolvers<ContextType>;
DeviceStatus?: DeviceStatusResolvers; DeviceStatus?: DeviceStatusResolvers;
DeviceValue?: DeviceValueResolvers<ContextType>; DeviceValue?: DeviceValueResolvers<ContextType>;
DeviceValueMessage?: DeviceValueMessageResolvers<ContextType>; DeviceValueMessage?: DeviceValueMessageResolvers<ContextType>;
DisplayFieldSpec?: DisplayFieldSpecResolvers<ContextType>;
Error?: ErrorResolvers<ContextType>; Error?: ErrorResolvers<ContextType>;
ErrorPayload?: ErrorPayloadResolvers<ContextType>; ErrorPayload?: ErrorPayloadResolvers<ContextType>;
GenericDevice?: GenericDeviceResolvers<ContextType>; GenericDevice?: GenericDeviceResolvers<ContextType>;
@ -1156,6 +1230,7 @@ export type Resolvers<ContextType = any> = {
UserRoleModule?: UserRoleModuleResolvers<ContextType>; UserRoleModule?: UserRoleModuleResolvers<ContextType>;
UserRoleRule?: UserRoleRuleResolvers<ContextType>; UserRoleRule?: UserRoleRuleResolvers<ContextType>;
UserRoleRules?: UserRoleRulesResolvers<ContextType>; UserRoleRules?: UserRoleRulesResolvers<ContextType>;
WidgetPreview?: WidgetPreviewResolvers<ContextType>;
ZabbixGroupRight?: ZabbixGroupRightResolvers<ContextType>; ZabbixGroupRight?: ZabbixGroupRightResolvers<ContextType>;
ZabbixHost?: ZabbixHostResolvers<ContextType>; ZabbixHost?: ZabbixHostResolvers<ContextType>;
ZabbixItem?: ZabbixItemResolvers<ContextType>; ZabbixItem?: ZabbixItemResolvers<ContextType>;