Skip to content

Commit

Permalink
Merge branch 'main' into fix/1051/manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasqueck committed Jun 12, 2023
2 parents f108b7c + e91e129 commit 2f9db7f
Show file tree
Hide file tree
Showing 136 changed files with 575 additions and 141 deletions.
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/no-floating-promises": ["error"],
"@typescript-eslint/consistent-type-imports": [
"error",
{
Expand Down Expand Up @@ -88,9 +89,11 @@
"files": ["**/test/**/*.js", "**/test/**/*.ts", "**/test/**/*.tsx"],
"rules": {
"no-console": "off",
"jsdoc/require-jsdoc": "off",
"jsdoc/require-returns-description": "off",
"jsdoc/require-param-description": "off",
"max-nested-callbacks": ["warn", 5]
"max-nested-callbacks": ["warn", 5],
"sonarjs/cognitive-complexity": "off"
}
}
],
Expand Down
1 change: 1 addition & 0 deletions examples/odata-cli/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"extends": ["../../.eslintrc"],
"parserOptions": { "project": "./tsconfig.eslint.json" },
"rules": {
"no-console": "off"
}
Expand Down
10 changes: 10 additions & 0 deletions examples/odata-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @sap-ux/odata-cli

## 0.11.20

### Patch Changes

- 25911701: Fix for 'promises must be awaited' sonar issues
- Updated dependencies [25911701]
- @sap-ux/axios-extension@1.2.8
- @sap-ux/btp-utils@0.11.6
- @sap-ux/logger@0.3.6

## 0.11.19

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/odata-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sap-ux/odata-cli",
"version": "0.11.19",
"version": "0.11.20",
"description": "Simple example CLI uing the @sap-ux/axios-extension module to fetch metadata and annotations from an SAP system.",
"license": "SEE LICENSE IN LICENSE",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/odata-cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ if (isAppStudio()) {
target = args.length > 0 ? args[0] : 'unknown';
activity = args.length > 1 ? args[1] : 'odata';
}
targets[target](processEnv, activities[activity]);
targets[target](processEnv, activities[activity]).catch((error) => console.error(error));
8 changes: 4 additions & 4 deletions examples/odata-cli/src/targets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function testWithAbapSystem(
password: env.TEST_PASSWORD
}
});
activity(provider, env);
activity(provider, env).catch((error) => console.error(error));
}

