Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a072fa8
veracode task version update
shiyuanzhao-lf Nov 11, 2025
5d55802
update string for spanish
Dec 9, 2025
db1831d
Update main.yml
alexgomezlf Dec 9, 2025
f887285
Update GitHub Actions workflow configuration
alexgomezlf Dec 10, 2025
4848605
comment self-hosted tests for now
Dec 10, 2025
fa627e7
don't run tests
Dec 10, 2025
6715e49
remove dependencies on test_libraries
Dec 10, 2025
80a3790
update environment
Dec 10, 2025
169d345
add integration tests back
Dec 10, 2025
daa8e0f
dummy commit to trigger build
Dec 12, 2025
e8d58b7
dummy commit to trigger build
Dec 29, 2025
0f475ed
dummy commit to trigger tests
Dec 29, 2025
7d87fd3
updated Jest and fixed DatetimeUtils tests
paolo-arge-lf Dec 30, 2025
7cf9ac6
Removed jest-runner-groups dependency
paolo-arge-lf Dec 30, 2025
a5fe11b
Removed jest-runner-groups dependency
paolo-arge-lf Dec 30, 2025
9b63b3f
Removed jest-runner-groups dependency
paolo-arge-lf Dec 30, 2025
ea051b2
Removed jest-runner-groups dependency
paolo-arge-lf Dec 30, 2025
72d2fc6
Removed jest-runner-groups dependency
paolo-arge-lf Dec 30, 2025
5fbc862
Fix lint error
paolo-arge-lf Dec 30, 2025
c15c0e8
lint
paolo-arge-lf Dec 30, 2025
8b792aa
LINT - Unit Test - Clean pnpm audit
paolo-arge-lf Dec 30, 2025
efe134b
fix vscode test explorer
paolo-arge-lf Dec 30, 2025
e736f66
dummy commit to trigger build
Dec 30, 2025
1d480d6
Merge branch 'shiyuan/fix_veracode_task' of https://github.com/Laserf…
Dec 30, 2025
600db64
dummy commit to trigger build
Dec 30, 2025
3774367
Format on save
paolo-arge-lf Dec 30, 2025
71fb84f
Enabled PKCEUtils tests
paolo-arge-lf Dec 30, 2025
811dac1
demoved todo
paolo-arge-lf Dec 30, 2025
7ea53e7
lint
paolo-arge-lf Dec 30, 2025
f4018f3
dummy .env
paolo-arge-lf Dec 30, 2025
520eff4
env
paolo-arge-lf Dec 30, 2025
d7fdb93
tests
paolo-arge-lf Dec 30, 2025
c9ab8ee
Added REPOSITORY_ID_CLOUD env for testing
paolo-arge-lf Dec 30, 2025
ada2361
.env
paolo-arge-lf Dec 31, 2025
38adf89
.env
paolo-arge-lf Dec 31, 2025
af9e5d4
test yaml
paolo-arge-lf Dec 31, 2025
b2768b2
ts tests only
paolo-arge-lf Dec 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 56 additions & 50 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,50 +149,58 @@ jobs:
id: test-cloud
env:
ACCESS_KEY: ${{ secrets.DEV_CA_PUBLIC_USE_INTEGRATION_TEST_ACCESS_KEY }}
ACCESS_KEY_JSON: ${{ secrets.DEV_CA_PUBLIC_USE_INTEGRATION_TEST_ACCESS_KEY_JSON }}
SERVICE_PRINCIPAL_KEY: ${{ secrets.DEV_CA_PUBLIC_USE_TESTOAUTHSERVICEPRINCIPAL_SERVICE_PRINCIPAL_KEY }}
run: pnpm --filter @laserfiche/lf-api-client-core run test:Cloud

