@jayfong/x-server 1.10.3 → 1.11.2

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.
Files changed (73) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/lib/_cjs/cli/api_generator.js +295 -0
  3. package/lib/_cjs/cli/build_util.js +146 -0
  4. package/lib/_cjs/cli/cli.js +190 -0
  5. package/lib/_cjs/cli/deploy_util.js +61 -0
  6. package/lib/_cjs/cli/env_util.js +145 -0
  7. package/lib/_cjs/cli/register.js +8 -0
  8. package/lib/_cjs/cli/template_util.js +77 -0
  9. package/lib/_cjs/cli/templates/handlers.ts +3 -0
  10. package/lib/_cjs/cli/templates/hooks.ts +2 -0
  11. package/lib/_cjs/cli/templates/models.ts +22 -0
  12. package/lib/_cjs/cli/templates/package.json +3 -0
  13. package/lib/_cjs/cli/templates/routes.ts +26 -0
  14. package/lib/_cjs/cli/templates/tasks.ts +2 -0
  15. package/lib/_cjs/core/define_bus.js +28 -0
  16. package/lib/_cjs/core/define_handler.js +43 -0
  17. package/lib/_cjs/core/define_hook.js +10 -0
  18. package/lib/_cjs/core/define_server.js +12 -0
  19. package/lib/_cjs/core/define_task.js +30 -0
  20. package/lib/_cjs/core/handler.js +90 -0
  21. package/lib/_cjs/core/http_error.js +9 -0
  22. package/lib/_cjs/core/http_method.js +12 -0
  23. package/lib/_cjs/core/server.js +145 -0
  24. package/lib/_cjs/core/types.js +18 -0
  25. package/lib/_cjs/index.js +179 -0
  26. package/lib/_cjs/plugins/base.js +3 -0
  27. package/lib/_cjs/plugins/cors.js +44 -0
  28. package/lib/_cjs/plugins/file_parser.js +24 -0
  29. package/lib/_cjs/plugins/ws_parser.js +24 -0
  30. package/lib/_cjs/plugins/xml_parser.js +61 -0
  31. package/lib/_cjs/services/base.js +3 -0
  32. package/lib/_cjs/services/cache.js +231 -0
  33. package/lib/_cjs/services/captcha.js +45 -0
  34. package/lib/_cjs/services/dispose.js +33 -0
  35. package/lib/_cjs/services/jwt.js +59 -0
  36. package/lib/_cjs/services/redis.js +18 -0
  37. package/lib/_cjs/x.js +20 -0
  38. package/lib/cli/api_generator.js +269 -332
  39. package/lib/cli/build_util.d.ts +1 -0
  40. package/lib/cli/build_util.js +108 -130
  41. package/lib/cli/cli.js +161 -181
  42. package/lib/cli/deploy_util.js +37 -41
  43. package/lib/cli/env_util.js +112 -120
  44. package/lib/cli/register.js +5 -7
  45. package/lib/cli/template_util.js +47 -52
  46. package/lib/core/define_bus.js +22 -14
  47. package/lib/core/define_handler.js +31 -36
  48. package/lib/core/define_hook.js +4 -8
  49. package/lib/core/define_server.js +6 -10
  50. package/lib/core/define_task.js +20 -25
  51. package/lib/core/handler.js +78 -74
  52. package/lib/core/http_error.js +2 -8
  53. package/lib/core/http_method.js +7 -10
  54. package/lib/core/server.js +125 -139
  55. package/lib/core/types.js +11 -2
  56. package/lib/index.js +23 -39
  57. package/lib/plugins/base.js +1 -2
  58. package/lib/plugins/cors.js +30 -36
  59. package/lib/plugins/file_parser.d.ts +1 -1
  60. package/lib/plugins/file_parser.js +12 -16
  61. package/lib/plugins/ws_parser.d.ts +1 -1
  62. package/lib/plugins/ws_parser.js +12 -16
  63. package/lib/plugins/xml_parser.d.ts +1 -1
  64. package/lib/plugins/xml_parser.js +47 -43
  65. package/lib/services/base.js +1 -2
  66. package/lib/services/cache.js +213 -190
  67. package/lib/services/captcha.js +32 -33
  68. package/lib/services/dispose.d.ts +1 -1
  69. package/lib/services/dispose.js +22 -23
  70. package/lib/services/jwt.js +45 -48
  71. package/lib/services/redis.js +8 -14
  72. package/lib/x.js +12 -15
  73. package/package.json +6 -4
