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

kintone-pretty-fields

v0.10.4

Published

Get kintone form fields in a pretty format.

Downloads

23

Readme

kintone-pretty-fields

npm version

Retrieve kintone form field(@kintone/rest-api-client) information in a pretty format.

Description

Provides the field information needed to create a kintone plugin.

  1. Get both field and spacer.
    Check Kintone Developer Program for property details.

  2. Obtain in layout order. (top left first, bottom right after)

  3. Determine the fields in a table.
    Set the table field code to the table property.

{
  type: 'SINGLE_LINE_TEXT',
  code: '文字列__1行_',
  label: '文字列 (1行)',
  noLabel: false,
  required: false,
  minLength: '',
  maxLength: '',
  expression: '',
  hideExpression: false,
  unique: false,
  defaultValue: '',
  table: 'テーブル' // table field code
}
  1. Determine the fields in a group.
    Set the group field code to the group property.
  {
    type: 'SINGLE_LINE_TEXT',
    code: '文字列__1行_',
    label: '文字列 (1行)',
    noLabel: false,
    required: false,
    minLength: '',
    maxLength: '',
    expression: '',
    hideExpression: false,
    unique: false,
    defaultValue: '',
    group: 'グループ' // group field code
  }
  1. Determine the destination field for copying lookups.
    Set the true to the isLookupCopy property.(Requires lookup source app permissions)
{
  type: 'SINGLE_LINE_TEXT',
  code: '文字列__1行_',
  label: '文字列 (1行)',
  noLabel: false,
  required: false,
  minLength: '',
  maxLength: '',
  expression: '',
  hideExpression: false,
  unique: false,
  defaultValue: '',
  isLookupCopy: true // If true, lookup copy destination field
}
  1. Sorts the values of the options.
{
  type: 'CHECK_BOX',
  code: 'チェックボックス',
  label: 'チェックボックス',
  noLabel: false,
  required: false,
  options: {
    sample1: { label: 'sample1', index: '0' },
    sample4: { label: 'sample4', index: '3' },
    sample3: { label: 'sample3', index: '2' },
    sample2: { label: 'sample2', index: '1' }
  },
  defaultValue: [],
  align: 'HORIZONTAL',
  sortedOptions: [ 'sample1', 'sample2', 'sample3', 'sample4' ] // sorted options
}

Installation

1. Install with npm

This library is distributed on npm.

npm install kintone-pretty-fields

You can then use import to import the library.

// ES modules
import { kintonePrettyFields } from "kintone-pretty-fields";

Usage

Here is a sample code that retrieves form fields of an app.

import { KintoneRestAPIClient } from "@kintone/rest-api-client";
import { kintonePrettyFields, kintonePrettyType } from "kintone-pretty-fields";

const client = new KintoneRestAPIClient();
const { fields, spacers } = await kintonePrettyFields.get({ client, app: 1, lang: "en", preview: false });
console.log({ fields, spacers });

const checkBoxFields = fields.filter(kintonePrettyFields.isCheckBox);
console.log(checkBoxFields);

const inSubtableFields = fields.filter(kintonePrettyFields.isInSubtable);
console.log(inSubtableFields);

const myFunction1 = (fields: kintonePrettyType.OneOf[]) => {
  // do something
};

const myFunction2 = (field: kintonePrettyType.CheckBox) => {
  // do something
};

License