@domain.js/main 0.1.1 → 0.1.6

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.
@@ -1,11 +1,11 @@
1
1
  import * as restify from "restify";
2
2
  import { Router } from "./router";
3
- import { Cnf, Domain, Profile, HttpCodes } from "./defines";
3
+ import { Cnf, Domain, Profile, HttpCodes, GetSchemaByPath } from "./defines";
4
4
  interface Deps {
5
5
  routers(r: ReturnType<typeof Router>): void;
6
6
  domain: Domain;
7
7
  httpCodes: HttpCodes;
8
- swaggerDocJson?: any;
8
+ getSchemaByPath: GetSchemaByPath;
9
9
  makeProfileHook?: (obj: Profile, req: restify.Request) => any;
10
10
  }
11
11
  export declare function Main(cnf: Cnf, deps: Deps): () => restify.Server;
@@ -6,7 +6,7 @@ const router_1 = require("./router");
6
6
  const utils_1 = require("./utils");
7
7
  function Main(cnf, deps) {
8
8
  const utils = (0, utils_1.Utils)(cnf);
9
- const { routers, domain, httpCodes, swaggerDocJson, makeProfileHook } = deps;
9
+ const { routers, getSchemaByPath, domain, httpCodes, makeProfileHook } = deps;
10
10
  const server = restify.createServer();
11
11
  server.use(restify.plugins.queryParser());
12
12
  server.use(restify.plugins.bodyParser({
@@ -18,9 +18,9 @@ function Main(cnf, deps) {
18
18
  server,
19
19
  httpCodes,
20
20
  makeProfileHook,
21
+ getSchemaByPath,
21
22
  domain,
22
23
  apisRoute: cnf.apisRoute,
23
- swagger: [cnf.swaggerApiPath, swaggerDocJson],
24
24
  });
25
25
  routers(router);
26
26
  // Http server start
@@ -1,8 +1,9 @@
1
1
  import * as restify from "restify";
2
2
  import { Utils } from "./utils";
3
- import { HttpCodes, Domain, Profile } from "./defines";
3
+ import { HttpCodes, Domain, Profile, GetSchemaByPath } from "./defines";
4
4
  interface Deps {
5
5
  domain: Domain;
6
+ getSchemaByPath: GetSchemaByPath;
6
7
  utils: ReturnType<typeof Utils>;
7
8
  server: restify.Server;
8
9
  httpCodes: HttpCodes;
@@ -3,10 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Router = void 0;
4
4
  const _ = require("lodash");
5
5
  const errors = require("restify-errors");
6
- const swaggerUi = require("swagger-ui-restify");
7
6
  function Router(deps) {
8
- const { domain, apisRoute, utils, server, httpCodes = {}, makeProfileHook, swagger = ["", {}], } = deps;
9
- const { ucwords, makeParams, makeProfile, outputCSV, jsonSchema2Swagger } = utils;
7
+ const { domain, apisRoute, getSchemaByPath, utils, server, httpCodes = {}, makeProfileHook, } = deps;
8
+ const { ucwords, makeParams, makeProfile, outputCSV } = utils;
10
9
  // 改写 HttpErrorToJSON 处理 data
11
10
  const HttpErrorToJSON = errors.HttpError.prototype.toJSON;
12
11
  errors.HttpError.prototype.toJSON = function toJSON() {
@@ -24,21 +23,8 @@ function Router(deps) {
24
23
  e.body.data = data;
25
24
  return e;
26
25
  };
27
- const [apiSwagger, swaggerDocJson] = swagger;
28
26
  const apis = [];
29
27
  let apisHTML = "<h3>API 目录,点击可以查看参数格式定义</h3>";
30
- let swaggerHtml = "";
31
- if (apiSwagger) {
32
- server.get(`/${apiSwagger}/*.*`, ...swaggerUi.serve);
33
- server.get(`/${apiSwagger}`, (req, res) => {
34
- res.writeHead(200, {
35
- "Content-Length": Buffer.byteLength(swaggerHtml),
36
- "Content-Type": "text/html",
37
- });
38
- res.write(swaggerHtml);
39
- res.end();
40
- });
41
- }
42
28
  /** 判断是否需要提供apis的查询接口 */
43
29
  if (apisRoute) {
44
30
  server.get(`/${apisRoute}`, (req, res, next) => {
@@ -56,7 +42,7 @@ function Router(deps) {
56
42
  const { path } = req.query;
57
43
  try {
58
44
  const { all } = req.query;
59
- const schema = domain._getSchemaByPath(path);
45
+ const schema = getSchemaByPath(path);
60
46
  res.send(all === undefined ? schema[1] : schema);
61
47
  }
62
48
  catch (e) {
@@ -66,39 +52,6 @@ function Router(deps) {
66
52
  next();
67
53
  });
68
54
  }
69
- const getAPISchemaDoc = (verb, route, methodPath) => {
70
- if (!apiSwagger)
71
- return;
72
- let apiSchema = [];
73
- let desc = "";
74
- try {
75
- apiSchema = domain._getSchemaByPath(methodPath);
76
- desc = apiSchema[1] ? apiSchema[1].description : "unknow";
77
- apiSchema = jsonSchema2Swagger(apiSchema[1] ? apiSchema[1] : {}, verb, methodPath, swaggerDocJson);
78
- }
79
- catch (e) {
80
- console.log(methodPath, "schema to swagger error.");
81
- }
82
- swaggerHtml = swaggerUi.generateHTML(swaggerDocJson, {
83
- baseURL: `${swaggerDocJson.basePath}${apiSwagger}`,
84
- explorer: true,
85
- });
86
- const apiTag = methodPath.split(".")[0];
87
- swaggerDocJson.paths[route] = {
88
- [verb]: {
89
- "x-swagger-router-controller": methodPath,
90
- operationId: methodPath,
91
- tags: [apiTag],
92
- externalDocs: {
93
- description: "查看接口参数 json schema 定义",
94
- url: `./${apisRoute}/_schema?path=${methodPath}`,
95
- },
96
- description: desc,
97
- parameters: apiSchema || [],
98
- responses: {},
99
- },
100
- };
101
- };
102
55
  function register(verb, route, methodPath, code = 200, isList = false, handler, resHandler) {
103
56
  /**
104
57
  * 暂存起来,提供给apis接口来用
@@ -111,7 +64,6 @@ function Router(deps) {
111
64
  if (!method || !_.isFunction(method)) {
112
65
  throw Error(`Missing domain method: ${methodPath}`);
113
66
  }
114
- getAPISchemaDoc(verb, route, methodPath);
115
67
  server[verb](route, async (req, res, next) => {
116
68
  const profile = makeProfile(req, methodPath, makeProfileHook);
117
69
  const params = makeParams(req);
@@ -25,5 +25,4 @@ export declare function Utils(cnf: Cnf): {
25
25
  * 输出csv相关
26
26
  */
27
27
  outputCSV(rows: any[], params: any, res: restify.Response, isXLSX?: boolean): Promise<boolean>;
28
- jsonSchema2Swagger(schema: any, verb: string, methodPath: string, swaggerDocJson: any): any[];
29
28
  };
@@ -144,41 +144,6 @@ function Utils(cnf) {
144
144
  }
145
145
  return true;
146
146
  },
147
- jsonSchema2Swagger(schema, verb, methodPath, swaggerDocJson) {
148
- if (verb === "post" || verb === "put" || verb === "patch") {
149
- swaggerDocJson.definitions[methodPath] = schema;
150
- return [
151
- {
152
- name: "body",
153
- in: "body",
154
- require: true,
155
- description: schema.description,
156
- operationId: methodPath,
157
- schema: {
158
- $ref: `#/definitions/${methodPath}`,
159
- },
160
- },
161
- ];
162
- }
163
- const parameters = [];
164
- if (!_.has(schema, "properties")) {
165
- return parameters;
166
- }
167
- const requireds = schema.required ? schema.required : [];
168
- for (const prop of Object.keys(schema.properties)) {
169
- const val = schema.properties[prop];
170
- const param = {
171
- name: prop,
172
- in: "query",
173
- ...val,
174
- };
175
- if (requireds.includes("prop")) {
176
- param.required = true;
177
- }
178
- parameters.push(param);
179
- }
180
- return parameters;
181
- },
182
147
  };
183
148
  return utils;
184
149
  }
package/dist/index.d.ts CHANGED
@@ -19,31 +19,31 @@ export declare function Main<T extends Readonly<Array<keyof TDeps>>>(features: T
19
19
  aes: typeof import("./deps/aes");
20
20
  cache: typeof import("./deps/cache");
21
21
  checker: typeof import("./deps/checker");
22
- cia: typeof import("./deps/cia");
23
22
  counter: typeof import("./deps/counter");
24
23
  cron: typeof import("./deps/cron");
25
24
  graceful: typeof import("./deps/graceful");
26
25
  hash: typeof import("./deps/hash");
27
26
  logger: typeof import("./deps/logger");
27
+ myCia: typeof import("./deps/myCia");
28
28
  parallel: typeof import("./deps/parallel");
29
- redis: typeof import("./deps/redis"); /** 模块名称联合类型 */
29
+ redis: typeof import("./deps/redis");
30
30
  request: typeof import("./deps/request");
31
31
  rest: typeof import("./deps/rest");
32
32
  schema: typeof import("./deps/schema");
33
33
  sequelize: typeof import("./deps/sequelize");
34
34
  signer: typeof import("./deps/signer");
35
- }[Include<"schema", RemoveReadonlyArray<T>> | Include<"logger", RemoveReadonlyArray<T>> | Include<"aes", RemoveReadonlyArray<T>> | Include<"request", RemoveReadonlyArray<T>> | Include<"sequelize", RemoveReadonlyArray<T>> | Include<"cache", RemoveReadonlyArray<T>> | Include<"redis", RemoveReadonlyArray<T>> | Include<"rest", RemoveReadonlyArray<T>> | Include<"parallel", RemoveReadonlyArray<T>> | Include<"graceful", RemoveReadonlyArray<T>> | Include<"cia", RemoveReadonlyArray<T>> | Include<"counter", RemoveReadonlyArray<T>> | Include<"cron", RemoveReadonlyArray<T>> | Include<"hash", RemoveReadonlyArray<T>> | Include<"checker", RemoveReadonlyArray<T>> | Include<"signer", RemoveReadonlyArray<T>>]["Main"] extends (arg: infer R, ...args: any[]) => any ? R : {}>) => { [k in keyof Pick<{
35
+ }[Include<"schema", RemoveReadonlyArray<T>> | Include<"logger", RemoveReadonlyArray<T>> | Include<"aes", RemoveReadonlyArray<T>> | Include<"request", RemoveReadonlyArray<T>> | Include<"sequelize", RemoveReadonlyArray<T>> | Include<"cache", RemoveReadonlyArray<T>> | Include<"redis", RemoveReadonlyArray<T>> | Include<"counter", RemoveReadonlyArray<T>> | Include<"cron", RemoveReadonlyArray<T>> | Include<"myCia", RemoveReadonlyArray<T>> | Include<"hash", RemoveReadonlyArray<T>> | Include<"rest", RemoveReadonlyArray<T>> | Include<"parallel", RemoveReadonlyArray<T>> | Include<"graceful", RemoveReadonlyArray<T>> | Include<"checker", RemoveReadonlyArray<T>> | Include<"signer", RemoveReadonlyArray<T>>]["Main"] extends (arg: infer R, ...args: any[]) => any ? R : {}>) => { [k in keyof Pick<{
36
36
  aes: typeof import("./deps/aes");
37
37
  cache: typeof import("./deps/cache");
38
38
  checker: typeof import("./deps/checker");
39
- cia: typeof import("./deps/cia");
40
39
  counter: typeof import("./deps/counter");
41
40
  cron: typeof import("./deps/cron");
42
41
  graceful: typeof import("./deps/graceful");
43
42
  hash: typeof import("./deps/hash");
44
43
  logger: typeof import("./deps/logger");
44
+ myCia: typeof import("./deps/myCia");
45
45
  parallel: typeof import("./deps/parallel");
46
- redis: typeof import("./deps/redis"); /** 模块名称联合类型 */
46
+ redis: typeof import("./deps/redis");
47
47
  request: typeof import("./deps/request");
48
48
  rest: typeof import("./deps/rest");
49
49
  schema: typeof import("./deps/schema");
@@ -53,14 +53,14 @@ export declare function Main<T extends Readonly<Array<keyof TDeps>>>(features: T
53
53
  aes: typeof import("./deps/aes");
54
54
  cache: typeof import("./deps/cache");
55
55
  checker: typeof import("./deps/checker");
56
- cia: typeof import("./deps/cia");
57
56
  counter: typeof import("./deps/counter");
58
57
  cron: typeof import("./deps/cron");
59
58
  graceful: typeof import("./deps/graceful");
60
59
  hash: typeof import("./deps/hash");
61
60
  logger: typeof import("./deps/logger");
61
+ myCia: typeof import("./deps/myCia");
62
62
  parallel: typeof import("./deps/parallel");
63
- redis: typeof import("./deps/redis"); /** 模块名称联合类型 */
63
+ redis: typeof import("./deps/redis");
64
64
  request: typeof import("./deps/request");
65
65
  rest: typeof import("./deps/rest");
66
66
  schema: typeof import("./deps/schema");
@@ -0,0 +1 @@
1
+ export declare type ReadonlyArray2union<T extends ReadonlyArray<any>> = T extends ReadonlyArray<infer A> ? A : never;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@domain.js/main",
3
- "version": "0.1.1",
3
+ "version": "0.1.6",
4
4
  "description": "DDD framework",
5
5
  "main": "dist/index.js",
6
+ "bin": {
7
+ "domain-cli": "dist/cli/index.js"
8
+ },
6
9
  "scripts": {
7
10
  "build": "tsc",
8
11
  "test": "export NODE_ENV=test && jest ./src --coverage",
@@ -71,8 +74,7 @@
71
74
  "mysql2": "^2.3.3",
72
75
  "restify": "^8.6.0",
73
76
  "restify-errors": "^8.0.2",
74
- "sequelize": "^6.9.0",
75
- "swagger-ui-restify": "^3.0.8",
77
+ "sequelize": "6.12.1",
76
78
  "type-fest": "^2.8.0",
77
79
  "uuid": "^8.3.2",
78
80
  "xlsx": "^0.17.4"
@@ -1,22 +0,0 @@
1
- import { AxiosInstance } from "axios";
2
- import { Main as Logger } from "../logger";
3
- import * as utils from "../../utils";
4
- declare type VERBS = "post" | "get" | "put" | "delete";
5
- interface Cnf {
6
- axios: {
7
- loggers?: VERBS[];
8
- retrys?: VERBS[];
9
- retryTimes?: number;
10
- retryIntervalMS?: number;
11
- conf?: {};
12
- };
13
- }
14
- interface Deps {
15
- logger: ReturnType<typeof Logger>;
16
- utils: typeof utils;
17
- }
18
- export declare function Main(cnf: Cnf, deps: Deps): AxiosInstance & {
19
- origin?: import("axios").AxiosStatic | undefined;
20
- };
21
- export declare const Deps: string[];
22
- export {};
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Deps = exports.Main = void 0;
4
- const axios_1 = require("axios");
5
- function Main(cnf, deps) {
6
- const axiosError = (e) => (() => {
7
- if (!e.response)
8
- return ["no-response", e.message];
9
- const r = e.response;
10
- if (!r.data)
11
- return [r.status, r.statusText];
12
- const d = r.data;
13
- if (typeof d === "string")
14
- return [r.status, d];
15
- return [d.code || r.status, d.message || d];
16
- })().join("\t");
17
- if (!cnf.axios)
18
- cnf.axios = {};
19
- const { loggers, retrys, retryTimes = 3, retryIntervalMS = 3000, conf } = cnf.axios;
20
- const { utils: { sleep }, logger, } = deps;
21
- const retryAble = (fn, times, interval) => {
22
- const exec = async (args, no) => {
23
- try {
24
- const res = await fn(...args);
25
- return res;
26
- }
27
- catch (e) {
28
- if (e.code === "ETIMEDOUT") {
29
- if (interval)
30
- await sleep(interval);
31
- if (times <= no)
32
- throw e;
33
- return exec(args, no + 1);
34
- }
35
- throw e;
36
- }
37
- };
38
- return ((...args) => exec(args, 1));
39
- };
40
- const instance = axios_1.default.create(conf);
41
- instance.origin = axios_1.default;
42
- if (loggers) {
43
- for (const x of loggers) {
44
- const method = logger.logger(instance[x], `axios.${x}`, true, (res) => res.data, axiosError);
45
- instance[x] = method;
46
- }
47
- }
48
- if (retrys) {
49
- for (const x of retrys) {
50
- instance[x] = retryAble(instance[x], retryTimes, retryIntervalMS);
51
- }
52
- }
53
- return instance;
54
- }
55
- exports.Main = Main;
56
- exports.Deps = ["logger", "utils"];
@@ -1 +0,0 @@
1
- export declare const errors: Readonly<Record<"notFound" | "notAllowed" | "noAuth", import("../../errors").ErrorFn>>;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.errors = void 0;
4
- const errors_1 = require("../../errors");
5
- const defines = [
6
- ["notFound", "Resource not found"],
7
- ["notAllowed", "No access"],
8
- ["noAuth", "Not authentication"],
9
- ];
10
- exports.errors = Object.freeze((0, errors_1.Errors)(defines));
package/dist/dm/dm.d.ts DELETED
@@ -1,21 +0,0 @@
1
- import * as lodash from "lodash";
2
- interface ModuleInterface {
3
- Main?: (...args: any[]) => any;
4
- main?: (...args: any[]) => any;
5
- Deps?: string[];
6
- Before?: (...args: any[]) => any;
7
- After?: (...args: any[]) => void;
8
- }
9
- declare type ModuleFn = (((...args: any[]) => any) | {}) & ModuleInterface;
10
- export declare type Merge<T extends {}, D extends {
11
- [k in string]: ModuleFn;
12
- }> = T & {
13
- [K in keyof D]: ReturnType<D[K]["Main"] extends (...args: any) => any ? D[K]["Main"] : D[K]["main"] extends (...args: any) => any ? D[K]["main"] : D[K] extends (...args: any) => any ? D[K] : (...args: any) => any>;
14
- };
15
- export declare function DM(_: typeof lodash): {
16
- exec: <Args extends any[], BeforeFn extends (...args: Args) => any[], MainFn extends (...args: ReturnType<BeforeFn>) => any, AfterFn extends (main: ReturnType<MainFn>, ...args: ReturnType<BeforeFn>) => void>(Main: MainFn, Before: BeforeFn | undefined, After: AfterFn | undefined, _args?: Args) => ReturnType<MainFn>;
17
- auto: <Modules extends {
18
- [x: string]: ModuleFn;
19
- }, Deps extends object, Args_1 extends any[]>(modules: Modules, deps: Deps, args: Args_1) => Merge<Deps, Modules>;
20
- };
21
- export {};
package/dist/dm/dm.js DELETED
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DM = void 0;
4
- function DM(_) {
5
- function exec(Main, Before = ((...args) => args), After, _args = []) {
6
- const args = Before(..._args);
7
- const main = Main(...args);
8
- if (typeof After === "function")
9
- After(main, ...args);
10
- return main;
11
- }
12
- function auto(modules, deps, args) {
13
- // 获取全部即将初始化的模块名称,此时的 modules 是扁平的一级结构
14
- const names = new Set(Object.keys(modules));
15
- while (names.size) {
16
- // 记录此次迭代有多少个模块被排序了,如果某次迭代被排序的模块数量为0,
17
- // 那就要抛出异常了,说明依赖指定有问题,永远都不可能排序完毕
18
- let count = 0;
19
- /** 默认挂载函数 */
20
- const plugin = (name) => {
21
- const Module = modules[name];
22
- const Main = Module.Main || Module.main || Module;
23
- if (typeof Main !== "function")
24
- throw Error("Main is not a function");
25
- const Before = Module.Before || ((...args) => args);
26
- const After = Module.After;
27
- if (After && typeof After !== "function")
28
- throw Error("After is not a function");
29
- const main = exec(Main, Before, After, args);
30
- if (_.has(deps, name))
31
- throw Error(`Name ${name} duplicate`);
32
- _.set(deps, name, main);
33
- names.delete(name);
34
- count += 1;
35
- };
36
- for (const x of names) {
37
- const { Deps } = modules[x];
38
- if (!Array.isArray(Deps) || !Deps.length) {
39
- plugin(x);
40
- continue;
41
- }
42
- if (Deps.every((d) => _.has(deps, d)))
43
- plugin(x);
44
- }
45
- if (count === 0) {
46
- const lacks = [];
47
- for (const x of names) {
48
- lacks.push(`${x}: ${_.filter(modules[x].Deps, (d) => !_.has(deps, d)).join(",")}`);
49
- }
50
- throw Error(`Deps defined conflict, ${lacks.join(";")}`);
51
- }
52
- }
53
- return deps;
54
- }
55
- return { exec, auto };
56
- }
57
- exports.DM = DM;
@@ -1,16 +0,0 @@
1
- export interface MyError {
2
- message: string;
3
- code?: string | number;
4
- data?: any;
5
- }
6
- export interface ErrorFn {
7
- (...args: any): MyError;
8
- }
9
- declare type RemoveReadonlyArray<T extends readonly any[]> = T extends readonly (infer A)[] ? A extends readonly [infer key, any] ? key : never : never;
10
- /**
11
- * Convert error configuration to errors function
12
- * @param defines error configuration
13
- * @returns errors function
14
- */
15
- export declare function Errors<T extends ReadonlyArray<readonly [string, string]>>(defines: T): Record<RemoveReadonlyArray<T>, ErrorFn>;
16
- export {};
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Errors = void 0;
4
- /**
5
- * Convert error configuration to errors function
6
- * @param defines error configuration
7
- * @returns errors function
8
- */
9
- function Errors(defines) {
10
- const errors = {};
11
- for (const [code, msg] of defines) {
12
- errors[code] = (...args) => {
13
- if (Array.isArray(args) && args.length === 1) {
14
- const [first] = args;
15
- // 只有一个参数且,参数已经是一个封装后的
16
- if (first && first.code)
17
- return first;
18
- }
19
- return Object.assign(new Error(msg), {
20
- code,
21
- data: args,
22
- });
23
- };
24
- }
25
- return errors;
26
- }
27
- exports.Errors = Errors;
package/dist/errors.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare const errors: Readonly<Record<"notFound" | "notAllowed" | "noAuth", import("./Errors/index").ErrorFn>>;
package/dist/errors.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.errors = void 0;
4
- const index_1 = require("./Errors/index");
5
- const defines = [
6
- ["notFound", "Resource not found"],
7
- ["notAllowed", "No access"],
8
- ["noAuth", "Not authentication"],
9
- ];
10
- exports.errors = Object.freeze((0, index_1.Errors)(defines));
package/dist/npms.d.ts DELETED
@@ -1,88 +0,0 @@
1
- import * as _ from "lodash";
2
- import * as uuid from "uuid";
3
- import * as ajv from "ajv";
4
- import * as ajvFormats from "ajv-formats";
5
- import * as async from "async";
6
- import * as axios from "axios";
7
- import * as cronParser from "cron-parser";
8
- import humanInterval = require("human-interval");
9
- import * as IORedis from "ioredis";
10
- import * as LRU from "lru-cache";
11
- import * as mysql from "mysql2";
12
- import * as Sequelize from "sequelize";
13
- import * as moment from "moment";
14
- /** npm packages injection */
15
- export interface MDeps {
16
- /**
17
- * The Lodash library exported as Node.js modules.
18
- * @link https://www.npmjs.com/package/lodash
19
- */
20
- _: typeof _;
21
- /**
22
- * For the creation of RFC4122 UUIDs
23
- * @link https://www.npmjs.com/package/uuid
24
- */
25
- uuid: typeof uuid;
26
- /**
27
- * Ajv JSON schema validator
28
- * @link https://www.npmjs.com/package/ajv
29
- */
30
- ajv: typeof ajv;
31
- /**
32
- * JSON Schema formats for Ajv
33
- * @link https://www.npmjs.com/package/ajv-formats
34
- */
35
- ajvFormats: typeof ajvFormats;
36
- /**
37
- * Async is a utility module which provides straight-forward
38
- * powerful functions for working with asynchronous JavaScript.
39
- * @link https://www.npmjs.com/package/async
40
- */
41
- async: typeof async;
42
- /**
43
- * Promise based HTTP client for the browser and node.js
44
- * @Link https://www.npmjs.com/package/axios
45
- */
46
- axios: typeof axios;
47
- /**
48
- * Node.js library for parsing and manipulating crontab instructions.
49
- * It includes support for timezones and DST transitions.
50
- * @link https://www.npmjs.com/package/cron-parser
51
- */
52
- cronParser: typeof cronParser;
53
- /**
54
- * Human-readable interval parser for Javascript.
55
- * @link https://www.npmjs.com/package/human-interval
56
- */
57
- humanInterval: typeof humanInterval;
58
- /**
59
- * A robust, performance-focused and full-featured Redis client for Node.js.
60
- * @link https://www.npmjs.com/package/ioredis
61
- */
62
- IORedis: typeof IORedis;
63
- /**
64
- * A cache object that deletes the least-recently-used items.
65
- * https://www.npmjs.com/package/lru-cache
66
- */
67
- LRU: typeof LRU;
68
- /**
69
- * MySQL client for Node.js with focus on performance.
70
- * Supports prepared statements, non-utf8 encodings,
71
- * binary log protocol, compression, ssl much more
72
- * @link https://www.npmjs.com/package/mysql2
73
- */
74
- mysql: typeof mysql;
75
- /**
76
- * Sequelize is a promise-based Node.js ORM tool for Postgres, MySQL, MariaDB,
77
- * SQLite and Microsoft SQL Server.
78
- * It features solid transaction support, relations,
79
- * eager and lazy loading, read replication and more.
80
- * @link https://www.npmjs.com/package/sequelize
81
- */
82
- Sequelize: typeof Sequelize;
83
- /**
84
- * A JavaScript date library for parsing, validating, manipulating, and formatting dates.
85
- */
86
- moment: typeof moment;
87
- }
88
- export declare const deps: MDeps;
package/dist/npms.js DELETED
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deps = void 0;
4
- const _ = require("lodash");
5
- const uuid = require("uuid");
6
- const ajv = require("ajv");
7
- const ajvFormats = require("ajv-formats");
8
- const async = require("async");
9
- const axios = require("axios");
10
- const cronParser = require("cron-parser");
11
- const humanInterval = require("human-interval");
12
- const IORedis = require("ioredis");
13
- const LRU = require("lru-cache");
14
- const mysql = require("mysql2");
15
- const Sequelize = require("sequelize");
16
- const moment = require("moment");
17
- exports.deps = {
18
- _,
19
- uuid,
20
- ajv,
21
- ajvFormats,
22
- async,
23
- axios,
24
- cronParser,
25
- humanInterval,
26
- IORedis,
27
- LRU,
28
- mysql,
29
- Sequelize,
30
- moment,
31
- };