Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit 1f0987d

Browse files
author
tkostuch
committed
udpate typings
1 parent 013d79b commit 1f0987d

File tree

7 files changed

+33
-16
lines changed

7 files changed

+33
-16
lines changed

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"ajv-keywords": "^3.4.0",
5555
"body-parser": "^1.18.2",
5656
"bodybuilder": "2.2.21",
57-
"commander": "^2.19.0",
57+
"commander": "^5.1.0",
5858
"compression": "^1.7.2",
5959
"config": "^1.30.0",
6060
"cors": "^2.8.4",
@@ -98,9 +98,10 @@
9898
"devDependencies": {
9999
"@types/body-parser": "^1.17.0",
100100
"@types/config": "^0.0.34",
101-
"@types/express": "^4.16.1",
102-
"@types/jest": "^24.0.11",
103-
"@types/node": "^11.13.4",
101+
"@types/express": "^4.17.6",
102+
"@types/express-serve-static-core": "^4.17.7",
103+
"@types/jest": "^25.2.3",
104+
"@types/node": "^14.0.5",
104105
"@typescript-eslint/eslint-plugin": "^1.7.1-alpha.17",
105106
"@typescript-eslint/parser": "^1.7.1-alpha.17",
106107
"apollo-server-express": "^1.3.6",

src/api/product.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default ({ config, db }) => {
2222

2323
if (!req.query.skus) { return apiStatus(res, 'skus parameter is required', 500); }
2424

25-
productProxy.list(req.query.skus.split(',')).then((result) => {
25+
productProxy.list((req.query.skus as string).split(',')).then((result) => {
2626
apiStatus(res, result, 200);
2727
}).catch(err => {
2828
apiError(res, err);
@@ -37,7 +37,7 @@ export default ({ config, db }) => {
3737

3838
if (!req.query.skus) { return apiStatus(res, 'skus parameter is required', 500); }
3939

40-
productProxy.renderList(req.query.skus.split(','), req.query.currencyCode, (req.query.storeId && parseInt(req.query.storeId) > 0) ? req.query.storeId : 1).then((result) => {
40+
productProxy.renderList((req.query.skus as string).split(','), req.query.currencyCode, (req.query.storeId && parseInt((req.query.storeId as string)) > 0) ? req.query.storeId : 1).then((result) => {
4141
result.items = result.items.map((item) => {
4242
let sgnObj = item
4343
if (config.tax.calculateServerSide === true) {

src/api/stock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default ({ config, db }) => {
6565
return apiStatus(res, 'skus parameter is required', 500);
6666
}
6767

68-
const skuArray = req.query.skus.split(',')
68+
const skuArray = (req.query.skus as string).split(',')
6969
const promisesList = []
7070
for (const sku of skuArray) {
7171
promisesList.push(stockProxy.check({sku: sku, stockId: config.msi.enabled ? _getStockId(req.query.storeCode) : null}))

src/api/user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export default ({config, db}) => {
121121
userApi.post('/reset-password', (req, res) => {
122122
const userProxy = _getProxy(req)
123123
const { storeCode } = req.query
124-
const websiteId = storeCode ? config.storeViews[storeCode].websiteId : undefined
124+
const websiteId = storeCode ? config.storeViews[storeCode as string].websiteId : undefined
125125

126126
if (!req.body.email) {
127127
return apiStatus(res, 'Invalid e-mail provided!', 500)

src/image/action/local/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ export default class LocalImageAction extends ImageAction {
2525
let height: number
2626
let action: string
2727
if (this.req.query.url) { // url provided as the query param
28-
imgUrl = decodeURIComponent(this.req.query.url)
29-
width = parseInt(this.req.query.width)
30-
height = parseInt(this.req.query.height)
31-
action = this.req.query.action
28+
imgUrl = decodeURIComponent(this.req.query.url as string)
29+
width = parseInt(this.req.query.width as string)
30+
height = parseInt(this.req.query.height as string)
31+
action = this.req.query.action as string
3232
} else {
3333
let urlParts = this.req.url.split('/')
3434
width = parseInt(urlParts[1])

src/processor/default.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class HmacProcessor {
2222
const processorChain = []
2323
return new Promise((resolve, reject) => {
2424
const rs = items.map((item) => {
25-
if (this._req.query._source_exclude && this._req.query._source_exclude.indexOf('sgn') < 0) {
25+
if (this._req.query._source_exclude && (this._req.query._source_exclude as string[]).indexOf('sgn') < 0) {
2626
item._source.sgn = hmac.sign(item._source, this._config.get('objHashSecret')); // for products we sign off only price and id becase only such data is getting back with orders
2727
}
2828
return item

yarn.lock

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,12 +402,23 @@
402402
"@types/node" "*"
403403
"@types/range-parser" "*"
404404

405-
"@types/express@^4.16.1":
406-
version "4.17.0"
407-
resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.0.tgz#49eaedb209582a86f12ed9b725160f12d04ef287"
405+
"@types/express-serve-static-core@^4.17.7":
406+
version "4.17.7"
407+
resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.7.tgz#dfe61f870eb549dc6d7e12050901847c7d7e915b"
408+
integrity sha512-EMgTj/DF9qpgLXyc+Btimg+XoH7A2liE8uKul8qSmMTHCeNYzydDKFdsJskDvw42UsesCnhO63dO0Grbj8J4Dw==
409+
dependencies:
410+
"@types/node" "*"
411+
"@types/qs" "*"
412+
"@types/range-parser" "*"
413+
414+
"@types/express@^4.17.6":
415+
version "4.17.6"
416+
resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.6.tgz#6bce49e49570507b86ea1b07b806f04697fac45e"
417+
integrity sha512-n/mr9tZI83kd4azlPG5y997C/M4DNABK9yErhFM6hKdym4kkmd9j0vtsJyjFIwfRBxtrxZtAfGZCNRIBMFLK5w==
408418
dependencies:
409419
"@types/body-parser" "*"
410420
"@types/express-serve-static-core" "*"
421+
"@types/qs" "*"
411422
"@types/serve-static" "*"
412423

413424
"@types/graphql@^0.9.0":
@@ -462,6 +473,11 @@
462473
version "11.13.17"
463474
resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.17.tgz#2e7efbfe5253561087812571e5e6a1e4b1d6295b"
464475

476+
"@types/qs@*":
477+
version "6.9.3"
478+
resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.3.tgz#b755a0934564a200d3efdf88546ec93c369abd03"
479+
integrity sha512-7s9EQWupR1fTc2pSMtXRQ9w9gLOcrJn+h7HOXw4evxyvVqMi4f+q7d2tnFe3ng3SNHjtK+0EzGMGFUQX4/AQRA==
480+
465481
"@types/range-parser@*":
466482
version "1.2.3"
467483
resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.3.tgz#7ee330ba7caafb98090bece86a5ee44115904c2c"

0 commit comments

Comments
 (0)