mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
AAE-48934 Eslint v9 migration (#12110)
* update * update * update * working * cr * cr * update * use nx boundaries * fixes * fixes * fixes * cr * cr * update * update * update * cr * fix null * cr * cr * cr * cr * cr * update * update * update * update * update * remove some duplications * fix units
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
{
|
||||
"extends": ["../../.eslintrc.js"],
|
||||
"ignorePatterns": ["!**/*", "dist", "node_modules"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"extends": ["plugin:@nx/angular"],
|
||||
"parserOptions": {
|
||||
"project": ["lib/cli/tsconfig.json"],
|
||||
"createDefaultProgram": true
|
||||
},
|
||||
"rules": {
|
||||
"@typescript-eslint/no-var-requires": "off",
|
||||
"@typescript-eslint/naming-convention": "warn",
|
||||
"quote-props": "off",
|
||||
"no-shadow": "warn",
|
||||
"no-restricted-syntax": "off",
|
||||
"no-underscore-dangle": "off",
|
||||
"@typescript-eslint/consistent-type-assertions": "warn",
|
||||
"@typescript-eslint/prefer-for-of": "off",
|
||||
"@typescript-eslint/consistent-type-definitions": "error",
|
||||
"@typescript-eslint/dot-notation": "off",
|
||||
"@typescript-eslint/no-inferrable-types": "off",
|
||||
"@typescript-eslint/no-require-imports": "off",
|
||||
"default-case": "error",
|
||||
"import/order": "off",
|
||||
"max-len": [
|
||||
"error",
|
||||
{
|
||||
"code": 240
|
||||
}
|
||||
],
|
||||
"no-duplicate-imports": "error",
|
||||
"no-multiple-empty-lines": "error",
|
||||
"no-redeclare": "error",
|
||||
"no-return-await": "error",
|
||||
"no-console": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"parserOptions": {
|
||||
"project": ["lib/cli/tsconfig.json"],
|
||||
"createDefaultProgram": true
|
||||
},
|
||||
"extends": ["plugin:@nx/angular-template"],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import rootConfig from '../../eslint.config.mjs';
|
||||
|
||||
export default [
|
||||
...rootConfig,
|
||||
{
|
||||
files: ['**/*.ts'],
|
||||
rules: {
|
||||
'@nx/enforce-module-boundaries': [
|
||||
'error',
|
||||
{
|
||||
enforceBuildableLibDependency: true,
|
||||
allow: [],
|
||||
depConstraints: [
|
||||
{
|
||||
sourceTag: 'scope:cli',
|
||||
onlyDependOnLibsWithTags: ['scope:js-api']
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/no-var-requires': 'off',
|
||||
'quote-props': 'off',
|
||||
'no-shadow': 'warn',
|
||||
'no-restricted-syntax': 'off',
|
||||
'no-underscore-dangle': 'off',
|
||||
'@typescript-eslint/consistent-type-assertions': 'warn',
|
||||
'@typescript-eslint/prefer-for-of': 'off',
|
||||
'no-redeclare': 'error',
|
||||
'no-console': 'off',
|
||||
}
|
||||
}
|
||||
];
|
||||
@@ -4,6 +4,7 @@
|
||||
"sourceRoot": "lib/cli",
|
||||
"projectType": "library",
|
||||
"prefix": "adf",
|
||||
"tags": ["scope:cli", "type:tooling"],
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "nx:run-commands",
|
||||
|
||||
@@ -29,6 +29,14 @@ interface AuditCommandArgs {
|
||||
outDir?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the audit report as a Markdown page.
|
||||
*
|
||||
* @param jsonAudit parsed npm audit JSON output
|
||||
* @param projName project name
|
||||
* @param projVersion project version
|
||||
* @returns rendered Markdown string
|
||||
*/
|
||||
function renderAuditPage(jsonAudit: any, projName: string, projVersion: string): string {
|
||||
const rows: string[] = [];
|
||||
if (jsonAudit.auditReportVersion >= 2) {
|
||||
@@ -122,7 +130,6 @@ Options:
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Running audit on ${packagePath}`);
|
||||
|
||||
const packageJson = JSON.parse(fs.readFileSync(packagePath).toString());
|
||||
@@ -172,7 +179,6 @@ Options:
|
||||
|
||||
fs.writeFileSync(outputFile, mdText);
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Report saved as ${outputFile}`);
|
||||
resolve(0);
|
||||
});
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
import { argv, exit } from 'node:process';
|
||||
import { parseArgs } from 'node:util';
|
||||
import { spawnSync } from 'node:child_process';
|
||||
@@ -146,7 +144,7 @@ function getCommits(options: DiffOptions): Array<Commit> {
|
||||
.map((str: string) => {
|
||||
try {
|
||||
return JSON.parse(str) as Commit;
|
||||
} catch (error) {
|
||||
} catch {
|
||||
logger.error(`Unparsable commit message: ${str}, dropping it... Please apply manual fix.`);
|
||||
return null;
|
||||
}
|
||||
@@ -167,6 +165,15 @@ function commitAuthorAllowed(commit: Commit, authorFilter: string): boolean {
|
||||
return !(filterRegex.test(commit.author) || filterRegex.test(commit.author_email));
|
||||
}
|
||||
|
||||
/**
|
||||
* Render changelog as Markdown.
|
||||
*
|
||||
* @param commits list of commits
|
||||
* @param projName project name
|
||||
* @param projVersion project version
|
||||
* @param repoUrl repository URL
|
||||
* @returns rendered Markdown string
|
||||
*/
|
||||
function renderChangelogMd(commits: Commit[], projName: string, projVersion: string, repoUrl: string): string {
|
||||
const lines = commits.map((c) => `- [${c.hash}](${repoUrl}/commit/${c.hash}) ${escapeHtml(c.subject)}`);
|
||||
return `---
|
||||
@@ -179,6 +186,15 @@ ${lines.join('\n')}
|
||||
`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render changelog as HTML.
|
||||
*
|
||||
* @param commits list of commits
|
||||
* @param projName project name
|
||||
* @param projVersion project version
|
||||
* @param repoUrl repository URL
|
||||
* @returns rendered HTML string
|
||||
*/
|
||||
function renderChangelogHtml(commits: Commit[], projName: string, projVersion: string, repoUrl: string): string {
|
||||
const items = commits
|
||||
.map((c) => ` <li>\n <a href="${repoUrl}/commit/${c.hash}">[${c.hash}]</a> ${escapeHtml(c.subject)}\n </li>`)
|
||||
|
||||
@@ -90,8 +90,9 @@ async function healthCheck(nameService: string) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get deployed application
|
||||
* Get deployed application.
|
||||
*
|
||||
* @returns list of deployed applications
|
||||
*/
|
||||
async function getApplications(): Promise<{ list: { entries: any[] } }> {
|
||||
const url = `${args.host}/deployment-service/v1/applications`;
|
||||
@@ -236,9 +237,10 @@ function getProjectRelease(projectId: string) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Release project
|
||||
* Release project.
|
||||
*
|
||||
* @param projectId project id
|
||||
* @returns release response
|
||||
*/
|
||||
async function releaseProject(projectId: string) {
|
||||
const url = `${args.host}/modeling-service/v1/projects/${projectId}/releases`;
|
||||
@@ -307,9 +309,10 @@ function deleteProject(projectId: string) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Import and release project
|
||||
* Import and release project.
|
||||
*
|
||||
* @param absoluteFilePath path to project file
|
||||
* @returns released project
|
||||
*/
|
||||
async function importAndReleaseProject(absoluteFilePath: string) {
|
||||
const fileContent = fs.createReadStream(absoluteFilePath);
|
||||
@@ -585,9 +588,10 @@ async function deployWithPayload(currentAbsentApp: any, projectRelease: any, env
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if descriptor exists
|
||||
* Check if descriptor exists.
|
||||
*
|
||||
* @param name descriptor name
|
||||
* @returns `true` if descriptor exists
|
||||
*/
|
||||
async function checkDescriptorExist(name: string): Promise<boolean> {
|
||||
logger.info(`Check descriptor ${name} exist in the list `);
|
||||
@@ -606,10 +610,11 @@ async function checkDescriptorExist(name: string): Promise<boolean> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Import and release project
|
||||
* Import and release project.
|
||||
*
|
||||
* @param app application
|
||||
* @param tag tag
|
||||
* @returns released project
|
||||
*/
|
||||
async function importProjectAndRelease(app: any, tag?: string) {
|
||||
const appLocationReplaced = app.file_location(tag);
|
||||
@@ -667,10 +672,11 @@ function findFailingApps(deployedApps: any[]): any[] {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file from the remote
|
||||
* Get file from the remote.
|
||||
*
|
||||
* @param url url to file
|
||||
* @param name name
|
||||
* @returns resolves when the file is downloaded
|
||||
*/
|
||||
async function getFileFromRemote(url: string, name: string): Promise<void> {
|
||||
return fetch(url)
|
||||
|
||||
@@ -119,6 +119,7 @@ async function initializeDefaultFiles() {
|
||||
|
||||
/**
|
||||
* Process a single file: upload if missing, then apply its action (lock/share/favorite).
|
||||
*
|
||||
* @param fileInfo file descriptor from ACS_DEFAULT
|
||||
* @param fileInfo.name file name
|
||||
* @param fileInfo.action action to apply (LOCK, SHARE, FAVORITE)
|
||||
@@ -154,6 +155,7 @@ async function processFile(fileInfo: { name: string; action: string }, parentFol
|
||||
/**
|
||||
* Ensure a folder exists under the given parent. Creates it if missing.
|
||||
* Handles 409 conflict (race condition) by fetching the existing folder.
|
||||
*
|
||||
* @param folderName folder name
|
||||
* @param parentId parent node id
|
||||
* @returns the folder node entry
|
||||
@@ -196,6 +198,7 @@ async function ensureFolder(folderName: string, parentId: string): Promise<NodeE
|
||||
|
||||
/**
|
||||
* Find a node by relative path under a parent. Returns null if not found (404).
|
||||
*
|
||||
* @param parentId parent node id
|
||||
* @param fileName relative path / file name
|
||||
* @returns the node entry or null if not found
|
||||
@@ -214,6 +217,7 @@ async function findNodeByRelativePath(parentId: string, fileName: string): Promi
|
||||
|
||||
/**
|
||||
* Upload a file to the given destination folder.
|
||||
*
|
||||
* @param fileName file name
|
||||
* @param destinationId destination folder node id
|
||||
* @returns the uploaded node entry
|
||||
@@ -238,6 +242,7 @@ async function uploadFile(fileName: string, destinationId: string): Promise<Node
|
||||
|
||||
/**
|
||||
* Ensure a file is locked. Skips if already locked.
|
||||
*
|
||||
* @param nodeId node id
|
||||
* @param fileName file name (for logging)
|
||||
* @param isAlreadyLocked whether the node is already locked
|
||||
@@ -258,6 +263,7 @@ async function ensureLocked(nodeId: string, fileName: string, isAlreadyLocked =
|
||||
|
||||
/**
|
||||
* Ensure a file is shared. Handles 409 (already shared) gracefully.
|
||||
*
|
||||
* @param nodeId node id
|
||||
* @param fileName file name (for logging)
|
||||
*/
|
||||
@@ -277,6 +283,7 @@ async function ensureShared(nodeId: string, fileName: string) {
|
||||
|
||||
/**
|
||||
* Ensure a file is favorite. Handles 409 (already favorite) gracefully.
|
||||
*
|
||||
* @param nodeId node id
|
||||
* @param fileName file name (for logging)
|
||||
*/
|
||||
@@ -302,6 +309,7 @@ async function ensureFavorite(nodeId: string, fileName: string) {
|
||||
|
||||
/**
|
||||
* Extract entry id from a node response. Throws if missing.
|
||||
*
|
||||
* @param nodeEntry node entry response
|
||||
* @param label label for error message
|
||||
* @returns the node id
|
||||
@@ -318,6 +326,7 @@ function getEntryId(nodeEntry: NodeEntry, label: string): string {
|
||||
|
||||
/**
|
||||
* Format an error for logging.
|
||||
*
|
||||
* @param error error object
|
||||
* @returns formatted error string
|
||||
*/
|
||||
@@ -339,6 +348,7 @@ function formatError(error: any): string {
|
||||
|
||||
/**
|
||||
* Retry wrapper for transient failures.
|
||||
*
|
||||
* @param fn async function to execute
|
||||
* @param label label for logging
|
||||
* @param maxAttempts maximum retry attempts
|
||||
@@ -364,6 +374,7 @@ async function withRetry<T>(fn: () => Promise<T>, label: string, maxAttempts = 3
|
||||
|
||||
/**
|
||||
* Async delay.
|
||||
*
|
||||
* @param ms milliseconds to wait
|
||||
* @returns a promise that resolves after the delay
|
||||
*/
|
||||
@@ -373,6 +384,7 @@ function wait(ms: number): Promise<void> {
|
||||
|
||||
/**
|
||||
* Check environment state and authenticate. Retries on transient failures.
|
||||
*
|
||||
* @param opts command options
|
||||
* @param attempt current attempt number
|
||||
*/
|
||||
|
||||
@@ -182,6 +182,7 @@ Options:
|
||||
* If the app is already present, returns true (skip full init).
|
||||
* If hruser can log in but the app is missing, imports, publishes and deploys it.
|
||||
* Returns false only if hruser cannot log in or deployment fails.
|
||||
*
|
||||
* @returns `true` if app is deployed, otherwise `false`
|
||||
*/
|
||||
async function ensureE2eApplicationDeployed(): Promise<boolean> {
|
||||
@@ -236,6 +237,7 @@ async function initializeDefaultApps() {
|
||||
|
||||
/**
|
||||
* Check environment state and authenticate. Retries on transient failures.
|
||||
*
|
||||
* @param opts command options
|
||||
* @param attempt current attempt number
|
||||
*/
|
||||
@@ -277,6 +279,7 @@ async function checkEnv(opts: InitApsEnvArgs, attempt = 1) {
|
||||
|
||||
/**
|
||||
* Check if the default tenant is present
|
||||
*
|
||||
* @param tenantId tenant id
|
||||
* @param tenantName tenant name
|
||||
* @returns `true` if tenant is found, otherwise `false`
|
||||
@@ -304,6 +307,7 @@ async function hasDefaultTenant(tenantId: number, tenantName: string): Promise<b
|
||||
|
||||
/**
|
||||
* Create default tenant
|
||||
*
|
||||
* @param tenantName tenant name
|
||||
* @returns the tenant id or null
|
||||
*/
|
||||
@@ -327,6 +331,7 @@ async function createDefaultTenant(tenantName: string) {
|
||||
|
||||
/**
|
||||
* Create users
|
||||
*
|
||||
* @param tenantId tenant id
|
||||
* @param user user object
|
||||
* @returns the created user
|
||||
@@ -355,6 +360,7 @@ async function createUsers(tenantId: number, user: any) {
|
||||
|
||||
/**
|
||||
* Update Activiti license
|
||||
*
|
||||
* @param opts command options
|
||||
* @returns `true` if license uploaded successfully, otherwise `false`
|
||||
*/
|
||||
@@ -383,6 +389,7 @@ async function updateLicense(opts: InitApsEnvArgs) {
|
||||
|
||||
/**
|
||||
* Check if default application is deployed
|
||||
*
|
||||
* @param appName application name
|
||||
* @returns `true` if application is deployed, otherwise `false`
|
||||
*/
|
||||
@@ -401,6 +408,7 @@ async function isDefaultAppDeployed(appName: string): Promise<boolean> {
|
||||
|
||||
/**
|
||||
* Import and publish the application
|
||||
*
|
||||
* @param appName application name
|
||||
* @returns the app definition result
|
||||
*/
|
||||
@@ -423,6 +431,7 @@ async function importPublishApp(appName: string): Promise<AppDefinitionUpdateRes
|
||||
|
||||
/**
|
||||
* Deploy application
|
||||
*
|
||||
* @param appDefinitionId app definition id
|
||||
*/
|
||||
async function deployApp(appDefinitionId: number) {
|
||||
@@ -442,6 +451,7 @@ async function deployApp(appDefinitionId: number) {
|
||||
|
||||
/**
|
||||
* Checks if Activiti app has license
|
||||
*
|
||||
* @param opts command options
|
||||
* @returns `true` if license is valid, otherwise `false`
|
||||
*/
|
||||
@@ -472,6 +482,7 @@ async function hasLicense(opts: InitApsEnvArgs): Promise<boolean> {
|
||||
|
||||
/**
|
||||
* Get default users from the realm
|
||||
*
|
||||
* @param opts command options
|
||||
* @returns array of default APS users or null
|
||||
*/
|
||||
@@ -500,6 +511,7 @@ async function getDefaultApsUsersFromRealm(opts: InitApsEnvArgs) {
|
||||
|
||||
/**
|
||||
* Validate that ACS repo for Activiti is present
|
||||
*
|
||||
* @param opts command options
|
||||
* @param tenantId tenant id
|
||||
* @param contentName content service name
|
||||
@@ -527,6 +539,7 @@ async function isContentRepoPresent(opts: InitApsEnvArgs, tenantId: number, cont
|
||||
|
||||
/**
|
||||
* Add content service with basic auth
|
||||
*
|
||||
* @param opts command options
|
||||
* @param tenantId tenant id
|
||||
* @param name content name
|
||||
@@ -567,6 +580,7 @@ async function addContentRepoWithBasic(opts: InitApsEnvArgs, tenantId: number, n
|
||||
|
||||
/**
|
||||
* Authorize activiti user to ACS repo
|
||||
*
|
||||
* @param opts command options
|
||||
* @param user user object
|
||||
*/
|
||||
@@ -600,6 +614,7 @@ async function authorizeUserToContentRepo(opts: InitApsEnvArgs, user: any) {
|
||||
|
||||
/**
|
||||
* Authorize user with content using basic auth
|
||||
*
|
||||
* @param opts command options
|
||||
* @param username username
|
||||
* @param contentId content id
|
||||
@@ -629,6 +644,7 @@ async function authorizeUserToContentWithBasic(opts: InitApsEnvArgs, username: s
|
||||
|
||||
/**
|
||||
* Download APS license file
|
||||
*
|
||||
* @param apsLicensePath path to license file
|
||||
* @returns `true` if download succeeded, otherwise `false`
|
||||
*/
|
||||
@@ -649,6 +665,7 @@ async function downloadLicenseFile(apsLicensePath: string) {
|
||||
|
||||
/**
|
||||
* Format an error for logging.
|
||||
*
|
||||
* @param error error object
|
||||
* @returns formatted error string
|
||||
*/
|
||||
@@ -670,6 +687,7 @@ function formatError(error: any): string {
|
||||
|
||||
/**
|
||||
* Async delay.
|
||||
*
|
||||
* @param ms milliseconds to wait
|
||||
* @returns a promise that resolves after the delay
|
||||
*/
|
||||
|
||||
@@ -101,6 +101,12 @@ function getPackageFile(packagePath: string): PackageInfo {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a license expression to linked Markdown.
|
||||
*
|
||||
* @param rawExpression raw SPDX license expression
|
||||
* @returns expression with Markdown links
|
||||
*/
|
||||
function toLinkedLicenseExpression(rawExpression: string): string {
|
||||
return rawExpression.replace(/\*/g, '').replace(/[a-zA-Z0-9\-.]+/g, (match: string) => {
|
||||
const lowerMatch = match.toLowerCase();
|
||||
@@ -112,6 +118,14 @@ function toLinkedLicenseExpression(rawExpression: string): string {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the license page as Markdown.
|
||||
*
|
||||
* @param filteredPackages packages with license metadata
|
||||
* @param projName project name
|
||||
* @param projVersion project version
|
||||
* @returns rendered Markdown string
|
||||
*/
|
||||
function renderLicensePage(filteredPackages: Record<string, PackageInfoWithMetadata>, projName: string, projVersion: string): string {
|
||||
const rows = Object.entries(filteredPackages).map(([packageName, pack]) => {
|
||||
const lastAtSignPos = packageName.lastIndexOf('@');
|
||||
@@ -192,7 +206,6 @@ Options:
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.info(`Checking ${packagePath}`);
|
||||
const licenseScan = collectProductionLicenses(packagePath, {
|
||||
denyList: ['GPL'],
|
||||
@@ -223,7 +236,7 @@ Options:
|
||||
const outputFile = path.join(outputPath, `license-info-${packageJson.version}.md`);
|
||||
|
||||
fs.writeFileSync(outputFile, mdText);
|
||||
// eslint-disable-next-line no-console
|
||||
|
||||
console.log(`Report saved as ${outputFile}`);
|
||||
resolve(0);
|
||||
});
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
import { exit } from 'node:process';
|
||||
|
||||
/* eslint-disable */
|
||||
let log = null;
|
||||
|
||||
log = {
|
||||
@@ -33,4 +32,3 @@ log = {
|
||||
};
|
||||
|
||||
export let logger = log;
|
||||
/* eslint-enable */
|
||||
|
||||
@@ -25,7 +25,12 @@ export class CheckEnv {
|
||||
_alfrescoJsApi: AlfrescoApi;
|
||||
counter = 0;
|
||||
|
||||
constructor(private host: string, private username: string, private password: string, private clientId: string = 'alfresco') {}
|
||||
constructor(
|
||||
private readonly host: string,
|
||||
private readonly username: string,
|
||||
private readonly password: string,
|
||||
private readonly clientId: string = 'alfresco'
|
||||
) {}
|
||||
|
||||
async checkEnv() {
|
||||
try {
|
||||
|
||||
@@ -21,7 +21,10 @@ import { AlfrescoApi } from '@alfresco/js-api';
|
||||
|
||||
export class GovernanceCheckPlugin {
|
||||
governanceHealth: GovernanceHealth;
|
||||
constructor(private pluginInfo: PluginInterface, private alfrescoJsApi: AlfrescoApi) {
|
||||
constructor(
|
||||
private readonly pluginInfo: PluginInterface,
|
||||
private readonly alfrescoJsApi: AlfrescoApi
|
||||
) {
|
||||
this.governanceHealth = new GovernanceHealth(this.pluginInfo, this.alfrescoJsApi);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,14 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
import { logger } from '../logger';
|
||||
import { PluginInterface } from './plugin-model';
|
||||
import { AlfrescoApi, GsSitesApi } from '@alfresco/js-api';
|
||||
|
||||
export class GovernanceHealth {
|
||||
constructor(private pluginInfo: PluginInterface, private alfrescoJsApi: AlfrescoApi) {}
|
||||
constructor(
|
||||
private readonly pluginInfo: PluginInterface,
|
||||
private readonly alfrescoJsApi: AlfrescoApi
|
||||
) {}
|
||||
|
||||
async isRecordManagementAvailable(): Promise<boolean> {
|
||||
try {
|
||||
|
||||
@@ -20,7 +20,10 @@ import { logger } from '../logger';
|
||||
import { AlfrescoApi } from '@alfresco/js-api';
|
||||
|
||||
export class PluginConfiguration {
|
||||
constructor(private plugInInfo: PluginInterface, private alfrescoJsApi: AlfrescoApi) {}
|
||||
constructor(
|
||||
private readonly plugInInfo: PluginInterface,
|
||||
private readonly alfrescoJsApi: AlfrescoApi
|
||||
) {}
|
||||
|
||||
async getAppConfig(url: string) {
|
||||
return this.callCustomApi(url);
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
import { PluginInterface } from './plugin-model';
|
||||
import { logger } from '../logger';
|
||||
import { ProcessAutomationHealth } from './process-automation-health';
|
||||
@@ -26,7 +24,10 @@ import { exit } from 'node:process';
|
||||
export class ProcessAutomationCheckPlugin {
|
||||
processAutomationHealth: ProcessAutomationHealth;
|
||||
|
||||
constructor(private plugInInfo: PluginInterface, private alfrescoJsApi: AlfrescoApi) {
|
||||
constructor(
|
||||
private readonly plugInInfo: PluginInterface,
|
||||
private readonly alfrescoJsApi: AlfrescoApi
|
||||
) {
|
||||
this.processAutomationHealth = new ProcessAutomationHealth(this.plugInInfo, this.alfrescoJsApi);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,10 @@ import { AlfrescoApi } from '@alfresco/js-api';
|
||||
export class ProcessAutomationHealth {
|
||||
config: PluginConfiguration;
|
||||
|
||||
constructor(private plugInInfo: PluginInterface, private alfrescoJsApi: AlfrescoApi) {
|
||||
constructor(
|
||||
private readonly plugInInfo: PluginInterface,
|
||||
private readonly alfrescoJsApi: AlfrescoApi
|
||||
) {
|
||||
this.config = new PluginConfiguration(this.plugInInfo, this.alfrescoJsApi);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
import { exit } from 'node:process';
|
||||
import { PluginInterface } from './plugin-model';
|
||||
import { logger } from '../logger';
|
||||
@@ -26,7 +24,10 @@ import { AlfrescoApi } from '@alfresco/js-api';
|
||||
export class ProcessServiceCheckPlugin {
|
||||
processServiceHealth: ProcessServiceHealth;
|
||||
|
||||
constructor(private plugInInfo: PluginInterface, private alfrescoJsApi: AlfrescoApi) {
|
||||
constructor(
|
||||
private readonly plugInInfo: PluginInterface,
|
||||
private readonly alfrescoJsApi: AlfrescoApi
|
||||
) {
|
||||
this.processServiceHealth = new ProcessServiceHealth(this.plugInInfo, this.alfrescoJsApi);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,10 @@ import { AlfrescoApi, SystemPropertiesApi } from '@alfresco/js-api';
|
||||
export class ProcessServiceHealth {
|
||||
config: PluginConfiguration;
|
||||
|
||||
constructor(private plugInInfo: PluginInterface, private alfrescoJsApi: AlfrescoApi) {
|
||||
constructor(
|
||||
private readonly plugInInfo: PluginInterface,
|
||||
private readonly alfrescoJsApi: AlfrescoApi
|
||||
) {
|
||||
this.config = new PluginConfiguration(this.plugInInfo, this.alfrescoJsApi);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
/* cSpell:disable */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
export const ACTIVITI_CLOUD_APPS: any = {
|
||||
SIMPLE_APP: {
|
||||
|
||||
@@ -15,6 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Escape HTML special characters.
|
||||
*
|
||||
* @param text input string
|
||||
* @returns escaped string
|
||||
*/
|
||||
export function escapeHtml(text: string): string {
|
||||
return text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
||||
}
|
||||
|
||||
@@ -15,9 +15,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const expand = require('dotenv-expand');
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
|
||||
const nodeDotEnv = require('dotenv');
|
||||
|
||||
export const dotenv = () => expand(nodeDotEnv);
|
||||
|
||||
Reference in New Issue
Block a user