@medusajs/fulfillment-manual 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
File without changes
@@ -0,0 +1,3 @@
1
+ import { ModuleProviderExports } from "@medusajs/types";
2
+ declare const providerExport: ModuleProviderExports;
3
+ export default providerExport;
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var manual_fulfillment_1 = require("./services/manual-fulfillment");
4
+ var services = [manual_fulfillment_1.ManualFulfillmentService];
5
+ var providerExport = {
6
+ services: services,
7
+ };
8
+ exports.default = providerExport;
9
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFDQSxvRUFBd0U7QUFFeEUsSUFBTSxRQUFRLEdBQUcsQ0FBQyw2Q0FBd0IsQ0FBQyxDQUFBO0FBRTNDLElBQU0sY0FBYyxHQUEwQjtJQUM1QyxRQUFRLFVBQUE7Q0FDVCxDQUFBO0FBRUQsa0JBQWUsY0FBYyxDQUFBIn0=
@@ -0,0 +1,10 @@
1
+ import { AbstractFulfillmentProviderService } from "@medusajs/utils";
2
+ export declare class ManualFulfillmentService extends AbstractFulfillmentProviderService {
3
+ static identifier: string;
4
+ constructor();
5
+ getFulfillmentOptions(): Promise<Record<string, unknown>[]>;
6
+ validateFulfillmentData(optionData: Record<string, unknown>, data: Record<string, unknown>, context: Record<string, unknown>): Promise<any>;
7
+ validateOption(data: Record<string, unknown>): Promise<boolean>;
8
+ createFulfillment(): Promise<Record<string, unknown>>;
9
+ cancelFulfillment(fulfillment: Record<string, unknown>): Promise<any>;
10
+ }
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ exports.ManualFulfillmentService = void 0;
55
+ var utils_1 = require("@medusajs/utils");
56
+ // TODO rework type and DTO's
57
+ var ManualFulfillmentService = /** @class */ (function (_super) {
58
+ __extends(ManualFulfillmentService, _super);
59
+ function ManualFulfillmentService() {
60
+ return _super.call(this) || this;
61
+ }
62
+ ManualFulfillmentService.prototype.getFulfillmentOptions = function () {
63
+ return __awaiter(this, void 0, void 0, function () {
64
+ return __generator(this, function (_a) {
65
+ return [2 /*return*/, [
66
+ {
67
+ id: "manual-fulfillment",
68
+ },
69
+ {
70
+ id: "manual-fulfillment-return",
71
+ is_return: true,
72
+ },
73
+ ]];
74
+ });
75
+ });
76
+ };
77
+ ManualFulfillmentService.prototype.validateFulfillmentData = function (optionData, data, context) {
78
+ return __awaiter(this, void 0, void 0, function () {
79
+ return __generator(this, function (_a) {
80
+ return [2 /*return*/, data];
81
+ });
82
+ });
83
+ };
84
+ ManualFulfillmentService.prototype.validateOption = function (data) {
85
+ return __awaiter(this, void 0, void 0, function () {
86
+ return __generator(this, function (_a) {
87
+ return [2 /*return*/, true];
88
+ });
89
+ });
90
+ };
91
+ ManualFulfillmentService.prototype.createFulfillment = function () {
92
+ return __awaiter(this, void 0, void 0, function () {
93
+ return __generator(this, function (_a) {
94
+ // No data is being sent anywhere
95
+ return [2 /*return*/, {}];
96
+ });
97
+ });
98
+ };
99
+ ManualFulfillmentService.prototype.cancelFulfillment = function (fulfillment) {
100
+ return __awaiter(this, void 0, void 0, function () {
101
+ return __generator(this, function (_a) {
102
+ return [2 /*return*/, {}];
103
+ });
104
+ });
105
+ };
106
+ ManualFulfillmentService.identifier = "manual";
107
+ return ManualFulfillmentService;
108
+ }(utils_1.AbstractFulfillmentProviderService));
109
+ exports.ManualFulfillmentService = ManualFulfillmentService;
110
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFudWFsLWZ1bGZpbGxtZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NlcnZpY2VzL21hbnVhbC1mdWxmaWxsbWVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSx5Q0FBb0U7QUFFcEUsNkJBQTZCO0FBRTdCO0lBQThDLDRDQUFrQztJQUc5RTtlQUNFLGlCQUFPO0lBQ1QsQ0FBQztJQUVLLHdEQUFxQixHQUEzQjs7O2dCQUNFLHNCQUFPO3dCQUNMOzRCQUNFLEVBQUUsRUFBRSxvQkFBb0I7eUJBQ3pCO3dCQUNEOzRCQUNFLEVBQUUsRUFBRSwyQkFBMkI7NEJBQy9CLFNBQVMsRUFBRSxJQUFJO3lCQUNoQjtxQkFDRixFQUFBOzs7S0FDRjtJQUVLLDBEQUF1QixHQUE3QixVQUNFLFVBQW1DLEVBQ25DLElBQTZCLEVBQzdCLE9BQWdDOzs7Z0JBRWhDLHNCQUFPLElBQUksRUFBQTs7O0tBQ1o7SUFFSyxpREFBYyxHQUFwQixVQUFxQixJQUE2Qjs7O2dCQUNoRCxzQkFBTyxJQUFJLEVBQUE7OztLQUNaO0lBRUssb0RBQWlCLEdBQXZCOzs7Z0JBQ0UsaUNBQWlDO2dCQUNqQyxzQkFBTyxFQUFFLEVBQUE7OztLQUNWO0lBRUssb0RBQWlCLEdBQXZCLFVBQXdCLFdBQW9DOzs7Z0JBQzFELHNCQUFPLEVBQUUsRUFBQTs7O0tBQ1Y7SUFyQ00sbUNBQVUsR0FBRyxRQUFRLENBQUE7SUFzQzlCLCtCQUFDO0NBQUEsQUF2Q0QsQ0FBOEMsMENBQWtDLEdBdUMvRTtBQXZDWSw0REFBd0IifQ==
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@medusajs/fulfillment-manual",
3
+ "version": "0.0.1",
4
+ "description": "Manual fulfillment for Medusa",
5
+ "main": "dist/index.js",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/medusajs/medusa",
9
+ "directory": "packages/fulfillment-manual"
10
+ },
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "engines": {
15
+ "node": ">=16"
16
+ },
17
+ "author": "Medusa",
18
+ "license": "MIT",
19
+ "scripts": {
20
+ "prepublishOnly": "cross-env NODE_ENV=production tsc --build",
21
+ "test": "jest --passWithNoTests src",
22
+ "build": "rimraf dist && tsc -p ./tsconfig.json",
23
+ "watch": "tsc --watch"
24
+ },
25
+ "devDependencies": {
26
+ "cross-env": "^5.2.1",
27
+ "jest": "^25.5.4",
28
+ "rimraf": "^5.0.1",
29
+ "typescript": "^4.9.5"
30
+ },
31
+ "dependencies": {
32
+ "@medusajs/utils": "^1.11.3",
33
+ "body-parser": "^1.19.0",
34
+ "express": "^4.17.1"
35
+ },
36
+ "keywords": [
37
+ "medusa-plugin",
38
+ "medusa-plugin-fulfillment"
39
+ ]
40
+ }