alemonjs 2.1.18 → 2.1.19

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 (37) hide show
  1. package/lib/app/define-response.d.ts +0 -3
  2. package/lib/app/define-response.js +1 -5
  3. package/lib/app/define-router.d.ts +5 -0
  4. package/lib/app/define-router.js +21 -0
  5. package/lib/app/event-processor-cycleRoute.js +31 -5
  6. package/lib/app/hook-use-api.d.ts +14 -6
  7. package/lib/app/hook-use-api.js +80 -82
  8. package/lib/app/index.d.ts +1 -0
  9. package/lib/app/index.js +3 -2
  10. package/lib/app/load_modules/loadChild.js +1 -1
  11. package/lib/app/message-format.d.ts +30 -1
  12. package/lib/app/message-format.js +82 -1
  13. package/lib/app/store.js +14 -2
  14. package/lib/index.js +3 -2
  15. package/lib/types/event/index.d.ts +7 -0
  16. package/package.json +1 -1
  17. package/lib/app/define-chidren.d.ts +0 -2
  18. package/lib/app/define-chidren.js +0 -19
  19. package/lib/app/define-pl.ts +0 -0
  20. package/lib/cbp/core/connection-manager.d.ts +0 -18
  21. package/lib/cbp/core/connection-manager.js +0 -67
  22. package/lib/cbp/core/constants.d.ts +0 -19
  23. package/lib/cbp/core/constants.js +0 -23
  24. package/lib/cbp/core/load-balancer.d.ts +0 -37
  25. package/lib/cbp/core/load-balancer.js +0 -118
  26. package/lib/cbp/processor/heandle.d.ts +0 -3
  27. package/lib/cbp/processor/heandle.js +0 -32
  28. package/lib/cbp/processor/request-handler.d.ts +0 -17
  29. package/lib/cbp/processor/request-handler.js +0 -65
  30. package/lib/polyfills/fs-promises.d.ts +0 -41
  31. package/lib/polyfills/fs-promises.js +0 -138
  32. package/lib/polyfills/fs.d.ts +0 -103
  33. package/lib/polyfills/fs.js +0 -229
  34. package/lib/polyfills/util-types.d.ts +0 -33
  35. package/lib/polyfills/util-types.js +0 -36
  36. package/lib/types/event/channal/index.d.ts +0 -10
  37. package/lib/types/event/channal/index.js +0 -1
