@konomi-app/k2 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -2
- package/dist/index.js +551 -13
- package/dist/index.js.map +1 -1
- package/dist/plugin.d.ts +0 -2
- package/dist/plugin.js +1086 -23
- package/dist/plugin.js.map +1 -1
- package/package.json +4 -79
- package/dist/commands/build-base.d.ts +0 -6
- package/dist/commands/build-base.d.ts.map +0 -1
- package/dist/commands/build-base.js +0 -7
- package/dist/commands/build-base.js.map +0 -1
- package/dist/commands/build-esbuild.d.ts +0 -7
- package/dist/commands/build-esbuild.d.ts.map +0 -1
- package/dist/commands/build-esbuild.js +0 -63
- package/dist/commands/build-esbuild.js.map +0 -1
- package/dist/commands/build-tailwind.d.ts +0 -2
- package/dist/commands/build-tailwind.d.ts.map +0 -1
- package/dist/commands/build-tailwind.js +0 -19
- package/dist/commands/build-tailwind.js.map +0 -1
- package/dist/commands/build.d.ts +0 -7
- package/dist/commands/build.d.ts.map +0 -1
- package/dist/commands/build.js +0 -52
- package/dist/commands/build.js.map +0 -1
- package/dist/commands/dev/index.d.ts +0 -9
- package/dist/commands/dev/index.d.ts.map +0 -1
- package/dist/commands/dev/index.js +0 -60
- package/dist/commands/dev/index.js.map +0 -1
- package/dist/commands/dev/tailwind.d.ts +0 -5
- package/dist/commands/dev/tailwind.d.ts.map +0 -1
- package/dist/commands/dev/tailwind.js +0 -30
- package/dist/commands/dev/tailwind.js.map +0 -1
- package/dist/commands/dev-base-esbuild.d.ts +0 -8
- package/dist/commands/dev-base-esbuild.d.ts.map +0 -1
- package/dist/commands/dev-base-esbuild.js +0 -18
- package/dist/commands/dev-base-esbuild.js.map +0 -1
- package/dist/commands/genkey-base.d.ts +0 -4
- package/dist/commands/genkey-base.d.ts.map +0 -1
- package/dist/commands/genkey-base.js +0 -19
- package/dist/commands/genkey-base.js.map +0 -1
- package/dist/commands/genkey.d.ts +0 -5
- package/dist/commands/genkey.d.ts.map +0 -1
- package/dist/commands/genkey.js +0 -14
- package/dist/commands/genkey.js.map +0 -1
- package/dist/commands/lint.d.ts +0 -8
- package/dist/commands/lint.d.ts.map +0 -1
- package/dist/commands/lint.js +0 -20
- package/dist/commands/lint.js.map +0 -1
- package/dist/commands/manifest/index.d.ts +0 -2
- package/dist/commands/manifest/index.d.ts.map +0 -1
- package/dist/commands/manifest/index.js +0 -29
- package/dist/commands/manifest/index.js.map +0 -1
- package/dist/commands/plugin-build.d.ts +0 -3
- package/dist/commands/plugin-build.d.ts.map +0 -1
- package/dist/commands/plugin-build.js +0 -60
- package/dist/commands/plugin-build.js.map +0 -1
- package/dist/commands/plugin-dev/create-manifest.d.ts +0 -5
- package/dist/commands/plugin-dev/create-manifest.d.ts.map +0 -1
- package/dist/commands/plugin-dev/create-manifest.js +0 -30
- package/dist/commands/plugin-dev/create-manifest.js.map +0 -1
- package/dist/commands/plugin-dev/index.d.ts +0 -6
- package/dist/commands/plugin-dev/index.d.ts.map +0 -1
- package/dist/commands/plugin-dev/index.js +0 -50
- package/dist/commands/plugin-dev/index.js.map +0 -1
- package/dist/commands/plugin-dev/tailwind.d.ts +0 -2
- package/dist/commands/plugin-dev/tailwind.d.ts.map +0 -1
- package/dist/commands/plugin-dev/tailwind.js +0 -42
- package/dist/commands/plugin-dev/tailwind.js.map +0 -1
- package/dist/commands/plugin-dev/upload.d.ts +0 -5
- package/dist/commands/plugin-dev/upload.d.ts.map +0 -1
- package/dist/commands/plugin-dev/upload.js +0 -58
- package/dist/commands/plugin-dev/upload.js.map +0 -1
- package/dist/commands/plugin-esbuild.d.ts +0 -3
- package/dist/commands/plugin-esbuild.d.ts.map +0 -1
- package/dist/commands/plugin-esbuild.js +0 -66
- package/dist/commands/plugin-esbuild.js.map +0 -1
- package/dist/commands/plugin-genkey.d.ts +0 -3
- package/dist/commands/plugin-genkey.d.ts.map +0 -1
- package/dist/commands/plugin-genkey.js +0 -13
- package/dist/commands/plugin-genkey.js.map +0 -1
- package/dist/commands/plugin-init.d.ts +0 -3
- package/dist/commands/plugin-init.d.ts.map +0 -1
- package/dist/commands/plugin-init.js +0 -45
- package/dist/commands/plugin-init.js.map +0 -1
- package/dist/commands/plugin-tsup.d.ts +0 -3
- package/dist/commands/plugin-tsup.d.ts.map +0 -1
- package/dist/commands/plugin-tsup.js +0 -65
- package/dist/commands/plugin-tsup.js.map +0 -1
- package/dist/commands/plugin-zip.d.ts +0 -2
- package/dist/commands/plugin-zip.d.ts.map +0 -1
- package/dist/commands/plugin-zip.js +0 -50
- package/dist/commands/plugin-zip.js.map +0 -1
- package/dist/commands/test/index.d.ts +0 -3
- package/dist/commands/test/index.d.ts.map +0 -1
- package/dist/commands/test/index.js +0 -17
- package/dist/commands/test/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/cert.d.ts +0 -4
- package/dist/lib/cert.d.ts.map +0 -1
- package/dist/lib/cert.js +0 -16
- package/dist/lib/cert.js.map +0 -1
- package/dist/lib/constants.d.ts +0 -13
- package/dist/lib/constants.d.ts.map +0 -1
- package/dist/lib/constants.js +0 -14
- package/dist/lib/constants.js.map +0 -1
- package/dist/lib/esbuild.d.ts +0 -6
- package/dist/lib/esbuild.d.ts.map +0 -1
- package/dist/lib/esbuild.js +0 -39
- package/dist/lib/esbuild.js.map +0 -1
- package/dist/lib/exec.d.ts +0 -3
- package/dist/lib/exec.d.ts.map +0 -1
- package/dist/lib/exec.js +0 -4
- package/dist/lib/exec.js.map +0 -1
- package/dist/lib/import.d.ts +0 -4
- package/dist/lib/import.d.ts.map +0 -1
- package/dist/lib/import.js +0 -18
- package/dist/lib/import.js.map +0 -1
- package/dist/lib/k2.d.ts +0 -2
- package/dist/lib/k2.d.ts.map +0 -1
- package/dist/lib/k2.js +0 -9
- package/dist/lib/k2.js.map +0 -1
- package/dist/lib/kintone-api-client.d.ts +0 -57
- package/dist/lib/kintone-api-client.d.ts.map +0 -1
- package/dist/lib/kintone-api-client.js +0 -95
- package/dist/lib/kintone-api-client.js.map +0 -1
- package/dist/lib/lint.d.ts +0 -2
- package/dist/lib/lint.d.ts.map +0 -1
- package/dist/lib/lint.js +0 -28
- package/dist/lib/lint.js.map +0 -1
- package/dist/lib/plugin-contents.d.ts +0 -5
- package/dist/lib/plugin-contents.d.ts.map +0 -1
- package/dist/lib/plugin-contents.js +0 -28
- package/dist/lib/plugin-contents.js.map +0 -1
- package/dist/lib/plugin-manifest.d.ts +0 -4
- package/dist/lib/plugin-manifest.d.ts.map +0 -1
- package/dist/lib/plugin-manifest.js +0 -13
- package/dist/lib/plugin-manifest.js.map +0 -1
- package/dist/lib/tailwind.d.ts +0 -33
- package/dist/lib/tailwind.d.ts.map +0 -1
- package/dist/lib/tailwind.js +0 -91
- package/dist/lib/tailwind.js.map +0 -1
- package/dist/lib/tsup.d.ts +0 -3
- package/dist/lib/tsup.d.ts.map +0 -1
- package/dist/lib/tsup.js +0 -26
- package/dist/lib/tsup.js.map +0 -1
- package/dist/lib/utils.d.ts +0 -16
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/utils.js +0 -66
- package/dist/lib/utils.js.map +0 -1
- package/dist/lib/webpack.d.ts +0 -6
- package/dist/lib/webpack.d.ts.map +0 -1
- package/dist/lib/webpack.js +0 -72
- package/dist/lib/webpack.js.map +0 -1
- package/dist/lib/zip.d.ts +0 -4
- package/dist/lib/zip.d.ts.map +0 -1
- package/dist/lib/zip.js +0 -65
- package/dist/lib/zip.js.map +0 -1
- package/dist/plugin.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-genkey.d.ts","sourceRoot":"","sources":["../../src/commands/plugin-genkey.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,OAAO,SAK9B;AAED,wBAAsB,MAAM,kBAE3B"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { program } from 'commander';
|
|
2
|
-
import base from './genkey-base.js';
|
|
3
|
-
import { PLUGIN_WORKSPACE_DIRECTORY } from '../lib/constants.js';
|
|
4
|
-
export default function command() {
|
|
5
|
-
program
|
|
6
|
-
.command('genkey')
|
|
7
|
-
.description('Generate SSL key for localhost. (Require mkcert)')
|
|
8
|
-
.action(action);
|
|
9
|
-
}
|
|
10
|
-
export async function action() {
|
|
11
|
-
await base({ output: PLUGIN_WORKSPACE_DIRECTORY });
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=plugin-genkey.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-genkey.js","sourceRoot":"","sources":["../../src/commands/plugin-genkey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,kDAAkD,CAAC;SAC/D,MAAM,CAAC,MAAM,CAAC,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM;IAC1B,MAAM,IAAI,CAAC,EAAE,MAAM,EAAE,0BAA0B,EAAE,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-init.d.ts","sourceRoot":"","sources":["../../src/commands/plugin-init.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,OAAO,SAE9B;AAED,wBAAsB,MAAM,kBAkC3B"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { program } from 'commander';
|
|
2
|
-
import fs from 'fs-extra';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import packer from '@kintone/plugin-packer';
|
|
5
|
-
import { outputManifest } from '../lib/plugin-manifest.js';
|
|
6
|
-
import { PLUGIN_WORKSPACE_DIRECTORY } from '../lib/constants.js';
|
|
7
|
-
import { getContentsZipBuffer, outputContentsZip } from '../lib/zip.js';
|
|
8
|
-
import { copyPluginContents } from '../lib/plugin-contents.js';
|
|
9
|
-
export default function command() {
|
|
10
|
-
program.command('init').description('generate private.ppk and kitting config').action(action);
|
|
11
|
-
}
|
|
12
|
-
export async function action() {
|
|
13
|
-
console.group('🍳 Executing plugin initialization setup');
|
|
14
|
-
try {
|
|
15
|
-
const manifest = await outputManifest('dev');
|
|
16
|
-
console.log('📝 manifest.json generated');
|
|
17
|
-
await copyPluginContents();
|
|
18
|
-
console.log('📁 contents copied');
|
|
19
|
-
let privateKey;
|
|
20
|
-
const keyPath = path.join(PLUGIN_WORKSPACE_DIRECTORY, 'private.ppk');
|
|
21
|
-
if (fs.existsSync(keyPath)) {
|
|
22
|
-
privateKey = await fs.readFile(keyPath, 'utf8');
|
|
23
|
-
}
|
|
24
|
-
await outputContentsZip(manifest);
|
|
25
|
-
const buffer = await getContentsZipBuffer();
|
|
26
|
-
const output = await packer(buffer, privateKey);
|
|
27
|
-
if (!privateKey) {
|
|
28
|
-
await fs.writeFile(path.join(PLUGIN_WORKSPACE_DIRECTORY, 'private.ppk'), output.privateKey);
|
|
29
|
-
console.log('🔑 private.ppk generated');
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
console.log('🔑 private.ppk already exists. The existing private.ppk will be used.');
|
|
33
|
-
}
|
|
34
|
-
await fs.writeFile(path.join(PLUGIN_WORKSPACE_DIRECTORY, 'plugin.zip'), output.plugin);
|
|
35
|
-
console.log('📦 plugin.zip generated');
|
|
36
|
-
console.log('✨ Plugin initialization setup completed! zip file path is ./.plugin/plugin.zip');
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
throw error;
|
|
40
|
-
}
|
|
41
|
-
finally {
|
|
42
|
-
console.groupEnd();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=plugin-init.js.map
|
|
@@ -1 +0,0 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C,CAAC;QAClC,MAAM,MAAM,GAAG,MAAM,oBAAoB,EAAE,CAAC;QAE5C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QAEhD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,aAAa,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;YAC5F,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QAC1C,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,uEAAuE,CAAC,CAAC;QACvF,CAAC;QACD,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QACvF,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,gFAAgF,CAAC,CAAC;IAChG,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,QAAQ,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-tsup.d.ts","sourceRoot":"","sources":["../../src/commands/plugin-tsup.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,OAAO,SAK9B;AAED,wBAAsB,MAAM,kBA0D3B"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { program } from 'commander';
|
|
2
|
-
import fs from 'fs-extra';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import { PLUGIN_CONTENTS_DIRECTORY } from '../lib/constants.js';
|
|
5
|
-
import { importK2PluginConfig } from '../lib/import.js';
|
|
6
|
-
import { lint } from '../lib/lint.js';
|
|
7
|
-
import { getTailwindConfig, getTailwindInputCss, outputCss } from '../lib/tailwind.js';
|
|
8
|
-
import { buildWithTsup } from '../lib/tsup.js';
|
|
9
|
-
export default function command() {
|
|
10
|
-
program
|
|
11
|
-
.command('tsup')
|
|
12
|
-
.description("Build the project for production. (It's a wrapper of webpack build command.)")
|
|
13
|
-
.action(action);
|
|
14
|
-
}
|
|
15
|
-
export async function action() {
|
|
16
|
-
console.group('🍳 Build the project for production');
|
|
17
|
-
try {
|
|
18
|
-
const config = await importK2PluginConfig();
|
|
19
|
-
if (config?.lint?.build) {
|
|
20
|
-
await lint();
|
|
21
|
-
console.log('✨ Lint success.');
|
|
22
|
-
}
|
|
23
|
-
if (!fs.existsSync(PLUGIN_CONTENTS_DIRECTORY)) {
|
|
24
|
-
await fs.mkdir(PLUGIN_CONTENTS_DIRECTORY, { recursive: true });
|
|
25
|
-
}
|
|
26
|
-
if (config.tailwind?.css && config.tailwind?.config) {
|
|
27
|
-
const tailwindConfig = await getTailwindConfig(config.tailwind);
|
|
28
|
-
const inputFile = getTailwindInputCss(config.tailwind);
|
|
29
|
-
await outputCss({
|
|
30
|
-
inputPath: inputFile.config,
|
|
31
|
-
outputPath: path.join(PLUGIN_CONTENTS_DIRECTORY, 'config.css'),
|
|
32
|
-
config: tailwindConfig.config,
|
|
33
|
-
minify: true,
|
|
34
|
-
});
|
|
35
|
-
console.log('✨ Built config.css');
|
|
36
|
-
await outputCss({
|
|
37
|
-
inputPath: inputFile.desktop,
|
|
38
|
-
outputPath: path.join(PLUGIN_CONTENTS_DIRECTORY, 'desktop.css'),
|
|
39
|
-
config: tailwindConfig.desktop,
|
|
40
|
-
minify: true,
|
|
41
|
-
});
|
|
42
|
-
console.log('✨ Built desktop.css');
|
|
43
|
-
}
|
|
44
|
-
const entryPoints = ['desktop', 'config'].reduce((acc, dir) => ({
|
|
45
|
-
...acc,
|
|
46
|
-
[dir]: path.join('src', dir, 'index.ts'),
|
|
47
|
-
}), {});
|
|
48
|
-
await buildWithTsup({
|
|
49
|
-
entryPoints,
|
|
50
|
-
outDir: PLUGIN_CONTENTS_DIRECTORY,
|
|
51
|
-
minify: true,
|
|
52
|
-
treeshake: true,
|
|
53
|
-
sourcemap: false,
|
|
54
|
-
});
|
|
55
|
-
console.log('✨ Built desktop.js and config.js');
|
|
56
|
-
console.log('✨ Build success.');
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
throw error;
|
|
60
|
-
}
|
|
61
|
-
finally {
|
|
62
|
-
console.groupEnd();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=plugin-tsup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-tsup.js","sourceRoot":"","sources":["../../src/commands/plugin-tsup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,8EAA8E,CAAC;SAC3F,MAAM,CAAC,MAAM,CAAC,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM;IAC1B,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;IAErD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,oBAAoB,EAAE,CAAC;QAE5C,IAA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C,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,UAAU,CAAC;SACzC,CAAC,EACF,EAAE,CACH,CAAC;QAEF,MAAM,aAAa,CAAC;YAClB,WAAW;YACX,MAAM,EAAE,yBAAyB;YACjC,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;QAChD,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,QAAQ,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-zip.d.ts","sourceRoot":"","sources":["../../src/commands/plugin-zip.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,OAAO,IAAI,IAAI,CAWtC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { program } from 'commander';
|
|
2
|
-
import { outputManifest } from '../lib/plugin-manifest.js';
|
|
3
|
-
import fs from 'fs-extra';
|
|
4
|
-
import path from 'path';
|
|
5
|
-
import { PLUGIN_WORKSPACE_DIRECTORY } from '../lib/constants.js';
|
|
6
|
-
import packer from '@kintone/plugin-packer';
|
|
7
|
-
import { getContentsZipBuffer, getZipFileNameSuffix, outputContentsZip } from '../lib/zip.js';
|
|
8
|
-
import { copyPluginContents } from '../lib/plugin-contents.js';
|
|
9
|
-
import { isEnv } from '../lib/utils.js';
|
|
10
|
-
export default function command() {
|
|
11
|
-
program
|
|
12
|
-
.command('zip')
|
|
13
|
-
.description('generate plugin zip')
|
|
14
|
-
.option('-e, --env <env>', 'plugin environment (dev, prod, standalone)', 'prod')
|
|
15
|
-
.option('-p, --ppk <ppk>', '.ppk file path', path.join(PLUGIN_WORKSPACE_DIRECTORY, 'private.ppk'))
|
|
16
|
-
.action(action);
|
|
17
|
-
}
|
|
18
|
-
async function action(options) {
|
|
19
|
-
console.group('🍳 Executing plugin zip generation');
|
|
20
|
-
try {
|
|
21
|
-
const { env, ppk: ppkPath } = options;
|
|
22
|
-
if (!isEnv(env)) {
|
|
23
|
-
throw new Error('Invalid environment');
|
|
24
|
-
}
|
|
25
|
-
await copyPluginContents();
|
|
26
|
-
console.log('📁 contents copied');
|
|
27
|
-
const manifest = await outputManifest(env);
|
|
28
|
-
console.log(`📝 manifest.json generated (${env})`);
|
|
29
|
-
await outputContentsZip(manifest);
|
|
30
|
-
console.log('📦 contents.zip generated');
|
|
31
|
-
const buffer = await getContentsZipBuffer();
|
|
32
|
-
const privateKey = await fs.readFile(path.resolve(ppkPath), 'utf8');
|
|
33
|
-
const output = await packer(buffer, privateKey);
|
|
34
|
-
const zipFileName = `plugin${getZipFileNameSuffix(env)}.zip`;
|
|
35
|
-
await fs.writeFile(path.join(PLUGIN_WORKSPACE_DIRECTORY, zipFileName), output.plugin);
|
|
36
|
-
console.log('📦 plugin.zip generated');
|
|
37
|
-
// version ファイルを出力
|
|
38
|
-
const version = String(manifest.version);
|
|
39
|
-
await fs.writeFile(path.join(PLUGIN_WORKSPACE_DIRECTORY, 'version'), version);
|
|
40
|
-
console.log(`📝 version file generated (${version})`);
|
|
41
|
-
console.log(`✨ Plugin zip generation completed! zip file path is ./.plugin/${zipFileName}`);
|
|
42
|
-
}
|
|
43
|
-
catch (error) {
|
|
44
|
-
throw error;
|
|
45
|
-
}
|
|
46
|
-
finally {
|
|
47
|
-
console.groupEnd();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=plugin-zip.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-zip.js","sourceRoot":"","sources":["../../src/commands/plugin-zip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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BAAsB,MAAM,kBAU3B"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { program } from 'commander';
|
|
2
|
-
import fs from 'fs-extra';
|
|
3
|
-
import { esmImport } from '../../lib/import.js';
|
|
4
|
-
export default function command() {
|
|
5
|
-
program.command('test').description('test').action(action);
|
|
6
|
-
}
|
|
7
|
-
export async function action() {
|
|
8
|
-
console.group('package.json');
|
|
9
|
-
const packageJson = fs.readJSONSync('package.json');
|
|
10
|
-
console.log('package.json detected');
|
|
11
|
-
console.groupEnd();
|
|
12
|
-
console.group('Config');
|
|
13
|
-
const config = await esmImport('plugin.config.mjs');
|
|
14
|
-
console.log('plugin.config.mjs detected', config);
|
|
15
|
-
console.groupEnd();
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/test/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM;IAC1B,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC9B,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACrC,OAAO,CAAC,QAAQ,EAAE,CAAC;IAEnB,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxB,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,mBAAmB,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,MAAM,CAAC,CAAC;IAClD,OAAO,CAAC,QAAQ,EAAE,CAAC;AACrB,CAAC"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/lib/cert.d.ts
DELETED
package/dist/lib/cert.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cert.d.ts","sourceRoot":"","sources":["../../src/lib/cert.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,GAAU,QAAQ,MAAM;;EAWhD,CAAC"}
|
package/dist/lib/cert.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { exec } from './exec.js';
|
|
2
|
-
import fs from 'fs-extra';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
export const generateCert = async (outDir) => {
|
|
5
|
-
const { stdout } = await exec(`mkcert localhost 127.0.0.1 ::1`);
|
|
6
|
-
[
|
|
7
|
-
{ input: 'localhost+2.pem', output: 'localhost-cert.pem' },
|
|
8
|
-
{ input: 'localhost+2-key.pem', output: 'localhost-key.pem' },
|
|
9
|
-
].forEach(({ input, output }) => {
|
|
10
|
-
fs.moveSync(`./${input}`, path.join(outDir, output), {
|
|
11
|
-
overwrite: true,
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
return { stdout };
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=cert.js.map
|
package/dist/lib/cert.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cert.js","sourceRoot":"","sources":["../../src/lib/cert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,MAAc,EAAE,EAAE;IACnD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,gCAAgC,CAAC,CAAC;IAChE;QACE,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,EAAE,oBAAoB,EAAE;QAC1D,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,EAAE,mBAAmB,EAAE;KAC9D,CAAC,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;QAC9B,EAAE,CAAC,QAAQ,CAAC,KAAK,KAAK,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;YACnD,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC,CAAC"}
|
package/dist/lib/constants.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const WORKSPACE_DIRECTORY = ".k2";
|
|
2
|
-
export declare const DEVELOPMENT_DIRECTORY: string;
|
|
3
|
-
export declare const CONFIG_FILE_NAME = "k2.config.mjs";
|
|
4
|
-
export declare const PLUGIN_CONFIG_FILE_NAME = "plugin.config.mjs";
|
|
5
|
-
/** kintoneプラグインの一時ファイルを管理するフォルダ */
|
|
6
|
-
export declare const PLUGIN_WORKSPACE_DIRECTORY = ".plugin";
|
|
7
|
-
/** kintoneプラグインのcontents.zipに格納するファイルを管理するフォルダ */
|
|
8
|
-
export declare const PLUGIN_CONTENTS_DIRECTORY: string;
|
|
9
|
-
/** kintoneプラグインの開発時、ローカルサーバーに反映するファイルを管理するフォルダ */
|
|
10
|
-
export declare const PLUGIN_DEVELOPMENT_DIRECTORY: string;
|
|
11
|
-
/** ローカルサーバーのデフォルトポート番号 */
|
|
12
|
-
export declare const DEFAULT_PORT = 32767;
|
|
13
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,QAAQ,CAAC;AACzC,eAAO,MAAM,qBAAqB,QAAwC,CAAC;AAE3E,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAChD,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAE3D,mCAAmC;AACnC,eAAO,MAAM,0BAA0B,YAAY,CAAC;AACpD,kDAAkD;AAClD,eAAO,MAAM,yBAAyB,QAAoD,CAAC;AAC3F,kDAAkD;AAClD,eAAO,MAAM,4BAA4B,QAA+C,CAAC;AAEzF,0BAA0B;AAC1B,eAAO,MAAM,YAAY,QAAQ,CAAC"}
|
package/dist/lib/constants.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
export const WORKSPACE_DIRECTORY = '.k2';
|
|
3
|
-
export const DEVELOPMENT_DIRECTORY = path.join(WORKSPACE_DIRECTORY, 'dev');
|
|
4
|
-
export const CONFIG_FILE_NAME = 'k2.config.mjs';
|
|
5
|
-
export const PLUGIN_CONFIG_FILE_NAME = 'plugin.config.mjs';
|
|
6
|
-
/** kintoneプラグインの一時ファイルを管理するフォルダ */
|
|
7
|
-
export const PLUGIN_WORKSPACE_DIRECTORY = '.plugin';
|
|
8
|
-
/** kintoneプラグインのcontents.zipに格納するファイルを管理するフォルダ */
|
|
9
|
-
export const PLUGIN_CONTENTS_DIRECTORY = path.join(PLUGIN_WORKSPACE_DIRECTORY, 'contents');
|
|
10
|
-
/** kintoneプラグインの開発時、ローカルサーバーに反映するファイルを管理するフォルダ */
|
|
11
|
-
export const PLUGIN_DEVELOPMENT_DIRECTORY = path.join(PLUGIN_WORKSPACE_DIRECTORY, 'dev');
|
|
12
|
-
/** ローカルサーバーのデフォルトポート番号 */
|
|
13
|
-
export const DEFAULT_PORT = 32767;
|
|
14
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC;AACzC,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;AAE3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAChD,MAAM,CAAC,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAE3D,mCAAmC;AACnC,MAAM,CAAC,MAAM,0BAA0B,GAAG,SAAS,CAAC;AACpD,kDAAkD;AAClD,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,UAAU,CAAC,CAAC;AAC3F,kDAAkD;AAClD,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;AAEzF,0BAA0B;AAC1B,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC"}
|
package/dist/lib/esbuild.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import esbuild, { type BuildOptions } from 'esbuild';
|
|
2
|
-
export declare const getEsbuildContext: (params: BuildOptions) => Promise<esbuild.BuildContext<esbuild.BuildOptions>>;
|
|
3
|
-
export declare const buildWithEsbuild: (params: BuildOptions & {
|
|
4
|
-
watch?: boolean;
|
|
5
|
-
}) => Promise<void>;
|
|
6
|
-
//# sourceMappingURL=esbuild.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"esbuild.d.ts","sourceRoot":"","sources":["../../src/lib/esbuild.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,EAAE,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AA+BrD,eAAO,MAAM,iBAAiB,GAAU,QAAQ,YAAY,wDAE3D,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,QAAQ,YAAY,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,kBAShF,CAAC"}
|
package/dist/lib/esbuild.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import esbuild, {} from 'esbuild';
|
|
3
|
-
const completeBuildOptions = (params) => {
|
|
4
|
-
return {
|
|
5
|
-
bundle: true,
|
|
6
|
-
platform: 'browser',
|
|
7
|
-
...params,
|
|
8
|
-
plugins: [...(params.plugins ?? [])],
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
const completeDevBuildOptions = (params) => {
|
|
12
|
-
return completeBuildOptions({
|
|
13
|
-
...params,
|
|
14
|
-
plugins: [
|
|
15
|
-
...(params.plugins ?? []),
|
|
16
|
-
{
|
|
17
|
-
name: 'on-end',
|
|
18
|
-
setup: ({ onEnd }) => onEnd(() => console.log(chalk.hex('#e5e7eb')(`${new Date().toLocaleTimeString()} `) +
|
|
19
|
-
chalk.cyan(`[js] `) +
|
|
20
|
-
`rebuilt`)),
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
export const getEsbuildContext = async (params) => {
|
|
26
|
-
return esbuild.context(completeDevBuildOptions(params));
|
|
27
|
-
};
|
|
28
|
-
export const buildWithEsbuild = async (params) => {
|
|
29
|
-
const { watch = false, ...rest } = params;
|
|
30
|
-
if (watch) {
|
|
31
|
-
const context = await getEsbuildContext(rest);
|
|
32
|
-
context.watch();
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
const options = completeBuildOptions(rest);
|
|
36
|
-
await esbuild.build(options);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=esbuild.js.map
|
package/dist/lib/esbuild.js.map
DELETED
|
@@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,EAAE,GAAG,MAAM,CAAC;IAC1C,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC9C,OAAO,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;SAAM,CAAC;QACN,MAAM,OAAO,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC,CAAC"}
|
package/dist/lib/exec.d.ts
DELETED
package/dist/lib/exec.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../src/lib/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AAGpD,eAAO,MAAM,IAAI,kCAAyB,CAAC"}
|
package/dist/lib/exec.js
DELETED
package/dist/lib/exec.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../src/lib/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,MAAM,CAAC,MAAM,IAAI,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC"}
|
package/dist/lib/import.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const esmImport: (path: string) => Promise<any>;
|
|
2
|
-
export declare const importK2Config: (configFileName?: string) => Promise<K2.Config>;
|
|
3
|
-
export declare const importK2PluginConfig: (configFileName?: string) => Promise<Plugin.Meta.Config>;
|
|
4
|
-
//# sourceMappingURL=import.d.ts.map
|
package/dist/lib/import.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../src/lib/import.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,iBAMrC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAU,iBAAiB,MAAM,KAAG,OAAO,CAAC,EAAE,CAAC,MAAM,CAE/E,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,iBAAiB,MAAM,KACtB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAE5B,CAAC"}
|
package/dist/lib/import.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { pathToFileURL } from 'url';
|
|
2
|
-
import { CONFIG_FILE_NAME, PLUGIN_CONFIG_FILE_NAME } from './constants.js';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
export const esmImport = (path) => {
|
|
5
|
-
if (process.platform === 'win32') {
|
|
6
|
-
return import(pathToFileURL(path).toString());
|
|
7
|
-
}
|
|
8
|
-
else {
|
|
9
|
-
return import(path);
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export const importK2Config = async (configFileName) => {
|
|
13
|
-
return (await esmImport(path.resolve(configFileName ?? CONFIG_FILE_NAME))).default;
|
|
14
|
-
};
|
|
15
|
-
export const importK2PluginConfig = async (configFileName) => {
|
|
16
|
-
return (await esmImport(path.resolve(configFileName ?? PLUGIN_CONFIG_FILE_NAME))).default;
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=import.js.map
|
package/dist/lib/import.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../src/lib/import.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,EAAE;IACxC,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChD,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EAAE,cAAuB,EAAsB,EAAE;IAClF,OAAO,CAAC,MAAM,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACrF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EACvC,cAAuB,EACM,EAAE;IAC/B,OAAO,CAAC,MAAM,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,IAAI,uBAAuB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AAC5F,CAAC,CAAC"}
|
package/dist/lib/k2.d.ts
DELETED
package/dist/lib/k2.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"k2.d.ts","sourceRoot":"","sources":["../../src/lib/k2.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,QAAO,EAAE,CAAC,MAOxC,CAAC"}
|
package/dist/lib/k2.js
DELETED
package/dist/lib/k2.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"k2.js","sourceRoot":"","sources":["../../src/lib/k2.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAc,EAAE;IAChD,OAAO;QACL,OAAO,EAAE,CAAC;QACV,MAAM,EAAE;YACN,IAAI,EAAE,KAAK;SACZ;KACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
type GetPluginsParams = {
|
|
2
|
-
offset?: number;
|
|
3
|
-
limit?: number;
|
|
4
|
-
};
|
|
5
|
-
type Plugin = {
|
|
6
|
-
id: string;
|
|
7
|
-
name: string;
|
|
8
|
-
isMarketplace: boolean;
|
|
9
|
-
version: string;
|
|
10
|
-
};
|
|
11
|
-
type GetPluginsSuccessResponse = {
|
|
12
|
-
plugins: Plugin[];
|
|
13
|
-
};
|
|
14
|
-
type GetPluginResponse = GetPluginsSuccessResponse;
|
|
15
|
-
type AddPluginSuccessResponse = {
|
|
16
|
-
id: string;
|
|
17
|
-
revision: string;
|
|
18
|
-
};
|
|
19
|
-
type AddPluginErrorResponse = {
|
|
20
|
-
code: string;
|
|
21
|
-
id: string;
|
|
22
|
-
message: string;
|
|
23
|
-
};
|
|
24
|
-
type AddPluginResponse = AddPluginSuccessResponse | AddPluginErrorResponse;
|
|
25
|
-
type UpdatePluginSuccessResponse = {
|
|
26
|
-
id: string;
|
|
27
|
-
revision: string;
|
|
28
|
-
};
|
|
29
|
-
type UpdatePluginErrorResponse = {
|
|
30
|
-
code: string;
|
|
31
|
-
id: string;
|
|
32
|
-
message: string;
|
|
33
|
-
errors?: Record<string, {
|
|
34
|
-
messages: string[];
|
|
35
|
-
}>;
|
|
36
|
-
};
|
|
37
|
-
type UpdatePluginResponse = UpdatePluginSuccessResponse | UpdatePluginErrorResponse;
|
|
38
|
-
export declare class KintoneApiClient {
|
|
39
|
-
#private;
|
|
40
|
-
constructor();
|
|
41
|
-
private getEndpointUrl;
|
|
42
|
-
upload(params: {
|
|
43
|
-
blob: Blob;
|
|
44
|
-
fileName: string;
|
|
45
|
-
}): Promise<string>;
|
|
46
|
-
getPlugins(params?: GetPluginsParams): Promise<GetPluginResponse>;
|
|
47
|
-
getAllPlugins(): Promise<Plugin[]>;
|
|
48
|
-
addPlugin(params: {
|
|
49
|
-
fileKey: string;
|
|
50
|
-
}): Promise<AddPluginResponse>;
|
|
51
|
-
updatePlugin(params: {
|
|
52
|
-
id: string;
|
|
53
|
-
fileKey: string;
|
|
54
|
-
}): Promise<UpdatePluginResponse>;
|
|
55
|
-
}
|
|
56
|
-
export {};
|
|
57
|
-
//# sourceMappingURL=kintone-api-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kintone-api-client.d.ts","sourceRoot":"","sources":["../../src/lib/kintone-api-client.ts"],"names":[],"mappings":"AAEA,KAAK,gBAAgB,GAAG;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,KAAK,MAAM,GAAG;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AACF,KAAK,iBAAiB,GAAG,yBAAyB,CAAC;AAEnD,KAAK,wBAAwB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AACF,KAAK,sBAAsB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AACF,KAAK,iBAAiB,GAAG,wBAAwB,GAAG,sBAAsB,CAAC;AAE3E,KAAK,2BAA2B,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AACF,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;CACjD,CAAC;AACF,KAAK,oBAAoB,GAAG,2BAA2B,GAAG,yBAAyB,CAAC;AAEpF,qBAAa,gBAAgB;;;IAoC3B,OAAO,CAAC,cAAc;IAIT,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAiBjE,UAAU,CAAC,MAAM,GAAE,gBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAgBrE,aAAa,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAoBlC,SAAS,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAiBlE,YAAY,CAAC,MAAM,EAAE;QAChC,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAYlC"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { config } from 'dotenv';
|
|
2
|
-
export class KintoneApiClient {
|
|
3
|
-
#baseUrl;
|
|
4
|
-
#authHeader;
|
|
5
|
-
constructor() {
|
|
6
|
-
config();
|
|
7
|
-
const { KINTONE_BASE_URL, KINTONE_USERNAME, KINTONE_PASSWORD, KINTONE_BASIC_AUTH_USERNAME = '', KINTONE_BASIC_AUTH_PASSWORD = '', } = process.env;
|
|
8
|
-
if (!KINTONE_BASE_URL || !KINTONE_USERNAME || !KINTONE_PASSWORD) {
|
|
9
|
-
throw new Error(`.envの設定が不十分です。以下のパラメータは必須です
|
|
10
|
-
KINTONE_BASE_URL
|
|
11
|
-
KINTONE_USERNAME
|
|
12
|
-
KINTONE_PASSWORD`);
|
|
13
|
-
}
|
|
14
|
-
const authHeader = {
|
|
15
|
-
'X-Cybozu-Authorization': Buffer.from(`${KINTONE_USERNAME}:${KINTONE_PASSWORD}`).toString('base64'),
|
|
16
|
-
...(KINTONE_BASIC_AUTH_USERNAME &&
|
|
17
|
-
KINTONE_BASIC_AUTH_PASSWORD && {
|
|
18
|
-
Authorization: `Basic ${Buffer.from(`${KINTONE_BASIC_AUTH_USERNAME}:${KINTONE_BASIC_AUTH_PASSWORD}`).toString('base64')}`,
|
|
19
|
-
}),
|
|
20
|
-
};
|
|
21
|
-
this.#baseUrl = KINTONE_BASE_URL;
|
|
22
|
-
this.#authHeader = authHeader;
|
|
23
|
-
}
|
|
24
|
-
getEndpointUrl(path) {
|
|
25
|
-
return `${this.#baseUrl}${path}`;
|
|
26
|
-
}
|
|
27
|
-
async upload(params) {
|
|
28
|
-
const { blob, fileName } = params;
|
|
29
|
-
const form = new FormData();
|
|
30
|
-
form.append('file', blob, fileName);
|
|
31
|
-
const uploadResult = await fetch(this.getEndpointUrl('/k/v1/file.json'), {
|
|
32
|
-
method: 'POST',
|
|
33
|
-
headers: this.#authHeader,
|
|
34
|
-
body: form,
|
|
35
|
-
});
|
|
36
|
-
const { fileKey } = await uploadResult.json();
|
|
37
|
-
return fileKey;
|
|
38
|
-
}
|
|
39
|
-
async getPlugins(params = {}) {
|
|
40
|
-
const url = new URL(this.getEndpointUrl('/k/v1/plugins.json'));
|
|
41
|
-
if (params.offset) {
|
|
42
|
-
url.searchParams.set('offset', String(params.offset));
|
|
43
|
-
}
|
|
44
|
-
if (params.limit) {
|
|
45
|
-
url.searchParams.set('limit', String(params.limit));
|
|
46
|
-
}
|
|
47
|
-
const pluginResponse = await fetch(url.toString(), {
|
|
48
|
-
headers: this.#authHeader,
|
|
49
|
-
});
|
|
50
|
-
return pluginResponse.json();
|
|
51
|
-
}
|
|
52
|
-
async getAllPlugins() {
|
|
53
|
-
const plugins = [];
|
|
54
|
-
let offset = 0;
|
|
55
|
-
let limit = 100;
|
|
56
|
-
let hasMore = true;
|
|
57
|
-
while (hasMore) {
|
|
58
|
-
const { plugins: currentPlugins } = await this.getPlugins({ offset, limit });
|
|
59
|
-
plugins.push(...currentPlugins);
|
|
60
|
-
if (currentPlugins.length < limit) {
|
|
61
|
-
hasMore = false;
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
offset += limit;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return plugins;
|
|
68
|
-
}
|
|
69
|
-
async addPlugin(params) {
|
|
70
|
-
const { fileKey } = params;
|
|
71
|
-
const pluginResponse = await fetch(this.getEndpointUrl('/k/v1/plugin.json'), {
|
|
72
|
-
method: 'POST',
|
|
73
|
-
headers: {
|
|
74
|
-
'Content-Type': 'application/json',
|
|
75
|
-
...this.#authHeader,
|
|
76
|
-
},
|
|
77
|
-
body: JSON.stringify({
|
|
78
|
-
fileKey,
|
|
79
|
-
}),
|
|
80
|
-
});
|
|
81
|
-
return pluginResponse.json();
|
|
82
|
-
}
|
|
83
|
-
async updatePlugin(params) {
|
|
84
|
-
const pluginResponse = await fetch(this.getEndpointUrl('/k/v1/plugin.json'), {
|
|
85
|
-
method: 'PUT',
|
|
86
|
-
headers: {
|
|
87
|
-
'Content-Type': 'application/json',
|
|
88
|
-
...this.#authHeader,
|
|
89
|
-
},
|
|
90
|
-
body: JSON.stringify(params),
|
|
91
|
-
});
|
|
92
|
-
return pluginResponse.json();
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=kintone-api-client.js.map
|