diff --git a/lib/client.d.ts b/lib/client.d.ts index 2ace47a..6173915 100644 --- a/lib/client.d.ts +++ b/lib/client.d.ts @@ -2,19 +2,28 @@ import { AxiosRequestConfig } from 'axios'; import schedule from 'node-schedule'; import { CGMDataType } from './utils'; declare type DexcomApiClientType = { - username: string; - password: string; - server: 'US' | 'EU'; - clientOpts?: AxiosRequestConfig; + username: string; + password: string; + server: 'US' | 'EU'; + clientOpts?: AxiosRequestConfig; }; -export declare const DexcomApiClient: ({ username, password, server, clientOpts, }: DexcomApiClientType) => { - login: () => Promise; - read: (minutesAgo?: number, count?: number) => Promise; - readLast: () => Promise; - observe: ({ maxAttempts, delay, listener, }: { - maxAttempts?: number | undefined; - delay?: number | undefined; - listener: (data: CGMDataType) => void; - }) => Promise; +export declare const DexcomApiClient: ({ + username, + password, + server, + clientOpts, +}: DexcomApiClientType) => { + login: () => Promise; + read: (minutesAgo?: number, count?: number) => Promise; + readLast: () => Promise; + observe: ({ + maxAttempts, + delay, + listener, + }: { + maxAttempts?: number | undefined; + delay?: number | undefined; + listener: (data: CGMDataType) => void; + }) => Promise; }; export {}; diff --git a/lib/client.js b/lib/client.js index 74d6df2..7964dce 100644 --- a/lib/client.js +++ b/lib/client.js @@ -1,310 +1,457 @@ -"use strict"; +'use strict'; -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _interopRequireDefault = require('@babel/runtime/helpers/interopRequireDefault'); -Object.defineProperty(exports, "__esModule", { - value: true +Object.defineProperty(exports, '__esModule', { + value: true, }); exports.DexcomApiClient = void 0; -var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - -var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray")); - -var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); - -var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - -var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); - -var _axios = _interopRequireDefault(require("axios")); - -var _nodeSchedule = _interopRequireDefault(require("node-schedule")); - -var _utils = require("./utils"); - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); 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 = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } +var _regenerator = _interopRequireDefault( + require('@babel/runtime/regenerator') +); + +var _toConsumableArray2 = _interopRequireDefault( + require('@babel/runtime/helpers/toConsumableArray') +); + +var _slicedToArray2 = _interopRequireDefault( + require('@babel/runtime/helpers/slicedToArray') +); + +var _asyncToGenerator2 = _interopRequireDefault( + require('@babel/runtime/helpers/asyncToGenerator') +); + +var _defineProperty2 = _interopRequireDefault( + require('@babel/runtime/helpers/defineProperty') +); + +var _axios = _interopRequireDefault(require('axios')); + +var _nodeSchedule = _interopRequireDefault(require('node-schedule')); + +var _utils = require('./utils'); + +function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + 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 = null != arguments[i] ? arguments[i] : {}; + i % 2 + ? ownKeys(Object(source), !0).forEach(function (key) { + (0, _defineProperty2['default'])(target, key, source[key]); + }) + : Object.getOwnPropertyDescriptors + ? Object.defineProperties( + target, + Object.getOwnPropertyDescriptors(source) + ) + : ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty( + target, + key, + Object.getOwnPropertyDescriptor(source, key) + ); + }); + } + return target; +} var APPLICATION_ID = 'd89443d2-327c-4a6f-89e5-496bbb0317db'; var DexcomApiClient = function DexcomApiClient(_ref) { var username = _ref.username, - password = _ref.password, - server = _ref.server, - clientOpts = _ref.clientOpts; - var targetServer = server === 'EU' ? 'shareous1.dexcom.com' : 'share2.dexcom.com'; + password = _ref.password, + server = _ref.server, + clientOpts = _ref.clientOpts; + var targetServer = + server === 'EU' ? 'shareous1.dexcom.com' : 'share2.dexcom.com'; var sessionId = null; - var client = _axios["default"].create(_objectSpread({ - baseURL: "https://".concat(targetServer, "/ShareWebServices/Services"), - headers: { - 'Content-Type': 'application/json', - Accept: 'application/json' - } - }, clientOpts)); - - var login = /*#__PURE__*/function () { - var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() { - var payload, responses; - return _regenerator["default"].wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - payload = { - accountName: username, - password: password, - applicationId: APPLICATION_ID - }; - _context.prev = 1; - _context.next = 4; - return Promise.all([client.post('/General/AuthenticatePublisherAccount', payload), client.post('/General/LoginPublisherAccountByName', payload)]); - - case 4: - responses = _context.sent; - - if (!responses.some(function (e) { - return !(0, _utils.validate)(e); - })) { - _context.next = 7; - break; - } + var client = _axios['default'].create( + _objectSpread( + { + baseURL: 'https://'.concat(targetServer, '/ShareWebServices/Services'), + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + }, + }, + clientOpts + ) + ); + + var login = /*#__PURE__*/ (function () { + var _ref2 = (0, _asyncToGenerator2['default'])( + /*#__PURE__*/ _regenerator['default'].mark(function _callee() { + var payload, responses; + return _regenerator['default'].wrap( + function _callee$(_context) { + while (1) { + switch ((_context.prev = _context.next)) { + case 0: + payload = { + accountName: username, + password: password, + applicationId: APPLICATION_ID, + }; + _context.prev = 1; + _context.next = 4; + return Promise.all([ + client.post( + '/General/AuthenticatePublisherAccount', + payload + ), + client.post( + '/General/LoginPublisherAccountByName', + payload + ), + ]); + + case 4: + responses = _context.sent; + + if ( + !responses.some(function (e) { + return !(0, _utils.validate)(e); + }) + ) { + _context.next = 7; + break; + } - throw new Error('Login failed.'); + throw new Error('Login failed.'); - case 7: - sessionId = responses[1].data; - console.log('Logged in successfully', sessionId); - _context.next = 14; - break; + case 7: + sessionId = responses[1].data; + console.log('Logged in successfully', sessionId); + _context.next = 14; + break; - case 11: - _context.prev = 11; - _context.t0 = _context["catch"](1); - throw new Error('Unable to login in'); + case 11: + _context.prev = 11; + _context.t0 = _context['catch'](1); + throw new Error('Unable to login in'); - case 14: - case "end": - return _context.stop(); - } - } - }, _callee, null, [[1, 11]]); - })); + case 14: + case 'end': + return _context.stop(); + } + } + }, + _callee, + null, + [[1, 11]] + ); + }) + ); return function login() { return _ref2.apply(this, arguments); }; - }(); - - var loginAndTry = /*#__PURE__*/function () { - var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(func) { - var response; - return _regenerator["default"].wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - response = null; - - if (sessionId) { - _context2.next = 4; - break; - } + })(); + + var loginAndTry = /*#__PURE__*/ (function () { + var _ref3 = (0, _asyncToGenerator2['default'])( + /*#__PURE__*/ _regenerator['default'].mark(function _callee2(func) { + var response; + return _regenerator['default'].wrap( + function _callee2$(_context2) { + while (1) { + switch ((_context2.prev = _context2.next)) { + case 0: + response = null; + + if (sessionId) { + _context2.next = 4; + break; + } - _context2.next = 4; - return login(); + _context2.next = 4; + return login(); - case 4: - _context2.prev = 4; - _context2.next = 7; - return func.apply(null); + case 4: + _context2.prev = 4; + _context2.next = 7; + return func.apply(null); - case 7: - response = _context2.sent; - _context2.next = 17; - break; + case 7: + response = _context2.sent; + _context2.next = 17; + break; - case 10: - _context2.prev = 10; - _context2.t0 = _context2["catch"](4); - _context2.next = 14; - return login(); + case 10: + _context2.prev = 10; + _context2.t0 = _context2['catch'](4); + _context2.next = 14; + return login(); - case 14: - _context2.next = 16; - return func.apply(null); + case 14: + _context2.next = 16; + return func.apply(null); - case 16: - response = _context2.sent; + case 16: + response = _context2.sent; - case 17: - return _context2.abrupt("return", response); + case 17: + return _context2.abrupt('return', response); - case 18: - case "end": - return _context2.stop(); - } - } - }, _callee2, null, [[4, 10]]); - })); + case 18: + case 'end': + return _context2.stop(); + } + } + }, + _callee2, + null, + [[4, 10]] + ); + }) + ); return function loginAndTry(_x) { return _ref3.apply(this, arguments); }; - }(); + })(); - var read = /*#__PURE__*/function () { - var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() { - var minutesAgo, + var read = /*#__PURE__*/ (function () { + var _ref4 = (0, _asyncToGenerator2['default'])( + /*#__PURE__*/ _regenerator['default'].mark(function _callee4() { + var minutesAgo, count, _args4 = arguments; - return _regenerator["default"].wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - minutesAgo = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : 1440; - count = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : 288; - return _context4.abrupt("return", loginAndTry( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() { - var params, response; - return _regenerator["default"].wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - params = { - sessionId: sessionId, - minutes: minutesAgo, - maxCount: count - }; - _context3.next = 3; - return client.post('/Publisher/ReadPublisherLatestGlucoseValues', null, { - params: params - }); - - case 3: - response = _context3.sent; - return _context3.abrupt("return", response.data.map(_utils.transform)); - - case 5: - case "end": - return _context3.stop(); - } - } - }, _callee3); - })))); - - case 3: - case "end": - return _context4.stop(); + return _regenerator['default'].wrap(function _callee4$(_context4) { + while (1) { + switch ((_context4.prev = _context4.next)) { + case 0: + minutesAgo = + _args4.length > 0 && _args4[0] !== undefined + ? _args4[0] + : 1440; + count = + _args4.length > 1 && _args4[1] !== undefined + ? _args4[1] + : 288; + return _context4.abrupt( + 'return', + loginAndTry( + /*#__PURE__*/ (0, _asyncToGenerator2['default'])( + /*#__PURE__*/ _regenerator['default'].mark( + function _callee3() { + var params, response; + return _regenerator['default'].wrap( + function _callee3$(_context3) { + while (1) { + switch ((_context3.prev = _context3.next)) { + case 0: + params = { + sessionId: sessionId, + minutes: minutesAgo, + maxCount: count, + }; + _context3.next = 3; + return client.post( + '/Publisher/ReadPublisherLatestGlucoseValues', + null, + { + params: params, + } + ); + + case 3: + response = _context3.sent; + return _context3.abrupt( + 'return', + response.data.map(_utils.transform) + ); + + case 5: + case 'end': + return _context3.stop(); + } + } + }, + _callee3 + ); + } + ) + ) + ) + ); + + case 3: + case 'end': + return _context4.stop(); + } } - } - }, _callee4); - })); + }, _callee4); + }) + ); return function read() { return _ref4.apply(this, arguments); }; - }(); - - var readLast = /*#__PURE__*/function () { - var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() { - return _regenerator["default"].wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - return _context5.abrupt("return", read(9999, 1)); - - case 1: - case "end": - return _context5.stop(); + })(); + + var readLast = /*#__PURE__*/ (function () { + var _ref6 = (0, _asyncToGenerator2['default'])( + /*#__PURE__*/ _regenerator['default'].mark(function _callee5() { + return _regenerator['default'].wrap(function _callee5$(_context5) { + while (1) { + switch ((_context5.prev = _context5.next)) { + case 0: + return _context5.abrupt('return', read(9999, 1)); + + case 1: + case 'end': + return _context5.stop(); + } } - } - }, _callee5); - })); + }, _callee5); + }) + ); return function readLast() { return _ref6.apply(this, arguments); }; - }(); - - var observe = /*#__PURE__*/function () { - var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(_ref7) { - var _ref7$maxAttempts, maxAttempts, _ref7$delay, delay, listener, _yield$readLast, _yield$readLast2, data, rawMinutes, a, b, runPoints, proc; - - return _regenerator["default"].wrap(function _callee7$(_context7) { - while (1) { - switch (_context7.prev = _context7.next) { - case 0: - _ref7$maxAttempts = _ref7.maxAttempts, maxAttempts = _ref7$maxAttempts === void 0 ? 50 : _ref7$maxAttempts, _ref7$delay = _ref7.delay, delay = _ref7$delay === void 0 ? 1000 : _ref7$delay, listener = _ref7.listener; - _context7.next = 3; - return readLast(); - - case 3: - _yield$readLast = _context7.sent; - _yield$readLast2 = (0, _slicedToArray2["default"])(_yield$readLast, 1); - data = _yield$readLast2[0]; - rawMinutes = data.date.getMinutes(); - a = String(rawMinutes).padStart(2, '0')[1]; - b = String(rawMinutes + 5).padStart(2, '0')[1]; - runPoints = ['0', '1', '2', '3', '4', '5'].reduce(function (acc, e) { - return [].concat((0, _toConsumableArray2["default"])(acc), [e + a, e + b]); - }, []); - - proc = function proc() { - var attempt = 0; - var interval = setInterval( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() { - var lastCgmData; - return _regenerator["default"].wrap(function _callee6$(_context6) { - while (1) { - switch (_context6.prev = _context6.next) { - case 0: - if (attempt >= maxAttempts) { - clearInterval(interval); - } - - _context6.next = 3; - return read(1, 1); - - case 3: - lastCgmData = _context6.sent; - - if (lastCgmData.length) { - listener.apply(null, [lastCgmData[0]]); - clearInterval(interval); - } - - attempt += 1; - - case 6: - case "end": - return _context6.stop(); - } - } - }, _callee6); - })), delay); - }; - - return _context7.abrupt("return", _nodeSchedule["default"].scheduleJob("".concat(runPoints.join(','), " * * * *"), proc)); - - case 12: - case "end": - return _context7.stop(); + })(); + + var observe = /*#__PURE__*/ (function () { + var _ref8 = (0, _asyncToGenerator2['default'])( + /*#__PURE__*/ _regenerator['default'].mark(function _callee7(_ref7) { + var _ref7$maxAttempts, + maxAttempts, + _ref7$delay, + delay, + listener, + _yield$readLast, + _yield$readLast2, + data, + rawMinutes, + a, + b, + runPoints, + proc; + + return _regenerator['default'].wrap(function _callee7$(_context7) { + while (1) { + switch ((_context7.prev = _context7.next)) { + case 0: + (_ref7$maxAttempts = _ref7.maxAttempts), + (maxAttempts = + _ref7$maxAttempts === void 0 ? 50 : _ref7$maxAttempts), + (_ref7$delay = _ref7.delay), + (delay = _ref7$delay === void 0 ? 1000 : _ref7$delay), + (listener = _ref7.listener); + _context7.next = 3; + return readLast(); + + case 3: + _yield$readLast = _context7.sent; + _yield$readLast2 = (0, _slicedToArray2['default'])( + _yield$readLast, + 1 + ); + data = _yield$readLast2[0]; + rawMinutes = data.date.getMinutes(); + a = String(rawMinutes).padStart(2, '0')[1]; + b = String(rawMinutes + 5).padStart(2, '0')[1]; + runPoints = ['0', '1', '2', '3', '4', '5'].reduce(function ( + acc, + e + ) { + return [].concat((0, _toConsumableArray2['default'])(acc), [ + e + a, + e + b, + ]); + }, + []); + + proc = function proc() { + var attempt = 0; + var interval = setInterval( + /*#__PURE__*/ (0, _asyncToGenerator2['default'])( + /*#__PURE__*/ _regenerator['default'].mark( + function _callee6() { + var lastCgmData; + return _regenerator['default'].wrap( + function _callee6$(_context6) { + while (1) { + switch ((_context6.prev = _context6.next)) { + case 0: + if (attempt >= maxAttempts) { + clearInterval(interval); + } + + _context6.next = 3; + return read(1, 1); + + case 3: + lastCgmData = _context6.sent; + + if (lastCgmData.length) { + listener.apply(null, [lastCgmData[0]]); + clearInterval(interval); + } + + attempt += 1; + + case 6: + case 'end': + return _context6.stop(); + } + } + }, + _callee6 + ); + } + ) + ), + delay + ); + }; + + return _context7.abrupt( + 'return', + _nodeSchedule['default'].scheduleJob( + ''.concat(runPoints.join(','), ' * * * *'), + proc + ) + ); + + case 12: + case 'end': + return _context7.stop(); + } } - } - }, _callee7); - })); + }, _callee7); + }) + ); return function observe(_x2) { return _ref8.apply(this, arguments); }; - }(); + })(); return { login: login, read: read, readLast: readLast, - observe: observe + observe: observe, }; }; exports.DexcomApiClient = DexcomApiClient; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jbGllbnQudHMiXSwibmFtZXMiOlsiQVBQTElDQVRJT05fSUQiLCJEZXhjb21BcGlDbGllbnQiLCJ1c2VybmFtZSIsInBhc3N3b3JkIiwic2VydmVyIiwiY2xpZW50T3B0cyIsInRhcmdldFNlcnZlciIsInNlc3Npb25JZCIsImNsaWVudCIsImF4aW9zIiwiY3JlYXRlIiwiYmFzZVVSTCIsImhlYWRlcnMiLCJBY2NlcHQiLCJsb2dpbiIsInBheWxvYWQiLCJhY2NvdW50TmFtZSIsImFwcGxpY2F0aW9uSWQiLCJQcm9taXNlIiwiYWxsIiwicG9zdCIsInJlc3BvbnNlcyIsInNvbWUiLCJlIiwiRXJyb3IiLCJkYXRhIiwiY29uc29sZSIsImxvZyIsImxvZ2luQW5kVHJ5IiwiZnVuYyIsInJlc3BvbnNlIiwiYXBwbHkiLCJyZWFkIiwibWludXRlc0FnbyIsImNvdW50IiwicGFyYW1zIiwibWludXRlcyIsIm1heENvdW50IiwibWFwIiwidHJhbnNmb3JtIiwicmVhZExhc3QiLCJvYnNlcnZlIiwibWF4QXR0ZW1wdHMiLCJkZWxheSIsImxpc3RlbmVyIiwicmF3TWludXRlcyIsImRhdGUiLCJnZXRNaW51dGVzIiwiYSIsIlN0cmluZyIsInBhZFN0YXJ0IiwiYiIsInJ1blBvaW50cyIsInJlZHVjZSIsImFjYyIsInByb2MiLCJhdHRlbXB0IiwiaW50ZXJ2YWwiLCJzZXRJbnRlcnZhbCIsImNsZWFySW50ZXJ2YWwiLCJsYXN0Q2dtRGF0YSIsImxlbmd0aCIsInNjaGVkdWxlIiwic2NoZWR1bGVKb2IiLCJqb2luIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUE7O0FBQ0E7O0FBQ0E7Ozs7Ozt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ICAgICAgICAgY2xlYXJJbnRlcnZhbChpbnRlcnZhbCk7XG4gICAgICAgIH1cbiAgICAgICAgYXR0ZW1wdCArPSAxO1xuICAgICAgfSwgZGVsYXkpO1xuICAgIH07XG5cbiAgICByZXR1cm4gc2NoZWR1bGUuc2NoZWR1bGVKb2IoYCR7cnVuUG9pbnRzLmpvaW4oJywnKX0gKiAqICogKmAsIHByb2MpO1xuICB9O1xuICByZXR1cm4ge1xuICAgIGxvZ2luLFxuICAgIHJlYWQsXG4gICAgcmVhZExhc3QsXG4gICAgb2JzZXJ2ZSxcbiAgfTtcbn07XG4iXX0= \ No newline at end of file +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jbGllbnQudHMiXSwibmFtZXMiOlsiQVBQTElDQVRJT05fSUQiLCJEZXhjb21BcGlDbGllbnQiLCJ1c2VybmFtZSIsInBhc3N3b3JkIiwic2VydmVyIiwiY2xpZW50T3B0cyIsInRhcmdldFNlcnZlciIsInNlc3Npb25JZCIsImNsaWVudCIsImF4aW9zIiwiY3JlYXRlIiwiYmFzZVVSTCIsImhlYWRlcnMiLCJBY2NlcHQiLCJsb2dpbiIsInBheWxvYWQiLCJhY2NvdW50TmFtZSIsImFwcGxpY2F0aW9uSWQiLCJQcm9taXNlIiwiYWxsIiwicG9zdCIsInJlc3BvbnNlcyIsInNvbWUiLCJlIiwiRXJyb3IiLCJkYXRhIiwiY29uc29sZSIsImxvZyIsImxvZ2luQW5kVHJ5IiwiZnVuYyIsInJlc3BvbnNlIiwiYXBwbHkiLCJyZWFkIiwibWludXRlc0FnbyIsImNvdW50IiwicGFyYW1zIiwibWludXRlcyIsIm1heENvdW50IiwibWFwIiwidHJhbnNmb3JtIiwicmVhZExhc3QiLCJvYnNlcnZlIiwibWF4QXR0ZW1wdHMiLCJkZWxheSIsImxpc3RlbmVyIiwicmF3TWludXRlcyIsImRhdGUiLCJnZXRNaW51dGVzIiwiY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KGFzeW5jICgpID0+IHtcbiAgICAgICAgaWYgKGF0dGVtcHQgPj0gbWF4QXR0ZW1wdHMpIHtcbiAgICAgICAgICBjbGVhckludGVydmFsKGludGVydmFsKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IGxhc3RDZ21EYXRhID0gYXdhaXQgcmVhZCgxLCAxKTtcblxuICAgICAgICBpZiAobGFzdENnbURhdGEubGVuZ3RoKSB7XG4gICAgICAgICAgbGlzdGVuZXIuYXBwbHkobnVsbCwgW2xhc3RDZ21EYXRhWzBdXSk7XG4gICAgICAgICAgY2xlYXJJbnRlcnZhbChpbnRlcnZhbCk7XG4gICAgICAgIH1cbiAgICAgICAgYXR0ZW1wdCArPSAxO1xuICAgICAgfSwgZGVsYXkpO1xuICAgIH07XG5cbiAgICByZXR1cm4gc2NoZWR1bGUuc2NoZWR1bGVKb2IoYCR7cnVuUG9pbnRzLmpvaW4oJywnKX0gKiAqICogKmAsIHByb2MpO1xuICB9O1xuICByZXR1cm4ge1xuICAgIGxvZ2luLFxuICAgIHJlYWQsXG4gICAgcmVhZExhc3QsXG4gICAgb2JzZXJ2ZSxcbiAgfTtcbn07XG4iXX0= diff --git a/lib/index.js b/lib/index.js index 759bb49..810ce1a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,19 +1,19 @@ -"use strict"; +'use strict'; -Object.defineProperty(exports, "__esModule", { - value: true +Object.defineProperty(exports, '__esModule', { + value: true, }); -var _client = require("./client"); +var _client = require('./client'); Object.keys(_client).forEach(function (key) { - if (key === "default" || key === "__esModule") return; + if (key === 'default' || key === '__esModule') return; if (key in exports && exports[key] === _client[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { return _client[key]; - } + }, }); }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQTs7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQSIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vY2xpZW50JztcbiJdfQ== \ No newline at end of file +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQTs7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQSIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vY2xpZW50JztcbiJdfQ== diff --git a/lib/utils.d.ts b/lib/utils.d.ts index 5c67dbb..d162440 100644 --- a/lib/utils.d.ts +++ b/lib/utils.d.ts @@ -1,16 +1,23 @@ import { AxiosResponse } from 'axios'; -declare type DexcomTrendType = 'DoubleDown' | 'SingleDown' | 'FortyFiveDown' | 'Flat' | 'FortyFiveUp' | 'SingleUp' | 'DoubleUp'; +declare type DexcomTrendType = + | 'DoubleDown' + | 'SingleDown' + | 'FortyFiveDown' + | 'Flat' + | 'FortyFiveUp' + | 'SingleUp' + | 'DoubleUp'; declare type DexcomDataType = { - WT: string; - ST: string; - DT: string; - Value: number; - Trend: DexcomTrendType; + WT: string; + ST: string; + DT: string; + Value: number; + Trend: DexcomTrendType; }; export declare type CGMDataType = { - date: Date; - value: number; - trend: DexcomTrendType; + date: Date; + value: number; + trend: DexcomTrendType; }; export declare const transform: (input: DexcomDataType) => CGMDataType; export declare const validate: (payload: AxiosResponse) => boolean; diff --git a/lib/utils.js b/lib/utils.js index 132581c..463dee6 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,7 +1,7 @@ -"use strict"; +'use strict'; -Object.defineProperty(exports, "__esModule", { - value: true +Object.defineProperty(exports, '__esModule', { + value: true, }); exports.validate = exports.transform = void 0; @@ -15,7 +15,7 @@ var transform = function transform(input) { return { date: new Date(parseInt(parsedDate[1], 10)), value: input.Value, - trend: input.Trend + trend: input.Trend, }; }; @@ -26,4 +26,4 @@ var validate = function validate(payload) { }; exports.validate = validate; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy91dGlscy50cyJdLCJuYW1lcyI6WyJ0cmFuc2Zvcm0iLCJpbnB1dCIsInBhcnNlZERhdGUiLCJXVCIsIm1hdGNoIiwiQXJyYXkiLCJpc0FycmF5IiwiRXJyb3IiLCJkYXRlIiwiRGF0ZSIsInBhcnNlSW50IiwidmFsdWUiLCJWYWx1ZSIsInRyZW5kIiwiVHJlbmQiLCJ2YWxpZGF0ZSIsInBheWxvYWQiLCJkYXRhIl0sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBdUJPLElBQU1BLFNBQVMsR0FBRyxTQUFaQSxTQUFZLENBQUNDLEtBQUQsRUFBd0M7QUFDL0QsTUFBTUMsVUFBVSxHQUFHRCxLQUFLLENBQUNFLEVBQU4sQ0FBU0MsS0FBVCxDQUFlLGtCQUFmLENBQW5COztBQUVBLE1BQUksQ0FBQ0YsVUFBRCxJQUFlLENBQUNHLEtBQUssQ0FBQ0MsT0FBTixDQUFjSixVQUFkLENBQWhCLElBQTZDLENBQUNBLFVBQVUsQ0FBQyxDQUFELENBQTVELEVBQWlFO0FBQy9ELFVBQU0sSUFBSUssS0FBSixDQUFVLCtCQUFWLENBQU47QUFDRDs7QUFFRCxTQUFPO0FBQ0xDLElBQUFBLElBQUksRUFBRSxJQUFJQyxJQUFKLENBQVNDLFFBQVEsQ0FBQ1IsVUFBVSxDQUFDLENBQUQsQ0FBWCxFQUFnQixFQUFoQixDQUFqQixDQUREO0FBRUxTLElBQUFBLEtBQUssRUFBRVYsS0FBSyxDQUFDVyxLQUZSO0FBR0xDLElBQUFBLEtBQUssRUFBRVosS0FBSyxDQUFDYTtB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G5cbiAgaWYgKCFwYXJzZWREYXRlIHx8ICFBcnJheS5pc0FycmF5KHBhcnNlZERhdGUpIHx8ICFwYXJzZWREYXRlWzFdKSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKCdVbmFibGUgdG8gcGFyc2UgZGV4Y29tIG9iamVjdCcpO1xuICB9XG5cbiAgcmV0dXJuIHtcbiAgICBkYXRlOiBuZXcgRGF0ZShwYXJzZUludChwYXJzZWREYXRlWzFdLCAxMCkpLFxuICAgIHZhbHVlOiBpbnB1dC5WYWx1ZSxcbiAgICB0cmVuZDogaW5wdXQuVHJlbmQsXG4gIH07XG59O1xuXG5leHBvcnQgY29uc3QgdmFsaWRhdGUgPSAocGF5bG9hZDogQXhpb3NSZXNwb25zZSkgPT5cbiAgcGF5bG9hZC5kYXRhICE9PSAnMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwJztcbiJdfQ== diff --git a/package.json b/package.json index e0fded8..b59cf24 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "build:js": "babel src --out-dir lib --extensions \".ts,.tsx\" --source-maps inline", "start": "babel-watch --extensions \".ts\" src/index.ts", "debug": "babel-watch --inspect 0.0.0.0:9229 --extensions \".ts\" src/index.ts", - "lint": "eslint --fix --ext .js,.ts ./src", - "format": "prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"", + "lint": "eslint --fix --ext .ts ./src", + "format": "prettier --ignore-path .gitignore --write \"**/*.+(ts|json)\"", "prepare": "husky install", "release": "release-it" },