@8medusa/framework 2.7.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/README.md +0 -0
- package/dist/build-tools/compiler.d.ts +64 -0
- package/dist/build-tools/compiler.d.ts.map +1 -0
- package/dist/build-tools/compiler.js +419 -0
- package/dist/build-tools/compiler.js.map +1 -0
- package/dist/build-tools/index.d.ts +2 -0
- package/dist/build-tools/index.d.ts.map +1 -0
- package/dist/build-tools/index.js +18 -0
- package/dist/build-tools/index.js.map +1 -0
- package/dist/config/config.d.ts +34 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/config/config.js +134 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +21 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +11 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +35 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/types.d.ts +2 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +3 -0
- package/dist/config/types.js.map +1 -0
- package/dist/container.d.ts +3 -0
- package/dist/container.d.ts.map +1 -0
- package/dist/container.js +21 -0
- package/dist/container.js.map +1 -0
- package/dist/database/index.d.ts +3 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +19 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/pg-connection-loader.d.ts +6 -0
- package/dist/database/pg-connection-loader.d.ts.map +1 -0
- package/dist/database/pg-connection-loader.js +43 -0
- package/dist/database/pg-connection-loader.js.map +1 -0
- package/dist/feature-flags/feature-flag-loader.d.ts +8 -0
- package/dist/feature-flags/feature-flag-loader.d.ts.map +1 -0
- package/dist/feature-flags/feature-flag-loader.js +81 -0
- package/dist/feature-flags/feature-flag-loader.js.map +1 -0
- package/dist/feature-flags/flag-router.d.ts +32 -0
- package/dist/feature-flags/flag-router.d.ts.map +1 -0
- package/dist/feature-flags/flag-router.js +67 -0
- package/dist/feature-flags/flag-router.js.map +1 -0
- package/dist/feature-flags/index.d.ts +5 -0
- package/dist/feature-flags/index.d.ts.map +1 -0
- package/dist/feature-flags/index.js +21 -0
- package/dist/feature-flags/index.js.map +1 -0
- package/dist/feature-flags/types.d.ts +31 -0
- package/dist/feature-flags/types.d.ts.map +1 -0
- package/dist/feature-flags/types.js +3 -0
- package/dist/feature-flags/types.js.map +1 -0
- package/dist/http/express-loader.d.ts +8 -0
- package/dist/http/express-loader.d.ts.map +1 -0
- package/dist/http/express-loader.js +128 -0
- package/dist/http/express-loader.js.map +1 -0
- package/dist/http/index.d.ts +15 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +31 -0
- package/dist/http/index.js.map +1 -0
- package/dist/http/middleware-file-loader.d.ts +33 -0
- package/dist/http/middleware-file-loader.d.ts.map +1 -0
- package/dist/http/middleware-file-loader.js +173 -0
- package/dist/http/middleware-file-loader.js.map +1 -0
- package/dist/http/middlewares/apply-default-filters.d.ts +3 -0
- package/dist/http/middlewares/apply-default-filters.d.ts.map +1 -0
- package/dist/http/middlewares/apply-default-filters.js +32 -0
- package/dist/http/middlewares/apply-default-filters.js.map +1 -0
- package/dist/http/middlewares/apply-params-as-filters.d.ts +5 -0
- package/dist/http/middlewares/apply-params-as-filters.d.ts.map +1 -0
- package/dist/http/middlewares/apply-params-as-filters.js +14 -0
- package/dist/http/middlewares/apply-params-as-filters.js.map +1 -0
- package/dist/http/middlewares/authenticate-middleware.d.ts +13 -0
- package/dist/http/middlewares/authenticate-middleware.d.ts.map +1 -0
- package/dist/http/middlewares/authenticate-middleware.js +136 -0
- package/dist/http/middlewares/authenticate-middleware.js.map +1 -0
- package/dist/http/middlewares/bodyparser.d.ts +13 -0
- package/dist/http/middlewares/bodyparser.d.ts.map +1 -0
- package/dist/http/middlewares/bodyparser.js +62 -0
- package/dist/http/middlewares/bodyparser.js.map +1 -0
- package/dist/http/middlewares/clear-filters-by-key.d.ts +3 -0
- package/dist/http/middlewares/clear-filters-by-key.d.ts.map +1 -0
- package/dist/http/middlewares/clear-filters-by-key.js +12 -0
- package/dist/http/middlewares/clear-filters-by-key.js.map +1 -0
- package/dist/http/middlewares/ensure-publishable-api-key.d.ts +3 -0
- package/dist/http/middlewares/ensure-publishable-api-key.d.ts.map +1 -0
- package/dist/http/middlewares/ensure-publishable-api-key.js +45 -0
- package/dist/http/middlewares/ensure-publishable-api-key.js.map +1 -0
- package/dist/http/middlewares/error-handler.d.ts +21 -0
- package/dist/http/middlewares/error-handler.d.ts.map +1 -0
- package/dist/http/middlewares/error-handler.js +85 -0
- package/dist/http/middlewares/error-handler.js.map +1 -0
- package/dist/http/middlewares/exception-formatter.d.ts +9 -0
- package/dist/http/middlewares/exception-formatter.d.ts.map +1 -0
- package/dist/http/middlewares/exception-formatter.js +36 -0
- package/dist/http/middlewares/exception-formatter.js.map +1 -0
- package/dist/http/middlewares/index.d.ts +8 -0
- package/dist/http/middlewares/index.d.ts.map +1 -0
- package/dist/http/middlewares/index.js +24 -0
- package/dist/http/middlewares/index.js.map +1 -0
- package/dist/http/middlewares/set-context.d.ts +3 -0
- package/dist/http/middlewares/set-context.d.ts.map +1 -0
- package/dist/http/middlewares/set-context.js +18 -0
- package/dist/http/middlewares/set-context.js.map +1 -0
- package/dist/http/router.d.ts +28 -0
- package/dist/http/router.d.ts.map +1 -0
- package/dist/http/router.js +252 -0
- package/dist/http/router.js.map +1 -0
- package/dist/http/routes-finder.d.ts +22 -0
- package/dist/http/routes-finder.d.ts.map +1 -0
- package/dist/http/routes-finder.js +62 -0
- package/dist/http/routes-finder.js.map +1 -0
- package/dist/http/routes-loader.d.ts +30 -0
- package/dist/http/routes-loader.d.ts.map +1 -0
- package/dist/http/routes-loader.js +203 -0
- package/dist/http/routes-loader.js.map +1 -0
- package/dist/http/routes-sorter.d.ts +105 -0
- package/dist/http/routes-sorter.d.ts.map +1 -0
- package/dist/http/routes-sorter.js +146 -0
- package/dist/http/routes-sorter.js.map +1 -0
- package/dist/http/types.d.ts +164 -0
- package/dist/http/types.d.ts.map +1 -0
- package/dist/http/types.js +16 -0
- package/dist/http/types.js.map +1 -0
- package/dist/http/utils/define-middlewares.d.ts +22 -0
- package/dist/http/utils/define-middlewares.d.ts.map +1 -0
- package/dist/http/utils/define-middlewares.js +27 -0
- package/dist/http/utils/define-middlewares.js.map +1 -0
- package/dist/http/utils/get-query-config.d.ts +42 -0
- package/dist/http/utils/get-query-config.d.ts.map +1 -0
- package/dist/http/utils/get-query-config.js +183 -0
- package/dist/http/utils/get-query-config.js.map +1 -0
- package/dist/http/utils/http-compression.d.ts +5 -0
- package/dist/http/utils/http-compression.d.ts.map +1 -0
- package/dist/http/utils/http-compression.js +33 -0
- package/dist/http/utils/http-compression.js.map +1 -0
- package/dist/http/utils/maybe-apply-link-filter.d.ts +8 -0
- package/dist/http/utils/maybe-apply-link-filter.d.ts.map +1 -0
- package/dist/http/utils/maybe-apply-link-filter.js +68 -0
- package/dist/http/utils/maybe-apply-link-filter.js.map +1 -0
- package/dist/http/utils/refetch-entities.d.ts +5 -0
- package/dist/http/utils/refetch-entities.d.ts.map +1 -0
- package/dist/http/utils/refetch-entities.js +29 -0
- package/dist/http/utils/refetch-entities.js.map +1 -0
- package/dist/http/utils/restricted-fields.d.ts +6 -0
- package/dist/http/utils/restricted-fields.d.ts.map +1 -0
- package/dist/http/utils/restricted-fields.js +30 -0
- package/dist/http/utils/restricted-fields.js.map +1 -0
- package/dist/http/utils/unless-path.d.ts +9 -0
- package/dist/http/utils/unless-path.d.ts.map +1 -0
- package/dist/http/utils/unless-path.js +19 -0
- package/dist/http/utils/unless-path.js.map +1 -0
- package/dist/http/utils/validate-body.d.ts +5 -0
- package/dist/http/utils/validate-body.d.ts.map +1 -0
- package/dist/http/utils/validate-body.js +23 -0
- package/dist/http/utils/validate-body.js.map +1 -0
- package/dist/http/utils/validate-query.d.ts +6 -0
- package/dist/http/utils/validate-query.d.ts.map +1 -0
- package/dist/http/utils/validate-query.js +79 -0
- package/dist/http/utils/validate-query.js.map +1 -0
- package/dist/http/utils/wrap-handler.d.ts +3 -0
- package/dist/http/utils/wrap-handler.d.ts.map +1 -0
- package/dist/http/utils/wrap-handler.js +26 -0
- package/dist/http/utils/wrap-handler.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/jobs/index.d.ts +2 -0
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/index.js +18 -0
- package/dist/jobs/index.js.map +1 -0
- package/dist/jobs/job-loader.d.ts +42 -0
- package/dist/jobs/job-loader.d.ts.map +1 -0
- package/dist/jobs/job-loader.js +78 -0
- package/dist/jobs/job-loader.js.map +1 -0
- package/dist/links/index.d.ts +2 -0
- package/dist/links/index.d.ts.map +1 -0
- package/dist/links/index.js +18 -0
- package/dist/links/index.js.map +1 -0
- package/dist/links/link-loader.d.ts +10 -0
- package/dist/links/link-loader.d.ts.map +1 -0
- package/dist/links/link-loader.js +74 -0
- package/dist/links/link-loader.js.map +1 -0
- package/dist/logger/index.d.ts +3 -0
- package/dist/logger/index.d.ts.map +1 -0
- package/dist/logger/index.js +9 -0
- package/dist/logger/index.js.map +1 -0
- package/dist/medusa-app-loader.d.ts +51 -0
- package/dist/medusa-app-loader.d.ts.map +1 -0
- package/dist/medusa-app-loader.js +189 -0
- package/dist/medusa-app-loader.js.map +1 -0
- package/dist/migrations/index.d.ts +3 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +19 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/migrations/migrator.d.ts +38 -0
- package/dist/migrations/migrator.d.ts.map +1 -0
- package/dist/migrations/migrator.js +129 -0
- package/dist/migrations/migrator.js.map +1 -0
- package/dist/migrations/run-migration-scripts.d.ts +17 -0
- package/dist/migrations/run-migration-scripts.d.ts.map +1 -0
- package/dist/migrations/run-migration-scripts.js +94 -0
- package/dist/migrations/run-migration-scripts.js.map +1 -0
- package/dist/mikro-orm-cli/bin.d.ts +14 -0
- package/dist/mikro-orm-cli/bin.d.ts.map +1 -0
- package/dist/mikro-orm-cli/bin.js +54 -0
- package/dist/mikro-orm-cli/bin.js.map +1 -0
- package/dist/modules-sdk/index.d.ts +2 -0
- package/dist/modules-sdk/index.d.ts.map +1 -0
- package/dist/modules-sdk/index.js +18 -0
- package/dist/modules-sdk/index.js.map +1 -0
- package/dist/orchestration/index.d.ts +2 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +18 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/subscribers/index.d.ts +3 -0
- package/dist/subscribers/index.d.ts.map +1 -0
- package/dist/subscribers/index.js +19 -0
- package/dist/subscribers/index.js.map +1 -0
- package/dist/subscribers/subscriber-loader.d.ts +12 -0
- package/dist/subscribers/subscriber-loader.d.ts.map +1 -0
- package/dist/subscribers/subscriber-loader.js +147 -0
- package/dist/subscribers/subscriber-loader.js.map +1 -0
- package/dist/subscribers/types.d.ts +15 -0
- package/dist/subscribers/types.d.ts.map +1 -0
- package/dist/subscribers/types.js +3 -0
- package/dist/subscribers/types.js.map +1 -0
- package/dist/telemetry/index.d.ts +50 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +81 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/types/container.d.ts +62 -0
- package/dist/types/container.d.ts.map +1 -0
- package/dist/types/container.js +3 -0
- package/dist/types/container.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +18 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +19 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/resource-loader.d.ts +26 -0
- package/dist/utils/resource-loader.d.ts.map +1 -0
- package/dist/utils/resource-loader.js +78 -0
- package/dist/utils/resource-loader.js.map +1 -0
- package/dist/workflows/index.d.ts +3 -0
- package/dist/workflows/index.d.ts.map +1 -0
- package/dist/workflows/index.js +19 -0
- package/dist/workflows/index.js.map +1 -0
- package/dist/workflows/workflow-loader.d.ts +12 -0
- package/dist/workflows/workflow-loader.d.ts.map +1 -0
- package/dist/workflows/workflow-loader.js +24 -0
- package/dist/workflows/workflow-loader.js.map +1 -0
- package/dist/workflows-sdk/composer.d.ts +2 -0
- package/dist/workflows-sdk/composer.d.ts.map +1 -0
- package/dist/workflows-sdk/composer.js +18 -0
- package/dist/workflows-sdk/composer.js.map +1 -0
- package/dist/workflows-sdk/index.d.ts +3 -0
- package/dist/workflows-sdk/index.d.ts.map +1 -0
- package/dist/workflows-sdk/index.js +19 -0
- package/dist/workflows-sdk/index.js.map +1 -0
- package/dist/zod/index.d.ts +2 -0
- package/dist/zod/index.d.ts.map +1 -0
- package/dist/zod/index.js +18 -0
- package/dist/zod/index.js.map +1 -0
- package/dist/zod/zod-helpers.d.ts +3 -0
- package/dist/zod/zod-helpers.d.ts.map +1 -0
- package/dist/zod/zod-helpers.js +95 -0
- package/dist/zod/zod-helpers.js.map +1 -0
- package/package.json +133 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var _ResourceLoader_sourceDir, _ResourceLoader_excludes;
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ResourceLoader = void 0;
|
|
16
|
+
const utils_1 = require("@8medusa/utils");
|
|
17
|
+
const promises_1 = require("fs/promises");
|
|
18
|
+
const path_1 = require("path");
|
|
19
|
+
const logger_1 = require("../logger");
|
|
20
|
+
class ResourceLoader {
|
|
21
|
+
constructor(sourceDir) {
|
|
22
|
+
/**
|
|
23
|
+
* The directory from which to load the jobs
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
_ResourceLoader_sourceDir.set(this, void 0);
|
|
27
|
+
/**
|
|
28
|
+
* The list of file names to exclude from the subscriber scan
|
|
29
|
+
* @private
|
|
30
|
+
*/
|
|
31
|
+
_ResourceLoader_excludes.set(this, [/^_[^/\\]*(\.[^/\\]+)?$/]);
|
|
32
|
+
__classPrivateFieldSet(this, _ResourceLoader_sourceDir, sourceDir, "f");
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Discover resources from the source directory
|
|
36
|
+
* @param exclude - custom exclusion regexes
|
|
37
|
+
* @param customFiltering - custom filtering function
|
|
38
|
+
* @returns The resources discovered
|
|
39
|
+
*/
|
|
40
|
+
async discoverResources({ exclude, customFiltering, } = {}) {
|
|
41
|
+
exclude ??= [];
|
|
42
|
+
customFiltering ??= (entry) => {
|
|
43
|
+
const parsedName = (0, path_1.parse)(entry.name);
|
|
44
|
+
return (!entry.isDirectory() &&
|
|
45
|
+
parsedName.name !== "index" &&
|
|
46
|
+
!parsedName.base.endsWith(".d.ts") &&
|
|
47
|
+
[".js", ".ts"].includes(parsedName.ext) &&
|
|
48
|
+
!__classPrivateFieldGet(this, _ResourceLoader_excludes, "f").some((exclude) => exclude.test(parsedName.base)) &&
|
|
49
|
+
!exclude.some((exclude) => exclude.test(parsedName.base)));
|
|
50
|
+
};
|
|
51
|
+
const normalizedSourcePath = Array.isArray(__classPrivateFieldGet(this, _ResourceLoader_sourceDir, "f"))
|
|
52
|
+
? __classPrivateFieldGet(this, _ResourceLoader_sourceDir, "f")
|
|
53
|
+
: [__classPrivateFieldGet(this, _ResourceLoader_sourceDir, "f")];
|
|
54
|
+
const promises = normalizedSourcePath.map(async (sourcePath) => {
|
|
55
|
+
try {
|
|
56
|
+
await (0, promises_1.access)(sourcePath);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
logger_1.logger.info(`No ${this.resourceName} to load from ${sourcePath}. skipped.`);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
return await (0, utils_1.readDirRecursive)(sourcePath).then(async (entries) => {
|
|
63
|
+
const fileEntries = entries.filter((entry) => customFiltering(entry));
|
|
64
|
+
return await (0, utils_1.promiseAll)(fileEntries.map(async (entry) => {
|
|
65
|
+
const fullPath = (0, path_1.join)(entry.path, entry.name);
|
|
66
|
+
const module_ = await (0, utils_1.dynamicImport)(fullPath);
|
|
67
|
+
await this.onFileLoaded(fullPath, module_);
|
|
68
|
+
return module_;
|
|
69
|
+
}));
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
const resources = await (0, utils_1.promiseAll)(promises);
|
|
73
|
+
return resources.flat();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.ResourceLoader = ResourceLoader;
|
|
77
|
+
_ResourceLoader_sourceDir = new WeakMap(), _ResourceLoader_excludes = new WeakMap();
|
|
78
|
+
//# sourceMappingURL=resource-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-loader.js","sourceRoot":"","sources":["../../src/utils/resource-loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;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Binding = (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
|
+
require("../types/container");
|
|
18
|
+
__exportStar(require("./workflow-loader"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workflows/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8BAA2B;AAE3B,oDAAiC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ResourceLoader } from "../utils/resource-loader";
|
|
2
|
+
export declare class WorkflowLoader extends ResourceLoader {
|
|
3
|
+
protected resourceName: string;
|
|
4
|
+
constructor(sourceDir: string | string[]);
|
|
5
|
+
protected onFileLoaded(path: string, fileExports: Record<string, unknown>): Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Load workflows from the source paths, workflows are registering themselves,
|
|
8
|
+
* therefore we only need to import them
|
|
9
|
+
*/
|
|
10
|
+
load(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=workflow-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-loader.d.ts","sourceRoot":"","sources":["../../src/workflows/workflow-loader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAEzD,qBAAa,cAAe,SAAQ,cAAc;IAChD,SAAS,CAAC,YAAY,SAAa;gBAEvB,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE;cAIxB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAKtC;;;OAGG;IACG,IAAI;CAKX"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkflowLoader = void 0;
|
|
4
|
+
const logger_1 = require("../logger");
|
|
5
|
+
const resource_loader_1 = require("../utils/resource-loader");
|
|
6
|
+
class WorkflowLoader extends resource_loader_1.ResourceLoader {
|
|
7
|
+
constructor(sourceDir) {
|
|
8
|
+
super(sourceDir);
|
|
9
|
+
this.resourceName = "workflow";
|
|
10
|
+
}
|
|
11
|
+
async onFileLoaded(path, fileExports) {
|
|
12
|
+
logger_1.logger.debug(`Registering workflows from ${path}.`);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Load workflows from the source paths, workflows are registering themselves,
|
|
16
|
+
* therefore we only need to import them
|
|
17
|
+
*/
|
|
18
|
+
async load() {
|
|
19
|
+
await super.discoverResources();
|
|
20
|
+
logger_1.logger.debug(`Workflows registered.`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.WorkflowLoader = WorkflowLoader;
|
|
24
|
+
//# sourceMappingURL=workflow-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-loader.js","sourceRoot":"","sources":["../../src/workflows/workflow-loader.ts"],"names":[],"mappings":";;;AAAA,sCAAkC;AAClC,8DAAyD;AAEzD,MAAa,cAAe,SAAQ,gCAAc;IAGhD,YAAY,SAA4B;QACtC,KAAK,CAAC,SAAS,CAAC,CAAA;QAHR,iBAAY,GAAG,UAAU,CAAA;IAInC,CAAC;IAES,KAAK,CAAC,YAAY,CAC1B,IAAY,EACZ,WAAoC;QAEpC,eAAM,CAAC,KAAK,CAAC,8BAA8B,IAAI,GAAG,CAAC,CAAA;IACrD,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,IAAI;QACR,MAAM,KAAK,CAAC,iBAAiB,EAAE,CAAA;QAE/B,eAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;IACvC,CAAC;CACF;AAvBD,wCAuBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../../src/workflows-sdk/composer.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAA"}
|
|
@@ -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("@8medusa/workflows-sdk/composer"), exports);
|
|
18
|
+
//# sourceMappingURL=composer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composer.js","sourceRoot":"","sources":["../../src/workflows-sdk/composer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAA+C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workflows-sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAE3B,cAAc,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
require("../types/container");
|
|
18
|
+
__exportStar(require("@8medusa/workflows-sdk"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workflows-sdk/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8BAA2B;AAE3B,yDAAsC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/zod/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
|
@@ -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("./zod-helpers"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/zod/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod-helpers.d.ts","sourceRoot":"","sources":["../../src/zod/zod-helpers.ts"],"names":[],"mappings":"AACA,OAAO,EACL,CAAC,EAKF,MAAM,KAAK,CAAA;AAwGZ,wBAAsB,YAAY,CAAC,CAAC,EAClC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EACzD,IAAI,EAAE,CAAC,GACN,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAmBxB"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.zodValidator = zodValidator;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const formatPath = (issue) => {
|
|
7
|
+
return issue.path.join(", ");
|
|
8
|
+
};
|
|
9
|
+
const formatInvalidType = (issues) => {
|
|
10
|
+
const expected = issues
|
|
11
|
+
.map((i) => {
|
|
12
|
+
// Unforutnately the zod library doesn't distinguish between a wrong type and a required field, which we want to handle differently
|
|
13
|
+
if (i.code === "invalid_type" && i.message !== "Required") {
|
|
14
|
+
return i.expected;
|
|
15
|
+
}
|
|
16
|
+
return;
|
|
17
|
+
})
|
|
18
|
+
.filter(Boolean);
|
|
19
|
+
if (!expected.length) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const received = issues?.[0]?.received;
|
|
23
|
+
return `Expected type: '${expected.join(", ")}' for field '${formatPath(issues[0])}', got: '${received}'`;
|
|
24
|
+
};
|
|
25
|
+
const formatRequiredField = (issues) => {
|
|
26
|
+
const expected = issues
|
|
27
|
+
.map((i) => {
|
|
28
|
+
if (i.code === "invalid_type" && i.message === "Required") {
|
|
29
|
+
return i.expected;
|
|
30
|
+
}
|
|
31
|
+
return;
|
|
32
|
+
})
|
|
33
|
+
.filter(Boolean);
|
|
34
|
+
if (!expected.length) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
return `Field '${formatPath(issues[0])}' is required`;
|
|
38
|
+
};
|
|
39
|
+
const formatUnionError = (issue) => {
|
|
40
|
+
const issues = issue.unionErrors.flatMap((e) => e.issues);
|
|
41
|
+
return (formatInvalidType(issues) || formatRequiredField(issues) || issue.message);
|
|
42
|
+
};
|
|
43
|
+
const formatError = (err) => {
|
|
44
|
+
const issueMessages = err.issues.slice(0, 3).map((issue) => {
|
|
45
|
+
switch (issue.code) {
|
|
46
|
+
case "invalid_type":
|
|
47
|
+
return (formatInvalidType([issue]) ||
|
|
48
|
+
formatRequiredField([issue]) ||
|
|
49
|
+
issue.message);
|
|
50
|
+
case "invalid_literal":
|
|
51
|
+
return `Expected literal: '${issue.expected}' for field '${formatPath(issue)}', but got: '${issue.received}'`;
|
|
52
|
+
case "invalid_union":
|
|
53
|
+
return formatUnionError(issue);
|
|
54
|
+
case "invalid_enum_value":
|
|
55
|
+
return `Expected: '${issue.options.join(", ")}' for field '${formatPath(issue)}', but got: '${issue.received}'`;
|
|
56
|
+
case "unrecognized_keys":
|
|
57
|
+
return `Unrecognized fields: '${issue.keys.join(", ")}'`;
|
|
58
|
+
case "invalid_arguments":
|
|
59
|
+
return `Invalid arguments for '${issue.path.join(", ")}'`;
|
|
60
|
+
case "too_small":
|
|
61
|
+
return `Value for field '${formatPath(issue)}' too small, expected at least: '${issue.minimum}'`;
|
|
62
|
+
case "too_big":
|
|
63
|
+
return `Value for field '${formatPath(issue)}' too big, expected at most: '${issue.maximum}'`;
|
|
64
|
+
case "not_multiple_of":
|
|
65
|
+
return `Value for field '${formatPath(issue)}' not multiple of: '${issue.multipleOf}'`;
|
|
66
|
+
case "not_finite":
|
|
67
|
+
return `Value for field '${formatPath(issue)}' not finite: '${issue.message}'`;
|
|
68
|
+
case "invalid_union_discriminator":
|
|
69
|
+
case "invalid_return_type":
|
|
70
|
+
case "invalid_date":
|
|
71
|
+
case "invalid_string":
|
|
72
|
+
case "invalid_intersection_types":
|
|
73
|
+
default:
|
|
74
|
+
return issue.message;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
return issueMessages.join("; ");
|
|
78
|
+
};
|
|
79
|
+
async function zodValidator(zodSchema, body) {
|
|
80
|
+
let strictSchema = zodSchema;
|
|
81
|
+
// ZodEffects doesn't support setting as strict, for all other schemas we want to enforce strictness.
|
|
82
|
+
if ("strict" in zodSchema) {
|
|
83
|
+
strictSchema = zodSchema.strict();
|
|
84
|
+
}
|
|
85
|
+
try {
|
|
86
|
+
return await strictSchema.parseAsync(body);
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
if (err instanceof zod_1.ZodError) {
|
|
90
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `Invalid request: ${formatError(err)}`);
|
|
91
|
+
}
|
|
92
|
+
throw err;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=zod-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod-helpers.js","sourceRoot":"","sources":["../../src/zod/zod-helpers.ts"],"names":[],"mappings":";;AA+GA,oCAsBC;AArID,oCAAsC;AACtC,6BAMY;AAEZ,MAAM,UAAU,GAAG,CAAC,KAAe,EAAE,EAAE;IACrC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,CAAC,MAAkB,EAAE,EAAE;IAC/C,MAAM,QAAQ,GAAG,MAAM;SACpB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACT,mIAAmI;QACnI,IAAI,CAAC,CAAC,IAAI,KAAK,cAAc,IAAI,CAAC,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;YAC1D,OAAO,CAAC,CAAC,QAAQ,CAAA;QACnB,CAAC;QACD,OAAM;IACR,CAAC,CAAC;SACD,MAAM,CAAC,OAAO,CAAC,CAAA;IAElB,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACrB,OAAM;IACR,CAAC;IAED,MAAM,QAAQ,GAAI,MAAM,EAAE,CAAC,CAAC,CAAyB,EAAE,QAAQ,CAAA;IAE/D,OAAO,mBAAmB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,UAAU,CACrE,MAAM,CAAC,CAAC,CAAC,CACV,YAAY,QAAQ,GAAG,CAAA;A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zD,IAAO;IAEP,IAAI,YAAY,GAAG,SAAS,CAAA;IAC5B,qGAAqG;IACrG,IAAI,QAAQ,IAAI,SAAS,EAAE,CAAC;QAC1B,YAAY,GAAG,SAAS,CAAC,MAAM,EAAE,CAAA;IACnC,CAAC;IAED,IAAI,CAAC;QACH,OAAO,MAAM,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,cAAQ,EAAE,CAAC;YAC5B,MAAM,IAAI,mBAAW,CACnB,mBAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,oBAAoB,WAAW,CAAC,GAAG,CAAC,EAAE,CACvC,CAAA;QACH,CAAC;QAED,MAAM,GAAG,CAAA;IACX,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@8medusa/framework",
|
|
3
|
+
"version": "2.7.0",
|
|
4
|
+
"description": "Framework",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"!dist/**/__tests__",
|
|
10
|
+
"!dist/**/__mocks__",
|
|
11
|
+
"!dist/**/__fixtures__"
|
|
12
|
+
],
|
|
13
|
+
"bin": {
|
|
14
|
+
"medusa-mikro-orm": "./dist/mikro-orm-cli/bin.js"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": "./dist/index.js",
|
|
18
|
+
"./config": "./dist/config/index.js",
|
|
19
|
+
"./logger": "./dist/logger/index.js",
|
|
20
|
+
"./database": "./dist/database/index.js",
|
|
21
|
+
"./subscribers": "./dist/subscribers/index.js",
|
|
22
|
+
"./workflows": "./dist/workflows/index.js",
|
|
23
|
+
"./links": "./dist/links/index.js",
|
|
24
|
+
"./jobs": "./dist/jobs/index.js",
|
|
25
|
+
"./http": "./dist/http/index.js",
|
|
26
|
+
"./telemetry": "./dist/telemetry/index.js",
|
|
27
|
+
"./feature-flags": "./dist/feature-flags/index.js",
|
|
28
|
+
"./utils": "./dist/utils/index.js",
|
|
29
|
+
"./types": "./dist/types/index.js",
|
|
30
|
+
"./build-tools": "./dist/build-tools/index.js",
|
|
31
|
+
"./orchestration": "./dist/orchestration/index.js",
|
|
32
|
+
"./workflows-sdk": "./dist/workflows-sdk/index.js",
|
|
33
|
+
"./workflows-sdk/composer": "./dist/workflows-sdk/composer.js",
|
|
34
|
+
"./modules-sdk": "./dist/modules-sdk/index.js",
|
|
35
|
+
"./migrations": "./dist/migrations/index.js"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=20"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "https://github.com/medusajs/medusa",
|
|
43
|
+
"directory": "packages/core/framework"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"author": "Medusa",
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"scripts": {
|
|
51
|
+
"watch": "tsc --watch ",
|
|
52
|
+
"watch:test": "tsc --watch",
|
|
53
|
+
"build": "rimraf dist && tsc --build",
|
|
54
|
+
"test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@8medusa/cli": "2.7.0",
|
|
58
|
+
"@aws-sdk/client-dynamodb": "^3.218.0",
|
|
59
|
+
"@mikro-orm/core": "6.4.3",
|
|
60
|
+
"@mikro-orm/knex": "6.4.3",
|
|
61
|
+
"@mikro-orm/migrations": "6.4.3",
|
|
62
|
+
"@mikro-orm/postgresql": "6.4.3",
|
|
63
|
+
"@swc/core": "^1.7.28",
|
|
64
|
+
"@swc/jest": "^0.2.36",
|
|
65
|
+
"@types/cors": "^2.8.17",
|
|
66
|
+
"@types/jsonwebtoken": "^8.5.9",
|
|
67
|
+
"awilix": "^8.0.1",
|
|
68
|
+
"connect-dynamodb": "^3.0.5",
|
|
69
|
+
"ioredis": "^5.4.1",
|
|
70
|
+
"jest": "^29.7.0",
|
|
71
|
+
"pg": "^8.13.0",
|
|
72
|
+
"rimraf": "^3.0.2",
|
|
73
|
+
"supertest": "^4.0.2",
|
|
74
|
+
"typescript": "^5.6.2",
|
|
75
|
+
"vite": "^5.4.14"
|
|
76
|
+
},
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"@8medusa/modules-sdk": "2.7.0",
|
|
79
|
+
"@8medusa/orchestration": "2.7.0",
|
|
80
|
+
"@8medusa/telemetry": "2.7.0",
|
|
81
|
+
"@8medusa/types": "2.7.0",
|
|
82
|
+
"@8medusa/utils": "2.7.0",
|
|
83
|
+
"@8medusa/workflows-sdk": "2.7.0",
|
|
84
|
+
"@jercle/yargonaut": "^1.1.5",
|
|
85
|
+
"@opentelemetry/api": "^1.9.0",
|
|
86
|
+
"@types/express": "^4.17.17",
|
|
87
|
+
"chokidar": "^3.4.2",
|
|
88
|
+
"compression": "1.7.4",
|
|
89
|
+
"connect-redis": "5.2.0",
|
|
90
|
+
"cookie-parser": "^1.4.6",
|
|
91
|
+
"cors": "^2.8.5",
|
|
92
|
+
"express": "^4.21.0",
|
|
93
|
+
"express-session": "^1.17.3",
|
|
94
|
+
"glob": "7.2.3",
|
|
95
|
+
"jsonwebtoken": "^9.0.2",
|
|
96
|
+
"lodash": "4.17.21",
|
|
97
|
+
"morgan": "^1.9.1",
|
|
98
|
+
"path-to-regexp": "^0.1.10",
|
|
99
|
+
"tsconfig-paths": "^4.2.0",
|
|
100
|
+
"zod": "3.22.4"
|
|
101
|
+
},
|
|
102
|
+
"peerDependencies": {
|
|
103
|
+
"@8medusa/cli": "2.7.0",
|
|
104
|
+
"@aws-sdk/client-dynamodb": "^3.218.0",
|
|
105
|
+
"@mikro-orm/cli": "6.4.3",
|
|
106
|
+
"@mikro-orm/core": "6.4.3",
|
|
107
|
+
"@mikro-orm/knex": "6.4.3",
|
|
108
|
+
"@mikro-orm/migrations": "6.4.3",
|
|
109
|
+
"@mikro-orm/postgresql": "6.4.3",
|
|
110
|
+
"awilix": "^8.0.1",
|
|
111
|
+
"connect-dynamodb": "^3.0.5",
|
|
112
|
+
"ioredis": "^5.4.1",
|
|
113
|
+
"pg": "^8.13.0",
|
|
114
|
+
"vite": "^5.4.14"
|
|
115
|
+
},
|
|
116
|
+
"peerDependenciesMeta": {
|
|
117
|
+
"@aws-sdk/client-dynamodb": {
|
|
118
|
+
"optional": true
|
|
119
|
+
},
|
|
120
|
+
"@mikro-orm/cli": {
|
|
121
|
+
"optional": true
|
|
122
|
+
},
|
|
123
|
+
"connect-dynamodb": {
|
|
124
|
+
"optional": true
|
|
125
|
+
},
|
|
126
|
+
"ioredis": {
|
|
127
|
+
"optional": true
|
|
128
|
+
},
|
|
129
|
+
"vite": {
|
|
130
|
+
"optional": true
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|