- name: pnpm test lf-api-client-core on self-hosted
if: always() && (steps.test-cloud.outcome == 'success' || steps.test-cloud.outcome == 'failure')
env:
REPOSITORY_ID: ${{ secrets.APISERVER_REPOSITORY_ID }}
APISERVER_USERNAME: ${{ secrets.APISERVER_USERNAME }}
APISERVER_PASSWORD: ${{ secrets.APISERVER_PASSWORD }}
APISERVER_REPOSITORY_API_BASE_URL: ${{ secrets.APISERVER_REPOSITORY_API_BASE_URL }}
run: pnpm --filter @laserfiche/lf-api-client-core run test:SelfHosted

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
with:
name: Client Core Jest Test Results
path: ./packages/lf-api-client-core-js/*.xml
reporter: jest-junit
only-summary: 'false'
list-tests: 'failed'
fail-on-error: 'false'

- name: pnpm test @laserfiche/lf-repository-api-client run all cloud tests
# - name: pnpm test lf-api-client-core on self-hosted
# if: always() && (steps.test-cloud.outcome == 'success' || steps.test-cloud.outcome == 'failure')
# env:
# REPOSITORY_ID: ${{ secrets.APISERVER_REPOSITORY_ID }}
# APISERVER_USERNAME: ${{ secrets.APISERVER_USERNAME }}
# APISERVER_PASSWORD: ${{ secrets.APISERVER_PASSWORD }}
# APISERVER_REPOSITORY_API_BASE_URL: ${{ secrets.APISERVER_REPOSITORY_API_BASE_URL }}
# run: pnpm --filter @laserfiche/lf-api-client-core run test:SelfHosted

# - name: Test Report lf-api-client-core
# uses: dorny/test-reporter@v1
# if: success() || failure() # run this step even if previous step failed
# with:
# name: Client Core Jest Test Results
# path: ./packages/lf-api-client-core-js/*.xml
# reporter: jest-junit
# only-summary: 'false'
# list-tests: 'failed'
# fail-on-error: 'false'

- name: pnpm test @laserfiche/lf-repository-api-client run all cloud node tests
env:
ACCESS_KEY: ${{ secrets.DEV_US_PUBLIC_USE_INTEGRATION_TEST_ACCESS_KEY }}
SERVICE_PRINCIPAL_KEY: ${{ secrets.DEV_US_PUBLIC_USE_TESTOAUTHSERVICEPRINCIPAL_SERVICE_PRINCIPAL_KEY }}
REPOSITORY_ID: ${{ secrets.DEV_US_PUBLIC_USE_REPOSITORY_ID_1 }}
REPOSITORY_ID_CLOUD: ${{ secrets.DEV_US_PUBLIC_USE_REPOSITORY_ID_1 }}
AUTHORIZATION_TYPE: ${{ secrets.AUTHORIZATION_TYPE }}
TEST_HEADER: ${{ secrets.TEST_HEADER }}
run: pnpm --filter @laserfiche/lf-repository-api-client run test:all
run: pnpm --filter @laserfiche/lf-repository-api-client run test:node

- name: pnpm test @laserfiche/lf-repository-api-client run all self-hosted tests
- name: pnpm test @laserfiche/lf-repository-api-client run all cloud browser tests
env:
ACCESS_KEY: ${{ secrets.DEV_US_PUBLIC_USE_INTEGRATION_TEST_ACCESS_KEY }}
SERVICE_PRINCIPAL_KEY: ${{ secrets.DEV_US_PUBLIC_USE_TESTOAUTHSERVICEPRINCIPAL_SERVICE_PRINCIPAL_KEY }}
REPOSITORY_ID: ${{ secrets.APISERVER_REPOSITORY_ID }}
APISERVER_USERNAME: ${{ secrets.APISERVER_USERNAME }}
APISERVER_PASSWORD: ${{ secrets.APISERVER_PASSWORD }}
APISERVER_REPOSITORY_API_BASE_URL: ${{ secrets.APISERVER_REPOSITORY_API_BASE_URL }}
AUTHORIZATION_TYPE: ${{ secrets.APISERVER_AUTHORIZATION_TYPE }}
REPOSITORY_ID_CLOUD: ${{ secrets.DEV_US_PUBLIC_USE_REPOSITORY_ID_1 }}
AUTHORIZATION_TYPE: ${{ secrets.AUTHORIZATION_TYPE }}
TEST_HEADER: ${{ secrets.TEST_HEADER }}
run: pnpm --filter @laserfiche/lf-repository-api-client run test:all
run: pnpm --filter @laserfiche/lf-repository-api-client run test:browser

# - name: pnpm test @laserfiche/lf-repository-api-client run all self-hosted tests
# env:
# ACCESS_KEY: ${{ secrets.DEV_US_PUBLIC_USE_INTEGRATION_TEST_ACCESS_KEY }}
# SERVICE_PRINCIPAL_KEY: ${{ secrets.DEV_US_PUBLIC_USE_TESTOAUTHSERVICEPRINCIPAL_SERVICE_PRINCIPAL_KEY }}
# REPOSITORY_ID: ${{ secrets.APISERVER_REPOSITORY_ID }}
# APISERVER_USERNAME: ${{ secrets.APISERVER_USERNAME }}
# APISERVER_PASSWORD: ${{ secrets.APISERVER_PASSWORD }}
# APISERVER_REPOSITORY_API_BASE_URL: ${{ secrets.APISERVER_REPOSITORY_API_BASE_URL }}
# AUTHORIZATION_TYPE: ${{ secrets.APISERVER_AUTHORIZATION_TYPE }}
# TEST_HEADER: ${{ secrets.TEST_HEADER }}
# run: pnpm --filter @laserfiche/lf-repository-api-client run test:all

- name: Test Report
uses: dorny/test-reporter@v1
Expand All @@ -210,7 +218,7 @@ jobs:
env:
ACCESS_KEY: ${{ secrets.DEV_CA_PUBLIC_USE_INTEGRATION_TEST_ACCESS_KEY }}
SERVICE_PRINCIPAL_KEY: ${{ secrets.DEV_CA_PUBLIC_USE_TESTOAUTHSERVICEPRINCIPAL_SERVICE_PRINCIPAL_KEY }}
REPOSITORY_ID: ${{ secrets.DEV_CA_PUBLIC_USE_REPOSITORY_ID_1 }}
REPOSITORY_ID_CLOUD: ${{ secrets.DEV_CA_PUBLIC_USE_REPOSITORY_ID_1 }}
AUTHORIZATION_TYPE: ${{ secrets.AUTHORIZATION_TYPE }}
TEST_HEADER: ${{ secrets.TEST_HEADER }}
run: pnpm --filter @laserfiche/lf-repository-api-client-v2 run test:node
Expand All @@ -220,7 +228,7 @@ jobs:
env:
ACCESS_KEY: ${{ secrets.DEV_CA_PUBLIC_USE_INTEGRATION_TEST_ACCESS_KEY }}
SERVICE_PRINCIPAL_KEY: ${{ secrets.DEV_CA_PUBLIC_USE_TESTOAUTHSERVICEPRINCIPAL_SERVICE_PRINCIPAL_KEY }}
REPOSITORY_ID: ${{ secrets.DEV_CA_PUBLIC_USE_REPOSITORY_ID_3 }}
REPOSITORY_ID_CLOUD: ${{ secrets.DEV_CA_PUBLIC_USE_REPOSITORY_ID_3 }}
AUTHORIZATION_TYPE: ${{ secrets.AUTHORIZATION_TYPE }}
TEST_HEADER: ${{ secrets.TEST_HEADER }}
run: pnpm --filter @laserfiche/lf-repository-api-client-v2 run test:browser
Expand Down Expand Up @@ -252,7 +260,7 @@ jobs:

build_documentation:
runs-on: ubuntu-latest
needs: [build_libraries, test_libraries]
needs: [build_libraries]
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -302,9 +310,9 @@ jobs:

publish-all-preview-packages:
runs-on: ubuntu-latest
environment: preview
environment: npm_publish
if: ${{ github.run_attempt != 1 }}
needs: [build_libraries, test_libraries, build_documentation]
needs: [build_libraries, build_documentation]
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -349,6 +357,9 @@ jobs:
with:
node-version: '20'

- name: Update npm
run: npm install -g npm@latest

- name: Install pnpm
run: npm install pnpm@latest-9 -g

Expand Down Expand Up @@ -410,11 +421,6 @@ jobs:
- name: PNPM install
run: pnpm install --no-frozen-lockfile

- name: Set publishing config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

- name: pnpm publish all preview packages
id: publish-preview-npm
run: pnpm publish --recursive --access public --tag next --no-git-checks --force
Expand All @@ -426,9 +432,9 @@ jobs:

publish-updated-production-packages:
runs-on: ubuntu-latest
environment: production
environment: npm_publish
if: ${{ github.run_attempt != 1 }}
needs: [build_libraries, test_libraries, build_documentation]
needs: [build_libraries, build_documentation]
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -473,6 +479,9 @@ jobs:
with:
node-version: '20'

- name: Update npm
run: npm install -g npm@latest

- name: Install pnpm
run: npm install pnpm@latest-9 -g

Expand Down Expand Up @@ -503,11 +512,6 @@ jobs:
- name: PNPM install
run: pnpm install

- name: Set publishing config
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

- name: pnpm publish all packages that version changed
id: publish-prod-npm
run: pnpm publish --recursive --access public --tag latest --no-git-checks
Expand All @@ -520,11 +524,13 @@ jobs:
publish_documentation:
runs-on: ubuntu-latest
if: ${{ github.run_attempt != 1 }}
needs: [build_libraries, test_libraries, build_documentation]
needs: [build_libraries, build_documentation]
environment: github-pages
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: github-pages

artifact_name: github-pages

2 changes: 1 addition & 1 deletion .github/workflows/veracode-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: tar -czvf ./veracode/lf-repository-api-v1.tar.gz ./packages/lf-repository-api-client-v1/dist

- name: Veracode Upload And Scan (Static Application Security Testing)
uses: veracode/veracode-uploadandscan-action@0.2.6
uses: veracode/veracode-uploadandscan-action@0.2.10
with:
appname: 'lf-api-js'
createprofile: true
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"recommendations": [
"epivision.vscode-file-header"
"epivision.vscode-file-header",
"orta.vscode-jest"
]
}
71 changes: 71 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Jest Tests",
"runtimeArgs": [
"--experimental-vm-modules",
"${workspaceFolder}/node_modules/jest/bin/jest.js",
"--runInBand",
"--no-cache"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"cwd": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "Debug Current Test File",
"runtimeArgs": [
"--experimental-vm-modules",
"${workspaceFolder}/node_modules/jest/bin/jest.js",
"--runInBand",
"--no-cache",
"${relativeFile}"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"cwd": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "Debug Test by Name",
"runtimeArgs": [
"--experimental-vm-modules",
"${workspaceFolder}/node_modules/jest/bin/jest.js",
"--runInBand",
"--no-cache",
"--testNamePattern",
"${input:testName}"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"cwd": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "vscode-jest-tests.v2.lf-api-js",
"runtimeArgs": [
"--experimental-vm-modules",
"${workspaceFolder}/node_modules/jest/bin/jest.js",
"--runInBand",
"--watchAll=false"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"cwd": "${workspaceFolder}"
}
],
"inputs": [
{
"id": "testName",
"type": "promptString",
"description": "Enter test name pattern to run"
}
]
}
27 changes: 23 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
{
"cSpell.words": ["fesm"],
"editor.formatOnSave": true,
"cSpell.words": [
"APISERVER",
"fesm",
"maxpagesize"
],
"angular.enable-strict-mode-prompt": false,
// Jest extension configuration for monorepo
"jest.disabledWorkspaceFolders": [],
"jest.jestCommandLine": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
"jest.runMode": "on-demand",
"jest.monitorLongRun": 60000,
"jest.outputConfig": "terminal-based",
"powerHeader.commentMode": "line",
"powerHeader.autoInsert.enable": true,
"powerHeader.autoInsert.allow": "all",
"powerHeader.template": "Copyright <author>.\\nLicensed under the <licenseType> License. See LICENSE in the project root for license information.",
"powerHeader.variables": ["<author>='Laserfiche'", "<licenseType>='MIT'"],
"powerHeader.variables": [
"<author>='Laserfiche'",
"<licenseType>='MIT'"
],
"[html]": {
"powerHeader.commentMode": "block"
},
Expand All @@ -15,5 +29,10 @@
"[markdown]": {
"powerHeader.commentMode": "block"
},
"powerHeader.autoInsert.languages": ["plaintext", "Log", "json"]
}
"powerHeader.autoInsert.languages": [
"plaintext",
"Log",
"json"
],
"testing.automaticallyOpenTestResults": "neverOpen"
}
44 changes: 39 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Contains the following packages:
## To build

- To build all projects run `pnpm run build`
- To lint run: `pnpm turbo lint`

## To build a specific library

Expand All @@ -26,16 +27,49 @@ Contains the following packages:

## To run a command on a specific library (for example tests)

- To run integration tests locally:
- Create a `.env` file containing the required env variables (e.g. from \*BitWarden - github.com/Laserfiche/lf-api-js)

```
AUTHORIZATION_TYPE="CLOUD_ACCESS_KEY or API_SERVER_USERNAME_PASSWORD"
REPOSITORY_ID="***your-secret***"
APISERVER_REPOSITORY_API_BASE_URL="***your-secret***"
APISERVER_USERNAME="***your-secret***"
APISERVER_PASSWORD="***your-secret***"
REPOSITORY_ID_CLOUD="***your-secret***"
ACCESS_KEY="***your-secret***"
SERVICE_PRINCIPAL_KEY="***your-secret***"
```

- Run `pnpm --filter ${project_name} run ${script_name}`
- Example to run the "cloud" tests on `@laserfiche/lf-api-client-core` run `pnpm --filter @laserfiche/lf-api-client-core run test:Cloud`
- Test scripts for lf-js-utils:
- `pnpm --filter @laserfiche/lf-js-utils run test`

- Test scripts for lf-api-client-core:
- To run locally, copy .env in package root folder
- `pnpm --filter @laserfiche/lf-api-client-core run test:unit`
- `pnpm --filter @laserfiche/lf-api-client-core run test:Cloud`
- `pnpm --filter @laserfiche/lf-api-client-core run test:SelfHosted`

- Test scripts for lf-repository-api-client-v1:
- To run locally, copy .env in package root folder
- `pnpm --filter @laserfiche/lf-repository-api-client run test:unit`
- `pnpm --filter @laserfiche/lf-repository-api-client run test:browser`
- `pnpm --filter @laserfiche/lf-repository-api-client run test:node`

- Test scripts for lf-repository-api-client-v2:
- To run locally, copy .env in package root folder
- `pnpm --filter @laserfiche/lf-repository-api-client-v2 run test:unit`
- `pnpm --filter @laserfiche/lf-repository-api-client-v2 run test:browser`
- `pnpm --filter @laserfiche/lf-repository-api-client-v2 run test:node`

## To publish a new package

1. Update the version in [main.yml](https://github.com/Laserfiche/lf-api-js/blob/main/.github/workflows/main.yml) for the package that you want to update
- `NPM_API_CLIENT_V1_VERSION` for `@laserfiche/lf-repository-api-client`
- `NPM_API_CLIENT_V2_VERSION` for `@laserfiche/lf-repository-api-client-v2`
- `NPM_CLIENT_CORE_VERSION` for `@laserfiche/lf-api-client-core`
1. Update CHANGELOG in the folder for the package you are updating (i.e. `packages/lf-repository-api-client-v1`)
- `NPM_API_CLIENT_V1_VERSION` for `@laserfiche/lf-repository-api-client`
- `NPM_API_CLIENT_V2_VERSION` for `@laserfiche/lf-repository-api-client-v2`
- `NPM_CLIENT_CORE_VERSION` for `@laserfiche/lf-api-client-core`
1. Update CHANGELOG in the folder for the package you are updating (i.e. `packages/lf-repository-api-client-v1`)
1. Run pipeline in Github and publish preview package
1. Test preview package
1. Run publish production package
Loading
Loading