@kubohiroya/turbowarp-cloudflare-worker 0.2.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.
@@ -0,0 +1,22 @@
1
+ # 固定入力の編集
2
+
3
+ S3-4のローカル実装です。対応GUIの固定入力機能は既定OFFです。旧GUI・API無し・固定入力機能OFFではブロックの従来動作を保ちます。`getInfo()` に存在する対象opcodeだけ登録し、再取得・APIの置換・拡張の`dispose()`・runtimeの破棄に対応します。既存SOURCEエディターとopcodeは分離しています。
4
+
5
+ |ブロックopcode|引数|UI|
6
+ |---|---|---|
7
+ |`createHandlerIr`|`METHOD`|既定値からの選択:`GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `OPTIONS`, `HEAD`|
8
+ |`createProtectedRouteIr`|`METHOD`|既定値からの選択:`GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `OPTIONS`, `HEAD`, `*`|
9
+ |`createProtectedRouteIr`|`ON_UNAUTHENTICATED`|既定値からの選択:`redirect-login`, `json-401`, `forbid-403`|
10
+ |`createBearerRouteIr`|`METHOD`|既定値からの選択:`GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `OPTIONS`, `HEAD`, `*`|
11
+ |`createBearerRoleRouteIr`|`METHOD`|既定値からの選択:`GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `OPTIONS`, `HEAD`, `*`|
12
+ |`createBearerScopeRouteIr`|`METHOD`|既定値からの選択:`GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `OPTIONS`, `HEAD`, `*`|
13
+
14
+ 数値の新規入力は、空白を除いた完全な有限JSON数値トークンを受け付け、指数表記・負のゼロ・表記を保持します。空文字、16進表記、先頭の`+`、先頭ゼロや未完成トークンは新規保存しません。既存値は開いただけで書き換えません。既存の有限数値別表記は参照用に投影し、未編集の生値を保ちます。未知の旧enum値も無操作では保存し直しません。
15
+
16
+ `METHOD` は前後空白を除いて大文字化します。`createHandlerIr` に `*` はありません。認証失敗時の動作は既存の `schemas/protected-routes.schema.json` の enum を参照し、旧Schemaの `$id` と既存データを維持します。
17
+
18
+ reporter接続は読取専用で、実行・置換しません。新しい選択や数値を保存するときだけ純粋codecとSchemaで検証します。検証失敗時は全変更を拒否し、ブロックや接続を部分的に書き換えません。
19
+
20
+ 正本は本ownerの `schemas/block-editor-fixed-inputs.schema.json`、TSモジュールは選択・参照用、`dist`は生成物です。外部候補取得や実行時Schema生成は行いません。
21
+
22
+ 切戻しはGUIの固定入力機能OFFで行えます。既存のプロジェクト形式・opcode・メニュー・defaultValue・実行時の処理は維持します。
package/docs/index.html CHANGED
@@ -9,8 +9,17 @@
9
9
  code{background:#f3f3f3;padding:.1em .3em;border-radius:.25em}
10
10
  pre{background:#f6f8fa;padding:1rem;overflow:auto;border-radius:.5rem}
11
11
  </style>
12
+ <style id="block-reference-style">
13
+ #extension-block-reference{max-width:72rem;margin:2rem auto;padding:1rem;line-height:1.6;overflow-wrap:anywhere}
14
+ #extension-block-reference .block-reference-entry{display:block;scroll-margin-top:6rem;margin:2rem 0;padding:1rem;border:1px solid currentColor;border-radius:.5rem}
15
+ #extension-block-reference .block-reference-table{overflow-x:auto}
16
+ #extension-block-reference table{border-collapse:collapse;width:100%}
17
+ #extension-block-reference th,#extension-block-reference td{text-align:left;vertical-align:top;border:1px solid currentColor;padding:.5rem}
18
+ #extension-block-reference code{white-space:pre-wrap}
19
+ #extension-block-reference a:focus-visible{outline:3px solid currentColor;outline-offset:3px}
20
+ </style>
12
21
  </head>
13
- <body>
22
+ <body><p lang="en" class="complete-block-reference-link"><a href="#extension-block-reference">Complete block reference (9 blocks)</a></p>
14
23
  <h1>turbowarp-cloudflare-worker</h1>
15
24
  <p>Cloudflare Workers TypeScript/Hono generation support for the turbowarp-http-server family.</p>
16
25
 
@@ -27,5 +36,29 @@
27
36
 
28
37
  <h2>Architecture</h2>
29
38
  <p>See <a href="architecture.ja.md">architecture.ja.md</a>.</p>
39
+ <!-- BEGIN COMPLETE BLOCK REFERENCE -->
40
+ <section lang="en" id="extension-block-reference" aria-labelledby="block-reference-title">
41
+ <h2 id="block-reference-title">TurboWarp HTTP Server Cloudflare: complete block reference</h2>
42
+ <p>All 9 blocks are documented below, including compatibility blocks and blocks available through optional features. Select a block to read its behavior, arguments, default values, and menu choices. Each block has a permanent link.</p>
43
+ <nav aria-label="Block reference"><ul><li><a href="#block-createHandlerIr"><code>Cloudflare handler [METHOD] [PATH] returns [BODY]</code></a></li>
44
+ <li><a href="#block-createWorkerIr"><code>Cloudflare Worker [NAME] with handlers JSON [HANDLERS]</code></a></li>
45
+ <li><a href="#block-generateFilesJson"><code>generated Cloudflare files JSON from IR [IR]</code></a></li>
46
+ <li><a href="#block-createProtectedRouteIr"><code>protected route [METHOD] [PATH] when unauthenticated [ON_UNAUTHENTICATED]</code></a></li>
47
+ <li><a href="#block-createAuthIr"><code>external OAuth/OIDC auth providers [PROVIDERS] protected routes JSON [PROTECTED_ROUTES]</code></a></li>
48
+ <li><a href="#block-createBearerRouteIr"><code>API route [METHOD] [PATH] requires bearer token</code></a></li>
49
+ <li><a href="#block-createBearerRoleRouteIr"><code>API route [METHOD] [PATH] requires bearer role [ROLE]</code></a></li>
50
+ <li><a href="#block-createBearerScopeRouteIr"><code>API route [METHOD] [PATH] requires bearer scope [SCOPE]</code></a></li>
51
+ <li><a href="#block-createWorkerIrWithAuth"><code>Cloudflare Worker [NAME] with handlers JSON [HANDLERS] and auth JSON [AUTH]</code></a></li>
52
+ </ul></nav>
53
+ <article id="block-createHandlerIr" class="block-reference-entry"><h3><code>Cloudflare handler [METHOD] [PATH] returns [BODY]</code></h3><p>Creates a minimal HTTP handler IR JSON entry for the Cloudflare generator.</p><p>Block type: REPORTER. Opcode: <code>createHandlerIr</code>. <a href="#block-createHandlerIr">Permanent link</a></p><div class="block-reference-table"><table><thead><tr><th>Argument</th><th>Type</th><th>Default value</th><th>Menu choices</th></tr></thead><tbody><tr><th scope="row"><code>METHOD</code></th><td>STRING</td><td><code>GET</code></td><td></td></tr><tr><th scope="row"><code>PATH</code></th><td>STRING</td><td><code>/hello</code></td><td></td></tr><tr><th scope="row"><code>BODY</code></th><td>STRING</td><td><code>Hello from TurboWarp</code></td><td></td></tr></tbody></table></div><p lang="ja" class="fixed-input-help"><a href="#fixed-input-editors">このブロックの固定入力編集と互換性</a></p>
54
+ </article><article id="block-createWorkerIr" class="block-reference-entry"><h3><code>Cloudflare Worker [NAME] with handlers JSON [HANDLERS]</code></h3><p>Creates a deployable Worker IR JSON document from handler entries.</p><p>Block type: REPORTER. Opcode: <code>createWorkerIr</code>. <a href="#block-createWorkerIr">Permanent link</a></p><div class="block-reference-table"><table><thead><tr><th>Argument</th><th>Type</th><th>Default value</th><th>Menu choices</th></tr></thead><tbody><tr><th scope="row"><code>NAME</code></th><td>STRING</td><td><code>tw-http-app</code></td><td></td></tr><tr><th scope="row"><code>HANDLERS</code></th><td>STRING</td><td><code>[]</code></td><td></td></tr></tbody></table></div></article><article id="block-generateFilesJson" class="block-reference-entry"><h3><code>generated Cloudflare files JSON from IR [IR]</code></h3><p>Runs the Cloudflare Workers/Hono generator and returns GeneratedFile[] as JSON.</p><p>Block type: REPORTER. Opcode: <code>generateFilesJson</code>. <a href="#block-generateFilesJson">Permanent link</a></p><div class="block-reference-table"><table><thead><tr><th>Argument</th><th>Type</th><th>Default value</th><th>Menu choices</th></tr></thead><tbody><tr><th scope="row"><code>IR</code></th><td>STRING</td><td><code>{&quot;name&quot;:&quot;tw-http-app&quot;,&quot;handlers&quot;:[]}</code></td><td></td></tr></tbody></table></div></article><article id="block-createProtectedRouteIr" class="block-reference-entry"><h3><code>protected route [METHOD] [PATH] when unauthenticated [ON_UNAUTHENTICATED]</code></h3><p>Creates an auth guard IR entry for a route protected by external OAuth/OIDC.</p><p>Block type: REPORTER. Opcode: <code>createProtectedRouteIr</code>. <a href="#block-createProtectedRouteIr">Permanent link</a></p><div class="block-reference-table"><table><thead><tr><th>Argument</th><th>Type</th><th>Default value</th><th>Menu choices</th></tr></thead><tbody><tr><th scope="row"><code>METHOD</code></th><td>STRING</td><td><code>GET</code></td><td></td></tr><tr><th scope="row"><code>PATH</code></th><td>STRING</td><td><code>/private</code></td><td></td></tr><tr><th scope="row"><code>ON_UNAUTHENTICATED</code></th><td>STRING</td><td><code>redirect-login</code></td><td></td></tr></tbody></table></div><p lang="ja" class="fixed-input-help"><a href="#fixed-input-editors">このブロックの固定入力編集と互換性</a></p>
55
+ </article><article id="block-createAuthIr" class="block-reference-entry"><h3><code>external OAuth/OIDC auth providers [PROVIDERS] protected routes JSON [PROTECTED_ROUTES]</code></h3><p>Creates auth IR for Google, Microsoft, and GitHub account sign-in.</p><p>Block type: REPORTER. Opcode: <code>createAuthIr</code>. <a href="#block-createAuthIr">Permanent link</a></p><div class="block-reference-table"><table><thead><tr><th>Argument</th><th>Type</th><th>Default value</th><th>Menu choices</th></tr></thead><tbody><tr><th scope="row"><code>PROVIDERS</code></th><td>STRING</td><td><code>google,github</code></td><td></td></tr><tr><th scope="row"><code>PROTECTED_ROUTES</code></th><td>STRING</td><td><code>[]</code></td><td></td></tr></tbody></table></div></article><article id="block-createBearerRouteIr" class="block-reference-entry"><h3><code>API route [METHOD] [PATH] requires bearer token</code></h3><p>Creates a protected route IR entry that requires a valid self-issued ES256 bearer JWT.</p><p>Block type: REPORTER. Opcode: <code>createBearerRouteIr</code>. <a href="#block-createBearerRouteIr">Permanent link</a></p><div class="block-reference-table"><table><thead><tr><th>Argument</th><th>Type</th><th>Default value</th><th>Menu choices</th></tr></thead><tbody><tr><th scope="row"><code>METHOD</code></th><td>STRING</td><td><code>GET</code></td><td></td></tr><tr><th scope="row"><code>PATH</code></th><td>STRING</td><td><code>/api/items</code></td><td></td></tr></tbody></table></div><p lang="ja" class="fixed-input-help"><a href="#fixed-input-editors">このブロックの固定入力編集と互換性</a></p>
56
+ </article><article id="block-createBearerRoleRouteIr" class="block-reference-entry"><h3><code>API route [METHOD] [PATH] requires bearer role [ROLE]</code></h3><p>Creates a bearer JWT protected route IR entry that also requires a role claim.</p><p>Block type: REPORTER. Opcode: <code>createBearerRoleRouteIr</code>. <a href="#block-createBearerRoleRouteIr">Permanent link</a></p><div class="block-reference-table"><table><thead><tr><th>Argument</th><th>Type</th><th>Default value</th><th>Menu choices</th></tr></thead><tbody><tr><th scope="row"><code>METHOD</code></th><td>STRING</td><td><code>POST</code></td><td></td></tr><tr><th scope="row"><code>PATH</code></th><td>STRING</td><td><code>/api/admin</code></td><td></td></tr><tr><th scope="row"><code>ROLE</code></th><td>STRING</td><td><code>admin</code></td><td></td></tr></tbody></table></div><p lang="ja" class="fixed-input-help"><a href="#fixed-input-editors">このブロックの固定入力編集と互換性</a></p>
57
+ </article><article id="block-createBearerScopeRouteIr" class="block-reference-entry"><h3><code>API route [METHOD] [PATH] requires bearer scope [SCOPE]</code></h3><p>Creates a bearer JWT protected route IR entry that also requires one or more scopes.</p><p>Block type: REPORTER. Opcode: <code>createBearerScopeRouteIr</code>. <a href="#block-createBearerScopeRouteIr">Permanent link</a></p><div class="block-reference-table"><table><thead><tr><th>Argument</th><th>Type</th><th>Default value</th><th>Menu choices</th></tr></thead><tbody><tr><th scope="row"><code>METHOD</code></th><td>STRING</td><td><code>POST</code></td><td></td></tr><tr><th scope="row"><code>PATH</code></th><td>STRING</td><td><code>/api/posts</code></td><td></td></tr><tr><th scope="row"><code>SCOPE</code></th><td>STRING</td><td><code>posts:write</code></td><td></td></tr></tbody></table></div><p lang="ja" class="fixed-input-help"><a href="#fixed-input-editors">このブロックの固定入力編集と互換性</a></p>
58
+ </article><article id="block-createWorkerIrWithAuth" class="block-reference-entry"><h3><code>Cloudflare Worker [NAME] with handlers JSON [HANDLERS] and auth JSON [AUTH]</code></h3><p>Creates Worker IR with an external OAuth/OIDC auth policy.</p><p>Block type: REPORTER. Opcode: <code>createWorkerIrWithAuth</code>. <a href="#block-createWorkerIrWithAuth">Permanent link</a></p><div class="block-reference-table"><table><thead><tr><th>Argument</th><th>Type</th><th>Default value</th><th>Menu choices</th></tr></thead><tbody><tr><th scope="row"><code>NAME</code></th><td>STRING</td><td><code>tw-http-app</code></td><td></td></tr><tr><th scope="row"><code>HANDLERS</code></th><td>STRING</td><td><code>[]</code></td><td></td></tr><tr><th scope="row"><code>AUTH</code></th><td>STRING</td><td><code>{&quot;mode&quot;:&quot;external-oauth-oidc&quot;,&quot;providers&quot;:[&quot;google&quot;],&quot;protectedRoutes&quot;:[]}</code></td><td></td></tr></tbody></table></div></article>
59
+ <p><a href="https://github.com/kubohiroya/turbowarp-cloudflare-worker/blob/main/README.md">Repository guide and examples</a></p>
60
+ </section>
61
+ <!-- END COMPLETE BLOCK REFERENCE -->
62
+ <section lang="ja" id="fixed-input-editors"><h2>固定入力の編集</h2><p>対応GUIの固定入力機能は既定OFFです。既存値は開いただけでは変更せず、reporter接続は評価・置換しません。新しい選択と有限JSON数値入力のみを検証して保存し、既存の補正・丸め処理を維持します。機能OFFで従来の編集へ戻せます。</p><p><a href="fixed-input-editors.ja.md">対象入力・Schemaの正本・互換性・切戻し</a></p></section>
30
63
  </body>
31
64
  </html>
@@ -0,0 +1,20 @@
1
+ # 段階2 Source/Form編集
2
+
3
+ この文書はローカル実装時の契約を示す。npm公開は実施しない。
4
+
5
+ - 対象: createWorkerIr.HANDLERS / generateFilesJson.IR / createAuthIr.PROTECTED_ROUTES / createWorkerIrWithAuth.HANDLERS+AUTH
6
+ - 契約: handler-ir / worker-ir / protected-routes / auth-ir
7
+ - Schema正本: schemas/{handler-ir,worker-ir,protected-routes,auth-ir}.schema.json。Schema文書はcanonical-schema、bundleは正本参照とprovenanceを保持する。
8
+ - owner受理条件: src/ir.ts の parseWorkerIr。HANDLERSとPROTECTED_ROUTESは単体objectまたは配列を受理。methodのtrim・大小文字とpath補完は検査時のみに用い、raw値を保存。worker.handlers/auth.providersの非配列を空配列として扱う既存受理も維持。closed enumは固定選択、method候補はGET/POST/PUT/PATCH/DELETE/OPTIONS/HEAD。
9
+
10
+ UIはSourceとFormを切り替える。無変更・cancel・編集後の元の値への復帰は入力文字列をそのまま保持する。Formの部分編集でも未知キー・null・空文字・配列の順序と重複・未編集箇所の表記を維持する。既定値の暗黙補完、variant/formatの暗黙移行、runtime正規化後の値の書き戻しは行わない。不正なsourceもSourceとして開き修復できるが、ownerに拒否される候補は保存できない。
11
+
12
+ 利用条件は、GUI起動時に `blockEditorDialogs=1` と `blockEditorSourceForms=1` の両方を指定し、信頼した拡張をunsandboxedで読み込むこと。`Scratch.gui.blockEditors` はunsandboxed拡張APIにのみ提供される。既存のsandbox実行権限や拡張の既定の読み込み方法は変更しない。sandboxed実行では従来のブロックを使用し、編集capabilityがないためフォーム登録を省略する。
13
+
14
+ 登録入口はoptionalな `Scratch.gui.blockEditors.registerSourceEditor`。GUIの起動時固定 `blockEditorSourceForms` は既定OFF、既存 `blockEditorDialogs` が前提となる。旧GUIやcapabilityを持たないhostでは登録を行わず、既存ブロックのAPI・引数・実行挙動は維持する。`dispose()` またはruntime破棄で登録を解除する。既存のruntime処理を実行せず、pure parser/validatorで保存候補の同じsourceを検査する。複数入力のブロックは単一editor definitionとして一度に検査・commitする。
15
+
16
+ 依存: 共通エディターの新 `./schema` 型・json-value契約と新prepared save経路、およびGUIのcapabilityが必要。ローカル検証は独立cloneから新共通artifactへaliasする。遠隔配布用のpin・lockは最終共通artifactのSHA確定後に揃える。架空のSHAを記載しない。
17
+
18
+ 受け入れ基準: 全対象inputの登録、既存受理との互換、Source修復、不正保存の拒否、no-opでundoを作らないこと、部分編集でraw値を維持すること、runtime破棄時の解除、既存APIのテスト・型検査・buildを確認する。原文不変・部分編集・拒否は `tests/source-editor.test.ts` から実際の共通serviceと接続して検証する。
19
+
20
+ ロールバック: 起動時 `blockEditorSourceForms` をOFFに戻してGUIを再起動する。登録capabilityを外すと新フォームは使用されず、既存のブロックと保存済みsourceは引き続き実行できる。Schema自体の編集・実行時の値からの動的Schema・値候補との接続は別工程。
@@ -0,0 +1,31 @@
1
+ # 段階2の安定版検証記録
2
+
3
+ 公開予定版: `@kubohiroya/turbowarp-cloudflare-worker@0.3.0`。4つの固定IR Schemaで5入力を編集します。HANDLERS + AUTH は単一transactionで保存し、Worker生成・deployは呼びません。
4
+
5
+ | opcode | 入力 |
6
+ | --- | --- |
7
+ | createWorkerIr | HANDLERS |
8
+ | generateFilesJson | IR |
9
+ | createAuthIr | PROTECTED_ROUTES |
10
+ | createWorkerIrWithAuth | HANDLERS, AUTH |
11
+
12
+ 正本は `schemas/{handler-ir,auth-ir,protected-routes,worker-ir}.schema.json` と既存 `src/ir.ts` のpure検証です。methodは固定候補から選択し、既存の大小文字・空白の正規化規則、未知キー、配列重複を維持します。
13
+
14
+ 共通依存は `76fa1d50a3c188082ceef723ea018a9d8769ea6e`(`@kubohiroya/turbowarp-extension-data-editor` 0.2.0)へGitの完全SHAで固定しています。manifest・lock・build許可・fresh実解決を揃え、直接・AJV経由のfast-uriを3.1.8へ統一しています。古い共有aliasの実解決を安定版の検証として流用していません。
15
+
16
+ Honoのdeclared range `^4.10.7` は維持し、既知moderate4件を修正する最小patch `4.13.7` へlockを更新しました。生成するWorkerのコード/APIは変更しません。
17
+
18
+ `react-dom@18.3.1` は実際のRJSF registration回帰テストに必要なdev依存として追加しました。拡張のruntimeコードはGUIのoptional APIを使い、ReactDOMを拡張bundleへ追加しません。
19
+
20
+ Node v22.23.3 / pnpm 11.11.0で、空の専用storeからscripts有効の `pnpm install --frozen-lockfile` を実施しました。Git prepareから得た共通packageにはsrcが含まれず、build-infoは上記SHAと一致します。
21
+
22
+ - 全テスト 18件、型検査、全lint、build、文書/リポジトリ検査、pack検査が成功しました。
23
+ - production auditはcritical/high/moderate/lowすべて0件です。
24
+ - dist 14件は2回のbuildでSHA-256が一致し、異なるcheckout pathのfresh fixtureと作業cloneでも全件のbytesが一致しました。
25
+ - Vite8を使う場合の生成region行にはpackage storeのpathが入るため、そのマーカー行だけを省きます。licenseコメントと実行コードは保持します。Vite7のrepoにはこの追加処理を適用しません。
26
+
27
+ 過去の段階2ローカル全体659件・実GUI5ケース(各8手順)は別の保存済み記録です。今回の数は当該repoのfresh full結果であり、繰り返し実行を合算していません。GitHub CIの結果はPRで別途確認します。
28
+
29
+ GUIの起動時固定・既定OFFの `blockEditorSourceForms` と `blockEditorDialogs` の両方、および信頼した拡張のunsandboxed読込を必要とします。旧API、ブロックのopcode/入力、raw保存形式を保持し、無変更・Cancelでは元の入力を維持します。検査した候補だけを保存し、複数入力はatomicに保存します。Schema自体の編集・動的Schema・既存候補への新規項目追加はこの段階に含みません。
30
+
31
+ ロールバックはflagをOFFにして再読込します。コードを戻す場合はconsumer→producer→共通の逆順でrevertし、manifest・lock・実解決を一体で戻します。以前の公開版 `@kubohiroya/turbowarp-cloudflare-worker@0.2.0` へ固定できます。保存形式を自動移行しません。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubohiroya/turbowarp-cloudflare-worker",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Cloudflare Workers TypeScript generator and TurboWarp extension bridge for turbowarp-http-server.",
5
5
  "author": "Hiroya Kubo <hiroya@cuc.ac.jp>",
6
6
  "license": "MPL-2.0",
@@ -64,17 +64,25 @@
64
64
  "turbowarp-cloudflare-worker": "./dist/cli.js"
65
65
  },
66
66
  "dependencies": {
67
- "hono": "^4.10.7"
67
+ "hono": "^4.10.7",
68
+ "@kubohiroya/turbowarp-extension-data-editor": "0.2.1"
68
69
  },
69
70
  "devDependencies": {
70
71
  "@cloudflare/workers-types": "^5.20260826.1",
71
72
  "@eslint/js": "^9.39.5",
72
- "@kubohiroya/vite-plugin-turbowarp-extension": "0.4.0",
73
+ "@kubohiroya/vite-plugin-turbowarp-extension": "0.6.1",
73
74
  "@types/node": "^24.13.3",
74
75
  "eslint": "^9.39.5",
75
76
  "typescript": "^5.9.3",
76
77
  "typescript-eslint": "^8.66.0",
77
78
  "vite": "^8.2.2",
78
- "vitest": "^4.1.10"
79
+ "vitest": "^4.1.10",
80
+ "react-dom": "18.3.1"
81
+ },
82
+ "gitHead": "fe4713e7f916ec0c1de1ee10873be635200582b7",
83
+ "x-turbowarp-source": {
84
+ "revision": "fe4713e7f916ec0c1de1ee10873be635200582b7",
85
+ "revisionRole": "base-commit",
86
+ "sourceState": "local-release-overlay"
79
87
  }
80
88
  }
@@ -0,0 +1,98 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kubohiroya.github.io/turbowarp-http-server-cloudflare/schemas/auth-ir.schema.json",
4
+ "type": "object",
5
+ "required": [
6
+ "mode"
7
+ ],
8
+ "properties": {
9
+ "mode": {
10
+ "const": "external-oauth-oidc"
11
+ },
12
+ "providers": {
13
+ "items": {
14
+ "enum": [
15
+ "google",
16
+ "microsoft",
17
+ "github"
18
+ ]
19
+ }
20
+ },
21
+ "session": {
22
+ "enum": [
23
+ "signed-cookie",
24
+ "bearer-jwt",
25
+ "cloudflare-access"
26
+ ]
27
+ },
28
+ "protectedRoutes": {
29
+ "type": "array",
30
+ "items": {
31
+ "type": "object",
32
+ "required": [
33
+ "method",
34
+ "path",
35
+ "onUnauthenticated"
36
+ ],
37
+ "properties": {
38
+ "method": {
39
+ "type": "string",
40
+ "minLength": 1
41
+ },
42
+ "path": {
43
+ "type": "string",
44
+ "minLength": 1
45
+ },
46
+ "onUnauthenticated": {
47
+ "enum": [
48
+ "redirect-login",
49
+ "json-401",
50
+ "forbid-403"
51
+ ]
52
+ },
53
+ "auth": {
54
+ "enum": [
55
+ "session",
56
+ "bearer-jwt"
57
+ ]
58
+ },
59
+ "requiredRole": {
60
+ "type": "string",
61
+ "minLength": 1
62
+ },
63
+ "requiredScopes": {
64
+ "type": "array",
65
+ "items": {
66
+ "type": "string",
67
+ "minLength": 1
68
+ }
69
+ }
70
+ }
71
+ }
72
+ },
73
+ "loginPath": {
74
+ "type": "string",
75
+ "minLength": 1
76
+ },
77
+ "callbackPath": {
78
+ "type": "string",
79
+ "minLength": 1
80
+ },
81
+ "logoutPath": {
82
+ "type": "string",
83
+ "minLength": 1
84
+ },
85
+ "mePath": {
86
+ "type": "string",
87
+ "minLength": 1
88
+ },
89
+ "jwtIssuerEnv": {
90
+ "type": "string",
91
+ "minLength": 1
92
+ },
93
+ "jwtAudienceEnv": {
94
+ "type": "string",
95
+ "minLength": 1
96
+ }
97
+ }
98
+ }
@@ -0,0 +1,119 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kubohiroya.github.io/turbowarp-cloudflare-worker/schemas/block-editor-fixed-inputs.schema.json",
4
+ "$defs": {
5
+ "createHandlerIr": {
6
+ "type": "object",
7
+ "properties": {
8
+ "METHOD": {
9
+ "type": "string",
10
+ "enum": [
11
+ "GET",
12
+ "POST",
13
+ "PUT",
14
+ "PATCH",
15
+ "DELETE",
16
+ "OPTIONS",
17
+ "HEAD"
18
+ ]
19
+ }
20
+ },
21
+ "required": [
22
+ "METHOD"
23
+ ],
24
+ "additionalProperties": true
25
+ },
26
+ "createProtectedRouteIr": {
27
+ "type": "object",
28
+ "properties": {
29
+ "METHOD": {
30
+ "type": "string",
31
+ "enum": [
32
+ "GET",
33
+ "POST",
34
+ "PUT",
35
+ "PATCH",
36
+ "DELETE",
37
+ "OPTIONS",
38
+ "HEAD",
39
+ "*"
40
+ ]
41
+ },
42
+ "ON_UNAUTHENTICATED": {
43
+ "$ref": "https://kubohiroya.github.io/turbowarp-http-server-cloudflare/schemas/protected-routes.schema.json#/anyOf/0/properties/onUnauthenticated"
44
+ }
45
+ },
46
+ "required": [
47
+ "METHOD",
48
+ "ON_UNAUTHENTICATED"
49
+ ],
50
+ "additionalProperties": true
51
+ },
52
+ "createBearerRouteIr": {
53
+ "type": "object",
54
+ "properties": {
55
+ "METHOD": {
56
+ "type": "string",
57
+ "enum": [
58
+ "GET",
59
+ "POST",
60
+ "PUT",
61
+ "PATCH",
62
+ "DELETE",
63
+ "OPTIONS",
64
+ "HEAD",
65
+ "*"
66
+ ]
67
+ }
68
+ },
69
+ "required": [
70
+ "METHOD"
71
+ ],
72
+ "additionalProperties": true
73
+ },
74
+ "createBearerRoleRouteIr": {
75
+ "type": "object",
76
+ "properties": {
77
+ "METHOD": {
78
+ "type": "string",
79
+ "enum": [
80
+ "GET",
81
+ "POST",
82
+ "PUT",
83
+ "PATCH",
84
+ "DELETE",
85
+ "OPTIONS",
86
+ "HEAD",
87
+ "*"
88
+ ]
89
+ }
90
+ },
91
+ "required": [
92
+ "METHOD"
93
+ ],
94
+ "additionalProperties": true
95
+ },
96
+ "createBearerScopeRouteIr": {
97
+ "type": "object",
98
+ "properties": {
99
+ "METHOD": {
100
+ "type": "string",
101
+ "enum": [
102
+ "GET",
103
+ "POST",
104
+ "PUT",
105
+ "PATCH",
106
+ "DELETE",
107
+ "OPTIONS",
108
+ "HEAD",
109
+ "*"
110
+ ]
111
+ }
112
+ },
113
+ "required": [
114
+ "METHOD"
115
+ ],
116
+ "additionalProperties": true
117
+ }
118
+ }
119
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kubohiroya.github.io/turbowarp-http-server-cloudflare/schemas/handler-ir.schema.json",
4
+ "anyOf": [
5
+ {
6
+ "type": "object",
7
+ "required": [
8
+ "method",
9
+ "path",
10
+ "responseText"
11
+ ],
12
+ "properties": {
13
+ "method": {
14
+ "type": "string",
15
+ "minLength": 1
16
+ },
17
+ "path": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "responseText": {
22
+ "type": "string",
23
+ "minLength": 1
24
+ }
25
+ }
26
+ },
27
+ {
28
+ "type": "array",
29
+ "items": {
30
+ "type": "object",
31
+ "required": [
32
+ "method",
33
+ "path",
34
+ "responseText"
35
+ ],
36
+ "properties": {
37
+ "method": {
38
+ "type": "string",
39
+ "minLength": 1
40
+ },
41
+ "path": {
42
+ "type": "string",
43
+ "minLength": 1
44
+ },
45
+ "responseText": {
46
+ "type": "string",
47
+ "minLength": 1
48
+ }
49
+ }
50
+ }
51
+ }
52
+ ]
53
+ }
@@ -0,0 +1,93 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kubohiroya.github.io/turbowarp-http-server-cloudflare/schemas/protected-routes.schema.json",
4
+ "anyOf": [
5
+ {
6
+ "type": "object",
7
+ "required": [
8
+ "method",
9
+ "path",
10
+ "onUnauthenticated"
11
+ ],
12
+ "properties": {
13
+ "method": {
14
+ "type": "string",
15
+ "minLength": 1
16
+ },
17
+ "path": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "onUnauthenticated": {
22
+ "enum": [
23
+ "redirect-login",
24
+ "json-401",
25
+ "forbid-403"
26
+ ]
27
+ },
28
+ "auth": {
29
+ "enum": [
30
+ "session",
31
+ "bearer-jwt"
32
+ ]
33
+ },
34
+ "requiredRole": {
35
+ "type": "string",
36
+ "minLength": 1
37
+ },
38
+ "requiredScopes": {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "string",
42
+ "minLength": 1
43
+ }
44
+ }
45
+ }
46
+ },
47
+ {
48
+ "type": "array",
49
+ "items": {
50
+ "type": "object",
51
+ "required": [
52
+ "method",
53
+ "path",
54
+ "onUnauthenticated"
55
+ ],
56
+ "properties": {
57
+ "method": {
58
+ "type": "string",
59
+ "minLength": 1
60
+ },
61
+ "path": {
62
+ "type": "string",
63
+ "minLength": 1
64
+ },
65
+ "onUnauthenticated": {
66
+ "enum": [
67
+ "redirect-login",
68
+ "json-401",
69
+ "forbid-403"
70
+ ]
71
+ },
72
+ "auth": {
73
+ "enum": [
74
+ "session",
75
+ "bearer-jwt"
76
+ ]
77
+ },
78
+ "requiredRole": {
79
+ "type": "string",
80
+ "minLength": 1
81
+ },
82
+ "requiredScopes": {
83
+ "type": "array",
84
+ "items": {
85
+ "type": "string",
86
+ "minLength": 1
87
+ }
88
+ }
89
+ }
90
+ }
91
+ }
92
+ ]
93
+ }