fix: bigint

This commit is contained in:
Eli Bosley
2025-05-22 14:59:37 -04:00
parent 574d572d65
commit e54d27aede
4 changed files with 27 additions and 30 deletions

View File

@@ -84,7 +84,7 @@ type ArrayDisk implements Node {
device: String
"""(KB) Disk Size total"""
size: Long
size: BigInt
status: ArrayDiskStatus
"""Is the disk a HDD or SSD."""
@@ -96,26 +96,26 @@ type ArrayDisk implements Node {
"""
Count of I/O read requests sent to the device I/O drivers. These statistics may be cleared at any time.
"""
numReads: Long
numReads: BigInt
"""
Count of I/O writes requests sent to the device I/O drivers. These statistics may be cleared at any time.
"""
numWrites: Long
numWrites: BigInt
"""
Number of unrecoverable errors reported by the device I/O drivers. Missing data due to unrecoverable array read errors is filled in on-the-fly using parity reconstruct (and we attempt to write this data back to the sector(s) which failed). Any unrecoverable write error results in disabling the disk.
"""
numErrors: Long
numErrors: BigInt
"""(KB) Total Size of the FS (Not present on Parity type drive)"""
fsSize: Long
fsSize: BigInt
"""(KB) Free Size on the FS (Not present on Parity type drive)"""
fsFree: Long
fsFree: BigInt
"""(KB) Used Size on the FS (Not present on Parity type drive)"""
fsUsed: Long
fsUsed: BigInt
exportable: Boolean
"""Type of Disk - used to differentiate Cache / Flash / Array / Parity"""
@@ -145,8 +145,10 @@ interface Node {
id: PrefixedID!
}
"""The `Long` scalar type represents 52-bit integers"""
scalar Long
"""
The `BigInt` scalar type represents non-fractional signed whole numeric values.
"""
scalar BigInt
enum ArrayDiskStatus {
DISK_NP
@@ -222,13 +224,13 @@ type Share implements Node {
name: String
"""(KB) Free space"""
free: Long
free: BigInt
"""(KB) Used Size"""
used: Long
used: BigInt
"""(KB) Total size"""
size: Long
size: BigInt
"""Disks that are included in this share"""
include: [String!]
@@ -1116,7 +1118,7 @@ enum Temperature {
type MemoryLayout implements Node {
id: PrefixedID!
size: Int!
size: BigInt!
bank: String
type: String
clockSpeed: Int
@@ -1131,16 +1133,16 @@ type MemoryLayout implements Node {
type InfoMemory implements Node {
id: PrefixedID!
max: Int!
total: Int!
free: Int!
used: Int!
active: Int!
available: Int!
buffcache: Int!
swaptotal: Int!
swapused: Int!
swapfree: Int!
max: BigInt!
total: BigInt!
free: BigInt!
used: BigInt!
active: BigInt!
available: BigInt!
buffcache: BigInt!
swaptotal: BigInt!
swapused: BigInt!
swapfree: BigInt!
layout: [MemoryLayout!]!
}

View File

@@ -1,5 +1,4 @@
import '@app/dotenv.js';
import 'json-bigint-patch';
import { execa } from 'execa';
import { CommandFactory } from 'nest-commander';
@@ -21,6 +20,7 @@ const getUnraidApiLocation = async () => {
};
try {
await import('json-bigint-patch');
await CommandFactory.run(CliModule, {
cliName: 'unraid-api',
logger: LOG_LEVEL === 'TRACE' ? new LogService() : false, // - enable this to see nest initialization issues

View File

@@ -1,6 +1,5 @@
import 'reflect-metadata';
import 'global-agent/bootstrap.js';
import 'json-bigint-patch';
import '@app/dotenv.js';
import { type NestFastifyApplication } from '@nestjs/platform-fastify';
@@ -41,6 +40,7 @@ const unlinkUnixPort = () => {
export const viteNodeApp = async () => {
try {
await import('json-bigint-patch');
environment.IS_MAIN_PROCESS = true;
logger.info('ENV %o', envVars);

View File

@@ -47,11 +47,6 @@ import { PluginModule } from '@app/unraid-api/plugin/plugin.module.js';
path: '/graphql',
},
},
resolvers: {
JSON: JSONResolver,
Long: GraphQLBigInt,
URL: URLResolver,
},
buildSchemaOptions: {
dateScalarMode: 'isoDate',
directives: [UsePermissionsDirective],