chyz 1.2.4-rc.7 → 1.2.5-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/index.js +35 -28
- package/base/index.js.map +1 -1
- package/decorator/index.js +7 -13
- package/decorator/index.js.map +1 -1
- package/filters/auth/index.js +9 -14
- package/filters/auth/index.js.map +1 -1
- package/filters/index.js +5 -12
- package/filters/index.js.map +1 -1
- package/index.js +43 -8
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/requiments/Utils.js +61 -1
- package/requiments/Utils.js.map +1 -1
package/base/index.js
CHANGED
|
@@ -1,31 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
3
|
+
exports.ModelManager = exports.NOW = exports.DataTypes = exports.Model = exports.ValidationHttpException = exports.DataErrorDbException = exports.UnauthorizedHttpException = exports.NotFoundHttpException = exports.InvalidArgumentException = exports.InvalidConfigException = exports.ForbiddenHttpException = exports.DbConnection = exports.CWebController = exports.Component = exports.Behavior = exports.BaseError = exports.BaseObject = exports.ActionFilter = void 0;
|
|
4
|
+
var ActionFilter_1 = require("./ActionFilter");
|
|
5
|
+
Object.defineProperty(exports, "ActionFilter", { enumerable: true, get: function () { return ActionFilter_1.ActionFilter; } });
|
|
6
|
+
var BaseObject_1 = require("./BaseObject");
|
|
7
|
+
Object.defineProperty(exports, "BaseObject", { enumerable: true, get: function () { return BaseObject_1.BaseObject; } });
|
|
8
|
+
var BaseError_1 = require("./BaseError");
|
|
9
|
+
Object.defineProperty(exports, "BaseError", { enumerable: true, get: function () { return BaseError_1.BaseError; } });
|
|
10
|
+
var Behavior_1 = require("./Behavior");
|
|
11
|
+
Object.defineProperty(exports, "Behavior", { enumerable: true, get: function () { return Behavior_1.Behavior; } });
|
|
12
|
+
var Component_1 = require("./Component");
|
|
13
|
+
Object.defineProperty(exports, "Component", { enumerable: true, get: function () { return Component_1.Component; } });
|
|
14
|
+
var CWebController_1 = require("./CWebController");
|
|
15
|
+
Object.defineProperty(exports, "CWebController", { enumerable: true, get: function () { return CWebController_1.CWebController; } });
|
|
16
|
+
var DbConnection_1 = require("./DbConnection");
|
|
17
|
+
Object.defineProperty(exports, "DbConnection", { enumerable: true, get: function () { return DbConnection_1.DbConnection; } });
|
|
18
|
+
var ForbiddenHttpException_1 = require("./ForbiddenHttpException");
|
|
19
|
+
Object.defineProperty(exports, "ForbiddenHttpException", { enumerable: true, get: function () { return ForbiddenHttpException_1.ForbiddenHttpException; } });
|
|
20
|
+
var InvalidConfigException_1 = require("./InvalidConfigException");
|
|
21
|
+
Object.defineProperty(exports, "InvalidConfigException", { enumerable: true, get: function () { return InvalidConfigException_1.InvalidConfigException; } });
|
|
22
|
+
var InvalidArgumentException_1 = require("./InvalidArgumentException");
|
|
23
|
+
Object.defineProperty(exports, "InvalidArgumentException", { enumerable: true, get: function () { return InvalidArgumentException_1.InvalidArgumentException; } });
|
|
24
|
+
var NotFoundHttpException_1 = require("./NotFoundHttpException");
|
|
25
|
+
Object.defineProperty(exports, "NotFoundHttpException", { enumerable: true, get: function () { return NotFoundHttpException_1.NotFoundHttpException; } });
|
|
26
|
+
var UnauthorizedHttpException_1 = require("./UnauthorizedHttpException");
|
|
27
|
+
Object.defineProperty(exports, "UnauthorizedHttpException", { enumerable: true, get: function () { return UnauthorizedHttpException_1.UnauthorizedHttpException; } });
|
|
28
|
+
var DataErrorDbException_1 = require("./DataErrorDbException");
|
|
29
|
+
Object.defineProperty(exports, "DataErrorDbException", { enumerable: true, get: function () { return DataErrorDbException_1.DataErrorDbException; } });
|
|
30
|
+
var ValidationHttpException_1 = require("./ValidationHttpException");
|
|
31
|
+
Object.defineProperty(exports, "ValidationHttpException", { enumerable: true, get: function () { return ValidationHttpException_1.ValidationHttpException; } });
|
|
32
|
+
var Model_1 = require("./Model");
|
|
33
|
+
Object.defineProperty(exports, "Model", { enumerable: true, get: function () { return Model_1.Model; } });
|
|
34
|
+
Object.defineProperty(exports, "DataTypes", { enumerable: true, get: function () { return Model_1.DataTypes; } });
|
|
35
|
+
Object.defineProperty(exports, "NOW", { enumerable: true, get: function () { return Model_1.NOW; } });
|
|
36
|
+
var ModelManager_1 = require("./ModelManager");
|
|
37
|
+
Object.defineProperty(exports, "ModelManager", { enumerable: true, get: function () { return ModelManager_1.ModelManager; } });
|
|
31
38
|
//# sourceMappingURL=index.js.map
|
package/base/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../base/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../base/index.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAAnC,4GAAA,YAAY,OAAA;AACpB,2CAAuC;AAA/B,wGAAA,UAAU,OAAA;AAClB,yCAAqC;AAA7B,sGAAA,SAAS,OAAA;AACjB,uCAAmC;AAA3B,oGAAA,QAAQ,OAAA;AAChB,yCAAqC;AAA7B,sGAAA,SAAS,OAAA;AAEjB,mDAA+C;AAAvC,gHAAA,cAAc,OAAA;AACtB,+CAA2C;AAAnC,4GAAA,YAAY,OAAA;AACpB,mEAA+D;AAAvD,gIAAA,sBAAsB,OAAA;AAC9B,mEAA+D;AAAvD,gIAAA,sBAAsB,OAAA;AAC9B,uEAAmE;AAA3D,oIAAA,wBAAwB,OAAA;AAChC,iEAA6D;AAArD,8HAAA,qBAAqB,OAAA;AAC7B,yEAAqE;AAA7D,sIAAA,yBAAyB,OAAA;AACjC,+DAA2D;AAAnD,4HAAA,oBAAoB,OAAA;AAC5B,qEAAiE;AAAzD,kIAAA,uBAAuB,OAAA;AAC/B,iCAAqD;AAA7C,8FAAA,KAAK,OAAA;AAAU,kGAAA,SAAS,OAAA;AAAE,4FAAA,GAAG,OAAA;AACrC,+CAA2C;AAAnC,4GAAA,YAAY,OAAA"}
|
package/decorator/index.js
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
exports.post = exports.get = exports.controller = void 0;
|
|
4
|
+
var controller_1 = require("./controller");
|
|
5
|
+
Object.defineProperty(exports, "controller", { enumerable: true, get: function () { return controller_1.controller; } });
|
|
6
|
+
var get_1 = require("./get");
|
|
7
|
+
Object.defineProperty(exports, "get", { enumerable: true, get: function () { return get_1.get; } });
|
|
8
|
+
var post_1 = require("./post");
|
|
9
|
+
Object.defineProperty(exports, "post", { enumerable: true, get: function () { return post_1.post; } });
|
|
16
10
|
//# sourceMappingURL=index.js.map
|
package/decorator/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../decorator/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../decorator/index.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AAA/B,wGAAA,UAAU,OAAA;AAClB,6BAAyB;AAAjB,0FAAA,GAAG,OAAA;AACX,+BAA2B;AAAnB,4FAAA,IAAI,OAAA"}
|
package/filters/auth/index.js
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
exports.HttpBasicAuth = exports.HttpHeaderAuth = exports.HttpBearerAuth = exports.JwtHttpBearerAuth = void 0;
|
|
4
|
+
var JwtHttpBearerAuth_1 = require("./JwtHttpBearerAuth");
|
|
5
|
+
Object.defineProperty(exports, "JwtHttpBearerAuth", { enumerable: true, get: function () { return JwtHttpBearerAuth_1.JwtHttpBearerAuth; } });
|
|
6
|
+
var HttpBearerAuth_1 = require("./HttpBearerAuth");
|
|
7
|
+
Object.defineProperty(exports, "HttpBearerAuth", { enumerable: true, get: function () { return HttpBearerAuth_1.HttpBearerAuth; } });
|
|
8
|
+
var HttpHeaderAuth_1 = require("./HttpHeaderAuth");
|
|
9
|
+
Object.defineProperty(exports, "HttpHeaderAuth", { enumerable: true, get: function () { return HttpHeaderAuth_1.HttpHeaderAuth; } });
|
|
10
|
+
var HttpBasicAuth_1 = require("./HttpBasicAuth");
|
|
11
|
+
Object.defineProperty(exports, "HttpBasicAuth", { enumerable: true, get: function () { return HttpBasicAuth_1.HttpBasicAuth; } });
|
|
17
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../filters/auth/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../filters/auth/index.ts"],"names":[],"mappings":";;;AAAA,yDAAqD;AAA7C,sHAAA,iBAAiB,OAAA;AACzB,mDAA+C;AAAvC,gHAAA,cAAc,OAAA;AACtB,mDAA+C;AAAvC,gHAAA,cAAc,OAAA;AACtB,iDAA6C;AAArC,8GAAA,aAAa,OAAA"}
|
package/filters/index.js
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
exports.AccessRule = exports.AccessControl = void 0;
|
|
4
|
+
var AccessControl_1 = require("./AccessControl");
|
|
5
|
+
Object.defineProperty(exports, "AccessControl", { enumerable: true, get: function () { return AccessControl_1.AccessControl; } });
|
|
6
|
+
var AccessRule_1 = require("./AccessRule");
|
|
7
|
+
Object.defineProperty(exports, "AccessRule", { enumerable: true, get: function () { return AccessRule_1.AccessRule; } });
|
|
15
8
|
//# sourceMappingURL=index.js.map
|
package/filters/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../filters/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../filters/index.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAArC,8GAAA,aAAa,OAAA;AACrB,2CAAuC;AAA/B,wGAAA,UAAU,OAAA"}
|
package/index.js
CHANGED
|
@@ -6,26 +6,61 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
6
6
|
if (k2 === undefined) k2 = k;
|
|
7
7
|
o[k2] = m[k];
|
|
8
8
|
}));
|
|
9
|
-
var
|
|
10
|
-
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
11
20
|
};
|
|
12
21
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
23
|
};
|
|
15
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.BaseChyz = exports.WebUser = void 0;
|
|
17
|
-
__exportStar(require("./base"), exports);
|
|
18
|
-
__exportStar(require("./filters"), exports);
|
|
19
|
-
__exportStar(require("./filters/auth"), exports);
|
|
20
|
-
__exportStar(require("./decorator"), exports);
|
|
21
|
-
__exportStar(require("./requiments/Utils"), exports);
|
|
25
|
+
exports.utils = exports.post = exports.get = exports.controller = exports.HttpBasicAuth = exports.HttpHeaderAuth = exports.HttpBearerAuth = exports.JwtHttpBearerAuth = exports.AccessRule = exports.AccessControl = exports.ModelManager = exports.Model = exports.ValidationHttpException = exports.DataErrorDbException = exports.UnauthorizedHttpException = exports.NotFoundHttpException = exports.InvalidArgumentException = exports.InvalidConfigException = exports.ForbiddenHttpException = exports.DbConnection = exports.CWebController = exports.Component = exports.Behavior = exports.BaseError = exports.BaseObject = exports.ActionFilter = exports.BaseChyz = exports.WebUser = void 0;
|
|
22
26
|
var WebUser_1 = require("./web/WebUser");
|
|
23
27
|
Object.defineProperty(exports, "WebUser", { enumerable: true, get: function () { return WebUser_1.WebUser; } });
|
|
24
28
|
const BaseChyz_1 = __importDefault(require("./BaseChyz"));
|
|
25
29
|
exports.BaseChyz = BaseChyz_1.default;
|
|
30
|
+
;
|
|
26
31
|
/**
|
|
27
32
|
*
|
|
28
33
|
*/
|
|
29
34
|
const Chyz = new BaseChyz_1.default();
|
|
30
35
|
exports.default = Chyz;
|
|
36
|
+
var base_1 = require("./base");
|
|
37
|
+
Object.defineProperty(exports, "ActionFilter", { enumerable: true, get: function () { return base_1.ActionFilter; } });
|
|
38
|
+
Object.defineProperty(exports, "BaseObject", { enumerable: true, get: function () { return base_1.BaseObject; } });
|
|
39
|
+
Object.defineProperty(exports, "BaseError", { enumerable: true, get: function () { return base_1.BaseError; } });
|
|
40
|
+
Object.defineProperty(exports, "Behavior", { enumerable: true, get: function () { return base_1.Behavior; } });
|
|
41
|
+
Object.defineProperty(exports, "Component", { enumerable: true, get: function () { return base_1.Component; } });
|
|
42
|
+
Object.defineProperty(exports, "CWebController", { enumerable: true, get: function () { return base_1.CWebController; } });
|
|
43
|
+
Object.defineProperty(exports, "DbConnection", { enumerable: true, get: function () { return base_1.DbConnection; } });
|
|
44
|
+
Object.defineProperty(exports, "ForbiddenHttpException", { enumerable: true, get: function () { return base_1.ForbiddenHttpException; } });
|
|
45
|
+
Object.defineProperty(exports, "InvalidConfigException", { enumerable: true, get: function () { return base_1.InvalidConfigException; } });
|
|
46
|
+
Object.defineProperty(exports, "InvalidArgumentException", { enumerable: true, get: function () { return base_1.InvalidArgumentException; } });
|
|
47
|
+
Object.defineProperty(exports, "NotFoundHttpException", { enumerable: true, get: function () { return base_1.NotFoundHttpException; } });
|
|
48
|
+
Object.defineProperty(exports, "UnauthorizedHttpException", { enumerable: true, get: function () { return base_1.UnauthorizedHttpException; } });
|
|
49
|
+
Object.defineProperty(exports, "DataErrorDbException", { enumerable: true, get: function () { return base_1.DataErrorDbException; } });
|
|
50
|
+
Object.defineProperty(exports, "ValidationHttpException", { enumerable: true, get: function () { return base_1.ValidationHttpException; } });
|
|
51
|
+
Object.defineProperty(exports, "Model", { enumerable: true, get: function () { return base_1.Model; } });
|
|
52
|
+
Object.defineProperty(exports, "ModelManager", { enumerable: true, get: function () { return base_1.ModelManager; } });
|
|
53
|
+
var filters_1 = require("./filters");
|
|
54
|
+
Object.defineProperty(exports, "AccessControl", { enumerable: true, get: function () { return filters_1.AccessControl; } });
|
|
55
|
+
Object.defineProperty(exports, "AccessRule", { enumerable: true, get: function () { return filters_1.AccessRule; } });
|
|
56
|
+
var auth_1 = require("./filters/auth");
|
|
57
|
+
Object.defineProperty(exports, "JwtHttpBearerAuth", { enumerable: true, get: function () { return auth_1.JwtHttpBearerAuth; } });
|
|
58
|
+
Object.defineProperty(exports, "HttpBearerAuth", { enumerable: true, get: function () { return auth_1.HttpBearerAuth; } });
|
|
59
|
+
Object.defineProperty(exports, "HttpHeaderAuth", { enumerable: true, get: function () { return auth_1.HttpHeaderAuth; } });
|
|
60
|
+
Object.defineProperty(exports, "HttpBasicAuth", { enumerable: true, get: function () { return auth_1.HttpBasicAuth; } });
|
|
61
|
+
var decorator_1 = require("./decorator");
|
|
62
|
+
Object.defineProperty(exports, "controller", { enumerable: true, get: function () { return decorator_1.controller; } });
|
|
63
|
+
Object.defineProperty(exports, "get", { enumerable: true, get: function () { return decorator_1.get; } });
|
|
64
|
+
Object.defineProperty(exports, "post", { enumerable: true, get: function () { return decorator_1.post; } });
|
|
65
|
+
exports.utils = __importStar(require("./requiments/Utils"));
|
|
31
66
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,yCAAsC;AAA9B,kGAAA,OAAO,OAAA;AAGf,0DAAkC;AAS1B,mBATD,kBAAQ,CASC;AAPhB,CAAC;AAED;;GAEG;AACH,MAAM,IAAI,GAAG,IAAI,kBAAQ,EAAE,CAAC;AAC5B,kBAAe,IAAI,CAAC;AAEpB,+BAkBgB;AAjBZ,oGAAA,YAAY,OAAA;AACZ,kGAAA,UAAU,OAAA;AACV,iGAAA,SAAS,OAAA;AACT,gGAAA,QAAQ,OAAA;AACR,iGAAA,SAAS,OAAA;AAET,sGAAA,cAAc,OAAA;AACd,oGAAA,YAAY,OAAA;AACZ,8GAAA,sBAAsB,OAAA;AACtB,8GAAA,sBAAsB,OAAA;AACtB,gHAAA,wBAAwB,OAAA;AACxB,6GAAA,qBAAqB,OAAA;AACrB,iHAAA,yBAAyB,OAAA;AACzB,4GAAA,oBAAoB,OAAA;AACpB,+GAAA,uBAAuB,OAAA;AACvB,6FAAA,KAAK,OAAA;AACL,oGAAA,YAAY,OAAA;AAEhB,qCAAoD;AAA5C,wGAAA,aAAa,OAAA;AAAE,qGAAA,UAAU,OAAA;AACjC,uCAKwB;AAJpB,yGAAA,iBAAiB,OAAA;AACjB,sGAAA,cAAc,OAAA;AACd,sGAAA,cAAc,OAAA;AACd,qGAAA,aAAa,OAAA;AAGjB,yCAAgD;AAAxC,uGAAA,UAAU,OAAA;AAAC,gGAAA,GAAG,OAAA;AAAC,iGAAA,IAAI,OAAA;AAC3B,4DAA4C"}
|
package/package.json
CHANGED
package/requiments/Utils.js
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const _ = require('lodash');
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param prefix
|
|
7
|
+
* @param val
|
|
8
|
+
* @param top
|
|
9
|
+
*/
|
|
10
|
+
var buildParams = function (prefix, val, top) {
|
|
11
|
+
if (_.isUndefined(top))
|
|
12
|
+
top = true;
|
|
13
|
+
if (_.isArray(val)) {
|
|
14
|
+
return _.map(val, function (value, key) {
|
|
15
|
+
return buildParams(top ? key : prefix + '[]', value, false);
|
|
16
|
+
}).join('&');
|
|
17
|
+
}
|
|
18
|
+
else if (_.isObject(val)) {
|
|
19
|
+
return _.map(val, function (value, key) {
|
|
20
|
+
return buildParams(top ? key : prefix + '[' + key + ']', value, false);
|
|
21
|
+
}).join('&');
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return encodeURIComponent(prefix) + '=' + encodeURIComponent(val);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
*Creates a query string from a hash
|
|
29
|
+
* @param obj
|
|
30
|
+
*/
|
|
31
|
+
const toQuery = function (obj) {
|
|
32
|
+
return buildParams('', obj);
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @param object
|
|
37
|
+
* @param params
|
|
38
|
+
*/
|
|
4
39
|
const createObject = (object, params) => {
|
|
5
40
|
let newParams = {};
|
|
6
41
|
Object.keys(params).forEach((param) => {
|
|
@@ -13,6 +48,11 @@ const createObject = (object, params) => {
|
|
|
13
48
|
});
|
|
14
49
|
return Object.create(object, newParams);
|
|
15
50
|
};
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @param object
|
|
54
|
+
* @param findKey
|
|
55
|
+
*/
|
|
16
56
|
const findKeyValue = (object, findKey) => {
|
|
17
57
|
let key = Object.keys(object).find(key => key.toLowerCase() === findKey.toLowerCase());
|
|
18
58
|
if (key) {
|
|
@@ -20,19 +60,38 @@ const findKeyValue = (object, findKey) => {
|
|
|
20
60
|
}
|
|
21
61
|
return null;
|
|
22
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* @param seconds
|
|
66
|
+
*/
|
|
23
67
|
const sleep = (seconds = 1) => {
|
|
24
68
|
var waitTill = new Date(new Date().getTime() + seconds * 1000);
|
|
25
69
|
while (waitTill > new Date()) {
|
|
26
70
|
}
|
|
27
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
* @param wildcard
|
|
75
|
+
* @param str
|
|
76
|
+
*/
|
|
28
77
|
function wildTest(wildcard, str) {
|
|
29
78
|
let w = wildcard.replace(/[.+^${}()|[\]\\]/g, '\\$&'); // regexp escape
|
|
30
79
|
const re = new RegExp(`^${w.replace(/\*/g, '.*').replace(/\?/g, '.')}$`, 'i');
|
|
31
80
|
return re.test(str); // remove last 'i' above to have case sensitive
|
|
32
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
*
|
|
84
|
+
* @param pattern
|
|
85
|
+
* @param string
|
|
86
|
+
* @param options
|
|
87
|
+
*/
|
|
33
88
|
const matchWildcard = (pattern, string, options = {}) => {
|
|
34
89
|
return wildTest(pattern, string);
|
|
35
90
|
};
|
|
91
|
+
/**
|
|
92
|
+
*
|
|
93
|
+
* @param text
|
|
94
|
+
*/
|
|
36
95
|
const t = function (text) {
|
|
37
96
|
return text;
|
|
38
97
|
};
|
|
@@ -40,5 +99,6 @@ exports.default = Object.assign({ t,
|
|
|
40
99
|
createObject,
|
|
41
100
|
findKeyValue,
|
|
42
101
|
sleep,
|
|
43
|
-
matchWildcard
|
|
102
|
+
matchWildcard,
|
|
103
|
+
toQuery }, _);
|
|
44
104
|
//# sourceMappingURL=Utils.js.map
|
package/requiments/Utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../requiments/Utils.ts"],"names":[],"mappings":";;AASA,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../requiments/Utils.ts"],"names":[],"mappings":";;AASA,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B;;;;;GAKG;AACH,IAAI,WAAW,GAAG,UAAU,MAAc,EAAE,GAAQ,EAAE,GAAa;IAC/D,IAAI,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC;QAAE,GAAG,GAAG,IAAI,CAAC;IACnC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAChB,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,KAAU,EAAE,GAAW;YAC/C,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAChB;SAAM,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACxB,OAAO,CAAC,CAAC,GAAG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