kinpost
v1.0.1
Published
Kinpost is custom JavaScript file uploader for Kintone.
Readme
kinpost
Description
Kinpost can upload any files to custom JavaScript (or CSS) forms via kintone REST API.
Installation
npm install --save-dev kinpostor
yarn add --dev kinpostUsage
- Append any files to custom JavaScript (or CSS) form, if the same filename exists, overwrite an old file.
- File uploads to Testing Environment. Use
deployoption, 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.

