@medusajs/fulfillment-manual 0.0.3 → 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 CHANGED
@@ -1,3 +1,4 @@
1
- import { ModuleProviderExports } from "@medusajs/types";
1
+ import { ModuleProviderExports } from "@medusajs/framework/types";
2
2
  declare const providerExport: ModuleProviderExports;
3
3
  export default providerExport;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAKjE,QAAA,MAAM,cAAc,EAAE,qBAErB,CAAA;AAED,eAAe,cAAc,CAAA"}
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
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,
3
+ const manual_fulfillment_1 = require("./services/manual-fulfillment");
4
+ const services = [manual_fulfillment_1.ManualFulfillmentService];
5
+ const providerExport = {
6
+ services,
7
7
  };
8
8
  exports.default = providerExport;
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFDQSxvRUFBd0U7QUFFeEUsSUFBTSxRQUFRLEdBQUcsQ0FBQyw2Q0FBd0IsQ0FBQyxDQUFBO0FBRTNDLElBQU0sY0FBYyxHQUEwQjtJQUM1QyxRQUFRLFVBQUE7Q0FDVCxDQUFBO0FBRUQsa0JBQWUsY0FBYyxDQUFBIn0=
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA,sEAAwE;AAExE,MAAM,QAAQ,GAAG,CAAC,6CAAwB,CAAC,CAAA;AAE3C,MAAM,cAAc,GAA0B;IAC5C,QAAQ;CACT,CAAA;AAED,kBAAe,cAAc,CAAA"}
@@ -1,10 +1,12 @@
1
- import { AbstractFulfillmentProviderService } from "@medusajs/utils";
1
+ import { AbstractFulfillmentProviderService } from "@medusajs/framework/utils";
2
2
  export declare class ManualFulfillmentService extends AbstractFulfillmentProviderService {
3
3
  static identifier: string;
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, unknown>): Promise<boolean>;
8
- createFulfillment(): Promise<Record<string, unknown>>;
9
- cancelFulfillment(fulfillment: Record<string, unknown>): Promise<any>;
7
+ validateOption(data: Record<string, any>): Promise<boolean>;
8
+ createFulfillment(): Promise<Record<string, any>>;
9
+ cancelFulfillment(): Promise<any>;
10
+ createReturnFulfillment(): Promise<any>;
10
11
  }
12
+ //# sourceMappingURL=manual-fulfillment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manual-fulfillment.d.ts","sourceRoot":"","sources":["../../src/services/manual-fulfillment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAA;AAI9E,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"}
@@ -1,110 +1,40 @@
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
- };
53
2
  Object.defineProperty(exports, "__esModule", { value: true });
54
3
  exports.ManualFulfillmentService = void 0;
55
- var utils_1 = require("@medusajs/utils");
4
+ const utils_1 = require("@medusajs/framework/utils");
56
5
  // 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;
6
+ class ManualFulfillmentService extends utils_1.AbstractFulfillmentProviderService {
7
+ constructor() {
8
+ super();
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 {};
61
36
  }
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));
37
+ }
109
38
  exports.ManualFulfillmentService = ManualFulfillmentService;
110
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFudWFsLWZ1bGZpbGxtZW50LmpzIiwic291cmNl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
+ {"version":3,"file":"manual-fulfillment.js","sourceRoot":"","sources":["../../src/services/manual-fulfillment.ts"],"names":[],"mappings":";;;AAAA,qDAA8E;AAE9E,6BAA6B;AAE7B,MAAa,wBAAyB,SAAQ,0CAAkC;IAG9E;QACE,KAAK,EAAE,CAAA;IACT,CAAC;IAED,KAAK,CAAC,qBAAqB;QACzB,OAAO;YACL;gBACE,EAAE,EAAE,oBAAoB;aACzB;YACD;gBACE,EAAE,EAAE,2BAA2B;gBAC/B,SAAS,EAAE,IAAI;aAChB;SACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,uBAAuB,CAC3B,UAAmC,EACnC,IAA6B,EAC7B,OAAgC;QAEhC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,IAAyB;QAC5C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,iCAAiC;QACjC,OAAO,EAAE,CAAA;IACX,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,OAAO,EAAE,CAAA;IACX,CAAC;IAED,KAAK,CAAC,uBAAuB;QAC3B,OAAO,EAAE,CAAA;IACX,CAAC;;AA1CH,4DA2CC;AA1CQ,mCAAU,GAAG,QAAQ,CAAA"}
@@ -0,0 +1 @@
1
+ {"root":["../src/index.ts","../src/services/manual-fulfillment.ts"],"version":"5.6.2"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/fulfillment-manual",
3
- "version": "0.0.3",
3
+ "version": "1.0.0-rc-20241001083650",
4
4
  "description": "Manual fulfillment for Medusa",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -9,29 +9,31 @@
9
9
  "directory": "packages/fulfillment-manual"
10
10
  },
11
11
  "files": [
12
- "dist"
12
+ "dist",
13
+ "!dist/**/__tests__",
14
+ "!dist/**/__mocks__",
15
+ "!dist/**/__fixtures__"
13
16
  ],
14
17
  "engines": {
15
- "node": ">=16"
18
+ "node": ">=20"
16
19
  },
17
20
  "author": "Medusa",
18
21
  "license": "MIT",
19
22
  "scripts": {
20
- "prepublishOnly": "cross-env NODE_ENV=production tsc --build",
21
23
  "test": "jest --passWithNoTests src",
22
- "build": "rimraf dist && tsc -p ./tsconfig.json",
24
+ "build": "rimraf dist && tsc --build ./tsconfig.json",
23
25
  "watch": "tsc --watch"
24
26
  },
25
27
  "devDependencies": {
26
- "cross-env": "^5.2.1",
27
- "jest": "^25.5.4",
28
+ "@medusajs/framework": "1.0.0-rc-20241001083650",
29
+ "@swc/core": "^1.7.28",
30
+ "@swc/jest": "^0.2.36",
31
+ "jest": "^29.7.0",
28
32
  "rimraf": "^5.0.1",
29
- "typescript": "^4.9.5"
33
+ "typescript": "^5.6.2"
30
34
  },
31
- "dependencies": {
32
- "@medusajs/utils": "^1.11.10",
33
- "body-parser": "^1.19.0",
34
- "express": "^4.17.1"
35
+ "peerDependencies": {
36
+ "@medusajs/framework": "1.0.0-rc-20241001083650"
35
37
  },
36
38
  "keywords": [
37
39
  "medusa-plugin",