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

shopby-api-typescript

v1.0.2

Published

Types for shopby API

Downloads

3

Readme

shopby-api-typescript

이 패키지는 샵바이 API 의 타입만 제공하는 라이브러리입니다.

설치

npm i -D shopby-api-typescript

예시


import type { Paths } from "shopby-api-typescript"; // generated by openapi-typescript

// Schema Obj
type MyType = components["schemas"]["MyType"];

// Path params
type EndpointParams = Paths["/products/search"]["parameters"];

// Response obj
type SuccessResponse = Paths["/products/search"]["get"]["responses"][200]["content"]["application/json"]["schema"];
type ErrorResponse =
  Paths["/products/search"]["get"]["responses"][500]["content"]["application/json"]["schema"];

개선하려는 페인포인트

샵바이 api 문서를 매번 확인하며 개발하는 것은 생산적이지 않습니다. 하지만 샵바이 문서를 만드는 yaml 파일은 openapi 가이드에 맞추어져 제공되진 않습니다. 그렇기 때문에 샵바이 yaml 파일을 openapi-typescript 를 사용하여 ts 파일을 만드는 경우에는 다음과 같은 문제들이 있었습니다.

  • nullable 한 내용들이 optional 하게 처리 되지 않는다.
  • enum 형식 데이터들의 description 들이 union 타입으로 잡힌다.
    • Ex:'네이버 페이' | '카카오 페이' -> 'NAVER_PAY' | 'KAKAO_PAY'
  • 헤더는 모두 optional 하게 처리 되어야 한다.