Skip to content

pulsate-dev/pulsate-api-types

Repository files navigation

pulsate-api-types

JSR npm

TypeScript types and a Fetch API client generated from the Pulsate OpenAPI schema.

The source package is published as @pulsate/exp-api-types on JSR and as @pulsate-dev/exp-api-types on npm.

Install

deno add jsr:@pulsate/exp-api-types
npm install @pulsate-dev/exp-api-types

Use Fetch Client

import { client, getV0TimelinePublic } from "@pulsate-dev/exp-api-types";

client.setConfig({
  baseUrl: "https://demo.pulsate.dev",
});

const { data, error } = await getV0TimelinePublic();

if (error) {
  throw error;
}

console.log(data[0]?.content);

Use Types

import type { GetPublicTimelineResponse } from "@pulsate-dev/exp-api-types";

type TimelineProps = {
  timeline: GetPublicTimelineResponse;
};

export function Timeline({ timeline }: TimelineProps) {
  return timeline.map((note) => note.content);
}

Generate Types

Requirements: Deno 2.

deno task build

deno task build fetches the OpenAPI schema from the fixed @pulsate-dev/api-schema version in deno.json, generates src/, and does not require a locally copied schema file. OpenAPI descriptions are emitted as JSDoc comments in generated types and operation functions.

To update the schema, explicitly change the @pulsate-dev/api-schema version in deno.json and package.json, then regenerate the types and lockfile.

Build npm Package

The npm package is generated with dnt.

deno task build-npm

Release

Push a v<version> tag matching deno.json's version. GitHub Actions verifies generated types, publishes @pulsate/exp-api-types to JSR, then publishes @pulsate-dev/exp-api-types to npm.

Licenses

Copyright (C) 2025 Pulsate Project

Licensed under Apache 2.0 license

About

TypeScript type definition / fetch client for Pulsate API

Resources

Code of conduct

Stars

Watchers

Forks

Releases

Sponsor this project

Packages

Contributors

Languages