Feature request: accommodations for event hooks

オープン
#1,455 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript
領域
api, backend

調査の方向性

Start by tracing the /update route, its POST body, and the UI's save handling using the existing network traffic described in the issue. Determine how collection and slug data, server reload signals, and HTTP error messages would fit together; done means the route contract and client behavior support these event-hook workflows.

索引モデルが issue の本文から書いたものです。

説明

I'm trying to add some automation & verification to my workflow. Some examples:

  • When a post is set to 'published', automatically set the 'published_at' field to the current time
  • A post may only be published if required fields are filled in
  • When a post is created, store a random nonce so I can pass around unpublished drafts with secret URLs
  • Disallow saving a post if it's already published and the slug would change
  • Alternatively, create a redirect if I change a post slug

I don't know what Keystatic plans for the long term, but I think right now I could do all of this with just a few small changes:

  1. Commit to the /update route being a stable API so I can build a middleware that intercepts it
  2. Include the collection name and slug as fields in the POST body to /update
  3. Allow the server to signal that the client needs to reload the post content. Maybe a header?
  4. Have the UI gracefully handle if the server returns an HTTP error status & error message when saving.

With these changes, my server can intercept post updates and change the content however it needs. Looking at the existing network traffic, this feels fairly non-intrusive, but offers big benefits.

主要言語
TypeScript
スター
2.5k
フォーク
176
平均マージ
5時間 46分
マージ済み PR(30日)
3

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Thinkmill/keystatic のほかの issue

Thinkmill/keystatic の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。