medusa-core-utils
Advanced tools
Comparing version 1.1.26 to 1.1.27-alpha.70
@@ -6,2 +6,12 @@ # Change Log | ||
## [1.1.28](https://github.com/medusajs/medusa/compare/medusa-core-utils@1.1.27...medusa-core-utils@1.1.28) (2021-11-19) | ||
**Note:** Version bump only for package medusa-core-utils | ||
## [1.1.27](https://github.com/medusajs/medusa/compare/medusa-core-utils@1.1.26...medusa-core-utils@1.1.27) (2021-11-19) | ||
### Features | ||
- Typescript for API layer ([#817](https://github.com/medusajs/medusa/issues/817)) ([373532e](https://github.com/medusajs/medusa/commit/373532ecbc8196f47e71af95a8cf82a14a4b1f9e)) | ||
## [1.1.26](https://github.com/medusajs/medusa/compare/medusa-core-utils@1.1.25...medusa-core-utils@1.1.26) (2021-10-18) | ||
@@ -8,0 +18,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _lodash = _interopRequireDefault(require("lodash")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var lodash_1 = __importDefault(require("lodash")); | ||
function compareObjectsByProp(object1, object2, prop) { | ||
if (Array.isArray(object1[prop])) { | ||
object2[prop] = object2[prop].map(function (_ref) { | ||
var _id = _ref._id, | ||
rest = _objectWithoutProperties(_ref, ["_id"]); | ||
return rest; | ||
}); | ||
return _lodash["default"].differenceWith(object1[prop], object2[prop], _lodash["default"].isEqual).length === 0; | ||
} else if (_typeof(object1[prop]) === "object") { | ||
delete object2[prop]._id; | ||
return _lodash["default"].isEqual(object1[prop], object2[prop]); | ||
} else { | ||
return object1[prop] === object2[prop]; | ||
} | ||
if (Array.isArray(object1[prop])) { | ||
object2[prop] = object2[prop].map(function (_a) { | ||
var _id = _a._id, rest = __rest(_a, ["_id"]); | ||
return rest; | ||
}); | ||
return (lodash_1.default.differenceWith(object1[prop], object2[prop], lodash_1.default.isEqual).length === 0); | ||
} | ||
else if (typeof object1[prop] === "object") { | ||
delete object2[prop]._id; | ||
return lodash_1.default.isEqual(object1[prop], object2[prop]); | ||
} | ||
else { | ||
return object1[prop] === object2[prop]; | ||
} | ||
} | ||
var _default = compareObjectsByProp; | ||
exports["default"] = _default; | ||
exports.default = compareObjectsByProp; | ||
//# sourceMappingURL=compare-objects.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.isoCountryLookup = isoCountryLookup; | ||
exports.countries = void 0; | ||
var countries = [{ | ||
alpha2: "AF", | ||
name: "Afghanistan", | ||
alpha3: "AFG", | ||
numeric: "004" | ||
}, { | ||
alpha2: "AL", | ||
name: "Albania", | ||
alpha3: "ALB", | ||
numeric: "008" | ||
}, { | ||
alpha2: "DZ", | ||
name: "Algeria", | ||
alpha3: "DZA", | ||
numeric: "012" | ||
}, { | ||
alpha2: "AS", | ||
name: "American Samoa", | ||
alpha3: "ASM", | ||
numeric: "016" | ||
}, { | ||
alpha2: "AD", | ||
name: "Andorra", | ||
alpha3: "AND", | ||
numeric: "020" | ||
}, { | ||
alpha2: "AO", | ||
name: "Angola", | ||
alpha3: "AGO", | ||
numeric: "024" | ||
}, { | ||
alpha2: "AI", | ||
name: "Anguilla", | ||
alpha3: "AIA", | ||
numeric: "660" | ||
}, { | ||
alpha2: "AQ", | ||
name: "Antarctica", | ||
alpha3: "ATA", | ||
numeric: "010" | ||
}, { | ||
alpha2: "AG", | ||
name: "Antigua and Barbuda", | ||
alpha3: "ATG", | ||
numeric: "028" | ||
}, { | ||
alpha2: "AR", | ||
name: "Argentina", | ||
alpha3: "ARG", | ||
numeric: "032" | ||
}, { | ||
alpha2: "AM", | ||
name: "Armenia", | ||
alpha3: "ARM", | ||
numeric: "051" | ||
}, { | ||
alpha2: "AW", | ||
name: "Aruba", | ||
alpha3: "ABW", | ||
numeric: "533" | ||
}, { | ||
alpha2: "AU", | ||
name: "Australia", | ||
alpha3: "AUS", | ||
numeric: "036" | ||
}, { | ||
alpha2: "AT", | ||
name: "Austria", | ||
alpha3: "AUT", | ||
numeric: "040" | ||
}, { | ||
alpha2: "AZ", | ||
name: "Azerbaijan", | ||
alpha3: "AZE", | ||
numeric: "031" | ||
}, { | ||
alpha2: "BS", | ||
name: "Bahamas", | ||
alpha3: "BHS", | ||
numeric: "044" | ||
}, { | ||
alpha2: "BH", | ||
name: "Bahrain", | ||
alpha3: "BHR", | ||
numeric: "048" | ||
}, { | ||
alpha2: "BD", | ||
name: "Bangladesh", | ||
alpha3: "BGD", | ||
numeric: "050" | ||
}, { | ||
alpha2: "BB", | ||
name: "Barbados", | ||
alpha3: "BRB", | ||
numeric: "052" | ||
}, { | ||
alpha2: "BY", | ||
name: "Belarus", | ||
alpha3: "BLR", | ||
numeric: "112" | ||
}, { | ||
alpha2: "BE", | ||
name: "Belgium", | ||
alpha3: "BEL", | ||
numeric: "056" | ||
}, { | ||
alpha2: "BZ", | ||
name: "Belize", | ||
alpha3: "BLZ", | ||
numeric: "084" | ||
}, { | ||
alpha2: "BJ", | ||
name: "Benin", | ||
alpha3: "BEN", | ||
numeric: "204" | ||
}, { | ||
alpha2: "BM", | ||
name: "Bermuda", | ||
alpha3: "BMU", | ||
numeric: "060" | ||
}, { | ||
alpha2: "BT", | ||
name: "Bhutan", | ||
alpha3: "BTN", | ||
numeric: "064" | ||
}, { | ||
alpha2: "BO", | ||
name: "Bolivia", | ||
alpha3: "BOL", | ||
numeric: "068" | ||
}, { | ||
alpha2: "BQ", | ||
name: "Bonaire, Sint Eustatius and Saba", | ||
alpha3: "BES", | ||
numeric: "535" | ||
}, { | ||
alpha2: "BA", | ||
name: "Bosnia and Herzegovina", | ||
alpha3: "BIH", | ||
numeric: "070" | ||
}, { | ||
alpha2: "BW", | ||
name: "Botswana", | ||
alpha3: "BWA", | ||
numeric: "072" | ||
}, { | ||
alpha2: "BV", | ||
name: "Bouvet Island", | ||
alpha3: "BVD", | ||
numeric: "074" | ||
}, { | ||
alpha2: "BR", | ||
name: "Brazil", | ||
alpha3: "BRA", | ||
numeric: "076" | ||
}, { | ||
alpha2: "IO", | ||
name: "British Indian Ocean Territory", | ||
alpha3: "IOT", | ||
numeric: "086" | ||
}, { | ||
alpha2: "BN", | ||
name: "Brunei Darussalam", | ||
alpha3: "BRN", | ||
numeric: "096" | ||
}, { | ||
alpha2: "BG", | ||
name: "Bulgaria", | ||
alpha3: "BGR", | ||
numeric: "100" | ||
}, { | ||
alpha2: "BF", | ||
name: "Burkina Faso", | ||
alpha3: "BFA", | ||
numeric: "854" | ||
}, { | ||
alpha2: "BI", | ||
name: "Burundi", | ||
alpha3: "BDI", | ||
numeric: "108" | ||
}, { | ||
alpha2: "KH", | ||
name: "Cambodia", | ||
alpha3: "KHM", | ||
numeric: "116" | ||
}, { | ||
alpha2: "CM", | ||
name: "Cameroon", | ||
alpha3: "CMR", | ||
numeric: "120" | ||
}, { | ||
alpha2: "CA", | ||
name: "Canada", | ||
alpha3: "CAN", | ||
numeric: "124" | ||
}, { | ||
alpha2: "CV", | ||
name: "Cape Verde", | ||
alpha3: "CPV", | ||
numeric: "132" | ||
}, { | ||
alpha2: "KY", | ||
name: "Cayman Islands", | ||
alpha3: "CYM", | ||
numeric: "136" | ||
}, { | ||
alpha2: "CF", | ||
name: "Central African Republic", | ||
alpha3: "CAF", | ||
numeric: "140" | ||
}, { | ||
alpha2: "TD", | ||
name: "Chad", | ||
alpha3: "TCD", | ||
numeric: "148" | ||
}, { | ||
alpha2: "CL", | ||
name: "Chile", | ||
alpha3: "CHL", | ||
numeric: "152" | ||
}, { | ||
alpha2: "CN", | ||
name: "China", | ||
alpha3: "CHN", | ||
numeric: "156" | ||
}, { | ||
alpha2: "CX", | ||
name: "Christmas Island", | ||
alpha3: "CXR", | ||
numeric: "162" | ||
}, { | ||
alpha2: "CC", | ||
name: "Cocos (Keeling) Islands", | ||
alpha3: "CCK", | ||
numeric: "166" | ||
}, { | ||
alpha2: "CO", | ||
name: "Colombia", | ||
alpha3: "COL", | ||
numeric: "170" | ||
}, { | ||
alpha2: "KM", | ||
name: "Comoros", | ||
alpha3: "COM", | ||
numeric: "174" | ||
}, { | ||
alpha2: "CG", | ||
name: "Congo", | ||
alpha3: "COG", | ||
numeric: "178" | ||
}, { | ||
alpha2: "CD", | ||
name: "Congo, the Democratic Republic of the", | ||
alpha3: "COD", | ||
numeric: "180" | ||
}, { | ||
alpha2: "CK", | ||
name: "Cook Islands", | ||
alpha3: "COK", | ||
numeric: "184" | ||
}, { | ||
alpha2: "CR", | ||
name: "Costa Rica", | ||
alpha3: "CRI", | ||
numeric: "188" | ||
}, { | ||
alpha2: "CI", | ||
name: "Cote D'Ivoire", | ||
alpha3: "CIV", | ||
numeric: "384" | ||
}, { | ||
alpha2: "HR", | ||
name: "Croatia", | ||
alpha3: "HRV", | ||
numeric: "191" | ||
}, { | ||
alpha2: "CU", | ||
name: "Cuba", | ||
alpha3: "CUB", | ||
numeric: "192" | ||
}, { | ||
alpha2: "CW", | ||
name: "Curaçao", | ||
alpha3: "CUW", | ||
numeric: "531" | ||
}, { | ||
alpha2: "CY", | ||
name: "Cyprus", | ||
alpha3: "CYP", | ||
numeric: "196" | ||
}, { | ||
alpha2: "CZ", | ||
name: "Czech Republic", | ||
alpha3: "CZE", | ||
numeric: "203" | ||
}, { | ||
alpha2: "DK", | ||
name: "Denmark", | ||
alpha3: "DNK", | ||
numeric: "208" | ||
}, { | ||
alpha2: "DJ", | ||
name: "Djibouti", | ||
alpha3: "DJI", | ||
numeric: "262" | ||
}, { | ||
alpha2: "DM", | ||
name: "Dominica", | ||
alpha3: "DMA", | ||
numeric: "212" | ||
}, { | ||
alpha2: "DO", | ||
name: "Dominican Republic", | ||
alpha3: "DOM", | ||
numeric: "214" | ||
}, { | ||
alpha2: "EC", | ||
name: "Ecuador", | ||
alpha3: "ECU", | ||
numeric: "218" | ||
}, { | ||
alpha2: "EG", | ||
name: "Egypt", | ||
alpha3: "EGY", | ||
numeric: "818" | ||
}, { | ||
alpha2: "SV", | ||
name: "El Salvador", | ||
alpha3: "SLV", | ||
numeric: "222" | ||
}, { | ||
alpha2: "GQ", | ||
name: "Equatorial Guinea", | ||
alpha3: "GNQ", | ||
numeric: "226" | ||
}, { | ||
alpha2: "ER", | ||
name: "Eritrea", | ||
alpha3: "ERI", | ||
numeric: "232" | ||
}, { | ||
alpha2: "EE", | ||
name: "Estonia", | ||
alpha3: "EST", | ||
numeric: "233" | ||
}, { | ||
alpha2: "ET", | ||
name: "Ethiopia", | ||
alpha3: "ETH", | ||
numeric: "231" | ||
}, { | ||
alpha2: "FK", | ||
name: "Falkland Islands (Malvinas)", | ||
alpha3: "FLK", | ||
numeric: "238" | ||
}, { | ||
alpha2: "FO", | ||
name: "Faroe Islands", | ||
alpha3: "FRO", | ||
numeric: "234" | ||
}, { | ||
alpha2: "FJ", | ||
name: "Fiji", | ||
alpha3: "FJI", | ||
numeric: "242" | ||
}, { | ||
alpha2: "FI", | ||
name: "Finland", | ||
alpha3: "FIN", | ||
numeric: "246" | ||
}, { | ||
alpha2: "FR", | ||
name: "France", | ||
alpha3: "FRA", | ||
numeric: "250" | ||
}, { | ||
alpha2: "GF", | ||
name: "French Guiana", | ||
alpha3: "GUF", | ||
numeric: "254" | ||
}, { | ||
alpha2: "PF", | ||
name: "French Polynesia", | ||
alpha3: "PYF", | ||
numeric: "258" | ||
}, { | ||
alpha2: "TF", | ||
name: "French Southern Territories", | ||
alpha3: "ATF", | ||
numeric: "260" | ||
}, { | ||
alpha2: "GA", | ||
name: "Gabon", | ||
alpha3: "GAB", | ||
numeric: "266" | ||
}, { | ||
alpha2: "GM", | ||
name: "Gambia", | ||
alpha3: "GMB", | ||
numeric: "270" | ||
}, { | ||
alpha2: "GE", | ||
name: "Georgia", | ||
alpha3: "GEO", | ||
numeric: "268" | ||
}, { | ||
alpha2: "DE", | ||
name: "Germany", | ||
alpha3: "DEU", | ||
numeric: "276" | ||
}, { | ||
alpha2: "GH", | ||
name: "Ghana", | ||
alpha3: "GHA", | ||
numeric: "288" | ||
}, { | ||
alpha2: "GI", | ||
name: "Gibraltar", | ||
alpha3: "GIB", | ||
numeric: "292" | ||
}, { | ||
alpha2: "GR", | ||
name: "Greece", | ||
alpha3: "GRC", | ||
numeric: "300" | ||
}, { | ||
alpha2: "GL", | ||
name: "Greenland", | ||
alpha3: "GRL", | ||
numeric: "304" | ||
}, { | ||
alpha2: "GD", | ||
name: "Grenada", | ||
alpha3: "GRD", | ||
numeric: "308" | ||
}, { | ||
alpha2: "GP", | ||
name: "Guadeloupe", | ||
alpha3: "GLP", | ||
numeric: "312" | ||
}, { | ||
alpha2: "GU", | ||
name: "Guam", | ||
alpha3: "GUM", | ||
numeric: "316" | ||
}, { | ||
alpha2: "GT", | ||
name: "Guatemala", | ||
alpha3: "GTM", | ||
numeric: "320" | ||
}, { | ||
alpha2: "GG", | ||
name: "Guernsey", | ||
alpha3: "GGY", | ||
numeric: "831" | ||
}, { | ||
alpha2: "GN", | ||
name: "Guinea", | ||
alpha3: "GIN", | ||
numeric: "324" | ||
}, { | ||
alpha2: "GW", | ||
name: "Guinea-Bissau", | ||
alpha3: "GNB", | ||
numeric: "624" | ||
}, { | ||
alpha2: "GY", | ||
name: "Guyana", | ||
alpha3: "GUY", | ||
numeric: "328" | ||
}, { | ||
alpha2: "HT", | ||
name: "Haiti", | ||
alpha3: "HTI", | ||
numeric: "332" | ||
}, { | ||
alpha2: "HM", | ||
name: "Heard Island And Mcdonald Islands", | ||
alpha3: "HMD", | ||
numeric: "334" | ||
}, { | ||
alpha2: "VA", | ||
name: "Holy See (Vatican City State)", | ||
alpha3: "VAT", | ||
numeric: "336" | ||
}, { | ||
alpha2: "HN", | ||
name: "Honduras", | ||
alpha3: "HND", | ||
numeric: "340" | ||
}, { | ||
alpha2: "HK", | ||
name: "Hong Kong", | ||
alpha3: "HKG", | ||
numeric: "344" | ||
}, { | ||
alpha2: "HU", | ||
name: "Hungary", | ||
alpha3: "HUN", | ||
numeric: "348" | ||
}, { | ||
alpha2: "IS", | ||
name: "Iceland", | ||
alpha3: "ISL", | ||
numeric: "352" | ||
}, { | ||
alpha2: "IN", | ||
name: "India", | ||
alpha3: "IND", | ||
numeric: "356" | ||
}, { | ||
alpha2: "ID", | ||
name: "Indonesia", | ||
alpha3: "IDN", | ||
numeric: "360" | ||
}, { | ||
alpha2: "IR", | ||
name: "Iran, Islamic Republic of", | ||
alpha3: "IRN", | ||
numeric: "364" | ||
}, { | ||
alpha2: "IQ", | ||
name: "Iraq", | ||
alpha3: "IRQ", | ||
numeric: "368" | ||
}, { | ||
alpha2: "IE", | ||
name: "Ireland", | ||
alpha3: "IRL", | ||
numeric: "372" | ||
}, { | ||
alpha2: "IM", | ||
name: "Isle Of Man", | ||
alpha3: "IMN", | ||
numeric: "833" | ||
}, { | ||
alpha2: "IL", | ||
name: "Israel", | ||
alpha3: "ISR", | ||
numeric: "376" | ||
}, { | ||
alpha2: "IT", | ||
name: "Italy", | ||
alpha3: "ITA", | ||
numeric: "380" | ||
}, { | ||
alpha2: "JM", | ||
name: "Jamaica", | ||
alpha3: "JAM", | ||
numeric: "388" | ||
}, { | ||
alpha2: "JP", | ||
name: "Japan", | ||
alpha3: "JPN", | ||
numeric: "392" | ||
}, { | ||
alpha2: "JE", | ||
name: "Jersey", | ||
alpha3: "JEY", | ||
numeric: "832" | ||
}, { | ||
alpha2: "JO", | ||
name: "Jordan", | ||
alpha3: "JOR", | ||
numeric: "400" | ||
}, { | ||
alpha2: "KZ", | ||
name: "Kazakhstan", | ||
alpha3: "KAZ", | ||
numeric: "398" | ||
}, { | ||
alpha2: "KE", | ||
name: "Kenya", | ||
alpha3: "KEN", | ||
numeric: "404" | ||
}, { | ||
alpha2: "KI", | ||
name: "Kiribati", | ||
alpha3: "KIR", | ||
numeric: "296" | ||
}, { | ||
alpha2: "KP", | ||
name: "Korea, Democratic People's Republic of", | ||
alpha3: "PRK", | ||
numeric: "408" | ||
}, { | ||
alpha2: "KR", | ||
name: "Korea, Republic of", | ||
alpha3: "KOR", | ||
numeric: "410" | ||
}, { | ||
alpha2: "XK", | ||
name: "Kosovo", | ||
alpha3: "XKX", | ||
numeric: "900" | ||
}, { | ||
alpha2: "KW", | ||
name: "Kuwait", | ||
alpha3: "KWT", | ||
numeric: "414" | ||
}, { | ||
alpha2: "KG", | ||
name: "Kyrgyzstan", | ||
alpha3: "KGZ", | ||
numeric: "417" | ||
}, { | ||
alpha2: "LA", | ||
name: "Lao People's Democratic Republic", | ||
alpha3: "LAO", | ||
numeric: "418" | ||
}, { | ||
alpha2: "LV", | ||
name: "Latvia", | ||
alpha3: "LVA", | ||
numeric: "428" | ||
}, { | ||
alpha2: "LB", | ||
name: "Lebanon", | ||
alpha3: "LBN", | ||
numeric: "422" | ||
}, { | ||
alpha2: "LS", | ||
name: "Lesotho", | ||
alpha3: "LSO", | ||
numeric: "426" | ||
}, { | ||
alpha2: "LR", | ||
name: "Liberia", | ||
alpha3: "LBR", | ||
numeric: "430" | ||
}, { | ||
alpha2: "LY", | ||
name: "Libyan Arab Jamahiriya", | ||
alpha3: "LBY", | ||
numeric: "434" | ||
}, { | ||
alpha2: "LI", | ||
name: "Liechtenstein", | ||
alpha3: "LIE", | ||
numeric: "438" | ||
}, { | ||
alpha2: "LT", | ||
name: "Lithuania", | ||
alpha3: "LTU", | ||
numeric: "440" | ||
}, { | ||
alpha2: "LU", | ||
name: "Luxembourg", | ||
alpha3: "LUX", | ||
numeric: "442" | ||
}, { | ||
alpha2: "MO", | ||
name: "Macao", | ||
alpha3: "MAC", | ||
numeric: "446" | ||
}, { | ||
alpha2: "MK", | ||
name: "Macedonia, the Former Yugoslav Republic of", | ||
alpha3: "MKD", | ||
numeric: "807" | ||
}, { | ||
alpha2: "MG", | ||
name: "Madagascar", | ||
alpha3: "MDG", | ||
numeric: "450" | ||
}, { | ||
alpha2: "MW", | ||
name: "Malawi", | ||
alpha3: "MWI", | ||
numeric: "454" | ||
}, { | ||
alpha2: "MY", | ||
name: "Malaysia", | ||
alpha3: "MYS", | ||
numeric: "458" | ||
}, { | ||
alpha2: "MV", | ||
name: "Maldives", | ||
alpha3: "MDV", | ||
numeric: "462" | ||
}, { | ||
alpha2: "ML", | ||
name: "Mali", | ||
alpha3: "MLI", | ||
numeric: "466" | ||
}, { | ||
alpha2: "MT", | ||
name: "Malta", | ||
alpha3: "MLT", | ||
numeric: "470" | ||
}, { | ||
alpha2: "MH", | ||
name: "Marshall Islands", | ||
alpha3: "MHL", | ||
numeric: "584" | ||
}, { | ||
alpha2: "MQ", | ||
name: "Martinique", | ||
alpha3: "MTQ", | ||
numeric: "474" | ||
}, { | ||
alpha2: "MR", | ||
name: "Mauritania", | ||
alpha3: "MRT", | ||
numeric: "478" | ||
}, { | ||
alpha2: "MU", | ||
name: "Mauritius", | ||
alpha3: "MUS", | ||
numeric: "480" | ||
}, { | ||
alpha2: "YT", | ||
name: "Mayotte", | ||
alpha3: "MYT", | ||
numeric: "175" | ||
}, { | ||
alpha2: "MX", | ||
name: "Mexico", | ||
alpha3: "MEX", | ||
numeric: "484" | ||
}, { | ||
alpha2: "FM", | ||
name: "Micronesia, Federated States of", | ||
alpha3: "FSM", | ||
numeric: "583" | ||
}, { | ||
alpha2: "MD", | ||
name: "Moldova, Republic of", | ||
alpha3: "MDA", | ||
numeric: "498" | ||
}, { | ||
alpha2: "MC", | ||
name: "Monaco", | ||
alpha3: "MCO", | ||
numeric: "492" | ||
}, { | ||
alpha2: "MN", | ||
name: "Mongolia", | ||
alpha3: "MNG", | ||
numeric: "496" | ||
}, { | ||
alpha2: "ME", | ||
name: "Montenegro", | ||
alpha3: "MNE", | ||
numeric: "499" | ||
}, { | ||
alpha2: "MS", | ||
name: "Montserrat", | ||
alpha3: "MSR", | ||
numeric: "500" | ||
}, { | ||
alpha2: "MA", | ||
name: "Morocco", | ||
alpha3: "MAR", | ||
numeric: "504" | ||
}, { | ||
alpha2: "MZ", | ||
name: "Mozambique", | ||
alpha3: "MOZ", | ||
numeric: "508" | ||
}, { | ||
alpha2: "MM", | ||
name: "Myanmar", | ||
alpha3: "MMR", | ||
numeric: "104" | ||
}, { | ||
alpha2: "NA", | ||
name: "Namibia", | ||
alpha3: "NAM", | ||
numeric: "516" | ||
}, { | ||
alpha2: "NR", | ||
name: "Nauru", | ||
alpha3: "NRU", | ||
numeric: "520" | ||
}, { | ||
alpha2: "NP", | ||
name: "Nepal", | ||
alpha3: "NPL", | ||
numeric: "524" | ||
}, { | ||
alpha2: "NL", | ||
name: "Netherlands", | ||
alpha3: "NLD", | ||
numeric: "528" | ||
}, { | ||
alpha2: "NC", | ||
name: "New Caledonia", | ||
alpha3: "NCL", | ||
numeric: "540" | ||
}, { | ||
alpha2: "NZ", | ||
name: "New Zealand", | ||
alpha3: "NZL", | ||
numeric: "554" | ||
}, { | ||
alpha2: "NI", | ||
name: "Nicaragua", | ||
alpha3: "NIC", | ||
numeric: "558" | ||
}, { | ||
alpha2: "NE", | ||
name: "Niger", | ||
alpha3: "NER", | ||
numeric: "562" | ||
}, { | ||
alpha2: "NG", | ||
name: "Nigeria", | ||
alpha3: "NGA", | ||
numeric: "566" | ||
}, { | ||
alpha2: "NU", | ||
name: "Niue", | ||
alpha3: "NIU", | ||
numeric: "570" | ||
}, { | ||
alpha2: "NF", | ||
name: "Norfolk Island", | ||
alpha3: "NFK", | ||
numeric: "574" | ||
}, { | ||
alpha2: "MP", | ||
name: "Northern Mariana Islands", | ||
alpha3: "MNP", | ||
numeric: "580" | ||
}, { | ||
alpha2: "NO", | ||
name: "Norway", | ||
alpha3: "NOR", | ||
numeric: "578" | ||
}, { | ||
alpha2: "OM", | ||
name: "Oman", | ||
alpha3: "OMN", | ||
numeric: "512" | ||
}, { | ||
alpha2: "PK", | ||
name: "Pakistan", | ||
alpha3: "PAK", | ||
numeric: "586" | ||
}, { | ||
alpha2: "PW", | ||
name: "Palau", | ||
alpha3: "PLW", | ||
numeric: "585" | ||
}, { | ||
alpha2: "PS", | ||
name: "Palestinian Territory, Occupied", | ||
alpha3: "PSE", | ||
numeric: "275" | ||
}, { | ||
alpha2: "PA", | ||
name: "Panama", | ||
alpha3: "PAN", | ||
numeric: "591" | ||
}, { | ||
alpha2: "PG", | ||
name: "Papua New Guinea", | ||
alpha3: "PNG", | ||
numeric: "598" | ||
}, { | ||
alpha2: "PY", | ||
name: "Paraguay", | ||
alpha3: "PRY", | ||
numeric: "600" | ||
}, { | ||
alpha2: "PE", | ||
name: "Peru", | ||
alpha3: "PER", | ||
numeric: "604" | ||
}, { | ||
alpha2: "PH", | ||
name: "Philippines", | ||
alpha3: "PHL", | ||
numeric: "608" | ||
}, { | ||
alpha2: "PN", | ||
name: "Pitcairn", | ||
alpha3: "PCN", | ||
numeric: "612" | ||
}, { | ||
alpha2: "PL", | ||
name: "Poland", | ||
alpha3: "POL", | ||
numeric: "616" | ||
}, { | ||
alpha2: "PT", | ||
name: "Portugal", | ||
alpha3: "PRT", | ||
numeric: "620" | ||
}, { | ||
alpha2: "PR", | ||
name: "Puerto Rico", | ||
alpha3: "PRI", | ||
numeric: "630" | ||
}, { | ||
alpha2: "QA", | ||
name: "Qatar", | ||
alpha3: "QAT", | ||
numeric: "634" | ||
}, { | ||
alpha2: "RE", | ||
name: "Reunion", | ||
alpha3: "REU", | ||
numeric: "638" | ||
}, { | ||
alpha2: "RO", | ||
name: "Romania", | ||
alpha3: "ROU", | ||
numeric: "642" | ||
}, { | ||
alpha2: "RO", | ||
name: "Romania", | ||
alpha3: "ROM", | ||
numeric: "642" | ||
}, { | ||
alpha2: "RU", | ||
name: "Russian Federation", | ||
alpha3: "RUS", | ||
numeric: "643" | ||
}, { | ||
alpha2: "RW", | ||
name: "Rwanda", | ||
alpha3: "RWA", | ||
numeric: "646" | ||
}, { | ||
alpha2: "BL", | ||
name: "Saint Barthélemy", | ||
alpha3: "BLM", | ||
numeric: "652" | ||
}, { | ||
alpha2: "SH", | ||
name: "Saint Helena", | ||
alpha3: "SHN", | ||
numeric: "654" | ||
}, { | ||
alpha2: "KN", | ||
name: "Saint Kitts and Nevis", | ||
alpha3: "KNA", | ||
numeric: "659" | ||
}, { | ||
alpha2: "LC", | ||
name: "Saint Lucia", | ||
alpha3: "LCA", | ||
numeric: "662" | ||
}, { | ||
alpha2: "MF", | ||
name: "Saint Martin (French part)", | ||
alpha3: "MAF", | ||
numeric: "663" | ||
}, { | ||
alpha2: "PM", | ||
name: "Saint Pierre and Miquelon", | ||
alpha3: "SPM", | ||
numeric: "666" | ||
}, { | ||
alpha2: "VC", | ||
name: "Saint Vincent and the Grenadines", | ||
alpha3: "VCT", | ||
numeric: "670" | ||
}, { | ||
alpha2: "WS", | ||
name: "Samoa", | ||
alpha3: "WSM", | ||
numeric: "882" | ||
}, { | ||
alpha2: "SM", | ||
name: "San Marino", | ||
alpha3: "SMR", | ||
numeric: "674" | ||
}, { | ||
alpha2: "ST", | ||
name: "Sao Tome and Principe", | ||
alpha3: "STP", | ||
numeric: "678" | ||
}, { | ||
alpha2: "SA", | ||
name: "Saudi Arabia", | ||
alpha3: "SAU", | ||
numeric: "682" | ||
}, { | ||
alpha2: "SN", | ||
name: "Senegal", | ||
alpha3: "SEN", | ||
numeric: "686" | ||
}, { | ||
alpha2: "RS", | ||
name: "Serbia", | ||
alpha3: "SRB", | ||
numeric: "688" | ||
}, { | ||
alpha2: "SC", | ||
name: "Seychelles", | ||
alpha3: "SYC", | ||
numeric: "690" | ||
}, { | ||
alpha2: "SL", | ||
name: "Sierra Leone", | ||
alpha3: "SLE", | ||
numeric: "694" | ||
}, { | ||
alpha2: "SG", | ||
name: "Singapore", | ||
alpha3: "SGP", | ||
numeric: "702" | ||
}, { | ||
alpha2: "SX", | ||
name: "Sint Maarten", | ||
alpha3: "SXM", | ||
numeric: "534" | ||
}, { | ||
alpha2: "SK", | ||
name: "Slovakia", | ||
alpha3: "SVK", | ||
numeric: "703" | ||
}, { | ||
alpha2: "SI", | ||
name: "Slovenia", | ||
alpha3: "SVN", | ||
numeric: "705" | ||
}, { | ||
alpha2: "SB", | ||
name: "Solomon Islands", | ||
alpha3: "SLB", | ||
numeric: "090" | ||
}, { | ||
alpha2: "SO", | ||
name: "Somalia", | ||
alpha3: "SOM", | ||
numeric: "706" | ||
}, { | ||
alpha2: "ZA", | ||
name: "South Africa", | ||
alpha3: "ZAF", | ||
numeric: "710" | ||
}, { | ||
alpha2: "GS", | ||
name: "South Georgia and the South Sandwich Islands", | ||
alpha3: "SGS", | ||
numeric: "239" | ||
}, { | ||
alpha2: "SS", | ||
name: "South Sudan", | ||
alpha3: "SSD", | ||
numeric: "728" | ||
}, { | ||
alpha2: "ES", | ||
name: "Spain", | ||
alpha3: "ESP", | ||
numeric: "724" | ||
}, { | ||
alpha2: "LK", | ||
name: "Sri Lanka", | ||
alpha3: "LKA", | ||
numeric: "144" | ||
}, { | ||
alpha2: "SD", | ||
name: "Sudan", | ||
alpha3: "SDN", | ||
numeric: "729" | ||
}, { | ||
alpha2: "SR", | ||
name: "Suriname", | ||
alpha3: "SUR", | ||
numeric: "740" | ||
}, { | ||
alpha2: "SJ", | ||
name: "Svalbard and Jan Mayen", | ||
alpha3: "SJM", | ||
numeric: "744" | ||
}, { | ||
alpha2: "SZ", | ||
name: "Swaziland", | ||
alpha3: "SWZ", | ||
numeric: "748" | ||
}, { | ||
alpha2: "SE", | ||
name: "Sweden", | ||
alpha3: "SWE", | ||
numeric: "752" | ||
}, { | ||
alpha2: "CH", | ||
name: "Switzerland", | ||
alpha3: "CHE", | ||
numeric: "756" | ||
}, { | ||
alpha2: "SY", | ||
name: "Syrian Arab Republic", | ||
alpha3: "SYR", | ||
numeric: "760" | ||
}, { | ||
alpha2: "TW", | ||
name: "Taiwan, Province of China", | ||
alpha3: "TWN", | ||
numeric: "158" | ||
}, { | ||
alpha2: "TJ", | ||
name: "Tajikistan", | ||
alpha3: "TJK", | ||
numeric: "762" | ||
}, { | ||
alpha2: "TZ", | ||
name: "Tanzania, United Republic of", | ||
alpha3: "TZA", | ||
numeric: "834" | ||
}, { | ||
alpha2: "TH", | ||
name: "Thailand", | ||
alpha3: "THA", | ||
numeric: "764" | ||
}, { | ||
alpha2: "TL", | ||
name: "Timor Leste", | ||
alpha3: "TLS", | ||
numeric: "626" | ||
}, { | ||
alpha2: "TG", | ||
name: "Togo", | ||
alpha3: "TGO", | ||
numeric: "768" | ||
}, { | ||
alpha2: "TK", | ||
name: "Tokelau", | ||
alpha3: "TKL", | ||
numeric: "772" | ||
}, { | ||
alpha2: "TO", | ||
name: "Tonga", | ||
alpha3: "TON", | ||
numeric: "776" | ||
}, { | ||
alpha2: "TT", | ||
name: "Trinidad and Tobago", | ||
alpha3: "TTO", | ||
numeric: "780" | ||
}, { | ||
alpha2: "TN", | ||
name: "Tunisia", | ||
alpha3: "TUN", | ||
numeric: "788" | ||
}, { | ||
alpha2: "TR", | ||
name: "Turkey", | ||
alpha3: "TUR", | ||
numeric: "792" | ||
}, { | ||
alpha2: "TM", | ||
name: "Turkmenistan", | ||
alpha3: "TKM", | ||
numeric: "795" | ||
}, { | ||
alpha2: "TC", | ||
name: "Turks and Caicos Islands", | ||
alpha3: "TCA", | ||
numeric: "796" | ||
}, { | ||
alpha2: "TV", | ||
name: "Tuvalu", | ||
alpha3: "TUV", | ||
numeric: "798" | ||
}, { | ||
alpha2: "UG", | ||
name: "Uganda", | ||
alpha3: "UGA", | ||
numeric: "800" | ||
}, { | ||
alpha2: "UA", | ||
name: "Ukraine", | ||
alpha3: "UKR", | ||
numeric: "804" | ||
}, { | ||
alpha2: "AE", | ||
name: "United Arab Emirates", | ||
alpha3: "ARE", | ||
numeric: "784" | ||
}, { | ||
alpha2: "GB", | ||
name: "United Kingdom", | ||
alpha3: "GBR", | ||
numeric: "826" | ||
}, { | ||
alpha2: "US", | ||
name: "United States", | ||
alpha3: "USA", | ||
numeric: "840" | ||
}, { | ||
alpha2: "UM", | ||
name: "United States Minor Outlying Islands", | ||
alpha3: "UMI", | ||
numeric: "581" | ||
}, { | ||
alpha2: "UY", | ||
name: "Uruguay", | ||
alpha3: "URY", | ||
numeric: "858" | ||
}, { | ||
alpha2: "UZ", | ||
name: "Uzbekistan", | ||
alpha3: "UZB", | ||
numeric: "860" | ||
}, { | ||
alpha2: "VU", | ||
name: "Vanuatu", | ||
alpha3: "VUT", | ||
numeric: "548" | ||
}, { | ||
alpha2: "VE", | ||
name: "Venezuela", | ||
alpha3: "VEN", | ||
numeric: "862" | ||
}, { | ||
alpha2: "VN", | ||
name: "Viet Nam", | ||
alpha3: "VNM", | ||
numeric: "704" | ||
}, { | ||
alpha2: "VG", | ||
name: "Virgin Islands, British", | ||
alpha3: "VGB", | ||
numeric: "092" | ||
}, { | ||
alpha2: "VI", | ||
name: "Virgin Islands, U.S.", | ||
alpha3: "VIR", | ||
numeric: "850" | ||
}, { | ||
alpha2: "WF", | ||
name: "Wallis and Futuna", | ||
alpha3: "WLF", | ||
numeric: "876" | ||
}, { | ||
alpha2: "EH", | ||
name: "Western Sahara", | ||
alpha3: "ESH", | ||
numeric: "732" | ||
}, { | ||
alpha2: "YE", | ||
name: "Yemen", | ||
alpha3: "YEM", | ||
numeric: "887" | ||
}, { | ||
alpha2: "ZM", | ||
name: "Zambia", | ||
alpha3: "ZMB", | ||
numeric: "894" | ||
}, { | ||
alpha2: "ZW", | ||
name: "Zimbabwe", | ||
alpha3: "ZWE", | ||
numeric: "716" | ||
}, { | ||
alpha2: "AX", | ||
name: "Åland Islands", | ||
alpha3: "ALA", | ||
numeric: "248" | ||
}]; | ||
exports.countries = countries; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isoCountryLookup = exports.countries = void 0; | ||
exports.countries = [ | ||
{ alpha2: "AF", name: "Afghanistan", alpha3: "AFG", numeric: "004" }, | ||
{ alpha2: "AL", name: "Albania", alpha3: "ALB", numeric: "008" }, | ||
{ alpha2: "DZ", name: "Algeria", alpha3: "DZA", numeric: "012" }, | ||
{ alpha2: "AS", name: "American Samoa", alpha3: "ASM", numeric: "016" }, | ||
{ alpha2: "AD", name: "Andorra", alpha3: "AND", numeric: "020" }, | ||
{ alpha2: "AO", name: "Angola", alpha3: "AGO", numeric: "024" }, | ||
{ alpha2: "AI", name: "Anguilla", alpha3: "AIA", numeric: "660" }, | ||
{ alpha2: "AQ", name: "Antarctica", alpha3: "ATA", numeric: "010" }, | ||
{ alpha2: "AG", name: "Antigua and Barbuda", alpha3: "ATG", numeric: "028" }, | ||
{ alpha2: "AR", name: "Argentina", alpha3: "ARG", numeric: "032" }, | ||
{ alpha2: "AM", name: "Armenia", alpha3: "ARM", numeric: "051" }, | ||
{ alpha2: "AW", name: "Aruba", alpha3: "ABW", numeric: "533" }, | ||
{ alpha2: "AU", name: "Australia", alpha3: "AUS", numeric: "036" }, | ||
{ alpha2: "AT", name: "Austria", alpha3: "AUT", numeric: "040" }, | ||
{ alpha2: "AZ", name: "Azerbaijan", alpha3: "AZE", numeric: "031" }, | ||
{ alpha2: "BS", name: "Bahamas", alpha3: "BHS", numeric: "044" }, | ||
{ alpha2: "BH", name: "Bahrain", alpha3: "BHR", numeric: "048" }, | ||
{ alpha2: "BD", name: "Bangladesh", alpha3: "BGD", numeric: "050" }, | ||
{ alpha2: "BB", name: "Barbados", alpha3: "BRB", numeric: "052" }, | ||
{ alpha2: "BY", name: "Belarus", alpha3: "BLR", numeric: "112" }, | ||
{ alpha2: "BE", name: "Belgium", alpha3: "BEL", numeric: "056" }, | ||
{ alpha2: "BZ", name: "Belize", alpha3: "BLZ", numeric: "084" }, | ||
{ alpha2: "BJ", name: "Benin", alpha3: "BEN", numeric: "204" }, | ||
{ alpha2: "BM", name: "Bermuda", alpha3: "BMU", numeric: "060" }, | ||
{ alpha2: "BT", name: "Bhutan", alpha3: "BTN", numeric: "064" }, | ||
{ alpha2: "BO", name: "Bolivia", alpha3: "BOL", numeric: "068" }, | ||
{ | ||
alpha2: "BQ", | ||
name: "Bonaire, Sint Eustatius and Saba", | ||
alpha3: "BES", | ||
numeric: "535", | ||
}, | ||
{ | ||
alpha2: "BA", | ||
name: "Bosnia and Herzegovina", | ||
alpha3: "BIH", | ||
numeric: "070", | ||
}, | ||
{ alpha2: "BW", name: "Botswana", alpha3: "BWA", numeric: "072" }, | ||
{ alpha2: "BV", name: "Bouvet Island", alpha3: "BVD", numeric: "074" }, | ||
{ alpha2: "BR", name: "Brazil", alpha3: "BRA", numeric: "076" }, | ||
{ | ||
alpha2: "IO", | ||
name: "British Indian Ocean Territory", | ||
alpha3: "IOT", | ||
numeric: "086", | ||
}, | ||
{ alpha2: "BN", name: "Brunei Darussalam", alpha3: "BRN", numeric: "096" }, | ||
{ alpha2: "BG", name: "Bulgaria", alpha3: "BGR", numeric: "100" }, | ||
{ alpha2: "BF", name: "Burkina Faso", alpha3: "BFA", numeric: "854" }, | ||
{ alpha2: "BI", name: "Burundi", alpha3: "BDI", numeric: "108" }, | ||
{ alpha2: "KH", name: "Cambodia", alpha3: "KHM", numeric: "116" }, | ||
{ alpha2: "CM", name: "Cameroon", alpha3: "CMR", numeric: "120" }, | ||
{ alpha2: "CA", name: "Canada", alpha3: "CAN", numeric: "124" }, | ||
{ alpha2: "CV", name: "Cape Verde", alpha3: "CPV", numeric: "132" }, | ||
{ alpha2: "KY", name: "Cayman Islands", alpha3: "CYM", numeric: "136" }, | ||
{ | ||
alpha2: "CF", | ||
name: "Central African Republic", | ||
alpha3: "CAF", | ||
numeric: "140", | ||
}, | ||
{ alpha2: "TD", name: "Chad", alpha3: "TCD", numeric: "148" }, | ||
{ alpha2: "CL", name: "Chile", alpha3: "CHL", numeric: "152" }, | ||
{ alpha2: "CN", name: "China", alpha3: "CHN", numeric: "156" }, | ||
{ alpha2: "CX", name: "Christmas Island", alpha3: "CXR", numeric: "162" }, | ||
{ | ||
alpha2: "CC", | ||
name: "Cocos (Keeling) Islands", | ||
alpha3: "CCK", | ||
numeric: "166", | ||
}, | ||
{ alpha2: "CO", name: "Colombia", alpha3: "COL", numeric: "170" }, | ||
{ alpha2: "KM", name: "Comoros", alpha3: "COM", numeric: "174" }, | ||
{ alpha2: "CG", name: "Congo", alpha3: "COG", numeric: "178" }, | ||
{ | ||
alpha2: "CD", | ||
name: "Congo, the Democratic Republic of the", | ||
alpha3: "COD", | ||
numeric: "180", | ||
}, | ||
{ alpha2: "CK", name: "Cook Islands", alpha3: "COK", numeric: "184" }, | ||
{ alpha2: "CR", name: "Costa Rica", alpha3: "CRI", numeric: "188" }, | ||
{ alpha2: "CI", name: "Cote D'Ivoire", alpha3: "CIV", numeric: "384" }, | ||
{ alpha2: "HR", name: "Croatia", alpha3: "HRV", numeric: "191" }, | ||
{ alpha2: "CU", name: "Cuba", alpha3: "CUB", numeric: "192" }, | ||
{ alpha2: "CW", name: "Curaçao", alpha3: "CUW", numeric: "531" }, | ||
{ alpha2: "CY", name: "Cyprus", alpha3: "CYP", numeric: "196" }, | ||
{ alpha2: "CZ", name: "Czech Republic", alpha3: "CZE", numeric: "203" }, | ||
{ alpha2: "DK", name: "Denmark", alpha3: "DNK", numeric: "208" }, | ||
{ alpha2: "DJ", name: "Djibouti", alpha3: "DJI", numeric: "262" }, | ||
{ alpha2: "DM", name: "Dominica", alpha3: "DMA", numeric: "212" }, | ||
{ alpha2: "DO", name: "Dominican Republic", alpha3: "DOM", numeric: "214" }, | ||
{ alpha2: "EC", name: "Ecuador", alpha3: "ECU", numeric: "218" }, | ||
{ alpha2: "EG", name: "Egypt", alpha3: "EGY", numeric: "818" }, | ||
{ alpha2: "SV", name: "El Salvador", alpha3: "SLV", numeric: "222" }, | ||
{ alpha2: "GQ", name: "Equatorial Guinea", alpha3: "GNQ", numeric: "226" }, | ||
{ alpha2: "ER", name: "Eritrea", alpha3: "ERI", numeric: "232" }, | ||
{ alpha2: "EE", name: "Estonia", alpha3: "EST", numeric: "233" }, | ||
{ alpha2: "ET", name: "Ethiopia", alpha3: "ETH", numeric: "231" }, | ||
{ | ||
alpha2: "FK", | ||
name: "Falkland Islands (Malvinas)", | ||
alpha3: "FLK", | ||
numeric: "238", | ||
}, | ||
{ alpha2: "FO", name: "Faroe Islands", alpha3: "FRO", numeric: "234" }, | ||
{ alpha2: "FJ", name: "Fiji", alpha3: "FJI", numeric: "242" }, | ||
{ alpha2: "FI", name: "Finland", alpha3: "FIN", numeric: "246" }, | ||
{ alpha2: "FR", name: "France", alpha3: "FRA", numeric: "250" }, | ||
{ alpha2: "GF", name: "French Guiana", alpha3: "GUF", numeric: "254" }, | ||
{ alpha2: "PF", name: "French Polynesia", alpha3: "PYF", numeric: "258" }, | ||
{ | ||
alpha2: "TF", | ||
name: "French Southern Territories", | ||
alpha3: "ATF", | ||
numeric: "260", | ||
}, | ||
{ alpha2: "GA", name: "Gabon", alpha3: "GAB", numeric: "266" }, | ||
{ alpha2: "GM", name: "Gambia", alpha3: "GMB", numeric: "270" }, | ||
{ alpha2: "GE", name: "Georgia", alpha3: "GEO", numeric: "268" }, | ||
{ alpha2: "DE", name: "Germany", alpha3: "DEU", numeric: "276" }, | ||
{ alpha2: "GH", name: "Ghana", alpha3: "GHA", numeric: "288" }, | ||
{ alpha2: "GI", name: "Gibraltar", alpha3: "GIB", numeric: "292" }, | ||
{ alpha2: "GR", name: "Greece", alpha3: "GRC", numeric: "300" }, | ||
{ alpha2: "GL", name: "Greenland", alpha3: "GRL", numeric: "304" }, | ||
{ alpha2: "GD", name: "Grenada", alpha3: "GRD", numeric: "308" }, | ||
{ alpha2: "GP", name: "Guadeloupe", alpha3: "GLP", numeric: "312" }, | ||
{ alpha2: "GU", name: "Guam", alpha3: "GUM", numeric: "316" }, | ||
{ alpha2: "GT", name: "Guatemala", alpha3: "GTM", numeric: "320" }, | ||
{ alpha2: "GG", name: "Guernsey", alpha3: "GGY", numeric: "831" }, | ||
{ alpha2: "GN", name: "Guinea", alpha3: "GIN", numeric: "324" }, | ||
{ alpha2: "GW", name: "Guinea-Bissau", alpha3: "GNB", numeric: "624" }, | ||
{ alpha2: "GY", name: "Guyana", alpha3: "GUY", numeric: "328" }, | ||
{ alpha2: "HT", name: "Haiti", alpha3: "HTI", numeric: "332" }, | ||
{ | ||
alpha2: "HM", | ||
name: "Heard Island And Mcdonald Islands", | ||
alpha3: "HMD", | ||
numeric: "334", | ||
}, | ||
{ | ||
alpha2: "VA", | ||
name: "Holy See (Vatican City State)", | ||
alpha3: "VAT", | ||
numeric: "336", | ||
}, | ||
{ alpha2: "HN", name: "Honduras", alpha3: "HND", numeric: "340" }, | ||
{ alpha2: "HK", name: "Hong Kong", alpha3: "HKG", numeric: "344" }, | ||
{ alpha2: "HU", name: "Hungary", alpha3: "HUN", numeric: "348" }, | ||
{ alpha2: "IS", name: "Iceland", alpha3: "ISL", numeric: "352" }, | ||
{ alpha2: "IN", name: "India", alpha3: "IND", numeric: "356" }, | ||
{ alpha2: "ID", name: "Indonesia", alpha3: "IDN", numeric: "360" }, | ||
{ | ||
alpha2: "IR", | ||
name: "Iran, Islamic Republic of", | ||
alpha3: "IRN", | ||
numeric: "364", | ||
}, | ||
{ alpha2: "IQ", name: "Iraq", alpha3: "IRQ", numeric: "368" }, | ||
{ alpha2: "IE", name: "Ireland", alpha3: "IRL", numeric: "372" }, | ||
{ alpha2: "IM", name: "Isle Of Man", alpha3: "IMN", numeric: "833" }, | ||
{ alpha2: "IL", name: "Israel", alpha3: "ISR", numeric: "376" }, | ||
{ alpha2: "IT", name: "Italy", alpha3: "ITA", numeric: "380" }, | ||
{ alpha2: "JM", name: "Jamaica", alpha3: "JAM", numeric: "388" }, | ||
{ alpha2: "JP", name: "Japan", alpha3: "JPN", numeric: "392" }, | ||
{ alpha2: "JE", name: "Jersey", alpha3: "JEY", numeric: "832" }, | ||
{ alpha2: "JO", name: "Jordan", alpha3: "JOR", numeric: "400" }, | ||
{ alpha2: "KZ", name: "Kazakhstan", alpha3: "KAZ", numeric: "398" }, | ||
{ alpha2: "KE", name: "Kenya", alpha3: "KEN", numeric: "404" }, | ||
{ alpha2: "KI", name: "Kiribati", alpha3: "KIR", numeric: "296" }, | ||
{ | ||
alpha2: "KP", | ||
name: "Korea, Democratic People's Republic of", | ||
alpha3: "PRK", | ||
numeric: "408", | ||
}, | ||
{ alpha2: "KR", name: "Korea, Republic of", alpha3: "KOR", numeric: "410" }, | ||
{ alpha2: "XK", name: "Kosovo", alpha3: "XKX", numeric: "900" }, | ||
{ alpha2: "KW", name: "Kuwait", alpha3: "KWT", numeric: "414" }, | ||
{ alpha2: "KG", name: "Kyrgyzstan", alpha3: "KGZ", numeric: "417" }, | ||
{ | ||
alpha2: "LA", | ||
name: "Lao People's Democratic Republic", | ||
alpha3: "LAO", | ||
numeric: "418", | ||
}, | ||
{ alpha2: "LV", name: "Latvia", alpha3: "LVA", numeric: "428" }, | ||
{ alpha2: "LB", name: "Lebanon", alpha3: "LBN", numeric: "422" }, | ||
{ alpha2: "LS", name: "Lesotho", alpha3: "LSO", numeric: "426" }, | ||
{ alpha2: "LR", name: "Liberia", alpha3: "LBR", numeric: "430" }, | ||
{ | ||
alpha2: "LY", | ||
name: "Libyan Arab Jamahiriya", | ||
alpha3: "LBY", | ||
numeric: "434", | ||
}, | ||
{ alpha2: "LI", name: "Liechtenstein", alpha3: "LIE", numeric: "438" }, | ||
{ alpha2: "LT", name: "Lithuania", alpha3: "LTU", numeric: "440" }, | ||
{ alpha2: "LU", name: "Luxembourg", alpha3: "LUX", numeric: "442" }, | ||
{ alpha2: "MO", name: "Macao", alpha3: "MAC", numeric: "446" }, | ||
{ | ||
alpha2: "MK", | ||
name: "Macedonia, the Former Yugoslav Republic of", | ||
alpha3: "MKD", | ||
numeric: "807", | ||
}, | ||
{ alpha2: "MG", name: "Madagascar", alpha3: "MDG", numeric: "450" }, | ||
{ alpha2: "MW", name: "Malawi", alpha3: "MWI", numeric: "454" }, | ||
{ alpha2: "MY", name: "Malaysia", alpha3: "MYS", numeric: "458" }, | ||
{ alpha2: "MV", name: "Maldives", alpha3: "MDV", numeric: "462" }, | ||
{ alpha2: "ML", name: "Mali", alpha3: "MLI", numeric: "466" }, | ||
{ alpha2: "MT", name: "Malta", alpha3: "MLT", numeric: "470" }, | ||
{ alpha2: "MH", name: "Marshall Islands", alpha3: "MHL", numeric: "584" }, | ||
{ alpha2: "MQ", name: "Martinique", alpha3: "MTQ", numeric: "474" }, | ||
{ alpha2: "MR", name: "Mauritania", alpha3: "MRT", numeric: "478" }, | ||
{ alpha2: "MU", name: "Mauritius", alpha3: "MUS", numeric: "480" }, | ||
{ alpha2: "YT", name: "Mayotte", alpha3: "MYT", numeric: "175" }, | ||
{ alpha2: "MX", name: "Mexico", alpha3: "MEX", numeric: "484" }, | ||
{ | ||
alpha2: "FM", | ||
name: "Micronesia, Federated States of", | ||
alpha3: "FSM", | ||
numeric: "583", | ||
}, | ||
{ alpha2: "MD", name: "Moldova, Republic of", alpha3: "MDA", numeric: "498" }, | ||
{ alpha2: "MC", name: "Monaco", alpha3: "MCO", numeric: "492" }, | ||
{ alpha2: "MN", name: "Mongolia", alpha3: "MNG", numeric: "496" }, | ||
{ alpha2: "ME", name: "Montenegro", alpha3: "MNE", numeric: "499" }, | ||
{ alpha2: "MS", name: "Montserrat", alpha3: "MSR", numeric: "500" }, | ||
{ alpha2: "MA", name: "Morocco", alpha3: "MAR", numeric: "504" }, | ||
{ alpha2: "MZ", name: "Mozambique", alpha3: "MOZ", numeric: "508" }, | ||
{ alpha2: "MM", name: "Myanmar", alpha3: "MMR", numeric: "104" }, | ||
{ alpha2: "NA", name: "Namibia", alpha3: "NAM", numeric: "516" }, | ||
{ alpha2: "NR", name: "Nauru", alpha3: "NRU", numeric: "520" }, | ||
{ alpha2: "NP", name: "Nepal", alpha3: "NPL", numeric: "524" }, | ||
{ alpha2: "NL", name: "Netherlands", alpha3: "NLD", numeric: "528" }, | ||
{ alpha2: "NC", name: "New Caledonia", alpha3: "NCL", numeric: "540" }, | ||
{ alpha2: "NZ", name: "New Zealand", alpha3: "NZL", numeric: "554" }, | ||
{ alpha2: "NI", name: "Nicaragua", alpha3: "NIC", numeric: "558" }, | ||
{ alpha2: "NE", name: "Niger", alpha3: "NER", numeric: "562" }, | ||
{ alpha2: "NG", name: "Nigeria", alpha3: "NGA", numeric: "566" }, | ||
{ alpha2: "NU", name: "Niue", alpha3: "NIU", numeric: "570" }, | ||
{ alpha2: "NF", name: "Norfolk Island", alpha3: "NFK", numeric: "574" }, | ||
{ | ||
alpha2: "MP", | ||
name: "Northern Mariana Islands", | ||
alpha3: "MNP", | ||
numeric: "580", | ||
}, | ||
{ alpha2: "NO", name: "Norway", alpha3: "NOR", numeric: "578" }, | ||
{ alpha2: "OM", name: "Oman", alpha3: "OMN", numeric: "512" }, | ||
{ alpha2: "PK", name: "Pakistan", alpha3: "PAK", numeric: "586" }, | ||
{ alpha2: "PW", name: "Palau", alpha3: "PLW", numeric: "585" }, | ||
{ | ||
alpha2: "PS", | ||
name: "Palestinian Territory, Occupied", | ||
alpha3: "PSE", | ||
numeric: "275", | ||
}, | ||
{ alpha2: "PA", name: "Panama", alpha3: "PAN", numeric: "591" }, | ||
{ alpha2: "PG", name: "Papua New Guinea", alpha3: "PNG", numeric: "598" }, | ||
{ alpha2: "PY", name: "Paraguay", alpha3: "PRY", numeric: "600" }, | ||
{ alpha2: "PE", name: "Peru", alpha3: "PER", numeric: "604" }, | ||
{ alpha2: "PH", name: "Philippines", alpha3: "PHL", numeric: "608" }, | ||
{ alpha2: "PN", name: "Pitcairn", alpha3: "PCN", numeric: "612" }, | ||
{ alpha2: "PL", name: "Poland", alpha3: "POL", numeric: "616" }, | ||
{ alpha2: "PT", name: "Portugal", alpha3: "PRT", numeric: "620" }, | ||
{ alpha2: "PR", name: "Puerto Rico", alpha3: "PRI", numeric: "630" }, | ||
{ alpha2: "QA", name: "Qatar", alpha3: "QAT", numeric: "634" }, | ||
{ alpha2: "RE", name: "Reunion", alpha3: "REU", numeric: "638" }, | ||
{ alpha2: "RO", name: "Romania", alpha3: "ROU", numeric: "642" }, | ||
{ alpha2: "RO", name: "Romania", alpha3: "ROM", numeric: "642" }, | ||
{ alpha2: "RU", name: "Russian Federation", alpha3: "RUS", numeric: "643" }, | ||
{ alpha2: "RW", name: "Rwanda", alpha3: "RWA", numeric: "646" }, | ||
{ alpha2: "BL", name: "Saint Barthélemy", alpha3: "BLM", numeric: "652" }, | ||
{ alpha2: "SH", name: "Saint Helena", alpha3: "SHN", numeric: "654" }, | ||
{ | ||
alpha2: "KN", | ||
name: "Saint Kitts and Nevis", | ||
alpha3: "KNA", | ||
numeric: "659", | ||
}, | ||
{ alpha2: "LC", name: "Saint Lucia", alpha3: "LCA", numeric: "662" }, | ||
{ | ||
alpha2: "MF", | ||
name: "Saint Martin (French part)", | ||
alpha3: "MAF", | ||
numeric: "663", | ||
}, | ||
{ | ||
alpha2: "PM", | ||
name: "Saint Pierre and Miquelon", | ||
alpha3: "SPM", | ||
numeric: "666", | ||
}, | ||
{ | ||
alpha2: "VC", | ||
name: "Saint Vincent and the Grenadines", | ||
alpha3: "VCT", | ||
numeric: "670", | ||
}, | ||
{ alpha2: "WS", name: "Samoa", alpha3: "WSM", numeric: "882" }, | ||
{ alpha2: "SM", name: "San Marino", alpha3: "SMR", numeric: "674" }, | ||
{ | ||
alpha2: "ST", | ||
name: "Sao Tome and Principe", | ||
alpha3: "STP", | ||
numeric: "678", | ||
}, | ||
{ alpha2: "SA", name: "Saudi Arabia", alpha3: "SAU", numeric: "682" }, | ||
{ alpha2: "SN", name: "Senegal", alpha3: "SEN", numeric: "686" }, | ||
{ alpha2: "RS", name: "Serbia", alpha3: "SRB", numeric: "688" }, | ||
{ alpha2: "SC", name: "Seychelles", alpha3: "SYC", numeric: "690" }, | ||
{ alpha2: "SL", name: "Sierra Leone", alpha3: "SLE", numeric: "694" }, | ||
{ alpha2: "SG", name: "Singapore", alpha3: "SGP", numeric: "702" }, | ||
{ alpha2: "SX", name: "Sint Maarten", alpha3: "SXM", numeric: "534" }, | ||
{ alpha2: "SK", name: "Slovakia", alpha3: "SVK", numeric: "703" }, | ||
{ alpha2: "SI", name: "Slovenia", alpha3: "SVN", numeric: "705" }, | ||
{ alpha2: "SB", name: "Solomon Islands", alpha3: "SLB", numeric: "090" }, | ||
{ alpha2: "SO", name: "Somalia", alpha3: "SOM", numeric: "706" }, | ||
{ alpha2: "ZA", name: "South Africa", alpha3: "ZAF", numeric: "710" }, | ||
{ | ||
alpha2: "GS", | ||
name: "South Georgia and the South Sandwich Islands", | ||
alpha3: "SGS", | ||
numeric: "239", | ||
}, | ||
{ alpha2: "SS", name: "South Sudan", alpha3: "SSD", numeric: "728" }, | ||
{ alpha2: "ES", name: "Spain", alpha3: "ESP", numeric: "724" }, | ||
{ alpha2: "LK", name: "Sri Lanka", alpha3: "LKA", numeric: "144" }, | ||
{ alpha2: "SD", name: "Sudan", alpha3: "SDN", numeric: "729" }, | ||
{ alpha2: "SR", name: "Suriname", alpha3: "SUR", numeric: "740" }, | ||
{ | ||
alpha2: "SJ", | ||
name: "Svalbard and Jan Mayen", | ||
alpha3: "SJM", | ||
numeric: "744", | ||
}, | ||
{ alpha2: "SZ", name: "Swaziland", alpha3: "SWZ", numeric: "748" }, | ||
{ alpha2: "SE", name: "Sweden", alpha3: "SWE", numeric: "752" }, | ||
{ alpha2: "CH", name: "Switzerland", alpha3: "CHE", numeric: "756" }, | ||
{ alpha2: "SY", name: "Syrian Arab Republic", alpha3: "SYR", numeric: "760" }, | ||
{ | ||
alpha2: "TW", | ||
name: "Taiwan, Province of China", | ||
alpha3: "TWN", | ||
numeric: "158", | ||
}, | ||
{ alpha2: "TJ", name: "Tajikistan", alpha3: "TJK", numeric: "762" }, | ||
{ | ||
alpha2: "TZ", | ||
name: "Tanzania, United Republic of", | ||
alpha3: "TZA", | ||
numeric: "834", | ||
}, | ||
{ alpha2: "TH", name: "Thailand", alpha3: "THA", numeric: "764" }, | ||
{ alpha2: "TL", name: "Timor Leste", alpha3: "TLS", numeric: "626" }, | ||
{ alpha2: "TG", name: "Togo", alpha3: "TGO", numeric: "768" }, | ||
{ alpha2: "TK", name: "Tokelau", alpha3: "TKL", numeric: "772" }, | ||
{ alpha2: "TO", name: "Tonga", alpha3: "TON", numeric: "776" }, | ||
{ alpha2: "TT", name: "Trinidad and Tobago", alpha3: "TTO", numeric: "780" }, | ||
{ alpha2: "TN", name: "Tunisia", alpha3: "TUN", numeric: "788" }, | ||
{ alpha2: "TR", name: "Turkey", alpha3: "TUR", numeric: "792" }, | ||
{ alpha2: "TM", name: "Turkmenistan", alpha3: "TKM", numeric: "795" }, | ||
{ | ||
alpha2: "TC", | ||
name: "Turks and Caicos Islands", | ||
alpha3: "TCA", | ||
numeric: "796", | ||
}, | ||
{ alpha2: "TV", name: "Tuvalu", alpha3: "TUV", numeric: "798" }, | ||
{ alpha2: "UG", name: "Uganda", alpha3: "UGA", numeric: "800" }, | ||
{ alpha2: "UA", name: "Ukraine", alpha3: "UKR", numeric: "804" }, | ||
{ alpha2: "AE", name: "United Arab Emirates", alpha3: "ARE", numeric: "784" }, | ||
{ alpha2: "GB", name: "United Kingdom", alpha3: "GBR", numeric: "826" }, | ||
{ alpha2: "US", name: "United States", alpha3: "USA", numeric: "840" }, | ||
{ | ||
alpha2: "UM", | ||
name: "United States Minor Outlying Islands", | ||
alpha3: "UMI", | ||
numeric: "581", | ||
}, | ||
{ alpha2: "UY", name: "Uruguay", alpha3: "URY", numeric: "858" }, | ||
{ alpha2: "UZ", name: "Uzbekistan", alpha3: "UZB", numeric: "860" }, | ||
{ alpha2: "VU", name: "Vanuatu", alpha3: "VUT", numeric: "548" }, | ||
{ alpha2: "VE", name: "Venezuela", alpha3: "VEN", numeric: "862" }, | ||
{ alpha2: "VN", name: "Viet Nam", alpha3: "VNM", numeric: "704" }, | ||
{ | ||
alpha2: "VG", | ||
name: "Virgin Islands, British", | ||
alpha3: "VGB", | ||
numeric: "092", | ||
}, | ||
{ alpha2: "VI", name: "Virgin Islands, U.S.", alpha3: "VIR", numeric: "850" }, | ||
{ alpha2: "WF", name: "Wallis and Futuna", alpha3: "WLF", numeric: "876" }, | ||
{ alpha2: "EH", name: "Western Sahara", alpha3: "ESH", numeric: "732" }, | ||
{ alpha2: "YE", name: "Yemen", alpha3: "YEM", numeric: "887" }, | ||
{ alpha2: "ZM", name: "Zambia", alpha3: "ZMB", numeric: "894" }, | ||
{ alpha2: "ZW", name: "Zimbabwe", alpha3: "ZWE", numeric: "716" }, | ||
{ alpha2: "AX", name: "Åland Islands", alpha3: "ALA", numeric: "248" }, | ||
]; | ||
function isoCountryLookup(country) { | ||
var normalizedCountry = country.toUpperCase(); | ||
var isoRecord = countries.find(function (record) { | ||
return record.name === normalizedCountry; | ||
}); // Try alpha2 instead | ||
if (!isoRecord) { | ||
isoRecord = countries.find(function (record) { | ||
return record.alpha2 === normalizedCountry; | ||
var normalizedCountry = country.toUpperCase(); | ||
var isoRecord = exports.countries.find(function (record) { | ||
return record.name === normalizedCountry; | ||
}); | ||
} // Try alpha3 | ||
if (!isoRecord) { | ||
isoRecord = countries.find(function (record) { | ||
return record.alpha3 === normalizedCountry; | ||
}); | ||
} | ||
if (!isoRecord) { | ||
throw new Error("Invalid country name"); | ||
} | ||
return isoRecord.alpha2; | ||
} | ||
// Try alpha2 instead | ||
if (!isoRecord) { | ||
isoRecord = exports.countries.find(function (record) { | ||
return record.alpha2 === normalizedCountry; | ||
}); | ||
} | ||
// Try alpha3 | ||
if (!isoRecord) { | ||
isoRecord = exports.countries.find(function (record) { | ||
return record.alpha3 === normalizedCountry; | ||
}); | ||
} | ||
if (!isoRecord) { | ||
throw new Error("Invalid country name"); | ||
} | ||
return isoRecord.alpha2; | ||
} | ||
exports.isoCountryLookup = isoCountryLookup; | ||
//# sourceMappingURL=countries.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _module = _interopRequireDefault(require("module")); | ||
var _path = _interopRequireDefault(require("path")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var fallback = function fallback(filename) { | ||
var mod = new _module["default"](filename); | ||
mod.filename = filename; | ||
mod.paths = _module["default"]._nodeModulePaths(_path["default"].dirname(filename)); | ||
mod._compile("module.exports = require;", filename); | ||
return mod.exports; | ||
}; // Polyfill Node's `Module.createRequireFromPath` if not present (added in Node v10.12.0) | ||
var createRequireFromPath = _module["default"].createRequire || _module["default"].createRequireFromPath || fallback; | ||
var _default = createRequireFromPath; | ||
exports["default"] = _default; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var module_1 = __importDefault(require("module")); | ||
var path_1 = __importDefault(require("path")); | ||
var fallback = function (filename) { | ||
var mod = new module_1.default(filename); | ||
mod.filename = filename; | ||
mod.paths = module_1.default._nodeModulePaths(path_1.default.dirname(filename)); | ||
mod._compile("module.exports = require;", filename); | ||
return mod.exports; | ||
}; | ||
// Polyfill Node's `Module.createRequireFromPath` if not present (added in Node v10.12.0) | ||
var createRequireFromPath = module_1.default.createRequire || module_1.default.createRequireFromPath || fallback; | ||
exports.default = createRequireFromPath; | ||
//# sourceMappingURL=create-require-from-path.js.map |
"use strict"; | ||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = exports.MedusaErrorCodes = exports.MedusaErrorTypes = void 0; | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); } | ||
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); } | ||
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; } } | ||
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; } | ||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MedusaErrorCodes = exports.MedusaErrorTypes = void 0; | ||
/** | ||
@@ -36,15 +23,14 @@ * @typedef MedusaErrorType | ||
*/ | ||
var MedusaErrorTypes = { | ||
/** Errors stemming from the database */ | ||
DB_ERROR: "database_error", | ||
DUPLICATE_ERROR: "duplicate_error", | ||
INVALID_ARGUMENT: "invalid_argument", | ||
INVALID_DATA: "invalid_data", | ||
NOT_FOUND: "not_found", | ||
NOT_ALLOWED: "not_allowed" | ||
exports.MedusaErrorTypes = { | ||
/** Errors stemming from the database */ | ||
DB_ERROR: "database_error", | ||
DUPLICATE_ERROR: "duplicate_error", | ||
INVALID_ARGUMENT: "invalid_argument", | ||
INVALID_DATA: "invalid_data", | ||
NOT_FOUND: "not_found", | ||
NOT_ALLOWED: "not_allowed", | ||
}; | ||
exports.MedusaErrorTypes = MedusaErrorTypes; | ||
var MedusaErrorCodes = { | ||
INSUFFICIENT_INVENTORY: "insufficient_inventory", | ||
CART_INCOMPATIBLE_STATE: "cart_incompatible_state" | ||
exports.MedusaErrorCodes = { | ||
INSUFFICIENT_INVENTORY: "insufficient_inventory", | ||
CART_INCOMPATIBLE_STATE: "cart_incompatible_state", | ||
}; | ||
@@ -55,44 +41,31 @@ /** | ||
*/ | ||
exports.MedusaErrorCodes = MedusaErrorCodes; | ||
var MedusaError = /*#__PURE__*/function (_Error) { | ||
_inherits(MedusaError, _Error); | ||
var _super = _createSuper(MedusaError); | ||
/** | ||
* Creates a standardized error to be used across Medusa project. | ||
* @param type {MedusaErrorType} - the type of error. | ||
* @param params {Array} - Error params. | ||
*/ | ||
function MedusaError(type, message, code) { | ||
var _this; | ||
_classCallCheck(this, MedusaError); | ||
for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { | ||
params[_key - 3] = arguments[_key]; | ||
var MedusaError = /** @class */ (function (_super) { | ||
__extends(MedusaError, _super); | ||
/** | ||
* Creates a standardized error to be used across Medusa project. | ||
* @param {string} type - type of error | ||
* @param {string} message - message to go along with error | ||
* @param {string} code - code of error | ||
* @param {Array} params - params | ||
*/ | ||
function MedusaError(type, message, code) { | ||
var params = []; | ||
for (var _i = 3; _i < arguments.length; _i++) { | ||
params[_i - 3] = arguments[_i]; | ||
} | ||
var _this = _super.apply(this, params) || this; | ||
if (Error.captureStackTrace) { | ||
Error.captureStackTrace(_this, MedusaError); | ||
} | ||
_this.type = type; | ||
_this.code = code; | ||
_this.message = message; | ||
_this.date = new Date(); | ||
return _this; | ||
} | ||
_this = _super.call.apply(_super, [this].concat(params)); | ||
if (Error.captureStackTrace) { | ||
Error.captureStackTrace(_assertThisInitialized(_this), MedusaError); | ||
} | ||
_this.type = type; | ||
_this.name = type; | ||
_this.code = code; | ||
_this.message = message; | ||
_this.date = new Date(); | ||
return _this; | ||
} | ||
return MedusaError; | ||
}( /*#__PURE__*/_wrapNativeSuper(Error)); | ||
MedusaError.Types = MedusaErrorTypes; | ||
MedusaError.Codes = MedusaErrorCodes; | ||
var _default = MedusaError; | ||
exports["default"] = _default; | ||
MedusaError.Types = exports.MedusaErrorTypes; | ||
MedusaError.Codes = exports.MedusaErrorCodes; | ||
return MedusaError; | ||
}(Error)); | ||
exports.default = MedusaError; | ||
//# sourceMappingURL=errors.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _path = _interopRequireDefault(require("path")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var path_1 = __importDefault(require("path")); | ||
/** | ||
@@ -19,21 +14,15 @@ * Attempts to resolve the config file in a given root directory. | ||
function getConfigFile(rootDir, configName) { | ||
var configPath = _path["default"].join(rootDir, configName); | ||
var configFilePath = ""; | ||
var configModule; | ||
try { | ||
configFilePath = require.resolve(configPath); | ||
configModule = require(configFilePath); | ||
} catch (err) { | ||
return {}; | ||
} | ||
return { | ||
configModule: configModule, | ||
configFilePath: configFilePath | ||
}; | ||
var configPath = path_1.default.join(rootDir, configName); | ||
var configFilePath = ""; | ||
var configModule; | ||
try { | ||
configFilePath = require.resolve(configPath); | ||
configModule = require(configFilePath); | ||
} | ||
catch (err) { | ||
return {}; | ||
} | ||
return { configModule: configModule, configFilePath: configFilePath }; | ||
} | ||
var _default = getConfigFile; | ||
exports["default"] = _default; | ||
exports.default = getConfigFile; | ||
//# sourceMappingURL=get-config-file.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getMedusaVersion = void 0; | ||
var _path = _interopRequireDefault(require("path")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var getMedusaVersion = function getMedusaVersion() { | ||
try { | ||
return require(_path["default"].join(process.cwd(), "node_modules", "@medusajs/medusa", "package.json")).version; | ||
} catch (e) { | ||
return ""; | ||
} | ||
var path_1 = __importDefault(require("path")); | ||
var getMedusaVersion = function () { | ||
try { | ||
return require(path_1.default.join(process.cwd(), "node_modules", "@medusajs/medusa", "package.json")).version; | ||
} | ||
catch (e) { | ||
return ""; | ||
} | ||
}; | ||
exports.getMedusaVersion = getMedusaVersion; | ||
exports.getMedusaVersion = getMedusaVersion; | ||
//# sourceMappingURL=get-medusa-version.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _zeroDecimalCurrencies = _interopRequireDefault(require("./zero-decimal-currencies")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var humanizeAmount = function humanizeAmount(amount, currency) { | ||
var divisor = 100; | ||
if (_zeroDecimalCurrencies["default"].includes(currency.toLowerCase())) { | ||
divisor = 1; | ||
} | ||
return amount / divisor; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
var _default = humanizeAmount; | ||
exports["default"] = _default; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var zero_decimal_currencies_1 = __importDefault(require("./zero-decimal-currencies")); | ||
var humanizeAmount = function (amount, currency) { | ||
var divisor = 100; | ||
if (zero_decimal_currencies_1.default.includes(currency.toLowerCase())) { | ||
divisor = 1; | ||
} | ||
return amount / divisor; | ||
}; | ||
exports.default = humanizeAmount; | ||
//# sourceMappingURL=humanize-amount.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.indexTypes = void 0; | ||
var indexTypes = { | ||
products: "products" | ||
exports.indexTypes = { | ||
products: "products", | ||
}; | ||
exports.indexTypes = indexTypes; | ||
//# sourceMappingURL=index-types.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
Object.defineProperty(exports, "countries", { | ||
enumerable: true, | ||
get: function get() { | ||
return _countries.countries; | ||
} | ||
}); | ||
Object.defineProperty(exports, "isoCountryLookup", { | ||
enumerable: true, | ||
get: function get() { | ||
return _countries.isoCountryLookup; | ||
} | ||
}); | ||
Object.defineProperty(exports, "transformIdableFields", { | ||
enumerable: true, | ||
get: function get() { | ||
return _transformIdableFields.transformIdableFields; | ||
} | ||
}); | ||
Object.defineProperty(exports, "indexTypes", { | ||
enumerable: true, | ||
get: function get() { | ||
return _indexTypes.indexTypes; | ||
} | ||
}); | ||
Object.defineProperty(exports, "Validator", { | ||
enumerable: true, | ||
get: function get() { | ||
return _validator["default"]; | ||
} | ||
}); | ||
Object.defineProperty(exports, "MedusaError", { | ||
enumerable: true, | ||
get: function get() { | ||
return _errors["default"]; | ||
} | ||
}); | ||
Object.defineProperty(exports, "getConfigFile", { | ||
enumerable: true, | ||
get: function get() { | ||
return _getConfigFile["default"]; | ||
} | ||
}); | ||
Object.defineProperty(exports, "createRequireFromPath", { | ||
enumerable: true, | ||
get: function get() { | ||
return _createRequireFromPath["default"]; | ||
} | ||
}); | ||
Object.defineProperty(exports, "compareObjectsByProp", { | ||
enumerable: true, | ||
get: function get() { | ||
return _compareObjects["default"]; | ||
} | ||
}); | ||
Object.defineProperty(exports, "zeroDecimalCurrencies", { | ||
enumerable: true, | ||
get: function get() { | ||
return _zeroDecimalCurrencies["default"]; | ||
} | ||
}); | ||
Object.defineProperty(exports, "humanizeAmount", { | ||
enumerable: true, | ||
get: function get() { | ||
return _humanizeAmount["default"]; | ||
} | ||
}); | ||
var _countries = require("./countries"); | ||
var _transformIdableFields = require("./transform-idable-fields"); | ||
var _indexTypes = require("./index-types"); | ||
var _validator = _interopRequireDefault(require("./validator")); | ||
var _errors = _interopRequireDefault(require("./errors")); | ||
var _getConfigFile = _interopRequireDefault(require("./get-config-file")); | ||
var _createRequireFromPath = _interopRequireDefault(require("./create-require-from-path")); | ||
var _compareObjects = _interopRequireDefault(require("./compare-objects")); | ||
var _zeroDecimalCurrencies = _interopRequireDefault(require("./zero-decimal-currencies")); | ||
var _humanizeAmount = _interopRequireDefault(require("./humanize-amount")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.zeroDecimalCurrencies = exports.Validator = exports.transformIdableFields = exports.indexTypes = exports.humanizeAmount = exports.getConfigFile = exports.MedusaError = exports.createRequireFromPath = exports.isoCountryLookup = exports.countries = exports.compareObjectsByProp = void 0; | ||
var compare_objects_1 = require("./compare-objects"); | ||
Object.defineProperty(exports, "compareObjectsByProp", { enumerable: true, get: function () { return __importDefault(compare_objects_1).default; } }); | ||
var countries_1 = require("./countries"); | ||
Object.defineProperty(exports, "countries", { enumerable: true, get: function () { return countries_1.countries; } }); | ||
Object.defineProperty(exports, "isoCountryLookup", { enumerable: true, get: function () { return countries_1.isoCountryLookup; } }); | ||
var create_require_from_path_1 = require("./create-require-from-path"); | ||
Object.defineProperty(exports, "createRequireFromPath", { enumerable: true, get: function () { return __importDefault(create_require_from_path_1).default; } }); | ||
var errors_1 = require("./errors"); | ||
Object.defineProperty(exports, "MedusaError", { enumerable: true, get: function () { return __importDefault(errors_1).default; } }); | ||
var get_config_file_1 = require("./get-config-file"); | ||
Object.defineProperty(exports, "getConfigFile", { enumerable: true, get: function () { return __importDefault(get_config_file_1).default; } }); | ||
var humanize_amount_1 = require("./humanize-amount"); | ||
Object.defineProperty(exports, "humanizeAmount", { enumerable: true, get: function () { return __importDefault(humanize_amount_1).default; } }); | ||
var index_types_1 = require("./index-types"); | ||
Object.defineProperty(exports, "indexTypes", { enumerable: true, get: function () { return index_types_1.indexTypes; } }); | ||
var transform_idable_fields_1 = require("./transform-idable-fields"); | ||
Object.defineProperty(exports, "transformIdableFields", { enumerable: true, get: function () { return transform_idable_fields_1.transformIdableFields; } }); | ||
var validator_1 = require("./validator"); | ||
Object.defineProperty(exports, "Validator", { enumerable: true, get: function () { return __importDefault(validator_1).default; } }); | ||
var zero_decimal_currencies_1 = require("./zero-decimal-currencies"); | ||
Object.defineProperty(exports, "zeroDecimalCurrencies", { enumerable: true, get: function () { return __importDefault(zero_decimal_currencies_1).default; } }); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.transformIdableFields = void 0; | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
/** | ||
* Takes an object and a list of fields to tranform in that object. If the field | ||
* exists on the object and its value is a string it will append `_id` to the | ||
* exists on the object and its value is a string it will append `_id` to the | ||
* field name. This is used when allowing API calls to hold either ID or object | ||
* values in the payload. The method returns a new object with the | ||
* values in the payload. The method returns a new object with the | ||
* transformation. | ||
@@ -30,26 +25,14 @@ * @param {Object} obj - the object to transform | ||
*/ | ||
var transformIdableFields = function transformIdableFields(obj, fields) { | ||
var ret = _objectSpread({}, obj); | ||
var _iterator = _createForOfIteratorHelper(fields), | ||
_step; | ||
try { | ||
for (_iterator.s(); !(_step = _iterator.n()).done;) { | ||
var key = _step.value; | ||
if (key in obj && typeof ret[key] === "string") { | ||
ret["".concat(key, "_id")] = ret[key]; | ||
delete ret[key]; | ||
} | ||
var transformIdableFields = function (obj, fields) { | ||
var ret = __assign({}, obj); | ||
for (var _i = 0, fields_1 = fields; _i < fields_1.length; _i++) { | ||
var key = fields_1[_i]; | ||
if (key in obj && typeof ret[key] === "string") { | ||
ret[key + "_id"] = ret[key]; | ||
delete ret[key]; | ||
} | ||
} | ||
} catch (err) { | ||
_iterator.e(err); | ||
} finally { | ||
_iterator.f(); | ||
} | ||
return ret; | ||
return ret; | ||
}; | ||
exports.transformIdableFields = transformIdableFields; | ||
exports.transformIdableFields = transformIdableFields; | ||
//# sourceMappingURL=transform-idable-fields.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var _joi = _interopRequireDefault(require("joi")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
_joi["default"].objectId = require("joi-objectid")(_joi["default"]); // if address is a string, we assume that it is an id | ||
_joi["default"].address = function () { | ||
return _joi["default"].alternatives()["try"](_joi["default"].string(), _joi["default"].object().keys({ | ||
first_name: _joi["default"].string().required(), | ||
last_name: _joi["default"].string().required(), | ||
address_1: _joi["default"].string().required(), | ||
address_2: _joi["default"].string().allow(null, "").optional(), | ||
city: _joi["default"].string().required(), | ||
country_code: _joi["default"].string().required(), | ||
province: _joi["default"].string().allow(null, "").optional(), | ||
postal_code: _joi["default"].string().required(), | ||
phone: _joi["default"].string().optional(), | ||
metadata: _joi["default"].object().allow(null, {}).optional() | ||
})); | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
_joi["default"].dateFilter = function () { | ||
return _joi["default"].object({ | ||
lt: _joi["default"].alternatives(_joi["default"].date().timestamp("unix"), _joi["default"].date()), | ||
gt: _joi["default"].alternatives(_joi["default"].date().timestamp("unix"), _joi["default"].date()), | ||
gte: _joi["default"].alternatives(_joi["default"].date().timestamp("unix"), _joi["default"].date()), | ||
lte: _joi["default"].alternatives(_joi["default"].date().timestamp("unix"), _joi["default"].date()) | ||
}); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var joi_1 = __importDefault(require("joi")); | ||
joi_1.default.objectId = require("joi-objectid")(joi_1.default); | ||
// if address is a string, we assume that it is an id | ||
joi_1.default.address = function () { | ||
return joi_1.default.alternatives().try(joi_1.default.string(), joi_1.default.object().keys({ | ||
first_name: joi_1.default.string().required(), | ||
last_name: joi_1.default.string().required(), | ||
address_1: joi_1.default.string().required(), | ||
address_2: joi_1.default.string() | ||
.allow(null, "") | ||
.optional(), | ||
city: joi_1.default.string().required(), | ||
country_code: joi_1.default.string().required(), | ||
province: joi_1.default.string() | ||
.allow(null, "") | ||
.optional(), | ||
postal_code: joi_1.default.string().required(), | ||
phone: joi_1.default.string().optional(), | ||
metadata: joi_1.default.object() | ||
.allow(null, {}) | ||
.optional(), | ||
})); | ||
}; | ||
_joi["default"].orderFilter = function () { | ||
return _joi["default"].object().keys({ | ||
id: _joi["default"].string(), | ||
q: _joi["default"].string(), | ||
status: _joi["default"].array().items(_joi["default"].string().valid("pending", "completed", "archived", "canceled", "requires_action")).single(), | ||
fulfillment_status: _joi["default"].array().items(_joi["default"].string().valid("not_fulfilled", "fulfilled", "partially_fulfilled", "shipped", "partially_shipped", "canceled", "returned", "partially_returned", "requires_action")).single(), | ||
payment_status: _joi["default"].array().items(_joi["default"].string().valid("captured", "awaiting", "not_paid", "refunded", "partially_refunded", "canceled", "requires_action")).single(), | ||
display_id: _joi["default"].string(), | ||
cart_id: _joi["default"].string(), | ||
offset: _joi["default"].string(), | ||
limit: _joi["default"].string(), | ||
expand: _joi["default"].string(), | ||
fields: _joi["default"].string(), | ||
customer_id: _joi["default"].string(), | ||
email: _joi["default"].string(), | ||
region_id: _joi["default"].string(), | ||
currency_code: _joi["default"].string(), | ||
tax_rate: _joi["default"].string(), | ||
canceled_at: _joi["default"].dateFilter(), | ||
created_at: _joi["default"].dateFilter(), | ||
updated_at: _joi["default"].dateFilter() | ||
}); | ||
joi_1.default.dateFilter = function () { | ||
return joi_1.default.object({ | ||
lt: joi_1.default.alternatives(joi_1.default.date().timestamp("unix"), joi_1.default.date()), | ||
gt: joi_1.default.alternatives(joi_1.default.date().timestamp("unix"), joi_1.default.date()), | ||
gte: joi_1.default.alternatives(joi_1.default.date().timestamp("unix"), joi_1.default.date()), | ||
lte: joi_1.default.alternatives(joi_1.default.date().timestamp("unix"), joi_1.default.date()), | ||
}); | ||
}; | ||
_joi["default"].productFilter = function () { | ||
return _joi["default"].object().keys({ | ||
id: _joi["default"].string(), | ||
q: _joi["default"].string().allow(null, ""), | ||
status: _joi["default"].array().items(_joi["default"].string().valid("proposed", "draft", "published", "rejected")).single(), | ||
collection_id: _joi["default"].array().items(_joi["default"].string()).single(), | ||
tags: _joi["default"].array().items(_joi["default"].string()).single(), | ||
title: _joi["default"].string(), | ||
description: _joi["default"].string(), | ||
handle: _joi["default"].string(), | ||
is_giftcard: _joi["default"].string(), | ||
type: _joi["default"].string(), | ||
offset: _joi["default"].string(), | ||
limit: _joi["default"].string(), | ||
expand: _joi["default"].string(), | ||
fields: _joi["default"].string(), | ||
order: _joi["default"].string().optional(), | ||
created_at: _joi["default"].dateFilter(), | ||
updated_at: _joi["default"].dateFilter(), | ||
deleted_at: _joi["default"].dateFilter() | ||
}); | ||
joi_1.default.orderFilter = function () { | ||
return joi_1.default.object().keys({ | ||
id: joi_1.default.string(), | ||
q: joi_1.default.string(), | ||
status: joi_1.default.array() | ||
.items(joi_1.default.string().valid("pending", "completed", "archived", "canceled", "requires_action")) | ||
.single(), | ||
fulfillment_status: joi_1.default.array() | ||
.items(joi_1.default.string().valid("not_fulfilled", "fulfilled", "partially_fulfilled", "shipped", "partially_shipped", "canceled", "returned", "partially_returned", "requires_action")) | ||
.single(), | ||
payment_status: joi_1.default.array() | ||
.items(joi_1.default.string().valid("captured", "awaiting", "not_paid", "refunded", "partially_refunded", "canceled", "requires_action")) | ||
.single(), | ||
display_id: joi_1.default.string(), | ||
cart_id: joi_1.default.string(), | ||
offset: joi_1.default.string(), | ||
limit: joi_1.default.string(), | ||
expand: joi_1.default.string(), | ||
fields: joi_1.default.string(), | ||
customer_id: joi_1.default.string(), | ||
email: joi_1.default.string(), | ||
region_id: joi_1.default.string(), | ||
currency_code: joi_1.default.string(), | ||
tax_rate: joi_1.default.string(), | ||
canceled_at: joi_1.default.dateFilter(), | ||
created_at: joi_1.default.dateFilter(), | ||
updated_at: joi_1.default.dateFilter(), | ||
}); | ||
}; | ||
var _default = _joi["default"]; | ||
exports["default"] = _default; | ||
joi_1.default.productFilter = function () { | ||
return joi_1.default.object().keys({ | ||
id: joi_1.default.string(), | ||
q: joi_1.default.string().allow(null, ""), | ||
status: joi_1.default.array() | ||
.items(joi_1.default.string().valid("proposed", "draft", "published", "rejected")) | ||
.single(), | ||
collection_id: joi_1.default.array() | ||
.items(joi_1.default.string()) | ||
.single(), | ||
tags: joi_1.default.array() | ||
.items(joi_1.default.string()) | ||
.single(), | ||
title: joi_1.default.string(), | ||
description: joi_1.default.string(), | ||
handle: joi_1.default.string(), | ||
is_giftcard: joi_1.default.string(), | ||
type: joi_1.default.string(), | ||
offset: joi_1.default.string(), | ||
limit: joi_1.default.string(), | ||
expand: joi_1.default.string(), | ||
fields: joi_1.default.string(), | ||
order: joi_1.default.string().optional(), | ||
created_at: joi_1.default.dateFilter(), | ||
updated_at: joi_1.default.dateFilter(), | ||
deleted_at: joi_1.default.dateFilter(), | ||
}); | ||
}; | ||
exports.default = joi_1.default; | ||
//# sourceMappingURL=validator.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports["default"] = void 0; | ||
var zeroDecimalCurrencies = ["bif", "clp", "djf", "gnf", "jpy", "kmf", "krw", "mga", "pyg", "rwf", "ugx", "vnd", "vuv", "xaf", "xof", "xpf"]; | ||
var _default = zeroDecimalCurrencies; | ||
exports["default"] = _default; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var zeroDecimalCurrencies = [ | ||
"bif", | ||
"clp", | ||
"djf", | ||
"gnf", | ||
"jpy", | ||
"kmf", | ||
"krw", | ||
"mga", | ||
"pyg", | ||
"rwf", | ||
"ugx", | ||
"vnd", | ||
"vuv", | ||
"xaf", | ||
"xof", | ||
"xpf", | ||
]; | ||
exports.default = zeroDecimalCurrencies; | ||
//# sourceMappingURL=zero-decimal-currencies.js.map |
{ | ||
"name": "medusa-core-utils", | ||
"version": "1.1.26", | ||
"version": "1.1.27-alpha.70+b7329e90", | ||
"description": "Core utils for Medusa", | ||
@@ -13,3 +13,3 @@ "main": "dist/index.js", | ||
"test": "jest", | ||
"build": "babel src --out-dir dist/ --ignore **/__tests__", | ||
"build": "tsc --build", | ||
"prepare": "cross-env NODE_ENV=production npm run build", | ||
@@ -27,7 +27,11 @@ "watch": "babel -w src --out-dir dist/ --ignore **/__tests__" | ||
"@babel/preset-env": "^7.13.9", | ||
"@babel/preset-typescript": "^7.16.0", | ||
"@babel/runtime": "^7.13.9", | ||
"class-transformer": "^0.4.0", | ||
"class-validator": "^0.13.1", | ||
"cross-env": "^5.2.1", | ||
"eslint": "^6.8.0", | ||
"jest": "^25.5.2", | ||
"prettier": "^1.19.1" | ||
"prettier": "^1.19.1", | ||
"typescript": "^4.4.4" | ||
}, | ||
@@ -38,3 +42,3 @@ "dependencies": { | ||
}, | ||
"gitHead": "528fc3a933973a8a790679781077a9122e155c65" | ||
"gitHead": "b7329e90836fe240a6c31afd01ccf99b3ee83754" | ||
} |
@@ -1,11 +0,11 @@ | ||
export { countries } from "./countries" | ||
export { isoCountryLookup } from "./countries" | ||
export { default as compareObjectsByProp } from "./compare-objects" | ||
export { countries, isoCountryLookup } from "./countries" | ||
export { default as createRequireFromPath } from "./create-require-from-path" | ||
export { default as MedusaError } from "./errors" | ||
export { default as getConfigFile } from "./get-config-file" | ||
export { default as humanizeAmount } from "./humanize-amount" | ||
export { indexTypes } from "./index-types" | ||
export { transformIdableFields } from "./transform-idable-fields" | ||
export { indexTypes } from "./index-types" | ||
export { default as Validator } from "./validator" | ||
export { default as MedusaError } from "./errors" | ||
export { default as getConfigFile } from "./get-config-file" | ||
export { default as createRequireFromPath } from "./create-require-from-path" | ||
export { default as compareObjectsByProp } from "./compare-objects" | ||
export { default as zeroDecimalCurrencies } from "./zero-decimal-currencies" | ||
export { default as humanizeAmount } from "./humanize-amount" | ||
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
114351
54
15
1704
2
2