@jayfong/x-server 2.79.1 → 2.80.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
File without changes
@@ -97,6 +97,12 @@ Object.keys(_base).forEach(function (key) {
97
97
  if (key in exports && exports[key] === _base[key]) return;
98
98
  exports[key] = _base[key];
99
99
  });
100
+ var _compress = require("./plugins/compress");
101
+ Object.keys(_compress).forEach(function (key) {
102
+ if (key === "default" || key === "__esModule") return;
103
+ if (key in exports && exports[key] === _compress[key]) return;
104
+ exports[key] = _compress[key];
105
+ });
100
106
  var _cookie = require("./plugins/cookie");
101
107
  Object.keys(_cookie).forEach(function (key) {
102
108
  if (key === "default" || key === "__esModule") return;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ exports.__esModule = true;
5
+ exports.CompressPlugin = void 0;
6
+ var _compress = _interopRequireDefault(require("@fastify/compress"));
7
+ /**
8
+ * 响应压缩插件
9
+ */
10
+ class CompressPlugin {
11
+ constructor(options) {
12
+ this.options = options;
13
+ }
14
+ register(fastify) {
15
+ fastify.register(_compress.default, this.options);
16
+ }
17
+ }
18
+ exports.CompressPlugin = CompressPlugin;
package/lib/exports.d.ts CHANGED
@@ -14,6 +14,7 @@ export * from './core/http_redirect';
14
14
  export * from './core/server';
15
15
  export * from './core/types';
16
16
  export * from './plugins/base';
17
+ export * from './plugins/compress';
17
18
  export * from './plugins/cookie';
18
19
  export * from './plugins/cors';
19
20
  export * from './plugins/file_parser';
package/lib/exports.js CHANGED
@@ -15,6 +15,7 @@ export * from "./core/http_redirect";
15
15
  export * from "./core/server";
16
16
  export * from "./core/types";
17
17
  export * from "./plugins/base";
18
+ export * from "./plugins/compress";
18
19
  export * from "./plugins/cookie";
19
20
  export * from "./plugins/cors";
20
21
  export * from "./plugins/file_parser";
@@ -0,0 +1,13 @@
1
+ import { FastifyCompressOptions } from '@fastify/compress';
2
+ import { FastifyInstance } from 'fastify';
3
+ import { BasePlugin } from './base';
4
+ export interface CompressPluginOptions extends FastifyCompressOptions {
5
+ }
6
+ /**
7
+ * 响应压缩插件
8
+ */
9
+ export declare class CompressPlugin implements BasePlugin {
10
+ private options?;
11
+ constructor(options?: CompressPluginOptions | undefined);
12
+ register(fastify: FastifyInstance<any, any, any, any, any>): void;
13
+ }
@@ -0,0 +1,12 @@
1
+ import FastifyCompress from '@fastify/compress';
2
+ /**
3
+ * 响应压缩插件
4
+ */
5
+ export class CompressPlugin {
6
+ constructor(options) {
7
+ this.options = options;
8
+ }
9
+ register(fastify) {
10
+ fastify.register(FastifyCompress, this.options);
11
+ }
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayfong/x-server",
3
- "version": "2.79.1",
3
+ "version": "2.80.1",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "lib/_cjs/index.js",
@@ -9,7 +9,9 @@
9
9
  "bin": {
10
10
  "xs": "lib/_cjs/cli/cli.js"
11
11
  },
12
- "files": ["lib"],
12
+ "files": [
13
+ "lib"
14
+ ],
13
15
  "scripts": {
14
16
  "build": "haoma compile",
15
17
  "build_test_pkg": "tyn build && rm -rf ./lib_test && mkdir -p ./lib_test && cp -r ./lib ./lib_test/lib && cp ./package.json ./lib_test/package.json && cd ./tests/app && tyn add file:../../lib_test",
@@ -19,6 +21,7 @@
19
21
  "test_api_qiqi": "cd /Users/admin/Documents/jfWorks/qiqi-server && DEBUG=api tsx /Users/admin/Documents/jfWorks/x/packages/x-server/src/cli/cli.ts api"
20
22
  },
21
23
  "dependencies": {
24
+ "@fastify/compress": "^7.0.3",
22
25
  "@fastify/cookie": "^9.4.0",
23
26
  "@fastify/cors": "^8.3.0",
24
27
  "@fastify/formbody": "^7.4.0",