Release 202506141856
This commit is contained in:
@@ -35,8 +35,8 @@ type NonDbAttributeFull = NonDbAttribute & {
|
||||
select: {
|
||||
verificationStatus: true
|
||||
serviceVisibility: true
|
||||
isRecentlyListed: true
|
||||
listedAt: true
|
||||
isRecentlyApproved: true
|
||||
approvedAt: true
|
||||
createdAt: true
|
||||
tosReviewAt: true
|
||||
tosReview: true
|
||||
@@ -189,17 +189,17 @@ export const nonDbAttributes: NonDbAttributeFull[] = [
|
||||
}),
|
||||
},
|
||||
{
|
||||
slug: 'recently-listed',
|
||||
title: 'Recently listed',
|
||||
slug: 'recently-approved',
|
||||
title: 'Recently approved',
|
||||
type: 'WARNING',
|
||||
category: 'TRUST',
|
||||
description: 'Listed on KYCnot.me less than 15 days ago. Proceed with caution.',
|
||||
description: 'Approved on KYCnot.me less than 15 days ago. Proceed with caution.',
|
||||
privacyPoints: 0,
|
||||
trustPoints: -5,
|
||||
links: [],
|
||||
customize: (service) => ({
|
||||
show: service.isRecentlyListed,
|
||||
description: `Listed on KYCnot.me ${formatDateShort(service.listedAt ?? service.createdAt)}. Proceed with caution.`,
|
||||
show: service.isRecentlyApproved,
|
||||
description: `Approved on KYCnot.me ${formatDateShort(service.approvedAt ?? service.createdAt)}. Proceed with caution.`,
|
||||
}),
|
||||
},
|
||||
{
|
||||
@@ -217,41 +217,22 @@ export const nonDbAttributes: NonDbAttributeFull[] = [
|
||||
}),
|
||||
},
|
||||
{
|
||||
slug: 'has-onion-urls',
|
||||
title: 'Has Onion URLs',
|
||||
slug: 'has-onion-or-i2p-urls',
|
||||
title: 'Has Onion or I2P URLs',
|
||||
type: 'GOOD',
|
||||
category: 'PRIVACY',
|
||||
description: 'Onion (Tor) URLs enhance privacy and anonymity.',
|
||||
description: 'Onion (Tor) and I2P URLs enhance privacy and anonymity.',
|
||||
privacyPoints: 5,
|
||||
trustPoints: 0,
|
||||
links: [
|
||||
{
|
||||
url: '/?onion=true',
|
||||
url: '/?networks=onion&networks=i2p',
|
||||
label: 'Search with this',
|
||||
icon: 'ri:search-line',
|
||||
},
|
||||
],
|
||||
customize: (service) => ({
|
||||
show: service.onionUrls.length > 0,
|
||||
}),
|
||||
},
|
||||
{
|
||||
slug: 'has-i2p-urls',
|
||||
title: 'Has I2P URLs',
|
||||
type: 'GOOD',
|
||||
category: 'PRIVACY',
|
||||
description: 'I2P URLs enhance privacy and anonymity.',
|
||||
privacyPoints: 5,
|
||||
trustPoints: 0,
|
||||
links: [
|
||||
{
|
||||
url: '/?i2p=true',
|
||||
label: 'Search with this',
|
||||
icon: 'ri:search-line',
|
||||
},
|
||||
],
|
||||
customize: (service) => ({
|
||||
show: service.i2pUrls.length > 0,
|
||||
show: service.onionUrls.length > 0 || service.i2pUrls.length > 0,
|
||||
}),
|
||||
},
|
||||
{
|
||||
|
||||
7
web/src/lib/client/envVariables.ts
Normal file
7
web/src/lib/client/envVariables.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export const DEPLOYMENT_MODE = import.meta.env.PROD
|
||||
? import.meta.env.MODE === 'development' ||
|
||||
import.meta.env.MODE === 'staging' ||
|
||||
import.meta.env.MODE === 'production'
|
||||
? import.meta.env.MODE
|
||||
: 'development'
|
||||
: 'development'
|
||||
@@ -1,4 +1,6 @@
|
||||
import type { NotificationData, NotificationPayload } from './serverEventsTypes'
|
||||
import { DEPLOYMENT_MODE } from './envVariables'
|
||||
|
||||
import type { NotificationData, NotificationPayload } from '../serverEventsTypes'
|
||||
|
||||
export type CustomNotificationOptions = NotificationOptions & {
|
||||
actions?: { action: string; title: string; icon?: string }[]
|
||||
@@ -6,14 +8,24 @@ export type CustomNotificationOptions = NotificationOptions & {
|
||||
data: NotificationData
|
||||
}
|
||||
|
||||
export function makeNotificationOptions(
|
||||
export function makeBrowserNotificationTitle(title?: string | null) {
|
||||
const prefix = DEPLOYMENT_MODE === 'development' ? '[DEV] ' : DEPLOYMENT_MODE === 'staging' ? '[PRE] ' : ''
|
||||
return `${prefix}${title ?? 'New Notification'}`
|
||||
}
|
||||
|
||||
export function makeBrowserNotificationOptions(
|
||||
payload: NotificationPayload | null,
|
||||
options: { removeActions?: boolean } = {}
|
||||
) {
|
||||
const defaultOptions: CustomNotificationOptions = {
|
||||
body: 'You have a new notification',
|
||||
lang: 'en-US',
|
||||
icon: '/favicon.svg',
|
||||
icon:
|
||||
DEPLOYMENT_MODE === 'development'
|
||||
? '/favicon-dev.svg'
|
||||
: DEPLOYMENT_MODE === 'staging'
|
||||
? '/favicon-stage.svg'
|
||||
: '/favicon.svg',
|
||||
badge: '/notification-icon.svg',
|
||||
requireInteraction: false,
|
||||
silent: false,
|
||||
@@ -1,5 +0,0 @@
|
||||
import { z } from 'astro/zod'
|
||||
|
||||
const schema = z.enum(['development', 'staging', 'production'])
|
||||
|
||||
export const DEPLOYMENT_MODE = schema.parse(import.meta.env.PROD ? import.meta.env.MODE : 'development')
|
||||
@@ -39,7 +39,6 @@ export async function getService(slug: string | undefined): Promise<
|
||||
const service =
|
||||
(await prisma.service.findFirst({
|
||||
where: {
|
||||
listedAt: { lte: new Date() },
|
||||
serviceVisibility: { in: ['PUBLIC', 'ARCHIVED', 'UNLISTED'] },
|
||||
slug,
|
||||
},
|
||||
@@ -47,7 +46,6 @@ export async function getService(slug: string | undefined): Promise<
|
||||
})) ??
|
||||
(await prisma.service.findFirst({
|
||||
where: {
|
||||
listedAt: { lte: new Date() },
|
||||
serviceVisibility: { in: ['PUBLIC', 'ARCHIVED', 'UNLISTED'] },
|
||||
previousSlugs: { has: slug },
|
||||
},
|
||||
@@ -175,7 +173,6 @@ export async function getEvents(): Promise<
|
||||
where: {
|
||||
visible: true,
|
||||
service: {
|
||||
listedAt: { lte: new Date() },
|
||||
serviceVisibility: { in: ['PUBLIC', 'ARCHIVED'] },
|
||||
},
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
} from '../constants/characters'
|
||||
|
||||
import { getRandom, typedJoin } from './arrays'
|
||||
import { DEPLOYMENT_MODE } from './envVariables'
|
||||
import { DEPLOYMENT_MODE } from './client/envVariables'
|
||||
import { transformCase } from './strings'
|
||||
|
||||
const DIGEST = 'sha512'
|
||||
|
||||
Reference in New Issue
Block a user