@ryusenkei/maezae 0.9.0 → 0.10.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 +25 -0
- package/dist/dev.js +1 -1
- package/dist/integrations.js +14 -2
- package/dist/preview.js +1 -1
- package/dist/{src-Baj-EC2G.js → src-C6YqllXw.js} +28 -17
- package/dist/trace.js +1 -1
- package/dist/types/access/src/index.d.ts +1 -1
- package/dist/types/access/src/signed.d.ts +11 -9
- package/dist/types/cms-contract/src/embeds.d.ts +4 -1
- package/dist/types/cms-contract/src/errors.d.ts +1 -1
- package/dist/types/cms-contract/src/functions.d.ts +6 -1
- package/dist/types/cms-contract/src/index.d.ts +1 -1
- package/dist/types/cms-contract/src/webhooks.d.ts +6 -1
- package/dist/types/model/src/capabilities.d.ts +5 -0
- package/dist/types/model/src/index.d.ts +1 -1
- package/dist/types/sdk/src/integrations.d.ts +6 -2
- package/dist/types/sdk/src/preview.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,3 +53,28 @@ const body = (await request.json()) as PublishCheckRequest;
|
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
- Webhook の重複: 失敗した送信は同じ本文で再送する。本文の `id`(イベントの ID)を処理済みとして保存し、同じ `id` は処理せずに 2xx を返す
|
|
56
|
+
|
|
57
|
+
## 外の画面の受け手
|
|
58
|
+
|
|
59
|
+
- 鍵: 媒体の管理画面の「設定 → 連携」の外の画面の登録ごとの署名の鍵
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
import { openEmbedContext } from '@ryusenkei/maezae/integrations';
|
|
63
|
+
|
|
64
|
+
const context = await openEmbedContext(env.CMS_SCREEN_SECRET, request.url);
|
|
65
|
+
if (!context) return new Response(null, { status: 401 });
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 署名の鍵の再発行(止めずに差し替える)
|
|
69
|
+
|
|
70
|
+
- 対象: Webhook・外の関数・外の画面の登録ごとの鍵と、プレビューの署名の鍵
|
|
71
|
+
- 移行の期間: 管理画面で「鍵を再発行」してから「古い鍵を失効」するまで、新旧の鍵の両方が有効
|
|
72
|
+
- Webhook・外の関数・プレビュー: CMS は署名のヘッダーに新旧の鍵の `v1` を並べる(新しい鍵が先、古い鍵が最後)
|
|
73
|
+
- 外の画面: クエリ `ctx` は古い鍵、`ctx_next` は新しい鍵で封印
|
|
74
|
+
- 古い SDK(0.10.0 より前): 古い鍵の署名だけを照合するため、古い鍵のままなら移行の期間も通る
|
|
75
|
+
- 導入先の手順
|
|
76
|
+
1. SDK を 0.10.0 以上にしてデプロイ(照合は `verifyRequest`、外の画面は `openEmbedContext`)
|
|
77
|
+
2. 管理画面で「鍵を再発行」し、表示された新しい鍵を受け手の秘密値(例: `CMS_FUNCTION_SECRET`)に設定してデプロイ
|
|
78
|
+
3. 管理画面の「送信の記録」で、差し替えの後の送信が成功していることを確かめる
|
|
79
|
+
4. 管理画面で「古い鍵を失効」
|
|
80
|
+
- 受け手が新旧の鍵を並べて持つこともできる: `verifyRequest([env.NEW_SECRET, env.OLD_SECRET], request, …)`
|
package/dist/dev.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as SIGNED_HEADERS, s as signedHeaders } from "./src-
|
|
1
|
+
import { i as SIGNED_HEADERS, s as signedHeaders } from "./src-C6YqllXw.js";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import { createServer } from "node:http";
|
package/dist/integrations.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { a as openValue, i as SIGNED_HEADERS, l as verifyRequest } from "./src-
|
|
1
|
+
import { a as openValue, i as SIGNED_HEADERS, l as verifyRequest } from "./src-C6YqllXw.js";
|
|
2
2
|
import "./src-BrLwIWaT.js";
|
|
3
3
|
// ../cms-contract/src/embeds.ts
|
|
4
4
|
/** URL のクエリの名前(署名つきの文脈) */
|
|
5
5
|
const EMBED_CONTEXT_PARAM = "ctx";
|
|
6
|
+
/** URL のクエリの名前(鍵の移行の期間だけ、新しい鍵で封印した文脈) */
|
|
7
|
+
const EMBED_CONTEXT_NEXT_PARAM = "ctx_next";
|
|
6
8
|
/** postMessage の種類 */
|
|
7
9
|
const EMBED_MESSAGES = {
|
|
8
10
|
ready: "maezae:ready",
|
|
@@ -13,4 +15,14 @@ const EMBED_MESSAGES = {
|
|
|
13
15
|
// ../cms-contract/src/functions.ts
|
|
14
16
|
/** 依頼する時点(save_check は型の保存前、publish_check は提出・公開の前の検査) */
|
|
15
17
|
const FUNCTION_HOOKS = ["save_check", "publish_check"];
|
|
16
|
-
|
|
18
|
+
// src/integrations.ts
|
|
19
|
+
/** 外の画面の URL の文脈(クエリ ctx と、鍵の移行の期間の ctx_next のどちらかが鍵で開けば文脈、なければ null) */
|
|
20
|
+
async function openEmbedContext(secret, url, now = Date.now()) {
|
|
21
|
+
const params = new URL(url).searchParams;
|
|
22
|
+
for (const name of [EMBED_CONTEXT_NEXT_PARAM, "ctx"]) {
|
|
23
|
+
const context = await openValue(secret, params.get(name), now);
|
|
24
|
+
if (context) return context;
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
export { EMBED_CONTEXT_NEXT_PARAM, EMBED_CONTEXT_PARAM, EMBED_MESSAGES, FUNCTION_HOOKS, SIGNED_HEADERS, openEmbedContext, openValue, verifyRequest };
|
package/dist/preview.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { i as SIGNED_HEADERS, o as signParts, s as signedHeaders, c as verifyParts, l as verifyRequest } from "./src-
|
|
1
|
+
export { i as SIGNED_HEADERS, o as signParts, s as signedHeaders, c as verifyParts, l as verifyRequest } from "./src-C6YqllXw.js";
|
|
@@ -56,23 +56,31 @@ async function messageOf(t, { method, url, body, subject }) {
|
|
|
56
56
|
digest
|
|
57
57
|
].join("\n"));
|
|
58
58
|
}
|
|
59
|
-
/**
|
|
59
|
+
/** 鍵の一覧(空の値を除く) */
|
|
60
|
+
const secretsOf = (secret) => (typeof secret === "string" ? [secret] : [...secret ?? []]).filter(Boolean);
|
|
61
|
+
/** 署名のヘッダーの値(t=<秒>,v1=<署名>、鍵が複数なら v1 を鍵の順に並べる) */
|
|
60
62
|
async function signParts(secret, parts, now = Date.now()) {
|
|
61
63
|
const t = Math.floor(now / 1e3);
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
+
const message = await messageOf(t, parts);
|
|
65
|
+
const sigs = await Promise.all(secretsOf(secret).map(async (s) => base64Url(await crypto.subtle.sign("HMAC", await hmacKey(s), message))));
|
|
66
|
+
return [`t=${t}`, ...sigs.map((sig) => `v1=${sig}`)].join(",");
|
|
64
67
|
}
|
|
65
|
-
/**
|
|
68
|
+
/** 署名の照合(鍵のどれかと v1 のどれかが合えば true、形の誤り・時刻のずれの超過・不一致は false) */
|
|
66
69
|
async function verifyParts(secret, header, parts, { now = Date.now(), maxSkewSec = MAX_SKEW_SEC } = {}) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
const secrets = secretsOf(secret);
|
|
71
|
+
if (!secrets.length || !header) return false;
|
|
72
|
+
const fields = header.split(",").map((f) => f.trim().split("=", 2));
|
|
73
|
+
const t = Number(fields.find(([k]) => k === "t")?.[1]);
|
|
74
|
+
const sigs = fields.flatMap(([k, v]) => k === "v1" && v ? [v] : []);
|
|
75
|
+
if (!Number.isInteger(t) || !sigs.length || Math.abs(now / 1e3 - t) > maxSkewSec) return false;
|
|
76
|
+
const message = await messageOf(t, parts);
|
|
77
|
+
for (const s of secrets) {
|
|
78
|
+
const key = await hmacKey(s);
|
|
79
|
+
for (const sig of sigs) try {
|
|
80
|
+
if (await crypto.subtle.verify("HMAC", key, decodeBase64Url(sig), message)) return true;
|
|
81
|
+
} catch {}
|
|
75
82
|
}
|
|
83
|
+
return false;
|
|
76
84
|
}
|
|
77
85
|
/** 署名を付けたヘッダー(init のヘッダーに署名と主体を追加した新しい Headers) */
|
|
78
86
|
async function signedHeaders(secret, { method, url, body, subject }, { header, subjectHeader, init, now }) {
|
|
@@ -86,10 +94,10 @@ async function signedHeaders(secret, { method, url, body, subject }, { header, s
|
|
|
86
94
|
}, now));
|
|
87
95
|
return headers;
|
|
88
96
|
}
|
|
89
|
-
/**
|
|
97
|
+
/** リクエストの署名の照合(本文は複製から読み込み、元のリクエストの本文は残す、鍵の移行の期間は受け手が新旧の鍵を並べて渡せる) */
|
|
90
98
|
async function verifyRequest(secret, request, { header, subjectHeader, now }) {
|
|
91
99
|
const value = request.headers.get(header);
|
|
92
|
-
if (!secret || !value) return false;
|
|
100
|
+
if (!secretsOf(secret).length || !value) return false;
|
|
93
101
|
const body = request.body ? await request.clone().arrayBuffer() : null;
|
|
94
102
|
return verifyParts(secret, value, {
|
|
95
103
|
method: request.method,
|
|
@@ -98,12 +106,15 @@ async function verifyRequest(secret, request, { header, subjectHeader, now }) {
|
|
|
98
106
|
subject: subjectHeader ? request.headers.get(subjectHeader) : null
|
|
99
107
|
}, now === void 0 ? {} : { now });
|
|
100
108
|
}
|
|
101
|
-
/**
|
|
109
|
+
/** 封印した値(鍵のどれかで署名が合えば値、署名の不一致・期限切れ・形の誤りは null) */
|
|
102
110
|
async function openValue(secret, token, now = Date.now()) {
|
|
103
111
|
const [body, sig] = token?.split(".") ?? [];
|
|
104
|
-
|
|
112
|
+
const secrets = secretsOf(secret);
|
|
113
|
+
if (!secrets.length || !body || !sig) return null;
|
|
105
114
|
try {
|
|
106
|
-
|
|
115
|
+
let matched = false;
|
|
116
|
+
for (const s of secrets) if (!matched) matched = await crypto.subtle.verify("HMAC", await hmacKey(s), decodeBase64Url(sig), enc.encode(body));
|
|
117
|
+
if (!matched) return null;
|
|
107
118
|
const { v, exp } = JSON.parse(new TextDecoder().decode(decodeBase64Url(body)));
|
|
108
119
|
return typeof exp === "number" && exp * 1e3 > now ? v : null;
|
|
109
120
|
} catch {
|
package/dist/trace.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { r as TRACEPARENT_HEADER, t as sampleRateOf, n as withEdgeSpan } from "./src-
|
|
1
|
+
export { r as TRACEPARENT_HEADER, t as sampleRateOf, n as withEdgeSpan } from "./src-C6YqllXw.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { accessJwtOptions, type FetchCerts, type JwtClaims, type JwtOptions, verifyAccessJwt, verifyJwt } from './jwt.js';
|
|
2
2
|
export { emailOfClaims, type LoginAuth, oidcLogin, type OidcLoginOptions, tokenAuth, type TokenAuthOptions } from './oidc.js';
|
|
3
3
|
export { type EdgeSpan, type EdgeSpanOptions, type EdgeSpanStatus, sampleRateOf, startEdgeSpan, withEdgeSpan } from './span.js';
|
|
4
|
-
export { openValue, sealValue, SIGNED_HEADERS, signedHeaders, signParts, type SignedParts, verifyParts, verifyRequest, type VerifyRequestOptions } from './signed.js';
|
|
4
|
+
export { openValue, sealValue, SIGNED_HEADERS, signedHeaders, type SigningSecrets, signParts, type SignedParts, verifyParts, verifyRequest, type VerifyRequestOptions } from './signed.js';
|
|
5
5
|
export { childTraceContext, formatTraceparent, newSpanId, newTraceId, parseTraceparent, type TraceContext, TRACEPARENT_HEADER } from './traceparent.js';
|
|
@@ -17,15 +17,17 @@ export type SignedParts = Readonly<{
|
|
|
17
17
|
/** 主体(MCP のログインのメールアドレスなど、なしは空) */
|
|
18
18
|
subject?: string | null;
|
|
19
19
|
}>;
|
|
20
|
-
/**
|
|
21
|
-
export
|
|
22
|
-
/**
|
|
23
|
-
export declare function
|
|
20
|
+
/** 署名の鍵(1つか、移行の期間は新しい鍵を先・古い鍵を最後に並べた複数) */
|
|
21
|
+
export type SigningSecrets = string | readonly string[];
|
|
22
|
+
/** 署名のヘッダーの値(t=<秒>,v1=<署名>、鍵が複数なら v1 を鍵の順に並べる) */
|
|
23
|
+
export declare function signParts(secret: SigningSecrets, parts: SignedParts, now?: number): Promise<string>;
|
|
24
|
+
/** 署名の照合(鍵のどれかと v1 のどれかが合えば true、形の誤り・時刻のずれの超過・不一致は false) */
|
|
25
|
+
export declare function verifyParts(secret: SigningSecrets | null | undefined, header: string | null | undefined, parts: SignedParts, { now, maxSkewSec }?: {
|
|
24
26
|
now?: number;
|
|
25
27
|
maxSkewSec?: number;
|
|
26
28
|
}): Promise<boolean>;
|
|
27
29
|
/** 署名を付けたヘッダー(init のヘッダーに署名と主体を追加した新しい Headers) */
|
|
28
|
-
export declare function signedHeaders(secret:
|
|
30
|
+
export declare function signedHeaders(secret: SigningSecrets, { method, url, body, subject }: SignedParts, { header, subjectHeader, init, now }: Readonly<{
|
|
29
31
|
header: string;
|
|
30
32
|
subjectHeader?: string;
|
|
31
33
|
init?: HeadersInit;
|
|
@@ -39,9 +41,9 @@ export type VerifyRequestOptions = Readonly<{
|
|
|
39
41
|
subjectHeader?: string;
|
|
40
42
|
now?: number;
|
|
41
43
|
}>;
|
|
42
|
-
/**
|
|
43
|
-
export declare function verifyRequest(secret:
|
|
44
|
+
/** リクエストの署名の照合(本文は複製から読み込み、元のリクエストの本文は残す、鍵の移行の期間は受け手が新旧の鍵を並べて渡せる) */
|
|
45
|
+
export declare function verifyRequest(secret: SigningSecrets | undefined, request: Request, { header, subjectHeader, now }: VerifyRequestOptions): Promise<boolean>;
|
|
44
46
|
/** 期限と署名を付けた値(JSON にできる値、ttlSec は有効な秒数) */
|
|
45
47
|
export declare function sealValue(secret: string, value: unknown, ttlSec: number, now?: number): Promise<string>;
|
|
46
|
-
/**
|
|
47
|
-
export declare function openValue<T = unknown>(secret:
|
|
48
|
+
/** 封印した値(鍵のどれかで署名が合えば値、署名の不一致・期限切れ・形の誤りは null) */
|
|
49
|
+
export declare function openValue<T = unknown>(secret: SigningSecrets, token: string | null | undefined, now?: number): Promise<T | null>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const EMBED_PLACEMENTS: readonly ["panel"];
|
|
3
3
|
/** 外の画面を表示する位置 */
|
|
4
4
|
export type EmbedPlacement = (typeof EMBED_PLACEMENTS)[number];
|
|
5
|
-
/** 外の画面の登録(secret
|
|
5
|
+
/** 外の画面の登録(secret は末尾だけを伏せずに返す、previousSecret は鍵の移行の期間の古い鍵の末尾で期間の外は null) */
|
|
6
6
|
export type ExternalScreen = Readonly<{
|
|
7
7
|
id: string;
|
|
8
8
|
label: string;
|
|
@@ -10,6 +10,7 @@ export type ExternalScreen = Readonly<{
|
|
|
10
10
|
url: string;
|
|
11
11
|
placement: EmbedPlacement;
|
|
12
12
|
secret: string;
|
|
13
|
+
previousSecret: string | null;
|
|
13
14
|
enabled: boolean;
|
|
14
15
|
}>;
|
|
15
16
|
/** 編集画面に置く外の画面(鍵なし、編集できるアカウントに返す) */
|
|
@@ -32,6 +33,8 @@ export type EmbedContext = Readonly<{
|
|
|
32
33
|
}>;
|
|
33
34
|
/** URL のクエリの名前(署名つきの文脈) */
|
|
34
35
|
export declare const EMBED_CONTEXT_PARAM = "ctx";
|
|
36
|
+
/** URL のクエリの名前(鍵の移行の期間だけ、新しい鍵で封印した文脈) */
|
|
37
|
+
export declare const EMBED_CONTEXT_NEXT_PARAM = "ctx_next";
|
|
35
38
|
/** 文脈の有効期間(秒) */
|
|
36
39
|
export declare const EMBED_CONTEXT_TTL_SEC = 600;
|
|
37
40
|
/** postMessage の種類 */
|
|
@@ -57,7 +57,7 @@ export type ErrorCode = keyof typeof ERROR_STATUS;
|
|
|
57
57
|
* - 型の対象: 型の id、表示名はスキーマ
|
|
58
58
|
* - モジュールの対象: ModuleManifest の targets
|
|
59
59
|
*/
|
|
60
|
-
export type ErrorTarget = 'request' | 'role' | 'media' | 'entry' | 'asset' | 'mcp' | 'version' | 'profile' | 'portrait' | 'extension' | 'account' | 'comment' | 'view' | 'webhook' | 'external_function' | 'external_screen' | 'api_key';
|
|
60
|
+
export type ErrorTarget = 'request' | 'role' | 'media' | 'entry' | 'asset' | 'mcp' | 'version' | 'profile' | 'portrait' | 'extension' | 'account' | 'comment' | 'view' | 'webhook' | 'external_function' | 'external_screen' | 'api_key' | 'preview';
|
|
61
61
|
/** エラーの補足の値(コードごとに使用する項目だけ) */
|
|
62
62
|
export type ErrorParams = {
|
|
63
63
|
/**
|
|
@@ -6,7 +6,11 @@ export type FunctionHook = (typeof FUNCTION_HOOKS)[number];
|
|
|
6
6
|
export declare const FUNCTION_HOOK_LABELS: Readonly<Record<FunctionHook, string>>;
|
|
7
7
|
/** 時間切れ・失敗・不正な応答のときの扱い(block は保存・提出・公開を拒否、pass は通過) */
|
|
8
8
|
export type FunctionOnError = 'block' | 'pass';
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* 外の関数の登録(url・secret は末尾だけを伏せずに返す)
|
|
11
|
+
* - previousSecret: 鍵の移行の期間の古い鍵の末尾、期間の外は null
|
|
12
|
+
* - lastStatus: 最新の呼び出しで返った HTTP の状態、送れなかったときは0
|
|
13
|
+
*/
|
|
10
14
|
export type ExternalFunction = Readonly<{
|
|
11
15
|
id: string;
|
|
12
16
|
label: string;
|
|
@@ -14,6 +18,7 @@ export type ExternalFunction = Readonly<{
|
|
|
14
18
|
type: string;
|
|
15
19
|
url: string;
|
|
16
20
|
secret: string;
|
|
21
|
+
previousSecret: string | null;
|
|
17
22
|
onError: FunctionOnError;
|
|
18
23
|
enabled: boolean;
|
|
19
24
|
lastStatus: number | null;
|
|
@@ -13,7 +13,7 @@ export { ADMIN_PERMISSIONS, ADMIN_ROLE, isAdmin, rolePermissionsOf, type Role, S
|
|
|
13
13
|
export { isServerPath, OPS_PATHS, SERVER_PATHS } from './paths.js';
|
|
14
14
|
export { CONFIG_FORMAT, type ConfigBundle, type ConfigPreview } from './transfer.js';
|
|
15
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';
|
|
16
|
-
export { EMBED_CONTEXT_PARAM, EMBED_CONTEXT_TTL_SEC, EMBED_MESSAGES, EMBED_PLACEMENTS, type EmbedContext, type EmbedEntry, type EmbedMessage, type EmbedPlacement, type ExternalScreen } from './embeds.js';
|
|
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 { parseWebhookEvent, type Webhook, WEBHOOK_ACTION_LABELS, type WebhookBody, WEBHOOK_ACTIONS, type WebhookAction, type WebhookDelivery, type WebhookEvent, webhookEventLabel, webhookEventOf, type WebhookKind } from './webhooks.js';
|
|
19
19
|
export { type SavedView, VIEW_ACTIONS, type ViewAction, type ViewDefinition } from './views.js';
|
|
@@ -17,13 +17,18 @@ export declare function parseWebhookEvent(event: string): Readonly<{
|
|
|
17
17
|
export declare function webhookEventLabel(event: string, types: Readonly<Record<string, string>>, moduleEvents?: Readonly<Record<string, string>>): string;
|
|
18
18
|
/** Webhook の形式 */
|
|
19
19
|
export type WebhookKind = 'json' | 'slack';
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Webhook(url・secret は末尾だけを伏せずに返す、secret の null は署名なし)
|
|
22
|
+
* - previousSecret: 鍵の移行の期間の古い鍵の末尾、期間の外は null
|
|
23
|
+
* - lastStatus: 最新の送信で返った HTTP の状態、送れなかったときは0
|
|
24
|
+
*/
|
|
21
25
|
export type Webhook = Readonly<{
|
|
22
26
|
id: string;
|
|
23
27
|
label: string;
|
|
24
28
|
kind: WebhookKind;
|
|
25
29
|
url: string;
|
|
26
30
|
secret: string | null;
|
|
31
|
+
previousSecret: string | null;
|
|
27
32
|
events: readonly WebhookEvent[];
|
|
28
33
|
enabled: boolean;
|
|
29
34
|
lastStatus: number | null;
|
|
@@ -15,6 +15,11 @@ export type SourcesField = Extract<FieldDef, {
|
|
|
15
15
|
export declare const primaryTypeOf: (model: ContentModel) => ContentType | null;
|
|
16
16
|
/** 主の型(なければ例外: その型を前提にする画面・処理だけが使用) */
|
|
17
17
|
export declare function requiredPrimaryTypeOf(model: ContentModel): ContentType;
|
|
18
|
+
/** 暦の日付(日付の役割の項目を持つ一覧の型と項目の key、スキーマの順、役割は宣言だけで推測なし) */
|
|
19
|
+
export declare const dateRoleFieldsOf: (model: ContentModel) => {
|
|
20
|
+
type: string;
|
|
21
|
+
field: string;
|
|
22
|
+
}[];
|
|
18
23
|
/** 型の出典の項目(なければ null) */
|
|
19
24
|
export declare function sourcesFieldOf(type: ContentType): SourcesField | null;
|
|
20
25
|
/** 出典の型(出典の項目の参照先でスキーマの順で先頭、なければ null) */
|
|
@@ -4,7 +4,7 @@ export { coverPosition, coverStart, cropRect, croppedHotspot, objectPosition, st
|
|
|
4
4
|
export { IMAGE_TYPE, VIDEO_TYPE } from './media.js';
|
|
5
5
|
export { IMAGE_SIZE_MAX, imageParamsOf, mediaExtOf, mediaMimeOf, mediaPathOf, parseMediaPath, withImageParams, type ImageParams, type MediaPath } from './mediaUrl.js';
|
|
6
6
|
export { diffSchema, type ChangeKind, type ChangeLevel, type DiffOptions, type SchemaChange } from './changes.js';
|
|
7
|
-
export { primaryTypeOf, requiredPrimaryTypeOf, SOURCES_FIELD, sourceIdsOf, sourcesFieldOf, sourceTypeOf, type SourcesField } from './capabilities.js';
|
|
7
|
+
export { dateRoleFieldsOf, primaryTypeOf, requiredPrimaryTypeOf, SOURCES_FIELD, sourceIdsOf, sourcesFieldOf, sourceTypeOf, type SourcesField } from './capabilities.js';
|
|
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';
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { type SigningSecrets } from '../../access/src/index.js';
|
|
2
|
+
import { type EmbedContext } from '../../cms-contract/src/index.js';
|
|
1
3
|
export { openValue, SIGNED_HEADERS, verifyRequest } from '../../access/src/index.js';
|
|
2
|
-
export type { VerifyRequestOptions } from '../../access/src/index.js';
|
|
3
|
-
export { EMBED_CONTEXT_PARAM, EMBED_MESSAGES, FUNCTION_HOOKS } from '../../cms-contract/src/index.js';
|
|
4
|
+
export type { SigningSecrets, VerifyRequestOptions } from '../../access/src/index.js';
|
|
5
|
+
export { EMBED_CONTEXT_NEXT_PARAM, EMBED_CONTEXT_PARAM, EMBED_MESSAGES, FUNCTION_HOOKS } from '../../cms-contract/src/index.js';
|
|
4
6
|
export type { EmbedContext, EmbedMessage, FunctionHook, FunctionRequest, PublishCheckRequest, PublishCheckResponse, SaveCheckRequest, SaveCheckResponse, WebhookAction, WebhookBody, WebhookEvent } from '../../cms-contract/src/index.js';
|
|
7
|
+
/** 外の画面の URL の文脈(クエリ ctx と、鍵の移行の期間の ctx_next のどちらかが鍵で開けば文脈、なければ null) */
|
|
8
|
+
export declare function openEmbedContext(secret: SigningSecrets, url: string | URL, now?: number): Promise<EmbedContext | null>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { SIGNED_HEADERS, signedHeaders, signParts, verifyParts, verifyRequest } from '../../access/src/index.js';
|
|
2
|
-
export type { SignedParts, VerifyRequestOptions } from '../../access/src/index.js';
|
|
2
|
+
export type { SignedParts, SigningSecrets, VerifyRequestOptions } from '../../access/src/index.js';
|