From cf788ec49e7443ed0e71cd26aaa2e61024bcbbc9 Mon Sep 17 00:00:00 2001 From: Riqwan Thamir Date: Tue, 11 Feb 2025 09:52:33 +0100 Subject: [PATCH] chore(types,framework): pick ssl types from tls lib (#11381) * chore(types,framework): pick ssl types from tls lib * chore: call from node:tls directly --- packages/core/framework/src/config/types.ts | 20 ++++++++----------- .../core/types/src/common/config-module.ts | 8 ++------ 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/packages/core/framework/src/config/types.ts b/packages/core/framework/src/config/types.ts index be40e443d7..f50fc1435e 100644 --- a/packages/core/framework/src/config/types.ts +++ b/packages/core/framework/src/config/types.ts @@ -4,6 +4,7 @@ import { } from "@medusajs/types" import type { RedisOptions } from "ioredis" +import { ConnectionOptions } from "node:tls" // @ts-expect-error import type { InlineConfig } from "vite" @@ -89,12 +90,12 @@ export type AdminOptions = { /** * Configure the Vite configuration for the admin dashboard. This function receives the default Vite configuration * and returns the modified configuration. The default value is `undefined`. - * + * * Learn about configurations you can pass to Vite in [Vite's documentation](https://vite.dev/config/). * * @example * For example, if you're using a third-party library that isn't ESM-compatible, add it to Vite's `optimizeDeps` configuration: - * + * * ```ts title="medusa-config.ts" * module.exports = defineConfig({ * admin: { @@ -304,12 +305,7 @@ export type ProjectConfigOptions = { /** * Configure support for TLS/SSL connection */ - ssl?: { - /** - * Whether to fail connection if the server certificate is verified against the list of supplied CAs and the hostname and no match is found. - */ - rejectUnauthorized?: false - } + ssl?: boolean | ConnectionOptions } } @@ -851,7 +847,7 @@ export type ConfigModule = { * - An object having the following properties: * - `resolve`: The name of the plugin's package as specified in the plugin's `package.json` file. * - `options`: An object that includes options to be passed to the modules within the plugin. Learn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/modules/options). - * + * * Learn how to create a plugin in [this documentation](https://docs.medusajs.com/learn/fundamentals/plugins/create). * * @example @@ -874,9 +870,9 @@ export type ConfigModule = { */ plugins: ( | { - /** - * The name of the plugin's package as specified in the plugin's `package.json` file. - */ + /** + * The name of the plugin's package as specified in the plugin's `package.json` file. + */ resolve: string /** * An object that includes options to be passed to the modules within the plugin. diff --git a/packages/core/types/src/common/config-module.ts b/packages/core/types/src/common/config-module.ts index d979be5ba8..46337eaae6 100644 --- a/packages/core/types/src/common/config-module.ts +++ b/packages/core/types/src/common/config-module.ts @@ -4,6 +4,7 @@ import { } from "../modules-sdk" import type { RedisOptions } from "ioredis" +import { ConnectionOptions } from "node:tls" // @ts-ignore import type { InlineConfig } from "vite" @@ -280,12 +281,7 @@ export type ProjectConfigOptions = { /** * Configure support for TLS/SSL connection */ - ssl?: { - /** - * Whether to fail connection if the server certificate is verified against the list of supplied CAs and the hostname and no match is found. - */ - rejectUnauthorized?: false - } + ssl?: boolean | ConnectionOptions } }