πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’
Socket
DemoInstallSign in
Socket

wtm-api

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wtm-api

wtm api

1.6.6
latest
Source
npm
Version published
Weekly downloads
1
-83.33%
Maintainers
1
Weekly downloads
Β 
Created
Source

WTM API

Installation

Using npm:

$ npm install wtm-api

Using yarn:

$ yarn add wtm-api

Usage

import

import {
  getWtmData,
  getWtmCategoryData,
  getWtmSearchData,
  createWtmData,
  WtmListType,
  CategoryItems,
  CategoryColors,
} from "wtm-api";

method

getWtmData()

λͺ¨λ“ λ°μ΄ν„° 쑰회

getWtmFilterData(filterCategory : string, filterNames : string[])

μž₯λ₯΄, μΉ΄ν…Œκ³ λ¦¬ 쑰회

  • filterCategory : ν•„ν„°ν•  νƒœκ·Έλ‚˜ μΉ΄ν…Œκ³ λ¦¬ μ’…λ₯˜
  • filterNames : ν•„ν„°ν•  νƒœκ·Έλ‚˜ μΉ΄ν…Œκ³ λ¦¬μ΄λ¦„λ“€

getWtmSearchData(keyword : string, category : string)

검색데이터 쑰회

  • keyword : 검색할 κ°’
  • category(Optional) : 검색할 μΉ΄ν…Œκ³ λ¦¬(κΈ°λ³Έκ°’ 제λͺ©)

getWtmDetailData(subDocument : string, subCollection : string)

데이터 세뢀사항 쑰회

  • subDocument : λ¬Έμ„œμ΄λ¦„
  • subCollection : μ„ΈλΆ€ μ»¬λ ‰μ…˜ 이름

createWtmData(createObj: WtmListType)

데이터 생성

  • createObj : 생성할 데이터

ex) data.json

{
  tag: "μ˜ν™”",
  title: "λ„ˆμ™€ λ‚˜",
  thumbnailUrl: "imgUrl.jpg",
  category: ['둜맨슀'],
  described: 'β€œμ˜€λŠ˜μ€ λ„ˆν•œν…Œ κΌ­ ν•˜κ³  싢은 말이 μžˆλŠ”λ°β€
              μˆ˜ν•™μ—¬ν–‰μ„ ν•˜λ£¨ μ•žλ‘” μ˜€ν›„, μ„Έλ―ΈλŠ” μ΄μƒν•œ κΏˆμ—μ„œ κΉ¨μ–΄λ‚˜ ν•˜μ€μ—κ²Œλ‘œ ν–₯ν•œλ‹€. μ˜€λž«λ™μ•ˆ λˆŒλŸ¬μ™”λ˜ λ§ˆμŒμ„ μ˜€λŠ˜μ€ λ°˜λ“œμ‹œ μ „ν•΄μ•Ό ν•  것 같은 기뢄이 λ“€μ—ˆκΈ° λ•Œλ¬Έμ΄λ‹€.
              ν•˜μ§€λ§Œ λ„˜μ³ 흐λ₯΄λŠ” 마음과 달리 자꾸만 μ–΄κΈ‹λ‚˜λŠ” 두 μ‚¬λžŒ. μ„œνˆ° μ˜€ν•΄μ™€ μƒμ²˜λ₯Ό λ’€λ‘œν•˜κ³ , μ„Έλ―ΈλŠ” ν•˜μ€μ—κ²Œ 진심을 κ³ λ°±ν•  수 μžˆμ„κΉŒ?',
  grade: "5",
  famousLine: "μ‚¬λž‘ν•΄, μ‚¬λž‘ν•΄, μ‚¬λž‘ν•΄",
  recommended: true,
  startDate: "Wed Jan 25 2017 16:00:00 GMT-0800",
  endDate: null,
  ost: "https://open.spotify.com/track/6HgeeiHqVpxxFCB0bjBRT6?si=3aeb768d866c467c",
  trailer: "https://www.youtube.com/watch?v=CT68pb1ptuY&t=4s",
  watchaPedia: "https://pedia.watcha.com/ko-KR/contents/mdREZrD",
}

utils

list type

import { WtmListType } from "wtm-api";

export interface WtmListType {
  title: string;
  described: string;
  thumbnailUrl: string;
  tag: "μ˜ν™”" | "λ“œλΌλ§ˆ" | "예λŠ₯" | "전체";
  category: string[];
  grade: string;
  recommended: boolean;
  famousLine: string;
  startDate: Date | string;
  endDate?: Date;
  ost: string;
  trailer: string;
  watchaPedia: string;
}

Colors, CategoryColors data

import { Colors, CategoryColors } from "wtm-api";

export const Colors: Record<string, string> = {
  red: "#FF7D7D",
  purple: "#55155d",
  pink: "#982E81",
  gray: "#818198",
  orange: "#EE786D",
  blue: "#5966E9",
  yellow: "#eff4af",
  green: "#7eb293",
  shallowGray: "#d4d4dc",
  brown: "#a95e13",
};

export const CategoryColors = {
  휴먼: Colors.orange,
  둜맨슀: Colors.purple,
  μ•‘μ…˜: Colors.red,
  νŒνƒ€μ§€: Colors.blue,
  범죄: Colors.gray,
  슀릴러: Colors.brown,
  λ―ΈμŠ€ν„°λ¦¬: Colors.shallowGray,
  μ½”λ―Έλ””: Colors.pink,
  λŠμ™€λ₯΄: Colors.shallowGray,
  μ„œλ°”μ΄λ²Œ: Colors.red,
  호러: Colors.yellow,
  SF: Colors.green,
};

export Count CategoryItems =
  휴먼
  둜맨슀: μš°μ›ν•΄, λΉ¨λ ·λ“€
  μ•‘μ…˜: red,
  νŒνƒ€μ§€: blue,
  범죄: gray,
  슀릴러: brown,
  λ―ΈμŠ€ν„°λ¦¬: shallowGray,
  μ½”λ―Έλ””: pink,
  λŠμ™€λ₯΄: shallowGray,
  μ„œλ°”μ΄λ²Œ: red,
  호러: yellow,
  SF: green,

Keywords

wtm

FAQs

Package last updated on 27 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts