@medusajs/fulfillment-manual 0.0.3-snapshot-20240718073308 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
services,
|
3
|
+
var manual_fulfillment_1 = require("./services/manual-fulfillment");
|
4
|
+
var services = [manual_fulfillment_1.ManualFulfillmentService];
|
5
|
+
var providerExport = {
|
6
|
+
services: services,
|
7
7
|
};
|
8
8
|
exports.default = providerExport;
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFDQSxvRUFBd0U7QUFFeEUsSUFBTSxRQUFRLEdBQUcsQ0FBQyw2Q0FBd0IsQ0FBQyxDQUFBO0FBRTNDLElBQU0sY0FBYyxHQUEwQjtJQUM1QyxRQUFRLFVBQUE7Q0FDVCxDQUFBO0FBRUQsa0JBQWUsY0FBYyxDQUFBIn0=
|
@@ -4,9 +4,7 @@ export declare class ManualFulfillmentService extends AbstractFulfillmentProvide
|
|
4
4
|
constructor();
|
5
5
|
getFulfillmentOptions(): Promise<Record<string, unknown>[]>;
|
6
6
|
validateFulfillmentData(optionData: Record<string, unknown>, data: Record<string, unknown>, context: Record<string, unknown>): Promise<any>;
|
7
|
-
validateOption(data: Record<string,
|
8
|
-
createFulfillment(): Promise<Record<string,
|
9
|
-
cancelFulfillment(): Promise<any>;
|
10
|
-
createReturnFulfillment(): Promise<any>;
|
7
|
+
validateOption(data: Record<string, unknown>): Promise<boolean>;
|
8
|
+
createFulfillment(): Promise<Record<string, unknown>>;
|
9
|
+
cancelFulfillment(fulfillment: Record<string, unknown>): Promise<any>;
|
11
10
|
}
|
12
|
-
//# sourceMappingURL=manual-fulfillment.d.ts.map
|
@@ -1,40 +1,110 @@
|
|
1
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
|
+
};
|
2
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
54
|
exports.ManualFulfillmentService = void 0;
|
4
|
-
|
55
|
+
var utils_1 = require("@medusajs/utils");
|
5
56
|
// TODO rework type and DTO's
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
async getFulfillmentOptions() {
|
11
|
-
return [
|
12
|
-
{
|
13
|
-
id: "manual-fulfillment",
|
14
|
-
},
|
15
|
-
{
|
16
|
-
id: "manual-fulfillment-return",
|
17
|
-
is_return: true,
|
18
|
-
},
|
19
|
-
];
|
20
|
-
}
|
21
|
-
async validateFulfillmentData(optionData, data, context) {
|
22
|
-
return data;
|
23
|
-
}
|
24
|
-
async validateOption(data) {
|
25
|
-
return true;
|
26
|
-
}
|
27
|
-
async createFulfillment() {
|
28
|
-
// No data is being sent anywhere
|
29
|
-
return {};
|
30
|
-
}
|
31
|
-
async cancelFulfillment() {
|
32
|
-
return {};
|
33
|
-
}
|
34
|
-
async createReturnFulfillment() {
|
35
|
-
return {};
|
57
|
+
var ManualFulfillmentService = /** @class */ (function (_super) {
|
58
|
+
__extends(ManualFulfillmentService, _super);
|
59
|
+
function ManualFulfillmentService() {
|
60
|
+
return _super.call(this) || this;
|
36
61
|
}
|
37
|
-
|
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));
|
38
109
|
exports.ManualFulfillmentService = ManualFulfillmentService;
|
39
|
-
|
40
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFudWFsLWZ1bGZpbGxtZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NlcnZpY2VzL21hbnVhbC1mdWxmaWxsbWVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwyQ0FBb0U7QUFFcEUsNkJBQTZCO0FBRTdCLE1BQWEsd0JBQXlCLFNBQVEsMENBQWtDO0lBRzlFO1FBQ0UsS0FBSyxFQUFFLENBQUE7SUFDVCxDQUFDO0lBRUQsS0FBSyxDQUFDLHFCQUFxQjtRQUN6QixPQUFPO1lBQ0w7Z0JBQ0UsRUFBRSxFQUFFLG9CQUFvQjthQUN6QjtZQUNEO2dCQUNFLEVBQUUsRUFBRSwyQkFBMkI7Z0JBQy9CLFNBQVMsRUFBRSxJQUFJO2FBQ2hCO1NBQ0YsQ0FBQTtJQUNILENBQUM7SUFFRCxLQUFLLENBQUMsdUJBQXVCLENBQzNCLFVBQW1DLEVBQ25DLElBQTZCLEVBQzdCLE9BQWdDO1FBRWhDLE9BQU8sSUFBSSxDQUFBO0lBQ2IsQ0FBQztJQUVELEtBQUssQ0FBQyxjQUFjLENBQUMsSUFBeUI7UUFD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UFwQixVQUFxQixJQUE2Qjs7O2dCQUNoRCxzQkFBTyxJQUFJLEVBQUE7OztLQUNaO0lBRUssb0RBQWlCLEdBQXZCOzs7Z0JBQ0UsaUNBQWlDO2dCQUNqQyxzQkFBTyxFQUFFLEVBQUE7OztLQUNWO0lBRUssb0RBQWlCLEdBQXZCLFVBQXdCLFdBQW9DOzs7Z0JBQzFELHNCQUFPLEVBQUUsRUFBQTs7O0tBQ1Y7SUFyQ00sbUNBQVUsR0FBRyxRQUFRLENBQUE7SUFzQzlCLCtCQUFDO0NBQUEsQUF2Q0QsQ0FBOEMsMENBQWtDLEdBdUMvRTtBQXZDWSw0REFBd0IifQ==
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@medusajs/fulfillment-manual",
|
3
|
-
"version": "0.0.3
|
3
|
+
"version": "0.0.3",
|
4
4
|
"description": "Manual fulfillment for Medusa",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"repository": {
|
@@ -12,7 +12,7 @@
|
|
12
12
|
"dist"
|
13
13
|
],
|
14
14
|
"engines": {
|
15
|
-
"node": ">=
|
15
|
+
"node": ">=16"
|
16
16
|
},
|
17
17
|
"author": "Medusa",
|
18
18
|
"license": "MIT",
|
@@ -24,12 +24,12 @@
|
|
24
24
|
},
|
25
25
|
"devDependencies": {
|
26
26
|
"cross-env": "^5.2.1",
|
27
|
-
"jest": "^
|
27
|
+
"jest": "^25.5.4",
|
28
28
|
"rimraf": "^5.0.1",
|
29
|
-
"typescript": "^
|
29
|
+
"typescript": "^4.9.5"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@medusajs/utils": "1.
|
32
|
+
"@medusajs/utils": "^1.11.10",
|
33
33
|
"body-parser": "^1.19.0",
|
34
34
|
"express": "^4.17.1"
|
35
35
|
},
|
package/dist/index.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAKvD,QAAA,MAAM,cAAc,EAAE,qBAErB,CAAA;AAED,eAAe,cAAc,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"manual-fulfillment.d.ts","sourceRoot":"","sources":["../../src/services/manual-fulfillment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,iBAAiB,CAAA;AAIpE,qBAAa,wBAAyB,SAAQ,kCAAkC;IAC9E,MAAM,CAAC,UAAU,SAAW;;IAMtB,qBAAqB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAY3D,uBAAuB,CAC3B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,GAAG,CAAC;IAIT,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAI3D,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAKjD,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC;IAIjC,uBAAuB,IAAI,OAAO,CAAC,GAAG,CAAC;CAG9C"}
|