@@ -1,229 +0,0 @@
1
- const existsSync = (path) => {
2
- console.warn(`[AlemonJS Browser] fs.existsSync('${path}') is not available in browser, returning false`);
3
- return false;
4
- };
5
- const readFileSync = (path, encoding) => {
6
- console.warn(`[AlemonJS Browser] fs.readFileSync('${path}') is not available in browser, returning empty string`);
7
- return '';
8
- };
9
- const writeFileSync = (path, data) => {
10
- console.warn(`[AlemonJS Browser] fs.writeFileSync('${path}') is not available in browser, operation skipped`);
11
- };
12
- const mkdirSync = (path, options) => {
13
- console.warn(`[AlemonJS Browser] fs.mkdirSync('${path}') is not available in browser, operation skipped`);
14
- };
15
- const watch = (path, options) => {
16
- console.warn(`[AlemonJS Browser] fs.watch('${path}') is not available in browser, returning mock watcher`);
17
- return {
18
- close: () => {
19
- console.warn('[AlemonJS Browser] Mock fs.watch close() called');
20
- },
21
- on: (event, callback) => {
22
- console.warn(`[AlemonJS Browser] Mock fs.watch on('${event}') called`);
23
- },
24
- ref: () => {
25
- console.warn('[AlemonJS Browser] Mock fs.watch ref() called');
26
- return undefined;
27
- },
28
- unref: () => {
29
- console.warn('[AlemonJS Browser] Mock fs.watch unref() called');
30
- return undefined;
31
- }
32
- };
33
- };
34
- const readdirSync = (path) => {
35
- console.warn(`[AlemonJS Browser] fs.readdirSync('${path}') is not available in browser, returning empty array`);
36
- return [];
37
- };
38
- const statSync = (path) => {
39
- console.warn(`[AlemonJS Browser] fs.statSync('${path}') is not available in browser, returning mock stats`);
40
- return {
41
- isDirectory: () => false,
42
- isFile: () => false,
43
- isBlockDevice: () => false,
44
- isCharacterDevice: () => false,
45
- isSymbolicLink: () => false,
46
- isFIFO: () => false,
47
- isSocket: () => false,
48
- dev: 0,
49
- ino: 0,
50
- mode: 0,
51
- nlink: 0,
52
- uid: 0,
53
- gid: 0,
54
- rdev: 0,
55
- size: 0,
56
- blksize: 0,
57
- blocks: 0,
58
- atimeMs: 0,
59
- mtimeMs: 0,
60
- ctimeMs: 0,
61
- birthtimeMs: 0,
62
- atime: new Date(),
63
- mtime: new Date(),
64
- ctime: new Date(),
65
- birthtime: new Date()
66
- };
67
- };
68
- const unlinkSync = (path) => {
69
- console.warn(`[AlemonJS Browser] fs.unlinkSync('${path}') is not available in browser, operation skipped`);
70
- };
71
- const rmdirSync = (path, options) => {
72
- console.warn(`[AlemonJS Browser] fs.rmdirSync('${path}') is not available in browser, operation skipped`);
73
- };
74
- const renameSync = (oldPath, newPath) => {
75
- console.warn(`[AlemonJS Browser] fs.renameSync('${oldPath}', '${newPath}') is not available in browser, operation skipped`);
76
- };
77
- const copyFileSync = (src, dest, flags) => {
78
- console.warn(`[AlemonJS Browser] fs.copyFileSync('${src}', '${dest}') is not available in browser, operation skipped`);
79
- };
80
- const appendFileSync = (path, data, options) => {
81
- console.warn(`[AlemonJS Browser] fs.appendFileSync('${path}') is not available in browser, operation skipped`);
82
- };
83
- const writeFile = (path, data, callback) => {
84
- console.warn(`[AlemonJS Browser] fs.writeFile('${path}') is not available in browser, operation skipped`);
85
- if (callback) {
86
- setTimeout(() => callback(null), 0);
87
- }
88
- };
89
- const readFile = (path, encoding, callback) => {
90
- console.warn(`[AlemonJS Browser] fs.readFile('${path}') is not available in browser, returning empty data`);
91
- if (callback) {
92
- setTimeout(() => callback(null, ''), 0);
93
- }
94
- };
95
- const mkdir = (path, options, callback) => {
96
- console.warn(`[AlemonJS Browser] fs.mkdir('${path}') is not available in browser, operation skipped`);
97
- if (callback) {
98
- setTimeout(() => callback(null), 0);
99
- }
100
- };
101
- const unlink = (path, callback) => {
102
- console.warn(`[AlemonJS Browser] fs.unlink('${path}') is not available in browser, operation skipped`);
103
- if (callback) {
104
- setTimeout(() => callback(null), 0);
105
- }
106
- };
107
- const rmdir = (path, callback) => {
108
- console.warn(`[AlemonJS Browser] fs.rmdir('${path}') is not available in browser, operation skipped`);
109
- if (callback) {
110
- setTimeout(() => callback(null), 0);
111
- }
112
- };
113
- const rename = (oldPath, newPath, callback) => {
114
- console.warn(`[AlemonJS Browser] fs.rename('${oldPath}', '${newPath}') is not available in browser, operation skipped`);
115
- if (callback) {
116
- setTimeout(() => callback(null), 0);
117
- }
118
- };
119
- const promises = {
120
- writeFile: async (path, data) => {
121
- console.warn(`[AlemonJS Browser] fs.promises.writeFile('${path}') is not available in browser, operation skipped`);
122
- return Promise.resolve();
123
- },
124
- readFile: async (path, encoding) => {
125
- console.warn(`[AlemonJS Browser] fs.promises.readFile('${path}') is not available in browser, returning empty string`);
126
- return Promise.resolve('');
127
- },
128
- mkdir: async (path, options) => {
129
- console.warn(`[AlemonJS Browser] fs.promises.mkdir('${path}') is not available in browser, operation skipped`);
130
- return Promise.resolve();
131
- },
132
- readdir: async (path) => {
133
- console.warn(`[AlemonJS Browser] fs.promises.readdir('${path}') is not available in browser, returning empty array`);
134
- return Promise.resolve([]);
135
- },
136
- stat: async (path) => {
137
- console.warn(`[AlemonJS Browser] fs.promises.stat('${path}') is not available in browser, returning mock stats`);
138
- return Promise.resolve(statSync(path));
139
- },
140
- unlink: async (path) => {
141
- console.warn(`[AlemonJS Browser] fs.promises.unlink('${path}') is not available in browser, operation skipped`);
142
- return Promise.resolve();
143
- },
144
- rmdir: async (path) => {
145
- console.warn(`[AlemonJS Browser] fs.promises.rmdir('${path}') is not available in browser, operation skipped`);
146
- return Promise.resolve();
147
- }
148
- };
149
- const createReadStream = (path, options) => {
150
- console.warn(`[AlemonJS Browser] fs.createReadStream('${path}') is not available in browser, returning mock stream`);
151
- const mockStream = {
152
- on: (event, listener) => {
153
- if (event === 'error') {
154
- setTimeout(() => listener(new Error(`Cannot create read stream for ${path} in browser`)), 0);
155
- }
156
- return mockStream;
157
- },
158
- pipe: () => mockStream,
159
- destroy: () => { },
160
- pause: () => mockStream,
161
- resume: () => mockStream
162
- };
163
- return mockStream;
164
- };
165
- const createWriteStream = (path, options) => {
166
- console.warn(`[AlemonJS Browser] fs.createWriteStream('${path}') is not available in browser, returning mock stream`);
167
- const mockStream = {
168
- write: (data) => {
169
- console.warn(`[AlemonJS Browser] Mock write stream write() called for ${path}`);
170
- return true;
171
- },
172
- end: () => {
173
- console.warn(`[AlemonJS Browser] Mock write stream end() called for ${path}`);
174
- },
175
- on: (event, listener) => {
176
- return mockStream;
177
- },
178
- destroy: () => { },
179
- pipe: () => mockStream
180
- };
181
- return mockStream;
182
- };
183
- const constants = {
184
- F_OK: 0,
185
- R_OK: 4,
186
- W_OK: 2,
187
- X_OK: 1,
188
- O_RDONLY: 0,
189
- O_WRONLY: 1,
190
- O_RDWR: 2,
191
- O_CREAT: 64,
192
- O_EXCL: 128,
193
- O_NOCTTY: 256,
194
- O_TRUNC: 512,
195
- O_APPEND: 1024,
196
- O_DIRECTORY: 65536,
197
- O_NOATIME: 262144,
198
- O_NOFOLLOW: 131072,
199
- O_SYNC: 1052672,
200
- O_DSYNC: 4096,
201
- O_DIRECT: 16384,
202
- O_NONBLOCK: 2048
203
- };
204
- var fs = {
205
- existsSync,
206
- readFileSync,
207
- writeFileSync,
208
- mkdirSync,
209
- watch,
210
- readdirSync,
211
- statSync,
212
- unlinkSync,
213
- rmdirSync,
214
- renameSync,
215
- copyFileSync,
216
- appendFileSync,
217
- writeFile,
218
- readFile,
219
- mkdir,
220
- unlink,
221
- rmdir,
222
- rename,
223
- promises,
224
- createReadStream,
225
- createWriteStream,
226
- constants
227
- };
228
-
229
- export { appendFileSync, constants, copyFileSync, createReadStream, createWriteStream, fs as default, existsSync, mkdir, mkdirSync, promises, readFile, readFileSync, readdirSync, rename, renameSync, rmdir, rmdirSync, statSync, unlink, unlinkSync, watch, writeFile, writeFileSync };
@@ -1,33 +0,0 @@
1
- export declare const isString: (value: any) => value is string;
2
- export declare const isNumber: (value: any) => value is number;
3
- export declare const isBoolean: (value: any) => value is boolean;
4
- export declare const isFunction: (value: any) => value is Function;
5
- export declare const isObject: (value: any) => value is object;
6
- export declare const isArray: (value: any) => value is any[];
7
- export declare const isBuffer: (value: any) => boolean;
8
- export declare const isDate: (value: any) => value is Date;
9
- export declare const isRegExp: (value: any) => value is RegExp;
10
- export declare const isError: (value: any) => value is Error;
11
- export declare const isNull: (value: any) => value is null;
12
- export declare const isUndefined: (value: any) => value is undefined;
13
- export declare const isSymbol: (value: any) => value is symbol;
14
- export declare const isPrimitive: (value: any) => boolean;
15
- export declare const isAsyncFunction: (func: unknown) => boolean;
16
- declare const _default: {
17
- isString: (value: any) => value is string;
18
- isNumber: (value: any) => value is number;
19
- isBoolean: (value: any) => value is boolean;
20
- isFunction: (value: any) => value is Function;
21
- isObject: (value: any) => value is object;
22
- isArray: (value: any) => value is any[];
23
- isBuffer: (value: any) => boolean;
24
- isDate: (value: any) => value is Date;
25
- isRegExp: (value: any) => value is RegExp;
26
- isError: (value: any) => value is Error;
27
- isNull: (value: any) => value is null;
28
- isUndefined: (value: any) => value is undefined;
29
- isSymbol: (value: any) => value is symbol;
30
- isPrimitive: (value: any) => boolean;
31
- isAsyncFunction: (func: unknown) => boolean;
32
- };
33
- export default _default;
@@ -1,36 +0,0 @@
1
- const isString = (value) => typeof value === 'string';
2
- const isNumber = (value) => typeof value === 'number';
3
- const isBoolean = (value) => typeof value === 'boolean';
4
- const isFunction = (value) => typeof value === 'function';
5
- const isObject = (value) => value !== null && typeof value === 'object';
6
- const isArray = (value) => Array.isArray(value);
7
- const isBuffer = (value) => value instanceof Uint8Array;
8
- const isDate = (value) => value instanceof Date;
9
- const isRegExp = (value) => value instanceof RegExp;
10
- const isError = (value) => value instanceof Error;
11
- const isNull = (value) => value === null;
12
- const isUndefined = (value) => value === undefined;
13
- const isSymbol = (value) => typeof value === 'symbol';
14
- const isPrimitive = (value) => value === null || (typeof value !== 'object' && typeof value !== 'function');
15
- const isAsyncFunction = (func) => {
16
- return Object.prototype.toString.call(func) === '[object AsyncFunction]';
17
- };
18
- var utilTypes = {
19
- isString,
20
- isNumber,
21
- isBoolean,
22
- isFunction,
23
- isObject,
24
- isArray,
25
- isBuffer,
26
- isDate,
27
- isRegExp,
28
- isError,
29
- isNull,
30
- isUndefined,
31
- isSymbol,
32
- isPrimitive,
33
- isAsyncFunction
34
- };
35
-
36
- export { utilTypes as default, isArray, isAsyncFunction, isBoolean, isBuffer, isDate, isError, isFunction, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isUndefined };
@@ -1,10 +0,0 @@
1
- import { Guild, Channel } from '../base/guild';
2
- import { platform } from '../base/platform';
3
- import { Message } from '../base/message';
4
- import { Expansion } from '../base/expansion';
5
- export type PublicEventChannalCreate = platform & Guild & Channel & Message & {
6
- name: 'channel.create';
7
- } & Expansion;
8
- export type PublicEventChannalDelete = platform & Guild & Channel & Message & {
9
- name: 'channal.delete';
10
- } & Expansion;
@@ -1 +0,0 @@
1
-