mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-16 18:13:06 +00:00
Compare commits
86
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d67ff00f67 | ||
|
|
268067b63b | ||
|
|
a51af0866e | ||
|
|
00d0ffc945 | ||
|
|
96e109d6f3 | ||
|
|
3280107fe0 | ||
|
|
d62f241098 | ||
|
|
4592a8ae21 | ||
|
|
99c574bad6 | ||
|
|
f435b63e42 | ||
|
|
1ab385a3c9 | ||
|
|
33cf47342d | ||
|
|
4cbe97c12c | ||
|
|
e717189430 | ||
|
|
e4e5d4a908 | ||
|
|
9e5c3d71d0 | ||
|
|
4a5154b0c8 | ||
|
|
57b7a79bc2 | ||
|
|
c46496f2fc | ||
|
|
12ae30ce06 | ||
|
|
72522c0f72 | ||
|
|
3d01611249 | ||
|
|
b06098c500 | ||
|
|
2579d58d25 | ||
|
|
9a7e037522 | ||
|
|
83f8b3cff5 | ||
|
|
3f232e75bc | ||
|
|
4123a89814 | ||
|
|
8ebbfa819e | ||
|
|
9587995ac3 | ||
|
|
0c099eafb0 | ||
|
|
4f32198afd | ||
|
|
f0c60b422d | ||
|
|
b8df098e35 | ||
|
|
c0ab354698 | ||
|
|
c9473d93c0 | ||
|
|
6c8b874704 | ||
|
|
c316c6b594 | ||
|
|
c941c81984 | ||
|
|
b234ca6c42 | ||
|
|
b6ae479cd0 | ||
|
|
03e6320bd2 | ||
|
|
e1f463aa8a | ||
|
|
ac3b21454f | ||
|
|
9a49e4ff5c | ||
|
|
565af341dd | ||
|
|
ba814fd6ec | ||
|
|
3f2c767d43 | ||
|
|
a1ee4e0d48 | ||
|
|
40a0a67583 | ||
|
|
85ec35cdf9 | ||
|
|
9f21d602fc | ||
|
|
2827d44768 | ||
|
|
1b905fe312 | ||
|
|
1f7722ca89 | ||
|
|
62dff48260 | ||
|
|
660b14a780 | ||
|
|
9d5f6e692c | ||
|
|
3496363b8e | ||
|
|
d25038dc59 | ||
|
|
c348ea32c0 | ||
|
|
0505b1d5c3 | ||
|
|
0a19be090e | ||
|
|
b69c3ae1ae | ||
|
|
ce907417b7 | ||
|
|
4c7765e3fa | ||
|
|
407a64996e | ||
|
|
c0a102f87f | ||
|
|
066ef30516 | ||
|
|
01cea60490 | ||
|
|
f438c6ce69 | ||
|
|
09ef05038c | ||
|
|
c7bd56f244 | ||
|
|
b86e41515e | ||
|
|
0b35118dee | ||
|
|
fe2b3d85dd | ||
|
|
b0dc85422c | ||
|
|
23f0392c12 | ||
|
|
997303e6a7 | ||
|
|
45d1818f04 | ||
|
|
2f50af623d | ||
|
|
9c56712328 | ||
|
|
448e667c52 | ||
|
|
18e602aa85 | ||
|
|
53ef0cfc00 | ||
|
|
4cd8648a05 |
@@ -1,14 +0,0 @@
|
||||
.angular
|
||||
nxcache
|
||||
node_modules
|
||||
dist
|
||||
coverage
|
||||
.github
|
||||
.vscode
|
||||
scripts
|
||||
/angular.json
|
||||
docs/**/*.md
|
||||
lib/js-api/docs/**/*.md
|
||||
.storybook
|
||||
webpack.config.js
|
||||
lib/core/src/lib/icon
|
||||
-248
@@ -1,248 +0,0 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
|
||||
ignorePatterns: ['projects/**/*', '**/node_modules/**/*', 'lib/cli/node_modules/**/*', '**/node_modules', '**/assets', '**/scripts', '**/docs'],
|
||||
|
||||
plugins: ['@nx'],
|
||||
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.ts'],
|
||||
parserOptions: {
|
||||
project: ['tsconfig.json'],
|
||||
createDefaultProgram: true
|
||||
},
|
||||
extends: [
|
||||
'plugin:@nx/typescript',
|
||||
'plugin:@nx/angular',
|
||||
'plugin:@cspell/recommended',
|
||||
'plugin:@angular-eslint/recommended',
|
||||
'plugin:@angular-eslint/template/process-inline-templates',
|
||||
'plugin:jsdoc/recommended-typescript-error'
|
||||
// Uncomment this once all linting issues are fixed
|
||||
// Note to developers:
|
||||
// you can uncomment the full ruleset locally when fixing issues, and then comment
|
||||
// that will allow splitting the work into smaller chunks
|
||||
// 'plugin:unicorn/recommended'
|
||||
],
|
||||
plugins: [
|
||||
'eslint-plugin-unicorn',
|
||||
'eslint-plugin-rxjs',
|
||||
'prettier',
|
||||
'ban',
|
||||
'license-header',
|
||||
'@cspell',
|
||||
'eslint-plugin-import',
|
||||
'@angular-eslint/eslint-plugin',
|
||||
'@typescript-eslint',
|
||||
'jsdoc'
|
||||
],
|
||||
rules: {
|
||||
// Uncomment this to enable prettier checks as part of the ESLint
|
||||
// 'prettier/prettier': 'error',
|
||||
'ban/ban': [
|
||||
'error',
|
||||
{ name: 'eval', message: 'Calls to eval is not allowed.' },
|
||||
{ name: 'fdescribe', message: 'Calls to fdescribe is not allowed' },
|
||||
{ name: 'fit', message: 'Calls to fit is not allowed' },
|
||||
{ name: 'xit', message: 'Calls to xit is not allowed' },
|
||||
{ name: 'xdescribe', message: 'Calls to xdescribe is not allowed' },
|
||||
{ name: ['test', 'only'], message: 'Calls to test.only is not allowed' },
|
||||
{ name: ['describe', 'only'], message: 'Calls to describe.only is not allowed' }
|
||||
],
|
||||
'@angular-eslint/component-selector': [
|
||||
'error',
|
||||
{
|
||||
type: 'element',
|
||||
prefix: ['adf', 'app'],
|
||||
style: 'kebab-case'
|
||||
}
|
||||
],
|
||||
'@angular-eslint/directive-selector': [
|
||||
'error',
|
||||
{
|
||||
type: ['element', 'attribute'],
|
||||
prefix: ['adf', 'app'],
|
||||
style: 'kebab-case'
|
||||
}
|
||||
],
|
||||
'@angular-eslint/no-host-metadata-property': 'off',
|
||||
'@angular-eslint/no-input-prefix': 'error',
|
||||
'@angular-eslint/prefer-inject': 'error',
|
||||
'@typescript-eslint/consistent-type-definitions': 'error',
|
||||
'@typescript-eslint/dot-notation': 'off',
|
||||
'@typescript-eslint/explicit-member-accessibility': [
|
||||
'off',
|
||||
{
|
||||
accessibility: 'explicit'
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/await-thenable': 'error',
|
||||
'@typescript-eslint/prefer-optional-chain': 'warn',
|
||||
'@typescript-eslint/prefer-readonly': 'error',
|
||||
'@typescript-eslint/no-inferrable-types': 'off',
|
||||
'@typescript-eslint/no-require-imports': 'off',
|
||||
'@typescript-eslint/no-var-requires': 'error',
|
||||
'@typescript-eslint/naming-convention': [
|
||||
'error',
|
||||
{
|
||||
selector: [
|
||||
'classProperty',
|
||||
'objectLiteralProperty',
|
||||
'typeProperty',
|
||||
'classMethod',
|
||||
'objectLiteralMethod',
|
||||
'typeMethod',
|
||||
'accessor',
|
||||
'enumMember'
|
||||
],
|
||||
format: null,
|
||||
modifiers: ['requiresQuotes']
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/member-ordering': 'off',
|
||||
'@typescript-eslint/no-empty-function': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'prefer-promise-reject-errors': 'error',
|
||||
'brace-style': 'off',
|
||||
'comma-dangle': 'error',
|
||||
'default-case': 'error',
|
||||
'import/order': 'off',
|
||||
'max-len': [
|
||||
'error',
|
||||
{
|
||||
code: 240
|
||||
}
|
||||
],
|
||||
'no-bitwise': 'off',
|
||||
'no-console': [
|
||||
'error',
|
||||
{
|
||||
allow: [
|
||||
'warn',
|
||||
'dir',
|
||||
'timeLog',
|
||||
'assert',
|
||||
'clear',
|
||||
'count',
|
||||
'countReset',
|
||||
'group',
|
||||
'groupEnd',
|
||||
'table',
|
||||
'dirxml',
|
||||
'error',
|
||||
'groupCollapsed',
|
||||
'Console',
|
||||
'profile',
|
||||
'profileEnd',
|
||||
'timeStamp',
|
||||
'context'
|
||||
]
|
||||
}
|
||||
],
|
||||
'no-duplicate-imports': 'error',
|
||||
'no-multiple-empty-lines': 'error',
|
||||
'no-redeclare': 'off',
|
||||
'@typescript-eslint/no-redeclare': ['off', { ignoreDeclarationMerge: true }],
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{
|
||||
argsIgnorePattern: '^_',
|
||||
varsIgnorePattern: '^_',
|
||||
caughtErrorsIgnorePattern: '^_'
|
||||
}
|
||||
],
|
||||
'no-return-await': 'error',
|
||||
'rxjs/no-create': 'error',
|
||||
'rxjs/no-subject-unsubscribe': 'error',
|
||||
'rxjs/no-subject-value': 'error',
|
||||
'rxjs/no-unsafe-takeuntil': 'error',
|
||||
'unicorn/filename-case': 'error',
|
||||
'unicorn/prefer-optional-catch-binding': 'error',
|
||||
'@typescript-eslint/no-unused-expressions': [
|
||||
'error',
|
||||
{
|
||||
allowShortCircuit: true,
|
||||
allowTernary: true
|
||||
}
|
||||
],
|
||||
'license-header/header': [
|
||||
'error',
|
||||
[
|
||||
'/*!',
|
||||
' * @license',
|
||||
' * Copyright © 2005-2025 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.',
|
||||
' */'
|
||||
]
|
||||
],
|
||||
'no-restricted-syntax': [
|
||||
'error',
|
||||
{
|
||||
selector: "Identifier[name='CUSTOM_ELEMENTS_SCHEMA']",
|
||||
message: 'The use of CUSTOM_ELEMENTS_SCHEMA is not allowed. Consider alternatives for proper schema handling.'
|
||||
},
|
||||
{
|
||||
selector: "Identifier[name='NO_ERRORS_SCHEMA']",
|
||||
message: 'The use of NO_ERRORS_SCHEMA is not allowed. Consider alternatives for proper schema handling.'
|
||||
},
|
||||
{
|
||||
selector: 'TSEnumDeclaration',
|
||||
message: 'Enums are not allowed. Use string literal types (e.g., type Foo = "a" | "b") or const objects instead.'
|
||||
},
|
||||
{
|
||||
selector: ':matches(Literal[value=/ng-reflect-/], TemplateElement[value.cooked=/ng-reflect-/])',
|
||||
message: '*ng-reflect-* attributes should not be used. Consider alternatives for proper selectors.'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['*.html'],
|
||||
extends: ['plugin:@angular-eslint/template/recommended', 'plugin:@angular-eslint/template/accessibility'],
|
||||
parser: '@angular-eslint/template-parser',
|
||||
rules: {
|
||||
'@angular-eslint/template/prefer-self-closing-tags': 'error'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['*.spec.ts'],
|
||||
plugins: ['@alfresco/eslint-angular'],
|
||||
rules: {
|
||||
'@alfresco/eslint-angular/no-angular-material-selectors': 'error',
|
||||
'@angular-eslint/component-class-suffix': 'off'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['*.ts'],
|
||||
extends: ['plugin:@angular-eslint/template/process-inline-templates'],
|
||||
excludedFiles: ['*.spec.ts']
|
||||
},
|
||||
{
|
||||
files: ['*.json'],
|
||||
parser: 'jsonc-eslint-parser',
|
||||
rules: {
|
||||
'comma-dangle': ['error', 'never']
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/*.stories.ts'],
|
||||
rules: {
|
||||
'@cspell/spellchecker': 'off'
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
extends: ['plugin:storybook/recommended']
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"extends": ["./.eslintrc.js"]
|
||||
}
|
||||
@@ -12,9 +12,14 @@ runs:
|
||||
- name: base vars
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -n "${GITHUB_BASE_REF:-}" ]; then
|
||||
BASE_HASH=$(git merge-base "origin/${GITHUB_BASE_REF}" HEAD 2>/dev/null || git rev-parse HEAD)
|
||||
else
|
||||
BASE_HASH=$(git rev-parse HEAD)
|
||||
fi
|
||||
{
|
||||
echo "GIT_HASH=$(git rev-parse HEAD)";
|
||||
echo "BASE_HASH=$(git merge-base origin/${GITHUB_BASE_REF} HEAD)";
|
||||
echo "BASE_HASH=${BASE_HASH}";
|
||||
echo "HEAD_HASH=HEAD";
|
||||
echo "HEAD_COMMIT_HASH=${GH_COMMIT}";
|
||||
echo "NX_CALCULATION_FLAGS=--all";
|
||||
@@ -55,7 +60,7 @@ runs:
|
||||
} >> $GITHUB_ENV
|
||||
|
||||
- name: RELEASE on master/develop patch branch
|
||||
if: ${{ env.BREAK_ACTION == false && github.event.pull_request.merged }}
|
||||
if: ${{ env.BREAK_ACTION == false && (github.event.pull_request.merged || github.event_name == 'push') }}
|
||||
shell: bash
|
||||
env:
|
||||
REF_NAME: ${{ github.ref_name }}
|
||||
|
||||
@@ -23,8 +23,8 @@ runs:
|
||||
env:
|
||||
DRY_RUN_FLAG: ${{ inputs.dry-run-flag }}
|
||||
run: |
|
||||
if [[ '$DRY_RUN_FLAG' == 'true' ]]; then
|
||||
echo "dryrun=--dryrun" >> $GITHUB_OUTPUT;
|
||||
if [[ "$DRY_RUN_FLAG" == 'true' ]]; then
|
||||
echo "dryrun=--dry-run" >> $GITHUB_OUTPUT;
|
||||
echo "enabling dryrun"
|
||||
else
|
||||
echo "dryrun=" >> $GITHUB_OUTPUT;
|
||||
|
||||
@@ -28,14 +28,14 @@ runs:
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'pnpm'
|
||||
- name: get latest tag sha
|
||||
if: ${{ inputs.full-setup == 'true' }}
|
||||
id: tag-sha
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/git-latest-tag@10cea6c0b390c4f8af21d9dc1670d581bd10319f # v18.13.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/git-latest-tag@44f603af32dc79129056a9e4246ab62f35987a2b # v18.21.1
|
||||
- name: load "NPM TAG"
|
||||
if: ${{ inputs.full-setup == 'true' }}
|
||||
id: set-npm-tag
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"entries": {
|
||||
"github/gh-aw-actions/setup@v0.85.4": {
|
||||
"repo": "github/gh-aw-actions/setup",
|
||||
"version": "v0.85.4",
|
||||
"sha": "2709137ea6c5b0e19aa621454dc643ea8dc526b1"
|
||||
}
|
||||
},
|
||||
"containers": {
|
||||
"ghcr.io/github/gh-aw-firewall/agent:0.27.44": {
|
||||
"image": "ghcr.io/github/gh-aw-firewall/agent:0.27.44",
|
||||
"digest": "sha256:0d727725c737b58c7bdf51f640cffb928385ec46517e0917c7f1a02f1bada8b4",
|
||||
"pinned_image": "ghcr.io/github/gh-aw-firewall/agent:0.27.44@sha256:0d727725c737b58c7bdf51f640cffb928385ec46517e0917c7f1a02f1bada8b4"
|
||||
},
|
||||
"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.44": {
|
||||
"image": "ghcr.io/github/gh-aw-firewall/api-proxy:0.27.44",
|
||||
"digest": "sha256:b50fbadba138f6e9aba94aca09711335c489bb3b15861220cb66f6092e042dc7",
|
||||
"pinned_image": "ghcr.io/github/gh-aw-firewall/api-proxy:0.27.44@sha256:b50fbadba138f6e9aba94aca09711335c489bb3b15861220cb66f6092e042dc7"
|
||||
},
|
||||
"ghcr.io/github/gh-aw-firewall/squid:0.27.44": {
|
||||
"image": "ghcr.io/github/gh-aw-firewall/squid:0.27.44",
|
||||
"digest": "sha256:83e48bbe12c634be8c228a576832fe45f66c529ac3659db92bddbcf2eeb6d627",
|
||||
"pinned_image": "ghcr.io/github/gh-aw-firewall/squid:0.27.44@sha256:83e48bbe12c634be8c228a576832fe45f66c529ac3659db92bddbcf2eeb6d627"
|
||||
},
|
||||
"ghcr.io/github/gh-aw-mcpg:v0.4.8": {
|
||||
"image": "ghcr.io/github/gh-aw-mcpg:v0.4.8",
|
||||
"digest": "sha256:38bbea36cdb46a3c9d04d1db05e672966f5239b431a2022eb35881688e5721d8",
|
||||
"pinned_image": "ghcr.io/github/gh-aw-mcpg:v0.4.8@sha256:38bbea36cdb46a3c9d04d1db05e672966f5239b431a2022eb35881688e5721d8"
|
||||
},
|
||||
"ghcr.io/github/gh-aw-node": {
|
||||
"image": "ghcr.io/github/gh-aw-node",
|
||||
"digest": "sha256:0d9f1fb5fd6610c0ac1f5194a38e45a8a1e81f8a390d5142d8e4e6f26a4b3196",
|
||||
"pinned_image": "ghcr.io/github/gh-aw-node@sha256:0d9f1fb5fd6610c0ac1f5194a38e45a8a1e81f8a390d5142d8e4e6f26a4b3196"
|
||||
},
|
||||
"ghcr.io/github/github-mcp-server:v1.8.0": {
|
||||
"image": "ghcr.io/github/github-mcp-server:v1.8.0",
|
||||
"digest": "sha256:d5a18c04b92714c309eb46a2305087e91a4dbd80420f6e462656699f95093520",
|
||||
"pinned_image": "ghcr.io/github/github-mcp-server:v1.8.0@sha256:d5a18c04b92714c309eb46a2305087e91a4dbd80420f6e462656699f95093520"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup environment
|
||||
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v3.29.5
|
||||
uses: github/codeql-action/init@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v3.29.5
|
||||
# Override language selection by uncommenting this and choosing your languages
|
||||
with:
|
||||
languages: javascript
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v3.29.5
|
||||
uses: github/codeql-action/autobuild@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v3.29.5
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
@@ -53,4 +53,4 @@ jobs:
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v3.29.5
|
||||
uses: github/codeql-action/analyze@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v3.29.5
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
name: "Sends notification when A/N BDU label is attached to PR"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [labeled]
|
||||
branches: [develop]
|
||||
|
||||
permissions:
|
||||
pull-requests: read
|
||||
issues: read # timeline API is served via the issues endpoint
|
||||
|
||||
jobs:
|
||||
notify-bdu:
|
||||
name: Notify Teams when A/N BDU label is added
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
if: >-
|
||||
github.event.label.name == 'A/N BDU' &&
|
||||
github.event.pull_request.state == 'open'
|
||||
steps:
|
||||
- name: Was the label added after PR creation?
|
||||
id: check
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const prCreatedAt = new Date(context.payload.pull_request.created_at).getTime();
|
||||
const events = await github.paginate(github.rest.issues.listEventsForTimeline, {
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.payload.pull_request.number,
|
||||
per_page: 100
|
||||
});
|
||||
const labeled = events.filter(e => e.event === 'labeled' && e.label?.name === 'A/N BDU');
|
||||
if (labeled.length === 0) {
|
||||
core.setOutput('notify', 'false');
|
||||
return;
|
||||
}
|
||||
const labeledAt = new Date(labeled[labeled.length - 1].created_at).getTime();
|
||||
// labels applied within 30s of opening are treated as "added at creation"
|
||||
core.setOutput('notify', (labeledAt - prCreatedAt) > 30000 ? 'true' : 'false');
|
||||
|
||||
- name: Send Teams notification
|
||||
if: steps.check.outputs.notify == 'true'
|
||||
uses: Alfresco/alfresco-build-tools/.github/actions/send-teams-notification@1d671f8f10336861c89c67be57c6648d98876103 # v18.19.0
|
||||
with:
|
||||
webhook-url: ${{ secrets.TEAMS_NOTIFICATION_ADF_BDU_WEBHOOK }}
|
||||
skip_checkout: true
|
||||
status: success
|
||||
title: "A/N BDU PR: ${{ github.event.pull_request.title }}"
|
||||
message: |
|
||||
A pull request has been marked with the **A/N BDU** label.
|
||||
|
||||
- **Repository:** ${{ github.repository }}
|
||||
- **PR:** [#${{ github.event.pull_request.number }} ${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})
|
||||
- **Author:** ${{ github.event.pull_request.user.login }}
|
||||
@@ -8,13 +8,22 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.registry_package.package_type == 'npm' && github.event.registry_package.name == 'adf-core'
|
||||
steps:
|
||||
- name: Generate app token
|
||||
id: app-token
|
||||
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||
with:
|
||||
client-id: ${{ vars.GH_APP_ENGINEERING_CONTRIB_CLIENT_ID }}
|
||||
private-key: ${{ secrets.GH_APP_ENGINEERING_CONTRIB_PRIVATE_KEY }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
repositories: alfresco-apps
|
||||
permission-contents: write
|
||||
- name: Dispatch event to monorepo
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
env:
|
||||
PACKAGE_NAME: ${{ github.event.registry_package.name }}
|
||||
PACKAGE_VERSION: ${{ github.event.registry_package.package_version.name }}
|
||||
with:
|
||||
github-token: ${{ secrets.PAT_WRITE_PKG }}
|
||||
github-token: ${{ steps.app-token.outputs.token }}
|
||||
retries: 3
|
||||
script: |
|
||||
const payload = {
|
||||
|
||||
@@ -5,7 +5,7 @@ on:
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
secrets:
|
||||
BOT_GITHUB_TOKEN:
|
||||
GH_APP_ENGINEERING_CONTRIB_PRIVATE_KEY:
|
||||
required: true
|
||||
CROWDIN_TRANSLATIONS_TOKEN:
|
||||
required: true
|
||||
@@ -15,13 +15,21 @@ jobs:
|
||||
pull-from-crowdin:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Generate app token
|
||||
id: app-token
|
||||
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
|
||||
with:
|
||||
client-id: ${{ vars.GH_APP_ENGINEERING_CONTRIB_CLIENT_ID }}
|
||||
private-key: ${{ secrets.GH_APP_ENGINEERING_CONTRIB_PRIVATE_KEY }}
|
||||
permission-contents: write
|
||||
permission-pull-requests: write
|
||||
- name: Checkout
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: develop
|
||||
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
token: ${{ steps.app-token.outputs.token }}
|
||||
- name: Pull translations from Crowdin
|
||||
uses: crowdin/github-action@52aa776766211d83d975df51f3b9c53c2f8ba35f # v2.16.3
|
||||
uses: crowdin/github-action@c7af9bc98b01694653031fef2a0dc6c7888ce9bc # v2.17.0
|
||||
with:
|
||||
skip_ref_checkout: true
|
||||
upload_sources: false
|
||||
@@ -34,5 +42,5 @@ jobs:
|
||||
github_user_email: ${{ vars.HXPS_GIT_EMAIL }}
|
||||
gpg_private_key: ${{ secrets.HXPS_GIT_COMMIT_SIGNING_PRIVATE_KEY }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TRANSLATIONS_TOKEN }}
|
||||
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
code-changed: ${{ steps.path-filter.outputs.code-changed }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Ensure SHA pinned actions
|
||||
uses: hyland/github-actions-ensure-sha-pinned-actions@7957efb76aba0eec7580a9c0392d3e5bec381359 # v2.0.1
|
||||
@@ -94,7 +94,7 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 1
|
||||
@@ -172,7 +172,7 @@ jobs:
|
||||
if: ${{ needs.pre-checks.outputs.code-changed == 'true' }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup environment
|
||||
@@ -197,7 +197,7 @@ jobs:
|
||||
needs: [setup]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup environment
|
||||
@@ -230,7 +230,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup environment
|
||||
|
||||
@@ -9,7 +9,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the latest code
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Automatic Rebase
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
name: "release"
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
dry-run-flag:
|
||||
description: 'enable dry-run on artifact push'
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
dry-run-flag:
|
||||
@@ -15,13 +8,10 @@ on:
|
||||
required: false
|
||||
type: boolean
|
||||
default: true
|
||||
pull_request:
|
||||
types: [closed]
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- develop-patch*
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- master-patch-*
|
||||
|
||||
@@ -34,8 +24,6 @@ concurrency:
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
BASE_REF: ${{ github.base_ref }}
|
||||
HEAD_REF: ${{ github.head_ref }}
|
||||
GH_COMMIT: ${{ github.sha }}
|
||||
GH_BUILD_NUMBER: ${{ github.run_id }}
|
||||
LOG_LEVEL: "ERROR"
|
||||
@@ -44,7 +32,7 @@ env:
|
||||
jobs:
|
||||
setup:
|
||||
timeout-minutes: 20
|
||||
if: github.event.pull_request.merged == true || github.ref_name == 'master' || github.ref_name == 'master-patch-*' || github.event_name == 'workflow_dispatch'
|
||||
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
||||
name: "Setup"
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
@@ -52,7 +40,7 @@ jobs:
|
||||
actions: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: ./.github/actions/setup
|
||||
@@ -68,7 +56,7 @@ jobs:
|
||||
outputs:
|
||||
release_version: ${{ steps.set-version.outputs.release_version }}
|
||||
timeout-minutes: 30
|
||||
if: github.event.pull_request.merged == true || github.ref_name == 'master' || github.ref_name == 'master-patch-*' || github.event_name == 'workflow_dispatch'
|
||||
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
id-token: write # Required for OIDC
|
||||
@@ -77,7 +65,7 @@ jobs:
|
||||
actions: read
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- id: setup
|
||||
@@ -102,22 +90,22 @@ jobs:
|
||||
run: |
|
||||
pnpm build:libs
|
||||
pnpm build:schematics
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
name: release libraries GH registry
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
registry-url: 'https://npm.pkg.github.com'
|
||||
scope: '@alfresco'
|
||||
- run: pnpm run publish --tag ${{ steps.setup.outputs.npm-tag }} --provenance=false
|
||||
- run: pnpm run publish --tag ${{ steps.setup.outputs.npm-tag }} --provenance=false ${{ steps.set-dryrun.outputs.dryrun }}
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
name: release libraries Npm registry
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
registry-url: 'https://${{ vars.NPM_REGISTRY_ADDRESS }}'
|
||||
scope: '@alfresco'
|
||||
- run: pnpm run publish --tag ${{ steps.setup.outputs.npm-tag }}
|
||||
- run: pnpm run publish --tag ${{ steps.setup.outputs.npm-tag }} ${{ steps.set-dryrun.outputs.dryrun }}
|
||||
|
||||
create-git-tag:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -128,7 +116,7 @@ jobs:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- uses: './.github/actions/create-git-tag'
|
||||
@@ -138,11 +126,11 @@ jobs:
|
||||
npm-check-bundle:
|
||||
needs: [release-npm]
|
||||
timeout-minutes: 15
|
||||
if: github.event.pull_request.merged == true || github.ref_name == 'master' || github.ref_name == 'master-patch-*' || github.event_name == 'workflow_dispatch'
|
||||
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: ./.github/actions/npm-check-bundle
|
||||
|
||||
push-translation-keys-to-crowdin:
|
||||
@@ -156,10 +144,10 @@ jobs:
|
||||
actions: read
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Push Source Files to Crowdin
|
||||
uses: crowdin/github-action@52aa776766211d83d975df51f3b9c53c2f8ba35f # v2.16.3
|
||||
uses: crowdin/github-action@c7af9bc98b01694653031fef2a0dc6c7888ce9bc # v2.17.0
|
||||
with:
|
||||
upload_sources: true
|
||||
upload_sources_args: --delete-obsolete
|
||||
@@ -171,7 +159,7 @@ jobs:
|
||||
name: Run Crowdin pull pipeline for up-to-date sync
|
||||
uses: ./.github/workflows/pull-from-crowdin.yml
|
||||
secrets:
|
||||
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
GH_APP_ENGINEERING_CONTRIB_PRIVATE_KEY: ${{ secrets.GH_APP_ENGINEERING_CONTRIB_PRIVATE_KEY }}
|
||||
CROWDIN_TRANSLATIONS_TOKEN: ${{ secrets.CROWDIN_TRANSLATIONS_TOKEN }}
|
||||
HXPS_GIT_COMMIT_SIGNING_PRIVATE_KEY: ${{ secrets.HXPS_GIT_COMMIT_SIGNING_PRIVATE_KEY }}
|
||||
|
||||
|
||||
@@ -11,4 +11,4 @@ permissions:
|
||||
|
||||
jobs:
|
||||
stale-pr-cleanup:
|
||||
uses: Alfresco/alfresco-build-tools/.github/workflows/stale-pr-cleanup.yml@10cea6c0b390c4f8af21d9dc1670d581bd10319f # v18.13.0
|
||||
uses: Alfresco/alfresco-build-tools/.github/workflows/stale-pr-cleanup.yml@44f603af32dc79129056a9e4246ab62f35987a2b # v18.21.1
|
||||
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/github-upsert-comment@10cea6c0b390c4f8af21d9dc1670d581bd10319f # v18.13.0
|
||||
- uses: Alfresco/alfresco-build-tools/.github/actions/github-upsert-comment@44f603af32dc79129056a9e4246ab62f35987a2b # v18.21.1
|
||||
with:
|
||||
comment-identifier: supply-chain-review-instructions
|
||||
comment-body: |
|
||||
|
||||
+214
-193
File diff suppressed because one or more lines are too long
@@ -34,7 +34,7 @@ safe-outputs:
|
||||
allowed: [security:low, security:medium, security:high]
|
||||
submit-pull-request-review:
|
||||
|
||||
source: Alfresco/alfresco-build-tools/.github/workflows/supply-chain-review.md@7479d99410acb8b63f78a5b17abb3b8ebec3a66d
|
||||
source: Alfresco/alfresco-build-tools/.github/workflows/supply-chain-review.md@7bc0fc6f4f11df6c065b57d4a6aa90d7ea362b2f
|
||||
---
|
||||
|
||||
# Supply Chain Review
|
||||
@@ -46,7 +46,11 @@ You are the primary and only analysis engine. There is no secondary check. Be th
|
||||
|
||||
## Step 1 — Identify Dependency Changes
|
||||
|
||||
Read the pull request diff and find all modified dependency files (`package.json`, `package-lock.json`, `pom.xml`, `yarn.lock`, `build.gradle`, etc.). For each changed dependency extract:
|
||||
Read the **full** pull request diff — every commit in the PR, not just the latest one — and find all modified dependency files (`package.json`, `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`/`pnpm-lock.yml`, `pnpm-workspace.yaml`/`pnpm-workspace.yml`, `npm-shrinkwrap.json`, `pom.xml`, `build.gradle`, etc.).
|
||||
|
||||
**CRITICAL**: always use the GitHub MCP Server `pull_requests` toolset (e.g. `get_diff` / `get_files`) to fetch the diff — this always reflects every commit in the PR, regardless of local git history, against the correct base branch. Do NOT rely on local git commands or assumptions about the PR's commit history.
|
||||
|
||||
For each changed dependency extract:
|
||||
|
||||
- Package name (including scope/groupId if applicable)
|
||||
- Ecosystem (`npm` or `maven`)
|
||||
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
hasProjects: ${{ steps.set-matrix.outputs.hasProjects }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup environment
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
include: ${{ fromJson(needs.generate-affected-matrix.outputs.unitMatrix) }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Setup environment
|
||||
id: setup-env
|
||||
uses: ./.github/actions/setup
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"*.{ts,js}": ["prettier --write", "eslint"],
|
||||
"*.{ts,js}": ["prettier --write", "eslint --flag v10_config_lookup_from_file"],
|
||||
"*.{css,scss}": ["prettier --write", "stylelint --fix"]
|
||||
}
|
||||
|
||||
+9
-2
@@ -351,7 +351,6 @@ for more information about installing and using the source code.
|
||||
|
||||
| Name | Description | Source link |
|
||||
| ---- | ----------- | ----------- |
|
||||
| [Agent Service](content-services/services/agent.service.md) | Manages agents in Content Services. | [Source](../lib/content-services/src/lib/agent/services/agent.service.ts) |
|
||||
| [Audit Service](content-services/services/audit.service.md) | Manages Audit apps and entries. | [Source](../lib/content-services/src/lib/audit/audit.service.ts) |
|
||||
| [Card View Content Update Service](content-services/services/card-view-content-update.service.md) | Manages Card View properties in the content services environment. Implements BaseCardViewContentUpdate. | [Source](../lib/content-services/src/lib/common/services/card-view-content-update.service.ts) | |
|
||||
| [Category tree datasource service](content-services/services/category-tree-datasource.service.md) | Datasource service for category tree. | [Source](../lib/content-services/src/lib/category/services/category-tree-datasource.service.ts) |
|
||||
@@ -367,7 +366,6 @@ for more information about installing and using the source code.
|
||||
| [Node Comments Service](content-services/services/node-comments.service.md) | Adds and retrieves comments for nodes in Content Services. | [Source](../lib/content-services/src/lib/node-comments/services/node-comments.service.ts) |
|
||||
| [Node permission dialog service](content-services/services/node-permission-dialog.service.md) | Displays dialogs to let the user set node permissions. | [Source](../lib/content-services/src/lib/permission-manager/services/node-permission-dialog.service.ts) |
|
||||
| [Node Permission service](content-services/services/node-permission.service.md) | Manages role permissions for content nodes. | [Source](../lib/content-services/src/lib/permission-manager/services/node-permission.service.ts) |
|
||||
| [Search Ai Service](content-services/services/search-ai.service.md) | Manages search AI in Content Services. | [Source](../lib/content-services/src/lib/search-ai/services/search-ai.service.ts) |
|
||||
| [Search filter service](content-services/services/search-filter.service.md) | Registers widgets for use with the Search Filter component. | [Source](../lib/content-services/src/lib/search/services/search-filter.service.ts) |
|
||||
| [Search Query Builder service](content-services/services/search-query-builder.service.md) | Stores information from all the custom search and faceted search widgets, compiles and runs the final search query. | [Source](../lib/content-services/src/lib/search/services/search-query-builder.service.ts) |
|
||||
| [Security Controls service](content-services/services/security-controls.service.md) | Manages security groups & marks in Content Services. | [Source](../lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.ts) |
|
||||
@@ -567,3 +565,12 @@ Contains all custom rules used by ESLint.
|
||||
<!--eslint-angular end-->
|
||||
|
||||
[(Back to Contents)](#contents)
|
||||
|
||||
## Notes
|
||||
|
||||
### Knowledge Discovery removal (v9.0.0)
|
||||
|
||||
The Knowledge Discovery components, services, and APIs have been removed as of version 9.0.0.
|
||||
The integrated Knowledge Discovery features have been replaced with a section in the side navigation panel containing a link to the standalone Knowledge Discovery UI application in higher level apps such as ACA and ADW.
|
||||
|
||||
If you were using those features, please consider cleaning Local Storage in your browser as *aiReferences* entry may remain.
|
||||
|
||||
@@ -417,7 +417,8 @@ Once you have enabled this feature you will be able to double click on your meta
|
||||
"exif:exif": [ "exif:pixelXDimension", "exif:pixelYDimension"]
|
||||
}
|
||||
},
|
||||
"copy-to-clipboard-action": true
|
||||
"copy-to-clipboard-action": true,
|
||||
"display-copy-to-clipboard-icon": true
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
Title: Agent service
|
||||
Added: v7.0.0-alpha.3
|
||||
Status: Active
|
||||
Last reviewed: 2024-07-12
|
||||
---
|
||||
|
||||
# [Agent service](../../../lib/content-services/src/lib/agent/services/agent.service.ts "Defined in agent.service.ts")
|
||||
|
||||
Manages agents in Content Services.<br/>
|
||||
|
||||
<b>In order to use this service, you need to have the HX Insights Connector (additional ACS module) installed.</b>
|
||||
|
||||
## Class members
|
||||
|
||||
### Methods
|
||||
|
||||
- **getAgents**(): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`AgentPaging`](../../../lib/js-api/src/api/content-rest-api/docs/AgentsApi.md#agentpaging)`>`<br/>
|
||||
Gets all agents.
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`AgentPaging`](../../../lib/js-api/src/api/content-rest-api/docs/AgentsApi.md#agentpaging)`>` - AgentPaging object containing the agents.
|
||||
|
||||
## Details
|
||||
|
||||
See the
|
||||
[Agents API](../../../lib/js-api/src/api/content-rest-api/docs/AgentsApi.md) for more information about the types returned by [Agent
|
||||
service](agent.service.md) methods and for the implementation of the REST API the service is
|
||||
based on.
|
||||
@@ -23,11 +23,12 @@ Manages Document List information that is specific to a user.
|
||||
- _node:_ `any` - Node object
|
||||
- _nodeId:_ `string` - ID of the node object
|
||||
- **Returns** `string` - ID value
|
||||
- **getRecentFiles**(personId: `string`, pagination: [`PaginationModel`](../../../lib/core/src/lib/models/pagination.model.ts), filters?: `string[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/NodePaging.md)`>`<br/>
|
||||
- **getRecentFiles**(personId: `string`, pagination: [`PaginationModel`](../../../lib/core/src/lib/models/pagination.model.ts), filters?: `string[]`, includeFields: `string[]` = `[]`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/NodePaging.md)`>`<br/>
|
||||
Gets files recently accessed by a user.
|
||||
- _personId:_ `string` - ID of the user
|
||||
- _pagination:_ [`PaginationModel`](../../../lib/core/src/lib/models/pagination.model.ts) - Specifies how to paginate the results
|
||||
- _filters:_ `string[]` - (Optional) Specifies additional filters to apply (joined with **AND**)
|
||||
- _includeFields:_ `string[]` - List of data field names to include in the results
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`NodePaging`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/NodePaging.md)`>` - List of nodes for the recently used files
|
||||
- **hasCorrespondingNodeIds**(nodeId: `string`): `boolean`<br/>
|
||||
Does the well-known alias have a corresponding node ID?
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
---
|
||||
Title: Search Ai service
|
||||
Added: v7.0.0-alpha.3
|
||||
Status: Active
|
||||
Last reviewed: 2024-07-12
|
||||
---
|
||||
|
||||
# [Search Ai service](../../../lib/content-services/src/lib/search-ai/services/search-ai.service.ts "Defined in search-ai.service.ts")
|
||||
|
||||
Manages search AI in Content Services.
|
||||
|
||||
<b>In order to use this service, you need to have the HX Insights Connector (additional ACS module) installed.</b>
|
||||
|
||||
## Class members
|
||||
|
||||
### Methods
|
||||
|
||||
- **updateSearchAiInputState**(state: `SearchAiInputState`): `void`<br/>
|
||||
Update the state of the search AI input.
|
||||
- _state:_ `SearchAiInputState` - The new state of the search AI input.
|
||||
- **ask**(question: [`QuestionRequest`](../../../lib/js-api/src/api/content-rest-api/docs/SearchAiApi.md#questionrequest)): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`QuestionModel`](../../../lib/js-api/src/api/content-rest-api/docs/SearchAiApi.md#questionmodel)`>`<br/>
|
||||
Ask a question to the AI.
|
||||
- _question:_ [`QuestionRequest`](../../../lib/js-api/src/api/content-rest-api/docs/SearchAiApi.md#questionrequest) - The question to ask.
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`QuestionModel`](../../../lib/js-api/src/api/content-rest-api/docs/SearchAiApi.md#questionmodel)`>` - QuestionModel object containing information about questions.
|
||||
- **getAnswer**(questionId: `string`): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`AiAnswerEntry`](../../../lib/js-api/src/api/content-rest-api/docs/SearchAiApi.md#aianswerentry)`>`<br/>
|
||||
Get an answer to specific question.
|
||||
- _questionId:_ `string` - The ID of the question to get an answer for.
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`AiAnswerEntry`](../../../lib/js-api/src/api/content-rest-api/docs/SearchAiApi.md#aianswerentry)`>` - AiAnswerEntry object containing the answer.
|
||||
- **getConfig**(): [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`KnowledgeRetrievalConfigEntry`](../../../lib/js-api/src/api/content-rest-api/docs/SearchAiApi.md#knowledgeretrievalconfigentry)`>`<br/>
|
||||
Get the knowledge retrieval configuration.
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<`[`KnowledgeRetrievalConfigEntry`](../../../lib/js-api/src/api/content-rest-api/docs/SearchAiApi.md#knowledgeretrievalconfigentry)`>` - KnowledgeRetrievalConfigEntry object containing the configuration.
|
||||
- **checkSearchAvailability**(selectedNodesState: `SelectionState`, maxSelectedNodes: `number`): `string`<br/>
|
||||
Check if using of search is possible (if all conditions are met).
|
||||
- _selectedNodesState:_ `SelectionState` - information about selected nodes.
|
||||
- _maxSelectedNodes:_ `number` - max number of selected nodes. Default 100.
|
||||
- **Returns** `string` - string with error if any condition is not met, empty string otherwise.
|
||||
|
||||
## Details
|
||||
|
||||
See the
|
||||
[Search Ai API](../../../lib/js-api/src/api/content-rest-api/docs/SearchAiApi.md) for more information about the types returned by [Search Ai
|
||||
service](search-ai.service.md) methods and for the implementation of the REST API the service is
|
||||
based on.
|
||||
@@ -109,6 +109,7 @@ Defining properties from Typescript:
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| copyToClipboardAction | `boolean` | true | Toggles whether or not to enable copy to clipboard action. |
|
||||
| displayCopyToClipboardIcon | `boolean` | true | Toggles whether or not to show copy to clipboard icon. |
|
||||
| displayClearAction | `boolean` | true | Toggles whether or not to display clear action. |
|
||||
| displayEmpty | `boolean` | true | Toggles whether or not to show empty items in non-editable mode. |
|
||||
| displayNoneOption | `boolean` | true | Toggles whether or not to display none option. |
|
||||
@@ -193,6 +194,7 @@ const textItemProperty = new CardViewTextItemModel(options);
|
||||
| clickable | boolean | false | Toggles whether the property responds to clicks |
|
||||
| clickableCallBack | function | null | Function to execute when click the element |
|
||||
| copyToClipboardAction | `boolean` | true | Toggles whether or not to enable copy to clipboard action. |
|
||||
| displayCopyToClipboardIcon | `boolean` | true | Toggles whether or not to show copy to clipboard icon. |
|
||||
| useChipsForMultiValueProperty | `boolean` | true | Toggles whether or not to enable chips for multivalued properties. |
|
||||
| multiValueSeparator | `string` | ',' | String separator between multi-value property items. |
|
||||
| icon | string | | The material icon to show beside the item if it is clickable |
|
||||
@@ -249,6 +251,7 @@ const dateItemProperty = new CardViewDateItemModel(options);
|
||||
| label\* | string | | Item label |
|
||||
| value\* | any | | The original data value for the item |
|
||||
| copyToClipboardAction | `boolean` | true | Toggles whether or not to enable copy to clipboard action. |
|
||||
| displayCopyToClipboardIcon | `boolean` | true | Toggles whether or not to show copy to clipboard icon. |
|
||||
| key\* | string | | Identifying key (important when editing the item) |
|
||||
| default | any | | The default value to display if the value is empty |
|
||||
| displayValue\* | any | | The value to display |
|
||||
|
||||
@@ -50,6 +50,7 @@ Contains the value and metadata for a field of a [`Form`](../../../lib/process-s
|
||||
| numberOfColumns | number | 1 | Number of columns defined by a container field |
|
||||
| fields | [`FormFieldModel`](../../core/models/form-field.model.md)\[] | \[] | Fields contained within a container field |
|
||||
| columns | [`ContainerColumnModel`](../../../lib/core/src/lib/form/components/widgets/core/container-column.model.ts)\[] | \[] | Column definitions for a container field |
|
||||
| rows | [`ContainerRowModel`](../../../lib/core/src/lib/form/components/widgets/core/container-row.model.ts)\[] | \[] | Row definitions for a repeatable section field |
|
||||
| emptyOption | [`FormFieldOption`](../../../lib/core/src/lib/form/components/widgets/core/form-field-option.ts) | | Dropdown menu item to use when no option is chosen |
|
||||
| validationSummary | string | | Error/information message added during field validation (see [`FormFieldValidator`](../../../lib/core/src/lib/form/components/widgets/core/form-field-validator.ts) interface) |
|
||||
|
||||
@@ -95,6 +96,17 @@ The [REST Call Task 101](https://community.alfresco.com/community/bpm/blog/2016/
|
||||
tutorial on the [APS community site](https://community.alfresco.com/community/bpm)
|
||||
contains full details about how the REST calls work, along with a worked example.
|
||||
|
||||
### Repeatable sections
|
||||
|
||||
Repeatable section fields (`type: 'repeatable-section'`) support an `initialNumberOfRows` parameter in `params`.
|
||||
Setting `initialNumberOfRows` to `0` is valid: the section starts with no runtime rows and users add rows via the **Add row** action.
|
||||
|
||||
When no rows exist, `columns` holds a design-time column template (used by form editors and form-rules).
|
||||
Template fields are bound to the form for rendering but are marked as templates and do not write to `form.values`.
|
||||
No row data is written to `form.values` until the user adds a row or saved values are loaded from the server.
|
||||
|
||||
If saved values are present on the field (`value` array), row count is derived from `value.length` (subject to `maxNumberOfRows`), regardless of `initialNumberOfRows`.
|
||||
|
||||
## See also
|
||||
|
||||
- [Extensibility](../../user-guide/extensibility.md)
|
||||
|
||||
@@ -66,12 +66,19 @@ Manipulates content related to a Process Instance or Task Instance in APS.
|
||||
- _taskId:_ `string` - ID of the target task
|
||||
- _opts:_ `any` - (Optional) Options supported by JS-API
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Metadata for the content
|
||||
- **getProcessesAndTasksOnContent**(sourceId: `string`, source: `string`, size?: `number`, page?: `number`): [`Observable`](http://reactivex.io/documentation/observable.html)<[`ResultListDataRepresentationRelatedProcessTask`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/activiti-rest-api/docs/ResultListDataRepresentation%C2%ABRelatedContentRepresentation%C2%BB.md)><br/>
|
||||
- **getProcessesAndTasksOnContent**(sourceId: `string`, source: `string`, size?: `number`, page?: `number`): [`Observable`](http://reactivex.io/documentation/observable.html)<[`ResultListDataRepresentationRelatedProcessTask`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/activiti-rest-api/docs/ResultListDataRepresentationRelatedProcessTask.md)><br/>
|
||||
Lists processes and tasks on workflow started with provided document
|
||||
- _sourceId:_ `string` - id of the document that workflow or task has been started with
|
||||
- _source:_ `string` - source of the document that workflow or task has been started with
|
||||
- _size:_ `number` - size of the entries to get
|
||||
- _page:_ `number` - page number
|
||||
- **getProcessesAndTasksOnContentBatch**(sourceIds: `string[]`, source: `string`, size?: `number`, page?: `number`): [`Observable`](http://reactivex.io/documentation/observable.html)<[`ResultListDataRepresentationRelatedProcessTask`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/activiti-rest-api/docs/ResultListDataRepresentationRelatedProcessTask.md)><br/>
|
||||
Batch variant of getProcessesAndTasksOnContent. Accepts multiple source document ids in one request (up to 500) and returns the related processes and tasks for all of them.
|
||||
- _sourceIds:_ `string[]` - ids of the documents to query process participation for (up to 500)
|
||||
- _source:_ `string` - source of the documents that workflows or tasks have been started with
|
||||
- _size:_ `number` - (Optional) size of the entries to get
|
||||
- _page:_ `number` - (Optional) page number
|
||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)<[`ResultListDataRepresentationRelatedProcessTask`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/activiti-rest-api/docs/ResultListDataRepresentationRelatedProcessTask.md)>
|
||||
- **handleError**(error: `any`): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/>
|
||||
Reports an error message.
|
||||
- _error:_ `any` - Data object with optional `message` and `status` fields for the error
|
||||
@@ -422,6 +429,21 @@ this.contentService.getProcessesAndTasksOnContent(sourceId, source).subscribe(
|
||||
});
|
||||
```
|
||||
|
||||
#### getProcessesAndTasksOnContentBatch(sourceIds: string[], source: string, size?: number, page?: number): Observable`<ResultListDataRepresentationRelatedProcessTask>`
|
||||
|
||||
Batch variant of `getProcessesAndTasksOnContent`. Accepts multiple source document ids in one request (up to 500) and returns the related processes and tasks for all of them.
|
||||
|
||||
```ts
|
||||
const sourceIds = ['sourceId1', 'sourceId2'];
|
||||
const source = 'source';
|
||||
this.contentService.getProcessesAndTasksOnContentBatch(sourceIds, source).subscribe(
|
||||
res => {
|
||||
console.log('Response: ', res);
|
||||
}, error => {
|
||||
console.log('Error: ', error);
|
||||
});
|
||||
```
|
||||
|
||||
## Details
|
||||
|
||||
## Importing
|
||||
|
||||
@@ -63,3 +63,4 @@ The pages linked below contain the licenses for all third party dependencies of
|
||||
- [ADF 8.3.1](license-info-8.3.1.md)
|
||||
- [ADF 8.4.1](license-info-8.4.1.md)
|
||||
- [ADF 8.5.0](license-info-8.5.0.md)
|
||||
- [ADF 9.0.0](license-info-9.0.0.md)
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
---
|
||||
Title: License info, alfresco-ng2-components 9.0.0
|
||||
---
|
||||
|
||||
# License information for alfresco-ng2-components 9.0.0
|
||||
|
||||
This page lists all third party libraries the project depends on.
|
||||
|
||||
## Libraries
|
||||
|
||||
| Name | Version | License |
|
||||
| --- | --- | --- |
|
||||
| [@angular-eslint/bundled-angular-compiler](https://github.com/angular-eslint/angular-eslint.git) | 20.7.0 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@angular-eslint/utils](https://github.com/angular-eslint/angular-eslint.git) | 20.7.0 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@angular/animations](https://github.com/angular/angular.git) | 20.3.25 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@angular/cdk](https://github.com/angular/components.git) | 20.2.14 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@angular/common](https://github.com/angular/angular.git) | 20.3.25 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@angular/compiler](https://github.com/angular/angular.git) | 20.3.25 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@angular/core](https://github.com/angular/angular.git) | 20.3.25 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@angular/forms](https://github.com/angular/angular.git) | 20.3.25 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@angular/material](https://github.com/angular/components.git) | 20.2.14 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@angular/material-date-fns-adapter](https://github.com/angular/components.git) | 20.2.14 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@angular/platform-browser](https://github.com/angular/angular.git) | 20.3.25 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@angular/platform-browser-dynamic](https://github.com/angular/angular.git) | 20.3.25 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@angular/router](git+https://github.com/angular/angular.git) | 20.3.25 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@apollo/client](git+https://github.com/apollographql/apollo-client.git) | 3.13.1 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@babel/runtime](https://github.com/babel/babel.git) | 7.26.10 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@cspell/eslint-plugin](https://github.com/streetsidesoftware/cspell.git) | 10.0.0 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@graphql-typed-document-node/core](git@github.com:dotansimha/graphql-typed-document-node.git) | 3.2.0 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@mat-datetimepicker/core](https://github.com/kuhnroyal/mat-datetimepicker.git) | 16.0.1 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@napi-rs/canvas](git+https://github.com/Brooooooklyn/canvas.git) | 0.1.100 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@napi-rs/canvas-darwin-arm64](git+https://github.com/Brooooooklyn/canvas.git) | 0.1.100 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@ngx-translate/core](https://github.com/ngx-translate/core) | 17.0.0 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@wry/caches](git+https://github.com/benjamn/wryware.git) | 1.0.1 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@wry/context](git+https://github.com/benjamn/wryware.git) | 0.7.4 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@wry/equality](git+https://github.com/benjamn/wryware.git) | 0.5.7 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [@wry/trie](git+https://github.com/benjamn/wryware.git) | 0.5.0 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [angular-oauth2-oidc](https://github.com/manfredsteyer/angular-oauth2-oidc) | 19.0.0 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [apollo-angular](https://github.com/kamilkisiela/apollo-angular) | 11.0.0 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [balanced-match](git://github.com/juliangruber/balanced-match.git) | 1.0.2 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [brace-expansion](git://github.com/juliangruber/brace-expansion.git) | 1.1.15 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [brace-expansion](git://github.com/juliangruber/brace-expansion.git) | 2.1.1 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [concat-map](git://github.com/substack/node-concat-map.git) | 0.0.1 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [cropperjs](git+https://github.com/fengyuanchen/cropperjs.git) | 1.6.2 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [date-fns](https://github.com/date-fns/date-fns) | 2.30.0 | [MIT](https://opensource.org/license/mit/) |
|
||||
| dotenv-expand | 5.1.0 | [BSD-2-Clause](https://opensource.org/licenses/BSD-2-Clause) |
|
||||
| editorjs-html | 4.0.5 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [eve-raphael](https://github.com/tomasAlabes/eve.git) | 0.5.0 | UNKNOWN |
|
||||
| [eventemitter3](git://github.com/primus/eventemitter3.git) | 5.0.4 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [fetch-blob](https://github.com/node-fetch/fetch-blob.git) | 3.2.0 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [formdata-polyfill](git+https://jimmywarting@github.com/jimmywarting/FormData.git) | 4.0.10 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [graphql-tag](git+https://github.com/apollographql/graphql-tag.git) | 2.12.7 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [graphql-ws](git+https://github.com/enisdenjo/graphql-ws.git) | 6.0.8 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [hoist-non-react-statics](git://github.com/mridgway/hoist-non-react-statics.git) | 3.3.2 | [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) |
|
||||
| [js-tokens](lydell/js-tokens) | 4.0.0 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [lodash-es](lodash/lodash) | 4.18.1 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [loose-envify](git://github.com/zertosh/loose-envify.git) | 1.4.0 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [material-icons](git+https://github.com/marella/material-icons.git) | 1.13.14 | [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0) |
|
||||
| [minimatch](git://github.com/isaacs/minimatch.git) | 5.1.9 | [ISC](https://www.isc.org/licenses/) |
|
||||
| [minimatch-browser](git://github.com/isaacs/minimatch.git) | 1.0.0 | [ISC](https://www.isc.org/licenses/) |
|
||||
| [ng2-charts](git+https://github.com/valor-software/ng2-charts.git) | 4.1.1 | [ISC](https://www.isc.org/licenses/) |
|
||||
| [node-domexception](git+https://github.com/jimmywarting/node-domexception.git) | 1.0.0 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [node-fetch](https://github.com/node-fetch/node-fetch.git) | 3.3.2 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [object-assign](sindresorhus/object-assign) | 4.1.1 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [optimism](git+https://github.com/benjamn/optimism.git) | 0.18.1 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [pdfjs-dist](git+https://github.com/mozilla/pdf.js.git) | 5.1.91 | [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0) |
|
||||
| [prop-types](facebook/prop-types) | 15.8.1 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [raphael](git://github.com/DmitryBaranovskiy/raphael.git) | 2.3.0 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [react-is](https://github.com/facebook/react.git) | 16.13.1 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [regenerator-runtime](https://github.com/facebook/regenerator/tree/main/packages/runtime) | 0.14.1 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [rehackt](git+https://github.com/phryneas/rehackt.git) | 0.1.0 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [rxjs](https://github.com/reactivex/rxjs.git) | 7.8.2 | [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0) |
|
||||
| [symbol-observable](blesh/symbol-observable) | 4.0.0 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [ts-invariant](git+https://github.com/apollographql/invariant-packages.git) | 0.10.3 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [tslib](https://github.com/Microsoft/tslib.git) | 2.8.1 | [0BSD](http://landley.net/toybox/license.html) |
|
||||
| [uuid](https://github.com/uuidjs/uuid.git) | 14.0.1 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [web-streams-polyfill](git+https://github.com/MattiasBuelens/web-streams-polyfill.git) | 3.3.3 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [zen-observable](zenparsing/zen-observable) | 0.8.15 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [zen-observable-ts](git+https://github.com/apollographql/zen-observable-ts.git) | 1.2.5 | [MIT](https://opensource.org/license/mit/) |
|
||||
| [zone.js](git://github.com/angular/angular.git) | 0.15.0 | [MIT](https://opensource.org/license/mit/) |
|
||||
|
||||
@@ -9,6 +9,7 @@ The first **General Availability** release was v2.0.0.
|
||||
|
||||
## General Availability
|
||||
|
||||
- [9.0.0](RelNote-9.0.0.md)
|
||||
- [8.5.0](RelNote-8.5.0.md)
|
||||
- [8.4.1](RelNote-8.4.1.md)
|
||||
- [8.3.1](RelNote-8.3.1.md)
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
---
|
||||
Title: Changelog for alfresco-ng2-components v9.0.0
|
||||
---
|
||||
|
||||
# Changelog
|
||||
|
||||
- [0a19be090e](git@github.com:Alfresco/alfresco-ng2-components/commit/0a19be090e) [ACS-12286] Pass includeFields through to getRecentFiles for -recent- (#12067)
|
||||
- [b69c3ae1ae](git@github.com:Alfresco/alfresco-ng2-components/commit/b69c3ae1ae) [MNT-25230] Displayed modified time for node version (#12066)
|
||||
- [ce907417b7](git@github.com:Alfresco/alfresco-ng2-components/commit/ce907417b7) AAE-48166 Compensate for VM/Citrix clock drift in token expiry check (#12024)
|
||||
- [4c7765e3fa](git@github.com:Alfresco/alfresco-ng2-components/commit/4c7765e3fa) AAE-46517 Add onRowCountChange form event for Repeatable Sections (#12062)
|
||||
- [407a64996e](git@github.com:Alfresco/alfresco-ng2-components/commit/407a64996e) AAE-46248 Format dropdown/radio option labels in display-text expressions (#12045)
|
||||
- [01cea60490](git@github.com:Alfresco/alfresco-ng2-components/commit/01cea60490) [MNT-25230] adw version history does not provide user information (#12050)
|
||||
- [09ef05038c](git@github.com:Alfresco/alfresco-ng2-components/commit/09ef05038c) chore: remove deprecated MaterialModule and its references (#12051)
|
||||
- [c7bd56f244](git@github.com:Alfresco/alfresco-ng2-components/commit/c7bd56f244) AAE-43974 Fix for alfresco-content-app e2e failure (#12055)
|
||||
- [b86e41515e](git@github.com:Alfresco/alfresco-ng2-components/commit/b86e41515e) [ACS-12037] Remove Knowledge Discovery from ADF (#12042)
|
||||
- [0b35118dee](git@github.com:Alfresco/alfresco-ng2-components/commit/0b35118dee) AAE-47880 UI breaks when pasting very large text into text field (#12043)
|
||||
- [fe2b3d85dd](git@github.com:Alfresco/alfresco-ng2-components/commit/fe2b3d85dd) [ACS-12108] Introduce signed commits into ADF workflows (#12040)
|
||||
- [b0dc85422c](git@github.com:Alfresco/alfresco-ng2-components/commit/b0dc85422c) Improvement/AAE-43974 Refactoring form fields (#11945)
|
||||
- [23f0392c12](git@github.com:Alfresco/alfresco-ng2-components/commit/23f0392c12) AAE-47634 Refactor: switch form service getTask to use runtime bundle API (#12020)
|
||||
- [997303e6a7](git@github.com:Alfresco/alfresco-ng2-components/commit/997303e6a7) [ACS-11325] remove chevron button from tab order in adf-tree (#12041)
|
||||
- [45d1818f04](git@github.com:Alfresco/alfresco-ng2-components/commit/45d1818f04) [ACS-12098] firefox headless race condition viewer fix (#12023)
|
||||
- [448e667c52](git@github.com:Alfresco/alfresco-ng2-components/commit/448e667c52) [MNT-25681] Content node selector panel filtering fixed (#12032)
|
||||
- [18e602aa85](git@github.com:Alfresco/alfresco-ng2-components/commit/18e602aa85) [PRODSEC-13253] Increased peerDependencies versions to allow to increase angular version in other projects (#12031)
|
||||
- [4cd8648a05](git@github.com:Alfresco/alfresco-ng2-components/commit/4cd8648a05) Adjust release triggers to use cache-writable token (#12030)
|
||||
- [7f57b3936b](git@github.com:Alfresco/alfresco-ng2-components/commit/7f57b3936b) AAE-39528 Session timeout features (#12008)
|
||||
- [5a30baad99](git@github.com:Alfresco/alfresco-ng2-components/commit/5a30baad99) Release cache read/write fix (#12029)
|
||||
- [5050c3d974](git@github.com:Alfresco/alfresco-ng2-components/commit/5050c3d974) [ACS-12041] Add debounceTime in PeopleWidgetComponent to limit API calls on every keystroke (#12027)
|
||||
- [d8b36606e2](git@github.com:Alfresco/alfresco-ng2-components/commit/d8b36606e2) [MNT-25681] Search refactoring and unification (#12019)
|
||||
- [37f8fe47ac](git@github.com:Alfresco/alfresco-ng2-components/commit/37f8fe47ac) AAE-46695 Upgrade to pnpm 11.9 (#12028)
|
||||
- [af0d1e4ead](git@github.com:Alfresco/alfresco-ng2-components/commit/af0d1e4ead) AAE-47093 Update Supply Chain Review GH AW to latest (#12025)
|
||||
- [bd7f393db9](git@github.com:Alfresco/alfresco-ng2-components/commit/bd7f393db9) AAE-47634 Fix block task claim checking status on Runtime Bundle (#12009)
|
||||
- [d2d6696c05](git@github.com:Alfresco/alfresco-ng2-components/commit/d2d6696c05) Migrate to Angular 20, TypeScript 5.9, and Angular Material 20 (#11657)
|
||||
- [7546aa91a3](git@github.com:Alfresco/alfresco-ng2-components/commit/7546aa91a3) AAE-47577 Form Spinner persists outside of Automate Form (#12005)
|
||||
- [74d67c39a0](git@github.com:Alfresco/alfresco-ng2-components/commit/74d67c39a0) [ACS-11317] a11y Fix: Tags interactive controls are not manageable via keyboard (#11845)
|
||||
- [20c20f2749](git@github.com:Alfresco/alfresco-ng2-components/commit/20c20f2749) AAE-46247 Add type-aware form field value adapter service (#11968)
|
||||
- [b498d5744c](git@github.com:Alfresco/alfresco-ng2-components/commit/b498d5744c) [AAE-47470] - Upgrade Pnpm to 11.8.0 (#12004)
|
||||
- [80eef35e1d](git@github.com:Alfresco/alfresco-ng2-components/commit/80eef35e1d) [ACS-11325] Add keyboard navigation and a11y support for adf-tree component (#11973)
|
||||
- [49a3f1e104](git@github.com:Alfresco/alfresco-ng2-components/commit/49a3f1e104) AAE-47412 Update suprocesses and linked processes for process instance model (#11996)
|
||||
- [0beaa18452](git@github.com:Alfresco/alfresco-ng2-components/commit/0beaa18452) [ACS-11973] Fix: context menu disappears during bulk upload (#11994)
|
||||
- [76fd461741](git@github.com:Alfresco/alfresco-ng2-components/commit/76fd461741) AAE-47042 Add auto grow support to multiline text widget (#11981)
|
||||
- [78697ee62a](git@github.com:Alfresco/alfresco-ng2-components/commit/78697ee62a) [AAE-0000] - Fixed js-api error index.js (#11970)
|
||||
- [43c5bc17fb](git@github.com:Alfresco/alfresco-ng2-components/commit/43c5bc17fb) [ACS-12020] Updated init-aps passwords with secret ones (#11993)
|
||||
- [cda20e0386](git@github.com:Alfresco/alfresco-ng2-components/commit/cda20e0386) Post-release version bump (#11988)
|
||||
- [8f5099e822](git@github.com:Alfresco/alfresco-ng2-components/commit/8f5099e822) [ACS-11928] convert ReadStream to Blob before appending to FormData (#11987)
|
||||
- [5dd709ed58](git@github.com:Alfresco/alfresco-ng2-components/commit/5dd709ed58) AAE-44809 Fix form multi-file attachment - document viewer not updated on file selection (#11980)
|
||||
- [9d353bf271](git@github.com:Alfresco/alfresco-ng2-components/commit/9d353bf271) [ACS-11974] [ACA] Upload new version button is no longer disabled when clicked once (#11977)
|
||||
- [633702860f](git@github.com:Alfresco/alfresco-ng2-components/commit/633702860f) Post-release version bump (#11984)
|
||||
- [bf5b3af285](git@github.com:Alfresco/alfresco-ng2-components/commit/bf5b3af285) AAE-47094 Add Stale PR Cleanup workflow (#11983)
|
||||
@@ -109,9 +109,10 @@ Now that the `my-preset` configuration is defined, let's use it in a view of the
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
|----------|-----------|---------------|------------------------------------------------------------------------------|
|
||||
| readOnly | `boolean` | false | (optional) This flag sets the metadata in read only mode preventing changes. |
|
||||
| Name | Type | Default value | Description |
|
||||
|----------------------------|-----------|---------------|------------------------------------------------------------------------------|
|
||||
| readOnly | `boolean` | false | (optional) This flag sets the metadata in read only mode preventing changes. |
|
||||
| displayCopyToClipboardIcon | `boolean` | true | Toggles whether or not to display the copy to clipboard icon. |
|
||||
|
||||
### Viewing the result
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ Open the `src/app/login/login.component.html` file. The contents will look like
|
||||
|
||||
```html
|
||||
<adf-login
|
||||
copyrightText="© 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved."
|
||||
copyrightText="© 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved."
|
||||
successRoute="/documentlist">
|
||||
</adf-login>
|
||||
```
|
||||
@@ -49,7 +49,7 @@ Looking at the documentation, we can see that the `<adf-login/>` component has a
|
||||
<adf-login
|
||||
[showRememberMe]="false"
|
||||
[showLoginActions]="false"
|
||||
copyrightText="© 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved."
|
||||
copyrightText="© 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved."
|
||||
successRoute="/documentlist">
|
||||
</adf-login>
|
||||
```
|
||||
@@ -80,7 +80,7 @@ Open `src/app/login/login.component.html` and add `(executeSubmit)="myExecuteSub
|
||||
[showRememberMe]="false"
|
||||
[showLoginActions]="false"
|
||||
(executeSubmit)="myExecuteSubmitMethod($event)"
|
||||
copyrightText="© 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved."
|
||||
copyrightText="© 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved."
|
||||
successRoute="/documentlist">
|
||||
</adf-login>
|
||||
```
|
||||
@@ -147,7 +147,7 @@ Let's add a simple Hello World message in the footer. Open the template `src/app
|
||||
[showRememberMe]="false"
|
||||
[showLoginActions]="false"
|
||||
(executeSubmit)="myExecuteSubmitMethod($event)"
|
||||
copyrightText="© 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved."
|
||||
copyrightText="© 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved."
|
||||
successRoute="/documentlist">
|
||||
<adf-login-footer>
|
||||
<ng-template>
|
||||
|
||||
@@ -61,8 +61,8 @@ backend services have been tested with each released version of ADF.
|
||||
|
||||
<!--7.0.0-alpha.3 start-->
|
||||
|
||||
- [AgentService](content-services/services/agent.service.md)
|
||||
- [SearchAiService](content-services/services/search-ai.service.md)
|
||||
- AgentService — removed, see [Notes](README.md#knowledge-discovery-removal-v900)
|
||||
- SearchAiService — removed, see [Notes](README.md#knowledge-discovery-removal-v900)
|
||||
|
||||
<!--7.0.0-alpha.3 end-->
|
||||
|
||||
|
||||
@@ -60,3 +60,4 @@ The pages linked below contain the audit for all third party dependencies of ADF
|
||||
- [ADF 8.3.1](audit-info-8.3.1.md)
|
||||
- [ADF 8.4.1](audit-info-8.4.1.md)
|
||||
- [ADF 8.5.0](audit-info-8.5.0.md)
|
||||
- [ADF 9.0.0](audit-info-9.0.0.md)
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
Title: Audit info, alfresco-ng2-components 9.0.0
|
||||
---
|
||||
|
||||
# Audit information for alfresco-ng2-components 9.0.0
|
||||
|
||||
This page lists the security audit of the dependencies this project depends on.
|
||||
|
||||
## Risks
|
||||
|
||||
- Critical risk: 0
|
||||
- High risk: 0
|
||||
- Moderate risk: 0
|
||||
- Low risk: 0
|
||||
|
||||
Dependencies analyzed: 297
|
||||
|
||||
## Libraries
|
||||
|
||||
| Severity | Module | Vulnerable versions |
|
||||
| --- | --- | --- |
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
@@ -0,0 +1,357 @@
|
||||
/*!
|
||||
* @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 path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import js from '@eslint/js';
|
||||
import { FlatCompat } from '@eslint/eslintrc';
|
||||
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
||||
import { fixupPluginRules } from '@eslint/compat';
|
||||
import unicorn from 'eslint-plugin-unicorn';
|
||||
import rxjs from 'eslint-plugin-rxjs';
|
||||
import prettier from 'eslint-plugin-prettier';
|
||||
import ban from 'eslint-plugin-ban';
|
||||
import licenseHeader from 'eslint-plugin-license-header';
|
||||
import cspell from '@cspell/eslint-plugin';
|
||||
import importPlugin from 'eslint-plugin-import';
|
||||
import storybook from 'eslint-plugin-storybook';
|
||||
import nxPlugin from '@nx/eslint-plugin';
|
||||
import angularEslintEslintPlugin from '@angular-eslint/eslint-plugin';
|
||||
import angularTemplateParser from '@angular-eslint/template-parser';
|
||||
import tsParser from '@typescript-eslint/parser';
|
||||
import jsonParser from 'jsonc-eslint-parser';
|
||||
import alfrescoEslintAngular from './lib/eslint-angular/main.js';
|
||||
import jsdoc from 'eslint-plugin-jsdoc';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all
|
||||
});
|
||||
|
||||
export default [
|
||||
{
|
||||
ignores: [
|
||||
'.angular',
|
||||
'.DS_Store',
|
||||
'.github',
|
||||
'.history',
|
||||
'.husky',
|
||||
'.nx',
|
||||
'.vscode',
|
||||
'coverage',
|
||||
'dist',
|
||||
'**/docs',
|
||||
'nxcache',
|
||||
'tmp',
|
||||
'projects/**/*',
|
||||
'**/node_modules/**/*',
|
||||
'lib/cli/node_modules/**/*',
|
||||
'lib/core/src/lib/icon',
|
||||
'**/node_modules',
|
||||
'**/assets',
|
||||
'/scripts'
|
||||
]
|
||||
},
|
||||
// You can uncomment unicorn.configs['recommended'], fix a few issues, and comment it out again until all issues are resolved.
|
||||
// Expect significant effort to fix all reported issues.
|
||||
// Note to developers: when enabling unicorn.configs['recommended'], remove unicorn from plugins to avoid plugin redefinition errors.
|
||||
// unicorn.configs['recommended'],
|
||||
...storybook.configs['flat/recommended'],
|
||||
{
|
||||
files: ['**/*.{js,mjs,cjs,ts}'],
|
||||
ignores: ['**/*.d.ts'],
|
||||
plugins: {
|
||||
'license-header': licenseHeader
|
||||
},
|
||||
rules: {
|
||||
'license-header/header': [
|
||||
'error',
|
||||
[
|
||||
'/*!',
|
||||
' * @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.',
|
||||
' */'
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/*.ts', '**/*.js', '**/*.mjs'],
|
||||
ignores: ['**/*.d.ts', '**/*.spec.ts'],
|
||||
...jsdoc.configs['flat/recommended-typescript-error']
|
||||
},
|
||||
{
|
||||
files: ['**/*.ts'],
|
||||
ignores: ['**/*.d.ts', '**/*.mjs'],
|
||||
...compat.extends(
|
||||
'plugin:@nx/typescript',
|
||||
'plugin:@nx/angular',
|
||||
'plugin:@cspell/recommended',
|
||||
'plugin:@angular-eslint/recommended',
|
||||
'plugin:@angular-eslint/template/process-inline-templates'
|
||||
)[0],
|
||||
plugins: {
|
||||
'@nx': nxPlugin,
|
||||
jsdoc,
|
||||
unicorn,
|
||||
rxjs: fixupPluginRules(rxjs),
|
||||
prettier: prettier,
|
||||
ban: ban,
|
||||
'@cspell': cspell,
|
||||
import: importPlugin,
|
||||
'@angular-eslint': angularEslintEslintPlugin,
|
||||
'@typescript-eslint': typescriptEslint
|
||||
},
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
allowDefaultProject: true,
|
||||
tsconfigRootDir: __dirname,
|
||||
sourceType: 'module'
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
// Uncomment this to enable prettier checks as part of the ESLint
|
||||
// Note to developers:
|
||||
// you can uncomment the full ruleset locally when fixing issues, and then comment
|
||||
// that will allow splitting the work into smaller chunks
|
||||
// 'prettier/prettier': 'error',
|
||||
'ban/ban': [
|
||||
'error',
|
||||
{ name: 'eval', message: 'Calls to eval is not allowed.' },
|
||||
{ name: 'fdescribe', message: 'Calls to fdescribe is not allowed' },
|
||||
{ name: 'fit', message: 'Calls to fit is not allowed' },
|
||||
{ name: 'xit', message: 'Calls to xit is not allowed' },
|
||||
{ name: 'xdescribe', message: 'Calls to xdescribe is not allowed' },
|
||||
{ name: ['test', 'only'], message: 'Calls to test.only is not allowed' },
|
||||
{ name: ['describe', 'only'], message: 'Calls to describe.only is not allowed' }
|
||||
],
|
||||
'@angular-eslint/component-selector': [
|
||||
'error',
|
||||
{
|
||||
type: 'element',
|
||||
prefix: ['adf', 'app'],
|
||||
style: 'kebab-case'
|
||||
}
|
||||
],
|
||||
'@angular-eslint/directive-selector': [
|
||||
'error',
|
||||
{
|
||||
type: ['element', 'attribute'],
|
||||
prefix: ['adf', 'app'],
|
||||
style: 'kebab-case'
|
||||
}
|
||||
],
|
||||
'@angular-eslint/no-host-metadata-property': 'off',
|
||||
'@angular-eslint/no-input-prefix': 'error',
|
||||
'@angular-eslint/prefer-inject': 'error',
|
||||
'@typescript-eslint/consistent-type-definitions': 'error',
|
||||
'@typescript-eslint/dot-notation': 'off',
|
||||
'@typescript-eslint/explicit-member-accessibility': [
|
||||
'off',
|
||||
{
|
||||
accessibility: 'explicit'
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/await-thenable': 'error',
|
||||
'@typescript-eslint/prefer-optional-chain': 'warn',
|
||||
'@typescript-eslint/prefer-readonly': 'error',
|
||||
'@typescript-eslint/no-inferrable-types': 'off',
|
||||
'@typescript-eslint/no-require-imports': 'off',
|
||||
'@typescript-eslint/no-var-requires': 'error',
|
||||
'jsdoc/tag-lines': [
|
||||
'error',
|
||||
'any',
|
||||
{
|
||||
startLines: 1
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/naming-convention': [
|
||||
'error',
|
||||
{
|
||||
selector: [
|
||||
'classProperty',
|
||||
'objectLiteralProperty',
|
||||
'typeProperty',
|
||||
'classMethod',
|
||||
'objectLiteralMethod',
|
||||
'typeMethod',
|
||||
'accessor',
|
||||
'enumMember'
|
||||
],
|
||||
format: null,
|
||||
modifiers: ['requiresQuotes']
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/member-ordering': 'off',
|
||||
'@typescript-eslint/no-empty-function': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'prefer-promise-reject-errors': 'error',
|
||||
'brace-style': 'off',
|
||||
'comma-dangle': 'error',
|
||||
'default-case': 'error',
|
||||
'import/order': 'off',
|
||||
'max-len': [
|
||||
'error',
|
||||
{
|
||||
code: 240
|
||||
}
|
||||
],
|
||||
'no-bitwise': 'off',
|
||||
'no-console': [
|
||||
'error',
|
||||
{
|
||||
allow: [
|
||||
'warn',
|
||||
'dir',
|
||||
'timeLog',
|
||||
'assert',
|
||||
'clear',
|
||||
'count',
|
||||
'countReset',
|
||||
'group',
|
||||
'groupEnd',
|
||||
'table',
|
||||
'dirxml',
|
||||
'error',
|
||||
'groupCollapsed',
|
||||
'Console',
|
||||
'profile',
|
||||
'profileEnd',
|
||||
'timeStamp',
|
||||
'context'
|
||||
]
|
||||
}
|
||||
],
|
||||
'no-duplicate-imports': 'error',
|
||||
'no-multiple-empty-lines': 'error',
|
||||
'no-redeclare': 'off',
|
||||
'@typescript-eslint/no-redeclare': ['off', { ignoreDeclarationMerge: true }],
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{
|
||||
argsIgnorePattern: '^_',
|
||||
varsIgnorePattern: '^_',
|
||||
caughtErrorsIgnorePattern: '^_'
|
||||
}
|
||||
],
|
||||
'no-return-await': 'error',
|
||||
'rxjs/no-create': 'error',
|
||||
'rxjs/no-subject-unsubscribe': 'error',
|
||||
'rxjs/no-subject-value': 'error',
|
||||
'rxjs/no-unsafe-takeuntil': 'error',
|
||||
'unicorn/filename-case': 'error',
|
||||
'unicorn/prefer-optional-catch-binding': 'error',
|
||||
'@typescript-eslint/no-unused-expressions': [
|
||||
'error',
|
||||
{
|
||||
allowShortCircuit: true,
|
||||
allowTernary: true
|
||||
}
|
||||
],
|
||||
'no-restricted-syntax': [
|
||||
'error',
|
||||
{
|
||||
selector: "Identifier[name='CUSTOM_ELEMENTS_SCHEMA']",
|
||||
message: 'The use of CUSTOM_ELEMENTS_SCHEMA is not allowed. Consider alternatives for proper schema handling.'
|
||||
},
|
||||
{
|
||||
selector: "Identifier[name='NO_ERRORS_SCHEMA']",
|
||||
message: 'The use of NO_ERRORS_SCHEMA is not allowed. Consider alternatives for proper schema handling.'
|
||||
},
|
||||
{
|
||||
selector: 'TSEnumDeclaration',
|
||||
message: 'Enums are not allowed. Use string literal types (e.g., type Foo = "a" | "b") or const objects instead.'
|
||||
},
|
||||
{
|
||||
selector: ':matches(Literal[value=/ng-reflect-/], TemplateElement[value.cooked=/ng-reflect-/])',
|
||||
message: '*ng-reflect-* attributes should not be used. Consider alternatives for proper selectors.'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/*.html'],
|
||||
...compat.extends(
|
||||
'plugin:@angular-eslint/template/recommended',
|
||||
'plugin:@angular-eslint/template/accessibility',
|
||||
'plugin:@nx/angular-template'
|
||||
)[0],
|
||||
languageOptions: {
|
||||
parser: angularTemplateParser
|
||||
},
|
||||
rules: {
|
||||
'@angular-eslint/template/prefer-self-closing-tags': 'error'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/*.spec.ts'],
|
||||
plugins: {
|
||||
'@alfresco/eslint-angular': alfrescoEslintAngular
|
||||
},
|
||||
rules: {
|
||||
'@alfresco/eslint-angular/no-angular-material-selectors': 'error',
|
||||
'@angular-eslint/component-class-suffix': 'off'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/*.json'],
|
||||
languageOptions: {
|
||||
parser: jsonParser
|
||||
},
|
||||
rules: {
|
||||
'comma-dangle': ['error', 'never']
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/*.stories.ts'],
|
||||
rules: {
|
||||
'@cspell/spellchecker': 'off'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/*.mjs'],
|
||||
rules: {
|
||||
'unicorn/no-null': 'off'
|
||||
},
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
parserOptions: {
|
||||
tsconfigRootDir: __dirname,
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module'
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
@@ -1,4 +0,0 @@
|
||||
// eslint-disable
|
||||
const nxPreset = require('@nx/jest/preset').default;
|
||||
|
||||
module.exports = {...nxPreset };
|
||||
@@ -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',
|
||||
}
|
||||
}
|
||||
];
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@alfresco/adf-cli",
|
||||
"description": "Alfresco ADF cli and utils",
|
||||
"version": "9.0.0",
|
||||
"version": "9.1.0",
|
||||
"author": "Hyland Software, Inc. and its affiliates",
|
||||
"bin": {
|
||||
"adf-cli": "bin/adf-cli",
|
||||
@@ -17,14 +17,12 @@
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json",
|
||||
"develop": "tsc -p tsconfig.json --watch",
|
||||
"dist": "rm -rf ../../dist/libs/cli && npm run build && cp -R ./bin ../../dist/libs/cli && cp -R ./resources ../../dist/libs/cli && cp -R ./templates ../../dist/libs/cli && cp ./package.json ../../dist/libs/cli",
|
||||
"dist": "rm -rf ../../dist/libs/cli && npm run build && cp -R ./bin ../../dist/libs/cli && cp -R ./resources ../../dist/libs/cli && cp ./package.json ../../dist/libs/cli",
|
||||
"link": "npm run dist && cd ../../dist/libs/cli && npm link",
|
||||
"unlink": "cd ../../dist/libs/cli && npm unlink"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alfresco/js-api": ">=9.5.0",
|
||||
"ejs": "^3.1.10",
|
||||
"node-fetch": "^2.7.0",
|
||||
"@alfresco/js-api": ">=10.0.0",
|
||||
"spdx-license-list": "^5.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
@@ -32,7 +30,6 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@types/ejs": "^3.1.2",
|
||||
"@types/node": "^20.1.7",
|
||||
"typescript": "^4.9.5"
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"sourceRoot": "lib/cli",
|
||||
"projectType": "library",
|
||||
"prefix": "adf",
|
||||
"tags": ["scope:cli", "type:tooling"],
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "nx:run-commands",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
+57
-33
@@ -2,7 +2,7 @@
|
||||
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -18,17 +18,64 @@
|
||||
*/
|
||||
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import * as ejs from 'ejs';
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs';
|
||||
import { argv, exit } from 'node:process';
|
||||
import { parseArgs } from 'node:util';
|
||||
import { escapeHtml } from './utils';
|
||||
|
||||
interface AuditCommandArgs {
|
||||
package?: string;
|
||||
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) {
|
||||
for (const key in jsonAudit.vulnerabilities) {
|
||||
const v = jsonAudit.vulnerabilities[key];
|
||||
rows.push(`|${escapeHtml(v.severity)} | ${escapeHtml(v.name)} | ${JSON.stringify(v.range)} |`);
|
||||
}
|
||||
} else {
|
||||
for (const key in jsonAudit.advisories) {
|
||||
const a = jsonAudit.advisories[key];
|
||||
rows.push(`|${escapeHtml(a.severity)} | ${escapeHtml(a.module_name)} | ${JSON.stringify(a.vulnerable_versions)} |`);
|
||||
}
|
||||
}
|
||||
|
||||
return `---
|
||||
Title: Audit info, ${escapeHtml(projName)} ${escapeHtml(projVersion)}
|
||||
---
|
||||
|
||||
# Audit information for ${escapeHtml(projName)} ${escapeHtml(projVersion)}
|
||||
|
||||
This page lists the security audit of the dependencies this project depends on.
|
||||
|
||||
## Risks
|
||||
|
||||
- Critical risk: ${jsonAudit.metadata.vulnerabilities.critical}
|
||||
- High risk: ${jsonAudit.metadata.vulnerabilities.high}
|
||||
- Moderate risk: ${jsonAudit.metadata.vulnerabilities.moderate}
|
||||
- Low risk: ${jsonAudit.metadata.vulnerabilities.low}
|
||||
|
||||
Dependencies analyzed: ${jsonAudit.metadata.totalDependencies}
|
||||
|
||||
## Libraries
|
||||
|
||||
| Severity | Module | Vulnerable versions |
|
||||
| --- | --- | --- |
|
||||
${rows.join('\n')}
|
||||
`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Audit report command
|
||||
*
|
||||
@@ -82,14 +129,7 @@ Options:
|
||||
exit(1);
|
||||
}
|
||||
|
||||
const templatePath = path.resolve(__dirname, '../templates/auditPage.ejs');
|
||||
if (!fs.existsSync(templatePath)) {
|
||||
console.error(`Cannot find the report template: ${templatePath}`);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
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());
|
||||
@@ -98,8 +138,8 @@ Options:
|
||||
const packageDir = path.dirname(packagePath);
|
||||
|
||||
// Use spawnSync with array arguments for safer command execution (prevents shell injection)
|
||||
// Cross-platform: npm is available on PATH on all platforms (Windows, macOS, Linux)
|
||||
const result = spawnSync('npm', ['audit', '--json', '--prod'], {
|
||||
// Cross-platform: pnpm is available on PATH on all platforms (Windows, macOS, Linux)
|
||||
const result = spawnSync('pnpm', ['audit', '--json', '--prod'], {
|
||||
cwd: packageDir,
|
||||
encoding: 'utf-8',
|
||||
// shell: false is the default and more secure (no shell interpretation)
|
||||
@@ -133,29 +173,13 @@ Options:
|
||||
return;
|
||||
}
|
||||
|
||||
ejs.renderFile(
|
||||
templatePath,
|
||||
{
|
||||
jsonAudit,
|
||||
projVersion: packageJson.version,
|
||||
projName: packageJson.name
|
||||
},
|
||||
{},
|
||||
(err: any, mdText: string) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
reject(err);
|
||||
} else {
|
||||
const outputPath = path.resolve(options.outDir || workingDir);
|
||||
const outputFile = path.join(outputPath, `audit-info-${packageJson.version}.md`);
|
||||
const mdText = renderAuditPage(jsonAudit, packageJson.name, packageJson.version);
|
||||
const outputPath = path.resolve(options.outDir || workingDir);
|
||||
const outputFile = path.join(outputPath, `audit-info-${packageJson.version}.md`);
|
||||
|
||||
fs.writeFileSync(outputFile, mdText);
|
||||
fs.writeFileSync(outputFile, mdText);
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Report saved as ${outputFile}`);
|
||||
resolve(0);
|
||||
}
|
||||
}
|
||||
);
|
||||
console.log(`Report saved as ${outputFile}`);
|
||||
resolve(0);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -17,15 +17,13 @@
|
||||
* 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';
|
||||
import * as path from 'path';
|
||||
import { logger } from './logger';
|
||||
import * as fs from 'fs';
|
||||
import * as ejs from 'ejs';
|
||||
import { escapeHtml } from './utils';
|
||||
|
||||
interface Commit {
|
||||
hash: string;
|
||||
@@ -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,57 @@ 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 `---
|
||||
Title: Changelog for ${escapeHtml(projName)} v${escapeHtml(projVersion)}
|
||||
---
|
||||
|
||||
# Changelog
|
||||
|
||||
${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>`)
|
||||
.join('\n');
|
||||
return `<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Changelog for ${escapeHtml(projName)} v${escapeHtml(projVersion)}</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Changelog</h1>
|
||||
<ul>
|
||||
${items}
|
||||
</ul>
|
||||
</body>
|
||||
</html>`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Changelog command
|
||||
*
|
||||
@@ -265,42 +314,23 @@ Options:
|
||||
exit(1);
|
||||
}
|
||||
|
||||
const templatePath = path.resolve(__dirname, `../templates/changelog-${format}.ejs`);
|
||||
if (!fs.existsSync(templatePath)) {
|
||||
console.error(`Cannot find the report template: ${templatePath}`);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise((resolve) => {
|
||||
const packageJson = JSON.parse(fs.readFileSync(packagePath).toString());
|
||||
|
||||
ejs.renderFile(
|
||||
templatePath,
|
||||
{
|
||||
remote,
|
||||
repo_url,
|
||||
commits,
|
||||
projVersion: packageJson.version,
|
||||
projName: packageJson.name
|
||||
},
|
||||
{},
|
||||
(err: any, text: string) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
reject(err);
|
||||
} else {
|
||||
if (output) {
|
||||
const outputDir = path.resolve(output);
|
||||
const outputFile = path.join(outputDir, `changelog-${packageJson.version}.${format}`);
|
||||
console.log('Writing changelog to', outputFile);
|
||||
const text =
|
||||
format === 'html'
|
||||
? renderChangelogHtml(commits, packageJson.name, packageJson.version, repo_url)
|
||||
: renderChangelogMd(commits, packageJson.name, packageJson.version, repo_url);
|
||||
|
||||
fs.writeFileSync(outputFile, text);
|
||||
} else {
|
||||
console.log(text);
|
||||
}
|
||||
resolve(0);
|
||||
}
|
||||
}
|
||||
);
|
||||
if (output) {
|
||||
const outputDir = path.resolve(output);
|
||||
const outputFile = path.join(outputDir, `changelog-${packageJson.version}.${format}`);
|
||||
console.log('Writing changelog to', outputFile);
|
||||
|
||||
fs.writeFileSync(outputFile, text);
|
||||
} else {
|
||||
console.log(text);
|
||||
}
|
||||
resolve(0);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -18,8 +18,9 @@
|
||||
*/
|
||||
|
||||
import { parseArgs } from 'node:util';
|
||||
import fetch from 'node-fetch';
|
||||
import * as fs from 'fs';
|
||||
import { Readable } from 'node:stream';
|
||||
import type { ReadableStream } from 'node:stream/web';
|
||||
import { logger } from './logger';
|
||||
import { AlfrescoApi, AlfrescoApiConfig } from '@alfresco/js-api';
|
||||
import { argv, exit } from 'node:process';
|
||||
@@ -89,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`;
|
||||
@@ -235,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`;
|
||||
@@ -306,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);
|
||||
@@ -584,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 `);
|
||||
@@ -605,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);
|
||||
@@ -666,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)
|
||||
@@ -682,14 +689,18 @@ async function getFileFromRemote(url: string, name: string): Promise<void> {
|
||||
.then(
|
||||
(response) =>
|
||||
new Promise<void>((resolve, reject) => {
|
||||
if (!response.body) {
|
||||
reject(new Error('Response body is empty'));
|
||||
return;
|
||||
}
|
||||
const outputFile = fs.createWriteStream(`${name}.zip`);
|
||||
response.body.pipe(outputFile);
|
||||
Readable.fromWeb(response.body as ReadableStream<Uint8Array>).pipe(outputFile);
|
||||
outputFile.on('finish', () => {
|
||||
logger.info(`The file is finished downloading.`);
|
||||
resolve();
|
||||
});
|
||||
outputFile.on('error', (error) => {
|
||||
logger.error(`Not possible to download the project form remote`);
|
||||
logger.error(`Not possible to download the project from remote: ${error.message}`);
|
||||
reject(error);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
+49
-31
@@ -2,7 +2,7 @@
|
||||
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -22,7 +22,7 @@ import { parseArgs } from 'node:util';
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs';
|
||||
import * as licenseList from 'spdx-license-list';
|
||||
import * as ejs from 'ejs';
|
||||
import { escapeHtml } from './utils';
|
||||
|
||||
const { collectProductionLicenses } = require('../resources/license-collector.cjs');
|
||||
|
||||
@@ -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,40 @@ 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('@');
|
||||
const name = packageName.substring(0, lastAtSignPos);
|
||||
const version = packageName.substring(lastAtSignPos + 1);
|
||||
const licenses = escapeHtml(pack.licenseExp || 'N/A');
|
||||
const linkedName = pack.repository ? `[${escapeHtml(name)}](${pack.repository})` : escapeHtml(name);
|
||||
return `| ${linkedName} | ${escapeHtml(version)} | ${licenses} |`;
|
||||
});
|
||||
|
||||
return `---
|
||||
Title: License info, ${escapeHtml(projName)} ${escapeHtml(projVersion)}
|
||||
---
|
||||
|
||||
# License information for ${escapeHtml(projName)} ${escapeHtml(projVersion)}
|
||||
|
||||
This page lists all third party libraries the project depends on.
|
||||
|
||||
## Libraries
|
||||
|
||||
| Name | Version | License |
|
||||
| --- | --- | --- |
|
||||
${rows.join('\n')}
|
||||
`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Licenses command
|
||||
*
|
||||
@@ -165,14 +205,7 @@ Options:
|
||||
exit(1);
|
||||
}
|
||||
|
||||
const templatePath = path.resolve(__dirname, '../templates/licensePage.ejs');
|
||||
if (!fs.existsSync(templatePath)) {
|
||||
console.error(`Cannot find the report template: ${templatePath}`);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.info(`Checking ${packagePath}`);
|
||||
const licenseScan = collectProductionLicenses(packagePath, {
|
||||
denyList: ['GPL'],
|
||||
@@ -198,28 +231,13 @@ Options:
|
||||
|
||||
const packageJson: PackageInfo = getPackageFile(packagePath);
|
||||
|
||||
ejs.renderFile(
|
||||
templatePath,
|
||||
{
|
||||
filteredPackages,
|
||||
projVersion: packageJson.version,
|
||||
projName: packageJson.name
|
||||
},
|
||||
{},
|
||||
(ejsError: unknown, mdText: string) => {
|
||||
if (ejsError) {
|
||||
console.error(ejsError);
|
||||
reject(ejsError);
|
||||
} else {
|
||||
const outputPath = path.resolve(options.outDir || workingDir);
|
||||
const outputFile = path.join(outputPath, `license-info-${packageJson.version}.md`);
|
||||
const mdText = renderLicensePage(filteredPackages, packageJson.name, packageJson.version);
|
||||
const outputPath = path.resolve(options.outDir || workingDir);
|
||||
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);
|
||||
}
|
||||
}
|
||||
);
|
||||
fs.writeFileSync(outputFile, mdText);
|
||||
|
||||
console.log(`Report saved as ${outputFile}`);
|
||||
resolve(0);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -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 */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -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);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
/* cSpell:disable */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
|
||||
export const ACTIVITI_CLOUD_APPS: any = {
|
||||
SIMPLE_APP: {
|
||||
|
||||
+9
-5
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -15,8 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export interface SearchAiInputState {
|
||||
active: boolean;
|
||||
selectedAgentId?: string;
|
||||
searchTerm?: string;
|
||||
/**
|
||||
* 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, ''');
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
---
|
||||
Title: Audit info, <%= projName %> <%= projVersion %>
|
||||
---
|
||||
|
||||
# Audit information for <%= projName %> <%= projVersion %>
|
||||
|
||||
This page lists the security audit of the dependencies this project depends on.
|
||||
|
||||
## Risks
|
||||
|
||||
- Critical risk: <%= jsonAudit.metadata.vulnerabilities.critical %>
|
||||
- High risk: <%= jsonAudit.metadata.vulnerabilities.high %>
|
||||
- Moderate risk: <%= jsonAudit.metadata.vulnerabilities.moderate %>
|
||||
- Low risk: <%= jsonAudit.metadata.vulnerabilities.low %>
|
||||
|
||||
Dependencies analyzed: <%= jsonAudit.metadata.totalDependencies %>
|
||||
|
||||
## Libraries
|
||||
|
||||
| Severity | Module | Vulnerable versions |
|
||||
| --- | --- | --- |
|
||||
<% if(jsonAudit.auditReportVersion >= 2) {
|
||||
for(var currentVulnerabilities in jsonAudit.vulnerabilities) {
|
||||
severity = jsonAudit.vulnerabilities[currentVulnerabilities].severity;
|
||||
vulnerable_versions = JSON.stringify(jsonAudit.vulnerabilities[currentVulnerabilities].range);
|
||||
module = jsonAudit.vulnerabilities[currentVulnerabilities].name;
|
||||
-%>
|
||||
|<%= severity %> | <%= module %> | <%= vulnerable_versions %> |
|
||||
<% } %>
|
||||
<% } else {
|
||||
for(var currentAdvisories in jsonAudit.advisories) {
|
||||
severity = jsonAudit.advisories[currentAdvisories].severity;
|
||||
vulnerable_versions = JSON.stringify(jsonAudit.advisories[currentAdvisories].vulnerable_versions);
|
||||
module = jsonAudit.advisories[currentAdvisories].module_name;
|
||||
-%>
|
||||
|<%= severity %> | <%= module %> | <%= vulnerable_versions %> |
|
||||
<% } %>
|
||||
<% } %>
|
||||
@@ -1,21 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Changelog for <%= projName %> v<%= projVersion %></title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Changelog</h1>
|
||||
<ul>
|
||||
<% for(var idx in commits) {
|
||||
commit = commits[idx];
|
||||
-%>
|
||||
<li>
|
||||
<a href="<%= repo_url %>/commit/<%= commit.hash %>">[<%= commit.hash %>]</a> <%= commit.subject %>
|
||||
</li>
|
||||
<% } %>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
Title: Changelog for <%= projName %> v<%= projVersion %>
|
||||
---
|
||||
|
||||
# Changelog
|
||||
|
||||
<% for(var idx in commits) {
|
||||
commit = commits[idx];
|
||||
-%>
|
||||
- [<%= commit.hash %>](<%= repo_url %>/commit/<%= commit.hash %>) <%= commit.subject %>
|
||||
<% } %>
|
||||
@@ -1,28 +0,0 @@
|
||||
---
|
||||
Title: License info, <%= projName %> <%= projVersion %>
|
||||
---
|
||||
|
||||
# License information for <%= projName %> <%= projVersion %>
|
||||
|
||||
This page lists all third party libraries the project depends on.
|
||||
|
||||
## Libraries
|
||||
|
||||
| Name | Version | License |
|
||||
| --- | --- | --- |
|
||||
<% for (var packageName in filteredPackages) {
|
||||
var lastAtSignPos = packageName.lastIndexOf('@');
|
||||
|
||||
var name = packageName.substring(0, lastAtSignPos);
|
||||
var version = packageName.substring(lastAtSignPos + 1);
|
||||
var pack = filteredPackages[packageName];
|
||||
var licenses = pack['licenseExp'] || 'N/A';
|
||||
var repo = pack['repository'];
|
||||
var linkedName = name;
|
||||
|
||||
if (repo) {
|
||||
linkedName = `[${name}](${repo})`
|
||||
}
|
||||
-%>
|
||||
| <%= linkedName %> | <%= version %> | <%= licenses %> |
|
||||
<% } %>
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -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);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
coverage
|
||||
@@ -1,103 +0,0 @@
|
||||
{
|
||||
"extends": ["../../.eslintrc.js"],
|
||||
"ignorePatterns": ["!**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"extends": ["plugin:@nx/angular"],
|
||||
"parserOptions": {
|
||||
"project": [
|
||||
"lib/content-services/tsconfig.lib.json",
|
||||
"lib/content-services/tsconfig.spec.json",
|
||||
"lib/content-services/.storybook/tsconfig.json"
|
||||
],
|
||||
"createDefaultProgram": true
|
||||
},
|
||||
"rules": {
|
||||
"jsdoc/tag-lines": [
|
||||
"error",
|
||||
"any",
|
||||
{
|
||||
"startLines": 1
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/naming-convention": "warn",
|
||||
"@typescript-eslint/consistent-type-assertions": "warn",
|
||||
"@typescript-eslint/prefer-for-of": "warn",
|
||||
"@typescript-eslint/member-ordering": "off",
|
||||
"no-underscore-dangle": [
|
||||
"error",
|
||||
{
|
||||
"allowAfterThis": true
|
||||
}
|
||||
],
|
||||
"no-shadow": "warn",
|
||||
"quote-props": "off",
|
||||
"object-shorthand": "warn",
|
||||
"prefer-const": "warn",
|
||||
"arrow-body-style": "warn",
|
||||
"@angular-eslint/no-output-native": "off",
|
||||
"space-before-function-paren": "off",
|
||||
"@angular-eslint/component-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": "element",
|
||||
"prefix": ["adf", "app"],
|
||||
"style": "kebab-case"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/directive-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": ["element", "attribute"],
|
||||
"prefix": ["adf", "app"],
|
||||
"style": "kebab-case"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/no-input-prefix": "error",
|
||||
"@typescript-eslint/consistent-type-definitions": "error",
|
||||
"@typescript-eslint/dot-notation": "off",
|
||||
"@typescript-eslint/explicit-member-accessibility": [
|
||||
"off",
|
||||
{
|
||||
"accessibility": "explicit"
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/no-inferrable-types": "off",
|
||||
"@typescript-eslint/no-require-imports": "off",
|
||||
"@typescript-eslint/no-var-requires": "error",
|
||||
"comma-dangle": "error",
|
||||
"default-case": "error",
|
||||
"import/order": "off",
|
||||
"max-len": [
|
||||
"error",
|
||||
{
|
||||
"code": 240
|
||||
}
|
||||
],
|
||||
"no-bitwise": "off",
|
||||
"no-duplicate-imports": "error",
|
||||
"no-multiple-empty-lines": "error",
|
||||
"no-return-await": "error",
|
||||
"rxjs/no-create": "error",
|
||||
"rxjs/no-subject-unsubscribe": "error",
|
||||
"rxjs/no-subject-value": "error",
|
||||
"rxjs/no-unsafe-takeuntil": "error",
|
||||
"unicorn/filename-case": "error",
|
||||
"@angular-eslint/prefer-standalone": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"parserOptions": {
|
||||
"project": ["lib/content-services/tsconfig.lib.json", "lib/content-services/tsconfig.spec.json"],
|
||||
"createDefaultProgram": true
|
||||
},
|
||||
"extends": ["plugin:@nx/angular-template"],
|
||||
"rules": {
|
||||
"@angular-eslint/template/no-autofocus": "error",
|
||||
"@angular-eslint/template/no-positive-tabindex": "error"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @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 { fileURLToPath } from 'node:url';
|
||||
import { dirname } from 'node:path';
|
||||
import type { StorybookConfig } from '@storybook/angular';
|
||||
@@ -21,6 +38,12 @@ const config: StorybookConfig = {
|
||||
|
||||
export default config;
|
||||
|
||||
/**
|
||||
* Resolve absolute path for a package.
|
||||
*
|
||||
* @param value package name
|
||||
* @returns absolute path to the package
|
||||
*/
|
||||
function getAbsolutePath(value: string): any {
|
||||
return dirname(fileURLToPath(import.meta.resolve(`${value}/package.json`)));
|
||||
}
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
/*!
|
||||
* @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 type { Preview } from '@storybook/angular';
|
||||
|
||||
const preview: Preview = {
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
/*!
|
||||
* @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:content-services',
|
||||
onlyDependOnLibsWithTags: ['scope:js-api', 'scope:core', 'scope:extensions']
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/consistent-type-assertions': 'warn',
|
||||
'@typescript-eslint/prefer-for-of': 'warn',
|
||||
'no-underscore-dangle': [
|
||||
'error',
|
||||
{
|
||||
allowAfterThis: true
|
||||
}
|
||||
],
|
||||
'no-shadow': 'warn',
|
||||
'quote-props': 'off',
|
||||
'object-shorthand': 'warn',
|
||||
'prefer-const': 'warn',
|
||||
'arrow-body-style': 'warn',
|
||||
'space-before-function-paren': 'off',
|
||||
'@angular-eslint/prefer-standalone': 'off'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['lib/content-services/**/*.html'],
|
||||
rules: {
|
||||
'@angular-eslint/template/no-autofocus': 'error',
|
||||
'@angular-eslint/template/no-positive-tabindex': 'error'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/.storybook/**/*.ts'],
|
||||
rules: {
|
||||
'@nx/enforce-module-boundaries': 'off'
|
||||
}
|
||||
}
|
||||
];
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
@@ -29,7 +29,7 @@ module.exports = function (config) {
|
||||
{ pattern: 'lib/config/app.config.json', included: false, served: true, watched: false }
|
||||
],
|
||||
|
||||
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
||||
frameworks: ['jasmine'],
|
||||
|
||||
proxies: {
|
||||
'/assets/images/': '/base/lib/core/src/lib/assets/images/',
|
||||
@@ -41,13 +41,7 @@ module.exports = function (config) {
|
||||
'/app.config.json': '/base/lib/config/app.config.json'
|
||||
},
|
||||
|
||||
plugins: [
|
||||
require('karma-jasmine'),
|
||||
require('karma-chrome-launcher'),
|
||||
require('karma-jasmine-html-reporter'),
|
||||
require('karma-coverage'),
|
||||
require('@angular-devkit/build-angular/plugins/karma')
|
||||
],
|
||||
plugins: [require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage')],
|
||||
client: {
|
||||
clearContext: false,
|
||||
jasmine: {
|
||||
@@ -84,7 +78,6 @@ module.exports = function (config) {
|
||||
port: 9876,
|
||||
colors: true,
|
||||
logLevel: constants.LOG_INFO,
|
||||
autoWatch: true,
|
||||
browsers: ['ChromeHeadless'],
|
||||
singleRun: true
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@alfresco/adf-content-services",
|
||||
"description": "Alfresco ADF content services",
|
||||
"version": "9.0.0",
|
||||
"version": "9.1.0",
|
||||
"author": "Hyland Software, Inc. and its affiliates",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -11,19 +11,18 @@
|
||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/animations": ">=14.1.3",
|
||||
"@angular/cdk": ">=14.1.2",
|
||||
"@angular/common": ">=14.1.3",
|
||||
"@angular/compiler": ">=14.1.3",
|
||||
"@angular/core": ">=14.1.3",
|
||||
"@angular/forms": ">=14.1.3",
|
||||
"@angular/material": ">=14.1.2",
|
||||
"@angular/platform-browser": ">=14.1.3",
|
||||
"@angular/platform-browser-dynamic": ">=14.1.3",
|
||||
"@angular/router": ">=14.1.3",
|
||||
"@alfresco/js-api": ">=9.5.0",
|
||||
"@angular/cdk": ">=20.2.14",
|
||||
"@angular/common": ">=20.3.25",
|
||||
"@angular/compiler": ">=20.3.25",
|
||||
"@angular/core": ">=20.3.25",
|
||||
"@angular/forms": ">=20.3.25",
|
||||
"@angular/material": ">=20.2.14",
|
||||
"@angular/platform-browser": ">=20.3.25",
|
||||
"@angular/platform-browser-dynamic": ">=20.3.25",
|
||||
"@angular/router": ">=20.3.25",
|
||||
"@alfresco/js-api": ">=10.0.0",
|
||||
"@ngx-translate/core": ">=17.0.0",
|
||||
"@alfresco/adf-core": ">=8.5.0"
|
||||
"@alfresco/adf-core": ">=9.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"content-services",
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
"sourceRoot": "lib/content-services/src",
|
||||
"projectType": "library",
|
||||
"prefix": "adf",
|
||||
"tags": ["scope:content-services", "type:library"],
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@angular-devkit/build-angular:ng-packagr",
|
||||
"executor": "@angular/build:ng-packagr",
|
||||
"options": {
|
||||
"tsConfig": "lib/content-services/tsconfig.lib.json",
|
||||
"project": "lib/content-services/ng-package.json"
|
||||
@@ -20,11 +21,12 @@
|
||||
"defaultConfiguration": "production"
|
||||
},
|
||||
"test": {
|
||||
"executor": "@angular-devkit/build-angular:karma",
|
||||
"executor": "@angular/build:karma",
|
||||
"options": {
|
||||
"main": "lib/content-services/src/test.ts",
|
||||
"tsConfig": "lib/content-services/tsconfig.spec.json",
|
||||
"karmaConfig": "lib/content-services/karma.conf.js",
|
||||
"watch": false,
|
||||
"sourceMap": true,
|
||||
"codeCoverage": true,
|
||||
"stylePreprocessorOptions": {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
@mixin adf-error-icon {
|
||||
font-size: 16px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-right: 4px;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 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.
|
||||
*/
|
||||
|
||||
export * from './public-api';
|
||||
@@ -1,18 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 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.
|
||||
*/
|
||||
|
||||
export * from './services/agent.service';
|
||||
@@ -1,67 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 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 { TestBed } from '@angular/core/testing';
|
||||
import { AgentService } from './agent.service';
|
||||
import { Agent, AgentPaging } from '@alfresco/js-api';
|
||||
|
||||
const agent1: Agent = {
|
||||
id: '1',
|
||||
name: 'HR Agent',
|
||||
description: 'Your Claims Doc Agent streamlines the extraction, analysis, and management of data from insurance claims documents.',
|
||||
avatarUrl: ''
|
||||
};
|
||||
|
||||
const agent2: Agent = {
|
||||
id: '2',
|
||||
name: 'Policy Agent',
|
||||
description: 'Your Claims Doc Agent streamlines the extraction, analysis, and management of data from insurance claims documents.',
|
||||
avatarUrl: ''
|
||||
};
|
||||
|
||||
const agentPagingObjectMock: AgentPaging = {
|
||||
list: {
|
||||
entries: [
|
||||
{
|
||||
entry: agent1
|
||||
},
|
||||
{
|
||||
entry: agent2
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
const agentListMock: Agent[] = [agent1, agent2];
|
||||
|
||||
describe('AgentService', () => {
|
||||
let agentService: AgentService;
|
||||
|
||||
beforeEach(() => {
|
||||
agentService = TestBed.inject(AgentService);
|
||||
});
|
||||
|
||||
it('should load agents', (done) => {
|
||||
spyOn(agentService.agentsApi, 'getAgents').and.returnValue(Promise.resolve(agentPagingObjectMock));
|
||||
|
||||
agentService.getAgents().subscribe((pagingResponse) => {
|
||||
expect(pagingResponse).toEqual(agentListMock);
|
||||
expect(agentService.agentsApi.getAgents).toHaveBeenCalled();
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,58 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 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 { Injectable, inject } from '@angular/core';
|
||||
import { Agent, AgentsApi, LazyApi } from '@alfresco/js-api';
|
||||
import { BehaviorSubject, from, Observable, of } from 'rxjs';
|
||||
import { map, switchMap } from 'rxjs/operators';
|
||||
import { AlfrescoApiService } from '../../services';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AgentService {
|
||||
private readonly apiService = inject(AlfrescoApiService);
|
||||
|
||||
private readonly agents = new BehaviorSubject<Agent[]>([]);
|
||||
|
||||
@LazyApi((self: AgentService) => new AgentsApi(self.apiService.getInstance()))
|
||||
declare readonly agentsApi: AgentsApi;
|
||||
|
||||
agents$ = this.agents.asObservable();
|
||||
|
||||
/**
|
||||
* Gets all agents from cache. If cache is empty, fetches agents from backend.
|
||||
*
|
||||
* @returns Agent[] list containing agents.
|
||||
*/
|
||||
getAgents(): Observable<Agent[]> {
|
||||
return this.agents$.pipe(
|
||||
switchMap((agentsList) => {
|
||||
if (agentsList.length) {
|
||||
return of(agentsList);
|
||||
}
|
||||
return from(this.agentsApi.getAgents()).pipe(
|
||||
map((paging) => {
|
||||
const agentEntries = paging.list.entries.map((agentEntry) => agentEntry.entry);
|
||||
this.agents.next(agentEntries);
|
||||
return agentEntries;
|
||||
})
|
||||
);
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -20,7 +20,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { AspectListDialogComponent } from './aspect-list-dialog.component';
|
||||
import { of, Subject } from 'rxjs';
|
||||
import { AspectListDialogComponentData } from './aspect-list-dialog-data.interface';
|
||||
import { AspectListService } from './services/aspect-list.service';
|
||||
import { AspectListService, StandardAspectsWhere } from './services/aspect-list.service';
|
||||
import { delay } from 'rxjs/operators';
|
||||
import { AspectEntry, Node } from '@alfresco/js-api';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
@@ -144,8 +144,8 @@ describe('AspectListDialogComponent', () => {
|
||||
describe('Without passing node id', () => {
|
||||
beforeEach(() => {
|
||||
aspectListService = TestBed.inject(AspectListService);
|
||||
spyOn(aspectListService, 'getAllAspects').and.returnValue(
|
||||
of({ standardAspectPaging: { list: { entries: aspectListMock } }, customAspectPaging: { list: { entries: customAspectListMock } } })
|
||||
spyOn(aspectListService, 'getAspects').and.callFake((_visibleAspects, opts) =>
|
||||
of({ list: { entries: opts.where === StandardAspectsWhere ? aspectListMock : customAspectListMock } })
|
||||
);
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@@ -251,11 +251,10 @@ describe('AspectListDialogComponent', () => {
|
||||
data.nodeId = 'fake-node-id';
|
||||
aspectListService = TestBed.inject(AspectListService);
|
||||
nodeService = TestBed.inject(NodesApiService);
|
||||
spyOn(aspectListService, 'getAllAspects').and.returnValue(
|
||||
of({ standardAspectPaging: { list: { entries: aspectListMock } }, customAspectPaging: { list: { entries: customAspectListMock } } })
|
||||
);
|
||||
spyOn(aspectListService, 'getVisibleAspects').and.returnValue(['frs:AspectOne']);
|
||||
spyOn(aspectListService, 'getAspects').and.returnValue(of({ list: { entries: customAspectListMock } }));
|
||||
spyOn(aspectListService, 'getAspects').and.callFake((_visibleAspects, opts) =>
|
||||
of({ list: { entries: opts.where === StandardAspectsWhere ? aspectListMock : customAspectListMock } })
|
||||
);
|
||||
spyOn(nodeService, 'getNode').and.returnValue(
|
||||
of(new Node({ id: 'fake-node-id', aspectNames: ['frs:AspectOne', 'cst:customAspect'] })).pipe(delay(0))
|
||||
);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -19,15 +19,14 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
import { AspectListComponent } from './aspect-list.component';
|
||||
import { AspectListService, CustomAspectsWhere, StandardAspectsWhere } from './services/aspect-list.service';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
import { AspectEntry, Pagination } from '@alfresco/js-api';
|
||||
import { NEVER, of } from 'rxjs';
|
||||
import { AspectEntry } from '@alfresco/js-api';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||
import { MatExpansionPanelHarness } from '@angular/material/expansion/testing';
|
||||
import { MatTableHarness } from '@angular/material/table/testing';
|
||||
import { MatCheckboxHarness } from '@angular/material/checkbox/testing';
|
||||
import { MatProgressSpinnerHarness } from '@angular/material/progress-spinner/testing';
|
||||
import { CustomAspectPaging } from './interfaces/custom-aspect-paging.interface';
|
||||
import { provideApiTesting } from '../testing/providers';
|
||||
|
||||
const aspectListMock: AspectEntry[] = [
|
||||
@@ -111,11 +110,6 @@ const customAspectListMock: AspectEntry[] = [
|
||||
}
|
||||
];
|
||||
|
||||
const allAspectsMock: CustomAspectPaging = {
|
||||
standardAspectPaging: { list: { entries: aspectListMock } },
|
||||
customAspectPaging: { list: { entries: customAspectListMock } }
|
||||
};
|
||||
|
||||
describe('AspectListComponent', () => {
|
||||
let loader: HarnessLoader;
|
||||
let component: AspectListComponent;
|
||||
@@ -138,8 +132,8 @@ describe('AspectListComponent', () => {
|
||||
|
||||
describe('Loading', () => {
|
||||
it('should show the loading spinner when result is loading', async () => {
|
||||
spyOn(nodeService, 'getNode').and.returnValue(EMPTY);
|
||||
spyOn(aspectListService, 'getAspects').and.returnValue(EMPTY);
|
||||
spyOn(nodeService, 'getNode').and.returnValue(NEVER);
|
||||
spyOn(aspectListService, 'getAspects').and.returnValue(NEVER);
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(await loader.hasHarness(MatProgressSpinnerHarness)).toBe(true);
|
||||
@@ -148,8 +142,9 @@ describe('AspectListComponent', () => {
|
||||
|
||||
describe('When passing a node id', () => {
|
||||
beforeEach(() => {
|
||||
spyOn(aspectListService, 'getAllAspects').and.returnValue(of(allAspectsMock));
|
||||
spyOn(aspectListService, 'getAspects').and.returnValue(of({ list: { entries: customAspectListMock } }));
|
||||
spyOn(aspectListService, 'getAspects').and.callFake((_visibleAspects, opts) =>
|
||||
of({ list: { entries: opts.where === StandardAspectsWhere ? aspectListMock : customAspectListMock } })
|
||||
);
|
||||
spyOn(aspectListService, 'getVisibleAspects').and.returnValue(['frs:AspectOne']);
|
||||
spyOn(nodeService, 'getNode').and.returnValue(of({ id: 'fake-node-id', aspectNames: ['frs:AspectOne', 'stored:aspect'] } as any));
|
||||
component.nodeId = 'fake-node-id';
|
||||
@@ -252,10 +247,18 @@ describe('AspectListComponent', () => {
|
||||
});
|
||||
|
||||
it('should load aspects with 0 skip count as pagination by default', () => {
|
||||
expect(aspectListService.getAllAspects).toHaveBeenCalledWith(
|
||||
{ where: StandardAspectsWhere, include: ['properties'], skipCount: 0, maxItems: 100 },
|
||||
{ where: CustomAspectsWhere, include: ['properties'], skipCount: 0, maxItems: 100 }
|
||||
);
|
||||
expect(aspectListService.getAspects).toHaveBeenCalledWith(jasmine.anything(), {
|
||||
where: StandardAspectsWhere,
|
||||
include: ['properties'],
|
||||
skipCount: 0,
|
||||
maxItems: 100
|
||||
});
|
||||
expect(aspectListService.getAspects).toHaveBeenCalledWith(jasmine.anything(), {
|
||||
where: CustomAspectsWhere,
|
||||
include: ['properties'],
|
||||
skipCount: 0,
|
||||
maxItems: 100
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -271,7 +274,9 @@ describe('AspectListComponent', () => {
|
||||
|
||||
describe('When no node id is passed', () => {
|
||||
beforeEach(() => {
|
||||
spyOn(aspectListService, 'getAllAspects').and.returnValue(of(allAspectsMock));
|
||||
spyOn(aspectListService, 'getAspects').and.callFake((_visibleAspects, opts) =>
|
||||
of({ list: { entries: opts.where === StandardAspectsWhere ? aspectListMock : customAspectListMock } })
|
||||
);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -294,35 +299,73 @@ describe('AspectListComponent', () => {
|
||||
|
||||
it('should load aspects with 0 skip count as pagination by default', () => {
|
||||
fixture.detectChanges();
|
||||
expect(aspectListService.getAllAspects).toHaveBeenCalledWith(
|
||||
{ where: StandardAspectsWhere, include: ['properties'], skipCount: 0, maxItems: 100 },
|
||||
{ where: CustomAspectsWhere, include: ['properties'], skipCount: 0, maxItems: 100 }
|
||||
);
|
||||
expect(aspectListService.getAspects).toHaveBeenCalledWith(jasmine.anything(), {
|
||||
where: StandardAspectsWhere,
|
||||
include: ['properties'],
|
||||
skipCount: 0,
|
||||
maxItems: 100
|
||||
});
|
||||
expect(aspectListService.getAspects).toHaveBeenCalledWith(jasmine.anything(), {
|
||||
where: CustomAspectsWhere,
|
||||
include: ['properties'],
|
||||
skipCount: 0,
|
||||
maxItems: 100
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should load next batch of aspects if not all items were returned by first call', (done) => {
|
||||
fixture.detectChanges();
|
||||
const moreItemsPagination: Pagination = { count: 2, hasMoreItems: true };
|
||||
const allAspectsWithMoreItems: CustomAspectPaging = {
|
||||
standardAspectPaging: { list: { entries: aspectListMock, pagination: moreItemsPagination } },
|
||||
customAspectPaging: { list: { entries: customAspectListMock, pagination: moreItemsPagination } }
|
||||
};
|
||||
const getAspectsSpy = spyOn(aspectListService, 'getAllAspects').and.returnValues(of(allAspectsWithMoreItems), of(allAspectsMock));
|
||||
spyOn(aspectListService, 'getAspects').and.returnValues(
|
||||
of({ list: { entries: aspectListMock } }),
|
||||
of({ list: { entries: customAspectListMock } })
|
||||
);
|
||||
it('should keep requesting a type until its hasMoreItems is false, without re-querying an exhausted type', (done) => {
|
||||
const getAspectsSpy = spyOn(aspectListService, 'getAspects').and.callFake((_visibleAspects, opts) => {
|
||||
if (opts.where === StandardAspectsWhere) {
|
||||
return opts.skipCount === 0
|
||||
? of({ list: { entries: aspectListMock, pagination: { count: 2, hasMoreItems: true } } })
|
||||
: of({ list: { entries: aspectListMock, pagination: { count: 2, hasMoreItems: false } } });
|
||||
}
|
||||
return of({ list: { entries: customAspectListMock, pagination: { count: 2, hasMoreItems: false } } });
|
||||
});
|
||||
component.ngOnInit();
|
||||
|
||||
component.aspects$.subscribe(() => {
|
||||
expect(getAspectsSpy.calls.argsFor(0)[0]).toEqual({ where: StandardAspectsWhere, include: ['properties'], skipCount: 0, maxItems: 100 });
|
||||
expect(getAspectsSpy.calls.argsFor(0)[1]).toEqual({ where: CustomAspectsWhere, include: ['properties'], skipCount: 0, maxItems: 100 });
|
||||
expect(getAspectsSpy.calls.argsFor(1)[0]).toEqual({ where: StandardAspectsWhere, include: ['properties'], skipCount: 2, maxItems: 100 });
|
||||
expect(getAspectsSpy.calls.argsFor(1)[1]).toEqual({ where: CustomAspectsWhere, include: ['properties'], skipCount: 2, maxItems: 100 });
|
||||
const standardCalls = getAspectsSpy.calls.allArgs().filter(([, opts]) => opts.where === StandardAspectsWhere);
|
||||
const customCalls = getAspectsSpy.calls.allArgs().filter(([, opts]) => opts.where === CustomAspectsWhere);
|
||||
expect(standardCalls.map(([, opts]) => opts.skipCount)).toEqual([0, 2]);
|
||||
expect(customCalls.map(([, opts]) => opts.skipCount)).toEqual([0]);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should page through all aspects (standard and custom) when categorising node aspects', (done) => {
|
||||
const standardPage1: AspectEntry[] = [{ entry: { id: 'std:first', title: 'First', properties: [] } }];
|
||||
const standardPage2: AspectEntry[] = [{ entry: { id: 'std:second', title: 'Second', properties: [] } }];
|
||||
spyOn(aspectListService, 'getVisibleAspects').and.returnValue([]);
|
||||
spyOn(nodeService, 'getNode').and.returnValue(of({ id: 'node-id', aspectNames: ['std:second'] } as any));
|
||||
const getAspectsSpy = spyOn(aspectListService, 'getAspects').and.callFake((_visibleAspects, opts) => {
|
||||
if (opts.where === StandardAspectsWhere) {
|
||||
return opts.skipCount === 0
|
||||
? of({ list: { entries: standardPage1, pagination: { count: 1, hasMoreItems: true } } })
|
||||
: of({ list: { entries: standardPage2, pagination: { count: 1, hasMoreItems: false } } });
|
||||
}
|
||||
return of({ list: { entries: [], pagination: { count: 0, hasMoreItems: false } } });
|
||||
});
|
||||
component.nodeId = 'node-id';
|
||||
component.ngOnInit();
|
||||
fixture.detectChanges();
|
||||
|
||||
component.aspects$.subscribe(() => {
|
||||
expect(getAspectsSpy).toHaveBeenCalledWith(jasmine.anything(), {
|
||||
where: StandardAspectsWhere,
|
||||
include: ['properties'],
|
||||
skipCount: 0,
|
||||
maxItems: 100
|
||||
});
|
||||
expect(getAspectsSpy).toHaveBeenCalledWith(jasmine.anything(), {
|
||||
where: StandardAspectsWhere,
|
||||
include: ['properties'],
|
||||
skipCount: 1,
|
||||
maxItems: 100
|
||||
});
|
||||
expect(component.nodeAspects).toContain('std:second');
|
||||
expect(component.notDisplayedAspects).not.toContain('std:second');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
* 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.
|
||||
@@ -17,11 +17,11 @@
|
||||
|
||||
import { Component, DestroyRef, EventEmitter, inject, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';
|
||||
import { NodesApiService } from '../common/services/nodes-api.service';
|
||||
import { EMPTY, Observable, zip } from 'rxjs';
|
||||
import { concatMap, expand, map, reduce, take, tap } from 'rxjs/operators';
|
||||
import { EMPTY, forkJoin, Observable } from 'rxjs';
|
||||
import { expand, map, reduce } from 'rxjs/operators';
|
||||
import { AspectListService, CustomAspectsWhere, StandardAspectsWhere } from './services/aspect-list.service';
|
||||
import { MatCheckboxChange, MatCheckboxModule } from '@angular/material/checkbox';
|
||||
import { AspectEntry, ContentPagingQuery, ListAspectsOpts } from '@alfresco/js-api';
|
||||
import { AspectEntry, ListAspectsOpts, Node } from '@alfresco/js-api';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatExpansionModule } from '@angular/material/expansion';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
@@ -66,46 +66,19 @@ export class AspectListComponent implements OnInit {
|
||||
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
|
||||
private customAspectsLoaded = 0;
|
||||
private standardAspectsLoaded = 0;
|
||||
private hasMoreAspects = false;
|
||||
|
||||
ngOnInit(): void {
|
||||
let aspects$: Observable<AspectEntry[]>;
|
||||
if (this.nodeId) {
|
||||
const node$ = this.nodeApiService.getNode(this.nodeId);
|
||||
const customAspect$ = this.aspectListService
|
||||
.getAspects(this.aspectListService.getVisibleAspects(), {
|
||||
where: CustomAspectsWhere,
|
||||
include: ['properties'],
|
||||
skipCount: 0,
|
||||
maxItems: 100
|
||||
})
|
||||
.pipe(map((customAspects) => customAspects?.list?.entries.flatMap((customAspect) => customAspect.entry.id)));
|
||||
aspects$ = zip(node$, customAspect$).pipe(
|
||||
tap(([node, customAspects]) => {
|
||||
this.nodeAspects = node.aspectNames.filter(
|
||||
(aspect) => this.aspectListService.getVisibleAspects().includes(aspect) || customAspects.includes(aspect)
|
||||
);
|
||||
this.nodeAspectStatus = [...this.nodeAspects];
|
||||
this.notDisplayedAspects = node.aspectNames.filter(
|
||||
(aspect) => !this.aspectListService.getVisibleAspects().includes(aspect) && !customAspects.includes(aspect)
|
||||
);
|
||||
this.valueChanged.emit([...this.nodeAspects, ...this.notDisplayedAspects]);
|
||||
this.updateCounter.emit(this.nodeAspects.length);
|
||||
}),
|
||||
concatMap(() => this.loadAspects({ skipCount: this.standardAspectsLoaded }, { skipCount: this.customAspectsLoaded })),
|
||||
takeUntilDestroyed(this.destroyRef)
|
||||
);
|
||||
} else {
|
||||
aspects$ = this.loadAspects({ skipCount: this.standardAspectsLoaded }, { skipCount: this.customAspectsLoaded });
|
||||
}
|
||||
this.aspects$ = aspects$.pipe(
|
||||
expand(() =>
|
||||
this.hasMoreAspects ? this.loadAspects({ skipCount: this.standardAspectsLoaded }, { skipCount: this.customAspectsLoaded }) : EMPTY
|
||||
),
|
||||
map((aspects) => aspects.filter((aspect) => !this.excludedAspects.includes(aspect.entry.id))),
|
||||
reduce((acc, aspects) => [...acc, ...aspects])
|
||||
const allAspects$ = this.loadAllAspects();
|
||||
const displayAspects$ = this.nodeId
|
||||
? forkJoin([this.nodeApiService.getNode(this.nodeId), allAspects$]).pipe(
|
||||
map(([node, allAspects]) => {
|
||||
this.categoriseNodeAspects(node, allAspects);
|
||||
return allAspects;
|
||||
})
|
||||
)
|
||||
: allAspects$;
|
||||
this.aspects$ = displayAspects$.pipe(
|
||||
map((aspects) => aspects.filter((aspect) => !(this.excludedAspects ?? []).includes(aspect.entry.id))),
|
||||
takeUntilDestroyed(this.destroyRef)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -158,32 +131,38 @@ export class AspectListComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
private loadAspects(standardAspectsPagination?: ContentPagingQuery, customAspectsPagination?: ContentPagingQuery): Observable<AspectEntry[]> {
|
||||
const standardAspectOpts: ListAspectsOpts = {
|
||||
where: StandardAspectsWhere,
|
||||
include: ['properties'],
|
||||
skipCount: standardAspectsPagination?.skipCount ?? 0,
|
||||
maxItems: 100
|
||||
};
|
||||
const customAspectOpts: ListAspectsOpts = {
|
||||
where: CustomAspectsWhere,
|
||||
include: ['properties'],
|
||||
skipCount: customAspectsPagination?.skipCount ?? 0,
|
||||
maxItems: 100
|
||||
};
|
||||
return this.aspectListService.getAllAspects(standardAspectOpts, customAspectOpts).pipe(
|
||||
take(1),
|
||||
tap((aspectsPaging) => {
|
||||
this.customAspectsLoaded += aspectsPaging.customAspectPaging?.list?.pagination?.count ?? 0;
|
||||
this.standardAspectsLoaded += aspectsPaging.standardAspectPaging?.list?.pagination?.count ?? 0;
|
||||
this.hasMoreAspects =
|
||||
aspectsPaging.customAspectPaging?.list?.pagination?.hasMoreItems ||
|
||||
aspectsPaging.standardAspectPaging?.list?.pagination?.hasMoreItems;
|
||||
}),
|
||||
map((aspectsPaging) => [
|
||||
...(aspectsPaging.standardAspectPaging?.list?.entries ?? []),
|
||||
...(aspectsPaging.customAspectPaging?.list?.entries ?? [])
|
||||
])
|
||||
private loadAllAspects(): Observable<AspectEntry[]> {
|
||||
return forkJoin([this.loadAllAspectsOfType(StandardAspectsWhere), this.loadAllAspectsOfType(CustomAspectsWhere)]).pipe(
|
||||
map(([standardAspects, customAspects]) => [...standardAspects, ...customAspects])
|
||||
);
|
||||
}
|
||||
|
||||
private loadAllAspectsOfType(where: string): Observable<AspectEntry[]> {
|
||||
const visibleAspects = this.aspectListService.getVisibleAspects();
|
||||
const fetchPage = (skipCount: number): Observable<{ entries: AspectEntry[]; skipCount: number; hasMoreItems: boolean }> => {
|
||||
const opts: ListAspectsOpts = { where, include: ['properties'], skipCount, maxItems: 100 };
|
||||
return this.aspectListService.getAspects(visibleAspects, opts).pipe(
|
||||
map((aspectPaging) => ({
|
||||
entries: aspectPaging?.list?.entries ?? [],
|
||||
skipCount: skipCount + (aspectPaging?.list?.pagination?.count ?? 0),
|
||||
hasMoreItems: aspectPaging?.list?.pagination?.hasMoreItems ?? false
|
||||
}))
|
||||
);
|
||||
};
|
||||
return fetchPage(0).pipe(
|
||||
expand((page) => (page.hasMoreItems ? fetchPage(page.skipCount) : EMPTY)),
|
||||
reduce((allEntries, page) => [...allEntries, ...page.entries], [] as AspectEntry[])
|
||||
);
|
||||
}
|
||||
|
||||
private categoriseNodeAspects(node: Node, allAspects: AspectEntry[]): void {
|
||||
const allAspectIds = allAspects.map((aspect) => aspect.entry.id);
|
||||
const visibleAspects = this.aspectListService.getVisibleAspects();
|
||||
const aspectNames = node.aspectNames ?? [];
|
||||
this.nodeAspects = aspectNames.filter((aspect) => visibleAspects.includes(aspect) || allAspectIds.includes(aspect));
|
||||
this.nodeAspectStatus = [...this.nodeAspects];
|
||||
this.notDisplayedAspects = aspectNames.filter((aspect) => !visibleAspects.includes(aspect) && !allAspectIds.includes(aspect));
|
||||
this.valueChanged.emit([...this.nodeAspects, ...this.notDisplayedAspects]);
|
||||
this.updateCounter.emit(this.nodeAspects.length);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user