Skip to content

Commit

Permalink
[ACS-6071] fix jsdoc warnings and errors (#8948)
Browse files Browse the repository at this point in the history
* fix content docs

* fix extensions docs

* fix insights docs

* [ci:force] fix jsdoc errors and warnings

* enable jsdoc linter

* [ci:force] fix demo shell jsdoc

* [ci:force] fix e2e typings

* fix typo

* fix typo
  • Loading branch information
DenysVuika authored Sep 29, 2023
1 parent 501516c commit d72eb5e
Show file tree
Hide file tree
Showing 86 changed files with 1,233 additions and 254 deletions.
6 changes: 4 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ module.exports = {
'plugin:@cspell/recommended',
'plugin:@angular-eslint/ng-cli-compat',
'plugin:@angular-eslint/ng-cli-compat--formatting-add-on',
'plugin:@angular-eslint/template/process-inline-templates'
'plugin:@angular-eslint/template/process-inline-templates',
'plugin:jsdoc/recommended-typescript-error'
],
plugins: [
'eslint-plugin-unicorn',
Expand All @@ -35,7 +36,8 @@ module.exports = {
'@cspell',
'eslint-plugin-import',
'@angular-eslint/eslint-plugin',
'@typescript-eslint'
'@typescript-eslint',
'jsdoc'
],
rules: {
// Uncomment this to enable prettier checks as part of the ESLint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ import { PreviewService } from '../../services/preview.service';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

/**
* Provide a factory for process upload service
*
* @param api api client
* @param config config service
* @param discoveryApiService discovery service
* @returns factory function
*/
export function processUploadServiceFactory(api: AlfrescoApiService, config: AppConfigService, discoveryApiService: DiscoveryApiService) {
return new ProcessUploadService(api, config, discoveryApiService);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ import { PreviewService } from '../../services/preview.service';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';

/**
* Provide a task upload service factory
*
* @param api api client
* @param config config service
* @param discoveryApiService discovery service
* @returns factory function
*/
export function taskUploadServiceFactory(api: AlfrescoApiService, config: AppConfigService, discoveryApiService: DiscoveryApiService) {
return new TaskUploadService(api, config, discoveryApiService);
}
Expand Down
18 changes: 18 additions & 0 deletions lib/cli/scripts/artifact-from-s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,41 @@ import { exec } from './exec';
import { logger } from './logger';
import program from 'commander';

/**
* Perform a test
*
* @param output output path
*/
function test(output: string) {
const response = exec('test !', [`-d ${output} && mkdir ${output}`], {});
logger.info(response);
}

/**
* Copy AWS S3
*
* @param artifact artifact name
*/
function awsCp(artifact: string) {
logger.info(`aws s3 cp ${artifact}`);
const response = exec(`aws s3 cp ${artifact}`, [`./s3-artifact.tmp ${artifact}`], {});
logger.info(response);
}

/**
* Zip artifact
*
* @param output output name
*/
function zipArtifact(output: string) {
logger.info(`Perform zip artifact ${output}`);
const response = exec('tar', ['-xvf', `./s3-artifact.tmp`, '-C ' + program.output], {});
logger.info(response);
}

/**
* Artifact from S3 command
*/
export default function main() {
program
.version('0.1.0')
Expand Down
13 changes: 13 additions & 0 deletions lib/cli/scripts/artifact-to-s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,33 @@ import { exec } from './exec';
import { logger } from './logger';
import program from 'commander';

/**
* Zip artifact
*
* @param artifact artifact name
*/
function zipArtifact(artifact: string) {
logger.info(`Perform zip artifact ${artifact}`);

const response = exec(`tar cvfj ./s3-artifact.tmp -C ${program.artifact} ls ${program.artifact}`, [], {});
logger.info(response);
}

/**
* Copy to AWS S3
*
* @param output output path
*/
function awsCp(output: string) {
logger.info(`aws s3 cp ${output}`);
const response = exec('aws s3 cp', [`./s3-artifact.tmp ${output}`], {});
logger.info(response);
}


/**
* Artifact to S3 command
*/
export default function main() {
program
.version('0.1.0')
Expand Down
7 changes: 7 additions & 0 deletions lib/cli/scripts/audit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ import * as fs from 'fs';
import { argv, exit } from 'node:process';
import program from 'commander';

/**
* Audit report command
*
* @param _args (unused)
* @param workingDir working directory
* @returns void
*/
export default function main(_args: string[], workingDir: string) {
program
.description('Generate an audit report')
Expand Down
14 changes: 14 additions & 0 deletions lib/cli/scripts/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,25 @@ function getCommits(options: DiffOptions): Array<Commit> {
.filter((commit: Commit) => commitAuthorAllowed(commit, authorFilter));
}

/**
* Check if commit author is allowed
*
* @param commit git commit
* @param authorFilter filter
* @returns `true` if author is allowed, otherwise `false`
*/
function commitAuthorAllowed(commit: Commit, authorFilter: string): boolean {
const filterRegex = RegExp(authorFilter);
return !(filterRegex.test(commit.author) || filterRegex.test(commit.author_email));
}

/**
* Changelog command
*
* @param _args (unused)
* @param workingDir working directory
* @returns void
*/
export default function main(_args: string[], workingDir: string) {
program
.description('Generate changelog report for two branches of git repository')
Expand Down
11 changes: 11 additions & 0 deletions lib/cli/scripts/check-cs-env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const TIMEOUT = 20000;
let counter = 0;
let alfrescoJsApi: AlfrescoApi;

/**
* Check CS environment command
*/
export default async function main() {
program
.version('0.1.0')
Expand All @@ -42,6 +45,9 @@ export default async function main() {
// await checkDiskSpaceFullEnv();
}

/**
* Check environment
*/
async function checkEnv() {
try {
alfrescoJsApi = new AlfrescoApi({
Expand Down Expand Up @@ -111,6 +117,11 @@ async function checkDiskSpaceFullEnv() {
}
*/

/**
* Perform a delay
*
* @param delay timeout in milliseconds
*/
function sleep(delay: number) {
const start = new Date().getTime();
while (new Date().getTime() < start + delay) {}
Expand Down
14 changes: 13 additions & 1 deletion lib/cli/scripts/check-plugin-env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ import { GovernanceCheckPlugin } from './plugins/governance-check-plugin';

let pluginEnv: CheckEnv;

export default async function main(_args: string[]) {
/**
* Check environment plugin
*/
export default async function main() {
program
.version('0.1.0')
.option('--host [type]', 'Remote environment host')
Expand Down Expand Up @@ -53,6 +56,9 @@ export default async function main(_args: string[]) {
}
}

/**
* Check PS plugin
*/
async function checkProcessServicesPlugin() {
const processServiceCheckPlugin = new ProcessServiceCheckPlugin(
{
Expand All @@ -64,6 +70,9 @@ async function checkProcessServicesPlugin() {
await processServiceCheckPlugin.checkProcessServicesPlugin();
}

/**
* Check APA plugin
*/
async function checkProcessAutomationPlugin() {
const processAutomationCheckPlugin = new ProcessAutomationCheckPlugin(
{
Expand All @@ -77,6 +86,9 @@ async function checkProcessAutomationPlugin() {
await processAutomationCheckPlugin.checkProcessAutomationPlugin();
}

/**
* Check AGS plugin
*/
async function checkGovernancePlugin() {
const governancePluginCheck = new GovernanceCheckPlugin(
{
Expand Down
11 changes: 11 additions & 0 deletions lib/cli/scripts/check-ps-env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ const MAX_RETRY = 10;
const TIMEOUT = 60000;
let counter = 0;

/**
* Check PS environment command
*/
export default async function main() {
program
.version('0.1.0')
Expand All @@ -36,6 +39,9 @@ export default async function main() {
await checkEnv();
}

/**
* Check environment
*/
async function checkEnv() {
try {
const alfrescoJsApi = new AlfrescoApi({
Expand Down Expand Up @@ -63,6 +69,11 @@ async function checkEnv() {
}
}

/**
* Perform a delay
*
* @param delay timeout in milliseconds
*/
function sleep(delay: number) {
const start = new Date().getTime();
while (new Date().getTime() < start + delay) {}
Expand Down
5 changes: 5 additions & 0 deletions lib/cli/scripts/docker-publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@

import * as docker from './docker';

/**
* Docker publish command
*
* @param args command arguments
*/
export default function(args: any) {
docker.default(args);
}
Loading

0 comments on commit d72eb5e

Please sign in to comment.