/**
Expand Down Expand Up @@ -98,7 +98,7 @@ export async function testWithCloudAbapSystem(
url: env.TEST_SYSTEM,
ignoreCertErrors: env.TEST_IGNORE_CERT_ERRORS === 'true'
});
activity(provider, env);
activity(provider, env).catch((error) => console.error(error));
}

/**
Expand Down Expand Up @@ -132,15 +132,15 @@ export async function testWithDestination(
: {},
destinations[env.TEST_DESTINATION]
) as AbapServiceProvider;
activity(provider, env);
activity(provider, env).catch((error) => console.error(error));

const provider2 = createForDestination(
{
cookies: provider.cookies.toString()
},
destinations[env.TEST_DESTINATION]
) as AbapServiceProvider;
activity(provider2, env);
activity(provider2, env).catch((error) => console.error(error));
} else {
logger.info(`Invalid destination ${env.TEST_DESTINATION}`);
}
Expand Down
4 changes: 4 additions & 0 deletions examples/odata-cli/tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"include": ["src", "test"]
}
1 change: 1 addition & 0 deletions examples/simple-generator/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"extends": ["../../.eslintrc"],
"parserOptions": { "project": "./tsconfig.eslint.json" },
"rules": {
"quote-props": 0
}
Expand Down
13 changes: 13 additions & 0 deletions examples/simple-generator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @sap-ux/generator-simple-fe

## 0.2.116

### Patch Changes

- 25911701: Fix for 'promises must be awaited' sonar issues
- Updated dependencies [25911701]
- @sap-ux/axios-extension@1.2.8
- @sap-ux/btp-utils@0.11.6
- @sap-ux/fiori-elements-writer@0.12.11
- @sap-ux/fiori-freestyle-writer@0.19.8
- @sap-ux/logger@0.3.6
- @sap-ux/store@0.3.11

## 0.2.115

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/simple-generator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sap-ux/generator-simple-fe",
"version": "0.2.115",
"version": "0.2.116",
"description": "Simple example of a yeoman generator for Fiori elements.",
"license": "SEE LICENSE IN LICENSE",
"private": true,
Expand Down
4 changes: 4 additions & 0 deletions examples/simple-generator/tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"include": ["src", "test"]
}
4 changes: 4 additions & 0 deletions packages/app-config-writer/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": ["../../.eslintrc"],
"parserOptions": { "project": "./tsconfig.eslint.json" }
}
13 changes: 13 additions & 0 deletions packages/app-config-writer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# @sap-ux/app-config-writer

## 0.0.19

### Patch Changes

- 25911701: Fix for 'promises must be awaited' sonar issues
- Updated dependencies [25911701]
- @sap-ux/axios-extension@1.2.8
- @sap-ux/btp-utils@0.11.6
- @sap-ux/logger@0.3.6
- @sap-ux/project-access@1.8.1
- @sap-ux/store@0.3.11
- @sap-ux/ui5-config@0.17.1

## 0.0.18

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/app-config-writer/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sap-ux/app-config-writer",
"description": "Add or update configuration for SAP Fiori tools application",
"version": "0.0.18",
"version": "0.0.19",
"repository": {
"type": "git",
"url": "https://github.com/SAP/open-ux-tools.git",
Expand Down
4 changes: 3 additions & 1 deletion packages/app-config-writer/src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ export function t(key: string, options?: TOptions): string {
return i18next.t(key, options);
}

initI18n();
initI18n().catch(() => {
// Ignore any errors since the write will still work
});
4 changes: 4 additions & 0 deletions packages/app-config-writer/tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"include": ["src", "test"]
}
4 changes: 4 additions & 0 deletions packages/axios-extension/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": ["../../.eslintrc"],
"parserOptions": { "project": "./tsconfig.eslint.json" }
}
9 changes: 9 additions & 0 deletions packages/axios-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @sap-ux/axios-extension

## 1.2.8

### Patch Changes

- 25911701: Fix for 'promises must be awaited' sonar issues
- Updated dependencies [25911701]
- @sap-ux/btp-utils@0.11.6
- @sap-ux/logger@0.3.6

## 1.2.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/axios-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sap-ux/axios-extension",
"version": "1.2.7",
"version": "1.2.8",
"description": "Extension of the Axios module adding convenience methods to interact with SAP systems especially with OData services.",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ export async function getReentranceTicket({

// Open browser to handle SAML flow and return the reentrance ticket
const url = `${backend.uiHostname()}${ADT_REENTRANCE_ENDPOINT}?redirect-url=${redirectUrl(redirectPort)}`;
open(url);
open(url)?.catch((error) => logger.error(error));
});
}
20 changes: 10 additions & 10 deletions packages/axios-extension/src/auth/uaa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ export class Uaa {
this.url +
'/oauth/authorize?' +
qs.stringify({
response_type: 'code',
redirect_uri: redirectUri,
client_id: this.clientid
'response_type': 'code',
'redirect_uri': redirectUri,
'client_id': this.clientid
})
);
}
Expand All @@ -120,9 +120,9 @@ export class Uaa {
method: 'POST',
data: qs.stringify({
code: authCode,
grant_type: 'authorization_code',
redirect_uri: redirectUri,
response_type: 'token'
'grant_type': 'authorization_code',
'redirect_uri': redirectUri,
'response_type': 'token'
}),
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
Expand All @@ -143,8 +143,8 @@ export class Uaa {
auth: { username: this.clientid, password: this.clientsecret },
method: 'POST',
data: qs.stringify({
grant_type: 'refresh_token',
refresh_token: refreshToken
'grant_type': 'refresh_token',
'refresh_token': refreshToken
}),
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
Expand Down Expand Up @@ -205,7 +205,7 @@ export class Uaa {
server.listen();
redirect = new Redirect((server.address() as AddressInfo).port);
const oauthUrl = this.getAuthCodeUrl({ redirectUri: redirect.url() });
open(oauthUrl);
open(oauthUrl)?.catch((error) => this.log.error(error));
});
}

Expand Down Expand Up @@ -251,7 +251,7 @@ export class Uaa {

if (newRefreshToken && refreshTokenChangedCb) {
this.log.info('Sending notification that refresh token changed');
refreshTokenChangedCb(newRefreshToken);
await refreshTokenChangedCb(newRefreshToken);
}

this.log.info('Got access token successfully');
Expand Down
4 changes: 2 additions & 2 deletions packages/axios-extension/test/abap/message.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('message helpers', () => {
const msg: SuccessMessage = {
code: '200',
message: '~message',
longtext_url: '/abc/de',
'longtext_url': '/abc/de',
details: [
{ code: '1', message: '~message', severity: 'info' },
{ code: '2', message: '~message', severity: 'warning' }
Expand Down Expand Up @@ -43,7 +43,7 @@ describe('message helpers', () => {
innererror: {
transactionid: '~id',
timestamp: '~time',
Error_Resolution: {
'Error_Resolution': {
abc: '~message',
def: '~message'
},
Expand Down
18 changes: 11 additions & 7 deletions packages/axios-extension/test/auth/uaa.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ describe('UAA', () => {
const refreshToken = 'refreshToken';
const mockedResponse = {
data: {
access_token: accessToken,
refresh_token: refreshToken
'access_token': accessToken,
'refresh_token': refreshToken
}
};

Expand All @@ -79,11 +79,15 @@ describe('UAA', () => {
expect(params.get('response_type')).toBe('code');
const openedUri = params.get('redirect_uri');
expect(openedUri).toBeDefined();
axios.get(openedUri, {
params: {
code: 'authCode'
}
});
if (openedUri) {
axios
.get(openedUri, {
params: {
code: 'authCode'
}
})
.catch((error) => console.error(error));
}
};

await expect(uaaInstance().getAccessToken()).resolves.toEqual(accessToken);
Expand Down
4 changes: 4 additions & 0 deletions packages/axios-extension/tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"include": ["src", "test"]
}
4 changes: 4 additions & 0 deletions packages/backend-proxy-middleware/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": ["../../.eslintrc"],
"parserOptions": { "project": "./tsconfig.eslint.json" }
}
11 changes: 11 additions & 0 deletions packages/backend-proxy-middleware/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @sap-ux/backend-proxy-middleware

## 0.6.56

### Patch Changes

- 25911701: Fix for 'promises must be awaited' sonar issues
- Updated dependencies [25911701]
- @sap-ux/axios-extension@1.2.8
- @sap-ux/btp-utils@0.11.6
- @sap-ux/logger@0.3.6
- @sap-ux/store@0.3.11

## 0.6.55

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/backend-proxy-middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"bugs": {
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Abackend-proxy-middleware"
},
"version": "0.6.55",
"version": "0.6.56",
"license": "Apache-2.0",
"author": "@SAP/ux-tools-team",
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/backend-proxy-middleware/src/base/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ export async function generateProxyMiddlewareOptions(
await enhanceConfigForSystem(proxyOptions, system, backend.scp, (refreshToken?: string) => {
if (refreshToken) {
logger.info('Updating refresh token for: ' + localBackend.url);
systemStore.write({ ...system, refreshToken });
systemStore.write({ ...system, refreshToken }).catch((error) => logger.error(error));
}
});
}
Expand Down
4 changes: 3 additions & 1 deletion packages/backend-proxy-middleware/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ import { generateProxyMiddlewareOptions, createProxy, initI18n } from './base/pr

export { generateProxyMiddlewareOptions, createProxy };

initI18n();
initI18n().catch(() => {
// Ignore any errors since the middleware will still work
});
4 changes: 4 additions & 0 deletions packages/backend-proxy-middleware/tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"include": ["src", "test"]
}
4 changes: 4 additions & 0 deletions packages/btp-utils/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": ["../../.eslintrc"],
"parserOptions": { "project": "./tsconfig.eslint.json" }
}
6 changes: 6 additions & 0 deletions packages/btp-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @sap-ux/btp-utils

## 0.11.6

### Patch Changes

- 25911701: Fix for 'promises must be awaited' sonar issues

## 0.11.5

### Patch Changes
Expand Down
Loading

0 comments on commit 2f9db7f

Please sign in to comment.