From 1c1aeb45197e2e3b32d16281e81ad500fb73eaa5 Mon Sep 17 00:00:00 2001 From: Andreas Hilbig Date: Tue, 13 Jan 2026 14:13:58 +0100 Subject: [PATCH] chore: Update IntelliJ workspace settings and add GitHub Actions workflow for Docker deployment --- .forgejo/workflows/deploy-docker.yaml | 164 ++++ .idea/deployment.xml | 14 + .idea/webServers.xml | 14 + .idea/workspace.xml | 120 ++- src/schema/generated/graphql.ts | 1163 +++++++++++++++++++++++++ 5 files changed, 1470 insertions(+), 5 deletions(-) create mode 100644 .forgejo/workflows/deploy-docker.yaml create mode 100644 .idea/deployment.xml create mode 100644 .idea/webServers.xml create mode 100644 src/schema/generated/graphql.ts diff --git a/.forgejo/workflows/deploy-docker.yaml b/.forgejo/workflows/deploy-docker.yaml new file mode 100644 index 0000000..1d54975 --- /dev/null +++ b/.forgejo/workflows/deploy-docker.yaml @@ -0,0 +1,164 @@ +# .forgejo/workflows/deploy-docker.yaml +name: Prototype deployment +run-name: ${{ github.actor }} is deploying.. +on: + push: + +env: + API_VERSION: "unknown" + ENV: "develop" + DEBUG_WORKFLOW: "false" + IMAGE_TAG: forgejo.tooling.hilbigit.com/vcr/zabbix-graphql-api:${{ env.API_VERSION }} +jobs: + RunNpmBuildAndTestLocally: + runs-on: + - develop-build + container: + image: forgejo.tooling.hilbigit.com/omidevco/builder:latest + credentials: + username: ${{ secrets.DOCKER_REGISTRY_USER }} + password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} + steps: + - name: Display current ref + run: "echo Current ref=${{ github.ref }}, ref_name=${{ github.ref_name }}, env.DEBUG_WORKFLOW=${{ env.DEBUG_WORKFLOW }}" + + - name: Prepare apk packages + run: apk update && apk add --no-cache nodejs npm git + + - name: Checkout (needs git) + uses: actions/checkout@v4 + + - name: Run build + dry-run to test node prod installation + run: npm install;npm run compile;DRY_RUN=1 npm run prod + + - name: Run test + if: ${{ vars.SKIP_TESTS != 'true' }} + run: npm run test + + BuildAndPushDockerImage: + runs-on: + - develop-build + - docker + container: + image: forgejo.tooling.hilbigit.com/omidevco/builder:latest + credentials: + username: ${{ secrets.DOCKER_REGISTRY_USER }} + password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} + steps: + - name: Checkout (needs git) + uses: actions/checkout@v4 + + - name: Determine and store version - all branches except prod + if: ${{ github.ref_name != 'prod' }} + run: | + API_VERSION="$(git describe --tags --always)" + LATEST_TAG=latest + echo "Building ${{ github.ref_name }}, apiVersion=${API_VERSION}, latestTag=${LATEST_TAG}, GITHUB_WORKSPACE=$GITHUB_WORKSPACE, storing in GITHUB_ENV=$GITHUB_ENV" + echo "API_VERSION=$API_VERSION" >> setApiVersion.sh + echo "LATEST_TAG=$LATEST_TAG" >> setApiVersion.sh + + - name: Determine and store version - prod + if: ${{ github.ref_name == 'prod' }} + run: | + API_VERSION="$(git describe --tags --always)" + LATEST_TAG=latest-prod + echo "Building ${{ github.ref_name }}, apiVersion=${API_VERSION}, latestTag=${LATEST_TAG}, GITHUB_WORKSPACE=$GITHUB_WORKSPACE, storing in GITHUB_ENV=$GITHUB_ENV" + echo "API_VERSION=$API_VERSION" >> setApiVersion.sh + echo "LATEST_TAG=$LATEST_TAG" >> setApiVersion.sh + + - name: Upload api version number + uses: actions/upload-artifact@v3 + with: + name: setApiVersion + path: setApiVersion.sh + + - name: Set version number in $GITHUB_ENV + run: | + set -x + . ./setApiVersion.sh + echo "Building apiVersion=${API_VERSION}, latestTag=${LATEST_TAG}, storing in GITHUB_ENV=$GITHUB_ENV" + echo "API_VERSION=$API_VERSION" >> "$GITHUB_ENV" + echo "LATEST_TAG=$LATEST_TAG" >> "$GITHUB_ENV" + + - name: Set up Docker Buildx + if: ${{ github.ref_name == 'main' || github.ref_name == 'prod' || env.DEBUG_WORKFLOW == 'true' }} + uses: docker/setup-buildx-action@v3 + with: + platforms: linux/arm64 + + - name: Login to Forgejo Container Registry + if: ${{ github.ref_name == 'main' || github.ref_name == 'prod' || env.DEBUG_WORKFLOW == 'true' }} + uses: docker/login-action@v3 + with: + registry: forgejo.tooling.hilbigit.com + username: ${{ secrets.DOCKER_REGISTRY_USER }} + password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} + + - name: Building and pushing image + if: ${{ github.ref_name == 'main' || github.ref_name == 'prod' || env.DEBUG_WORKFLOW == 'true' }} + uses: docker/build-push-action@v5 + with: + context: . + build-args: | + API_VERSION=${{ env.API_VERSION }} + push: true + tags: ${{ env.IMAGE_TAG }}:${{ env.API_VERSION }} + platforms: linux/arm64 + + TriggerDeploymentAndSmoketest: + runs-on: docker-develop + needs: + - BuildAndPushDockerImage + - RunNpmBuildAndTestLocally + env: + ZABBIX_BASE_URL: "http://zabbix-web-internal:8080" + container: + image: forgejo.tooling.hilbigit.com/omidevco/builder:latest + credentials: + username: ${{ secrets.DOCKER_REGISTRY_USER }} + password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} + steps: + - name: Checkout (needs git) + uses: actions/checkout@v4 + + - name: Prepare apk packages + run: apk update && apk add --no-cache curl + + - name: Download version number + uses: actions/download-artifact@v3 + with: + name: setApiVersion + + - name: Set version number in $GITHUB_ENV + run: | + set -x + . ./setApiVersion.sh + echo "Building apiVersion=${API_VERSION}, latestTag=${LATEST_TAG}, storing in GITHUB_ENV=$GITHUB_ENV" + echo "API_VERSION=$API_VERSION" >> "$GITHUB_ENV" + echo "LATEST_TAG=$LATEST_TAG" >> "$GITHUB_ENV" + + - name: Login to Forgejo Container Registry + if: ${{ github.ref_name == 'main' || github.ref_name == 'prod' || env.DEBUG_WORKFLOW == 'true' }} + uses: docker/login-action@v3 + with: + registry: forgejo.tooling.hilbigit.com + username: ${{ secrets.DOCKER_REGISTRY_USER }} + password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} + + - name: Set latest tag + if: ${{ github.ref_name == 'main' || github.ref_name == 'prod' || env.DEBUG_WORKFLOW == 'true' }} + run: | + set -x + docker buildx imagetools create -t ${{ env.IMAGE_TAG }}:${LATEST_TAG} ${{ env.IMAGE_TAG }}:${API_VERSION} + + - name: Trigger infrastructure project deployment + if: ${{ github.ref_name == 'main' || env.DEBUG_WORKFLOW == 'true' }} + run: | + forgejo_deploy_url=${{ github.api_url }}/repos/vcr/vcr-control-center-infrastructure/actions/workflows/call-deploy-apps-develop.yaml/dispatches + echo Deploying using $forgejo_deploy_url + curl -L "$forgejo_deploy_url" \ + -X POST \ + -H "Content-Type: application/json" \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: token ${{ secrets.DEPLOY_TOKEN }}" \ + --data "{\"ref\":\"refs/heads/${{ env.ENV }}\",\"inputs\":{ \"api_version\": \"${API_VERSION}\" }}" diff --git a/.idea/deployment.xml b/.idea/deployment.xml new file mode 100644 index 0000000..75aaeb9 --- /dev/null +++ b/.idea/deployment.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/webServers.xml b/.idea/webServers.xml new file mode 100644 index 0000000..66e14c1 --- /dev/null +++ b/.idea/webServers.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index c5b5924..d8954de 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,8 +1,36 @@ + + + + + + + + + + + + + + + + + { + "associatedIndex": 2 +} + - { - "keyToString": { - "go.import.settings.migrated": "true", - "settings.editor.selected.configurable": "ssh.settings" + +}]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + 1768273021451 + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/schema/generated/graphql.ts b/src/schema/generated/graphql.ts new file mode 100644 index 0000000..d47d361 --- /dev/null +++ b/src/schema/generated/graphql.ts @@ -0,0 +1,1163 @@ +import { DeviceCommunicationType } from '../../model/model_enum_values.js'; +import { StorageItemType } from '../../model/model_enum_values.js'; +import { DeviceStatus } from '../../model/model_enum_values.js'; +import { Permission } from '../../model/model_enum_values.js'; +import { GraphQLResolveInfo, GraphQLScalarType, GraphQLScalarTypeConfig } from 'graphql'; +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +export type MakeEmpty = { [_ in K]?: never }; +export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; +export type Omit = Pick>; +export type EnumResolverSignature = { [key in keyof T]?: AllowedValues }; +export type RequireFields = Omit & { [P in K]-?: NonNullable }; +/** All built-in and custom scalars, mapped to their actual values */ +export interface Scalars { + ID: { input: string; output: string; } + String: { input: string; output: string; } + Boolean: { input: boolean; output: boolean; } + Int: { input: number; output: number; } + Float: { input: number; output: number; } + DateTime: { input: any; output: any; } + JSONObject: { input: any; output: any; } + Time: { input: any; output: any; } +} + +export interface ApiError extends Error { + __typename?: 'ApiError'; + args?: Maybe; + code?: Maybe; + data?: Maybe; + message?: Maybe; + path?: Maybe; +} + +export interface CreateHost { + deviceKey: Scalars['String']['input']; + deviceType: Scalars['String']['input']; + /** + * groupNames is used to assign the created object + * to a host group. It is mandatory but + * can also be blank. This is usefull in case of + * passing a groupid instead which is + * the zabbix internal key for storing the group. + * If a groupid is provided the passed groupName is ignored + */ + groupNames: Array; + /** + * Optionally the internal groupids can be passed - in this case the + * groupName is ignored + */ + groupids?: InputMaybe>>; + location?: InputMaybe; + /** Optional display name of the device (must be unique if provided - default is to set display name to deviceKey) */ + name?: InputMaybe; +} + +export interface CreateHostGroup { + /** Name of the host group */ + groupName: Scalars['String']['input']; + /** + * Internally used unique id + * (will be assigned by Zabbix if empty) + */ + uuid?: InputMaybe; +} + +export interface CreateHostGroupResponse { + __typename?: 'CreateHostGroupResponse'; + error?: Maybe; + groupName: Scalars['String']['output']; + groupid?: Maybe; + message?: Maybe; +} + +export interface CreateHostResponse { + __typename?: 'CreateHostResponse'; + error?: Maybe; + hostids?: Maybe>>; + itemids?: Maybe>>; +} + +/** + * (IoT / Edge - ) Devices are hosts having a state containing the "output" / the business data which is exposed + * besides monitoring information. + */ +export interface Device { + deviceType?: Maybe; + /** Per convention a uuid is used as hostname to identify devices if they do not have a unique hostname */ + host: Scalars['String']['output']; + hostgroups?: Maybe>; + hostid: Scalars['ID']['output']; + name?: Maybe; + state?: Maybe; + tags?: Maybe; +} + +export { DeviceCommunicationType }; + +export interface DeviceState { + operational?: Maybe; +} + +export { DeviceStatus }; + +/** Marker-interface for device-related data values. */ +export interface DeviceValue { + _empty?: Maybe; +} + +/** + * Represents a message containing information about a specific device and its associated data value. + * The interface is designed to be extended by other types that define more structured or specialized types + * of device value messages. + */ +export interface DeviceValueMessage { + /** + * Represents the name assigned to a set of values that are submitted together with a single timestamp. + * This name is associated with a well-defined data structure. + */ + attributeName?: Maybe; + /** + * A unique identifier used to distinguish a specific device within the system. + * This field is commonly used to associate messages, configurations, or data values + * with a particular device. + */ + deviceKey?: Maybe; + /** + * Specifies the type or category of the device. Used to define the classification + * of a device in the system (capabilities, functionalities, or purpose). + */ + deviceType?: Maybe; + /** + * Represents the timestamp at which a specific event, message, or data point was created or recorded. + * The format should align with standard expectations (e.g., ISO 8601). + */ + timestamp?: Maybe; + /** + * Represents the name of the sub-topic to which the attribute is submitted. + * Classification or grouping of data within a broader topic structure. + */ + topicName?: Maybe; + /** Retrieves the value associated with the current instance of the object. */ + value?: Maybe; +} + +export interface Error { + code?: Maybe; + data?: Maybe; + message?: Maybe; +} + +export interface ErrorPayload { + __typename?: 'ErrorPayload'; + additionalInfo?: Maybe; + code: Scalars['Int']['output']; + message?: Maybe; +} + +/** Device represents generic IoT / Edge - devices providing their state as generic "state.current" - JSON Object */ +export interface GenericDevice extends Device, Host { + __typename?: 'GenericDevice'; + deviceType?: Maybe; + /** Per convention a uuid is used as hostname to identify devices if they do not have a unique hostname */ + host: Scalars['String']['output']; + hostgroups?: Maybe>; + hostid: Scalars['ID']['output']; + name?: Maybe; + state?: Maybe; + tags?: Maybe; +} + +export interface GenericDeviceState extends DeviceState { + __typename?: 'GenericDeviceState'; + current?: Maybe; + operational?: Maybe; +} + +export interface GenericResponse { + __typename?: 'GenericResponse'; + error?: Maybe; + result?: Maybe>; +} + +/** Hint: WGS84[dd.ddddd] coordinates are used */ +export interface GpsPosition { + latitude?: Maybe; + longitude?: Maybe; +} + +export interface Host { + /** + * Specifies the type or category of the device. Used to define the classification + * of a device in the system (capabilities, functionalities, or purpose). + */ + deviceType?: Maybe; + /** The host field contains the "hostname" in Zabbix */ + host: Scalars['String']['output']; + hostgroups?: Maybe>; + hostid: Scalars['ID']['output']; + name?: Maybe; + tags?: Maybe; +} + +export interface HostGroup { + __typename?: 'HostGroup'; + groupid: Scalars['ID']['output']; + name?: Maybe; +} + +export interface ImportHostResponse { + __typename?: 'ImportHostResponse'; + deviceKey: Scalars['String']['output']; + error?: Maybe; + hostid?: Maybe; + message?: Maybe; +} + +export interface ImportUserRightResult { + __typename?: 'ImportUserRightResult'; + errors?: Maybe>; + id?: Maybe; + message?: Maybe; + name?: Maybe; +} + +export interface ImportUserRightsResult { + __typename?: 'ImportUserRightsResult'; + userGroups?: Maybe>; + userRoles?: Maybe>; +} + +export interface Inventory { + __typename?: 'Inventory'; + location?: Maybe; +} + +export interface Location extends GpsPosition { + __typename?: 'Location'; + latitude?: Maybe; + longitude?: Maybe; + name?: Maybe; +} + +export interface LocationInput { + location_lat?: InputMaybe; + location_lon?: InputMaybe; + name?: InputMaybe; +} + +export interface Mutation { + __typename?: 'Mutation'; + /** Authentication: By zbx_session - cookie or zabbix-auth-token - header */ + createHost?: Maybe; + /** + * (Mass) Import zabbix groups + * and assign them to the corresponding hosts by groupid or groupName. + * + * Return value: If no error occurs a groupid be returned for each created group, + * otherwise the return object will contain an error message + * + * Authentication: By zbx_session - cookie or zabbix-auth-token - header + */ + importHostGroups?: Maybe>; + /** + * (Mass) Import hosts and assign them to host groups by groupid or groupName. + * + * Return value: If no error occurs a hostid will be returned for each created host, + * otherwise the return object will contain an error message. + * + * Authentication: By zbx_session - cookie or zabbix-auth-token - header + */ + importHosts?: Maybe>; + importUserRights?: Maybe; +} + + +export interface MutationCreateHostArgs { + host: Scalars['String']['input']; + hostgroupids: Array; + location?: InputMaybe; + templateids: Array; +} + + +export interface MutationImportHostGroupsArgs { + hostGroups: Array; +} + + +export interface MutationImportHostsArgs { + hosts: Array; +} + + +export interface MutationImportUserRightsArgs { + dryRun?: Scalars['Boolean']['input']; + input: UserRightsInput; +} + +export interface OperationalDeviceData { + __typename?: 'OperationalDeviceData'; + error?: Maybe>; + location?: Maybe; + signalstrength?: Maybe; + temperature?: Maybe; + timestamp?: Maybe; + voltage?: Maybe; +} + +export { Permission }; + +export interface PermissionRequest { + /** + * objectName maps to name / path suffix of the template group representing the permission in Zabbix: + * Permissions/{objectName} + */ + objectName: Scalars['String']['input']; + permission: Permission; +} + +export interface Query { + __typename?: 'Query'; + /** + * Get all host groups. + * If with_hosts==true only groups with attached hosts are delivered. + * + * Authentication: By zbx_session - cookie or zabbix-auth-token - header + */ + allHostGroups?: Maybe>>; + /** + * Get all hosts + corresponding items. 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 + */ + allHosts?: Maybe>>; + /** Get api (build) version */ + apiVersion: Scalars['String']['output']; + /** + * Export history from Zabbix items + * + * Authentication: By zbx_session - cookie or zabbix-auth-token - header + */ + exportHostValueHistory?: Maybe; + /** + * name_pattern: If provided this will perform a LIKE "%…%" search on the name attribute within the database. + * exclude_groups_pattern: Regex allowing to exclude all matching hostgroups from group permissions + */ + exportUserRights?: Maybe; + /** + * Return true if and only if the current user (identified by token / cookie) + * has all requested permissions (minimum - if READ is requested and the user has READ_WRITE + * the response will be true) + */ + hasPermissions?: Maybe; + /** + * Get all locations used by hosts. + * distinct_by_name=true means that the result is filtered for distinct names (default) + * name_pattern: If provided this will perform a Regex search on the name attribute within the database. + * + * Authentication: By zbx_session - cookie or zabbix-auth-token - header + */ + locations?: Maybe>>; + /** + * Login to zabbix - provided for debugging and testing purpose. The result of the login operation is + * authentication token returned may be passed as + * header 'zabbix-auth-token' for authenticating future API requests. + * As an alternative to the cookie 'zbx_session' may be set which is automatically set after login to + * the cockpit - this is the standard way to authenticate api calls initiated by the cockpit frontend + * because the frontend is always embedded into the Zabbix portal which is only accessible after logging in and + * obtainind the zbx_session - cookie. + */ + login?: Maybe; + /** + * Logout from zabbix - provided for debugging and testing purpose. This invalidates the token received by the login + * operation. Returns true on success + */ + logout?: Maybe; + /** + * Return all user permissions. If objectNames is provided return only the permissions related to the objects within + * the objectNames - list + */ + userPermissions?: Maybe>; + /** Get zabbix version */ + zabbixVersion?: Maybe; +} + + +export interface QueryAllHostGroupsArgs { + search_name?: InputMaybe; + with_hosts?: InputMaybe; +} + + +export interface QueryAllHostsArgs { + filter_host?: InputMaybe; + groupids?: InputMaybe>; + hostids?: InputMaybe; + name_pattern?: InputMaybe; + tag_deviceType?: InputMaybe>>; + tag_hostType?: InputMaybe>; + with_items?: InputMaybe; +} + + +export interface QueryExportHostValueHistoryArgs { + host_filter?: InputMaybe>; + itemKey_filter?: InputMaybe>; + limit?: InputMaybe; + sortOrder?: InputMaybe; + time_from?: InputMaybe; + time_until?: InputMaybe; + type?: InputMaybe; +} + + +export interface QueryExportUserRightsArgs { + exclude_hostgroups_pattern?: InputMaybe; + name_pattern?: InputMaybe; +} + + +export interface QueryHasPermissionsArgs { + permissions: Array; +} + + +export interface QueryLocationsArgs { + distinct_by_name?: InputMaybe; + name_pattern?: InputMaybe; + templateids?: InputMaybe>>; +} + + +export interface QueryLoginArgs { + password: Scalars['String']['input']; + username: Scalars['String']['input']; +} + + +export interface QueryUserPermissionsArgs { + objectNames?: InputMaybe>; +} + +export enum SortOrder { + /** Deliver values in ascending order */ + Asc = 'asc', + /** Deliver values in descending order */ + Desc = 'desc' +} + +export { StorageItemType }; + +export interface Template { + __typename?: 'Template'; + name?: Maybe; + templateid: Scalars['String']['output']; +} + +export interface UserGroup { + __typename?: 'UserGroup'; + gui_access?: Maybe; + hostgroup_rights?: Maybe>; + name: Scalars['String']['output']; + templategroup_rights?: Maybe>; + users_status?: Maybe; + usrgrpid: Scalars['Int']['output']; +} + +export interface UserGroupInput { + gui_access?: InputMaybe; + hostgroup_rights?: InputMaybe>; + name: Scalars['String']['input']; + templategroup_rights?: InputMaybe>; + users_status?: InputMaybe; +} + +export interface UserPermission { + __typename?: 'UserPermission'; + /** + * objectName maps to name / path suffix of the template group representing the permission in Zabbix: + * Permissions/{objectName} + */ + objectName: Scalars['String']['output']; + permission: Permission; +} + +export interface UserRights { + __typename?: 'UserRights'; + userGroups?: Maybe>; + userRoles?: Maybe>; +} + +export interface UserRightsInput { + userGroups?: InputMaybe>; + userRoles?: InputMaybe>; +} + +export interface UserRole { + __typename?: 'UserRole'; + name?: Maybe; + readonly?: Maybe; + roleid: Scalars['Int']['output']; + rules?: Maybe; + type?: Maybe; +} + +export interface UserRoleInput { + name?: InputMaybe; + readonly?: InputMaybe; + rules?: InputMaybe; + type?: InputMaybe; +} + +export interface UserRoleModule { + __typename?: 'UserRoleModule'; + id?: Maybe; + moduleid?: Maybe; + relative_path?: Maybe; + status?: Maybe; +} + +export interface UserRoleModuleInput { + id?: InputMaybe; + moduleid?: InputMaybe; + status?: InputMaybe; +} + +export interface UserRoleRule { + __typename?: 'UserRoleRule'; + name?: Maybe; + status?: Maybe; +} + +export interface UserRoleRuleInput { + name?: InputMaybe; + status?: InputMaybe; +} + +export interface UserRoleRules { + __typename?: 'UserRoleRules'; + actions?: Maybe>; + actions_default_access?: Maybe; + api?: Maybe>; + api_access?: Maybe; + api_mode?: Maybe; + modules?: Maybe>; + modules_default_access?: Maybe; + ui?: Maybe>; + ui_default_access?: Maybe; +} + +export interface UserRoleRulesInput { + actions?: InputMaybe>; + actions_default_access?: InputMaybe; + api?: InputMaybe>; + api_access?: InputMaybe; + api_mode?: InputMaybe; + modules?: InputMaybe>; + modules_default_access?: InputMaybe; + ui?: InputMaybe>; + ui_default_access?: InputMaybe; +} + +export interface ZabbixGroupRight { + __typename?: 'ZabbixGroupRight'; + id: Scalars['Int']['output']; + name?: Maybe; + permission?: Maybe; + uuid?: Maybe; +} + +export interface ZabbixGroupRightInput { + /** + * name may optionally be specified for documentation purpose, + * but the master for setting the user right is the uuid. + * If a uuid is found and the corresponding group + * has a deviating name this will be documented within a message + * with errorcode = 0 (OK) but the permission will be set ( + * the reason is that names for groups may deviate between several + * instances of the control center although the semantic is the same - + * while the semantic is identified by uuid. + */ + name?: InputMaybe; + permission?: InputMaybe; + uuid?: InputMaybe; +} + +export interface ZabbixHost extends Host { + __typename?: 'ZabbixHost'; + /** + * Specifies the type or category of the device. Used to define the classification + * of a device in the system (capabilities, functionalities, or purpose). + */ + deviceType?: Maybe; + host: Scalars['String']['output']; + hostgroups?: Maybe>; + hostid: Scalars['ID']['output']; + inventory?: Maybe; + items?: Maybe>; + name?: Maybe; + parentTemplates?: Maybe>; + tags?: Maybe; +} + +export interface ZabbixItem { + __typename?: 'ZabbixItem'; + attributeName?: Maybe; + hostid?: Maybe; + hosts?: Maybe>; + itemid: Scalars['Int']['output']; + key_: Scalars['String']['output']; + lastclock?: Maybe; + lastvalue?: Maybe; + name: Scalars['String']['output']; + status?: Maybe; + type?: Maybe; + value_type: Scalars['Int']['output']; +} + + + +export type ResolverTypeWrapper = Promise | T; + + +export type ResolverWithResolve = { + resolve: ResolverFn; +}; +export type Resolver = ResolverFn | ResolverWithResolve; + +export type ResolverFn = ( + parent: TParent, + args: TArgs, + context: TContext, + info: GraphQLResolveInfo +) => Promise | TResult; + +export type SubscriptionSubscribeFn = ( + parent: TParent, + args: TArgs, + context: TContext, + info: GraphQLResolveInfo +) => AsyncIterable | Promise>; + +export type SubscriptionResolveFn = ( + parent: TParent, + args: TArgs, + context: TContext, + info: GraphQLResolveInfo +) => TResult | Promise; + +export interface SubscriptionSubscriberObject { + subscribe: SubscriptionSubscribeFn<{ [key in TKey]: TResult }, TParent, TContext, TArgs>; + resolve?: SubscriptionResolveFn; +} + +export interface SubscriptionResolverObject { + subscribe: SubscriptionSubscribeFn; + resolve: SubscriptionResolveFn; +} + +export type SubscriptionObject = + | SubscriptionSubscriberObject + | SubscriptionResolverObject; + +export type SubscriptionResolver = + | ((...args: any[]) => SubscriptionObject) + | SubscriptionObject; + +export type TypeResolveFn = ( + parent: TParent, + context: TContext, + info: GraphQLResolveInfo +) => Maybe | Promise>; + +export type IsTypeOfResolverFn = (obj: T, context: TContext, info: GraphQLResolveInfo) => boolean | Promise; + +export type NextResolverFn = () => Promise; + +export type DirectiveResolverFn = ( + next: NextResolverFn, + parent: TParent, + args: TArgs, + context: TContext, + info: GraphQLResolveInfo +) => TResult | Promise; + + +/** Mapping of interface types */ +export type ResolversInterfaceTypes<_RefType extends Record> = { + Device: ( GenericDevice ); + DeviceState: ( GenericDeviceState ); + DeviceValue: never; + DeviceValueMessage: never; + Error: ( ApiError ); + GpsPosition: ( Location ); + Host: ( GenericDevice ) | ( Omit & { items?: Maybe> } ); +}; + +/** Mapping between all available schema types and the resolvers types */ +export type ResolversTypes = { + ApiError: ResolverTypeWrapper; + Boolean: ResolverTypeWrapper; + CreateHost: CreateHost; + CreateHostGroup: CreateHostGroup; + CreateHostGroupResponse: ResolverTypeWrapper; + CreateHostResponse: ResolverTypeWrapper; + DateTime: ResolverTypeWrapper; + Device: ResolverTypeWrapper['Device']>; + DeviceCommunicationType: DeviceCommunicationType; + DeviceState: ResolverTypeWrapper['DeviceState']>; + DeviceStatus: DeviceStatus; + DeviceValue: ResolverTypeWrapper['DeviceValue']>; + DeviceValueMessage: ResolverTypeWrapper['DeviceValueMessage']>; + Error: ResolverTypeWrapper['Error']>; + ErrorPayload: ResolverTypeWrapper; + Float: ResolverTypeWrapper; + GenericDevice: ResolverTypeWrapper; + GenericDeviceState: ResolverTypeWrapper; + GenericResponse: ResolverTypeWrapper; + GpsPosition: ResolverTypeWrapper['GpsPosition']>; + Host: ResolverTypeWrapper['Host']>; + HostGroup: ResolverTypeWrapper; + ID: ResolverTypeWrapper; + ImportHostResponse: ResolverTypeWrapper; + ImportUserRightResult: ResolverTypeWrapper; + ImportUserRightsResult: ResolverTypeWrapper; + Int: ResolverTypeWrapper; + Inventory: ResolverTypeWrapper; + JSONObject: ResolverTypeWrapper; + Location: ResolverTypeWrapper; + LocationInput: LocationInput; + Mutation: ResolverTypeWrapper<{}>; + OperationalDeviceData: ResolverTypeWrapper; + Permission: Permission; + PermissionRequest: PermissionRequest; + Query: ResolverTypeWrapper<{}>; + SortOrder: SortOrder; + StorageItemType: StorageItemType; + String: ResolverTypeWrapper; + Template: ResolverTypeWrapper