@swimlane/swimlane-js

1.1.2 • Public • Published

swimlane-js

Setup

./setup-swimlane-js -h SWIMLANE_HOST -u SWIMLANE_USER

SWIMLANE_USER should be the user used when installing Swimlane (the owner of /opt/swimlane). Defaults to swimlane-host if not specified

This script automates setting up the git repo taking these steps:

  • create a new ed25519 SSH key if one doesn't already exist in the default location and adds it to the authorized_keys for the swimlane user
  • set up a git repo for the swimlane-js code
  • set a post-receive hook to update the docker container when code is pushed
  • add an entry in importmap.json to enable importing code from widgets
  • adds a remote to the git repo named swimlane-dev
  • pushes the "main" branch to the new remote to trigger the deployment of the code to the sw_web docker

Usage

Import it into a widget with

import {SwimlaneAPI} from 'swimlane-js';

The constructor takes the api token as a parameter. If instantiated inside a SwimlaneElement

const cli = new SwimlaneAPI(this.contextData.token);

Example code (may not be current)

There's an example index.html that can be used as a reference

  • Fill in the relevant values in config.skel.js and move it to config.js
  • start a web server and load index.html

/@swimlane/swimlane-js/

    Package Sidebar

    Install

    npm i @swimlane/swimlane-js

    Weekly Downloads

    2,502

    Version

    1.1.2

    License

    APACHE-2

    Unpacked Size

    508 kB

    Total Files

    47

    Last publish

    Collaborators

    • lazargersh
    • siva.yadala
    • ajaypalswimlane
    • adityagonnade
    • ashraygupta
    • prasanthsaiboyina
    • abhiswimlane0410
    • varsha_swimlane
    • kodalipraveen
    • mohanalakshmi.s
    • nikshithkolan
    • steveblue
    • kasiviswanathan.mangudi
    • koushik.kumar
    • dmytro_skorokhodov
    • sasha.polishchuk
    • dabbott-sl
    • daniel.selig
    • jogaj_26
    • markcoleman1
    • caleb.bass
    • hansstoetzer
    • sarath.pantula
    • nikkuman
    • agustin.firpo
    • tmcclure
    • ischultz-swimlane
    • bensteele7
    • brantw
    • marjan-georgiev
    • danstory
    • seangrimes
    • adamfrank
    • bageldawg
    • it.admin.swim
    • smartinski
    • royar95
    • mr_charlie
    • swimlane.dev