New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@medusajs/modules-sdk

Package Overview
Dependencies
Maintainers
2
Versions
3059
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@medusajs/modules-sdk - npm Package Compare versions

Comparing version 1.8.7-snapshot-20230529090917 to 1.8.7-snapshot-20230529095716

3

dist/definitions.d.ts

@@ -6,3 +6,4 @@ import { ModuleDefinition } from "@medusajs/types";

INVENTORY = "inventoryService",
CACHE = "cacheService"
CACHE = "cacheService",
PRODUCT = "productService"
}

@@ -9,0 +10,0 @@ export declare const ModulesDefinition: {

@@ -11,2 +11,3 @@ "use strict";

Modules["CACHE"] = "cacheService";
Modules["PRODUCT"] = "productService";
})(Modules = exports.Modules || (exports.Modules = {}));

@@ -65,2 +66,14 @@ exports.ModulesDefinition = {

},
[Modules.PRODUCT]: {
key: Modules.PRODUCT,
registrationName: "productService",
defaultPackage: false,
label: "productService",
isRequired: false,
canOverride: true,
dependencies: [],
defaultModuleDeclaration: {
scope: types_1.MODULE_SCOPE.EXTERNAL,
},
},
};

@@ -67,0 +80,0 @@ exports.MODULE_DEFINITIONS = Object.values(exports.ModulesDefinition);

@@ -8,4 +8,4 @@ "use strict";

const types_1 = require("@medusajs/types");
const definitions_1 = __importDefault(require("../definitions"));
const resolve_cwd_1 = __importDefault(require("resolve-cwd"));
const definitions_1 = __importDefault(require("../definitions"));
const registerModules = (modules) => {

@@ -12,0 +12,0 @@ const moduleResolutions = {};

@@ -30,3 +30,3 @@ "use strict";

const awilix_1 = require("awilix");
const medusa_telemetry_1 = require("medusa-telemetry");
// import { trackInstallation } from "medusa-telemetry"
async function loadInternalModule(container, resolution, logger) {

@@ -37,3 +37,5 @@ const registrationName = resolution.definition.registrationName;

try {
loadedModule = (await Promise.resolve().then(() => __importStar(require(resolution.resolutionPath)))).default;
loadedModule =
resolution.moduleDefinition ??
(await Promise.resolve().then(() => __importStar(require(resolution.resolutionPath)))).default;
}

@@ -103,6 +105,11 @@ catch (error) {

});
(0, medusa_telemetry_1.trackInstallation)({
/*
trackInstallation(
{
module: resolution.definition.key,
resolution: resolution.resolutionPath,
}, "module");
},
"module"
)
*/
}

@@ -109,0 +116,0 @@ exports.loadInternalModule = loadInternalModule;

import { ExternalModuleDeclaration, InternalModuleDeclaration } from "@medusajs/types";
export declare class MedusaModule {
private static instances_;
static bootstrap(moduleKey: string, defaultPath: string, declaration?: InternalModuleDeclaration | ExternalModuleDeclaration, injectedDependencies?: Record<string, any>): Promise<{
static bootstrap(moduleKey: string, defaultPath: string, declaration?: InternalModuleDeclaration | ExternalModuleDeclaration, moduleDefinition?: any, injectedDependencies?: Record<string, any>): Promise<{
[key: string]: any;

@@ -6,0 +6,0 @@ }>;

@@ -16,3 +16,3 @@ "use strict";

class MedusaModule {
static async bootstrap(moduleKey, defaultPath, declaration, injectedDependencies) {
static async bootstrap(moduleKey, defaultPath, declaration, moduleDefinition, injectedDependencies) {
if (MedusaModule.instances_.has(moduleKey)) {

@@ -37,3 +37,8 @@ return MedusaModule.instances_.get(moduleKey);

const moduleResolutions = (0, loaders_1.registerMedusaModule)(moduleKey, modDeclaration);
await (0, loaders_1.moduleLoader)({ container, moduleResolutions, logger });
moduleResolutions[moduleKey].moduleDefinition = moduleDefinition;
await (0, loaders_1.moduleLoader)({
container,
moduleResolutions,
logger,
});
const services = {};

@@ -40,0 +45,0 @@ for (const resolution of Object.values(moduleResolutions)) {

{
"name": "@medusajs/modules-sdk",
"version": "1.8.7-snapshot-20230529090917",
"version": "1.8.7-snapshot-20230529095716",
"description": "SDK for medusa modules",

@@ -26,7 +26,5 @@ "main": "dist/index.js",

"dependencies": {
"@medusajs/types": "1.8.7-snapshot-20230529090917",
"@medusajs/utils": "1.9.0-snapshot-20230529090917",
"@medusajs/types": "1.8.7-snapshot-20230529095716",
"@medusajs/utils": "1.9.0-snapshot-20230529095716",
"awilix": "^8.0.0",
"glob": "7.1.6",
"medusa-telemetry": "^0.0.16",
"resolve-cwd": "^3.0.0"

@@ -37,4 +35,5 @@ },

"build": "tsc --build",
"test": "jest"
"test": "jest",
"watch": "tsc --build --watch"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc