Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/late-dodos-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@sap-cloud-sdk/openapi-generator': minor
'@sap-cloud-sdk/generator-common': minor
'@sap-cloud-sdk/generator': minor
---

[Compatibility Note] The project has been updated to `typescript` version 6.
Some options are deprecated in TypeScript 6, reference the [breaking changes page](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-6-0.html#breaking-changes-and-deprecations-in-typescript-60) for more details.
21 changes: 20 additions & 1 deletion .github/actions/check-public-api/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/actions/merge-and-write-changelogs/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build-packages/changesets-fixed-version-bump/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"eslint": "^9.39.2",
"memfs": "^4.57.2",
"prettier": "^3.8.1",
"typescript": "~5.9.3"
"typescript": "~6.0.2"
}
}
3 changes: 2 additions & 1 deletion build-packages/changesets-fixed-version-bump/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"declaration": false,
"esModuleInterop": true,
"target": "ESNext",
"module": "NodeNext"
"module": "NodeNext",
"types": ["node", "jest"]
},
"include": ["*.ts"],
"exclude": []
Expand Down
2 changes: 1 addition & 1 deletion build-packages/check-license/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"depcheck": "^1.4.7",
"eslint": "^9.39.2",
"prettier": "^3.8.1",
"typescript": "~5.9.3"
"typescript": "~6.0.3"
}
}
3 changes: 2 additions & 1 deletion build-packages/check-license/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"target": "esnext",
"noUncheckedSideEffectImports": true,
"libReplacement": false,
"module": "NodeNext"
"module": "NodeNext",
"types": ["node"]
},
"types": ["node"],
"include": ["*.ts"],
Expand Down
2 changes: 1 addition & 1 deletion build-packages/check-pr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"eslint": "^9.39.2",
"memfs": "^4.57.2",
"prettier": "^3.8.1",
"typescript": "~5.9.3"
"typescript": "~6.0.2"
}
}
3 changes: 2 additions & 1 deletion build-packages/check-pr/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"skipLibCheck": true,
"isolatedModules": true,
"outDir": "./lib",
"tsBuildInfoFile": "./lib/.tsbuildinfo"
"tsBuildInfoFile": "./lib/.tsbuildinfo",
"types": ["node", "jest"]
},
"include": ["*.ts"],
"exclude": []
Expand Down
2 changes: 1 addition & 1 deletion build-packages/check-public-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"eslint": "^9.39.2",
"memfs": "^4.57.2",
"prettier": "^3.8.1",
"typescript": "~5.9.3"
"typescript": "~6.0.2"
}
}
3 changes: 2 additions & 1 deletion build-packages/check-public-api/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"skipLibCheck": true,
"isolatedModules": true,
"outDir": "./lib",
"tsBuildInfoFile": "./lib/.tsbuildinfo"
"tsBuildInfoFile": "./lib/.tsbuildinfo",
"types": ["node", "jest"]
},
"include": ["*.ts"],
"exclude": []
Expand Down
2 changes: 1 addition & 1 deletion build-packages/get-changelog/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ async function getChangelog(v?: string): Promise<string> {
try {
setOutput('changelog', await getChangelog());
} catch (error) {
setFailed(error.message);
setFailed((error as Error).message);
}
})();
2 changes: 1 addition & 1 deletion build-packages/get-changelog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"depcheck": "^1.4.7",
"eslint": "^9.39.2",
"prettier": "^3.8.1",
"typescript": "~5.9.3"
"typescript": "~6.0.2"
}
}
3 changes: 2 additions & 1 deletion build-packages/get-changelog/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"incremental": true,
"declaration": false,
"esModuleInterop": true,
"module": "NodeNext"
"module": "NodeNext",
"types": ["node"]
},
"files": [
"index.ts"
Expand Down
2 changes: 1 addition & 1 deletion build-packages/merge-and-write-changelogs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function parseContent(
summary,
packageNames: [packageName],
// TODO: add link to commit
commit: groups.commit ? `(${groups.commit})` : '',
commit: groups?.commit ? `(${groups.commit})` : '',
type
};
});
Expand Down
2 changes: 1 addition & 1 deletion build-packages/merge-and-write-changelogs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"depcheck": "^1.4.7",
"eslint": "^9.39.2",
"prettier": "^3.8.1",
"typescript": "~5.9.3"
"typescript": "~6.0.3"
}
}
3 changes: 2 additions & 1 deletion build-packages/merge-and-write-changelogs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"declaration": false,
"esModuleInterop": true,
"target": "ESNext",
"module": "NodeNext"
"module": "NodeNext",
"types": ["node"]
},
"include": ["*.ts"],
"exclude": []
Expand Down
2 changes: 1 addition & 1 deletion build-packages/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"depcheck": "^1.4.7",
"eslint": "^9.39.2",
"prettier": "^3.8.1",
"typescript": "~5.9.3"
"typescript": "~6.0.3"
}
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
"@types/jest": "^30.0.0",
"@types/jsonwebtoken": "^9.0.10",
"@types/node": "^22.19.15",
"@types/sap__xsenv": "^3.3.2",
"@types/semver": "^7.7.1",
"@types/voca": "^1.4.6",
"axios": "^1.15.0",
"cross-env": "10.1.0",
Expand All @@ -87,7 +89,7 @@
"ts-node": "^10.9.2",
"turbo": "^2.9.6",
"typedoc": "^0.28.18",
"typescript": "~5.9.3",
"typescript": "~6.0.3",
"unionfs": "^4.6.0"
}
}
3 changes: 2 additions & 1 deletion packages/connectivity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@
"devDependencies": {
"@jest/globals": "^30.3.0",
"@sap-cloud-sdk/test-util-internal": "workspace:^",
"@types/async-retry": "^1.4.9",
"depcheck": "^1.4.7",
"memfs": "^4.57.2",
"nock": "^14.0.11",
"prettier": "^3.8.1",
"typescript": "~5.9.3"
"typescript": "~6.0.3"
}
}
6 changes: 3 additions & 3 deletions packages/connectivity/src/http-agent/http-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ function isSupportedFormat(format: string | undefined): boolean {
return !!format && supportedCertificateFormats.includes(format);
}

