New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@ccs-ui/float-button

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ccs-ui/float-button

### 特性

latest
npmnpm
Version
0.0.4
Version published
Maintainers
0
Created
Source

open-api 可视化代码生成插件

特性

  • 本地打开 Swagger UI
  • 本地打开 Swagger UI TS 版本
  • 在线生成代码文件:http 请求和 typing.d 定义文件
  • typing 泛型化
  • 根据 controller 生成独立文件

插件安装

  • pnpm add @ccs-ui/open-api

插件启用

export default defineConfig({
  ccsOpenApi: [
    {
      projectName: 'default',
      serversPath: './src/service',
      schemaPath: 'http://136.25.60.144:30472/api/service-sysmgr/v3/api-docs',
      authorization: `Basic bWljcm86QE1pY3JvLC4xMjM=`,
      namespace: 'API',
      commonIntfs: ['Result<T>', 'PageRsp<T>', 'PageReq<T>', 'OrderProp'],
      requestImportStatement: `import { request } from '@/utils/http'`,
    },
    {
      projectName: 'easy-im',
      serversPath: './src/service',
      schemaPath: 'http://136.25.60.143:30314/easy/easy-im/v3/api-docs',
      authorization: `Basic bWljcm86QE1pY3JvLC4xMjM=`,
      namespace: 'APIM',
      commonIntfs: ['Result<T>', 'PageRsp<T>', 'PageReq<T>', 'OrderProp'],
      requestImportStatement: `import { request } from '@/utils/http'`,
    },
  ],
});

参数说明

  • projectName 项目服务名称。
  • serversPath 请求和定义文件生成目录。
  • schemaPath 接口信息地址,参考 swagger 获取的数据。
  • authorization 文档登录凭证。
  • namespace typing 定义的命名空间。
  • commonIntfs 公共类型,统一生成到 common.d.ts 文件中,避免冗余。
  • requestImportStatement: 本地 http 请求引入

生成结果示例

import { request } from '@/utils/http';

/** 清空所有缓存 */
export async function clearAllCachesUsingGet() {
  return request<API.Result<void>>(
    '/easy-im/access/CacheController/clearAllCaches',
    {
      method: 'GET',
    },
  );
}

/** 清空所有组织缓存 */
export async function clearAllOrgsCacheUsingGet() {
  return request<API.Result<void>>(
    '/easy-im/access/CacheController/clearAllOrgsCache',
    {
      method: 'GET',
    },
  );
}
declare namespace API {
  type Result<T> = {
    /** 错误编码 */
    code?: string;
    /** 业务数据 */
    data?: T;
    /** 错误信息 */
    msg?: string;
    /** 业务调用是否成功 */
    success?: boolean;
  };
}

FAQs

Package last updated on 27 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts