npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@merl.ooo/api-types

v1.26.2

Published

Type declarations for api.merl.ooo

Downloads

118

Readme

@merl.ooo/api-types

IMPORTANT NOTE: The type definitions should always be up to date with int.api.merl.ooo. This is the integration environment. So releases might be stuck there for some days, before being deployed to production api.merl.ooo. So you should test your frontend agains integration api in order to ensure consistency with type definitions of this packages. Then maybe wait until the new version is deployed to production. Or for your production deployment pin the version number of this package.

NOTE: RestResource types the members createdAt and updatedAt as Dates. But the REST api outputs Dates in ISO 8601 strings. So you have to convert those fields into Dates before the parsed api response will match the RestResource inheriting Types. This is also valid for all Date field specific to a resource.

Installation

npm i -D @merl.ooo/api-types

Usage

// use meta types (RestResource, ...) helpers (Color, ...) and specific Resources (Room, Event, ...)
import type { RestResource, ResourceId, FindQuery, Color, Room, Event, Tag, v1 /*...*/ } from '@merl.ooo/api-types';

// use a specific api version
import type { Room, Event, Tag /*...*/ } from '@merl.ooo/api-types/v1';
// versions are also exported as named (v1, v2) and the current version, so
// if v1 is the latest version, v1.Room and current.Room are identical to Room imported above
import type { v1, current } from '@merl.ooo/api-types';

enums

You can use fixed enums (eg. for event.kind or art event.essentials.status). Don't import those as types (and move it from devDependencies to regular dependencies, eg. leave out the -D when installing):

import { EventKind, ArtEventStatus } from '@merl.ooo/api-types/v1';

console.log(EventKind.art, ArtEventStatus.requested); // art requested

LICENSE

MIT