@aom-js/router 0.0.0-stage → 0.1.1
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/dist/cjs/classes/index.d.ts +3 -0
- package/dist/cjs/classes/index.d.ts.map +1 -0
- package/dist/cjs/classes/index.js +19 -0
- package/dist/cjs/classes/index.js.map +1 -0
- package/dist/cjs/classes/openapi.d.ts +21 -0
- package/dist/cjs/classes/openapi.d.ts.map +1 -0
- package/dist/cjs/classes/openapi.js +188 -0
- package/dist/cjs/classes/openapi.js.map +1 -0
- package/dist/cjs/classes/router.d.ts +17 -0
- package/dist/cjs/classes/router.d.ts.map +1 -0
- package/dist/cjs/classes/router.js +84 -0
- package/dist/cjs/classes/router.js.map +1 -0
- package/dist/cjs/common/api.d.ts +95 -0
- package/dist/cjs/common/api.d.ts.map +1 -0
- package/dist/cjs/common/api.js +113 -0
- package/dist/cjs/common/api.js.map +1 -0
- package/dist/cjs/common/classes.d.ts +7 -0
- package/dist/cjs/common/classes.d.ts.map +1 -0
- package/dist/cjs/common/classes.js +12 -0
- package/dist/cjs/common/classes.js.map +1 -0
- package/dist/cjs/common/context.d.ts +28 -0
- package/dist/cjs/common/context.d.ts.map +1 -0
- package/dist/cjs/common/context.js +142 -0
- package/dist/cjs/common/context.js.map +1 -0
- package/dist/cjs/common/cursor.d.ts +55 -0
- package/dist/cjs/common/cursor.d.ts.map +1 -0
- package/dist/cjs/common/cursor.js +170 -0
- package/dist/cjs/common/cursor.js.map +1 -0
- package/dist/cjs/common/index.d.ts +7 -0
- package/dist/cjs/common/index.d.ts.map +1 -0
- package/dist/cjs/common/index.js +23 -0
- package/dist/cjs/common/index.js.map +1 -0
- package/dist/cjs/common/kinds.d.ts +44 -0
- package/dist/cjs/common/kinds.d.ts.map +1 -0
- package/dist/cjs/common/kinds.js +51 -0
- package/dist/cjs/common/kinds.js.map +1 -0
- package/dist/cjs/common/lazy.d.ts +7 -0
- package/dist/cjs/common/lazy.d.ts.map +1 -0
- package/dist/cjs/common/lazy.js +14 -0
- package/dist/cjs/common/lazy.js.map +1 -0
- package/dist/cjs/common/openapi.d.ts +45 -0
- package/dist/cjs/common/openapi.d.ts.map +1 -0
- package/dist/cjs/common/openapi.js +3 -0
- package/dist/cjs/common/openapi.js.map +1 -0
- package/dist/cjs/common/path.d.ts +6 -0
- package/dist/cjs/common/path.d.ts.map +1 -0
- package/dist/cjs/common/path.js +17 -0
- package/dist/cjs/common/path.js.map +1 -0
- package/dist/cjs/common/references.d.ts +18 -0
- package/dist/cjs/common/references.d.ts.map +1 -0
- package/dist/cjs/common/references.js +31 -0
- package/dist/cjs/common/references.js.map +1 -0
- package/dist/cjs/common/route.d.ts +33 -0
- package/dist/cjs/common/route.d.ts.map +1 -0
- package/dist/cjs/common/route.js +78 -0
- package/dist/cjs/common/route.js.map +1 -0
- package/dist/cjs/common/types.d.ts +8 -0
- package/dist/cjs/common/types.d.ts.map +1 -0
- package/dist/cjs/common/types.js +3 -0
- package/dist/cjs/common/types.js.map +1 -0
- package/dist/cjs/constants/errors.d.ts +21 -0
- package/dist/cjs/constants/errors.d.ts.map +1 -0
- package/dist/cjs/constants/errors.js +24 -0
- package/dist/cjs/constants/errors.js.map +1 -0
- package/dist/cjs/constants/index.d.ts +2 -0
- package/dist/cjs/constants/index.d.ts.map +1 -0
- package/dist/cjs/constants/index.js +18 -0
- package/dist/cjs/constants/index.js.map +1 -0
- package/dist/cjs/decorators/arguments/index.d.ts +22 -0
- package/dist/cjs/decorators/arguments/index.d.ts.map +1 -0
- package/dist/cjs/decorators/arguments/index.js +188 -0
- package/dist/cjs/decorators/arguments/index.js.map +1 -0
- package/dist/cjs/decorators/controllers/index.d.ts +2 -0
- package/dist/cjs/decorators/controllers/index.d.ts.map +1 -0
- package/dist/cjs/decorators/controllers/index.js +21 -0
- package/dist/cjs/decorators/controllers/index.js.map +1 -0
- package/dist/cjs/decorators/docs/index.d.ts +4 -0
- package/dist/cjs/decorators/docs/index.d.ts.map +1 -0
- package/dist/cjs/decorators/docs/index.js +16 -0
- package/dist/cjs/decorators/docs/index.js.map +1 -0
- package/dist/cjs/decorators/endpoints/index.d.ts +20 -0
- package/dist/cjs/decorators/endpoints/index.d.ts.map +1 -0
- package/dist/cjs/decorators/endpoints/index.js +125 -0
- package/dist/cjs/decorators/endpoints/index.js.map +1 -0
- package/dist/cjs/decorators/index.d.ts +9 -0
- package/dist/cjs/decorators/index.d.ts.map +1 -0
- package/dist/cjs/decorators/index.js +25 -0
- package/dist/cjs/decorators/index.js.map +1 -0
- package/dist/cjs/decorators/kinds/index.d.ts +3 -0
- package/dist/cjs/decorators/kinds/index.d.ts.map +1 -0
- package/dist/cjs/decorators/kinds/index.js +49 -0
- package/dist/cjs/decorators/kinds/index.js.map +1 -0
- package/dist/cjs/decorators/middlewares/index.d.ts +11 -0
- package/dist/cjs/decorators/middlewares/index.d.ts.map +1 -0
- package/dist/cjs/decorators/middlewares/index.js +137 -0
- package/dist/cjs/decorators/middlewares/index.js.map +1 -0
- package/dist/cjs/decorators/openapi/index.d.ts +10 -0
- package/dist/cjs/decorators/openapi/index.d.ts.map +1 -0
- package/dist/cjs/decorators/openapi/index.js +61 -0
- package/dist/cjs/decorators/openapi/index.js.map +1 -0
- package/dist/cjs/decorators/openapi/tags.d.ts +6 -0
- package/dist/cjs/decorators/openapi/tags.d.ts.map +1 -0
- package/dist/cjs/decorators/openapi/tags.js +28 -0
- package/dist/cjs/decorators/openapi/tags.js.map +1 -0
- package/dist/cjs/decorators/references/index.d.ts +3 -0
- package/dist/cjs/decorators/references/index.d.ts.map +1 -0
- package/dist/cjs/decorators/references/index.js +10 -0
- package/dist/cjs/decorators/references/index.js.map +1 -0
- package/dist/cjs/index.d.ts +12 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +30 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/specials/index.d.ts +2 -0
- package/dist/cjs/specials/index.d.ts.map +1 -0
- package/dist/cjs/specials/index.js +18 -0
- package/dist/cjs/specials/index.js.map +1 -0
- package/dist/cjs/specials/references.d.ts +5 -0
- package/dist/cjs/specials/references.d.ts.map +1 -0
- package/dist/cjs/specials/references.js +16 -0
- package/dist/cjs/specials/references.js.map +1 -0
- package/dist/cjs/testing/chain.d.ts +31 -0
- package/dist/cjs/testing/chain.d.ts.map +1 -0
- package/dist/cjs/testing/chain.js +110 -0
- package/dist/cjs/testing/chain.js.map +1 -0
- package/dist/cjs/testing/decorators.d.ts +23 -0
- package/dist/cjs/testing/decorators.d.ts.map +1 -0
- package/dist/cjs/testing/decorators.js +52 -0
- package/dist/cjs/testing/decorators.js.map +1 -0
- package/dist/cjs/testing/index.d.ts +7 -0
- package/dist/cjs/testing/index.d.ts.map +1 -0
- package/dist/cjs/testing/index.js +27 -0
- package/dist/cjs/testing/index.js.map +1 -0
- package/dist/cjs/testing/report.d.ts +24 -0
- package/dist/cjs/testing/report.d.ts.map +1 -0
- package/dist/cjs/testing/report.js +53 -0
- package/dist/cjs/testing/report.js.map +1 -0
- package/dist/cjs/testing/runner.d.ts +23 -0
- package/dist/cjs/testing/runner.d.ts.map +1 -0
- package/dist/cjs/testing/runner.js +295 -0
- package/dist/cjs/testing/runner.js.map +1 -0
- package/dist/cjs/types/index.d.ts +16 -0
- package/dist/cjs/types/index.d.ts.map +1 -0
- package/dist/cjs/types/index.js +3 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/mjs/classes/index.d.ts +3 -0
- package/dist/mjs/classes/index.d.ts.map +1 -0
- package/dist/mjs/classes/index.js +3 -0
- package/dist/mjs/classes/index.js.map +1 -0
- package/dist/mjs/classes/openapi.d.ts +21 -0
- package/dist/mjs/classes/openapi.d.ts.map +1 -0
- package/dist/mjs/classes/openapi.js +151 -0
- package/dist/mjs/classes/openapi.js.map +1 -0
- package/dist/mjs/classes/router.d.ts +17 -0
- package/dist/mjs/classes/router.d.ts.map +1 -0
- package/dist/mjs/classes/router.js +47 -0
- package/dist/mjs/classes/router.js.map +1 -0
- package/dist/mjs/common/api.d.ts +95 -0
- package/dist/mjs/common/api.d.ts.map +1 -0
- package/dist/mjs/common/api.js +109 -0
- package/dist/mjs/common/api.js.map +1 -0
- package/dist/mjs/common/classes.d.ts +7 -0
- package/dist/mjs/common/classes.d.ts.map +1 -0
- package/dist/mjs/common/classes.js +4 -0
- package/dist/mjs/common/classes.js.map +1 -0
- package/dist/mjs/common/context.d.ts +28 -0
- package/dist/mjs/common/context.d.ts.map +1 -0
- package/dist/mjs/common/context.js +104 -0
- package/dist/mjs/common/context.js.map +1 -0
- package/dist/mjs/common/cursor.d.ts +55 -0
- package/dist/mjs/common/cursor.d.ts.map +1 -0
- package/dist/mjs/common/cursor.js +132 -0
- package/dist/mjs/common/cursor.js.map +1 -0
- package/dist/mjs/common/index.d.ts +7 -0
- package/dist/mjs/common/index.d.ts.map +1 -0
- package/dist/mjs/common/index.js +7 -0
- package/dist/mjs/common/index.js.map +1 -0
- package/dist/mjs/common/kinds.d.ts +44 -0
- package/dist/mjs/common/kinds.d.ts.map +1 -0
- package/dist/mjs/common/kinds.js +48 -0
- package/dist/mjs/common/kinds.js.map +1 -0
- package/dist/mjs/common/lazy.d.ts +7 -0
- package/dist/mjs/common/lazy.d.ts.map +1 -0
- package/dist/mjs/common/lazy.js +9 -0
- package/dist/mjs/common/lazy.js.map +1 -0
- package/dist/mjs/common/openapi.d.ts +45 -0
- package/dist/mjs/common/openapi.d.ts.map +1 -0
- package/dist/mjs/common/openapi.js +2 -0
- package/dist/mjs/common/openapi.js.map +1 -0
- package/dist/mjs/common/path.d.ts +6 -0
- package/dist/mjs/common/path.d.ts.map +1 -0
- package/dist/mjs/common/path.js +13 -0
- package/dist/mjs/common/path.js.map +1 -0
- package/dist/mjs/common/references.d.ts +18 -0
- package/dist/mjs/common/references.d.ts.map +1 -0
- package/dist/mjs/common/references.js +24 -0
- package/dist/mjs/common/references.js.map +1 -0
- package/dist/mjs/common/route.d.ts +33 -0
- package/dist/mjs/common/route.d.ts.map +1 -0
- package/dist/mjs/common/route.js +73 -0
- package/dist/mjs/common/route.js.map +1 -0
- package/dist/mjs/common/types.d.ts +8 -0
- package/dist/mjs/common/types.d.ts.map +1 -0
- package/dist/mjs/common/types.js +2 -0
- package/dist/mjs/common/types.js.map +1 -0
- package/dist/mjs/constants/errors.d.ts +21 -0
- package/dist/mjs/constants/errors.d.ts.map +1 -0
- package/dist/mjs/constants/errors.js +21 -0
- package/dist/mjs/constants/errors.js.map +1 -0
- package/dist/mjs/constants/index.d.ts +2 -0
- package/dist/mjs/constants/index.d.ts.map +1 -0
- package/dist/mjs/constants/index.js +2 -0
- package/dist/mjs/constants/index.js.map +1 -0
- package/dist/mjs/decorators/arguments/index.d.ts +22 -0
- package/dist/mjs/decorators/arguments/index.d.ts.map +1 -0
- package/dist/mjs/decorators/arguments/index.js +136 -0
- package/dist/mjs/decorators/arguments/index.js.map +1 -0
- package/dist/mjs/decorators/controllers/index.d.ts +2 -0
- package/dist/mjs/decorators/controllers/index.d.ts.map +1 -0
- package/dist/mjs/decorators/controllers/index.js +18 -0
- package/dist/mjs/decorators/controllers/index.js.map +1 -0
- package/dist/mjs/decorators/docs/index.d.ts +4 -0
- package/dist/mjs/decorators/docs/index.d.ts.map +1 -0
- package/dist/mjs/decorators/docs/index.js +12 -0
- package/dist/mjs/decorators/docs/index.js.map +1 -0
- package/dist/mjs/decorators/endpoints/index.d.ts +20 -0
- package/dist/mjs/decorators/endpoints/index.d.ts.map +1 -0
- package/dist/mjs/decorators/endpoints/index.js +80 -0
- package/dist/mjs/decorators/endpoints/index.js.map +1 -0
- package/dist/mjs/decorators/index.d.ts +9 -0
- package/dist/mjs/decorators/index.d.ts.map +1 -0
- package/dist/mjs/decorators/index.js +9 -0
- package/dist/mjs/decorators/index.js.map +1 -0
- package/dist/mjs/decorators/kinds/index.d.ts +3 -0
- package/dist/mjs/decorators/kinds/index.d.ts.map +1 -0
- package/dist/mjs/decorators/kinds/index.js +13 -0
- package/dist/mjs/decorators/kinds/index.js.map +1 -0
- package/dist/mjs/decorators/middlewares/index.d.ts +11 -0
- package/dist/mjs/decorators/middlewares/index.d.ts.map +1 -0
- package/dist/mjs/decorators/middlewares/index.js +94 -0
- package/dist/mjs/decorators/middlewares/index.js.map +1 -0
- package/dist/mjs/decorators/openapi/index.d.ts +10 -0
- package/dist/mjs/decorators/openapi/index.d.ts.map +1 -0
- package/dist/mjs/decorators/openapi/index.js +38 -0
- package/dist/mjs/decorators/openapi/index.js.map +1 -0
- package/dist/mjs/decorators/openapi/tags.d.ts +6 -0
- package/dist/mjs/decorators/openapi/tags.d.ts.map +1 -0
- package/dist/mjs/decorators/openapi/tags.js +22 -0
- package/dist/mjs/decorators/openapi/tags.js.map +1 -0
- package/dist/mjs/decorators/references/index.d.ts +3 -0
- package/dist/mjs/decorators/references/index.d.ts.map +1 -0
- package/dist/mjs/decorators/references/index.js +7 -0
- package/dist/mjs/decorators/references/index.js.map +1 -0
- package/dist/mjs/index.d.ts +12 -0
- package/dist/mjs/index.d.ts.map +1 -0
- package/dist/mjs/index.js +12 -0
- package/dist/mjs/index.js.map +1 -0
- package/dist/mjs/specials/index.d.ts +2 -0
- package/dist/mjs/specials/index.d.ts.map +1 -0
- package/dist/mjs/specials/index.js +2 -0
- package/dist/mjs/specials/index.js.map +1 -0
- package/dist/mjs/specials/references.d.ts +5 -0
- package/dist/mjs/specials/references.d.ts.map +1 -0
- package/dist/mjs/specials/references.js +11 -0
- package/dist/mjs/specials/references.js.map +1 -0
- package/dist/mjs/testing/chain.d.ts +31 -0
- package/dist/mjs/testing/chain.d.ts.map +1 -0
- package/dist/mjs/testing/chain.js +99 -0
- package/dist/mjs/testing/chain.js.map +1 -0
- package/dist/mjs/testing/decorators.d.ts +23 -0
- package/dist/mjs/testing/decorators.d.ts.map +1 -0
- package/dist/mjs/testing/decorators.js +42 -0
- package/dist/mjs/testing/decorators.js.map +1 -0
- package/dist/mjs/testing/index.d.ts +7 -0
- package/dist/mjs/testing/index.d.ts.map +1 -0
- package/dist/mjs/testing/index.js +6 -0
- package/dist/mjs/testing/index.js.map +1 -0
- package/dist/mjs/testing/report.d.ts +24 -0
- package/dist/mjs/testing/report.d.ts.map +1 -0
- package/dist/mjs/testing/report.js +49 -0
- package/dist/mjs/testing/report.js.map +1 -0
- package/dist/mjs/testing/runner.d.ts +23 -0
- package/dist/mjs/testing/runner.d.ts.map +1 -0
- package/dist/mjs/testing/runner.js +289 -0
- package/dist/mjs/testing/runner.js.map +1 -0
- package/dist/mjs/types/index.d.ts +16 -0
- package/dist/mjs/types/index.d.ts.map +1 -0
- package/dist/mjs/types/index.js +2 -0
- package/dist/mjs/types/index.js.map +1 -0
- package/dist/types/classes/index.d.ts +2 -0
- package/dist/types/classes/openapi.d.ts +20 -0
- package/dist/types/classes/router.d.ts +16 -0
- package/dist/types/common/api.d.ts +94 -0
- package/dist/types/common/classes.d.ts +6 -0
- package/dist/types/common/context.d.ts +27 -0
- package/dist/types/common/cursor.d.ts +54 -0
- package/dist/types/common/index.d.ts +6 -0
- package/dist/types/common/kinds.d.ts +43 -0
- package/dist/types/common/lazy.d.ts +6 -0
- package/dist/types/common/openapi.d.ts +44 -0
- package/dist/types/common/path.d.ts +5 -0
- package/dist/types/common/references.d.ts +17 -0
- package/dist/types/common/route.d.ts +32 -0
- package/dist/types/common/types.d.ts +7 -0
- package/dist/types/constants/errors.d.ts +20 -0
- package/dist/types/constants/index.d.ts +1 -0
- package/dist/types/decorators/arguments/index.d.ts +21 -0
- package/dist/types/decorators/controllers/index.d.ts +1 -0
- package/dist/types/decorators/docs/index.d.ts +3 -0
- package/dist/types/decorators/endpoints/index.d.ts +19 -0
- package/dist/types/decorators/index.d.ts +8 -0
- package/dist/types/decorators/kinds/index.d.ts +2 -0
- package/dist/types/decorators/middlewares/index.d.ts +10 -0
- package/dist/types/decorators/openapi/index.d.ts +9 -0
- package/dist/types/decorators/openapi/tags.d.ts +5 -0
- package/dist/types/decorators/references/index.d.ts +2 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/specials/index.d.ts +1 -0
- package/dist/types/specials/references.d.ts +4 -0
- package/dist/types/testing/chain.d.ts +30 -0
- package/dist/types/testing/decorators.d.ts +22 -0
- package/dist/types/testing/index.d.ts +6 -0
- package/dist/types/testing/report.d.ts +23 -0
- package/dist/types/testing/runner.d.ts +22 -0
- package/dist/types/types/index.d.ts +15 -0
- package/package.json +66 -3
- package/readme.md +9 -0
- package/README.md +0 -3
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.compilePath = void 0;
|
|
18
|
+
require("reflect-metadata");
|
|
19
|
+
__exportStar(require("./decorators/index.js"), exports);
|
|
20
|
+
__exportStar(require("./specials/index.js"), exports);
|
|
21
|
+
__exportStar(require("./types/index.js"), exports);
|
|
22
|
+
__exportStar(require("./classes/index.js"), exports);
|
|
23
|
+
__exportStar(require("./common/openapi.js"), exports);
|
|
24
|
+
__exportStar(require("./common/classes.js"), exports);
|
|
25
|
+
__exportStar(require("./common/types.js"), exports);
|
|
26
|
+
__exportStar(require("./common/lazy.js"), exports);
|
|
27
|
+
__exportStar(require("./common/kinds.js"), exports);
|
|
28
|
+
var path_1 = require("./common/path.js");
|
|
29
|
+
Object.defineProperty(exports, "compilePath", { enumerable: true, get: function () { return path_1.compilePath; } });
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,4BAA0B;AAE1B,+CAA6B;AAC7B,6CAA2B;AAC3B,0CAAwB;AACxB,4CAA0B;AAC1B,mDAAiC;AACjC,mDAAiC;AACjC,iDAA+B;AAC/B,gDAA8B;AAC9B,iDAA+B;AAC/B,sCAA4C;AAAnC,mGAAA,WAAW,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/specials/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./references.js"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/specials/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FwdContainer, FwdFunction, RefFunction, RouteRefContainer, ThisRefContainer } from "../common/index.js";
|
|
2
|
+
export declare function FwdRef(fn: FwdFunction): FwdContainer;
|
|
3
|
+
export declare function ThisRef(fn?: RefFunction): ThisRefContainer;
|
|
4
|
+
export declare function RouteRef(fn?: RefFunction): RouteRefContainer;
|
|
5
|
+
//# sourceMappingURL=references.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../../src/specials/references.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,WAAW,CAAC;AAyBnB,wBAAgB,MAAM,CAAC,EAAE,EAAE,WAAW,GAAG,YAAY,CAEpD;AAmCD,wBAAgB,OAAO,CAAC,EAAE,CAAC,EAAE,WAAW,GAAG,gBAAgB,CAE1D;AAiCD,wBAAgB,QAAQ,CAAC,EAAE,CAAC,EAAE,WAAW,GAAG,iBAAiB,CAE5D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FwdRef = FwdRef;
|
|
4
|
+
exports.ThisRef = ThisRef;
|
|
5
|
+
exports.RouteRef = RouteRef;
|
|
6
|
+
const common_1 = require("../common/index.js");
|
|
7
|
+
function FwdRef(fn) {
|
|
8
|
+
return new common_1.FwdContainer(fn);
|
|
9
|
+
}
|
|
10
|
+
function ThisRef(fn) {
|
|
11
|
+
return new common_1.ThisRefContainer(fn);
|
|
12
|
+
}
|
|
13
|
+
function RouteRef(fn) {
|
|
14
|
+
return new common_1.RouteRefContainer(fn);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=references.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.js","sourceRoot":"","sources":["../../../src/specials/references.ts"],"names":[],"mappings":";;;;;AAAA,sCAMmB;AAyBnB,gBAAuB,EAAe;IACpC,OAAO,IAAI,qBAAY,CAAC,EAAE,CAAC,CAAC;AAC9B,CAAC;AAmCD,iBAAwB,EAAgB;IACtC,OAAO,IAAI,yBAAgB,CAAC,EAAE,CAAC,CAAC;AAClC,CAAC;AAiCD,kBAAyB,EAAgB;IACvC,OAAO,IAAI,0BAAiB,CAAC,EAAE,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type AomCursor } from "../common/cursor.js";
|
|
2
|
+
import type { AomCursorKind } from "../common/kinds.js";
|
|
3
|
+
import type { AomRoute } from "../common/route.js";
|
|
4
|
+
import type { Router } from "../classes/index.js";
|
|
5
|
+
export declare const routeName: ({ method, path }: {
|
|
6
|
+
method: string;
|
|
7
|
+
path: string;
|
|
8
|
+
}) => string;
|
|
9
|
+
export declare function parentsOf(cursors: AomCursor[]): number[];
|
|
10
|
+
export declare function sharedEndpoints(router: Router): string[];
|
|
11
|
+
export declare function accessIdents(router: Router): Map<string, Set<unknown>>;
|
|
12
|
+
export declare const identCollisions: (router: Router) => string[];
|
|
13
|
+
export declare function serializationErrors(router: Router): string[];
|
|
14
|
+
export declare function constructorThisRefs(router: Router): {
|
|
15
|
+
inspected: number;
|
|
16
|
+
found: string[];
|
|
17
|
+
};
|
|
18
|
+
export interface RepeatOptions {
|
|
19
|
+
kindOf: (cursor: AomCursor) => AomCursorKind;
|
|
20
|
+
writes: (cursor: AomCursor) => boolean;
|
|
21
|
+
harmless: AomCursorKind[];
|
|
22
|
+
}
|
|
23
|
+
export type RepeatBranch = "kind" | "next-group" | "after-handler";
|
|
24
|
+
export interface Repeat {
|
|
25
|
+
step: AomCursor["$"]["_"];
|
|
26
|
+
i: number;
|
|
27
|
+
earlier: number[];
|
|
28
|
+
branch?: RepeatBranch;
|
|
29
|
+
}
|
|
30
|
+
export declare function repeatsOf(route: AomRoute, { kindOf, writes, harmless }: RepeatOptions): Repeat[];
|
|
31
|
+
//# sourceMappingURL=chain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../../src/testing/chain.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAIzC,eAAO,MAAM,SAAS,qBAAsB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,KAAG,MAChC,CAAC;AAOhD,wBAAgB,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,CAMxD;AAGD,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAQxD;AAOD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAatE;AAGD,eAAO,MAAM,eAAe,WAAY,MAAM,KAAG,MAAM,EAMlD,CAAC;AAGN,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAO5D;AAQD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAwB1F;AAGD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,aAAa,CAAC;IAC7C,MAAM,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC;IAEvC,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,YAAY,GAAG,eAAe,CAAC;AAGnE,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAUD,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,aAAa,GAAG,MAAM,EAAE,CAoBhG"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.identCollisions = exports.routeName = void 0;
|
|
4
|
+
exports.parentsOf = parentsOf;
|
|
5
|
+
exports.sharedEndpoints = sharedEndpoints;
|
|
6
|
+
exports.accessIdents = accessIdents;
|
|
7
|
+
exports.serializationErrors = serializationErrors;
|
|
8
|
+
exports.constructorThisRefs = constructorThisRefs;
|
|
9
|
+
exports.repeatsOf = repeatsOf;
|
|
10
|
+
const api_1 = require("../common/api.js");
|
|
11
|
+
const cursor_1 = require("../common/cursor.js");
|
|
12
|
+
const specials_1 = require("../specials/index.js");
|
|
13
|
+
const routeName = ({ method, path }) => `${method} ${path.replace(/\([^)]*\)/g, "")}`;
|
|
14
|
+
exports.routeName = routeName;
|
|
15
|
+
function parentsOf(cursors) {
|
|
16
|
+
return cursors.map((cursor, j) => {
|
|
17
|
+
if (cursor.via === "before")
|
|
18
|
+
return cursors.findIndex((other, k) => k > j && other.$ === cursor.origin);
|
|
19
|
+
if (cursor.via === "after" || cursor.via === "next")
|
|
20
|
+
return cursors.findLastIndex((other, k) => k < j && other.$ === cursor.origin);
|
|
21
|
+
return -1;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function sharedEndpoints(router) {
|
|
25
|
+
const places = new Map();
|
|
26
|
+
router.routes.forEach(({ endpoint, method, path }) => places.set(endpoint.$, [...(places.get(endpoint.$) ?? []), `${method} ${path}`]));
|
|
27
|
+
return [...places]
|
|
28
|
+
.filter(([, list]) => list.length > 1)
|
|
29
|
+
.map(([$, list]) => `endpoint ${String($)} serves ${list.length} routes: ${list.sort().join(", ")}`);
|
|
30
|
+
}
|
|
31
|
+
function accessIdents(router) {
|
|
32
|
+
const sources = new Map();
|
|
33
|
+
router.routes.forEach((route) => {
|
|
34
|
+
const points = new Set(Object.values(route.toJSON().markers).flatMap(({ accessPoints }) => accessPoints));
|
|
35
|
+
route.cursors.forEach((cursor) => {
|
|
36
|
+
if (!cursor.$.element.markers.length)
|
|
37
|
+
return;
|
|
38
|
+
const source = cursor.origin === route.endpoint.$ ? route.endpoint.$ : cursor.origin;
|
|
39
|
+
const ident = String(source);
|
|
40
|
+
if (points.has(ident))
|
|
41
|
+
sources.set(ident, (sources.get(ident) ?? new Set()).add(source));
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
return sources;
|
|
45
|
+
}
|
|
46
|
+
const identCollisions = (router) => [...accessIdents(router)]
|
|
47
|
+
.filter(([, sources]) => sources.size > 1)
|
|
48
|
+
.map(([ident, sources]) => `ident "${ident}" is shared by ${sources.size} different access points — grants are stored as strings, a match would grant access to a foreign point`);
|
|
49
|
+
exports.identCollisions = identCollisions;
|
|
50
|
+
function serializationErrors(router) {
|
|
51
|
+
try {
|
|
52
|
+
JSON.stringify(router);
|
|
53
|
+
return [];
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
return [`router does not serialize: ${error.message}`];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function constructorThisRefs(router) {
|
|
60
|
+
const ThisRefContainer = (0, specials_1.ThisRef)().constructor;
|
|
61
|
+
const inspected = new Set();
|
|
62
|
+
const found = [];
|
|
63
|
+
const visit = (target, cursor) => {
|
|
64
|
+
if (typeof target !== "function" || inspected.has(target))
|
|
65
|
+
return;
|
|
66
|
+
inspected.add(target);
|
|
67
|
+
(api_1.AomApi.checkExists(target)?.element.parameters.descriptors ?? []).forEach((descriptor, index) => {
|
|
68
|
+
if (descriptor.ref instanceof ThisRefContainer) {
|
|
69
|
+
found.push(`${target.name}: constructor parameter ${index} — ThisRef, the target depends on the cursor that created the class first`);
|
|
70
|
+
}
|
|
71
|
+
else if (descriptor.kind === "this" && descriptor.ref === undefined) {
|
|
72
|
+
found.push(`${target.name}: constructor parameter ${index} — @This() without an argument, the target depends on the cursor that created the class first`);
|
|
73
|
+
}
|
|
74
|
+
else if (descriptor.kind === "this") {
|
|
75
|
+
visit((0, cursor_1.resolveTarget)(descriptor.ref, cursor), cursor);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
router.routes.forEach((route) => route.cursors.forEach((cursor) => {
|
|
80
|
+
visit(cursor.$._.target, cursor);
|
|
81
|
+
cursor.parameters().forEach(({ kind, target }) => kind === "this" && visit(target, cursor));
|
|
82
|
+
}));
|
|
83
|
+
return { inspected: inspected.size, found };
|
|
84
|
+
}
|
|
85
|
+
const same = (a, b) => a.target === b.target && a.property === b.property;
|
|
86
|
+
function repeatsOf(route, { kindOf, writes, harmless }) {
|
|
87
|
+
const { cursors } = route;
|
|
88
|
+
const handler = cursors.findIndex((cursor) => cursor.$ === route.endpoint.$);
|
|
89
|
+
const parent = parentsOf(cursors);
|
|
90
|
+
const groupOf = (j) => {
|
|
91
|
+
for (let k = j; k >= 0; k = parent[k])
|
|
92
|
+
if (cursors[k].via === "next")
|
|
93
|
+
return cursors[k].viaGroup;
|
|
94
|
+
return undefined;
|
|
95
|
+
};
|
|
96
|
+
return cursors.flatMap((cursor, i) => {
|
|
97
|
+
const earlier = cursors.slice(0, i).flatMap((other, j) => (same(other.$._, cursor.$._) ? [j] : []));
|
|
98
|
+
if (!earlier.length)
|
|
99
|
+
return [];
|
|
100
|
+
const branch = harmless.includes(kindOf(cursor))
|
|
101
|
+
? "kind"
|
|
102
|
+
: earlier.every((j) => groupOf(j) !== groupOf(i))
|
|
103
|
+
? "next-group"
|
|
104
|
+
: i > handler && !writes(cursor)
|
|
105
|
+
? "after-handler"
|
|
106
|
+
: undefined;
|
|
107
|
+
return [{ step: cursor.$._, i, earlier, branch }];
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=chain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../src/testing/chain.ts"],"names":[],"mappings":";;;;;;;;;AAIA,uCAAuC;AACvC,6CAAiE;AAIjE,0CAAsC;AAG/B,MAAM,SAAS,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,EAAoC,EAAU,EAAE,CACtF,GAAG,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,EAAE,CAAC;AADnC,QAAA,SAAS,GAAT,SAAS,CAC0B;AAOhD,mBAA0B,OAAoB;IAC5C,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,IAAI,MAAM,CAAC,GAAG,KAAK,QAAQ;YAAE,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC;QACxG,IAAI,MAAM,CAAC,GAAG,KAAK,OAAO,IAA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AAQ,CAAC;QACjG,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;IACF,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,EAAY,EAAE;QAC7C,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACpG,IAAI,CAAC,OAAO,CAAC,MAAM;YAAE,OAAO,EAAE,CAAC;QAC/B,MAAM,MAAM,GAA6B,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACxE,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;gBAC/C,CAAC,CAAC,YAAY;gBACd,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;oBAC9B,CAAC,CAAC,eAAe;oBACjB,CAAC,CAAC,SAAS,CAAC;QAClB,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ClassConstructor } from "@aom-js/core";
|
|
2
|
+
import type { AomRoute } from "../common/route.js";
|
|
3
|
+
import type { HandlerFunction } from "../common/types.js";
|
|
4
|
+
import type { HttpContextValues } from "../types/index.js";
|
|
5
|
+
export type RouteOutcome = "ok" | number | "any";
|
|
6
|
+
export declare const probeMeta: WeakMap<HandlerFunction, {
|
|
7
|
+
title: string;
|
|
8
|
+
input?: Partial<HttpContextValues>;
|
|
9
|
+
route: RouteOutcome;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function Probe(title: string, input?: Partial<HttpContextValues>, expect?: {
|
|
12
|
+
route?: RouteOutcome;
|
|
13
|
+
}): MethodDecorator;
|
|
14
|
+
export declare function Observe<T extends object>(target: ClassConstructor<T>): ParameterDecorator;
|
|
15
|
+
export declare const Report: () => ParameterDecorator;
|
|
16
|
+
export type RouteMatch = {
|
|
17
|
+
match: (route: AomRoute) => boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare const endpointOf: (tester: object) => HandlerFunction | undefined;
|
|
20
|
+
export declare const matchOf: (tester: object) => ((route: AomRoute) => boolean) | undefined;
|
|
21
|
+
export declare const isTester: (cls: object) => boolean;
|
|
22
|
+
export declare function Tester(target: HandlerFunction | RouteMatch): ClassDecorator;
|
|
23
|
+
//# sourceMappingURL=decorators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../src/testing/decorators.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAQlD,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,MAAM,GAAG,KAAK,CAAC;AAGjD,eAAO,MAAM,SAAS;WAEX,MAAM;YAAU,OAAO,CAAC,iBAAiB,CAAC;WAAS,YAAY;EACvE,CAAC;AAqCJ,wBAAgB,KAAK,CACnB,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,EAClC,MAAM,GAAE;IAAE,KAAK,CAAC,EAAE,YAAY,CAAA;CAAO,GACpC,eAAe,CAEjB;AAMD,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,sBAQpE;AAGD,eAAO,MAAM,MAAM,0BAA8B,CAAC;AAGlD,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,OAAO,CAAA;CAAE,CAAC;AASjE,eAAO,MAAM,UAAU,WAAY,MAAM,gCAGxC,CAAC;AAGF,eAAO,MAAM,OAAO,WAAY,MAAM,cAfI,QAAQ,KAAK,OAAO,aAkB7D,CAAC;AAGF,eAAO,MAAM,QAAQ,QAAS,MAAM,KAAG,OAA2B,CAAC;AAcnE,wBAAgB,MAAM,CAAC,MAAM,EAAE,eAAe,GAAG,UAAU,GAAG,cAAc,CAI3E"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTester = exports.matchOf = exports.endpointOf = exports.Report = exports.probeMeta = void 0;
|
|
4
|
+
exports.Probe = Probe;
|
|
5
|
+
exports.Observe = Observe;
|
|
6
|
+
exports.Tester = Tester;
|
|
7
|
+
const core_1 = require("@aom-js/core");
|
|
8
|
+
const api_1 = require("../common/api.js");
|
|
9
|
+
const arguments_1 = require("../decorators/arguments/index.js");
|
|
10
|
+
const report_1 = require("./report.js");
|
|
11
|
+
exports.probeMeta = new WeakMap();
|
|
12
|
+
const aggregate = (handler = () => { }) => api_1.AomApi.classDecorator(($) => {
|
|
13
|
+
handler($._.target);
|
|
14
|
+
$._.apply();
|
|
15
|
+
}, core_1.ExecutionPhase.INSTANT);
|
|
16
|
+
function runnable(store) {
|
|
17
|
+
return api_1.AomApi.methodDecorator(($, descriptor) => {
|
|
18
|
+
$.element.descriptor = descriptor;
|
|
19
|
+
store?.(descriptor.value);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function Probe(title, input, expect = {}) {
|
|
23
|
+
return runnable((fn) => exports.probeMeta.set(fn, { title, input, route: expect.route ?? "ok" }));
|
|
24
|
+
}
|
|
25
|
+
function Observe(target) {
|
|
26
|
+
return (0, arguments_1.Args)(({ context }) => {
|
|
27
|
+
const found = context.state.get(target);
|
|
28
|
+
if (!found) {
|
|
29
|
+
throw new Error(`@Observe(${target.name}): no instance in the request state — the step did not run`);
|
|
30
|
+
}
|
|
31
|
+
return found;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const Report = () => Observe(report_1.TesterReport);
|
|
35
|
+
exports.Report = Report;
|
|
36
|
+
const testers = new WeakMap();
|
|
37
|
+
const endpointOf = (tester) => {
|
|
38
|
+
const target = testers.get(tester);
|
|
39
|
+
return target && "endpoint" in target ? target.endpoint : undefined;
|
|
40
|
+
};
|
|
41
|
+
exports.endpointOf = endpointOf;
|
|
42
|
+
const matchOf = (tester) => {
|
|
43
|
+
const target = testers.get(tester);
|
|
44
|
+
return target && "match" in target ? target.match : undefined;
|
|
45
|
+
};
|
|
46
|
+
exports.matchOf = matchOf;
|
|
47
|
+
const isTester = (cls) => testers.has(cls);
|
|
48
|
+
exports.isTester = isTester;
|
|
49
|
+
function Tester(target) {
|
|
50
|
+
return aggregate((cls) => testers.set(cls, typeof target === "function" ? { endpoint: target } : { match: target.match }));
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=decorators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../src/testing/decorators.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA8C;AAG9C,uCAAuC;AAGvC,uDAA+C;AAE/C,qCAAwC;AAU3B,QAAA,SAAS,GAAG,IAAI,OAAO,EAGjC,CAAC;AAaJ,MAAM,SAAS,GAAG,CAAC,OAAO,GAA6B,GAAG,EAAE,GAA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I,OAAO,EAAsD,CAAC;AAG3E,MAAM,UAAU,GAAG,CAAC,MAAc,EAAE,EAAE;IAC3C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACnC,OAAO,MAAM,IAAI,UAAU,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;AACtE,CAAC,CAAC;AAHW,QAAA,UAAU,GAAV,UAAU,CAGrB;AAGK,MAAM,OAAO,GAAG,CAAC,MAAc,EAAE,EAAE;IACxC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACnC,OAAO,MAAM,IAAI,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAChE,CAAC,CAAC;AAHW,QAAA,OAAO,GAAP,OAAO,CAGlB;AAGK,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAW,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAAtD,QAAA,QAAQ,GAAR,QAAQ,CAA8C;AAcnE,gBAAuB,MAAoC;IACzD,OAAO,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CACvB,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAChG,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "reflect-metadata";
|
|
2
|
+
export { Observe, Probe, Report, Tester, isTester, type RouteMatch, type RouteOutcome } from "./decorators.js";
|
|
3
|
+
export { TesterReport, type CheckResult } from "./report.js";
|
|
4
|
+
export { routesOf, runAcross, runProbes, runSteps, type AcrossOptions, type RunOptions } from "./runner.js";
|
|
5
|
+
export type { CreatedRecord } from "../common/context.js";
|
|
6
|
+
export { accessIdents, constructorThisRefs, identCollisions, parentsOf, repeatsOf, type Repeat, type RepeatBranch, type RepeatOptions, routeName, serializationErrors, sharedEndpoints, } from "./chain.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/testing/index.ts"],"names":[],"mappings":"AASA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5G,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AACzG,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,SAAS,EACT,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,SAAS,EACT,mBAAmB,EACnB,eAAe,GAChB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sharedEndpoints = exports.serializationErrors = exports.routeName = exports.repeatsOf = exports.parentsOf = exports.identCollisions = exports.constructorThisRefs = exports.accessIdents = exports.runSteps = exports.runProbes = exports.runAcross = exports.routesOf = exports.TesterReport = exports.isTester = exports.Tester = exports.Report = exports.Probe = exports.Observe = void 0;
|
|
4
|
+
require("reflect-metadata");
|
|
5
|
+
var decorators_1 = require("./decorators.js");
|
|
6
|
+
Object.defineProperty(exports, "Observe", { enumerable: true, get: function () { return decorators_1.Observe; } });
|
|
7
|
+
Object.defineProperty(exports, "Probe", { enumerable: true, get: function () { return decorators_1.Probe; } });
|
|
8
|
+
Object.defineProperty(exports, "Report", { enumerable: true, get: function () { return decorators_1.Report; } });
|
|
9
|
+
Object.defineProperty(exports, "Tester", { enumerable: true, get: function () { return decorators_1.Tester; } });
|
|
10
|
+
Object.defineProperty(exports, "isTester", { enumerable: true, get: function () { return decorators_1.isTester; } });
|
|
11
|
+
var report_1 = require("./report.js");
|
|
12
|
+
Object.defineProperty(exports, "TesterReport", { enumerable: true, get: function () { return report_1.TesterReport; } });
|
|
13
|
+
var runner_1 = require("./runner.js");
|
|
14
|
+
Object.defineProperty(exports, "routesOf", { enumerable: true, get: function () { return runner_1.routesOf; } });
|
|
15
|
+
Object.defineProperty(exports, "runAcross", { enumerable: true, get: function () { return runner_1.runAcross; } });
|
|
16
|
+
Object.defineProperty(exports, "runProbes", { enumerable: true, get: function () { return runner_1.runProbes; } });
|
|
17
|
+
Object.defineProperty(exports, "runSteps", { enumerable: true, get: function () { return runner_1.runSteps; } });
|
|
18
|
+
var chain_1 = require("./chain.js");
|
|
19
|
+
Object.defineProperty(exports, "accessIdents", { enumerable: true, get: function () { return chain_1.accessIdents; } });
|
|
20
|
+
Object.defineProperty(exports, "constructorThisRefs", { enumerable: true, get: function () { return chain_1.constructorThisRefs; } });
|
|
21
|
+
Object.defineProperty(exports, "identCollisions", { enumerable: true, get: function () { return chain_1.identCollisions; } });
|
|
22
|
+
Object.defineProperty(exports, "parentsOf", { enumerable: true, get: function () { return chain_1.parentsOf; } });
|
|
23
|
+
Object.defineProperty(exports, "repeatsOf", { enumerable: true, get: function () { return chain_1.repeatsOf; } });
|
|
24
|
+
Object.defineProperty(exports, "routeName", { enumerable: true, get: function () { return chain_1.routeName; } });
|
|
25
|
+
Object.defineProperty(exports, "serializationErrors", { enumerable: true, get: function () { return chain_1.serializationErrors; } });
|
|
26
|
+
Object.defineProperty(exports, "sharedEndpoints", { enumerable: true, get: function () { return chain_1.sharedEndpoints; } });
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/testing/index.ts"],"names":[],"mappings":";;;AASA,4BAA0B;AAE1B,2CAA4G;AAAnG,qGAAA,OAAO,OAAA;AAAE,mGAAA,KAAK,OAAA;AAAE,oGAAA,MAAM,OAAA;AAAE,oGAAA,MAAM,OAAA;AAAE,sGAAA,QAAQ,OAAA;AACjD,mCAA0D;AAAjD,sGAAA,YAAY,OAAA;AACrB,mCAAyG;AAAhG,kGAAA,QAAQ,OAAA;AAAE,mGAAA,SAAS,OAAA;AAAE,mGAAA,SAAS,OAAA;AAAE,kGAAA,QAAQ,OAAA;AAEjD,iCAYiB;AAXf,qGAAA,YAAY,OAAA;AACZ,4GAAA,mBAAmB,OAAA;AACnB,wGAAA,eAAe,OAAA;AACf,kGAAA,SAAS,OAAA;AACT,kGAAA,SAAS,OAAA;AAIT,kGAAA,SAAS,OAAA;AACT,4GAAA,mBAAmB,OAAA;AACnB,wGAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CreatedRecord } from "../common/context.js";
|
|
2
|
+
export type CheckResult = {
|
|
3
|
+
probe: string;
|
|
4
|
+
check: string;
|
|
5
|
+
ok: boolean;
|
|
6
|
+
error?: string;
|
|
7
|
+
route?: string;
|
|
8
|
+
set?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare class TesterReport {
|
|
11
|
+
readonly results: CheckResult[];
|
|
12
|
+
routeError?: unknown;
|
|
13
|
+
created?: CreatedRecord[];
|
|
14
|
+
probe: string;
|
|
15
|
+
route: string;
|
|
16
|
+
set: string;
|
|
17
|
+
private counter;
|
|
18
|
+
get checks(): number;
|
|
19
|
+
get failures(): CheckResult[];
|
|
20
|
+
check(name: string, assertion: boolean | (() => void)): this;
|
|
21
|
+
violation(probe: string, what: string, error: string): void;
|
|
22
|
+
private where;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../src/testing/report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAMvD,MAAM,MAAM,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAMtH,qBAAa,YAAY;IACvB,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE,CAAM;IAGrC,UAAU,CAAC,EAAE,OAAO,CAAC;IAGrB,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAG1B,KAAK,SAAM;IAGX,KAAK,SAAM;IAGX,GAAG,SAAM;IAGT,OAAO,CAAC,OAAO,CAAK;IAEpB,IAAI,MAAM,WAET;IAED,IAAI,QAAQ,kBAEX;IASD,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CA2B3D;IAGD,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAEnD;IAED,OAAO,CAAC,KAAK;CAGd"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TesterReport = void 0;
|
|
4
|
+
class TesterReport {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.results = [];
|
|
7
|
+
this.probe = "";
|
|
8
|
+
this.route = "";
|
|
9
|
+
this.set = "";
|
|
10
|
+
this.counter = 0;
|
|
11
|
+
}
|
|
12
|
+
get checks() {
|
|
13
|
+
return this.counter;
|
|
14
|
+
}
|
|
15
|
+
get failures() {
|
|
16
|
+
return this.results.filter((r) => !r.ok);
|
|
17
|
+
}
|
|
18
|
+
check(name, assertion) {
|
|
19
|
+
this.counter += 1;
|
|
20
|
+
if (typeof assertion === "boolean") {
|
|
21
|
+
this.results.push({
|
|
22
|
+
probe: this.probe,
|
|
23
|
+
check: name,
|
|
24
|
+
ok: assertion,
|
|
25
|
+
...(assertion ? {} : { error: "condition not met" }),
|
|
26
|
+
...this.where(),
|
|
27
|
+
});
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
assertion();
|
|
32
|
+
this.results.push({ probe: this.probe, check: name, ok: true, ...this.where() });
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
this.results.push({
|
|
36
|
+
probe: this.probe,
|
|
37
|
+
check: name,
|
|
38
|
+
ok: false,
|
|
39
|
+
error: error instanceof Error ? error.message : String(error),
|
|
40
|
+
...this.where(),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
violation(probe, what, error) {
|
|
46
|
+
this.results.push({ probe, check: what, ok: false, error, ...this.where() });
|
|
47
|
+
}
|
|
48
|
+
where() {
|
|
49
|
+
return { ...(this.route ? { route: this.route } : {}), ...(this.set ? { set: this.set } : {}) };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.TesterReport = TesterReport;
|
|
53
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../../src/testing/report.ts"],"names":[],"mappings":";;;AAYA;IAAA;QACW,YAAO,GAAkB,EAAE,CAAC;QASrC,UAAK,GAAG,EAAE,CAAC;QAGX,UAAK,GAAG,EAAE,CAAC;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AAC;gBAC7D,GAAG,IAAI,CAAC,KAAK,EAAE;aAChB,CAAC,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAGD,SAAS,CAAC,KAAa,EAAE,IAAY,EAAE,KAAa;QAClD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC/E,CAAC;IAEO,KAAK;QACX,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IAClG,CAAC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ClassConstructor } from "@aom-js/core";
|
|
2
|
+
import type { Router } from "../classes/index.js";
|
|
3
|
+
import { AomCursor } from "../common/cursor.js";
|
|
4
|
+
import { type AomRoute } from "../common/route.js";
|
|
5
|
+
import type { HandlerFunction } from "../common/types.js";
|
|
6
|
+
import type { HttpContextValues } from "../types/index.js";
|
|
7
|
+
import { TesterReport } from "./report.js";
|
|
8
|
+
export type RunOptions = {
|
|
9
|
+
values?: Partial<HttpContextValues>;
|
|
10
|
+
cursors?: HandlerFunction[];
|
|
11
|
+
preset?: Array<[ClassConstructor<object>, object]>;
|
|
12
|
+
};
|
|
13
|
+
export declare function runProbes(tester: object, router: Router, options?: RunOptions): Promise<TesterReport>;
|
|
14
|
+
export declare function routesOf(tester: object, routers: Router | Router[]): AomRoute[];
|
|
15
|
+
export type AcrossOptions = {
|
|
16
|
+
values: (route: AomRoute) => Partial<HttpContextValues> | Partial<HttpContextValues>[] | undefined;
|
|
17
|
+
steps?: (route: AomRoute) => AomCursor[];
|
|
18
|
+
preset?: RunOptions["preset"];
|
|
19
|
+
skip?: Map<HandlerFunction, string>;
|
|
20
|
+
};
|
|
21
|
+
export declare function runAcross(tester: object, routers: Router | Router[], options: AcrossOptions): Promise<TesterReport>;
|
|
22
|
+
export declare function runSteps(route: AomRoute, values?: Partial<HttpContextValues>, steps?: AomCursor[]): Promise<unknown>;
|
|
23
|
+
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../../src/testing/runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAS,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,MAAM,UAAU,GAAG;IAEvB,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAMpC,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAE5B,MAAM,CAAC,EAAE,KAAK,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;CACpD,CAAC;AAyMF,wBAAsB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,YAAY,CAAC,CAa/G;AAqED,wBAAgB,QAAQ,CAAC,MAAM,EAAE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