From cc31fdd0417bc5e602c25efa1d5666d86b6da45a Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Fri, 12 Nov 2021 19:37:28 -0300 Subject: [PATCH] FIXXXXXX --- definition/rest/v1/licenses.ts | 2 +- ee/app/license/definitions/ILicense.ts | 11 +++++++ ee/app/license/definitions/ILicenseTag.ts | 4 +++ ee/app/license/server/license.ts | 17 ++-------- ee/server/services/package-lock.json | 39 +++++++++++++++++++++++ ee/server/services/package.json | 1 + 6 files changed, 58 insertions(+), 16 deletions(-) create mode 100644 ee/app/license/definitions/ILicense.ts create mode 100644 ee/app/license/definitions/ILicenseTag.ts diff --git a/definition/rest/v1/licenses.ts b/definition/rest/v1/licenses.ts index 55f8cefc6b99c..cc4b0dba981d3 100644 --- a/definition/rest/v1/licenses.ts +++ b/definition/rest/v1/licenses.ts @@ -1,4 +1,4 @@ -import type { ILicense } from '../../../ee/app/license/server/license'; +import type { ILicense } from '../../../ee/app/license/definitions/ILicense'; export type LicensesEndpoints = { 'licenses.get': { diff --git a/ee/app/license/definitions/ILicense.ts b/ee/app/license/definitions/ILicense.ts new file mode 100644 index 0000000000000..014912bef1add --- /dev/null +++ b/ee/app/license/definitions/ILicense.ts @@ -0,0 +1,11 @@ +import { ILicenseTag } from './ILicenseTag'; + +export interface ILicense { + url: string; + expiry: string; + maxActiveUsers: number; + modules: string[]; + maxGuestUsers: number; + maxRoomsPerGuest: number; + tag?: ILicenseTag; +} diff --git a/ee/app/license/definitions/ILicenseTag.ts b/ee/app/license/definitions/ILicenseTag.ts new file mode 100644 index 0000000000000..2f11fdebd5db5 --- /dev/null +++ b/ee/app/license/definitions/ILicenseTag.ts @@ -0,0 +1,4 @@ +export interface ILicenseTag { + name: string; + color: string; +} diff --git a/ee/app/license/server/license.ts b/ee/app/license/server/license.ts index ad0b962759f95..dd666753f6218 100644 --- a/ee/app/license/server/license.ts +++ b/ee/app/license/server/license.ts @@ -4,24 +4,11 @@ import { Users } from '../../../../app/models/server'; import { getBundleModules, isBundle, getBundleFromModule } from './bundles'; import decrypt from './decrypt'; import { getTagColor } from './getTagColor'; +import { ILicense } from '../definitions/ILicense'; +import { ILicenseTag } from '../definitions/ILicenseTag'; const EnterpriseLicenses = new EventEmitter(); -interface ILicenseTag { - name: string; - color: string; -} - -export interface ILicense { - url: string; - expiry: string; - maxActiveUsers: number; - modules: string[]; - maxGuestUsers: number; - maxRoomsPerGuest: number; - tag?: ILicenseTag; -} - export interface IValidLicense { valid?: boolean; license: ILicense; diff --git a/ee/server/services/package-lock.json b/ee/server/services/package-lock.json index 3b1cfe814ecef..110aa6323e6ef 100644 --- a/ee/server/services/package-lock.json +++ b/ee/server/services/package-lock.json @@ -419,6 +419,17 @@ "debug": "4" } }, + "ajv": { + "version": "8.7.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.7.1.tgz", + "integrity": "sha512-gPpOObTO1QjbnN1sVMjJcp1TF9nggMfO4MBR5uQl6ZVTOaEPq5i4oq/6R9q2alMMPB3eg53wFv1RuJBLuxf3Hw==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, "amp": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/amp/-/amp-0.3.1.tgz", @@ -1225,6 +1236,11 @@ } } }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, "fast-json-patch": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-3.1.0.tgz", @@ -1676,6 +1692,11 @@ "pako": "^0.2.5" } }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -2490,6 +2511,11 @@ "once": "^1.3.1" } }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, "qs": { "version": "6.7.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", @@ -2564,6 +2590,11 @@ "ttl": "^1.3.0" } }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + }, "require-in-the-middle": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-5.1.0.tgz", @@ -3070,6 +3101,14 @@ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/ee/server/services/package.json b/ee/server/services/package.json index 5000e768d23cc..984e7ce794bff 100644 --- a/ee/server/services/package.json +++ b/ee/server/services/package.json @@ -19,6 +19,7 @@ "license": "MIT", "dependencies": { "@rocket.chat/string-helpers": "^0.29.0", + "ajv": "^8.7.1", "bcrypt": "^5.0.1", "body-parser": "^1.19.0", "colorette": "^1.3.0",