medusa-interfaces
Advanced tools
Comparing version 1.3.8-next-20230530075345 to 1.3.8-snapshot-20231221111816
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -9,17 +8,9 @@ value: true | ||
exports["default"] = void 0; | ||
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); | ||
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); | ||
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _utils = require("@medusajs/medusa/dist/utils"); | ||
// Import from dist to avoid circular deps which result in the base service to be undefined | ||
/** | ||
@@ -35,3 +26,2 @@ * Common functionality for Services | ||
} | ||
(0, _createClass2["default"])(BaseService, [{ | ||
@@ -43,6 +33,6 @@ key: "withTransaction", | ||
} | ||
/** | ||
* Used to build TypeORM queries. | ||
*/ | ||
}, { | ||
@@ -54,2 +44,3 @@ key: "buildQuery_", | ||
} | ||
/** | ||
@@ -63,3 +54,2 @@ * Confirms whether a given raw id is valid. Fails if the provided | ||
*/ | ||
}, { | ||
@@ -77,2 +67,3 @@ key: "validateId_", | ||
} | ||
/** | ||
@@ -86,3 +77,2 @@ * Wraps some work within a transactional block. If the service already has | ||
*/ | ||
}, { | ||
@@ -93,211 +83,162 @@ key: "atomicPhase_", | ||
var _this = this; | ||
var errorHandler, isolation, dontFail, doWork, temp, _doWork, result, _result; | ||
return _regenerator["default"].wrap(function _callee3$(_context3) { | ||
while (1) { | ||
switch (_context3.prev = _context3.next) { | ||
case 0: | ||
errorHandler = maybeErrorHandlerOrDontFail; | ||
isolation = isolationOrErrorHandler; | ||
dontFail = false; | ||
if (typeof isolationOrErrorHandler === "function") { | ||
isolation = null; | ||
errorHandler = isolationOrErrorHandler; | ||
dontFail = !!maybeErrorHandlerOrDontFail; | ||
} | ||
if (!this.transactionManager_) { | ||
_context3.next = 9; | ||
break; | ||
} | ||
doWork = /*#__PURE__*/function () { | ||
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(m) { | ||
var result, queryRunner; | ||
return _regenerator["default"].wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
_this.manager_ = m; | ||
_this.transactionManager_ = m; | ||
_context.prev = 2; | ||
_context.next = 5; | ||
return work(m); | ||
case 5: | ||
result = _context.sent; | ||
return _context.abrupt("return", result); | ||
case 9: | ||
_context.prev = 9; | ||
_context.t0 = _context["catch"](2); | ||
if (!errorHandler) { | ||
_context.next = 18; | ||
break; | ||
} | ||
queryRunner = _this.transactionManager_.queryRunner; | ||
if (!queryRunner.isTransactionActive) { | ||
_context.next = 16; | ||
break; | ||
} | ||
_context.next = 16; | ||
return queryRunner.rollbackTransaction(); | ||
case 16: | ||
_context.next = 18; | ||
return errorHandler(_context.t0); | ||
case 18: | ||
throw _context.t0; | ||
case 19: | ||
case "end": | ||
return _context.stop(); | ||
while (1) switch (_context3.prev = _context3.next) { | ||
case 0: | ||
errorHandler = maybeErrorHandlerOrDontFail; | ||
isolation = isolationOrErrorHandler; | ||
dontFail = false; | ||
if (typeof isolationOrErrorHandler === "function") { | ||
isolation = null; | ||
errorHandler = isolationOrErrorHandler; | ||
dontFail = !!maybeErrorHandlerOrDontFail; | ||
} | ||
if (!this.transactionManager_) { | ||
_context3.next = 9; | ||
break; | ||
} | ||
doWork = /*#__PURE__*/function () { | ||
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(m) { | ||
var result, queryRunner; | ||
return _regenerator["default"].wrap(function _callee$(_context) { | ||
while (1) switch (_context.prev = _context.next) { | ||
case 0: | ||
_this.manager_ = m; | ||
_this.transactionManager_ = m; | ||
_context.prev = 2; | ||
_context.next = 5; | ||
return work(m); | ||
case 5: | ||
result = _context.sent; | ||
return _context.abrupt("return", result); | ||
case 9: | ||
_context.prev = 9; | ||
_context.t0 = _context["catch"](2); | ||
if (!errorHandler) { | ||
_context.next = 18; | ||
break; | ||
} | ||
} | ||
}, _callee, null, [[2, 9]]); | ||
})); | ||
return function doWork(_x4) { | ||
return _ref.apply(this, arguments); | ||
}; | ||
}(); | ||
return _context3.abrupt("return", doWork(this.transactionManager_)); | ||
case 9: | ||
temp = this.manager_; | ||
_doWork = /*#__PURE__*/function () { | ||
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(m) { | ||
var result; | ||
return _regenerator["default"].wrap(function _callee2$(_context2) { | ||
while (1) { | ||
switch (_context2.prev = _context2.next) { | ||
case 0: | ||
_this.manager_ = m; | ||
_this.transactionManager_ = m; | ||
_context2.prev = 2; | ||
_context2.next = 5; | ||
return work(m); | ||
case 5: | ||
result = _context2.sent; | ||
_this.manager_ = temp; | ||
_this.transactionManager_ = undefined; | ||
return _context2.abrupt("return", result); | ||
case 11: | ||
_context2.prev = 11; | ||
_context2.t0 = _context2["catch"](2); | ||
_this.manager_ = temp; | ||
_this.transactionManager_ = undefined; | ||
throw _context2.t0; | ||
case 16: | ||
case "end": | ||
return _context2.stop(); | ||
queryRunner = _this.transactionManager_.queryRunner; | ||
if (!queryRunner.isTransactionActive) { | ||
_context.next = 16; | ||
break; | ||
} | ||
} | ||
}, _callee2, null, [[2, 11]]); | ||
})); | ||
return function _doWork(_x5) { | ||
return _ref2.apply(this, arguments); | ||
}; | ||
}(); | ||
if (!isolation) { | ||
_context3.next = 29; | ||
break; | ||
} | ||
_context3.prev = 12; | ||
_context3.next = 15; | ||
return this.manager_.transaction(isolation, function (m) { | ||
return _doWork(m); | ||
}); | ||
case 15: | ||
result = _context3.sent; | ||
return _context3.abrupt("return", result); | ||
case 19: | ||
_context3.prev = 19; | ||
_context3.t0 = _context3["catch"](12); | ||
if (!this.shouldRetryTransaction(_context3.t0)) { | ||
_context3.next = 25; | ||
break; | ||
} | ||
return _context3.abrupt("return", this.manager_.transaction(isolation, function (m) { | ||
return _doWork(m); | ||
_context.next = 16; | ||
return queryRunner.rollbackTransaction(); | ||
case 16: | ||
_context.next = 18; | ||
return errorHandler(_context.t0); | ||
case 18: | ||
throw _context.t0; | ||
case 19: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
}, _callee, null, [[2, 9]]); | ||
})); | ||
case 25: | ||
if (!errorHandler) { | ||
_context3.next = 28; | ||
break; | ||
} | ||
return function doWork(_x4) { | ||
return _ref.apply(this, arguments); | ||
}; | ||
}(); | ||
return _context3.abrupt("return", doWork(this.transactionManager_)); | ||
case 9: | ||
temp = this.manager_; | ||
_doWork = /*#__PURE__*/function () { | ||
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(m) { | ||
var result; | ||
return _regenerator["default"].wrap(function _callee2$(_context2) { | ||
while (1) switch (_context2.prev = _context2.next) { | ||
case 0: | ||
_this.manager_ = m; | ||
_this.transactionManager_ = m; | ||
_context2.prev = 2; | ||
_context2.next = 5; | ||
return work(m); | ||
case 5: | ||
result = _context2.sent; | ||
_this.manager_ = temp; | ||
_this.transactionManager_ = undefined; | ||
return _context2.abrupt("return", result); | ||
case 11: | ||
_context2.prev = 11; | ||
_context2.t0 = _context2["catch"](2); | ||
_this.manager_ = temp; | ||
_this.transactionManager_ = undefined; | ||
throw _context2.t0; | ||
case 16: | ||
case "end": | ||
return _context2.stop(); | ||
} | ||
}, _callee2, null, [[2, 11]]); | ||
})); | ||
return function _doWork(_x5) { | ||
return _ref2.apply(this, arguments); | ||
}; | ||
}(); | ||
if (!isolation) { | ||
_context3.next = 29; | ||
break; | ||
} | ||
_context3.prev = 12; | ||
_context3.next = 15; | ||
return this.manager_.transaction(isolation, function (m) { | ||
return _doWork(m); | ||
}); | ||
case 15: | ||
result = _context3.sent; | ||
return _context3.abrupt("return", result); | ||
case 19: | ||
_context3.prev = 19; | ||
_context3.t0 = _context3["catch"](12); | ||
if (!this.shouldRetryTransaction(_context3.t0)) { | ||
_context3.next = 25; | ||
break; | ||
} | ||
return _context3.abrupt("return", this.manager_.transaction(isolation, function (m) { | ||
return _doWork(m); | ||
})); | ||
case 25: | ||
if (!errorHandler) { | ||
_context3.next = 28; | ||
return errorHandler(_context3.t0); | ||
case 28: | ||
throw _context3.t0; | ||
case 29: | ||
_context3.prev = 29; | ||
_context3.next = 32; | ||
return this.manager_.transaction(function (m) { | ||
return _doWork(m); | ||
}); | ||
case 32: | ||
return _context3.abrupt("return", _context3.sent); | ||
case 35: | ||
_context3.prev = 35; | ||
_context3.t1 = _context3["catch"](29); | ||
if (!errorHandler) { | ||
_context3.next = 43; | ||
break; | ||
} | ||
_context3.next = 40; | ||
return errorHandler(_context3.t1); | ||
case 40: | ||
_result = _context3.sent; | ||
if (!dontFail) { | ||
_context3.next = 43; | ||
break; | ||
} | ||
return _context3.abrupt("return", _result); | ||
case 43: | ||
throw _context3.t1; | ||
case 44: | ||
case "end": | ||
return _context3.stop(); | ||
} | ||
break; | ||
} | ||
_context3.next = 28; | ||
return errorHandler(_context3.t0); | ||
case 28: | ||
throw _context3.t0; | ||
case 29: | ||
_context3.prev = 29; | ||
_context3.next = 32; | ||
return this.manager_.transaction(function (m) { | ||
return _doWork(m); | ||
}); | ||
case 32: | ||
return _context3.abrupt("return", _context3.sent); | ||
case 35: | ||
_context3.prev = 35; | ||
_context3.t1 = _context3["catch"](29); | ||
if (!errorHandler) { | ||
_context3.next = 43; | ||
break; | ||
} | ||
_context3.next = 40; | ||
return errorHandler(_context3.t1); | ||
case 40: | ||
_result = _context3.sent; | ||
if (!dontFail) { | ||
_context3.next = 43; | ||
break; | ||
} | ||
return _context3.abrupt("return", _result); | ||
case 43: | ||
throw _context3.t1; | ||
case 44: | ||
case "end": | ||
return _context3.stop(); | ||
} | ||
}, _callee3, this, [[12, 19], [29, 35]]); | ||
})); | ||
function atomicPhase_(_x, _x2, _x3) { | ||
return _atomicPhase_.apply(this, arguments); | ||
} | ||
return atomicPhase_; | ||
@@ -311,3 +252,2 @@ }() | ||
*/ | ||
}, { | ||
@@ -318,2 +258,3 @@ key: "setMetadata_", | ||
} | ||
/** | ||
@@ -324,3 +265,2 @@ * Adds a decorator to a service. The decorator must be a function and should | ||
*/ | ||
}, { | ||
@@ -332,5 +272,5 @@ key: "addDecorator", | ||
} | ||
this.decorators_.push(fn); | ||
} | ||
/** | ||
@@ -343,3 +283,2 @@ * Runs the decorators registered on the service. The decorators are run in | ||
*/ | ||
}, { | ||
@@ -353,19 +292,15 @@ key: "runDecorators_", | ||
return _regenerator["default"].wrap(function _callee4$(_context4) { | ||
while (1) { | ||
switch (_context4.prev = _context4.next) { | ||
case 0: | ||
return _context4.abrupt("return", acc.then(function (res) { | ||
return next(res, fields, expandFields); | ||
})["catch"](function () { | ||
return acc; | ||
})); | ||
case 1: | ||
case "end": | ||
return _context4.stop(); | ||
} | ||
while (1) switch (_context4.prev = _context4.next) { | ||
case 0: | ||
return _context4.abrupt("return", acc.then(function (res) { | ||
return next(res, fields, expandFields); | ||
})["catch"](function () { | ||
return acc; | ||
})); | ||
case 1: | ||
case "end": | ||
return _context4.stop(); | ||
} | ||
}, _callee4); | ||
})); | ||
return function (_x6, _x7) { | ||
@@ -379,3 +314,2 @@ return _ref3.apply(this, arguments); | ||
}(); | ||
exports["default"] = BaseService; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -9,28 +8,19 @@ value: true | ||
exports["default"] = void 0; | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _baseService = _interopRequireDefault(require("./base-service")); | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
/** | ||
* Interface for file connectors | ||
* @interface | ||
* @deprecated use AbstractFileService from @medusajs/medusa instead | ||
*/ | ||
var BaseFileService = /*#__PURE__*/function (_BaseService) { | ||
(0, _inherits2["default"])(BaseFileService, _BaseService); | ||
var _super = _createSuper(BaseFileService); | ||
function BaseFileService() { | ||
@@ -40,3 +30,2 @@ (0, _classCallCheck2["default"])(this, BaseFileService); | ||
} | ||
(0, _createClass2["default"])(BaseFileService, [{ | ||
@@ -52,7 +41,13 @@ key: "upload", | ||
} | ||
}], [{ | ||
key: "isFileService", | ||
value: function isFileService(obj) { | ||
var _obj$constructor; | ||
return obj === null || obj === void 0 ? void 0 : (_obj$constructor = obj.constructor) === null || _obj$constructor === void 0 ? void 0 : _obj$constructor._isFileService; | ||
} | ||
}]); | ||
return BaseFileService; | ||
}(_baseService["default"]); | ||
(0, _defineProperty2["default"])(BaseFileService, "_isFileService", true); | ||
var _default = BaseFileService; | ||
exports["default"] = _default; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -9,19 +8,11 @@ value: true | ||
exports["default"] = void 0; | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _baseService = _interopRequireDefault(require("./base-service")); | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
/** | ||
@@ -32,8 +23,7 @@ * The interface that all fulfillment services must inherit from. The intercace | ||
* @interface | ||
* @deprecated use AbstractFulfillmentService from @medusajs/medusa instead | ||
*/ | ||
var BaseFulfillmentService = /*#__PURE__*/function (_BaseService) { | ||
(0, _inherits2["default"])(BaseFulfillmentService, _BaseService); | ||
var _super = _createSuper(BaseFulfillmentService); | ||
function BaseFulfillmentService() { | ||
@@ -43,3 +33,2 @@ (0, _classCallCheck2["default"])(this, BaseFulfillmentService); | ||
} | ||
(0, _createClass2["default"])(BaseFulfillmentService, [{ | ||
@@ -50,2 +39,3 @@ key: "getIdentifier", | ||
} | ||
/** | ||
@@ -60,3 +50,2 @@ * Called before a shipping option is created in Admin. The method should | ||
*/ | ||
}, { | ||
@@ -67,2 +56,3 @@ key: "getFulfillmentOptions", | ||
} | ||
/** | ||
@@ -80,3 +70,2 @@ * Called before a shipping method is set on a cart to ensure that the data | ||
*/ | ||
}, { | ||
@@ -87,2 +76,3 @@ key: "validateFulfillmentData", | ||
} | ||
/** | ||
@@ -92,3 +82,2 @@ * Called before a shipping option is created in Admin. Use this to ensure | ||
*/ | ||
}, { | ||
@@ -104,6 +93,6 @@ key: "validateOption", | ||
} | ||
/** | ||
* Used to calculate a price for a given shipping option. | ||
*/ | ||
}, { | ||
@@ -124,2 +113,3 @@ key: "calculatePrice", | ||
} | ||
/** | ||
@@ -129,3 +119,2 @@ * Used to retrieve documents associated with a fulfillment. | ||
*/ | ||
}, { | ||
@@ -136,2 +125,3 @@ key: "getFulfillmentDocuments", | ||
} | ||
/** | ||
@@ -142,3 +132,2 @@ * Used to create a return order. Should return the data necessary for future | ||
*/ | ||
}, { | ||
@@ -149,6 +138,6 @@ key: "createReturn", | ||
} | ||
/** | ||
* Used to retrieve documents related to a return order. | ||
*/ | ||
}, { | ||
@@ -159,6 +148,6 @@ key: "getReturnDocuments", | ||
} | ||
/** | ||
* Used to retrieve documents related to a shipment. | ||
*/ | ||
}, { | ||
@@ -174,7 +163,13 @@ key: "getShipmentDocuments", | ||
} | ||
}], [{ | ||
key: "isFulfillmentService", | ||
value: function isFulfillmentService(obj) { | ||
var _obj$constructor; | ||
return obj === null || obj === void 0 ? void 0 : (_obj$constructor = obj.constructor) === null || _obj$constructor === void 0 ? void 0 : _obj$constructor._isFulfillmentService; | ||
} | ||
}]); | ||
return BaseFulfillmentService; | ||
}(_baseService["default"]); | ||
(0, _defineProperty2["default"])(BaseFulfillmentService, "_isFulfillmentService", true); | ||
var _default = BaseFulfillmentService; | ||
exports["default"] = _default; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -50,15 +49,8 @@ value: true | ||
}); | ||
var _baseService = _interopRequireDefault(require("./base-service")); | ||
var _paymentService = _interopRequireDefault(require("./payment-service")); | ||
var _fulfillmentService = _interopRequireDefault(require("./fulfillment-service")); | ||
var _fileService = _interopRequireDefault(require("./file-service")); | ||
var _notificationService = _interopRequireDefault(require("./notification-service")); | ||
var _oauthService = _interopRequireDefault(require("./oauth-service")); | ||
var _searchService = _interopRequireDefault(require("./search-service")); |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -9,28 +8,19 @@ value: true | ||
exports["default"] = void 0; | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _baseService = _interopRequireDefault(require("./base-service")); | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
/** | ||
* Interface for Notification Providers | ||
* @interface | ||
* @deprecated use AbstractNotificationService from @medusajs/medusa instead | ||
*/ | ||
var BaseNotificationService = /*#__PURE__*/function (_BaseService) { | ||
(0, _inherits2["default"])(BaseNotificationService, _BaseService); | ||
var _super = _createSuper(BaseNotificationService); | ||
function BaseNotificationService() { | ||
@@ -40,3 +30,2 @@ (0, _classCallCheck2["default"])(this, BaseNotificationService); | ||
} | ||
(0, _createClass2["default"])(BaseNotificationService, [{ | ||
@@ -47,6 +36,6 @@ key: "getIdentifier", | ||
} | ||
/** | ||
* Used to retrieve documents related to a shipment. | ||
*/ | ||
}, { | ||
@@ -63,7 +52,13 @@ key: "sendNotification", | ||
} | ||
}], [{ | ||
key: "isNotificationService", | ||
value: function isNotificationService(obj) { | ||
var _obj$constructor; | ||
return obj === null || obj === void 0 ? void 0 : (_obj$constructor = obj.constructor) === null || _obj$constructor === void 0 ? void 0 : _obj$constructor._isNotificationService; | ||
} | ||
}]); | ||
return BaseNotificationService; | ||
}(_baseService["default"]); | ||
(0, _defineProperty2["default"])(BaseNotificationService, "_isNotificationService", true); | ||
var _default = BaseNotificationService; | ||
exports["default"] = _default; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -9,19 +8,11 @@ value: true | ||
exports["default"] = void 0; | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _baseService = _interopRequireDefault(require("./base-service")); | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
/** | ||
@@ -33,5 +24,3 @@ * Interface for file connectors | ||
(0, _inherits2["default"])(BaseOauthService, _BaseService); | ||
var _super = _createSuper(BaseOauthService); | ||
function BaseOauthService() { | ||
@@ -41,3 +30,2 @@ (0, _classCallCheck2["default"])(this, BaseOauthService); | ||
} | ||
(0, _createClass2["default"])(BaseOauthService, [{ | ||
@@ -58,7 +46,13 @@ key: "generateToken", | ||
} | ||
}], [{ | ||
key: "isOauthService", | ||
value: function isOauthService(obj) { | ||
var _obj$constructor; | ||
return obj === null || obj === void 0 ? void 0 : (_obj$constructor = obj.constructor) === null || _obj$constructor === void 0 ? void 0 : _obj$constructor._isOauthService; | ||
} | ||
}]); | ||
return BaseOauthService; | ||
}(_baseService["default"]); | ||
(0, _defineProperty2["default"])(BaseOauthService, "_isOauthService", true); | ||
var _default = BaseOauthService; | ||
exports["default"] = _default; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -9,19 +8,11 @@ value: true | ||
exports["default"] = void 0; | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _baseService = _interopRequireDefault(require("./base-service")); | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
/** | ||
@@ -32,8 +23,7 @@ * The interface that all payment services must inherit from. The intercace | ||
* @interface | ||
* @deprecated use AbstractPaymentProcessor from @medusajs/medusa instead | ||
*/ | ||
var BasePaymentService = /*#__PURE__*/function (_BaseService) { | ||
(0, _inherits2["default"])(BasePaymentService, _BaseService); | ||
var _super = _createSuper(BasePaymentService); | ||
function BasePaymentService() { | ||
@@ -43,3 +33,2 @@ (0, _classCallCheck2["default"])(this, BasePaymentService); | ||
} | ||
(0, _createClass2["default"])(BasePaymentService, [{ | ||
@@ -50,2 +39,3 @@ key: "getIdentifier", | ||
} | ||
/** | ||
@@ -58,3 +48,2 @@ * Used to create a payment to be processed with the service's payment gateway. | ||
*/ | ||
}, { | ||
@@ -65,2 +54,3 @@ key: "createPayment", | ||
} | ||
/** | ||
@@ -72,3 +62,2 @@ * Used to retrieve a payment. | ||
*/ | ||
}, { | ||
@@ -79,2 +68,3 @@ key: "retrievePayment", | ||
} | ||
/** | ||
@@ -86,3 +76,2 @@ * Used to update a payment. This method is called when the cart is updated. | ||
*/ | ||
}, { | ||
@@ -118,2 +107,3 @@ key: "updatePayment", | ||
} | ||
/** | ||
@@ -123,3 +113,2 @@ * If the payment provider can save a payment method this function will | ||
*/ | ||
}, { | ||
@@ -130,7 +119,13 @@ key: "retrieveSavedMethods", | ||
} | ||
}], [{ | ||
key: "isPaymentService", | ||
value: function isPaymentService(obj) { | ||
var _obj$constructor; | ||
return obj === null || obj === void 0 ? void 0 : (_obj$constructor = obj.constructor) === null || _obj$constructor === void 0 ? void 0 : _obj$constructor._isPaymentService; | ||
} | ||
}]); | ||
return BasePaymentService; | ||
}(_baseService["default"]); | ||
(0, _defineProperty2["default"])(BasePaymentService, "_isPaymentService", true); | ||
var _default = BasePaymentService; | ||
exports["default"] = _default; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -9,28 +8,19 @@ value: true | ||
exports["default"] = void 0; | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _baseService = _interopRequireDefault(require("./base-service")); | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
/** | ||
* The interface that all search services must implement. | ||
* @interface | ||
* @deprecated use AbstractSearchService from @medusajs/utils instead | ||
*/ | ||
var SearchService = /*#__PURE__*/function (_BaseService) { | ||
(0, _inherits2["default"])(SearchService, _BaseService); | ||
var _super = _createSuper(SearchService); | ||
function SearchService() { | ||
@@ -40,3 +30,2 @@ (0, _classCallCheck2["default"])(this, SearchService); | ||
} | ||
(0, _createClass2["default"])(SearchService, [{ | ||
@@ -46,5 +35,5 @@ key: "options", | ||
var _this$options_; | ||
return (_this$options_ = this.options_) !== null && _this$options_ !== void 0 ? _this$options_ : {}; | ||
} | ||
/** | ||
@@ -56,3 +45,2 @@ * Used to create an index | ||
*/ | ||
}, { | ||
@@ -63,2 +51,3 @@ key: "createIndex", | ||
} | ||
/** | ||
@@ -69,3 +58,2 @@ * Used to get an index | ||
*/ | ||
}, { | ||
@@ -76,2 +64,3 @@ key: "getIndex", | ||
} | ||
/** | ||
@@ -84,3 +73,2 @@ * Used to index documents by the search engine provider | ||
*/ | ||
}, { | ||
@@ -91,2 +79,3 @@ key: "addDocuments", | ||
} | ||
/** | ||
@@ -99,3 +88,2 @@ * Used to replace documents | ||
*/ | ||
}, { | ||
@@ -106,2 +94,3 @@ key: "replaceDocuments", | ||
} | ||
/** | ||
@@ -113,3 +102,2 @@ * Used to delete document | ||
*/ | ||
}, { | ||
@@ -120,2 +108,3 @@ key: "deleteDocument", | ||
} | ||
/** | ||
@@ -126,3 +115,2 @@ * Used to delete all documents | ||
*/ | ||
}, { | ||
@@ -133,2 +121,3 @@ key: "deleteAllDocuments", | ||
} | ||
/** | ||
@@ -143,3 +132,2 @@ * Used to search for a document in an index | ||
*/ | ||
}, { | ||
@@ -150,2 +138,3 @@ key: "search", | ||
} | ||
/** | ||
@@ -157,3 +146,2 @@ * Used to update the settings of an index | ||
*/ | ||
}, { | ||
@@ -164,7 +152,13 @@ key: "updateSettings", | ||
} | ||
}], [{ | ||
key: "isSearchService", | ||
value: function isSearchService(obj) { | ||
var _obj$constructor; | ||
return obj === null || obj === void 0 ? void 0 : (_obj$constructor = obj.constructor) === null || _obj$constructor === void 0 ? void 0 : _obj$constructor._isSearchService; | ||
} | ||
}]); | ||
return SearchService; | ||
}(_baseService["default"]); | ||
(0, _defineProperty2["default"])(SearchService, "_isSearchService", true); | ||
var _default = SearchService; | ||
exports["default"] = _default; |
{ | ||
"name": "medusa-interfaces", | ||
"version": "1.3.8-next-20230530075345", | ||
"version": "1.3.8-snapshot-20231221111816", | ||
"description": "Core interfaces for Medusa", | ||
@@ -11,6 +11,9 @@ "main": "dist/index.js", | ||
}, | ||
"engines": { | ||
"node": ">=16" | ||
}, | ||
"scripts": { | ||
"prepare": "cross-env NODE_ENV=production yarn run build", | ||
"test": "jest --passWithNoTests src", | ||
"build": "babel src --out-dir dist --ignore '**/__tests__','**/__mocks__'", | ||
"build": "rimraf dist && babel src --out-dir dist --ignore '**/__tests__','**/__mocks__'", | ||
"watch": "babel -w src --out-dir dist --ignore '**/__tests__','**/__mocks__'" | ||
@@ -35,4 +38,5 @@ }, | ||
"jest": "^25.5.4", | ||
"medusa-core-utils": "1.2.1-next-20230530075345", | ||
"medusa-core-utils": "^1.2.0", | ||
"medusa-test-utils": "^1.1.40", | ||
"rimraf": "^5.0.1", | ||
"typescript": "^4.4.4" | ||
@@ -39,0 +43,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42898
15
9
911