Kinpost can upload any files to custom JavaScript (or CSS) forms via kintone REST API.
npm install --save-dev kinpost
or
yarn add --dev kinpost
- 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,
});
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 |
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 |
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',
},
],
});
MIT License.