@medusajs/user 0.0.4 → 1.0.0-rc-20241001083650
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -21
- package/dist/index.js.map +1 -0
- package/dist/migrations/Migration20240214033943.d.ts +1 -0
- package/dist/migrations/Migration20240214033943.d.ts.map +1 -0
- package/dist/migrations/Migration20240214033943.js +2 -1
- package/dist/migrations/Migration20240214033943.js.map +1 -0
- package/dist/migrations/Migration20240703095850.d.ts +6 -0
- package/dist/migrations/Migration20240703095850.d.ts.map +1 -0
- package/dist/migrations/Migration20240703095850.js +17 -0
- package/dist/migrations/Migration20240703095850.js.map +1 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +1 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/invite.d.ts +3 -2
- package/dist/models/invite.d.ts.map +1 -0
- package/dist/models/invite.js +2 -1
- package/dist/models/invite.js.map +1 -0
- package/dist/models/user.d.ts +3 -2
- package/dist/models/user.d.ts.map +1 -0
- package/dist/models/user.js +5 -6
- package/dist/models/user.js.map +1 -0
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +2 -3
- package/dist/services/index.js.map +1 -0
- package/dist/services/user-module.d.ts +21 -16
- package/dist/services/user-module.d.ts.map +1 -0
- package/dist/services/user-module.js +106 -59
- package/dist/services/user-module.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/services/index.d.ts +1 -0
- package/dist/types/services/index.d.ts.map +1 -0
- package/dist/types/services/index.js +1 -0
- package/dist/types/services/index.js.map +1 -0
- package/dist/types/services/invite.d.ts +1 -0
- package/dist/types/services/invite.d.ts.map +1 -0
- package/dist/types/services/invite.js +1 -0
- package/dist/types/services/invite.js.map +1 -0
- package/package.json +22 -21
- package/dist/initialize/index.d.ts +0 -3
- package/dist/initialize/index.js +0 -16
- package/dist/joiner-config.d.ts +0 -8
- package/dist/joiner-config.js +0 -38
- package/dist/loaders/connection.d.ts +0 -4
- package/dist/loaders/connection.js +0 -41
- package/dist/loaders/container.d.ts +0 -2
- package/dist/loaders/container.js +0 -34
- package/dist/loaders/index.d.ts +0 -2
- package/dist/loaders/index.js +0 -18
- package/dist/module-definition.d.ts +0 -4
- package/dist/module-definition.js +0 -50
- package/dist/repositories/index.d.ts +0 -1
- package/dist/repositories/index.js +0 -5
- package/dist/scripts/bin/run-seed.d.ts +0 -3
- package/dist/scripts/bin/run-seed.js +0 -38
- package/dist/scripts/seed.d.ts +0 -4
- package/dist/scripts/seed.js +0 -54
- package/dist/services/invite.d.ts +0 -25
- package/dist/services/invite.js +0 -140
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"user-module.js","sourceRoot":"","sources":["../../src/services/user-module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAOA,qDAUkC;AAClC,gEAA8C;AAC9C,8DAAgC;AAEhC,qCAAsC;AAQtC,QAAQ;AACR,MAAM,6BAA6B,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AACzD,MAAqB,iBACnB,SAAQ,IAAA,qBAAa,EAOlB,EAAE,IAAI,EAAJ,cAAI,EAAE,MAAM,EAAN,gBAAM,EAAE,CAAC;IASpB,YACE,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAwB,EACjD,iBAA4C;QAE/D,aAAa;QACb,KAAK,CAAC,GAAG,SAAS,CAAC,CAAA;QAHA,sBAAiB,GAAjB,iBAAiB,CAA2B;QAK/D,IAAI,CAAC,eAAe,GAAG,cAAc,CAAA;QACrC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAA;QAC/B,IAAI,CAAC,cAAc,GAAG,aAAa,CAAA;QACnC,IAAI,CAAC,MAAM,GAAG;YACZ,S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AA;;;;6DAiCjB;AAcK;IAFL,IAAA,qBAAa,GAAE;IACf,IAAA,kBAAU,GAAE;IAGV,WAAA,IAAA,qBAAa,GAAE,CAAA;;;;oDAwBjB;AAcK;IAFL,IAAA,qBAAa,GAAE;IACf,IAAA,kBAAU,GAAE;IAGV,WAAA,IAAA,qBAAa,GAAE,CAAA;;;;oDAwBjB;AAcK;IAFL,IAAA,qBAAa,GAAE;IACf,IAAA,kBAAU,GAAE;IAGV,WAAA,IAAA,qBAAa,GAAE,CAAA;;;;sDAmCjB;AAGa;IADb,IAAA,gCAAwB,GAAE;IAGxB,WAAA,IAAA,qBAAa,GAAE,CAAA;;;;uDAoCjB;AAcK;IAFL,IAAA,qBAAa,GAAE;IACf,IAAA,kBAAU,GAAE;IAGV,WAAA,IAAA,qBAAa,GAAE,CAAA;;;;sDA2BjB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"root":["../src/index.ts","../src/migrations/migration20240214033943.ts","../src/migrations/migration20240703095850.ts","../src/models/index.ts","../src/models/invite.ts","../src/models/user.ts","../src/services/index.ts","../src/services/user-module.ts","../src/types/index.ts","../src/types/services/index.ts","../src/types/services/invite.ts"],"version":"5.6.2"}
|
package/dist/types/index.d.ts
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAElD,MAAM,MAAM,sCAAsC,GAAG;IACnD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,cAAc,YAAY,CAAA"}
|
package/dist/types/index.js
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAMA,6CAA0B"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,kBAAkB,MAAM,UAAU,CAAA"}
|
@@ -25,3 +25,4 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
26
|
exports.InviteServiceTypes = void 0;
|
27
27
|
exports.InviteServiceTypes = __importStar(require("./invite"));
|
28
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAA8C"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"invite.d.ts","sourceRoot":"","sources":["../../../src/types/services/invite.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAC1C"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"invite.js","sourceRoot":"","sources":["../../../src/types/services/invite.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
{
|
2
2
|
"name": "@medusajs/user",
|
3
|
-
"version": "0.0
|
3
|
+
"version": "1.0.0-rc-20241001083650",
|
4
4
|
"description": "Medusa Users module",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
7
7
|
"files": [
|
8
|
-
"dist"
|
8
|
+
"dist",
|
9
|
+
"!dist/**/__tests__",
|
10
|
+
"!dist/**/__mocks__",
|
11
|
+
"!dist/**/__fixtures__"
|
9
12
|
],
|
10
13
|
"engines": {
|
11
|
-
"node": ">=
|
12
|
-
},
|
13
|
-
"bin": {
|
14
|
-
"medusa-user-seed": "dist/scripts/bin/run-seed.js"
|
14
|
+
"node": ">=20"
|
15
15
|
},
|
16
16
|
"repository": {
|
17
17
|
"type": "git",
|
@@ -26,8 +26,8 @@
|
|
26
26
|
"scripts": {
|
27
27
|
"watch": "tsc --build --watch",
|
28
28
|
"watch:test": "tsc --build tsconfig.spec.json --watch",
|
29
|
-
"
|
30
|
-
"build": "rimraf dist && tsc --build &&
|
29
|
+
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
|
30
|
+
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
|
31
31
|
"test": "jest --runInBand --passWithNoTests --bail --forceExit -- src",
|
32
32
|
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts",
|
33
33
|
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
|
@@ -37,26 +37,27 @@
|
|
37
37
|
"orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm cache:clear"
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
|
+
"@medusajs/framework": "1.0.0-rc-20241001083650",
|
40
41
|
"@mikro-orm/cli": "5.9.7",
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
42
|
+
"@mikro-orm/core": "5.9.7",
|
43
|
+
"@mikro-orm/migrations": "5.9.7",
|
44
|
+
"@mikro-orm/postgresql": "5.9.7",
|
45
|
+
"@swc/core": "^1.7.28",
|
46
|
+
"@swc/jest": "^0.2.36",
|
47
|
+
"jest": "^29.7.0",
|
48
|
+
"medusa-test-utils": "2.0.0-rc-20241001083650",
|
44
49
|
"rimraf": "^3.0.2",
|
45
|
-
"ts-jest": "^29.1.1",
|
46
|
-
"ts-node": "^10.9.1",
|
47
50
|
"tsc-alias": "^1.8.6",
|
48
|
-
"typescript": "^5.
|
51
|
+
"typescript": "^5.6.2"
|
49
52
|
},
|
50
53
|
"dependencies": {
|
51
|
-
"
|
52
|
-
|
53
|
-
|
54
|
+
"jsonwebtoken": "^9.0.2"
|
55
|
+
},
|
56
|
+
"peerDependencies": {
|
57
|
+
"@medusajs/framework": "1.0.0-rc-20241001083650",
|
54
58
|
"@mikro-orm/core": "5.9.7",
|
55
59
|
"@mikro-orm/migrations": "5.9.7",
|
56
60
|
"@mikro-orm/postgresql": "5.9.7",
|
57
|
-
"awilix": "^8.0.
|
58
|
-
"dotenv": "^16.4.5",
|
59
|
-
"jsonwebtoken": "^9.0.2",
|
60
|
-
"knex": "2.4.2"
|
61
|
+
"awilix": "^8.0.1"
|
61
62
|
}
|
62
63
|
}
|
@@ -1,3 +0,0 @@
|
|
1
|
-
import { IUserModuleService, ModulesSdkTypes } from "@medusajs/types";
|
2
|
-
import { InitializeModuleInjectableDependencies } from "../types";
|
3
|
-
export declare const initialize: (options?: ModulesSdkTypes.ModuleBootstrapDeclaration | ModulesSdkTypes.ModuleServiceInitializeOptions | ModulesSdkTypes.ModuleServiceInitializeCustomDataLayerOptions, injectedDependencies?: InitializeModuleInjectableDependencies) => Promise<IUserModuleService>;
|
package/dist/initialize/index.js
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.initialize = void 0;
|
4
|
-
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
5
|
-
const module_definition_1 = require("../module-definition");
|
6
|
-
const initialize = async (options, injectedDependencies) => {
|
7
|
-
const loaded = await modules_sdk_1.MedusaModule.bootstrap({
|
8
|
-
moduleKey: modules_sdk_1.Modules.USER,
|
9
|
-
defaultPath: modules_sdk_1.MODULE_PACKAGE_NAMES[modules_sdk_1.Modules.USER],
|
10
|
-
declaration: options,
|
11
|
-
injectedDependencies,
|
12
|
-
moduleExports: module_definition_1.moduleDefinition,
|
13
|
-
});
|
14
|
-
return loaded[modules_sdk_1.Modules.USER];
|
15
|
-
};
|
16
|
-
exports.initialize = initialize;
|
package/dist/joiner-config.d.ts
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
import { MapToConfig } from "@medusajs/utils";
|
2
|
-
import { ModuleJoinerConfig } from "@medusajs/types";
|
3
|
-
export declare const LinkableKeys: {
|
4
|
-
user_id: string;
|
5
|
-
invite_id: string;
|
6
|
-
};
|
7
|
-
export declare const entityNameToLinkableKeysMap: MapToConfig;
|
8
|
-
export declare const joinerConfig: ModuleJoinerConfig;
|
package/dist/joiner-config.js
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.joinerConfig = exports.entityNameToLinkableKeysMap = exports.LinkableKeys = void 0;
|
4
|
-
const _models_1 = require("./models");
|
5
|
-
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
6
|
-
exports.LinkableKeys = {
|
7
|
-
user_id: _models_1.User.name,
|
8
|
-
invite_id: _models_1.Invite.name,
|
9
|
-
};
|
10
|
-
const entityLinkableKeysMap = {};
|
11
|
-
Object.entries(exports.LinkableKeys).forEach(([key, value]) => {
|
12
|
-
entityLinkableKeysMap[value] ?? (entityLinkableKeysMap[value] = []);
|
13
|
-
entityLinkableKeysMap[value].push({
|
14
|
-
mapTo: key,
|
15
|
-
valueFrom: key.split("_").pop(),
|
16
|
-
});
|
17
|
-
});
|
18
|
-
exports.entityNameToLinkableKeysMap = entityLinkableKeysMap;
|
19
|
-
exports.joinerConfig = {
|
20
|
-
serviceName: modules_sdk_1.Modules.USER,
|
21
|
-
primaryKeys: ["id"],
|
22
|
-
linkableKeys: exports.LinkableKeys,
|
23
|
-
alias: [
|
24
|
-
{
|
25
|
-
name: ["user", "users"],
|
26
|
-
args: {
|
27
|
-
entity: _models_1.User.name,
|
28
|
-
},
|
29
|
-
},
|
30
|
-
{
|
31
|
-
name: ["invite", "invites"],
|
32
|
-
args: {
|
33
|
-
entity: _models_1.Invite.name,
|
34
|
-
methodSuffix: "Invites",
|
35
|
-
},
|
36
|
-
},
|
37
|
-
],
|
38
|
-
};
|
@@ -1,4 +0,0 @@
|
|
1
|
-
import { InternalModuleDeclaration, LoaderOptions } from "@medusajs/modules-sdk";
|
2
|
-
import { ModulesSdkTypes } from "@medusajs/types";
|
3
|
-
declare const _default: ({ options, container, logger, }: LoaderOptions<ModulesSdkTypes.ModuleServiceInitializeOptions | ModulesSdkTypes.ModuleServiceInitializeCustomDataLayerOptions>, moduleDeclaration?: InternalModuleDeclaration) => Promise<void>;
|
4
|
-
export default _default;
|
@@ -1,41 +0,0 @@
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
const UserModels = __importStar(require("../models"));
|
27
|
-
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
28
|
-
const utils_1 = require("@medusajs/utils");
|
29
|
-
exports.default = async ({ options, container, logger, }, moduleDeclaration) => {
|
30
|
-
const entities = Object.values(UserModels);
|
31
|
-
const pathToMigrations = __dirname + "/../migrations";
|
32
|
-
await utils_1.ModulesSdkUtils.mikroOrmConnectionLoader({
|
33
|
-
moduleName: modules_sdk_1.Modules.USER,
|
34
|
-
entities,
|
35
|
-
container,
|
36
|
-
options,
|
37
|
-
moduleDeclaration,
|
38
|
-
logger,
|
39
|
-
pathToMigrations,
|
40
|
-
});
|
41
|
-
};
|
@@ -1,34 +0,0 @@
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
const utils_1 = require("@medusajs/utils");
|
27
|
-
const ModuleModels = __importStar(require("../models"));
|
28
|
-
const ModuleRepositories = __importStar(require("../repositories"));
|
29
|
-
const ModuleServices = __importStar(require("../services"));
|
30
|
-
exports.default = utils_1.ModulesSdkUtils.moduleContainerLoaderFactory({
|
31
|
-
moduleModels: ModuleModels,
|
32
|
-
moduleRepositories: ModuleRepositories,
|
33
|
-
moduleServices: ModuleServices,
|
34
|
-
});
|
package/dist/loaders/index.d.ts
DELETED
package/dist/loaders/index.js
DELETED
@@ -1,18 +0,0 @@
|
|
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("./connection"), exports);
|
18
|
-
__exportStar(require("./container"), exports);
|
@@ -1,4 +0,0 @@
|
|
1
|
-
import { ModuleExports } from "@medusajs/types";
|
2
|
-
export declare const runMigrations: ({ options, logger, }?: Pick<import("@medusajs/types").LoaderOptions<import("@medusajs/types").ModuleServiceInitializeOptions>, "options" | "logger"> | undefined) => Promise<void>;
|
3
|
-
export declare const revertMigration: ({ options, logger, }?: Pick<import("@medusajs/types").LoaderOptions<import("@medusajs/types").ModuleServiceInitializeOptions>, "options" | "logger"> | undefined) => Promise<void>;
|
4
|
-
export declare const moduleDefinition: ModuleExports;
|
@@ -1,50 +0,0 @@
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
|
-
};
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
-
exports.moduleDefinition = exports.revertMigration = exports.runMigrations = void 0;
|
30
|
-
const Models = __importStar(require("./models"));
|
31
|
-
const _services_1 = require("./services");
|
32
|
-
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
33
|
-
const utils_1 = require("@medusajs/utils");
|
34
|
-
const connection_1 = __importDefault(require("./loaders/connection"));
|
35
|
-
const container_1 = __importDefault(require("./loaders/container"));
|
36
|
-
const migrationScriptOptions = {
|
37
|
-
moduleName: modules_sdk_1.Modules.USER,
|
38
|
-
models: Models,
|
39
|
-
pathToMigrations: __dirname + "/migrations",
|
40
|
-
};
|
41
|
-
exports.runMigrations = utils_1.ModulesSdkUtils.buildMigrationScript(migrationScriptOptions);
|
42
|
-
exports.revertMigration = utils_1.ModulesSdkUtils.buildRevertMigrationScript(migrationScriptOptions);
|
43
|
-
const service = _services_1.UserModuleService;
|
44
|
-
const loaders = [container_1.default, connection_1.default];
|
45
|
-
exports.moduleDefinition = {
|
46
|
-
service,
|
47
|
-
loaders,
|
48
|
-
runMigrations: exports.runMigrations,
|
49
|
-
revertMigration: exports.revertMigration,
|
50
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export { MikroOrmBaseRepository as BaseRepository } from "@medusajs/utils";
|
@@ -1,5 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.BaseRepository = void 0;
|
4
|
-
var utils_1 = require("@medusajs/utils");
|
5
|
-
Object.defineProperty(exports, "BaseRepository", { enumerable: true, get: function () { return utils_1.MikroOrmBaseRepository; } });
|
@@ -1,38 +0,0 @@
|
|
1
|
-
#!/usr/bin/env node
|
2
|
-
"use strict";
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
4
|
-
if (k2 === undefined) k2 = k;
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
8
|
-
}
|
9
|
-
Object.defineProperty(o, k2, desc);
|
10
|
-
}) : (function(o, m, k, k2) {
|
11
|
-
if (k2 === undefined) k2 = k;
|
12
|
-
o[k2] = m[k];
|
13
|
-
}));
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
16
|
-
}) : function(o, v) {
|
17
|
-
o["default"] = v;
|
18
|
-
});
|
19
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
20
|
-
if (mod && mod.__esModule) return mod;
|
21
|
-
var result = {};
|
22
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
23
|
-
__setModuleDefault(result, mod);
|
24
|
-
return result;
|
25
|
-
};
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
27
|
-
const os_1 = require("os");
|
28
|
-
const seed_1 = require("../seed");
|
29
|
-
const args = process.argv;
|
30
|
-
const path = args.pop();
|
31
|
-
exports.default = (async () => {
|
32
|
-
const { config } = await Promise.resolve().then(() => __importStar(require("dotenv")));
|
33
|
-
config();
|
34
|
-
if (!path) {
|
35
|
-
throw new Error(`filePath is required.${os_1.EOL}Example: medusa-user-seed <filePath>`);
|
36
|
-
}
|
37
|
-
await (0, seed_1.run)({ path });
|
38
|
-
})();
|
package/dist/scripts/seed.d.ts
DELETED
package/dist/scripts/seed.js
DELETED
@@ -1,54 +0,0 @@
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
exports.run = void 0;
|
27
|
-
const UserModels = __importStar(require("../models"));
|
28
|
-
const utils_1 = require("@medusajs/utils");
|
29
|
-
const os_1 = require("os");
|
30
|
-
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
31
|
-
const path_1 = require("path");
|
32
|
-
async function run({ options, logger, path, }) {
|
33
|
-
logger ?? (logger = console);
|
34
|
-
logger.info(`Loading seed data from ${path}...`);
|
35
|
-
const { userData } = await Promise.resolve(`${(0, path_1.resolve)(process.cwd(), path)}`).then(s => __importStar(require(s))).catch((e) => {
|
36
|
-
logger?.error(`Failed to load seed data from ${path}. Please, provide a relative path and check that you export the following: userData.${os_1.EOL}${e}`);
|
37
|
-
throw e;
|
38
|
-
});
|
39
|
-
const dbData = utils_1.ModulesSdkUtils.loadDatabaseConfig(modules_sdk_1.Modules.USER, options);
|
40
|
-
const entities = Object.values(UserModels);
|
41
|
-
const pathToMigrations = __dirname + "/../migrations";
|
42
|
-
const orm = await utils_1.DALUtils.mikroOrmCreateConnection(dbData, entities, pathToMigrations);
|
43
|
-
const manager = orm.em.fork();
|
44
|
-
try {
|
45
|
-
logger.info("Seeding user data..");
|
46
|
-
// TODO: implement user seed data
|
47
|
-
// await createUsers(manager, usersData)
|
48
|
-
}
|
49
|
-
catch (e) {
|
50
|
-
logger.error(`Failed to insert the seed data in the PostgreSQL database ${dbData.clientUrl}.${os_1.EOL}${e}`);
|
51
|
-
}
|
52
|
-
await orm.close(true);
|
53
|
-
}
|
54
|
-
exports.run = run;
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import { Context, DAL } from "@medusajs/types";
|
2
|
-
import { Invite } from "../models";
|
3
|
-
import { InviteServiceTypes } from "../types";
|
4
|
-
type InjectedDependencies = {
|
5
|
-
inviteRepository: DAL.RepositoryService;
|
6
|
-
};
|
7
|
-
declare const InviteService_base: new <TEntity_1 extends object = any>(container: InjectedDependencies) => import("@medusajs/types").InternalModuleService<TEntity_1, InjectedDependencies>;
|
8
|
-
export default class InviteService<TEntity extends Invite = Invite> extends InviteService_base<TEntity> {
|
9
|
-
protected readonly inviteRepository_: DAL.RepositoryService<TEntity>;
|
10
|
-
protected options_: {
|
11
|
-
jwt_secret: string;
|
12
|
-
valid_duration: number;
|
13
|
-
} | undefined;
|
14
|
-
constructor(container: InjectedDependencies);
|
15
|
-
withModuleOptions(options: any): InviteService<TEntity>;
|
16
|
-
private getOption;
|
17
|
-
create(data: InviteServiceTypes.CreateInviteDTO, context?: Context): Promise<TEntity>;
|
18
|
-
create(data: InviteServiceTypes.CreateInviteDTO[], context?: Context): Promise<TEntity[]>;
|
19
|
-
refreshInviteTokens(inviteIds: string[], context?: Context): Promise<TEntity[]>;
|
20
|
-
validateInviteToken(token: string, context?: Context): Promise<TEntity>;
|
21
|
-
private generateToken;
|
22
|
-
private getValidDuration;
|
23
|
-
private validateToken;
|
24
|
-
}
|
25
|
-
export {};
|