8000 5.3.3 release by ps0002 · Pull Request #70 · CAAPIM/APIHub · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v12.20.2
v22.13.0
Empty file modified LICENSE.md
100755 → 100644
Empty file.
27 changes: 2 additions & 25 deletions Makefile
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ install: package.json ## Install dependencies
copy-config-example: ## Copy config of the example. Usage DEPLOY_ENV=[dev|integration|layer7] make copy-config-example.
cp packages/example/config/config-${DEPLOY_ENV}.js packages/example/public/config.js

copy-config-healthcare: ## Copy config of the healthcare. Usage DEPLOY_ENV=[dev|integration|layer7] make copy-config-healthcare.
cp packages/healthcare/config/config-${DEPLOY_ENV}.js packages/healthcare/public/config.js

generate-mock-data: ## Generate new data for the mock server. Usage OUTPUT_FILE=my-file.json make generate-mock-data. OUTPUT_FILE is optionnal.
./packages/layer7-apihub-mock/bin/generateData.js ${OUTPUT_FILE}

#### Build ####

build: ## Build the library
Expand All @@ -28,18 +22,12 @@ build: ## Build the library
build-example: ## Build the example
@yarn build-example

build-healthcare: ## Build the healthcare
@yarn build-healthcare


#### Run ####

start: copy-config-example build ## Starts the application in development mode
@yarn start-example

start-healthcare: copy-config-healthcare build ## Starts the application in development mode
@yarn start-healthcare

watch-lib: ## Starts the library in development mode
@yarn start-lib

Expand All @@ -54,7 +42,7 @@ test-unit: ## Runs the unit tests. Usage make test-unit.
test-unit-coverage: ## Runs the unit tests with coverage report. Usage make test-unit-coverage.
@yarn test:coverage

test-e2e: copy-config-example build build-example ## Runs the end-to-end tests. Usage BROWSER=[chrome|firefox] make test-e2e.
test-e2e: build build-example ## Runs the end-to-end tests. Usage BROWSER=[chrome|firefox] make test-e2e.
@NODE_ENV=test cd cypress && yarn -s start

test-e2e-local: ## Opens the end-to-end tests GUI. Usage make test-e2e-local.
Expand All @@ -68,25 +56,14 @@ lint: ## Runs linting tools


#### Deployment ####

copy-deploy-config-example: ## Copy config of the example. Usage DEPLOY_ENV=[dev|integration|staging] make copy-deploy-config-example.
cp packages/example/config/config-${DEPLOY_ENV}.js packages/example/build/config.js

copy-deploy-config-healthcare: ## Copy config of the healthcare. Usage DEPLOY_ENV=[dev|integration|staging] make copy-deploy-config-healthcare.
cp packages/healthcare/config/config-${DEPLOY_ENV}.js packages/healthcare/build/config.js

deploy-example: copy-deploy-config-example ## Deploy the example on AWS S3. Usage DEPLOY_ENV=[dev|integration|staging] make deploy-example.
aws s3 rm s3://broadcom-apihub.marmelab.com/example --recursive
aws s3 sync packages/example/build/ s3://broadcom-apihub.marmelab.com/example
aws s3 cp packages/example/build/index.html s3://broadcom-apihub.marmelab.com/example/index.html --cache-control="max-age=120"
aws cloudfront create-invalidation --distribution-id E1AOZQ3R1CQ7R6 --paths "/*"

deploy-healthcare: copy-deploy-config-healthcare ## Deploy the healthcare on AWS S3. Usage DEPLOY_ENV=[dev|integration|staging] make deploy-healthcare.
aws s3 rm s3://broadcom-apihub.marmelab.com/healthcare --recursive
aws s3 sync packages/healthcare/build/ s3://broadcom-apihub.marmelab.com/healthcare
aws s3 cp packages/healthcare/build/index.html s3://broadcom-apihub.marmelab.com/healthcare/index.html --cache-control="max-age=120"
aws cloudfront create-invalidation --distribution-id E2X6V50RZK09GM --paths "/*"