function selectCertificate(destination): DestinationCertificate {
const certificate = destination.certificates.find(
c => c.name === destination.keyStoreName
function selectCertificate(destination: Destination): DestinationCertificate {
const certificate = destination.certificates?.find(
(c: DestinationCertificate) => c.name === destination.keyStoreName
);

if (!certificate) {
Expand Down
2 changes: 1 addition & 1 deletion packages/connectivity/src/scp-cf/connectivity-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ async function proxyAuthorizationHeader(
} catch (error) {
throw new ErrorWithCause(
'Failed to add proxy authorization header - client credentials grant failed!',
error
error as Error
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import { isHttpDestination } from './destination-service-types';
import { addForwardedAuthTokenIfNeeded } from './forward-auth-token';
import type { Destination } from './destination-service-types';
import type { DestinationConfiguration } from './destination';
import type { DestinationFetchOptions } from './destination-accessor-types';

const logger = createLogger({
Expand All @@ -37,14 +38,15 @@ export function getDestinationsFromEnv(): Destination[] {
} catch (err) {
throw new ErrorWithCause(
'Error in parsing the destinations from the environment variable.',
err
err as Error
);
}
validateDestinations(destinations);
return destinations.map(destination =>
isDestinationConfiguration(destination)
? parseDestination(destination)
: sanitizeDestination(destination)
return destinations.map(
(destination: DestinationConfiguration | Destination) =>
isDestinationConfiguration(destination)
? parseDestination(destination)
: sanitizeDestination(destination)
);
}
return [];
Expand Down Expand Up @@ -121,7 +123,7 @@ export function searchEnvVariablesForDestination(
}
} catch (error) {
logger.error(
`Error in reading the given destinations from the environment variable ${error.message}.`
`Error in reading the given destinations from the environment variable ${(error as Error).message}.`
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export async function searchServiceBindingForDestination(
return destination;
} catch (error) {
logger.debug(
`Could not retrieve destination from service binding. If you are not using SAP Extension Factory, this information probably does not concern you. ${error.message}`
`Could not retrieve destination from service binding. If you are not using SAP Extension Factory, this information probably does not concern you. ${(error as Error).message}`
);
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
propertyExists,
removeTrailingSlashes
} from '@sap-cloud-sdk/util';
import axios from 'axios';
import axios, { isAxiosError } from 'axios';
import { executeWithMiddleware } from '@sap-cloud-sdk/resilience/internal';
import { resilience } from '@sap-cloud-sdk/resilience';
import asyncRetry from 'async-retry';
Expand Down Expand Up @@ -76,8 +76,8 @@ export async function fetchDestinations(
headers
)
.then(response => {
const destinations: Destination[] = response.data.map(destination =>
parseDestination(destination)
const destinations: Destination[] = response.data.map(
(destination: DestinationJson) => parseDestination(destination)
);

if (options?.useCache) {
Expand Down Expand Up @@ -156,6 +156,7 @@ export async function fetchDestinationWithoutTokenRetrieval(
};
} catch (err) {
if (
isAxiosError(err) &&
err.response?.status === 404 &&
err.response?.data?.ErrorMessage ===
'Configuration with the specified name was not found'
Expand All @@ -166,8 +167,8 @@ export async function fetchDestinationWithoutTokenRetrieval(
};
}
throw new ErrorWithCause(
`Failed to fetch destination.${errorMessageFromResponse(err)}`,
err
`Failed to fetch destination.${errorMessageFromResponse(err as AxiosError<{ ErrorMessage: string }>)}`,
err as Error
);
}
}
Expand Down Expand Up @@ -323,12 +324,14 @@ function retryDestination(
}
return destination;
} catch (error) {
const status = error?.response?.status;
if (status.toString().startsWith('4')) {
const status = isAxiosError(error)
? error.response?.status
: undefined;
if (status?.toString().startsWith('4')) {
bail(
new ErrorWithCause(
`Request failed with status code ${status}`,
error
error as Error
)
);
// We need to return something here but the actual value does not matter
Expand Down
Loading
Loading