@@ -1,19 +1,15 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FileParserPlugin = void 0;
7
- const fastify_multipart_1 = __importDefault(require("fastify-multipart"));
1
+ import FastifyMultipart from 'fastify-multipart';
2
+
8
3
  /**
9
4
  * file 解析器插件
10
5
  */
11
- class FileParserPlugin {
12
- constructor(options) {
13
- this.options = options;
14
- }
15
- register(fastify) {
16
- fastify.register(fastify_multipart_1.default, this.options);
17
- }
18
- }
19
- exports.FileParserPlugin = FileParserPlugin;
6
+ export class FileParserPlugin {
7
+ constructor(options) {
8
+ this.options = options;
9
+ }
10
+
11
+ register(fastify) {
12
+ fastify.register(FastifyMultipart, this.options);
13
+ }
14
+
15
+ }
@@ -8,6 +8,6 @@ export interface WsParserPluginOptions extends WebsocketPluginOptions {
8
8
  */
9
9
  export declare class WsParserPlugin implements BasePlugin {
10
10
  private options?;
11
- constructor(options?: WsParserPluginOptions | undefined);
11
+ constructor(options?: WsParserPluginOptions);
12
12
  register(fastify: FastifyInstance): void;
13
13
  }
@@ -1,19 +1,15 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.WsParserPlugin = void 0;
7
- const fastify_websocket_1 = __importDefault(require("fastify-websocket"));
1
+ import FastifyWebsocket from 'fastify-websocket';
2
+
8
3
  /**
9
4
  * websocket 解析器插件
10
5
  */
11
- class WsParserPlugin {
12
- constructor(options) {
13
- this.options = options;
14
- }
15
- register(fastify) {
16
- fastify.register(fastify_websocket_1.default, this.options);
17
- }
18
- }
19
- exports.WsParserPlugin = WsParserPlugin;
6
+ export class WsParserPlugin {
7
+ constructor(options) {
8
+ this.options = options;
9
+ }
10
+
11
+ register(fastify) {
12
+ fastify.register(FastifyWebsocket, this.options);
13
+ }
14
+
15
+ }
@@ -14,6 +14,6 @@ export interface XmlParserPluginOptions extends Partial<fxp.X2jOptions> {
14
14
  */
15
15
  export declare class XmlParserPlugin implements BasePlugin {
16
16
  private options?;
17
- constructor(options?: XmlParserPluginOptions | undefined);
17
+ constructor(options?: XmlParserPluginOptions);
18
18
  register(fastify: FastifyInstance): void;
19
19
  }
@@ -1,48 +1,52 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.XmlParserPlugin = void 0;
7
- const fast_xml_parser_1 = __importDefault(require("fast-xml-parser"));
1
+ import fxp from 'fast-xml-parser';
2
+
8
3
  /**
9
4
  * XML 解析器插件
10
5
  *
11
6
  * 底层解析器是 [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser)
12
7
  */
13
- class XmlParserPlugin {
14
- constructor(options) {
15
- this.options = options;
16
- }
17
- register(fastify) {
18
- const { contentType = ['text/xml', 'application/xml'], ...parseOptions } = this.options || {};
19
- fastify.addContentTypeParser(contentType, (req, payload, done) => {
20
- let body = '';
21
- const handleError = (err) => done(err);
22
- const handleData = (data) => (body += data);
23
- const handleEnd = () => {
24
- let data;
25
- let err;
26
- try {
27
- data = fast_xml_parser_1.default.parse(body, parseOptions);
28
- }
29
- catch (_err) {
30
- err = _err;
31
- }
32
- payload.removeListener('error', handleError);
33
- payload.removeListener('data', handleData);
34
- payload.removeListener('end', handleEnd);
35
- if (err) {
36
- done(err);
37
- }
38
- else {
39
- done(null, data);
40
- }
41
- };
42
- payload.on('error', handleError);
43
- payload.on('data', handleData);
44
- payload.on('end', handleEnd);
45
- });
46
- }
47
- }
48
- exports.XmlParserPlugin = XmlParserPlugin;
8
+ export class XmlParserPlugin {
9
+ constructor(options) {
10
+ this.options = options;
11
+ }
12
+
13
+ register(fastify) {
14
+ const {
15
+ contentType = ['text/xml', 'application/xml'],
16
+ ...parseOptions
17
+ } = this.options || {};
18
+ fastify.addContentTypeParser(contentType, (req, payload, done) => {
19
+ let body = '';
20
+
21
+ const handleError = err => done(err);
22
+
23
+ const handleData = data => body += data;
24
+
25
+ const handleEnd = () => {
26
+ let data;
27
+ let err;
28
+
29
+ try {
30
+ data = fxp.parse(body, parseOptions);
31
+ } catch (_err) {
32
+ err = _err;
33
+ }
34
+
35
+ payload.removeListener('error', handleError);
36
+ payload.removeListener('data', handleData);
37
+ payload.removeListener('end', handleEnd);
38
+
39
+ if (err) {
40
+ done(err);
41
+ } else {
42
+ done(null, data);
43
+ }
44
+ };
45
+
46
+ payload.on('error', handleError);
47
+ payload.on('data', handleData);
48
+ payload.on('end', handleEnd);
49
+ });
50
+ }
51
+
52
+ }
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,196 +1,219 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CacheService = void 0;
7
- const cuid_1 = __importDefault(require("cuid"));
8
- const date_1 = require("vtils/date");
9
- const x_1 = require("../x");
10
- class CacheService {
11
- constructor(options) {
12
- this.options = options;
13
- this.serviceName = 'cache';
14
- this.prefix = `${x_1.x.appName}:`;
1
+ import cuid from 'cuid';
2
+ import { ms } from 'vtils/date';
3
+ import { x } from "../x";
4
+ export class CacheService {
5
+ constructor(options) {
6
+ this.options = options;
7
+ this.serviceName = 'cache';
8
+ this.prefix = void 0;
9
+ this.prefix = `${x.appName}:`;
10
+ }
11
+
12
+ toRedisKey(key) {
13
+ return `${this.prefix}${Array.isArray(key) ? key.join('_') : String(key)}`;
14
+ }
15
+ /**
16
+ * 设置缓存内容。对象类内容尽量避免使用,以免造成问题。
17
+ *
18
+ * @param key 键
19
+ * @param value 值
20
+ * @param ttl 缓存时间(单位:时)
21
+ * @returns 返回设置的缓存内容
22
+ */
23
+
24
+
25
+ async set(key, value, ttl = this.options.ttl) {
26
+ const redisKey = this.toRedisKey(key);
27
+ const redisValue = JSON.stringify(value);
28
+ const redisTtl = typeof ttl === 'function' ? ttl(value, this.options.ttl) : ttl;
29
+ await x.redis.set(redisKey, redisValue, // 毫秒
30
+ 'PX', ms(redisTtl));
31
+ return value;
32
+ }
33
+ /**
34
+ * 存储值然后返回其对应的键,该键 URL 友好。
35
+ *
36
+ * @param value 值
37
+ * @param ttl 存活时间
38
+ */
39
+
40
+
41
+ async save(value, ttl = this.options.ttl) {
42
+ const key = `X__${cuid()}`;
43
+ await this.set(key, typeof value === 'function' ? await value(key) : value, ttl);
44
+ return key;
45
+ }
46
+ /**
47
+ * 获取缓存内容。
48
+ *
49
+ * @param key 键
50
+ * @returns 返回获取到的缓存内容
51
+ */
52
+
53
+
54
+ async get(key) {
55
+ const redisKey = this.toRedisKey(key);
56
+ const gotValue = await x.redis.get(redisKey);
57
+
58
+ if (gotValue) {
59
+ try {
60
+ return JSON.parse(gotValue);
61
+ } catch {}
15
62
  }
16
- toRedisKey(key) {
17
- return `${this.prefix}${Array.isArray(key) ? key.join('_') : String(key)}`;
18
- }
19
- /**
20
- * 设置缓存内容。对象类内容尽量避免使用,以免造成问题。
21
- *
22
- * @param key
23
- * @param value 值
24
- * @param ttl 缓存时间(单位:时)
25
- * @returns 返回设置的缓存内容
26
- */
27
- async set(key, value, ttl = this.options
28
- .ttl) {
29
- const redisKey = this.toRedisKey(key);
30
- const redisValue = JSON.stringify(value);
31
- const redisTtl = typeof ttl === 'function' ? ttl(value, this.options.ttl) : ttl;
32
- await x_1.x.redis.set(redisKey, redisValue,
33
- // 毫秒
34
- 'PX', (0, date_1.ms)(redisTtl));
35
- return value;
36
- }
37
- /**
38
- * 存储值然后返回其对应的键,该键 URL 友好。
39
- *
40
- * @param value 值
41
- * @param ttl 存活时间
42
- */
43
- async save(value, ttl = this.options.ttl) {
44
- const key = `X__${(0, cuid_1.default)()}`;
45
- await this.set(key, typeof value === 'function' ? await value(key) : value, ttl);
46
- return key;
47
- }
48
- /**
49
- * 获取缓存内容。
50
- *
51
- * @param key 键
52
- * @returns 返回获取到的缓存内容
53
- */
54
- async get(key) {
55
- const redisKey = this.toRedisKey(key);
56
- const gotValue = await x_1.x.redis.get(redisKey);
57
- if (gotValue) {
58
- try {
59
- return JSON.parse(gotValue);
60
- }
61
- catch { }
62
- }
63
+
64
+ return null;
65
+ }
66
+ /**
67
+ * 获取多个缓存内容。
68
+ *
69
+ * @param keys
70
+ * @returns 返回获取到的缓存内容
71
+ */
72
+
73
+
74
+ async getMany(...keys) {
75
+ const redisKeys = keys.map(key => this.toRedisKey(key));
76
+ if (!redisKeys.length) return [];
77
+ const gotValues = await x.redis.mget(...redisKeys);
78
+ return gotValues.map(value => {
79
+ if (value == null) return null;
80
+
81
+ try {
82
+ return JSON.parse(value);
83
+ } catch {
63
84
  return null;
85
+ }
86
+ });
87
+ }
88
+ /**
89
+ * 缓存内容。
90
+ *
91
+ * @param key 键
92
+ * @param action 获取缓存内容的操作
93
+ * @param ttl 缓存时间(单位:时)
94
+ * @returns 返回获取到的内容
95
+ */
96
+
97
+
98
+ async remember(key, action, ttl = this.options.ttl) {
99
+ let value = await this.get(key);
100
+
101
+ if (value === null) {
102
+ value = await action();
103
+ await this.set(key, value, ttl);
64
104
  }
65
- /**
66
- * 获取多个缓存内容。
67
- *
68
- * @param keys 键
69
- * @returns 返回获取到的缓存内容
70
- */
71
- async getMany(...keys) {
72
- const redisKeys = keys.map(key => this.toRedisKey(key));
73
- if (!redisKeys.length)
74
- return [];
75
- const gotValues = await x_1.x.redis.mget(...redisKeys);
76
- return gotValues.map(value => {
77
- if (value == null)
78
- return null;
79
- try {
80
- return JSON.parse(value);
81
- }
82
- catch {
83
- return null;
84
- }
85
- });
86
- }
87
- /**
88
- * 缓存内容。
89
- *
90
- * @param key 键
91
- * @param action 获取缓存内容的操作
92
- * @param ttl 缓存时间(单位:时)
93
- * @returns 返回获取到的内容
94
- */
95
- async remember(key, action, ttl = this.options
96
- .ttl) {
97
- let value = await this.get(key);
98
- if (value === null) {
99
- value = await action();
100
- await this.set(key, value, ttl);
101
- }
102
- return value;
103
- }
104
- /**
105
- * 自增。
106
- *
107
- * @param key
108
- * @param increment 增量
109
- */
110
- async increase(key, increment = 1) {
111
- const redisKey = this.toRedisKey(key);
112
- return x_1.x.redis.incrby(redisKey, increment);
113
- }
114
- /**
115
- * 自减。
116
- *
117
- * @param key 键
118
- * @param decrement 减量
119
- */
120
- async decrease(key, decrement = 1) {
121
- return this.increase(key, -decrement);
122
- }
123
- /**
124
- * 新增元素。
125
- *
126
- * @param key 键
127
- * @param values 元素列表
128
- */
129
- async push(key, ...values) {
130
- const redisKey = this.toRedisKey(key);
131
- return x_1.x.redis.rpush(redisKey, ...values.map(value => JSON.stringify(value)));
132
- }
133
- /**
134
- * 从头部弹出元素并返回。
135
- *
136
- * @param key 键
137
- * @param count 弹出元素个数
138
- */
139
- async shift(key, count = 1) {
140
- const redisKey = this.toRedisKey(key);
141
- const res = [];
142
- for (let i = 0; i < count; i++) {
143
- const item = await x_1.x.redis.lpop(redisKey);
144
- if (item) {
145
- res.push(JSON.parse(item));
146
- }
147
- else {
148
- break;
149
- }
150
- }
151
- return res;
152
- }
153
- /**
154
- * 删除缓存。
155
- *
156
- * @param keys 键列表
157
- */
158
- async remove(...keys) {
159
- return Promise.all(keys.map(async (key) => {
160
- const redisKey = this.toRedisKey(key);
161
- return x_1.x.redis.del(redisKey);
162
- }));
163
- }
164
- /**
165
- * 清空全部缓存。
166
- */
167
- async clearAll() {
168
- const keys = await x_1.x.redis.keys(`${this.prefix}*`);
169
- if (keys.length) {
170
- return x_1.x.redis.del(...keys);
171
- }
172
- return 0;
105
+
106
+ return value;
107
+ }
108
+ /**
109
+ * 自增。
110
+ *
111
+ * @param key 键
112
+ * @param increment 增量
113
+ */
114
+
115
+
116
+ async increase(key, increment = 1) {
117
+ const redisKey = this.toRedisKey(key);
118
+ return x.redis.incrby(redisKey, increment);
119
+ }
120
+ /**
121
+ * 自减。
122
+ *
123
+ * @param key 键
124
+ * @param decrement 减量
125
+ */
126
+
127
+
128
+ async decrease(key, decrement = 1) {
129
+ return this.increase(key, -decrement);
130
+ }
131
+ /**
132
+ * 新增元素。
133
+ *
134
+ * @param key 键
135
+ * @param values 元素列表
136
+ */
137
+
138
+
139
+ async push(key, ...values) {
140
+ const redisKey = this.toRedisKey(key);
141
+ return x.redis.rpush(redisKey, ...values.map(value => JSON.stringify(value)));
142
+ }
143
+ /**
144
+ * 从头部弹出元素并返回。
145
+ *
146
+ * @param key 键
147
+ * @param count 弹出元素个数
148
+ */
149
+
150
+
151
+ async shift(key, count = 1) {
152
+ const redisKey = this.toRedisKey(key);
153
+ const res = [];
154
+
155
+ for (let i = 0; i < count; i++) {
156
+ const item = await x.redis.lpop(redisKey);
157
+
158
+ if (item) {
159
+ res.push(JSON.parse(item));
160
+ } else {
161
+ break;
162
+ }
173
163
  }
174
- /**
175
- * 清空指定前缀的缓存。
176
- */
177
- async clear(...prefixes) {
178
- const keys = (await Promise.all(prefixes.map(prefix => x_1.x.redis.keys(`${this.toRedisKey(prefix)}*`)))).flat();
179
- if (keys.length) {
180
- return x_1.x.redis.del(...keys);
181
- }
182
- return 0;
164
+
165
+ return res;
166
+ }
167
+ /**
168
+ * 删除缓存。
169
+ *
170
+ * @param keys 键列表
171
+ */
172
+
173
+
174
+ async remove(...keys) {
175
+ return Promise.all(keys.map(async key => {
176
+ const redisKey = this.toRedisKey(key);
177
+ return x.redis.del(redisKey);
178
+ }));
179
+ }
180
+ /**
181
+ * 清空全部缓存。
182
+ */
183
+
184
+
185
+ async clearAll() {
186
+ const keys = await x.redis.keys(`${this.prefix}*`);
187
+
188
+ if (keys.length) {
189
+ return x.redis.del(...keys);
183
190
  }
184
- /**
185
- * 派生出一个指定类型的缓存服务。
186
- */
187
- fork(options) {
188
- return options
189
- ? new CacheService({
190
- ...this.options,
191
- ...options,
192
- })
193
- : this;
191
+
192
+ return 0;
193
+ }
194
+ /**
195
+ * 清空指定前缀的缓存。
196
+ */
197
+
198
+
199
+ async clear(...prefixes) {
200
+ const keys = (await Promise.all(prefixes.map(prefix => x.redis.keys(`${this.toRedisKey(prefix)}*`)))).flat();
201
+
202
+ if (keys.length) {
203
+ return x.redis.del(...keys);
194
204
  }
195
- }
196
- exports.CacheService = CacheService;
205
+
206
+ return 0;
207
+ }
208
+ /**
209
+ * 派生出一个指定类型的缓存服务。
210
+ */
211
+
212
+
213
+ fork(options) {
214
+ return options ? new CacheService({ ...this.options,
215
+ ...options
216
+ }) : this;
217
+ }
218
+
219
+ }
@@ -1,34 +1,33 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CaptchaService = void 0;
7
- const svg_captcha_1 = __importDefault(require("svg-captcha"));
8
- const x_1 = require("../x");
9
- class CaptchaService {
10
- constructor(options) {
11
- this.options = options;
12
- this.serviceName = 'captcha';
1
+ import svgCaptcha from 'svg-captcha';
2
+ import { x } from "../x";
3
+ export class CaptchaService {
4
+ constructor(options) {
5
+ this.options = options;
6
+ this.serviceName = 'captcha';
7
+ }
8
+
9
+ async generate() {
10
+ const res = svgCaptcha.create({
11
+ size: this.options.size
12
+ });
13
+ const token = await x.cache.save(res.text, this.options.ttl);
14
+ return {
15
+ text: res.text,
16
+ svg: res.data,
17
+ token: token
18
+ };
19
+ }
20
+
21
+ async verify(options) {
22
+ var _options$text;
23
+
24
+ if (((_options$text = options.text) == null ? void 0 : _options$text.length) !== this.options.size) {
25
+ return false;
13
26
  }
14
- async generate() {
15
- const res = svg_captcha_1.default.create({
16
- size: this.options.size,
17
- });
18
- const token = await x_1.x.cache.save(res.text, this.options.ttl);
19
- return {
20
- text: res.text,
21
- svg: res.data,
22
- token: token,
23
- };
24
- }
25
- async verify(options) {
26
- if (options.text?.length !== this.options.size) {
27
- return false;
28
- }
29
- const expectedText = await x_1.x.cache.get(options.token);
30
- await x_1.x.cache.remove(options.token);
31
- return options.text === expectedText;
32
- }
33
- }
34
- exports.CaptchaService = CaptchaService;
27
+
28
+ const expectedText = await x.cache.get(options.token);
29
+ await x.cache.remove(options.token);
30
+ return options.text === expectedText;
31
+ }
32
+
33
+ }
@@ -5,7 +5,7 @@ export interface DisposeOptions {
5
5
  export declare class DisposeService implements BaseService {
6
6
  private options?;
7
7
  serviceName: string;
8
- constructor(options?: DisposeOptions | undefined);
8
+ constructor(options?: DisposeOptions);
9
9
  private disposes;
10
10
  add(fn: () => any): void;
11
11
  dispose(): Promise<any[]>;