@ryusenkei/maezae 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -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/handoff.d.ts +29 -0
- package/dist/types/access/src/index.d.ts +3 -2
- package/dist/types/access/src/signed.d.ts +11 -9
- package/dist/types/analytics/src/index.d.ts +1 -1
- package/dist/types/analytics/src/source.d.ts +2 -0
- 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 +3 -2
- package/dist/types/cms-contract/src/modules.d.ts +3 -0
- package/dist/types/cms-contract/src/transfer.d.ts +4 -0
- package/dist/types/cms-contract/src/versions.d.ts +4 -0
- package/dist/types/cms-contract/src/webhooks.d.ts +55 -9
- package/dist/types/model/src/capabilities.d.ts +5 -0
- package/dist/types/model/src/changes.d.ts +12 -3
- package/dist/types/model/src/index.d.ts +2 -2
- package/dist/types/sdk/src/integrations.d.ts +7 -3
- package/dist/types/sdk/src/preview.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@ maezae の SDK(導入先のサイト向け)
|
|
|
21
21
|
- 鍵: 媒体の管理画面の「設定 → 連携」で発行した API の鍵
|
|
22
22
|
- 1件の形: `{ id, ...項目, _meta: { created_at, updated_at, published_at } }`、published_at は公開の管理がある型だけ(0.7.0 から)
|
|
23
23
|
- 一覧: 本文の種類の項目を含めない、本文は1件の取得か `/bundle` で
|
|
24
|
+
- 契約の版: パス `/content/v1` と、すべての応答のヘッダー `x-cms-version: 1`。非互換の変更はバージョン(版)を上げて行う(#495)
|
|
24
25
|
|
|
25
26
|
```ts
|
|
26
27
|
import { createDeliveryClient } from '@ryusenkei/maezae/delivery';
|
|
@@ -53,3 +54,71 @@ const body = (await request.json()) as PublishCheckRequest;
|
|
|
53
54
|
```
|
|
54
55
|
|
|
55
56
|
- Webhook の重複: 失敗した送信は同じ本文で再送する。本文の `id`(イベントの ID)を処理済みとして保存し、同じ `id` は処理せずに 2xx を返す
|
|
57
|
+
|
|
58
|
+
## Webhook の本文と契約の版
|
|
59
|
+
|
|
60
|
+
本文の形は Webhook の登録ごとの契約の版(`version`)で決まる。非互換の変更はバージョン(版)を上げて行い、旧い版は受け手の移行の期間だけ残す(#495)
|
|
61
|
+
|
|
62
|
+
| 版 | 対象の登録 | 編集の出来事の本文 |
|
|
63
|
+
| --- | --- | --- |
|
|
64
|
+
| 2(今の版) | 2026-11-12より後に作成した登録と、管理画面で版2に切り替えた登録 | `{ "version": 2, "id": "evt_…", "event": "published", "type": "column", "item": { "id": "…", "title": "…" }, "by": "…", "at": "…" }` |
|
|
65
|
+
| 1(旧い版) | 2026-11-12より前に作成した登録(移し替えの後も版1のまま) | `{ "version": 1, "id": "evt_…", "event": "column.published", "type": "column", "item": {…}, "by": "…", "at": "…" }` |
|
|
66
|
+
|
|
67
|
+
- `event`: `submitted`(レビューの依頼)・`published`(公開)・`unpublished`(非公開)・`rejected`(差し戻し)。型は `type` で判断する(型の ID を変えても受け手の分岐が切れない)
|
|
68
|
+
- 拡張機能の出来事(例: お問い合わせの `contact.received`): 版を問わず `{ version, id, event: "contact.received", data, at }`(接頭辞はモジュールの ID で型の ID ではないため、名前は変えない)
|
|
69
|
+
- 購読: 管理画面の「設定 → 連携」で、送る出来事と対象の型を別々に選ぶ。編集の出来事は「選んだ出来事 × 選んだ型」で届く
|
|
70
|
+
- 版1の廃止: 本番のすべての登録が版2になり、最後の切り替えから再送の期間(約55時間半)が過ぎた後。期限の目安は2027-01-31(延ばすときは #495に書く)
|
|
71
|
+
- 版1の登録のまま型の ID を変えると、版1の `event`(`<型の ID>.<出来事>`)も変わる。型の ID の変更(#465)は受け手を版2に移してから行う
|
|
72
|
+
|
|
73
|
+
### 受け手の移行(版1 → 版2)
|
|
74
|
+
|
|
75
|
+
1. 受け手を両方の形で動くように直してデプロイ(下の例)。SDK を 0.11.0 以上にすると `WebhookBody` が2つの版の型になる
|
|
76
|
+
2. 管理画面の「設定 → 連携」で Webhook を開き、「契約の版」を版2にして保存し、「テストの送信」で受け手の成功を確かめる
|
|
77
|
+
3. 「送信の記録」で、切り替えの後の本物の出来事が成功していることを確かめる
|
|
78
|
+
4. 3日(再送の期間の約55時間半を過ぎる)待ってから、受け手の版1の処理を消す。切り替えの前に失敗した送信の再送は、版1の形のまま届く
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
import type { WebhookBody } from '@ryusenkei/maezae/integrations';
|
|
82
|
+
|
|
83
|
+
const body = (await request.json()) as WebhookBody;
|
|
84
|
+
// 版2は event と type、版1は event の <型の ID>.<出来事> を分けて同じ形に
|
|
85
|
+
const [type, event] = body.version === 2 ? [body.type, body.event] : [body.type, body.event.slice(body.event.lastIndexOf('.') + 1)];
|
|
86
|
+
if (type === 'part' && event === 'published') await revalidatePart(body.item.id);
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### microCMS の Webhook との対応
|
|
90
|
+
|
|
91
|
+
キーの名前は maezae の語彙のまま(`type` を2つの意味で使わない)
|
|
92
|
+
|
|
93
|
+
| microCMS | maezae(版2) | 備考 |
|
|
94
|
+
| --- | --- | --- |
|
|
95
|
+
| `service` | (なし) | 送信先の URL と署名の鍵が媒体ごと |
|
|
96
|
+
| `api`(API のエンドポイント名) | `type`(型の ID) | |
|
|
97
|
+
| `type`(`new`・`edit`・`delete`) | `event`(`submitted`・`published`・`unpublished`・`rejected`) | データの変更の出来事(作成・更新・削除)は #494の決定(3)で追加の予定 |
|
|
98
|
+
| `id`(コンテンツ ID) | `item.id` | maezae の `id` はイベントの ID(重複の除去に使用) |
|
|
99
|
+
| `contents`(前後の全内容) | `item`(ID と題) | 中身の選択は #494の決定(3)で追加の予定、今は配信 API で取得 |
|
|
100
|
+
|
|
101
|
+
## 外の画面の受け手
|
|
102
|
+
|
|
103
|
+
- 鍵: 媒体の管理画面の「設定 → 連携」の外の画面の登録ごとの署名の鍵
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
import { openEmbedContext } from '@ryusenkei/maezae/integrations';
|
|
107
|
+
|
|
108
|
+
const context = await openEmbedContext(env.CMS_SCREEN_SECRET, request.url);
|
|
109
|
+
if (!context) return new Response(null, { status: 401 });
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## 署名の鍵の再発行(止めずに差し替える)
|
|
113
|
+
|
|
114
|
+
- 対象: Webhook・外の関数・外の画面の登録ごとの鍵と、プレビューの署名の鍵
|
|
115
|
+
- 移行の期間: 管理画面で「鍵を再発行」してから「古い鍵を失効」するまで、新旧の鍵の両方が有効
|
|
116
|
+
- Webhook・外の関数・プレビュー: CMS は署名のヘッダーに新旧の鍵の `v1` を並べる(新しい鍵が先、古い鍵が最後)
|
|
117
|
+
- 外の画面: クエリ `ctx` は古い鍵、`ctx_next` は新しい鍵で封印
|
|
118
|
+
- 古い SDK(0.10.0 より前): 古い鍵の署名だけを照合するため、古い鍵のままなら移行の期間も通る
|
|
119
|
+
- 導入先の手順
|
|
120
|
+
1. SDK を 0.10.0 以上にしてデプロイ(照合は `verifyRequest`、外の画面は `openEmbedContext`)
|
|
121
|
+
2. 管理画面で「鍵を再発行」し、表示された新しい鍵を受け手の秘密値(例: `CMS_FUNCTION_SECRET`)に設定してデプロイ
|
|
122
|
+
3. 管理画面の「送信の記録」で、差し替えの後の送信が成功していることを確かめる
|
|
123
|
+
4. 管理画面で「古い鍵を失効」
|
|
124
|
+
- 受け手が新旧の鍵を並べて持つこともできる: `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";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { LoginAuth } from './oidc.js';
|
|
2
|
+
/** セッションの Cookie の名前(https は __Host- の接頭辞) */
|
|
3
|
+
export declare const sessionCookieName: (url: URL) => string;
|
|
4
|
+
/** セッションの Cookie の Set-Cookie の値(maxAgeSec が0は削除) */
|
|
5
|
+
export declare const sessionCookie: (url: URL, value: string, maxAgeSec: number) => string;
|
|
6
|
+
/** リクエストの Cookie の値(なければ null) */
|
|
7
|
+
export declare const cookieValue: (request: Request, name: string) => string | null;
|
|
8
|
+
/** セッションの値(なし・署名の不一致・期限切れは null) */
|
|
9
|
+
export declare const openSession: <T>(request: Request, secret: string) => Promise<T | null>;
|
|
10
|
+
/** 引き継ぎのログインの設定 */
|
|
11
|
+
export type HandoffLoginOptions = Readonly<{
|
|
12
|
+
/** Cookie の署名の鍵 */
|
|
13
|
+
secret: string;
|
|
14
|
+
/** manage のログインの URL(例: https://example.com/manage/login) */
|
|
15
|
+
loginUrl: string;
|
|
16
|
+
/** トークンを消して使い、メールアドレスを返す(使えないトークンは null、host は CMS のホスト名) */
|
|
17
|
+
consume(token: string, host: string): Promise<string | null>;
|
|
18
|
+
/** 入り口のパスの頭(既定 /auth) */
|
|
19
|
+
basePath?: string;
|
|
20
|
+
/** セッションの秒数(既定は12時間) */
|
|
21
|
+
sessionTtlSec?: number;
|
|
22
|
+
}>;
|
|
23
|
+
/** manage からの引き継ぎのログイン */
|
|
24
|
+
export declare function handoffLogin({ secret, loginUrl, consume, basePath, sessionTtlSec }: HandoffLoginOptions): LoginAuth;
|
|
25
|
+
/**
|
|
26
|
+
* 2つのログインを順に試す(emailOf は first が null なら second、入り口とログアウトは first)
|
|
27
|
+
* - 用途: 引き継ぎのログインへの移行の間、Access の JWT も受け付ける
|
|
28
|
+
*/
|
|
29
|
+
export declare function eitherLogin(first: LoginAuth, second: LoginAuth): LoginAuth;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { accessJwtOptions, type FetchCerts, type JwtClaims, type JwtOptions, verifyAccessJwt, verifyJwt } from './jwt.js';
|
|
2
|
-
export {
|
|
2
|
+
export { cookieValue, eitherLogin, handoffLogin, type HandoffLoginOptions, openSession, sessionCookie, sessionCookieName } from './handoff.js';
|
|
3
|
+
export { emailOfClaims, type LoginAuth, oidcLogin, type OidcLoginOptions, safeNext, tokenAuth, type TokenAuthOptions } from './oidc.js';
|
|
3
4
|
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';
|
|
5
|
+
export { openValue, sealValue, SIGNED_HEADERS, signedHeaders, type SigningSecrets, signParts, type SignedParts, verifyParts, verifyRequest, type VerifyRequestOptions } from './signed.js';
|
|
5
6
|
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>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { recordView, type Classify, type Dataset } from './record.js';
|
|
2
2
|
export { syncCron } from './schedule.js';
|
|
3
|
-
export { analyticsEngine, type DailyRow, fixedSource, type Source, projectDaily, type ProjectSource } from './source.js';
|
|
3
|
+
export { analyticsEngine, type DailyRow, fixedSource, type Source, projectDaily, type ProjectSource, renamedSource } from './source.js';
|
|
4
4
|
export { readDaily, syncDaily } from './store.js';
|
|
@@ -30,4 +30,6 @@ export type ProjectSource = {
|
|
|
30
30
|
export declare function projectDaily(options: Omit<AnalyticsEngineOptions, 'project'>): ProjectSource;
|
|
31
31
|
/** 集計済みの行の読み込み元(定期の集計で全媒体の問い合わせ結果を媒体ごとに受け渡し、daily は since 以降の行) */
|
|
32
32
|
export declare const fixedSource: (rows: readonly DailyRow[]) => Source;
|
|
33
|
+
/** 種類を付け替えた読み込み元(renames は旧の種類 → 今の種類、付け替えで重なった行は閲覧数を合計) */
|
|
34
|
+
export declare function renamedSource(source: Source, renames: Readonly<Record<string, string>>): Source;
|
|
33
35
|
export {};
|
|
@@ -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,8 +13,9 @@ 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
|
-
export { parseWebhookEvent, type Webhook, WEBHOOK_ACTION_LABELS, type WebhookBody, WEBHOOK_ACTIONS, type WebhookAction, type WebhookDelivery, type WebhookEvent, webhookEventLabel, webhookEventOf, type WebhookKind } from './webhooks.js';
|
|
18
|
+
export { isWebhookAction, parseWebhookEvent, type Webhook, WEBHOOK_ACTION_LABELS, type WebhookBody, type WebhookBodyV1, type WebhookBodyV2, WEBHOOK_ACTIONS, type WebhookAction, type WebhookDelivery, type WebhookEvent, webhookEventLabel, webhookEventOf, type WebhookKind, type WebhookModuleBody, type WebhookSubscription, webhookSubscriptionLabel, WEBHOOK_VERSION, WEBHOOK_VERSIONS, type WebhookVersion } from './webhooks.js';
|
|
19
|
+
export { CONTRACT_VERSION_HEADER, DELIVERY_VERSION } from './versions.js';
|
|
19
20
|
export { type SavedView, VIEW_ACTIONS, type ViewAction, type ViewDefinition } from './views.js';
|
|
20
21
|
export { canManageSettings, isSettingsTarget, managedAreasOf, SETTINGS_AREA_LABELS, SETTINGS_AREAS, type SettingsArea, settingsTarget } from './settings.js';
|
|
@@ -56,6 +56,8 @@ export type ModuleManifest<S = Readonly<Record<string, never>>> = Readonly<{
|
|
|
56
56
|
settingFields?: readonly SettingField[];
|
|
57
57
|
/** フィールドの宣言(設定値から作成、例: 種類で決まる名義) */
|
|
58
58
|
fieldRules?(settings: S): readonly FieldRule[];
|
|
59
|
+
/** 型の id を値に持つ設定値のキー(型の id の変更で書き換え、値は id の文字列か配列) */
|
|
60
|
+
typeSettings?: readonly string[];
|
|
59
61
|
/** 拡張機能が送る Webhook の出来事(キーは出来事の名前 <対象>.<操作>、値は表示名、設定の「連携」で選択) */
|
|
60
62
|
webhookEvents?: Readonly<Record<string, string>>;
|
|
61
63
|
}>;
|
|
@@ -91,6 +93,7 @@ export type ModuleBase = Readonly<{
|
|
|
91
93
|
fieldRules: readonly FieldRule[];
|
|
92
94
|
messages: TargetMessages;
|
|
93
95
|
webhookEvents: Readonly<Record<string, string>>;
|
|
96
|
+
typeSettings: readonly string[];
|
|
94
97
|
}>;
|
|
95
98
|
/** 組み立てたモジュール(共通の定義と、側ごとの内容) */
|
|
96
99
|
export type ModuleInstance<P> = ModuleBase & P;
|
|
@@ -29,8 +29,12 @@ export type ConfigBundle = Readonly<{
|
|
|
29
29
|
}>;
|
|
30
30
|
/** スキーマと設定の読み込みの確認(schema はスキーマの変更、ほかは追加と更新の件数) */
|
|
31
31
|
export type ConfigPreview = Readonly<{
|
|
32
|
+
/** kind は変更の種類、type は型の id、value は型の id の変更の旧の id(型の id の変更の候補の選択に使用) */
|
|
32
33
|
schema: readonly Readonly<{
|
|
33
34
|
id: string;
|
|
35
|
+
kind: string;
|
|
36
|
+
type: string;
|
|
37
|
+
value?: string;
|
|
34
38
|
level: 'safe' | 'confirm' | 'forbidden';
|
|
35
39
|
message: string;
|
|
36
40
|
count: number | null;
|
|
@@ -2,39 +2,75 @@
|
|
|
2
2
|
export declare const WEBHOOK_ACTIONS: readonly ["submitted", "published", "unpublished", "rejected"];
|
|
3
3
|
/** 送れる操作 */
|
|
4
4
|
export type WebhookAction = (typeof WEBHOOK_ACTIONS)[number];
|
|
5
|
-
/**
|
|
5
|
+
/** Webhook の契約の版(1は旧い形、2は今の形) */
|
|
6
|
+
export declare const WEBHOOK_VERSIONS: readonly [1, 2];
|
|
7
|
+
/** Webhook の契約の版 */
|
|
8
|
+
export type WebhookVersion = (typeof WEBHOOK_VERSIONS)[number];
|
|
9
|
+
/** 新しい登録の版(今の版) */
|
|
10
|
+
export declare const WEBHOOK_VERSION: WebhookVersion;
|
|
11
|
+
/** サーバーの内側の出来事のキー(編集の出来事は <型の id>.<操作>、拡張機能の出来事は宣言の名前) */
|
|
6
12
|
export type WebhookEvent = `${string}.${string}`;
|
|
13
|
+
/** 購読する出来事(操作か拡張機能の出来事の名前) */
|
|
14
|
+
export type WebhookSubscription = WebhookAction | WebhookEvent;
|
|
7
15
|
/** 操作の表示名(画面の選択肢と、Slack の文) */
|
|
8
16
|
export declare const WEBHOOK_ACTION_LABELS: Readonly<Record<WebhookAction, string>>;
|
|
9
|
-
/**
|
|
17
|
+
/** 送れる操作か */
|
|
18
|
+
export declare const isWebhookAction: (value: string) => value is WebhookAction;
|
|
19
|
+
/** 型と操作の出来事のキー */
|
|
10
20
|
export declare const webhookEventOf: (type: string, action: WebhookAction) => WebhookEvent;
|
|
11
|
-
/**
|
|
21
|
+
/** 出来事のキーの型と操作(編集の出来事でなければ null) */
|
|
12
22
|
export declare function parseWebhookEvent(event: string): Readonly<{
|
|
13
23
|
type: string;
|
|
14
24
|
action: WebhookAction;
|
|
15
25
|
}> | null;
|
|
16
|
-
/**
|
|
26
|
+
/** 出来事のキーの表示名(types は型の id と表示名で型の表示名と操作の表示名、moduleEvents は拡張機能の出来事の表示名) */
|
|
17
27
|
export declare function webhookEventLabel(event: string, types: Readonly<Record<string, string>>, moduleEvents?: Readonly<Record<string, string>>): string;
|
|
28
|
+
/** 購読する出来事の表示名(操作か拡張機能の出来事) */
|
|
29
|
+
export declare const webhookSubscriptionLabel: (subscription: string, moduleEvents?: Readonly<Record<string, string>>) => string;
|
|
18
30
|
/** Webhook の形式 */
|
|
19
31
|
export type WebhookKind = 'json' | 'slack';
|
|
20
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Webhook(url・secret は末尾だけを伏せずに返す、secret の null は署名なし)
|
|
34
|
+
* - version: 契約の版(本文の形)
|
|
35
|
+
* - events: 購読する出来事(操作と拡張機能の出来事)、types: 購読する型の id(編集の出来事は events の操作 × types)
|
|
36
|
+
* - previousSecret: 鍵の移行の期間の古い鍵の末尾、期間の外は null
|
|
37
|
+
* - lastStatus: 最新の送信で返った HTTP の状態、送れなかったときは0
|
|
38
|
+
*/
|
|
21
39
|
export type Webhook = Readonly<{
|
|
22
40
|
id: string;
|
|
23
41
|
label: string;
|
|
24
42
|
kind: WebhookKind;
|
|
25
43
|
url: string;
|
|
26
44
|
secret: string | null;
|
|
27
|
-
|
|
45
|
+
previousSecret: string | null;
|
|
46
|
+
version: WebhookVersion;
|
|
47
|
+
events: readonly WebhookSubscription[];
|
|
48
|
+
types: readonly string[];
|
|
28
49
|
enabled: boolean;
|
|
29
50
|
lastStatus: number | null;
|
|
30
51
|
lastAt: string | null;
|
|
31
52
|
}>;
|
|
32
53
|
/**
|
|
33
|
-
* json
|
|
54
|
+
* json の形式の本文の版2(編集機能を持つ型の出来事、署名はヘッダー x-cms-signature で登録ごとの鍵)
|
|
34
55
|
* - id: イベントの ID(再送しても同じ値、受け手は処理済みの id を捨てて重複を除く)
|
|
56
|
+
* - event: 操作、type: 型の id
|
|
35
57
|
* - item: 行の ID と題、by: 操作した人の表示名、at: 出来事の日時(ISO 8601、再送しても同じ値)
|
|
36
58
|
*/
|
|
37
|
-
export type
|
|
59
|
+
export type WebhookBodyV2 = Readonly<{
|
|
60
|
+
version: 2;
|
|
61
|
+
id: string;
|
|
62
|
+
event: WebhookAction;
|
|
63
|
+
type: string;
|
|
64
|
+
item: Readonly<{
|
|
65
|
+
id: string;
|
|
66
|
+
title: string;
|
|
67
|
+
}>;
|
|
68
|
+
by: string;
|
|
69
|
+
at: string;
|
|
70
|
+
}>;
|
|
71
|
+
/** json の形式の本文の版1(event は <型の id>.<操作>、ほかは版2と同じ。版1の登録だけに送る) */
|
|
72
|
+
export type WebhookBodyV1 = Readonly<{
|
|
73
|
+
version: 1;
|
|
38
74
|
id: string;
|
|
39
75
|
event: WebhookEvent;
|
|
40
76
|
type: string;
|
|
@@ -45,7 +81,17 @@ export type WebhookBody = Readonly<{
|
|
|
45
81
|
by: string;
|
|
46
82
|
at: string;
|
|
47
83
|
}>;
|
|
48
|
-
/**
|
|
84
|
+
/** json の形式の本文(編集機能を持つ型の出来事、version で形を判別) */
|
|
85
|
+
export type WebhookBody = WebhookBodyV2 | WebhookBodyV1;
|
|
86
|
+
/** json の形式の拡張機能の出来事の本文(event は宣言の名前、data はモジュールの値、形は版1と版2で同じ) */
|
|
87
|
+
export type WebhookModuleBody = Readonly<{
|
|
88
|
+
version: WebhookVersion;
|
|
89
|
+
id: string;
|
|
90
|
+
event: WebhookEvent;
|
|
91
|
+
data: Readonly<Record<string, unknown>>;
|
|
92
|
+
at: string;
|
|
93
|
+
}>;
|
|
94
|
+
/** 送信の記録(event は出来事のキー、attempt は何回目の送信か、retryAt は次の再送の予定の日時、再送なしは null) */
|
|
49
95
|
export type WebhookDelivery = Readonly<{
|
|
50
96
|
id: number;
|
|
51
97
|
source: 'webhook' | 'function';
|
|
@@ -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) */
|
|
@@ -2,8 +2,8 @@ import { type ContentModel } from './model.js';
|
|
|
2
2
|
/** 変更の扱い */
|
|
3
3
|
export type ChangeLevel = 'safe' | 'confirm' | 'forbidden';
|
|
4
4
|
/** 変更の種類 */
|
|
5
|
-
export type ChangeKind = 'type-added' | 'type-removed' | 'type-changed' | 'format-changed' | 'publishing-changed' | 'publishing-removed' | 'fixed-changed' | 'field-added' | 'field-removed' | 'field-changed' | 'field-type-changed' | 'field-key-reused' | 'required-added' | 'constraint-tightened' | 'option-added' | 'option-removed' | 'component-added' | 'component-changed' | 'component-removed';
|
|
6
|
-
/** スキーマの1つの変更(id は確認と置き換え先の指定で使用する識別子、path は項目の key を `.` で連結、value
|
|
5
|
+
export type ChangeKind = 'type-added' | 'type-removed' | 'type-renamed' | 'type-rename-invalid' | 'type-changed' | 'format-changed' | 'publishing-changed' | 'publishing-removed' | 'fixed-changed' | 'field-added' | 'field-removed' | 'field-changed' | 'field-type-changed' | 'field-key-reused' | 'required-added' | 'constraint-tightened' | 'option-added' | 'option-removed' | 'component-added' | 'component-changed' | 'component-removed';
|
|
6
|
+
/** スキーマの1つの変更(id は確認と置き換え先の指定で使用する識別子、path は項目の key を `.` で連結、value は削除した選択肢の値・型の旧の id) */
|
|
7
7
|
export type SchemaChange = Readonly<{
|
|
8
8
|
id: string;
|
|
9
9
|
level: ChangeLevel;
|
|
@@ -13,9 +13,18 @@ export type SchemaChange = Readonly<{
|
|
|
13
13
|
value?: string;
|
|
14
14
|
message: string;
|
|
15
15
|
}>;
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* 差分の条件
|
|
18
|
+
* - history: 保存済みの版より古い過去の版
|
|
19
|
+
* - renames: 型の id の変更(旧の id → 新しい id)
|
|
20
|
+
* - takenIds: 行が残る型の id(削除した型の行、id の変更先に不可)
|
|
21
|
+
*/
|
|
17
22
|
export type DiffOptions = Readonly<{
|
|
18
23
|
history?: readonly ContentModel[];
|
|
24
|
+
renames?: Readonly<Record<string, string>>;
|
|
25
|
+
takenIds?: readonly string[];
|
|
19
26
|
}>;
|
|
20
27
|
/** 保存済みの版 prev から新しい定義 next への変更(型の順、項目の順) */
|
|
21
28
|
export declare function diffSchema(prev: ContentModel, next: ContentModel, options?: DiffOptions): SchemaChange[];
|
|
29
|
+
/** 型の id を from から to に変えた定義(型の id と、すべての型の参照の to) */
|
|
30
|
+
export declare const renameType: (model: ContentModel, from: string, to: string) => ContentModel;
|
|
@@ -3,8 +3,8 @@ export { assetRefSchema, cropSchema, hotspotSchema, mediaSchema, type Asset, typ
|
|
|
3
3
|
export { coverPosition, coverStart, cropRect, croppedHotspot, objectPosition, stillOf, type CropRect } from './image.js';
|
|
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
|
-
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';
|
|
6
|
+
export { diffSchema, renameType, type ChangeKind, type ChangeLevel, type DiffOptions, type SchemaChange } from './changes.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 { EmbedContext, EmbedMessage, FunctionHook, FunctionRequest, PublishCheckRequest, PublishCheckResponse, SaveCheckRequest, SaveCheckResponse, WebhookAction, WebhookBody, WebhookEvent } 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';
|
|
6
|
+
export type { EmbedContext, EmbedMessage, FunctionHook, FunctionRequest, PublishCheckRequest, PublishCheckResponse, SaveCheckRequest, SaveCheckResponse, WebhookAction, WebhookBody, WebhookBodyV1, WebhookBodyV2, WebhookEvent, WebhookModuleBody, WebhookVersion } 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';
|