Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: upgrade to typescript 5 #4464

Merged
merged 14 commits into from
Jan 16, 2025
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/index.d.ts b/index.d.ts
index 4238da8770e14cabd912c10c8a3b6dee4692209c..beebec01b3e212df0aaf911ded6f1a629f7ac1ae 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -1,11 +1,22 @@
import { Connection, Transport } from '@elastic/elasticsearch';
-import AWS from 'aws-sdk';
+
+
+export interface ConnectorConfigCredentials {
+ accessKeyId?: string;
+ secretAccessKey?: string;
+ sessionToken?: string;
+}
+
+export interface ConnectorConfig {
+ region: string;
+ credentials: ConnectorConfigCredentials;
+}

export type Connector = {
Connection: typeof Connection;
Transport: typeof Transport;
};

-export const ConnectorFactory: (awsConfig: AWS.Config) => Connector;
+export const ConnectorFactory: (awsConfig: ConnectorConfig) => Connector;

export default ConnectorFactory;
2 changes: 1 addition & 1 deletion cypress-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"lodash": "^4.17.21",
"nanoid": "^3.3.8",
"node-fetch": "2.6.7",
"typescript": "4.9.5",
"typescript": "5.3.3",
"uniqid": "^5.4.0"
},
"scripts": {
Expand Down
31 changes: 11 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
"devDependencies": {
"@babel/cli": "^7.26.4",
"@babel/code-frame": "^7.26.2",
"@babel/compat-data": "^7.26.3",
"@babel/compat-data": "7.26.5",
"@babel/core": "^7.26.0",
"@babel/helper-define-polyfill-provider": "^0.6.3",
"@babel/helper-environment-visitor": "^7.24.7",
"@babel/parser": "^7.26.3",
"@babel/parser": "7.26.5",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-proposal-throw-expressions": "^7.25.9",
Expand All @@ -47,8 +47,8 @@
"@babel/register": "^7.25.9",
"@babel/runtime": "^7.26.0",
"@babel/template": "^7.25.9",
"@babel/traverse": "^7.26.4",
"@babel/types": "^7.26.3",
"@babel/traverse": "7.26.5",
"@babel/types": "7.26.5",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@grpc/grpc-js": "^1.11.1",
Expand All @@ -59,8 +59,8 @@
"@types/prettier": "^2.7.3",
"@types/react": "18.2.79",
"@types/react-dom": "18.2.25",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"adio": "^1.0.1",
"axios": "^1.7.9",
"babel-jest": "29.7.0",
Expand Down Expand Up @@ -117,8 +117,9 @@
"ts-expect": "^1.3.0",
"ts-jest": "29.1.5",
"ts-node": "^10.9.2",
"typescript": "4.9.5",
"typescript-transform-paths": "^3.4.6",
"type-fest": "4.14.0",
"typescript": "5.3.3",
"typescript-transform-paths": "^3.5.3",
"verdaccio": "^6.0.5",
"write-json-file": "^4.3.0",
"yargs": "^17.7.2"
Expand Down Expand Up @@ -176,6 +177,8 @@
"verdaccio:start": "yarn verdaccio -c ./.verdaccio.yaml",
"verdaccio:start:detached": "yarn pm2 start \"yarn verdaccio:start\"",
"webiny": "./node_modules/.bin/webiny",
"system:verify": "yarn eslint && yarn prettier:check && yarn adio && yarn check-ts-configs && yarn webiny verify-dependencies",
"system:build": "yarn && yarn ghawac build && yarn webiny sync-dependencies && yarn build",
"wby": "./node_modules/.bin/wby",
"webiny-ui-build-storybook": "cd packages/ui && cross-env OUT=../../netlify-static yarn build-storybook"
},
Expand Down Expand Up @@ -229,29 +232,17 @@
"systeminformation": "^5.23.18",
"@emotion/react": "11.10.8",
"@octokit/rest": "^20.0.2",
"braces": "^3.0.3",
"typescript": "4.9.5",
"@types/jsdom": "link:./typings/void",
"@types/webpack": "^5.28.0",
"browserify-sign": "^4.2.2",
"@types/react": "18.2.79",
"@types/react-dom": "18.2.25",
"react": "18.2.0",
"react-dom": "18.2.0",
"follow-redirects": "^1.15.6",
"crypto-js": "^4.2.0",
"ip": "^2.0.1",
"tar": "^6.2.1",
"ejs": "^3.1.10",
"@grpc/grpc-js": "^1.11.1",
"postcss": "^8.4.35",
"semver": "^7.6.3",
"@types/eslint": "8.2.1",
"http-proxy-middleware": "^2.0.7",
"xml2js": "0.6.2",
"[email protected]": "patch:lerna@npm%3A8.1.2#./.yarn/patches/lerna-npm-8.1.2-be48ad2329.patch",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"apollo-link@^1.2.14": "patch:apollo-link@npm%3A1.2.14#./.yarn/patches/apollo-link-npm-1.2.14-74f0ba01f9.patch",
"apollo-link@^1.0.0": "patch:apollo-link@npm%3A1.2.14#./.yarn/patches/apollo-link-npm-1.2.14-74f0ba01f9.patch",
"@material/base@^14.0.0": "patch:@material/base@npm%3A14.0.0#./.yarn/patches/@material-base-npm-14.0.0-36e0a55c42.patch"
Expand Down
3 changes: 1 addition & 2 deletions packages/api-aco/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"graphql": "^15.9.0",
"prettier": "^2.8.8",
"rimraf": "^6.0.1",
"ttypescript": "^1.5.15",
"typescript": "4.9.5"
"typescript": "5.3.3"
}
}
3 changes: 1 addition & 2 deletions packages/api-admin-settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
"jest-dynalite": "^3.6.1",
"prettier": "^2.8.8",
"rimraf": "^6.0.1",
"ttypescript": "^1.5.15",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
3 changes: 1 addition & 2 deletions packages/api-admin-users-so-ddb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"jest": "^29.7.0",
"jest-dynalite": "^3.6.1",
"rimraf": "^6.0.1",
"ttypescript": "^1.5.15",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion packages/api-admin-users/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@webiny/cli": "0.0.0",
"@webiny/project-utils": "0.0.0",
"rimraf": "^6.0.1",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
3 changes: 1 addition & 2 deletions packages/api-apw-scheduler-so-ddb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
"jest": "^29.7.0",
"jest-dynalite": "^3.6.1",
"rimraf": "^6.0.1",
"ttypescript": "^1.5.15",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
3 changes: 1 addition & 2 deletions packages/api-apw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
"jest": "^29.7.0",
"prettier": "^2.8.8",
"rimraf": "^6.0.1",
"ttypescript": "^1.5.15",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
3 changes: 1 addition & 2 deletions packages/api-audit-logs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"@webiny/plugins": "0.0.0",
"@webiny/project-utils": "0.0.0",
"graphql": "^15.9.0",
"ttypescript": "^1.5.15",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"dependencies": {
"@webiny/api": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/api-authentication-cognito/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@webiny/cli": "0.0.0",
"@webiny/project-utils": "0.0.0",
"rimraf": "^6.0.1",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
3 changes: 1 addition & 2 deletions packages/api-authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"@webiny/project-utils": "0.0.0",
"jest-dynalite": "^3.6.1",
"rimraf": "^6.0.1",
"ttypescript": "^1.5.15",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
3 changes: 1 addition & 2 deletions packages/api-background-tasks-ddb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"@webiny/cli": "0.0.0",
"@webiny/project-utils": "0.0.0",
"rimraf": "^6.0.1",
"ttypescript": "^1.5.15",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
3 changes: 1 addition & 2 deletions packages/api-background-tasks-es/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"@webiny/cli": "0.0.0",
"@webiny/project-utils": "0.0.0",
"rimraf": "^6.0.1",
"ttypescript": "^1.5.15",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
3 changes: 1 addition & 2 deletions packages/api-background-tasks-os/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"@webiny/cli": "0.0.0",
"@webiny/project-utils": "0.0.0",
"rimraf": "^6.0.1",
"ttypescript": "^1.5.15",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion packages/api-cognito-authenticator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@webiny/cli": "0.0.0",
"@webiny/project-utils": "0.0.0",
"rimraf": "^6.0.1",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion packages/api-dynamodb-to-elasticsearch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@webiny/cli": "0.0.0",
"@webiny/plugins": "0.0.0",
"@webiny/project-utils": "0.0.0",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
5 changes: 2 additions & 3 deletions packages/api-elasticsearch-tasks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@
"@webiny/plugins": "0.0.0",
"@webiny/project-utils": "0.0.0",
"rimraf": "^6.0.1",
"ttypescript": "^1.5.15",
"type-fest": "^3.13.1",
"typescript": "4.9.5"
"type-fest": "4.14.0",
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
5 changes: 2 additions & 3 deletions packages/api-elasticsearch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@
"@webiny/error": "0.0.0",
"@webiny/plugins": "0.0.0",
"@webiny/utils": "0.0.0",
"aws-elasticsearch-connector": "^9.2.0",
"aws-elasticsearch-connector": "patch:aws-elasticsearch-connector@npm%3A9.2.0#~/.yarn/patches/aws-elasticsearch-connector-npm-9.2.0-e1245671b1.patch",
"elastic-ts": "^0.12.0"
},
"devDependencies": {
"@webiny/cli": "0.0.0",
"@webiny/project-utils": "0.0.0",
"rimraf": "^6.0.1",
"ttypescript": "^1.5.15",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
1 change: 0 additions & 1 deletion packages/api-elasticsearch/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export const createElasticsearchClient = (options: ElasticsearchClientOptions):
...clientOptions,
...createAwsElasticsearchConnector({
region,
// @ts-expect-error
credentials
})
};
Expand Down
3 changes: 1 addition & 2 deletions packages/api-file-manager-ddb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"jest-dynalite": "^3.6.1",
"jsonpack": "^1.1.5",
"rimraf": "^6.0.1",
"ttypescript": "^1.5.15",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion packages/api-file-manager-s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@webiny/cli": "0.0.0",
"@webiny/project-utils": "0.0.0",
"rimraf": "^6.0.1",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
4 changes: 1 addition & 3 deletions packages/api-file-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@types/sharp": "^0.32.0",
"@webiny/api-i18n": "0.0.0",
"@webiny/cli": "0.0.0",
"@webiny/utils": "0.0.0",
"jest": "^29.7.0",
"rimraf": "^6.0.1",
"ttypescript": "^1.5.15",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class NotAuthorizedAssetReply extends AssetReply {
code: 403,
headers: ResponseHeaders.create({
"cache-control": "no-store",
"content-type": "application/json"
"content-type": "application/json; charset=utf-8"
}),
body: () => ({ error: "Not authorized!", code: "NOT_AUTHORIZED" })
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const setupAssetDelivery = (params: AssetDeliveryParams) => {
const headers = assetReply.getHeaders();

// Set default headers.
headers.set("x-webiny-base64-encoded", true);
headers.set("x-webiny-base64-encoded", "true");

reply.code(assetReply.getCode());
reply.headers(headers.getHeaders());
Expand Down
3 changes: 1 addition & 2 deletions packages/api-form-builder-so-ddb-es/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
"jest": "^29.7.0",
"jest-dynalite": "^3.6.1",
"rimraf": "^6.0.1",
"ttypescript": "^1.5.15",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
3 changes: 1 addition & 2 deletions packages/api-form-builder-so-ddb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
"jest": "^29.7.0",
"jest-dynalite": "^3.6.1",
"rimraf": "^6.0.1",
"ttypescript": "^1.5.15",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
3 changes: 1 addition & 2 deletions packages/api-form-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@
"jest": "^29.7.0",
"jest-dynalite": "^3.6.1",
"rimraf": "^6.0.1",
"ttypescript": "^1.5.15",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"publishConfig": {
"access": "public",
Expand Down
3 changes: 1 addition & 2 deletions packages/api-headless-cms-aco/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
"@webiny/project-utils": "0.0.0",
"@webiny/wcp": "0.0.0",
"graphql": "^15.9.0",
"ttypescript": "^1.5.15",
"typescript": "4.9.5"
"typescript": "5.3.3"
},
"dependencies": {
"@webiny/api": "0.0.0",
Expand Down
Loading
Loading