@diagonal-hq/cli 0.24.0 → 0.25.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.
@@ -6480,7 +6480,7 @@ type SdkHooks = {
6480
6480
  * Keys are isolated from the app's other React Query caches. Begin a key with
6481
6481
  * `'records'` when the endpoint's result depends on resource records, for example
6482
6482
  * `['records', resource.id, 'summary']`; successful resource create/update/delete/restore
6483
- * operations then invalidate it automatically. Other keys refresh only through their
6483
+ * operations and record form submits then invalidate it automatically. Other keys refresh only through their
6484
6484
  * returned `invalidate` function.
6485
6485
  *
6486
6486
  * Keep the key the same between renders. A clock read such as `Date.now()` in the key
@@ -7719,6 +7719,9 @@ type SdkHooks = {
7719
7719
  * `form.errors` contains only 422 field validation. Other failures are available
7720
7720
  * as `form.failure`; for example, branch on
7721
7721
  * `Sdk.utils.error.isConflict(form.failure)` without inspecting status codes.
7722
+ * A successful submit refreshes no other page data. Call the `invalidate()` of the
7723
+ * data that the workflow changed in `onSuccess`, or `Sdk.hooks.useInvalidateAll()`
7724
+ * when the page cannot name it.
7722
7725
  * Success callbacks receive the parsed workflow body directly. Synchronous
7723
7726
  * output can be a scalar, list, record, or object; asynchronous workflows return
7724
7727
  * `{ execution_id }`. Narrow the value before reading authored output fields.
@@ -7804,6 +7807,12 @@ type SdkHooks = {
7804
7807
  * `reset()` also starts a fresh key lifecycle. The hook does not poll asynchronous
7805
7808
  * executions.
7806
7809
  *
7810
+ * A successful run refreshes no other page data. When the workflow changes data that
7811
+ * the page shows, call that data's `invalidate()` in `onSuccess`. Use
7812
+ * `Sdk.hooks.useInvalidateAll()` only when the page cannot name what changed. A
7813
+ * workflow that only reads, such as a search called inside a `Sdk.hooks.useApi`
7814
+ * fetcher, needs no `onSuccess`.
7815
+ *
7807
7816
  * @example
7808
7817
  * ```tsx
7809
7818
  * function ReserveButton({ slotId }) {
@@ -14177,7 +14186,9 @@ type WorkflowFormProps = {
14177
14186
  * suppress. */
14178
14187
  successMessage?: string | null;
14179
14188
 
14180
- /** Called after a successful submission with the workflow's response payload. */
14189
+ /** Called after a successful submission with the workflow's response payload. A
14190
+ * submission refreshes no other page data, so call the `invalidate()` of the data
14191
+ * that the workflow changed here. */
14181
14192
  onSuccess?: (response: SdkWorkflowResponse) => void;
14182
14193
 
14183
14194
  /** Called when the submission resolves with a non-2xx response, with
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diagonal-hq/cli",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "The diagonal CLI and the configuration helpers for file-based Diagonal workspaces.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {