Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@aglyn/shared-util-rest-api

Latest version: v1.33.0

Overview

Last scanned
1 Dec 2026
Published
1 Dec 2026
npm package Publisher: zachary.gover, zgover
7 Stars
2 Forks
171 Versions
10.9K Downloads
TypeScript Repo language

Scan summary

@aglyn/shared-util-rest-api was last scanned on 1 Dec 2026 at version 1.33.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 171 versions; the latest 5 were published within 6 days (26 Nov – 1 Dec 2026).
  • Findings: No rules fired in version 1.33.0.
  • Downloads: 10,873 downloads.

Versions

171 versions published
Versions and the rules that fired in each
VersionPublishedStatus
1.33.0 LATEST 1 Dec 2026 No rules fired
1.32.0 1 Dec 2026 No rules fired
1.31.0 26 Nov 2026 No rules fired
1.30.0 26 Nov 2026 Not shown
1.29.3 26 Nov 2026 Not shown

No rules fired in 1.33.0

Findings

Findings for v1.33.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.33.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@aglyn/shared-util-rest-api

Helpers for writing JSON API routes in Next.js: one response envelope for both the Pages Router (NextApiResponse) and the App Router (Web Response), plus small middleware and cookie utilities. Published mainly as a building block for Aglyn's own apps; usable in any Next.js project that wants the same envelope.

Published to npm from the Aglyn monorepo. Versions follow semantic versioning.

Install

npm install @aglyn/shared-util-rest-api

Peer dependency: next (16.3.3).

What's in it

Everything is exported from the package root; each module is also reachable as @aglyn/shared-util-rest-api/<file-name>.

The envelope, JsonResponse:

type JsonResponse = {
  error?: any
  errorCode?: HttpRefCode
  status?: HttpResponseStatus | true
  statusCode?: HttpStatusCode
  statusMessage?: string
  data?: any
}
  • App Router (route.ts): appHandleJsonResponse(statusCode, options?), appHandleJsonSuccess(data), appHandleJsonError(error) - each returns a Response.
  • Pages Router: nextHandleJsonResponse(res, statusCode, options?), nextHandleJsonSuccess(res, data), nextHandleJsonError(res, error) - each writes to a NextApiResponse. Both families put the same shape on the wire. The error variants take the status from error.code or error.statusCode (default 500) and the message from error.message or error.statusMessage.
  • createNewJsonResponse(statusCode, options?) - a bare Response with a JSON content type, for middleware.
  • httpRequestMethodMiddleware(allowed) - a next-api-middleware middleware that answers 405 for methods other than the allowed ones (OPTIONS always passes).
  • initializeMiddleware(middleware) - wraps a Connect-style (req, res, next) middleware in a promise.
  • requireHeader(name, key, handler) and withIdTokenHeader(handler) - wrap a Pages Router handler and answer 400 when the header (id-token for the latter) is missing.
  • getApiRequestCookie(name, request?) and setApiResponseCookie(res, name, value, options?). setApiResponseCookie takes maxAge in milliseconds and serializes object values as j: plus JSON.

Usage

// app/api/things/route.ts
import {
  appHandleJsonError,
  appHandleJsonSuccess,
} from '@aglyn/shared-util-rest-api'

export async function GET() {
  try {
    return appHandleJsonSuccess({ things: [] })
  } catch (error) {
    return appHandleJsonError(error)
  }
}

Note that appHandleJsonError and nextHandleJsonError include the error object itself in the body, so pass them errors that are safe to show to the caller.

How it fits

A shared package: generic, with no knowledge of Aglyn's model. Shared packages may only import other shared packages; this one depends on @aglyn/shared-data-enums (status codes and reference codes), @aglyn/shared-util-errors and @aglyn/shared-util-http. No other library in the monorepo depends on it; Aglyn's apps use it in their API routes.

License

Apache-2.0. Source: https://github.com/aglyn/aglyn/tree/main/libs/shared/util/rest-api

OX Radar and Response Center

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.

Where it’s listed

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).

  • npm @aglyn/shared-util-rest-api

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Frame 2085668439 (1)
Group 1261154229