@mirai/core 0.3.343 → 0.3.344
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7,6 +7,7 @@ exports.fetchCurrency = void 0;
|
|
|
7
7
|
var _dataSources = require("@mirai/data-sources");
|
|
8
8
|
var _services = require("@mirai/services");
|
|
9
9
|
const fetchCurrency = async id => {
|
|
10
|
+
var _await$ServiceHotel$g;
|
|
10
11
|
const {
|
|
11
12
|
country
|
|
12
13
|
} = (await (0, _dataSources.request)({
|
|
@@ -17,7 +18,7 @@ const fetchCurrency = async id => {
|
|
|
17
18
|
Authorization: 'Basic YW5vbmltb3VzOmFub25pbW91cw=='
|
|
18
19
|
}
|
|
19
20
|
})) || {};
|
|
20
|
-
return country ? (await _services.ServiceHotel.getCurrencies(id))[country] : undefined;
|
|
21
|
+
return country ? (_await$ServiceHotel$g = await _services.ServiceHotel.getCurrencies(id).catch(() => ({}))) === null || _await$ServiceHotel$g === void 0 ? void 0 : _await$ServiceHotel$g[country] : undefined;
|
|
21
22
|
};
|
|
22
23
|
exports.fetchCurrency = fetchCurrency;
|
|
23
24
|
//# sourceMappingURL=fetchCurrency.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchCurrency.js","names":["_dataSources","require","_services","fetchCurrency","id","country","request","hostname","process","env","SERVICE_CURRENCY","endpoint","headers","undefined","Authorization","ServiceHotel","getCurrencies","exports"],"sources":["../../src/helpers/fetchCurrency.js"],"sourcesContent":["import { request } from '@mirai/data-sources';\nimport { ServiceHotel } from '@mirai/services';\n\nexport const fetchCurrency = async (id) => {\n const { country } =\n (await request({\n hostname: process.env.SERVICE_CURRENCY,\n endpoint: '/ip/get',\n headers: { 'X-Requested-With': undefined, Authorization: 'Basic YW5vbmltb3VzOmFub25pbW91cw==' },\n })) || {};\n\n return country ? (await ServiceHotel.getCurrencies(id))[country] : undefined;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAEO,MAAME,aAAa,GAAG,MAAOC,EAAE,IAAK;EACzC,MAAM;IAAEC;EAAQ,CAAC,GACf,CAAC,MAAM,IAAAC,oBAAO,EAAC;IACbC,QAAQ,EAAEC,OAAO,CAACC,GAAG,CAACC,gBAAgB;IACtCC,QAAQ,EAAE,SAAS;IACnBC,OAAO,EAAE;MAAE,kBAAkB,EAAEC,SAAS;MAAEC,aAAa,EAAE;IAAqC;EAChG,CAAC,CAAC,KAAK,CAAC,CAAC;EAEX,OAAOT,OAAO,
|
|
1
|
+
{"version":3,"file":"fetchCurrency.js","names":["_dataSources","require","_services","fetchCurrency","id","_await$ServiceHotel$g","country","request","hostname","process","env","SERVICE_CURRENCY","endpoint","headers","undefined","Authorization","ServiceHotel","getCurrencies","catch","exports"],"sources":["../../src/helpers/fetchCurrency.js"],"sourcesContent":["import { request } from '@mirai/data-sources';\nimport { ServiceHotel } from '@mirai/services';\n\nexport const fetchCurrency = async (id) => {\n const { country } =\n (await request({\n hostname: process.env.SERVICE_CURRENCY,\n endpoint: '/ip/get',\n headers: { 'X-Requested-With': undefined, Authorization: 'Basic YW5vbmltb3VzOmFub25pbW91cw==' },\n })) || {};\n\n return country ? (await ServiceHotel.getCurrencies(id).catch(() => ({})))?.[country] : undefined;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAEO,MAAME,aAAa,GAAG,MAAOC,EAAE,IAAK;EAAA,IAAAC,qBAAA;EACzC,MAAM;IAAEC;EAAQ,CAAC,GACf,CAAC,MAAM,IAAAC,oBAAO,EAAC;IACbC,QAAQ,EAAEC,OAAO,CAACC,GAAG,CAACC,gBAAgB;IACtCC,QAAQ,EAAE,SAAS;IACnBC,OAAO,EAAE;MAAE,kBAAkB,EAAEC,SAAS;MAAEC,aAAa,EAAE;IAAqC;EAChG,CAAC,CAAC,KAAK,CAAC,CAAC;EAEX,OAAOT,OAAO,IAAAD,qBAAA,GAAI,MAAMW,sBAAY,CAACC,aAAa,CAACb,EAAE,CAAC,CAACc,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,cAAAb,qBAAA,uBAAvDA,qBAAA,CAA2DC,OAAO,CAAC,GAAGQ,SAAS;AAClG,CAAC;AAACK,OAAA,CAAAhB,aAAA,GAAAA,aAAA"}
|