New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

express-zod-api

Package Overview
Dependencies
Maintainers
0
Versions
428
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-zod-api - npm Package Versions

1
43

22.0.0-beta.2

Diff

robintail
published 22.0.0-beta.1 •

robintail
published 21.9.0 •

Changelog

Source

v21.9.0

  • Deprecating MethodPath type in the code generated by Integration:
    • Introducing the Request type to be used instead;
  • Added JSDoc having the request in description for every type and interface generated by Integration;
  • A couple adjustments for consistency and performance.
robintail
published 21.8.0 •

Changelog

Source

v21.8.0

  • Deprecating jsonEndpoints from the code generated by Integration:
    • Use the content-type header of an actual response instead, example.
robintail
published 21.7.0 •

Changelog

Source

v21.7.0

  • Feature: introducing EncodedResponse public interface in the code generated by Integration:
    • The new entity should enable making custom clients having response type awereness based on the status code;
    • The difference between Response and EndcodedResponse is the second hierarchical level.
import { EncodedResponse } from "./generated.ts";

type UsageExample = EncodedResponse["get /v1/user/retrieve"][200];
robintail
published 21.7.0-beta.1 •

robintail
published 21.6.1 •

Changelog

Source

v21.6.1

  • node-mocks-http version is ^1.16.2.
robintail
published 21.6.0 •

Changelog

Source

v21.6.0

  • Supporting the following z.string() formats by the Documentation generator:
    • base64 (as byte), date, time, duration, nanoid;
    • And new formats introduced by Zod 3.24: jwt, base64url, cidr;
  • Fixed missing minLength and maxLength properties when depicting z.string().length() (fixed length strings).
robintail
published 21.5.0 •

Changelog

Source

v21.5.0

  • Feat: Introducing Server-Sent Events:
    • Basic implementation of the event streams feature is now available using EventStreamFactory class;
    • The new factory is similar to EndpointsFactory including the middlewares support;
    • Client application can subscribe to the event stream using EventSource class instance;
    • Documentation and Integration do not have yet a special depiction of such endpoints;
    • This feature is a lightweight alternative to Zod Sockets.
import { z } from "zod";
import { EventStreamFactory } from "express-zod-api";
import { setTimeout } from "node:timers/promises";

const subscriptionEndpoint = EventStreamFactory({
  events: { time: z.number().int().positive() },
}).buildVoid({
  input: z.object({}), // optional input schema
  handler: async ({ options: { emit, isClosed } }) => {
    while (!isClosed()) {
      emit("time", Date.now());
      await setTimeout(1000);
    }
  },
});
const source = new EventSource("https://example.com/api/v1/time");
source.addEventListener("time", (event) => {
  const data = JSON.parse(event.data); // number
});
robintail
published 21.4.0 •

Changelog

Source

v21.4.0

  • Return type of public methods getTags() and getScopes() of Endpoint corrected to ReadyonlyArray<string>;
  • Featuring EndpointsFactory::buildVoid() method:
    • It's a shorthand for returning {} while having output schema z.object({});
    • When using this method, handler may return void while retaining the object-based operation internally.
- factory.build({
+ factory.buildVoid({
-   output: z.object({}),
    handler: async () => {
-     return {};
    },
  });
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc