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

Tsc #586

Closed

Tsc #586

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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Bumps `@aws-sdk/types` from 3.257.0 to 3.341.0
- Bumps `semver` from 7.3.8 to 7.5.1
- Bumps `node-fetch` from 3.2.10 to 3.3.1
- Bumps `proxy` from 1.0.2 to 2.1.1
### Changed
- Implemented Docker Image caching for `integration-unreleased` workflow ([#387](https://github.com/opensearch-project/opensearch-js/issues/387))
- Add upgrading NPM to all workflows running older Node.js versions ([#545](https://github.com/opensearch-project/opensearch-js/issues/545))
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"license-checker": "license-checker --production --onlyAllow='MIT;Apache-2.0;Apache1.1;ISC;BSD-3-Clause;BSD-2-Clause'",
"build-esm": "npx gen-esm-wrapper . index.mjs && eslint --fix index.mjs"
"build-esm": "npx gen-esm-wrapper . index.mjs && eslint --fix index.mjs",
"build": "tsc"
},
"author": "opensearch-project",
"original-author": {
Expand Down Expand Up @@ -78,7 +79,7 @@
"ora": "^6.1.2",
"prettier": "^2.6.2",
"pretty-hrtime": "^1.0.3",
"proxy": "^1.0.2",
"proxy": "^2.1.1",
"rimraf": "^5.0.0",
"semver": "^7.3.5",
"simple-git": "^3.15.0",
Expand Down
18 changes: 6 additions & 12 deletions test/acceptance/proxy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,9 @@ test('http basic authentication', async (t) => {
res.end(JSON.stringify({ hello: 'world' }));
});

proxy.authenticate = function (req, fn) {
fn(
null,
req.headers['proxy-authorization'] ===
`Basic ${Buffer.from('hello:world').toString('base64')}`
);
proxy.authenticate = (req) => {
const basic = `Basic ${Buffer.from('hello:world').toString('base64')}`;
return req.headers['proxy-authorization'] === basic;
};

const client = new Client({
Expand All @@ -141,12 +138,9 @@ test('https basic authentication', async (t) => {
res.end(JSON.stringify({ hello: 'world' }));
});

proxy.authenticate = function (req, fn) {
fn(
null,
req.headers['proxy-authorization'] ===
`Basic ${Buffer.from('hello:world').toString('base64')}`
);
proxy.authenticate = (req) => {
const basic = `Basic ${Buffer.from('hello:world').toString('base64')}`;
return req.headers['proxy-authorization'] === basic;
};

const client = new Client({
Expand Down
2 changes: 1 addition & 1 deletion test/utils/buildProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

'use strict';

const proxy = require('proxy');
const { createProxy: proxy } = require('proxy');
const { readFileSync } = require('fs');
const { join } = require('path');
const http = require('http');
Expand Down
20 changes: 20 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"baseUrl": ".",
"outDir": "dist",
"allowJs": true,
"downlevelIteration": true,
"esModuleInterop": true,
"incremental": true,
"lib": ["ES2015"],
"module": "commonjs",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"preserveConstEnums": true,
"removeComments": true,
"resolveJsonModule": true,
"target": "es5"
},
"exclude": ["node_modules/", "**/*.test.ts"],
"include": ["lib/**/*", "api/**/*", "index.js"]
}
30 changes: 15 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -626,10 +626,10 @@ argparse@^2.0.1:
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==

[email protected].1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/args/-/args-5.0.1.tgz#4bf298df90a4799a09521362c579278cc2fdd761"
integrity sha512-1kqmFCFsPffavQFGt8OxJdIcETti99kySRUPMpOhaGjL6mRJn8HFU1OxKY5bMqfZKUwTQc1mZkAjmGYaVOHFtQ==
args@^5.0.3:
version "5.0.3"
resolved "https://registry.yarnpkg.com/args/-/args-5.0.3.tgz#943256db85021a85684be2f0882f25d796278702"
integrity sha512-h6k/zfFgusnv3i5TU08KQkVKuCPBtL/PWQbWkHUxvJrZ2nAyeaUupneemcrgn1xmqxPQsPIzwkUhOpoqPDRZuA==
dependencies:
camelcase "5.0.0"
chalk "2.4.2"
Expand Down Expand Up @@ -686,10 +686,10 @@ base64-js@^1.3.1:
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==

[email protected]:
version "0.0.2"
resolved "https://registry.yarnpkg.com/basic-auth-parser/-/basic-auth-parser-0.0.2.tgz#ce9e71a77f23c1279eecd2659b2a46244c156e41"
integrity sha1-zp5xp38jwSee7NJlmypGJEwVbkE=
[email protected]-1:
version "0.0.2-1"
resolved "https://registry.yarnpkg.com/basic-auth-parser/-/basic-auth-parser-0.0.2-1.tgz#f1ea575979b27af6a411921d6ff8793d9117347f"
integrity sha512-GFj8iVxo9onSU6BnnQvVwqvxh60UcSHJEDnIk3z4B6iOjsKSmqe+ibW0Rsz7YO7IE1HG3D3tqCNIidP46SZVdQ==

binary-extensions@^2.0.0:
version "2.2.0"
Expand Down Expand Up @@ -2585,14 +2585,14 @@ process-on-spawn@^1.0.0:
dependencies:
fromentries "^1.2.0"

proxy@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/proxy/-/proxy-1.0.2.tgz#e0cfbe11c0a7a8b238fd2d7134de4e2867578e7f"
integrity sha512-KNac2ueWRpjbUh77OAFPZuNdfEqNynm9DD4xHT14CccGpW8wKZwEkN0yjlb7X9G9Z9F55N0Q+1z+WfgAhwYdzQ==
proxy@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/proxy/-/proxy-2.1.1.tgz#45f9b307508ffcae12bdc71678d44a4ab79cbf8b"
integrity sha512-nLgd7zdUAOpB3ZO/xCkU8gy74UER7P0aihU8DkUsDS5ZoFwVCX7u8dy+cv5tVK8UaB/yminU1GiLWE26TKPYpg==
dependencies:
args "5.0.1"
basic-auth-parser "0.0.2"
debug "^4.1.1"
args "^5.0.3"
basic-auth-parser "0.0.2-1"
debug "^4.3.4"

punycode@^2.0.0, punycode@^2.1.0:
version "2.1.1"
Expand Down