@ryusenkei/maezae 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/model.js
CHANGED
|
@@ -358,7 +358,8 @@ const contentType = z.object({
|
|
|
358
358
|
from: key,
|
|
359
359
|
field: fieldKey
|
|
360
360
|
})).optional(),
|
|
361
|
-
og: z.string().startsWith("/", "OG 画像の雛形は / で始まる").optional()
|
|
361
|
+
og: z.string().startsWith("/", "OG 画像の雛形は / で始まる").optional(),
|
|
362
|
+
idInput: z.boolean().optional()
|
|
362
363
|
}).refine((t) => t.format !== "object" || !t.core?.length, { message: "オブジェクト形式の型はコアの項目なし" }).refine((t) => new Set([...t.core ?? [], ...t.fields].map((f) => f.key)).size === (t.core?.length ?? 0) + t.fields.length, { message: "項目の key が重複(コアの項目を含む)" }).refine((t) => conditionsValid([...t.core ?? [], ...t.fields]), { message: "項目の条件が同じ階層の選択肢の項目と値を指していない" }).refine((t) => (t.pages ?? []).every((p) => conditionValid(p.when, [...t.core ?? [], ...t.fields])), { message: "ページの条件が型の選択肢の項目と値を指していない" }).superRefine((t, ctx) => {
|
|
363
364
|
for (const k of reservedKeysOf(t)) ctx.addIssue({
|
|
364
365
|
code: "custom",
|
|
@@ -51,6 +51,7 @@ export declare function createDeliveryClient(delivery: Delivery, { drafts, at }?
|
|
|
51
51
|
pages?: readonly import("../../model/src/index.js").PageDef[];
|
|
52
52
|
counts?: readonly import("../../model/src/index.js").CountDef[];
|
|
53
53
|
og?: string;
|
|
54
|
+
idInput?: boolean;
|
|
54
55
|
}>>(path: string, query: ListQuery<T> & Readonly<{
|
|
55
56
|
limit: number;
|
|
56
57
|
}>) => Promise<Page<I>>;
|
|
@@ -6,7 +6,7 @@ export { diffSchema, withFixed, type ChangeKind, type ChangeLevel, type DiffOpti
|
|
|
6
6
|
export { requiredTypeWithTrait, tableTraitsOf, typeWithTrait, type TableTraits } from './capabilities.js';
|
|
7
7
|
export { appliesTo, checkFields, fieldsFor } from './check.js';
|
|
8
8
|
export { deliveredFields, emptyValues, pickValues, referencedIds, referencesOf, valueFieldsOf } from './values.js';
|
|
9
|
-
export { imageFieldOf, initialValueOf, isEditorial, isEntryType, isListType, isSingleton, optionLabelOf, optionsOf, publishingOf, requestReferencesOf, tableOf, titleFieldOf, toneOf, typeOf, type ContentFormat, type ContentModel, type ContentType, type FieldCondition, type FieldDef, type FieldDerive, type FieldFixedBy, type CountDef, type FieldProblem, type MediaKind, type OptionTone, type Publishing, type ReferenceRules, type SelectOption } from './model.js';
|
|
9
|
+
export { idInputOf, imageFieldOf, initialValueOf, isEditorial, isEntryType, isListType, isSingleton, optionLabelOf, optionsOf, publishingOf, requestReferencesOf, tableOf, titleFieldOf, toneOf, typeOf, type ContentFormat, type ContentModel, type ContentType, type FieldCondition, type FieldDef, type FieldDerive, type FieldFixedBy, type CountDef, type FieldProblem, type MediaKind, type OptionTone, type Publishing, type ReferenceRules, type SelectOption } from './model.js';
|
|
10
10
|
export { hasPublicPage, imageFrameOf, pagePathOf, publicPathOf, type ImageFrame, type ImageFrameDef, type PageDef, type PageEntry, type PageRule } from './page.js';
|
|
11
11
|
export { schemaRulesOf, type SchemaRule } from './rules.js';
|
|
12
12
|
export { parseModel } from './schema.js';
|
|
@@ -129,6 +129,7 @@ export type Publishing = 'none' | 'draft' | 'review';
|
|
|
129
129
|
* コンテンツタイプ
|
|
130
130
|
* - counts: 被参照の件数(ページの公開中の条件・ページの公開で必須の判定に使用)
|
|
131
131
|
* - og: サイトの OG 画像のパスの雛形({key} は行の値、管理画面の OG 画像のプレビュー)
|
|
132
|
+
* - idInput: 作成のときに管理画面で ID を入力できる(汎用の型だけ、ページのある型は常に入力可、空欄は自動)
|
|
132
133
|
*/
|
|
133
134
|
export type ContentType = Readonly<{
|
|
134
135
|
id: string;
|
|
@@ -142,6 +143,7 @@ export type ContentType = Readonly<{
|
|
|
142
143
|
pages?: readonly PageDef[];
|
|
143
144
|
counts?: readonly CountDef[];
|
|
144
145
|
og?: string;
|
|
146
|
+
idInput?: boolean;
|
|
145
147
|
}>;
|
|
146
148
|
/** コンテンツスキーマ(導入先ごとに1つ) */
|
|
147
149
|
export type ContentModel = Readonly<{
|
|
@@ -155,6 +157,8 @@ export type FieldProblem = Readonly<{
|
|
|
155
157
|
}>;
|
|
156
158
|
/** 汎用の表 entries に保存する型か(コアの項目がない型、コアの項目がある型は専用の表) */
|
|
157
159
|
export declare const isEntryType: (type: ContentType) => boolean;
|
|
160
|
+
/** 作成のときに ID を入力できる型か(汎用の型で、宣言 idInput かページを持つ型) */
|
|
161
|
+
export declare const idInputOf: (type: ContentType) => boolean;
|
|
158
162
|
/** オブジェクト形式の型か(行は表 entries の id が型の id の1行、一覧・作成の対象外) */
|
|
159
163
|
export declare const isSingleton: (type: ContentType) => boolean;
|
|
160
164
|
/** 公開の管理(なしは none) */
|