typespeed 2.0.13 → 2.0.16

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 (222) hide show
  1. package/dist/core.decorator.js +0 -1
  2. package/dist/database.decorator.js +0 -1
  3. package/dist/default/express-server.class.js +0 -1
  4. package/dist/default/log-default.class.js +0 -1
  5. package/dist/default/node-cache.class.js +0 -1
  6. package/dist/default/rabbitmq.class.js +0 -1
  7. package/dist/default/read-write-db.class.js +0 -1
  8. package/dist/default/redis.class.js +0 -1
  9. package/dist/factory/cache-factory.class.js +0 -1
  10. package/dist/factory/data-source-factory.class.js +0 -1
  11. package/dist/factory/log-factory.class.js +0 -1
  12. package/dist/factory/server-factory.class.js +0 -1
  13. package/dist/route.decorator.js +0 -1
  14. package/dist/scaffold/command.js +0 -1
  15. package/dist/typespeed.d.ts +133 -12
  16. package/dist/typespeed.js +1 -1
  17. package/package.json +2 -2
  18. package/src/typespeed.d.ts +133 -0
  19. package/src/typespeed.ts +2 -1
  20. package/test/node_modules/.package-lock.json +112 -4
  21. package/test/node_modules/@acuminous/bitsyntax/.github/workflows/node-js-ci.yml +17 -0
  22. package/test/node_modules/@acuminous/bitsyntax/.github/workflows/node-js-publish.yml +30 -0
  23. package/test/node_modules/@acuminous/bitsyntax/LICENSE +6 -0
  24. package/test/node_modules/@acuminous/bitsyntax/LICENSE-MIT +21 -0
  25. package/test/node_modules/@acuminous/bitsyntax/Makefile +15 -0
  26. package/test/node_modules/@acuminous/bitsyntax/README.md +308 -0
  27. package/test/node_modules/@acuminous/bitsyntax/index.js +10 -0
  28. package/test/node_modules/@acuminous/bitsyntax/lib/compile.js +303 -0
  29. package/test/node_modules/@acuminous/bitsyntax/lib/constructor.js +142 -0
  30. package/test/node_modules/@acuminous/bitsyntax/lib/grammar.pegjs +67 -0
  31. package/test/node_modules/@acuminous/bitsyntax/lib/interp.js +232 -0
  32. package/test/node_modules/@acuminous/bitsyntax/lib/parse.js +32 -0
  33. package/test/node_modules/@acuminous/bitsyntax/lib/parser.js +1173 -0
  34. package/test/node_modules/@acuminous/bitsyntax/lib/pattern.js +119 -0
  35. package/test/node_modules/@acuminous/bitsyntax/package.json +36 -0
  36. package/test/node_modules/@acuminous/bitsyntax/test/consing.test.js +50 -0
  37. package/test/node_modules/@acuminous/bitsyntax/test/matching.test.js +193 -0
  38. package/test/node_modules/@types/node/README.md +1 -1
  39. package/test/node_modules/@types/node/buffer.d.ts +5 -2
  40. package/test/node_modules/@types/node/child_process.d.ts +27 -0
  41. package/test/node_modules/@types/node/globals.d.ts +1 -0
  42. package/test/node_modules/@types/node/package.json +2 -2
  43. package/test/node_modules/@types/node/test.d.ts +43 -20
  44. package/test/node_modules/@types/node/ts4.8/buffer.d.ts +5 -2
  45. package/test/node_modules/@types/node/ts4.8/child_process.d.ts +27 -0
  46. package/test/node_modules/@types/node/ts4.8/globals.d.ts +1 -0
  47. package/test/node_modules/@types/node/ts4.8/test.d.ts +43 -19
  48. package/test/node_modules/@types/node/ts4.8/url.d.ts +3 -3
  49. package/test/node_modules/@types/node/ts4.8/util.d.ts +1 -1
  50. package/test/node_modules/@types/node/url.d.ts +3 -3
  51. package/test/node_modules/@types/node/util.d.ts +1 -1
  52. package/test/node_modules/amqplib/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  53. package/test/node_modules/amqplib/.github/workflows/test.yml +38 -0
  54. package/test/node_modules/amqplib/CHANGELOG.md +430 -0
  55. package/test/node_modules/amqplib/LICENSE +6 -0
  56. package/test/node_modules/amqplib/LICENSE-MIT +21 -0
  57. package/test/node_modules/amqplib/Makefile +47 -0
  58. package/test/node_modules/amqplib/README.md +157 -0
  59. package/test/node_modules/amqplib/bin/generate-defs.js +722 -0
  60. package/test/node_modules/amqplib/callback_api.js +22 -0
  61. package/test/node_modules/amqplib/channel_api.js +16 -0
  62. package/test/node_modules/amqplib/examples/headers.js +42 -0
  63. package/test/node_modules/amqplib/examples/receive_generator.js +39 -0
  64. package/test/node_modules/amqplib/examples/send_generators.js +42 -0
  65. package/test/node_modules/amqplib/examples/ssl.js +64 -0
  66. package/test/node_modules/amqplib/examples/tutorials/README.md +93 -0
  67. package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log.js +28 -0
  68. package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log_direct.js +30 -0
  69. package/test/node_modules/amqplib/examples/tutorials/callback_api/emit_log_topic.js +27 -0
  70. package/test/node_modules/amqplib/examples/tutorials/callback_api/new_task.js +27 -0
  71. package/test/node_modules/amqplib/examples/tutorials/callback_api/receive.js +30 -0
  72. package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs.js +36 -0
  73. package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs_direct.js +56 -0
  74. package/test/node_modules/amqplib/examples/tutorials/callback_api/receive_logs_topic.js +55 -0
  75. package/test/node_modules/amqplib/examples/tutorials/callback_api/rpc_client.js +49 -0
  76. package/test/node_modules/amqplib/examples/tutorials/callback_api/rpc_server.js +45 -0
  77. package/test/node_modules/amqplib/examples/tutorials/callback_api/send.js +29 -0
  78. package/test/node_modules/amqplib/examples/tutorials/callback_api/worker.js +35 -0
  79. package/test/node_modules/amqplib/examples/tutorials/emit_log.js +19 -0
  80. package/test/node_modules/amqplib/examples/tutorials/emit_log_direct.js +20 -0
  81. package/test/node_modules/amqplib/examples/tutorials/emit_log_topic.js +19 -0
  82. package/test/node_modules/amqplib/examples/tutorials/new_task.js +18 -0
  83. package/test/node_modules/amqplib/examples/tutorials/package.json +16 -0
  84. package/test/node_modules/amqplib/examples/tutorials/receive.js +21 -0
  85. package/test/node_modules/amqplib/examples/tutorials/receive_logs.js +28 -0
  86. package/test/node_modules/amqplib/examples/tutorials/receive_logs_direct.js +44 -0
  87. package/test/node_modules/amqplib/examples/tutorials/receive_logs_topic.js +43 -0
  88. package/test/node_modules/amqplib/examples/tutorials/rpc_client.js +52 -0
  89. package/test/node_modules/amqplib/examples/tutorials/rpc_server.js +39 -0
  90. package/test/node_modules/amqplib/examples/tutorials/send.js +23 -0
  91. package/test/node_modules/amqplib/examples/tutorials/worker.js +28 -0
  92. package/test/node_modules/amqplib/examples/waitForConfirms.js +22 -0
  93. package/test/node_modules/amqplib/lib/api_args.js +314 -0
  94. package/test/node_modules/amqplib/lib/bitset.js +130 -0
  95. package/test/node_modules/amqplib/lib/callback_model.js +327 -0
  96. package/test/node_modules/amqplib/lib/channel.js +499 -0
  97. package/test/node_modules/amqplib/lib/channel_model.js +302 -0
  98. package/test/node_modules/amqplib/lib/codec.js +321 -0
  99. package/test/node_modules/amqplib/lib/connect.js +189 -0
  100. package/test/node_modules/amqplib/lib/connection.js +663 -0
  101. package/test/node_modules/amqplib/lib/credentials.js +42 -0
  102. package/test/node_modules/amqplib/lib/defs.js +4966 -0
  103. package/test/node_modules/amqplib/lib/error.js +24 -0
  104. package/test/node_modules/amqplib/lib/format.js +40 -0
  105. package/test/node_modules/amqplib/lib/frame.js +113 -0
  106. package/test/node_modules/amqplib/lib/heartbeat.js +89 -0
  107. package/test/node_modules/amqplib/lib/mux.js +129 -0
  108. package/test/node_modules/amqplib/package.json +37 -0
  109. package/test/node_modules/amqplib/test/bitset.js +69 -0
  110. package/test/node_modules/amqplib/test/callback_api.js +312 -0
  111. package/test/node_modules/amqplib/test/channel.js +621 -0
  112. package/test/node_modules/amqplib/test/channel_api.js +596 -0
  113. package/test/node_modules/amqplib/test/codec.js +237 -0
  114. package/test/node_modules/amqplib/test/connect.js +197 -0
  115. package/test/node_modules/amqplib/test/connection.js +390 -0
  116. package/test/node_modules/amqplib/test/data.js +254 -0
  117. package/test/node_modules/amqplib/test/frame.js +198 -0
  118. package/test/node_modules/amqplib/test/mux.js +204 -0
  119. package/test/node_modules/amqplib/test/util.js +219 -0
  120. package/test/node_modules/buffer-more-ints/.travis.yml +6 -0
  121. package/test/node_modules/buffer-more-ints/LICENSE +19 -0
  122. package/test/node_modules/buffer-more-ints/README.md +69 -0
  123. package/test/node_modules/buffer-more-ints/buffer-more-ints-tests.js +183 -0
  124. package/test/node_modules/buffer-more-ints/buffer-more-ints.js +432 -0
  125. package/test/node_modules/buffer-more-ints/package.json +19 -0
  126. package/test/node_modules/buffer-more-ints/polyfill.js +71 -0
  127. package/test/node_modules/core-util-is/LICENSE +19 -0
  128. package/test/node_modules/core-util-is/README.md +3 -0
  129. package/test/node_modules/core-util-is/lib/util.js +107 -0
  130. package/test/node_modules/core-util-is/package.json +38 -0
  131. package/test/node_modules/debug/LICENSE +20 -0
  132. package/test/node_modules/debug/README.md +481 -0
  133. package/test/node_modules/debug/package.json +59 -0
  134. package/test/node_modules/debug/src/browser.js +269 -0
  135. package/test/node_modules/debug/src/common.js +274 -0
  136. package/test/node_modules/debug/src/index.js +10 -0
  137. package/test/node_modules/debug/src/node.js +263 -0
  138. package/test/node_modules/inherits/LICENSE +16 -0
  139. package/test/node_modules/inherits/README.md +42 -0
  140. package/test/node_modules/inherits/inherits.js +9 -0
  141. package/test/node_modules/inherits/inherits_browser.js +27 -0
  142. package/test/node_modules/inherits/package.json +29 -0
  143. package/test/node_modules/isarray/README.md +54 -0
  144. package/test/node_modules/isarray/build/build.js +209 -0
  145. package/test/node_modules/isarray/component.json +19 -0
  146. package/test/node_modules/isarray/index.js +3 -0
  147. package/test/node_modules/isarray/package.json +25 -0
  148. package/test/node_modules/ms/index.js +162 -0
  149. package/test/node_modules/ms/license.md +21 -0
  150. package/test/node_modules/ms/package.json +37 -0
  151. package/test/node_modules/ms/readme.md +60 -0
  152. package/test/node_modules/querystringify/LICENSE +22 -0
  153. package/test/node_modules/querystringify/README.md +61 -0
  154. package/test/node_modules/querystringify/index.js +118 -0
  155. package/test/node_modules/querystringify/package.json +38 -0
  156. package/test/node_modules/readable-stream/LICENSE +18 -0
  157. package/test/node_modules/readable-stream/README.md +15 -0
  158. package/test/node_modules/readable-stream/duplex.js +1 -0
  159. package/test/node_modules/readable-stream/float.patch +923 -0
  160. package/test/node_modules/readable-stream/lib/_stream_duplex.js +89 -0
  161. package/test/node_modules/readable-stream/lib/_stream_passthrough.js +46 -0
  162. package/test/node_modules/readable-stream/lib/_stream_readable.js +951 -0
  163. package/test/node_modules/readable-stream/lib/_stream_transform.js +209 -0
  164. package/test/node_modules/readable-stream/lib/_stream_writable.js +477 -0
  165. package/test/node_modules/readable-stream/package.json +32 -0
  166. package/test/node_modules/readable-stream/passthrough.js +1 -0
  167. package/test/node_modules/readable-stream/readable.js +10 -0
  168. package/test/node_modules/readable-stream/transform.js +1 -0
  169. package/test/node_modules/readable-stream/writable.js +1 -0
  170. package/test/node_modules/requires-port/.travis.yml +19 -0
  171. package/test/node_modules/requires-port/LICENSE +22 -0
  172. package/test/node_modules/requires-port/README.md +47 -0
  173. package/test/node_modules/requires-port/index.js +38 -0
  174. package/test/node_modules/requires-port/package.json +47 -0
  175. package/test/node_modules/requires-port/test.js +98 -0
  176. package/test/node_modules/safe-buffer/LICENSE +21 -0
  177. package/test/node_modules/safe-buffer/README.md +584 -0
  178. package/test/node_modules/safe-buffer/index.d.ts +187 -0
  179. package/test/node_modules/safe-buffer/index.js +62 -0
  180. package/test/node_modules/safe-buffer/package.json +37 -0
  181. package/test/node_modules/string_decoder/LICENSE +20 -0
  182. package/test/node_modules/string_decoder/README.md +7 -0
  183. package/test/node_modules/string_decoder/index.js +221 -0
  184. package/test/node_modules/string_decoder/package.json +25 -0
  185. package/test/node_modules/url-parse/LICENSE +22 -0
  186. package/test/node_modules/url-parse/README.md +153 -0
  187. package/test/node_modules/url-parse/dist/url-parse.js +755 -0
  188. package/test/node_modules/url-parse/dist/url-parse.min.js +1 -0
  189. package/test/node_modules/url-parse/dist/url-parse.min.js.map +1 -0
  190. package/test/node_modules/url-parse/index.js +589 -0
  191. package/test/node_modules/url-parse/package.json +49 -0
  192. package/test/src/test-mq.class.ts +1 -2
  193. package/tsconfig.json +4 -3
  194. package/dist/core.decorator.d.ts +0 -18
  195. package/dist/core.decorator.js.map +0 -1
  196. package/dist/database.decorator.d.ts +0 -24
  197. package/dist/database.decorator.js.map +0 -1
  198. package/dist/default/express-server.class.d.ts +0 -15
  199. package/dist/default/express-server.class.js.map +0 -1
  200. package/dist/default/log-default.class.d.ts +0 -6
  201. package/dist/default/log-default.class.js.map +0 -1
  202. package/dist/default/node-cache.class.d.ts +0 -13
  203. package/dist/default/node-cache.class.js.map +0 -1
  204. package/dist/default/rabbitmq.class.d.ts +0 -9
  205. package/dist/default/rabbitmq.class.js.map +0 -1
  206. package/dist/default/read-write-db.class.d.ts +0 -10
  207. package/dist/default/read-write-db.class.js.map +0 -1
  208. package/dist/default/redis.class.d.ts +0 -5
  209. package/dist/default/redis.class.js.map +0 -1
  210. package/dist/factory/cache-factory.class.d.ts +0 -7
  211. package/dist/factory/cache-factory.class.js.map +0 -1
  212. package/dist/factory/data-source-factory.class.d.ts +0 -4
  213. package/dist/factory/data-source-factory.class.js.map +0 -1
  214. package/dist/factory/log-factory.class.d.ts +0 -4
  215. package/dist/factory/log-factory.class.js.map +0 -1
  216. package/dist/factory/server-factory.class.d.ts +0 -6
  217. package/dist/factory/server-factory.class.js.map +0 -1
  218. package/dist/route.decorator.d.ts +0 -8
  219. package/dist/route.decorator.js.map +0 -1
  220. package/dist/scaffold/command.d.ts +0 -2
  221. package/dist/scaffold/command.js.map +0 -1
  222. package/dist/typespeed.js.map +0 -1
