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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mizunashi/api-types

v1.0.0

Published

水無海浜温泉 入浴可能時間 API のレスポンス型定義(非公式)

Readme

@mizunashi/api-types

函館市 水無海浜温泉 の入浴可能時間 API(非公式)のレスポンス型定義です。

依存ゼロ。 実行時に持つのは API_VERSIONSCHEMA_VERSION の 2 つの定数だけです。CJS と ESM の両方から型を解決できます。

npm install @mizunashi/api-types

使い方

import type { StatusResponse, PeriodResponse, ResponseMeta } from '@mizunashi/api-types';

const res = await fetch('https://example.com/api/v1/status');
const status = (await res.json()) as StatusResponse;

if (status.state === 'open') {
  console.log(`${status.current?.end} まで`);
}

HTTP クライアントごと欲しい場合は @mizunashi/api-client を使ってください。

主な型

| 型 | 用途 | | --- | --- | | StatusResponse | /api/v1/status | | PeriodResponse | /api/v1/days /weeks /months /years に共通 | | YearsResponse | 提供中の年の一覧 | | MetaResponse | 施設情報・出典 | | ProblemDetails | エラー(RFC 9457) | | ResponseMeta | すべてのレスポンスに含まれるメタ情報 |

押さえておくべき点

期間ビュー 4 種は同じ形を返します。 day / week / month / year はすべて PeriodResponse で、scoperange だけが違います。1 つのレンダラで全ビューを扱えます。

1 日に複数回入れるのが常態です。 sessions は必ず全件を見てください。sessions[0] だけを扱う実装や、summary.firstStartsummary.lastEnd を「入浴可能時間」として表示する実装は誤りになります(その間には入れない時間帯が含まれます)。合計は summary.totalMinutes を使ってください。

nextTodayopenFrom は別物です。 前者は日をまたがない次のセッション、後者は日をまたいで探した次です。両者の差が「今日まだ入れるか」を表します。

すべてのレスポンスに meta が付きます。 meta.fetchedAt(原本の取得時刻)と meta.servedAt(レスポンスの生成時刻)で、情報の鮮度が判断できます。

バージョニング

メジャーバージョンは API のバージョンに追従します(1.x/api/v1)。

型定義は packages/schema の Zod 定義と型等価であることがコンパイル時に検証されています。ずれた状態で公開されることはありません。

著者

otoneko. https://github.com/otnc

ライセンス

MIT