Scan your whole stack
Are you using @telamonjs/data?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v1.5.0
@telamonjs/data was last scanned on 29 Nov 2026 at version 1.5.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 1.5.0 LATEST | 29 Nov 2026 | No rules fired |
| 1.4.1 | 26 Nov 2026 | No rules fired |
| 1.4.0 | 26 Nov 2026 | No rules fired |
| 1.3.1 | 25 Nov 2026 | Not shown |
| 1.3.0 | 25 Nov 2026 | Not shown |
Findings for v1.5.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 1.5.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
The server half of a TelamonJS list. A ListPage sends page, page size, search, sort and filters.
This package reads them on the endpoint and turns them into a query, with no dependencies and
without React, Next or Prisma. A NestJS API also gets the Prisma exception filter, health
endpoint and audit interceptor every API repeats.
Zero runtime dependencies · dual ESM/CJS (each entry ships .js and .cjs, with .d.ts and
.d.cts, so a CommonJS Nest build or ts-jest loads it without transforming node_modules) ·
sideEffects: false.
pnpm add @telamonjs/data
| Entry | What it has | Needs an ORM? |
|---|---|---|
@telamonjs/data |
The wire contract (PaginationParams, PaginationInput, PaginatedResponse, SortField, createPaginatedResponse), sanitizePaginationParams, paginationArgs, resolveSort, resolveSortPath; the audit helpers computeDiff, redactPayload, DEFAULT_REDACT_KEYS |
No |
@telamonjs/data/prisma |
buildPrismaOrderBy(Multi), resolveOrderBy, buildSearchConditions, buildFilterConditions, buildWhereClause, createPaginationContext |
Builds Prisma's object shape; never imports @prisma/client |
@telamonjs/data/nest |
PrismaExceptionFilter, HealthModule, createAuditInterceptor, SkipAudit, isPrismaKnownRequestError, isPrismaValidationError |
Needs @nestjs/common and rxjs (optional peers); never imports @prisma/client |
A ListPage sends the sort field in one of two forms: the column's data path (customer.name,
with list.sortParam: 'path') or the TanStack column id (customer_name, the default). Both
resolve to the same path:
import { resolveSortPath } from '@telamonjs/data'
import { buildPrismaOrderBy } from '@telamonjs/data/prisma'
resolveSortPath('customer_name') // 'customer.name'
buildPrismaOrderBy('customer_name', 'asc') // { customer: { name: 'asc' } }
buildPrismaOrderBy('_count.items', 'desc') // { items: { _count: 'desc' } }
buildPrismaOrderBy('created_at', 'asc', ['created_at']) // { created_at: 'asc' }
A missing direction is 'desc'. A missing or empty sortBy (an optional DTO field without a
default) gives undefined, no ordering, which Prisma's orderBy accepts. The fourth argument
changes both fallbacks:
buildPrismaOrderBy(undefined) // undefined
buildPrismaOrderBy('name') // { name: 'desc' }
buildPrismaOrderBy(query.sortBy, query.sortOrder, sortableFields, {
defaultSortBy: 'name', // when sortBy is missing or empty
defaultOrder: 'asc', // when sortOrder is missing
})
buildPrismaOrderByMulti(sorting, sortableFields, defaults) takes the same defaults: a missing
list is [], an empty one is [defaultSortBy] when given, an entry without order takes
defaultOrder, and one without field is dropped.
Pass the endpoint's sortableFields. A listed snake_case field (created_at) then stays a
scalar, and anything not listed is rejected:
import { resolveSort } from '@telamonjs/data'
const sort = resolveSort(query.sortBy ?? 'name', query.sortOrder, {
defaultOrderBy: 'name',
defaultOrderDirection: 'asc',
sortableFields: ['name', 'customer.name', 'created_at'],
})
Without an ORM, resolveSort and resolveSortPath are all you need to build your own
ORDER BY.
resolveOrderBy does the whitelist and the conversion in one call, for an endpoint that builds
its own findMany:
import { resolveOrderBy } from '@telamonjs/data/prisma'
const users = await prisma.user.findMany({
where,
orderBy: resolveOrderBy(query, {
sortableFields: ['name', 'createdAt', 'customer.name'],
defaultSortBy: 'createdAt', // optional; without it, nothing valid means no ordering
defaultOrder: 'desc', // required
}),
})
It reads query.sortBy (a field or SortField[]) and query.sortOrder. A field outside
sortableFields falls back to defaultSortBy in defaultOrder; a missing or invalid direction
is defaultOrder. defaultOrder is required on purpose: a helper default that differs from the
service's flips the list. It returns undefined when nothing valid was sent and there is no
defaultSortBy. The return type is a generic, TOrderBy, inferred from orderBy as above, or
given as resolveOrderBy<Prisma.UserOrderByWithRelationInput>(…).
sanitizePaginationParams clamps what the client sent (page ≥ 1, 1 ≤ pageSize ≤ maxPageSize,
non-numeric values fall back to the defaults). paginationArgs turns that result into Prisma's
{ skip, take }. It is pure arithmetic and does not clamp again, so a custom maxPageSize
survives; pass it sanitized values only. It returns just skip and take, so it spreads into
findMany:
import { createPaginatedResponse, paginationArgs, sanitizePaginationParams } from '@telamonjs/data'
const page = sanitizePaginationParams({ page: query.page, pageSize: query.pageSize })
const [rows, total] = await Promise.all([
prisma.user.findMany({ where, ...paginationArgs(page) }), // { skip, take }
prisma.user.count({ where }),
])
return createPaginatedResponse(rows, total, page.page, page.pageSize)
Server helpers take PaginationInput: PaginationParams with page and pageSize optional, so
a query DTO fits without Partial<>. A service's list(params) sanitizes and fills them, and
beforeQuery receives the sanitized values.
wherebuildWhereClause combines search and filters with the endpoint's baseWhere (for example
{ deletedAt: null }) and the user's visibility rule using AND. None of them can overwrite
another, even when they share a key:
import { buildSearchConditions, buildWhereClause } from '@telamonjs/data/prisma'
const where = buildWhereClause(
buildSearchConditions(query.search, ['name', 'customer.name']),
[],
{ deletedAt: null },
{ OR: [{ ownerId: user.id }, { public: true }] }
)
createPaginationContext builds a list (and getFilterOptions) per model from a declarative
config: search fields, typed filters, sortableFields, visibility, counts and hooks.
import { createPaginationContext } from '@telamonjs/data/prisma'
export const { createPaginatedService } = createPaginationContext({
prisma,
auth, // () => Promise<{ user } | null>
filterLabels: () => ({ yes: 'Sim', no: 'Não', active: 'Ativo', inactive: 'Inativo' }),
})
export const customers = createPaginatedService({
model: 'customer',
searchFields: ['name', 'email'],
filters: { active: 'boolean', state: 'string' },
sortableFields: ['name', 'created_at', '_count.orders'],
})
createCachedPaginatedService takes the same config and caches through cache.cacheEntity of
the context. Entries are keyed by the service config and, with visibility, by the user and the
clause the rule returns for them, so that clause must be deterministic for a given user:
{ publishedAt: { lte: new Date() } } changes on every call, so nothing is reused and each call
stores one more entry. A service with beforeQuery, afterQuery, customFilterOptions or a
filter transform is returned uncached, with an onWarning message.
@telamonjs/ui/server re-exports these helpers for Next.js server code. A NestJS or plain Node
API installs only this package.
The ORM-agnostic types (AuthUser, FilterFieldConfig, FilterFieldType, FilterValue,
FilterOption, FilterLabels) are exported from @telamonjs/data itself, and re-exported from
/prisma. AuthUser.role takes a bare code or an object carrying one, so the RoleInfo of
@telamonjs/auth fits as is.
@telamonjs/data/nest)Needs @nestjs/common 10 or 11 and rxjs 7, optional peers that only this entry imports
(every Nest app already has both).
PrismaExceptionFilter answers Prisma errors with a status instead of a 500. It matches
Prisma's known-request and validation errors by shape (code + name/clientVersion), so it
works with any @prisma/client copy, and it never claims other errors: your own filters and
Nest's default handling still get them.
import { PrismaExceptionFilter } from '@telamonjs/data/nest'
app.useGlobalFilters(new PrismaExceptionFilter())
| Prisma | HTTP |
|---|---|
P2002 unique |
409, field = first target field |
P2003 foreign key |
400, field = constraint |
P2025 not found |
404 |
P2011, P2012, P2014, PrismaClientValidationError |
400 |
P2023 inconsistent column data (a malformed id or uuid in a where) |
400 |
P1000–P1003 connection |
503 |
| any other code | 500, logged with Nest's Logger |
The body is { statusCode, message, error, field?, timestamp, path }, written with Express's
res.status().json(). Outside HTTP (RPC, WebSocket, GraphQL) the error is rethrown. Messages are
English; replace them (in your app's language, say) per code, validation or default, with a
string or a function of the reported fields:
new PrismaExceptionFilter({
messages: {
P2025: 'Nothing here',
P2002: (fields) => `${fields.join(', ')} is already taken`,
},
})
To change one case (say, P2003 on a DELETE as 409), subclass it, handle that case in catch
and call super.catch(exception, host) for the rest.
HealthModule.forRoot() serves GET /health. It runs the checks in parallel and answers 200, or
503 with status: 'error' when any check is down, so Docker and load balancers can read the
status code (downStatus: 200 keeps 200 for setups that read only the body):
import { Public } from '@telamonjs/auth/nest'
import { HealthModule } from '@telamonjs/data/nest'
HealthModule.forRoot({
decorators: [Public()], // class decorators for the controller
inject: [PrismaService, REDIS],
checks: (prisma: PrismaService, redis: Redis) => ({
database: () => prisma.$queryRaw`SELECT 1`,
redis: () => redis.ping(),
}),
})
// GET /health → { status: 'ok', timestamp, uptime, database: 'connected', redis: 'connected' }
A check is down when it throws, rejects or resolves false. path changes the route (default
'health'); imports brings in the modules of the inject tokens when they are not global.
createAuditInterceptor() returns an interceptor class that turns every successful,
authenticated POST/PUT/PATCH/DELETE into an AuditEntry and hands it to your write.
The package owns no table: you persist the entry wherever you keep audit rows.
import { APP_INTERCEPTOR } from '@nestjs/core'
import { createAuditInterceptor } from '@telamonjs/data/nest'
export const AuditInterceptor = createAuditInterceptor({
inject: [PrismaService],
write: (entry, _context, prisma: PrismaService) => prisma.auditLog.create({ data: entry }),
})
// app.module.ts
providers: [{ provide: APP_INTERCEPTOR, useClass: AuditInterceptor }]
A Prisma model that takes the entry as it is:
model AuditLog {
id String @id @default(cuid())
userId String
impersonatedBy String?
action String // CREATE | UPDATE | DELETE
entityType String
entityId String?
changes Json?
ipAddress String?
userAgent String?
method String
path String
statusCode Int
createdAt DateTime @default(now())
@@index([entityType, entityId])
@@index([userId, createdAt])
} Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.