@tunasand/sdk 0.8.0 → 0.11.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/CHANGELOG.md +121 -0
- package/README.md +162 -143
- package/dist/analytics.js +76 -65
- package/dist/app.js +184 -163
- package/dist/apps-DIxAWBSZ.js +318 -0
- package/dist/astro-image.d.ts +1 -0
- package/dist/astro-image.js +33 -0
- package/dist/astro-server-Bwau8F6d.js +99 -0
- package/dist/astro-server.d.ts +1 -0
- package/dist/astro-server.js +1 -0
- package/dist/astro.d.ts +1 -0
- package/dist/astro.js +306 -0
- package/dist/bridge-Dv4NxGZ7.js +81 -0
- package/dist/bridge.js +1 -13
- package/dist/build-file-DNi0PHC5.js +31 -0
- package/dist/cli.js +6212 -8
- package/dist/{client-Derrexwr.js → client-C8STAw9T.js} +43 -24
- package/dist/code-N8pBUDbq.js +30 -0
- package/dist/code.d.ts +1 -0
- package/dist/code.js +1 -0
- package/dist/collection-nUz1RetA.js +264 -0
- package/dist/{declared-DuNMsdXw.js → declared-CE4a61qb.js} +35 -35
- package/dist/delivery.js +121 -114
- package/dist/dev-operations-Tutwi1On.js +46 -0
- package/dist/dev.js +9 -16
- package/dist/embeds-B-Dbn64k.js +29 -0
- package/dist/end-users.d.ts +1 -0
- package/dist/end-users.js +185 -0
- package/dist/endUsers-DODfjnv1.js +77 -0
- package/dist/{errorLabels-BgtQ_zUn.js → errorLabels-aT2bnMsO.js} +355 -235
- package/dist/i18n.js +4 -4
- package/dist/ids-DmtIoqBX.js +109 -0
- package/dist/integrations.js +95 -24
- package/dist/{ja-Du6ooL6i.js → ja-CrY_72Tn.js} +88 -44
- package/dist/{ja-CeHU0EaY.js → ja-axQPxMJ-.js} +3 -3
- package/dist/operations-CIB99rIY.js +95 -0
- package/dist/operations.d.ts +1 -0
- package/dist/operations.js +1 -0
- package/dist/{page-Bzrj24sJ.js → page-yo1cw1kW.js} +1 -1
- package/dist/preview.js +8 -1
- package/dist/{profile-1em_lcxq.js → profile-DBsXLvvI.js} +48 -48
- package/dist/rich-text.js +16 -16
- package/dist/{schema-WnobuwLg.js → schema-Dcg1ajnW.js} +496 -263
- package/dist/schema.js +66 -88
- package/dist/types/access/src/handoff.d.ts +19 -14
- package/dist/types/access/src/index.d.ts +2 -2
- package/dist/types/access/src/jws.d.ts +41 -0
- package/dist/types/access/src/oidc.d.ts +10 -2
- package/dist/types/access/src/signed.d.ts +0 -2
- package/dist/types/adapter-cloudflare/src/eventLog/viewSchema.d.ts +11 -0
- package/dist/types/contract/src/accountProfile.d.ts +7 -0
- package/dist/types/contract/src/apiKeys.d.ts +6 -2
- package/dist/types/contract/src/app.d.ts +15 -5
- package/dist/types/contract/src/appChannels.d.ts +114 -0
- package/dist/types/contract/src/appDefinition.d.ts +11 -5
- package/dist/types/contract/src/appDependencies.d.ts +87 -24
- package/dist/types/contract/src/appIdentities.d.ts +21 -0
- package/dist/types/contract/src/appInbound.d.ts +28 -0
- package/dist/types/contract/src/appMail.d.ts +106 -0
- package/dist/types/contract/src/appSecrets.d.ts +45 -0
- package/dist/types/contract/src/appServer.d.ts +408 -43
- package/dist/types/contract/src/approvals.d.ts +1 -1
- package/dist/types/contract/src/apps.d.ts +112 -55
- package/dist/types/contract/src/auditActions.d.ts +2 -2
- package/dist/types/contract/src/auditLabels.d.ts +111 -15
- package/dist/types/contract/src/authorize.d.ts +42 -14
- package/dist/types/contract/src/bridge.d.ts +34 -35
- package/dist/types/contract/src/consents.d.ts +32 -25
- package/dist/types/contract/src/deletion.d.ts +18 -0
- package/dist/types/contract/src/embeds.d.ts +16 -82
- package/dist/types/contract/src/{customerLabels.d.ts → endUserLabels.d.ts} +6 -9
- package/dist/types/contract/src/endUsers.d.ts +241 -0
- package/dist/types/contract/src/errorLabels.d.ts +63 -36
- package/dist/types/contract/src/errorLabelsEn.d.ts +46 -32
- package/dist/types/contract/src/errors.d.ts +28 -16
- package/dist/types/contract/src/eventSchemas.d.ts +70 -0
- package/dist/types/contract/src/eventTraces.d.ts +43 -0
- package/dist/types/contract/src/failureStatus.d.ts +14 -22
- package/dist/types/contract/src/fieldAccess.d.ts +8 -8
- package/dist/types/contract/src/formLabels.d.ts +3 -0
- package/dist/types/contract/src/forms.d.ts +4 -0
- package/dist/types/contract/src/grants.d.ts +26 -0
- package/dist/types/contract/src/headers.d.ts +5 -0
- package/dist/types/contract/src/hostingRpc.d.ts +23 -17
- package/dist/types/contract/src/identifiers.d.ts +45 -17
- package/dist/types/contract/src/ids.d.ts +18 -10
- package/dist/types/contract/src/import.d.ts +17 -16
- package/dist/types/contract/src/index.d.ts +52 -27
- package/dist/types/contract/src/integrationGraph.d.ts +83 -0
- package/dist/types/contract/src/issueLabels.d.ts +113 -81
- package/dist/types/contract/src/issueLabelsEn.d.ts +57 -41
- package/dist/types/contract/src/manage.d.ts +11 -7
- package/dist/types/contract/src/manageLabels.d.ts +2 -0
- package/dist/types/contract/src/manifestText.d.ts +66 -0
- package/dist/types/contract/src/messagePort.d.ts +208 -0
- package/dist/types/contract/src/migration.d.ts +2 -2
- package/dist/types/contract/src/notices.d.ts +38 -0
- package/dist/types/contract/src/operatorOperations.d.ts +0 -63
- package/dist/types/contract/src/outbound.d.ts +29 -0
- package/dist/types/contract/src/paths.d.ts +13 -0
- package/dist/types/contract/src/pending.d.ts +2 -0
- package/dist/types/contract/src/permissions.d.ts +7 -11
- package/dist/types/contract/src/perspective.d.ts +26 -0
- package/dist/types/contract/src/powers.d.ts +5 -0
- package/dist/types/contract/src/principal.d.ts +127 -56
- package/dist/types/contract/src/recordLabels.d.ts +6 -0
- package/dist/types/contract/src/roles.d.ts +7 -4
- package/dist/types/contract/src/ruleLabels.d.ts +16 -0
- package/dist/types/contract/src/ruleProblems.d.ts +16 -0
- package/dist/types/contract/src/schemaLabels.d.ts +8 -0
- package/dist/types/contract/src/settingProblems.d.ts +1 -1
- package/dist/types/contract/src/settings.d.ts +5 -7
- package/dist/types/contract/src/siteDeclaration.d.ts +7 -7
- package/dist/types/contract/src/siteIndex.d.ts +76 -0
- package/dist/types/contract/src/transfer.d.ts +1 -1
- package/dist/types/contract/src/trial.d.ts +4 -1
- package/dist/types/contract/src/versions.d.ts +1 -3
- package/dist/types/contract/src/viewEvent.d.ts +0 -9
- package/dist/types/contract/src/webhooks.d.ts +24 -3
- package/dist/types/contract/src/workflow.d.ts +13 -19
- package/dist/types/contract/src/workspaceItems.d.ts +20 -6
- package/dist/types/rich-text/src/html.d.ts +1 -1
- package/dist/types/rich-text/src/index.d.ts +8 -7
- package/dist/types/rich-text/src/labels/en.d.ts +1 -1
- package/dist/types/rich-text/src/labels/ja.d.ts +2 -2
- package/dist/types/rich-text/src/library.d.ts +1 -1
- package/dist/types/rich-text/src/media.d.ts +2 -0
- package/dist/types/rich-text/src/normalize.d.ts +1 -1
- package/dist/types/rich-text/src/problems.d.ts +5 -5
- package/dist/types/rich-text/src/profile.d.ts +10 -10
- package/dist/types/rich-text/src/render.d.ts +1 -1
- package/dist/types/rich-text/src/schema.d.ts +2 -2
- package/dist/types/rich-text/src/standard.d.ts +4 -4
- package/dist/types/rich-text/src/types.d.ts +2 -2
- package/dist/types/schema/src/audience.d.ts +1 -3
- package/dist/types/schema/src/capabilities.d.ts +18 -27
- package/dist/types/schema/src/changes.d.ts +3 -1
- package/dist/types/schema/src/collection.d.ts +138 -111
- package/dist/types/schema/src/defaultSchema.d.ts +8 -2
- package/dist/types/schema/src/fieldIds.d.ts +18 -0
- package/dist/types/schema/src/file.d.ts +22 -11
- package/dist/types/schema/src/fileRefs.d.ts +14 -0
- package/dist/types/schema/src/fileSignature.d.ts +20 -0
- package/dist/types/schema/src/filesCollection.d.ts +7 -0
- package/dist/types/schema/src/forms.d.ts +43 -0
- package/dist/types/schema/src/imageMetadata.d.ts +9 -0
- package/dist/types/schema/src/index.d.ts +18 -10
- package/dist/types/schema/src/input.d.ts +1 -1
- package/dist/types/schema/src/integrity.d.ts +8 -7
- package/dist/types/schema/src/kinds.d.ts +26 -0
- package/dist/types/schema/src/labels/en.d.ts +87 -46
- package/dist/types/schema/src/labels/ja.d.ts +89 -45
- package/dist/types/schema/src/mediaUrl.d.ts +26 -33
- package/dist/types/schema/src/page.d.ts +4 -4
- package/dist/types/schema/src/problems.d.ts +82 -41
- package/dist/types/schema/src/refs.d.ts +0 -9
- package/dist/types/schema/src/schema.d.ts +17 -12
- package/dist/types/schema/src/selfOps.d.ts +20 -19
- package/dist/types/schema/src/traits.d.ts +28 -0
- package/dist/types/schema/src/typesSource.d.ts +1 -1
- package/dist/types/schema/src/values.d.ts +5 -2
- package/dist/types/schema/src/widening.d.ts +3 -0
- package/dist/types/sdk/src/analytics.d.ts +2 -1
- package/dist/types/sdk/src/app.d.ts +40 -14
- package/dist/types/sdk/src/astro-image.d.ts +19 -0
- package/dist/types/sdk/src/astro-response.d.ts +6 -0
- package/dist/types/sdk/src/astro-server.d.ts +16 -0
- package/dist/types/sdk/src/astro.d.ts +19 -0
- package/dist/types/sdk/src/bridge.d.ts +2 -4
- package/dist/types/sdk/src/code.d.ts +61 -0
- package/dist/types/sdk/src/delegation.d.ts +13 -3
- package/dist/types/sdk/src/delivery/changes.d.ts +4 -4
- package/dist/types/sdk/src/delivery/client.d.ts +33 -22
- package/dist/types/sdk/src/delivery/fields.d.ts +3 -3
- package/dist/types/sdk/src/delivery/index.d.ts +3 -3
- package/dist/types/sdk/src/delivery/media.d.ts +5 -8
- package/dist/types/sdk/src/delivery/query.d.ts +15 -11
- package/dist/types/sdk/src/delivery/schema.d.ts +1 -1
- package/dist/types/sdk/src/delivery/values.d.ts +10 -14
- package/dist/types/sdk/src/delivery.d.ts +2 -2
- package/dist/types/sdk/src/dev-operations.d.ts +20 -0
- package/dist/types/sdk/src/dev.d.ts +6 -5
- package/dist/types/sdk/src/end-users.d.ts +190 -0
- package/dist/types/sdk/src/i18n.d.ts +2 -2
- package/dist/types/sdk/src/integrations.d.ts +14 -21
- package/dist/types/sdk/src/operations.d.ts +17 -0
- package/dist/types/sdk/src/preview.d.ts +2 -1
- package/dist/types/sdk/src/rich-text.d.ts +2 -2
- package/dist/types/sdk/src/schema.d.ts +1 -1
- package/dist/types/sdk/src/site/artifact.d.ts +64 -0
- package/dist/types/sdk/src/site/build-file.d.ts +30 -0
- package/dist/types/sdk/src/site/check-code.d.ts +14 -0
- package/dist/types/sdk/src/site/check-text.d.ts +19 -0
- package/dist/types/sdk/src/site/cli.d.ts +52 -0
- package/dist/types/sdk/src/site/content-type.d.ts +2 -0
- package/dist/types/sdk/src/site/labels.d.ts +14 -0
- package/dist/types/sdk/src/types.d.ts +1 -1
- package/dist/{types-B77qvqPJ.js → types-DkO2N7u2.js} +5 -6
- package/dist/types.js +1 -1
- package/dist/{typesSource-CWybQYus.js → typesSource-VJIxtN9b.js} +17 -15
- package/dist/workflow-CUpl6hO_.js +148 -0
- package/package.json +32 -6
- package/dist/apps-BxnJ1RlU.js +0 -435
- package/dist/bridge-DtHw9hS6.js +0 -74
- package/dist/collection-BEOxeISR.js +0 -189
- package/dist/customers-DTbL0qn6.js +0 -86
- package/dist/customers.d.ts +0 -1
- package/dist/customers.js +0 -185
- package/dist/embeds-B5V54Zur.js +0 -34
- package/dist/ids--RF7hGyC.js +0 -36
- package/dist/src-sazhzYui.js +0 -71
- package/dist/types/contract/src/customers.d.ts +0 -266
- package/dist/types/schema/src/legacy.d.ts +0 -2
- package/dist/types/schema/src/media.d.ts +0 -5
- package/dist/types/sdk/src/customers.d.ts +0 -184
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/** 索引の形のバージョン */
|
|
2
|
+
export declare const SITE_INDEX_VERSION = 1;
|
|
3
|
+
/** 中立の実行環境の版(固有の互換の設定は、アダプターが版から決める) */
|
|
4
|
+
export declare const SITE_RUNTIMES: readonly ["web-1"];
|
|
5
|
+
export type SiteRuntime = (typeof SITE_RUNTIMES)[number];
|
|
6
|
+
export declare const SITE_MODULE_TYPES: readonly ["js", "wasm", "text", "data"];
|
|
7
|
+
/** 失敗の応答に使う静的ファイルを置ける状態コード */
|
|
8
|
+
export declare const SITE_ERROR_STATUSES: readonly ["404", "500"];
|
|
9
|
+
export type SiteErrorStatus = (typeof SITE_ERROR_STATUSES)[number];
|
|
10
|
+
/** 上限(大きさはバイト。modules と codeBytes は、カーネルの束の上限と同じ値) */
|
|
11
|
+
export declare const SITE_INDEX_MAX: {
|
|
12
|
+
readonly indexBytes: number;
|
|
13
|
+
readonly modules: 1000;
|
|
14
|
+
readonly codeBytes: number;
|
|
15
|
+
readonly files: 20000;
|
|
16
|
+
readonly fileBytes: number;
|
|
17
|
+
readonly filesBytes: number;
|
|
18
|
+
readonly pathLength: 1024;
|
|
19
|
+
readonly contentTypeLength: 128;
|
|
20
|
+
};
|
|
21
|
+
/** コードの1つのファイル */
|
|
22
|
+
export type SiteModule = Readonly<{
|
|
23
|
+
path: string;
|
|
24
|
+
type: (typeof SITE_MODULE_TYPES)[number];
|
|
25
|
+
sha256: string;
|
|
26
|
+
bytes: number;
|
|
27
|
+
}>;
|
|
28
|
+
/** 静的ファイル(path は返す URL のパスそのもの。immutable は内容が変わらないもの) */
|
|
29
|
+
export type SiteFile = Readonly<{
|
|
30
|
+
path: string;
|
|
31
|
+
sha256: string;
|
|
32
|
+
bytes: number;
|
|
33
|
+
content_type: string;
|
|
34
|
+
immutable: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
export type SiteIndex = Readonly<{
|
|
37
|
+
version: typeof SITE_INDEX_VERSION;
|
|
38
|
+
runtime: SiteRuntime;
|
|
39
|
+
entry: string;
|
|
40
|
+
modules: readonly SiteModule[];
|
|
41
|
+
files: readonly SiteFile[];
|
|
42
|
+
errors: Readonly<Partial<Record<SiteErrorStatus, string>>>;
|
|
43
|
+
manifest_version: number;
|
|
44
|
+
}>;
|
|
45
|
+
/** 索引の誤り(at は索引の中の場所) */
|
|
46
|
+
export type SiteIndexProblem = 'index_too_large' | 'not_json' | 'not_canonical' | 'invalid_shape' | 'unknown_version' | 'unknown_runtime' | 'invalid_path' | 'duplicate_path' | 'invalid_sha256' | 'invalid_bytes' | 'conflicting_content' | 'invalid_type' | 'too_many_modules' | 'code_too_large' | 'too_many_files' | 'file_too_large' | 'files_too_large' | 'missing_entry' | 'missing_error_file' | 'invalid_manifest_version';
|
|
47
|
+
export type SiteIndexResult = Readonly<{
|
|
48
|
+
ok: true;
|
|
49
|
+
index: SiteIndex;
|
|
50
|
+
} | {
|
|
51
|
+
ok: false;
|
|
52
|
+
problem: SiteIndexProblem;
|
|
53
|
+
at: string;
|
|
54
|
+
}>;
|
|
55
|
+
/** コードのパスか */
|
|
56
|
+
export declare const isSiteModulePath: (path: string) => boolean;
|
|
57
|
+
/** 復号した静的ファイルのパスを、索引に書く形にする(正しくなければ null) */
|
|
58
|
+
export declare function siteFilePathOf(decoded: string): string | null;
|
|
59
|
+
/** 要求の URL のパスを、索引と比べる形にする(復号した文字で比べる。対応するものがなければ null) */
|
|
60
|
+
export declare function siteRequestPathOf(pathname: string): string | null;
|
|
61
|
+
/** キーと、パスを持つものの順によらない、索引の正規形 */
|
|
62
|
+
export declare function siteIndexJson({ version, runtime, entry, modules, files, errors, manifest_version }: SiteIndex): string;
|
|
63
|
+
/** バイトの SHA-256(16進) */
|
|
64
|
+
export declare function sha256Hex(bytes: Uint8Array): Promise<string>;
|
|
65
|
+
/** 成果物のハッシュ(索引の正規形の SHA-256) */
|
|
66
|
+
export declare const siteDigestOf: (index: SiteIndex) => Promise<string>;
|
|
67
|
+
/** 索引の値を確かめる(パスの順に並べて返す) */
|
|
68
|
+
export declare const checkSiteIndex: (value: unknown) => SiteIndexResult;
|
|
69
|
+
/** 受けた索引のバイトを確かめる(正規形のバイトと1つでも違えば拒む) */
|
|
70
|
+
export declare const parseSiteIndex: (bytes: Uint8Array) => SiteIndexResult;
|
|
71
|
+
/** 束の中のコードの範囲(索引の順に隙間なくつなぐ) */
|
|
72
|
+
export type SiteCodeRange = SiteModule & Readonly<{
|
|
73
|
+
start: number;
|
|
74
|
+
}>;
|
|
75
|
+
/** 索引から、束の中の範囲を作る */
|
|
76
|
+
export declare function siteCodeRanges({ modules }: Pick<SiteIndex, 'modules'>): readonly SiteCodeRange[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Permissions } from './permissions.js';
|
|
2
2
|
import type { ViewDefinition } from './views.js';
|
|
3
3
|
/** スキーマと設定の形式の名前 */
|
|
4
|
-
export declare const CONFIG_FORMAT = "
|
|
4
|
+
export declare const CONFIG_FORMAT = "tunasand-config";
|
|
5
5
|
/** スキーマと設定(schema は CollectionSchema・screens は画面設定 ScreenSettings の形、roles は管理者以外、views はチームのビュー) */
|
|
6
6
|
export type ConfigBundle = Readonly<{
|
|
7
7
|
format: typeof CONFIG_FORMAT;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* 検証用のフラグのプロジェクトの CMS のホスト名の印(先頭のラベルの末尾)
|
|
3
|
+
* Tunasand が振るホスト名は `--` を含み、導入先が選ぶ名前とぶつからない(docs/specs/identifiers.md の「URL とホスト名」)
|
|
4
|
+
*/
|
|
2
5
|
export declare const TRIAL_HOST_SUFFIX = "--trial";
|
|
3
6
|
/** 検証用のフラグのプロジェクトの送信が届くホスト名の印(先頭のラベルが `<プロジェクトの ID>--trialsite`。CMS のホスト名と分ける) */
|
|
4
7
|
export declare const TRIAL_SITE_SUFFIX = "--trialsite";
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** 公開の API の版(パス /v1) */
|
|
2
2
|
export declare const DELIVERY_VERSION = 1;
|
|
3
|
-
/** 配信 API の応答で契約の版を示すヘッダー */
|
|
4
|
-
export declare const CONTRACT_VERSION_HEADER = "x-cms-version";
|
|
5
3
|
/** プロジェクトのデータの書き出しの形(JSON の行とファイルの中身のバンドル、書き出しの目録の format と version。実装は L の後) */
|
|
6
4
|
export declare const EXPORT_FORMAT: {
|
|
7
5
|
readonly name: "tunasand-export";
|
|
@@ -14,15 +14,6 @@ export type ViewEvent = Readonly<{
|
|
|
14
14
|
}>;
|
|
15
15
|
/** 位置で持つ記録先の列の順 */
|
|
16
16
|
export declare const VIEW_COLUMNS: readonly ["kind", "id", "path", "date", "event", "project"];
|
|
17
|
-
/**
|
|
18
|
-
* 閲覧のイベントの形(toolkit の analyticsEngineRecorder・analyticsEngineCounts に渡す)
|
|
19
|
-
* - index: プロジェクト、指定なしは種類(Analytics Engine は index ごとに標本を抽出するため、共有のデータセットで小さなプロジェクトの記録が間引かれないように)
|
|
20
|
-
*/
|
|
21
|
-
export declare const VIEW_SCHEMA: Readonly<{
|
|
22
|
-
blobs: readonly ("id" | "kind" | "date" | "path" | "project" | "event")[];
|
|
23
|
-
doubles?: readonly never[] | undefined;
|
|
24
|
-
index?: ((event: Readonly<Partial<Record<"id" | "kind" | "date" | "path" | "project" | "event", string>> & Partial<Record<never, number>>>) => string) | undefined;
|
|
25
|
-
}>;
|
|
26
17
|
/** イベントにする設定(project はプロジェクトの識別子) */
|
|
27
18
|
export type ViewOptions = Readonly<{
|
|
28
19
|
classify: Classify;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { ActorKind } from './identifiers.js';
|
|
2
|
+
/** 送れる操作(公開・非公開と、データの変更の作成・更新・削除) */
|
|
3
|
+
export declare const WEBHOOK_ACTIONS: readonly ["published", "unpublished", "created", "updated", "deleted"];
|
|
3
4
|
/** データの変更の操作(配信 API の変更の一覧と同じ記録から送る) */
|
|
4
5
|
export declare const WEBHOOK_CHANGE_ACTIONS: readonly ["created", "updated", "deleted"];
|
|
5
6
|
/** データの変更の操作 */
|
|
@@ -28,6 +29,26 @@ export type InstallationDeletedData = Readonly<{
|
|
|
28
29
|
export declare const isWebhookAction: (value: string) => value is WebhookAction;
|
|
29
30
|
/** コレクションと操作のイベントのキー */
|
|
30
31
|
export declare const webhookEventOf: (collection: string, action: WebhookAction) => WebhookEvent;
|
|
32
|
+
/** アプリのイベントのキー(namespace は登録簿のアプリの名前空間、name はマニフェストの emits の名前) */
|
|
33
|
+
export declare const appEventOf: (namespace: string, name: string) => WebhookEvent;
|
|
34
|
+
/** アプリのイベントのキーの形か(宣言の有無は見ない) */
|
|
35
|
+
export declare const isAppEventName: (event: string) => boolean;
|
|
36
|
+
/**
|
|
37
|
+
* アプリのイベントの data(対象の ID と主体の種類だけで、レコードの値と、主体の ID とメールアドレスを持たない)
|
|
38
|
+
* - environment: 環境の ID、collection・record: 対象の ID、actor: 起こした主体の種類(アカウント、インストールなど)
|
|
39
|
+
*/
|
|
40
|
+
export type AppEventData = Readonly<{
|
|
41
|
+
environment: string;
|
|
42
|
+
collection: Readonly<{
|
|
43
|
+
id: string;
|
|
44
|
+
}>;
|
|
45
|
+
record: Readonly<{
|
|
46
|
+
id: string;
|
|
47
|
+
}>;
|
|
48
|
+
actor: Readonly<{
|
|
49
|
+
kind: ActorKind;
|
|
50
|
+
}>;
|
|
51
|
+
}>;
|
|
31
52
|
/** イベントのキーの型と操作(編集のイベントでなければ null) */
|
|
32
53
|
export declare function parseWebhookEvent(event: string): Readonly<{
|
|
33
54
|
collection: string;
|
|
@@ -97,7 +118,7 @@ export type WebhookRecordData = Readonly<{
|
|
|
97
118
|
}>;
|
|
98
119
|
/** レコードのイベントの本文(timestamp はイベントの日時、データの変更は変更の一覧の記録の日時) */
|
|
99
120
|
export type WebhookBody = WebhookMessage<WebhookRecordType, WebhookRecordData>;
|
|
100
|
-
/**
|
|
121
|
+
/** 名前つきのイベントの本文(エンドユーザー・取り込み・インストール・アプリのイベント。type は宣言の名前、例 endUser.status_changed) */
|
|
101
122
|
export type WebhookAppBody = WebhookMessage<WebhookEvent>;
|
|
102
123
|
/** 送信の記録(event はイベントのキー、attempt は何回目の送信か、retryAt は次の再送の予定の日時、再送なしは null) */
|
|
103
124
|
export type WebhookDelivery = Readonly<{
|
|
@@ -1,31 +1,26 @@
|
|
|
1
1
|
import type { ErrorCode, ErrorParams } from './errors.js';
|
|
2
2
|
import { type ContentAccess } from './permissions.js';
|
|
3
|
-
import type {
|
|
4
|
-
/** コレクションの公開の管理(schema の Publishing と同じ値) */
|
|
5
|
-
export type WorkflowPublishing = 'none' | 'draft' | 'review';
|
|
3
|
+
import type { Subject } from './principal.js';
|
|
6
4
|
/** レコードの派生の状態 */
|
|
7
|
-
export declare const RECORD_STATES: readonly ["draft", "
|
|
5
|
+
export declare const RECORD_STATES: readonly ["draft", "scheduled", "published"];
|
|
8
6
|
export type RecordState = (typeof RECORD_STATES)[number];
|
|
9
|
-
/** 公開中・予約のレコードの未公開の変更(none
|
|
10
|
-
export type RecordChanges = 'none' | 'draft'
|
|
11
|
-
/** レコードの操作(publish は公開・予約・再公開・変更の公開、unpublish
|
|
12
|
-
export declare const RECORD_ACTIONS: readonly ["save", "
|
|
7
|
+
/** 公開中・予約のレコードの未公開の変更(none はなし) */
|
|
8
|
+
export type RecordChanges = 'none' | 'draft';
|
|
9
|
+
/** レコードの操作(publish は公開・予約・再公開・変更の公開、unpublish は予約の取り消しか下書きに戻す、discard は未公開の変更の破棄) */
|
|
10
|
+
export declare const RECORD_ACTIONS: readonly ["save", "publish", "unpublish", "discard", "delete"];
|
|
13
11
|
export type RecordAction = (typeof RECORD_ACTIONS)[number];
|
|
14
|
-
/** 判定に使うレコードの値(API の形: has_draft
|
|
12
|
+
/** 判定に使うレコードの値(API の形: has_draft は未公開の変更、持ち主の項目と created_by を含む) */
|
|
15
13
|
export type RecordRow = ContentAccess & Readonly<{
|
|
16
|
-
|
|
17
|
-
review_note?: unknown;
|
|
14
|
+
scheduled_at?: unknown;
|
|
18
15
|
has_draft?: unknown;
|
|
19
|
-
draft_status?: unknown;
|
|
20
16
|
}>;
|
|
21
|
-
|
|
22
|
-
/** 判定の材料(target はコレクションの id、now は ISO の日時) */
|
|
17
|
+
/** 判定の材料(publication は公開の管理があるコレクションか、target はコレクションの id、acceptsDrafts は公開が承認の人の、公開中のレコードの編集中の版を受け付けるか) */
|
|
23
18
|
export type RecordGuardInput = Readonly<{
|
|
24
|
-
|
|
19
|
+
publication: boolean;
|
|
20
|
+
acceptsDrafts: boolean;
|
|
25
21
|
user: Subject;
|
|
26
22
|
target: string;
|
|
27
23
|
row: RecordRow;
|
|
28
|
-
now: string;
|
|
29
24
|
}>;
|
|
30
25
|
/** 判定の結果(拒否はエラーのコードと引数) */
|
|
31
26
|
export type RecordGuard = {
|
|
@@ -36,14 +31,13 @@ export type RecordGuard = {
|
|
|
36
31
|
params?: ErrorParams;
|
|
37
32
|
};
|
|
38
33
|
/** レコードの派生の状態と未公開の変更 */
|
|
39
|
-
export declare function recordStateOf(row: RecordRow
|
|
34
|
+
export declare function recordStateOf(row: RecordRow): {
|
|
40
35
|
state: RecordState;
|
|
41
36
|
changes: RecordChanges;
|
|
42
37
|
};
|
|
43
38
|
/** 公開中か予約の状態か */
|
|
44
39
|
export declare const isLiveState: (state: RecordState) => boolean;
|
|
45
40
|
/** レコードの操作の可否 */
|
|
46
|
-
export declare function recordGuard({
|
|
41
|
+
export declare function recordGuard({ publication, acceptsDrafts, user, target, row }: RecordGuardInput, action: RecordAction): RecordGuard;
|
|
47
42
|
/** レコードに許される操作(RECORD_ACTIONS の順) */
|
|
48
43
|
export declare const recordActions: (input: RecordGuardInput) => RecordAction[];
|
|
49
|
-
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { AppBase } from './appDefinition.js';
|
|
2
|
-
import type { AppSettingDef } from './appDependencies.js';
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import type { AppCollection, AppSettingDef } from './appDependencies.js';
|
|
3
|
+
import type { AppInboundUrl } from './appInbound.js';
|
|
4
|
+
import type { AppSecretDeclaration } from './appSecrets.js';
|
|
5
|
+
import type { CollectionMappings, ConnectionPoint, InstallationRelations, PermissionTarget } from './apps.js';
|
|
6
|
+
/** 標準の機能の1つの状態(API /api/standard-apps の行、標準の機能の並びの順) */
|
|
7
|
+
export type StandardAppState = InstallationRelations & Readonly<{
|
|
6
8
|
id: string;
|
|
7
9
|
label: string;
|
|
8
10
|
description: string;
|
|
@@ -10,17 +12,29 @@ export type StandardAppState = Readonly<{
|
|
|
10
12
|
required: boolean;
|
|
11
13
|
/** この環境に入れたか(入れていなければ追加の候補) */
|
|
12
14
|
installed: boolean;
|
|
15
|
+
/** インストールの ID(入れていなければ null。秘密値の API の経路に使う) */
|
|
16
|
+
installationId: string | null;
|
|
13
17
|
enabled: boolean;
|
|
14
18
|
permissions: readonly PermissionTarget[];
|
|
19
|
+
/** 追加のときと入れた後に当て先を選ぶコレクション(マニフェストの collections) */
|
|
20
|
+
collections: readonly AppCollection[];
|
|
21
|
+
/** 当てたコレクション(入れていないか、当てていなければ空。プロジェクトと環境の作成で入れたアプリは当てずに入る) */
|
|
22
|
+
mapped: CollectionMappings;
|
|
15
23
|
/** 必要な外部の接続と、接続済みか */
|
|
16
24
|
connections: readonly (ConnectionPoint & Readonly<{
|
|
17
25
|
connected: boolean;
|
|
18
26
|
}>)[];
|
|
19
27
|
settingFields: readonly AppSettingDef[];
|
|
28
|
+
/** マニフェストの秘密値の宣言(入力は設定のページの共通のフォーム) */
|
|
29
|
+
secrets: readonly AppSecretDeclaration[];
|
|
30
|
+
/** マニフェストの inbound の宣言ごとの受信の URL(入れていなければ空。外のサービスの管理画面に貼る) */
|
|
31
|
+
inbound: readonly AppInboundUrl[];
|
|
20
32
|
/** 設定のページで編集する項目の現在値(キーは settingFields の key) */
|
|
21
33
|
settings: Readonly<Record<string, unknown>>;
|
|
22
34
|
/** 設定値の入力(画面で保存した値、ワークスペース・MCP が manifest.settings で解釈) */
|
|
23
35
|
settingsInput: Readonly<Record<string, unknown>>;
|
|
36
|
+
/** マニフェストの画面のうち、呼んだ主体に見えるものの key(判定はサーバー) */
|
|
37
|
+
uiVisible: readonly string[];
|
|
24
38
|
/** サーバーの側が追加するもの(定期の処理・記事の規則は表示名) */
|
|
25
39
|
adds: Readonly<{
|
|
26
40
|
jobs: readonly string[];
|
|
@@ -28,13 +42,13 @@ export type StandardAppState = Readonly<{
|
|
|
28
42
|
delivery: boolean;
|
|
29
43
|
}>;
|
|
30
44
|
}>;
|
|
31
|
-
/** 標準の機能の切り替えと設定の保存(PUT /api/apps
|
|
45
|
+
/** 標準の機能の切り替えと設定の保存(PUT /api/standard-apps/:id の本文) */
|
|
32
46
|
export type StandardAppUpdate = Readonly<{
|
|
33
47
|
enabled?: boolean;
|
|
34
48
|
settings?: Readonly<Record<string, unknown>>;
|
|
35
49
|
}>;
|
|
36
50
|
/**
|
|
37
|
-
* カレンダーの予定(API /api/calendar の行、at は ISO 8601、path はワークスペースの経路)
|
|
51
|
+
* カレンダーの予定(API /api/apps/content/calendar の行、at は ISO 8601、path はワークスペースの経路)
|
|
38
52
|
* - source: 記事の公開は core、設定で掲載する日付のフィールドは calendarFieldSource
|
|
39
53
|
*/
|
|
40
54
|
export type CalendarItem = Readonly<{
|
|
@@ -27,4 +27,4 @@ export type HtmlResult<M> = Readonly<{
|
|
|
27
27
|
dropped: readonly Dropped[];
|
|
28
28
|
}>;
|
|
29
29
|
/** HTML を本文に(コピーできないものは dropped) */
|
|
30
|
-
export declare function
|
|
30
|
+
export declare function richTextFromHtml<M>(html: string, options: HtmlOptions<M>): HtmlResult<M>;
|
|
@@ -4,16 +4,17 @@ export { DESCRIPTION_MAX, descriptionOf } from './description.js';
|
|
|
4
4
|
export { citesOf, excerptOf, linksOf, plainOf, READING_SPEED, readMinOf } from './derive.js';
|
|
5
5
|
export { CORE_COMPONENTS, coreComponentOf, type Chart, type ChartColor, type ChartDatum, type ComponentName, type ComponentProps, type CoreComponent } from './library.js';
|
|
6
6
|
export { isSafeHref } from './href.js';
|
|
7
|
-
export {
|
|
7
|
+
export { richTextFromHtml, type Dropped, type HtmlOptions, type HtmlResult } from './html.js';
|
|
8
8
|
export { EMBED_FRAME_ORIGINS, EMBED_PROVIDERS, embedOfUrl, embedSrcOf, type EmbedProvider, type EmbedTarget } from './embed.js';
|
|
9
9
|
export { fromMarkdown, toMarkdown, type MarkdownOptions } from './markdown.js';
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
10
|
+
export { checkRichText, describeMarkdown, isSafeCssValue, type RichTextProfile, type NamedStyle, type NamedValue } from './profile.js';
|
|
11
|
+
export { richTextToHtml, type RenderedImage, type RenderOptions } from './render.js';
|
|
12
12
|
export { blockSchemaOf } from './schema.js';
|
|
13
|
+
export { mapBodyMedia } from './media.js';
|
|
13
14
|
export { sortMarks } from './inline.js';
|
|
14
15
|
export { normalizeRich } from './normalize.js';
|
|
15
|
-
export {
|
|
16
|
+
export { richTextFromMarkdown, richTextToMarkdown, markdownGuide, type MarkdownResult, type MediaSyntax } from './standard.js';
|
|
16
17
|
export { ALIGNS, cellParagraphs, IMAGE_ALIGNS, isTableCell, STYLE_KINDS, type StyleKind, type Align, type Block, type Body, type Cell, type ComponentBlock, type HeadingLevel, type ImageAlign, type Inline, type InlineComponent, type Link, type List, type ListItem, type Mark, type Named, type Rich, type StandardBlock, type TableCell, type Text, type TextStyle } from './types.js';
|
|
17
|
-
export {
|
|
18
|
-
export { type
|
|
19
|
-
export {
|
|
18
|
+
export { RICH_TEXT_PROBLEM_MESSAGES } from './labels/ja.js';
|
|
19
|
+
export { type RichTextProblemCode, richTextProblemText } from './problems.js';
|
|
20
|
+
export { RICH_TEXT_PROBLEM_MESSAGES_EN } from './labels/en.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** 本文の検査の問題の英語の文 */
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const RICH_TEXT_PROBLEM_MESSAGES_EN: {
|
|
3
3
|
readonly inline_component_here: "Inline components cannot be used here";
|
|
4
4
|
readonly inline_component_unavailable: "Inline component {name} cannot be used";
|
|
5
5
|
readonly marks_here: "Marks and links cannot be used here";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** 本文の検査の問題の文 */
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const RICH_TEXT_PROBLEM_MESSAGES: {
|
|
3
3
|
readonly drop_attribute: "属性 {name}";
|
|
4
4
|
readonly drop_style: "style の {key}";
|
|
5
5
|
readonly drop_style_value: "style の {key} の値";
|
|
@@ -116,7 +116,7 @@ export declare const BODY_GUIDE_LABELS: {
|
|
|
116
116
|
readonly markSyntax: "{mark, select, strong {**太字**} em {*斜体*} code {`コード`} strike {~~取り消し線~~} mark {:mark[蛍光ペン]} sup {:sup[上付き]} sub {:sub[下付き]} other {:u[下線]}}";
|
|
117
117
|
readonly styleValue: "{key}=\"CSS の値\"";
|
|
118
118
|
readonly styleNames: "styles=\"{names}\" のどれか(空白で区切る)";
|
|
119
|
-
readonly
|
|
119
|
+
readonly text_style: "- 文字の見た目: :span[文字]'{'属性'}'(属性: {attrs})";
|
|
120
120
|
readonly link: "- リンク: [文字](https://…){rels, select, none {} other {、rel つきは :link[文字]'{'href=\"https://…\" rel={rels}'}'}}{target, select, yes {、別のタブは :link[文字]'{'href=\"https://…\" target=_blank'}'} other {}}{combine, select, no {(装飾つきは不可)} other {}}";
|
|
121
121
|
readonly component: "- {inline, select, yes {インラインの} other {}}コンポーネント {name}: {description}";
|
|
122
122
|
readonly componentExample: " 例: {example}";
|
|
@@ -2,4 +2,4 @@ import { type Body, type Rich } from './types.js';
|
|
|
2
2
|
/** インラインの断片の列を正規化 */
|
|
3
3
|
export declare function normalizeRich(rich: Rich): Rich;
|
|
4
4
|
/** 本文を正規化 */
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function normalizeRichText<M>(body: Body<M>): Body<M>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ParamsArg } from '../../i18n/src/index.js';
|
|
2
|
-
import { BODY_GUIDE_LABELS,
|
|
3
|
-
type Messages = typeof
|
|
4
|
-
export type
|
|
2
|
+
import { BODY_GUIDE_LABELS, RICH_TEXT_PROBLEM_MESSAGES, CORE_COMPONENT_LABELS } from './labels/ja.js';
|
|
3
|
+
type Messages = typeof RICH_TEXT_PROBLEM_MESSAGES;
|
|
4
|
+
export type RichTextProblemCode = keyof Messages;
|
|
5
5
|
/** 本文の検査の問題を作る */
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const richTextProblem: import("../../i18n/src/index.js").ProblemFactory<{
|
|
7
7
|
readonly drop_attribute: "属性 {name}";
|
|
8
8
|
readonly drop_style: "style の {key}";
|
|
9
9
|
readonly drop_style_value: "style の {key} の値";
|
|
@@ -93,7 +93,7 @@ export declare const bodyProblem: import("../../i18n/src/index.js").ProblemFacto
|
|
|
93
93
|
readonly block_problem: "{index}番目のブロック: {problem}";
|
|
94
94
|
}>;
|
|
95
95
|
/** 問題の英語の既定の文(zod の message と検査の issues に入れ、problemOf で戻す) */
|
|
96
|
-
export declare const
|
|
96
|
+
export declare const richTextProblemText: <K extends RichTextProblemCode>(code: K, ...params: ParamsArg<Messages[K]>) => string;
|
|
97
97
|
type Guide = typeof BODY_GUIDE_LABELS;
|
|
98
98
|
/** Markdown の説明の文言 */
|
|
99
99
|
export declare const guideText: <K extends keyof Guide>(key: K, ...params: ParamsArg<Guide[K]>) => string;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { ComponentDef } from './components.js';
|
|
2
2
|
import { type Body, type HeadingLevel, type Mark } from './types.js';
|
|
3
3
|
/** 本文の設定 */
|
|
4
|
-
export type
|
|
4
|
+
export type RichTextProfile = Readonly<{
|
|
5
5
|
headings: readonly HeadingLevel[];
|
|
6
6
|
marks: readonly Mark[];
|
|
7
7
|
/** 装飾の重ね掛けと装飾つきのリンク(既定は可) */
|
|
8
|
-
|
|
8
|
+
combine_marks?: boolean;
|
|
9
9
|
/** リンクの rel(なしは rel なしのリンクだけ) */
|
|
10
|
-
|
|
10
|
+
link_rels?: readonly string[];
|
|
11
11
|
/** 装飾・リンク・インラインのコンポーネントを使用できない場所 */
|
|
12
|
-
plain?: readonly ('heading' | '
|
|
12
|
+
plain?: readonly ('heading' | 'table_head')[];
|
|
13
13
|
/** リンクを別のタブで開く指定(既定は不可) */
|
|
14
|
-
|
|
14
|
+
link_targets?: true;
|
|
15
15
|
/** 文字の見た目(色・背景・大きさは名前の宣言、項目がないものは使用不可、styles は名前のついた装飾の宣言) */
|
|
16
|
-
|
|
16
|
+
text_style?: Readonly<{
|
|
17
17
|
color?: readonly NamedValue[];
|
|
18
18
|
background?: readonly NamedValue[];
|
|
19
19
|
size?: readonly NamedValue[];
|
|
@@ -34,7 +34,7 @@ export type BodyProfile = Readonly<{
|
|
|
34
34
|
code?: Readonly<{
|
|
35
35
|
caption: boolean;
|
|
36
36
|
filename?: boolean;
|
|
37
|
-
|
|
37
|
+
component_langs?: Readonly<Record<string, string>>;
|
|
38
38
|
}>;
|
|
39
39
|
/** 画像(link は画像のリンク、align は横の位置) */
|
|
40
40
|
image?: Readonly<{
|
|
@@ -67,14 +67,14 @@ export type NamedStyle = Readonly<{
|
|
|
67
67
|
label: string;
|
|
68
68
|
}>;
|
|
69
69
|
/** 本文の設定に合わない箇所(index は本文のブロックの位置、0から) */
|
|
70
|
-
type
|
|
70
|
+
type RichTextProblem = Readonly<{
|
|
71
71
|
index: number;
|
|
72
72
|
message: string;
|
|
73
73
|
}>;
|
|
74
74
|
/** 元の CSS の値として描画してよいか(kind は色か大きさ) */
|
|
75
75
|
export declare const isSafeCssValue: (kind: "color" | "background" | "size", value: string) => boolean;
|
|
76
76
|
/** 本文を設定で検査(合わない箇所をすべて返却) */
|
|
77
|
-
export declare function
|
|
77
|
+
export declare function checkRichText<M>(body: Body<M>, profile: RichTextProfile): RichTextProblem[];
|
|
78
78
|
/** 書き手と AI への Markdown の説明(使用できるものを記法の例つきで列挙し、使用できないものは末尾、mediaExample は画像の参照の例) */
|
|
79
|
-
export declare function describeMarkdown<M>(profile:
|
|
79
|
+
export declare function describeMarkdown<M>(profile: RichTextProfile, components?: readonly ComponentDef<M>[], mediaExample?: string): string;
|
|
80
80
|
export {};
|
|
@@ -26,4 +26,4 @@ export type RenderOptions<M> = Readonly<{
|
|
|
26
26
|
allowHtml?: boolean;
|
|
27
27
|
}>;
|
|
28
28
|
/** 本文を HTML に */
|
|
29
|
-
export declare function
|
|
29
|
+
export declare function richTextToHtml<M>(body: Body<M>, options: RenderOptions<M>): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { type DeclaredComponent } from './declared.js';
|
|
3
|
-
import { type
|
|
3
|
+
import { type RichTextProfile } from './profile.js';
|
|
4
4
|
import { type Block } from './types.js';
|
|
5
5
|
/** 本文の1ブロックの検査(profile は本文の設定、media は画像の参照の検査、declared は導入先が宣言した部品) */
|
|
6
|
-
export declare function blockSchemaOf<M>(profile:
|
|
6
|
+
export declare function blockSchemaOf<M>(profile: RichTextProfile, media: z.ZodType<M>, declared?: readonly DeclaredComponent[]): z.ZodType<Block<M>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DeclaredComponent } from './declared.js';
|
|
2
2
|
import { type MarkdownOptions } from './markdown.js';
|
|
3
|
-
import { type
|
|
3
|
+
import { type RichTextProfile } from './profile.js';
|
|
4
4
|
import type { Body } from './types.js';
|
|
5
5
|
/** 画像の参照と Markdown の文字列の変換(example は説明の例の参照) */
|
|
6
6
|
export type MediaSyntax<M> = MarkdownOptions<M>['media'] & Readonly<{
|
|
@@ -13,8 +13,8 @@ export type MarkdownResult<M> = Readonly<{
|
|
|
13
13
|
problems: readonly string[];
|
|
14
14
|
}>;
|
|
15
15
|
/** 本文を Markdown に(declared は導入先が宣言した部品) */
|
|
16
|
-
export declare const
|
|
16
|
+
export declare const richTextToMarkdown: <M>(body: Body<M>, media: MediaSyntax<M>, declared?: readonly DeclaredComponent[]) => string;
|
|
17
17
|
/** Markdown を本文に(解析できない・設定に合わない内容は problems、declared は導入先が宣言した部品) */
|
|
18
|
-
export declare function
|
|
18
|
+
export declare function richTextFromMarkdown<M>(markdown: string, profile: RichTextProfile, media: MediaSyntax<M>, declared?: readonly DeclaredComponent[]): MarkdownResult<M>;
|
|
19
19
|
/** 書き手と AI へ最初に提示する Markdown の説明(設定と核のコンポーネント・宣言した部品から作成) */
|
|
20
|
-
export declare const markdownGuide: (profile:
|
|
20
|
+
export declare const markdownGuide: (profile: RichTextProfile, media: Pick<MediaSyntax<unknown>, "example">, declared?: readonly DeclaredComponent[]) => string;
|
|
@@ -102,7 +102,7 @@ export type StandardBlock<M> = Readonly<{
|
|
|
102
102
|
variant?: string;
|
|
103
103
|
}> | Readonly<{
|
|
104
104
|
type: 'image';
|
|
105
|
-
|
|
105
|
+
file: M;
|
|
106
106
|
alt?: string;
|
|
107
107
|
caption?: string;
|
|
108
108
|
link?: Link;
|
|
@@ -116,7 +116,7 @@ export type StandardBlock<M> = Readonly<{
|
|
|
116
116
|
variant?: string;
|
|
117
117
|
}> | Readonly<{
|
|
118
118
|
type: 'file';
|
|
119
|
-
|
|
119
|
+
file: M;
|
|
120
120
|
label?: string;
|
|
121
121
|
}> | Readonly<{
|
|
122
122
|
type: 'divider';
|
|
@@ -6,10 +6,8 @@ export type AudienceHistoryEntry = Readonly<{
|
|
|
6
6
|
fieldType: string;
|
|
7
7
|
audience: Audience;
|
|
8
8
|
}>;
|
|
9
|
-
/** 旧い形の入力か(どの項目にも audience がない、まとまりの中も) */
|
|
10
|
-
export declare function isLegacyInput(json: unknown): boolean;
|
|
11
9
|
/**
|
|
12
|
-
*
|
|
10
|
+
* 読み替えた定義(最上位の項目は見える範囲を必ず持つ)
|
|
13
11
|
* - 実行の側(配信、判定、管理の API)と保存の検査が使う。保存の形と GET の応答は読み込んだ値のまま
|
|
14
12
|
*/
|
|
15
13
|
export declare const resolvedSchema: (schema: CollectionSchema) => ResolvedSchema;
|
|
@@ -1,28 +1,19 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}> & Readonly<{
|
|
12
|
-
to: string;
|
|
1
|
+
import { type Collection, type CollectionSchema } from './collection.js';
|
|
2
|
+
export declare const COLLECTION_CAPABILITIES: readonly ["transactions", "history", "events", "publication", "trash"];
|
|
3
|
+
export type CollectionCapability = (typeof COLLECTION_CAPABILITIES)[number];
|
|
4
|
+
/** コレクションが持つ能力 */
|
|
5
|
+
export declare const capabilitiesOf: (collection: Collection) => CollectionCapability[];
|
|
6
|
+
export declare const hasCapability: (collection: Collection, capability: CollectionCapability) => boolean;
|
|
7
|
+
/** 宣言が頼る能力(宣言はコレクションの key) */
|
|
8
|
+
export type CapabilityNeed = Readonly<{
|
|
9
|
+
capability: CollectionCapability;
|
|
10
|
+
declaration: keyof Collection;
|
|
13
11
|
}>;
|
|
14
|
-
/**
|
|
15
|
-
export declare const
|
|
16
|
-
/**
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}[];
|
|
23
|
-
/** コレクションの出典の項目(なければ null) */
|
|
24
|
-
export declare function sourcesFieldOf(collection: Pick<Collection, 'fields'>): SourcesField | null;
|
|
25
|
-
/** 出典のコレクション(出典の項目の参照先でスキーマの順で先頭、なければ null) */
|
|
26
|
-
export declare function sourceCollectionOf(schema: CollectionSchema): Collection | null;
|
|
27
|
-
/** 出典の値にある参照の ID(注の順、空と形の誤りは除外) */
|
|
28
|
-
export declare const sourceIdsOf: (value: unknown) => string[];
|
|
12
|
+
/** コレクションの宣言が頼る能力(公開の前の検査 publish_checks は公開) */
|
|
13
|
+
export declare const requiredCapabilities: (collection: Collection) => CapabilityNeed[];
|
|
14
|
+
/** 能力のないコレクションに頼る宣言(スキーマの順) */
|
|
15
|
+
export type MissingCapability = CapabilityNeed & Readonly<{
|
|
16
|
+
collection: Collection;
|
|
17
|
+
}>;
|
|
18
|
+
/** 宣言が頼るのにコレクションが持たない能力(なければ空) */
|
|
19
|
+
export declare const missingCapabilities: (schema: CollectionSchema) => MissingCapability[];
|
|
@@ -4,9 +4,10 @@ import { type CollectionSchema } from './collection.js';
|
|
|
4
4
|
/** 変更の扱い */
|
|
5
5
|
export type ChangeLevel = 'safe' | 'confirm' | 'forbidden';
|
|
6
6
|
/** 変更の種類 */
|
|
7
|
-
export type ChangeKind = 'collection-added' | 'collection-removed' | 'collection-slug-changed' | 'collection-changed' | '
|
|
7
|
+
export type ChangeKind = 'collection-added' | 'collection-removed' | 'collection-slug-changed' | 'collection-changed' | 'end-user-ops-added' | 'form-opened' | 'retention-shortened' | 'format-changed' | 'kind-changed' | 'publication-added' | 'publication-removed' | 'fixed-changed' | 'field-added' | 'field-removed' | 'field-changed' | 'field-key-changed' | 'field-managed-changed' | 'field-type-changed' | 'field-key-reused' | 'audience-widened' | 'pii-narrowed' | 'confidential-key-reused' | 'required-added' | 'constraint-tightened' | 'option-added' | 'option-removed' | 'component-added' | 'component-changed' | 'component-removed';
|
|
8
8
|
/**
|
|
9
9
|
* スキーマの1つの変更(id は確認と置き換え先の指定で使用する識別子、path は項目の key を `.` で連結、value は削除した選択肢の値・コレクションの旧いスラッグ)
|
|
10
|
+
* - readded: 過去の版にある id のコレクションの追加
|
|
10
11
|
* - code・params: 文言の表 labels/ja.ts のキーと差し込み(画面はこれで引く)、message は英語の文
|
|
11
12
|
*/
|
|
12
13
|
export type SchemaChange = Readonly<{
|
|
@@ -20,6 +21,7 @@ export type SchemaChange = Readonly<{
|
|
|
20
21
|
params?: Problem['params'];
|
|
21
22
|
message: string;
|
|
22
23
|
widening?: AudienceWidening;
|
|
24
|
+
readded?: true;
|
|
23
25
|
}>;
|
|
24
26
|
/**
|
|
25
27
|
* 差分の条件
|