Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@openapi-to/plugin-msw

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openapi-to/plugin-msw - npm Package Compare versions

Comparing version
3.2.0
to
3.2.1
+16
-11
dist/index.cjs

@@ -5,4 +5,4 @@ 'use strict';

var core = require('@openapi-to/core');
var tsMorph = require('ts-morph');
var utils = require('@openapi-to/core/utils');
var tsMorph = require('ts-morph');

@@ -555,17 +555,19 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

// src/plugin.ts
var stateMap = /* @__PURE__ */ new WeakMap();
var definePlugin = core.createPlugin((_pluginConfig) => {
const project = new tsMorph.Project();
const dependencies = [
..._pluginConfig?.responseDefaultType === "faker" ? [] : [],
core.pluginEnum.TsType
];
const pluginConfig = {
importWithExtension: _pluginConfig?.importWithExtension ?? true,
responseDefaultType: _pluginConfig?.responseDefaultType || ""
};
return {
dependencies,
dependencies: [
..._pluginConfig?.responseDefaultType === "faker" ? [] : [],
core.pluginEnum.TsType
],
name: core.pluginEnum.MSW,
hooks: {
buildStart: async (ctx) => {
stateMap.set(ctx.openapiToSingleConfig, {
project: new tsMorph.Project(),
pluginConfig: {
importWithExtension: _pluginConfig?.importWithExtension ?? true,
responseDefaultType: _pluginConfig?.responseDefaultType || ""
}
});
},

@@ -575,2 +577,5 @@ tagStart: async (tagData, ctx) => {

operation: async (operation, ctx) => {
const { project, pluginConfig } = stateMap.get(
ctx.openapiToSingleConfig
);
const requestName = `${operation.accessor.operationName}Handler`;

@@ -577,0 +582,0 @@ const filePath = path__default.default.join(

import { createRequire } from 'module';
import path from 'node:path';
import { createPlugin, pluginEnum } from '@openapi-to/core';
import { StructureKind, Project, VariableDeclarationKind } from 'ts-morph';
import { formatterModuleSpecifier, getRelativePath, URLPath } from '@openapi-to/core/utils';
import { Project, StructureKind, VariableDeclarationKind } from 'ts-morph';

@@ -549,17 +549,19 @@ createRequire(import.meta.url);

// src/plugin.ts
var stateMap = /* @__PURE__ */ new WeakMap();
var definePlugin = createPlugin((_pluginConfig) => {
const project = new Project();
const dependencies = [
..._pluginConfig?.responseDefaultType === "faker" ? [] : [],
pluginEnum.TsType
];
const pluginConfig = {
importWithExtension: _pluginConfig?.importWithExtension ?? true,
responseDefaultType: _pluginConfig?.responseDefaultType || ""
};
return {
dependencies,
dependencies: [
..._pluginConfig?.responseDefaultType === "faker" ? [] : [],
pluginEnum.TsType
],
name: pluginEnum.MSW,
hooks: {
buildStart: async (ctx) => {
stateMap.set(ctx.openapiToSingleConfig, {
project: new Project(),
pluginConfig: {
importWithExtension: _pluginConfig?.importWithExtension ?? true,
responseDefaultType: _pluginConfig?.responseDefaultType || ""
}
});
},

@@ -569,2 +571,5 @@ tagStart: async (tagData, ctx) => {

operation: async (operation, ctx) => {
const { project, pluginConfig } = stateMap.get(
ctx.openapiToSingleConfig
);
const requestName = `${operation.accessor.operationName}Handler`;

@@ -571,0 +576,0 @@ const filePath = path.join(

{
"name": "@openapi-to/plugin-msw",
"version": "3.2.0",
"version": "3.2.1",
"sideEffects": false,

@@ -25,6 +25,6 @@ "type": "module",

"utility-types": "^3.11.0",
"@openapi-to/config-ts": "3.2.0",
"@openapi-to/plugin-zod": "3.2.0",
"@openapi-to/config-tsup": "3.2.0",
"@openapi-to/plugin-ts-type": "3.2.0"
"@openapi-to/config-ts": "3.2.1",
"@openapi-to/plugin-zod": "3.2.1",
"@openapi-to/plugin-ts-type": "3.2.1",
"@openapi-to/config-tsup": "3.2.1"
},

@@ -37,3 +37,3 @@ "keywords": [],

"ts-morph": "^23.0.0",
"@openapi-to/core": "3.2.0"
"@openapi-to/core": "3.2.1"
},

@@ -40,0 +40,0 @@ "publishConfig": {