@@ -182,4 +182,3 @@ function schedule(cronTime) {
182
182
  };
183
183
  }
184
184
  exports.schedule = schedule;
185
- //# sourceMappingURL=core.decorator.js.map
@@ -332,4 +332,3 @@ class Model {
332
332
  }
333
333
  }
334
334
  exports.Model = Model;
335
- //# sourceMappingURL=database.decorator.js.map
@@ -145,4 +145,3 @@ __decorate([
145
145
  __metadata("design:returntype", server_factory_class_1.default)
146
146
  ], ExpressServer.prototype, "getSever", null);
147
147
  exports.default = ExpressServer;
148
- //# sourceMappingURL=express-server.class.js.map
@@ -29,4 +29,3 @@ __decorate([
29
29
  __metadata("design:returntype", log_factory_class_1.default)
30
30
  ], LogDefault.prototype, "createLog", null);
31
31
  exports.default = LogDefault;
32
- //# sourceMappingURL=log-default.class.js.map
@@ -48,4 +48,3 @@ __decorate([
48
48
  __metadata("design:returntype", cache_factory_class_1.default)
49
49
  ], NodeCache.prototype, "getNodeCache", null);
50
50
  exports.default = NodeCache;
51
- //# sourceMappingURL=node-cache.class.js.map
@@ -66,4 +66,3 @@ function rabbitListener(queue) {
66
66
  };
