Skip to content

Kinpost is custom JavaScript file uploader for Kintone.

License

Notifications You must be signed in to change notification settings

t-kojima/kinpost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kinpost

npm version Build Status License: MIT

Description

Kinpost can upload any files to custom JavaScript (or CSS) forms via kintone REST API.

Installation

npm install --save-dev kinpost

or

yarn add --dev kinpost

Usage

  • Append any files to custom JavaScript (or CSS) form, if the same filename exists, overwrite an old file.
  • File uploads to Testing Environment. Use deploy option, if you need upload to Production Environment.
const kinpost = require('kinpost');

kinpost({
  domain: 'example.cybozu.com',
  app: 1,
  username: '[email protected]',
  password: '**********',
  files: [
    { path: './js/sample.js' },
    { path: './js/mobile.js', platform: 'mobile' },
    { path: './css/global.css', type: 'css' },
  ],
  deploy: true,
});

Parameters

name type required default description
domain string yes Your kintone sub domain name
app number yes Target kintone app ID
username string yes Login user name
password string yes Login user's password
files array yes File config list, please see next section
deploy boolean no false Deploy to Production Environment

File Config

name type required default description
path string yes Path of the file for upload
encoding string no utf-8 File encoding
platform string no desktop Target Platform. desktop or mobile
type string no js File type. js or css

Examples

Upload a sample.js file to custom JavaScript form for PC.

const kinpost = require('kinpost');

kinpost({
  domain: 'example.cybozu.com',
  app: 1,
  username: '[email protected]',
  password: '**********',
  files: [
    {
      path: './sample.js',
    },
  ],
});

Upload a mobile.js file to custom JavaScript form for Mobile.

const kinpost = require('kinpost');

kinpost({
  domain: 'example.cybozu.com',
  app: 1,
  username: '[email protected]',
  password: '**********',
  files: [
    {
      path: './js/mobile.js',
      platform: 'mobile',
    },
  ],
});

Upload a sample.js file to custom JavaScript form for PC, and global.css file to custom CSS form for PC.

const kinpost = require('kinpost');

kinpost({
  domain: 'example.cybozu.com',
  app: 1,
  username: '[email protected]',
  password: '**********',
  files: [
    {
      path: './js/sample.js',
    },
    {
      path: '/css/global.css',
      type: 'css',
    },
  ],
});

Licence

MIT License.

About

Kinpost is custom JavaScript file uploader for Kintone.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published