@jayfong/x-server 2.48.0 → 2.49.0

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.
package/lib/_cjs/index.js CHANGED
@@ -91,6 +91,12 @@ Object.keys(_base).forEach(function (key) {
91
91
  if (key in exports && exports[key] === _base[key]) return;
92
92
  exports[key] = _base[key];
93
93
  });
94
+ var _cookie = require("./plugins/cookie");
95
+ Object.keys(_cookie).forEach(function (key) {
96
+ if (key === "default" || key === "__esModule") return;
97
+ if (key in exports && exports[key] === _cookie[key]) return;
98
+ exports[key] = _cookie[key];
99
+ });
94
100
  var _cors = require("./plugins/cors");
95
101
  Object.keys(_cors).forEach(function (key) {
96
102
  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.CookiePlugin = void 0;
6
+ var _cookie = _interopRequireDefault(require("@fastify/cookie"));
7
+ /**
8
+ * Cookie 支持插件
9
+ */
10
+ class CookiePlugin {
11
+ constructor(options) {
12
+ this.options = options;
13
+ }
14
+ register(fastify) {
15
+ fastify.register(_cookie.default, this.options);
16
+ }
17
+ }
18
+ exports.CookiePlugin = CookiePlugin;
package/lib/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export * from './core/http_redirect';
13
13
  export * from './core/server';
14
14
  export * from './core/types';
15
15
  export * from './plugins/base';
16
+ export * from './plugins/cookie';
16
17
  export * from './plugins/cors';
17
18
  export * from './plugins/file_parser';
18
19
  export * from './plugins/form_body_parser';
package/lib/index.js 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/cookie";
17
18
  export * from "./plugins/cors";
18
19
  export * from "./plugins/file_parser";
19
20
  export * from "./plugins/form_body_parser";
@@ -0,0 +1,13 @@
1
+ import { FastifyCookieOptions } from '@fastify/cookie';
2
+ import { FastifyInstance } from 'fastify';
3
+ import { BasePlugin } from './base';
4
+ export interface CookiePluginOptions extends FastifyCookieOptions {
5
+ }
6
+ /**
7
+ * Cookie 支持插件
8
+ */
9
+ export declare class CookiePlugin implements BasePlugin {
10
+ private options?;
11
+ constructor(options?: CookiePluginOptions);
12
+ register(fastify: FastifyInstance<any, any, any, any, any>): void;
13
+ }
@@ -0,0 +1,12 @@
1
+ import FastifyCookie from '@fastify/cookie';
2
+ /**
3
+ * Cookie 支持插件
4
+ */
5
+ export class CookiePlugin {
6
+ constructor(options) {
7
+ this.options = options;
8
+ }
9
+ register(fastify) {
10
+ fastify.register(FastifyCookie, this.options);
11
+ }
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayfong/x-server",
3
- "version": "2.48.0",
3
+ "version": "2.49.0",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "lib/_cjs/index.js",
@@ -22,6 +22,7 @@
22
22
  "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"
23
23
  },
24
24
  "dependencies": {
25
+ "@fastify/cookie": "^9.4.0",
25
26
  "@fastify/cors": "^8.3.0",
26
27
  "@fastify/formbody": "^7.4.0",
27
28
  "@fastify/multipart": "^7.7.0",