@tunasand/sdk 0.6.0 → 0.8.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 +116 -84
- package/README.md +209 -195
- package/dist/analytics.js +638 -2
- package/dist/app.js +230 -24
- package/dist/apps-BxnJ1RlU.js +435 -0
- package/dist/{bridge-DYAYGV7t.js → bridge-DtHw9hS6.js} +3 -3
- package/dist/bridge.js +2 -2
- package/dist/cli.js +5 -4
- package/dist/{model-pmXzGX12.js → collection-BEOxeISR.js} +49 -12
- package/dist/{customers-C_vJY2_v.js → customers-DTbL0qn6.js} +5 -3
- package/dist/customers.js +2 -2
- package/dist/{declared-C_GvPiGF.js → declared-DuNMsdXw.js} +93 -5
- package/dist/delivery.js +39 -8
- package/dist/embeds-B5V54Zur.js +34 -0
- package/dist/{errorLabels-BcyRbv_i.js → errorLabels-BgtQ_zUn.js} +277 -264
- package/dist/i18n.js +4 -4
- package/dist/ids--RF7hGyC.js +36 -0
- package/dist/integrations.js +4 -29
- package/dist/{ja-C1HEWWTQ.js → ja-CeHU0EaY.js} +3 -3
- package/dist/{ja-C6lX0CeJ.js → ja-Du6ooL6i.js} +12 -11
- package/dist/{page-E_cYgZx-.js → page-Bzrj24sJ.js} +4 -4
- package/dist/{profile-D6t1QMQh.js → profile-1em_lcxq.js} +5 -5
- package/dist/rich-text.d.ts +1 -0
- package/dist/{body.js → rich-text.js} +6 -7
- package/dist/{schema-UQJWRyfJ.js → schema-WnobuwLg.js} +136 -97
- package/dist/schema.js +346 -1
- package/dist/types/access/src/handoff.d.ts +3 -3
- package/dist/types/access/src/jwt.d.ts +1 -1
- package/dist/types/access/src/oidc.d.ts +1 -1
- package/dist/types/{cms-contract → contract}/src/apiKeys.d.ts +1 -1
- package/dist/types/{cms-contract → contract}/src/app.d.ts +8 -15
- package/dist/types/contract/src/appDefinition.d.ts +127 -0
- package/dist/types/{cms-contract → contract}/src/appDependencies.d.ts +6 -13
- package/dist/types/contract/src/appServer.d.ts +136 -0
- package/dist/types/contract/src/approvalLabels.d.ts +26 -0
- package/dist/types/contract/src/approvals.d.ts +63 -0
- package/dist/types/{cms-contract → contract}/src/apps.d.ts +72 -29
- package/dist/types/contract/src/auditActions.d.ts +18 -0
- package/dist/types/contract/src/auditLabels.d.ts +127 -0
- package/dist/types/{cms-contract → contract}/src/authorize.d.ts +22 -63
- package/dist/types/{cms-contract → contract}/src/bridge.d.ts +6 -6
- package/dist/types/{cms-contract → contract}/src/customers.d.ts +6 -6
- package/dist/types/{cms-contract → contract}/src/embeds.d.ts +13 -7
- package/dist/types/{cms-contract → contract}/src/errorLabels.d.ts +18 -16
- package/dist/types/{cms-contract → contract}/src/errorLabelsEn.d.ts +9 -7
- package/dist/types/{cms-contract → contract}/src/errors.d.ts +11 -11
- package/dist/types/{cms-contract → contract}/src/failureStatus.d.ts +4 -3
- package/dist/types/contract/src/fieldAccess.d.ts +45 -0
- package/dist/types/contract/src/fieldRules.d.ts +41 -0
- package/dist/types/{cms-contract/src/assets.d.ts → contract/src/files.d.ts} +5 -5
- package/dist/types/{cms-contract → contract}/src/functions.d.ts +3 -3
- package/dist/types/contract/src/hostingRpc.d.ts +143 -0
- package/dist/types/contract/src/hostnames.d.ts +30 -0
- package/dist/types/{cms-contract → contract}/src/identifiers.d.ts +31 -28
- package/dist/types/contract/src/ids.d.ts +104 -0
- package/dist/types/{cms-contract → contract}/src/import.d.ts +3 -3
- package/dist/types/contract/src/importLabels.d.ts +3 -0
- package/dist/types/contract/src/index.d.ts +67 -0
- package/dist/types/{cms-contract → contract}/src/issueLabels.d.ts +27 -23
- package/dist/types/{cms-contract → contract}/src/issueLabelsEn.d.ts +15 -13
- package/dist/types/contract/src/labels.d.ts +11 -0
- package/dist/types/contract/src/legacyAuditLabels.d.ts +10 -0
- package/dist/types/contract/src/livePeriods.d.ts +18 -0
- package/dist/types/contract/src/manage.d.ts +47 -0
- package/dist/types/contract/src/manageLabels.d.ts +9 -0
- package/dist/types/contract/src/mcpAuth.d.ts +139 -0
- package/dist/types/contract/src/mcpLabels.d.ts +5 -0
- package/dist/types/{cms-contract → contract}/src/migration.d.ts +1 -1
- package/dist/types/contract/src/operatorOperations.d.ts +703 -0
- package/dist/types/contract/src/operators.d.ts +33 -0
- package/dist/types/{cms-contract → contract}/src/paths.d.ts +6 -8
- package/dist/types/contract/src/pending.d.ts +4 -0
- package/dist/types/{cms-contract → contract}/src/permissions.d.ts +2 -0
- package/dist/types/contract/src/principal.d.ts +110 -0
- package/dist/types/{cms-contract → contract}/src/problems.d.ts +4 -4
- package/dist/types/contract/src/projectRole.d.ts +6 -0
- package/dist/types/{cms-contract → contract}/src/roles.d.ts +4 -3
- package/dist/types/{cms-contract → contract}/src/settingProblems.d.ts +2 -2
- package/dist/types/{cms-contract → contract}/src/settings.d.ts +2 -2
- package/dist/types/contract/src/settingsLabels.d.ts +3 -0
- package/dist/types/contract/src/slugs.d.ts +6 -0
- package/dist/types/{cms-contract → contract}/src/transfer.d.ts +3 -3
- package/dist/types/contract/src/trial.d.ts +10 -0
- package/dist/types/contract/src/versions.d.ts +9 -0
- package/dist/types/{cms-contract → contract}/src/webhooks.d.ts +33 -58
- package/dist/types/contract/src/workflow.d.ts +49 -0
- package/dist/types/contract/src/workspaceItems.d.ts +73 -0
- package/dist/types/contract/src/workspacePaths.d.ts +4 -0
- package/dist/types/{body → rich-text}/src/declared.d.ts +2 -2
- package/dist/types/{body → rich-text}/src/embed.d.ts +1 -1
- package/dist/types/{body → rich-text}/src/labels/ja.d.ts +2 -2
- package/dist/types/{body → rich-text}/src/profile.d.ts +1 -1
- package/dist/types/{model → schema}/src/audience.d.ts +11 -11
- package/dist/types/schema/src/brand.d.ts +5 -0
- package/dist/types/{model → schema}/src/capabilities.d.ts +5 -5
- package/dist/types/{model → schema}/src/changes.d.ts +6 -6
- package/dist/types/{model → schema}/src/check.d.ts +2 -2
- package/dist/types/{model/src/model.d.ts → schema/src/collection.d.ts} +25 -23
- package/dist/types/{platform/src/defaultModel.d.ts → schema/src/defaultSchema.d.ts} +4 -3
- package/dist/types/{model/src/asset.d.ts → schema/src/file.d.ts} +16 -16
- package/dist/types/{model → schema}/src/image.d.ts +3 -3
- package/dist/types/{model → schema}/src/index.d.ts +11 -10
- package/dist/types/{model → schema}/src/input.d.ts +3 -3
- package/dist/types/{model → schema}/src/integrity.d.ts +1 -1
- package/dist/types/{model → schema}/src/labels/en.d.ts +8 -7
- package/dist/types/{model → schema}/src/labels/ja.d.ts +9 -8
- package/dist/types/schema/src/legacy.d.ts +2 -0
- package/dist/types/{model → schema}/src/media.d.ts +1 -1
- package/dist/types/{model → schema}/src/mediaUrl.d.ts +5 -5
- package/dist/types/{model → schema}/src/page.d.ts +2 -2
- package/dist/types/{model → schema}/src/problems.d.ts +14 -13
- package/dist/types/{model → schema}/src/refs.d.ts +1 -1
- package/dist/types/{model → schema}/src/rules.d.ts +2 -2
- package/dist/types/{model → schema}/src/schema.d.ts +10 -10
- package/dist/types/{model → schema}/src/selfOps.d.ts +1 -1
- package/dist/types/schema/src/typesSource.d.ts +16 -0
- package/dist/types/{model → schema}/src/values.d.ts +2 -2
- package/dist/types/sdk/src/analytics.d.ts +2 -2
- package/dist/types/sdk/src/app.d.ts +44 -16
- package/dist/types/sdk/src/bridge.d.ts +12 -12
- package/dist/types/sdk/src/customers.d.ts +14 -20
- package/dist/types/sdk/src/delegation.d.ts +39 -0
- package/dist/types/sdk/src/delivery/client.d.ts +11 -10
- package/dist/types/sdk/src/delivery/fields.d.ts +2 -2
- package/dist/types/sdk/src/delivery/index.d.ts +2 -2
- package/dist/types/sdk/src/delivery/media.d.ts +17 -3
- package/dist/types/sdk/src/delivery/query.d.ts +1 -1
- package/dist/types/sdk/src/delivery/schema.d.ts +4 -4
- package/dist/types/sdk/src/delivery/values.d.ts +6 -6
- package/dist/types/sdk/src/delivery.d.ts +3 -3
- package/dist/types/sdk/src/i18n.d.ts +11 -11
- package/dist/types/sdk/src/integrations.d.ts +10 -10
- package/dist/types/sdk/src/{body.d.ts → rich-text.d.ts} +2 -2
- package/dist/types/sdk/src/schema.d.ts +5 -21
- package/dist/types/sdk/src/site.d.ts +1 -1
- package/dist/types/sdk/src/types.d.ts +21 -0
- package/dist/{schema-BPHL7Qr-.js → types-B77qvqPJ.js} +5 -4
- package/dist/types.d.ts +1 -0
- package/dist/types.js +1 -0
- package/dist/{typesSource-bO0jFw1I.js → typesSource-CWybQYus.js} +58 -12
- package/package.json +12 -12
- package/dist/apps-9u4XMi7E.js +0 -114
- package/dist/body.d.ts +0 -1
- package/dist/embed-R-OvDYAw.js +0 -90
- package/dist/model.d.ts +0 -1
- package/dist/model.js +0 -345
- package/dist/types/analytics/src/index.d.ts +0 -5
- package/dist/types/analytics/src/schedule.d.ts +0 -2
- package/dist/types/analytics/src/shared.d.ts +0 -21
- package/dist/types/analytics/src/source.d.ts +0 -19
- package/dist/types/analytics/src/store.d.ts +0 -24
- package/dist/types/model/src/brand.d.ts +0 -25
- package/dist/types/model/src/legacy.d.ts +0 -2
- package/dist/types/model/src/typesSource.d.ts +0 -8
- package/dist/types/sdk/src/model.d.ts +0 -5
- /package/dist/types/{cms-contract → contract}/src/appProblems.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/consents.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/customerLabels.d.ts +0 -0
- /package/dist/types/{analytics → contract}/src/day.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/functionLabels.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/permissionLabels.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/siteArtifact.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/siteDeclaration.d.ts +0 -0
- /package/dist/types/{analytics/src/view.d.ts → contract/src/viewEvent.d.ts} +0 -0
- /package/dist/types/{cms-contract → contract}/src/views.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/webhookLabels.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/components.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/derive.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/description.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/href.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/html.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/index.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/inline.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/labels/en.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/library.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/markdown.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/normalize.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/problems.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/render.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/schema.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/standard.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/types.d.ts +0 -0
- /package/dist/types/{model → schema}/src/contact.d.ts +0 -0
- /package/dist/types/{model → schema}/src/json.d.ts +0 -0
- /package/dist/types/{model → schema}/src/screens.d.ts +0 -0
- /package/dist/types/{model → schema}/src/time.d.ts +0 -0
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { type ComponentDef } from './components.js';
|
|
3
3
|
/** 引数の型 */
|
|
4
4
|
export type PropType = 'string' | 'number' | 'integer' | 'boolean' | 'array' | 'object';
|
|
5
|
-
/** 1つの引数の形(title
|
|
5
|
+
/** 1つの引数の形(title はワークスペースの項目名、enum は文字列の選択肢、items は配列の要素、properties・required はオブジェクトの中) */
|
|
6
6
|
export type PropSchema = Readonly<{
|
|
7
7
|
type: PropType;
|
|
8
8
|
title?: string;
|
|
@@ -18,7 +18,7 @@ export type PropsSchema = Readonly<{
|
|
|
18
18
|
properties: Readonly<Record<string, PropSchema>>;
|
|
19
19
|
required?: readonly string[];
|
|
20
20
|
}>;
|
|
21
|
-
/** 導入先が宣言する部品(label
|
|
21
|
+
/** 導入先が宣言する部品(label はワークスペースの表示名、inline の省略はブロック) */
|
|
22
22
|
export type DeclaredComponent = Readonly<{
|
|
23
23
|
name: string;
|
|
24
24
|
label: string;
|
|
@@ -10,7 +10,7 @@ export type EmbedTarget = Readonly<{
|
|
|
10
10
|
}>;
|
|
11
11
|
/** URL から埋め込み(埋め込めるサービスでなければ null) */
|
|
12
12
|
export declare function embedOfUrl(raw: string): EmbedTarget | null;
|
|
13
|
-
/** 描画の iframe のオリジン(embedSrcOf が組み立てる URL
|
|
13
|
+
/** 描画の iframe のオリジン(embedSrcOf が組み立てる URL のオリジン、ワークスペースの CSP の frame-src) */
|
|
14
14
|
export declare const EMBED_FRAME_ORIGINS: readonly ["https://www.youtube-nocookie.com", "https://player.vimeo.com", "https://platform.twitter.com", "https://www.instagram.com", "https://open.spotify.com", "https://embed.podcasts.apple.com"];
|
|
15
15
|
/** 描画の iframe の URL(サービスと ID から組み立てる、X と Instagram は埋め込みのページ) */
|
|
16
16
|
export declare function embedSrcOf(target: EmbedTarget): `https://${string}`;
|
|
@@ -127,7 +127,7 @@ export declare const BODY_GUIDE_LABELS: {
|
|
|
127
127
|
readonly separator: "・";
|
|
128
128
|
readonly listSeparator: "、";
|
|
129
129
|
};
|
|
130
|
-
/** 核の部品の説明と例(library.ts、書き手と AI
|
|
130
|
+
/** 核の部品の説明と例(library.ts、書き手と AI への説明とワークスペースの部品の一覧) */
|
|
131
131
|
export declare const CORE_COMPONENT_LABELS: {
|
|
132
132
|
readonly citeDescription: "注(参考資料の ID を参照、参考資料はコンテンツに結び付けが必要)";
|
|
133
133
|
readonly citeExample: ":cite'{'#出典の ID'}'";
|
|
@@ -140,7 +140,7 @@ export declare const CORE_COMPONENT_LABELS: {
|
|
|
140
140
|
readonly diagramDescription: "図(中は Mermaid、alt は図の内容の説明、caption は必須)";
|
|
141
141
|
readonly diagramExample: ":::diagram'{'alt=\"内容の説明\" caption=\"説明\"'}'\n```mermaid\nflowchart LR\n A --> B\n```\n:::";
|
|
142
142
|
readonly galleryDescription: "複数の画像を2列で配置(画像は2枚以上)";
|
|
143
|
-
readonly galleryExample: ":::gallery\n\n\n\n:::";
|
|
144
144
|
readonly linkCardDescription: "リンクのカード(外のページは https と題名、site・desc・画像は任意。中のコンテンツは ref=\"コレクションの id/レコードの ID\")";
|
|
145
145
|
readonly linkCardExample: ":::link-card'{'href=\"https://…\" title=\"ページの題\" site=\"サイト名\" desc=\"説明\"'}'\n:::";
|
|
146
146
|
readonly embedDescription: "外のサービスの埋め込み(provider は {providers}、id はサービスの中の ID、url は元の URL、start は開始の秒)";
|
|
@@ -55,7 +55,7 @@ export type BodyProfile = Readonly<{
|
|
|
55
55
|
/** 使用できるコンポーネントの名前(ブロック・インライン) */
|
|
56
56
|
components: readonly string[];
|
|
57
57
|
}>;
|
|
58
|
-
/** 名前のついた値の宣言(label
|
|
58
|
+
/** 名前のついた値の宣言(label はワークスペースの表示名、value はサイトが対応を持たないときの既定の CSS の値) */
|
|
59
59
|
export type NamedValue = Readonly<{
|
|
60
60
|
name: string;
|
|
61
61
|
label: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type Audience, type
|
|
2
|
-
/**
|
|
3
|
-
export type
|
|
1
|
+
import { type Audience, type CollectionSchema, type ResolvedSchema } from './collection.js';
|
|
2
|
+
/** レジストリの1件(コレクションの id × 項目の path、path はまとまりの中を `.` で連結、audience は記録の時点の見える範囲、fieldType は記録の時点の種類) */
|
|
3
|
+
export type AudienceHistoryEntry = Readonly<{
|
|
4
4
|
collection: string;
|
|
5
5
|
path: string;
|
|
6
6
|
fieldType: string;
|
|
@@ -12,17 +12,17 @@ export declare function isLegacyInput(json: unknown): boolean;
|
|
|
12
12
|
* 読み替えた定義(最上位の項目は見える範囲を必ず持つ、旧い印を外す)
|
|
13
13
|
* - 実行の側(配信、判定、管理の API)と保存の検査が使う。保存の形と GET の応答は読み込んだ値のまま
|
|
14
14
|
*/
|
|
15
|
-
export declare const
|
|
15
|
+
export declare const resolvedSchema: (schema: CollectionSchema) => ResolvedSchema;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* 保存でレジストリに足す記録(公開でない項目のうち、レジストリにない・レジストリより狭い・機密で種類が替わった項目)
|
|
18
18
|
* - 広げた記録は保存の側が変更の一覧の audience-widened から足す
|
|
19
19
|
*/
|
|
20
|
-
export declare function
|
|
21
|
-
/** 広げた項目(from は保存済みの見える範囲か、作り直した key
|
|
22
|
-
export type AudienceWidening =
|
|
20
|
+
export declare function audienceAdditions(schema: CollectionSchema, registry: readonly AudienceHistoryEntry[]): AudienceHistoryEntry[];
|
|
21
|
+
/** 広げた項目(from は保存済みの見える範囲か、作り直した key のレジストリの最も狭い見える範囲) */
|
|
22
|
+
export type AudienceWidening = AudienceHistoryEntry & Readonly<{
|
|
23
23
|
from: Audience;
|
|
24
24
|
}>;
|
|
25
|
-
/** 機密だった key を別の種類で作り直した項目(previousType
|
|
25
|
+
/** 機密だった key を別の種類で作り直した項目(previousType はレジストリの種類) */
|
|
26
26
|
export type ConfidentialReuse = Readonly<{
|
|
27
27
|
collection: string;
|
|
28
28
|
path: string;
|
|
@@ -30,9 +30,9 @@ export type ConfidentialReuse = Readonly<{
|
|
|
30
30
|
}>;
|
|
31
31
|
/**
|
|
32
32
|
* 保存済みの定義 prev から next への見える範囲の変更(どちらも読み込んだ形、読み替えは audienceOf)
|
|
33
|
-
* - 保存済みの項目は保存済みの見える範囲と、追加の項目(作り直した key
|
|
33
|
+
* - 保存済みの項目は保存済みの見える範囲と、追加の項目(作り直した key とコレクション)はレジストリと比べる
|
|
34
34
|
*/
|
|
35
|
-
export declare function audienceFindings(prev:
|
|
35
|
+
export declare function audienceFindings(prev: CollectionSchema, next: CollectionSchema, registry: readonly AudienceHistoryEntry[]): {
|
|
36
36
|
widened: AudienceWidening[];
|
|
37
37
|
reused: ConfidentialReuse[];
|
|
38
38
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type CollectionSchema, type Collection, type FieldDef } from './collection.js';
|
|
2
2
|
/** 出典の項目と、内側の項目の key */
|
|
3
3
|
export declare const SOURCES_FIELD: {
|
|
4
4
|
readonly key: "sources";
|
|
@@ -12,17 +12,17 @@ export type SourcesField = Extract<FieldDef, {
|
|
|
12
12
|
to: string;
|
|
13
13
|
}>;
|
|
14
14
|
/** 主のコレクション(スキーマの順で先頭、なければ null) */
|
|
15
|
-
export declare const primaryCollectionOf: (
|
|
15
|
+
export declare const primaryCollectionOf: (schema: CollectionSchema) => Collection | null;
|
|
16
16
|
/** 主のコレクション(なければ例外: そのコレクションを前提にする画面・処理だけが使用) */
|
|
17
|
-
export declare function requiredPrimaryCollectionOf(
|
|
17
|
+
export declare function requiredPrimaryCollectionOf(collectionSchema: CollectionSchema): Collection;
|
|
18
18
|
/** 暦の日付(日付の役割の項目を持つ一覧のコレクションと項目の key、スキーマの順、役割は宣言だけで推測なし) */
|
|
19
|
-
export declare const dateRoleFieldsOf: (
|
|
19
|
+
export declare const dateRoleFieldsOf: (schema: CollectionSchema) => {
|
|
20
20
|
collection: string;
|
|
21
21
|
field: string;
|
|
22
22
|
}[];
|
|
23
23
|
/** コレクションの出典の項目(なければ null) */
|
|
24
24
|
export declare function sourcesFieldOf(collection: Pick<Collection, 'fields'>): SourcesField | null;
|
|
25
25
|
/** 出典のコレクション(出典の項目の参照先でスキーマの順で先頭、なければ null) */
|
|
26
|
-
export declare function sourceCollectionOf(
|
|
26
|
+
export declare function sourceCollectionOf(schema: CollectionSchema): Collection | null;
|
|
27
27
|
/** 出典の値にある参照の ID(注の順、空と形の誤りは除外) */
|
|
28
28
|
export declare const sourceIdsOf: (value: unknown) => string[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AudienceHistoryEntry, type AudienceWidening } from './audience.js';
|
|
2
2
|
import type { Problem } from '../../i18n/src/index.js';
|
|
3
|
-
import { type
|
|
3
|
+
import { type CollectionSchema } from './collection.js';
|
|
4
4
|
/** 変更の扱い */
|
|
5
5
|
export type ChangeLevel = 'safe' | 'confirm' | 'forbidden';
|
|
6
6
|
/** 変更の種類 */
|
|
@@ -24,11 +24,11 @@ export type SchemaChange = Readonly<{
|
|
|
24
24
|
/**
|
|
25
25
|
* 差分の条件
|
|
26
26
|
* - history: 保存済みの版より古い過去の版
|
|
27
|
-
* -
|
|
27
|
+
* - registry: 見える範囲の履歴(audience.ts)
|
|
28
28
|
*/
|
|
29
29
|
export type DiffOptions = Readonly<{
|
|
30
|
-
history?: readonly
|
|
31
|
-
|
|
30
|
+
history?: readonly CollectionSchema[];
|
|
31
|
+
registry?: readonly AudienceHistoryEntry[];
|
|
32
32
|
}>;
|
|
33
33
|
/** 保存済みの版 prev から新しい定義 next への変更(コレクションの順、項目の順) */
|
|
34
|
-
export declare function diffSchema(prev:
|
|
34
|
+
export declare function diffSchema(prev: CollectionSchema, next: CollectionSchema, options?: DiffOptions): SchemaChange[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DeclaredComponent } from '../../
|
|
2
|
-
import type { Collection, FieldDef, FieldProblem } from './
|
|
1
|
+
import type { DeclaredComponent } from '../../rich-text/src/index.js';
|
|
2
|
+
import type { Collection, FieldDef, FieldProblem } from './collection.js';
|
|
3
3
|
/** 項目が値の組に当てはまるか(条件なしは常に当てはまる、values は同じ階層の値) */
|
|
4
4
|
export declare const appliesTo: (field: FieldDef, values: Readonly<Record<string, unknown>>) => boolean;
|
|
5
5
|
/** 値の組に当てはまる項目だけ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BodyProfile, DeclaredComponent } from '../../
|
|
1
|
+
import type { BodyProfile, DeclaredComponent } from '../../rich-text/src/index.js';
|
|
2
2
|
import type { PhoneRegion, UrlScheme } from './contact.js';
|
|
3
3
|
import type { Transition, UniqueDef } from './integrity.js';
|
|
4
4
|
import type { ImageFrameDef, PageDef } from './page.js';
|
|
@@ -110,7 +110,7 @@ export declare const ON_DELETE: readonly ["cascade", "anonymize", "clear", "rest
|
|
|
110
110
|
export type OnDelete = (typeof ON_DELETE)[number];
|
|
111
111
|
/** 顧客フィールドの指す人が消えたときの扱い(restrict は不可、人の削除の求めを止めないため) */
|
|
112
112
|
export type CustomerOnDelete = Exclude<OnDelete, 'restrict'>;
|
|
113
|
-
/**
|
|
113
|
+
/** ファイルの種類(メディアのコレクション image・video の id と同じ) */
|
|
114
114
|
export type MediaKind = 'image' | 'video';
|
|
115
115
|
/** 項目の定義 */
|
|
116
116
|
export type FieldDef = FieldBase & Readonly<{
|
|
@@ -156,14 +156,14 @@ export type FieldDef = FieldBase & Readonly<{
|
|
|
156
156
|
requests?: boolean; /** 値が空のときの表示名(持ち主のいないレコードの名義など) */
|
|
157
157
|
emptyLabel?: string;
|
|
158
158
|
} & ReferenceRules & Counts) | ({
|
|
159
|
-
type: '
|
|
159
|
+
type: 'file'; /** 受け付けるファイルの種類(なしはすべて) */
|
|
160
160
|
accept?: readonly MediaKind[];
|
|
161
161
|
multiple?: boolean; /** 画像の枠(先頭から条件に合うもの、page.ts) */
|
|
162
|
-
frames?: readonly ImageFrameDef[]; /**
|
|
162
|
+
frames?: readonly ImageFrameDef[]; /** 非公開のファイルだけ(アップロードと取り込みは非公開、公開の実体は保存で拒否) */
|
|
163
163
|
visibility?: 'private';
|
|
164
164
|
} & Counts) | {
|
|
165
165
|
type: 'rich_text';
|
|
166
|
-
profile: BodyProfile; /**
|
|
166
|
+
profile: BodyProfile; /** 本文の画像とファイルは非公開のファイルだけ */
|
|
167
167
|
visibility?: 'private';
|
|
168
168
|
} | ({
|
|
169
169
|
type: 'group'; /** まとまりの中の項目(Sanity の object、microCMS のカスタムフィールド) */
|
|
@@ -190,14 +190,14 @@ export type Publishing = 'none' | 'draft' | 'review';
|
|
|
190
190
|
* - publishing: 公開の管理(なしは管理なし)
|
|
191
191
|
* - pages: サイトのページの URL と公開中の条件(なしはページのないコレクション、page.ts)
|
|
192
192
|
* - counts: 被参照の件数(ページの公開中の条件・ページの公開で必須の判定に使用)
|
|
193
|
-
* - og: サイトの OG 画像のパスの雛形({key}
|
|
193
|
+
* - og: サイトの OG 画像のパスの雛形({key} はレコードの値、ワークスペースの OG 画像のプレビュー)
|
|
194
194
|
* - slugMode: レコードのスラッグの決め方(auto は自動の10桁、editor は編集者が入力して変更でき、空欄は自動。ページのあるコレクションは常に editor)
|
|
195
195
|
* - roles: 項目の役割(役割ごとに最上位の項目の key、roleFieldOf)
|
|
196
196
|
*/
|
|
197
197
|
export type Collection = Readonly<{
|
|
198
198
|
/** 内部のキー(不変、参照の to・権限・DB が指す) */
|
|
199
199
|
id: string;
|
|
200
|
-
/** 人が見る識別子(プロジェクトで一意、変更できる。API
|
|
200
|
+
/** 人が見る識別子(プロジェクトで一意、変更できる。API とワークスペースの経路) */
|
|
201
201
|
slug: string;
|
|
202
202
|
label: string;
|
|
203
203
|
description?: string;
|
|
@@ -219,6 +219,8 @@ export type Collection = Readonly<{
|
|
|
219
219
|
selfOps?: readonly SelfOp[];
|
|
220
220
|
/** 保持の日数(#683の5、人の操作 selfOps を足す・変える保存で必須) */
|
|
221
221
|
retentionDays?: number;
|
|
222
|
+
/** 公開と予約の前に要る検査の id(提供するアプリがオンでなければ公開を拒む) */
|
|
223
|
+
publishChecks?: readonly string[];
|
|
222
224
|
}>;
|
|
223
225
|
/** コレクションが宣言で受ける人の操作(#712) */
|
|
224
226
|
export declare const SELF_OPS: readonly ["read_self", "create_self", "update_self", "delete_self"];
|
|
@@ -230,13 +232,13 @@ export type FieldRole = (typeof FIELD_ROLES)[number];
|
|
|
230
232
|
/** コレクションの役割の宣言(役割ごとに最上位の項目の key) */
|
|
231
233
|
export type FieldRoles = Readonly<Partial<Record<FieldRole, string>>>;
|
|
232
234
|
/** コンテンツスキーマ(導入先ごとに1つ、読み込みの結果: 宣言のない見える範囲と onDelete は任意で、読むときは audienceOf・onDeleteOf が狭い側に読み替える) */
|
|
233
|
-
export type
|
|
235
|
+
export type CollectionSchema = Readonly<{
|
|
234
236
|
collections: readonly Collection[];
|
|
235
237
|
components?: readonly DeclaredComponent[];
|
|
236
238
|
}>;
|
|
237
239
|
/**
|
|
238
|
-
* 読み替えた項目(最上位: 見える範囲は必須、旧い印 private・customersOnly は持たない、audience.ts の
|
|
239
|
-
* - 顧客フィールドの onDelete: 足すか変える項目は
|
|
240
|
+
* 読み替えた項目(最上位: 見える範囲は必須、旧い印 private・customersOnly は持たない、audience.ts の resolvedSchema)
|
|
241
|
+
* - 顧客フィールドの onDelete: 足すか変える項目は validateSchemaForSave が宣言を求める。変わらない旧い項目は宣言なしのまま(読みは restrict)
|
|
240
242
|
*/
|
|
241
243
|
type Resolved<F> = F extends unknown ? Omit<F, 'private' | 'customersOnly' | 'audience'> & Readonly<{
|
|
242
244
|
audience: Audience;
|
|
@@ -247,8 +249,8 @@ export type ResolvedField = Resolved<FieldDef>;
|
|
|
247
249
|
export type ResolvedCollection = Omit<Collection, 'fields'> & Readonly<{
|
|
248
250
|
fields: readonly ResolvedField[];
|
|
249
251
|
}>;
|
|
250
|
-
/** 読み替えたコンテンツスキーマ(実行の側と保存の検査の規則が使う値、
|
|
251
|
-
export type
|
|
252
|
+
/** 読み替えたコンテンツスキーマ(実行の側と保存の検査の規則が使う値、CollectionSchema としても読める。保存するのは入力の形のまま) */
|
|
253
|
+
export type ResolvedSchema = Omit<CollectionSchema, 'collections'> & Readonly<{
|
|
252
254
|
collections: readonly ResolvedCollection[];
|
|
253
255
|
}>;
|
|
254
256
|
/** 項目の値の問題(path は項目の key) */
|
|
@@ -256,9 +258,9 @@ export type FieldProblem = Readonly<{
|
|
|
256
258
|
path: string;
|
|
257
259
|
message: string;
|
|
258
260
|
}>;
|
|
259
|
-
/** メディアのコレクションの id(項目の種類 media の accept と同じ、レコードは表
|
|
261
|
+
/** メディアのコレクションの id(項目の種類 media の accept と同じ、レコードは表 files) */
|
|
260
262
|
export declare const MEDIA_COLLECTION_IDS: readonly MediaKind[];
|
|
261
|
-
/** メディアのコレクションか(画像・動画、レコードは表
|
|
263
|
+
/** メディアのコレクションか(画像・動画、レコードは表 files で一覧・作成・配信の対象外) */
|
|
262
264
|
export declare const isMediaCollection: (collection: Collection) => boolean;
|
|
263
265
|
/** 編集者がレコードのスラッグを入力・変更できるコレクションか(メディアのコレクションを除き、slugMode が editor かページを持つコレクション) */
|
|
264
266
|
export declare const editsSlug: (collection: Collection) => boolean;
|
|
@@ -266,7 +268,7 @@ export declare const editsSlug: (collection: Collection) => boolean;
|
|
|
266
268
|
export declare const isSingleton: (collection: Collection) => boolean;
|
|
267
269
|
/** 公開の管理(なしは none) */
|
|
268
270
|
export declare const publishingOf: (collection: Collection) => Publishing;
|
|
269
|
-
/** 顧客への参照の項目の種類(
|
|
271
|
+
/** 顧客への参照の項目の種類(contract の CUSTOMER_REFERENCE_FIELD と同じ値) */
|
|
270
272
|
export declare const CUSTOMER_FIELD_TYPE = "customer";
|
|
271
273
|
/** 顧客への参照の項目 */
|
|
272
274
|
export type CustomerField = Extract<FieldDef, {
|
|
@@ -294,9 +296,9 @@ export declare const isPersonalCollection: (collection: Pick<Collection, "fields
|
|
|
294
296
|
export declare const isCustomerLinkedCollection: (collection: Collection) => boolean;
|
|
295
297
|
/**
|
|
296
298
|
* 項目の個人の情報の分類(宣言 pii、なければ外の値 outer、なければ項目の種類の既定)
|
|
297
|
-
* -
|
|
299
|
+
* - 組織の項目は既定で PII として扱う(決定)
|
|
298
300
|
* - 既定: text・url は identifier、email・phone は contact
|
|
299
|
-
* - 既定の freetext(値を空にする): ほかの値(long_text
|
|
301
|
+
* - 既定の freetext(値を空にする): ほかの値(long_text、本文、日付、数値、選択、チェック、ファイル)
|
|
300
302
|
* - 既定の none: 値でない項目(人と参照はレコードの結び付き、まとまりは中の項目ごと、連番はシステムが振る番号)。それ以外の none は宣言だけで付く
|
|
301
303
|
*/
|
|
302
304
|
export declare function fieldPiiOf(_type: Collection, f: FieldDef, outer?: PiiClass): PiiClass;
|
|
@@ -310,7 +312,7 @@ export declare const PII_STRENGTH: {
|
|
|
310
312
|
readonly freetext: 2;
|
|
311
313
|
readonly sensitive: 3;
|
|
312
314
|
};
|
|
313
|
-
/** 足す項目の既定の見える範囲(非公開のコレクションは宣言なしの読み、個人の情報を持つコレクションは staff、ほかは public
|
|
315
|
+
/** 足す項目の既定の見える範囲(非公開のコレクションは宣言なしの読み、個人の情報を持つコレクションは staff、ほかは public。ワークスペースの既定と保存の規則が共有) */
|
|
314
316
|
export declare function addedFieldAudienceOf(collection: Pick<Collection, 'private' | 'fields'>): Audience;
|
|
315
317
|
/** 見える範囲の宣言(audience と旧い印)を外した項目 */
|
|
316
318
|
export declare const withoutAudience: <F extends FieldDef>(f: F) => Omit<F, "audience" | "private" | "customersOnly">;
|
|
@@ -367,16 +369,16 @@ export declare const isPublishable: (collection: Collection) => boolean;
|
|
|
367
369
|
export declare const usesReview: (collection: Collection) => boolean;
|
|
368
370
|
/** コレクションのレコードを表 records に保存するか(メディアのコレクションを除くすべて) */
|
|
369
371
|
export declare const isStoredCollection: (collection: Collection) => boolean;
|
|
370
|
-
/**
|
|
372
|
+
/** 非公開のコレクションか(顧客のレジストリ・アンケートなど) */
|
|
371
373
|
export declare const isPrivateCollection: (collection: Collection) => boolean;
|
|
372
374
|
/** 配信するコレクションか(表 records のコレクションで、非公開のコレクションを除く) */
|
|
373
375
|
export declare const isDeliveredCollection: (collection: Collection) => boolean;
|
|
374
376
|
/** コンテンツスキーマのコレクション(id から、なければ例外: 導入先の設定の誤り) */
|
|
375
|
-
export declare function collectionOf(
|
|
377
|
+
export declare function collectionOf(collectionSchema: CollectionSchema, id: string): Collection;
|
|
376
378
|
/** UUID の形(経路の値が id かスラッグかの引き分け。スラッグはハイフンを持てないので UUID の形にならない) */
|
|
377
379
|
export declare const isUuidShape: (value: string) => boolean;
|
|
378
380
|
/** 経路・入力の値のコレクション(UUID の形なら id、ほかはスラッグで引く。なければ undefined) */
|
|
379
|
-
export declare const collectionByRef: (
|
|
381
|
+
export declare const collectionByRef: (schema: CollectionSchema, ref: string) => Collection | undefined;
|
|
380
382
|
/** 選択肢の項目の選択肢(まとまりの中の項目は `links.kind` の形、選択肢の項目でなければ空) */
|
|
381
383
|
export declare function optionsOf(collection: Collection, key: string): readonly SelectOption[];
|
|
382
384
|
/** 新しいレコードの初期値(セレクトは項目の initial、なければ先頭の選択肢、セレクトでなければ空文字) */
|
|
@@ -397,7 +399,7 @@ export declare const acceptsRole: (role: FieldRole, f: FieldDef) => boolean;
|
|
|
397
399
|
/**
|
|
398
400
|
* コレクションの役割の項目(宣言 roles の項目、宣言のない役割は推測、なければ null)
|
|
399
401
|
* - 用途: 題はレコードの表示名、画像は一覧・参照の候補・アイキャッチ、本文は Markdown・点検・制作の案内、要約は説明、日付は暦
|
|
400
|
-
* 期間(月)は権利の対象のレコードごとの権利の期間(
|
|
402
|
+
* 期間(月)は権利の対象のレコードごとの権利の期間(contract の grantEndsOn)
|
|
401
403
|
* - 宣言が最上位の項目を指さない・受け付けない項目を指す: null(検査は schema.ts)
|
|
402
404
|
*/
|
|
403
405
|
export declare function roleFieldOf(collection: Collection, role: 'body'): BodyField | null;
|
|
@@ -409,7 +411,7 @@ export declare const bodyFieldsOf: (collection: Collection) => BodyField[];
|
|
|
409
411
|
/** コレクションの計算の項目(最上位) */
|
|
410
412
|
export declare const computedFieldsOf: (collection: Collection) => FieldDef[];
|
|
411
413
|
/** 追加の依頼ができる参照の項目(参照先が一覧で管理するコレクションで requests の指定があるもの、タグ・分類など) */
|
|
412
|
-
export declare function requestReferencesOf(
|
|
414
|
+
export declare function requestReferencesOf(schema: CollectionSchema, collection: Collection): Extract<FieldDef, {
|
|
413
415
|
type: 'reference';
|
|
414
416
|
}>[];
|
|
415
417
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { BodyProfile } from '../../
|
|
2
|
-
import { type
|
|
1
|
+
import type { BodyProfile } from '../../rich-text/src/index.js';
|
|
2
|
+
import { type CollectionSchema } from './collection.js';
|
|
3
|
+
import { type ScreenSettings } from './screens.js';
|
|
3
4
|
/** 既定の本文の設定(本文の項目 profile と同じ値) */
|
|
4
5
|
export declare const DEFAULT_BODY_PROFILE: BodyProfile;
|
|
5
6
|
/** 中立の既定のスキーマ(新しいプロジェクトの作成で適用するコレクション: post・author・tag・image・video、設定の移入の土台) */
|
|
6
|
-
export declare const DEFAULT_SCHEMA:
|
|
7
|
+
export declare const DEFAULT_SCHEMA: CollectionSchema;
|
|
7
8
|
/** 既定の画面設定(新しいプロジェクトの作成で適用する中立の値、移入する screens の土台) */
|
|
8
9
|
export declare const DEFAULT_SCREENS: ScreenSettings;
|
|
@@ -26,7 +26,7 @@ export type LocalImage = Readonly<{
|
|
|
26
26
|
format: string;
|
|
27
27
|
}>;
|
|
28
28
|
/** 実体の共通の項目(ID は UUID で R2 のキーと同じ、sha256 は内容のハッシュで同じ画像の重複を防止、visibility は非公開の実体だけ private) */
|
|
29
|
-
type
|
|
29
|
+
type FileBase = Readonly<{
|
|
30
30
|
id: string;
|
|
31
31
|
mimeType: string;
|
|
32
32
|
size: number;
|
|
@@ -39,38 +39,38 @@ type AssetBase = Readonly<{
|
|
|
39
39
|
createdAt: string;
|
|
40
40
|
visibility?: 'private';
|
|
41
41
|
}>;
|
|
42
|
-
/** 画像の実体(Sanity の sanity.
|
|
43
|
-
export type
|
|
42
|
+
/** 画像の実体(Sanity の sanity.imageFile、代替テキストと hotspot は画像ごとに1つ) */
|
|
43
|
+
export type ImageFile = FileBase & Readonly<{
|
|
44
44
|
kind: 'image';
|
|
45
45
|
}>;
|
|
46
46
|
/** 動画の実体(poster は代わりに表示する画像の実体の ID、配信と再生は最初に使用する場所が決まったときに実装) */
|
|
47
|
-
export type
|
|
47
|
+
export type VideoFile = FileBase & Readonly<{
|
|
48
48
|
kind: 'video';
|
|
49
49
|
duration?: number;
|
|
50
50
|
poster?: string;
|
|
51
51
|
}>;
|
|
52
52
|
/** ファイルの実体(本文の中のファイル、name は元のファイル名、寸法は0) */
|
|
53
|
-
export type
|
|
54
|
-
kind: '
|
|
53
|
+
export type OtherFile = FileBase & Readonly<{
|
|
54
|
+
kind: 'other';
|
|
55
55
|
name?: string;
|
|
56
56
|
}>;
|
|
57
|
-
/** 実体(CMS
|
|
58
|
-
export type
|
|
59
|
-
/** 使用する側が保存する実体の参照(Sanity の image の
|
|
60
|
-
export type
|
|
61
|
-
|
|
57
|
+
/** 実体(CMS のファイルにある1件) */
|
|
58
|
+
export type File = ImageFile | VideoFile | OtherFile;
|
|
59
|
+
/** 使用する側が保存する実体の参照(Sanity の image の file、表示のときに実体の寸法・代替テキスト・hotspot を合わせて Media に解決) */
|
|
60
|
+
export type FileRef = Readonly<{
|
|
61
|
+
file: string;
|
|
62
62
|
}>;
|
|
63
63
|
/** 配信 API が解決した実体(url は配信 URL で配信のオリジンがある CMS だけ、hotspot・crop は元の画像に対する割合) */
|
|
64
|
-
export type
|
|
64
|
+
export type DeliveredFile = Readonly<{
|
|
65
65
|
id: string;
|
|
66
|
-
kind: 'image' | 'video' | '
|
|
66
|
+
kind: 'image' | 'video' | 'other';
|
|
67
67
|
url?: string;
|
|
68
68
|
width: number;
|
|
69
69
|
height: number;
|
|
70
70
|
alt: string;
|
|
71
71
|
hotspot?: Hotspot;
|
|
72
72
|
crop?: Crop;
|
|
73
|
-
poster?:
|
|
73
|
+
poster?: DeliveredFile | null; /** 非公開の実体(url は署名のない配信 URL、signMediaUrl で署名して渡す) */
|
|
74
74
|
visibility?: 'private'; /** ファイルの元のファイル名・形式・大きさ(バイト) */
|
|
75
75
|
name?: string;
|
|
76
76
|
mimeType?: string;
|
|
@@ -90,7 +90,7 @@ type MediaBase = Readonly<{
|
|
|
90
90
|
hotspot?: Hotspot;
|
|
91
91
|
}>;
|
|
92
92
|
/**
|
|
93
|
-
* 表示の素材(使用する側のコレクションで共通、実体の参照
|
|
93
|
+
* 表示の素材(使用する側のコレクションで共通、実体の参照 FileRef を解決した値)
|
|
94
94
|
* - `image`: 画像
|
|
95
95
|
* - `video`: 動画(poster は読み込み前・動きを抑える設定・OG で代わりに表示する画像、再生の仕方は使用する場所で決定)
|
|
96
96
|
*/
|
|
@@ -107,5 +107,5 @@ export declare const cropSchema: z.ZodType<Crop>;
|
|
|
107
107
|
/** 解決後の素材の検査(src は URL、ビルドで読み込んだ画像は JSON に含めないため対象外) */
|
|
108
108
|
export declare const mediaSchema: z.ZodType<Media>;
|
|
109
109
|
/** 使用する側が保存する実体の参照の検査 */
|
|
110
|
-
export declare const
|
|
110
|
+
export declare const fileRefSchema: z.ZodType<FileRef>;
|
|
111
111
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Crop, Hotspot, Media } from './
|
|
1
|
+
import type { Crop, Hotspot, Media } from './file.js';
|
|
2
2
|
/** 静止画として表示する画像(動画は代わりの画像 poster) */
|
|
3
3
|
export declare const stillOf: (media: Media) => Readonly<{
|
|
4
|
-
src: string | import("./
|
|
4
|
+
src: string | import("./file.js").LocalImage;
|
|
5
5
|
width: number;
|
|
6
6
|
height: number;
|
|
7
7
|
alt: string;
|
|
@@ -13,7 +13,7 @@ export declare const objectPosition: (hotspot?: Hotspot) => string | undefined;
|
|
|
13
13
|
* 枠を覆う表示で、枠に見える範囲(窓)の始まりの位置: 1次元、画像に対する割合で0〜1 - window
|
|
14
14
|
* - 見せたい範囲の中心を窓の中央に寄せ、画像の端を越えるときは端と同じ位置
|
|
15
15
|
* - 範囲が窓に収まる大きさなら、この位置で範囲は必ず窓に入る(範囲が窓より大きいときは範囲の中央を表示)
|
|
16
|
-
* - center なしは中央、CMS のプレビュー(apps/
|
|
16
|
+
* - center なしは中央、CMS のプレビュー(apps/workspace の crop.ts)とサイトの表示で共通
|
|
17
17
|
*/
|
|
18
18
|
export declare function coverStart(center: number | undefined, window: number): number;
|
|
19
19
|
/**
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { BRAND_NAME } from './brand.js';
|
|
2
2
|
export { fieldZod, jsonSchemaOf, normalizeValues, zodOf, type ValueOptions } from './input.js';
|
|
3
|
-
export {
|
|
3
|
+
export { fileRefSchema, cropSchema, hotspotSchema, mediaSchema, type File, type FileRef, type Crop, type DeliveredFile, type Hotspot, type LocalImage, type Media } from './file.js';
|
|
4
4
|
export { coverPosition, coverStart, cropRect, croppedHotspot, objectPosition, stillOf, type CropRect } from './image.js';
|
|
5
5
|
export { IMAGE_TYPE, VIDEO_TYPE } from './media.js';
|
|
6
|
-
export { IMAGE_SIZE_MAX, imageParamsOf, isMediaId, MEDIA_SIGNING_KEY_BLOB, MEDIA_SIGNING_KEY_SPOT,
|
|
6
|
+
export { IMAGE_SIZE_MAX, imageParamsOf, isMediaId, MEDIA_SIGNING_KEY_BLOB, MEDIA_SIGNING_KEY_SPOT, fileBlobKeyOf, mediaExtOf, mediaKindOf, mediaMimeOf, mediaPathOf, parseMediaPath, signMediaUrl, verifyMediaUrl, withImageParams, type ImageParams, type FileKind, type MediaPath } from './mediaUrl.js';
|
|
7
7
|
export { diffSchema, type ChangeKind, type ChangeLevel, type DiffOptions, type SchemaChange } from './changes.js';
|
|
8
8
|
export { dateRoleFieldsOf, primaryCollectionOf, requiredPrimaryCollectionOf, SOURCES_FIELD, sourceIdsOf, sourcesFieldOf, sourceCollectionOf, type SourcesField } from './capabilities.js';
|
|
9
9
|
export { appliesTo, checkFields, fieldsFor, shapeProblems } from './check.js';
|
|
10
10
|
export { deliveredFields, emptyValues, pickValues, referencedIds, referencesOf, valueFieldsOf } from './values.js';
|
|
11
|
-
export { typesSourceOf } from './typesSource.js';
|
|
11
|
+
export { typesSourceOf, UnknownFieldTypeError } from './typesSource.js';
|
|
12
12
|
export { mapReferences, recordRefsOf, type RecordRef, referencedIdsOf, referenceInputOf, type ReferenceValue, renameRecordRefs } from './refs.js';
|
|
13
13
|
export { sameJson } from './json.js';
|
|
14
14
|
export { isSelfField, isSelfRow, ownerFieldOf, type SelfWrite, selfFieldsOf, selfWritableKeysOf, selfWritableOf, selfWritableProblems, type CustomerOperation, selfOpsOf, selfOpsProblems, type CustomerProof, surveyInputField } from './selfOps.js';
|
|
15
|
-
export {
|
|
16
|
-
export { acceptsRole, addedFieldAudienceOf, defaultPiiOf, fieldPiiOf, isPersonalCollection, isCustomerLinkedCollection, PII_CLASSES, PII_STRENGTH, type PiiClass, anonymizedKeysOf, audienceOf, withoutAudience, declaredAudienceOf, innerAudienceOf, AUDIENCES, type Audience, bodyFieldsOf, cascadeDepths, type CascadeCollection, ON_DELETE, onDeleteOf, type OnDelete, type CustomerOnDelete, grantedKeysOf, isDeliveredAudience, computedFieldsOf, FIELD_ROLES, hasCustomerRules, editsSlug, SLUG_MODES, type SlugMode, initialValueOf, isPublishable, isInputField, isSequenceField, isListCollection, isDeliveredCollection, isMediaCollection, isPrivateCollection, isSingleton, isStoredCollection, isUndeliveredField, MEDIA_COLLECTION_IDS, CUSTOMER_FIELD_TYPE, SELF_OPS, type SelfOp, customerFieldsOf, type CustomerField, type ReferenceField, optionLabelOf, optionsOf, publishingOf, requestReferencesOf, resolvedRolesOf, roleFieldOf, toneOf, collectionOf, collectionByRef, isUuidShape, type ComputedKind, type FieldRole, type FieldRoles, type FieldComputed, type ContentFormat, type
|
|
15
|
+
export { audienceAdditions, resolvedSchema, type AudienceHistoryEntry } from './audience.js';
|
|
16
|
+
export { acceptsRole, addedFieldAudienceOf, defaultPiiOf, fieldPiiOf, isPersonalCollection, isCustomerLinkedCollection, PII_CLASSES, PII_STRENGTH, type PiiClass, anonymizedKeysOf, audienceOf, withoutAudience, declaredAudienceOf, innerAudienceOf, AUDIENCES, type Audience, bodyFieldsOf, cascadeDepths, type CascadeCollection, ON_DELETE, onDeleteOf, type OnDelete, type CustomerOnDelete, grantedKeysOf, isDeliveredAudience, computedFieldsOf, FIELD_ROLES, hasCustomerRules, editsSlug, SLUG_MODES, type SlugMode, initialValueOf, isPublishable, isInputField, isSequenceField, isListCollection, isDeliveredCollection, isMediaCollection, isPrivateCollection, isSingleton, isStoredCollection, isUndeliveredField, MEDIA_COLLECTION_IDS, CUSTOMER_FIELD_TYPE, SELF_OPS, type SelfOp, customerFieldsOf, type CustomerField, type ReferenceField, optionLabelOf, optionsOf, publishingOf, requestReferencesOf, resolvedRolesOf, roleFieldOf, toneOf, collectionOf, collectionByRef, isUuidShape, type ComputedKind, type FieldRole, type FieldRoles, type FieldComputed, type ContentFormat, type CollectionSchema, type Collection, type ResolvedSchema, type FieldCondition, type FieldDef, type FieldDerive, type FieldFixedBy, type CountDef, type FieldProblem, type MediaKind, type OptionTone, type Publishing, type ReferenceRules, type SelectOption, usesReview } from './collection.js';
|
|
17
17
|
export { hasPublicPage, imageFrameOf, pagePathOf, publicPathOf, withPagesFrom, type ImageFrame, type ImageFrameDef, type PageDef, type PageRecord, type PageRule } from './page.js';
|
|
18
18
|
export { schemaRulesOf, type SchemaRule } from './rules.js';
|
|
19
19
|
export { acceptsUnique, hasTransitions, integrityProblems, transitionAllowed, transitionFieldsOf, transitionProblems, transitionTargets, type Transition, type TransitionActor, type TransitionActors, type TransitionField, sequenceFieldsOf, UNIQUE_FIELDS_MAX, UNIQUE_NORMALIZATION_VERSION, uniqueDefsOf, uniquePartOf, uniqueDuplicatesOf, uniquesColumnOf, uniqueValueOf, type UniqueDef, type UniqueDuplicate } from './integrity.js';
|
|
20
|
-
export { fieldDefSchema, MAX_CASCADE_DEPTH,
|
|
20
|
+
export { fieldDefSchema, MAX_CASCADE_DEPTH, parseSchema, RESERVED_FIELD_KEYS, RETENTION_DAYS_MAX, retentionProblems, ruleIssues, undeclaredDeleteProblems, validateSchemaForSave } from './schema.js';
|
|
21
21
|
export { MENU_GROUP_ID, menuItemsOf, parseScreens, placedItemsOf, resolveLayout, resolveMenu, embedItem, collectionItem, collectionOfItem, viewItem, viewOfItem, type EditorLayout, type EditorSection, type MenuEntry, type MenuGroup, type ResolvedMenuEntry, type ScreenSettings } from './screens.js';
|
|
22
22
|
export { createClock, isDateOnly, isDateTimeText, type Clock, type DateString } from './time.js';
|
|
23
23
|
export { phoneNationalOf, type PhoneRegion, type UrlScheme } from './contact.js';
|
|
24
|
-
export { AUDIENCE_LABELS,
|
|
25
|
-
export {
|
|
26
|
-
export { type
|
|
24
|
+
export { AUDIENCE_LABELS, SCHEMA_PROBLEM_MESSAGES } from './labels/ja.js';
|
|
25
|
+
export { SCHEMA_PROBLEM_MESSAGES_EN } from './labels/en.js';
|
|
26
|
+
export { type SchemaProblemCode, schemaProblemText } from './problems.js';
|
|
27
|
+
export { DEFAULT_BODY_PROFILE, DEFAULT_SCHEMA, DEFAULT_SCREENS } from './defaultSchema.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type DeclaredComponent } from '../../
|
|
1
|
+
import { type DeclaredComponent } from '../../rich-text/src/index.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import type { FieldDef } from './
|
|
3
|
+
import type { FieldDef } from './collection.js';
|
|
4
4
|
/** 検査の時点(保存か提出、提出は保存の必須も含む) */
|
|
5
5
|
type Stage = 'save' | 'submit';
|
|
6
6
|
/** 値の検査の設定(toDateTime は日時の変換で、プロジェクトのタイムゾーンを持つ側が指定、components はスキーマで宣言した本文の部品) */
|
|
@@ -16,7 +16,7 @@ export declare function fieldZod(field: FieldDef, stage: Stage, options?: ValueO
|
|
|
16
16
|
export declare const zodOf: (fields: readonly FieldDef[], stage: Stage, options?: ValueOptions) => z.ZodObject<Record<string, z.ZodType>>;
|
|
17
17
|
/**
|
|
18
18
|
* 値を保存の形に整形(すべての格納先で共通、まとまりの中も)
|
|
19
|
-
* - 日時: `ISO 8601` の UTC(options の toDateTime)、本文:
|
|
19
|
+
* - 日時: `ISO 8601` の UTC(options の toDateTime)、本文: 注の記法の変換と未知のキーの除去、ファイル: { file } だけ
|
|
20
20
|
* - 形の誤りのある値: そのまま(checkFields が検出)
|
|
21
21
|
* - 定義にないキー・項目を定義しないまとまり: そのまま
|
|
22
22
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** コンテンツスキーマの検査の問題の英語の文 */
|
|
2
|
-
export declare const
|
|
3
|
-
readonly
|
|
2
|
+
export declare const SCHEMA_PROBLEM_MESSAGES_EN: {
|
|
3
|
+
readonly schema_unreadable_input: "Cannot read the collection list types (each collection needs an id and an array of fields, groups also need an array of fields)";
|
|
4
4
|
readonly invalid_collection_id: "id must start with a lowercase letter and contain only lowercase letters, digits and underscores";
|
|
5
5
|
readonly invalid_field_key: "key must start with a lowercase letter and contain only letters, digits, underscores and hyphens";
|
|
6
6
|
readonly page_path_slash: "The page template must start with /";
|
|
@@ -82,7 +82,7 @@ export declare const MODEL_PROBLEM_MESSAGES_EN: {
|
|
|
82
82
|
readonly self_ops_on_delete: "Collection {collection}: the self customer field {field} of a selfOps collection must use onDelete cascade or anonymize (deletion requests must not keep self records)";
|
|
83
83
|
readonly self_ops_unique: "Collection {collection}: unique constraint {key} of a selfOps collection must include the self customer field {field} (to avoid conflicts with other people's values)";
|
|
84
84
|
readonly self_writable_nested: "Collection {collection}, field {field}: selfWritable cannot be set inside a group";
|
|
85
|
-
readonly self_writable_blocked: "Collection {collection}, field {field}: selfWritable cannot be set on {block, select, customer {customer fields} group {groups}
|
|
85
|
+
readonly self_writable_blocked: "Collection {collection}, field {field}: selfWritable cannot be set on {block, select, customer {customer fields} group {groups} file {file fields} rich_text {body fields} staff {staff fields} admin_only {admin-only fields} computed {computed fields} other {sequence fields}}";
|
|
86
86
|
readonly self_writable_without_ops: "Collection {collection}, field {field}: selfWritable requires a collection that accepts create_self or update_self";
|
|
87
87
|
readonly field_key_reused: "Field \"{label}\": key {key} was a {type} field in a past version (values remain in records, use another key)";
|
|
88
88
|
readonly field_removed: "Remove field \"{label}\" (values are kept and hidden)";
|
|
@@ -114,13 +114,14 @@ export declare const MODEL_PROBLEM_MESSAGES_EN: {
|
|
|
114
114
|
readonly collection_self_ops_removed: "Remove selfOps from collection \"{label}\"";
|
|
115
115
|
readonly collection_retention_shortened: "Set the retention of collection \"{label}\" to {days, number} days (expired records are deleted by the daily cleanup)";
|
|
116
116
|
readonly collection_retention_changed: "Change the retention of collection \"{label}\"";
|
|
117
|
-
readonly
|
|
118
|
-
readonly
|
|
117
|
+
readonly collection_publish_checks_changed: "Change the publish checks of collection \"{label}\"";
|
|
118
|
+
readonly file_fixed: "The fields, format and publishing of collection \"{label}\" are fixed by the product (name and description can be changed)";
|
|
119
|
+
readonly file_not_removable: "Collection \"{label}\" is fixed by the product and cannot be deleted";
|
|
119
120
|
readonly collection_removed: "Delete collection \"{label}\" (records are kept and hidden)";
|
|
120
|
-
readonly
|
|
121
|
+
readonly file_defined: "The fields and format of collection \"{label}\" are defined by the product";
|
|
121
122
|
readonly collection_added: "Add collection \"{label}\"";
|
|
122
123
|
readonly confidential_key_reused: "The key of field {field} was a confidential field ({type}) (values remain in records, use another key)";
|
|
123
|
-
readonly audience_widened: "Widen the audience of field {field} from {from, select, public {public} granted {granted customers} self {self} other {staff}} to {to, select, public {public} granted {granted customers} self {self} other {staff}} (recorded in the
|
|
124
|
+
readonly audience_widened: "Widen the audience of field {field} from {from, select, public {public} granted {granted customers} self {self} other {staff}} to {to, select, public {public} granted {granted customers} self {self} other {staff}} (recorded in the registry)";
|
|
124
125
|
readonly component_removed: "Remove the declaration of body component \"{label}\" (bodies using it are rejected on the next save)";
|
|
125
126
|
readonly component_added: "Declare body component \"{label}\"";
|
|
126
127
|
readonly component_changed: "Change the declaration of body component \"{label}\"";
|