Skip to content

Commit 7f9888a

Browse files
committedAug 29, 2024
docs: update documentation links
1 parent 81cd392 commit 7f9888a

File tree

8 files changed

+22
-22
lines changed

8 files changed

+22
-22
lines changed
 

‎packages/next-safe-action/src/action-builder.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -395,15 +395,15 @@ export function actionBuilder<
395395
* Define the action.
396396
* @param serverCodeFn Code that will be executed on the **server side**
397397
*
398-
* {@link https://next-safe-action.dev/docs/safe-action-client/instance-methods#action--stateaction See docs for more information}
398+
* {@link https://next-safe-action.dev/docs/define-actions/instance-methods#action--stateaction See docs for more information}
399399
*/
400400
action: buildAction({ withState: false }).action,
401401

402402
/**
403-
* Define the stateful action. To be used with the [`useStateAction`](https://next-safe-action.dev/docs/execution/hooks/usestateaction) hook.
403+
* Define the stateful action. To be used with the [`useStateAction`](https://next-safe-action.dev/docs/execute-actions/hooks/usestateaction) hook.
404404
* @param serverCodeFn Code that will be executed on the **server side**
405405
*
406-
* {@link https://next-safe-action.dev/docs/safe-action-client/instance-methods#action--stateaction See docs for more information}
406+
* {@link https://next-safe-action.dev/docs/define-actions/instance-methods#action--stateaction See docs for more information}
407407
*/
408408
stateAction: buildAction({ withState: true }).action,
409409
};

‎packages/next-safe-action/src/adapters/typebox.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2323
// SOFTWARE.
2424

25-
import type { TSchema } from "@sinclair/typebox";
25+
import { type TSchema } from "@sinclair/typebox";
2626
import { TypeCompiler } from "@sinclair/typebox/compiler";
2727
import type { IfInstalled, Infer, ValidationAdapter } from "./types";
2828

‎packages/next-safe-action/src/hooks.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { isError } from "./utils";
2424
* @param safeActionFn The action function
2525
* @param utils Optional base utils and callbacks
2626
*
27-
* {@link https://next-safe-action.dev/docs/execution/hooks/useaction See docs for more information}
27+
* {@link https://next-safe-action.dev/docs/execute-actions/hooks/useaction See docs for more information}
2828
*/
2929
export const useAction = <
3030
ServerError,
@@ -144,7 +144,7 @@ export const useAction = <
144144
* @param safeActionFn The action function
145145
* @param utils Required `currentData` and `updateFn` and optional base utils and callbacks
146146
*
147-
* {@link https://next-safe-action.dev/docs/execution/hooks/useoptimisticaction See docs for more information}
147+
* {@link https://next-safe-action.dev/docs/execute-actions/hooks/useoptimisticaction See docs for more information}
148148
*/
149149
export const useOptimisticAction = <
150150
ServerError,

‎packages/next-safe-action/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export type * from "./validation-errors.types";
3131
* Note: this client only works with Zod as the validation library.
3232
* @param createOpts Initialization options
3333
*
34-
* {@link https://next-safe-action.dev/docs/safe-action-client/initialization-options See docs for more information}
34+
* {@link https://next-safe-action.dev/docs/define-actions/create-the-client#initialization-options See docs for more information}
3535
*/
3636
export const createSafeActionClient = <
3737
ODVES extends DVES | undefined = undefined,

‎packages/next-safe-action/src/middleware.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { MiddlewareFn } from "./index.types";
55
* properties, if you need one or all of them to be typed. The type for each property that is passed as generic is the
66
* **minimum** shape required to define the middleware function, but it can also be larger than that.
77
*
8-
* {@link https://next-safe-action.dev/docs/safe-action-client/middleware#create-standalone-middleware-with-createmiddleware See docs for more information}
8+
* {@link https://next-safe-action.dev/docs/define-actions/middleware#create-standalone-middleware-with-createmiddleware See docs for more information}
99
*/
1010
export const createMiddleware = <BaseData extends { serverError?: any; ctx?: object; metadata?: any }>() => {
1111
return {

‎packages/next-safe-action/src/safe-action-client.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class SafeActionClient<
8989
* Use a middleware function.
9090
* @param middlewareFn Middleware function
9191
*
92-
* {@link https://next-safe-action.dev/docs/safe-action-client/instance-methods#use See docs for more information}
92+
* {@link https://next-safe-action.dev/docs/define-actions/instance-methods#use See docs for more information}
9393
*/
9494
use<NextCtx extends object>(middlewareFn: MiddlewareFn<ServerError, MD, Ctx, Ctx & NextCtx>) {
9595
return new SafeActionClient({
@@ -112,9 +112,9 @@ export class SafeActionClient<
112112

113113
/**
114114
* Define metadata for the action.
115-
* @param data Metadata with the same type as the return value of the [`defineMetadataSchema`](https://next-safe-action.dev/docs/safe-action-client/initialization-options#definemetadataschema) optional initialization function
115+
* @param data Metadata with the same type as the return value of the [`defineMetadataSchema`](https://next-safe-action.dev/docs/define-actions/create-the-client#definemetadataschema) optional initialization function
116116
*
117-
* {@link https://next-safe-action.dev/docs/safe-action-client/instance-methods#metadata See docs for more information}
117+
* {@link https://next-safe-action.dev/docs/define-actions/instance-methods#metadata See docs for more information}
118118
*/
119119
metadata(data: MD) {
120120
return new SafeActionClient({
@@ -140,7 +140,7 @@ export class SafeActionClient<
140140
* @param inputSchema Input validation schema
141141
* @param utils Optional utils object
142142
*
143-
* {@link https://next-safe-action.dev/docs/safe-action-client/instance-methods#inputschema See docs for more information}
143+
* {@link https://next-safe-action.dev/docs/define-actions/create-the-client#inputschema See docs for more information}
144144
*/
145145
schema<
146146
OIS extends Schema | ((prevSchema: IS) => Promise<Schema>), // override input schema
@@ -183,7 +183,7 @@ export class SafeActionClient<
183183
* @param bindArgsSchemas Bind args input validation schemas
184184
* @param utils Optional utils object
185185
*
186-
* {@link https://next-safe-action.dev/docs/safe-action-client/instance-methods#bindargsschemas See docs for more information}
186+
* {@link https://next-safe-action.dev/docs/define-actions/instance-methods#bindargsschemas See docs for more information}
187187
*/
188188
bindArgsSchemas<
189189
const OBAS extends readonly Schema[],
@@ -217,7 +217,7 @@ export class SafeActionClient<
217217
* Define the output data validation schema for the action.
218218
* @param schema Output data validation schema
219219
*
220-
* {@link https://next-safe-action.dev/docs/safe-action-client/instance-methods#outputschema See docs for more information}
220+
* {@link https://next-safe-action.dev/docs/define-actions/create-the-client#outputschema See docs for more information}
221221
*/
222222
outputSchema<OOS extends Schema>(dataSchema: OOS) {
223223
return new SafeActionClient({
@@ -243,7 +243,7 @@ export class SafeActionClient<
243243
* @param serverCodeFn Code that will be executed on the **server side**
244244
* @param [cb] Optional callbacks that will be called after action execution, on the server.
245245
*
246-
* {@link https://next-safe-action.dev/docs/safe-action-client/instance-methods#action--stateaction See docs for more information}
246+
* {@link https://next-safe-action.dev/docs/define-actions/instance-methods#action--stateaction See docs for more information}
247247
*/
248248
action<Data extends OS extends Schema ? Infer<OS> : any>(
249249
serverCodeFn: ServerCodeFn<MD, Ctx, IS, BAS, Data>,
@@ -268,11 +268,11 @@ export class SafeActionClient<
268268

269269
/**
270270
* Define the stateful action.
271-
* To be used with the [`useStateAction`](https://next-safe-action.dev/docs/execution/hooks/usestateaction) hook.
271+
* To be used with the [`useStateAction`](https://next-safe-action.dev/docs/execute-actions/hooks/usestateaction) hook.
272272
* @param serverCodeFn Code that will be executed on the **server side**
273273
* @param [cb] Optional callbacks that will be called after action execution, on the server.
274274
*
275-
* {@link https://next-safe-action.dev/docs/safe-action-client/instance-methods#action--stateaction See docs for more information}
275+
* {@link https://next-safe-action.dev/docs/define-actions/instance-methods#action--stateaction See docs for more information}
276276
*/
277277
stateAction<Data extends OS extends Schema ? Infer<OS> : any>(
278278
serverCodeFn: StateServerCodeFn<ServerError, MD, Ctx, IS, BAS, CVE, CBAVE, Data>,

‎packages/next-safe-action/src/stateful-hooks.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import type { InferIn, Schema } from "./adapters/types";
77
import { getActionShorthandStatusObject, getActionStatus, useActionCallbacks, useExecuteOnMount } from "./hooks-utils";
88
import type { HookBaseUtils, HookCallbacks, HookSafeStateActionFn, UseStateActionHookReturn } from "./hooks.types";
99
/**
10-
* Use the stateful action from a Client Component via hook. Used for actions defined with [`stateAction`](https://next-safe-action.dev/docs/safe-action-client/instance-methods#action--stateaction).
10+
* Use the stateful action from a Client Component via hook. Used for actions defined with [`stateAction`](https://next-safe-action.dev/docs/define-actions/instance-methods#action--stateaction).
1111
* @param safeActionFn The action function
1212
* @param utils Optional `initResult`, `permalink`, base utils and callbacks
1313
*
14-
* {@link https://next-safe-action.dev/docs/execution/hooks/usestateaction See docs for more information}
14+
* {@link https://next-safe-action.dev/docs/execute-actions/hooks/usestateaction See docs for more information}
1515
*/
1616
export const useStateAction = <
1717
ServerError,

‎packages/next-safe-action/src/validation-errors.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export class ActionValidationError<CVE> extends Error {
7575
* @param schema Input schema
7676
* @param validationErrors Validation errors object
7777
*
78-
* {@link https://next-safe-action.dev/docs/recipes/additional-validation-errors#returnvalidationerrors See docs for more information}
78+
* {@link https://next-safe-action.dev/docs/define-actions/validation-errors#returnvalidationerrors See docs for more information}
7979
*/
8080
export function returnValidationErrors<
8181
S extends Schema | (() => Promise<Schema>),
@@ -109,7 +109,7 @@ export function formatBindArgsValidationErrors<BAVE extends readonly ValidationE
109109
* Emulation of `zod`'s [`flatten`](https://zod.dev/ERROR_HANDLING?id=flattening-errors) function.
110110
* @param {ValidationErrors} [validationErrors] Validation errors object
111111
*
112-
* {@link https://next-safe-action.dev/docs/recipes/customize-validation-errors-format#flattenvalidationerrors-and-flattenbindargsvalidationerrors-utility-functions See docs for more information}
112+
* {@link https://next-safe-action.dev/docs/define-actions/validation-errors#flattenvalidationerrors-and-flattenbindargsvalidationerrors-utility-functions See docs for more information}
113113
*/
114114
export function flattenValidationErrors<VE extends ValidationErrors<any>>(validationErrors: VE) {
115115
const flattened: FlattenedValidationErrors<VE> = {
@@ -137,7 +137,7 @@ export function flattenValidationErrors<VE extends ValidationErrors<any>>(valida
137137
* Emulation of `zod`'s [`flatten`](https://zod.dev/ERROR_HANDLING?id=flattening-errors) function.
138138
* @param {ValidationErrors[]} [bindArgsValidationErrors] Bind arguments validation errors object
139139
*
140-
* {@link https://next-safe-action.dev/docs/recipes/customize-validation-errors-format#flattenvalidationerrors-and-flattenbindargsvalidationerrors-utility-functions See docs for more information}
140+
* {@link https://next-safe-action.dev/docs/define-actions/validation-errors#flattenvalidationerrors-and-flattenbindargsvalidationerrors-utility-functions See docs for more information}
141141
*/
142142
export function flattenBindArgsValidationErrors<BAVE extends readonly ValidationErrors<any>[]>(
143143
bindArgsValidationErrors: BAVE

0 commit comments

Comments
 (0)
Please sign in to comment.