@medusajs/fulfillment 0.1.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 +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +29 -0
- package/dist/joiner-config.d.ts +5 -0
- package/dist/joiner-config.js +21 -0
- package/dist/models/fullfilment-set.d.ts +14 -0
- package/dist/models/fullfilment-set.js +71 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +8 -0
- package/dist/module-definition.d.ts +2 -0
- package/dist/module-definition.js +58 -0
- package/dist/repositories/index.d.ts +1 -0
- package/dist/repositories/index.js +5 -0
- package/dist/scripts/bin/run-seed.d.ts +3 -0
- package/dist/scripts/bin/run-seed.js +48 -0
- package/dist/services/fulfillment-module-service.d.ts +20 -0
- package/dist/services/fulfillment-module-service.js +46 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +8 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +2 -0
- package/package.json +61 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Fulfillment Module
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { moduleDefinition } from "./module-definition";
|
|
2
|
+
export * from "./types";
|
|
3
|
+
export * from "./models";
|
|
4
|
+
export * from "./services";
|
|
5
|
+
export declare const initialize: (options?: import("@medusajs/modules-sdk").InternalModuleDeclaration | import("@medusajs/modules-sdk").ModuleServiceInitializeOptions | import("@medusajs/modules-sdk").ModuleServiceInitializeCustomDataLayerOptions | import("@medusajs/modules-sdk").ExternalModuleDeclaration | undefined, injectedDependencies?: any) => Promise<unknown>;
|
|
6
|
+
export declare const runMigrations: ((options: import("@medusajs/modules-sdk").LoaderOptions<any>, moduleDeclaration?: import("@medusajs/modules-sdk").InternalModuleDeclaration | undefined) => Promise<void>) | undefined;
|
|
7
|
+
export declare const revertMigration: ((options: import("@medusajs/modules-sdk").LoaderOptions<any>, moduleDeclaration?: import("@medusajs/modules-sdk").InternalModuleDeclaration | undefined) => Promise<void>) | undefined;
|
|
8
|
+
export default moduleDefinition;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
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.revertMigration = exports.runMigrations = exports.initialize = void 0;
|
|
18
|
+
const module_definition_1 = require("./module-definition");
|
|
19
|
+
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
|
20
|
+
__exportStar(require("./types"), exports);
|
|
21
|
+
__exportStar(require("./models"), exports);
|
|
22
|
+
__exportStar(require("./services"), exports);
|
|
23
|
+
exports.initialize = (0, modules_sdk_1.initializeFactory)({
|
|
24
|
+
moduleName: modules_sdk_1.Modules.FULFILLMENT,
|
|
25
|
+
moduleDefinition: module_definition_1.moduleDefinition,
|
|
26
|
+
});
|
|
27
|
+
exports.runMigrations = module_definition_1.moduleDefinition.runMigrations;
|
|
28
|
+
exports.revertMigration = module_definition_1.moduleDefinition.revertMigration;
|
|
29
|
+
exports.default = module_definition_1.moduleDefinition;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ModuleJoinerConfig } from "@medusajs/types";
|
|
2
|
+
import { MapToConfig } from "@medusajs/utils";
|
|
3
|
+
export declare const LinkableKeys: Record<string, string>;
|
|
4
|
+
export declare const entityNameToLinkableKeysMap: MapToConfig;
|
|
5
|
+
export declare const joinerConfig: ModuleJoinerConfig;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.joinerConfig = exports.entityNameToLinkableKeysMap = exports.LinkableKeys = void 0;
|
|
4
|
+
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
|
5
|
+
// TODO manage the config
|
|
6
|
+
exports.LinkableKeys = {};
|
|
7
|
+
const entityLinkableKeysMap = {};
|
|
8
|
+
Object.entries(exports.LinkableKeys).forEach(([key, value]) => {
|
|
9
|
+
entityLinkableKeysMap[value] ?? (entityLinkableKeysMap[value] = []);
|
|
10
|
+
entityLinkableKeysMap[value].push({
|
|
11
|
+
mapTo: key,
|
|
12
|
+
valueFrom: key.split("_").pop(),
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
exports.entityNameToLinkableKeysMap = entityLinkableKeysMap;
|
|
16
|
+
exports.joinerConfig = {
|
|
17
|
+
serviceName: modules_sdk_1.Modules.FULFILLMENT,
|
|
18
|
+
primaryKeys: ["id"],
|
|
19
|
+
linkableKeys: exports.LinkableKeys,
|
|
20
|
+
alias: [],
|
|
21
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OptionalProps } from "@mikro-orm/core";
|
|
2
|
+
import { DAL } from "@medusajs/types";
|
|
3
|
+
type FulfillmentSetOptionalProps = DAL.SoftDeletableEntityDateColumns;
|
|
4
|
+
export default class FulfillmentSet {
|
|
5
|
+
[OptionalProps]?: FulfillmentSetOptionalProps;
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
created_at: Date;
|
|
9
|
+
updated_at: Date;
|
|
10
|
+
deleted_at: Date | null;
|
|
11
|
+
onCreate(): void;
|
|
12
|
+
onInit(): void;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const utils_1 = require("@medusajs/utils");
|
|
13
|
+
const core_1 = require("@mikro-orm/core");
|
|
14
|
+
let FulfillmentSet = class FulfillmentSet {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.deleted_at = null;
|
|
17
|
+
}
|
|
18
|
+
onCreate() {
|
|
19
|
+
this.id = (0, utils_1.generateEntityId)(this.id, "fuset");
|
|
20
|
+
}
|
|
21
|
+
onInit() {
|
|
22
|
+
this.id = (0, utils_1.generateEntityId)(this.id, "fuset");
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, core_1.PrimaryKey)({ columnType: "text" }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], FulfillmentSet.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, core_1.Property)({ columnType: "text" }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], FulfillmentSet.prototype, "name", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, core_1.Property)({
|
|
35
|
+
onCreate: () => new Date(),
|
|
36
|
+
columnType: "timestamptz",
|
|
37
|
+
defaultRaw: "now()",
|
|
38
|
+
}),
|
|
39
|
+
__metadata("design:type", Date)
|
|
40
|
+
], FulfillmentSet.prototype, "created_at", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, core_1.Property)({
|
|
43
|
+
onCreate: () => new Date(),
|
|
44
|
+
onUpdate: () => new Date(),
|
|
45
|
+
columnType: "timestamptz",
|
|
46
|
+
defaultRaw: "now()",
|
|
47
|
+
}),
|
|
48
|
+
__metadata("design:type", Date)
|
|
49
|
+
], FulfillmentSet.prototype, "updated_at", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, core_1.Index)({ name: "IDX_fulfillment_set_deleted_at" }),
|
|
52
|
+
(0, core_1.Property)({ columnType: "timestamptz", nullable: true }),
|
|
53
|
+
__metadata("design:type", Object)
|
|
54
|
+
], FulfillmentSet.prototype, "deleted_at", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, core_1.BeforeCreate)(),
|
|
57
|
+
__metadata("design:type", Function),
|
|
58
|
+
__metadata("design:paramtypes", []),
|
|
59
|
+
__metadata("design:returntype", void 0)
|
|
60
|
+
], FulfillmentSet.prototype, "onCreate", null);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, core_1.OnInit)(),
|
|
63
|
+
__metadata("design:type", Function),
|
|
64
|
+
__metadata("design:paramtypes", []),
|
|
65
|
+
__metadata("design:returntype", void 0)
|
|
66
|
+
], FulfillmentSet.prototype, "onInit", null);
|
|
67
|
+
FulfillmentSet = __decorate([
|
|
68
|
+
(0, core_1.Entity)(),
|
|
69
|
+
(0, core_1.Filter)(utils_1.DALUtils.mikroOrmSoftDeletableFilterOptions)
|
|
70
|
+
], FulfillmentSet);
|
|
71
|
+
exports.default = FulfillmentSet;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FulfillmentSet } from "./fullfilment-set";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FulfillmentSet = void 0;
|
|
7
|
+
var fullfilment_set_1 = require("./fullfilment-set");
|
|
8
|
+
Object.defineProperty(exports, "FulfillmentSet", { enumerable: true, get: function () { return __importDefault(fullfilment_set_1).default; } });
|
|
@@ -0,0 +1,58 @@
|
|
|
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.moduleDefinition = void 0;
|
|
27
|
+
const ModuleServices = __importStar(require("./services"));
|
|
28
|
+
const _services_1 = require("./services");
|
|
29
|
+
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
|
30
|
+
const Models = __importStar(require("./models"));
|
|
31
|
+
const ModuleModels = __importStar(require("./models"));
|
|
32
|
+
const utils_1 = require("@medusajs/utils");
|
|
33
|
+
const ModuleRepositories = __importStar(require("./repositories"));
|
|
34
|
+
const migrationScriptOptions = {
|
|
35
|
+
moduleName: modules_sdk_1.Modules.FULFILLMENT,
|
|
36
|
+
models: Models,
|
|
37
|
+
pathToMigrations: __dirname + "/migrations",
|
|
38
|
+
};
|
|
39
|
+
const runMigrations = utils_1.ModulesSdkUtils.buildMigrationScript(migrationScriptOptions);
|
|
40
|
+
const revertMigration = utils_1.ModulesSdkUtils.buildRevertMigrationScript(migrationScriptOptions);
|
|
41
|
+
const containerLoader = utils_1.ModulesSdkUtils.moduleContainerLoaderFactory({
|
|
42
|
+
moduleModels: ModuleModels,
|
|
43
|
+
moduleRepositories: ModuleRepositories,
|
|
44
|
+
moduleServices: ModuleServices,
|
|
45
|
+
});
|
|
46
|
+
const connectionLoader = utils_1.ModulesSdkUtils.mikroOrmConnectionLoaderFactory({
|
|
47
|
+
moduleName: modules_sdk_1.Modules.FULFILLMENT,
|
|
48
|
+
moduleModels: Object.values(Models),
|
|
49
|
+
migrationsPath: __dirname + "/migrations",
|
|
50
|
+
});
|
|
51
|
+
const service = _services_1.FulfillmentModuleService;
|
|
52
|
+
const loaders = [containerLoader, connectionLoader];
|
|
53
|
+
exports.moduleDefinition = {
|
|
54
|
+
service,
|
|
55
|
+
loaders,
|
|
56
|
+
revertMigration,
|
|
57
|
+
runMigrations,
|
|
58
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MikroOrmBaseRepository as BaseRepository } from "@medusajs/utils";
|
|
@@ -0,0 +1,5 @@
|
|
|
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; } });
|
|
@@ -0,0 +1,48 @@
|
|
|
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 utils_1 = require("@medusajs/utils");
|
|
28
|
+
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
|
29
|
+
const Models = __importStar(require("../../models"));
|
|
30
|
+
const os_1 = require("os");
|
|
31
|
+
const args = process.argv;
|
|
32
|
+
const path = args.pop();
|
|
33
|
+
exports.default = (async () => {
|
|
34
|
+
const { config } = await Promise.resolve().then(() => __importStar(require("dotenv")));
|
|
35
|
+
config();
|
|
36
|
+
if (!path) {
|
|
37
|
+
throw new Error(`filePath is required.${os_1.EOL}Example: medusa-fulfillment-seed <filePath>`);
|
|
38
|
+
}
|
|
39
|
+
const run = utils_1.ModulesSdkUtils.buildSeedScript({
|
|
40
|
+
moduleName: modules_sdk_1.Modules.FULFILLMENT,
|
|
41
|
+
models: Models,
|
|
42
|
+
pathToMigrations: __dirname + "/../../migrations",
|
|
43
|
+
seedHandler: async ({ manager, data }) => {
|
|
44
|
+
// TODO: Add seed logic
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
await run({ path });
|
|
48
|
+
})();
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Context, DAL, FulfillmentTypes, IFulfillmentModuleService, InternalModuleDeclaration, ModuleJoinerConfig, ModulesSdkTypes } from "@medusajs/types";
|
|
2
|
+
import { ModulesSdkUtils } from "@medusajs/utils";
|
|
3
|
+
import { FulfillmentSet } from "../models";
|
|
4
|
+
type InjectedDependencies = {
|
|
5
|
+
baseRepository: DAL.RepositoryService;
|
|
6
|
+
fulfillmentService: ModulesSdkTypes.InternalModuleService<any>;
|
|
7
|
+
};
|
|
8
|
+
declare const FulfillmentModuleService_base: new (container: InjectedDependencies) => ModulesSdkUtils.AbstractModuleService<InjectedDependencies, any, {}>;
|
|
9
|
+
export default class FulfillmentModuleService<TEntity extends FulfillmentSet = FulfillmentSet> extends FulfillmentModuleService_base implements IFulfillmentModuleService {
|
|
10
|
+
protected readonly moduleDeclaration: InternalModuleDeclaration;
|
|
11
|
+
protected baseRepository_: DAL.RepositoryService;
|
|
12
|
+
protected readonly fulfillmentService_: ModulesSdkTypes.InternalModuleService<TEntity>;
|
|
13
|
+
constructor({ baseRepository, fulfillmentService }: InjectedDependencies, moduleDeclaration: InternalModuleDeclaration);
|
|
14
|
+
__joinerConfig(): ModuleJoinerConfig;
|
|
15
|
+
create(data: any[], sharedContext?: Context): Promise<FulfillmentTypes.FulfillmentDTO[]>;
|
|
16
|
+
create(data: any, sharedContext?: Context): Promise<FulfillmentTypes.FulfillmentDTO>;
|
|
17
|
+
update(data: any[], sharedContext?: Context): Promise<FulfillmentTypes.FulfillmentDTO[]>;
|
|
18
|
+
update(data: any, sharedContext?: Context): Promise<FulfillmentTypes.FulfillmentDTO>;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const utils_1 = require("@medusajs/utils");
|
|
13
|
+
const joiner_config_1 = require("../joiner-config");
|
|
14
|
+
const _models_1 = require("../models");
|
|
15
|
+
class FulfillmentModuleService extends utils_1.ModulesSdkUtils.abstractModuleServiceFactory(_models_1.FulfillmentSet, [], joiner_config_1.entityNameToLinkableKeysMap) {
|
|
16
|
+
constructor({ baseRepository, fulfillmentService }, moduleDeclaration) {
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.moduleDeclaration = moduleDeclaration;
|
|
20
|
+
this.baseRepository_ = baseRepository;
|
|
21
|
+
this.fulfillmentService_ = fulfillmentService;
|
|
22
|
+
}
|
|
23
|
+
__joinerConfig() {
|
|
24
|
+
return joiner_config_1.joinerConfig;
|
|
25
|
+
}
|
|
26
|
+
// TODO Implement the methods from the interface and change type
|
|
27
|
+
async create(data, sharedContext) {
|
|
28
|
+
return await Promise.resolve([]);
|
|
29
|
+
}
|
|
30
|
+
async update(data, sharedContext) {
|
|
31
|
+
return await Promise.resolve([]);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.default = FulfillmentModuleService;
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
37
|
+
__metadata("design:type", Function),
|
|
38
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
39
|
+
__metadata("design:returntype", Promise)
|
|
40
|
+
], FulfillmentModuleService.prototype, "create", null);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
43
|
+
__metadata("design:type", Function),
|
|
44
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
45
|
+
__metadata("design:returntype", Promise)
|
|
46
|
+
], FulfillmentModuleService.prototype, "update", null);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FulfillmentModuleService } from "./fulfillment-module-service";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FulfillmentModuleService = void 0;
|
|
7
|
+
var fulfillment_module_service_1 = require("./fulfillment-module-service");
|
|
8
|
+
Object.defineProperty(exports, "FulfillmentModuleService", { enumerable: true, get: function () { return __importDefault(fulfillment_module_service_1).default; } });
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@medusajs/fulfillment",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Medusa Fulfillment module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=16"
|
|
12
|
+
},
|
|
13
|
+
"bin": {
|
|
14
|
+
"medusa-fulfillment-seed": "dist/scripts/bin/run-seed.js"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/medusajs/medusa",
|
|
19
|
+
"directory": "packages/fulfillment"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"author": "Medusa",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"watch": "tsc --build --watch",
|
|
28
|
+
"watch:test": "tsc --build tsconfig.spec.json --watch",
|
|
29
|
+
"prepublishOnly": "cross-env NODE_ENV=production tsc --build && tsc-alias -p tsconfig.json",
|
|
30
|
+
"build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json",
|
|
31
|
+
"test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts",
|
|
32
|
+
"test:integration": "jest --runInBand --forceExit -- integration-tests/**/__tests__/**/*.ts",
|
|
33
|
+
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
|
|
34
|
+
"migration:initial": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:create --initial",
|
|
35
|
+
"migration:create": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:create",
|
|
36
|
+
"migration:up": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:up",
|
|
37
|
+
"orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm cache:clear"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@mikro-orm/cli": "5.9.7",
|
|
41
|
+
"cross-env": "^5.2.1",
|
|
42
|
+
"jest": "^29.6.3",
|
|
43
|
+
"medusa-test-utils": "^1.1.40",
|
|
44
|
+
"rimraf": "^3.0.2",
|
|
45
|
+
"ts-jest": "^29.1.1",
|
|
46
|
+
"ts-node": "^10.9.1",
|
|
47
|
+
"tsc-alias": "^1.8.6",
|
|
48
|
+
"typescript": "^5.1.6"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@medusajs/modules-sdk": "^1.12.4",
|
|
52
|
+
"@medusajs/types": "^1.11.8",
|
|
53
|
+
"@medusajs/utils": "^1.11.1",
|
|
54
|
+
"@mikro-orm/core": "5.9.7",
|
|
55
|
+
"@mikro-orm/migrations": "5.9.7",
|
|
56
|
+
"@mikro-orm/postgresql": "5.9.7",
|
|
57
|
+
"awilix": "^8.0.0",
|
|
58
|
+
"dotenv": "^16.1.4",
|
|
59
|
+
"knex": "2.4.2"
|
|
60
|
+
}
|
|
61
|
+
}
|