chore: perform dependencies scan and fix all dependencies (#9296)

This commit is contained in:
Harminder Virk authored and GitHub committed 2024-09-26 14:14:38 +05:30
1 parent fba78c0fb1
commit 48bea267dc
593 files changed
+2729 -2314

No files matched your search

+2 -5
View File
@@ -1,5 +1,2 @@
module.exports = {
transform: { "^.+\\.[jt]s?$": "@swc/jest" },
testEnvironment: `node`,
moduleFileExtensions: [`js`, `ts`, `json`],
}
const defineJestConfig = require("../../../define_jest_config")
module.exports = defineJestConfig()
+14 -6
View File
@@ -3,36 +3,44 @@
"version": "0.0.1",
"description": "SDK for the Medusa API",
"main": "dist/index.js",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/index.js"
},
"repository": {
"type": "git",
"url": "https://github.com/medusajs/medusa",
"directory": "packages/core/js-sdk"
},
"engines": {
"node": ">=18"
"node": ">=20"
},
"publishConfig": {
"access": "public"
},
"files": [
"dist"
"dist",
"!dist/**/__tests__",
"!dist/**/__mocks__",
"!dist/**/__fixtures__"
],
"author": "Medusa",
"license": "MIT",
"devDependencies": {
"@medusajs/types": "^1.11.16",
"cross-env": "^5.2.1",
"jest": "^29.7.0",
"msw": "^2.3.0",
"rimraf": "^5.0.1",
"typescript": "^5.1.6"
"typescript": "^5.6.2"
},
"dependencies": {
"@medusajs/types": "^1.11.16",
"fetch-event-stream": "^0.1.5",
"qs": "^6.12.1"
},
"scripts": {
"build": "rimraf dist && tsc --build",
"build": "rimraf dist && tsc -p tsconfig.json && tsc -p tsconfig.esm.json",
"test": "jest --passWithNoTests --runInBand --bail --forceExit",
"watch": "tsc --build --watch"
}
@@ -18,7 +18,7 @@ const server = setupServer(
statusText: "Internal Server Error",
})
}),
http.get(`${baseUrl}/header`, ({ request, params, cookies }) => {
http.get(`${baseUrl}/header`, ({ request }) => {
if (
request.headers.get("X-custom-header") === "test" &&
request.headers.get("Content-Type") === "application/json"
@@ -27,28 +27,43 @@ const server = setupServer(
test: "test",
})
}
return new HttpResponse(null, {
status: 500,
statusText: "Internal Server Error",
})
}),
http.get(`${baseUrl}/replaced-header`, ({ request, params, cookies }) => {
request.headers
http.get(`${baseUrl}/replaced-header`, ({ request }) => {
if (request.headers.get("Content-Type") === "application/xml") {
return HttpResponse.json({
test: "test",
})
}
return new HttpResponse(null, {
status: 500,
statusText: "Internal Server Error",
})
}),
http.get(`${baseUrl}/apikey`, ({ request, params, cookies }) => {
http.get(`${baseUrl}/apikey`, ({ request }) => {
if (request.headers.get("authorization")?.startsWith("Basic")) {
return HttpResponse.json({
test: "test",
})
}
return new HttpResponse(null, {
status: 500,
statusText: "Internal Server Error",
})
}),
http.get(`${baseUrl}/pubkey`, ({ request, params, cookies }) => {
http.get(`${baseUrl}/pubkey`, ({ request }) => {
if (request.headers.get(PUBLISHABLE_KEY_HEADER) === "test-pub-key") {
return HttpResponse.json({
test: "test",
})
}
return new HttpResponse(null, {
status: 500,
statusText: "Internal Server Error",
})
}),
http.post(`${baseUrl}/create`, async ({ request, params, cookies }) => {
return HttpResponse.json(await request.json())
@@ -56,12 +71,16 @@ const server = setupServer(
http.delete(`${baseUrl}/delete/123`, async ({ request, params, cookies }) => {
return HttpResponse.json({ test: "test" })
}),
http.get(`${baseUrl}/jwt`, ({ request, params, cookies }) => {
http.get(`${baseUrl}/jwt`, ({ request }) => {
if (request.headers.get("authorization") === "Bearer token-123") {
return HttpResponse.json({
test: "test",
})
}
return new HttpResponse(null, {
status: 500,
statusText: "Internal Server Error",
})
}),
http.all("*", ({ request, params, cookies }) => {
return new HttpResponse(null, {
@@ -1,4 +1,4 @@
import { HttpTypes, SelectParams } from "@medusajs/types"
import { HttpTypes } from "@medusajs/types"
import { Client } from "../client"
import { ClientHeaders } from "../types"
+28
View File
@@ -0,0 +1,28 @@
{
"compilerOptions": {
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"target": "ES6",
"outDir": "./dist/esm",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "ESNext",
"moduleResolution": "Bundler",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true
},
"include": ["./src/**/*"],
"exclude": [
"./dist/**/*",
"./src/**/__tests__",
"./src/**/__mocks__",
"node_modules"
]
}
+1 -26
View File
@@ -1,28 +1,3 @@
{
"compilerOptions": {
"lib": ["es2021"],
"target": "es2021",
"outDir": "./dist",
"esModuleInterop": true,
"declarationMap": true,
"declaration": true,
"module": "ES2020",
"moduleResolution": "Node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noImplicitReturns": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"allowJs": true,
"skipLibCheck": true
},
"include": ["./src/**/*"],
"exclude": [
"./dist/**/*",
"./src/**/__tests__",
"./src/**/__mocks__",
"node_modules"
]
"extends": "../../../_tsconfig.base.json"
}