Remove license headers and update imports
This commit is contained in:
1 parent
bfbbdb12ca
commit
0dee9a5f00
123 files changed
+566
-2505
No files matched your search
+7
-26
@@ -1,29 +1,10 @@
|
|||||||
/**
|
import * as config from "../lib/config.ts";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import * as logger from "../lib/logger.ts";
|
||||||
*
|
import * as cluster from "../lib/cluster.ts";
|
||||||
* This file is part of GenieACS.
|
import * as server from "../lib/server.ts";
|
||||||
*
|
import * as cwmp from "../lib/cwmp.ts";
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
import * as db from "../lib/db/db.ts";
|
||||||
* it under the terms of the GNU Affero General Public License as
|
import * as extensions from "../lib/extensions.ts";
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as config from "../lib/config";
|
|
||||||
import * as logger from "../lib/logger";
|
|
||||||
import * as cluster from "../lib/cluster";
|
|
||||||
import * as server from "../lib/server";
|
|
||||||
import * as cwmp from "../lib/cwmp";
|
|
||||||
import * as db from "../lib/db/db";
|
|
||||||
import * as extensions from "../lib/extensions";
|
|
||||||
import { version as VERSION } from "../package.json";
|
import { version as VERSION } from "../package.json";
|
||||||
|
|
||||||
logger.init("cwmp", VERSION);
|
logger.init("cwmp", VERSION);
|
||||||
|
|||||||
+1
-20
@@ -1,23 +1,4 @@
|
|||||||
/**
|
import { Fault } from "../lib/types.ts";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { Fault } from "../lib/types";
|
|
||||||
|
|
||||||
const jobs = new Set();
|
const jobs = new Set();
|
||||||
const fileName = process.argv[2];
|
const fileName = process.argv[2];
|
||||||
|
|||||||
+6
-25
@@ -1,28 +1,9 @@
|
|||||||
/**
|
import * as config from "../lib/config.ts";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import * as logger from "../lib/logger.ts";
|
||||||
*
|
import * as cluster from "../lib/cluster.ts";
|
||||||
* This file is part of GenieACS.
|
import * as server from "../lib/server.ts";
|
||||||
*
|
import { listener } from "../lib/fs.ts";
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
import * as db from "../lib/db/db.ts";
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as config from "../lib/config";
|
|
||||||
import * as logger from "../lib/logger";
|
|
||||||
import * as cluster from "../lib/cluster";
|
|
||||||
import * as server from "../lib/server";
|
|
||||||
import { listener } from "../lib/fs";
|
|
||||||
import * as db from "../lib/db/db";
|
|
||||||
import { version as VERSION } from "../package.json";
|
import { version as VERSION } from "../package.json";
|
||||||
|
|
||||||
logger.init("fs", VERSION);
|
logger.init("fs", VERSION);
|
||||||
|
|||||||
+7
-26
@@ -1,29 +1,10 @@
|
|||||||
/**
|
import * as config from "../lib/config.ts";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import * as logger from "../lib/logger.ts";
|
||||||
*
|
import * as cluster from "../lib/cluster.ts";
|
||||||
* This file is part of GenieACS.
|
import * as server from "../lib/server.ts";
|
||||||
*
|
import { listener } from "../lib/nbi.ts";
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
import * as db from "../lib/db/db.ts";
|
||||||
* it under the terms of the GNU Affero General Public License as
|
import * as extensions from "../lib/extensions.ts";
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as config from "../lib/config";
|
|
||||||
import * as logger from "../lib/logger";
|
|
||||||
import * as cluster from "../lib/cluster";
|
|
||||||
import * as server from "../lib/server";
|
|
||||||
import { listener } from "../lib/nbi";
|
|
||||||
import * as db from "../lib/db/db";
|
|
||||||
import * as extensions from "../lib/extensions";
|
|
||||||
import { version as VERSION } from "../package.json";
|
import { version as VERSION } from "../package.json";
|
||||||
|
|
||||||
logger.init("nbi", VERSION);
|
logger.init("nbi", VERSION);
|
||||||
|
|||||||
+7
-26
@@ -1,29 +1,10 @@
|
|||||||
/**
|
import * as config from "../lib/config.ts";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import * as logger from "../lib/logger.ts";
|
||||||
*
|
import * as cluster from "../lib/cluster.ts";
|
||||||
* This file is part of GenieACS.
|
import * as server from "../lib/server.ts";
|
||||||
*
|
import { listener } from "../lib/ui.ts";
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
import * as extensions from "../lib/extensions.ts";
|
||||||
* it under the terms of the GNU Affero General Public License as
|
import * as db from "../lib/db/db.ts";
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as config from "../lib/config";
|
|
||||||
import * as logger from "../lib/logger";
|
|
||||||
import * as cluster from "../lib/cluster";
|
|
||||||
import * as server from "../lib/server";
|
|
||||||
import { listener } from "../lib/ui";
|
|
||||||
import * as extensions from "../lib/extensions";
|
|
||||||
import * as db from "../lib/db/db";
|
|
||||||
import { version as VERSION } from "../package.json";
|
import { version as VERSION } from "../package.json";
|
||||||
|
|
||||||
logger.init("ui", VERSION);
|
logger.init("ui", VERSION);
|
||||||
|
|||||||
+5
-24
@@ -1,29 +1,10 @@
|
|||||||
/**
|
import path from "node:path";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import fs from "node:fs";
|
||||||
*
|
import { createHash } from "node:crypto";
|
||||||
* This file is part of GenieACS.
|
import { promisify } from "node:util";
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import path from "path";
|
|
||||||
import fs from "fs";
|
|
||||||
import { createHash } from "crypto";
|
|
||||||
import { promisify } from "util";
|
|
||||||
import * as esbuild from "esbuild";
|
import * as esbuild from "esbuild";
|
||||||
import { optimize } from "svgo";
|
import { optimize } from "svgo";
|
||||||
import * as xmlParser from "../lib/xml-parser";
|
import * as xmlParser from "../lib/xml-parser.ts";
|
||||||
|
|
||||||
const fsAsync = {
|
const fsAsync = {
|
||||||
readdir: promisify(fs.readdir),
|
readdir: promisify(fs.readdir),
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import { exec } from "child_process";
|
import { exec } from "node:child_process";
|
||||||
import { promisify } from "util";
|
import { promisify } from "node:util";
|
||||||
|
|
||||||
const execPromise = promisify(exec);
|
const execPromise = promisify(exec);
|
||||||
|
|
||||||
|
|||||||
+12
-31
@@ -1,24 +1,5 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ObjectId } from "mongodb";
|
import { ObjectId } from "mongodb";
|
||||||
import { collections } from "./db/db";
|
import { collections } from "./db/db.ts";
|
||||||
import {
|
import {
|
||||||
deleteConfig,
|
deleteConfig,
|
||||||
deleteFault as dbDeleteFault,
|
deleteFault as dbDeleteFault,
|
||||||
@@ -35,25 +16,25 @@ import {
|
|||||||
putProvision,
|
putProvision,
|
||||||
putUser,
|
putUser,
|
||||||
putVirtualParameter,
|
putVirtualParameter,
|
||||||
} from "./ui/db";
|
} from "./ui/db.ts";
|
||||||
import * as common from "./util";
|
import * as common from "./util.ts";
|
||||||
import * as cache from "./cache";
|
import * as cache from "./cache.ts";
|
||||||
import { acquireLock, getToken, releaseLock } from "./lock";
|
import { acquireLock, getToken, releaseLock } from "./lock.ts";
|
||||||
import {
|
import {
|
||||||
getRevision,
|
getRevision,
|
||||||
getConfig,
|
getConfig,
|
||||||
getConfigExpression,
|
getConfigExpression,
|
||||||
getUsers,
|
getUsers,
|
||||||
} from "./ui/local-cache";
|
} from "./ui/local-cache.ts";
|
||||||
import {
|
import {
|
||||||
httpConnectionRequest,
|
httpConnectionRequest,
|
||||||
udpConnectionRequest,
|
udpConnectionRequest,
|
||||||
} from "./connection-request";
|
} from "./connection-request.ts";
|
||||||
import { Expression, Task } from "./types";
|
import { Expression, Task } from "./types.ts";
|
||||||
import { evaluate } from "./common/expression/util";
|
import { evaluate } from "./common/expression/util.ts";
|
||||||
import { hashPassword } from "./auth";
|
import { hashPassword } from "./auth.ts";
|
||||||
import { flattenDevice } from "./ui/db";
|
import { flattenDevice } from "./ui/db.ts";
|
||||||
import { ResourceLockedError } from "./common/errors";
|
import { ResourceLockedError } from "./common/errors.ts";
|
||||||
|
|
||||||
export async function connectionRequest(
|
export async function connectionRequest(
|
||||||
deviceId: string,
|
deviceId: string,
|
||||||
|
|||||||
+1
-20
@@ -1,23 +1,4 @@
|
|||||||
/**
|
import { createHash, randomBytes, pbkdf2 } from "node:crypto";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { createHash, randomBytes, pbkdf2 } from "crypto";
|
|
||||||
|
|
||||||
function parseHeaderFeilds(str: string): Record<string, string> {
|
function parseHeaderFeilds(str: string): Record<string, string> {
|
||||||
const res = {};
|
const res = {};
|
||||||
|
|||||||
+2
-21
@@ -1,24 +1,5 @@
|
|||||||
/**
|
import { collections } from "./db/db.ts";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import * as config from "./config.ts";
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { collections } from "./db/db";
|
|
||||||
import * as config from "./config";
|
|
||||||
|
|
||||||
const CLOCK_SKEW_TOLERANCE = 30000;
|
const CLOCK_SKEW_TOLERANCE = 30000;
|
||||||
const MAX_CACHE_TTL = +config.get("MAX_CACHE_TTL");
|
const MAX_CACHE_TTL = +config.get("MAX_CACHE_TTL");
|
||||||
|
|||||||
+3
-22
@@ -1,25 +1,6 @@
|
|||||||
/**
|
import cluster, { Worker } from "node:cluster";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import { cpus } from "node:os";
|
||||||
*
|
import * as logger from "./logger.ts";
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import cluster, { Worker } from "cluster";
|
|
||||||
import { cpus } from "os";
|
|
||||||
import * as logger from "./logger";
|
|
||||||
|
|
||||||
let respawnTimestamp = 0;
|
let respawnTimestamp = 0;
|
||||||
let crashes: number[] = [];
|
let crashes: number[] = [];
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
/**
|
import { PermissionSet, Expression } from "../types.ts";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import { evaluate, or } from "./expression/util.ts";
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { PermissionSet, Expression } from "../types";
|
|
||||||
import { evaluate, or } from "./expression/util";
|
|
||||||
|
|
||||||
export default class Authorizer {
|
export default class Authorizer {
|
||||||
private declare permissionSets: PermissionSet[];
|
private declare permissionSets: PermissionSet[];
|
||||||
|
|||||||
@@ -1,22 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2020 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
export function and(a: bigint, b: bigint): bigint {
|
export function and(a: bigint, b: bigint): bigint {
|
||||||
return a & b;
|
return a & b;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as BI from "./bigint";
|
import * as BI from "./bigint.ts";
|
||||||
import { Expression } from "../../types";
|
import { Expression } from "../../types.ts";
|
||||||
import { map } from "./parser";
|
import { map } from "./parser.ts";
|
||||||
import { and, evaluateCallback } from "./util";
|
import { and, evaluateCallback } from "./util.ts";
|
||||||
|
|
||||||
const ZERO = BI.BigInt(0);
|
const ZERO = BI.BigInt(0);
|
||||||
const ONE = BI.BigInt(1);
|
const ONE = BI.BigInt(1);
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import parsimmon from "parsimmon";
|
import parsimmon from "parsimmon";
|
||||||
import { Expression } from "../../types";
|
import { Expression } from "../../types.ts";
|
||||||
|
|
||||||
// Turn escaped characters into real ones (e.g. "\\n" becomes "\n").
|
// Turn escaped characters into real ones (e.g. "\\n" becomes "\n").
|
||||||
function interpretEscapes(str): string {
|
function interpretEscapes(str): string {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { espresso, complement, tautology } from "espresso-iisojs";
|
import { espresso, complement, tautology } from "espresso-iisojs";
|
||||||
import { Expression } from "../../types";
|
import { Expression } from "../../types.ts";
|
||||||
import normalize from "./normalize";
|
import normalize from "./normalize.ts";
|
||||||
import { map, parseLikePattern } from "./parser";
|
import { map, parseLikePattern } from "./parser.ts";
|
||||||
|
|
||||||
type Minterm = number[];
|
type Minterm = number[];
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,5 @@
|
|||||||
/**
|
import { map, mapAsync, parseLikePattern } from "./parser.ts";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import { Expression } from "../../types.ts";
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { map, mapAsync, parseLikePattern } from "./parser";
|
|
||||||
import { Expression } from "../../types";
|
|
||||||
|
|
||||||
const isArray = Array.isArray;
|
const isArray = Array.isArray;
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
let cache1 = new Map();
|
let cache1 = new Map();
|
||||||
let cache2 = new Map();
|
let cache2 = new Map();
|
||||||
const keys = new WeakMap();
|
const keys = new WeakMap();
|
||||||
|
|||||||
+1
-20
@@ -1,23 +1,4 @@
|
|||||||
/**
|
import Path from "./path.ts";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import Path from "./path";
|
|
||||||
|
|
||||||
export default class PathSet {
|
export default class PathSet {
|
||||||
private declare lengthIndex: Set<Path>[];
|
private declare lengthIndex: Set<Path>[];
|
||||||
|
|||||||
@@ -1,22 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
type Segments = (string | Alias)[];
|
type Segments = (string | Alias)[];
|
||||||
type Alias = [Path, string][];
|
type Alias = [Path, string][];
|
||||||
|
|
||||||
|
|||||||
+2
-21
@@ -1,24 +1,5 @@
|
|||||||
/**
|
import { resolve } from "node:path";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import { readFileSync, existsSync } from "node:fs";
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { resolve } from "path";
|
|
||||||
import { readFileSync, existsSync } from "fs";
|
|
||||||
|
|
||||||
// Find project root directory
|
// Find project root directory
|
||||||
export let ROOT_DIR = resolve(__dirname, "..");
|
export let ROOT_DIR = resolve(__dirname, "..");
|
||||||
|
|||||||
@@ -1,30 +1,11 @@
|
|||||||
/**
|
import * as crypto from "node:crypto";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import * as dgram from "node:dgram";
|
||||||
*
|
import * as http from "node:http";
|
||||||
* This file is part of GenieACS.
|
import { evaluateAsync } from "./common/expression/util.ts";
|
||||||
*
|
import { Expression } from "./types.ts";
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
import * as auth from "./auth.ts";
|
||||||
* it under the terms of the GNU Affero General Public License as
|
import * as extensions from "./extensions.ts";
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
import * as debug from "./debug.ts";
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as crypto from "crypto";
|
|
||||||
import * as dgram from "dgram";
|
|
||||||
import * as http from "http";
|
|
||||||
import { evaluateAsync } from "./common/expression/util";
|
|
||||||
import { Expression } from "./types";
|
|
||||||
import * as auth from "./auth";
|
|
||||||
import * as extensions from "./extensions";
|
|
||||||
import * as debug from "./debug";
|
|
||||||
|
|
||||||
async function extractAuth(
|
async function extractAuth(
|
||||||
exp: Expression,
|
exp: Expression,
|
||||||
|
|||||||
+26
-45
@@ -1,38 +1,23 @@
|
|||||||
/**
|
import * as zlib from "node:zlib";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import * as crypto from "node:crypto";
|
||||||
*
|
import { Socket } from "node:net";
|
||||||
* This file is part of GenieACS.
|
import { IncomingMessage, ServerResponse } from "node:http";
|
||||||
*
|
import { pipeline, Readable } from "node:stream";
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
import { promisify } from "node:util";
|
||||||
* it under the terms of the GNU Affero General Public License as
|
import { decode, encodingExists } from "iconv-lite";
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
import * as auth from "./auth.ts";
|
||||||
* License, or (at your option) any later version.
|
import * as config from "./config.ts";
|
||||||
*
|
import { generateDeviceId, once, setTimeoutPromise } from "./util.ts";
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
import * as soap from "./soap.ts";
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
import * as session from "./session.ts";
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as zlib from "zlib";
|
|
||||||
import * as crypto from "crypto";
|
|
||||||
import { Socket } from "net";
|
|
||||||
import * as auth from "./auth";
|
|
||||||
import * as config from "./config";
|
|
||||||
import { generateDeviceId, once, setTimeoutPromise } from "./util";
|
|
||||||
import * as soap from "./soap";
|
|
||||||
import * as session from "./session";
|
|
||||||
import {
|
import {
|
||||||
evaluateAsync,
|
evaluateAsync,
|
||||||
evaluate,
|
evaluate,
|
||||||
extractParams,
|
extractParams,
|
||||||
} from "./common/expression/util";
|
} from "./common/expression/util.ts";
|
||||||
import * as cache from "./cache";
|
import * as cache from "./cache.ts";
|
||||||
import * as lock from "./lock";
|
import * as lock from "./lock.ts";
|
||||||
import * as localCache from "./cwmp/local-cache";
|
import * as localCache from "./cwmp/local-cache.ts";
|
||||||
import {
|
import {
|
||||||
clearTasks,
|
clearTasks,
|
||||||
deleteFault,
|
deleteFault,
|
||||||
@@ -44,11 +29,11 @@ import {
|
|||||||
saveDevice,
|
saveDevice,
|
||||||
saveFault,
|
saveFault,
|
||||||
saveOperation,
|
saveOperation,
|
||||||
} from "./cwmp/db";
|
} from "./cwmp/db.ts";
|
||||||
import * as logger from "./logger";
|
import * as logger from "./logger.ts";
|
||||||
import * as scheduling from "./scheduling";
|
import * as scheduling from "./scheduling.ts";
|
||||||
import Path from "./common/path";
|
import Path from "./common/path.ts";
|
||||||
import * as extensions from "./extensions";
|
import * as extensions from "./extensions.ts";
|
||||||
import {
|
import {
|
||||||
SessionContext,
|
SessionContext,
|
||||||
AcsRequest,
|
AcsRequest,
|
||||||
@@ -60,15 +45,11 @@ import {
|
|||||||
Preset,
|
Preset,
|
||||||
GetRPCMethodsResponse,
|
GetRPCMethodsResponse,
|
||||||
CpeFault,
|
CpeFault,
|
||||||
} from "./types";
|
} from "./types.ts";
|
||||||
import { IncomingMessage, ServerResponse } from "http";
|
import { parseXmlDeclaration } from "./xml-parser.ts";
|
||||||
import { pipeline, Readable } from "stream";
|
import * as debug from "./debug.ts";
|
||||||
import { promisify } from "util";
|
import { getRequestOrigin } from "./forwarded.ts";
|
||||||
import { decode, encodingExists } from "iconv-lite";
|
import { getSocketEndpoints } from "./server.ts";
|
||||||
import { parseXmlDeclaration } from "./xml-parser";
|
|
||||||
import * as debug from "./debug";
|
|
||||||
import { getRequestOrigin } from "./forwarded";
|
|
||||||
import { getSocketEndpoints } from "./server";
|
|
||||||
|
|
||||||
const gzipPromisified = promisify(zlib.gzip);
|
const gzipPromisified = promisify(zlib.gzip);
|
||||||
const deflatePromisified = promisify(zlib.deflate);
|
const deflatePromisified = promisify(zlib.deflate);
|
||||||
|
|||||||
+7
-7
@@ -1,16 +1,16 @@
|
|||||||
import { decodeTag, encodeTag, escapeRegExp } from "../util";
|
import { ObjectId } from "mongodb";
|
||||||
|
import { decodeTag, encodeTag, escapeRegExp } from "../util.ts";
|
||||||
import {
|
import {
|
||||||
DeviceData,
|
DeviceData,
|
||||||
Attributes,
|
Attributes,
|
||||||
SessionFault,
|
SessionFault,
|
||||||
Task,
|
Task,
|
||||||
Operation,
|
Operation,
|
||||||
} from "../types";
|
} from "../types.ts";
|
||||||
import Path from "../common/path";
|
import Path from "../common/path.ts";
|
||||||
import { collections } from "../db/db";
|
import { collections } from "../db/db.ts";
|
||||||
import { optimizeProjection } from "../db/util";
|
import { optimizeProjection } from "../db/util.ts";
|
||||||
import * as MongoTypes from "../db/types";
|
import * as MongoTypes from "../db/types.ts";
|
||||||
import { ObjectId } from "mongodb";
|
|
||||||
|
|
||||||
const INVALID_PATH_SUFFIX = "__invalid";
|
const INVALID_PATH_SUFFIX = "__invalid";
|
||||||
|
|
||||||
|
|||||||
+11
-11
@@ -1,12 +1,12 @@
|
|||||||
import * as vm from "vm";
|
import * as vm from "node:vm";
|
||||||
import * as crypto from "crypto";
|
import * as crypto from "node:crypto";
|
||||||
import * as config from "../config";
|
import * as config from "../config.ts";
|
||||||
import { collections } from "../db/db";
|
import { collections } from "../db/db.ts";
|
||||||
import { convertOldPrecondition } from "../db/util";
|
import { convertOldPrecondition } from "../db/util.ts";
|
||||||
import * as logger from "../logger";
|
import * as logger from "../logger.ts";
|
||||||
import * as scheduling from "../scheduling";
|
import * as scheduling from "../scheduling.ts";
|
||||||
import * as expression from "../common/expression/util";
|
import * as expression from "../common/expression/util.ts";
|
||||||
import { parse } from "../common/expression/parser";
|
import { parse } from "../common/expression/parser.ts";
|
||||||
import {
|
import {
|
||||||
Preset,
|
Preset,
|
||||||
Expression,
|
Expression,
|
||||||
@@ -14,8 +14,8 @@ import {
|
|||||||
VirtualParameters,
|
VirtualParameters,
|
||||||
Files,
|
Files,
|
||||||
Config,
|
Config,
|
||||||
} from "../types";
|
} from "../types.ts";
|
||||||
import { LocalCache } from "../local-cache";
|
import { LocalCache } from "../local-cache.ts";
|
||||||
|
|
||||||
interface Snapshot {
|
interface Snapshot {
|
||||||
presets: Preset[];
|
presets: Preset[];
|
||||||
|
|||||||
+2
-21
@@ -1,25 +1,6 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { MongoClient, Collection, GridFSBucket } from "mongodb";
|
import { MongoClient, Collection, GridFSBucket } from "mongodb";
|
||||||
import { get } from "../config";
|
import { get } from "../config.ts";
|
||||||
import * as MongoTypes from "./types";
|
import * as MongoTypes from "./types.ts";
|
||||||
|
|
||||||
export let filesBucket: GridFSBucket;
|
export let filesBucket: GridFSBucket;
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -1,16 +1,16 @@
|
|||||||
import { Filter } from "mongodb";
|
import { Filter } from "mongodb";
|
||||||
import { EJSON } from "bson";
|
import { EJSON } from "bson";
|
||||||
import { parseLikePattern } from "../common/expression/parser";
|
import { parseLikePattern } from "../common/expression/parser.ts";
|
||||||
import { Expression } from "../types";
|
import { Expression } from "../types.ts";
|
||||||
import { decodeTag } from "../util";
|
import { decodeTag } from "../util.ts";
|
||||||
import {
|
import {
|
||||||
SynthContextBase,
|
SynthContextBase,
|
||||||
likeDisjoint,
|
likeDisjoint,
|
||||||
likeImplies,
|
likeImplies,
|
||||||
Clause,
|
Clause,
|
||||||
} from "../common/expression/synth";
|
} from "../common/expression/synth.ts";
|
||||||
import normalize from "../common/expression/normalize";
|
import normalize from "../common/expression/normalize.ts";
|
||||||
import * as BI from "../common/expression/bigint";
|
import * as BI from "../common/expression/bigint.ts";
|
||||||
|
|
||||||
type Minterm = number[];
|
type Minterm = number[];
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
import { ObjectId } from "mongodb";
|
import { ObjectId } from "mongodb";
|
||||||
import { Expression, FaultStruct } from "../types";
|
import { Expression, FaultStruct } from "../types.ts";
|
||||||
|
|
||||||
export interface Fault {
|
export interface Fault {
|
||||||
_id: string;
|
_id: string;
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import { Expression } from "../types";
|
import { Expression } from "../types.ts";
|
||||||
import { encodeTag } from "../util";
|
import { encodeTag } from "../util.ts";
|
||||||
|
|
||||||
// Optimize projection by removing overlaps
|
// Optimize projection by removing overlaps
|
||||||
// This can modify the object
|
// This can modify the object
|
||||||
|
|||||||
+6
-25
@@ -1,28 +1,9 @@
|
|||||||
/**
|
import { IncomingMessage, ServerResponse, ClientRequest } from "node:http";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import { Socket } from "node:net";
|
||||||
*
|
import { appendFileSync } from "node:fs";
|
||||||
* This file is part of GenieACS.
|
import { stringify } from "./common/yaml.ts";
|
||||||
*
|
import * as config from "./config.ts";
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
import { getSocketEndpoints } from "./server.ts";
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { IncomingMessage, ServerResponse, ClientRequest } from "http";
|
|
||||||
import { Socket } from "net";
|
|
||||||
import { appendFileSync } from "fs";
|
|
||||||
import { stringify } from "./common/yaml";
|
|
||||||
import * as config from "./config";
|
|
||||||
import { getSocketEndpoints } from "./server";
|
|
||||||
|
|
||||||
const DEBUG_FILE = "" + config.get("DEBUG_FILE");
|
const DEBUG_FILE = "" + config.get("DEBUG_FILE");
|
||||||
const DEBUG_FORMAT = "" + config.get("DEBUG_FORMAT");
|
const DEBUG_FORMAT = "" + config.get("DEBUG_FORMAT");
|
||||||
|
|||||||
@@ -1,27 +1,8 @@
|
|||||||
/**
|
import Path from "./common/path.ts";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import * as config from "./config.ts";
|
||||||
*
|
import * as device from "./device.ts";
|
||||||
* This file is part of GenieACS.
|
import * as scheduling from "./scheduling.ts";
|
||||||
*
|
import { SessionContext, Declaration } from "./types.ts";
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import Path from "./common/path";
|
|
||||||
import * as config from "./config";
|
|
||||||
import * as device from "./device";
|
|
||||||
import * as scheduling from "./scheduling";
|
|
||||||
import { SessionContext, Declaration } from "./types";
|
|
||||||
|
|
||||||
const MAX_DEPTH = +config.get("MAX_DEPTH");
|
const MAX_DEPTH = +config.get("MAX_DEPTH");
|
||||||
|
|
||||||
|
|||||||
+2
-21
@@ -1,30 +1,11 @@
|
|||||||
/**
|
import Path from "./common/path.ts";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import Path from "./common/path";
|
|
||||||
import {
|
import {
|
||||||
DeviceData,
|
DeviceData,
|
||||||
Declaration,
|
Declaration,
|
||||||
Clear,
|
Clear,
|
||||||
AttributeTimestamps,
|
AttributeTimestamps,
|
||||||
Attributes,
|
Attributes,
|
||||||
} from "./types";
|
} from "./types.ts";
|
||||||
|
|
||||||
const CHANGE_FLAGS = {
|
const CHANGE_FLAGS = {
|
||||||
object: 2,
|
object: 2,
|
||||||
|
|||||||
+7
-26
@@ -1,29 +1,10 @@
|
|||||||
/**
|
import { spawn, ChildProcess } from "node:child_process";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import * as crypto from "node:crypto";
|
||||||
*
|
import readline from "node:readline";
|
||||||
* This file is part of GenieACS.
|
import * as config from "./config.ts";
|
||||||
*
|
import { Fault } from "./types.ts";
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
import { ROOT_DIR } from "./config.ts";
|
||||||
* it under the terms of the GNU Affero General Public License as
|
import * as logger from "./logger.ts";
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { spawn, ChildProcess } from "child_process";
|
|
||||||
import * as crypto from "crypto";
|
|
||||||
import * as config from "./config";
|
|
||||||
import { Fault } from "./types";
|
|
||||||
import { ROOT_DIR } from "./config";
|
|
||||||
import * as logger from "./logger";
|
|
||||||
import readline from "readline";
|
|
||||||
|
|
||||||
const TIMEOUT = +config.get("EXT_TIMEOUT");
|
const TIMEOUT = +config.get("EXT_TIMEOUT");
|
||||||
|
|
||||||
|
|||||||
+4
-23
@@ -1,27 +1,8 @@
|
|||||||
/**
|
import { IncomingMessage } from "node:http";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import { TLSSocket } from "node:tls";
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { IncomingMessage } from "http";
|
|
||||||
import { TLSSocket } from "tls";
|
|
||||||
import { parseCIDR, parse, IPv6, IPv4 } from "ipaddr.js";
|
import { parseCIDR, parse, IPv6, IPv4 } from "ipaddr.js";
|
||||||
import * as config from "./config";
|
import * as config from "./config.ts";
|
||||||
import { getSocketEndpoints } from "./server";
|
import { getSocketEndpoints } from "./server.ts";
|
||||||
|
|
||||||
interface RequestOrigin {
|
interface RequestOrigin {
|
||||||
localAddress: string;
|
localAddress: string;
|
||||||
|
|||||||
@@ -1,30 +1,11 @@
|
|||||||
/**
|
import * as url from "node:url";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import { IncomingMessage, ServerResponse } from "node:http";
|
||||||
*
|
import { PassThrough, pipeline, Readable } from "node:stream";
|
||||||
* This file is part of GenieACS.
|
import { createHash } from "node:crypto";
|
||||||
*
|
import { filesBucket, collections } from "./db/db.ts";
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
import * as logger from "./logger.ts";
|
||||||
* it under the terms of the GNU Affero General Public License as
|
import { getRequestOrigin } from "./forwarded.ts";
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
import memoize from "./common/memoize.ts";
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as url from "url";
|
|
||||||
import { IncomingMessage, ServerResponse } from "http";
|
|
||||||
import { PassThrough, pipeline, Readable } from "stream";
|
|
||||||
import { createHash } from "crypto";
|
|
||||||
import { filesBucket, collections } from "./db/db";
|
|
||||||
import * as logger from "./logger";
|
|
||||||
import { getRequestOrigin } from "./forwarded";
|
|
||||||
import memoize from "./common/memoize";
|
|
||||||
|
|
||||||
const getFile = memoize(
|
const getFile = memoize(
|
||||||
async (
|
async (
|
||||||
|
|||||||
+1
-20
@@ -1,23 +1,4 @@
|
|||||||
import Path from "./common/path";
|
import Path from "./common/path.ts";
|
||||||
|
|
||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const WILDCARD_MULTIPLIER = 2;
|
const WILDCARD_MULTIPLIER = 2;
|
||||||
const UNDISCOVERED_DEPTH = 7;
|
const UNDISCOVERED_DEPTH = 7;
|
||||||
|
|||||||
+5
-24
@@ -1,33 +1,14 @@
|
|||||||
/**
|
import { getRevision, getUiConfig, getUsers } from "./ui/local-cache.ts";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import { generateSalt, hashPassword } from "./auth.ts";
|
||||||
*
|
import { collections } from "./db/db.ts";
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { getRevision, getUiConfig, getUsers } from "./ui/local-cache";
|
|
||||||
import { generateSalt, hashPassword } from "./auth";
|
|
||||||
import { collections } from "./db/db";
|
|
||||||
import {
|
import {
|
||||||
putConfig,
|
putConfig,
|
||||||
putPermission,
|
putPermission,
|
||||||
putPreset,
|
putPreset,
|
||||||
putProvision,
|
putProvision,
|
||||||
putUser,
|
putUser,
|
||||||
} from "./ui/db";
|
} from "./ui/db.ts";
|
||||||
import { del } from "./cache";
|
import { del } from "./cache.ts";
|
||||||
|
|
||||||
interface Status {
|
interface Status {
|
||||||
users: boolean;
|
users: boolean;
|
||||||
|
|||||||
@@ -1,22 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
interface Instance {
|
interface Instance {
|
||||||
[name: string]: string;
|
[name: string]: string;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-22
@@ -1,25 +1,6 @@
|
|||||||
/**
|
import { setTimeoutPromise } from "./util.ts";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import { get, set } from "./cache.ts";
|
||||||
*
|
import { acquireLock, releaseLock } from "./lock.ts";
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { setTimeoutPromise } from "./util";
|
|
||||||
import { get, set } from "./cache";
|
|
||||||
import { acquireLock, releaseLock } from "./lock";
|
|
||||||
|
|
||||||
const REFRESH = 5000;
|
const REFRESH = 5000;
|
||||||
const EVICT_TIMEOUT = 120000;
|
const EVICT_TIMEOUT = 120000;
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { collections } from "./db/db";
|
import { collections } from "./db/db.ts";
|
||||||
|
|
||||||
const CLOCK_SKEW_TOLERANCE = 30000;
|
const CLOCK_SKEW_TOLERANCE = 30000;
|
||||||
|
|
||||||
|
|||||||
+5
-25
@@ -1,27 +1,7 @@
|
|||||||
/**
|
import * as fs from "node:fs";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import * as os from "node:os";
|
||||||
*
|
import * as config from "./config.ts";
|
||||||
* This file is part of GenieACS.
|
import { getRequestOrigin } from "./forwarded.ts";
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as fs from "fs";
|
|
||||||
import * as os from "os";
|
|
||||||
|
|
||||||
import * as config from "./config";
|
|
||||||
import { getRequestOrigin } from "./forwarded";
|
|
||||||
import {
|
import {
|
||||||
SessionContext,
|
SessionContext,
|
||||||
AcsRequest,
|
AcsRequest,
|
||||||
@@ -29,7 +9,7 @@ import {
|
|||||||
CpeFault,
|
CpeFault,
|
||||||
InformRequest,
|
InformRequest,
|
||||||
Fault,
|
Fault,
|
||||||
} from "./types";
|
} from "./types.ts";
|
||||||
|
|
||||||
const REOPEN_EVERY = 60000;
|
const REOPEN_EVERY = 60000;
|
||||||
|
|
||||||
|
|||||||
+14
-33
@@ -1,38 +1,19 @@
|
|||||||
/**
|
import * as vm from "node:vm";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import { IncomingMessage, ServerResponse } from "node:http";
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { Collection, ObjectId } from "mongodb";
|
import { Collection, ObjectId } from "mongodb";
|
||||||
import * as vm from "vm";
|
import { getRevision, getConfig } from "./ui/local-cache.ts";
|
||||||
import { getRevision, getConfig } from "./ui/local-cache";
|
import { filesBucket, collections } from "./db/db.ts";
|
||||||
import { filesBucket, collections } from "./db/db";
|
import { optimizeProjection } from "./db/util.ts";
|
||||||
import { optimizeProjection } from "./db/util";
|
import * as query from "./query.ts";
|
||||||
import * as query from "./query";
|
import * as apiFunctions from "./api-functions.ts";
|
||||||
import * as apiFunctions from "./api-functions";
|
import * as cache from "./cache.ts";
|
||||||
import { IncomingMessage, ServerResponse } from "http";
|
|
||||||
import * as cache from "./cache";
|
|
||||||
import { version as VERSION } from "../package.json";
|
import { version as VERSION } from "../package.json";
|
||||||
import { ping } from "./ping";
|
import { ping } from "./ping.ts";
|
||||||
import * as logger from "./logger";
|
import * as logger from "./logger.ts";
|
||||||
import { flattenDevice } from "./ui/db";
|
import { flattenDevice } from "./ui/db.ts";
|
||||||
import { getRequestOrigin } from "./forwarded";
|
import { getRequestOrigin } from "./forwarded.ts";
|
||||||
import { acquireLock, releaseLock } from "./lock";
|
import { acquireLock, releaseLock } from "./lock.ts";
|
||||||
import { ResourceLockedError } from "./common/errors";
|
import { ResourceLockedError } from "./common/errors.ts";
|
||||||
|
|
||||||
const DEVICE_TASKS_REGEX = /^\/devices\/([a-zA-Z0-9\-_%]+)\/tasks\/?$/;
|
const DEVICE_TASKS_REGEX = /^\/devices\/([a-zA-Z0-9\-_%]+)\/tasks\/?$/;
|
||||||
const TASKS_REGEX = /^\/tasks\/([a-zA-Z0-9\-_%]+)(\/[a-zA-Z_]*)?$/;
|
const TASKS_REGEX = /^\/tasks\/([a-zA-Z0-9\-_%]+)(\/[a-zA-Z_]*)?$/;
|
||||||
|
|||||||
+3
-22
@@ -1,25 +1,6 @@
|
|||||||
/**
|
import { platform } from "node:os";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import { exec } from "node:child_process";
|
||||||
*
|
import { domainToASCII } from "node:url";
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { platform } from "os";
|
|
||||||
import { exec } from "child_process";
|
|
||||||
import { domainToASCII } from "url";
|
|
||||||
|
|
||||||
export interface PingResult {
|
export interface PingResult {
|
||||||
packetsTransmitted: number;
|
packetsTransmitted: number;
|
||||||
|
|||||||
@@ -1,22 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
function isObject(obj: any): boolean {
|
function isObject(obj: any): boolean {
|
||||||
return Object.prototype.toString.call(obj) === "[object Object]";
|
return Object.prototype.toString.call(obj) === "[object Object]";
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-26
@@ -1,30 +1,11 @@
|
|||||||
/**
|
import * as vm from "node:vm";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as vm from "vm";
|
|
||||||
import seedrandom from "seedrandom";
|
import seedrandom from "seedrandom";
|
||||||
import * as device from "./device";
|
import * as device from "./device.ts";
|
||||||
import * as extensions from "./extensions";
|
import * as extensions from "./extensions.ts";
|
||||||
import * as logger from "./logger";
|
import * as logger from "./logger.ts";
|
||||||
import * as scheduling from "./scheduling";
|
import * as scheduling from "./scheduling.ts";
|
||||||
import Path from "./common/path";
|
import Path from "./common/path.ts";
|
||||||
import { Fault, SessionContext, ScriptResult } from "./types";
|
import { Fault, SessionContext, ScriptResult } from "./types.ts";
|
||||||
|
|
||||||
// Used for throwing to exit user script and commit
|
// Used for throwing to exit user script and commit
|
||||||
const COMMIT = Symbol();
|
const COMMIT = Symbol();
|
||||||
|
|||||||
+1
-20
@@ -1,23 +1,4 @@
|
|||||||
/**
|
import * as crypto from "node:crypto";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as crypto from "crypto";
|
|
||||||
import * as later from "@breejs/later";
|
import * as later from "@breejs/later";
|
||||||
|
|
||||||
function md532(str): number {
|
function md532(str): number {
|
||||||
|
|||||||
+6
-25
@@ -1,28 +1,9 @@
|
|||||||
/**
|
import * as fs from "node:fs";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import * as http from "node:http";
|
||||||
*
|
import * as https from "node:https";
|
||||||
* This file is part of GenieACS.
|
import { Socket } from "node:net";
|
||||||
*
|
import * as path from "node:path";
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
import { ROOT_DIR } from "./config.ts";
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as fs from "fs";
|
|
||||||
import * as http from "http";
|
|
||||||
import * as https from "https";
|
|
||||||
import { Socket } from "net";
|
|
||||||
import * as path from "path";
|
|
||||||
import { ROOT_DIR } from "./config";
|
|
||||||
|
|
||||||
let server: http.Server | https.Server;
|
let server: http.Server | https.Server;
|
||||||
let listener: http.RequestListener;
|
let listener: http.RequestListener;
|
||||||
|
|||||||
+13
-32
@@ -1,31 +1,12 @@
|
|||||||
/**
|
import * as device from "./device.ts";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import * as sandbox from "./sandbox.ts";
|
||||||
*
|
import * as localCache from "./cwmp/local-cache.ts";
|
||||||
* This file is part of GenieACS.
|
import * as defaultProvisions from "./default-provisions.ts";
|
||||||
*
|
import { estimateGpnCount } from "./gpn-heuristic.ts";
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
import Path from "./common/path.ts";
|
||||||
* it under the terms of the GNU Affero General Public License as
|
import PathSet from "./common/path-set.ts";
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
import VersionedMap from "./versioned-map.ts";
|
||||||
* License, or (at your option) any later version.
|
import InstanceSet from "./instance-set.ts";
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as device from "./device";
|
|
||||||
import * as sandbox from "./sandbox";
|
|
||||||
import * as localCache from "./cwmp/local-cache";
|
|
||||||
import * as defaultProvisions from "./default-provisions";
|
|
||||||
import { estimateGpnCount } from "./gpn-heuristic";
|
|
||||||
import Path from "./common/path";
|
|
||||||
import PathSet from "./common/path-set";
|
|
||||||
import VersionedMap from "./versioned-map";
|
|
||||||
import InstanceSet from "./instance-set";
|
|
||||||
import {
|
import {
|
||||||
Attributes,
|
Attributes,
|
||||||
SessionContext,
|
SessionContext,
|
||||||
@@ -57,10 +38,10 @@ import {
|
|||||||
FactoryReset,
|
FactoryReset,
|
||||||
AddObjectResponse,
|
AddObjectResponse,
|
||||||
GetParameterValuesResponse,
|
GetParameterValuesResponse,
|
||||||
} from "./types";
|
} from "./types.ts";
|
||||||
import { getRequestOrigin } from "./forwarded";
|
import { getRequestOrigin } from "./forwarded.ts";
|
||||||
import * as logger from "./logger";
|
import * as logger from "./logger.ts";
|
||||||
import { encodeTag } from "./util";
|
import { encodeTag } from "./util.ts";
|
||||||
|
|
||||||
const VALID_PARAM_TYPES = new Set([
|
const VALID_PARAM_TYPES = new Set([
|
||||||
"xsd:int",
|
"xsd:int",
|
||||||
|
|||||||
+4
-23
@@ -1,30 +1,11 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
parseXml,
|
parseXml,
|
||||||
Element,
|
Element,
|
||||||
parseAttrs,
|
parseAttrs,
|
||||||
encodeEntities,
|
encodeEntities,
|
||||||
decodeEntities,
|
decodeEntities,
|
||||||
} from "./xml-parser";
|
} from "./xml-parser.ts";
|
||||||
import memoize from "./common/memoize";
|
import memoize from "./common/memoize.ts";
|
||||||
import { version as VERSION } from "../package.json";
|
import { version as VERSION } from "../package.json";
|
||||||
import {
|
import {
|
||||||
InformRequest,
|
InformRequest,
|
||||||
@@ -48,8 +29,8 @@ import {
|
|||||||
GetRPCMethodsRequest,
|
GetRPCMethodsRequest,
|
||||||
RequestDownloadRequest,
|
RequestDownloadRequest,
|
||||||
AcsResponse,
|
AcsResponse,
|
||||||
} from "./types";
|
} from "./types.ts";
|
||||||
import Path from "./common/path";
|
import Path from "./common/path.ts";
|
||||||
|
|
||||||
const SERVER_NAME = `GenieACS/${VERSION}`;
|
const SERVER_NAME = `GenieACS/${VERSION}`;
|
||||||
|
|
||||||
|
|||||||
+6
-25
@@ -1,28 +1,9 @@
|
|||||||
/**
|
import { IncomingMessage, ServerResponse } from "node:http";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import { Script } from "node:vm";
|
||||||
*
|
import Path from "./common/path.ts";
|
||||||
* This file is part of GenieACS.
|
import PathSet from "./common/path-set.ts";
|
||||||
*
|
import VersionedMap from "./versioned-map.ts";
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
import InstanceSet from "./instance-set.ts";
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import Path from "./common/path";
|
|
||||||
import PathSet from "./common/path-set";
|
|
||||||
import VersionedMap from "./versioned-map";
|
|
||||||
import InstanceSet from "./instance-set";
|
|
||||||
import { IncomingMessage, ServerResponse } from "http";
|
|
||||||
import { Script } from "vm";
|
|
||||||
|
|
||||||
export type Expression = string | number | boolean | null | any[];
|
export type Expression = string | number | boolean | null | any[];
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +1,4 @@
|
|||||||
/**
|
import { constants } from "node:zlib";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { constants } from "zlib";
|
|
||||||
import Koa from "koa";
|
import Koa from "koa";
|
||||||
import Router from "koa-router";
|
import Router from "koa-router";
|
||||||
import * as jwt from "jsonwebtoken";
|
import * as jwt from "jsonwebtoken";
|
||||||
@@ -25,17 +6,17 @@ import koaStatic from "koa-static";
|
|||||||
import koaCompress from "koa-compress";
|
import koaCompress from "koa-compress";
|
||||||
import koaBodyParser from "koa-bodyparser";
|
import koaBodyParser from "koa-bodyparser";
|
||||||
import koaJwt from "koa-jwt";
|
import koaJwt from "koa-jwt";
|
||||||
import * as config from "./config";
|
import * as config from "./config.ts";
|
||||||
import api from "./ui/api";
|
import api from "./ui/api.ts";
|
||||||
import Authorizer from "./common/authorizer";
|
import Authorizer from "./common/authorizer.ts";
|
||||||
import * as logger from "./logger";
|
import * as logger from "./logger.ts";
|
||||||
import * as localCache from "./ui/local-cache";
|
import * as localCache from "./ui/local-cache.ts";
|
||||||
import { PermissionSet } from "./types";
|
import { PermissionSet } from "./types.ts";
|
||||||
import { authLocal } from "./api-functions";
|
import { authLocal } from "./api-functions.ts";
|
||||||
import * as init from "./init";
|
import * as init from "./init.ts";
|
||||||
import { version as VERSION } from "../package.json";
|
import { version as VERSION } from "../package.json";
|
||||||
import memoize from "./common/memoize";
|
import memoize from "./common/memoize.ts";
|
||||||
import { APP_JS, APP_CSS, FAVICON_PNG } from "../build/assets";
|
import { APP_JS, APP_CSS, FAVICON_PNG } from "../build/assets.ts";
|
||||||
|
|
||||||
declare module "koa" {
|
declare module "koa" {
|
||||||
interface Request {
|
interface Request {
|
||||||
|
|||||||
+17
-36
@@ -1,41 +1,22 @@
|
|||||||
/**
|
import { PassThrough } from "node:stream";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { PassThrough } from "stream";
|
|
||||||
import Router from "koa-router";
|
import Router from "koa-router";
|
||||||
import { ObjectId } from "mongodb";
|
import { ObjectId } from "mongodb";
|
||||||
import * as db from "./db";
|
import * as db from "./db.ts";
|
||||||
import * as apiFunctions from "../api-functions";
|
import * as apiFunctions from "../api-functions.ts";
|
||||||
import { evaluate, and, extractParams } from "../common/expression/util";
|
import { evaluate, and, extractParams } from "../common/expression/util.ts";
|
||||||
import { parse } from "../common/expression/parser";
|
import { parse } from "../common/expression/parser.ts";
|
||||||
import * as logger from "../logger";
|
import * as logger from "../logger.ts";
|
||||||
import { getConfig } from "../ui/local-cache";
|
import { getConfig } from "../ui/local-cache.ts";
|
||||||
import { Expression, Task } from "../types";
|
import { Expression, Task } from "../types.ts";
|
||||||
import { generateSalt, hashPassword } from "../auth";
|
import { generateSalt, hashPassword } from "../auth.ts";
|
||||||
import { del } from "../cache";
|
import { del } from "../cache.ts";
|
||||||
import Authorizer from "../common/authorizer";
|
import Authorizer from "../common/authorizer.ts";
|
||||||
import { ping } from "../ping";
|
import { ping } from "../ping.ts";
|
||||||
import { decodeTag } from "../util";
|
import { decodeTag } from "../util.ts";
|
||||||
import { stringify as yamlStringify } from "../common/yaml";
|
import { stringify as yamlStringify } from "../common/yaml.ts";
|
||||||
import { ResourceLockedError } from "../common/errors";
|
import { ResourceLockedError } from "../common/errors.ts";
|
||||||
import { acquireLock, releaseLock } from "../lock";
|
import { acquireLock, releaseLock } from "../lock.ts";
|
||||||
import { collections } from "../db/db";
|
import { collections } from "../db/db.ts";
|
||||||
|
|
||||||
const router = new Router();
|
const router = new Router();
|
||||||
export default router;
|
export default router;
|
||||||
|
|||||||
+10
-29
@@ -1,33 +1,14 @@
|
|||||||
/**
|
import { Script } from "node:vm";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
import { Readable } from "node:stream";
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { encodeTag } from "../util";
|
|
||||||
import { evaluate } from "../common/expression/util";
|
|
||||||
import { Expression, Fault, Task } from "../types";
|
|
||||||
import { collections, filesBucket } from "../db/db";
|
|
||||||
import { convertOldPrecondition, optimizeProjection } from "../db/util";
|
|
||||||
import * as MongoTypes from "../db/types";
|
|
||||||
import { parse, parseList, stringify } from "../common/expression/parser";
|
|
||||||
import { toMongoQuery } from "../db/synth";
|
|
||||||
import { Collection, ObjectId, WithoutId } from "mongodb";
|
import { Collection, ObjectId, WithoutId } from "mongodb";
|
||||||
import { Script } from "vm";
|
import { encodeTag } from "../util.ts";
|
||||||
import { Readable } from "stream";
|
import { evaluate } from "../common/expression/util.ts";
|
||||||
|
import { Expression, Fault, Task } from "../types.ts";
|
||||||
|
import { collections, filesBucket } from "../db/db.ts";
|
||||||
|
import { convertOldPrecondition, optimizeProjection } from "../db/util.ts";
|
||||||
|
import * as MongoTypes from "../db/types.ts";
|
||||||
|
import { parse, parseList, stringify } from "../common/expression/parser.ts";
|
||||||
|
import { toMongoQuery } from "../db/synth.ts";
|
||||||
|
|
||||||
function processDeviceProjection(
|
function processDeviceProjection(
|
||||||
projection: Record<string, 1>,
|
projection: Record<string, 1>,
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import * as crypto from "crypto";
|
import * as crypto from "node:crypto";
|
||||||
import * as config from "../config";
|
import * as config from "../config.ts";
|
||||||
import { collections } from "../db/db";
|
import { collections } from "../db/db.ts";
|
||||||
import * as expression from "../common/expression/util";
|
import * as expression from "../common/expression/util.ts";
|
||||||
import { parse } from "../common/expression/parser";
|
import { parse } from "../common/expression/parser.ts";
|
||||||
import { Expression, Users, Permissions, Config, UiConfig } from "../types";
|
import { Expression, Users, Permissions, Config, UiConfig } from "../types.ts";
|
||||||
import { LocalCache } from "../local-cache";
|
import { LocalCache } from "../local-cache.ts";
|
||||||
|
|
||||||
interface Snapshot {
|
interface Snapshot {
|
||||||
permissions: Permissions;
|
permissions: Permissions;
|
||||||
|
|||||||
+1
-20
@@ -1,23 +1,4 @@
|
|||||||
/**
|
import { EventEmitter } from "node:events";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { EventEmitter } from "events";
|
|
||||||
|
|
||||||
export function generateDeviceId(
|
export function generateDeviceId(
|
||||||
deviceIdStruct: Record<string, string>,
|
deviceIdStruct: Record<string, string>,
|
||||||
|
|||||||
@@ -1,22 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const NONEXISTENT = Symbol();
|
const NONEXISTENT = Symbol();
|
||||||
const UNDEFINED = undefined;
|
const UNDEFINED = undefined;
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
const CHAR_SINGLE_QUOTE = 39;
|
const CHAR_SINGLE_QUOTE = 39;
|
||||||
const CHAR_DOUBLE_QUOTE = 34;
|
const CHAR_DOUBLE_QUOTE = 34;
|
||||||
const CHAR_LESS_THAN = 60;
|
const CHAR_LESS_THAN = 60;
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
import test from "node:test";
|
import test from "node:test";
|
||||||
import assert from "node:assert";
|
import assert from "node:assert";
|
||||||
import { randomBytes } from "crypto";
|
import { randomBytes } from "node:crypto";
|
||||||
import * as auth from "../lib/auth";
|
import * as auth from "../lib/auth.ts";
|
||||||
|
|
||||||
void test("digest", () => {
|
void test("digest", () => {
|
||||||
const username = "test";
|
const username = "test";
|
||||||
|
|||||||
+3
-3
@@ -2,9 +2,9 @@ import test from "node:test";
|
|||||||
import assert from "node:assert";
|
import assert from "node:assert";
|
||||||
import { EJSON } from "bson";
|
import { EJSON } from "bson";
|
||||||
import { Filter } from "mongodb";
|
import { Filter } from "mongodb";
|
||||||
import { stringify, parse } from "../lib/common/expression/parser";
|
import { stringify, parse } from "../lib/common/expression/parser.ts";
|
||||||
import { convertOldPrecondition } from "../lib/db/util";
|
import { convertOldPrecondition } from "../lib/db/util.ts";
|
||||||
import { toMongoQuery } from "../lib/db/synth";
|
import { toMongoQuery } from "../lib/db/synth.ts";
|
||||||
|
|
||||||
void test("convertOldPrecondition", () => {
|
void test("convertOldPrecondition", () => {
|
||||||
const tests = [
|
const tests = [
|
||||||
|
|||||||
+5
-5
@@ -1,10 +1,10 @@
|
|||||||
import test from "node:test";
|
import test from "node:test";
|
||||||
import assert from "node:assert";
|
import assert from "node:assert";
|
||||||
import Path from "../lib/common/path";
|
import Path from "../lib/common/path.ts";
|
||||||
import * as device from "../lib/device";
|
import * as device from "../lib/device.ts";
|
||||||
import PathSet from "../lib/common/path-set";
|
import PathSet from "../lib/common/path-set.ts";
|
||||||
import VersionedMap from "../lib/versioned-map";
|
import VersionedMap from "../lib/versioned-map.ts";
|
||||||
import { Attributes } from "../lib/types";
|
import { Attributes } from "../lib/types.ts";
|
||||||
|
|
||||||
void test("getAliasDeclarations", () => {
|
void test("getAliasDeclarations", () => {
|
||||||
const path = Path.parse("a.[aa:10,bb.[aaa:100].cc:1].b");
|
const path = Path.parse("a.[aa:10,bb.[aaa:100].cc:1].b");
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
import test from "node:test";
|
import test from "node:test";
|
||||||
import assert from "node:assert";
|
import assert from "node:assert";
|
||||||
import Path from "../lib/common/path";
|
import Path from "../lib/common/path.ts";
|
||||||
import PathSet from "../lib/common/path-set";
|
import PathSet from "../lib/common/path-set.ts";
|
||||||
|
|
||||||
void test("depth", () => {
|
void test("depth", () => {
|
||||||
const pathSet = new PathSet();
|
const pathSet = new PathSet();
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import test from "node:test";
|
import test from "node:test";
|
||||||
import assert from "node:assert";
|
import assert from "node:assert";
|
||||||
import Path from "../lib/common/path";
|
import Path from "../lib/common/path.ts";
|
||||||
|
|
||||||
void test("parse", () => {
|
void test("parse", () => {
|
||||||
assert.throws(() => Path.parse("."));
|
assert.throws(() => Path.parse("."));
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import test from "node:test";
|
import test from "node:test";
|
||||||
import assert from "node:assert";
|
import assert from "node:assert";
|
||||||
import { parsePing } from "../lib/ping";
|
import { parsePing } from "../lib/ping.ts";
|
||||||
|
|
||||||
void test("linux Case-1", () => {
|
void test("linux Case-1", () => {
|
||||||
const platform = "linux";
|
const platform = "linux";
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
import test from "node:test";
|
import test from "node:test";
|
||||||
import assert from "node:assert";
|
import assert from "node:assert";
|
||||||
import { minimize, unionDiff } from "../lib/common/expression/synth";
|
|
||||||
import { parse, stringify } from "../lib/common/expression/parser";
|
|
||||||
import initSqlJs from "sql.js/dist/sql-asm.js";
|
import initSqlJs from "sql.js/dist/sql-asm.js";
|
||||||
|
import { minimize, unionDiff } from "../lib/common/expression/synth.ts";
|
||||||
|
import { parse, stringify } from "../lib/common/expression/parser.ts";
|
||||||
|
|
||||||
const STRING_VALUES = [null, "", "a", "ab", "ab10", "ab-10"];
|
const STRING_VALUES = [null, "", "a", "ab", "ab10", "ab-10"];
|
||||||
const DECIMAL_VALUES = [null, 0, -10, 10];
|
const DECIMAL_VALUES = [null, 0, -10, 10];
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import test from "node:test";
|
import test from "node:test";
|
||||||
import assert from "node:assert";
|
import assert from "node:assert";
|
||||||
import * as common from "../lib/util";
|
import * as common from "../lib/util.ts";
|
||||||
|
|
||||||
void test("generateDeviceId", () => {
|
void test("generateDeviceId", () => {
|
||||||
const space = [" ", "%20"];
|
const space = [" ", "%20"];
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ import {
|
|||||||
parseXmlDeclaration,
|
parseXmlDeclaration,
|
||||||
decodeEntities,
|
decodeEntities,
|
||||||
parseXml,
|
parseXml,
|
||||||
} from "../lib/xml-parser";
|
} from "../lib/xml-parser.ts";
|
||||||
|
|
||||||
void test("parseXmlDeclaration", () => {
|
void test("parseXmlDeclaration", () => {
|
||||||
const buf = Buffer.from(
|
const buf = Buffer.from(
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import test from "node:test";
|
import test from "node:test";
|
||||||
import assert from "node:assert";
|
import assert from "node:assert";
|
||||||
import * as yaml from "yaml";
|
import * as yaml from "yaml";
|
||||||
import { stringify } from "../lib/common/yaml";
|
import { stringify } from "../lib/common/yaml.ts";
|
||||||
|
|
||||||
import testCases from "./yaml-tests.json";
|
import testCases from "./yaml-tests.json";
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -9,7 +9,9 @@
|
|||||||
"alwaysStrict": true,
|
"alwaysStrict": true,
|
||||||
"noImplicitReturns": true,
|
"noImplicitReturns": true,
|
||||||
"strictFunctionTypes": true,
|
"strictFunctionTypes": true,
|
||||||
"isolatedModules": true
|
"isolatedModules": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"allowImportingTsExtensions": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"./bin/*.ts",
|
"./bin/*.ts",
|
||||||
|
|||||||
+1
-21
@@ -1,24 +1,4 @@
|
|||||||
/**
|
import m, { ClosureComponent, Component } from "mithril";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import m from "mithril";
|
|
||||||
import { ClosureComponent, Component } from "mithril";
|
|
||||||
|
|
||||||
const component: ClosureComponent = (): Component => {
|
const component: ClosureComponent = (): Component => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,43 +1,24 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import m, { RouteResolver } from "mithril";
|
import m, { RouteResolver } from "mithril";
|
||||||
import layout from "./layout";
|
import layout from "./layout.ts";
|
||||||
import * as store from "./store";
|
import * as store from "./store.ts";
|
||||||
import * as wizardPage from "./wizard-page";
|
import * as wizardPage from "./wizard-page.ts";
|
||||||
import * as loginPage from "./login-page";
|
import * as loginPage from "./login-page.ts";
|
||||||
import * as overviewPage from "./overview-page";
|
import * as overviewPage from "./overview-page.ts";
|
||||||
import * as devicesPage from "./devices-page";
|
import * as devicesPage from "./devices-page.ts";
|
||||||
import * as devicePage from "./device-page";
|
import * as devicePage from "./device-page.ts";
|
||||||
import * as errorPage from "./error-page";
|
import * as errorPage from "./error-page.ts";
|
||||||
import * as faultsPage from "./faults-page";
|
import * as faultsPage from "./faults-page.ts";
|
||||||
import * as presetsPage from "./presets-page";
|
import * as presetsPage from "./presets-page.ts";
|
||||||
import * as provisionsPage from "./provisions-page";
|
import * as provisionsPage from "./provisions-page.ts";
|
||||||
import * as virtualParametersPage from "./virtual-parameters-page";
|
import * as virtualParametersPage from "./virtual-parameters-page.ts";
|
||||||
import * as filesPage from "./files-page";
|
import * as filesPage from "./files-page.ts";
|
||||||
import * as configPage from "./config-page";
|
import * as configPage from "./config-page.ts";
|
||||||
import * as permissionsPage from "./permissions-page";
|
import * as permissionsPage from "./permissions-page.ts";
|
||||||
import * as usersPage from "./users-page";
|
import * as usersPage from "./users-page.ts";
|
||||||
import Authorizer from "../lib//common/authorizer";
|
import Authorizer from "../lib//common/authorizer.ts";
|
||||||
import * as notifications from "./notifications";
|
import * as notifications from "./notifications.ts";
|
||||||
import { contextifyComponent } from "./components";
|
import { contextifyComponent } from "./components.ts";
|
||||||
import { PermissionSet, UiConfig } from "../lib/types";
|
import { PermissionSet, UiConfig } from "../lib/types.ts";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
|
|||||||
@@ -1,22 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
type AutocompleteCallback = (
|
type AutocompleteCallback = (
|
||||||
value: string,
|
value: string,
|
||||||
callback: (suggestions: { value: string; tip?: string }[]) => void,
|
callback: (suggestions: { value: string; tip?: string }[]) => void,
|
||||||
|
|||||||
@@ -1,26 +1,7 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { VnodeDOM, ClosureComponent } from "mithril";
|
import { VnodeDOM, ClosureComponent } from "mithril";
|
||||||
import * as notifications from "./notifications";
|
import * as notifications from "./notifications.ts";
|
||||||
import { changePassword } from "./store";
|
import { changePassword } from "./store.ts";
|
||||||
import { m } from "./components";
|
import { m } from "./components.ts";
|
||||||
|
|
||||||
interface Attrs {
|
interface Attrs {
|
||||||
noAuth?: boolean;
|
noAuth?: boolean;
|
||||||
|
|||||||
@@ -1,26 +1,7 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { Editor } from "codemirror";
|
import { Editor } from "codemirror";
|
||||||
import { ClosureComponent } from "mithril";
|
import { ClosureComponent } from "mithril";
|
||||||
import { m } from "./components";
|
import { m } from "./components.ts";
|
||||||
import { codeMirror } from "./dynamic-loader";
|
import { codeMirror } from "./dynamic-loader.ts";
|
||||||
|
|
||||||
interface Attrs {
|
interface Attrs {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
+14
-33
@@ -1,22 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import m, {
|
import m, {
|
||||||
Static,
|
Static,
|
||||||
Attributes,
|
Attributes,
|
||||||
@@ -26,20 +7,20 @@ import m, {
|
|||||||
ClosureComponent,
|
ClosureComponent,
|
||||||
Vnode,
|
Vnode,
|
||||||
} from "mithril";
|
} from "mithril";
|
||||||
import parameter from "./components/parameter";
|
import parameter from "./components/parameter.ts";
|
||||||
import parameterList from "./components/parameter-list";
|
import parameterList from "./components/parameter-list.ts";
|
||||||
import parameterTable from "./components/parameter-table";
|
import parameterTable from "./components/parameter-table.ts";
|
||||||
import overviewDot from "./components/overview-dot";
|
import overviewDot from "./components/overview-dot.ts";
|
||||||
import container from "./components/container";
|
import container from "./components/container.ts";
|
||||||
import summonButton from "./components/summon-button";
|
import summonButton from "./components/summon-button.ts";
|
||||||
import deviceFaults from "./components/device-faults";
|
import deviceFaults from "./components/device-faults.ts";
|
||||||
import allParameters from "./components/all-parameters";
|
import allParameters from "./components/all-parameters.ts";
|
||||||
import deviceActions from "./components/device-actions";
|
import deviceActions from "./components/device-actions.ts";
|
||||||
import tags from "./components/tags";
|
import tags from "./components/tags.ts";
|
||||||
import ping from "./components/ping";
|
import ping from "./components/ping.ts";
|
||||||
import deviceLink from "./components/device-link";
|
import deviceLink from "./components/device-link.ts";
|
||||||
import longTextComponent from "./long-text-component";
|
import longTextComponent from "./long-text-component.ts";
|
||||||
import loading from "./components/loading";
|
import loading from "./components/loading.ts";
|
||||||
|
|
||||||
const comps = {
|
const comps = {
|
||||||
parameter,
|
parameter,
|
||||||
|
|||||||
@@ -1,32 +1,13 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ClosureComponent } from "mithril";
|
import { ClosureComponent } from "mithril";
|
||||||
import { m } from "../components";
|
import { m } from "../components.ts";
|
||||||
import * as taskQueue from "../task-queue";
|
import * as taskQueue from "../task-queue.ts";
|
||||||
import { parse } from "../../lib/common/expression/parser";
|
import { parse } from "../../lib/common/expression/parser.ts";
|
||||||
import memoize from "../../lib/common/memoize";
|
import memoize from "../../lib/common/memoize.ts";
|
||||||
import { getIcon } from "../icons";
|
import { getIcon } from "../icons.ts";
|
||||||
import { QueryResponse, evaluateExpression } from "../store";
|
import { QueryResponse, evaluateExpression } from "../store.ts";
|
||||||
import debounce from "../../lib/common/debounce";
|
import debounce from "../../lib/common/debounce.ts";
|
||||||
import { Expression } from "../../lib/types";
|
import { Expression } from "../../lib/types.ts";
|
||||||
import { FlatDevice } from "../../lib/ui/db";
|
import { FlatDevice } from "../../lib/ui/db.ts";
|
||||||
|
|
||||||
const memoizedParse = memoize(parse);
|
const memoizedParse = memoize(parse);
|
||||||
|
|
||||||
|
|||||||
@@ -1,29 +1,10 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { Attributes, ClosureComponent } from "mithril";
|
import { Attributes, ClosureComponent } from "mithril";
|
||||||
import { map } from "../../lib/common/expression/parser";
|
import { map } from "../../lib/common/expression/parser.ts";
|
||||||
import memoize from "../../lib/common/memoize";
|
import memoize from "../../lib/common/memoize.ts";
|
||||||
import { Expression } from "../../lib/types";
|
import { Expression } from "../../lib/types.ts";
|
||||||
import { m } from "../components";
|
import { m } from "../components.ts";
|
||||||
import { evaluateExpression, getTimestamp } from "../store";
|
import { evaluateExpression, getTimestamp } from "../store.ts";
|
||||||
import { FlatDevice } from "../../lib/ui/db";
|
import { FlatDevice } from "../../lib/ui/db.ts";
|
||||||
|
|
||||||
const evaluateAttributes = memoize(
|
const evaluateAttributes = memoize(
|
||||||
(
|
(
|
||||||
|
|||||||
@@ -1,27 +1,8 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ClosureComponent, Component } from "mithril";
|
import { ClosureComponent, Component } from "mithril";
|
||||||
import { m } from "../components";
|
import { m } from "../components.ts";
|
||||||
import * as taskQueue from "../task-queue";
|
import * as taskQueue from "../task-queue.ts";
|
||||||
import * as notifications from "../notifications";
|
import * as notifications from "../notifications.ts";
|
||||||
import * as store from "../store";
|
import * as store from "../store.ts";
|
||||||
|
|
||||||
const component: ClosureComponent = (): Component => {
|
const component: ClosureComponent = (): Component => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,28 +1,9 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ClosureComponent, Component } from "mithril";
|
import { ClosureComponent, Component } from "mithril";
|
||||||
import { m } from "../components";
|
import { m } from "../components.ts";
|
||||||
import * as store from "../store";
|
import * as store from "../store.ts";
|
||||||
import * as notifications from "../notifications";
|
import * as notifications from "../notifications.ts";
|
||||||
import { getIcon } from "../icons";
|
import { getIcon } from "../icons.ts";
|
||||||
import { stringify } from "../../lib/common/yaml";
|
import { stringify } from "../../lib/common/yaml.ts";
|
||||||
|
|
||||||
const component: ClosureComponent = (): Component => {
|
const component: ClosureComponent = (): Component => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,25 +1,6 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ClosureComponent, Component } from "mithril";
|
import { ClosureComponent, Component } from "mithril";
|
||||||
import { m } from "../components";
|
import { m } from "../components.ts";
|
||||||
import { evaluateExpression } from "../store";
|
import { evaluateExpression } from "../store.ts";
|
||||||
|
|
||||||
const component: ClosureComponent = (): Component => {
|
const component: ClosureComponent = (): Component => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,22 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2021 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { VnodeDOM, ClosureComponent, Component } from "mithril";
|
import { VnodeDOM, ClosureComponent, Component } from "mithril";
|
||||||
|
|
||||||
const component: ClosureComponent = (): Component => {
|
const component: ClosureComponent = (): Component => {
|
||||||
|
|||||||
@@ -1,26 +1,7 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ClosureComponent, Component } from "mithril";
|
import { ClosureComponent, Component } from "mithril";
|
||||||
import { m } from "../components";
|
import { m } from "../components.ts";
|
||||||
import config from "../config";
|
import config from "../config.ts";
|
||||||
import { evaluateExpression } from "../store";
|
import { evaluateExpression } from "../store.ts";
|
||||||
|
|
||||||
const CHARTS = config.ui.overview.charts;
|
const CHARTS = config.ui.overview.charts;
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +1,8 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ClosureComponent, VnodeDOM } from "mithril";
|
import { ClosureComponent, VnodeDOM } from "mithril";
|
||||||
import { m } from "../components";
|
import { m } from "../components.ts";
|
||||||
import { QueryResponse, evaluateExpression } from "../store";
|
import { QueryResponse, evaluateExpression } from "../store.ts";
|
||||||
import { FlatDevice } from "../../lib/ui/db";
|
import { FlatDevice } from "../../lib/ui/db.ts";
|
||||||
import { Expression } from "../../lib/types";
|
import { Expression } from "../../lib/types.ts";
|
||||||
|
|
||||||
interface Attrs {
|
interface Attrs {
|
||||||
device: FlatDevice;
|
device: FlatDevice;
|
||||||
|
|||||||
@@ -1,30 +1,11 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ClosureComponent } from "mithril";
|
import { ClosureComponent } from "mithril";
|
||||||
import { m } from "../components";
|
import { m } from "../components.ts";
|
||||||
import * as taskQueue from "../task-queue";
|
import * as taskQueue from "../task-queue.ts";
|
||||||
import { QueryResponse, evaluateExpression } from "../store";
|
import { QueryResponse, evaluateExpression } from "../store.ts";
|
||||||
import * as expressionParser from "../../lib/common/expression/parser";
|
import * as expressionParser from "../../lib/common/expression/parser.ts";
|
||||||
import { getIcon } from "../icons";
|
import { getIcon } from "../icons.ts";
|
||||||
import { FlatDevice } from "../../lib/ui/db";
|
import { FlatDevice } from "../../lib/ui/db.ts";
|
||||||
import { Expression } from "../../lib/types";
|
import { Expression } from "../../lib/types.ts";
|
||||||
|
|
||||||
interface Attrs {
|
interface Attrs {
|
||||||
device: FlatDevice;
|
device: FlatDevice;
|
||||||
|
|||||||
@@ -1,30 +1,11 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ClosureComponent, Component, VnodeDOM } from "mithril";
|
import { ClosureComponent, Component, VnodeDOM } from "mithril";
|
||||||
import { m } from "../components";
|
import { m } from "../components.ts";
|
||||||
import * as taskQueue from "../task-queue";
|
import * as taskQueue from "../task-queue.ts";
|
||||||
import * as store from "../store";
|
import * as store from "../store.ts";
|
||||||
import { evaluate } from "../../lib/common/expression/util";
|
import { evaluate } from "../../lib/common/expression/util.ts";
|
||||||
import memoize from "../../lib/common/memoize";
|
import memoize from "../../lib/common/memoize.ts";
|
||||||
import timeAgo from "../timeago";
|
import timeAgo from "../timeago.ts";
|
||||||
import { getIcon } from "../icons";
|
import { getIcon } from "../icons.ts";
|
||||||
|
|
||||||
const evaluateParam = memoize((exp, obj, now: number) => {
|
const evaluateParam = memoize((exp, obj, now: number) => {
|
||||||
let timestamp = now;
|
let timestamp = now;
|
||||||
|
|||||||
+2
-21
@@ -1,25 +1,6 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ClosureComponent, Component, VnodeDOM } from "mithril";
|
import { ClosureComponent, Component, VnodeDOM } from "mithril";
|
||||||
import { m } from "../components";
|
import { m } from "../components.ts";
|
||||||
import * as store from "../store";
|
import * as store from "../store.ts";
|
||||||
|
|
||||||
const REFRESH_INTERVAL = 3000;
|
const REFRESH_INTERVAL = 3000;
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +1,8 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ClosureComponent, Component } from "mithril";
|
import { ClosureComponent, Component } from "mithril";
|
||||||
import { m } from "../components";
|
import { m } from "../components.ts";
|
||||||
import * as taskQueue from "../task-queue";
|
import * as taskQueue from "../task-queue.ts";
|
||||||
import * as store from "../store";
|
import * as store from "../store.ts";
|
||||||
import * as notifications from "../notifications";
|
import * as notifications from "../notifications.ts";
|
||||||
|
|
||||||
const component: ClosureComponent = (): Component => {
|
const component: ClosureComponent = (): Component => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
+7
-26
@@ -1,30 +1,11 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ClosureComponent } from "mithril";
|
import { ClosureComponent } from "mithril";
|
||||||
import { m } from "../components";
|
import { m } from "../components.ts";
|
||||||
import * as notifications from "../notifications";
|
import * as notifications from "../notifications.ts";
|
||||||
import * as store from "../store";
|
import * as store from "../store.ts";
|
||||||
import { getIcon } from "../icons";
|
import { getIcon } from "../icons.ts";
|
||||||
import { decodeTag } from "../../lib/util";
|
import { decodeTag } from "../../lib/util.ts";
|
||||||
import { Expression } from "../../lib/types";
|
import { Expression } from "../../lib/types.ts";
|
||||||
import { FlatDevice } from "../../lib/ui/db";
|
import { FlatDevice } from "../../lib/ui/db.ts";
|
||||||
|
|
||||||
interface Attrs {
|
interface Attrs {
|
||||||
device: FlatDevice;
|
device: FlatDevice;
|
||||||
|
|||||||
@@ -1,22 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
interface Config {
|
interface Config {
|
||||||
_id: string;
|
_id: string;
|
||||||
value: string;
|
value: string;
|
||||||
|
|||||||
+9
-28
@@ -1,32 +1,13 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { m } from "./components";
|
|
||||||
import * as store from "./store";
|
|
||||||
import * as notifications from "./notifications";
|
|
||||||
import putFormComponent from "./put-form-component";
|
|
||||||
import uiConfigComponent from "./ui-config-component";
|
|
||||||
import * as overlay from "./overlay";
|
|
||||||
import { parse, stringify } from "../lib/common/expression/parser";
|
|
||||||
import { loadCodeMirror, loadYaml } from "./dynamic-loader";
|
|
||||||
import { ClosureComponent, Component, Children } from "mithril";
|
import { ClosureComponent, Component, Children } from "mithril";
|
||||||
import { getIcon } from "./icons";
|
import { m } from "./components.ts";
|
||||||
|
import * as store from "./store.ts";
|
||||||
|
import * as notifications from "./notifications.ts";
|
||||||
|
import putFormComponent from "./put-form-component.ts";
|
||||||
|
import uiConfigComponent from "./ui-config-component.ts";
|
||||||
|
import * as overlay from "./overlay.ts";
|
||||||
|
import { parse, stringify } from "../lib/common/expression/parser.ts";
|
||||||
|
import { loadCodeMirror, loadYaml } from "./dynamic-loader.ts";
|
||||||
|
import { getIcon } from "./icons.ts";
|
||||||
|
|
||||||
const attributes = [
|
const attributes = [
|
||||||
{ id: "_id", label: "Key" },
|
{ id: "_id", label: "Key" },
|
||||||
|
|||||||
@@ -1,22 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
export default window.clientConfig;
|
export default window.clientConfig;
|
||||||
export const configSnapshot = window.configSnapshot;
|
export const configSnapshot = window.configSnapshot;
|
||||||
export const genieacsVersion = window.genieacsVersion;
|
export const genieacsVersion = window.genieacsVersion;
|
||||||
@@ -1,22 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
@import "normalize.css";
|
@import "normalize.css";
|
||||||
@import "codemirror/lib/codemirror.css";
|
@import "codemirror/lib/codemirror.css";
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2021 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import m, { ClosureComponent, Component, Vnode } from "mithril";
|
import m, { ClosureComponent, Component, Vnode } from "mithril";
|
||||||
|
|
||||||
const elements: Map<string, Vnode> = new Map();
|
const elements: Map<string, Vnode> = new Map();
|
||||||
|
|||||||
+3
-22
@@ -1,26 +1,7 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ClosureComponent, Component } from "mithril";
|
import { ClosureComponent, Component } from "mithril";
|
||||||
import { m } from "./components";
|
import { m } from "./components.ts";
|
||||||
import config from "./config";
|
import config from "./config.ts";
|
||||||
import * as store from "./store";
|
import * as store from "./store.ts";
|
||||||
|
|
||||||
export function init(
|
export function init(
|
||||||
args: Record<string, unknown>,
|
args: Record<string, unknown>,
|
||||||
|
|||||||
+11
-30
@@ -1,34 +1,15 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ClosureComponent, Component, Children } from "mithril";
|
import { ClosureComponent, Component, Children } from "mithril";
|
||||||
import { m } from "./components";
|
import { m } from "./components.ts";
|
||||||
import config from "./config";
|
import config from "./config.ts";
|
||||||
import indexTableComponent from "./index-table-component";
|
import indexTableComponent from "./index-table-component.ts";
|
||||||
import filterComponent from "./filter-component";
|
import filterComponent from "./filter-component.ts";
|
||||||
import * as store from "./store";
|
import * as store from "./store.ts";
|
||||||
import { queueTask, stageDownload } from "./task-queue";
|
import { queueTask, stageDownload } from "./task-queue.ts";
|
||||||
import * as notifications from "./notifications";
|
import * as notifications from "./notifications.ts";
|
||||||
import { parse, stringify, map } from "../lib/common/expression/parser";
|
import { parse, stringify, map } from "../lib/common/expression/parser.ts";
|
||||||
import { evaluate, extractParams } from "../lib/common/expression/util";
|
import { evaluate, extractParams } from "../lib/common/expression/util.ts";
|
||||||
import memoize from "../lib/common/memoize";
|
import memoize from "../lib/common/memoize.ts";
|
||||||
import * as smartQuery from "./smart-query";
|
import * as smartQuery from "./smart-query.ts";
|
||||||
|
|
||||||
const PAGE_SIZE = config.ui.pageSize || 10;
|
const PAGE_SIZE = config.ui.pageSize || 10;
|
||||||
|
|
||||||
|
|||||||
+4
-23
@@ -1,22 +1,3 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import m, {
|
import m, {
|
||||||
Children,
|
Children,
|
||||||
Child,
|
Child,
|
||||||
@@ -24,9 +5,9 @@ import m, {
|
|||||||
Component,
|
Component,
|
||||||
VnodeDOM,
|
VnodeDOM,
|
||||||
} from "mithril";
|
} from "mithril";
|
||||||
import * as store from "./store";
|
import * as store from "./store.ts";
|
||||||
import * as notifications from "./notifications";
|
import * as notifications from "./notifications.ts";
|
||||||
import { getIcon } from "./icons";
|
import { getIcon } from "./icons.ts";
|
||||||
import {
|
import {
|
||||||
clear,
|
clear,
|
||||||
commit,
|
commit,
|
||||||
@@ -36,7 +17,7 @@ import {
|
|||||||
QueueTask,
|
QueueTask,
|
||||||
queueTask,
|
queueTask,
|
||||||
StageTask,
|
StageTask,
|
||||||
} from "./task-queue";
|
} from "./task-queue.ts";
|
||||||
|
|
||||||
const invalid: WeakSet<StageTask> = new WeakSet();
|
const invalid: WeakSet<StageTask> = new WeakSet();
|
||||||
|
|
||||||
|
|||||||
+1
-20
@@ -1,23 +1,4 @@
|
|||||||
/**
|
import * as notifications from "./notifications.ts";
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import * as notifications from "./notifications";
|
|
||||||
|
|
||||||
export let codeMirror: typeof import("codemirror");
|
export let codeMirror: typeof import("codemirror");
|
||||||
export let yaml: typeof import("yaml");
|
export let yaml: typeof import("yaml");
|
||||||
|
|||||||
+1
-20
@@ -1,24 +1,5 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ClosureComponent, Component } from "mithril";
|
import { ClosureComponent, Component } from "mithril";
|
||||||
import { m } from "./components";
|
import { m } from "./components.ts";
|
||||||
|
|
||||||
export const component: ClosureComponent = (): Component => {
|
export const component: ClosureComponent = (): Component => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
+10
-29
@@ -1,33 +1,14 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ClosureComponent, Component, Children } from "mithril";
|
import { ClosureComponent, Component, Children } from "mithril";
|
||||||
import { m } from "./components";
|
import { m } from "./components.ts";
|
||||||
import config from "./config";
|
import config from "./config.ts";
|
||||||
import indexTableComponent from "./index-table-component";
|
import indexTableComponent from "./index-table-component.ts";
|
||||||
import filterComponent from "./filter-component";
|
import filterComponent from "./filter-component.ts";
|
||||||
import * as store from "./store";
|
import * as store from "./store.ts";
|
||||||
import * as notifications from "./notifications";
|
import * as notifications from "./notifications.ts";
|
||||||
import memoize from "../lib/common/memoize";
|
import memoize from "../lib/common/memoize.ts";
|
||||||
import * as smartQuery from "./smart-query";
|
import * as smartQuery from "./smart-query.ts";
|
||||||
import { map, parse, stringify } from "../lib/common/expression/parser";
|
import { map, parse, stringify } from "../lib/common/expression/parser.ts";
|
||||||
import { stringify as yamlStringify } from "../lib/common/yaml";
|
import { stringify as yamlStringify } from "../lib/common/yaml.ts";
|
||||||
|
|
||||||
const PAGE_SIZE = config.ui.pageSize || 10;
|
const PAGE_SIZE = config.ui.pageSize || 10;
|
||||||
|
|
||||||
|
|||||||
+11
-30
@@ -1,34 +1,15 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { ClosureComponent, Component, Children } from "mithril";
|
import { ClosureComponent, Component, Children } from "mithril";
|
||||||
import { m } from "./components";
|
import { m } from "./components.ts";
|
||||||
import config from "./config";
|
import config from "./config.ts";
|
||||||
import filterComponent from "./filter-component";
|
import filterComponent from "./filter-component.ts";
|
||||||
import * as store from "./store";
|
import * as store from "./store.ts";
|
||||||
import * as notifications from "./notifications";
|
import * as notifications from "./notifications.ts";
|
||||||
import memoize from "../lib/common/memoize";
|
import memoize from "../lib/common/memoize.ts";
|
||||||
import putFormComponent from "./put-form-component";
|
import putFormComponent from "./put-form-component.ts";
|
||||||
import indexTableComponent from "./index-table-component";
|
import indexTableComponent from "./index-table-component.ts";
|
||||||
import * as overlay from "./overlay";
|
import * as overlay from "./overlay.ts";
|
||||||
import * as smartQuery from "./smart-query";
|
import * as smartQuery from "./smart-query.ts";
|
||||||
import { map, parse, stringify } from "../lib/common/expression/parser";
|
import { map, parse, stringify } from "../lib/common/expression/parser.ts";
|
||||||
|
|
||||||
const PAGE_SIZE = config.ui.pageSize || 10;
|
const PAGE_SIZE = config.ui.pageSize || 10;
|
||||||
|
|
||||||
|
|||||||
+6
-25
@@ -1,29 +1,10 @@
|
|||||||
/**
|
|
||||||
* Copyright 2013-2019 GenieACS Inc.
|
|
||||||
*
|
|
||||||
* This file is part of GenieACS.
|
|
||||||
*
|
|
||||||
* GenieACS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* GenieACS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with GenieACS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import m, { ClosureComponent } from "mithril";
|
import m, { ClosureComponent } from "mithril";
|
||||||
import { parse, stringify, map } from "../lib/common/expression/parser";
|
import { parse, stringify, map } from "../lib/common/expression/parser.ts";
|
||||||
import memoize from "../lib/common/memoize";
|
import memoize from "../lib/common/memoize.ts";
|
||||||
import Autocomplete from "./autocomplete-compnent";
|
import Autocomplete from "./autocomplete-compnent.ts";
|
||||||
import * as smartQuery from "./smart-query";
|
import * as smartQuery from "./smart-query.ts";
|
||||||
import { validQuery } from "../lib/db/synth";
|
import { validQuery } from "../lib/db/synth.ts";
|
||||||
import { Expression } from "../lib/types";
|
import { Expression } from "../lib/types.ts";
|
||||||
|
|
||||||
const getAutocomplete = memoize((resource) => {
|
const getAutocomplete = memoize((resource) => {
|
||||||
const labels = smartQuery.getLabels(resource);
|
const labels = smartQuery.getLabels(resource);
|
||||||
|
|||||||
Loaded 100 of 123 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user