@rex0220/print-craft-authoring-tools 1.2.0 → 1.3.0
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/README.md +2 -1
- package/SECURITY.md +2 -2
- package/dist/cli.mjs +2 -2
- package/dist/core.mjs +3422 -0
- package/dist/types/_print-craft/src/authoring/api.d.ts +3 -0
- package/dist/types/_print-craft/src/config/load.d.ts +4 -0
- package/dist/types/_print-craft/src/config/schema.d.ts +5 -0
- package/dist/types/commands/buttons.d.ts +19 -0
- package/dist/types/commands/diff.d.ts +6 -0
- package/dist/types/commands/fields.d.ts +54 -0
- package/dist/types/commands/normalize.d.ts +40 -0
- package/dist/types/commands/preview.d.ts +39 -0
- package/dist/types/commands/pull.d.ts +36 -0
- package/dist/types/commands/record.d.ts +63 -0
- package/dist/types/commands/records.d.ts +36 -0
- package/dist/types/commands/save.d.ts +50 -0
- package/dist/types/commands/take.d.ts +19 -0
- package/dist/types/commit-file.d.ts +38 -0
- package/dist/types/context.d.ts +10 -0
- package/dist/types/core.d.ts +32 -0
- package/dist/types/engine.d.ts +64 -0
- package/dist/types/env.d.ts +50 -0
- package/dist/types/kintone-rest.d.ts +65 -0
- package/dist/types/kintone-url.d.ts +11 -0
- package/dist/types/meta.d.ts +30 -0
- package/dist/types/normalize/checks.d.ts +58 -0
- package/dist/types/normalize/css-check.d.ts +53 -0
- package/dist/types/normalize/derive.d.ts +30 -0
- package/dist/types/normalize/findings.d.ts +21 -0
- package/dist/types/normalize/html-check.d.ts +23 -0
- package/dist/types/normalize/line-diff.d.ts +8 -0
- package/dist/types/normalize/model.d.ts +36 -0
- package/dist/types/normalize/policy.d.ts +29 -0
- package/dist/types/normalize/size.d.ts +16 -0
- package/dist/types/paths.d.ts +7 -0
- package/dist/types/permission.d.ts +21 -0
- package/dist/types/plugin-zip.d.ts +53 -0
- package/dist/types/preview/render.d.ts +82 -0
- package/dist/types/safe-path.d.ts +24 -0
- package/dist/types/workspace.d.ts +84 -0
- package/package.json +10 -2
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export declare const WORKSPACE_FILE = "environments.json";
|
|
2
|
+
export declare const KINTONE_ROOT = "kintone";
|
|
3
|
+
export declare const INBOX = "inbox";
|
|
4
|
+
/** 設定画面のダウンロードのファイル名の接頭辞(kit の exportFileName。print-craft の exportPrefix) */
|
|
5
|
+
export declare const SNAPSHOT_PREFIX = "rex0220-print-craft";
|
|
6
|
+
export declare const SNAPSHOT_RE: RegExp;
|
|
7
|
+
export declare const EDIT_RE: RegExp;
|
|
8
|
+
export declare class WorkspaceError extends Error {
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 環境の役割(段階 0-2 の段 3。print-craft-authoring-mcp の実装案 13.3、permission-table.md)。environments.json に書けるのは
|
|
12
|
+
* development / production だけ。書いていない環境は内部だけの状態 unclassified(読み取りと診断だけ。kintone/ の下を変えられない)
|
|
13
|
+
*/
|
|
14
|
+
export type EnvRole = "development" | "production" | "unclassified";
|
|
15
|
+
export declare const ENV_ROLES: readonly ["development", "production"];
|
|
16
|
+
export interface EnvironmentDef {
|
|
17
|
+
name: string;
|
|
18
|
+
/** 役割(書いていなければ unclassified) */
|
|
19
|
+
role: EnvRole;
|
|
20
|
+
/** 正規化した接続先(https://<サブドメイン>.cybozu.com) */
|
|
21
|
+
baseUrl: string;
|
|
22
|
+
/** フォルダー名に使うホスト名 */
|
|
23
|
+
host: string;
|
|
24
|
+
/** 認証のファイル(作業フォルダーからの相対。.env か env/<名前>.env) */
|
|
25
|
+
envFile: string;
|
|
26
|
+
}
|
|
27
|
+
export interface AppDef {
|
|
28
|
+
/** 論理アプリ名(--app に書ける名前) */
|
|
29
|
+
name: string;
|
|
30
|
+
/** 環境の名前 → アプリ番号 */
|
|
31
|
+
ids: Record<string, number>;
|
|
32
|
+
}
|
|
33
|
+
export interface Workspace {
|
|
34
|
+
defaultEnv: string;
|
|
35
|
+
environments: Record<string, EnvironmentDef>;
|
|
36
|
+
apps: AppDef[];
|
|
37
|
+
}
|
|
38
|
+
export declare const isEnvName: (s: string) => boolean;
|
|
39
|
+
/** environments.json を検証して読む(未知のキー、名前の形、接続先、envFile の場所、番号を厳しく見る) */
|
|
40
|
+
export declare function parseWorkspace(text: string, where?: string): Workspace;
|
|
41
|
+
/** 作業フォルダーの environments.json(無ければ null = 今までの形) */
|
|
42
|
+
export declare function loadWorkspace(cwd: string): Workspace | null;
|
|
43
|
+
export declare function pickEnv(ws: Workspace, name?: string): EnvironmentDef;
|
|
44
|
+
/** --app の値(番号か、apps の名前)をその環境のアプリ番号にする */
|
|
45
|
+
export declare function resolveApp(ws: Workspace, env: EnvironmentDef, app: string): {
|
|
46
|
+
appId: number;
|
|
47
|
+
name?: string;
|
|
48
|
+
};
|
|
49
|
+
/** アプリのフォルダーの名前(番号-アプリ名。名前が使えなければ番号だけ) */
|
|
50
|
+
export declare function folderNameOf(appId: number, appName: string): string;
|
|
51
|
+
export declare function hostDirOf(cwd: string, env: EnvironmentDef): string;
|
|
52
|
+
/** 今あるアプリのフォルダー(番号で探す。無ければ null。同じ番号が 2 つあれば止まる) */
|
|
53
|
+
export declare function findAppDir(cwd: string, env: EnvironmentDef, appId: number): string | null;
|
|
54
|
+
/** アプリのフォルダー(あればそれ、無ければ 番号-アプリ名 で作る場所。作るのは書くとき) */
|
|
55
|
+
export declare function appDirFor(cwd: string, env: EnvironmentDef, appId: number, appName: string): string;
|
|
56
|
+
/** ファイルが kintone/<ホスト>/<番号>-…/ の中(records/ などの下を含む)なら、そのフォルダーとホストと番号 */
|
|
57
|
+
export declare function appFolderOfFile(cwd: string, file: string): {
|
|
58
|
+
dir: string;
|
|
59
|
+
host: string;
|
|
60
|
+
appId: number;
|
|
61
|
+
} | null;
|
|
62
|
+
/** ダウンロードと同じ名前(kit の exportFileName と同じ。日時はこの PC の時刻) */
|
|
63
|
+
export declare function snapshotNameOf(appId: number, now?: Date): string;
|
|
64
|
+
export declare function editNameOf(snapshotFile: string): string;
|
|
65
|
+
export interface AppFolderList {
|
|
66
|
+
dir: string;
|
|
67
|
+
hasFields: boolean;
|
|
68
|
+
/** ダウンロードと pull(新しい順) */
|
|
69
|
+
snapshots: string[];
|
|
70
|
+
/** 直したもの(新しい順) */
|
|
71
|
+
edits: string[];
|
|
72
|
+
/** AI が作った帳票など、その他の json */
|
|
73
|
+
reports: string[];
|
|
74
|
+
records: string[];
|
|
75
|
+
outs: number;
|
|
76
|
+
}
|
|
77
|
+
export declare function listAppFolder(dir: string): AppFolderList;
|
|
78
|
+
/** 環境のうち、ホスト名が同じもの(構成 2 では 2 つ以上ある) */
|
|
79
|
+
export declare function envsOfHost(ws: Workspace, host: string): EnvironmentDef[];
|
|
80
|
+
/**
|
|
81
|
+
* アプリのフォルダー(kintone/<ホスト>/<番号>-…/)がどの環境のものか。ホストが 1 つの環境だけならそれ、
|
|
82
|
+
* 同じホストの環境が 2 つ以上(構成 2)なら apps でその番号を持つ環境が 1 つだけのときそれ。決まらなければ undefined
|
|
83
|
+
*/
|
|
84
|
+
export declare function envOfAppFolder(ws: Workspace, host: string, appId: number): EnvironmentDef | undefined;
|
package/package.json
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rex0220/print-craft-authoring-tools",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "rex0220 印刷屋プラグイン(kintone)の設定 JSON を AI で作る・確かめるための tools(fields / record / pull / normalize / preview / diff / buttons / version
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "rex0220 印刷屋プラグイン(kintone)の設定 JSON を AI で作る・確かめるための tools(fields / record / pull / normalize / preview / diff / buttons / version)。共通の中核(@rex0220/print-craft-authoring-tools/core。print-craft MCP が使う)も含む。計算式エンジンと印刷屋のコードは利用者の印刷屋プラグインの zip から読む",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
8
|
"pcraft-authoring": "dist/cli.mjs"
|
|
9
9
|
},
|
|
10
|
+
"exports": {
|
|
11
|
+
"./core": {
|
|
12
|
+
"types": "./dist/types/core.d.ts",
|
|
13
|
+
"import": "./dist/core.mjs",
|
|
14
|
+
"default": "./dist/core.mjs"
|
|
15
|
+
},
|
|
16
|
+
"./package.json": "./package.json"
|
|
17
|
+
},
|
|
10
18
|
"files": [
|
|
11
19
|
"dist/**",
|
|
12
20
|
"vendor/**",
|