mirror of
https://github.com/unraid/api.git
synced 2026-01-06 16:49:49 -06:00
chore: update deps and fix minification breaking class names
This commit is contained in:
@@ -19,6 +19,7 @@ const parse = (state: DeviceIni[]): Device[] => Object.values(state);
|
||||
* Devices
|
||||
*/
|
||||
class Devices extends ArrayState {
|
||||
public channel = 'devices';
|
||||
private static instance: Devices;
|
||||
_data: any;
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ const parse = (state: NetworkIni) => {
|
||||
* Network
|
||||
*/
|
||||
class Network extends ArrayState {
|
||||
public channel = 'network';
|
||||
private static instance: Network;
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -27,6 +27,7 @@ const parse = (state: SecIni[]) => {
|
||||
};
|
||||
|
||||
class NfsSec extends ArrayState {
|
||||
public channel = 'nsf-sec';
|
||||
private static instance: NfsSec;
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -41,6 +41,7 @@ const parse = (state: SharesIni[]): Share[] => {
|
||||
};
|
||||
|
||||
class Shares extends ArrayState {
|
||||
public channel = 'shares';
|
||||
private static instance: Shares;
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -70,6 +70,7 @@ const parse = (state: SlotIni[]) => {
|
||||
* Slots
|
||||
*/
|
||||
class Slots extends ArrayState {
|
||||
public channel = 'slots';
|
||||
private static instance: Slots;
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -59,6 +59,7 @@ const parse = (state: SmbSecIni[]) => {
|
||||
};
|
||||
|
||||
class SmbSec extends ArrayState {
|
||||
public channel = 'smb-sec';
|
||||
private static instance: SmbSec;
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -10,6 +10,7 @@ import { LooseObject } from '../types';
|
||||
type Mutation = 'CREATED' | 'UPDATED' | 'DELETED';
|
||||
|
||||
export class State {
|
||||
channel?: string;
|
||||
_data?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
@@ -38,7 +39,10 @@ export class State {
|
||||
}
|
||||
|
||||
public emit(mutation: Mutation, node: LooseObject) {
|
||||
const channel = this.constructor.name.toLowerCase();
|
||||
const channel = this.channel;
|
||||
|
||||
// Bail since we have no channel to post to
|
||||
if (!channel) return;
|
||||
|
||||
// Update channel with new state
|
||||
bus.emit(channel, {
|
||||
|
||||
@@ -36,6 +36,7 @@ const parseUser = (state: UserIni): User => {
|
||||
const parse = (states: UserIni[]): User[] => Object.values(states).map(parseUser);
|
||||
|
||||
class Users extends ArrayState {
|
||||
public channel = 'users';
|
||||
private static instance: Users;
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -276,6 +276,7 @@ interface ParseOptions {
|
||||
}
|
||||
|
||||
class VarState extends State {
|
||||
public channel = 'var';
|
||||
private static instance: VarState;
|
||||
|
||||
constructor() {
|
||||
|
||||
@@ -10,7 +10,7 @@ import { bus, apiManager, graphqlLogger, config, pluginManager, modules, coreLog
|
||||
import { AppError, FatalAppError, PluginError } from '../core/errors';
|
||||
import { usersState } from '../core/states';
|
||||
import { makeExecutableSchema, SchemaDirectiveVisitor } from 'graphql-tools';
|
||||
import { mergeTypes } from 'merge-graphql-schemas';
|
||||
import { mergeTypeDefs } from '@graphql-tools/merge';
|
||||
import gql from 'graphql-tag';
|
||||
import dee from '@gridplus/docker-events';
|
||||
import { setIntervalAsync } from 'set-interval-async/dynamic';
|
||||
@@ -109,7 +109,7 @@ if (process.env.NODE_ENV !== 'production') {
|
||||
baseTypes.push(debugDefs);
|
||||
}
|
||||
|
||||
const types = mergeTypes([
|
||||
const types = mergeTypeDefs([
|
||||
...baseTypes,
|
||||
typeDefs
|
||||
]);
|
||||
@@ -277,15 +277,17 @@ const debug = config.get('debug');
|
||||
const apiKeyToUser = (apiKey: string) => {
|
||||
ensureApiKey(apiKey);
|
||||
|
||||
const keyName = apiManager.getNameFromKey(apiKey);
|
||||
try {
|
||||
const keyName = apiManager.getNameFromKey(apiKey);
|
||||
|
||||
if (keyName) {
|
||||
const id = apiManager.getKey(keyName)?.userId;
|
||||
const foundUser = usersState.findOne({ id });
|
||||
if (foundUser) {
|
||||
return foundUser;
|
||||
if (keyName) {
|
||||
const id = apiManager.getKey(keyName)?.userId;
|
||||
const foundUser = usersState.findOne({ id });
|
||||
if (foundUser) {
|
||||
return foundUser;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
|
||||
return { name: 'guest', role: 'guest' };
|
||||
};
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
*/
|
||||
|
||||
import { join } from 'path';
|
||||
import { fileLoader, mergeTypes } from 'merge-graphql-schemas';
|
||||
import { mergeTypeDefs } from '@graphql-tools/merge';
|
||||
import { loadFilesSync } from '@graphql-tools/load-files';
|
||||
|
||||
const files = fileLoader(join(__dirname, './types/**/*.graphql'));
|
||||
const files = loadFilesSync(join(__dirname, './types/**/*.graphql'));
|
||||
|
||||
export const typeDefs = mergeTypes(files, {
|
||||
all: true
|
||||
});
|
||||
export const typeDefs = mergeTypeDefs(files);
|
||||
|
||||
1433
package-lock.json
generated
1433
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
52
package.json
52
package.json
@@ -34,35 +34,37 @@
|
||||
"ecosystem.config.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.2.5",
|
||||
"@apollo/client": "^3.3.5",
|
||||
"@graphql-tools/load-files": "^6.2.5",
|
||||
"@graphql-tools/merge": "^6.2.6",
|
||||
"@gridplus/docker-events": "OmgImAlexis/docker-events#master",
|
||||
"@schemastore/package": "0.0.6",
|
||||
"@sentry/node": "^5.26.0",
|
||||
"@sentry/node": "^5.29.0",
|
||||
"accesscontrol": "^2.2.1",
|
||||
"ain2": "^3.0.0",
|
||||
"am": "^1.1.0",
|
||||
"apollo-server": "2.18.2",
|
||||
"apollo-server-express": "2.18.2",
|
||||
"apollo-server": "2.19.0",
|
||||
"apollo-server-express": "2.19.0",
|
||||
"async-exit-hook": "^2.0.1",
|
||||
"async-mutex": "^0.2.4",
|
||||
"async-mutex": "^0.2.6",
|
||||
"bycontract": "^2.0.10",
|
||||
"bytes": "^3.1.0",
|
||||
"camelcase": "6.1.0",
|
||||
"camelcase": "6.2.0",
|
||||
"camelcase-keys": "^6.2.2",
|
||||
"chalk": "^4.1.0",
|
||||
"chokidar": "^3.4.3",
|
||||
"clean-cache": "github:OmgImAlexis/clean-cache#master",
|
||||
"clear-module": "^4.1.1",
|
||||
"cli-table": "^0.3.1",
|
||||
"cli-table": "^0.3.4",
|
||||
"command-exists": "^1.2.9",
|
||||
"cross-fetch": "^3.0.6",
|
||||
"daemonize-process": "^3.0.0",
|
||||
"deepmerge": "^4.2.2",
|
||||
"dl-tgz": "^0.7.1",
|
||||
"dockerode": "^3.2.1",
|
||||
"dot-prop": "^6.0.0",
|
||||
"dot-prop": "^6.0.1",
|
||||
"dotenv": "^8.2.0",
|
||||
"execa": "^4.1.0",
|
||||
"execa": "^5.0.0",
|
||||
"express": "^4.17.1",
|
||||
"express-list-endpoints": "^5.0.0",
|
||||
"filter-obj": "^2.0.1",
|
||||
@@ -71,7 +73,7 @@
|
||||
"get-server-address": "^1.0.1",
|
||||
"glob": "^7.1.6",
|
||||
"globby": "^11.0.1",
|
||||
"graphql": "^15.3.0",
|
||||
"graphql": "^15.4.0",
|
||||
"graphql-directive": "^0.2.1",
|
||||
"graphql-subscriptions-client": "OmgImAlexis/graphql-subscriptions-client#master",
|
||||
"graphql-tag": "^2.11.0",
|
||||
@@ -79,16 +81,15 @@
|
||||
"graphql-type-long": "^0.1.1",
|
||||
"graphql-type-uuid": "^0.2.0",
|
||||
"htpasswd-js": "^1.0.2",
|
||||
"ini": "^1.3.5",
|
||||
"ini": "^1.3.7",
|
||||
"lodash.get": "^4.4.2",
|
||||
"logger": "github:unraid/logger#master",
|
||||
"map-obj": "^4.1.0",
|
||||
"merge-graphql-schemas": "^1.7.8",
|
||||
"micromongo": "^0.3.1",
|
||||
"mqtt": "github:OmgImAlexis/MQTT.js#master",
|
||||
"ms": "^2.1.2",
|
||||
"ms": "^2.1.3",
|
||||
"multi-ini": "^2.1.0",
|
||||
"mustache": "^4.0.1",
|
||||
"mustache": "^4.1.0",
|
||||
"nanobus": "^4.4.0",
|
||||
"node-cache": "5.1.2",
|
||||
"node-fetch": "^2.6.1",
|
||||
@@ -107,7 +108,7 @@
|
||||
"redact-secrets": "OmgImAlexis/redact-secrets#master",
|
||||
"request": "^2.88.2",
|
||||
"request-promise-native": "^1.0.9",
|
||||
"semver": "^7.3.2",
|
||||
"semver": "^7.3.4",
|
||||
"sendmail": "^1.6.1",
|
||||
"set-interval-async": "^1.0.33",
|
||||
"spread-the-word": "^0.8.4",
|
||||
@@ -115,9 +116,9 @@
|
||||
"subscriptions-transport-ws": "^0.9.18",
|
||||
"systeminformation": "^4.31.0",
|
||||
"tracer": "^1.1.4",
|
||||
"unix-dgram": "^2.0.3",
|
||||
"unix-dgram": "^2.0.4",
|
||||
"upcast": "^4.0.0",
|
||||
"uuid": "^8.3.1",
|
||||
"uuid": "^8.3.2",
|
||||
"uuid-apikey": "^1.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -128,22 +129,22 @@
|
||||
"@types/stoppable": "^1.1.0",
|
||||
"@types/supertest": "^2.0.10",
|
||||
"@types/uuid": "^8.3.0",
|
||||
"ava": "^3.13.0",
|
||||
"ava": "^3.14.0",
|
||||
"ava-env": "^2.0.2",
|
||||
"bundle-dependencies": "^1.0.2",
|
||||
"cpx": "1.5.0",
|
||||
"cz-conventional-changelog": "3.3.0",
|
||||
"husky": "4.3.0",
|
||||
"husky": "4.3.5",
|
||||
"modclean": "^3.0.0-beta.1",
|
||||
"node-env-run": "^4.0.2",
|
||||
"p-each-series": "^2.1.0",
|
||||
"p-each-series": "^2.2.0",
|
||||
"source-map-support": "0.5.19",
|
||||
"standard-version": "^9.0.0",
|
||||
"supertest": "^6.0.1",
|
||||
"ts-node": "9.0.0",
|
||||
"typescript": "4.0.3",
|
||||
"typescript-coverage-report": "^0.1.3",
|
||||
"xo": "0.33.1"
|
||||
"ts-node": "9.1.1",
|
||||
"typescript": "4.1.2",
|
||||
"typescript-coverage-report": "^0.3.1",
|
||||
"xo": "0.36.1"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"libvirt": "^1.2.1"
|
||||
@@ -165,6 +166,8 @@
|
||||
},
|
||||
"bundledDependencies": [
|
||||
"@apollo/client",
|
||||
"@graphql-tools/load-files",
|
||||
"@graphql-tools/merge",
|
||||
"@gridplus/docker-events",
|
||||
"@schemastore/package",
|
||||
"@sentry/node",
|
||||
@@ -213,7 +216,6 @@
|
||||
"lodash.get",
|
||||
"logger",
|
||||
"map-obj",
|
||||
"merge-graphql-schemas",
|
||||
"micromongo",
|
||||
"mqtt",
|
||||
"ms",
|
||||
|
||||
Reference in New Issue
Block a user