mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 21:57:16 +01:00
Changed import path.
This commit is contained in:
parent
a62e84f516
commit
8525188e42
365 changed files with 1277 additions and 1267 deletions
|
|
@ -2,11 +2,11 @@ import bcrypt from 'bcryptjs';
|
|||
import { Report } from '@prisma/client';
|
||||
import { getClient, redisEnabled } from '@umami/redis-client';
|
||||
import debug from 'debug';
|
||||
import { PERMISSIONS, ROLE_PERMISSIONS, ROLES, SHARE_TOKEN_HEADER } from 'lib/constants';
|
||||
import { secret, getRandomChars } from 'lib/crypto';
|
||||
import { createSecureToken, parseSecureToken, parseToken } from 'lib/jwt';
|
||||
import { ensureArray } from 'lib/utils';
|
||||
import { getTeamUser, getUser, getWebsite } from 'queries';
|
||||
import { PERMISSIONS, ROLE_PERMISSIONS, ROLES, SHARE_TOKEN_HEADER } from '@/lib/constants';
|
||||
import { secret, getRandomChars } from '@/lib/crypto';
|
||||
import { createSecureToken, parseSecureToken, parseToken } from '@/lib/jwt';
|
||||
import { ensureArray } from '@/lib/utils';
|
||||
import { getTeamUser, getUser, getWebsite } from '@/queries';
|
||||
import { Auth } from './types';
|
||||
|
||||
const log = debug('umami:auth');
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { formatDate } from 'lib/date';
|
||||
import { formatLongNumber } from 'lib/format';
|
||||
import { formatDate } from '@/lib/date';
|
||||
import { formatLongNumber } from '@/lib/format';
|
||||
|
||||
export function renderNumberLabels(label: string) {
|
||||
return +label > 1000 ? formatLongNumber(+label) : label;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { ClickHouseClient, createClient } from '@clickhouse/client';
|
||||
import { formatInTimeZone } from 'date-fns-tz';
|
||||
import debug from 'debug';
|
||||
import { CLICKHOUSE } from 'lib/db';
|
||||
import { getWebsite } from 'queries/index';
|
||||
import { CLICKHOUSE } from '@/lib/db';
|
||||
import { getWebsite } from '@/queries/index';
|
||||
import { DEFAULT_PAGE_SIZE, OPERATORS } from './constants';
|
||||
import { maxDate } from './date';
|
||||
import { filtersToArray } from './params';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { getItem, setItem, removeItem } from 'lib/storage';
|
||||
import { getItem, setItem, removeItem } from '@/lib/storage';
|
||||
import { AUTH_TOKEN } from './constants';
|
||||
|
||||
export function getClientAuthToken() {
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ import {
|
|||
endOfMinute,
|
||||
isSameDay,
|
||||
} from 'date-fns';
|
||||
import { getDateLocale } from 'lib/lang';
|
||||
import { DateRange } from 'lib/types';
|
||||
import { getDateLocale } from '@/lib/lang';
|
||||
import { DateRange } from '@/lib/types';
|
||||
|
||||
export const TIME_UNIT = {
|
||||
minute: 'minute',
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { buildUrl } from 'lib/url';
|
||||
import { buildUrl } from '@/lib/url';
|
||||
|
||||
export async function request(method: string, url: string, body?: string, headers: object = {}) {
|
||||
const res = await fetch(url, {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import jwt from 'jsonwebtoken';
|
||||
import { decrypt, encrypt } from 'lib/crypto';
|
||||
import { decrypt, encrypt } from '@/lib/crypto';
|
||||
|
||||
export function createToken(payload: any, secret: any, options?: any) {
|
||||
return jwt.sign(payload, secret, options);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { serializeError } from 'serialize-error';
|
||||
import debug from 'debug';
|
||||
import { Kafka, Producer, RecordMetadata, SASLOptions, logLevel } from 'kafkajs';
|
||||
import { KAFKA, KAFKA_PRODUCER } from 'lib/db';
|
||||
import { KAFKA, KAFKA_PRODUCER } from '@/lib/db';
|
||||
import * as tls from 'tls';
|
||||
|
||||
const log = debug('umami:kafka');
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Website, Session } from '@prisma/client';
|
||||
import { getClient, redisEnabled } from '@umami/redis-client';
|
||||
import { getWebsiteSession, getWebsite } from 'queries';
|
||||
import { getWebsiteSession, getWebsite } from '@/queries';
|
||||
|
||||
export async function fetchWebsite(websiteId: string): Promise<Website> {
|
||||
let website = null;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { FILTER_COLUMNS, OPERATOR_PREFIXES, OPERATORS } from 'lib/constants';
|
||||
import { QueryFilters, QueryOptions } from 'lib/types';
|
||||
import { FILTER_COLUMNS, OPERATOR_PREFIXES, OPERATORS } from '@/lib/constants';
|
||||
import { QueryFilters, QueryOptions } from '@/lib/types';
|
||||
|
||||
export function parseParameterValue(param: any) {
|
||||
if (typeof param === 'string') {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import debug from 'debug';
|
||||
import prisma from '@umami/prisma-client';
|
||||
import { formatInTimeZone } from 'date-fns-tz';
|
||||
import { MYSQL, POSTGRESQL, getDatabaseType } from 'lib/db';
|
||||
import { MYSQL, POSTGRESQL, getDatabaseType } from '@/lib/db';
|
||||
import { SESSION_COLUMNS, OPERATORS, DEFAULT_PAGE_SIZE } from './constants';
|
||||
import { fetchWebsite } from './load';
|
||||
import { maxDate } from './date';
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { ZodObject } from 'zod';
|
||||
import { FILTER_COLUMNS } from 'lib/constants';
|
||||
import { badRequest, unauthorized } from 'lib/response';
|
||||
import { getAllowedUnits, getMinimumUnit } from 'lib/date';
|
||||
import { checkAuth } from 'lib/auth';
|
||||
import { getWebsiteDateRange } from 'queries';
|
||||
import { FILTER_COLUMNS } from '@/lib/constants';
|
||||
import { badRequest, unauthorized } from '@/lib/response';
|
||||
import { getAllowedUnits, getMinimumUnit } from '@/lib/date';
|
||||
import { checkAuth } from '@/lib/auth';
|
||||
import { getWebsiteDateRange } from '@/queries';
|
||||
|
||||
export async function getJsonBody(request: Request) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { z } from 'zod';
|
||||
import { isValidTimezone } from 'lib/date';
|
||||
import { isValidTimezone } from '@/lib/date';
|
||||
import { UNIT_TYPES } from './constants';
|
||||
|
||||
export const filterParams = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue