@ryusenkei/maezae 0.15.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -0
- package/dist/body.js +312 -10
- package/dist/{declared-9_jI3JXH.js → declared-Qo-mWnDd.js} +154 -15
- package/dist/delivery.js +26 -2
- package/dist/model.js +1 -1
- package/dist/types/access/src/handoff.d.ts +1 -1
- package/dist/types/analytics/src/index.d.ts +1 -0
- package/dist/types/analytics/src/shared.d.ts +21 -0
- package/dist/types/body/src/derive.d.ts +1 -1
- package/dist/types/body/src/embed.d.ts +14 -0
- package/dist/types/body/src/html.d.ts +31 -0
- package/dist/types/body/src/index.d.ts +5 -2
- package/dist/types/body/src/library.d.ts +19 -0
- package/dist/types/body/src/markdown.d.ts +1 -1
- package/dist/types/body/src/normalize.d.ts +1 -1
- package/dist/types/body/src/profile.d.ts +34 -2
- package/dist/types/body/src/render.d.ts +29 -0
- package/dist/types/body/src/types.d.ts +46 -5
- package/dist/types/cms-contract/src/apiKeys.d.ts +27 -0
- package/dist/types/cms-contract/src/errors.d.ts +5 -3
- package/dist/types/cms-contract/src/import.d.ts +32 -1
- package/dist/types/cms-contract/src/index.d.ts +5 -4
- package/dist/types/cms-contract/src/labels.d.ts +5 -0
- package/dist/types/cms-contract/src/roles.d.ts +3 -1
- package/dist/types/cms-contract/src/views.d.ts +2 -2
- package/dist/types/cms-contract/src/workflow.d.ts +49 -0
- package/dist/types/model/src/index.d.ts +1 -1
- package/dist/types/model/src/model.d.ts +8 -2
- package/dist/types/sdk/src/body.d.ts +2 -2
- package/dist/types/sdk/src/delivery/changes.d.ts +23 -0
- package/dist/types/sdk/src/delivery/client.d.ts +4 -0
- package/dist/types/sdk/src/delivery/index.d.ts +1 -0
- package/dist/types/sdk/src/delivery.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,7 +1,29 @@
|
|
|
1
|
+
/** 鍵の種類 */
|
|
2
|
+
export declare const API_KEY_KINDS: readonly ["server"];
|
|
3
|
+
/** 鍵の種類 */
|
|
4
|
+
export type ApiKeyKind = (typeof API_KEY_KINDS)[number];
|
|
5
|
+
/** 鍵の操作 */
|
|
6
|
+
export declare const API_KEY_OPERATIONS: readonly ["read", "read_drafts", "create", "update", "publish", "delete"];
|
|
7
|
+
/** 鍵の操作 */
|
|
8
|
+
export type ApiKeyOperation = (typeof API_KEY_OPERATIONS)[number];
|
|
9
|
+
/** 書き込みの操作(書き込みの API(#500)まで画面で選べない) */
|
|
10
|
+
export declare const API_KEY_WRITE_OPERATIONS: readonly ["create", "update", "publish", "delete"];
|
|
11
|
+
/** 権限のキーで、すべての型(後から足す型を含む) */
|
|
12
|
+
export declare const API_KEY_ALL_TYPES = "*";
|
|
13
|
+
/** 鍵の権限(キーは型の id か API_KEY_ALL_TYPES) */
|
|
14
|
+
export type ApiKeyPermissions = Readonly<Record<string, readonly ApiKeyOperation[]>>;
|
|
15
|
+
/** 権限を省略した鍵と既存の鍵の権限 */
|
|
16
|
+
export declare const DEFAULT_API_KEY_PERMISSIONS: {
|
|
17
|
+
readonly "*": readonly ["read"];
|
|
18
|
+
};
|
|
19
|
+
/** 鍵の権限が型の操作を許すか(read は read_drafts でも満たす) */
|
|
20
|
+
export declare function apiKeyAllows(permissions: ApiKeyPermissions, type: string, operation: ApiKeyOperation): boolean;
|
|
1
21
|
/** 一覧に表示する API の鍵(tail は鍵の末尾、revokedAt は失効の日時で有効なら null) */
|
|
2
22
|
export type ApiKey = Readonly<{
|
|
3
23
|
id: string;
|
|
4
24
|
label: string;
|
|
25
|
+
kind: ApiKeyKind;
|
|
26
|
+
permissions: ApiKeyPermissions;
|
|
5
27
|
tail: string;
|
|
6
28
|
createdAt: string;
|
|
7
29
|
revokedAt: string | null;
|
|
@@ -11,3 +33,8 @@ export declare const API_KEY_RATE: {
|
|
|
11
33
|
readonly limit: 600;
|
|
12
34
|
readonly period: 60;
|
|
13
35
|
};
|
|
36
|
+
/** 公開のエンドポイントで鍵や媒体の照合に失敗した要求の、接続元の IP ごとの上限(period 秒で limit 回、超えた IP は照合の前に429、platform#45) */
|
|
37
|
+
export declare const PUBLIC_FAILURE_RATE: {
|
|
38
|
+
readonly limit: 30;
|
|
39
|
+
readonly period: 60;
|
|
40
|
+
};
|
|
@@ -20,6 +20,7 @@ export declare const ERROR_STATUS: {
|
|
|
20
20
|
readonly invalid_api_key: 401;
|
|
21
21
|
readonly account_not_found: 403;
|
|
22
22
|
readonly invalid_preview_token: 403;
|
|
23
|
+
readonly api_key_forbidden: 403;
|
|
23
24
|
readonly mcp_not_allowed: 403;
|
|
24
25
|
readonly admin_only: 403;
|
|
25
26
|
readonly forbidden: 403;
|
|
@@ -40,6 +41,7 @@ export declare const ERROR_STATUS: {
|
|
|
40
41
|
readonly article_editing: 409;
|
|
41
42
|
readonly invalid_state: 409;
|
|
42
43
|
readonly unpublish_first: 409;
|
|
44
|
+
readonly cursor_expired: 410;
|
|
43
45
|
readonly body_too_large: 413;
|
|
44
46
|
readonly rate_limited: 429;
|
|
45
47
|
readonly upstream_failed: 502;
|
|
@@ -61,7 +63,7 @@ export type ErrorTarget = 'request' | 'role' | 'media' | 'entry' | 'asset' | 'mc
|
|
|
61
63
|
/** エラーの補足の値(コードごとに使用する項目だけ) */
|
|
62
64
|
export type ErrorParams = {
|
|
63
65
|
/**
|
|
64
|
-
* 対象: not_found・own_only・forbidden・not_visible・no_linked_entry・editorial_only
|
|
66
|
+
* 対象: not_found・own_only・forbidden・not_visible・no_linked_entry・editorial_only・api_key_forbidden
|
|
65
67
|
* - 文字列: モジュールの対象・コンテンツタイプの id
|
|
66
68
|
*/
|
|
67
69
|
target?: ErrorTarget | (string & {});
|
|
@@ -70,9 +72,9 @@ export type ErrorParams = {
|
|
|
70
72
|
/** 使用先: in_use */
|
|
71
73
|
by?: 'uses' | 'places' | 'outputs' | 'entry' | 'writers' | 'members' | 'accounts';
|
|
72
74
|
/** 状態の不一致の理由: invalid_state */
|
|
73
|
-
reason?: 'not_draft' | 'no_draft' | 'not_in_review' | 'request_handled' | 'deleted' | 'not_deleted' | 'schema_confirm' | 'no_publishing' | 'no_review';
|
|
75
|
+
reason?: 'not_draft' | 'no_draft' | 'not_in_review' | 'request_handled' | 'deleted' | 'not_deleted' | 'schema_confirm' | 'no_publishing' | 'no_review' | 'not_published';
|
|
74
76
|
/** 取得の対象: upstream_failed */
|
|
75
|
-
resource?: 'page' | 'image' | 'webhook';
|
|
77
|
+
resource?: 'page' | 'image' | 'webhook' | 'microcms';
|
|
76
78
|
/**
|
|
77
79
|
* 名前
|
|
78
80
|
* - no_linked_entry: 結び付くコンテンツタイプの表示名、account_not_found: メールアドレス
|
|
@@ -36,7 +36,7 @@ export type ImportItemReport = Readonly<{
|
|
|
36
36
|
source: string;
|
|
37
37
|
type: string;
|
|
38
38
|
id: string | null;
|
|
39
|
-
status: 'created' | 'ready' | 'skipped';
|
|
39
|
+
status: 'created' | 'updated' | 'ready' | 'skipped';
|
|
40
40
|
problems: readonly ImportProblem[];
|
|
41
41
|
}>;
|
|
42
42
|
/** 画像の結果(checked は試しの実行で取得できた、asset は保存した画像の ID) */
|
|
@@ -71,6 +71,7 @@ export type ImportReport = Readonly<{
|
|
|
71
71
|
summary: Readonly<{
|
|
72
72
|
items: number;
|
|
73
73
|
created: number;
|
|
74
|
+
updated: number;
|
|
74
75
|
ready: number;
|
|
75
76
|
skipped: number;
|
|
76
77
|
images: Readonly<Record<ImportImage['status'], number>>;
|
|
@@ -99,3 +100,33 @@ export declare const sourceOf: (item: ImportItem, index: number) => string;
|
|
|
99
100
|
export declare function importReportOf(dryRun: boolean, parts: Omit<ImportReport, 'dryRun' | 'summary'>): ImportReport;
|
|
100
101
|
/** 分けて送った取り込みの報告を1つに(同じ URL の画像は先の結果) */
|
|
101
102
|
export declare function mergeImportReports(dryRun: boolean, reports: readonly ImportReport[], extra?: Partial<Omit<ImportReport, 'dryRun' | 'summary'>>): ImportReport;
|
|
103
|
+
/** microCMS から取り込む API(schema は API のスキーマの JSON、relations は関係の項目の fieldId と先のエンドポイント) */
|
|
104
|
+
export type MicroCmsApiInput = Readonly<{
|
|
105
|
+
endpoint: string;
|
|
106
|
+
label: string;
|
|
107
|
+
format: 'list' | 'object';
|
|
108
|
+
schema: unknown;
|
|
109
|
+
relations: Readonly<Record<string, string>>;
|
|
110
|
+
}>;
|
|
111
|
+
/** microCMS の型の変換の注意(path は型の id と項目) */
|
|
112
|
+
export type MicroCmsNote = Readonly<{
|
|
113
|
+
level: 'error' | 'warning';
|
|
114
|
+
path: string;
|
|
115
|
+
message: string;
|
|
116
|
+
}>;
|
|
117
|
+
/** 本文の変換で捨てたもの(what は要素・属性・style の項目・class) */
|
|
118
|
+
export type MicroCmsDropped = Readonly<{
|
|
119
|
+
what: string;
|
|
120
|
+
count: number;
|
|
121
|
+
}>;
|
|
122
|
+
/** microCMS のコンテンツの1ページの取り込みの結果(next は次のページの offset、なしは終わり、tooLarge は大きすぎて残さなかった元の HTML) */
|
|
123
|
+
export type MicroCmsContentResult = Readonly<{
|
|
124
|
+
report: ImportReport;
|
|
125
|
+
total: number;
|
|
126
|
+
next: number | null;
|
|
127
|
+
dropped: readonly MicroCmsDropped[];
|
|
128
|
+
tooLarge: readonly Readonly<{
|
|
129
|
+
id: string;
|
|
130
|
+
field: string;
|
|
131
|
+
}>[];
|
|
132
|
+
}>;
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
export { API_KEY_RATE, type ApiKey } from './apiKeys.js';
|
|
1
|
+
export { API_KEY_ALL_TYPES, API_KEY_KINDS, API_KEY_OPERATIONS, API_KEY_RATE, API_KEY_WRITE_OPERATIONS, PUBLIC_FAILURE_RATE, apiKeyAllows, type ApiKey, type ApiKeyKind, type ApiKeyOperation, type ApiKeyPermissions, DEFAULT_API_KEY_PERMISSIONS } from './apiKeys.js';
|
|
2
2
|
export { ASSET_BULK_MAX, ASSET_IMAGE_TYPES, ASSET_SIZE_MAX } from './assets.js';
|
|
3
3
|
export { errorLabel, errorTitle, mergeMessages, TARGET_LABELS, targetOf, type TargetMessages } from './errorLabels.js';
|
|
4
4
|
export { ERROR_STATUS, JSON_BODY_MAX, type ErrorBody, type ErrorCode, type ErrorParams, type ErrorTarget } from './errors.js';
|
|
5
|
-
export { STATUS } from './labels.js';
|
|
5
|
+
export { CHANGES_LABELS, STATUS } from './labels.js';
|
|
6
6
|
export { ANALYTICS_MODULE, BUILTIN_MODULES, OG_FONTS, OG_MODULE, type OgFont, type OgSettings } from './builtins.js';
|
|
7
7
|
export { type CalendarField, calendarFieldSource, type CalendarItem, type ExtensionState, type ExtensionUpdate, fieldOwnersOf, type PendingItem, permissionTargetsOf } from './extensions.js';
|
|
8
8
|
export { type CallApi, type ConnectionPoint, type ContentTypePoint, createModules, type FieldRef, type McpModule, type McpModuleContext, type McpParts, type McpTool, type ModuleAbout, type ModuleBase, moduleBaseOf, type ModuleContext, type ModuleInstance, type ModuleManifest, type ModuleSettingsInput, type ModuleSide, moduleTargetsOf, type PermissionTarget, type SettingField } from './modules.js';
|
|
9
9
|
export { applyFieldRules, autoFieldsOf, type FieldRule, hiddenFieldsOf, restrictedChoicesOf, restrictedProblemsOf } from './fieldRules.js';
|
|
10
10
|
export { pendingIds, pendingValue } from './pending.js';
|
|
11
11
|
export { type AccountLink, type Action, ACTION_LEVELS, ACTIONS, allows, ANY_TARGET, canChangeRow, canDeleteContent, canEditContent, canPublishContent, canReadContent, canReadRow, canSubmitContent, checkPermissions, type ContentAccess, type Level, LEVELS, levelOf, ownsContent, ownsRow, type Permissions, type RowAccess } from './permissions.js';
|
|
12
|
-
export { ADMIN_PERMISSIONS, ADMIN_ROLE, isAdmin, rolePermissionsOf, type Role, SYSTEM_ROLES, type User, WRITER_ROLE } from './roles.js';
|
|
12
|
+
export { ADMIN_PERMISSIONS, ADMIN_ROLE, defaultRoleOf, isAdmin, rolePermissionsOf, type Role, SYSTEM_ROLES, type User, WRITER_ROLE } from './roles.js';
|
|
13
13
|
export { isServerPath, OPS_PATHS, SERVER_PATHS } from './paths.js';
|
|
14
14
|
export { CONFIG_FORMAT, type ConfigBundle, type ConfigPreview } from './transfer.js';
|
|
15
|
-
export { IMPORT_ITEMS_MAX, IMPORT_PROBLEM_LABELS, IMPORT_PROBLEMS, type ImportIdChange, type ImportIdConflict, importIdOf, type ImportIdPlan, type ImportImage, type ImportItem, type ImportItemReport, type ImportProblem, type ImportProblemCode, type ImportReport, importReportOf, mergeImportReports, planImportIds, sourceOf } from './import.js';
|
|
15
|
+
export { IMPORT_ITEMS_MAX, IMPORT_PROBLEM_LABELS, IMPORT_PROBLEMS, type ImportIdChange, type ImportIdConflict, importIdOf, type ImportIdPlan, type ImportImage, type ImportItem, type ImportItemReport, type ImportProblem, type ImportProblemCode, type ImportReport, importReportOf, mergeImportReports, type MicroCmsApiInput, type MicroCmsContentResult, type MicroCmsDropped, type MicroCmsNote, planImportIds, sourceOf } from './import.js';
|
|
16
16
|
export { EMBED_CONTEXT_NEXT_PARAM, EMBED_CONTEXT_PARAM, EMBED_CONTEXT_TTL_SEC, EMBED_MESSAGES, EMBED_PLACEMENTS, type EmbedContext, type EmbedEntry, type EmbedMessage, type EmbedPlacement, type ExternalScreen } from './embeds.js';
|
|
17
17
|
export { type ExternalFunction, FUNCTION_HOOK_LABELS, FUNCTION_HOOKS, functionEventLabel, functionEventOf, type FunctionHook, type FunctionOnError, type FunctionRequest, type PublishCheckRequest, type PublishCheckResponse, type SaveCheckRequest, type SaveCheckResponse } from './functions.js';
|
|
18
18
|
export { isWebhookAction, parseWebhookEvent, type Webhook, WEBHOOK_ACTION_LABELS, type WebhookBody, WEBHOOK_ACTIONS, type WebhookAction, type WebhookDelivery, type WebhookEvent, webhookEventLabel, webhookEventOf, type WebhookKind, type WebhookModuleBody, type WebhookSubscription, webhookSubscriptionLabel, WEBHOOK_VERSION, type WebhookVersion } from './webhooks.js';
|
|
19
19
|
export { CONTRACT_VERSION_HEADER, DELIVERY_VERSION } from './versions.js';
|
|
20
20
|
export { type SavedView, VIEW_ACTIONS, type ViewAction, type ViewDefinition } from './views.js';
|
|
21
|
+
export { ENTRY_ACTIONS, ENTRY_STATES, type EntryAction, entryActions, type EntryChanges, entryGuard, type EntryGuard, type EntryGuardInput, type EntryRow, type EntryState, entryStateOf, isLiveState, type WorkflowPublishing } from './workflow.js';
|
|
21
22
|
export { canManageSettings, isSettingsTarget, managedAreasOf, SETTINGS_AREA_LABELS, SETTINGS_AREAS, type SettingsArea, settingsTarget } from './settings.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type AccountLink, type Permissions } from './permissions.js';
|
|
2
2
|
/** 管理者のロールの ID */
|
|
3
3
|
export declare const ADMIN_ROLE = "admin";
|
|
4
|
-
/** ライターのロールの ID
|
|
4
|
+
/** ライターのロールの ID(あれば新しいアカウントの既定、削除できる) */
|
|
5
5
|
export declare const WRITER_ROLE = "writer";
|
|
6
6
|
/** 管理者の権限の表(すべての対象・操作が可、DB の値より優先) */
|
|
7
7
|
export declare const ADMIN_PERMISSIONS: Permissions;
|
|
@@ -9,6 +9,8 @@ export declare const ADMIN_PERMISSIONS: Permissions;
|
|
|
9
9
|
export declare const rolePermissionsOf: (roleId: string, stored: Permissions) => Permissions;
|
|
10
10
|
/** 削除できないロールの ID */
|
|
11
11
|
export declare const SYSTEM_ROLES: readonly string[];
|
|
12
|
+
/** 新しいアカウントの既定のロール(ライター、なければ管理者以外の最初のロール、それもなければ管理者) */
|
|
13
|
+
export declare const defaultRoleOf: (roles: readonly Pick<Role, "id">[]) => string;
|
|
12
14
|
/** ロール(API /api/roles の行) */
|
|
13
15
|
export type Role = Readonly<{
|
|
14
16
|
id: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export declare const VIEW_ACTIONS: readonly ["assign", "publish"];
|
|
1
|
+
/** ビューで許可できる一括操作(名前は行の操作 workflow.ts の EntryAction と同じ、assign は担当者の割り当て) */
|
|
2
|
+
export declare const VIEW_ACTIONS: readonly ["assign", "submit", "publish", "unpublish", "delete"];
|
|
3
3
|
/** ビューで許可できる一括操作 */
|
|
4
4
|
export type ViewAction = (typeof VIEW_ACTIONS)[number];
|
|
5
5
|
/** ビューの内容(filters は列の id ごとの絞り込みの値、query は検索の文、columns は表示する列、editable は一覧で編集する列) */
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ErrorCode, ErrorParams } from './errors.js';
|
|
2
|
+
import { type ContentAccess } from './permissions.js';
|
|
3
|
+
import type { User } from './roles.js';
|
|
4
|
+
/** 型の公開の管理(model の Publishing と同じ値) */
|
|
5
|
+
export type WorkflowPublishing = 'none' | 'draft' | 'review';
|
|
6
|
+
/** 行の派生の状態 */
|
|
7
|
+
export declare const ENTRY_STATES: readonly ["draft", "returned", "review", "scheduled", "published"];
|
|
8
|
+
export type EntryState = (typeof ENTRY_STATES)[number];
|
|
9
|
+
/** 公開中・予約の行の未公開の変更(none はなし、review はレビュー待ち) */
|
|
10
|
+
export type EntryChanges = 'none' | 'draft' | 'review';
|
|
11
|
+
/** 行の操作(publish は公開・予約・再公開・変更の公開、unpublish は下書きに戻す・予約の取り消し、discard は未公開の変更の破棄) */
|
|
12
|
+
export declare const ENTRY_ACTIONS: readonly ["save", "submit", "reject", "publish", "unpublish", "discard", "delete", "assign"];
|
|
13
|
+
export type EntryAction = (typeof ENTRY_ACTIONS)[number];
|
|
14
|
+
/** 判定に使う行の値(API の形: has_draft・draft_status は未公開の変更、持ち主の項目と created_by を含む) */
|
|
15
|
+
export type EntryRow = ContentAccess & Readonly<{
|
|
16
|
+
published_at?: unknown;
|
|
17
|
+
review_note?: unknown;
|
|
18
|
+
has_draft?: unknown;
|
|
19
|
+
draft_status?: unknown;
|
|
20
|
+
}>;
|
|
21
|
+
type Subject = Pick<User, 'permissions' | 'id' | 'entryId' | 'link'>;
|
|
22
|
+
/** 判定の材料(target は型の id、now は ISO の日時) */
|
|
23
|
+
export type EntryGuardInput = Readonly<{
|
|
24
|
+
publishing: WorkflowPublishing;
|
|
25
|
+
user: Subject;
|
|
26
|
+
target: string;
|
|
27
|
+
row: EntryRow;
|
|
28
|
+
now: string;
|
|
29
|
+
}>;
|
|
30
|
+
/** 判定の結果(拒否はエラーのコードと引数) */
|
|
31
|
+
export type EntryGuard = {
|
|
32
|
+
ok: true;
|
|
33
|
+
} | {
|
|
34
|
+
ok: false;
|
|
35
|
+
code: Exclude<ErrorCode, 'network_error'>;
|
|
36
|
+
params?: ErrorParams;
|
|
37
|
+
};
|
|
38
|
+
/** 行の派生の状態と未公開の変更 */
|
|
39
|
+
export declare function entryStateOf(row: EntryRow, now: string): {
|
|
40
|
+
state: EntryState;
|
|
41
|
+
changes: EntryChanges;
|
|
42
|
+
};
|
|
43
|
+
/** 公開中か予約の状態か */
|
|
44
|
+
export declare const isLiveState: (state: EntryState) => boolean;
|
|
45
|
+
/** 行の操作の可否 */
|
|
46
|
+
export declare function entryGuard({ publishing, user, target, row, now }: EntryGuardInput, action: EntryAction): EntryGuard;
|
|
47
|
+
/** 行に許される操作(ENTRY_ACTIONS の順) */
|
|
48
|
+
export declare const entryActions: (input: EntryGuardInput) => EntryAction[];
|
|
49
|
+
export {};
|
|
@@ -8,7 +8,7 @@ export { dateRoleFieldsOf, primaryTypeOf, requiredPrimaryTypeOf, SOURCES_FIELD,
|
|
|
8
8
|
export { appliesTo, checkFields, fieldsFor } from './check.js';
|
|
9
9
|
export { deliveredFields, emptyValues, pickValues, referencedIds, referencesOf, valueFieldsOf } from './values.js';
|
|
10
10
|
export { entryRefsOf, type EntryRef } from './refs.js';
|
|
11
|
-
export { acceptsRole, bodyFieldsOf, computedFieldsOf, FIELD_ROLES, idInputOf, initialValueOf, isEditorial, isInputField, isListType, isMediaType, isSingleton, isStoredType, MEDIA_TYPE_IDS, optionLabelOf, optionsOf, publishingOf, requestReferencesOf, resolvedRolesOf, roleFieldOf, toneOf, typeOf, type ComputedKind, type FieldRole, type FieldRoles, type FieldComputed, 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';
|
|
11
|
+
export { acceptsRole, bodyFieldsOf, computedFieldsOf, FIELD_ROLES, idInputOf, initialValueOf, isEditorial, isInputField, isListType, isMediaType, isSingleton, isStoredType, MEDIA_TYPE_IDS, optionLabelOf, optionsOf, publishingOf, requestReferencesOf, resolvedRolesOf, roleFieldOf, toneOf, typeOf, type ComputedKind, type FieldRole, type FieldRoles, type FieldComputed, 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, usesReview } from './model.js';
|
|
12
12
|
export { hasPublicPage, imageFrameOf, pagePathOf, publicPathOf, withPagesFrom, type ImageFrame, type ImageFrameDef, type PageDef, type PageEntry, type PageRule } from './page.js';
|
|
13
13
|
export { schemaRulesOf, type SchemaRule } from './rules.js';
|
|
14
14
|
export { parseModel } from './schema.js';
|
|
@@ -178,10 +178,16 @@ export declare const publishingOf: (type: ContentType) => Publishing;
|
|
|
178
178
|
export declare const isListType: (type: ContentType) => boolean;
|
|
179
179
|
/**
|
|
180
180
|
* 編集の機能を持つ型か(公開の管理がある一覧の型)
|
|
181
|
-
* - 機能:
|
|
182
|
-
* -
|
|
181
|
+
* - 機能: 版・楽観ロック・編集中のリース・コメント・公開の前の点検
|
|
182
|
+
* - 提出と差し戻し・担当者: レビューありの型だけ(usesReview)
|
|
183
183
|
*/
|
|
184
184
|
export declare const isEditorial: (type: ContentType) => boolean;
|
|
185
|
+
/**
|
|
186
|
+
* レビューのワークフローを持つ型か(レビューありの一覧の型)
|
|
187
|
+
* - 機能: 提出と差し戻し・担当者(レビューを担当するアカウント)
|
|
188
|
+
* - 下書きと公開の型: 担当者の表示・割り当て・一括の割り当てを出さない
|
|
189
|
+
*/
|
|
190
|
+
export declare const usesReview: (type: ContentType) => boolean;
|
|
185
191
|
/** 型の行を表 entries に保存するか(メディアの型を除くすべて) */
|
|
186
192
|
export declare const isStoredType: (type: ContentType) => boolean;
|
|
187
193
|
/** コンテンツスキーマの型(id から、なければ例外: 導入先の設定の誤り) */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { blockSchemaOf, citesOf, DESCRIPTION_MAX, descriptionOf, excerptOf, isSafeHref, linksOf, plainOf, READING_SPEED, readMinOf } from '../../body/src/index.js';
|
|
2
|
-
export type { Block, Body, BodyProfile, ComponentBlock, DeclaredComponent, HeadingLevel, Inline, InlineComponent, Link, List, ListItem, Mark, PropSchema, PropsSchema, PropType, Rich, StandardBlock, Text } from '../../body/src/index.js';
|
|
1
|
+
export { blockSchemaOf, bodyToHtml, cellParagraphs, citesOf, DESCRIPTION_MAX, descriptionOf, EMBED_PROVIDERS, embedOfUrl, embedSrcOf, excerptOf, isSafeCssValue, isSafeHref, isTableCell, linksOf, plainOf, READING_SPEED, readMinOf } from '../../body/src/index.js';
|
|
2
|
+
export type { Align, Block, Body, BodyProfile, Cell, ComponentBlock, DeclaredComponent, EmbedProvider, EmbedTarget, HeadingLevel, ImageAlign, Inline, InlineComponent, Link, List, ListItem, Mark, Named, NamedStyle, NamedValue, PropSchema, PropsSchema, PropType, RenderedImage, RenderOptions, Rich, StandardBlock, TableCell, Text, TextStyle } from '../../body/src/index.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { DeliveryClient } from './client.js';
|
|
2
|
+
/** 変更の一覧の1件(at は配信 API に現れた日時、`ISO 8601` の UTC) */
|
|
3
|
+
export type Change = Readonly<{
|
|
4
|
+
type: string;
|
|
5
|
+
id: string;
|
|
6
|
+
change: 'upsert' | 'delete';
|
|
7
|
+
event: 'created' | 'updated' | 'deleted' | 'published' | 'unpublished' | 'snapshot';
|
|
8
|
+
at: string;
|
|
9
|
+
}>;
|
|
10
|
+
/** 変更の一覧の1ページ */
|
|
11
|
+
export type ChangesPage = Readonly<{
|
|
12
|
+
changes: readonly Change[];
|
|
13
|
+
next: string;
|
|
14
|
+
more: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* since から more がなくなるまで読み、ページごとに apply を呼ぶ(戻り値は次回の since)
|
|
18
|
+
* - apply が成功してから次のページへ進む(失敗したら例外で止まり、保存済みの since から再開できる)
|
|
19
|
+
* - 410(保存の期間を過ぎた cursor): DeliveryError、since を null にして全件から取り直す
|
|
20
|
+
*/
|
|
21
|
+
export declare function readChanges(client: Pick<DeliveryClient, 'changes'>, since: string | null, apply: (page: ChangesPage) => Promise<void> | void, { limit }?: {
|
|
22
|
+
limit?: number;
|
|
23
|
+
}): Promise<string>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ContentType } from '../../../model/src/index.js';
|
|
2
2
|
import { type ListQuery, type Page } from './query.js';
|
|
3
|
+
import type { ChangesPage } from './changes.js';
|
|
3
4
|
/** 配信 API のパスの前半 */
|
|
4
5
|
export declare const DELIVERY_PATH = "/content/v1";
|
|
5
6
|
/** 配信 API への接続(path は /content/v1 から始まるパスとクエリ) */
|
|
@@ -57,6 +58,9 @@ export declare function createDeliveryClient(delivery: Delivery, { drafts, at }?
|
|
|
57
58
|
prefetch: (paths: readonly string[], { ifNoneMatch }?: {
|
|
58
59
|
ifNoneMatch?: string;
|
|
59
60
|
}) => Promise<Prefetched>;
|
|
61
|
+
changes: (since: string | null, { limit }?: {
|
|
62
|
+
limit?: number;
|
|
63
|
+
}) => Promise<ChangesPage>;
|
|
60
64
|
};
|
|
61
65
|
/** 配信 API の読み取り(createDeliveryClient の戻り値) */
|
|
62
66
|
export type DeliveryClient = ReturnType<typeof createDeliveryClient>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { cachedDelivery, memoryDeliveryCache, type DeliveryCache } from './cache.js';
|
|
2
|
+
export { readChanges, type Change, type ChangesPage } from './changes.js';
|
|
2
3
|
export { createDeliveryClient, DELIVERY_PATH, DeliveryError, subPath, type BundleResult, type Delivery, type DeliveryClient, type Prefetched } from './client.js';
|
|
3
4
|
export { deliveredImageUrl, mediaOf, type ImageUrl, type MediaOf } from './media.js';
|
|
4
5
|
export { imageParamsOf, parseMediaPath, withImageParams, type ImageParams, type MediaPath } from '../../../model/src/index.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { cachedDelivery, createDeliveryClient, createDeliveryClock, deliveredImageUrl, DELIVERY_PATH, DeliveryError, fieldOf, imageParamsOf, limitOf, listParams, mediaOf, memoryDeliveryCache, optionLabels, pagePath, parseMediaPath, subPath, withImageParams } from './delivery/index.js';
|
|
2
|
-
export type { BundleResult, DeliveredAsset, Delivery, DeliveryCache, DeliveryClient, DeliveryClock, FieldValue, ImageParams, ImageUrl, Item, ItemMeta, ItemOf, FieldPath, ListFilter, ListQuery, MediaOf, MediaPath, Page, Prefetched, Selected } from './delivery/index.js';
|
|
1
|
+
export { cachedDelivery, createDeliveryClient, createDeliveryClock, deliveredImageUrl, DELIVERY_PATH, DeliveryError, fieldOf, imageParamsOf, limitOf, listParams, mediaOf, memoryDeliveryCache, optionLabels, pagePath, parseMediaPath, readChanges, subPath, withImageParams } from './delivery/index.js';
|
|
2
|
+
export type { BundleResult, Change, ChangesPage, DeliveredAsset, Delivery, DeliveryCache, DeliveryClient, DeliveryClock, FieldValue, ImageParams, ImageUrl, Item, ItemMeta, ItemOf, FieldPath, ListFilter, ListQuery, MediaOf, MediaPath, Page, Prefetched, Selected } from './delivery/index.js';
|