@1amageek/passkit
passkit.ts is Passkit generator
Last updated a year ago by 1amageek .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @1amageek/passkit 
SYNC missed versions from official npm registry.

passkit.ts

passkit.ts is a library for issuing pass with typescript.

Installation

npm add @1amageek/passkit

Usage


const options: PassKit.Options = {
    secretURL: "SECRET_URL", // 
    wwdrURL: "WWDR_URL",
    passTypeIdentifier: "pass.**.**.**",
    teamIdentifier: "TEAM_ID",
    password: "PASSWORD",
}

PassKit.initialize(options)

const assets = new PassKit.Assets()
assets.icon = "URL_icon"
assets.icon2x = "URL_icon2x"
assets.logo = "URL_logo"
assets.logo2x = "URL_logo2x"

const pass: PassKit.Pass = {}
pass.primaryFields = [
    {
        "key": "event",
        "label": "hoge",
        "value": "fuga"
    }
]
pass.secondaryFields = [
    {
        "key": "loc",
        "label": "hoge",
        "value": "fuga"
    }
]

const barcode: PassKit.Barcode = {
    altText: "wow",
    format: PassKit.BarcodeFormat.QR,
    message: "http://google.com",
    messageEncoding: "iso-8859-1"
}

const ticket: PassKit.EventTicket = new PassKit.EventTicket(pass, "Organization", "Description", "UUID_string")
ticket.webServiceURL = "https://google.com"
ticket.barcode = barcode
ticket.relevantDate = new Date()
ticket.logoText = "logo_string"
ticket.foregroundColor = new PassKit.RGB(255, 255, 255)
ticket.backgroundColor = new PassKit.RGB(255, 255, 255)
ticket.authenticationToken = "authenticationToken_string"
try {
    const path = await PassKit.generate(ticket, assets)
    console.log(path)
} catch (error) {
    console.log(error)
}

Donation

Current Tags

  • 0.3.3                                ...           latest (a year ago)

19 Versions

  • 0.3.3                                ...           a year ago
  • 0.3.2                                ...           a year ago
  • 0.3.1                                ...           a year ago
  • 0.3.0                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.8                                ...           2 years ago
  • 0.1.7                                ...           2 years ago
  • 0.1.6                                ...           2 years ago
  • 0.1.5                                ...           2 years ago
  • 0.1.4                                ...           2 years ago
  • 0.1.3                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.0.6                                ...           2 years ago
  • 0.0.5                                ...           2 years ago
  • 0.0.4                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 19
Last Month 58
Dependencies (7)
Dev Dependencies (12)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |