🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@ubio/sdk-application-bundle

Package Overview
Dependencies
Maintainers
10
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ubio/sdk-application-bundle

ubio sdk application bundle (prototype)

latest
Source
npmnpm
Version
0.1.4
Version published
Maintainers
10
Created
Source

SDK application bundle

Application bundle using @ubio/sdk.

building form

We use lit-html to support template for all browsers, including IE9.

Form name conventions for building input data

To create input, you need to build a right structure from the form that our protocol expects to get. For instance, you'd like to create the PetInsurance.policyOptions input, you will need to send json data like:

{
    "policyOptions": {
        "coverStartDate": "2019-06-01",
        "numberOfPetsOwned": 1,
        "jointPolicyHolder": false
    }
}

To build that structure, you just need to specify the right name for the input field in your form. Nest the object with brackets([]), if you need to build an array, use numbers in the brackets such as pets[0][name].

<div name="policy-options">
    <input
        type="date"
        name="policy-options[cover-start-date]" value="2019-06-01">

    <input
        type="number"
        name="policy-options[number-of-pets-owned-$number]"
        value="1"/>

    <input
        type="radio"
        name="policy-options[joint-policy-holder-$boolean]"
        value="true">

    <input
        type="radio"
        name="policy-options[joint-policy-holder-$boolean]"
        value="false"
        checked>
</div>

Also, if you need to convert the value to integer or boolean, suffix the name with -$number, -$boolean or -$object to let the form serializer know it needs to parse the value. (if it fails to convert to the specified type, it will just use string value)

Then when you submitting form, it will camel-case the keys and serialize the form to json object which is ready to be posted to automation cloud.

Keywords

ubio

FAQs

Package last updated on 20 Jun 2019

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