deploy: build build-example build-healthcare ## Deploy all on AWS S3. Usage DEPLOY_ENV=[dev|integration|staging] make deploy.
deploy: build build-example ## Deploy all on AWS S3. Usage DEPLOY_ENV=[dev|integration|staging] make deploy.
make deploy-example
make deploy-healthcare
Empty file modified OVERVIEW.md
100755 → 100644
Empty file.
78 changes: 7 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,6 @@ The Example app has the same source code as the standard API Hub. [The Example a
- [Auto-detect the API Hub URL](./packages/example/README.md##auto-detect-the-api-hub-url)
- [Customization Tutorials](./packages/example/README.md##customization-tutorials)

### Healthcare App [Deprecated]

> **_Note:_** The Healthcare app is now deprecated. It will no longer be actively maintained and will not receive new features or updates, including bug fixes. This deprecation is part of our ongoing efforts to improve the repository and streamline functionality.
[The Healthcare app](./packages/healthcare/README.md) demonstrates a possible customized variation of API Hub with a Healthcare theme. It includes the same developer features as the Example app. It further extends the API Hub to include custom pages and additional calls (PAPI and Portal Metrics API). You use this app with the mock server.

The Healthcare app README includes the following information:

- [Available users](./packages/healthcare/README.md##available-users)
- [Customize the Healthcare app](./packages/layer7-apihub-mock/README.md##customize-the-healthcare-app)

### Layer7 API Hub Mock Server [Deprecated]

> **_Note:_** Layer7 API Hub Mock Server is now deprecated. It will no longer be actively maintained and will not receive new features or updates, including bug fixes. This deprecation is part of our ongoing efforts to improve the repository and streamline functionality.
[The Layer7 API Hub mock server README](./packages/layer7-apihub-mock/README.md) includes the following information:

- [Start the mock server in your client application](./packages/layer7-apihub-mock/README.md##start-the-cock-server-in-your-client-application)
- [Available users](./packages/layer7-apihub-mock/README.md##available-users)
- [Customize the mock server](./packages/layer7-apihub-mock/README.md##customize-the-mock-server)

### Cypress End-To-End Testing

The end-to-end (E2E) tests are for the Example app.

For more information about this testing, see [the Cypress - End-To-End Testing README](./cypress/README.md).

## Quick Start

Expand All @@ -61,7 +35,7 @@ Before setting up your local development environment, ensure that you have compl

- You have installed [Yarn](https://yarnpkg.com/).
- You have installed GNU Make 3.81 or later.
- You have installed Node v12.20.2.
- You have installed Node v22.13.0.

### Install the JavaScript Dependencies

Expand All @@ -81,12 +55,6 @@ To start the **Example app**, issue the following command:
make start
```

To start the **Healthcare app**, issue the following command:

```sh
make start-healthcare
```

### Run the Tests

Run the unit tests and the E2E tests by issuing the following command:
Expand All @@ -103,20 +71,6 @@ Run only the unit tests by issuing the following command:
make test-unit
```

#### End-To-End Tests

Run only the E2E tests:

```sh
make test-e2e
```

Open the E2E tests GUI (useful for writing and debugging E2E tests):

```sh
make test-e2e-local
```

## Deploy the Example App

Build the API Hub library, the Example app, and then copy the production configuration by issuing the following commands:
Expand Down Expand Up @@ -149,10 +103,11 @@ $ cd packages && yarn create react-app my-own-apihub --scripts-version=3.2.0
# in packages/my-own-apihub/package.json
"dependencies": {
"layer7-apihub": "~1.0.0",
"layer7-apihub-mock": "~1.0.0",
"react": "~16.13.1",
"react-admin": "~3.6.2",
"react-scripts": "~3.2.0"
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-admin": "^5.7.3",
"react-helmet": "~6.1.0",
"tss-react": "~4.9.4"
},
```

Expand Down Expand Up @@ -191,26 +146,7 @@ const App = () => {
};
```

6. Add the mock server to the `index.js` file

```js
// in packages/my-own-apihub/src/index.js
import { startApiHubMockedServer } from 'layer7-apihub-mock';
...
const { ENABLE_MOCK, MOCK_SERVER_INDICATOR_LINK } = global.APIHUB_CONFIG;
export const shouldEnableMock = (enableMock = ENABLE_MOCK) =>
enableMock === 'true' || enableMock === true;
if (!shouldEnableMock(ENABLE_MOCK)) {
ReactDOM.render(<App />, document.getElementById('root'));
} else {
console.log('Starting the mocked server');
startApiHubMockedServer({
runningIndicatorLink: MOCK_SERVER_INDICATOR_LINK,
}).then(() => ReactDOM.render(<App />, document.getElementById('root')));
}
```

7. Start the bare-bones my-own-apihub app by issuing the following commands:
6. Start the bare-bones my-own-apihub app by issuing the following commands:

```
$ cd packages/my-own-apihub
Expand Down
31 changes: 31 additions & 0 deletions conf/ci/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved. -->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>artifactory</id>
<mirrorOf>*</mirrorOf>
<url>https://usw1.packages.broadcom.com:443/artifactory/apim-maven-virtual</url>
</mirror>
</mirrors>
<servers>
<server>
<id>artifactory</id>
<username>${artifactory.username}</username>
<password>${artifactory.password}</password>
</server>
<server>
<id>layer7-snapshot-repo</id>
<username>${artifactory.username}</username>
<password>${artifactory.password}</password>
</server>
<server>
<id>layer7-release-repo</id>
<username>${artifactory.username}</username>
<password>${artifactory.password}</password>
</server>
</servers>
</settings>

Empty file modified cypress/.eslintrc
100755 → 100644
Empty file.
Empty file modified cypress/README.md
100755 → 100644
Empty file.
Empty file modified cypress/cypress.json
100755 → 100644
Empty file.
2 changes: 2 additions & 0 deletions cypress/integration/accountSetup.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.

// / <reference types="Cypress" />

describe('Account Setup', () => {
Expand Down
2 changes: 2 additions & 0 deletions cypress/integration/apis.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.

// / <reference types="Cypress" />

import { login } from '../support/login';
Expand Down
2 changes: 2 additions & 0 deletions cypress/integration/applications.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.

// / <reference types="Cypress" />

import { login } from '../support/login';
Expand Down
1 change: 1 addition & 0 deletions cypress/integration/authentication.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.
import { login, logout } from '../support/login';

describe('Authentication', () => {
Expand Down
1 change: 1 addition & 0 deletions cypress/integration/homepage.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.
import { login } from '../support/login';
import defaultData from '../../packages/layer7-apihub-mock/src/defaultData.json';

Expand Down
2 changes: 2 additions & 0 deletions cypress/integration/newPassword.js
85EA
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.

// / <reference types="Cypress" />

describe('New Password', () => {
Expand Down
2 changes: 2 additions & 0 deletions cypress/integration/resetPassword.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.

// / <reference types="Cypress" />

describe('Reset Password', () => {
Expand Down
1 change: 1 addition & 0 deletions cypress/integration/user.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.
import { login } from '../support/login';
import {
openUserProfile,
Expand Down
2 changes: 2 additions & 0 deletions cypress/integration/wiki.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.

// / <reference types="Cypress" />

import { login } from '../support/login';
Expand Down
Empty file modified cypress/package.json
100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions cypress/plugins/index.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.
const wp = require('@cypress/webpack-preprocessor');
const task = require('cypress-skip-and-only-ui/task');

Expand Down
1 change: 1 addition & 0 deletions cypress/server.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.
const express = require('express');
const path = require('path');

Expand Down
1 change: 1 addition & 0 deletions cypress/start.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.
const cypress = require('cypress');

const server = require('./server');
Expand Down
1 change: 1 addition & 0 deletions cypress/support/commands.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.
let LOCAL_STORAGE_MEMORY = {};

Cypress.Commands.add('saveLocalStorageCache', () => {
Expand Down
1 change: 1 addition & 0 deletions cypress/support/index.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.
require('cypress-skip-and-only-ui/support');
require('@testing-library/cypress/add-commands');
require('./loadData');
Expand Down
1 change: 1 addition & 0 deletions cypress/support/loadData.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.
import defaultData from '../../packages/layer7-apihub-mock/src/defaultData.json';

Cypress.Commands.add('loadData', (data = defaultData) => {
Expand Down
1 change: 1 addition & 0 deletions cypress/support/login.js
100755 → 100644
3360
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.
import { openUserMenu } from './userMenu';

export const login = (username, password) => {
Expand Down
1 change: 1 addition & 0 deletions cypress/support/userMenu.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.
export const openUserMenu = () => {
cy.findByLabelText('Profile').click({ force: true });
};
1 change: 1 addition & 0 deletions cypress/support/userProfile.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.
import { openUserMenu } from './userMenu';

export const openUserProfile = () => {
Expand Down
1 change: 1 addition & 0 deletions cypress/webpack.config.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright © 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved.
module.exports = {
resolve: {
extensions: ['.js'],
Expand Down
46 changes: 25 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
"private": true,
"name": "broadcom-api-hub",
"scripts": {
"build": "yarn build-lib && yarn build-mock",
"build": "yarn build-lib",
"build-lib": "cd packages/layer7-apihub && yarn build",
"build-mock": "cd packages/layer7-apihub-mock && yarn build",
"build-example": "cd packages/example && yarn build",
"build-healthcare": "cd packages/healthcare && yarn build",
"start-example": "concurrently \"yarn start-lib\" \"yarn start-mock\" \"cd packages/example && yarn start\"",
"start-healthcare": "concurrently \"yarn start-lib\" \"yarn start-mock\" \"cd packages/healthcare && yarn start\"",
"start-example": "concurrently \"yarn start-lib\" \"cd packages/example && yarn start\"",
"start-lib": "cd packages/layer7-apihub && yarn dev",
"start-mock": "cd packages/layer7-apihub-mock && yarn dev",
"test": "cd packages/layer7-apihub && yarn test",
"test:coverage": "cd packages/layer7-apihub && yarn test:coverage",
"lint": "eslint --fix ."
Expand All @@ -22,32 +18,40 @@
"devDependencies": {
"babel-eslint": "^10.1.0",
"concurrently": "~5.1.0",
"eslint": "~7.11.0",
"eslint-config-prettier": "~6.15.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-prettier": "~3.1.4",
"eslint": "~8.25.0",
"eslint-config-prettier": "^10.0.1",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-react": "7.37.4",
"eslint-plugin-react-hooks": "5.1.0",
"lint-staged": "~10.0.7",
"prettier": "~1.19.1"
"prettier": "^3.5.2",
"@typescript-eslint/eslint-plugin": "8.25.0",
"@typescript-eslint/parser": "8.25.0"
},
"resolutions": {
"@babel/plugin-transform-for-of": "7.12.13",
"@testing-library/dom": "~6.11.0",
"@testing-library/react": "~11.0.0",
"@material-ui/core": "~4.10.0",
"@material-ui/lab": "~4.0.0-alpha.54",
"@material-ui/styles": "~4.10.0",
"@material-ui/system": "~4.9.14",
"@material-ui/types": "~5.1.0",
"@uiw/react-markdown-preview": "3.4.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "^14.3.1",
"@testing-library/user-event": "^14.6.1",
"@mui/icons-material": "^5.16.12",
"@mui/material": "^5.16.12",
"@uiw/react-markdown-preview": "~5.1.3",
"tss-react": "~4.9.4",
"bl": "~4.0.3",
"cypress": "~5.6.0",
"date-fns": "~2.9.0",
"dompurify": "^2.5.6",
"es-abstract": "~1.19.0",
"elliptic": "~6.5.7",
"get-intrinsic": "~1.1.3",
"serialize-javascript": "~6.0.2",
"qs": "6.9.7",
"react": "^18.3.1",
"react-admin": "^5.7.3",
"react-dom": "^18.3.1",
"react-router": "^6.28.1",
"react-router-dom": "^6.28.1",
"rehype-ignore": "1.0.1",
"ua-parser-js": "0.7.35",
"url-parse": "^1.5.9",
Expand Down
Loading
0