mirror of
https://github.com/NationalSecurityAgency/skills-client.git
synced 2026-11-08 01:06:44 -10:00
Compare commits
71
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6af2944841 | ||
|
|
d19947c814 | ||
|
|
361bae4289 | ||
|
|
aae9cc7ee9 | ||
|
|
60c3d5edb1 | ||
|
|
bb12395d80 | ||
|
|
dea819670b | ||
|
|
7553782dcc | ||
|
|
daf5b1fca8 | ||
|
|
83878d8c3a | ||
|
|
83178bf58b | ||
|
|
03cf175e26 | ||
|
|
04c9f2e950 | ||
|
|
3f952ba966 | ||
|
|
b7ad03fb64 | ||
|
|
39c7abc757 | ||
|
|
aa0af7e776 | ||
|
|
33cfff5ebb | ||
|
|
7efe886ef4 | ||
|
|
caa236dff1 | ||
|
|
2b5b28c8dc | ||
|
|
481a6d0505 | ||
|
|
5103989eef | ||
|
|
266bf9911d | ||
|
|
8ab6ab5a3a | ||
|
|
d747c2b96f | ||
|
|
002ab3f783 | ||
|
|
a5f3848c16 | ||
|
|
601c7a2a96 | ||
|
|
8fcc10d52f | ||
|
|
65881829c5 | ||
|
|
99f946f33a | ||
|
|
8051bf7a63 | ||
|
|
9863d82e97 | ||
|
|
a56fef71fb | ||
|
|
db24520d75 | ||
|
|
ca23b4e4d4 | ||
|
|
9e9952eb53 | ||
|
|
90d63e19dd | ||
|
|
fe91a737d5 | ||
|
|
419f5c9968 | ||
|
|
809e361760 | ||
|
|
f5cc10c7df | ||
|
|
c225388951 | ||
|
|
6d50e32d27 | ||
|
|
6711223ad1 | ||
|
|
4e04972a09 | ||
|
|
a22b53a356 | ||
|
|
5e5aefd745 | ||
|
|
54eca19513 | ||
|
|
41bfbcc9d9 | ||
|
|
be1e821973 | ||
|
|
e38c70d39a | ||
|
|
796f97342b | ||
|
|
02fe5e1c77 | ||
|
|
c9bfb0ca1f | ||
|
|
ad321f0169 | ||
|
|
be81478d02 | ||
|
|
03372a9e92 | ||
|
|
7ec6092d6f | ||
|
|
354500f018 | ||
|
|
7458284c30 | ||
|
|
f8156f45ab | ||
|
|
ce13000dcb | ||
|
|
1664fa7ac7 | ||
|
|
1806136418 | ||
|
|
281140c19f | ||
|
|
0763dfbaa3 | ||
|
|
b4a59fdb7e | ||
|
|
7759001feb | ||
|
|
1b3ac0ff11 |
No files matched your search
@@ -2,6 +2,10 @@
|
||||
|
||||
name: Continuous Integration expired token tests
|
||||
|
||||
env:
|
||||
NODE_VERSION: 26
|
||||
JAVA_VERSION: 25
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 8 * * *'
|
||||
@@ -34,16 +38,16 @@ jobs:
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: '20.11.0'
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '19' # The JDK version to make available on the path.
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
|
||||
- name: Print Versions
|
||||
run: |
|
||||
@@ -53,7 +57,7 @@ jobs:
|
||||
node --version
|
||||
|
||||
- name: Cache local Maven repository
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
@@ -61,7 +65,7 @@ jobs:
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
@@ -79,7 +83,7 @@ jobs:
|
||||
# cd ..
|
||||
|
||||
- name: Checkout specific branch fo skills-service
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: NationalSecurityAgency/skills-service
|
||||
path: skills-service
|
||||
@@ -134,7 +138,7 @@ jobs:
|
||||
|
||||
- name: upload result artifacts
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: result artifacts
|
||||
path: |
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
name: Continuous Integration with OAuth
|
||||
|
||||
env:
|
||||
NODE_VERSION: 26
|
||||
JAVA_VERSION: 25
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
@@ -43,16 +47,16 @@ jobs:
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: '20.11.0'
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '19' # The JDK version to make available on the path.
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
|
||||
- name: Print Versions
|
||||
run: |
|
||||
@@ -62,7 +66,7 @@ jobs:
|
||||
node --version
|
||||
|
||||
- name: Cache local Maven repository
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
@@ -70,7 +74,7 @@ jobs:
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
@@ -86,7 +90,7 @@ jobs:
|
||||
# cd ..
|
||||
|
||||
- name: Checkout specific branch fo skills-service
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: NationalSecurityAgency/skills-service
|
||||
path: skills-service
|
||||
@@ -165,7 +169,7 @@ jobs:
|
||||
|
||||
- name: upload result artifacts
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: result artifacts
|
||||
path: |
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
name: Continuous Integration
|
||||
|
||||
env:
|
||||
NODE_VERSION: 26
|
||||
JAVA_VERSION: 25
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
@@ -43,16 +47,16 @@ jobs:
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: '20.11.0'
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '19' # The JDK version to make available on the path.
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
|
||||
- name: Print Versions
|
||||
run: |
|
||||
@@ -62,23 +66,16 @@ jobs:
|
||||
node --version
|
||||
|
||||
- name: Cache local Maven repository
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Checkout specific branch fo skills-service
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: NationalSecurityAgency/skills-service
|
||||
path: skills-service
|
||||
@@ -119,7 +116,7 @@ jobs:
|
||||
|
||||
- name: upload result artifacts
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: result artifacts
|
||||
path: |
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
name: Client Libs Backward Compatibility
|
||||
|
||||
env:
|
||||
NODE_VERSION: 26
|
||||
JAVA_VERSION: 25
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
@@ -37,16 +41,16 @@ jobs:
|
||||
build_skills_client_int:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: '20.11.0'
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '19' # The JDK version to make available on the path.
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
|
||||
- name: Print Versions
|
||||
run: |
|
||||
@@ -56,7 +60,7 @@ jobs:
|
||||
node --version
|
||||
|
||||
- name: Cache local Maven repository
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
@@ -64,7 +68,7 @@ jobs:
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
@@ -83,7 +87,7 @@ jobs:
|
||||
cd ../
|
||||
|
||||
- name: upload service jar
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: service jar
|
||||
path: ./skills-client-integration/skills-int-service/target/skills-int-service-*.jar
|
||||
@@ -117,16 +121,16 @@ jobs:
|
||||
matrix:
|
||||
version: ${{ fromJSON(needs.get_skills_service_versions.outputs.versions) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: '20.11.0'
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '19' # The JDK version to make available on the path.
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
|
||||
- name: Print Versions
|
||||
run: |
|
||||
@@ -136,7 +140,7 @@ jobs:
|
||||
node --version
|
||||
|
||||
- name: Cache local Maven repository
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
@@ -144,7 +148,7 @@ jobs:
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
@@ -160,7 +164,7 @@ jobs:
|
||||
cd ..
|
||||
|
||||
- name: download integration test apps
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: service jar
|
||||
path: ./skills-client-integration/skills-int-service/target/
|
||||
@@ -182,7 +186,7 @@ jobs:
|
||||
|
||||
- name: upload result artifacts
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: result artifacts for ${{ matrix.version }}
|
||||
path: |
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2020 SkillTree
|
||||
# Copyright 2025 SkillTree
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2020 SkillTree
|
||||
# Copyright 2025 SkillTree
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2020 SkillTree
|
||||
# Copyright 2025 SkillTree
|
||||
#
|
||||
# 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,31 @@ set -e
|
||||
set -o pipefail
|
||||
|
||||
echo "------- START: Setup npm links -------"
|
||||
cd skills-client-integration/skills-int-e2e-test
|
||||
mvn --batch-mode clean package -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
|
||||
ls -la target/skills-int-e2e-test-*.jar
|
||||
du -sh target/*
|
||||
java --version
|
||||
java -cp target/skills-int-e2e-test-*.jar -Dloader.main=skills.SetupNpmLinks org.springframework.boot.loader.launch.PropertiesLauncher
|
||||
cd ../../
|
||||
cd skills-client-js
|
||||
echo "------- skills-client-js: npm link -------"
|
||||
npm link
|
||||
cd ../skills-client-integration/skills-int-client-js/
|
||||
echo "------- skills-int-client-js: npm link @skilltree/skills-client-js -------"
|
||||
npm link @skilltree/skills-client-js
|
||||
|
||||
cd ../../skills-client-js
|
||||
echo "------- skills-client-js: npm install -------"
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
echo "------- skills-int-client-js: npm install -------"
|
||||
cd ../skills-client-integration/skills-int-client-js/
|
||||
npm install
|
||||
|
||||
echo "------- validate npm links -------"
|
||||
if ! npm ls --link --global | grep "skills-client-js"; then
|
||||
echo "Error: skills-client-js is not properly linked"
|
||||
exit 1
|
||||
else
|
||||
echo "Verified: skills-client-js is properly linked"
|
||||
fi
|
||||
|
||||
echo "------- skills-int-client-js: npm run build -------"
|
||||
npm run build
|
||||
|
||||
echo "------- DONE: Setup npm links -------"
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
name: Skills-service Backward Compatibility
|
||||
|
||||
env:
|
||||
NODE_VERSION: 26
|
||||
JAVA_VERSION: 25
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -21,18 +24,18 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: '20.11.0'
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: |
|
||||
11
|
||||
19
|
||||
${{ env.JAVA_VERSION }}
|
||||
|
||||
- name: Print Versions
|
||||
run: |
|
||||
@@ -42,7 +45,7 @@ jobs:
|
||||
node --version
|
||||
|
||||
- name: Cache local Maven repository
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
@@ -50,7 +53,7 @@ jobs:
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
@@ -58,7 +61,7 @@ jobs:
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Checkout specific branch fo skills-service
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: NationalSecurityAgency/skills-service
|
||||
path: skills-service
|
||||
@@ -70,7 +73,7 @@ jobs:
|
||||
cd ..
|
||||
|
||||
- name: upload service jar
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: service jar
|
||||
path: ./skills-service/service/target/skills-service-*.jar
|
||||
@@ -105,18 +108,18 @@ jobs:
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: '20.11.0'
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: |
|
||||
11
|
||||
19
|
||||
${{ env.JAVA_VERSION }}
|
||||
|
||||
- name: Print Versions
|
||||
run: |
|
||||
@@ -126,7 +129,7 @@ jobs:
|
||||
node --version
|
||||
|
||||
- name: Cache local Maven repository
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
@@ -134,7 +137,7 @@ jobs:
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
@@ -152,7 +155,7 @@ jobs:
|
||||
# cd ..
|
||||
|
||||
# - name: Checkout specific branch fo skills-service
|
||||
# uses: actions/checkout@v4
|
||||
# uses: actions/checkout@v6
|
||||
# with:
|
||||
# repository: NationalSecurityAgency/skills-service
|
||||
# path: skills-service
|
||||
@@ -165,7 +168,7 @@ jobs:
|
||||
# ls ./
|
||||
# cd ..
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: service jar
|
||||
path: ./skills-service/
|
||||
@@ -203,7 +206,7 @@ jobs:
|
||||
|
||||
- name: upload result artifacts
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: result artifacts for [${{ matrix.skillsJsVersion }}] version
|
||||
path: |
|
||||
@@ -229,7 +232,7 @@ jobs:
|
||||
#
|
||||
# - name: upload result artifacts
|
||||
# if: ${{ always() }}
|
||||
# uses: actions/upload-artifact@v4
|
||||
# uses: actions/upload-artifact@v7
|
||||
# with:
|
||||
# name: result artifacts
|
||||
# path: |
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
# SkillTree Client Libraries
|
||||
<p>
|
||||
<img src="https://img.shields.io/npm/d18m/%40skilltree%2Fskills-client-js" alt="npm downloads">
|
||||
<img src="https://img.shields.io/npm/dw/%40skilltree%2Fskills-client-js" alt="npm weekly downloads">
|
||||
<img src="https://img.shields.io/npm/l/%40skilltree%2Fskills-client-js" alt="License">
|
||||
<img src="https://img.shields.io/npm/v/%40skilltree%2Fskills-client-js" alt="Latest Version">
|
||||
<img alt="npm bundle size" src="https://img.shields.io/bundlephobia/minzip/%40skilltree%2Fskills-client-js">
|
||||
</p>
|
||||
|
||||
SkillTree is an innovative approach to implementing application training. SkillTree skills-client project is an assembly of
|
||||
client libraries that facilitate rapid integration with the SkillTree service.
|
||||
SkillTree is an innovative approach to implementing application training. SkillTree's ``skills-client-js`` project facilitates rapid integration with the SkillTree service.
|
||||
|
||||
To learn about the SkillTree platform please visit our [Official Documentation](https://skilltreeplatform.dev/).
|
||||
These pages provide in-depth guidance on the installation, usage and contribution.
|
||||
To learn about the SkillTree platform please visit our [Official Documentation](https://skilltreeplatform.dev/).
|
||||
These pages provide in-depth guidance on the installation, usage and contribution.
|
||||
|
||||
## Workflow Status
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.3.5</version>
|
||||
<version>3.5.16</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>skills</groupId>
|
||||
<artifactId>skills-client-integration</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>3.6.1-SNAPSHOT</version>
|
||||
<version>3.6.3-SNAPSHOT</version>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
@@ -32,8 +32,9 @@
|
||||
<!--suppress UnresolvedMavenProperty -->
|
||||
<nexusServer>${nexus.url}</nexusServer>
|
||||
<frontend-maven-plugin.version>1.10.3</frontend-maven-plugin.version>
|
||||
<node.version>v14.15.0</node.version>
|
||||
<java.version>19</java.version>
|
||||
|
||||
<!-- TODO: Temporary override spring boot versions, remove once spring boot upgrades these versions -->
|
||||
<commons-lang3.version>3.19.0</commons-lang3.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* 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 @@
|
||||
{
|
||||
"name": "skills-int-client-js",
|
||||
"version": "3.6.1",
|
||||
"version": "3.6.3",
|
||||
"license": "Apache-2.0",
|
||||
"description": "SkillTree Client Lib Integration Tests - Native JS",
|
||||
"main": "index.js",
|
||||
@@ -16,13 +16,13 @@
|
||||
},
|
||||
"author": "SkillTree Team",
|
||||
"dependencies": {
|
||||
"@skilltree/skills-client-js": "3.6.1",
|
||||
"axios": "1.7.7",
|
||||
"bootstrap": "5.3.3",
|
||||
"jquery": "3.7.1"
|
||||
"@skilltree/skills-client-js": "3.6.3",
|
||||
"axios": "1.17.0",
|
||||
"bootstrap": "5.3.8",
|
||||
"jquery": "4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"fs-extra": "11.2.0",
|
||||
"fs-extra": "11.3.5",
|
||||
"license-check-and-add": "4.0.5",
|
||||
"license-checker": "25.0.1",
|
||||
"live-server": "1.2.2"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>skills</groupId>
|
||||
<artifactId>skills-client-integration</artifactId>
|
||||
<version>3.6.1-SNAPSHOT</version>
|
||||
<version>3.6.3-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>skills-int-client-js</artifactId>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>3.5.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>exec-npm-install</id>
|
||||
@@ -39,57 +40,6 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>com.github.eirslett</groupId>-->
|
||||
<!-- <artifactId>frontend-maven-plugin</artifactId>-->
|
||||
<!-- <version>${frontend-maven-plugin.version}</version>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <installDirectory>target</installDirectory>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- <executions>-->
|
||||
<!-- <execution>-->
|
||||
<!-- <id>install node and npm</id>-->
|
||||
<!-- <goals>-->
|
||||
<!-- <goal>install-node-and-npm</goal>-->
|
||||
<!-- </goals>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <nodeVersion>${node.version}</nodeVersion>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </execution>-->
|
||||
<!-- <execution>-->
|
||||
<!-- <id>npm install</id>-->
|
||||
<!-- <goals>-->
|
||||
<!-- <goal>npm</goal>-->
|
||||
<!-- </goals>-->
|
||||
<!-- <phase>generate-resources</phase>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <arguments>--unsafe-perm install</arguments>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </execution>-->
|
||||
<!-- <execution>-->
|
||||
<!-- <id>npm run build</id>-->
|
||||
<!-- <goals>-->
|
||||
<!-- <goal>npm</goal>-->
|
||||
<!-- </goals>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <arguments>run build</arguments>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </execution>-->
|
||||
|
||||
<!-- <!–TODO: uncomment when we have at least 1 unit test–>-->
|
||||
<!-- <!–<execution>–>-->
|
||||
<!-- <!–<id>npm run test</id>–>-->
|
||||
<!-- <!–<goals>–>-->
|
||||
<!-- <!–<goal>npm</goal>–>-->
|
||||
<!-- <!–</goals>–>-->
|
||||
<!-- <!–<phase>test</phase>–>-->
|
||||
<!-- <!–<configuration>–>-->
|
||||
<!-- <!–<arguments>run unit</arguments>–>-->
|
||||
<!-- <!–</configuration>–>-->
|
||||
<!-- <!–</execution>–>-->
|
||||
<!-- </executions>-->
|
||||
|
||||
<!-- </plugin>-->
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -4,6 +4,7 @@ module.exports = defineConfig({
|
||||
chromeWebSecurity: false,
|
||||
defaultCommandTimeout: 10000,
|
||||
projectId: '3yas4t',
|
||||
video: true,
|
||||
retries: {
|
||||
runMode: 2,
|
||||
openMode: 0,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- Copyright 2020 SkillTree
|
||||
-- Copyright 2025 SkillTree
|
||||
--
|
||||
-- Licensed under the Apache License, Version 2.0 (the "License");
|
||||
-- you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -48,12 +48,12 @@
|
||||
"dev:removeNpmLinks": "mvn --batch-mode clean package && java -cp target/skills-int-e2e-test-*.jar -Dloader.main=skills.RemoveNpmLinks org.springframework.boot.loader.launch.PropertiesLauncher"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cypress": "13.6.3",
|
||||
"license-check-and-add": "3.0.4",
|
||||
"cypress": "14.5.2",
|
||||
"license-check-and-add": "4.0.5",
|
||||
"license-checker": "25.0.1",
|
||||
"pdf-parse": "1.1.1",
|
||||
"semver": "7.3.2",
|
||||
"wait-on": "5.2.0",
|
||||
"wait-port": "0.2.9"
|
||||
"semver": "7.7.2",
|
||||
"wait-on": "8.0.3",
|
||||
"wait-port": "1.1.0"
|
||||
}
|
||||
}
|
||||
@@ -5,13 +5,13 @@
|
||||
<parent>
|
||||
<groupId>skills</groupId>
|
||||
<artifactId>skills-client-integration</artifactId>
|
||||
<version>3.6.1-SNAPSHOT</version>
|
||||
<version>3.6.3-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>skills-int-e2e-test</artifactId>
|
||||
<description>End to End tests for Skills client libs using skills-int-service app</description>
|
||||
|
||||
<properties>
|
||||
<groovy.version>4.0.7</groovy.version>
|
||||
<!-- <groovy.version>4.0.7</groovy.version>-->
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
@@ -104,7 +104,6 @@
|
||||
<!-- mvn license:add-third-party-->
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>license-maven-plugin</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-cli</id>
|
||||
@@ -133,6 +132,7 @@
|
||||
<includedLicense>Common Development and Distribution License 1.1 (CDDL-1.1) + The GNU General Public License (GPL) Version 2 with the Classpath Exception</includedLicense>
|
||||
<includedLicense>Eclipse Public License - Version 2.0</includedLicense>
|
||||
<includedLicense>The GNU General Public License (GPL) Version 2 with the Classpath Exception</includedLicense>
|
||||
<includedLicense>GNU Lesser General Public License</includedLicense>
|
||||
</includedLicenses>
|
||||
<licenseMerges>
|
||||
<licenseMerge>The Apache Software License, Version 2.0|Apache License, Version 2.0</licenseMerge>
|
||||
@@ -144,7 +144,9 @@
|
||||
<licenseMerge>The 3-Clause BSD License|New BSD License</licenseMerge>
|
||||
<licenseMerge>Eclipse Public License - Version 1.0|Eclipse Public License - v 1.0</licenseMerge>
|
||||
<licenseMerge>MIT License|The MIT License</licenseMerge>
|
||||
<licenseMerge>Eclipse Public License - Version 2.0|EPL 2.0</licenseMerge>
|
||||
<licenseMerge>MIT License|MIT</licenseMerge>
|
||||
<licenseMerge>Eclipse Public License - Version 2.0|EPL 2.0|EPL-2.0</licenseMerge>
|
||||
<licenseMerge>Eclipse Public License - Version 2.0|Eclipse Public License - v 2.0</licenseMerge>
|
||||
<licenseMerge>The GNU General Public License (GPL) Version 2 with the Classpath Exception|GPL2 w/ CPE</licenseMerge>
|
||||
</licenseMerges>
|
||||
</configuration>
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Copyright 2020 SkillTree
|
||||
# Copyright 2025 SkillTree
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Copyright 2020 SkillTree
|
||||
# Copyright 2025 SkillTree
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# Copyright 2020 SkillTree
|
||||
# Copyright 2025 SkillTree
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
-111
@@ -1,111 +0,0 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
|
||||
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
|
||||
|
||||
https://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.
|
||||
*/
|
||||
package skills
|
||||
|
||||
//import callStack.profiler.CProf
|
||||
//import callStack.profiler.Profile
|
||||
import groovy.util.logging.Slf4j
|
||||
import org.apache.commons.io.FileUtils
|
||||
|
||||
import javax.print.attribute.SetOfIntegerSyntax
|
||||
import java.nio.file.Files
|
||||
|
||||
@Slf4j
|
||||
class SetupNpmLinks {
|
||||
|
||||
static void main(String[] args) {
|
||||
boolean shouldPrune = args.find({ it.equalsIgnoreCase("--prune") })
|
||||
new SetupNpmLinks(shouldPrune: shouldPrune).init().doLink()
|
||||
// log.info("Execution Prof:\n{}", CProf.prettyPrint())
|
||||
}
|
||||
|
||||
// configure
|
||||
File root = new File("./")
|
||||
boolean shouldPrune = false
|
||||
|
||||
// private
|
||||
TitlePrinter titlePrinter = new TitlePrinter()
|
||||
List<NpmProj> projs
|
||||
SetupNpmLinks init(){
|
||||
projs = new NpmProjBuilder(loc: root).build()
|
||||
return this
|
||||
}
|
||||
|
||||
// @Profile
|
||||
void doLink() {
|
||||
log.info("Should Prune = [{}]", shouldPrune)
|
||||
assert projs
|
||||
new RemoveNpmLinks(shouldPrune: shouldPrune, npmInstall: false).init().removeAnyExistingLinks()
|
||||
createLinks()
|
||||
npmLinkToSkills()
|
||||
install()
|
||||
validateLinks()
|
||||
build()
|
||||
}
|
||||
|
||||
// @Profile
|
||||
private void install() {
|
||||
titlePrinter.printTitle("install")
|
||||
projs.each { NpmProj npmProj ->
|
||||
npmProj.exec("npm install --force")
|
||||
}
|
||||
}
|
||||
|
||||
// @Profile
|
||||
private void build() {
|
||||
titlePrinter.printTitle("build")
|
||||
projs.each { NpmProj npmProj ->
|
||||
npmProj.exec("npm run build")
|
||||
}
|
||||
}
|
||||
|
||||
// @Profile
|
||||
private void validateLinks() {
|
||||
titlePrinter.printTitle("validate links")
|
||||
projs.findAll({ it.hasLinksToOtherProjects }).each { NpmProj npmProj ->
|
||||
titlePrinter.printSubTitle("validating [${npmProj.getSkillsModulesDir().absolutePath}]")
|
||||
npmProj.exec("ls -l node_modules/@skilltree/")
|
||||
npmProj.skillsDependenciesFromPackageJson.each {
|
||||
File shouldBeSymbolic = new File(npmProj.loc, "node_modules/${it}")
|
||||
assert shouldBeSymbolic.exists()
|
||||
assert Files.isSymbolicLink(shouldBeSymbolic.toPath())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @Profile
|
||||
private void npmLinkToSkills() {
|
||||
titlePrinter.printTitle("link")
|
||||
projs.findAll({ it.hasLinksToOtherProjects }).each { NpmProj npmProj ->
|
||||
npmProj.skillsDependenciesFromPackageJson.each {
|
||||
titlePrinter.printSubTitle("Linking module [${it}] in project [${npmProj}]")
|
||||
|
||||
npmProj.exec("npm link --force ${it}".toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// @Profile
|
||||
private void createLinks() {
|
||||
titlePrinter.printTitle("create links")
|
||||
projs.findAll({ it.doOthersLinkToMe }).each {
|
||||
titlePrinter.printSubTitle("create link for ${it.loc.name}")
|
||||
it.exec("ls")
|
||||
it.exec("node -v")
|
||||
it.exec("npm link")
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2025 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>skills</groupId>
|
||||
<artifactId>skills-client-integration</artifactId>
|
||||
<version>3.6.1-SNAPSHOT</version>
|
||||
<version>3.6.3-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>skills-int-service</artifactId>
|
||||
<description>SkillTree Client Lib Integration Tests</description>
|
||||
@@ -57,7 +57,6 @@
|
||||
<!-- mvn license:add-third-party-->
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>license-maven-plugin</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-cli</id>
|
||||
@@ -99,8 +98,10 @@
|
||||
<licenseMerge>Eclipse Public License - Version 1.0|Eclipse Public License 1.0</licenseMerge>
|
||||
<licenseMerge>The 3-Clause BSD License|New BSD License</licenseMerge>
|
||||
<licenseMerge>Eclipse Public License - Version 1.0|Eclipse Public License - v 1.0</licenseMerge>
|
||||
<licenseMerge>Eclipse Public License - Version 2.0|EPL 2.0</licenseMerge>
|
||||
<licenseMerge>Eclipse Public License - Version 2.0|EPL 2.0|EPL-2.0</licenseMerge>
|
||||
<licenseMerge>Eclipse Public License - Version 2.0|Eclipse Public License - v 2.0</licenseMerge>
|
||||
<licenseMerge>The GNU General Public License (GPL) Version 2 with the Classpath Exception|GPL2 w/ CPE</licenseMerge>
|
||||
<licenseMerge>MIT License|MIT</licenseMerge>
|
||||
</licenseMerges>
|
||||
</configuration>
|
||||
</execution>
|
||||
@@ -112,7 +113,6 @@
|
||||
mvn com.mycila:license-maven-plugin:3.0:format-->
|
||||
<groupId>com.mycila</groupId>
|
||||
<artifactId>license-maven-plugin</artifactId>
|
||||
<version>3.0</version>
|
||||
<configuration>
|
||||
<header>${basedir}/../license-add/LICENSE-HEADER.txt</header>
|
||||
<excludes>
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2020 SkillTree
|
||||
/*
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2020 SkillTree
|
||||
/*
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2020 SkillTree
|
||||
/*
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2020 SkillTree
|
||||
/*
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2020 SkillTree
|
||||
/*
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2020 SkillTree
|
||||
/*
|
||||
* Copyright 2025 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright 2020 SkillTree
|
||||
# Copyright 2025 SkillTree
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
module.exports = {
|
||||
"parser": "@babel/eslint-parser",
|
||||
"rules": {
|
||||
"no-underscore-dangle": 0,
|
||||
"max-len": ["error", {'code': 200}],
|
||||
},
|
||||
"globals": {
|
||||
"XMLHttpRequest": 'readonly',
|
||||
"document": 'readonly',
|
||||
"alert": 'readonly',
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"jasmine": true,
|
||||
"jest": true,
|
||||
}
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
<!---
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2026 SkillTree
|
||||
|
||||
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,11 @@ limitations under the License.
|
||||
# SkillTree Client Lib - Native JS Lib
|
||||
|
||||
<p>
|
||||
<a href="https://www.npmjs.com/package/@skilltree/skills-client-js">
|
||||
<img src="https://flat.badgen.net/npm/dt/@skilltree/skills-client-js" alt="npm downloads">
|
||||
</a>
|
||||
<a href="https://www.npmjs.com/package/@skilltree/skills-client-js">
|
||||
<img src="https://flat.badgen.net/npm/dw/@skilltree/skills-client-js" alt="npm weekly downloads">
|
||||
</a>
|
||||
<a href="https://www.npmjs.com/package/@skilltree/skills-client-js">
|
||||
<img src="https://img.shields.io/npm/l/@skilltree/skills-client-js.svg?sanitize=true" alt="License">
|
||||
</a>
|
||||
<img src="https://img.shields.io/npm/d18m/%40skilltree%2Fskills-client-js" alt="npm downloads">
|
||||
<img src="https://img.shields.io/npm/dw/%40skilltree%2Fskills-client-js" alt="npm weekly downloads">
|
||||
<img src="https://img.shields.io/npm/l/%40skilltree%2Fskills-client-js" alt="License">
|
||||
<img src="https://img.shields.io/npm/v/%40skilltree%2Fskills-client-js" alt="Latest Version">
|
||||
<img alt="npm bundle size" src="https://img.shields.io/bundlephobia/minzip/%40skilltree%2Fskills-client-js">
|
||||
</p>
|
||||
|
||||
SkillTree is an innovative approach to implementing application training. SkillTree's ``skills-client-js`` project facilitates rapid integration with the SkillTree service.
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
Copyright 2026 SkillTree
|
||||
|
||||
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
|
||||
|
||||
https://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 globals from "globals";
|
||||
import { defineConfig } from "eslint/config";
|
||||
import js from "@eslint/js";
|
||||
|
||||
export default defineConfig([
|
||||
{ files: ["**/*.js"], languageOptions: { globals: globals.browser } },
|
||||
{ files: ["**/*.js"], plugins: { js }, extends: ["js/recommended"] },
|
||||
]);
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2026 SkillTree
|
||||
|
||||
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 @@
|
||||
{
|
||||
"name": "@skilltree/skills-client-js",
|
||||
"version": "3.6.1",
|
||||
"version": "3.6.3",
|
||||
"license": "Apache-2.0",
|
||||
"description": "SkillTree Client Lib - Native JS Lib",
|
||||
"main": "dist/skills-client-js.umd.min.js",
|
||||
@@ -17,45 +17,46 @@
|
||||
"licenseHeaderCheck": " npx license-check-and-add check -f license-add/license-add-config.json",
|
||||
"licenseHeaderAdd": " npx license-check-and-add add -f license-add/license-add-config.json",
|
||||
"licenseCheck": "npm run licenseHeaderCheck && npm run licenseDepCheck ",
|
||||
"build": "npm run licenseCheck && npm run test && npm run clean && npm run build:umd && npm run build:esm",
|
||||
"buildSkipTests": "npm run clean && npm run build:umd && npm run build:esm",
|
||||
"build": "npm run lint && npm run licenseCheck && npm run test && npm run clean && npm run build:umd && npm run build:esm",
|
||||
"buildSkipTests": "npm run lint && npm run clean && npm run build:umd && npm run build:esm",
|
||||
"build:umd": "rollup --config --format umd --file dist/skills-client-js.umd.min.js --name SkillsClient --bundleConfigAsCjs",
|
||||
"build:esm": "rollup --config --format esm --file dist/skills-client-js.esm.min.js --bundleConfigAsCjs",
|
||||
"deploy-to-examples": "npm run build && cp ./dist/skills-display-js.umd.min.js ../skills-examples/skills-example-client-js/app/assets/js/@skilltree/skills-client-js/dist",
|
||||
"test": "NODE_ENV=test jest --coverage",
|
||||
"test-watch": "npx jest --passWithNoTests --coverage --watch",
|
||||
"prepublishOnly": "npm run build",
|
||||
"lint": "eslint --ext .js src/**"
|
||||
"lint": "eslint src/**"
|
||||
},
|
||||
"author": "SkillTree Team",
|
||||
"devDependencies": {
|
||||
"@babel/cli": "7.25.7",
|
||||
"@babel/core": "7.25.7",
|
||||
"@babel/eslint-parser": "7.25.7",
|
||||
"@babel/plugin-transform-runtime": "7.25.7",
|
||||
"@babel/cli": "7.28.6",
|
||||
"@babel/core": "7.29.0",
|
||||
"@babel/plugin-transform-runtime": "7.29.0",
|
||||
"@babel/polyfill": "7.12.1",
|
||||
"@babel/preset-env": "7.25.7",
|
||||
"@rollup/plugin-babel": "6.0.4",
|
||||
"@rollup/plugin-commonjs": "28.0.0",
|
||||
"@rollup/plugin-eslint": "9.0.5",
|
||||
"@babel/preset-env": "7.29.5",
|
||||
"@babel/runtime": "7.29.2",
|
||||
"@eslint/js": "10.0.1",
|
||||
"@rollup/plugin-babel": "7.0.0",
|
||||
"@rollup/plugin-commonjs": "29.0.2",
|
||||
"@rollup/plugin-json": "6.1.0",
|
||||
"@rollup/plugin-node-resolve": "15.3.0",
|
||||
"@rollup/plugin-replace": "6.0.1",
|
||||
"@rollup/plugin-terser": "0.4.4",
|
||||
"axios-mock-adapter": "2.0.0",
|
||||
"babel-jest": "29.7.0",
|
||||
"eslint": "9.12.0",
|
||||
"jest": "29.7.0",
|
||||
"jest-environment-jsdom": "29.7.0",
|
||||
"@rollup/plugin-node-resolve": "16.0.3",
|
||||
"@rollup/plugin-replace": "6.0.3",
|
||||
"@rollup/plugin-terser": "1.0.0",
|
||||
"axios-mock-adapter": "2.1.0",
|
||||
"babel-jest": "30.4.1",
|
||||
"eslint": "10.3.0",
|
||||
"globals": "17.6.0",
|
||||
"jest": "30.4.2",
|
||||
"jest-environment-jsdom": "30.4.1",
|
||||
"license-check-and-add": "4.0.5",
|
||||
"license-checker": "25.0.1",
|
||||
"regenerator-runtime": "0.14.1",
|
||||
"rollup": "4.24.0",
|
||||
"rollup": "4.60.3",
|
||||
"xhr-mock": "2.5.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@stomp/stompjs": "7.0.0",
|
||||
"axios": "1.7.7",
|
||||
"@stomp/stompjs": "7.3.0",
|
||||
"axios": "1.17.0",
|
||||
"js-logger": "1.6.1",
|
||||
"postmate": "1.5.2",
|
||||
"sockjs-client": "1.6.1"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 SkillTree
|
||||
Copyright 2026 SkillTree
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,6 @@ 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 eslint from '@rollup/plugin-eslint';
|
||||
import terser from '@rollup/plugin-terser';
|
||||
import babel from '@rollup/plugin-babel';
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
@@ -34,7 +33,6 @@ module.exports = {
|
||||
},
|
||||
preserveSymlinks: true,
|
||||
plugins: [
|
||||
eslint(),
|
||||
babel({
|
||||
babelHelpers: 'runtime',
|
||||
exclude: 'node_modules/**',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -99,6 +99,10 @@ export default {
|
||||
return typeof authenticator === 'string' && authenticator.startsWith(`${serviceUrl}/oauth2/authorization`);
|
||||
},
|
||||
|
||||
assignWindowLocation(newLocation) {
|
||||
window.location.assign(newLocation);
|
||||
},
|
||||
|
||||
getAuthenticationToken(authenticator, serviceUrl, projectId, oauthRedirect = false) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const isOAuthMode = this.isOAuthMode(authenticator, serviceUrl);
|
||||
@@ -117,7 +121,7 @@ export default {
|
||||
// if we get 401 and we are using OAuth, then redirect to the OAuth Provider
|
||||
const oauthAuthenticator = `${authenticator}?skillsRedirectUri=${window.location}`;
|
||||
log.info(`SkillsClient::SkillService::unable to get oAuth token, navigating to [${oauthAuthenticator}]`);
|
||||
window.location.assign(oauthAuthenticator);
|
||||
this.assignWindowLocation(oauthAuthenticator);
|
||||
resolve();
|
||||
} else {
|
||||
reject(new Error(`SkillTree: Unable to authenticate using [${authenticator}] endpoint. Response Code=[${xhr.status}].\n
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -125,7 +125,6 @@ const exportObject = {
|
||||
setConfigureWasCalled();
|
||||
}
|
||||
}).catch((error) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Error getting service status', error);
|
||||
setConfigureWasCalled();
|
||||
initializedResolvers.resolve();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -26,7 +26,6 @@ const skillsClientDisplayPath = 'skillsClientDisplayPath';
|
||||
const markedForDestruction = [];
|
||||
|
||||
export default class SkillsDisplayJS {
|
||||
/* eslint-disable object-curly-newline */
|
||||
constructor({ options, theme, version, handleRouteChanged, userId } = {}) {
|
||||
log.debug(`SkillsClient::SkillsDisplayJS::Constructing with options [${options}], theme [${theme}], version [${version}], userId [${userId}]`);
|
||||
this._options = { ...{ }, ...options };
|
||||
@@ -36,7 +35,6 @@ export default class SkillsDisplayJS {
|
||||
this._userId = userId;
|
||||
}
|
||||
|
||||
/* eslint-disable class-methods-use-this */
|
||||
currentIframeId() {
|
||||
return uniqueId;
|
||||
}
|
||||
@@ -201,7 +199,6 @@ export default class SkillsDisplayJS {
|
||||
errorMessage += ' and that your browser trusts the server\'s certificate';
|
||||
}
|
||||
errorMessage += `. skilltree service URL: ${this.configuration.serviceUrl}`;
|
||||
/* eslint-disable no-console */
|
||||
console.error(errorMessage);
|
||||
log.error(`SkillsClient::SkillsDisplayJS::${errorMessage}`, error);
|
||||
ErrorPageUtils.removeAllChildren(iframeContainer);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -32,7 +32,6 @@ const callSuccessHandlers = (event) => {
|
||||
};
|
||||
|
||||
const callErrorHandlers = (event) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Error reporting skill:', event);
|
||||
errorHandlerCache.forEach((it) => it(event));
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
import mock from 'xhr-mock';
|
||||
import SkillsService from '../src/SkillsService';
|
||||
import log from 'js-logger';
|
||||
|
||||
require('@babel/polyfill');
|
||||
|
||||
@@ -22,32 +23,14 @@ describe('OAuth auto redirect tests', () => {
|
||||
const mockServiceUrl = 'http://some.com';
|
||||
const mockProjectId = 'proj1';
|
||||
const authEndpoint = `${mockServiceUrl}/oauth2/authorization/gitlab`;
|
||||
const oldWindowLocation = window.location
|
||||
|
||||
beforeAll(() => {
|
||||
delete window.location
|
||||
|
||||
window.location = Object.defineProperties(
|
||||
{},
|
||||
{
|
||||
...Object.getOwnPropertyDescriptors(oldWindowLocation),
|
||||
assign: {
|
||||
configurable: true,
|
||||
value: jest.fn(),
|
||||
},
|
||||
},
|
||||
)
|
||||
})
|
||||
afterAll(() => {
|
||||
// restore `window.location` to the `jsdom` `Location` object
|
||||
window.location = oldWindowLocation
|
||||
SkillsService.assignWindowLocation = jest.fn();
|
||||
})
|
||||
|
||||
// replace the real XHR object with the mock XHR object before each test
|
||||
beforeEach(() => {
|
||||
mock.setup();
|
||||
const url = /.*\/api\/projects\/proj1\/skillsClientVersion/;
|
||||
window.location.assign.mockReset()
|
||||
SkillsService.assignWindowLocation.mockReset()
|
||||
});
|
||||
|
||||
// put the real XHR object back and clear the mocks after each test
|
||||
@@ -61,8 +44,8 @@ describe('OAuth auto redirect tests', () => {
|
||||
|
||||
await SkillsService.getAuthenticationToken(authEndpoint, mockServiceUrl, mockProjectId, true);
|
||||
|
||||
expect(window.location.assign).toHaveBeenCalledTimes(1)
|
||||
expect(window.location.assign).toHaveBeenCalledWith(`${authEndpoint}?skillsRedirectUri=http://localhost/`)
|
||||
expect(SkillsService.assignWindowLocation).toHaveBeenCalledTimes(1)
|
||||
expect(SkillsService.assignWindowLocation).toHaveBeenCalledWith(`${authEndpoint}?skillsRedirectUri=http://localhost/`)
|
||||
});
|
||||
|
||||
it('oauth does not auto redirect when oauthRedirect=false', async () => {
|
||||
@@ -73,7 +56,7 @@ describe('OAuth auto redirect tests', () => {
|
||||
await SkillsService.getAuthenticationToken(authEndpoint, mockServiceUrl, mockProjectId);
|
||||
} catch (e) {
|
||||
expect(e.message).toMatch('Unable to authenticate');
|
||||
expect(window.location.assign).toHaveBeenCalledTimes(0);
|
||||
expect(SkillsService.assignWindowLocation).toHaveBeenCalledTimes(0);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -82,8 +65,148 @@ describe('OAuth auto redirect tests', () => {
|
||||
mock.get(oauthTokenEndpoint, (req, res) => res.status(200).body('{"access_token": "token1"}'));
|
||||
|
||||
const result = await SkillsService.getAuthenticationToken(authEndpoint, mockServiceUrl, mockProjectId, true);
|
||||
expect(window.location.assign).toHaveBeenCalledTimes(0);
|
||||
expect(SkillsService.assignWindowLocation).toHaveBeenCalledTimes(0);
|
||||
expect(result).toMatch('token1');
|
||||
});
|
||||
|
||||
it('send log message', async () => {
|
||||
const logEndpoint = `${mockServiceUrl}/public/log`;
|
||||
const testMessage = 'Test log message';
|
||||
const testLevel = 'ERROR';
|
||||
|
||||
// Mock the POST request to the log endpoint
|
||||
mock.post(logEndpoint, (req, res) => {
|
||||
// Verify the request body contains expected data
|
||||
expect(req.body()).toContain('message');
|
||||
expect(req.body()).toContain(testMessage);
|
||||
expect(req.body()).toContain(testLevel);
|
||||
return res.status(200).body('{"success": true}');
|
||||
});
|
||||
|
||||
const result = await SkillsService.sendLogMessage(mockServiceUrl, [testMessage], { level: testLevel });
|
||||
|
||||
expect(result).toEqual({ success: true });
|
||||
});
|
||||
|
||||
it('send log message failure', async () => {
|
||||
const logEndpoint = `${mockServiceUrl}/public/log`;
|
||||
const testMessage = 'Test log message';
|
||||
const testLevel = 'ERROR';
|
||||
|
||||
// Mock a failed response
|
||||
mock.post(logEndpoint, (req, res) => res.status(500));
|
||||
|
||||
try {
|
||||
await SkillsService.sendLogMessage(mockServiceUrl, [testMessage], { level: testLevel });
|
||||
fail('Expected sendLogMessage to throw an error');
|
||||
} catch (error) {
|
||||
expect(error.message).toContain('Unable to send client log message');
|
||||
expect(error.message).toContain('Received status [500]');
|
||||
}
|
||||
});
|
||||
|
||||
it('configure logging with enabled logging', async () => {
|
||||
const logEndpoint = `${mockServiceUrl}/public/log`;
|
||||
const testMessage = 'Test log message';
|
||||
|
||||
// Mock the POST request for log message
|
||||
mock.post(logEndpoint, (req, res) => res.status(200).body('{"success": true}'));
|
||||
|
||||
const response = {
|
||||
clientLib: {
|
||||
loggingEnabled: 'true',
|
||||
loggingLevel: 'INFO'
|
||||
}
|
||||
};
|
||||
|
||||
// Mock console.info to capture log output
|
||||
const consoleSpy = jest.spyOn(console, 'info').mockImplementation();
|
||||
|
||||
SkillsService.configureLogging(mockServiceUrl, response);
|
||||
|
||||
// Trigger a log message to test the handler
|
||||
log.info(testMessage);
|
||||
|
||||
// Wait for async log message to be sent
|
||||
await new Promise(resolve => setTimeout(resolve, 10));
|
||||
|
||||
// Check that our test message was logged
|
||||
expect(consoleSpy.mock.calls.some(call =>
|
||||
call[0] === testMessage || (Array.isArray(call[0]) && call[0].includes(testMessage))
|
||||
)).toBe(true);
|
||||
consoleSpy.mockReset();
|
||||
});
|
||||
|
||||
it('configure logging with unknown level defaults to INFO and logs warning', async () => {
|
||||
const logEndpoint = `${mockServiceUrl}/public/log`;
|
||||
const response = {
|
||||
clientLib: {
|
||||
loggingEnabled: 'true',
|
||||
loggingLevel: 'UNKNOWN_LEVEL'
|
||||
}
|
||||
};
|
||||
|
||||
// Mock the POST request for log message
|
||||
mock.post(logEndpoint, (req, res) => res.status(200).body('{"success": true}'));
|
||||
|
||||
// Spy on the logger's warn method instead of console.warn
|
||||
const logWarnSpy = jest.spyOn(log, 'warn').mockImplementation();
|
||||
const consoleSpy = jest.spyOn(console, 'info').mockImplementation();
|
||||
|
||||
SkillsService.configureLogging(mockServiceUrl, response);
|
||||
|
||||
// Verify the specific warning message was logged
|
||||
expect(logWarnSpy).toHaveBeenCalledWith(
|
||||
'SkillsClient::SkillService::Unknown log level [UNKNOWN_LEVEL], defaulting to INFO'
|
||||
);
|
||||
|
||||
// Verify that logging still works after defaulting to INFO
|
||||
log.info('Test message after defaulting');
|
||||
|
||||
await new Promise(resolve => setTimeout(resolve, 10));
|
||||
|
||||
logWarnSpy.mockRestore();
|
||||
consoleSpy.mockRestore();
|
||||
});
|
||||
|
||||
it('reportSkillsClientVersion success', async () => {
|
||||
const mockConfig = {
|
||||
getServiceUrl: () => mockServiceUrl,
|
||||
getProjectId: () => mockProjectId,
|
||||
isPKIMode: () => false,
|
||||
getAuthToken: () => 'test-token'
|
||||
};
|
||||
|
||||
const versionEndpoint = `${mockServiceUrl}/api/projects/${mockProjectId}/skillsClientVersion`;
|
||||
const mockResponse = { success: true, version: '3.6.2' };
|
||||
|
||||
// Mock a successful response (200)
|
||||
mock.post(versionEndpoint, (req, res) => res.status(200).body(JSON.stringify(mockResponse)));
|
||||
|
||||
const result = await SkillsService.reportSkillsClientVersion(mockConfig);
|
||||
|
||||
expect(result).toEqual(mockResponse);
|
||||
});
|
||||
|
||||
it('reportSkillsClientVersion failure', async () => {
|
||||
const mockConfig = {
|
||||
getServiceUrl: () => mockServiceUrl,
|
||||
getProjectId: () => mockProjectId,
|
||||
isPKIMode: () => false,
|
||||
getAuthToken: () => 'test-token'
|
||||
};
|
||||
|
||||
const versionEndpoint = `${mockServiceUrl}/api/projects/${mockProjectId}/skillsClientVersion`;
|
||||
|
||||
// Mock a failed response (e.g., 401)
|
||||
mock.post(versionEndpoint, (req, res) => res.status(401));
|
||||
|
||||
try {
|
||||
await SkillsService.reportSkillsClientVersion(mockConfig);
|
||||
fail('Expected reportSkillsClientVersion to throw an error');
|
||||
} catch (error) {
|
||||
expect(error.message).toBe('Unable to report skillsClientVersion. Received status [401]');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
@@ -1,20 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* https://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.
|
||||
*/
|
||||
/*
|
||||
* Copyright 202 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,6 +16,7 @@
|
||||
|
||||
import mock from 'xhr-mock';
|
||||
import SkillsConfiguration from '../../src/config/SkillsConfiguration';
|
||||
import log from 'js-logger';
|
||||
|
||||
/**
|
||||
* @jest-environment jsdom
|
||||
@@ -208,4 +194,32 @@ describe('SkillsConfigurationInit', () => {
|
||||
|
||||
expect(SkillsConfiguration.getServiceUrl()).toBe('http://some');
|
||||
});
|
||||
|
||||
it('configure with enabled=false exercises disabled logging path', () => {
|
||||
// Spy on the logger methods to verify they are called
|
||||
const logUseDefaultsSpy = jest.spyOn(log, 'useDefaults').mockImplementation();
|
||||
const logSetLevelSpy = jest.spyOn(log, 'setLevel').mockImplementation();
|
||||
const logInfoSpy = jest.spyOn(log, 'info').mockImplementation();
|
||||
|
||||
const result = SkillsConfiguration.configure({
|
||||
serviceUrl: 'http://test.com',
|
||||
projectId: 'test-project',
|
||||
authenticator: 'http://test.com/auth',
|
||||
enabled: false
|
||||
});
|
||||
|
||||
// Verify the specific lines are exercised
|
||||
expect(logUseDefaultsSpy).toHaveBeenCalled();
|
||||
expect(logSetLevelSpy).toHaveBeenCalledWith(log.TRACE);
|
||||
expect(logInfoSpy).toHaveBeenCalledWith('SkillsConfiguration is disabled.');
|
||||
|
||||
// Verify it returns a resolved promise
|
||||
expect(result).toBeInstanceOf(Promise);
|
||||
|
||||
// Clean up spies
|
||||
logUseDefaultsSpy.mockRestore();
|
||||
logSetLevelSpy.mockRestore();
|
||||
logInfoSpy.mockRestore();
|
||||
});
|
||||
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 SkillTree
|
||||
* Copyright 2026 SkillTree
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
Reference in new issue
Block a user