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

swiss-admin-covid-certificate-api-cli

v1.4.1

Published

[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io) [![Version](https://img.shields.io/npm/v/swiss-admin-covid-certificate-api-cli.svg)](https://npmjs.org/package/swiss-admin-covid-certificate-api-cli) [![Downloads/week](h

Downloads

6

Readme

CLI to use the Swiss Covid Certificate API

oclif Version Downloads/week License

About

cc-cli interacts with the Swiss Covid Certificate API. It was created for testing and demo purposes only.

OpenAPI Model Generation

The model where created from the API specification using openapi-typescript-codegen.

They can be regenerated with npm run generate-api. The implementation is in generate-api.js and the API Spec located at api-doc.json.

Debugging

cc-cli uses debug.

Enable API interaction tracing with DEBUG=cc-cli:api or use the --debug flag.

Usage

$ npm install -g swiss-admin-covid-certificate-api-cli
$ cc-cli COMMAND
running command...
$ cc-cli (-v|--version|version)
swiss-admin-covid-certificate-api-cli/1.4.1 darwin-x64 node-v14.17.0
$ cc-cli --help [COMMAND]
USAGE
  $ cc-cli COMMAND
...

Commands

cc-cli create-recovery

create a recovery certificate

USAGE
  $ cc-cli create-recovery

OPTIONS
  -d, --debug                                            enable debug output.
  --baseUrl=https://ws.covidcertificate-a.bag.admin.ch/  (required) the url of the REST API
  --certificateFile=~/a0000-cc-cli-TEST.cer              (required) path to PEM encoded certificate

  --countryOfTest=CH                                     (required) the country in which the covid certificate owner has
                                                         been tested. Format: string (2 chars according to ISO 3166
                                                         Country Codes).

  --dateOfBirth=1964-03-14                               (required) birthdate of the covid certificate owner. Format:
                                                         ISO 8601 date without time.

  --dateOfFirstPositiveTestResult=2020-01-01             (required) date when the sample for the test was collected.
                                                         Format: ISO 8601 date without time.

  --familyName=Rochat                                    (required) family name of the covid certificate owner

  --givenName=Céline                                     (required) given name of the covid certificate owner

  --keyFile=~/a0000-cc-cli-TEST.encrypted.key            (required) path to PEM encoded private key

  --keyPassphrase=abcdefghijklmnopqrstuvwxyz             passphrase to decrypt the private key

  --language=fr                                          [default: de] Accepted languages are: de, it, fr, rm

  --local                                                adds additional headers required to mock the WSG

  --otp=a.b.c                                            (required) the otp secret

  --outDir=out                                           (required) [default:
                                                         /var/folders/hv/73dvbzz14ms96bgl5xlyxgww0000gn/T] output
                                                         directory

EXAMPLE

       export CC_CLI_OTP="a.b.c"
       export CC_CLI_KEY_PASSPHRASE="secret"
       export CC_CLI_BASE_URL="https://ws.covidcertificate-a.bag.admin.ch/"
       export CC_CLI_CERTIFICATE_FILE="ZH-spital-A-t.bit.admin.ch.cer"
       export CC_CLI_KEY_FILE="ZH-spital-A-t.bit.admin.ch.encrypted.key"
       export CC_CLI_OUT_DIR="out"
       cc-cli create-recovery \
         --language="it" \
         --familyName="Rossi" \
         --givenName="Giulia" \
         --dateOfBirth="1964-03-14" \
         --dateOfFirstPositiveTestResult="2020-01-01" \
         --countryOfTest="CH"

See code: src/commands/create-recovery.ts

cc-cli create-test

create a test certificate

USAGE
  $ cc-cli create-test

OPTIONS
  -d, --debug                                            enable debug output.
  --baseUrl=https://ws.covidcertificate-a.bag.admin.ch/  (required) the url of the REST API
  --certificateFile=~/a0000-cc-cli-TEST.cer              (required) path to PEM encoded certificate

  --dateOfBirth=1964-03-14                               (required) birthdate of the covid certificate owner. Format:
                                                         ISO 8601 date without time.

  --familyName=Rochat                                    (required) family name of the covid certificate owner

  --givenName=Céline                                     (required) given name of the covid certificate owner

  --keyFile=~/a0000-cc-cli-TEST.encrypted.key            (required) path to PEM encoded private key

  --keyPassphrase=abcdefghijklmnopqrstuvwxyz             passphrase to decrypt the private key

  --language=fr                                          [default: de] Accepted languages are: de, it, fr, rm

  --local                                                adds additional headers required to mock the WSG

  --manufacturerCode=1304                                test manufacturer code. This should only be sent when it is not
                                                         a PCR test

  --memberStateOfTest=CH                                 (required) the country in which the covid certificate owner has
                                                         been tested. Format: string (2 chars according to ISO 3166
                                                         Country Codes).

  --otp=a.b.c                                            (required) the otp secret

  --outDir=out                                           (required) [default:
                                                         /var/folders/hv/73dvbzz14ms96bgl5xlyxgww0000gn/T] output
                                                         directory

  --sampleDateTime=2021-05-22T11:12:85Z                  (required) date and time of the test sample collection. Format:
                                                         ISO 8601 date incl. time.

  --testingCentreOrFacility=Walk-in-Lyss AG              (required) name of centre or facility.

  --typeCode=LP217198-3                                  type of test. This field is only mandatory when it is a PCR
                                                         test.

EXAMPLE

       export CC_CLI_OTP="a.b.c"
       export CC_CLI_KEY_PASSPHRASE="secret"
       export CC_CLI_BASE_URL="https://ws.covidcertificate-a.bag.admin.ch/"
       export CC_CLI_CERTIFICATE_FILE="ZH-spital-A-t.bit.admin.ch.cer"
       export CC_CLI_KEY_FILE="ZH-spital-A-t.bit.admin.ch.encrypted.key"
       export CC_CLI_OUT_DIR="out"
       cc-cli create-test \
         --language="de" \
         --familyName="Rochat" \
         --givenName="Céline" \
         --dateOfBirth="1964-03-14" \
         --typeCode="LP6464-4" \
         --sampleDateTime="2020-01-01T17:29:41.063Z" \
         --testingCentreOrFacility="Walk-in-Lyss AG" \
         --memberStateOfTest="CH"

See code: src/commands/create-test.ts

cc-cli create-vaccination

create a vaccination certificate

USAGE
  $ cc-cli create-vaccination

OPTIONS
  -d, --debug                                            enable debug output.
  --baseUrl=https://ws.covidcertificate-a.bag.admin.ch/  (required) the url of the REST API
  --certificateFile=~/a0000-cc-cli-TEST.cer              (required) path to PEM encoded certificate

  --countryOfVaccination=CH                              (required) the country in which the covid certificate owner has
                                                         been vaccinated. Format: string (2 chars according to ISO 3166
                                                         Country Codes).

  --dateOfBirth=1964-03-14                               (required) birthdate of the covid certificate owner. Format:
                                                         ISO 8601 date without time.

  --familyName=Rochat                                    (required) family name of the covid certificate owner

  --givenName=Céline                                     (required) given name of the covid certificate owner

  --keyFile=~/a0000-cc-cli-TEST.encrypted.key            (required) path to PEM encoded private key

  --keyPassphrase=abcdefghijklmnopqrstuvwxyz             passphrase to decrypt the private key

  --language=fr                                          [default: de] Accepted languages are: de, it, fr, rm

  --local                                                adds additional headers required to mock the WSG

  --medicinalProductCode=EU/1/20/1507                    (required) name of the medicinal product as registered in the
                                                         country.

  --numberOfDoses=2                                      (required) number in a series of doses

  --otp=a.b.c                                            (required) the otp secret

  --outDir=out                                           (required) [default:
                                                         /var/folders/hv/73dvbzz14ms96bgl5xlyxgww0000gn/T] output
                                                         directory

  --totalNumberOfDoses=2                                 (required) number in a series of doses

  --vaccinationDate=2020-01-01                           (required) date of vaccination. Format: ISO 8601 date without
                                                         time. Range: can be between 1900-01-01 and 2099-12-31

EXAMPLE

       export CC_CLI_OTP="a.b.c"
       export CC_CLI_KEY_PASSPHRASE="secret"
       export CC_CLI_BASE_URL="https://ws.covidcertificate-a.bag.admin.ch/"
       export CC_CLI_CERTIFICATE_FILE="ZH-spital-A-t.bit.admin.ch.cer"
       export CC_CLI_KEY_FILE="ZH-spital-A-t.bit.admin.ch.encrypted.key"
       export CC_CLI_OUT_DIR="out"
       cc-cli create-vaccination \
         --language="fr" \
         --familyName="Céline" \
         --givenName="Rochat" \
         --dateOfBirth="1964-03-14" \
         --medicinalProductCode="EU/1/20/1507" \
         --numberOfDoses="2" \
         --totalNumberOfDoses="2" \
         --vaccinationDate="2020-01-01" \
         --countryOfVaccination="CH"

See code: src/commands/create-vaccination.ts

cc-cli help [COMMAND]

display help for cc-cli

USAGE
  $ cc-cli help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

cc-cli pm-update FILE

updates otp values and signatures in a Postman collection

USAGE
  $ cc-cli pm-update FILE

ARGUMENTS
  FILE  path to Postman collection

OPTIONS
  -h, --help                                   show CLI help
  --keyFile=~/a0000-cc-cli-TEST.encrypted.key  (required) path to PEM encoded private key
  --keyPassphrase=abcdefghijklmnopqrstuvwxyz   passphrase to decrypt the private key
  --otp=a.b.c                                  (required) the otp secret

See code: src/commands/pm-update.ts

cc-cli sign FILE

reads a utf8 encoded text file, signs the text and writes the base64 encoded signature to stdout

USAGE
  $ cc-cli sign FILE

ARGUMENTS
  FILE  input file, should be JSON

OPTIONS
  -h, --help                                   show CLI help
  --keyFile=~/a0000-cc-cli-TEST.encrypted.key  (required) path to PEM encoded private key
  --keyPassphrase=abcdefghijklmnopqrstuvwxyz   passphrase to decrypt the private key

See code: src/commands/sign.ts