67
67
  }
68
68
  exports.rabbitListener = rabbitListener;
69
- //# sourceMappingURL=rabbitmq.class.js.map
@@ -63,4 +63,3 @@ __decorate([
63
63
  __metadata("design:returntype", data_source_factory_class_1.default)
64
64
  ], ReadWriteDb.prototype, "getDataSource", null);
65
65
  exports.default = ReadWriteDb;
66
- //# sourceMappingURL=read-write-db.class.js.map
@@ -29,4 +29,3 @@ __decorate([
29
29
  __metadata("design:returntype", Redis)
30
30
  ], Redis.prototype, "getRedis", null);
31
31
  exports.default = Redis;
32
- //# sourceMappingURL=redis.class.js.map
@@ -3,4 +3,3 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class CacheFactory {
4
4
  }
5
5
  exports.default = CacheFactory;
6
- //# sourceMappingURL=cache-factory.class.js.map
@@ -3,4 +3,3 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class DataSourceFactory {
4
4
  }
5
5
  exports.default = DataSourceFactory;
6
- //# sourceMappingURL=data-source-factory.class.js.map
@@ -3,4 +3,3 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  class LogFactory {
4
4
  }
5
5
  exports.default = LogFactory;
6
- //# sourceMappingURL=log-factory.class.js.map
@@ -6,4 +6,3 @@ class ServerFactory {
6
6
  }
7
7
  }
8
8
  exports.default = ServerFactory;
9
- //# sourceMappingURL=server-factory.class.js.map
@@ -84,4 +84,3 @@ const postMapping = (value) => mapperFunction("post", value);
84
84
  exports.postMapping = postMapping;
85
85
  const requestMapping = (value) => mapperFunction("all", value);
86
86
  exports.requestMapping = requestMapping;
87
- //# sourceMappingURL=route.decorator.js.map
@@ -33,4 +33,3 @@ function mkFile(fileName, targetPath, appName) {
33
33
  const fileContents = fs.readFileSync(tplPath + "/" + fileName + ".tpl", "utf-8");
34
34
  fs.writeFileSync(targetPath + "/" + fileName, fileContents.replace("###appName###", appName));
35
35
  }
36
- //# sourceMappingURL=command.js.map
@@ -1,12 +1,133 @@
1
- export * from "./core.decorator";
2
- export * from "./route.decorator";
3
- export * from "./database.decorator";
4
- export { default as LogFactory } from "./factory/log-factory.class";
5
- export { default as CacheFactory } from "./factory/cache-factory.class";
6
- export { default as DataSourceFactory } from "./factory/data-source-factory.class";
7
- export { default as ServerFactory } from "./factory/server-factory.class";
8
- export { default as ExpressServer } from "./default/express-server.class";
9
- export { default as LogDefault } from "./default/log-default.class";
10
- export { default as NodeCache } from "./default/node-cache.class";
11
- export { default as Redis } from "./default/redis.class";
12
- export { default as ReadWriteDb } from "./default/read-write-db.class";
1
+ import * as express from "express";
2
+ import IoRedis from "ioredis";
3
+ import "reflect-metadata";
4
+
5
+
6
+ declare function setRouter(app: express.Application): void;
7
+ declare function upload(target: any, propertyKey: string): void;
8
+ declare function jwt(jwtConfig: any): (target: any, propertyKey: string) => void;
9
+ declare const getMapping: (value: string) => (target: any, propertyKey: string) => void;
10
+ declare const postMapping: (value: string) => (target: any, propertyKey: string) => void;
11
+ declare const requestMapping: (value: string) => (target: any, propertyKey: string) => void;
12
+
13
+ declare function insert(sql: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
14
+ declare function update(sql: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
15
+ declare function remove(sql: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
16
+ declare function select(sql: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
17
+ declare function resultType(dataClass: any): (target: any, propertyKey: string) => void;
18
+ declare function param(name: string): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
19
+ declare function cache(ttl: number): (target: any, propertyKey: string) => void;
20
+ declare class Model {
21
+ page: any;
22
+ private table;
23
+ constructor(table?: string);
24
+ findAll<T>(conditions: object | string, sort?: string | object, fields?: string | [string], limit?: number | object): Promise<T[]>;
25
+ create(rows: any): Promise<number>;
26
+ find<T>(conditions: any, sort: any, fields?: string): Promise<T>;
27
+ update(conditions: any, fieldToValues: any): Promise<number>;
28
+ delete(conditions: any): Promise<number>;
29
+ findCount(conditions: any): Promise<number>;
30
+ incr(conditions: any, field: any, optval?: number): Promise<number>;
31
+ decr(conditions: any, field: any, optval?: number): Promise<number>;
32
+ pager(page: any, total: any, pageSize?: number, scope?: number): any;
33
+ private where;
34
+ private range;
35
+ }
36
+
37
+ declare function app<T extends {
38
+ new (...args: any[]): {};
39
+ }>(constructor: T): void;
40
+ declare function config(node: string): any;
41
+ declare function component(constructorFunction: any): void;
42
+ declare function getComponent(constructorFunction: any): any;
43
+ declare function bean(target: any, propertyKey: string): void;
44
+ declare function getBean(mappingClass: Function): any;
45
+ declare function value(configPath: string): any;
46
+ declare function autoware(target: any, propertyKey: string): void;
47
+ declare function resource(...args: any[]): any;
48
+ declare function log(message?: any, ...optionalParams: any[]): void;
49
+ declare function error(message?: any, ...optionalParams: any[]): void;
50
+ declare function before(constructorFunction: any, methodName: string): (target: any, propertyKey: string) => void;
51
+ declare function after(constructorFunction: any, methodName: string): (target: any, propertyKey: string) => void;
52
+ declare function schedule(cronTime: string | Date): (target: any, propertyKey: string) => void;
53
+ declare abstract class ServerFactory {
54
+ app: any;
55
+ protected middlewareList: Array<any>;
56
+ abstract setMiddleware(middleware: any): any;
57
+ abstract start(port: number): any;
58
+ }
59
+ declare abstract class LogFactory {
60
+ abstract log(message?: any, ...optionalParams: any[]): void;
61
+ abstract error(message?: any, ...optionalParams: any[]): void;
62
+ }
63
+ declare abstract class DataSourceFactory {
64
+ abstract readConnection(): any;
65
+ abstract writeConnection(): any;
66
+ }
67
+ declare abstract class CacheFactory {
68
+ abstract get(key: string): any;
69
+ abstract set(key: string, value: any, expire?: number): void;
70
+ abstract del(key: string): void;
71
+ abstract has(key: string): boolean;
72
+ abstract flush(): void;
73
+ }
74
+
75
+
76
+ declare class Redis extends IoRedis {
77
+ getRedis(): Redis;
78
+ constructor(config: any);
79
+ }
80
+ declare class ReadWriteDb extends DataSourceFactory {
81
+ private readonly readSession;
82
+ private readonly writeSession;
83
+ getDataSource(): DataSourceFactory;
84
+ constructor();
85
+ private getConnectionByConfig;
86
+ readConnection(): any;
87
+ writeConnection(): any;
88
+ }
89
+
90
+ declare class RabbitMQ {
91
+ getRabbitMQ(): RabbitMQ;
92
+ publishMessageToExchange(exchange: string, routingKey: string, message: string): Promise<void>;
93
+ sendMessageToQueue(queue: string, message: string): Promise<void>;
94
+ publish(exchange: string, routingKey: string, message: string): Promise<void>;
95
+ send(queue: string, message: string): Promise<void>;
96
+ }
97
+ declare function rabbitListener(queue: string): (target: any, propertyKey: string) => void;
98
+
99
+ declare class NodeCache extends CacheFactory {
100
+ private NodeCache;
101
+ private nodeCacheOptions;
102
+ private config;
103
+ constructor();
104
+ getNodeCache(): CacheFactory;
105
+ get(key: string): any;
106
+ set(key: string, value: any, expire?: number): void;
107
+ del(key: string): void;
108
+ has(key: string): boolean;
109
+ flush(): void;
110
+ }
111
+
112
+ declare class LogDefault extends LogFactory {
113
+ createLog(): LogFactory;
114
+ log(message?: any, ...optionalParams: any[]): void;
115
+ error(message?: any, ...optionalParams: any[]): void;
116
+ }
117
+
118
+ declare class ExpressServer extends ServerFactory {
119
+ view: string;
120
+ private static;
121
+ private favicon;
122
+ private compression;
123
+ private cookieConfig;
124
+ private session;
125
+ private redisConfig;
126
+ private redisClient;
127
+ getSever(): ServerFactory;
128
+ setMiddleware(middleware: any): void;
129
+ start(port: number): void;
130
+ private setDefaultMiddleware;
131
+ }
132
+
133
+ export { ExpressServer, LogDefault, NodeCache, RabbitMQ, rabbitListener, ReadWriteDb, Redis, CacheFactory, DataSourceFactory, LogFactory, ServerFactory, component, bean, resource, log, app, before, after, value, error, config, autoware, getBean, getComponent, schedule, getMapping, postMapping, requestMapping, setRouter, upload, jwt, insert, update, remove, select, param, resultType, cache, Model };
package/dist/typespeed.js CHANGED
@@ -36,4 +36,4 @@ var redis_class_1 = require("./default/redis.class");
36
36
  Object.defineProperty(exports, "Redis", { enumerable: true, get: function () { return redis_class_1.default; } });
37
37
  var read_write_db_class_1 = require("./default/read-write-db.class");
38
38
  Object.defineProperty(exports, "ReadWriteDb", { enumerable: true, get: function () { return read_write_db_class_1.default; } });
39
- //# sourceMappingURL=typespeed.js.map
39
+ __exportStar(require("./default/rabbitmq.class"), exports);
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "typespeed",
3
- "version": "2.0.13",
3
+ "version": "2.0.16",
4
4
  "description": "A new Framework for TypeScript.",
5
5
  "author": "speedphp",
6
6
  "license": "MIT License",
7
7
  "scripts": {
8
8
  "build": "tsc -p .",
9
- "postbuild": "cp -r src/default/pages dist/default/pages && cp -r src/scaffold/templates dist/scaffold/templates",
9
+ "postbuild": "cp src/typespeed.d.ts dist/typespeed.d.ts && cp -r src/default/pages dist/default/pages && cp -r src/scaffold/templates dist/scaffold/templates",
10
10
  "prebuild": "rm -rf dist",
11
11
  "prepublishOnly": "npm version patch && npm run build",
12
12
  "upgrade": "npm version minor",
@@ -0,0 +1,133 @@
1
+ import * as express from "express";
2
+ import IoRedis from "ioredis";
3
+ import "reflect-metadata";
4
+
5
+
6
+ declare function setRouter(app: express.Application): void;
7
+ declare function upload(target: any, propertyKey: string): void;
8
+ declare function jwt(jwtConfig: any): (target: any, propertyKey: string) => void;
9
+ declare const getMapping: (value: string) => (target: any, propertyKey: string) => void;
10
+ declare const postMapping: (value: string) => (target: any, propertyKey: string) => void;
11
+ declare const requestMapping: (value: string) => (target: any, propertyKey: string) => void;
12
+
13
+ declare function insert(sql: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
14
+ declare function update(sql: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
15
+ declare function remove(sql: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
16
+ declare function select(sql: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
17
+ declare function resultType(dataClass: any): (target: any, propertyKey: string) => void;
18
+ declare function param(name: string): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
19
+ declare function cache(ttl: number): (target: any, propertyKey: string) => void;
20
+ declare class Model {
21
+ page: any;
22
+ private table;
23
+ constructor(table?: string);
24
+ findAll<T>(conditions: object | string, sort?: string | object, fields?: string | [string], limit?: number | object): Promise<T[]>;
25
+ create(rows: any): Promise<number>;
26
+ find<T>(conditions: any, sort: any, fields?: string): Promise<T>;
27
+ update(conditions: any, fieldToValues: any): Promise<number>;
28
+ delete(conditions: any): Promise<number>;
29
+ findCount(conditions: any): Promise<number>;
30
+ incr(conditions: any, field: any, optval?: number): Promise<number>;
31
+ decr(conditions: any, field: any, optval?: number): Promise<number>;
32
+ pager(page: any, total: any, pageSize?: number, scope?: number): any;
33
+ private where;
34
+ private range;
35
+ }
36
+
37
+ declare function app<T extends {
38
+ new (...args: any[]): {};
39
+ }>(constructor: T): void;
40
+ declare function config(node: string): any;
41
+ declare function component(constructorFunction: any): void;
42
+ declare function getComponent(constructorFunction: any): any;
43
+ declare function bean(target: any, propertyKey: string): void;
44
+ declare function getBean(mappingClass: Function): any;
45
+ declare function value(configPath: string): any;
46
+ declare function autoware(target: any, propertyKey: string): void;
47
+ declare function resource(...args: any[]): any;
48
+ declare function log(message?: any, ...optionalParams: any[]): void;
49
+ declare function error(message?: any, ...optionalParams: any[]): void;
50
+ declare function before(constructorFunction: any, methodName: string): (target: any, propertyKey: string) => void;
51
+ declare function after(constructorFunction: any, methodName: string): (target: any, propertyKey: string) => void;
52
+ declare function schedule(cronTime: string | Date): (target: any, propertyKey: string) => void;
53
+ declare abstract class ServerFactory {
54
+ app: any;
55
+ protected middlewareList: Array<any>;
56
+ abstract setMiddleware(middleware: any): any;
57
+ abstract start(port: number): any;
58
+ }
59
+ declare abstract class LogFactory {
60
+ abstract log(message?: any, ...optionalParams: any[]): void;
61
+ abstract error(message?: any, ...optionalParams: any[]): void;
62
+ }
63
+ declare abstract class DataSourceFactory {
64
+ abstract readConnection(): any;
65
+ abstract writeConnection(): any;
66
+ }
67
+ declare abstract class CacheFactory {
68
+ abstract get(key: string): any;
69
+ abstract set(key: string, value: any, expire?: number): void;
70
+ abstract del(key: string): void;
71
+ abstract has(key: string): boolean;
72
+ abstract flush(): void;
73
+ }
74
+
75
+
76
+ declare class Redis extends IoRedis {
77
+ getRedis(): Redis;
78
+ constructor(config: any);
79
+ }
80
+ declare class ReadWriteDb extends DataSourceFactory {
81
+ private readonly readSession;
82
+ private readonly writeSession;
83
+ getDataSource(): DataSourceFactory;
84
+ constructor();
85
+ private getConnectionByConfig;
86
+ readConnection(): any;
87
+ writeConnection(): any;
88
+ }
89
+
90
+ declare class RabbitMQ {
91
+ getRabbitMQ(): RabbitMQ;
92
+ publishMessageToExchange(exchange: string, routingKey: string, message: string): Promise<void>;
93
+ sendMessageToQueue(queue: string, message: string): Promise<void>;
94
+ publish(exchange: string, routingKey: string, message: string): Promise<void>;
95
+ send(queue: string, message: string): Promise<void>;
96
+ }
97
+ declare function rabbitListener(queue: string): (target: any, propertyKey: string) => void;
98
+
99
+ declare class NodeCache extends CacheFactory {
100
+ private NodeCache;
101
+ private nodeCacheOptions;
102
+ private config;
103
+ constructor();
104
+ getNodeCache(): CacheFactory;
105
+ get(key: string): any;
106
+ set(key: string, value: any, expire?: number): void;
107
+ del(key: string): void;
108
+ has(key: string): boolean;
109
+ flush(): void;
110
+ }
111
+
112
+ declare class LogDefault extends LogFactory {
113
+ createLog(): LogFactory;
114
+ log(message?: any, ...optionalParams: any[]): void;
115
+ error(message?: any, ...optionalParams: any[]): void;
116
+ }
117
+
118
+ declare class ExpressServer extends ServerFactory {
119
+ view: string;
120
+ private static;
121
+ private favicon;
122
+ private compression;
123
+ private cookieConfig;
124
+ private session;
125
+ private redisConfig;
126
+ private redisClient;
127
+ getSever(): ServerFactory;
128
+ setMiddleware(middleware: any): void;
129
+ start(port: number): void;
130
+ private setDefaultMiddleware;
131
+ }
132
+
133
+ export { ExpressServer, LogDefault, NodeCache, RabbitMQ, rabbitListener, ReadWriteDb, Redis, CacheFactory, DataSourceFactory, LogFactory, ServerFactory, component, bean, resource, log, app, before, after, value, error, config, autoware, getBean, getComponent, schedule, getMapping, postMapping, requestMapping, setRouter, upload, jwt, insert, update, remove, select, param, resultType, cache, Model };
package/src/typespeed.ts CHANGED
@@ -12,4 +12,5 @@ export { default as ExpressServer} from "./default/express-server.class";
12
12
  export { default as LogDefault} from "./default/log-default.class";
13
13
  export { default as NodeCache} from "./default/node-cache.class";
14
14
  export { default as Redis} from "./default/redis.class";
15
- export { default as ReadWriteDb} from "./default/read-write-db.class";
15
+ export { default as ReadWriteDb} from "./default/read-write-db.class";
16
+ export * from "./default/rabbitmq.class";
@@ -1,13 +1,45 @@
1
1
  {
2
2
  "name": "test-typespeed",
3
3
  "version": "1.0.0",
4
- "lockfileVersion": 2,
4
+ "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
+ "node_modules/@acuminous/bitsyntax": {
8
+ "version": "0.1.2",
9
+ "resolved": "https://registry.npmjs.org/@acuminous/bitsyntax/-/bitsyntax-0.1.2.tgz",
10
+ "integrity": "sha512-29lUK80d1muEQqiUsSo+3A0yP6CdspgC95EnKBMi22Xlwt79i/En4Vr67+cXhU+cZjbti3TgGGC5wy1stIywVQ==",
11
+ "dependencies": {
12
+ "buffer-more-ints": "~1.0.0",
13
+ "debug": "^4.3.4",
14
+ "safe-buffer": "~5.1.2"
15
+ },
16
+ "engines": {
17
+ "node": ">=0.8"
18
+ }
19
+ },
7
20
  "node_modules/@types/node": {
8
- "version": "18.16.8",
9
- "resolved": "https://registry.npmjs.org/@types/node/-/node-18.16.8.tgz",
10
- "integrity": "sha512-p0iAXcfWCOTCBbsExHIDFCfwsqFwBTgETJveKMT+Ci3LY9YqQCI91F5S+TB20+aRCXpcWfvx5Qr5EccnwCm2NA=="
21
+ "version": "18.16.14",
22
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.16.14.tgz",
23
+ "integrity": "sha512-+ImzUB3mw2c5ISJUq0punjDilUQ5GnUim0ZRvchHIWJmOC0G+p0kzhXBqj6cDjK0QdPFwzrHWgrJp3RPvCG5qg=="
24
+ },
25
+ "node_modules/amqplib": {
26
+ "version": "0.10.3",
27
+ "resolved": "https://registry.npmjs.org/amqplib/-/amqplib-0.10.3.tgz",
28
+ "integrity": "sha512-UHmuSa7n8vVW/a5HGh2nFPqAEr8+cD4dEZ6u9GjP91nHfr1a54RyAKyra7Sb5NH7NBKOUlyQSMXIp0qAixKexw==",
29
+ "dependencies": {
30
+ "@acuminous/bitsyntax": "^0.1.2",
31
+ "buffer-more-ints": "~1.0.0",
32
+ "readable-stream": "1.x >=1.1.9",
33
+ "url-parse": "~1.5.10"
34
+ },
35
+ "engines": {
36
+ "node": ">=10"
37
+ }
38
+ },
39
+ "node_modules/buffer-more-ints": {
40
+ "version": "1.0.0",
41
+ "resolved": "https://registry.npmjs.org/buffer-more-ints/-/buffer-more-ints-1.0.0.tgz",
42
+ "integrity": "sha512-EMetuGFz5SLsT0QTnXzINh4Ksr+oo4i+UGTXEshiGCQWnsgSs7ZhJ8fzlwQ+OzEMs0MpDAMr1hxnblp5a4vcHg=="
11
43
  },
12
44
  "node_modules/colors": {
13
45
  "version": "1.4.0",
@@ -17,6 +49,11 @@
17
49
  "node": ">=0.1.90"
18
50
  }
19
51
  },
52
+ "node_modules/core-util-is": {
53
+ "version": "1.0.3",
54
+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
55
+ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
56
+ },
20
57
  "node_modules/dateformat": {
21
58
  "version": "4.5.1",
22
59
  "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.5.1.tgz",
@@ -25,6 +62,32 @@
25
62
  "node": "*"
26
63
  }
27
64
  },
65
+ "node_modules/debug": {
66
+ "version": "4.3.4",
67
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
68
+ "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
69
+ "dependencies": {
70
+ "ms": "2.1.2"
71
+ },
72
+ "engines": {
73
+ "node": ">=6.0"
74
+ },
75
+ "peerDependenciesMeta": {
76
+ "supports-color": {
77
+ "optional": true
78
+ }
79
+ }
80
+ },
81
+ "node_modules/inherits": {
82
+ "version": "2.0.4",
83
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
84
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
85
+ },
86
+ "node_modules/isarray": {
87
+ "version": "0.0.1",
88
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
89
+ "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="
90
+ },
28
91
  "node_modules/mkdirp": {
29
92
  "version": "1.0.4",
30
93
  "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
@@ -36,6 +99,42 @@
36
99
  "node": ">=10"
37
100
  }
38
101
  },
102
+ "node_modules/ms": {
103
+ "version": "2.1.2",
104
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
105
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
106
+ },
107
+ "node_modules/querystringify": {
108
+ "version": "2.2.0",
109
+ "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
110
+ "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ=="
111
+ },
112
+ "node_modules/readable-stream": {
113
+ "version": "1.1.14",
114
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
115
+ "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==",
116
+ "dependencies": {
117
+ "core-util-is": "~1.0.0",
118
+ "inherits": "~2.0.1",
119
+ "isarray": "0.0.1",
120
+ "string_decoder": "~0.10.x"
121
+ }
122
+ },
123
+ "node_modules/requires-port": {
124
+ "version": "1.0.0",
125
+ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
126
+ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ=="
127
+ },
128
+ "node_modules/safe-buffer": {
129
+ "version": "5.1.2",
130
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
131
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
132
+ },
133
+ "node_modules/string_decoder": {
134
+ "version": "0.10.31",
135
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
136
+ "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ=="
137
+ },
39
138
  "node_modules/tinytim": {
40
139
  "version": "0.1.1",
41
140
  "resolved": "https://registry.npmjs.org/tinytim/-/tinytim-0.1.1.tgz",
@@ -57,6 +156,15 @@
57
156
  "engines": {
58
157
  "node": ">= 0.10.0"
59
158
  }
159
+ },
160
+ "node_modules/url-parse": {
161
+ "version": "1.5.10",
162
+ "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",
163
+ "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==",
164
+ "dependencies": {
165
+ "querystringify": "^2.1.1",
166
+ "requires-port": "^1.0.0"
167
+ }
60
168
  }
61
169
  }
62
170
  }
@@ -0,0 +1,17 @@
1
+ name: Node.js CI
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ node-version: [12.x, 14.x, 16.x, 18.x]
11
+ steps:
12
+ - uses: actions/checkout@v2
13
+ - uses: actions/setup-node@v2
14
+ with:
15
+ node-version: ${{ matrix.node-version }}
16
+ - run: npm ci
17
+ - run: npm test
@@ -0,0 +1,30 @@
1
+ name: Node.js Publish
2
+
3
+ on:
4
+ release:
5
+ types: [created]
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v2
12
+ - uses: actions/setup-node@v2
13
+ with:
14
+ node-version: "16.x"
15
+ - run: npm ci
16
+ - run: npm test
17
+
18
+ publish-npm:
19
+ needs: build
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v2
23
+ - uses: actions/setup-node@v2
24
+ with:
25
+ node-version: "16.x"
26
+ registry-url: https://registry.npmjs.org/
27
+ - run: npm ci
28
+ - run: npm publish --access public
29
+ env:
30
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
@@ -0,0 +1,6 @@
1
+ bitsyntax-js copyright (c) 2012-2014
2
+ Michael Bridgen <mikeb@squaremobius.net>
3
+
4
+ This package, "bitsyntax-js", is licensed under the MIT License. A
5
+ copy may be found in the file LICENSE-MIT in this directory, or
6
+ downloaded from http://opensource.org/licenses/MIT.
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2012-2014 Michael Bridgen <mikeb@squaremobius.net>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,15 @@
1
+ .PHONY: test all
2
+
3
+ GRAMMAR=lib/grammar.pegjs
4
+ PEGJS=./node_modules/.bin/pegjs
5
+
6
+ all: lib/parser.js
7
+
8
+ lib/parser.js: $(PEGJS)
9
+ $(PEGJS) $(GRAMMAR) $@
10
+
11
+ $(PEGJS):
12
+ npm install
13
+
14
+ test: lib/parser.js
15
+ ./node_modules/.bin/zUnit