New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

simple-notifier

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-notifier

A simple tool that supports management UI and query API for notifiactions designating specific version of app or platform

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-55.56%
Maintainers
2
Weekly downloads
 
Created
Source

Simple Notifier

Build Status npm Scrutinizer Code Quality

Overview

Simple Notifiers는 특정 앱/플랫폼 버전을 지정하여 공지사항을 전달할 수 있는 간단한 도구입니다. 공지사항을 관리할 수 있는 웹 UI와 질의를 위한 API를 제공합니다.

버전 비교를 위해서 내부적으로 SemVer를 사용하고 있습니다. 자세한 비교 방식을 확인하시려면 SemVer Calculator를 참조하세요.

Prerequisite

  • Node 6.9.1 버전 이상 설치
  • MongoDB 설치

Install

$ git clone git@github.com:ridibooks/viewer-notification.git [target directory]
$ cd [taget directory]
$ npm install

Run

Make .env file

필요한 경우 프로젝트 루트에 .env 파일을 생성하고 다음의 값들을 설정합니다.

  • MONGODB_URI: MongoDB 접속 주소 (없을 경우 mongodb://localhost 사용)
  • SECRET_KEY: 패스워드와 인증 토큰 암호화를 위한 비밀키 (없을 경우 "secretKey" 문자열 사용)
MONGODB_URI=mongodb://your.domain:port/database_name
SECRET_KEY=secret_key

Run Script

For development

# 다음을 실행하면 서버(포트 번호: 8080)와 모듈 핫 리로딩을 위한 서버(포트 번호: 3000)가 함께 구동됩니다.
npm run start:dev

For production

npm start

구동 후 http://localhost:8080으로 접속하면 관리 UI로 연결됩니다.

Test

npm test

Public API

Check Notifications

현재 디바이스 플랫폼과 앱 버전에 대해 공지사항이 있는지 확인한다.

GET /v1/status/check?device_type=[device_type]&device_version=[device_version]&app_version=[app_version]
Parameters
이름타입설명
device_typeenum (*, android, ios, paper, qt)디바이스(플랫폼) 종류 (더 추가될 수 있음)
device_versionstring (* or SemVer format)디바이스 플랫폼 버전
app_versionstring (* or SemVer format)뷰어 앱 버전 ('x.x.x' 형태 or '*' 입력)
Response (JSON)

배열 형태로 전달됩니다. 질의한 디바이스 타입과 버전에 맞는 알림이 없을 경우 빈 배열이 전달됩니다.

이름타입설명
idstring상태 ID
titlestring알림 제목
typeenum (serviceFailure, routineInspection)상태 종류 (serviceFailure: 서버 문제, routineInspection: 정기 점검)
device_typesarray알림의 대상 디바이스 종류
start_timestring (ISO 8601 포맷)알림 시작 시간 (timezone 포함) - 설정되어 있지 않은 경우 모든 기간 대상
end_timestring (ISO 8601 포맷)알림 종료 시간 (timezone 포함) - 설정되어 있지 않은 경우 모든 기간 대상
contentsstring알림 내용 (HTML 형태)
is_activatedboolean알림 활성화 여부 (항상 true)
device_sem_versionstring대상 디바이스 플랫폼 버전 비교 기준 (SemVer를 따름)
app_sem_versionstring대상 뷰어 앱 버전 비교 기준 (SemVer를 따름)
urlstring관련 URL
Example
Request
GET /api/v1/status/check?device_type=android&device_version=3.5.6&app_version=3.5.6
Response (Success)
{
    "data": [
        {
            "id": "58783e50fdfef4e35318f620",
            "type": "routineInspection",
            "device_types": [
                "android"
            ],
            "contents": "<p>...</p>",
            "is_activated": true,
            "device_sem_version": ">=1.0.0  || =7.0.0-alpha.1",
            "app_sem_version": "<3.0.0 || =6.0.0",
            "start_time": "2017-01-13T11:40:55+09:00",
            "end_time": "2017-01-13T13:40:55+09:00",
            "url": "http://...",
            "title": "..."
        }
    ],
    "success": true
}

Keywords

FAQs

Package last updated on 17 Apr 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc