UNPKG

ggez-banking-sdk

Version:

A Node.js package to handle GGEZ Banking API endpoints, Simplify the process of managing CRUD operations with this efficient and easy-to-use package.

45 lines (44 loc) 1.86 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.fillDeviceDetails = void 0; const clientjs_1 = require("clientjs"); const enum_1 = require("../constants/enum"); //import { fingerPrintHandler } from "./info"; const dayjs_1 = __importDefault(require("dayjs")); const utc_1 = __importDefault(require("dayjs/plugin/utc")); const timezone_1 = __importDefault(require("dayjs/plugin/timezone")); dayjs_1.default.extend(utc_1.default); dayjs_1.default.extend(timezone_1.default); const fillDeviceDetails = () => { const client = new clientjs_1.ClientJS(); // const { geo_coordinates, ip_address } = await getGeoCoordinatesAndIPAddress( // baseUrl // ); let device = { type: enum_1.DeviceType.Browser, brand: `${client.getBrowser()}-${client.getBrowserVersion()}`, os: client.getOS(), extended_info: { sim_info: null, culture_info: null, user_agent: client.getUserAgent(), cpu: client.getCPU(), system_language: client.getSystemLanguage(), }, activity_type: enum_1.SecurityOperationMethod.Login, application_version: null, serial_number: null, source_ip_address: "", geo_coordinates: "", client_time_zone: `UTC ${dayjs_1.default.tz(new Date()).format("Z")}`, server_date: "", date_utc: dayjs_1.default.utc(new Date()).format("YYYY-MM-DD HH:mm:ss.SSS"), client_date: dayjs_1.default.tz(new Date()).format("YYYY-MM-DD HH:mm:ss.SSS"), update_date_utc: dayjs_1.default.utc(new Date()).format("YYYY-MM-DD HH:mm:ss.SSS"), }; return device; }; exports.fillDeviceDetails = fillDeviceDetails;