diff --git a/AGENTS.md b/AGENTS.md index f843b67f2..936c6f091 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,6 +33,7 @@ ``` docs/developer-docs/6.0.x/ ├── admin/ # Admin area customization (whitelabeling) +├── webiny-api/ # API customization (custom domain, extend GraphQL schema, universal API keys) ├── cli/ # CLI commands reference (deploy, destroy, watch, etc.) ├── core-concepts/ # Foundational knowledge: architecture, applications, project structure, DI, Result pattern, multi-tenancy, local dev, env vars ├── get-started/ # Welcome, installation, upgrade to Business @@ -48,8 +49,9 @@ docs/developer-docs/6.0.x/ │ └── features/ ├── reference/ # Auto-generated API reference (extensions, admin, API) ├── tasks/ # Background task system (about, reference, management) +├── security/ # Security (universal API keys, programmatic roles and teams) ├── tenant-manager/ # Multi-tenancy management (GraphQL API, model extension) -└── website-builder/ # Website Builder extensibility (Next.js setup, theming, custom components) +└── website-builder/ # Website Builder extensibility (Next.js setup, multi-tenant setup, theming, custom components) ``` ### Key Patterns @@ -151,7 +153,7 @@ import type { CmsEntry } from "webiny/api"; - **Bold** for key labels: `**Naming Convention:**`, `**Key Point:**` - Bullet lists use `-`, not numbered lists (even for sequential steps) - No emojis in prose -- Inline links use standard markdown: `[text](/docs/path)` +- Inline links use standard markdown: `[text](/{version}/path)` - "Webiny" always capitalized ## Tone and Voice diff --git a/docs/developer-docs/6.x/headless-cms/content-models-via-code.mdx b/docs/developer-docs/6.x/headless-cms/content-models-via-code.mdx index f05523eb2..73611a9d8 100644 --- a/docs/developer-docs/6.x/headless-cms/content-models-via-code.mdx +++ b/docs/developer-docs/6.x/headless-cms/content-models-via-code.mdx @@ -11,6 +11,7 @@ import { Alert } from "@/components/Alert"; - Why define content models via code? - How to create a content model using the [`ModelFactory`](/{version}/reference/api/cms/model#model-factory) API? - How to define reference fields and object fields? +- How to create single-entry and private models? - How to register models as extensions? @@ -98,14 +99,15 @@ export const Extensions = () => { **Model configuration** -| Method | Description | -| ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -| `.public({ modelId, name, group })` | Model is visible in the Admin sidebar and exposed via the Read, Preview, and Manage GraphQL endpoints | -| `.private({ modelId, name, group })` | Model is not visible in the Admin sidebar and not exposed via the public GraphQL endpoints; useful for internal or system-level models | -| `.description()` | Model description shown in the Admin | -| `.singularApiName()` / `.pluralApiName()` | GraphQL query names | -| `.layout()` | Defines how fields are arranged in rows in the Admin UI (`[["field1", "field2"], ["field3"]]`) | -| `.titleFieldId()` | Which field to use as the entry title in list views | +| Method | Description | +| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `.public({ modelId, name, group })` | Model is visible in the Admin sidebar and exposed via the Read, Preview, and Manage GraphQL endpoints | +| `.private({ modelId, name, group })` | Model is not visible in the Admin sidebar and not exposed via the public GraphQL endpoints; access data via use cases in backend code | +| `.singleEntry()` | Only one entry of this model can exist; the Admin shows the entry form directly instead of a list view | +| `.description()` | Model description shown in the Admin | +| `.singularApiName()` / `.pluralApiName()` | GraphQL query names | +| `.layout()` | Defines how fields are arranged in rows in the Admin UI (`[["field1", "field2"], ["field3"]]`) | +| `.titleFieldId()` | Which field to use as the entry title in list views | **Field types** @@ -236,6 +238,41 @@ All renderer names are available via TypeScript autocomplete when calling `.rend | Special | `dynamicZone`, `hidden`, `passthrough` | | UI elements | `uiSeparator`, `uiAlert`, `uiTabs` | +## Single-Entry Models + +A single-entry model allows only one entry to exist. Call `.singleEntry()` on the builder to enable this mode. It is useful for global site settings, per-tenant configuration, or any data that should have exactly one record. + +```typescript extensions/siteSettingsModel.ts +import { ModelFactory } from "webiny/api/cms/model"; + +class SiteSettingsModelImpl implements ModelFactory.Interface { + async execute(builder: ModelFactory.Builder) { + return [ + builder + .public({ + modelId: "siteSettings", + name: "Site Settings", + group: "ungrouped" + }) + .singleEntry() + .fields(fields => ({ + googleAnalyticsId: fields.text().renderer("textInput").label("Google Analytics ID"), + facebookPixelId: fields.text().renderer("textInput").label("Facebook Pixel ID") + })) + .singularApiName("SiteSetting") + .pluralApiName("SiteSettings") + ]; + } +} + +export default ModelFactory.createImplementation({ + implementation: SiteSettingsModelImpl, + dependencies: [] +}); +``` + +The entry is available on both the Manage and Read GraphQL endpoints. The Admin shows the entry form directly — there is no list view. + ## Deploying Changes After creating or modifying a model extension, deploy the API: diff --git a/docs/developer-docs/6.x/navigation.tsx b/docs/developer-docs/6.x/navigation.tsx index a06af56ce..997781e25 100644 --- a/docs/developer-docs/6.x/navigation.tsx +++ b/docs/developer-docs/6.x/navigation.tsx @@ -43,6 +43,20 @@ export const Navigation = ({ children }: { children: React.ReactNode }) => { + + + + + + + + + + { {/* */} {/**/} - - - - { > + + + { + + + + + {/**/} {/* */} {/* */} @@ -130,6 +155,7 @@ export const Navigation = ({ children }: { children: React.ReactNode }) => { {/* */} {/* */} {/**/} + @@ -177,82 +203,18 @@ export const Navigation = ({ children }: { children: React.ReactNode }) => { {/* __REFERENCE_PAGES_START__ */} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + {/* __SDK_PAGES_START__ */} + + + + + + + {/* __SDK_PAGES_END__ */} {/* __REFERENCE_PAGES_END__ */} diff --git a/docs/developer-docs/6.x/reference/admin.ai.txt b/docs/developer-docs/6.x/reference/admin.ai.txt deleted file mode 100644 index 77654e17c..000000000 --- a/docs/developer-docs/6.x/reference/admin.ai.txt +++ /dev/null @@ -1,29 +0,0 @@ -AI Context: Admin (reference/admin.mdx) - -Source of Information: -1. packages/webiny/src/admin.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app/src/shared/di/useFeature.ts — originating source -3. /Users/adrian/dev/wby-next/packages/app/src/errors/index.ts — originating source -4. /Users/adrian/dev/wby-next/packages/app-admin/src/permissions/index.ts — originating source -5. /Users/adrian/dev/wby-next/packages/app-admin/src/features/buildParams/index.ts — originating source -6. /Users/adrian/dev/wby-next/packages/app-admin/src/routes.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -useFeature, NetworkErrorEventHandler, createPermissionSchema, createHasPermission, createUsePermissions, BuildParam, BuildParams, Routes - -Import Path: webiny/admin - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin.mdx b/docs/developer-docs/6.x/reference/admin.mdx deleted file mode 100644 index 1cd2dcf0a..000000000 --- a/docs/developer-docs/6.x/reference/admin.mdx +++ /dev/null @@ -1,198 +0,0 @@ ---- -id: ywrtaw40 -title: Admin -description: "Admin app core: createFeature, createAbstraction, Provider, Plugin" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- Which event handlers can you implement? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin`. Import any of the items below directly from this path in your Webiny extensions. - -**Components** - - - -**Hooks** - - - -**Other** - - - -## Components - -### `Routes` - -**Constant** — imported from `webiny/admin` - -```typescript -import { Routes } from "webiny/admin"; -``` - -```typescript -export const Routes = { - Dashboard: new Route({ - name: "Dashboard", - path: "/" - }), - - FileManager: new Route({ - name: "FileManager", - path: "/file-manager" - }), - - CatchAll: new Route({ - name: "CatchAll", - path: "*" - }) -}; -``` - -## Hooks - -### `useFeature` - -**Function** — imported from `webiny/admin` - -```typescript -import { useFeature } from "webiny/admin"; -``` - -```typescript -export function useFeature(feature: FeatureDefinition): TExports; -``` - -## Other - -### `BuildParam` - -**Abstraction** — imported from `webiny/admin` - -```typescript -import { BuildParam } from "webiny/admin"; -``` - -**Interface `BuildParam.Interface`:** - -```typescript -interface BuildParam.Interface { - key: string; - value: any; -} -``` - -**Types:** - -```typescript -namespace BuildParam { - type Interface = IBuildParam; -} -``` - -### `BuildParams` - -**Abstraction** — imported from `webiny/admin` - -```typescript -import { BuildParams } from "webiny/admin"; -``` - -**Interface `BuildParams.Interface`:** - -```typescript -interface BuildParams.Interface { - get(key: string): T | null; -} -``` - -**Types:** - -```typescript -namespace BuildParams { - type Interface = IBuildParams; -} -``` - -### `createHasPermission` - -**Function** — imported from `webiny/admin` - -```typescript -import { createHasPermission } from "webiny/admin"; -``` - -```typescript -export function createHasPermission( - schema: S -): React.FC>; -``` - -### `createPermissionSchema` - -**Function** — imported from `webiny/admin` - -```typescript -import { createPermissionSchema } from "webiny/admin"; -``` - -```typescript -export function createPermissionSchema(config: T): T; -``` - -### `createUsePermissions` - -**Function** — imported from `webiny/admin` - -```typescript -import { createUsePermissions } from "webiny/admin"; -``` - -```typescript -export function createUsePermissions( - schema: S -): () => UsePermissionsResult; -``` - -### `NetworkErrorEventHandler` - -**Event Handler Abstraction** — imported from `webiny/admin` - -```typescript -import { NetworkErrorEventHandler } from "webiny/admin"; -``` - -**Interface `NetworkErrorEventHandler.Interface`:** - -```typescript -interface NetworkErrorEventHandler.Interface { - handle(event: NetworkErrorEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace NetworkErrorEventHandler { - type Interface = IEventHandler; -} -``` diff --git a/docs/developer-docs/6.x/reference/admin/aco.ai.txt b/docs/developer-docs/6.x/reference/admin/aco.ai.txt deleted file mode 100644 index 7a6e5aa77..000000000 --- a/docs/developer-docs/6.x/reference/admin/aco.ai.txt +++ /dev/null @@ -1,26 +0,0 @@ -AI Context: ACO (reference/admin/aco.mdx) - -Source of Information: -1. packages/webiny/src/admin/aco.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app-aco/src/hooks/useRecords.ts — originating source -3. /Users/adrian/dev/wby-next/packages/app-aco/src/hooks/useNavigateFolder.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -useRecords, useNavigateFolder - -Import Path: webiny/admin/aco - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/aco.mdx b/docs/developer-docs/6.x/reference/admin/aco.mdx deleted file mode 100644 index 36e32fb1a..000000000 --- a/docs/developer-docs/6.x/reference/admin/aco.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -id: ywrtaw4v -title: ACO -description: "ACO (Advanced Content Organisation) hooks and utilities" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/aco`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/aco`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `useNavigateFolder` - -**Constant** — imported from `webiny/admin/aco` - -```typescript -import { useNavigateFolder } from "webiny/admin/aco"; -``` - -```typescript -export const useNavigateFolder = () => { - const context = useContext(NavigateFolderContext); - if (!context) { - throw new Error("useNavigateFolder must be used within a NavigateFolderContext"); - } - - return context; -}; -``` - -## `useRecords` - -**Constant** — imported from `webiny/admin/aco` - -```typescript -import { useRecords } from "webiny/admin/aco"; -``` - -```typescript -export const useRecords = makeDecoratable((folderId?: string) => { - const context = useContext(SearchRecordsContext); - - if (!context) { - throw new Error("useSearchRecords must be used within a SearchRecordsContext"); - } - - const { folderIdPath } = useAcoApp(); - - const { currentFolderId } = useNavigateFolder(); - - const { - records, - loading, - meta, - -``` diff --git a/docs/developer-docs/6.x/reference/admin/build-params.ai.txt b/docs/developer-docs/6.x/reference/admin/build-params.ai.txt deleted file mode 100644 index 8b9d8acfa..000000000 --- a/docs/developer-docs/6.x/reference/admin/build-params.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Build Params (reference/admin/build-params.mdx) - -Source of Information: -1. packages/webiny/src/admin/build-params.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app-admin/src/features/buildParams/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -BuildParam, BuildParams - -Import Path: webiny/admin/build-params - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/build-params.mdx b/docs/developer-docs/6.x/reference/admin/build-params.mdx deleted file mode 100644 index 1ec993269..000000000 --- a/docs/developer-docs/6.x/reference/admin/build-params.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: ywrtaw4v -title: Build Params -description: "Reference for webiny/admin/build-params" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/build-params`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/build-params`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `BuildParam` - -**Abstraction** — imported from `webiny/admin/build-params` - -```typescript -import { BuildParam } from "webiny/admin/build-params"; -``` - -**Interface `BuildParam.Interface`:** - -```typescript -interface BuildParam.Interface { - key: string; - value: any; -} -``` - -**Types:** - -```typescript -namespace BuildParam { - type Interface = IBuildParam; -} -``` - -## `BuildParams` - -**Abstraction** — imported from `webiny/admin/build-params` - -```typescript -import { BuildParams } from "webiny/admin/build-params"; -``` - -**Interface `BuildParams.Interface`:** - -```typescript -interface BuildParams.Interface { - get(key: string): T | null; -} -``` - -**Types:** - -```typescript -namespace BuildParams { - type Interface = IBuildParams; -} -``` diff --git a/docs/developer-docs/6.x/reference/admin/buildParams.ai.txt b/docs/developer-docs/6.x/reference/admin/buildParams.ai.txt deleted file mode 100644 index 129386644..000000000 --- a/docs/developer-docs/6.x/reference/admin/buildParams.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Build Params (reference/admin/buildParams.mdx) - -Source of Information: -1. packages/webiny/src/admin/buildParams.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app-admin/src/features/buildParams/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -BuildParam, BuildParams - -Import Path: webiny/admin/buildParams - -Related Documents: -- docs/developer-docs/6.0.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.0.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/buildParams.mdx b/docs/developer-docs/6.x/reference/admin/buildParams.mdx deleted file mode 100644 index a3fd1fabb..000000000 --- a/docs/developer-docs/6.x/reference/admin/buildParams.mdx +++ /dev/null @@ -1,115 +0,0 @@ ---- -id: ywrtaw4v -title: Build Params -description: "Admin build parameter types" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/buildParams`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/buildParams`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `BuildParam` - -**Abstraction** — imported from `webiny/admin/buildParams` - -```typescript -import { BuildParam } from "webiny/admin/buildParams"; -``` - -**Interface `BuildParam.Interface`:** - -```typescript -interface BuildParam.Interface { - key: string; - value: any; -} -``` - -**Types:** - -```typescript -namespace BuildParam { - type Interface = IBuildParam; -} -``` - -**Usage:** - -```typescript -// extensions/MyImpl.ts -import { BuildParam } from "webiny/admin/buildParams"; - -class MyImpl implements MyUseCase.Interface { - public constructor(private buildParam: BuildParam.Interface) {} - - public async execute(/* ... */): Promise { - this.buildParam.key: string(/* ... */); - } -} - -export default MyUseCase.createImplementation({ - implementation: MyImpl, - dependencies: [BuildParam] -}); -``` - -## `BuildParams` - -**Abstraction** — imported from `webiny/admin/buildParams` - -```typescript -import { BuildParams } from "webiny/admin/buildParams"; -``` - -**Interface `BuildParams.Interface`:** - -```typescript -interface BuildParams.Interface { - get(key: string): T | null; -} -``` - -**Types:** - -```typescript -namespace BuildParams { - type Interface = IBuildParams; -} -``` - -**Usage:** - -```typescript -// extensions/MyImpl.ts -import { BuildParams } from "webiny/admin/buildParams"; - -class MyImpl implements MyUseCase.Interface { - public constructor(private buildParams: BuildParams.Interface) {} - - public async execute(/* ... */): Promise { - this.buildParams.get(/* ... */); - } -} - -export default MyUseCase.createImplementation({ - implementation: MyImpl, - dependencies: [BuildParams] -}); -``` diff --git a/docs/developer-docs/6.x/reference/admin/cms.ai.txt b/docs/developer-docs/6.x/reference/admin/cms.ai.txt deleted file mode 100644 index 8c368b204..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms.ai.txt +++ /dev/null @@ -1,32 +0,0 @@ -AI Context: CMS (reference/admin/cms.mdx) - -Source of Information: -1. packages/webiny/src/admin/cms.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app-headless-cms/src/admin/hooks/useQuery.ts — originating source -3. /Users/adrian/dev/wby-next/packages/app-headless-cms/src/admin/hooks/useCms.ts — originating source -4. /Users/adrian/dev/wby-next/packages/app-headless-cms/src/admin/hooks/useLazyQuery.ts — originating source -5. /Users/adrian/dev/wby-next/packages/app-headless-cms/src/admin/hooks/useMutation.ts — originating source -6. /Users/adrian/dev/wby-next/packages/app-headless-cms/src/admin/components/ModelProvider/index.ts — originating source -7. /Users/adrian/dev/wby-next/packages/app-headless-cms/src/admin/hooks/usePermission.ts — originating source -8. /Users/adrian/dev/wby-next/packages/app-headless-cms/src/routes.ts — originating source -9. /Users/adrian/dev/wby-next/packages/app-headless-cms-common/src/types/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -useQuery, useCms, useLazyQuery, useMutation, useModel, usePermission, Routes, CmsContentEntry, CmsModel, CmsModelField, CmsModelLayoutField, CmsIdentity - -Import Path: webiny/admin/cms - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/cms.mdx b/docs/developer-docs/6.x/reference/admin/cms.mdx deleted file mode 100644 index ea750f1f9..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms.mdx +++ /dev/null @@ -1,265 +0,0 @@ ---- -id: ywrtaw4v -title: CMS -description: "CMS admin hooks, types and utilities" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/cms`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/cms`. Import any of the items below directly from this path in your Webiny extensions. - -**Components** - - - -**Hooks** - - - -**Types** - - - -## Components - -### `Routes` - -**Constant** — imported from `webiny/admin/cms` - -```typescript -import { Routes } from "webiny/admin/cms"; -``` - -```typescript -export const Routes = { - ContentModelGroups: { - List: new Route({ - name: "Cms/ContentModelGroups/List", - path: "/cms/content-model-groups", - params: zod => { - return { - id: zod.string().optional(), - new: zod.boolean().optional() - }; - } - }) - }, - - ContentEntries: { - -``` - -## Hooks - -### `useCms` - -**Function** — imported from `webiny/admin/cms` - -```typescript -import { useCms } from "webiny/admin/cms"; -``` - -```typescript -export function useCms(); -``` - -### `useLazyQuery` - -**Constant** — imported from `webiny/admin/cms` - -```typescript -import { useLazyQuery } from "webiny/admin/cms"; -``` - -```typescript -export const useLazyQuery = function ( - query: DocumentNode, - options: LazyQueryHookOptions = {} -): QueryTuple { - const { apolloClient } = useCms(); - - return apolloUseLazyQuery(query, { - client: apolloClient, - ...options - }); -}; -``` - -### `useModel` - -**Function** — imported from `webiny/admin/cms` - -Get model from the current context. - -```typescript -import { useModel } from "webiny/admin/cms"; -``` - -```typescript -export function useModel(): UseModelReturnType; -``` - -### `useMutation` - -**Constant** — imported from `webiny/admin/cms` - -```typescript -import { useMutation } from "webiny/admin/cms"; -``` - -```typescript -export const useMutation = function ( - mutation: DocumentNode, - options: MutationHookOptions = {} -): MutationTuple { - const { apolloClient } = useCms(); - - return apolloUseMutation(mutation, { - client: apolloClient, - ...options - }); -}; -``` - -### `usePermission` - -**Constant** — imported from `webiny/admin/cms` - -```typescript -import { usePermission } from "webiny/admin/cms"; -``` - -```typescript -export const usePermission = makeDecoratable(() => { - const { identity } = useIdentity(); - - const hasFullAccess = useMemo(() => !!identity.getPermission("cms.*"), [identity]); - - const canRead = useCallback( - (permissionName: string): boolean => { - if (hasFullAccess) { - return true; - } - const permissions = - identity.getP -``` - -### `useQuery` - -**Constant** — imported from `webiny/admin/cms` - -```typescript -import { useQuery } from "webiny/admin/cms"; -``` - -```typescript -export const useQuery = function ( - query: DocumentNode, - options: QueryHookOptions = {} -): QueryResult { - const { apolloClient } = useCms(); - - return apolloUseQuery(query, { - client: apolloClient, - skip: !apolloClient, - ...options - }); -}; -``` - -## Types - -### `CmsContentEntry` - -**Type** — imported from `webiny/admin/cms` - -```typescript -import type { CmsContentEntry } from "webiny/admin/cms"; -``` - -```typescript -export interface CmsContentEntry { ... } -``` - -### `CmsIdentity` - -**Type** — imported from `webiny/admin/cms` - -```typescript -import type { CmsIdentity } from "webiny/admin/cms"; -``` - -```typescript -export interface CmsIdentity { - id: string; - displayName: string; - type: string; -} -``` - -### `CmsModel` - -**Type** — imported from `webiny/admin/cms` - -```typescript -import type { CmsModel } from "webiny/admin/cms"; -``` - -```typescript -export interface CmsModel { ... } -``` - -### `CmsModelField` - -**Type** — imported from `webiny/admin/cms` - -```typescript -import type { CmsModelField } from "webiny/admin/cms"; -``` - -```typescript -export type CmsModelField = T & { ... }; -``` - -### `CmsModelLayoutField` - -**Type** — imported from `webiny/admin/cms` - -```typescript -import type { CmsModelLayoutField } from "webiny/admin/cms"; -``` - -```typescript -export interface CmsModelLayoutField { - id: string; - type: string; - rules?: FieldRule[]; -} -``` diff --git a/docs/developer-docs/6.x/reference/admin/cms/entry/editor.ai.txt b/docs/developer-docs/6.x/reference/admin/cms/entry/editor.ai.txt deleted file mode 100644 index f770c5ce0..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/entry/editor.ai.txt +++ /dev/null @@ -1,28 +0,0 @@ -AI Context: Editor (reference/admin/cms/entry/editor.mdx) - -Source of Information: -1. packages/webiny/src/admin/cms/entry/editor.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app-headless-cms/src/admin/components/ContentEntryForm/useContentEntryForm.ts — originating source -3. /Users/adrian/dev/wby-next/packages/app-headless-cms/src/admin/views/contentEntries/hooks/index.ts — originating source -4. /Users/adrian/dev/wby-next/packages/app-headless-cms/src/admin/config/contentEntries/index.ts — originating source -5. /Users/adrian/dev/wby-next/packages/app-headless-cms/src/admin/views/contentEntries/hooks/useSingletonContentEntry.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -useContentEntryForm, useContentEntryEditor, ContentEntryEditorConfig, useSingleEntryContentEntry - -Import Path: webiny/admin/cms/entry/editor - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/cms/entry/editor.mdx b/docs/developer-docs/6.x/reference/admin/cms/entry/editor.mdx deleted file mode 100644 index 73fea49b7..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/entry/editor.mdx +++ /dev/null @@ -1,113 +0,0 @@ ---- -id: ywrtaw4v -title: Editor -description: "Content entry editor components and hooks" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/cms/entry/editor`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/cms/entry/editor`. Import any of the items below directly from this path in your Webiny extensions. - -**Components** - - - -**Hooks** - - - -## Components - -### `ContentEntryEditorConfig` - -**Constant** — imported from `webiny/admin/cms/entry/editor` - -```typescript -import { ContentEntryEditorConfig } from "webiny/admin/cms/entry/editor"; -``` - -```typescript -export const ContentEntryEditorConfig = Object.assign(base.Config, { - Actions, - FieldElement, - Width, - ValidationIndicators: ValidationIndicatorsConfig -}); -``` - -## Hooks - -### `useContentEntryEditor` - -**Constant** — imported from `webiny/admin/cms/entry/editor` - -```typescript -import { useContentEntryEditor } from "webiny/admin/cms/entry/editor"; -``` - -```typescript -export const useContentEntry = makeDecoratable(() => { - const context = useContext(ContentEntryContext); - if (!context) { - throw Error(`useContentEntry() hook can only be used within the ContentEntryContext provider.`); - } - return context; -}); -``` - -### `useContentEntryForm` - -**Constant** — imported from `webiny/admin/cms/entry/editor` - -```typescript -import { useContentEntryForm } from "webiny/admin/cms/entry/editor"; -``` - -```typescript -export const useContentEntryForm = makeDecoratable(() => { - const context = React.useContext(ContentEntryFormContext); - if (!context) { - throw new Error("ContentEntryFormProvider is missing in the component hierarchy!"); - } - - return context; -}); -``` - -### `useSingleEntryContentEntry` - -**Constant** — imported from `webiny/admin/cms/entry/editor` - -```typescript -import { useSingleEntryContentEntry } from "webiny/admin/cms/entry/editor"; -``` - -```typescript -export const useSingletonContentEntry = makeDecoratable(() => { - const context = useContext(SingletonContentEntryContext); - if (!context) { - throw Error( - `useSingletonContentEntry() hook can only be used within the SingletonContentEntryContext provider.` - ); - } - return context; -}); -``` diff --git a/docs/developer-docs/6.x/reference/admin/cms/entry/list.ai.txt b/docs/developer-docs/6.x/reference/admin/cms/entry/list.ai.txt deleted file mode 100644 index 2a7704f2c..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/entry/list.ai.txt +++ /dev/null @@ -1,26 +0,0 @@ -AI Context: List (reference/admin/cms/entry/list.mdx) - -Source of Information: -1. packages/webiny/src/admin/cms/entry/list.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app-headless-cms/src/admin/config/contentEntries/index.ts — originating source -3. /Users/adrian/dev/wby-next/packages/app-headless-cms/src/admin/hooks/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -ContentEntryListConfig, useContentEntriesList - -Import Path: webiny/admin/cms/entry/list - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/cms/entry/list.mdx b/docs/developer-docs/6.x/reference/admin/cms/entry/list.mdx deleted file mode 100644 index 4fc1e69f3..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/entry/list.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -id: ywrtaw4v -title: List -description: "Content entry list configuration" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/cms/entry/list`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/cms/entry/list`. Import any of the items below directly from this path in your Webiny extensions. - -**Components** - - - -**Other** - - - -## Components - -### `ContentEntryListConfig` - -**Constant** — imported from `webiny/admin/cms/entry/list` - -```typescript -import { ContentEntryListConfig } from "webiny/admin/cms/entry/list"; -``` - -```typescript -export const ContentEntryListConfig = Object.assign(PublicContentEntryListConfig, { Browser }); -``` - -## Other - -### `useContentEntriesList` - -**Export** — imported from `webiny/admin/cms/entry/list` - -```typescript -import { useContentEntriesList } from "webiny/admin/cms/entry/list"; -``` diff --git a/docs/developer-docs/6.x/reference/admin/cms/field-renderers/dynamic-zone.ai.txt b/docs/developer-docs/6.x/reference/admin/cms/field-renderers/dynamic-zone.ai.txt deleted file mode 100644 index 8021b1469..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/field-renderers/dynamic-zone.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Dynamic Zone (reference/admin/cms/field-renderers/dynamic-zone.mdx) - -Source of Information: -1. packages/webiny/src/admin/cms/field-renderers/dynamic-zone.ts — barrel re-export file - - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: - - -Import Path: webiny/admin/cms/field-renderers/dynamic-zone - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/cms/field-renderers/dynamic-zone.mdx b/docs/developer-docs/6.x/reference/admin/cms/field-renderers/dynamic-zone.mdx deleted file mode 100644 index 47801d2af..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/field-renderers/dynamic-zone.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -id: ywrtaw4v -title: Dynamic Zone -description: "Reference for webiny/admin/cms/field-renderers/dynamic-zone" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/cms/field-renderers/dynamic-zone`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/cms/field-renderers/dynamic-zone`. Import any of the items below directly from this path in your Webiny extensions. - -_No exported symbols found._ diff --git a/docs/developer-docs/6.x/reference/admin/cms/field-renderers/object.ai.txt b/docs/developer-docs/6.x/reference/admin/cms/field-renderers/object.ai.txt deleted file mode 100644 index 28277b00e..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/field-renderers/object.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Object (reference/admin/cms/field-renderers/object.mdx) - -Source of Information: -1. packages/webiny/src/admin/cms/field-renderers/object.ts — barrel re-export file - - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: - - -Import Path: webiny/admin/cms/field-renderers/object - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/cms/field-renderers/object.mdx b/docs/developer-docs/6.x/reference/admin/cms/field-renderers/object.mdx deleted file mode 100644 index 2ca35754a..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/field-renderers/object.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -id: ywrtaw4v -title: Object -description: "Reference for webiny/admin/cms/field-renderers/object" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/cms/field-renderers/object`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/cms/field-renderers/object`. Import any of the items below directly from this path in your Webiny extensions. - -_No exported symbols found._ diff --git a/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/dynamic-zone.ai.txt b/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/dynamic-zone.ai.txt deleted file mode 100644 index ef5bdb06c..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/dynamic-zone.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Dynamic Zone (reference/admin/cms/fieldRenderers/dynamic-zone.mdx) - -Source of Information: -1. packages/webiny/src/admin/cms/fieldRenderers/dynamic-zone.ts — barrel re-export file - - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: - - -Import Path: webiny/admin/cms/fieldRenderers/dynamic-zone - -Related Documents: -- docs/developer-docs/6.0.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.0.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/dynamic-zone.mdx b/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/dynamic-zone.mdx deleted file mode 100644 index d0715ac77..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/dynamic-zone.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -id: ywrtaw4v -title: Dynamic Zone -description: "Reference for webiny/admin/cms/fieldRenderers/dynamic-zone" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/cms/fieldRenderers/dynamic-zone`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/cms/fieldRenderers/dynamic-zone`. Import any of the items below directly from this path in your Webiny extensions. - -_No exported symbols found._ diff --git a/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/dynamicZone.ai.txt b/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/dynamicZone.ai.txt deleted file mode 100644 index bcd8aad34..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/dynamicZone.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: DynamicZone (reference/admin/cms/fieldRenderers/dynamicZone.mdx) - -Source of Information: -1. packages/webiny/src/admin/cms/fieldRenderers/dynamicZone.ts — barrel re-export file - - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: - - -Import Path: webiny/admin/cms/fieldRenderers/dynamicZone - -Related Documents: -- docs/developer-docs/6.0.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.0.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/dynamicZone.mdx b/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/dynamicZone.mdx deleted file mode 100644 index 348784ce4..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/dynamicZone.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -id: ywrtaw4v -title: DynamicZone -description: "Dynamic zone field renderer components" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/cms/fieldRenderers/dynamicZone`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/cms/fieldRenderers/dynamicZone`. Import any of the items below directly from this path in your Webiny extensions. - -_No exported symbols found._ diff --git a/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/object.ai.txt b/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/object.ai.txt deleted file mode 100644 index fcd502b81..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/object.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Object (reference/admin/cms/fieldRenderers/object.mdx) - -Source of Information: -1. packages/webiny/src/admin/cms/fieldRenderers/object.ts — barrel re-export file - - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: - - -Import Path: webiny/admin/cms/fieldRenderers/object - -Related Documents: -- docs/developer-docs/6.0.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.0.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/object.mdx b/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/object.mdx deleted file mode 100644 index 37925bb50..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/fieldRenderers/object.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -id: ywrtaw4v -title: Object -description: "Object field renderer components" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/cms/fieldRenderers/object`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/cms/fieldRenderers/object`. Import any of the items below directly from this path in your Webiny extensions. - -_No exported symbols found._ diff --git a/docs/developer-docs/6.x/reference/admin/cms/lexical.ai.txt b/docs/developer-docs/6.x/reference/admin/cms/lexical.ai.txt deleted file mode 100644 index 78042214d..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/lexical.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Lexical Editor (reference/admin/cms/lexical.mdx) - -Source of Information: -1. packages/webiny/src/admin/cms/lexical.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/lexical-editor/src/exports/admin/lexical.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -useLexicalEditorConfig, LexicalHtmlRenderer, getNodeFromSelection, useCurrentElement, useCurrentSelection, useDeriveValueFromSelection, useRichTextEditor, useFontColorPicker, useTextAlignmentAction, useTypographyAction, useIsMounted, Divider, DropDownItem, DropDown, Klass, LexicalNode - -Import Path: webiny/admin/cms/lexical - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/cms/lexical.mdx b/docs/developer-docs/6.x/reference/admin/cms/lexical.mdx deleted file mode 100644 index 38113ff49..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/lexical.mdx +++ /dev/null @@ -1,168 +0,0 @@ ---- -id: ywrtaw4v -title: Lexical Editor -description: "CMS Lexical rich-text editor config" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/cms/lexical`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/cms/lexical`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `Divider` - -**Export** — imported from `webiny/admin/cms/lexical` - -```typescript -import { Divider } from "webiny/admin/cms/lexical"; -``` - -## `DropDown` - -**Export** — imported from `webiny/admin/cms/lexical` - -```typescript -import { DropDown } from "webiny/admin/cms/lexical"; -``` - -## `DropDownItem` - -**Export** — imported from `webiny/admin/cms/lexical` - -```typescript -import { DropDownItem } from "webiny/admin/cms/lexical"; -``` - -## `getNodeFromSelection` - -**Export** — imported from `webiny/admin/cms/lexical` - -```typescript -import { getNodeFromSelection } from "webiny/admin/cms/lexical"; -``` - -## `Klass` - -**Type** — imported from `webiny/admin/cms/lexical` - -```typescript -import type { Klass } from "webiny/admin/cms/lexical"; -``` - -## `LexicalHtmlRenderer` - -**Export** — imported from `webiny/admin/cms/lexical` - -```typescript -import { LexicalHtmlRenderer } from "webiny/admin/cms/lexical"; -``` - -## `LexicalNode` - -**Type** — imported from `webiny/admin/cms/lexical` - -```typescript -import type { LexicalNode } from "webiny/admin/cms/lexical"; -``` - -## `useCurrentElement` - -**Export** — imported from `webiny/admin/cms/lexical` - -```typescript -import { useCurrentElement } from "webiny/admin/cms/lexical"; -``` - -## `useCurrentSelection` - -**Export** — imported from `webiny/admin/cms/lexical` - -```typescript -import { useCurrentSelection } from "webiny/admin/cms/lexical"; -``` - -## `useDeriveValueFromSelection` - -**Export** — imported from `webiny/admin/cms/lexical` - -```typescript -import { useDeriveValueFromSelection } from "webiny/admin/cms/lexical"; -``` - -## `useFontColorPicker` - -**Export** — imported from `webiny/admin/cms/lexical` - -```typescript -import { useFontColorPicker } from "webiny/admin/cms/lexical"; -``` - -## `useIsMounted` - -**Export** — imported from `webiny/admin/cms/lexical` - -```typescript -import { useIsMounted } from "webiny/admin/cms/lexical"; -``` - -## `useLexicalEditorConfig` - -**Export** — imported from `webiny/admin/cms/lexical` - -```typescript -import { useLexicalEditorConfig } from "webiny/admin/cms/lexical"; -``` - -## `useRichTextEditor` - -**Export** — imported from `webiny/admin/cms/lexical` - -```typescript -import { useRichTextEditor } from "webiny/admin/cms/lexical"; -``` - -## `useTextAlignmentAction` - -**Export** — imported from `webiny/admin/cms/lexical` - -```typescript -import { useTextAlignmentAction } from "webiny/admin/cms/lexical"; -``` - -## `useTypographyAction` - -**Export** — imported from `webiny/admin/cms/lexical` - -```typescript -import { useTypographyAction } from "webiny/admin/cms/lexical"; -``` diff --git a/docs/developer-docs/6.x/reference/admin/cms/model.ai.txt b/docs/developer-docs/6.x/reference/admin/cms/model.ai.txt deleted file mode 100644 index c0bc62491..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/model.ai.txt +++ /dev/null @@ -1,26 +0,0 @@ -AI Context: Model (reference/admin/cms/model.mdx) - -Source of Information: -1. packages/webiny/src/admin/cms/model.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app-headless-cms/src/admin/components/FieldEditor/EditFieldDialog/RulesEditor/index.ts — originating source -3. /Users/adrian/dev/wby-next/packages/app-headless-cms-common/src/Fields/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -RulesEditor, useFieldAccessControlRules, useFieldEffectiveRules - -Import Path: webiny/admin/cms/model - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/cms/model.mdx b/docs/developer-docs/6.x/reference/admin/cms/model.mdx deleted file mode 100644 index ed0d86bbd..000000000 --- a/docs/developer-docs/6.x/reference/admin/cms/model.mdx +++ /dev/null @@ -1,90 +0,0 @@ ---- -id: ywrtaw4v -title: Model -description: "Reference for webiny/admin/cms/model" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/cms/model`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/cms/model`. Import any of the items below directly from this path in your Webiny extensions. - -**Components** - - - -**Hooks** - - - -## Components - -### `RulesEditor` - -**Constant** — imported from `webiny/admin/cms/model` - -```typescript -import { RulesEditor } from "webiny/admin/cms/model"; -``` - -```typescript -export const RulesEditor = ({ - fieldOptions, - actionOptions = DEFAULT_ACTION_OPTIONS -}: RulesTabProps) => { - const bind = useBind({ name: "rules" }); - const allRules: FieldRule[] = bind.value || []; - const entryRules = allRules.filter(r => r.type === "condition"); - const otherRules = allRules.filter(r => r.type !== "condition"); - - const addRule = () => { - const newRule: -``` - -## Hooks - -### `useFieldAccessControlRules` - -**Function** — imported from `webiny/admin/cms/model` - -Hook that evaluates access control rules for the current identity. -Does not require `bindParentName` — only identity-based permissions. - -```typescript -import { useFieldAccessControlRules } from "webiny/admin/cms/model"; -``` - -```typescript -export function useFieldAccessControlRules( - item: HasRules -): Pick; -``` - -### `useFieldEffectiveRules` - -**Function** — imported from `webiny/admin/cms/model` - -Composes useParentRules and useFieldRules into a single hook -that returns the effective (intersected) rules. - -```typescript -import { useFieldEffectiveRules } from "webiny/admin/cms/model"; -``` - -```typescript -export function useFieldEffectiveRules(item: HasRules): EffectiveFieldRules; -``` diff --git a/docs/developer-docs/6.x/reference/admin/configs.ai.txt b/docs/developer-docs/6.x/reference/admin/configs.ai.txt deleted file mode 100644 index 8d8d1bbfc..000000000 --- a/docs/developer-docs/6.x/reference/admin/configs.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Configs (reference/admin/configs.mdx) - -Source of Information: -1. packages/webiny/src/admin/configs.ts — barrel re-export file - - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: - - -Import Path: webiny/admin/configs - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/configs.mdx b/docs/developer-docs/6.x/reference/admin/configs.mdx deleted file mode 100644 index 4f863d758..000000000 --- a/docs/developer-docs/6.x/reference/admin/configs.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -id: ywrtaw4v -title: Configs -description: "Admin configuration types" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/configs`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/configs`. Import any of the items below directly from this path in your Webiny extensions. - -_No exported symbols found._ diff --git a/docs/developer-docs/6.x/reference/admin/env-config.ai.txt b/docs/developer-docs/6.x/reference/admin/env-config.ai.txt deleted file mode 100644 index 1a7322e88..000000000 --- a/docs/developer-docs/6.x/reference/admin/env-config.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Env Config (reference/admin/env-config.mdx) - -Source of Information: -1. packages/webiny/src/admin/env-config.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app/src/features/envConfig/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -EnvConfig - -Import Path: webiny/admin/env-config - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/env-config.mdx b/docs/developer-docs/6.x/reference/admin/env-config.mdx deleted file mode 100644 index 62088ff73..000000000 --- a/docs/developer-docs/6.x/reference/admin/env-config.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -id: ywrtaw4v -title: Env Config -description: "Reference for webiny/admin/env-config" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/env-config`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/env-config`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `EnvConfig` - -**Constant** — imported from `webiny/admin/env-config` - -```typescript -import { EnvConfig } from "webiny/admin/env-config"; -``` - -```typescript -export const EnvConfig = new Abstraction("EnvConfig"); -``` diff --git a/docs/developer-docs/6.x/reference/admin/envConfig.ai.txt b/docs/developer-docs/6.x/reference/admin/envConfig.ai.txt deleted file mode 100644 index bdcd7a895..000000000 --- a/docs/developer-docs/6.x/reference/admin/envConfig.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Env Config (reference/admin/envConfig.mdx) - -Source of Information: -1. packages/webiny/src/admin/envConfig.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app/src/features/envConfig/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -EnvConfig - -Import Path: webiny/admin/envConfig - -Related Documents: -- docs/developer-docs/6.0.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.0.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/envConfig.mdx b/docs/developer-docs/6.x/reference/admin/envConfig.mdx deleted file mode 100644 index 4615fe11f..000000000 --- a/docs/developer-docs/6.x/reference/admin/envConfig.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -id: ywrtaw4v -title: Env Config -description: "Environment configuration for admin" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/envConfig`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/envConfig`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `EnvConfig` - -**Constant** — imported from `webiny/admin/envConfig` - -```typescript -import { EnvConfig } from "webiny/admin/envConfig"; -``` - -```typescript -export const EnvConfig = new Abstraction("EnvConfig"); -``` diff --git a/docs/developer-docs/6.x/reference/admin/form.ai.txt b/docs/developer-docs/6.x/reference/admin/form.ai.txt deleted file mode 100644 index b4cf9aa41..000000000 --- a/docs/developer-docs/6.x/reference/admin/form.ai.txt +++ /dev/null @@ -1,26 +0,0 @@ -AI Context: Form (reference/admin/form.mdx) - -Source of Information: -1. packages/webiny/src/admin/form.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/form/src/index.ts — originating source -3. /Users/adrian/dev/wby-next/packages/validation/src/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -Bind, Form, UnsetOnUnmount, useBind, useBindPrefix, useGenerateSlug, useForm, FormApi, FormOnSubmit, GenericFormData, validation, Validation, ValidationError - -Import Path: webiny/admin/form - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/form.mdx b/docs/developer-docs/6.x/reference/admin/form.mdx deleted file mode 100644 index 11160ea49..000000000 --- a/docs/developer-docs/6.x/reference/admin/form.mdx +++ /dev/null @@ -1,296 +0,0 @@ ---- -id: ywrtaw4v -title: Form -description: "Form primitives: Bind, Form, useForm, validation" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/form`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/form`. Import any of the items below directly from this path in your Webiny extensions. - -**Components** - - - -**Hooks** - - - -**Types** - - - -**Other** - - - -## Components - -### `Bind` - -**Function** — imported from `webiny/admin/form` - -```typescript -import { Bind } from "webiny/admin/form"; -``` - -```typescript -export function Bind( -``` - -### `Form` - -**Constant** — imported from `webiny/admin/form` - -```typescript -import { Form } from "webiny/admin/form"; -``` - -```typescript -export const Form = observer( - React.forwardRef(FormInner) as ( - props: FormProps & { ref?: React.ForwardedRef } - ) => ReturnType> -); -``` - -### `UnsetOnUnmount` - -**Constant** — imported from `webiny/admin/form` - -```typescript -import { UnsetOnUnmount } from "webiny/admin/form"; -``` - -```typescript -export const UnsetOnUnmount = ({ name, children }: { name: string; children: React.ReactNode }) => { - const form = useForm(); - - useEffect(() => { - return () => { - form.setValue(name, undefined); - }; - }, []); - - return <>{children}; -}; -``` - -### `Validation` - -**Class** — imported from `webiny/admin/form` - -Main class of Validation library. -Exported as a singleton instance, it offers methods for sync/async data validation and overwriting or adding new validators. - -@class Validation -@example -import { validation } from '@webiny/validation'; - -// `validation` is a preconfigured instance of Validation class. -// From here you can either add new validators or use it as-is. - -```typescript -import { Validation } from "webiny/admin/form"; -``` - -```typescript -class Validation { - __validators:; - constructor(); - setValidator(name: string, callable: Validator): this; - getValidator(name: string): Validator; - async validate( - value: any, - validators: string, - options: ValidateOptions =; - validateSync( - value: any, - validators: string, - options: ValidateOptions =; - create(validators: string); - createSync(validators: string); - __parseValidateProperty(validators: string): ParsedValidators; -} -``` - -### `ValidationError` - -**Class** — imported from `webiny/admin/form` - -This class is used by validators to throw an error when value validation fails. - -```typescript -import { ValidationError } from "webiny/admin/form"; -``` - -```typescript -class ValidationError extends Error { - public override readonly message: string; - public readonly validator: string | null; - public readonly value: any; - constructor(message = "", validator: string | null = null, value: string | null = null); -} -``` - -## Hooks - -### `useBind` - -**Constant** — imported from `webiny/admin/form` - -```typescript -import { useBind } from "webiny/admin/form"; -``` - -```typescript -export const useBind = makeDecoratable((props: BindComponentProps): UseBindHook => { - const form = useForm(); - const bindPrefix = useBindPrefix(); - - const bindName = useMemo(() => { - return [bindPrefix, props.name].filter(Boolean).join("."); - }, [props.name]); - - const fieldProps = { ...props, name: bindName }; - - useEffect(() => { - form.registerField(fieldProps); - - -``` - -### `useBindPrefix` - -**Function** — imported from `webiny/admin/form` - -```typescript -import { useBindPrefix } from "webiny/admin/form"; -``` - -```typescript -export function useBindPrefix(); -``` - -### `useForm` - -**Constant** — imported from `webiny/admin/form` - -```typescript -import { useForm } from "webiny/admin/form"; -``` - -```typescript -export const useForm = () => { - const context = useContext(FormContext) as FormAPI; - if (!context) { - throw new Error("Missing Form component in the component hierarchy!"); - } - return context; -}; -``` - -### `useGenerateSlug` - -**Function** — imported from `webiny/admin/form` - -This hook is designed to be used with the `useForm` hook. -When `generateSlug` is called, it will generate a slug using the `from` form field, and set it into the `to` form field. -@param form -@param from -@param to - -```typescript -import { useGenerateSlug } from "webiny/admin/form"; -``` - -```typescript -export function useGenerateSlug(form: FormAPI, from: string, to = "slug"); -``` - -## Types - -### `FormApi` - -**Type** — imported from `webiny/admin/form` - -```typescript -import type { FormApi } from "webiny/admin/form"; -``` - -```typescript -export interface FormAPI { ... } -``` - -### `FormOnSubmit` - -**Type** — imported from `webiny/admin/form` - -```typescript -import type { FormOnSubmit } from "webiny/admin/form"; -``` - -```typescript -export interface FormOnSubmit { - (data: T, form: FormAPI): any; -} -``` - -### `GenericFormData` - -**Type** — imported from `webiny/admin/form` - -```typescript -import type { GenericFormData } from "webiny/admin/form"; -``` - -```typescript -export type GenericFormData = { - [key: string]: any; -}; -``` - -## Other - -### `validation` - -**Constant** — imported from `webiny/admin/form` - -```typescript -import { validation } from "webiny/admin/form"; -``` - -```typescript -export const validation = new Validation(); -``` diff --git a/docs/developer-docs/6.x/reference/admin/graphql-client.ai.txt b/docs/developer-docs/6.x/reference/admin/graphql-client.ai.txt deleted file mode 100644 index 2a36cd042..000000000 --- a/docs/developer-docs/6.x/reference/admin/graphql-client.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Graphql Client (reference/admin/graphql-client.mdx) - -Source of Information: -1. packages/webiny/src/admin/graphql-client.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app/src/features/graphqlClient/abstractions.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -GraphQLClient - -Import Path: webiny/admin/graphql-client - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/graphql-client.mdx b/docs/developer-docs/6.x/reference/admin/graphql-client.mdx deleted file mode 100644 index af342a846..000000000 --- a/docs/developer-docs/6.x/reference/admin/graphql-client.mdx +++ /dev/null @@ -1,47 +0,0 @@ ---- -id: ywrtaw4v -title: Graphql Client -description: "Reference for webiny/admin/graphql-client" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/graphql-client`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/graphql-client`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `GraphQLClient` - -**Abstraction** — imported from `webiny/admin/graphql-client` - -```typescript -import { GraphQLClient } from "webiny/admin/graphql-client"; -``` - -**Interface `GraphQLClient.Interface`:** - -```typescript -interface GraphQLClient.Interface { - execute(params: GraphQLRequest): Promise; -} -``` - -**Types:** - -```typescript -namespace GraphQLClient { - type Headers = IHeaders; - type Interface = IGraphQLClient; - type Request = GraphQLRequest; -} -``` diff --git a/docs/developer-docs/6.x/reference/admin/graphqlClient.ai.txt b/docs/developer-docs/6.x/reference/admin/graphqlClient.ai.txt deleted file mode 100644 index f403fce26..000000000 --- a/docs/developer-docs/6.x/reference/admin/graphqlClient.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: GraphQL Client (reference/admin/graphqlClient.mdx) - -Source of Information: -1. packages/webiny/src/admin/graphqlClient.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app/src/features/graphqlClient/abstractions.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -GraphQLClient - -Import Path: webiny/admin/graphqlClient - -Related Documents: -- docs/developer-docs/6.0.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.0.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/graphqlClient.mdx b/docs/developer-docs/6.x/reference/admin/graphqlClient.mdx deleted file mode 100644 index 26db5c331..000000000 --- a/docs/developer-docs/6.x/reference/admin/graphqlClient.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -id: ywrtaw4v -title: GraphQL Client -description: "GraphQL client hooks and utilities" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/graphqlClient`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/graphqlClient`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `GraphQLClient` - -**Abstraction** — imported from `webiny/admin/graphqlClient` - -```typescript -import { GraphQLClient } from "webiny/admin/graphqlClient"; -``` - -**Interface `GraphQLClient.Interface`:** - -```typescript -interface GraphQLClient.Interface { - execute(params: GraphQLRequest): Promise; -} -``` - -**Types:** - -```typescript -namespace GraphQLClient { - type Headers = IHeaders; - type Interface = IGraphQLClient; - type Request = GraphQLRequest; -} -``` - -**Usage:** - -```typescript -// extensions/MyImpl.ts -import { GraphQLClient } from "webiny/admin/graphqlClient"; - -class MyImpl implements MyUseCase.Interface { - public constructor(private graphQLClient: GraphQLClient.Interface) {} - - public async execute(/* ... */): Promise { - await this.graphQLClient.execute(/* ... */); - } -} - -export default MyUseCase.createImplementation({ - implementation: MyImpl, - dependencies: [GraphQLClient] -}); -``` diff --git a/docs/developer-docs/6.x/reference/admin/lexical.ai.txt b/docs/developer-docs/6.x/reference/admin/lexical.ai.txt deleted file mode 100644 index 43cc19c8c..000000000 --- a/docs/developer-docs/6.x/reference/admin/lexical.ai.txt +++ /dev/null @@ -1,26 +0,0 @@ -AI Context: Lexical Editor (reference/admin/lexical.mdx) - -Source of Information: -1. packages/webiny/src/admin/lexical.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/lexical-editor/src/hooks/index.ts — originating source -3. /Users/adrian/dev/wby-next/packages/lexical-editor/src/types.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -getNodeFromSelection, useCurrentElement, useCurrentSelection, useDeriveValueFromSelection, useRichTextEditor, useFontColorPicker, useTextAlignmentAction, useTypographyAction, useIsMounted, Klass, LexicalNode - -Import Path: webiny/admin/lexical - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/lexical.mdx b/docs/developer-docs/6.x/reference/admin/lexical.mdx deleted file mode 100644 index ba297b811..000000000 --- a/docs/developer-docs/6.x/reference/admin/lexical.mdx +++ /dev/null @@ -1,252 +0,0 @@ ---- -id: ywrtaw4v -title: Lexical Editor -description: "Lexical editor components and hooks" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/lexical`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/lexical`. Import any of the items below directly from this path in your Webiny extensions. - -**Components** - - - -**Hooks** - - - -**Types** - - - -**Other** - - - -## Components - -### `LexicalNode` - -**Type** — imported from `webiny/admin/lexical` - -```typescript -import type { LexicalNode } from "webiny/admin/lexical"; -``` - -```typescript -export declare class LexicalNode { - ["constructor"]: KlassConstructor; - __type: string; - __key: string; - __parent: null | NodeKey; - __prev: null | NodeKey; - __next: null | NodeKey; - __state?: NodeState; - static getType(): string; - static clone(_data: unknown): LexicalNode; - $config(): BaseStaticNodeConfig; - config>( - type: Type, - config: Config - ): StaticNodeConfigRecord; - afterCloneFrom(prevNode: this): void; - static importDOM?: () => DOMConversionMap | null; - constructor(key?: NodeKey); - getType(): string; - isInline(): boolean; - isAttached(): boolean; - isSelected(selection?: null | BaseSelection): boolean; - getKey(): NodeKey; - getIndexWithinParent(): number; - getParent(): T | null; - getParentOrThrow(): T; - getTopLevelElement(): ElementNode | DecoratorNode | null; - getTopLevelElementOrThrow(): ElementNode | DecoratorNode; - getParents(): Array; - getParentKeys(): Array; - getPreviousSibling(): T | null; - getPreviousSiblings(): Array; - getNextSibling(): T | null; - getNextSiblings(): Array; - getCommonAncestor(node: LexicalNode): T | null; - is(object: LexicalNode | null | undefined): boolean; - isBefore(targetNode: LexicalNode): boolean; - isParentOf(targetNode: LexicalNode): boolean; - getNodesBetween(targetNode: LexicalNode): Array; - isDirty(): boolean; - getLatest(): this; - getWritable(): this; - getTextContent(): string; - getTextContentSize(): number; - createDOM(_config: EditorConfig, _editor: LexicalEditor): HTMLElement; - updateDOM(_prevNode: unknown, _dom: HTMLElement, _config: EditorConfig): boolean; - exportDOM(editor: LexicalEditor): DOMExportOutput; - exportJSON(): SerializedLexicalNode; - static importJSON(_serializedNode: SerializedLexicalNode): LexicalNode; - updateFromJSON(serializedNode: LexicalUpdateJSON): this; - static transform(): ((node: LexicalNode) => void) | null; - remove(preserveEmptyParent?: boolean): void; - replace(replaceWith: N, includeChildren?: boolean): N; - insertAfter(nodeToInsert: LexicalNode, restoreSelection?: boolean): LexicalNode; - insertBefore(nodeToInsert: LexicalNode, restoreSelection?: boolean): LexicalNode; - isParentRequired(): boolean; - createParentElementNode(): ElementNode; - selectStart(): RangeSelection; - selectEnd(): RangeSelection; - selectPrevious(anchorOffset?: number, focusOffset?: number): RangeSelection; - selectNext(anchorOffset?: number, focusOffset?: number): RangeSelection; - markDirty(): void; - reconcileObservedMutation(dom: HTMLElement, editor: LexicalEditor): void; -} -``` - -## Hooks - -### `useCurrentElement` - -**Function** — imported from `webiny/admin/lexical` - -```typescript -import { useCurrentElement } from "webiny/admin/lexical"; -``` - -```typescript -export function useCurrentElement(); -``` - -### `useCurrentSelection` - -**Function** — imported from `webiny/admin/lexical` - -```typescript -import { useCurrentSelection } from "webiny/admin/lexical"; -``` - -```typescript -export function useCurrentSelection(); -``` - -### `useDeriveValueFromSelection` - -**Function** — imported from `webiny/admin/lexical` - -```typescript -import { useDeriveValueFromSelection } from "webiny/admin/lexical"; -``` - -```typescript -export function useDeriveValueFromSelection(generator: Generator); -``` - -### `useFontColorPicker` - -**Function** — imported from `webiny/admin/lexical` - -```typescript -import { useFontColorPicker } from "webiny/admin/lexical"; -``` - -```typescript -export function useFontColorPicker(); -``` - -### `useIsMounted` - -**Function** — imported from `webiny/admin/lexical` - -```typescript -import { useIsMounted } from "webiny/admin/lexical"; -``` - -```typescript -export function useIsMounted(); -``` - -### `useRichTextEditor` - -**Function** — imported from `webiny/admin/lexical` - -```typescript -import { useRichTextEditor } from "webiny/admin/lexical"; -``` - -```typescript -export function useRichTextEditor(); -``` - -### `useTextAlignmentAction` - -**Function** — imported from `webiny/admin/lexical` - -```typescript -import { useTextAlignmentAction } from "webiny/admin/lexical"; -``` - -```typescript -export function useTextAlignmentAction(); -``` - -### `useTypographyAction` - -**Function** — imported from `webiny/admin/lexical` - -```typescript -import { useTypographyAction } from "webiny/admin/lexical"; -``` - -```typescript -export function useTypographyAction(); -``` - -## Types - -### `Klass` - -**Type** — imported from `webiny/admin/lexical` - -```typescript -import type { Klass } from "webiny/admin/lexical"; -``` - -```typescript -export type Klass = - InstanceType extends T - ? T["constructor"] - : GenericConstructor & T["constructor"]; -``` - -## Other - -### `getNodeFromSelection` - -**Function** — imported from `webiny/admin/lexical` - -```typescript -import { getNodeFromSelection } from "webiny/admin/lexical"; -``` - -```typescript -export function getNodeFromSelection(selection: RangeSelection); -``` diff --git a/docs/developer-docs/6.x/reference/admin/local-storage.ai.txt b/docs/developer-docs/6.x/reference/admin/local-storage.ai.txt deleted file mode 100644 index 74c84ee59..000000000 --- a/docs/developer-docs/6.x/reference/admin/local-storage.ai.txt +++ /dev/null @@ -1,26 +0,0 @@ -AI Context: Local Storage (reference/admin/local-storage.mdx) - -Source of Information: -1. packages/webiny/src/admin/local-storage.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app/src/features/localStorage/abstractions.ts — originating source -3. /Users/adrian/dev/wby-next/packages/app/src/presentation/localStorage/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -LocalStorage, useLocalStorage, useLocalStorageValue, useLocalStorageValues - -Import Path: webiny/admin/local-storage - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/local-storage.mdx b/docs/developer-docs/6.x/reference/admin/local-storage.mdx deleted file mode 100644 index 2d47af6ac..000000000 --- a/docs/developer-docs/6.x/reference/admin/local-storage.mdx +++ /dev/null @@ -1,93 +0,0 @@ ---- -id: ywrtaw4v -title: Local Storage -description: "Reference for webiny/admin/local-storage" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/local-storage`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/local-storage`. Import any of the items below directly from this path in your Webiny extensions. - -**Components** - - - -**Hooks** - - - -## Components - -### `LocalStorage` - -**Constant** — imported from `webiny/admin/local-storage` - -```typescript -import { LocalStorage } from "webiny/admin/local-storage"; -``` - -```typescript -export const LocalStorage = new Abstraction("LocalStorage"); -``` - -## Hooks - -### `useLocalStorage` - -**Function** — imported from `webiny/admin/local-storage` - -Returns the LocalStorage instance from DI. -Useful when you want to call service methods imperatively inside components. - -```typescript -import { useLocalStorage } from "webiny/admin/local-storage"; -``` - -```typescript -export function useLocalStorage(): LocalStorage.Interface; -``` - -### `useLocalStorageValue` - -**Function** — imported from `webiny/admin/local-storage` - -```typescript -import { useLocalStorageValue } from "webiny/admin/local-storage"; -``` - -```typescript -export function useLocalStorageValue(key: string): T | undefined; -``` - -### `useLocalStorageValues` - -**Function** — imported from `webiny/admin/local-storage` - -Observes multiple keys in LocalStorage and returns an object of { key: value }. -Re-renders when any of the observed keys change. - -```typescript -import { useLocalStorageValues } from "webiny/admin/local-storage"; -``` - -```typescript -export function useLocalStorageValues>( - keys: (keyof T & string)[] -): Partial; -``` diff --git a/docs/developer-docs/6.x/reference/admin/localStorage.ai.txt b/docs/developer-docs/6.x/reference/admin/localStorage.ai.txt deleted file mode 100644 index 28fe2bb45..000000000 --- a/docs/developer-docs/6.x/reference/admin/localStorage.ai.txt +++ /dev/null @@ -1,26 +0,0 @@ -AI Context: Local Storage (reference/admin/localStorage.mdx) - -Source of Information: -1. packages/webiny/src/admin/localStorage.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app/src/features/localStorage/abstractions.ts — originating source -3. /Users/adrian/dev/wby-next/packages/app/src/presentation/localStorage/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -LocalStorage, useLocalStorage, useLocalStorageValue, useLocalStorageValues - -Import Path: webiny/admin/localStorage - -Related Documents: -- docs/developer-docs/6.0.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.0.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/localStorage.mdx b/docs/developer-docs/6.x/reference/admin/localStorage.mdx deleted file mode 100644 index 728d3800e..000000000 --- a/docs/developer-docs/6.x/reference/admin/localStorage.mdx +++ /dev/null @@ -1,84 +0,0 @@ ---- -id: ywrtaw4v -title: Local Storage -description: "Local storage abstraction and hooks" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/localStorage`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/localStorage`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `LocalStorage` - -**Constant** — imported from `webiny/admin/localStorage` - -```typescript -import { LocalStorage } from "webiny/admin/localStorage"; -``` - -```typescript -export const LocalStorage = new Abstraction("LocalStorage"); -``` - -## `useLocalStorage` - -**Function** — imported from `webiny/admin/localStorage` - -Returns the LocalStorage instance from DI. -Useful when you want to call service methods imperatively inside components. - -```typescript -import { useLocalStorage } from "webiny/admin/localStorage"; -``` - -```typescript -export function useLocalStorage(): LocalStorage.Interface; -``` - -## `useLocalStorageValue` - -**Function** — imported from `webiny/admin/localStorage` - -```typescript -import { useLocalStorageValue } from "webiny/admin/localStorage"; -``` - -```typescript -export function useLocalStorageValue(key: string): T | undefined; -``` - -## `useLocalStorageValues` - -**Function** — imported from `webiny/admin/localStorage` - -Observes multiple keys in LocalStorage and returns an object of { key: value }. -Re-renders when any of the observed keys change. - -```typescript -import { useLocalStorageValues } from "webiny/admin/localStorage"; -``` - -```typescript -export function useLocalStorageValues>( - keys: (keyof T & string)[] -): Partial; -``` diff --git a/docs/developer-docs/6.x/reference/admin/router.ai.txt b/docs/developer-docs/6.x/reference/admin/router.ai.txt deleted file mode 100644 index 4a9f4c6cd..000000000 --- a/docs/developer-docs/6.x/reference/admin/router.ai.txt +++ /dev/null @@ -1,26 +0,0 @@ -AI Context: Router (reference/admin/router.mdx) - -Source of Information: -1. packages/webiny/src/admin/router.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app/src/features/router/Route.ts — originating source -3. /Users/adrian/dev/wby-next/packages/app/src/presentation/router/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -Route, useRoute, useRouter - -Import Path: webiny/admin/router - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/router.mdx b/docs/developer-docs/6.x/reference/admin/router.mdx deleted file mode 100644 index 231cc1977..000000000 --- a/docs/developer-docs/6.x/reference/admin/router.mdx +++ /dev/null @@ -1,94 +0,0 @@ ---- -id: ywrtaw4v -title: Router -description: "Router components and hooks" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/router`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/router`. Import any of the items below directly from this path in your Webiny extensions. - -**Components** - - - -**Hooks** - - - -## Components - -### `Route` - -**Class** — imported from `webiny/admin/router` - -```typescript -import { Route } from "webiny/admin/router"; -``` - -```typescript -export class Route { - private readonly route: RouteParams; - private readonly schema: TParams extends RouteParamsDefinition - ? RouteParamsInfer - : undefined; - constructor(route: RouteParams); - get name(); - get path(); - get params(): TParams extends RouteParamsDefinition ? RouteParamsInfer : undefined; - private coerceParams>(shape: T); -} -``` - -## Hooks - -### `useRoute` - -**Function** — imported from `webiny/admin/router` - -```typescript -import { useRoute } from "webiny/admin/router"; -``` - -```typescript -export function useRoute( - // eslint-disable-next-line @typescript-eslint/no-unused-vars - route?: Route -); -``` - -### `useRouter` - -**Constant** — imported from `webiny/admin/router` - -```typescript -import { useRouter } from "webiny/admin/router"; -``` - -```typescript -export const useRouter = () => { - const { presenter } = useFeature(RouterFeature); - const container = useContainer(); - const registry = container.resolve(RouteElementRegistry); - - return { - goToRoute: presenter.goToRoute.bind(presenter), - getLink: presenter.getLink.bind(presenter), - onRouteExit: presenter.onRouteExit.bind(presenter), - setRoutes: (routes: Reac -``` diff --git a/docs/developer-docs/6.x/reference/admin/security.ai.txt b/docs/developer-docs/6.x/reference/admin/security.ai.txt deleted file mode 100644 index 074175022..000000000 --- a/docs/developer-docs/6.x/reference/admin/security.ai.txt +++ /dev/null @@ -1,31 +0,0 @@ -AI Context: Security (reference/admin/security.mdx) - -Source of Information: -1. packages/webiny/src/admin/security.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app/src/errors/abstractions.ts — originating source -3. /Users/adrian/dev/wby-next/packages/app-admin/src/features/security/LogIn/index.ts — originating source -4. /Users/adrian/dev/wby-next/packages/app-admin/src/features/security/LogOut/index.ts — originating source -5. /Users/adrian/dev/wby-next/packages/app-admin/src/features/security/AuthenticationContext/index.ts — originating source -6. /Users/adrian/dev/wby-next/packages/app-admin/src/features/security/IdentityContext/index.ts — originating source -7. /Users/adrian/dev/wby-next/packages/app-admin/src/presentation/security/hooks/useAuthentication.ts — originating source -8. /Users/adrian/dev/wby-next/packages/app-admin/src/presentation/security/hooks/useIdentity.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -AuthenticationErrorEventHandler, LogInUseCase, LogOutUseCase, AuthenticationContext, IdentityContext, useAuthentication, useIdentity - -Import Path: webiny/admin/security - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/security.mdx b/docs/developer-docs/6.x/reference/admin/security.mdx deleted file mode 100644 index 325e17f0e..000000000 --- a/docs/developer-docs/6.x/reference/admin/security.mdx +++ /dev/null @@ -1,199 +0,0 @@ ---- -id: ywrtaw4v -title: Security -description: "Admin security: authentication, identity, permissions" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What use cases are available in `webiny/admin/security`? -- Which event handlers can you implement? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/security`. Import any of the items below directly from this path in your Webiny extensions. - -**Hooks** - - - -**Other** - - - -## Hooks - -### `useAuthentication` - -**Function** — imported from `webiny/admin/security` - -```typescript -import { useAuthentication } from "webiny/admin/security"; -``` - -```typescript -export function useAuthentication(): IUseAuthenticationReturn; -``` - -### `useIdentity` - -**Function** — imported from `webiny/admin/security` - -```typescript -import { useIdentity } from "webiny/admin/security"; -``` - -```typescript -export function useIdentity(): IUseIdentityReturn; -``` - -## Other - -### `AuthenticationContext` - -**Abstraction** — imported from `webiny/admin/security` - -```typescript -import { AuthenticationContext } from "webiny/admin/security"; -``` - -**Interface `AuthenticationContext.Interface`:** - -```typescript -interface AuthenticationContext.Interface { - clear(): void; - getIdToken: IIdTokenProvider; - setIdTokenProvider(provider: IIdTokenProvider): void; - setLogoutCallback(callback: ILogoutCallback): void; - getLogoutCallback(): ILogoutCallback; -} -``` - -**Types:** - -```typescript -namespace AuthenticationContext { - type Interface = IAuthenticationContext; - type IdTokenProvider = IIdTokenProvider; - type LogoutCallback = ILogoutCallback; -} -``` - -### `AuthenticationErrorEventHandler` - -**Event Handler Abstraction** — imported from `webiny/admin/security` - -```typescript -import { AuthenticationErrorEventHandler } from "webiny/admin/security"; -``` - -**Interface `AuthenticationErrorEventHandler.Interface`:** - -```typescript -interface AuthenticationErrorEventHandler.Interface { - handle(event: AuthenticationErrorEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace AuthenticationErrorEventHandler { - type Interface = IEventHandler; - type Event = AuthenticationErrorEvent; -} -``` - -### `IdentityContext` - -**Abstraction** — imported from `webiny/admin/security` - -```typescript -import { IdentityContext } from "webiny/admin/security"; -``` - -**Interface `IdentityContext.Interface`:** - -```typescript -interface IdentityContext.Interface { - getIdentity(): Identity; - setIdentity(identity: Identity): void; - clear(): void; -} -``` - -**Types:** - -```typescript -namespace IdentityContext { - type Interface = IIdentityContext; -} -``` - -### `LogInUseCase` - -**Use Case Abstraction** — imported from `webiny/admin/security` - -```typescript -import { LogInUseCase } from "webiny/admin/security"; -``` - -**Interface `LogInUseCase.Interface`:** - -```typescript -interface LogInUseCase.Interface { - execute(params: ILoginParams): Promise; -} -``` - -**Types:** - -```typescript -namespace LogInUseCase { - type Interface = ILogInUseCase; - type Params = ILoginParams; -} -``` - -### `LogOutUseCase` - -**Use Case Abstraction** — imported from `webiny/admin/security` - -```typescript -import { LogOutUseCase } from "webiny/admin/security"; -``` - -**Interface `LogOutUseCase.Interface`:** - -```typescript -interface LogOutUseCase.Interface { - execute(): Promise; -} -``` - -**Types:** - -```typescript -namespace LogOutUseCase { - type Interface = ILogOutUseCase; -} -``` diff --git a/docs/developer-docs/6.x/reference/admin/tenancy.ai.txt b/docs/developer-docs/6.x/reference/admin/tenancy.ai.txt deleted file mode 100644 index cd7ae5299..000000000 --- a/docs/developer-docs/6.x/reference/admin/tenancy.ai.txt +++ /dev/null @@ -1,30 +0,0 @@ -AI Context: Tenancy (reference/admin/tenancy.mdx) - -Source of Information: -1. packages/webiny/src/admin/tenancy.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app-admin/src/features/tenancy/abstractions.ts — originating source -3. /Users/adrian/dev/wby-next/packages/app-admin/src/presentation/tenancy/useTenantContext.ts — originating source -4. /Users/adrian/dev/wby-next/packages/tenant-manager/src/admin/types.ts — originating source -5. /Users/adrian/dev/wby-next/packages/tenant-manager/src/admin/EnableTenant/index.ts — originating source -6. /Users/adrian/dev/wby-next/packages/tenant-manager/src/admin/DisableTenant/index.ts — originating source -7. /Users/adrian/dev/wby-next/packages/tenant-manager/src/admin/CurrentTenant/useCurrentTenant.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -TenantContext, useTenantContext, TenantEntry, useEnableTenant, useDisableTenant, useCurrentTenant - -Import Path: webiny/admin/tenancy - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/tenancy.mdx b/docs/developer-docs/6.x/reference/admin/tenancy.mdx deleted file mode 100644 index 70889e39c..000000000 --- a/docs/developer-docs/6.x/reference/admin/tenancy.mdx +++ /dev/null @@ -1,150 +0,0 @@ ---- -id: ywrtaw4v -title: Tenancy -description: "Admin tenancy hooks and context" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/tenancy`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/tenancy`. Import any of the items below directly from this path in your Webiny extensions. - -**Components** - - - -**Hooks** - - - -**Types** - - - -## Components - -### `TenantContext` - -**Constant** — imported from `webiny/admin/tenancy` - -```typescript -import { TenantContext } from "webiny/admin/tenancy"; -``` - -```typescript -export const TenantContext = new Abstraction("TenantContext"); -``` - -## Hooks - -### `useCurrentTenant` - -**Constant** — imported from `webiny/admin/tenancy` - -```typescript -import { useCurrentTenant } from "webiny/admin/tenancy"; -``` - -```typescript -export const useCurrentTenant = () => { - const { presenter } = useFeature(CurrentTenantFeature); - // The app is not rendered till the tenant is loaded. - // If this hook is used, it's safe to assume the tenant is loaded. - const [tenant, setTenant] = useState(presenter.vm.tenant as Tenant); - - useEffect(() => { - return autorun(() => { - const tenant = presenter.vm.tena -``` - -### `useDisableTenant` - -**Constant** — imported from `webiny/admin/tenancy` - -```typescript -import { useDisableTenant } from "webiny/admin/tenancy"; -``` - -```typescript -export const useDisableTenant = (tenant: TenantEntry) => { - const { useCase } = useFeature(DisableTenantFeature); - const { updateRecordInCache } = useRecords(); - - const disableTenant = useCallback(async () => { - await useCase.execute(tenant.entryId); - - updateRecordInCache({ - ...tenant, - values: { - ...tenant.values, - status: -``` - -### `useEnableTenant` - -**Constant** — imported from `webiny/admin/tenancy` - -```typescript -import { useEnableTenant } from "webiny/admin/tenancy"; -``` - -```typescript -export const useEnableTenant = () => { - const { useCase } = useFeature(EnableTenantFeature); - const [loading, setLoading] = useState(false); - - const enableTenant = useCallback( - async (tenantId: string) => { - setLoading(true); - - try { - await useCase.execute(tenantId); - } finally { - setLoading(false); - } - -``` - -### `useTenantContext` - -**Function** — imported from `webiny/admin/tenancy` - -```typescript -import { useTenantContext } from "webiny/admin/tenancy"; -``` - -```typescript -export function useTenantContext(); -``` - -## Types - -### `TenantEntry` - -**Type** — imported from `webiny/admin/tenancy` - -```typescript -import type { TenantEntry } from "webiny/admin/tenancy"; -``` - -```typescript -export interface TenantEntry extends BaseEntry { - values: TenantValues; -} -``` diff --git a/docs/developer-docs/6.x/reference/admin/ui.ai.txt b/docs/developer-docs/6.x/reference/admin/ui.ai.txt deleted file mode 100644 index ccea00fe3..000000000 --- a/docs/developer-docs/6.x/reference/admin/ui.ai.txt +++ /dev/null @@ -1,83 +0,0 @@ -AI Context: UI (reference/admin/ui.mdx) - -Source of Information: -1. packages/webiny/src/admin/ui.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/admin-ui/src/Accordion/index.ts — originating source -3. /Users/adrian/dev/wby-next/packages/admin-ui/src/Alert/index.ts — originating source -4. /Users/adrian/dev/wby-next/packages/admin-ui/src/AutoComplete/index.ts — originating source -5. /Users/adrian/dev/wby-next/packages/admin-ui/src/Avatar/index.ts — originating source -6. /Users/adrian/dev/wby-next/packages/admin-ui/src/Button/index.ts — originating source -7. /Users/adrian/dev/wby-next/packages/admin-ui/src/Card/index.ts — originating source -8. /Users/adrian/dev/wby-next/packages/admin-ui/src/Checkbox/index.ts — originating source -9. /Users/adrian/dev/wby-next/packages/admin-ui/src/CheckboxGroup/index.ts — originating source -10. /Users/adrian/dev/wby-next/packages/admin-ui/src/CodeEditor/index.ts — originating source -11. /Users/adrian/dev/wby-next/packages/admin-ui/src/ColorPicker/index.ts — originating source -12. /Users/adrian/dev/wby-next/packages/admin-ui/src/DataList/index.ts — originating source -13. /Users/adrian/dev/wby-next/packages/admin-ui/src/DataTable/index.ts — originating source -14. /Users/adrian/dev/wby-next/packages/admin-ui/src/DelayedOnChange/index.ts — originating source -15. /Users/adrian/dev/wby-next/packages/admin-ui/src/Dialog/index.ts — originating source -16. /Users/adrian/dev/wby-next/packages/admin-ui/src/Drawer/index.ts — originating source -17. /Users/adrian/dev/wby-next/packages/admin-ui/src/DropdownMenu/index.ts — originating source -18. /Users/adrian/dev/wby-next/packages/admin-ui/src/DynamicFieldset/index.ts — originating source -19. /Users/adrian/dev/wby-next/packages/admin-ui/src/FilePicker/index.ts — originating source -20. /Users/adrian/dev/wby-next/packages/admin-ui/src/Grid/index.ts — originating source -21. /Users/adrian/dev/wby-next/packages/admin-ui/src/HeaderBar/index.ts — originating source -22. /Users/adrian/dev/wby-next/packages/admin-ui/src/Heading/index.ts — originating source -23. /Users/adrian/dev/wby-next/packages/admin-ui/src/Icon/index.ts — originating source -24. /Users/adrian/dev/wby-next/packages/admin-ui/src/IconPicker/index.ts — originating source -25. /Users/adrian/dev/wby-next/packages/admin-ui/src/Image/index.ts — originating source -26. /Users/adrian/dev/wby-next/packages/admin-ui/src/Input/index.ts — originating source -27. /Users/adrian/dev/wby-next/packages/admin-ui/src/Label/index.ts — originating source -28. /Users/adrian/dev/wby-next/packages/admin-ui/src/Link/index.ts — originating source -29. /Users/adrian/dev/wby-next/packages/admin-ui/src/List/index.ts — originating source -30. /Users/adrian/dev/wby-next/packages/admin-ui/src/Loader/index.ts — originating source -31. /Users/adrian/dev/wby-next/packages/admin-ui/src/MultiAutoComplete/index.ts — originating source -32. /Users/adrian/dev/wby-next/packages/admin-ui/src/MultiFilePicker/index.ts — originating source -33. /Users/adrian/dev/wby-next/packages/admin-ui/src/Portal/index.ts — originating source -34. /Users/adrian/dev/wby-next/packages/admin-ui/src/Popover/index.ts — originating source -35. /Users/adrian/dev/wby-next/packages/admin-ui/src/ProgressBar/index.ts — originating source -36. /Users/adrian/dev/wby-next/packages/admin-ui/src/RadioGroup/index.ts — originating source -37. /Users/adrian/dev/wby-next/packages/admin-ui/src/RangeSlider/index.ts — originating source -38. /Users/adrian/dev/wby-next/packages/admin-ui/src/Scrollbar/index.ts — originating source -39. /Users/adrian/dev/wby-next/packages/admin-ui/src/ScrollArea/index.ts — originating source -40. /Users/adrian/dev/wby-next/packages/admin-ui/src/SegmentedControl/index.ts — originating source -41. /Users/adrian/dev/wby-next/packages/admin-ui/src/Select/index.ts — originating source -42. /Users/adrian/dev/wby-next/packages/admin-ui/src/Separator/index.ts — originating source -43. /Users/adrian/dev/wby-next/packages/admin-ui/src/Sidebar/index.ts — originating source -44. /Users/adrian/dev/wby-next/packages/admin-ui/src/Skeleton/index.ts — originating source -45. /Users/adrian/dev/wby-next/packages/admin-ui/src/Slider/index.ts — originating source -46. /Users/adrian/dev/wby-next/packages/admin-ui/src/SteppedProgress/index.ts — originating source -47. /Users/adrian/dev/wby-next/packages/admin-ui/src/Switch/index.ts — originating source -48. /Users/adrian/dev/wby-next/packages/admin-ui/src/Table/index.ts — originating source -49. /Users/adrian/dev/wby-next/packages/admin-ui/src/Tabs/index.ts — originating source -50. /Users/adrian/dev/wby-next/packages/admin-ui/src/Tag/index.ts — originating source -51. /Users/adrian/dev/wby-next/packages/admin-ui/src/Tags/index.ts — originating source -52. /Users/adrian/dev/wby-next/packages/admin-ui/src/Text/index.ts — originating source -53. /Users/adrian/dev/wby-next/packages/admin-ui/src/Textarea/index.ts — originating source -54. /Users/adrian/dev/wby-next/packages/admin-ui/src/TimeAgo/index.ts — originating source -55. /Users/adrian/dev/wby-next/packages/admin-ui/src/Toast/index.ts — originating source -56. /Users/adrian/dev/wby-next/packages/admin-ui/src/Tooltip/index.ts — originating source -57. /Users/adrian/dev/wby-next/packages/admin-ui/src/Tree/index.ts — originating source -58. /Users/adrian/dev/wby-next/packages/admin-ui/src/Widget/index.ts — originating source -59. /Users/adrian/dev/wby-next/packages/admin-ui/src/hooks/index.ts — originating source -60. /Users/adrian/dev/wby-next/packages/app-admin/src/components/Dialogs/useDialogs.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -Accordion, Alert, AutoComplete, Avatar, Button, CopyButton, IconButton, Card, Checkbox, CheckboxGroup, CodeEditor, ColorPicker, CloneIcon, CreateIcon, DataList, DataListModal, DataListWithSections, DeleteIcon, DownloadIcon, EditIcon, FilterIcon, ListIcon, LoginIcon, NextPageIcon, OptionsIcon, PreviousPageIcon, RefreshIcon, SortIcon, UploadIcon, DataTable, DelayedOnChange, Dialog, Drawer, DropdownMenu, DynamicFieldset, FilePicker, Grid, HeaderBar, Heading, Icon, IconPicker, Image, Input, Label, Link, List, Loader, OverlayLoader, MultiAutoComplete, MultiFilePicker, Portal, Popover, ProgressBar, Radio, RadioGroup, RangeSlider, Scrollbar, ScrollArea, ScrollBar, SegmentedControl, Select, Separator, Sidebar, SidebarProvider, useSidebar, Skeleton, Slider, SteppedProgress, Switch, Table, Tabs, Tag, Tags, Text, Textarea, TimeAgo, Toast, useToast, Tooltip, Tree, Widget, useDisclosure, useDialogs - -Import Path: webiny/admin/ui - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/ui.mdx b/docs/developer-docs/6.x/reference/admin/ui.mdx deleted file mode 100644 index b15da94de..000000000 --- a/docs/developer-docs/6.x/reference/admin/ui.mdx +++ /dev/null @@ -1,1430 +0,0 @@ ---- -id: ywrtaw4v -title: UI -description: "Admin UI component library" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/ui`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/ui`. Import any of the items below directly from this path in your Webiny extensions. - -**Components** - - - -**Hooks** - - - -## Components - -### `Accordion` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Accordion } from "webiny/admin/ui"; -``` - -```typescript -export const Accordion = withStaticProps(DecoratableAccordion, { - Item: AccordionItem -}); -``` - -### `Alert` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Alert } from "webiny/admin/ui"; -``` - -```typescript -const Alert = withStaticProps(makeDecoratable("AlertBase", AlertBase), { - Action: AlertAction -}); -``` - -### `AutoComplete` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { AutoComplete } from "webiny/admin/ui"; -``` - -```typescript -const AutoComplete = makeDecoratable("AutoComplete", DecoratableAutoComplete); -``` - -### `Avatar` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Avatar } from "webiny/admin/ui"; -``` - -```typescript -const Avatar = withStaticProps(makeDecoratable("Avatar", AvatarBase), { - Fallback: AvatarFallback, - Image: AvatarImage -}); -``` - -### `Button` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Button } from "webiny/admin/ui"; -``` - -```typescript -const Button = makeDecoratable("Button", ButtonBase); -``` - -### `Card` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Card } from "webiny/admin/ui"; -``` - -```typescript -const Card = withStaticProps(DecoratableCard, { - ConfirmAction, - CancelAction, - Icon -}); -``` - -### `Checkbox` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Checkbox } from "webiny/admin/ui"; -``` - -```typescript -const Checkbox = makeDecoratable("Checkbox", DecoratableCheckbox); -``` - -### `CheckboxGroup` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { CheckboxGroup } from "webiny/admin/ui"; -``` - -```typescript -const CheckboxGroup = makeDecoratable("CheckboxGroup", DecoratableCheckboxGroup); -``` - -### `CloneIcon` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { CloneIcon } from "webiny/admin/ui"; -``` - -```typescript -export const CloneIcon = (props: IconButtonProps) => { - return ( - } label={"Clone"} />} - variant={"ghost"} - size={"sm"} - {...props} - /> - ); -}; -``` - -### `CodeEditor` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { CodeEditor } from "webiny/admin/ui"; -``` - -```typescript -const CodeEditor = makeDecoratable("CodeEditor", DecoratableCodeEditor); -``` - -### `ColorPicker` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { ColorPicker } from "webiny/admin/ui"; -``` - -```typescript -const ColorPicker = makeDecoratable("ColorPicker", DecoratableIconPicker); -``` - -### `CopyButton` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { CopyButton } from "webiny/admin/ui"; -``` - -```typescript -const CopyButton = makeDecoratable("CopyButton", CopyButtonBase); -``` - -### `CreateIcon` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { CreateIcon } from "webiny/admin/ui"; -``` - -```typescript -export const CreateIcon = (props: IconButtonProps) => { - return ( - } label={"Create"} />} - variant={"ghost"} - size={"sm"} - {...props} - /> - ); -}; -``` - -### `DataList` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { DataList } from "webiny/admin/ui"; -``` - -```typescript -export const DataList = (propsInput: DataListProps) => { - let render: React.ReactNode | null; - - const props = useMemo(() => { - return { - ...defaultDataListProps, - ...propsInput - }; - }, [propsInput]); - - if (props.loading) { - render = props.loader; - } else if (isEmpty(props.data)) { - render = props.noData; - } else { - -``` - -### `DataListModal` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { DataListModal } from "webiny/admin/ui"; -``` - -```typescript -const DataListModal = withStaticProps(BaseDataListModal, { - Trigger: DataListModalTrigger, - Content: DataListModalContent -}); -``` - -### `DataListWithSections` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { DataListWithSections } from "webiny/admin/ui"; -``` - -```typescript -export const DataListWithSections = (propsInput: DataListProps) => { - let render: React.ReactNode | null; - - const props = useMemo(() => { - return { - ...dataListWithSectionsDefaultProps, - ...propsInput - }; - }, [propsInput]); - - if (props.loading) { - render = props.loader; - } else if (isEmpty(props.data)) { - render = prop -``` - -### `DataTable` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { DataTable } from "webiny/admin/ui"; -``` - -```typescript -const DataTable = makeDecoratable("DataTable", DecoratableDataTable); -``` - -### `DelayedOnChange` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { DelayedOnChange } from "webiny/admin/ui"; -``` - -```typescript -export const DelayedOnChange = ({ - children, - ...other -}: DelayedOnChangeProps) => { - const firstMount = useRef(true); - const { onChange, delay = 400, value: initialValue } = other; - const [value, setValue] = useState(initialValue); - // Sync state and props - useEffect(() => { - // Do not update local state, if the incoming value -``` - -### `DeleteIcon` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { DeleteIcon } from "webiny/admin/ui"; -``` - -```typescript -export const DeleteIcon = (props: IconButtonProps) => { - return ( - } label={"Delete"} />} - variant={"ghost"} - size={"sm"} - {...props} - /> - ); -}; -``` - -### `Dialog` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Dialog } from "webiny/admin/ui"; -``` - -```typescript -const Dialog = withStaticProps(DecoratableDialog, { - ConfirmAction, - CancelAction, - Icon, - Close: DialogClose -}); -``` - -### `DownloadIcon` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { DownloadIcon } from "webiny/admin/ui"; -``` - -```typescript -export const DownloadIcon = (props: IconButtonProps) => { - return ( - } label={"Download"} />} - variant={"ghost"} - size={"sm"} - {...props} - /> - ); -}; -``` - -### `Drawer` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Drawer } from "webiny/admin/ui"; -``` - -```typescript -const Drawer = withStaticProps(DecoratableDrawer, { - ConfirmButton, - CancelButton, - Icon -}); -``` - -### `DropdownMenu` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { DropdownMenu } from "webiny/admin/ui"; -``` - -```typescript -const DropdownMenu = withStaticProps(DecoratableDropdownMenu, { - Separator: DropdownMenuSeparator, - Label: DropdownMenuLabel, - Group: DropdownMenuGroup, - Item: DropdownMenuItem, - Link: DropdownMenuLink, - CheckboxItem: DropdownMenuCheckboxItem -}); -``` - -### `DynamicFieldset` - -**Class** — imported from `webiny/admin/ui` - -```typescript -import { DynamicFieldset } from "webiny/admin/ui"; -``` - -```typescript -class DynamicFieldset extends React.Component { - static defaultProps: Partial =; - header: React.ReactNode = null; - footer: React.ReactNode = null; - rows: React.ReactNode = null; - empty: React.ReactNode = null; - actions =; - removeData = (index: number) =>; - addData = (index = -1) =>; - renderHeader = (cb: () => React.ReactNode): React.ReactNode =>; - renderFooter = (cb: () => React.ReactNode): React.ReactNode =>; - renderRow = (cb: ChildrenRenderPropRowCallable): React.ReactNode =>; - renderEmpty = (cb: () => React.ReactNode): React.ReactNode =>; - public renderComponent(): React.ReactNode; - public override render(); -} -``` - -### `EditIcon` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { EditIcon } from "webiny/admin/ui"; -``` - -```typescript -export const EditIcon = (props: IconButtonProps) => { - return ( - } label={"Edit"} />} - variant={"ghost"} - size={"sm"} - {...props} - /> - ); -}; -``` - -### `FilePicker` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { FilePicker } from "webiny/admin/ui"; -``` - -```typescript -const FilePicker = withStaticProps(DecoratableFilePicker, { - Preview: { - Image: ImagePreview, - RichItem: RichItemPreview, - TextOnly: TextOnlyPreview - } -}); -``` - -### `FilterIcon` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { FilterIcon } from "webiny/admin/ui"; -``` - -```typescript -export const FilterIcon = (props: IconButtonProps) => { - return ( - } label={"Filter"} />} - variant={"ghost"} - size={"sm"} - {...props} - /> - ); -}; -``` - -### `Grid` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Grid } from "webiny/admin/ui"; -``` - -```typescript -const Grid = withStaticProps(DecoratableGrid, { Column }); -``` - -### `HeaderBar` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { HeaderBar } from "webiny/admin/ui"; -``` - -```typescript -const HeaderBar = makeDecoratable("HeaderBar", HeaderBarBase); -``` - -### `Heading` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Heading } from "webiny/admin/ui"; -``` - -```typescript -const Heading = makeDecoratable("Heading", HeadingBase); -``` - -### `Icon` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Icon } from "webiny/admin/ui"; -``` - -```typescript -const Icon = makeDecoratable("Icon", IconBase); -``` - -### `IconButton` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { IconButton } from "webiny/admin/ui"; -``` - -```typescript -const IconButton = makeDecoratable("IconButton", DecoratableIconButton); -``` - -### `IconPicker` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { IconPicker } from "webiny/admin/ui"; -``` - -```typescript -const IconPicker = makeDecoratable("IconPicker", DecoratableIconPicker); -``` - -### `Image` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Image } from "webiny/admin/ui"; -``` - -```typescript -const Image = ({ ...rest }: ImageProps) => { - const finalProps = { ...rest }; - const srcSet = finalProps.srcSet; - if (srcSet && typeof srcSet === "object") { - finalProps.srcSet = Object.keys(srcSet) - .map(key => `${srcSet[key]} ${key}`) - .join(", "); - } - - return ; -}; -``` - -### `Input` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Input } from "webiny/admin/ui"; -``` - -```typescript -const Input = makeDecoratable("Input", DecoratableInput); -``` - -### `Label` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Label } from "webiny/admin/ui"; -``` - -```typescript -const Label = makeDecoratable("Label", LabelBase); -``` - -### `Link` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Link } from "webiny/admin/ui"; -``` - -```typescript -export const Link = makeDecoratable("Link", LinkBase); -``` - -### `List` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { List } from "webiny/admin/ui"; -``` - -```typescript -const List = withStaticProps(makeDecoratable("List", DecoratableList), { - Item: ListItem -}); -``` - -### `ListIcon` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { ListIcon } from "webiny/admin/ui"; -``` - -```typescript -export const ListIcon = (props: IconButtonProps) => { - return ( - } label={"List"} />} - variant={"ghost"} - size={"sm"} - {...props} - /> - ); -}; -``` - -### `Loader` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Loader } from "webiny/admin/ui"; -``` - -```typescript -const Loader = makeDecoratable("Loader", DecoratableLoader); -``` - -### `LoginIcon` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { LoginIcon } from "webiny/admin/ui"; -``` - -```typescript -export const LoginIcon = (props: IconButtonProps) => { - return ( - } label={"Login"} />} - variant={"ghost"} - size={"sm"} - {...props} - /> - ); -}; -``` - -### `MultiAutoComplete` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { MultiAutoComplete } from "webiny/admin/ui"; -``` - -```typescript -const MultiAutoComplete = makeDecoratable("MultiAutoComplete", DecoratableMultiAutoComplete); -``` - -### `MultiFilePicker` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { MultiFilePicker } from "webiny/admin/ui"; -``` - -```typescript -const MultiFilePicker = withStaticProps(DecoratableMultiFilePicker, { - Preview: { - Image: ImagePreview, - RichItem: RichItemPreview, - TextOnly: TextOnlyPreview - } -}); -``` - -### `NextPageIcon` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { NextPageIcon } from "webiny/admin/ui"; -``` - -```typescript -export const NextPageIcon = (props: IconButtonProps) => { - return ( - } label={"Next Page"} />} - variant={"ghost"} - size={"sm"} - {...props} - /> - ); -}; -``` - -### `OptionsIcon` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { OptionsIcon } from "webiny/admin/ui"; -``` - -```typescript -export const OptionsIcon = (props: IconButtonProps) => { - return ( - } label={"Options"} />} - variant={"ghost"} - size={"sm"} - {...props} - /> - ); -}; -``` - -### `OverlayLoader` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { OverlayLoader } from "webiny/admin/ui"; -``` - -```typescript -const OverlayLoader = makeDecoratable("OverlayLoader", DecoratableOverlayLoader); -``` - -### `Popover` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Popover } from "webiny/admin/ui"; -``` - -```typescript -const Popover = makeDecoratable("Popover", DecoratablePopover); -``` - -### `Portal` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Portal } from "webiny/admin/ui"; -``` - -```typescript -const Portal = PortalPrimitive.Root; -``` - -### `PreviousPageIcon` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { PreviousPageIcon } from "webiny/admin/ui"; -``` - -```typescript -export const PreviousPageIcon = (props: IconButtonProps) => { - return ( - } label={"Previous Page"} />} - variant={"ghost"} - size={"sm"} - {...props} - /> - ); -}; -``` - -### `ProgressBar` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { ProgressBar } from "webiny/admin/ui"; -``` - -```typescript -const ProgressBar = makeDecoratable("ProgressBar", DecoratableProgressBar); -``` - -### `Radio` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Radio } from "webiny/admin/ui"; -``` - -```typescript -const Radio = makeDecoratable("Radio", DecoratableRadio); -``` - -### `RadioGroup` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { RadioGroup } from "webiny/admin/ui"; -``` - -```typescript -const RadioGroup = makeDecoratable("RadioGroup", DecoratableRadioGroup); -``` - -### `RangeSlider` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { RangeSlider } from "webiny/admin/ui"; -``` - -```typescript -const RangeSlider = makeDecoratable("RangeSlider", DecoratableRangeSlider); -``` - -### `RefreshIcon` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { RefreshIcon } from "webiny/admin/ui"; -``` - -```typescript -export const RefreshIcon = (props: IconButtonProps) => { - return ( - } label={"Refresh"} />} - variant={"ghost"} - size={"sm"} - {...props} - /> - ); -}; -``` - -### `ScrollArea` - -**Function** — imported from `webiny/admin/ui` - -```typescript -import { ScrollArea } from "webiny/admin/ui"; -``` - -```typescript -function ScrollArea( -``` - -### `Scrollbar` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Scrollbar } from "webiny/admin/ui"; -``` - -```typescript -const Scrollbar = (props: ScrollbarProps) => { - return ; -}; -``` - -### `ScrollBar` - -**Function** — imported from `webiny/admin/ui` - -```typescript -import { ScrollBar } from "webiny/admin/ui"; -``` - -```typescript -function ScrollBar( -``` - -### `SegmentedControl` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { SegmentedControl } from "webiny/admin/ui"; -``` - -```typescript -const SegmentedControl = makeDecoratable("SegmentedControl", DecoratableSegmentedControl); -``` - -### `Select` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Select } from "webiny/admin/ui"; -``` - -```typescript -const Select = makeDecoratable("Select", DecoratableSelect); -``` - -### `Separator` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Separator } from "webiny/admin/ui"; -``` - -```typescript -const Separator = makeDecoratable("Separator", SeparatorBase); -``` - -### `Sidebar` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Sidebar } from "webiny/admin/ui"; -``` - -```typescript -const Sidebar = withStaticProps(DecoratableSidebar, { - Item: SidebarMenuItem, - Link: SidebarMenuLink, - Group: SidebarMenuGroup, - Icon: SidebarIcon -}); -``` - -### `SidebarProvider` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { SidebarProvider } from "webiny/admin/ui"; -``` - -```typescript -const SidebarProvider = ({ - className, - children, - state: cachedState, - onChangeState, - ...props -}: SidebarProviderProps) => { - const [sidebarState, setSidebarState] = React.useState(() => - createInitialSidebarState(cachedState) - ); - const [pinnedItemsData, setPinnedItemsData] = React.useState>( - new Map() - ); - - -``` - -### `Skeleton` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Skeleton } from "webiny/admin/ui"; -``` - -```typescript -const Skeleton = makeDecoratable("Skeleton", DecoratableSkeleton); -``` - -### `Slider` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Slider } from "webiny/admin/ui"; -``` - -```typescript -const Slider = makeDecoratable("Slider", DecoratableSlider); -``` - -### `SortIcon` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { SortIcon } from "webiny/admin/ui"; -``` - -```typescript -export const SortIcon = (props: IconButtonProps) => { - return ( - } label={"Sort"} />} - variant={"ghost"} - size={"sm"} - {...props} - /> - ); -}; -``` - -### `SteppedProgress` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { SteppedProgress } from "webiny/admin/ui"; -``` - -```typescript -const SteppedProgress = withStaticProps(BaseSteppedProgress, { - Item: SteppedProgressItem -}); -``` - -### `Switch` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Switch } from "webiny/admin/ui"; -``` - -```typescript -const Switch = makeDecoratable("Switch", DecoratableSwitch); -``` - -### `Table` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Table } from "webiny/admin/ui"; -``` - -```typescript -const Table = withStaticProps(BaseTable, { - Body, - Caption, - Cell, - Direction, - Footer, - Head, - Header, - Resizer, - Row -}); -``` - -### `Tabs` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Tabs } from "webiny/admin/ui"; -``` - -```typescript -const Tabs = withStaticProps(BaseTabs, { - Tab -}); -``` - -### `Tag` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Tag } from "webiny/admin/ui"; -``` - -```typescript -const Tag = makeDecoratable("Tag", DecoratableTag); -``` - -### `Tags` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Tags } from "webiny/admin/ui"; -``` - -```typescript -const Tags = makeDecoratable("Tags", DecoratableTags); -``` - -### `Text` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Text } from "webiny/admin/ui"; -``` - -```typescript -const Text = makeDecoratable("Text", TextBase); -``` - -### `Textarea` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Textarea } from "webiny/admin/ui"; -``` - -```typescript -const Textarea = makeDecoratable("Textarea", DecoratableTextarea); -``` - -### `TimeAgo` - -**Class** — imported from `webiny/admin/ui` - -```typescript -import { TimeAgo } from "webiny/admin/ui"; -``` - -```typescript -export default class TimeAgo extends React.PureComponent { - static defaultProps:; - dom: HTMLTimeElement; - componentDidMount(): void; - componentDidUpdate(): void; - renderTimeAgo(): void; - componentWillUnmount(): void; - render(): JSX.Element; -} -``` - -### `Toast` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Toast } from "webiny/admin/ui"; -``` - -```typescript -const Toast = withStaticProps(makeDecoratable("Toast", DecoratableToast), { - Title: ToastTitle, - Description: ToastDescription, - Actions: ToastActions, - Provider: (props: ToasterProps) => ( - - - - ) -}); -``` - -### `Tooltip` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Tooltip } from "webiny/admin/ui"; -``` - -```typescript -const Tooltip = withStaticProps(makeDecoratable("Tooltip", DecoratableTooltip), { - Provider: TooltipProvider -}); -``` - -### `Tree` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Tree } from "webiny/admin/ui"; -``` - -```typescript -const Tree = withStaticProps(DecoratableTree, { - Item -}); -``` - -### `UploadIcon` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { UploadIcon } from "webiny/admin/ui"; -``` - -```typescript -export const UploadIcon = (props: IconButtonProps) => { - return ( - } label={"Upload"} />} - variant={"ghost"} - size={"sm"} - {...props} - /> - ); -}; -``` - -### `Widget` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { Widget } from "webiny/admin/ui"; -``` - -```typescript -const Widget = withStaticProps(DecoratableWidget, { - Action: WidgetAction, - Icon -}); -``` - -## Hooks - -### `useDialogs` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { useDialogs } from "webiny/admin/ui"; -``` - -```typescript -export const useDialogs = () => { - const context = useContext(DialogsContext); - - if (!context) { - throw new Error("useDialogs must be used within a DialogsContext.Provider"); - } - - return context; -}; -``` - -### `useDisclosure` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { useDisclosure } from "webiny/admin/ui"; -``` - -```typescript -export const useDisclosure = (isOpenDefault = false) => { - const [isOpen, defaultSetIsOpen] = useState(isOpenDefault); - const [data, setData] = useState(null); - - const setIsOpen = useCallback( - (isOpen: boolean | ((prev: boolean) => boolean), data?: TData) => { - defaultSetIsOpen(isOpen); - if (typeof data !== "undefined") { - -``` - -### `useSidebar` - -**Function** — imported from `webiny/admin/ui` - -```typescript -import { useSidebar } from "webiny/admin/ui"; -``` - -```typescript -function useSidebar(); -``` - -### `useToast` - -**Constant** — imported from `webiny/admin/ui` - -```typescript -import { useToast } from "webiny/admin/ui"; -``` - -```typescript -const useToast = () => { - const getTitle = React.useCallback((title: React.ReactElement | string) => { - return typeof title === "string" ? : title; - }, []); - - const getDescription = React.useCallback( - (description: React.ReactElement | string | undefined) => { - return typeof description === " -``` diff --git a/docs/developer-docs/6.x/reference/admin/website-builder.ai.txt b/docs/developer-docs/6.x/reference/admin/website-builder.ai.txt deleted file mode 100644 index 2b1b16a41..000000000 --- a/docs/developer-docs/6.x/reference/admin/website-builder.ai.txt +++ /dev/null @@ -1,26 +0,0 @@ -AI Context: Website Builder (reference/admin/website-builder.mdx) - -Source of Information: -1. packages/webiny/src/admin/website-builder.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app-website-builder/src/routes.ts — originating source -3. /Users/adrian/dev/wby-next/packages/app-website-builder/src/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -Routes, pagePathFromTitle - -Import Path: webiny/admin/website-builder - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/website-builder.mdx b/docs/developer-docs/6.x/reference/admin/website-builder.mdx deleted file mode 100644 index 56a8de27d..000000000 --- a/docs/developer-docs/6.x/reference/admin/website-builder.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: ywrtaw4v -title: Website Builder -description: "Website Builder admin utilities" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/website-builder`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/website-builder`. Import any of the items below directly from this path in your Webiny extensions. - -**Components** - - - -**Other** - - - -## Components - -### `Routes` - -**Constant** — imported from `webiny/admin/website-builder` - -```typescript -import { Routes } from "webiny/admin/website-builder"; -``` - -```typescript -export const Routes = { - Pages: { - List: new Route({ - name: "WebsiteBuilder/Pages/List", - path: "/website-builder/pages", - params: zod => { - return { - folderId: zod.string().optional(), - search: zod.string().optional() - }; - } - }), - Editor: new Route({ - -``` - -## Other - -### `pagePathFromTitle` - -**Constant** — imported from `webiny/admin/website-builder` - -```typescript -import { pagePathFromTitle } from "webiny/admin/website-builder"; -``` - -```typescript -export const pagePathFromTitle = (title: string = "") => { - return slugify(title, { - replacement: "-", - lower: true, - remove: /[*#\?<>_\{\}\[\]+~.()'"!:;@]/g, - trim: false - }); -}; -``` diff --git a/docs/developer-docs/6.x/reference/admin/website-builder/lexical.ai.txt b/docs/developer-docs/6.x/reference/admin/website-builder/lexical.ai.txt deleted file mode 100644 index 547bd9556..000000000 --- a/docs/developer-docs/6.x/reference/admin/website-builder/lexical.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Lexical Editor (reference/admin/website-builder/lexical.mdx) - -Source of Information: -1. packages/webiny/src/admin/website-builder/lexical.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/lexical-editor/src/exports/admin/lexical.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -useLexicalEditorConfig, LexicalHtmlRenderer, getNodeFromSelection, useCurrentElement, useCurrentSelection, useDeriveValueFromSelection, useRichTextEditor, useFontColorPicker, useTextAlignmentAction, useTypographyAction, useIsMounted, Divider, DropDownItem, DropDown, Klass, LexicalNode - -Import Path: webiny/admin/website-builder/lexical - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/website-builder/lexical.mdx b/docs/developer-docs/6.x/reference/admin/website-builder/lexical.mdx deleted file mode 100644 index 3ae307131..000000000 --- a/docs/developer-docs/6.x/reference/admin/website-builder/lexical.mdx +++ /dev/null @@ -1,168 +0,0 @@ ---- -id: ywrtaw4v -title: Lexical Editor -description: "Website Builder Lexical editor config" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/website-builder/lexical`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/website-builder/lexical`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `Divider` - -**Export** — imported from `webiny/admin/website-builder/lexical` - -```typescript -import { Divider } from "webiny/admin/website-builder/lexical"; -``` - -## `DropDown` - -**Export** — imported from `webiny/admin/website-builder/lexical` - -```typescript -import { DropDown } from "webiny/admin/website-builder/lexical"; -``` - -## `DropDownItem` - -**Export** — imported from `webiny/admin/website-builder/lexical` - -```typescript -import { DropDownItem } from "webiny/admin/website-builder/lexical"; -``` - -## `getNodeFromSelection` - -**Export** — imported from `webiny/admin/website-builder/lexical` - -```typescript -import { getNodeFromSelection } from "webiny/admin/website-builder/lexical"; -``` - -## `Klass` - -**Type** — imported from `webiny/admin/website-builder/lexical` - -```typescript -import type { Klass } from "webiny/admin/website-builder/lexical"; -``` - -## `LexicalHtmlRenderer` - -**Export** — imported from `webiny/admin/website-builder/lexical` - -```typescript -import { LexicalHtmlRenderer } from "webiny/admin/website-builder/lexical"; -``` - -## `LexicalNode` - -**Type** — imported from `webiny/admin/website-builder/lexical` - -```typescript -import type { LexicalNode } from "webiny/admin/website-builder/lexical"; -``` - -## `useCurrentElement` - -**Export** — imported from `webiny/admin/website-builder/lexical` - -```typescript -import { useCurrentElement } from "webiny/admin/website-builder/lexical"; -``` - -## `useCurrentSelection` - -**Export** — imported from `webiny/admin/website-builder/lexical` - -```typescript -import { useCurrentSelection } from "webiny/admin/website-builder/lexical"; -``` - -## `useDeriveValueFromSelection` - -**Export** — imported from `webiny/admin/website-builder/lexical` - -```typescript -import { useDeriveValueFromSelection } from "webiny/admin/website-builder/lexical"; -``` - -## `useFontColorPicker` - -**Export** — imported from `webiny/admin/website-builder/lexical` - -```typescript -import { useFontColorPicker } from "webiny/admin/website-builder/lexical"; -``` - -## `useIsMounted` - -**Export** — imported from `webiny/admin/website-builder/lexical` - -```typescript -import { useIsMounted } from "webiny/admin/website-builder/lexical"; -``` - -## `useLexicalEditorConfig` - -**Export** — imported from `webiny/admin/website-builder/lexical` - -```typescript -import { useLexicalEditorConfig } from "webiny/admin/website-builder/lexical"; -``` - -## `useRichTextEditor` - -**Export** — imported from `webiny/admin/website-builder/lexical` - -```typescript -import { useRichTextEditor } from "webiny/admin/website-builder/lexical"; -``` - -## `useTextAlignmentAction` - -**Export** — imported from `webiny/admin/website-builder/lexical` - -```typescript -import { useTextAlignmentAction } from "webiny/admin/website-builder/lexical"; -``` - -## `useTypographyAction` - -**Export** — imported from `webiny/admin/website-builder/lexical` - -```typescript -import { useTypographyAction } from "webiny/admin/website-builder/lexical"; -``` diff --git a/docs/developer-docs/6.x/reference/admin/website-builder/page/editor.ai.txt b/docs/developer-docs/6.x/reference/admin/website-builder/page/editor.ai.txt deleted file mode 100644 index 24be056d3..000000000 --- a/docs/developer-docs/6.x/reference/admin/website-builder/page/editor.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Editor (reference/admin/website-builder/page/editor.mdx) - -Source of Information: -1. packages/webiny/src/admin/website-builder/page/editor.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app-website-builder/src/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -Editor, PageEditorConfig - -Import Path: webiny/admin/website-builder/page/editor - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/website-builder/page/editor.mdx b/docs/developer-docs/6.x/reference/admin/website-builder/page/editor.mdx deleted file mode 100644 index 0b4f824d7..000000000 --- a/docs/developer-docs/6.x/reference/admin/website-builder/page/editor.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -id: ywrtaw4v -title: Editor -description: "Page editor components" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/website-builder/page/editor`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/website-builder/page/editor`. Import any of the items below directly from this path in your Webiny extensions. - -**Components** - - - -**Other** - - - -## Components - -### `PageEditorConfig` - -**Constant** — imported from `webiny/admin/website-builder/page/editor` - -```typescript -import { PageEditorConfig } from "webiny/admin/website-builder/page/editor"; -``` - -```typescript -export const PageEditorConfig = Object.assign(BasePageEditorConfig, EditorConfig); -``` - -## Other - -### `Editor` - -**Export** — imported from `webiny/admin/website-builder/page/editor` - -```typescript -import { Editor } from "webiny/admin/website-builder/page/editor"; -``` - -```typescript -export { DefaultEditorConfig } from "./defaultConfig/DefaultEditorConfig.js"; -export * from "./config/index.js"; -export * from "./commands.js"; -export type { ElementInputRendererProps } from "./config/ElementInput.js"; -``` diff --git a/docs/developer-docs/6.x/reference/admin/website-builder/page/list.ai.txt b/docs/developer-docs/6.x/reference/admin/website-builder/page/list.ai.txt deleted file mode 100644 index 768eba450..000000000 --- a/docs/developer-docs/6.x/reference/admin/website-builder/page/list.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: List (reference/admin/website-builder/page/list.mdx) - -Source of Information: -1. packages/webiny/src/admin/website-builder/page/list.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app-website-builder/src/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -PageListConfig - -Import Path: webiny/admin/website-builder/page/list - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/website-builder/page/list.mdx b/docs/developer-docs/6.x/reference/admin/website-builder/page/list.mdx deleted file mode 100644 index 392176817..000000000 --- a/docs/developer-docs/6.x/reference/admin/website-builder/page/list.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -id: ywrtaw4v -title: List -description: "Page list configuration" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/website-builder/page/list`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/website-builder/page/list`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `PageListConfig` - -**Export** — imported from `webiny/admin/website-builder/page/list` - -```typescript -import { PageListConfig } from "webiny/admin/website-builder/page/list"; -``` diff --git a/docs/developer-docs/6.x/reference/admin/website-builder/redirect/list.ai.txt b/docs/developer-docs/6.x/reference/admin/website-builder/redirect/list.ai.txt deleted file mode 100644 index 6fa90e2bf..000000000 --- a/docs/developer-docs/6.x/reference/admin/website-builder/redirect/list.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: List (reference/admin/website-builder/redirect/list.mdx) - -Source of Information: -1. packages/webiny/src/admin/website-builder/redirect/list.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/app-website-builder/src/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -RedirectListConfig - -Import Path: webiny/admin/website-builder/redirect/list - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/admin/website-builder/redirect/list.mdx b/docs/developer-docs/6.x/reference/admin/website-builder/redirect/list.mdx deleted file mode 100644 index ab4d27adc..000000000 --- a/docs/developer-docs/6.x/reference/admin/website-builder/redirect/list.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -id: ywrtaw4v -title: List -description: "Redirect list configuration" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/admin/website-builder/redirect/list`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/admin/website-builder/redirect/list`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `RedirectListConfig` - -**Export** — imported from `webiny/admin/website-builder/redirect/list` - -```typescript -import { RedirectListConfig } from "webiny/admin/website-builder/redirect/list"; -``` diff --git a/docs/developer-docs/6.x/reference/api.ai.txt b/docs/developer-docs/6.x/reference/api.ai.txt deleted file mode 100644 index ac4617720..000000000 --- a/docs/developer-docs/6.x/reference/api.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: API (reference/api.mdx) - -Source of Information: -1. packages/webiny/src/api.ts — barrel re-export file - - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: - - -Import Path: webiny/api - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api.mdx b/docs/developer-docs/6.x/reference/api.mdx deleted file mode 100644 index 19b8a8e57..000000000 --- a/docs/developer-docs/6.x/reference/api.mdx +++ /dev/null @@ -1,21 +0,0 @@ ---- -id: yxbp0000 -title: API -description: "Core API primitives: createFeature, createAbstraction, Result, BaseError" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/api`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api`. Import any of the items below directly from this path in your Webiny extensions. - -_No exported symbols found._ diff --git a/docs/developer-docs/6.x/reference/api/build-params.ai.txt b/docs/developer-docs/6.x/reference/api/build-params.ai.txt deleted file mode 100644 index 46a469299..000000000 --- a/docs/developer-docs/6.x/reference/api/build-params.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Build Params (reference/api/build-params.mdx) - -Source of Information: -1. packages/webiny/src/api/build-params.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-core/src/features/buildParams/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -BuildParam, BuildParams - -Import Path: webiny/api/build-params - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/build-params.mdx b/docs/developer-docs/6.x/reference/api/build-params.mdx deleted file mode 100644 index 610d8b272..000000000 --- a/docs/developer-docs/6.x/reference/api/build-params.mdx +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: yxbpl2j1 -title: Build Params -description: "Reference for webiny/api/build-params" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/api/build-params`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/build-params`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `BuildParam` - -**Abstraction** — imported from `webiny/api/build-params` - -```typescript -import { BuildParam } from "webiny/api/build-params"; -``` - -**Interface `BuildParam.Interface`:** - -```typescript -interface BuildParam.Interface { - key: string; - value: any; -} -``` - -**Types:** - -```typescript -namespace BuildParam { - type Interface = IBuildParam; -} -``` - -## `BuildParams` - -**Abstraction** — imported from `webiny/api/build-params` - -```typescript -import { BuildParams } from "webiny/api/build-params"; -``` - -**Interface `BuildParams.Interface`:** - -```typescript -interface BuildParams.Interface { - get(key: string): T | null; -} -``` - -**Types:** - -```typescript -namespace BuildParams { - type Interface = IBuildParams; -} -``` diff --git a/docs/developer-docs/6.x/reference/api/buildParams.ai.txt b/docs/developer-docs/6.x/reference/api/buildParams.ai.txt deleted file mode 100644 index c27a9c8e8..000000000 --- a/docs/developer-docs/6.x/reference/api/buildParams.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Build Params (reference/api/buildParams.mdx) - -Source of Information: -1. packages/webiny/src/api/buildParams.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-core/src/features/buildParams/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -BuildParam, BuildParams - -Import Path: webiny/api/buildParams - -Related Documents: -- docs/developer-docs/6.0.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.0.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/buildParams.mdx b/docs/developer-docs/6.x/reference/api/buildParams.mdx deleted file mode 100644 index 52e3e79a0..000000000 --- a/docs/developer-docs/6.x/reference/api/buildParams.mdx +++ /dev/null @@ -1,115 +0,0 @@ ---- -id: yxbpl2j1 -title: Build Params -description: "API build parameter types" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/api/buildParams`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/buildParams`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `BuildParam` - -**Abstraction** — imported from `webiny/api/buildParams` - -```typescript -import { BuildParam } from "webiny/api/buildParams"; -``` - -**Interface `BuildParam.Interface`:** - -```typescript -interface BuildParam.Interface { - key: string; - value: any; -} -``` - -**Types:** - -```typescript -namespace BuildParam { - type Interface = IBuildParam; -} -``` - -**Usage:** - -```typescript -// extensions/MyImpl.ts -import { BuildParam } from "webiny/api/buildParams"; - -class MyImpl implements MyUseCase.Interface { - public constructor(private buildParam: BuildParam.Interface) {} - - public async execute(/* ... */): Promise { - this.buildParam.key: string(/* ... */); - } -} - -export default MyUseCase.createImplementation({ - implementation: MyImpl, - dependencies: [BuildParam] -}); -``` - -## `BuildParams` - -**Abstraction** — imported from `webiny/api/buildParams` - -```typescript -import { BuildParams } from "webiny/api/buildParams"; -``` - -**Interface `BuildParams.Interface`:** - -```typescript -interface BuildParams.Interface { - get(key: string): T | null; -} -``` - -**Types:** - -```typescript -namespace BuildParams { - type Interface = IBuildParams; -} -``` - -**Usage:** - -```typescript -// extensions/MyImpl.ts -import { BuildParams } from "webiny/api/buildParams"; - -class MyImpl implements MyUseCase.Interface { - public constructor(private buildParams: BuildParams.Interface) {} - - public async execute(/* ... */): Promise { - this.buildParams.get(/* ... */); - } -} - -export default MyUseCase.createImplementation({ - implementation: MyImpl, - dependencies: [BuildParams] -}); -``` diff --git a/docs/developer-docs/6.x/reference/api/cms/entry.ai.txt b/docs/developer-docs/6.x/reference/api/cms/entry.ai.txt deleted file mode 100644 index 6931e429c..000000000 --- a/docs/developer-docs/6.x/reference/api/cms/entry.ai.txt +++ /dev/null @@ -1,64 +0,0 @@ -AI Context: Entry (reference/api/cms/entry.mdx) - -Source of Information: -1. packages/webiny/src/api/cms/entry.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/domain/contentEntry/EntryId.ts — originating source -3. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/types/types.ts — originating source -4. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/CreateEntry/abstractions.ts — originating source -5. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/CreateEntry/events.ts — originating source -6. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/CreateEntryRevisionFrom/abstractions.ts — originating source -7. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/CreateEntryRevisionFrom/events.ts — originating source -8. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/DeleteEntry/abstractions.ts — originating source -9. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/DeleteEntry/events.ts — originating source -10. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/DeleteEntryRevision/abstractions.ts — originating source -11. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/DeleteEntryRevision/events.ts — originating source -12. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/DeleteMultipleEntries/abstractions.ts — originating source -13. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/DeleteMultipleEntries/events.ts — originating source -14. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/MoveEntry/abstractions.ts — originating source -15. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/MoveEntry/events.ts — originating source -16. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/PublishEntry/abstractions.ts — originating source -17. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/PublishEntry/events.ts — originating source -18. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/RepublishEntry/abstractions.ts — originating source -19. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/RepublishEntry/events.ts — originating source -20. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/RestoreEntryFromBin/abstractions.ts — originating source -21. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/RestoreEntryFromBin/events.ts — originating source -22. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/UnpublishEntry/abstractions.ts — originating source -23. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/UnpublishEntry/events.ts — originating source -24. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/UpdateEntry/abstractions.ts — originating source -25. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/UpdateEntry/events.ts — originating source -26. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/UpdateSingletonEntry/abstractions.ts — originating source -27. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/GetEntriesByIds/abstractions.ts — originating source -28. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/GetEntry/abstractions.ts — originating source -29. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/GetEntryById/abstractions.ts — originating source -30. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/GetLatestEntriesByIds/abstractions.ts — originating source -31. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/GetLatestRevisionByEntryId/abstractions.ts — originating source -32. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/GetPreviousRevisionByEntryId/abstractions.ts — originating source -33. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/GetPublishedEntriesByIds/abstractions.ts — originating source -34. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/GetPublishedRevisionByEntryId/abstractions.ts — originating source -35. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/GetRevisionById/abstractions.ts — originating source -36. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/GetRevisionsByEntryId/abstractions.ts — originating source -37. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/GetSingletonEntry/abstractions.ts — originating source -38. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/ListEntries/abstractions.ts — originating source -39. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentEntry/ValidateEntry/abstractions.ts — originating source -40. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/whereMapper/abstractions.ts — originating source -41. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/sortMapper/abstractions.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -EntryId, CmsEntry, CmsEntryValues, CreateEntryUseCase, EntryBeforeCreateEventHandler, EntryAfterCreateEventHandler, CreateEntryRevisionFromUseCase, EntryRevisionBeforeCreateEventHandler, EntryRevisionAfterCreateEventHandler, DeleteEntryUseCase, MoveEntryToBinUseCase, EntryBeforeDeleteEventHandler, EntryAfterDeleteEventHandler, DeleteEntryRevisionUseCase, EntryRevisionBeforeDeleteEventHandler, EntryRevisionAfterDeleteEventHandler, DeleteMultipleEntriesUseCase, EntryBeforeDeleteMultipleEventHandler, EntryAfterDeleteMultipleEventHandler, MoveEntryUseCase, EntryBeforeMoveEventHandler, EntryAfterMoveEventHandler, PublishEntryUseCase, EntryBeforePublishEventHandler, EntryAfterPublishEventHandler, RepublishEntryUseCase, EntryBeforeRepublishEventHandler, EntryAfterRepublishEventHandler, RestoreEntryFromBinUseCase, EntryBeforeRestoreFromBinEventHandler, EntryAfterRestoreFromBinEventHandler, UnpublishEntryUseCase, EntryBeforeUnpublishEventHandler, EntryAfterUnpublishEventHandler, UpdateEntryUseCase, EntryBeforeUpdateEventHandler, EntryAfterUpdateEventHandler, UpdateSingletonEntryUseCase, GetEntriesByIdsUseCase, GetEntryUseCase, GetEntryByIdUseCase, GetLatestEntriesByIdsUseCase, GetLatestRevisionByEntryIdBaseUseCase, GetLatestRevisionByEntryIdUseCase, GetLatestDeletedRevisionByEntryIdUseCase, GetLatestRevisionByEntryIdIncludingDeletedUseCase, GetPreviousRevisionByEntryIdBaseUseCase, GetPreviousRevisionByEntryIdUseCase, GetPublishedEntriesByIdsUseCase, GetPublishedRevisionByEntryIdUseCase, GetRevisionByIdUseCase, GetRevisionsByEntryIdUseCase, GetSingletonEntryUseCase, ListEntriesUseCase, ListLatestEntriesUseCase, ListPublishedEntriesUseCase, ListDeletedEntriesUseCase, ValidateEntryUseCase, CmsWhereMapper, CmsSortMapper - -Import Path: webiny/api/cms/entry - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/cms/entry.mdx b/docs/developer-docs/6.x/reference/api/cms/entry.mdx deleted file mode 100644 index 0c3d74ca9..000000000 --- a/docs/developer-docs/6.x/reference/api/cms/entry.mdx +++ /dev/null @@ -1,1950 +0,0 @@ ---- -id: yxbpl2nt -title: Entry -description: "CMS entry use cases and event handlers" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What use cases are available in `webiny/api/cms/entry`? -- Which event handlers can you implement? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/cms/entry`. Import any of the items below directly from this path in your Webiny extensions. - -**Use Cases** - - - -**Event Handlers** - - - -**Services** - - - -**Types & Classes** - - - -## Use Cases - -### `CreateEntryRevisionFromUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { CreateEntryRevisionFromUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `CreateEntryRevisionFromUseCase.Interface`:** - -CreateEntryRevisionFrom Use Case - Creates a new revision from an existing entry. - -```typescript -interface CreateEntryRevisionFromUseCase.Interface { - execute( - model: CmsModel, - sourceId: string, - input: CreateCmsEntryInput, - options?: CreateCmsEntryOptionsInput - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace CreateEntryRevisionFromUseCase { - type Interface = ICreateEntryRevisionFromUseCase; - type Input = CreateCmsEntryInput; - type Options = CreateCmsEntryOptionsInput; - type Return = Promise, UseCaseError>>; - type Error = UseCaseError; -} -``` - -### `CreateEntryUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { CreateEntryUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `CreateEntryUseCase.Interface`:** - -CreateEntry Use Case - -```typescript -interface CreateEntryUseCase.Interface { - execute( - model: CmsModel, - input: CreateCmsEntryInput, - options?: CreateCmsEntryOptionsInput - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace CreateEntryUseCase { - type Interface = ICreateEntryUseCase; - type Input = CreateCmsEntryInput; - type Options = CreateCmsEntryOptionsInput; - type Error = UseCaseError; - type Return = Promise, UseCaseError>>; -} -``` - -### `DeleteEntryRevisionUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { DeleteEntryRevisionUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `DeleteEntryRevisionUseCase.Interface`:** - -DeleteEntryRevision Use Case - Deletes a specific revision of an entry. -Handles special cases like deleting the latest revision. - -```typescript -interface DeleteEntryRevisionUseCase.Interface { - execute(model: CmsModel, revisionId: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace DeleteEntryRevisionUseCase { - type Interface = IDeleteEntryRevisionUseCase; - type Error = UseCaseError; - type Return = Promise>; -} -``` - -### `DeleteEntryUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { DeleteEntryUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `DeleteEntryUseCase.Interface`:** - -DeleteEntry Use Case - Permanently deletes an entry from the database. -This is a hard delete that removes all traces of the entry. - -```typescript -interface DeleteEntryUseCase.Interface { - execute( - model: CmsModel, - id: string, - options?: CmsDeleteEntryOptions - ): Promise>; -} -``` - -**Types:** - -```typescript -namespace DeleteEntryUseCase { - type Interface = IDeleteEntryUseCase; - type Options = CmsDeleteEntryOptions; - type Error = UseCaseError; - type Return = Promise>; -} -``` - -### `DeleteMultipleEntriesUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { DeleteMultipleEntriesUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `DeleteMultipleEntriesUseCase.Interface`:** - -```typescript -interface DeleteMultipleEntriesUseCase.Interface { - execute( - model: CmsModel, - params: IDeleteMultipleEntriesUseCaseParams - ): Promise>; -} -``` - -**Types:** - -```typescript -namespace DeleteMultipleEntriesUseCase { - type Interface = IDeleteMultipleEntriesUseCase; - type Params = IDeleteMultipleEntriesUseCaseParams; - type Error = UseCaseError; - type Return = Promise>; -} -``` - -### `GetEntriesByIdsUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { GetEntriesByIdsUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `GetEntriesByIdsUseCase.Interface`:** - -GetEntriesByIds Use Case - Fetches multiple entries by their exact revision IDs. -Returns array of entries (excludes deleted entries via decorator). - -```typescript -interface GetEntriesByIdsUseCase.Interface { - execute( - model: CmsModel, - ids: string[] - ): Promise[], UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace GetEntriesByIdsUseCase { - type Interface = IGetEntriesByIdsUseCase; - type Error = UseCaseError; - type Return = Promise[], UseCaseError>>; -} -``` - -### `GetEntryByIdUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { GetEntryByIdUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `GetEntryByIdUseCase.Interface`:** - -GetEntryById Use Case - Fetches a single entry by its exact revision ID. -Returns entry or fails with EntryNotFoundError if not found or deleted. - -```typescript -interface GetEntryByIdUseCase.Interface { - execute( - model: CmsModel, - id: string - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace GetEntryByIdUseCase { - type Interface = IGetEntryByIdUseCase; - type Error = UseCaseError; - type Return = Promise, UseCaseError>>; -} -``` - -### `GetEntryUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { GetEntryUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `GetEntryUseCase.Interface`:** - -GetEntry Use Case - Gets a single entry by query parameters (where + sort). -Uses list operation with limit 1 and returns first result or NotFoundError. - -```typescript -interface GetEntryUseCase.Interface { - execute( - model: CmsModel, - params: CmsEntryGetParams - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace GetEntryUseCase { - type Interface = IGetEntryUseCase; - type Error = UseCaseError; - type Params = CmsEntryGetParams; - type Return = Promise, UseCaseError>>; -} -``` - -### `GetLatestDeletedRevisionByEntryIdUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { GetLatestDeletedRevisionByEntryIdUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `GetLatestDeletedRevisionByEntryIdUseCase.Interface`:** - -Base internal use case - returns entry regardless of deleted state. -This is used internally by the three public variations. - -```typescript -interface GetLatestDeletedRevisionByEntryIdUseCase.Interface { - execute( - model: CmsModel, - params: CmsEntryStorageOperationsGetLatestRevisionParams - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace GetLatestDeletedRevisionByEntryIdUseCase { - type Interface = IGetLatestRevisionByEntryIdBaseUseCase; - type Params = CmsEntryStorageOperationsGetLatestRevisionParams; - type Error = UseCaseError; - type Return = Promise, UseCaseError>>; -} -``` - -### `GetLatestEntriesByIdsUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { GetLatestEntriesByIdsUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `GetLatestEntriesByIdsUseCase.Interface`:** - -GetLatestEntriesByIds Use Case - Fetches latest revisions by entry IDs. -Returns array of latest entries (excludes deleted entries via decorator). - -```typescript -interface GetLatestEntriesByIdsUseCase.Interface { - execute( - model: CmsModel, - ids: string[] - ): Promise[], UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace GetLatestEntriesByIdsUseCase { - type Interface = IGetLatestEntriesByIdsUseCase; - type Error = UseCaseError; - type Return = Promise[], UseCaseError>>; -} -``` - -### `GetLatestRevisionByEntryIdBaseUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { GetLatestRevisionByEntryIdBaseUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `GetLatestRevisionByEntryIdBaseUseCase.Interface`:** - -Base internal use case - returns entry regardless of deleted state. -This is used internally by the three public variations. - -```typescript -interface GetLatestRevisionByEntryIdBaseUseCase.Interface { - execute( - model: CmsModel, - params: CmsEntryStorageOperationsGetLatestRevisionParams - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace GetLatestRevisionByEntryIdBaseUseCase { - type Interface = IGetLatestRevisionByEntryIdBaseUseCase; - type Params = CmsEntryStorageOperationsGetLatestRevisionParams; - type Error = UseCaseError; - type Return = Promise, UseCaseError>>; -} -``` - -### `GetLatestRevisionByEntryIdIncludingDeletedUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { GetLatestRevisionByEntryIdIncludingDeletedUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `GetLatestRevisionByEntryIdIncludingDeletedUseCase.Interface`:** - -Base internal use case - returns entry regardless of deleted state. -This is used internally by the three public variations. - -```typescript -interface GetLatestRevisionByEntryIdIncludingDeletedUseCase.Interface { - execute( - model: CmsModel, - params: CmsEntryStorageOperationsGetLatestRevisionParams - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace GetLatestRevisionByEntryIdIncludingDeletedUseCase { - type Interface = IGetLatestRevisionByEntryIdBaseUseCase; - type Params = CmsEntryStorageOperationsGetLatestRevisionParams; - type Error = UseCaseError; - type Return = Promise, UseCaseError>>; -} -``` - -### `GetLatestRevisionByEntryIdUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { GetLatestRevisionByEntryIdUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `GetLatestRevisionByEntryIdUseCase.Interface`:** - -Base internal use case - returns entry regardless of deleted state. -This is used internally by the three public variations. - -```typescript -interface GetLatestRevisionByEntryIdUseCase.Interface { - execute( - model: CmsModel, - params: CmsEntryStorageOperationsGetLatestRevisionParams - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace GetLatestRevisionByEntryIdUseCase { - type Interface = IGetLatestRevisionByEntryIdBaseUseCase; - type Params = CmsEntryStorageOperationsGetLatestRevisionParams; - type Error = UseCaseError; - type Return = Promise, UseCaseError>>; -} -``` - -### `GetPreviousRevisionByEntryIdBaseUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { GetPreviousRevisionByEntryIdBaseUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `GetPreviousRevisionByEntryIdBaseUseCase.Interface`:** - -Base internal use case - returns entry regardless of deleted state. -This is used internally by the public variation. - -```typescript -interface GetPreviousRevisionByEntryIdBaseUseCase.Interface { - execute( - model: CmsModel, - params: CmsEntryStorageOperationsGetPreviousRevisionParams - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace GetPreviousRevisionByEntryIdBaseUseCase { - type Interface = IGetPreviousRevisionByEntryIdBaseUseCase; - type Params = CmsEntryStorageOperationsGetPreviousRevisionParams; - type Error = UseCaseError; - type Return = Promise, UseCaseError>>; -} -``` - -### `GetPreviousRevisionByEntryIdUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { GetPreviousRevisionByEntryIdUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `GetPreviousRevisionByEntryIdUseCase.Interface`:** - -Base internal use case - returns entry regardless of deleted state. -This is used internally by the public variation. - -```typescript -interface GetPreviousRevisionByEntryIdUseCase.Interface { - execute( - model: CmsModel, - params: CmsEntryStorageOperationsGetPreviousRevisionParams - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace GetPreviousRevisionByEntryIdUseCase { - type Interface = IGetPreviousRevisionByEntryIdBaseUseCase; - type Params = CmsEntryStorageOperationsGetPreviousRevisionParams; - type Error = UseCaseError; - type Return = Promise, UseCaseError>>; -} -``` - -### `GetPublishedEntriesByIdsUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { GetPublishedEntriesByIdsUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `GetPublishedEntriesByIdsUseCase.Interface`:** - -GetPublishedEntriesByIds Use Case - Fetches published revisions by entry IDs. -Returns array of published entries (excludes deleted entries via decorator). - -```typescript -interface GetPublishedEntriesByIdsUseCase.Interface { - execute( - model: CmsModel, - ids: string[] - ): Promise[], UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace GetPublishedEntriesByIdsUseCase { - type Interface = IGetPublishedEntriesByIdsUseCase; - type Error = UseCaseError; - type Return = Promise[], UseCaseError>>; -} -``` - -### `GetPublishedRevisionByEntryIdUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { GetPublishedRevisionByEntryIdUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `GetPublishedRevisionByEntryIdUseCase.Interface`:** - -GetPublishedRevisionByEntryId Use Case - -```typescript -interface GetPublishedRevisionByEntryIdUseCase.Interface { - execute( - model: CmsModel, - entryId: string - ): Promise | null, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace GetPublishedRevisionByEntryIdUseCase { - type Interface = IGetPublishedRevisionByEntryIdUseCase; - type Error = UseCaseError; - type Return = Promise | null, UseCaseError>>; -} -``` - -### `GetRevisionByIdUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { GetRevisionByIdUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `GetRevisionByIdUseCase.Interface`:** - -GetRevisionById Use Case - Fetches a specific entry revision by ID. -Returns the entry or fails with EntryNotFoundError if not found or deleted. - -```typescript -interface GetRevisionByIdUseCase.Interface { - execute( - model: CmsModel, - id: string - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace GetRevisionByIdUseCase { - type Interface = IGetRevisionByIdUseCase; - type Error = UseCaseError; - type Return = Promise, UseCaseError>>; -} -``` - -### `GetRevisionsByEntryIdUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { GetRevisionsByEntryIdUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `GetRevisionsByEntryIdUseCase.Interface`:** - -GetRevisionsByEntryId Use Case - Fetches all revisions for a given entry ID. -Returns array of entry revisions. - -```typescript -interface GetRevisionsByEntryIdUseCase.Interface { - execute( - model: CmsModel, - entryId: string - ): Promise[], UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace GetRevisionsByEntryIdUseCase { - type Interface = IGetRevisionsByEntryIdUseCase; - type Error = UseCaseError; - type Return = Promise[], UseCaseError>>; -} -``` - -### `GetSingletonEntryUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { GetSingletonEntryUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `GetSingletonEntryUseCase.Interface`:** - -GetSingletonEntry Use Case - -Gets the singleton entry for a model, creating it if it doesn't exist. - -```typescript -interface GetSingletonEntryUseCase.Interface { - execute( - model: CmsModel - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace GetSingletonEntryUseCase { - type Interface = IGetSingletonEntryUseCase; - type Error = UseCaseError; - type Return = Promise, UseCaseError>>; -} -``` - -### `ListDeletedEntriesUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { ListDeletedEntriesUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `ListDeletedEntriesUseCase.Interface`:** - -ListDeletedEntries Use Case - Lists deleted entries (manage API). - -```typescript -interface ListDeletedEntriesUseCase.Interface { - execute( - model: CmsModel, - params?: CmsEntryListParams - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace ListDeletedEntriesUseCase { - type Interface = IListDeletedEntriesUseCase; - type Params = CmsEntryListParams; - type Return = Promise, UseCaseError>>; - type Error = UseCaseError; -} -``` - -### `ListEntriesUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { ListEntriesUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `ListEntriesUseCase.Interface`:** - -Base ListEntries Use Case - Internal base use case for listing entries. -Used by specific variants (Latest, Published, Deleted). - -```typescript -interface ListEntriesUseCase.Interface { - execute( - model: CmsModel, - params?: CmsEntryListParams - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace ListEntriesUseCase { - type Interface = IListEntriesUseCase; - type Params = CmsEntryListParams; - type Return = Promise, UseCaseError>>; - type Error = UseCaseError; -} -``` - -### `ListLatestEntriesUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { ListLatestEntriesUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `ListLatestEntriesUseCase.Interface`:** - -ListLatestEntries Use Case - Lists latest entries (manage API). - -```typescript -interface ListLatestEntriesUseCase.Interface { - execute( - model: CmsModel, - params?: CmsEntryListParams - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace ListLatestEntriesUseCase { - type Interface = IListLatestEntriesUseCase; - type Params = CmsEntryListParams; - type Return = Promise, UseCaseError>>; - type Error = UseCaseError; -} -``` - -### `ListPublishedEntriesUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { ListPublishedEntriesUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `ListPublishedEntriesUseCase.Interface`:** - -ListPublishedEntries Use Case - Lists published entries (read API). - -```typescript -interface ListPublishedEntriesUseCase.Interface { - execute( - model: CmsModel, - params?: CmsEntryListParams - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace ListPublishedEntriesUseCase { - type Interface = IListPublishedEntriesUseCase; - type Params = CmsEntryListParams; - type Return = Promise, UseCaseError>>; - type Error = UseCaseError; -} -``` - -### `MoveEntryToBinUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { MoveEntryToBinUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `MoveEntryToBinUseCase.Interface`:** - -MoveEntryToBin Use Case - Soft deletes an entry by marking it as deleted. -This moves the entry to the bin (trash) instead of permanently deleting it. - -```typescript -interface MoveEntryToBinUseCase.Interface { - execute(model: CmsModel, id: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace MoveEntryToBinUseCase { - type Interface = IMoveEntryToBinUseCase; - type Error = UseCaseError; -} -``` - -### `MoveEntryUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { MoveEntryUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `MoveEntryUseCase.Interface`:** - -MoveEntry Use Case - Moves an entry to a different folder. - -```typescript -interface MoveEntryUseCase.Interface { - execute( - model: CmsModel, - id: string, - folderId: string - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace MoveEntryUseCase { - type Interface = IMoveEntryUseCase; - type Error = UseCaseError; - type Return = Promise, UseCaseError>>; -} -``` - -### `PublishEntryUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { PublishEntryUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `PublishEntryUseCase.Interface`:** - -PublishEntry Use Case - Publishes an entry revision. - -```typescript -interface PublishEntryUseCase.Interface { - execute( - model: CmsModel, - id: string - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace PublishEntryUseCase { - type Interface = IPublishEntryUseCase; - type Error = UseCaseError; - type Return = Promise, UseCaseError>>; -} -``` - -### `RepublishEntryUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { RepublishEntryUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `RepublishEntryUseCase.Interface`:** - -RepublishEntry Use Case - Republishes an already published entry. -This updates the entry and publishes it again. - -```typescript -interface RepublishEntryUseCase.Interface { - execute( - model: CmsModel, - id: string - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace RepublishEntryUseCase { - type Interface = IRepublishEntryUseCase; - type Error = UseCaseError; - type Return = Promise, UseCaseError>>; -} -``` - -### `RestoreEntryFromBinUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { RestoreEntryFromBinUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `RestoreEntryFromBinUseCase.Interface`:** - -RestoreEntryFromBin Use Case - Restores a soft-deleted entry from the bin. -This clears the wbyDeleted flag and restores the entry to its original folder. - -```typescript -interface RestoreEntryFromBinUseCase.Interface { - execute( - model: CmsModel, - id: string - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace RestoreEntryFromBinUseCase { - type Interface = IRestoreEntryFromBinUseCase; - type Error = UseCaseError; - type Return = Promise, UseCaseError>>; -} -``` - -### `UnpublishEntryUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { UnpublishEntryUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `UnpublishEntryUseCase.Interface`:** - -UnpublishEntry Use Case - -```typescript -interface UnpublishEntryUseCase.Interface { - execute( - model: CmsModel, - id: string - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace UnpublishEntryUseCase { - type Interface = IUnpublishEntryUseCase; - type Error = UseCaseError; - type Return = Promise, UseCaseError>>; -} -``` - -### `UpdateEntryUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { UpdateEntryUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `UpdateEntryUseCase.Interface`:** - -UpdateEntry Use Case - -```typescript -interface UpdateEntryUseCase.Interface { - execute( - model: CmsModel, - id: string, - input: UpdateCmsEntryInput, - metaInput?: GenericRecord, - options?: UpdateCmsEntryOptionsInput - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace UpdateEntryUseCase { - type Interface = IUpdateEntryUseCase; - type Input = UpdateCmsEntryInput; - type Meta = GenericRecord; - type Options = UpdateCmsEntryOptionsInput; - type Error = UseCaseError; - type Return = Promise, UseCaseError>>; -} -``` - -### `UpdateSingletonEntryUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { UpdateSingletonEntryUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `UpdateSingletonEntryUseCase.Interface`:** - -UpdateSingletonEntry Use Case - -Updates the singleton entry for a model. - -```typescript -interface UpdateSingletonEntryUseCase.Interface { - execute( - model: CmsModel, - data: UpdateCmsEntryInput, - options?: UpdateCmsEntryOptionsInput - ): Promise, UseCaseError>>; -} -``` - -**Types:** - -```typescript -namespace UpdateSingletonEntryUseCase { - type Interface = IUpdateSingletonEntryUseCase; - type Input = UpdateCmsEntryInput; - type Options = UpdateCmsEntryOptionsInput; - type Error = UseCaseError; - type Return = Promise, UseCaseError>>; -} -``` - -### `ValidateEntryUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { ValidateEntryUseCase } from "webiny/api/cms/entry"; -``` - -**Interface `ValidateEntryUseCase.Interface`:** - -```typescript -interface ValidateEntryUseCase.Interface { - execute( - model: CmsModel, - id: string | null | undefined, - input: UpdateCmsEntryInput - ): IValidateEntryUseCaseExecuteResult; -} -``` - -**Types:** - -```typescript -namespace ValidateEntryUseCase { - type Interface = IValidateEntryUseCase; - type Input = UpdateCmsEntryInput; - type Error = UseCaseError; - type Return = IValidateEntryUseCaseExecuteResult; -} -``` - -## Event Handlers - -### `EntryAfterCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryAfterCreateEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryAfterCreateEventHandler.Interface`:** - -```typescript -interface EntryAfterCreateEventHandler.Interface { - handle(event: EntryAfterCreateEvent): Promise; -} -``` - -**Event payload `EntryAfterCreateEventPayload`:** - -```typescript -interface EntryAfterCreateEventPayload { - entry: CmsEntry; - input: CreateCmsEntryInput; - model: CmsModel; -} -``` - -**Types:** - -```typescript -namespace EntryAfterCreateEventHandler { - type Interface = IEventHandler; - type Event = EntryAfterCreateEvent; -} -``` - -### `EntryAfterDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryAfterDeleteEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryAfterDeleteEventHandler.Interface`:** - -```typescript -interface EntryAfterDeleteEventHandler.Interface { - handle(event: EntryAfterDeleteEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace EntryAfterDeleteEventHandler { - type Interface = IEventHandler; - type Event = EntryAfterDeleteEvent; -} -``` - -### `EntryAfterDeleteMultipleEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryAfterDeleteMultipleEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryAfterDeleteMultipleEventHandler.Interface`:** - -```typescript -interface EntryAfterDeleteMultipleEventHandler.Interface { - handle(event: EntryAfterDeleteMultipleEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace EntryAfterDeleteMultipleEventHandler { - type Interface = IEventHandler; - type Event = EntryAfterDeleteMultipleEvent; -} -``` - -### `EntryAfterMoveEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryAfterMoveEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryAfterMoveEventHandler.Interface`:** - -```typescript -interface EntryAfterMoveEventHandler.Interface { - handle(event: EntryAfterMoveEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace EntryAfterMoveEventHandler { - type Interface = IEventHandler; - type Event = EntryAfterMoveEvent; -} -``` - -### `EntryAfterPublishEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryAfterPublishEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryAfterPublishEventHandler.Interface`:** - -```typescript -interface EntryAfterPublishEventHandler.Interface { - handle(event: EntryAfterPublishEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace EntryAfterPublishEventHandler { - type Interface = IEventHandler; - type Event = EntryAfterPublishEvent; -} -``` - -### `EntryAfterRepublishEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryAfterRepublishEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryAfterRepublishEventHandler.Interface`:** - -```typescript -interface EntryAfterRepublishEventHandler.Interface { - handle(event: EntryAfterRepublishEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace EntryAfterRepublishEventHandler { - type Interface = IEventHandler; - type Event = EntryAfterRepublishEvent; -} -``` - -### `EntryAfterRestoreFromBinEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryAfterRestoreFromBinEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryAfterRestoreFromBinEventHandler.Interface`:** - -```typescript -interface EntryAfterRestoreFromBinEventHandler.Interface { - handle(event: EntryAfterRestoreFromBinEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace EntryAfterRestoreFromBinEventHandler { - type Interface = IEventHandler; - type Event = EntryAfterRestoreFromBinEvent; -} -``` - -### `EntryAfterUnpublishEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryAfterUnpublishEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryAfterUnpublishEventHandler.Interface`:** - -```typescript -interface EntryAfterUnpublishEventHandler.Interface { - handle(event: EntryAfterUnpublishEvent): Promise; -} -``` - -**Event payload `EntryAfterUnpublishEventPayload`:** - -```typescript -interface EntryAfterUnpublishEventPayload { - entry: CmsEntry; - storageEntry: any; - model: CmsModel; -} -``` - -**Types:** - -```typescript -namespace EntryAfterUnpublishEventHandler { - type Interface = IEventHandler; - type Event = EntryAfterUnpublishEvent; -} -``` - -### `EntryAfterUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryAfterUpdateEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryAfterUpdateEventHandler.Interface`:** - -```typescript -interface EntryAfterUpdateEventHandler.Interface { - handle(event: EntryAfterUpdateEvent): Promise; -} -``` - -**Event payload `EntryAfterUpdateEventPayload`:** - -```typescript -interface EntryAfterUpdateEventPayload { - entry: CmsEntry; - original: CmsEntry; - input: UpdateCmsEntryInput; - model: CmsModel; -} -``` - -**Types:** - -```typescript -namespace EntryAfterUpdateEventHandler { - type Interface = IEventHandler; - type Event = EntryAfterUpdateEvent; -} -``` - -### `EntryBeforeCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryBeforeCreateEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryBeforeCreateEventHandler.Interface`:** - -```typescript -interface EntryBeforeCreateEventHandler.Interface { - handle(event: EntryBeforeCreateEvent): Promise; -} -``` - -**Event payload `EntryBeforeCreateEventPayload`:** - -```typescript -interface EntryBeforeCreateEventPayload { - entry: CmsEntry; - input: CreateCmsEntryInput; - model: CmsModel; -} -``` - -**Types:** - -```typescript -namespace EntryBeforeCreateEventHandler { - type Interface = IEventHandler; - type Event = EntryBeforeCreateEvent; -} -``` - -### `EntryBeforeDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryBeforeDeleteEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryBeforeDeleteEventHandler.Interface`:** - -```typescript -interface EntryBeforeDeleteEventHandler.Interface { - handle(event: EntryBeforeDeleteEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace EntryBeforeDeleteEventHandler { - type Interface = IEventHandler; - type Event = EntryBeforeDeleteEvent; -} -``` - -### `EntryBeforeDeleteMultipleEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryBeforeDeleteMultipleEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryBeforeDeleteMultipleEventHandler.Interface`:** - -```typescript -interface EntryBeforeDeleteMultipleEventHandler.Interface { - handle(event: EntryBeforeDeleteMultipleEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace EntryBeforeDeleteMultipleEventHandler { - type Interface = IEventHandler; - type Event = EntryBeforeDeleteMultipleEvent; -} -``` - -### `EntryBeforeMoveEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryBeforeMoveEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryBeforeMoveEventHandler.Interface`:** - -```typescript -interface EntryBeforeMoveEventHandler.Interface { - handle(event: EntryBeforeMoveEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace EntryBeforeMoveEventHandler { - type Interface = IEventHandler; - type Event = EntryBeforeMoveEvent; -} -``` - -### `EntryBeforePublishEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryBeforePublishEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryBeforePublishEventHandler.Interface`:** - -```typescript -interface EntryBeforePublishEventHandler.Interface { - handle(event: EntryBeforePublishEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace EntryBeforePublishEventHandler { - type Interface = IEventHandler; - type Event = EntryBeforePublishEvent; -} -``` - -### `EntryBeforeRepublishEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryBeforeRepublishEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryBeforeRepublishEventHandler.Interface`:** - -```typescript -interface EntryBeforeRepublishEventHandler.Interface { - handle(event: EntryBeforeRepublishEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace EntryBeforeRepublishEventHandler { - type Interface = IEventHandler; - type Event = EntryBeforeRepublishEvent; -} -``` - -### `EntryBeforeRestoreFromBinEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryBeforeRestoreFromBinEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryBeforeRestoreFromBinEventHandler.Interface`:** - -```typescript -interface EntryBeforeRestoreFromBinEventHandler.Interface { - handle(event: EntryBeforeRestoreFromBinEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace EntryBeforeRestoreFromBinEventHandler { - type Interface = IEventHandler; - type Event = EntryBeforeRestoreFromBinEvent; -} -``` - -### `EntryBeforeUnpublishEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryBeforeUnpublishEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryBeforeUnpublishEventHandler.Interface`:** - -```typescript -interface EntryBeforeUnpublishEventHandler.Interface { - handle(event: EntryBeforeUnpublishEvent): Promise; -} -``` - -**Event payload `EntryBeforeUnpublishEventPayload`:** - -```typescript -interface EntryBeforeUnpublishEventPayload { - entry: CmsEntry; - model: CmsModel; -} -``` - -**Types:** - -```typescript -namespace EntryBeforeUnpublishEventHandler { - type Interface = IEventHandler; - type Event = EntryBeforeUnpublishEvent; -} -``` - -### `EntryBeforeUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryBeforeUpdateEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryBeforeUpdateEventHandler.Interface`:** - -```typescript -interface EntryBeforeUpdateEventHandler.Interface { - handle(event: EntryBeforeUpdateEvent): Promise; -} -``` - -**Event payload `EntryBeforeUpdateEventPayload`:** - -```typescript -interface EntryBeforeUpdateEventPayload { - entry: CmsEntry; - original: CmsEntry; - input: UpdateCmsEntryInput; - model: CmsModel; -} -``` - -**Types:** - -```typescript -namespace EntryBeforeUpdateEventHandler { - type Interface = IEventHandler; - type Event = EntryBeforeUpdateEvent; -} -``` - -### `EntryRevisionAfterCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryRevisionAfterCreateEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryRevisionAfterCreateEventHandler.Interface`:** - -```typescript -interface EntryRevisionAfterCreateEventHandler.Interface { - handle(event: EntryRevisionAfterCreateEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace EntryRevisionAfterCreateEventHandler { - type Interface = IEventHandler; - type Event = EntryRevisionAfterCreateEvent; -} -``` - -### `EntryRevisionAfterDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryRevisionAfterDeleteEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryRevisionAfterDeleteEventHandler.Interface`:** - -```typescript -interface EntryRevisionAfterDeleteEventHandler.Interface { - handle(event: EntryRevisionAfterDeleteEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace EntryRevisionAfterDeleteEventHandler { - type Interface = IEventHandler; - type Event = EntryRevisionAfterDeleteEvent; -} -``` - -### `EntryRevisionBeforeCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryRevisionBeforeCreateEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryRevisionBeforeCreateEventHandler.Interface`:** - -```typescript -interface EntryRevisionBeforeCreateEventHandler.Interface { - handle(event: EntryRevisionBeforeCreateEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace EntryRevisionBeforeCreateEventHandler { - type Interface = IEventHandler; - type Event = EntryRevisionBeforeCreateEvent; -} -``` - -### `EntryRevisionBeforeDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryRevisionBeforeDeleteEventHandler } from "webiny/api/cms/entry"; -``` - -**Interface `EntryRevisionBeforeDeleteEventHandler.Interface`:** - -```typescript -interface EntryRevisionBeforeDeleteEventHandler.Interface { - handle(event: EntryRevisionBeforeDeleteEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace EntryRevisionBeforeDeleteEventHandler { - type Interface = IEventHandler; - type Event = EntryRevisionBeforeDeleteEvent; -} -``` - -## Services - -### `CmsSortMapper` - -**Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { CmsSortMapper } from "webiny/api/cms/entry"; -``` - -**Interface `CmsSortMapper.Interface`:** - -```typescript -interface CmsSortMapper.Interface { - map(params: ICmsSortMapperParams): CmsEntryListSort | undefined; -} -``` - -**Types:** - -```typescript -namespace CmsSortMapper { - type Interface = ICmsSortMapper; - type Params = ICmsSortMapperParams; -} -``` - -### `CmsWhereMapper` - -**Abstraction** — imported from `webiny/api/cms/entry` - -```typescript -import { CmsWhereMapper } from "webiny/api/cms/entry"; -``` - -**Interface `CmsWhereMapper.Interface`:** - -```typescript -interface CmsWhereMapper.Interface { - map(params: ICmsWhereMapperParams): CmsEntryListWhere | undefined; -} -``` - -**Types:** - -```typescript -namespace CmsWhereMapper { - type Interface = ICmsWhereMapper; - type Params = ICmsWhereMapperParams; -} -``` - -## Types & Classes - -### `CmsEntry` - -**Type** — imported from `webiny/api/cms/entry` - -A content entry definition for and from the database. - -@category Database model -@category CmsEntry - -```typescript -import type { CmsEntry } from "webiny/api/cms/entry"; -``` - -```typescript -export interface CmsEntry { ... } -``` - -### `CmsEntryValues` - -**Type** — imported from `webiny/api/cms/entry` - -A content entry values definition for and from the database. - -@category Database model -@category CmsEntry - -```typescript -import type { CmsEntryValues } from "webiny/api/cms/entry"; -``` - -```typescript -export interface CmsEntryValues { - [key: string]: any; -} -``` - -### `EntryId` - -**Class** — imported from `webiny/api/cms/entry` - -```typescript -import { EntryId } from "webiny/api/cms/entry"; -``` - -```typescript -export class EntryId { - private constructor( - private _id: string, - private _version: number - ); - static create(); - static from(value: string); - toString(); - get id(); - get version(); - incrementVersion(); - decrementVersion(); - setVersion(version: number); -} -``` diff --git a/docs/developer-docs/6.x/reference/api/cms/group.ai.txt b/docs/developer-docs/6.x/reference/api/cms/group.ai.txt deleted file mode 100644 index 88386db3c..000000000 --- a/docs/developer-docs/6.x/reference/api/cms/group.ai.txt +++ /dev/null @@ -1,34 +0,0 @@ -AI Context: Group (reference/api/cms/group.mdx) - -Source of Information: -1. packages/webiny/src/api/cms/group.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModelGroup/shared/abstractions.ts — originating source -3. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/types/modelGroup.ts — originating source -4. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModelGroup/CreateGroup/abstractions.ts — originating source -5. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModelGroup/CreateGroup/events.ts — originating source -6. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModelGroup/UpdateGroup/abstractions.ts — originating source -7. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModelGroup/UpdateGroup/events.ts — originating source -8. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModelGroup/DeleteGroup/abstractions.ts — originating source -9. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModelGroup/DeleteGroup/events.ts — originating source -10. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModelGroup/ListGroups/abstractions.ts — originating source -11. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModelGroup/GetGroup/abstractions.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -ModelGroupFactory, CmsGroup, CmsModelGroup, CreateGroupUseCase, GroupBeforeCreateEventHandler, GroupAfterCreateEventHandler, UpdateGroupUseCase, GroupBeforeUpdateEventHandler, GroupAfterUpdateEventHandler, DeleteGroupUseCase, GroupBeforeDeleteEventHandler, GroupAfterDeleteEventHandler, ListGroupsUseCase, GetGroupUseCase - -Import Path: webiny/api/cms/group - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/cms/group.mdx b/docs/developer-docs/6.x/reference/api/cms/group.mdx deleted file mode 100644 index 6dfdaec1f..000000000 --- a/docs/developer-docs/6.x/reference/api/cms/group.mdx +++ /dev/null @@ -1,476 +0,0 @@ ---- -id: yxbpl2nt -title: Group -description: "CMS group use cases and event handlers" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What use cases are available in `webiny/api/cms/group`? -- Which event handlers can you implement? -- How to use the builder and factory APIs? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/cms/group`. Import any of the items below directly from this path in your Webiny extensions. - -**Use Cases** - - - -**Event Handlers** - - - -**Services** - - - -**Types & Classes** - - - -## Use Cases - -### `CreateGroupUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/group` - -```typescript -import { CreateGroupUseCase } from "webiny/api/cms/group"; -``` - -**Interface `CreateGroupUseCase.Interface`:** - -CreateGroup Use Case - -```typescript -interface CreateGroupUseCase.Interface { - execute(input: CmsGroupCreateInput): Promise>; -} -``` - -**Types:** - -```typescript -namespace CreateGroupUseCase { - type Interface = ICreateGroupUseCase; - type Input = CmsGroupCreateInput; - type Error = UseCaseError; - type Return = Promise>; -} -``` - -### `DeleteGroupUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/group` - -```typescript -import { DeleteGroupUseCase } from "webiny/api/cms/group"; -``` - -**Interface `DeleteGroupUseCase.Interface`:** - -DeleteGroup Use Case - -```typescript -interface DeleteGroupUseCase.Interface { - execute(groupId: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace DeleteGroupUseCase { - type Interface = IDeleteGroupUseCase; - type Error = UseCaseError; - type Return = Promise>; -} -``` - -### `GetGroupUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/group` - -```typescript -import { GetGroupUseCase } from "webiny/api/cms/group"; -``` - -**Interface `GetGroupUseCase.Interface`:** - -GetGroup Use Case - -```typescript -interface GetGroupUseCase.Interface { - execute(groupId: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace GetGroupUseCase { - type Interface = IGetGroupUseCase; - type Error = UseCaseError; - type Return = Promise>; -} -``` - -### `ListGroupsUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/group` - -```typescript -import { ListGroupsUseCase } from "webiny/api/cms/group"; -``` - -**Interface `ListGroupsUseCase.Interface`:** - -ListGroups Use Case - -```typescript -interface ListGroupsUseCase.Interface { - execute(): Promise>; -} -``` - -**Types:** - -```typescript -namespace ListGroupsUseCase { - type Interface = IListGroupsUseCase; - type Error = UseCaseError; - type Return = Promise>; -} -``` - -### `UpdateGroupUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/group` - -```typescript -import { UpdateGroupUseCase } from "webiny/api/cms/group"; -``` - -**Interface `UpdateGroupUseCase.Interface`:** - -UpdateGroup Use Case - -```typescript -interface UpdateGroupUseCase.Interface { - execute(groupId: string, input: CmsGroupUpdateInput): Promise>; -} -``` - -**Types:** - -```typescript -namespace UpdateGroupUseCase { - type Interface = IUpdateGroupUseCase; - type Input = CmsGroupUpdateInput; - type Error = UseCaseError; - type Return = Promise>; -} -``` - -## Event Handlers - -### `GroupAfterCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/group` - -```typescript -import { GroupAfterCreateEventHandler } from "webiny/api/cms/group"; -``` - -**Interface `GroupAfterCreateEventHandler.Interface`:** - -```typescript -interface GroupAfterCreateEventHandler.Interface { - handle(event: GroupAfterCreateEvent): Promise; -} -``` - -**Event payload `GroupAfterCreateEventPayload`:** - -```typescript -interface GroupAfterCreateEventPayload { - group: CmsGroup; -} -``` - -**Types:** - -```typescript -namespace GroupAfterCreateEventHandler { - type Interface = IEventHandler; - type Event = GroupAfterCreateEvent; -} -``` - -### `GroupAfterDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/group` - -```typescript -import { GroupAfterDeleteEventHandler } from "webiny/api/cms/group"; -``` - -**Interface `GroupAfterDeleteEventHandler.Interface`:** - -```typescript -interface GroupAfterDeleteEventHandler.Interface { - handle(event: GroupAfterDeleteEvent): Promise; -} -``` - -**Event payload `GroupAfterDeleteEventPayload`:** - -```typescript -interface GroupAfterDeleteEventPayload { - group: CmsGroup; -} -``` - -**Types:** - -```typescript -namespace GroupAfterDeleteEventHandler { - type Interface = IEventHandler; - type Event = GroupAfterDeleteEvent; -} -``` - -### `GroupAfterUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/group` - -```typescript -import { GroupAfterUpdateEventHandler } from "webiny/api/cms/group"; -``` - -**Interface `GroupAfterUpdateEventHandler.Interface`:** - -```typescript -interface GroupAfterUpdateEventHandler.Interface { - handle(event: GroupAfterUpdateEvent): Promise; -} -``` - -**Event payload `GroupAfterUpdateEventPayload`:** - -```typescript -interface GroupAfterUpdateEventPayload { - original: CmsGroup; - group: CmsGroup; -} -``` - -**Types:** - -```typescript -namespace GroupAfterUpdateEventHandler { - type Interface = IEventHandler; - type Event = GroupAfterUpdateEvent; -} -``` - -### `GroupBeforeCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/group` - -```typescript -import { GroupBeforeCreateEventHandler } from "webiny/api/cms/group"; -``` - -**Interface `GroupBeforeCreateEventHandler.Interface`:** - -```typescript -interface GroupBeforeCreateEventHandler.Interface { - handle(event: GroupBeforeCreateEventEvent): Promise; -} -``` - -**Event payload `GroupBeforeCreateEventPayload`:** - -```typescript -interface GroupBeforeCreateEventPayload { - group: CmsGroup; -} -``` - -**Types:** - -```typescript -namespace GroupBeforeCreateEventHandler { - type Interface = IEventHandler; - type Event = GroupBeforeCreateEventEvent; -} -``` - -### `GroupBeforeDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/group` - -```typescript -import { GroupBeforeDeleteEventHandler } from "webiny/api/cms/group"; -``` - -**Interface `GroupBeforeDeleteEventHandler.Interface`:** - -```typescript -interface GroupBeforeDeleteEventHandler.Interface { - handle(event: GroupBeforeDeleteEvent): Promise; -} -``` - -**Event payload `GroupBeforeDeleteEventPayload`:** - -```typescript -interface GroupBeforeDeleteEventPayload { - group: CmsGroup; -} -``` - -**Types:** - -```typescript -namespace GroupBeforeDeleteEventHandler { - type Interface = IEventHandler; - type Event = GroupBeforeDeleteEvent; -} -``` - -### `GroupBeforeUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/group` - -```typescript -import { GroupBeforeUpdateEventHandler } from "webiny/api/cms/group"; -``` - -**Interface `GroupBeforeUpdateEventHandler.Interface`:** - -```typescript -interface GroupBeforeUpdateEventHandler.Interface { - handle(event: GroupBeforeUpdateEvent): Promise; -} -``` - -**Event payload `GroupBeforeUpdateEventPayload`:** - -```typescript -interface GroupBeforeUpdateEventPayload { - original: CmsGroup; - group: CmsGroup; -} -``` - -**Types:** - -```typescript -namespace GroupBeforeUpdateEventHandler { - type Interface = IEventHandler; - type Event = GroupBeforeUpdateEvent; -} -``` - -## Services - -### `ModelGroupFactory` - -**Abstraction** — imported from `webiny/api/cms/group` - -```typescript -import { ModelGroupFactory } from "webiny/api/cms/group"; -``` - -**Interface `ModelGroupFactory.Interface`:** - -```typescript -interface ModelGroupFactory.Interface { - execute(): Promise; -} -``` - -**Types:** - -```typescript -namespace ModelGroupFactory { - type Interface = IModelGroupFactory; - type Return = Promise; - type Group = IModelGroup; -} -``` - -## Types & Classes - -### `CmsGroup` - -**Type** — imported from `webiny/api/cms/group` - -A representation of content model group in the database. - -@category CmsGroup -@category Database model - -```typescript -import type { CmsGroup } from "webiny/api/cms/group"; -``` - -```typescript -export interface CmsGroup { ... } -``` - -### `CmsModelGroup` - -**Type** — imported from `webiny/api/cms/group` - -@category Database model -@category CmsModel - -```typescript -import type { CmsModelGroup } from "webiny/api/cms/group"; -``` - -```typescript -export interface CmsModelGroup { - /** - * Generated ID of the group - */ - id: string; - /** - * Name of the group - */ - name: string; -} -``` diff --git a/docs/developer-docs/6.x/reference/api/cms/model.ai.txt b/docs/developer-docs/6.x/reference/api/cms/model.ai.txt deleted file mode 100644 index 612b23d72..000000000 --- a/docs/developer-docs/6.x/reference/api/cms/model.ai.txt +++ /dev/null @@ -1,41 +0,0 @@ -AI Context: Model (reference/api/cms/model.mdx) - -Source of Information: -1. packages/webiny/src/api/cms/model.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/modelBuilder/abstractions.ts — originating source -3. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/modelBuilder/models/ModelBuilder.ts — originating source -4. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/modelBuilder/fields/FieldBuilder.ts — originating source -5. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/modelBuilder/fields/abstractions.ts — originating source -6. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/modelBuilder/LayoutBuilder.ts — originating source -7. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/types/model.ts — originating source -8. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/types/modelField.ts — originating source -9. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModel/CreateModel/abstractions.ts — originating source -10. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModel/CreateModel/events.ts — originating source -11. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModel/CreateModelFrom/abstractions.ts — originating source -12. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModel/CreateModelFrom/events.ts — originating source -13. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModel/UpdateModel/abstractions.ts — originating source -14. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModel/UpdateModel/events.ts — originating source -15. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModel/DeleteModel/abstractions.ts — originating source -16. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModel/DeleteModel/events.ts — originating source -17. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModel/GetModel/abstractions.ts — originating source -18. /Users/adrian/dev/wby-next/packages/api-headless-cms/src/features/contentModel/ListModels/abstractions.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -ModelFactory, ModelBuilder, FieldBuilder, FieldRendererRegistry, FieldType, LayoutBuilder, CmsModel, CmsModelField, CreateModelUseCase, ModelBeforeCreateEventHandler, ModelAfterCreateEventHandler, CreateModelFromUseCase, ModelBeforeCreateFromEventHandler, ModelAfterCreateFromEventHandler, UpdateModelUseCase, ModelBeforeUpdateEventHandler, ModelAfterUpdateEventHandler, DeleteModelUseCase, ModelBeforeDeleteEventHandler, ModelAfterDeleteEventHandler, GetModelUseCase, ListModelsUseCase - -Import Path: webiny/api/cms/model - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/cms/model.mdx b/docs/developer-docs/6.x/reference/api/cms/model.mdx deleted file mode 100644 index 3bd1c5e56..000000000 --- a/docs/developer-docs/6.x/reference/api/cms/model.mdx +++ /dev/null @@ -1,717 +0,0 @@ ---- -id: yxbpl2nt -title: Model -description: "CMS model builders, factories, use cases and event handlers" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What use cases are available in `webiny/api/cms/model`? -- Which event handlers can you implement? -- How to use the builder and factory APIs? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/cms/model`. Import any of the items below directly from this path in your Webiny extensions. - -**Use Cases** - - - -**Event Handlers** - - - -**Services** - - - -**Types & Classes** - - - -## Use Cases - -### `CreateModelFromUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/model` - -```typescript -import { CreateModelFromUseCase } from "webiny/api/cms/model"; -``` - -**Interface `CreateModelFromUseCase.Interface`:** - -CreateModelFrom Use Case (Clone/Copy Model) - -```typescript -interface CreateModelFromUseCase.Interface { - execute( - modelId: string, - input: CmsModelCreateFromInput - ): Promise>; -} -``` - -**Types:** - -```typescript -namespace CreateModelFromUseCase { - type Interface = ICreateModelFromUseCase; - type Input = CmsModelCreateFromInput; - type Error = UseCaseError; - type Return = Promise>; -} -``` - -### `CreateModelUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/model` - -```typescript -import { CreateModelUseCase } from "webiny/api/cms/model"; -``` - -**Interface `CreateModelUseCase.Interface`:** - -CreateModel Use Case - -```typescript -interface CreateModelUseCase.Interface { - execute(input: CmsModelCreateInput): Promise>; -} -``` - -**Types:** - -```typescript -namespace CreateModelUseCase { - type Interface = ICreateModelUseCase; - type Input = CmsModelCreateInput; - type Error = UseCaseError; - type Return = Promise>; -} -``` - -### `DeleteModelUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/model` - -```typescript -import { DeleteModelUseCase } from "webiny/api/cms/model"; -``` - -**Interface `DeleteModelUseCase.Interface`:** - -DeleteModel Use Case - -```typescript -interface DeleteModelUseCase.Interface { - execute(modelId: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace DeleteModelUseCase { - type Interface = IDeleteModelUseCase; - type Error = UseCaseError; - type Return = Promise>; -} -``` - -### `GetModelUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/model` - -```typescript -import { GetModelUseCase } from "webiny/api/cms/model"; -``` - -**Interface `GetModelUseCase.Interface`:** - -GetModel Use Case - -```typescript -interface GetModelUseCase.Interface { - execute(modelId: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace GetModelUseCase { - type Interface = IGetModelUseCase; - type Error = UseCaseError; - type Return = Promise>; -} -``` - -### `ListModelsUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/model` - -```typescript -import { ListModelsUseCase } from "webiny/api/cms/model"; -``` - -**Interface `ListModelsUseCase.Interface`:** - -ListModels Use Case - -```typescript -interface ListModelsUseCase.Interface { - execute(params?: ICmsModelListParams): Promise>; -} -``` - -**Types:** - -```typescript -namespace ListModelsUseCase { - type Interface = IListModelsUseCase; - type Params = ICmsModelListParams; - type Error = UseCaseError; - type Return = Promise>; -} -``` - -### `UpdateModelUseCase` - -**Use Case Abstraction** — imported from `webiny/api/cms/model` - -```typescript -import { UpdateModelUseCase } from "webiny/api/cms/model"; -``` - -**Interface `UpdateModelUseCase.Interface`:** - -UpdateModel Use Case - -```typescript -interface UpdateModelUseCase.Interface { - execute(modelId: string, input: CmsModelUpdateInput): Promise>; -} -``` - -**Types:** - -```typescript -namespace UpdateModelUseCase { - type Interface = IUpdateModelUseCase; - type Input = CmsModelUpdateInput; - type Error = UseCaseError; - type Return = Promise>; -} -``` - -## Event Handlers - -### `ModelAfterCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/model` - -```typescript -import { ModelAfterCreateEventHandler } from "webiny/api/cms/model"; -``` - -**Interface `ModelAfterCreateEventHandler.Interface`:** - -```typescript -interface ModelAfterCreateEventHandler.Interface { - handle(event: ModelAfterCreateEvent): Promise; -} -``` - -**Event payload `ModelAfterCreateEventPayload`:** - -```typescript -interface ModelAfterCreateEventPayload { - model: CmsModel; -} -``` - -**Types:** - -```typescript -namespace ModelAfterCreateEventHandler { - type Interface = IEventHandler; - type Event = ModelAfterCreateEvent; -} -``` - -### `ModelAfterCreateFromEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/model` - -```typescript -import { ModelAfterCreateFromEventHandler } from "webiny/api/cms/model"; -``` - -**Interface `ModelAfterCreateFromEventHandler.Interface`:** - -```typescript -interface ModelAfterCreateFromEventHandler.Interface { - handle(event: ModelAfterCreateFromEvent): Promise; -} -``` - -**Event payload `ModelAfterCreateFromEventPayload`:** - -```typescript -interface ModelAfterCreateFromEventPayload { - model: CmsModel; - original: CmsModel; -} -``` - -**Types:** - -```typescript -namespace ModelAfterCreateFromEventHandler { - type Interface = IEventHandler; - type Event = ModelAfterCreateFromEvent; -} -``` - -### `ModelAfterDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/model` - -```typescript -import { ModelAfterDeleteEventHandler } from "webiny/api/cms/model"; -``` - -**Interface `ModelAfterDeleteEventHandler.Interface`:** - -```typescript -interface ModelAfterDeleteEventHandler.Interface { - handle(event: ModelAfterDeleteEvent): Promise; -} -``` - -**Event payload `ModelAfterDeleteEventPayload`:** - -```typescript -interface ModelAfterDeleteEventPayload { - model: CmsModel; -} -``` - -**Types:** - -```typescript -namespace ModelAfterDeleteEventHandler { - type Interface = IEventHandler; - type Event = ModelAfterDeleteEvent; -} -``` - -### `ModelAfterUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/model` - -```typescript -import { ModelAfterUpdateEventHandler } from "webiny/api/cms/model"; -``` - -**Interface `ModelAfterUpdateEventHandler.Interface`:** - -```typescript -interface ModelAfterUpdateEventHandler.Interface { - handle(event: ModelAfterUpdateEvent): Promise; -} -``` - -**Event payload `ModelAfterUpdateEventPayload`:** - -```typescript -interface ModelAfterUpdateEventPayload { - model: CmsModel; - original: CmsModel; -} -``` - -**Types:** - -```typescript -namespace ModelAfterUpdateEventHandler { - type Interface = IEventHandler; - type Event = ModelAfterUpdateEvent; -} -``` - -### `ModelBeforeCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/model` - -```typescript -import { ModelBeforeCreateEventHandler } from "webiny/api/cms/model"; -``` - -**Interface `ModelBeforeCreateEventHandler.Interface`:** - -```typescript -interface ModelBeforeCreateEventHandler.Interface { - handle(event: ModelBeforeCreateEvent): Promise; -} -``` - -**Event payload `ModelBeforeCreateEventPayload`:** - -```typescript -interface ModelBeforeCreateEventPayload { - model: CmsModel; - input: CmsModelCreateInput; -} -``` - -**Types:** - -```typescript -namespace ModelBeforeCreateEventHandler { - type Interface = IEventHandler; - type Event = ModelBeforeCreateEvent; -} -``` - -### `ModelBeforeCreateFromEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/model` - -```typescript -import { ModelBeforeCreateFromEventHandler } from "webiny/api/cms/model"; -``` - -**Interface `ModelBeforeCreateFromEventHandler.Interface`:** - -```typescript -interface ModelBeforeCreateFromEventHandler.Interface { - handle(event: ModelBeforeCreateFromEvent): Promise; -} -``` - -**Event payload `ModelBeforeCreateFromEventPayload`:** - -```typescript -interface ModelBeforeCreateFromEventPayload { - model: CmsModel; - original: CmsModel; - input: CmsModelCreateFromInput; -} -``` - -**Types:** - -```typescript -namespace ModelBeforeCreateFromEventHandler { - type Interface = IEventHandler; - type Event = ModelBeforeCreateFromEvent; -} -``` - -### `ModelBeforeDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/model` - -```typescript -import { ModelBeforeDeleteEventHandler } from "webiny/api/cms/model"; -``` - -**Interface `ModelBeforeDeleteEventHandler.Interface`:** - -```typescript -interface ModelBeforeDeleteEventHandler.Interface { - handle(event: ModelBeforeDeleteEvent): Promise; -} -``` - -**Event payload `ModelBeforeDeleteEventPayload`:** - -```typescript -interface ModelBeforeDeleteEventPayload { - model: CmsModel; -} -``` - -**Types:** - -```typescript -namespace ModelBeforeDeleteEventHandler { - type Interface = IEventHandler; - type Event = ModelBeforeDeleteEvent; -} -``` - -### `ModelBeforeUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/cms/model` - -```typescript -import { ModelBeforeUpdateEventHandler } from "webiny/api/cms/model"; -``` - -**Interface `ModelBeforeUpdateEventHandler.Interface`:** - -```typescript -interface ModelBeforeUpdateEventHandler.Interface { - handle(event: ModelBeforeUpdateEvent): Promise; -} -``` - -**Event payload `ModelBeforeUpdateEventPayload`:** - -```typescript -interface ModelBeforeUpdateEventPayload { - model: CmsModel; - original: CmsModel; - input: CmsModelUpdateInput; -} -``` - -**Types:** - -```typescript -namespace ModelBeforeUpdateEventHandler { - type Interface = IEventHandler; - type Event = ModelBeforeUpdateEvent; -} -``` - -## Services - -### `FieldType` - -**Abstraction** — imported from `webiny/api/cms/model` - -```typescript -import { FieldType } from "webiny/api/cms/model"; -``` - -**Interface `FieldType.Interface`:** - -Field Type Factory - creates a field builder instance - -```typescript -interface FieldType.Interface { - readonly type: string; - create(registry: IFieldBuilderRegistry): BaseFieldBuilder; -} -``` - -| Method | Description | -| ------------------------- | ------------------------------------- | -| `readonly type: string()` | Unique identifier for this field type | -| `create()` | Create a new field builder instance | - -### `ModelFactory` - -**Abstraction** — imported from `webiny/api/cms/model` - -```typescript -import { ModelFactory } from "webiny/api/cms/model"; -``` - -**Interface `ModelFactory.Interface`:** - -```typescript -interface ModelFactory.Interface { - execute(builder: IModelBuilder): Promise; -} -``` - -**Types:** - -```typescript -namespace ModelFactory { - type Interface = IModelFactory; - type Return = Promise; - type Builder = IModelBuilder; - type FieldBuilder = FieldBuilderRegistry.Interface; -} -``` - -## Types & Classes - -### `CmsModel` - -**Type** — imported from `webiny/api/cms/model` - -Base CMS Model. Should not be exported and used outside of this package. - -@category Database model -@category CmsModel - -```typescript -import type { CmsModel } from "webiny/api/cms/model"; -``` - -```typescript -export interface CmsModel { ... } -``` - -### `CmsModelField` - -**Type** — imported from `webiny/api/cms/model` - -A definition for content model field. This type exists on the app side as well. - -@category ModelField -@category Database model - -```typescript -import type { CmsModelField } from "webiny/api/cms/model"; -``` - -```typescript -export interface CmsModelField { ... } -``` - -### `FieldBuilder` - -**Class** — imported from `webiny/api/cms/model` - -DataFieldBuilder class for data fields that produce CmsModelField instances. -Provides storageId, list, validation, renderer, and other data-field methods. - -```typescript -import { FieldBuilder } from "webiny/api/cms/model"; -``` - -```typescript -export class DataFieldBuilder extends BaseFieldBuilder { - protected override config: FieldBuilderConfig; - public constructor(type: TType, label?: string); - placeholder(text: string): this; - storageId(id: string): this; - defaultValue(value: any): this; - list(): this; - tags(tags: string[]): this; - listMinLength(value: number, message?: string): this; - listMaxLength(value: number, message?: string): this; - protected validation(validation: CmsModelFieldValidation): this; - protected listValidation(validation: CmsModelFieldValidation): this; - predefinedValues(values: CmsModelFieldPredefinedValues["values"]): this; - renderer>( - name: TName, - ...args: undefined extends FieldRendererSettings - ? [settings?: FieldRendererSettings] - : FieldRendererSettings extends undefined - ? [] - : [settings: FieldRendererSettings] - ): this; - settings(settings: Record): this; - build(): DataFieldBuildResult; -} -``` - -### `FieldRendererRegistry` - -**Type** — imported from `webiny/api/cms/model` - -Augmentable renderer registry. -Each entry maps a renderer name to its applicable field type(s) and settings. - -Example: -declare module "@webiny/api-headless-cms/features/modelBuilder/fields/FieldBuilder" { -interface FieldRendererRegistry { -"my-renderer": { fieldType: "text" | "long-text"; settings: { color: string } }; -} -} - -```typescript -import type { FieldRendererRegistry } from "webiny/api/cms/model"; -``` - -```typescript -export interface FieldRendererRegistry { ... } -``` - -### `LayoutBuilder` - -**Class** — imported from `webiny/api/cms/model` - -LayoutBuilder provides a fluent API for modifying field layouts. -Supports adding fields to existing rows and inserting new rows at specific positions. -Callbacks can be queued and executed lazily for efficient composition. - -```typescript -import { LayoutBuilder } from "webiny/api/cms/model"; -``` - -```typescript -export class LayoutBuilder { - private layout: string[][]; - private modifiers: LayoutModifier[] = []; - constructor(existingLayout: string[][] = []); - setLayout(layout: string[][]): this; - addModifier(modifier: LayoutModifier): this; - addField(field: string, position:; - addRow(fields: string[]): this; - insertRow(fields: string[], position:; - getSnapshot():; - build(): string[][]; - private findFieldPosition(field: string):; -} -``` - -### `ModelBuilder` - -**Class** — imported from `webiny/api/cms/model` - -Entry point builder that allows selecting model type. -Call .private() or .public() to get the appropriate typed builder. - -```typescript -import { ModelBuilder } from "webiny/api/cms/model"; -``` - -```typescript -export class ModelBuilder { - public constructor(private registry: FieldBuilderRegistry.Interface); - public private(input: IModelBuilderPrivateInput): PrivateModelBuilder; - public public(input: IModelBuilderPublicInput): PublicModelBuilder; -} -``` diff --git a/docs/developer-docs/6.x/reference/api/event-publisher.ai.txt b/docs/developer-docs/6.x/reference/api/event-publisher.ai.txt deleted file mode 100644 index 1263f6647..000000000 --- a/docs/developer-docs/6.x/reference/api/event-publisher.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Event Publisher (reference/api/event-publisher.mdx) - -Source of Information: -1. packages/webiny/src/api/event-publisher.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-core/src/features/eventPublisher/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -DomainEvent, EventPublisher - -Import Path: webiny/api/event-publisher - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/event-publisher.mdx b/docs/developer-docs/6.x/reference/api/event-publisher.mdx deleted file mode 100644 index 5261348de..000000000 --- a/docs/developer-docs/6.x/reference/api/event-publisher.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -id: yxbpl2v2 -title: Event Publisher -description: "Reference for webiny/api/event-publisher" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/api/event-publisher`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/event-publisher`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `DomainEvent` - -**Class** — imported from `webiny/api/event-publisher` - -```typescript -import { DomainEvent } from "webiny/api/event-publisher"; -``` - -```typescript -export abstract class DomainEvent { - public abstract readonly eventType: string; - public readonly occurredAt: Date; - public readonly payload: TPayload extends void ? undefined : TPayload; - constructor(payload?: never); - abstract getHandlerAbstraction(): Abstraction>; -} -``` - -## `EventPublisher` - -**Constant** — imported from `webiny/api/event-publisher` - -```typescript -import { EventPublisher } from "webiny/api/event-publisher"; -``` - -```typescript -export const EventPublisher = new Abstraction("EventPublisher"); -``` diff --git a/docs/developer-docs/6.x/reference/api/eventPublisher.ai.txt b/docs/developer-docs/6.x/reference/api/eventPublisher.ai.txt deleted file mode 100644 index 19a802166..000000000 --- a/docs/developer-docs/6.x/reference/api/eventPublisher.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Event Publisher (reference/api/eventPublisher.mdx) - -Source of Information: -1. packages/webiny/src/api/eventPublisher.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-core/src/features/eventPublisher/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -DomainEvent, EventPublisher - -Import Path: webiny/api/eventPublisher - -Related Documents: -- docs/developer-docs/6.0.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.0.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/eventPublisher.mdx b/docs/developer-docs/6.x/reference/api/eventPublisher.mdx deleted file mode 100644 index 439a1a656..000000000 --- a/docs/developer-docs/6.x/reference/api/eventPublisher.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -id: yxbpl2v2 -title: Event Publisher -description: "Domain event publishing primitives" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/api/eventPublisher`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/eventPublisher`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `DomainEvent` - -**Class** — imported from `webiny/api/eventPublisher` - -```typescript -import { DomainEvent } from "webiny/api/eventPublisher"; -``` - -```typescript -export abstract class DomainEvent { - public abstract readonly eventType: string; - public readonly occurredAt: Date; - public readonly payload: TPayload extends void ? undefined : TPayload; - constructor(payload?: never); - abstract getHandlerAbstraction(): Abstraction>; -} -``` - -## `EventPublisher` - -**Constant** — imported from `webiny/api/eventPublisher` - -```typescript -import { EventPublisher } from "webiny/api/eventPublisher"; -``` - -```typescript -export const EventPublisher = new Abstraction("EventPublisher"); -``` diff --git a/docs/developer-docs/6.x/reference/api/graphql.ai.txt b/docs/developer-docs/6.x/reference/api/graphql.ai.txt deleted file mode 100644 index dcab68d0f..000000000 --- a/docs/developer-docs/6.x/reference/api/graphql.ai.txt +++ /dev/null @@ -1,27 +0,0 @@ -AI Context: GraphQL (reference/api/graphql.mdx) - -Source of Information: -1. packages/webiny/src/api/graphql.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-core/src/graphql/security/NotAuthorizedResponse.ts — originating source -3. /Users/adrian/dev/wby-next/packages/handler-graphql/src/graphql/abstractions.ts — originating source -4. /Users/adrian/dev/wby-next/packages/handler-graphql/src/responses.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -NotAuthorizedResponse, GraphQLSchemaFactory, ErrorResponse, ListResponse, Response, NotFoundResponse, ListErrorResponse - -Import Path: webiny/api/graphql - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/graphql.mdx b/docs/developer-docs/6.x/reference/api/graphql.mdx deleted file mode 100644 index c0f555f93..000000000 --- a/docs/developer-docs/6.x/reference/api/graphql.mdx +++ /dev/null @@ -1,180 +0,0 @@ ---- -id: yxbpl2dy -title: GraphQL -description: "GraphQL schema factory and response helpers" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- How to use the builder and factory APIs? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/graphql`. Import any of the items below directly from this path in your Webiny extensions. - -**Services** - - - -**Types & Classes** - - - -## Services - -### `GraphQLSchemaFactory` - -**Abstraction** — imported from `webiny/api/graphql` - -```typescript -import { GraphQLSchemaFactory } from "webiny/api/graphql"; -``` - -**Interface `GraphQLSchemaFactory.Interface`:** - -GraphQLSchemaFactory - -```typescript -interface GraphQLSchemaFactory.Interface { - execute(builder: GraphQLSchemaBuilder.Interface): Promise; -} -``` - -**Types:** - -```typescript -namespace GraphQLSchemaFactory { - type Interface = IGraphQLSchemaFactory; - type SchemaBuilder = GraphQLSchemaBuilder.Interface; - type Return = Promise; -} -``` - -**`SchemaBuilder` — `GraphQLSchemaBuilder.Interface`:** - -Interface for building GraphQL schemas by adding type definitions and resolvers. - -```typescript -interface GraphQLSchemaBuilder.Interface { - addTypeDefs(typeDefs: TypeDefs): this; - addResolver(config: ResolverConfig): this; - build(): IGraphQLSchema; -} -``` - -| Method | Description | -| ------------------------------------------- | -------------------------------------------------- | -| `addTypeDefs()` | Add GraphQL type definitions to the schema. | -| `addResolver()` | Add a GraphQL resolver with optional dependencies. | -| `build()` | Build and return the GraphQL schema. | - -## Types & Classes - -### `ErrorResponse` - -**Class** — imported from `webiny/api/graphql` - -```typescript -import { ErrorResponse } from "webiny/api/graphql"; -``` - -```typescript -export class ErrorResponse { - public readonly data: null; - public readonly error:; - constructor(params: ErrorResponseParams); -} -``` - -### `ListErrorResponse` - -**Class** — imported from `webiny/api/graphql` - -```typescript -import { ListErrorResponse } from "webiny/api/graphql"; -``` - -```typescript -export class ListErrorResponse { - public readonly data: null; - public readonly meta: null; - public readonly error:; - constructor(params: ErrorResponseParams); -} -``` - -### `ListResponse` - -**Class** — imported from `webiny/api/graphql` - -```typescript -import { ListResponse } from "webiny/api/graphql"; -``` - -```typescript -export class ListResponse { - public readonly data: Array; - public readonly meta: M; - public readonly error: null; - constructor(data: Array, meta?: M); -} -``` - -### `NotAuthorizedResponse` - -**Class** — imported from `webiny/api/graphql` - -```typescript -import { NotAuthorizedResponse } from "webiny/api/graphql"; -``` - -```typescript -export class NotAuthorizedResponse extends ErrorResponse { - constructor(; -} -``` - -### `NotFoundResponse` - -**Class** — imported from `webiny/api/graphql` - -```typescript -import { NotFoundResponse } from "webiny/api/graphql"; -``` - -```typescript -export class NotFoundResponse extends ErrorResponse { - constructor(message: string); -} -``` - -### `Response` - -**Class** — imported from `webiny/api/graphql` - -```typescript -import { Response } from "webiny/api/graphql"; -``` - -```typescript -export class Response { - public readonly data: T; - public readonly error: null; - constructor(data: T); -} -``` diff --git a/docs/developer-docs/6.x/reference/api/key-value-store.ai.txt b/docs/developer-docs/6.x/reference/api/key-value-store.ai.txt deleted file mode 100644 index 30e31a928..000000000 --- a/docs/developer-docs/6.x/reference/api/key-value-store.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Key Value Store (reference/api/key-value-store.mdx) - -Source of Information: -1. packages/webiny/src/api/key-value-store.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-core/src/features/keyValueStore/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -GlobalKeyValueStore, KeyValueStore - -Import Path: webiny/api/key-value-store - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/key-value-store.mdx b/docs/developer-docs/6.x/reference/api/key-value-store.mdx deleted file mode 100644 index 177f40768..000000000 --- a/docs/developer-docs/6.x/reference/api/key-value-store.mdx +++ /dev/null @@ -1,92 +0,0 @@ ---- -id: yxbpl2tl -title: Key Value Store -description: "Reference for webiny/api/key-value-store" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/api/key-value-store`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/key-value-store`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `GlobalKeyValueStore` - -**Abstraction** — imported from `webiny/api/key-value-store` - -```typescript -import { GlobalKeyValueStore } from "webiny/api/key-value-store"; -``` - -**Interface `GlobalKeyValueStore.Interface`:** - -```typescript -interface GlobalKeyValueStore.Interface { - get( - key: string, - options?: IGlobalKeyValueStoreOptions - ): Promise>; - set( - key: string, - value: any, - options?: IGlobalKeyValueStoreOptions - ): Promise>; - delete( - key: string, - options?: IGlobalKeyValueStoreOptions - ): Promise>; -} -``` - -**Types:** - -```typescript -namespace GlobalKeyValueStore { - type Interface = IGlobalKeyValueStore; - type KeyValueRecord = IKeyValueRecord; - type Error = KeyValueStoreRepository.Error; -} -``` - -## `KeyValueStore` - -**Abstraction** — imported from `webiny/api/key-value-store` - -```typescript -import { KeyValueStore } from "webiny/api/key-value-store"; -``` - -**Interface `KeyValueStore.Interface`:** - -```typescript -interface KeyValueStore.Interface { - get(key: string): Promise>; - set(key: string, value: any): Promise>; - delete(key: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace KeyValueStore { - type Interface = IKeyValueStore; - type KeyValueRecord = IKeyValueRecord; - type Error = KeyValueStoreRepository.Error; -} -``` diff --git a/docs/developer-docs/6.x/reference/api/keyValueStore.ai.txt b/docs/developer-docs/6.x/reference/api/keyValueStore.ai.txt deleted file mode 100644 index dad3eca93..000000000 --- a/docs/developer-docs/6.x/reference/api/keyValueStore.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Key-Value Store (reference/api/keyValueStore.mdx) - -Source of Information: -1. packages/webiny/src/api/keyValueStore.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-core/src/features/keyValueStore/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -GlobalKeyValueStore, KeyValueStore - -Import Path: webiny/api/keyValueStore - -Related Documents: -- docs/developer-docs/6.0.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.0.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/keyValueStore.mdx b/docs/developer-docs/6.x/reference/api/keyValueStore.mdx deleted file mode 100644 index 0eea91669..000000000 --- a/docs/developer-docs/6.x/reference/api/keyValueStore.mdx +++ /dev/null @@ -1,132 +0,0 @@ ---- -id: yxbpl2tl -title: Key-Value Store -description: "Key-value store abstraction" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/api/keyValueStore`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/keyValueStore`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `GlobalKeyValueStore` - -**Abstraction** — imported from `webiny/api/keyValueStore` - -```typescript -import { GlobalKeyValueStore } from "webiny/api/keyValueStore"; -``` - -**Interface `GlobalKeyValueStore.Interface`:** - -```typescript -interface GlobalKeyValueStore.Interface { - get( - key: string, - options?: IGlobalKeyValueStoreOptions - ): Promise>; - set( - key: string, - value: any, - options?: IGlobalKeyValueStoreOptions - ): Promise>; - delete( - key: string, - options?: IGlobalKeyValueStoreOptions - ): Promise>; -} -``` - -**Types:** - -```typescript -namespace GlobalKeyValueStore { - type Interface = IGlobalKeyValueStore; - type KeyValueRecord = IKeyValueRecord; - type Error = KeyValueStoreRepository.Error; -} -``` - -**Usage:** - -```typescript -// extensions/MyImpl.ts -import { GlobalKeyValueStore } from "webiny/api/keyValueStore"; - -class MyImpl implements MyUseCase.Interface { - public constructor(private globalKeyValueStore: GlobalKeyValueStore.Interface) {} - - public async execute(/* ... */): Promise { - await this.globalKeyValueStore.get(/* ... */); - } -} - -export default MyUseCase.createImplementation({ - implementation: MyImpl, - dependencies: [GlobalKeyValueStore] -}); -``` - -## `KeyValueStore` - -**Abstraction** — imported from `webiny/api/keyValueStore` - -```typescript -import { KeyValueStore } from "webiny/api/keyValueStore"; -``` - -**Interface `KeyValueStore.Interface`:** - -```typescript -interface KeyValueStore.Interface { - get(key: string): Promise>; - set(key: string, value: any): Promise>; - delete(key: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace KeyValueStore { - type Interface = IKeyValueStore; - type KeyValueRecord = IKeyValueRecord; - type Error = KeyValueStoreRepository.Error; -} -``` - -**Usage:** - -```typescript -// extensions/MyImpl.ts -import { KeyValueStore } from "webiny/api/keyValueStore"; - -class MyImpl implements MyUseCase.Interface { - public constructor(private keyValueStore: KeyValueStore.Interface) {} - - public async execute(/* ... */): Promise { - await this.keyValueStore.get(/* ... */); - } -} - -export default MyUseCase.createImplementation({ - implementation: MyImpl, - dependencies: [KeyValueStore] -}); -``` diff --git a/docs/developer-docs/6.x/reference/api/logger.ai.txt b/docs/developer-docs/6.x/reference/api/logger.ai.txt deleted file mode 100644 index 0871bb9bc..000000000 --- a/docs/developer-docs/6.x/reference/api/logger.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Logger (reference/api/logger.mdx) - -Source of Information: -1. packages/webiny/src/api/logger.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-core/src/features/logger/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -Logger - -Import Path: webiny/api/logger - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/logger.mdx b/docs/developer-docs/6.x/reference/api/logger.mdx deleted file mode 100644 index 0f3c823d4..000000000 --- a/docs/developer-docs/6.x/reference/api/logger.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -id: yxbpl2xv -title: Logger -description: "Logger abstraction for server-side logging" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/api/logger`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/logger`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `Logger` - -**Abstraction** — imported from `webiny/api/logger` - -```typescript -import { Logger } from "webiny/api/logger"; -``` - -**Interface `Logger.Interface`:** - -Interface for logging messages at different severity levels. - -```typescript -interface Logger.Interface { - trace(objOrMsg: object | string, ...args: any[]): void; - debug(objOrMsg: object | string, ...args: any[]): void; - info(objOrMsg: object | string, ...args: any[]): void; - warn(objOrMsg: object | string, ...args: any[]): void; - error(objOrMsg: object | string, ...args: any[]): void; - fatal(objOrMsg: object | string, ...args: any[]): void; - log(objOrMsg: object | string, ...args: any[]): void; -} -``` - -| Method | Description | -| --------- | ---------------------------------------------------------------------------------- | -| `trace()` | Log a trace-level message with optional additional arguments. | -| `debug()` | Log a debug-level message with optional additional arguments. | -| `info()` | Log an info-level message with optional additional arguments. | -| `warn()` | Log a warning-level message with optional additional arguments. | -| `error()` | Log an error-level message with optional additional arguments. | -| `fatal()` | Log a fatal-level message with optional additional arguments. | -| `log()` | Log a generic message (defaults to info level) with optional additional arguments. | - -**Types:** - -```typescript -namespace Logger { - type Interface = ILogger; -} -``` diff --git a/docs/developer-docs/6.x/reference/api/security.ai.txt b/docs/developer-docs/6.x/reference/api/security.ai.txt deleted file mode 100644 index bb4cf44ae..000000000 --- a/docs/developer-docs/6.x/reference/api/security.ai.txt +++ /dev/null @@ -1,30 +0,0 @@ -AI Context: Security (reference/api/security.mdx) - -Source of Information: -1. packages/webiny/src/api/security.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-core/src/features/security/IdentityContext/index.ts — originating source -3. /Users/adrian/dev/wby-next/packages/api-core/src/features/security/apiKeys/shared/abstractions.ts — originating source -4. /Users/adrian/dev/wby-next/packages/api-core/src/domain/security/ApiToken.ts — originating source -5. /Users/adrian/dev/wby-next/packages/api-core/src/idp/index.ts — originating source -6. /Users/adrian/dev/wby-next/packages/api-core/src/features/security/authentication/Authenticator/abstractions.ts — originating source -7. /Users/adrian/dev/wby-next/packages/api-core/src/features/security/authorization/Authorizer/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -IdentityContext, ApiKeyFactory, ApiToken, IdentityProvider, OidcIdentityProvider, JwtIdentityProvider, Authenticator, Authorizer - -Import Path: webiny/api/security - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/security.mdx b/docs/developer-docs/6.x/reference/api/security.mdx deleted file mode 100644 index b92fb0927..000000000 --- a/docs/developer-docs/6.x/reference/api/security.mdx +++ /dev/null @@ -1,252 +0,0 @@ ---- -id: yxbpl3nl -title: Security -description: "Security primitives: Identity, Authenticator, Authorizer" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- How to use the builder and factory APIs? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/security`. Import any of the items below directly from this path in your Webiny extensions. - -**Services** - - - -**Types & Classes** - - - -## Services - -### `ApiKeyFactory` - -**Abstraction** — imported from `webiny/api/security` - -```typescript -import { ApiKeyFactory } from "webiny/api/security"; -``` - -**Interface `ApiKeyFactory.Interface`:** - -```typescript -interface ApiKeyFactory.Interface { - execute(): Promise | CodeApiKey[]; -} -``` - -**Types:** - -```typescript -namespace ApiKeyFactory { - type Interface = IApiKeyFactory; - type Return = Promise | CodeApiKey[]; - type ApiKey = CodeApiKey; -} -``` - -### `Authenticator` - -**Abstraction** — imported from `webiny/api/security` - -```typescript -import { Authenticator } from "webiny/api/security"; -``` - -**Interface `Authenticator.Interface`:** - -```typescript -interface Authenticator.Interface { - authenticate(token: string): Promise; -} -``` - -**Types:** - -```typescript -namespace Authenticator { - type Interface = IAuthenticator; -} -``` - -### `Authorizer` - -**Abstraction** — imported from `webiny/api/security` - -```typescript -import { Authorizer } from "webiny/api/security"; -``` - -**Interface `Authorizer.Interface`:** - -```typescript -interface Authorizer.Interface { - authorize(identity: Identity): Promise; -} -``` - -**Types:** - -```typescript -namespace Authorizer { - type Interface = IAuthorizer; -} -``` - -### `IdentityContext` - -**Abstraction** — imported from `webiny/api/security` - -```typescript -import { IdentityContext } from "webiny/api/security"; -``` - -**Interface `IdentityContext.Interface`:** - -```typescript -interface IdentityContext.Interface { - getIdentity(): Identity; - setIdentity(identity: Identity | undefined): void; - withIdentity(identity: Identity | undefined, cb: () => Promise): Promise; - getPermission( - name: string - ): Promise; - getPermissions( - name: string - ): Promise; - listPermissions(): Promise; - hasFullAccess(): Promise; - withoutAuthorization(cb: () => Promise): Promise; - isAuthorizationEnabled(): boolean; -} -``` - -**Types:** - -```typescript -namespace IdentityContext { - type Interface = IIdentityContext; -} -``` - -### `IdentityProvider` - -**Abstraction** — imported from `webiny/api/security` - -```typescript -import { IdentityProvider } from "webiny/api/security"; -``` - -**Interface `IdentityProvider.Interface`:** - -```typescript -interface IdentityProvider.Interface { - isApplicable(token: string): boolean; - getIdentity(token: string): Promise; -} -``` - -**Types:** - -```typescript -namespace IdentityProvider { - type Interface = IIdentityProvider; - type IdentityData = IProviderIdentityData; - type JwtPayload = IJwtPayload; -} -``` - -### `JwtIdentityProvider` - -**Abstraction** — imported from `webiny/api/security` - -```typescript -import { JwtIdentityProvider } from "webiny/api/security"; -``` - -**Interface `JwtIdentityProvider.Interface`:** - -```typescript -interface JwtIdentityProvider.Interface { - isApplicable(token: IJwtPayload): boolean; - getIdentity(token: string, jwt: IJwt): Promise; -} -``` - -**Types:** - -```typescript -namespace JwtIdentityProvider { - type Interface = IJwtIdentityProvider; - type Jwt = IJwt; - type JwtPayload = IJwtPayload; - type JwtHeader = IJwtHeader; - type IdentityData = IProviderIdentityData; -} -``` - -### `OidcIdentityProvider` - -**Abstraction** — imported from `webiny/api/security` - -```typescript -import { OidcIdentityProvider } from "webiny/api/security"; -``` - -**Interface `OidcIdentityProvider.Interface`:** - -```typescript -interface OidcIdentityProvider.Interface { - issuer: string; - clientId: string; - isApplicable(token: IJwtPayload): boolean; - getIdentity(jwt: IJwtPayload): Promise; - verifyToken?(token: string): Promise; - verifyTokenClaims?(token: IJwtPayload): Promise; -} -``` - -**Types:** - -```typescript -namespace OidcIdentityProvider { - type Interface = IOidcIdentityProvider; - type JwtPayload = IJwtPayload; - type IdentityData = IProviderIdentityData; -} -``` - -## Types & Classes - -### `ApiToken` - -**Class** — imported from `webiny/api/security` - -```typescript -import { ApiToken } from "webiny/api/security"; -``` - -```typescript -export class ApiToken { - static validate(token: string): `wat_$; -} -``` diff --git a/docs/developer-docs/6.x/reference/api/security/api-key.ai.txt b/docs/developer-docs/6.x/reference/api/security/api-key.ai.txt deleted file mode 100644 index af354ac8e..000000000 --- a/docs/developer-docs/6.x/reference/api/security/api-key.ai.txt +++ /dev/null @@ -1,31 +0,0 @@ -AI Context: Api Key (reference/api/security/api-key.mdx) - -Source of Information: -1. packages/webiny/src/api/security/api-key.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-core/src/features/security/apiKeys/CreateApiKey/index.ts — originating source -3. /Users/adrian/dev/wby-next/packages/api-core/src/features/security/apiKeys/DeleteApiKey/index.ts — originating source -4. /Users/adrian/dev/wby-next/packages/api-core/src/features/security/apiKeys/GetApiKey/index.ts — originating source -5. /Users/adrian/dev/wby-next/packages/api-core/src/features/security/apiKeys/GetApiKeyByToken/index.ts — originating source -6. /Users/adrian/dev/wby-next/packages/api-core/src/features/security/apiKeys/ListApiKeys/index.ts — originating source -7. /Users/adrian/dev/wby-next/packages/api-core/src/features/security/apiKeys/UpdateApiKey/index.ts — originating source -8. /Users/adrian/dev/wby-next/packages/api-core/src/features/security/apiKeys/shared/abstractions.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -ApiKeyAfterCreateEventHandler, ApiKeyBeforeCreateEventHandler, CreateApiKeyUseCase, ApiKeyAfterDeleteEventHandler, ApiKeyBeforeDeleteEventHandler, DeleteApiKeyUseCase, GetApiKeyUseCase, GetApiKeyByTokenUseCase, ListApiKeysUseCase, ApiKeyAfterUpdateEventHandler, ApiKeyBeforeUpdateEventHandler, UpdateApiKeyUseCase, ApiKeyFactory - -Import Path: webiny/api/security/api-key - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/security/api-key.mdx b/docs/developer-docs/6.x/reference/api/security/api-key.mdx deleted file mode 100644 index 53c171d92..000000000 --- a/docs/developer-docs/6.x/reference/api/security/api-key.mdx +++ /dev/null @@ -1,383 +0,0 @@ ---- -id: yxbpl3nl -title: Api Key -description: "Reference for webiny/api/security/api-key" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What use cases are available in `webiny/api/security/api-key`? -- Which event handlers can you implement? -- How to use the builder and factory APIs? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/security/api-key`. Import any of the items below directly from this path in your Webiny extensions. - -**Use Cases** - - - -**Event Handlers** - - - -**Services** - - - -## Use Cases - -### `CreateApiKeyUseCase` - -**Use Case Abstraction** — imported from `webiny/api/security/api-key` - -```typescript -import { CreateApiKeyUseCase } from "webiny/api/security/api-key"; -``` - -**Interface `CreateApiKeyUseCase.Interface`:** - -```typescript -interface CreateApiKeyUseCase.Interface { - execute(input: CreateApiKeyInput): Promise>; -} -``` - -**Types:** - -```typescript -namespace CreateApiKeyUseCase { - type Interface = ICreateApiKey; - type Error = CreateApiKeyError; -} -``` - -### `DeleteApiKeyUseCase` - -**Use Case Abstraction** — imported from `webiny/api/security/api-key` - -```typescript -import { DeleteApiKeyUseCase } from "webiny/api/security/api-key"; -``` - -**Interface `DeleteApiKeyUseCase.Interface`:** - -```typescript -interface DeleteApiKeyUseCase.Interface { - execute(id: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace DeleteApiKeyUseCase { - type Interface = IDeleteApiKey; - type Error = DeleteApiKeyError; -} -``` - -### `GetApiKeyByTokenUseCase` - -**Use Case Abstraction** — imported from `webiny/api/security/api-key` - -```typescript -import { GetApiKeyByTokenUseCase } from "webiny/api/security/api-key"; -``` - -**Interface `GetApiKeyByTokenUseCase.Interface`:** - -```typescript -interface GetApiKeyByTokenUseCase.Interface { - execute(token: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace GetApiKeyByTokenUseCase { - type Interface = IGetApiKeyByToken; - type Error = GetApiKeyByTokenError; -} -``` - -### `GetApiKeyUseCase` - -**Use Case Abstraction** — imported from `webiny/api/security/api-key` - -```typescript -import { GetApiKeyUseCase } from "webiny/api/security/api-key"; -``` - -**Interface `GetApiKeyUseCase.Interface`:** - -```typescript -interface GetApiKeyUseCase.Interface { - execute(id: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace GetApiKeyUseCase { - type Interface = IGetApiKey; - type Error = GetApiKeyError; -} -``` - -### `ListApiKeysUseCase` - -**Use Case Abstraction** — imported from `webiny/api/security/api-key` - -```typescript -import { ListApiKeysUseCase } from "webiny/api/security/api-key"; -``` - -**Interface `ListApiKeysUseCase.Interface`:** - -```typescript -interface ListApiKeysUseCase.Interface { - execute(params?: ListApiKeysInput): Promise>; -} -``` - -**Types:** - -```typescript -namespace ListApiKeysUseCase { - type Interface = IListApiKeys; - type Error = ListApiKeysError; -} -``` - -### `UpdateApiKeyUseCase` - -**Use Case Abstraction** — imported from `webiny/api/security/api-key` - -```typescript -import { UpdateApiKeyUseCase } from "webiny/api/security/api-key"; -``` - -**Interface `UpdateApiKeyUseCase.Interface`:** - -```typescript -interface UpdateApiKeyUseCase.Interface { - execute(id: string, input: UpdateApiKeyInput): Promise>; -} -``` - -**Types:** - -```typescript -namespace UpdateApiKeyUseCase { - type Interface = IUpdateApiKey; - type Error = UpdateApiKeyError; -} -``` - -## Event Handlers - -### `ApiKeyAfterCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/api-key` - -```typescript -import { ApiKeyAfterCreateEventHandler } from "webiny/api/security/api-key"; -``` - -**Interface `ApiKeyAfterCreateEventHandler.Interface`:** - -```typescript -interface ApiKeyAfterCreateEventHandler.Interface { - handle(event: ApiKeyAfterCreateEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace ApiKeyAfterCreateEventHandler { - type Interface = IEventHandler; - type Event = ApiKeyAfterCreateEvent; -} -``` - -### `ApiKeyAfterDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/api-key` - -```typescript -import { ApiKeyAfterDeleteEventHandler } from "webiny/api/security/api-key"; -``` - -**Interface `ApiKeyAfterDeleteEventHandler.Interface`:** - -```typescript -interface ApiKeyAfterDeleteEventHandler.Interface { - handle(event: ApiKeyAfterDeleteEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace ApiKeyAfterDeleteEventHandler { - type Interface = IEventHandler; - type Event = ApiKeyAfterDeleteEvent; -} -``` - -### `ApiKeyAfterUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/api-key` - -```typescript -import { ApiKeyAfterUpdateEventHandler } from "webiny/api/security/api-key"; -``` - -**Interface `ApiKeyAfterUpdateEventHandler.Interface`:** - -```typescript -interface ApiKeyAfterUpdateEventHandler.Interface { - handle(event: ApiKeyAfterUpdateEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace ApiKeyAfterUpdateEventHandler { - type Interface = IEventHandler; - type Event = ApiKeyAfterUpdateEvent; -} -``` - -### `ApiKeyBeforeCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/api-key` - -```typescript -import { ApiKeyBeforeCreateEventHandler } from "webiny/api/security/api-key"; -``` - -**Interface `ApiKeyBeforeCreateEventHandler.Interface`:** - -```typescript -interface ApiKeyBeforeCreateEventHandler.Interface { - handle(event: ApiKeyBeforeCreateEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace ApiKeyBeforeCreateEventHandler { - type Interface = IEventHandler; - type Event = ApiKeyBeforeCreateEvent; -} -``` - -### `ApiKeyBeforeDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/api-key` - -```typescript -import { ApiKeyBeforeDeleteEventHandler } from "webiny/api/security/api-key"; -``` - -**Interface `ApiKeyBeforeDeleteEventHandler.Interface`:** - -```typescript -interface ApiKeyBeforeDeleteEventHandler.Interface { - handle(event: ApiKeyBeforeDeleteEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace ApiKeyBeforeDeleteEventHandler { - type Interface = IEventHandler; - type Event = ApiKeyBeforeDeleteEvent; -} -``` - -### `ApiKeyBeforeUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/api-key` - -```typescript -import { ApiKeyBeforeUpdateEventHandler } from "webiny/api/security/api-key"; -``` - -**Interface `ApiKeyBeforeUpdateEventHandler.Interface`:** - -```typescript -interface ApiKeyBeforeUpdateEventHandler.Interface { - handle(event: ApiKeyBeforeUpdateEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace ApiKeyBeforeUpdateEventHandler { - type Interface = IEventHandler; - type Event = ApiKeyBeforeUpdateEvent; -} -``` - -## Services - -### `ApiKeyFactory` - -**Abstraction** — imported from `webiny/api/security/api-key` - -```typescript -import { ApiKeyFactory } from "webiny/api/security/api-key"; -``` - -**Interface `ApiKeyFactory.Interface`:** - -```typescript -interface ApiKeyFactory.Interface { - execute(): Promise | CodeApiKey[]; -} -``` - -**Types:** - -```typescript -namespace ApiKeyFactory { - type Interface = IApiKeyFactory; - type Return = Promise | CodeApiKey[]; - type ApiKey = CodeApiKey; -} -``` diff --git a/docs/developer-docs/6.x/reference/api/security/authentication.ai.txt b/docs/developer-docs/6.x/reference/api/security/authentication.ai.txt deleted file mode 100644 index 553c1a4ea..000000000 --- a/docs/developer-docs/6.x/reference/api/security/authentication.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Authentication (reference/api/security/authentication.mdx) - -Source of Information: -1. packages/webiny/src/api/security/authentication.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-core/src/features/security/authentication/AuthenticationContext/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -AfterAuthenticationEventHandler, BeforeAuthenticationEventHandler - -Import Path: webiny/api/security/authentication - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/security/authentication.mdx b/docs/developer-docs/6.x/reference/api/security/authentication.mdx deleted file mode 100644 index e44c716ce..000000000 --- a/docs/developer-docs/6.x/reference/api/security/authentication.mdx +++ /dev/null @@ -1,76 +0,0 @@ ---- -id: yxbpl3nl -title: Authentication -description: "Authentication event handlers" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- Which event handlers can you implement? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/security/authentication`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `AfterAuthenticationEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/authentication` - -```typescript -import { AfterAuthenticationEventHandler } from "webiny/api/security/authentication"; -``` - -**Interface `AfterAuthenticationEventHandler.Interface`:** - -```typescript -interface AfterAuthenticationEventHandler.Interface { - handle(event: AfterAuthenticationEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace AfterAuthenticationEventHandler { - type Interface = IEventHandler; - type Event = AfterAuthenticationEvent; -} -``` - -## `BeforeAuthenticationEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/authentication` - -```typescript -import { BeforeAuthenticationEventHandler } from "webiny/api/security/authentication"; -``` - -**Interface `BeforeAuthenticationEventHandler.Interface`:** - -```typescript -interface BeforeAuthenticationEventHandler.Interface { - handle(event: BeforeAuthenticationEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace BeforeAuthenticationEventHandler { - type Interface = IEventHandler; - type Event = BeforeAuthenticationEvent; -} -``` diff --git a/docs/developer-docs/6.x/reference/api/security/role.ai.txt b/docs/developer-docs/6.x/reference/api/security/role.ai.txt deleted file mode 100644 index 7e9d51c80..000000000 --- a/docs/developer-docs/6.x/reference/api/security/role.ai.txt +++ /dev/null @@ -1,29 +0,0 @@ -AI Context: Role (reference/api/security/role.mdx) - -Source of Information: -1. packages/webiny/src/api/security/role.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-core/src/features/security/roles/CreateRole/index.ts — originating source -3. /Users/adrian/dev/wby-next/packages/api-core/src/features/security/roles/DeleteRole/index.ts — originating source -4. /Users/adrian/dev/wby-next/packages/api-core/src/features/security/roles/GetRole/index.ts — originating source -5. /Users/adrian/dev/wby-next/packages/api-core/src/features/security/roles/ListRoles/index.ts — originating source -6. /Users/adrian/dev/wby-next/packages/api-core/src/features/security/roles/UpdateRole/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -CreateRoleUseCase, RoleAfterCreateEventHandler, RoleBeforeCreateEventHandler, DeleteRoleUseCase, RoleAfterDeleteEventHandler, RoleBeforeDeleteEventHandler, GetRoleUseCase, ListRolesUseCase, UpdateRoleUseCase, RoleAfterUpdateEventHandler, RoleBeforeUpdateEventHandler - -Import Path: webiny/api/security/role - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/security/role.mdx b/docs/developer-docs/6.x/reference/api/security/role.mdx deleted file mode 100644 index 1f41d9d73..000000000 --- a/docs/developer-docs/6.x/reference/api/security/role.mdx +++ /dev/null @@ -1,327 +0,0 @@ ---- -id: yxbpl3nl -title: Role -description: "Role use cases and event handlers" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What use cases are available in `webiny/api/security/role`? -- Which event handlers can you implement? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/security/role`. Import any of the items below directly from this path in your Webiny extensions. - -**Use Cases** - - - -**Event Handlers** - - - -## Use Cases - -### `CreateRoleUseCase` - -**Use Case Abstraction** — imported from `webiny/api/security/role` - -```typescript -import { CreateRoleUseCase } from "webiny/api/security/role"; -``` - -**Interface `CreateRoleUseCase.Interface`:** - -```typescript -interface CreateRoleUseCase.Interface { - execute(input: CreateRoleInput): Promise>; -} -``` - -**Types:** - -```typescript -namespace CreateRoleUseCase { - type Interface = ICreateRole; - type Error = CreateRoleError; -} -``` - -### `DeleteRoleUseCase` - -**Use Case Abstraction** — imported from `webiny/api/security/role` - -```typescript -import { DeleteRoleUseCase } from "webiny/api/security/role"; -``` - -**Interface `DeleteRoleUseCase.Interface`:** - -```typescript -interface DeleteRoleUseCase.Interface { - execute(id: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace DeleteRoleUseCase { - type Interface = IDeleteRole; - type Error = DeleteRoleError; -} -``` - -### `GetRoleUseCase` - -**Use Case Abstraction** — imported from `webiny/api/security/role` - -```typescript -import { GetRoleUseCase } from "webiny/api/security/role"; -``` - -**Interface `GetRoleUseCase.Interface`:** - -```typescript -interface GetRoleUseCase.Interface { - execute(params: GetRoleInput): Promise>; -} -``` - -**Types:** - -```typescript -namespace GetRoleUseCase { - type Interface = IGetRole; - type Error = GetRoleError; -} -``` - -### `ListRolesUseCase` - -**Use Case Abstraction** — imported from `webiny/api/security/role` - -```typescript -import { ListRolesUseCase } from "webiny/api/security/role"; -``` - -**Interface `ListRolesUseCase.Interface`:** - -```typescript -interface ListRolesUseCase.Interface { - execute(params?: ListRolesInput): Promise>; -} -``` - -**Types:** - -```typescript -namespace ListRolesUseCase { - type Interface = IListRoles; - type Error = ListRolesError; -} -``` - -### `UpdateRoleUseCase` - -**Use Case Abstraction** — imported from `webiny/api/security/role` - -```typescript -import { UpdateRoleUseCase } from "webiny/api/security/role"; -``` - -**Interface `UpdateRoleUseCase.Interface`:** - -```typescript -interface UpdateRoleUseCase.Interface { - execute( - id: string, - input: UpdateRoleUseCaseInput - ): Promise>; -} -``` - -**Types:** - -```typescript -namespace UpdateRoleUseCase { - type Interface = IUpdateRoleUseCase; - type Error = UpdateRoleUseCaseError; -} -``` - -## Event Handlers - -### `RoleAfterCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/role` - -```typescript -import { RoleAfterCreateEventHandler } from "webiny/api/security/role"; -``` - -**Interface `RoleAfterCreateEventHandler.Interface`:** - -```typescript -interface RoleAfterCreateEventHandler.Interface { - handle(event: RoleAfterCreateEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace RoleAfterCreateEventHandler { - type Interface = IEventHandler; - type Event = RoleAfterCreateEvent; -} -``` - -### `RoleAfterDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/role` - -```typescript -import { RoleAfterDeleteEventHandler } from "webiny/api/security/role"; -``` - -**Interface `RoleAfterDeleteEventHandler.Interface`:** - -```typescript -interface RoleAfterDeleteEventHandler.Interface { - handle(event: RoleAfterDeleteEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace RoleAfterDeleteEventHandler { - type Interface = IEventHandler; - type Event = RoleAfterDeleteEvent; -} -``` - -### `RoleAfterUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/role` - -```typescript -import { RoleAfterUpdateEventHandler } from "webiny/api/security/role"; -``` - -**Interface `RoleAfterUpdateEventHandler.Interface`:** - -```typescript -interface RoleAfterUpdateEventHandler.Interface { - handle(event: RoleAfterUpdateEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace RoleAfterUpdateEventHandler { - type Interface = IEventHandler; - type Event = RoleAfterUpdateEvent; -} -``` - -### `RoleBeforeCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/role` - -```typescript -import { RoleBeforeCreateEventHandler } from "webiny/api/security/role"; -``` - -**Interface `RoleBeforeCreateEventHandler.Interface`:** - -```typescript -interface RoleBeforeCreateEventHandler.Interface { - handle(event: RoleBeforeCreateEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace RoleBeforeCreateEventHandler { - type Interface = IEventHandler; - type Event = RoleBeforeCreateEvent; -} -``` - -### `RoleBeforeDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/role` - -```typescript -import { RoleBeforeDeleteEventHandler } from "webiny/api/security/role"; -``` - -**Interface `RoleBeforeDeleteEventHandler.Interface`:** - -```typescript -interface RoleBeforeDeleteEventHandler.Interface { - handle(event: RoleBeforeDeleteEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace RoleBeforeDeleteEventHandler { - type Interface = IEventHandler; - type Event = RoleBeforeDeleteEvent; -} -``` - -### `RoleBeforeUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/role` - -```typescript -import { RoleBeforeUpdateEventHandler } from "webiny/api/security/role"; -``` - -**Interface `RoleBeforeUpdateEventHandler.Interface`:** - -```typescript -interface RoleBeforeUpdateEventHandler.Interface { - handle(event: RoleBeforeUpdateEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace RoleBeforeUpdateEventHandler { - type Interface = IEventHandler; - type Event = RoleBeforeUpdateEvent; -} -``` diff --git a/docs/developer-docs/6.x/reference/api/security/user.ai.txt b/docs/developer-docs/6.x/reference/api/security/user.ai.txt deleted file mode 100644 index 51be42a3d..000000000 --- a/docs/developer-docs/6.x/reference/api/security/user.ai.txt +++ /dev/null @@ -1,30 +0,0 @@ -AI Context: User (reference/api/security/user.mdx) - -Source of Information: -1. packages/webiny/src/api/security/user.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-core/src/features/users/CreateUser/index.ts — originating source -3. /Users/adrian/dev/wby-next/packages/api-core/src/features/users/DeleteUser/index.ts — originating source -4. /Users/adrian/dev/wby-next/packages/api-core/src/features/users/UpdateUser/index.ts — originating source -5. /Users/adrian/dev/wby-next/packages/api-core/src/features/users/GetUser/index.ts — originating source -6. /Users/adrian/dev/wby-next/packages/api-core/src/features/users/ListUsers/index.ts — originating source -7. /Users/adrian/dev/wby-next/packages/api-core/src/features/users/ListUserTeams/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -CreateUserUseCase, UserAfterCreateEventHandler, UserBeforeCreateEventHandler, DeleteUserUseCase, UserAfterDeleteEventHandler, UserBeforeDeleteEventHandler, UpdateUserUseCase, UserAfterUpdateEventHandler, UserBeforeUpdateEventHandler, GetUserUseCase, ListUsersUseCase, ListUserTeamsUseCase - -Import Path: webiny/api/security/user - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/security/user.mdx b/docs/developer-docs/6.x/reference/api/security/user.mdx deleted file mode 100644 index b1f82f182..000000000 --- a/docs/developer-docs/6.x/reference/api/security/user.mdx +++ /dev/null @@ -1,351 +0,0 @@ ---- -id: yxbpl3nl -title: User -description: "User use cases and event handlers" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What use cases are available in `webiny/api/security/user`? -- Which event handlers can you implement? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/security/user`. Import any of the items below directly from this path in your Webiny extensions. - -**Use Cases** - - - -**Event Handlers** - - - -## Use Cases - -### `CreateUserUseCase` - -**Use Case Abstraction** — imported from `webiny/api/security/user` - -```typescript -import { CreateUserUseCase } from "webiny/api/security/user"; -``` - -**Interface `CreateUserUseCase.Interface`:** - -```typescript -interface CreateUserUseCase.Interface { - execute(input: CreateUserInput): Promise>; -} -``` - -**Types:** - -```typescript -namespace CreateUserUseCase { - type Interface = ICreateUser; - type Input = CreateUserInput; - type Error = CreateUserError; -} -``` - -### `DeleteUserUseCase` - -**Use Case Abstraction** — imported from `webiny/api/security/user` - -```typescript -import { DeleteUserUseCase } from "webiny/api/security/user"; -``` - -**Interface `DeleteUserUseCase.Interface`:** - -```typescript -interface DeleteUserUseCase.Interface { - execute(id: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace DeleteUserUseCase { - type Interface = IDeleteUser; - type Error = DeleteUserError; -} -``` - -### `GetUserUseCase` - -**Use Case Abstraction** — imported from `webiny/api/security/user` - -```typescript -import { GetUserUseCase } from "webiny/api/security/user"; -``` - -**Interface `GetUserUseCase.Interface`:** - -```typescript -interface GetUserUseCase.Interface { - execute(input: GetUserInput): Promise>; -} -``` - -**Types:** - -```typescript -namespace GetUserUseCase { - type Interface = IGetUser; - type Error = GetUserError; -} -``` - -### `ListUsersUseCase` - -**Use Case Abstraction** — imported from `webiny/api/security/user` - -```typescript -import { ListUsersUseCase } from "webiny/api/security/user"; -``` - -**Interface `ListUsersUseCase.Interface`:** - -```typescript -interface ListUsersUseCase.Interface { - execute(input?: ListUsersInput): Promise>; -} -``` - -**Types:** - -```typescript -namespace ListUsersUseCase { - type Interface = IListUsers; - type Error = ListUsersError; -} -``` - -### `ListUserTeamsUseCase` - -**Use Case Abstraction** — imported from `webiny/api/security/user` - -```typescript -import { ListUserTeamsUseCase } from "webiny/api/security/user"; -``` - -**Interface `ListUserTeamsUseCase.Interface`:** - -```typescript -interface ListUserTeamsUseCase.Interface { - execute(userId: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace ListUserTeamsUseCase { - type Interface = IListUserTeams; - type Error = ListUserTeamsError; -} -``` - -### `UpdateUserUseCase` - -**Use Case Abstraction** — imported from `webiny/api/security/user` - -```typescript -import { UpdateUserUseCase } from "webiny/api/security/user"; -``` - -**Interface `UpdateUserUseCase.Interface`:** - -```typescript -interface UpdateUserUseCase.Interface { - execute(id: string, input: UpdateUserInput): Promise>; -} -``` - -**Types:** - -```typescript -namespace UpdateUserUseCase { - type Interface = IUpdateUser; - type Error = UpdateUserError; -} -``` - -## Event Handlers - -### `UserAfterCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/user` - -```typescript -import { UserAfterCreateEventHandler } from "webiny/api/security/user"; -``` - -**Interface `UserAfterCreateEventHandler.Interface`:** - -```typescript -interface UserAfterCreateEventHandler.Interface { - handle(event: UserAfterCreateEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace UserAfterCreateEventHandler { - type Interface = IEventHandler; - type Event = UserAfterCreateEvent; -} -``` - -### `UserAfterDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/user` - -```typescript -import { UserAfterDeleteEventHandler } from "webiny/api/security/user"; -``` - -**Interface `UserAfterDeleteEventHandler.Interface`:** - -```typescript -interface UserAfterDeleteEventHandler.Interface { - handle(event: UserAfterDeleteEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace UserAfterDeleteEventHandler { - type Interface = IEventHandler; - type Event = UserAfterDeleteEvent; -} -``` - -### `UserAfterUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/user` - -```typescript -import { UserAfterUpdateEventHandler } from "webiny/api/security/user"; -``` - -**Interface `UserAfterUpdateEventHandler.Interface`:** - -```typescript -interface UserAfterUpdateEventHandler.Interface { - handle(event: UserAfterUpdateEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace UserAfterUpdateEventHandler { - type Interface = IEventHandler; - type Event = UserAfterUpdateEvent; -} -``` - -### `UserBeforeCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/user` - -```typescript -import { UserBeforeCreateEventHandler } from "webiny/api/security/user"; -``` - -**Interface `UserBeforeCreateEventHandler.Interface`:** - -```typescript -interface UserBeforeCreateEventHandler.Interface { - handle(event: UserBeforeCreateEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace UserBeforeCreateEventHandler { - type Interface = IEventHandler; - type Event = UserBeforeCreateEvent; -} -``` - -### `UserBeforeDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/user` - -```typescript -import { UserBeforeDeleteEventHandler } from "webiny/api/security/user"; -``` - -**Interface `UserBeforeDeleteEventHandler.Interface`:** - -```typescript -interface UserBeforeDeleteEventHandler.Interface { - handle(event: UserBeforeDeleteEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace UserBeforeDeleteEventHandler { - type Interface = IEventHandler; - type Event = UserBeforeDeleteEvent; -} -``` - -### `UserBeforeUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/security/user` - -```typescript -import { UserBeforeUpdateEventHandler } from "webiny/api/security/user"; -``` - -**Interface `UserBeforeUpdateEventHandler.Interface`:** - -```typescript -interface UserBeforeUpdateEventHandler.Interface { - handle(event: UserBeforeUpdateEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace UserBeforeUpdateEventHandler { - type Interface = IEventHandler; - type Event = UserBeforeUpdateEvent; -} -``` diff --git a/docs/developer-docs/6.x/reference/api/system.ai.txt b/docs/developer-docs/6.x/reference/api/system.ai.txt deleted file mode 100644 index 91ba7d58d..000000000 --- a/docs/developer-docs/6.x/reference/api/system.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: System (reference/api/system.mdx) - -Source of Information: -1. packages/webiny/src/api/system.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-core/src/features/system/InstallSystem/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -InstallSystemUseCase, SystemInstalledEventHandler - -Import Path: webiny/api/system - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/system.mdx b/docs/developer-docs/6.x/reference/api/system.mdx deleted file mode 100644 index 00d6dbb44..000000000 --- a/docs/developer-docs/6.x/reference/api/system.mdx +++ /dev/null @@ -1,97 +0,0 @@ ---- -id: yxbpl3n5 -title: System -description: "System installation abstractions" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What use cases are available in `webiny/api/system`? -- Which event handlers can you implement? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/system`. Import any of the items below directly from this path in your Webiny extensions. - -**Use Cases** - - - -**Event Handlers** - - - -## Use Cases - -### `InstallSystemUseCase` - -**Use Case Abstraction** — imported from `webiny/api/system` - -```typescript -import { InstallSystemUseCase } from "webiny/api/system"; -``` - -**Interface `InstallSystemUseCase.Interface`:** - -Use Case Abstraction - -```typescript -interface InstallSystemUseCase.Interface { - execute( - input: InstallSystemInput - ): Promise>; -} -``` - -**Types:** - -```typescript -namespace InstallSystemUseCase { - type Interface = IInstallSystemUseCase; - type Input = InstallSystemInput; -} -``` - -**`Input` — `AppInstallationData[]`:** - -Types - -| Field | Type | Required | Description | -| ------ | --------------------- | -------- | ----------- | -| `app` | `string` | yes | — | -| `data` | `Record` | yes | — | - -## Event Handlers - -### `SystemInstalledEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/system` - -```typescript -import { SystemInstalledEventHandler } from "webiny/api/system"; -``` - -**Interface `SystemInstalledEventHandler.Interface`:** - -```typescript -interface SystemInstalledEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace SystemInstalledEventHandler { - type Interface = IEventHandler; - type Event = DomainEvent; -} -``` diff --git a/docs/developer-docs/6.x/reference/api/tasks.ai.txt b/docs/developer-docs/6.x/reference/api/tasks.ai.txt deleted file mode 100644 index fc5f1f0da..000000000 --- a/docs/developer-docs/6.x/reference/api/tasks.ai.txt +++ /dev/null @@ -1,26 +0,0 @@ -AI Context: Tasks (reference/api/tasks.mdx) - -Source of Information: -1. packages/webiny/src/api/tasks.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-core/src/features/task/TaskService/index.ts — originating source -3. /Users/adrian/dev/wby-next/packages/api-core/src/features/task/TaskDefinition/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -TaskService, TaskDefinition - -Import Path: webiny/api/tasks - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/tasks.mdx b/docs/developer-docs/6.x/reference/api/tasks.mdx deleted file mode 100644 index 74f1f27c4..000000000 --- a/docs/developer-docs/6.x/reference/api/tasks.mdx +++ /dev/null @@ -1,137 +0,0 @@ ---- -id: yxbpl3rh -title: Tasks -description: "Background task abstractions: TaskService, TaskDefinition" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/api/tasks`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/tasks`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `TaskDefinition` - -**Abstraction** — imported from `webiny/api/tasks` - -```typescript -import { TaskDefinition } from "webiny/api/tasks"; -``` - -**Interface `TaskDefinition.Interface`:** - -Core TaskDefinition - minimal interface - -```typescript -interface TaskDefinition.Interface { - id: string; - title: string; - description?: string; - maxIterations?: number; - databaseLogs?: boolean; - isPrivate?: boolean; - run(params: ITaskRunParams): Promise>; - onBeforeTrigger?(params: ITaskBeforeTriggerParams): Promise; - onDone?(params: ITaskLifecycleHook): Promise; - onError?(params: ITaskLifecycleHook): Promise; - onAbort?(params: ITaskLifecycleHook): Promise; - onMaxIterations?(params: ITaskLifecycleHook): Promise; - createInputValidation?( - params: ITaskCreateInputValidationParams - ): GenericRecord | zod.Schema; -} -``` - -| Method | Description | -| ----------------------------------------------------------------------------------- | -------------------------------------------------------- | -| `id: string()` | — | -| `title: string()` | — | -| `description?: string()` | — | -| `maxIterations?: number()` | — | -| `databaseLogs?: boolean()` | — | -| `isPrivate?: boolean()` | — | -| `run()` | Core run method - receives ONLY input params | -| All runtime dependencies (logging, state management, etc.) come from TaskController | -| `onBeforeTrigger?()` | Optional lifecycle hooks - receive task data, no context | -| `onDone?()` | — | -| `onError?()` | — | -| `onAbort?()` | — | -| `onMaxIterations?()` | — | -| `createInputValidation?()` | Create a validation schema for the task input. | -| This will be used to validate the input before the task is triggered. | - -**Types:** - -```typescript -namespace TaskDefinition { - type Interface = ITaskDefinition; - type TaskInput = ITaskInput; - type TaskOutput = ITaskOutput; - type Runnable = IRunnableTaskDefinition; - type RunParams = ITaskRunParams; - type Result = ITaskResult; - type Task = ITask; - type ResultDone = ITaskResultDone; - type ResultContinue = ITaskResultContinue; - type ResultError = ITaskResultError; - type ResultAborted = ITaskResultAborted; - type CreateInputValidationParams = ITaskCreateInputValidationParams; - type TaskCreateData = ITaskCreateData; - type BeforeTriggerParams = ITaskBeforeTriggerParams; - type LifecycleHookParams = ITaskLifecycleHook; -} -``` - -## `TaskService` - -**Abstraction** — imported from `webiny/api/tasks` - -```typescript -import { TaskService } from "webiny/api/tasks"; -``` - -**Interface `TaskService.Interface`:** - -```typescript -interface TaskService.Interface { - trigger: < - T extends TaskDefinition.TaskInput = TaskDefinition.TaskInput, - O extends IGenericOutput = IGenericOutput - >( - params: ITaskTriggerParams - ) => Promise, BaseError>>; - abort: < - T extends TaskDefinition.TaskInput = TaskDefinition.TaskInput, - O extends IGenericOutput = IGenericOutput - >( - params: ITaskAbortParams - ) => Promise, BaseError>>; - fetchServiceInfo: (input: ITask | string) => Promise>; -} -``` - -**Types:** - -```typescript -namespace TaskService { - type Interface = ITaskService; - type GenericOutput = IGenericOutput; - type TaskInput = TaskDefinition.TaskInput; - type Task = ITask; -} -``` diff --git a/docs/developer-docs/6.x/reference/api/tenancy.ai.txt b/docs/developer-docs/6.x/reference/api/tenancy.ai.txt deleted file mode 100644 index c4a842501..000000000 --- a/docs/developer-docs/6.x/reference/api/tenancy.ai.txt +++ /dev/null @@ -1,30 +0,0 @@ -AI Context: Tenancy (reference/api/tenancy.mdx) - -Source of Information: -1. packages/webiny/src/api/tenancy.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-core/src/features/tenancy/TenantContext/index.ts — originating source -3. /Users/adrian/dev/wby-next/packages/api-core/src/features/tenancy/CreateTenant/index.ts — originating source -4. /Users/adrian/dev/wby-next/packages/api-core/src/features/tenancy/GetTenantById/index.ts — originating source -5. /Users/adrian/dev/wby-next/packages/api-core/src/features/tenancy/UpdateTenant/index.ts — originating source -6. /Users/adrian/dev/wby-next/packages/api-core/src/features/tenancy/DeleteTenant/index.ts — originating source -7. /Users/adrian/dev/wby-next/packages/api-core/src/features/tenancy/InstallTenant/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -TenantContext, CreateTenantUseCase, CreateTenantRepository, TenantBeforeCreateEventHandler, TenantAfterCreateEventHandler, GetTenantByIdUseCase, UpdateTenantUseCase, UpdateTenantRepository, TenantAfterUpdateEventHandler, TenantBeforeUpdateEventHandler, DeleteTenantUseCase, DeleteTenantRepository, TenantAfterDeleteEventHandler, TenantBeforeDeleteEventHandler, InstallTenantUseCase, AppInstaller, TenantInstalledEventHandler - -Import Path: webiny/api/tenancy - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/tenancy.mdx b/docs/developer-docs/6.x/reference/api/tenancy.mdx deleted file mode 100644 index e1bbda4c3..000000000 --- a/docs/developer-docs/6.x/reference/api/tenancy.mdx +++ /dev/null @@ -1,517 +0,0 @@ ---- -id: yxbpl3rl -title: Tenancy -description: "Tenancy context and tenant management" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What use cases are available in `webiny/api/tenancy`? -- Which event handlers can you implement? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/tenancy`. Import any of the items below directly from this path in your Webiny extensions. - -**Use Cases** - - - -**Event Handlers** - - - -**Services** - - - -## Use Cases - -### `CreateTenantRepository` - -**Use Case Abstraction** — imported from `webiny/api/tenancy` - -```typescript -import { CreateTenantRepository } from "webiny/api/tenancy"; -``` - -**Interface `CreateTenantRepository.Interface`:** - -Repository - -```typescript -interface CreateTenantRepository.Interface { - create(tenant: Tenant): Promise; -} -``` - -**Types:** - -```typescript -namespace CreateTenantRepository { - type Interface = ICreateTenantRepository; -} -``` - -### `CreateTenantUseCase` - -**Use Case Abstraction** — imported from `webiny/api/tenancy` - -```typescript -import { CreateTenantUseCase } from "webiny/api/tenancy"; -``` - -**Interface `CreateTenantUseCase.Interface`:** - -Use Case - -```typescript -interface CreateTenantUseCase.Interface { - execute( - data: CreateTenantInput - ): Promise>; -} -``` - -**Types:** - -```typescript -namespace CreateTenantUseCase { - type Interface = ICreateTenantUseCase; - type Errors = ICreateTenantErrors[keyof ICreateTenantErrors]; -} -``` - -### `DeleteTenantRepository` - -**Use Case Abstraction** — imported from `webiny/api/tenancy` - -```typescript -import { DeleteTenantRepository } from "webiny/api/tenancy"; -``` - -**Interface `DeleteTenantRepository.Interface`:** - -```typescript -interface DeleteTenantRepository.Interface { - delete(id: string): Promise; -} -``` - -**Types:** - -```typescript -namespace DeleteTenantRepository { - type Interface = IDeleteTenantRepository; -} -``` - -### `DeleteTenantUseCase` - -**Use Case Abstraction** — imported from `webiny/api/tenancy` - -```typescript -import { DeleteTenantUseCase } from "webiny/api/tenancy"; -``` - -**Interface `DeleteTenantUseCase.Interface`:** - -```typescript -interface DeleteTenantUseCase.Interface { - execute(id: string): Promise; -} -``` - -**Types:** - -```typescript -namespace DeleteTenantUseCase { - type Interface = IDeleteTenantUseCase; -} -``` - -### `GetTenantByIdUseCase` - -**Use Case Abstraction** — imported from `webiny/api/tenancy` - -```typescript -import { GetTenantByIdUseCase } from "webiny/api/tenancy"; -``` - -**Interface `GetTenantByIdUseCase.Interface`:** - -```typescript -interface GetTenantByIdUseCase.Interface { - execute(id: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace GetTenantByIdUseCase { - type Interface = IGetTenantByIdUseCase; - type Error = GetTenantByIdError; - type Result = ReturnType; -} -``` - -### `InstallTenantUseCase` - -**Use Case Abstraction** — imported from `webiny/api/tenancy` - -```typescript -import { InstallTenantUseCase } from "webiny/api/tenancy"; -``` - -**Interface `InstallTenantUseCase.Interface`:** - -Use Case Abstraction - -```typescript -interface InstallTenantUseCase.Interface { - execute( - input: TenantInstallationInput - ): Promise>; -} -``` - -**Types:** - -```typescript -namespace InstallTenantUseCase { - type Interface = IInstallTenantUseCase; - type Input = TenantInstallationInput; - type Errors = IInstallTenantErrors[keyof IInstallTenantErrors]; -} -``` - -### `UpdateTenantRepository` - -**Use Case Abstraction** — imported from `webiny/api/tenancy` - -```typescript -import { UpdateTenantRepository } from "webiny/api/tenancy"; -``` - -**Interface `UpdateTenantRepository.Interface`:** - -```typescript -interface UpdateTenantRepository.Interface { - update(tenant: Tenant): Promise; -} -``` - -**Types:** - -```typescript -namespace UpdateTenantRepository { - type Interface = IUpdateTenantRepository; -} -``` - -### `UpdateTenantUseCase` - -**Use Case Abstraction** — imported from `webiny/api/tenancy` - -```typescript -import { UpdateTenantUseCase } from "webiny/api/tenancy"; -``` - -**Interface `UpdateTenantUseCase.Interface`:** - -```typescript -interface UpdateTenantUseCase.Interface { - execute(id: string, data: Partial): Promise>; -} -``` - -**Types:** - -```typescript -namespace UpdateTenantUseCase { - type Interface = IUpdateTenantUseCase; -} -``` - -## Event Handlers - -### `TenantAfterCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/tenancy` - -```typescript -import { TenantAfterCreateEventHandler } from "webiny/api/tenancy"; -``` - -**Interface `TenantAfterCreateEventHandler.Interface`:** - -```typescript -interface TenantAfterCreateEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace TenantAfterCreateEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; -} -``` - -### `TenantAfterDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/tenancy` - -```typescript -import { TenantAfterDeleteEventHandler } from "webiny/api/tenancy"; -``` - -**Interface `TenantAfterDeleteEventHandler.Interface`:** - -```typescript -interface TenantAfterDeleteEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace TenantAfterDeleteEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; -} -``` - -### `TenantAfterUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/tenancy` - -```typescript -import { TenantAfterUpdateEventHandler } from "webiny/api/tenancy"; -``` - -**Interface `TenantAfterUpdateEventHandler.Interface`:** - -```typescript -interface TenantAfterUpdateEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace TenantAfterUpdateEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; -} -``` - -### `TenantBeforeCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/tenancy` - -```typescript -import { TenantBeforeCreateEventHandler } from "webiny/api/tenancy"; -``` - -**Interface `TenantBeforeCreateEventHandler.Interface`:** - -```typescript -interface TenantBeforeCreateEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace TenantBeforeCreateEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; -} -``` - -### `TenantBeforeDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/tenancy` - -```typescript -import { TenantBeforeDeleteEventHandler } from "webiny/api/tenancy"; -``` - -**Interface `TenantBeforeDeleteEventHandler.Interface`:** - -```typescript -interface TenantBeforeDeleteEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace TenantBeforeDeleteEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; -} -``` - -### `TenantBeforeUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/tenancy` - -```typescript -import { TenantBeforeUpdateEventHandler } from "webiny/api/tenancy"; -``` - -**Interface `TenantBeforeUpdateEventHandler.Interface`:** - -```typescript -interface TenantBeforeUpdateEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace TenantBeforeUpdateEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; -} -``` - -### `TenantInstalledEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/tenancy` - -```typescript -import { TenantInstalledEventHandler } from "webiny/api/tenancy"; -``` - -**Interface `TenantInstalledEventHandler.Interface`:** - -```typescript -interface TenantInstalledEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Types:** - -```typescript -namespace TenantInstalledEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; -} -``` - -## Services - -### `AppInstaller` - -**Abstraction** — imported from `webiny/api/tenancy` - -```typescript -import { AppInstaller } from "webiny/api/tenancy"; -``` - -**Interface `AppInstaller.Interface`:** - -App Installer Abstraction - -```typescript -interface AppInstaller.Interface { - readonly alwaysRun?: boolean; - readonly appName: string; - readonly dependsOn: string[]; - install(tenant: Tenant, data: TData): Promise; - uninstall(tenant: Tenant): Promise; -} -``` - -| Method | Description | -| ------------------------------------------------------- | ------------------------ | -| `readonly alwaysRun?: boolean()` | — | -| `readonly appName: string()` | — | -| `readonly dependsOn: string[]()` | — | -| `install()` | Perform the installation | -| If this succeeds, uninstall() MUST be able to revert it | -| `uninstall()` | Revert the installation | -| Called if any subsequent installer fails | - -**Types:** - -```typescript -namespace AppInstaller { - type Interface = IAppInstaller; -} -``` - -### `TenantContext` - -**Abstraction** — imported from `webiny/api/tenancy` - -```typescript -import { TenantContext } from "webiny/api/tenancy"; -``` - -**Interface `TenantContext.Interface`:** - -```typescript -interface TenantContext.Interface { - setTenant(tenant: Tenant): void; - getTenant(): Tenant; - withRootTenant(cb: () => T): Promise; - withEachTenant( - tenants: Tenant[], - cb: (tenant: Tenant) => Promise - ): Promise; - withTenant(tenant: Tenant, cb: (tenant: Tenant) => Promise): Promise; -} -``` - -**Types:** - -```typescript -namespace TenantContext { - type Interface = ITenantContext; -} -``` diff --git a/docs/developer-docs/6.x/reference/api/tenant-manager.ai.txt b/docs/developer-docs/6.x/reference/api/tenant-manager.ai.txt deleted file mode 100644 index c911614a1..000000000 --- a/docs/developer-docs/6.x/reference/api/tenant-manager.ai.txt +++ /dev/null @@ -1,26 +0,0 @@ -AI Context: Tenant Manager (reference/api/tenant-manager.mdx) - -Source of Information: -1. packages/webiny/src/api/tenant-manager.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/tenant-manager/src/api/domain/TenantModelExtension.ts — originating source -3. /Users/adrian/dev/wby-next/packages/tenant-manager/src/shared/Tenant.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -TenantModelExtension, TenantExtensions - -Import Path: webiny/api/tenant-manager - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/tenant-manager.mdx b/docs/developer-docs/6.x/reference/api/tenant-manager.mdx deleted file mode 100644 index dbb1acfb5..000000000 --- a/docs/developer-docs/6.x/reference/api/tenant-manager.mdx +++ /dev/null @@ -1,68 +0,0 @@ ---- -id: yxbpl3rl -title: Tenant Manager -description: "Tenant manager abstractions" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/api/tenant-manager`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/tenant-manager`. Import any of the items below directly from this path in your Webiny extensions. - -**Services** - - - -**Types & Classes** - - - -## Services - -### `TenantModelExtension` - -**Abstraction** — imported from `webiny/api/tenant-manager` - -```typescript -import { TenantModelExtension } from "webiny/api/tenant-manager"; -``` - -**Interface `TenantModelExtension.Interface`:** - -```typescript -interface TenantModelExtension.Interface { - execute(extension: IExtension): void; -} -``` - -**Types:** - -```typescript -namespace TenantModelExtension { - type Interface = ITenantModelExtension; - type Extension = IExtension; -} -``` - -## Types & Classes - -### `TenantExtensions` - -**Type** — imported from `webiny/api/tenant-manager` - -```typescript -import type { TenantExtensions } from "webiny/api/tenant-manager"; -``` - -```typescript -export interface TenantExtensions {} -``` diff --git a/docs/developer-docs/6.x/reference/api/website-builder/nextjs.ai.txt b/docs/developer-docs/6.x/reference/api/website-builder/nextjs.ai.txt deleted file mode 100644 index fe7b0116f..000000000 --- a/docs/developer-docs/6.x/reference/api/website-builder/nextjs.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Next.js (reference/api/website-builder/nextjs.mdx) - -Source of Information: -1. packages/webiny/src/api/website-builder/nextjs.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/nextjs/abstractions.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -NextjsConfig - -Import Path: webiny/api/website-builder/nextjs - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/website-builder/nextjs.mdx b/docs/developer-docs/6.x/reference/api/website-builder/nextjs.mdx deleted file mode 100644 index 5a01f6d6b..000000000 --- a/docs/developer-docs/6.x/reference/api/website-builder/nextjs.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -id: yxbpl3dl -title: Next.js -description: "Next.js configuration abstraction" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/api/website-builder/nextjs`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/website-builder/nextjs`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `NextjsConfig` - -**Abstraction** — imported from `webiny/api/website-builder/nextjs` - -```typescript -import { NextjsConfig } from "webiny/api/website-builder/nextjs"; -``` - -**Interface `NextjsConfig.Interface`:** - -```typescript -interface NextjsConfig.Interface { - execute(): Promise; -} -``` - -**Types:** - -```typescript -namespace NextjsConfig { - type Interface = INextjsConfig; - type Return = Promise; -} -``` diff --git a/docs/developer-docs/6.x/reference/api/website-builder/page.ai.txt b/docs/developer-docs/6.x/reference/api/website-builder/page.ai.txt deleted file mode 100644 index 8553fe287..000000000 --- a/docs/developer-docs/6.x/reference/api/website-builder/page.ai.txt +++ /dev/null @@ -1,36 +0,0 @@ -AI Context: Page (reference/api/website-builder/page.mdx) - -Source of Information: -1. packages/webiny/src/api/website-builder/page.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/pages/CreatePage/abstractions.ts — originating source -3. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/pages/CreatePageRevisionFrom/abstractions.ts — originating source -4. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/pages/DeletePage/abstractions.ts — originating source -5. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/pages/DuplicatePage/abstractions.ts — originating source -6. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/pages/GetPageById/abstractions.ts — originating source -7. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/pages/GetPageByPath/abstractions.ts — originating source -8. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/pages/GetPageRevisions/abstractions.ts — originating source -9. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/pages/ListPages/abstractions.ts — originating source -10. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/pages/MovePage/abstractions.ts — originating source -11. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/pages/PublishPage/abstractions.ts — originating source -12. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/pages/UnpublishPage/abstractions.ts — originating source -13. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/pages/UpdatePage/abstractions.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -CreatePageUseCase, PageAfterCreateEventHandler, PageBeforeCreateEventHandler, CreatePageRevisionFromUseCase, PageAfterCreateRevisionFromEventHandler, PageBeforeCreateRevisionFromEventHandler, DeletePageUseCase, PageAfterDeleteEventHandler, PageBeforeDeleteEventHandler, DuplicatePageUseCase, PageAfterDuplicateEventHandler, PageBeforeDuplicateEventHandler, GetPageByIdUseCase, GetPageByPathUseCase, GetPageRevisionsUseCase, ListPagesUseCase, MovePageUseCase, PageAfterMoveEventHandler, PageBeforeMoveEventHandler, PublishPageUseCase, PageAfterPublishEventHandler, PageBeforePublishEventHandler, UnpublishPageUseCase, PageAfterUnpublishEventHandler, PageBeforeUnpublishEventHandler, UpdatePageUseCase, PageAfterUpdateEventHandler, PageBeforeUpdateEventHandler - -Import Path: webiny/api/website-builder/page - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/website-builder/page.mdx b/docs/developer-docs/6.x/reference/api/website-builder/page.mdx deleted file mode 100644 index dfbdd4207..000000000 --- a/docs/developer-docs/6.x/reference/api/website-builder/page.mdx +++ /dev/null @@ -1,968 +0,0 @@ ---- -id: yxbpl3dl -title: Page -description: "Website Builder page use cases and event handlers" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What use cases are available in `webiny/api/website-builder/page`? -- Which event handlers can you implement? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/website-builder/page`. Import any of the items below directly from this path in your Webiny extensions. - -**Use Cases** - - - -**Event Handlers** - - - -## Use Cases - -### `CreatePageRevisionFromUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { CreatePageRevisionFromUseCase } from "webiny/api/website-builder/page"; -``` - -**Interface `CreatePageRevisionFromUseCase.Interface`:** - -```typescript -interface CreatePageRevisionFromUseCase.Interface { - execute(params: ICreateWbPageRevisionFromParams): Promise>; -} -``` - -**Types:** - -```typescript -namespace CreatePageRevisionFromUseCase { - type Interface = ICreatePageRevisionFromUseCase; - type Params = ICreateWbPageRevisionFromParams; - type Return = Promise>; - type Error = UseCaseError; - type Page = WbPage; -} -``` - -### `CreatePageUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { CreatePageUseCase } from "webiny/api/website-builder/page"; -``` - -**Interface `CreatePageUseCase.Interface`:** - -```typescript -interface CreatePageUseCase.Interface { - execute(data: ICreateWbPageParams): Promise>; -} -``` - -**Types:** - -```typescript -namespace CreatePageUseCase { - type Interface = ICreatePageUseCase; - type Params = ICreateWbPageParams; - type Return = Promise>; - type Error = UseCaseError; - type Page = WbPage; -} -``` - -### `DeletePageUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { DeletePageUseCase } from "webiny/api/website-builder/page"; -``` - -**Interface `DeletePageUseCase.Interface`:** - -```typescript -interface DeletePageUseCase.Interface { - execute(params: IDeleteWbPageParams): Promise>; -} -``` - -**Types:** - -```typescript -namespace DeletePageUseCase { - type Interface = IDeletePageUseCase; - type Params = IDeleteWbPageParams; - type Return = Promise>; - type Error = UseCaseError; -} -``` - -### `DuplicatePageUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { DuplicatePageUseCase } from "webiny/api/website-builder/page"; -``` - -**Interface `DuplicatePageUseCase.Interface`:** - -```typescript -interface DuplicatePageUseCase.Interface { - execute(params: IDuplicateWbPageParams): Promise>; -} -``` - -**Types:** - -```typescript -namespace DuplicatePageUseCase { - type Interface = IDuplicatePageUseCase; - type Params = IDuplicateWbPageParams; - type Return = Promise>; - type Error = UseCaseError; - type Page = WbPage; -} -``` - -### `GetPageByIdUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { GetPageByIdUseCase } from "webiny/api/website-builder/page"; -``` - -**Interface `GetPageByIdUseCase.Interface`:** - -GetPageById use case interface - -```typescript -interface GetPageByIdUseCase.Interface { - execute(id: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace GetPageByIdUseCase { - type Interface = IGetPageByIdUseCase; - type Return = Promise>; - type Error = UseCaseError; - type Page = WbPage; -} -``` - -### `GetPageByPathUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { GetPageByPathUseCase } from "webiny/api/website-builder/page"; -``` - -**Interface `GetPageByPathUseCase.Interface`:** - -GetPageByPath use case interface - -```typescript -interface GetPageByPathUseCase.Interface { - execute(path: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace GetPageByPathUseCase { - type Interface = IGetPageByPathUseCase; - type Error = UseCaseError; - type Return = Promise>; - type Page = WbPage; -} -``` - -### `GetPageRevisionsUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { GetPageRevisionsUseCase } from "webiny/api/website-builder/page"; -``` - -**Interface `GetPageRevisionsUseCase.Interface`:** - -GetPageRevisions use case interface - -```typescript -interface GetPageRevisionsUseCase.Interface { - execute(entryId: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace GetPageRevisionsUseCase { - type Interface = IGetPageRevisionsUseCase; - type Error = UseCaseError; - type Return = Promise>; - type Page = WbPage; -} -``` - -### `ListPagesUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { ListPagesUseCase } from "webiny/api/website-builder/page"; -``` - -**Interface `ListPagesUseCase.Interface`:** - -ListPages use case interface - -```typescript -interface ListPagesUseCase.Interface { - execute(params: IListPagesParams): Promise>; -} -``` - -**Types:** - -```typescript -namespace ListPagesUseCase { - type Interface = IListPagesUseCase; - type Error = UseCaseError; - type Params = IListPagesParams; - type Return = Promise>; -} -``` - -### `MovePageUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { MovePageUseCase } from "webiny/api/website-builder/page"; -``` - -**Interface `MovePageUseCase.Interface`:** - -```typescript -interface MovePageUseCase.Interface { - execute(params: IMoveWbPageParams): Promise>; -} -``` - -**Types:** - -```typescript -namespace MovePageUseCase { - type Interface = IMovePageUseCase; - type Params = IMoveWbPageParams; - type Return = Promise>; - type Error = UseCaseError; - type Page = WbPage; -} -``` - -### `PublishPageUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { PublishPageUseCase } from "webiny/api/website-builder/page"; -``` - -**Interface `PublishPageUseCase.Interface`:** - -```typescript -interface PublishPageUseCase.Interface { - execute(params: IPublishWbPageParams): Promise>; -} -``` - -**Types:** - -```typescript -namespace PublishPageUseCase { - type Interface = IPublishPageUseCase; - type Params = IPublishWbPageParams; - type Return = Promise>; - type Error = UseCaseError; - type Page = WbPage; -} -``` - -### `UnpublishPageUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { UnpublishPageUseCase } from "webiny/api/website-builder/page"; -``` - -**Interface `UnpublishPageUseCase.Interface`:** - -```typescript -interface UnpublishPageUseCase.Interface { - execute(params: IUnpublishWbPageParams): Promise>; -} -``` - -**Types:** - -```typescript -namespace UnpublishPageUseCase { - type Interface = IUnpublishPageUseCase; - type Params = IUnpublishWbPageParams; - type Return = Promise>; - type Error = UseCaseError; - type Page = WbPage; -} -``` - -### `UpdatePageUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { UpdatePageUseCase } from "webiny/api/website-builder/page"; -``` - -**Interface `UpdatePageUseCase.Interface`:** - -```typescript -interface UpdatePageUseCase.Interface { - execute(id: string, data: IUpdateWbPageData): Promise>; -} -``` - -**Types:** - -```typescript -namespace UpdatePageUseCase { - type Interface = IUpdatePageUseCase; - type UpdateData = IUpdateWbPageData; - type Return = Promise>; - type Error = UseCaseError; - type Page = WbPage; -} -``` - -## Event Handlers - -### `PageAfterCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { PageAfterCreateEventHandler } from "webiny/api/website-builder/page"; -``` - -**Interface `PageAfterCreateEventHandler.Interface`:** - -```typescript -interface PageAfterCreateEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `PageAfterCreatePayload`:** - -```typescript -interface PageAfterCreatePayload { - page: WbPage; -} -``` - -**Types:** - -```typescript -namespace PageAfterCreateEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Page = WbPage; -} -``` - -### `PageAfterCreateRevisionFromEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { PageAfterCreateRevisionFromEventHandler } from "webiny/api/website-builder/page"; -``` - -**Interface `PageAfterCreateRevisionFromEventHandler.Interface`:** - -```typescript -interface PageAfterCreateRevisionFromEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `PageAfterCreateRevisionFromPayload`:** - -```typescript -interface PageAfterCreateRevisionFromPayload { - page: WbPage; -} -``` - -**Types:** - -```typescript -namespace PageAfterCreateRevisionFromEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Page = WbPage; -} -``` - -### `PageAfterDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { PageAfterDeleteEventHandler } from "webiny/api/website-builder/page"; -``` - -**Interface `PageAfterDeleteEventHandler.Interface`:** - -```typescript -interface PageAfterDeleteEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `PageAfterDeletePayload`:** - -```typescript -interface PageAfterDeletePayload { - page: WbPage; -} -``` - -**Types:** - -```typescript -namespace PageAfterDeleteEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Page = WbPage; -} -``` - -### `PageAfterDuplicateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { PageAfterDuplicateEventHandler } from "webiny/api/website-builder/page"; -``` - -**Interface `PageAfterDuplicateEventHandler.Interface`:** - -```typescript -interface PageAfterDuplicateEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `PageAfterDuplicatePayload`:** - -```typescript -interface PageAfterDuplicatePayload { - original: WbPage; - page: WbPage; -} -``` - -**Types:** - -```typescript -namespace PageAfterDuplicateEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Page = WbPage; -} -``` - -### `PageAfterMoveEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { PageAfterMoveEventHandler } from "webiny/api/website-builder/page"; -``` - -**Interface `PageAfterMoveEventHandler.Interface`:** - -```typescript -interface PageAfterMoveEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `PageAfterMovePayload`:** - -```typescript -interface PageAfterMovePayload { - original: WbPage; - input: IMoveWbPageParams; - page: WbPage; -} -``` - -**Types:** - -```typescript -namespace PageAfterMoveEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Page = WbPage; -} -``` - -### `PageAfterPublishEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { PageAfterPublishEventHandler } from "webiny/api/website-builder/page"; -``` - -**Interface `PageAfterPublishEventHandler.Interface`:** - -```typescript -interface PageAfterPublishEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `PageAfterPublishPayload`:** - -```typescript -interface PageAfterPublishPayload { - page: WbPage; -} -``` - -**Types:** - -```typescript -namespace PageAfterPublishEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Page = WbPage; -} -``` - -### `PageAfterUnpublishEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { PageAfterUnpublishEventHandler } from "webiny/api/website-builder/page"; -``` - -**Interface `PageAfterUnpublishEventHandler.Interface`:** - -```typescript -interface PageAfterUnpublishEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `PageAfterUnpublishPayload`:** - -```typescript -interface PageAfterUnpublishPayload { - page: WbPage; -} -``` - -**Types:** - -```typescript -namespace PageAfterUnpublishEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Page = WbPage; -} -``` - -### `PageAfterUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { PageAfterUpdateEventHandler } from "webiny/api/website-builder/page"; -``` - -**Interface `PageAfterUpdateEventHandler.Interface`:** - -```typescript -interface PageAfterUpdateEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `PageAfterUpdatePayload`:** - -```typescript -interface PageAfterUpdatePayload { - original: WbPage; - input: { - id: string; - data: IUpdateWbPageData; - }; - page: WbPage; -} -``` - -**Types:** - -```typescript -namespace PageAfterUpdateEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Page = WbPage; -} -``` - -### `PageBeforeCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { PageBeforeCreateEventHandler } from "webiny/api/website-builder/page"; -``` - -**Interface `PageBeforeCreateEventHandler.Interface`:** - -```typescript -interface PageBeforeCreateEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `PageBeforeCreatePayload`:** - -```typescript -interface PageBeforeCreatePayload { - input: ICreateWbPageParams; -} -``` - -**Types:** - -```typescript -namespace PageBeforeCreateEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Page = WbPage; -} -``` - -### `PageBeforeCreateRevisionFromEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { PageBeforeCreateRevisionFromEventHandler } from "webiny/api/website-builder/page"; -``` - -**Interface `PageBeforeCreateRevisionFromEventHandler.Interface`:** - -```typescript -interface PageBeforeCreateRevisionFromEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `PageBeforeCreateRevisionFromPayload`:** - -```typescript -interface PageBeforeCreateRevisionFromPayload { - params: ICreateWbPageRevisionFromParams; -} -``` - -**Types:** - -```typescript -namespace PageBeforeCreateRevisionFromEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Page = WbPage; -} -``` - -### `PageBeforeDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { PageBeforeDeleteEventHandler } from "webiny/api/website-builder/page"; -``` - -**Interface `PageBeforeDeleteEventHandler.Interface`:** - -```typescript -interface PageBeforeDeleteEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `PageBeforeDeletePayload`:** - -```typescript -interface PageBeforeDeletePayload { - page: WbPage; -} -``` - -**Types:** - -```typescript -namespace PageBeforeDeleteEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Page = WbPage; -} -``` - -### `PageBeforeDuplicateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { PageBeforeDuplicateEventHandler } from "webiny/api/website-builder/page"; -``` - -**Interface `PageBeforeDuplicateEventHandler.Interface`:** - -```typescript -interface PageBeforeDuplicateEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `PageBeforeDuplicatePayload`:** - -```typescript -interface PageBeforeDuplicatePayload { - original: WbPage; -} -``` - -**Types:** - -```typescript -namespace PageBeforeDuplicateEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Page = WbPage; -} -``` - -### `PageBeforeMoveEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { PageBeforeMoveEventHandler } from "webiny/api/website-builder/page"; -``` - -**Interface `PageBeforeMoveEventHandler.Interface`:** - -```typescript -interface PageBeforeMoveEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `PageBeforeMovePayload`:** - -```typescript -interface PageBeforeMovePayload { - original: WbPage; - input: IMoveWbPageParams; -} -``` - -**Types:** - -```typescript -namespace PageBeforeMoveEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Page = WbPage; -} -``` - -### `PageBeforePublishEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { PageBeforePublishEventHandler } from "webiny/api/website-builder/page"; -``` - -**Interface `PageBeforePublishEventHandler.Interface`:** - -```typescript -interface PageBeforePublishEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `PageBeforePublishPayload`:** - -```typescript -interface PageBeforePublishPayload { - page: WbPage; -} -``` - -**Types:** - -```typescript -namespace PageBeforePublishEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Page = WbPage; -} -``` - -### `PageBeforeUnpublishEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { PageBeforeUnpublishEventHandler } from "webiny/api/website-builder/page"; -``` - -**Interface `PageBeforeUnpublishEventHandler.Interface`:** - -```typescript -interface PageBeforeUnpublishEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `PageBeforeUnpublishPayload`:** - -```typescript -interface PageBeforeUnpublishPayload { - page: WbPage; -} -``` - -**Types:** - -```typescript -namespace PageBeforeUnpublishEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Page = WbPage; -} -``` - -### `PageBeforeUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/page` - -```typescript -import { PageBeforeUpdateEventHandler } from "webiny/api/website-builder/page"; -``` - -**Interface `PageBeforeUpdateEventHandler.Interface`:** - -```typescript -interface PageBeforeUpdateEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `PageBeforeUpdatePayload`:** - -```typescript -interface PageBeforeUpdatePayload { - original: WbPage; - input: { - id: string; - data: IUpdateWbPageData; - }; -} -``` - -**Types:** - -```typescript -namespace PageBeforeUpdateEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Page = WbPage; -} -``` diff --git a/docs/developer-docs/6.x/reference/api/website-builder/redirect.ai.txt b/docs/developer-docs/6.x/reference/api/website-builder/redirect.ai.txt deleted file mode 100644 index f8f539a9c..000000000 --- a/docs/developer-docs/6.x/reference/api/website-builder/redirect.ai.txt +++ /dev/null @@ -1,32 +0,0 @@ -AI Context: Redirect (reference/api/website-builder/redirect.mdx) - -Source of Information: -1. packages/webiny/src/api/website-builder/redirect.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/redirects/CreateRedirect/abstractions.ts — originating source -3. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/redirects/DeleteRedirect/abstractions.ts — originating source -4. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/redirects/GetActiveRedirects/abstractions.ts — originating source -5. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/redirects/GetRedirectById/abstractions.ts — originating source -6. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/redirects/InvalidateRedirectsCache/abstractions.ts — originating source -7. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/redirects/ListRedirects/abstractions.ts — originating source -8. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/redirects/MoveRedirect/abstractions.ts — originating source -9. /Users/adrian/dev/wby-next/packages/api-website-builder/src/features/redirects/UpdateRedirect/abstractions.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -CreateRedirectUseCase, RedirectAfterCreateEventHandler, RedirectBeforeCreateEventHandler, DeleteRedirectUseCase, RedirectAfterDeleteEventHandler, RedirectBeforeDeleteEventHandler, GetActiveRedirectsUseCase, GetRedirectByIdUseCase, InvalidateRedirectsCacheUseCase, ListRedirectsUseCase, MoveRedirectUseCase, RedirectAfterMoveEventHandler, RedirectBeforeMoveEventHandler, UpdateRedirectUseCase, RedirectAfterUpdateEventHandler, RedirectBeforeUpdateEventHandler - -Import Path: webiny/api/website-builder/redirect - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/api/website-builder/redirect.mdx b/docs/developer-docs/6.x/reference/api/website-builder/redirect.mdx deleted file mode 100644 index 24f7ea5be..000000000 --- a/docs/developer-docs/6.x/reference/api/website-builder/redirect.mdx +++ /dev/null @@ -1,561 +0,0 @@ ---- -id: yxbpl3dl -title: Redirect -description: "Website Builder redirect use cases and event handlers" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What use cases are available in `webiny/api/website-builder/redirect`? -- Which event handlers can you implement? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/api/website-builder/redirect`. Import any of the items below directly from this path in your Webiny extensions. - -**Use Cases** - - - -**Event Handlers** - - - -## Use Cases - -### `CreateRedirectUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/redirect` - -```typescript -import { CreateRedirectUseCase } from "webiny/api/website-builder/redirect"; -``` - -**Interface `CreateRedirectUseCase.Interface`:** - -```typescript -interface CreateRedirectUseCase.Interface { - execute(data: ICreateWbRedirectData): Promise>; -} -``` - -**Types:** - -```typescript -namespace CreateRedirectUseCase { - type Interface = ICreateRedirectUseCase; - type Params = ICreateWbRedirectData; - type Return = Promise>; - type Error = UseCaseError; - type Redirect = WbRedirect; -} -``` - -### `DeleteRedirectUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/redirect` - -```typescript -import { DeleteRedirectUseCase } from "webiny/api/website-builder/redirect"; -``` - -**Interface `DeleteRedirectUseCase.Interface`:** - -```typescript -interface DeleteRedirectUseCase.Interface { - execute(params: IDeleteWbRedirectParams): Promise>; -} -``` - -**Types:** - -```typescript -namespace DeleteRedirectUseCase { - type Interface = IDeleteRedirectUseCase; - type Params = IDeleteWbRedirectParams; - type Return = Promise>; - type Error = UseCaseError; -} -``` - -### `GetActiveRedirectsUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/redirect` - -```typescript -import { GetActiveRedirectsUseCase } from "webiny/api/website-builder/redirect"; -``` - -**Interface `GetActiveRedirectsUseCase.Interface`:** - -GetActiveRedirects use case interface - -```typescript -interface GetActiveRedirectsUseCase.Interface { - execute(): Promise>; -} -``` - -**Types:** - -```typescript -namespace GetActiveRedirectsUseCase { - type Interface = IGetActiveRedirectsUseCase; - type Return = Promise>; - type Error = UseCaseError; - type Redirect = WbRedirect; -} -``` - -### `GetRedirectByIdUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/redirect` - -```typescript -import { GetRedirectByIdUseCase } from "webiny/api/website-builder/redirect"; -``` - -**Interface `GetRedirectByIdUseCase.Interface`:** - -GetRedirectById use case interface - -```typescript -interface GetRedirectByIdUseCase.Interface { - execute(id: string): Promise>; -} -``` - -**Types:** - -```typescript -namespace GetRedirectByIdUseCase { - type Interface = IGetRedirectByIdUseCase; - type Return = Promise>; - type Error = UseCaseError; - type Redirect = WbRedirect; -} -``` - -### `InvalidateRedirectsCacheUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/redirect` - -```typescript -import { InvalidateRedirectsCacheUseCase } from "webiny/api/website-builder/redirect"; -``` - -**Interface `InvalidateRedirectsCacheUseCase.Interface`:** - -```typescript -interface InvalidateRedirectsCacheUseCase.Interface { - execute(): Promise>; -} -``` - -**Types:** - -```typescript -namespace InvalidateRedirectsCacheUseCase { - type Interface = IInvalidateRedirectsCacheUseCase; - type Return = Promise>; - type Error = UseCaseError; -} -``` - -### `ListRedirectsUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/redirect` - -```typescript -import { ListRedirectsUseCase } from "webiny/api/website-builder/redirect"; -``` - -**Interface `ListRedirectsUseCase.Interface`:** - -```typescript -interface ListRedirectsUseCase.Interface { - execute(params: ListWbRedirectsParams): Promise>; -} -``` - -**Types:** - -```typescript -namespace ListRedirectsUseCase { - type Interface = IListRedirectsUseCase; - type Params = ListWbRedirectsParams; - type Return = Promise>; - type Error = UseCaseError; - type Redirect = WbRedirect; -} -``` - -### `MoveRedirectUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/redirect` - -```typescript -import { MoveRedirectUseCase } from "webiny/api/website-builder/redirect"; -``` - -**Interface `MoveRedirectUseCase.Interface`:** - -```typescript -interface MoveRedirectUseCase.Interface { - execute(params: IMoveWbRedirectParams): Promise>; -} -``` - -**Types:** - -```typescript -namespace MoveRedirectUseCase { - type Interface = IMoveRedirectUseCase; - type Params = IMoveWbRedirectParams; - type Return = Promise>; - type Error = UseCaseError; - type Redirect = WbRedirect; -} -``` - -### `UpdateRedirectUseCase` - -**Use Case Abstraction** — imported from `webiny/api/website-builder/redirect` - -```typescript -import { UpdateRedirectUseCase } from "webiny/api/website-builder/redirect"; -``` - -**Interface `UpdateRedirectUseCase.Interface`:** - -```typescript -interface UpdateRedirectUseCase.Interface { - execute(id: string, data: IUpdateWbRedirectData): Promise>; -} -``` - -**Types:** - -```typescript -namespace UpdateRedirectUseCase { - type Interface = IUpdateRedirectUseCase; - type UpdateData = IUpdateWbRedirectData; - type Return = Promise>; - type Error = UseCaseError; - type Redirect = WbRedirect; -} -``` - -## Event Handlers - -### `RedirectAfterCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/redirect` - -```typescript -import { RedirectAfterCreateEventHandler } from "webiny/api/website-builder/redirect"; -``` - -**Interface `RedirectAfterCreateEventHandler.Interface`:** - -```typescript -interface RedirectAfterCreateEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `RedirectAfterCreatePayload`:** - -```typescript -interface RedirectAfterCreatePayload { - redirect: WbRedirect; -} -``` - -**Types:** - -```typescript -namespace RedirectAfterCreateEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Redirect = WbRedirect; -} -``` - -### `RedirectAfterDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/redirect` - -```typescript -import { RedirectAfterDeleteEventHandler } from "webiny/api/website-builder/redirect"; -``` - -**Interface `RedirectAfterDeleteEventHandler.Interface`:** - -```typescript -interface RedirectAfterDeleteEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `RedirectAfterDeletePayload`:** - -```typescript -interface RedirectAfterDeletePayload { - redirect: WbRedirect; -} -``` - -**Types:** - -```typescript -namespace RedirectAfterDeleteEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Redirect = WbRedirect; -} -``` - -### `RedirectAfterMoveEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/redirect` - -```typescript -import { RedirectAfterMoveEventHandler } from "webiny/api/website-builder/redirect"; -``` - -**Interface `RedirectAfterMoveEventHandler.Interface`:** - -```typescript -interface RedirectAfterMoveEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `RedirectAfterMovePayload`:** - -```typescript -interface RedirectAfterMovePayload { - original: WbRedirect; - input: IMoveWbRedirectParams; - redirect: WbRedirect; -} -``` - -**Types:** - -```typescript -namespace RedirectAfterMoveEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Redirect = WbRedirect; -} -``` - -### `RedirectAfterUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/redirect` - -```typescript -import { RedirectAfterUpdateEventHandler } from "webiny/api/website-builder/redirect"; -``` - -**Interface `RedirectAfterUpdateEventHandler.Interface`:** - -```typescript -interface RedirectAfterUpdateEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `RedirectAfterUpdatePayload`:** - -```typescript -interface RedirectAfterUpdatePayload { - original: WbRedirect; - input: { - id: string; - data: IUpdateWbRedirectData; - }; - redirect: WbRedirect; -} -``` - -**Types:** - -```typescript -namespace RedirectAfterUpdateEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Redirect = WbRedirect; -} -``` - -### `RedirectBeforeCreateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/redirect` - -```typescript -import { RedirectBeforeCreateEventHandler } from "webiny/api/website-builder/redirect"; -``` - -**Interface `RedirectBeforeCreateEventHandler.Interface`:** - -```typescript -interface RedirectBeforeCreateEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `RedirectBeforeCreatePayload`:** - -```typescript -interface RedirectBeforeCreatePayload { - input: ICreateWbRedirectData; -} -``` - -**Types:** - -```typescript -namespace RedirectBeforeCreateEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Redirect = WbRedirect; -} -``` - -### `RedirectBeforeDeleteEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/redirect` - -```typescript -import { RedirectBeforeDeleteEventHandler } from "webiny/api/website-builder/redirect"; -``` - -**Interface `RedirectBeforeDeleteEventHandler.Interface`:** - -```typescript -interface RedirectBeforeDeleteEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `RedirectBeforeDeletePayload`:** - -```typescript -interface RedirectBeforeDeletePayload { - redirect: WbRedirect; -} -``` - -**Types:** - -```typescript -namespace RedirectBeforeDeleteEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Redirect = WbRedirect; -} -``` - -### `RedirectBeforeMoveEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/redirect` - -```typescript -import { RedirectBeforeMoveEventHandler } from "webiny/api/website-builder/redirect"; -``` - -**Interface `RedirectBeforeMoveEventHandler.Interface`:** - -```typescript -interface RedirectBeforeMoveEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `RedirectBeforeMovePayload`:** - -```typescript -interface RedirectBeforeMovePayload { - original: WbRedirect; - input: IMoveWbRedirectParams; -} -``` - -**Types:** - -```typescript -namespace RedirectBeforeMoveEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Redirect = WbRedirect; -} -``` - -### `RedirectBeforeUpdateEventHandler` - -**Event Handler Abstraction** — imported from `webiny/api/website-builder/redirect` - -```typescript -import { RedirectBeforeUpdateEventHandler } from "webiny/api/website-builder/redirect"; -``` - -**Interface `RedirectBeforeUpdateEventHandler.Interface`:** - -```typescript -interface RedirectBeforeUpdateEventHandler.Interface { - handle(event: DomainEvent): Promise; -} -``` - -**Event payload `RedirectBeforeUpdatePayload`:** - -```typescript -interface RedirectBeforeUpdatePayload { - original: WbRedirect; - input: { - id: string; - data: IUpdateWbRedirectData; - }; -} -``` - -**Types:** - -```typescript -namespace RedirectBeforeUpdateEventHandler { - type Interface = IEventHandler>; - type Event = DomainEvent; - type Redirect = WbRedirect; -} -``` diff --git a/docs/developer-docs/6.x/reference/cli/command.ai.txt b/docs/developer-docs/6.x/reference/cli/command.ai.txt deleted file mode 100644 index f27041e88..000000000 --- a/docs/developer-docs/6.x/reference/cli/command.ai.txt +++ /dev/null @@ -1,25 +0,0 @@ -AI Context: Command (reference/cli/command.mdx) - -Source of Information: -1. packages/webiny/src/cli/command.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/cli-core/src/abstractions/features/CliCommand.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -CliCommandFactory - -Import Path: webiny/cli/command - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/cli/command.mdx b/docs/developer-docs/6.x/reference/cli/command.mdx deleted file mode 100644 index 3c3df8e89..000000000 --- a/docs/developer-docs/6.x/reference/cli/command.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: y2xpl2nv -title: Command -description: "CLI command factory abstraction" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- How to use the builder and factory APIs? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/cli/command`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `CliCommandFactory` - -**Abstraction** — imported from `webiny/cli/command` - -```typescript -import { CliCommandFactory } from "webiny/cli/command"; -``` - -**Types:** - -```typescript -namespace CliCommandFactory { - type Interface = ICliCommand; - type ParamDefinition = ICliCommandParamDefinition; - type OptionDefinition = ICliCommandOptionDefinition; - type CommandDefinition = ICliCommandDefinition; -} -``` diff --git a/docs/developer-docs/6.x/reference/cli/overview.ai.txt b/docs/developer-docs/6.x/reference/cli/overview.ai.txt deleted file mode 100644 index e4b07e228..000000000 --- a/docs/developer-docs/6.x/reference/cli/overview.ai.txt +++ /dev/null @@ -1,26 +0,0 @@ -AI Context: CLI (reference/cli/index.mdx) - -Source of Information: -1. packages/webiny/src/cli/index.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/cli-core/src/abstractions/services/LoggerService.ts — originating source -3. /Users/adrian/dev/wby-next/packages/cli-core/src/abstractions/services/UiService.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -Logger, Ui - -Import Path: webiny/cli/index - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/cli/overview.mdx b/docs/developer-docs/6.x/reference/cli/overview.mdx deleted file mode 100644 index 25b435229..000000000 --- a/docs/developer-docs/6.x/reference/cli/overview.mdx +++ /dev/null @@ -1,88 +0,0 @@ ---- -id: y2xpl2lu -title: CLI -description: "CLI-scoped Logger and Ui abstractions" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/cli/index`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/cli/index`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `Logger` - -**Abstraction** — imported from `webiny/cli/index` - -```typescript -import { Logger } from "webiny/cli/index"; -``` - -**Interface `Logger.Interface`:** - -```typescript -interface Logger.Interface { - trace(objOrMsg: object | string, ...args: any[]): void; - debug(objOrMsg: object | string, ...args: any[]): void; - info(objOrMsg: object | string, ...args: any[]): void; - warn(objOrMsg: object | string, ...args: any[]): void; - error(objOrMsg: object | string, ...args: any[]): void; - fatal(objOrMsg: object | string, ...args: any[]): void; - log(objOrMsg: object | string, ...args: any[]): void; -} -``` - -**Types:** - -```typescript -namespace Logger { - type Interface = ILoggerService; -} -``` - -## `Ui` - -**Abstraction** — imported from `webiny/cli/index` - -```typescript -import { Ui } from "webiny/cli/index"; -``` - -**Interface `Ui.Interface`:** - -```typescript -interface Ui.Interface { - raw(text: string): void; - text(text: string): void; - textBold(text: string): void; - emptyLine(): void; - info(text: string, ...args: any[]): void; - success(text: string, ...args: any[]): void; - error(text: string, ...args: any[]): void; - warning(text: string, ...args: any[]): void; - debug(text: string, ...args: any[]): void; -} -``` - -**Types:** - -```typescript -namespace Ui { - type Interface = IUiService; -} -``` diff --git a/docs/developer-docs/6.x/reference/extensions.ai.txt b/docs/developer-docs/6.x/reference/extensions.ai.txt deleted file mode 100644 index c0a13101c..000000000 --- a/docs/developer-docs/6.x/reference/extensions.ai.txt +++ /dev/null @@ -1,29 +0,0 @@ -AI Context: Extensions (reference/extensions.mdx) - -Source of Information: -1. packages/webiny/src/extensions.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/project-aws/src/api.ts — originating source -3. /Users/adrian/dev/wby-next/packages/project-aws/src/admin.ts — originating source -4. /Users/adrian/dev/wby-next/packages/project-aws/src/cli.ts — originating source -5. /Users/adrian/dev/wby-next/packages/project-aws/src/infra.ts — originating source -6. /Users/adrian/dev/wby-next/packages/project-aws/src/project.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -Api, Admin, Cli, Infra, Project - -Import Path: webiny/extensions - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/extensions.mdx b/docs/developer-docs/6.x/reference/extensions.mdx deleted file mode 100644 index 716a0f757..000000000 --- a/docs/developer-docs/6.x/reference/extensions.mdx +++ /dev/null @@ -1,581 +0,0 @@ ---- -id: zxh0zw5z -title: Extensions -description: "Reference for all webiny/extensions exports — React components used in webiny.config.tsx to wire extensions into the project." ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What extension components are available in `webiny/extensions`? -- What parameters does each extension accept? -- How to use each extension in your `webiny.config.tsx`? - - - -## Overview - -The `webiny/extensions` package exports React components used inside `webiny.config.tsx` to wire extensions into your Webiny project. Each component corresponds to a `defineExtension()` call in the Webiny source and accepts typed props defined by its Zod schema. - -**Api** - - - -**Admin** - - - -**Cli** - - - -**Infra** - - - -**Project** - - - -## Api - -### `Extension` - -Add any API extension. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Api } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `BuildParam` - -Add build-time parameter to API app. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Api } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -## Admin - -### `Extension` - -Extend the Admin application with custom functionality. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Admin } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `BuildParam` - -Add build-time parameter to Admin app. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Admin } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -## Cli - -### `Command` - -An extension for defining CLI commands. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Cli } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -## Infra - -### `Vpc` - -Apply VPC settings to AWS resources during deployment. - -Can only be used **once**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `BlueGreenDeployments` - -Enable blue/green deployments for your Webiny project. - -Can only be used **once**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `OpenSearch` - -Enable and configure Opensearch integration with project-level setup. - -Can only be used **once**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `PulumiResourceNamePrefix` - -Adjust the prefix for Pulumi resource names (default: "wby-"). - -Can only be used **once**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `ProductionEnvironments` - -Provide names for environments that are considered production environments. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `EnvVar` - -Set an environment variable in the project context. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Aws.DefaultRegion` - -Set the default AWS region for the project. - -Can only be used **once**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Aws.Tags` - -Apply tags to AWS resources during deployment. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Admin.BeforeBuild` - -Add custom logic to be executed before the ADMIN build process. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Admin.BeforeDeploy` - -Add custom logic to be executed before the ADMIN deployment process. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Admin.BeforeWatch` - -Add custom logic to be executed before the Admin watch process. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Admin.AfterBuild` - -Add custom logic to be executed after the ADMIN build process. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Admin.AfterDeploy` - -Add custom logic to be executed after the ADMIN deployment process. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Admin.Pulumi` - -Modify Admin app's cloud infrastructure using Pulumi. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Admin.CustomDomains` - -Configure custom domains for the Admin app. - -Can only be used **once**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Admin.StackOutputValue` - -Add custom output values to the Admin stack. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Api.BeforeBuild` - -Add custom logic to be executed before the API build process. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Api.BeforeDeploy` - -Add custom logic to be executed before the API deployment process. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Api.BeforeWatch` - -Add custom logic to be executed before the API watch process. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Api.AfterBuild` - -Add custom logic to be executed after the API build process. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Api.AfterDeploy` - -Add custom logic to be executed after the API deployment process. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Api.Pulumi` - -Modify Api app's cloud infrastructure using Pulumi. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Api.StackOutputValue` - -Add custom output values to the Api stack. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Api.LambdaFunction` - -Add a custom Lambda function to the API app. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Core.BeforeBuild` - -Add custom logic to be executed before the CORE build process. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Core.BeforeDeploy` - -Add custom logic to be executed before the CORE deployment process. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Core.BeforeWatch` - -Add custom logic to be executed before the CORE watch process. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Core.AfterBuild` - -Add custom logic to be executed after the CORE build process. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Core.AfterDeploy` - -Add custom logic to be executed after the CORE deployment process. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Core.Pulumi` - -Modify Core app's cloud infrastructure using Pulumi. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Core.StackOutputValue` - -Add custom output values to the Core stack. - -Can be used **multiple times**. - -```tsx webiny.config.tsx -import { Infra } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -## Project - -### `Id` - -An extension for defining the project ID. - -Can only be used **once**. - -```tsx webiny.config.tsx -import { Project } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `Telemetry` - -This extension allows you to enable or disable telemetry for the project. - -Can only be used **once**. - -```tsx webiny.config.tsx -import { Project } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `AutoInstall` - -Auto-install Webiny with admin user credentials on first deploy. - -Can only be used **once**. - -```tsx webiny.config.tsx -import { Project } from "webiny/extensions"; - -export const Extensions = () => ; -``` - -### `FeatureFlags` - -Enable or disable WCP features. - -Can only be used **once**. - -```tsx webiny.config.tsx -import { Project } from "webiny/extensions"; - -export const Extensions = () => ; -``` diff --git a/docs/developer-docs/6.x/reference/infra/admin.ai.txt b/docs/developer-docs/6.x/reference/infra/admin.ai.txt deleted file mode 100644 index 82b32c1dd..000000000 --- a/docs/developer-docs/6.x/reference/infra/admin.ai.txt +++ /dev/null @@ -1,31 +0,0 @@ -AI Context: Admin (reference/infra/admin.mdx) - -Source of Information: -1. packages/webiny/src/infra/admin.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/AdminAfterBuild.ts — originating source -3. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/AdminBeforeBuild.ts — originating source -4. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/AdminAfterDeploy.ts — originating source -5. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/AdminBeforeDeploy.ts — originating source -6. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/AdminBeforeWatch.ts — originating source -7. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/pulumi/AdminPulumi.ts — originating source -8. /Users/adrian/dev/wby-next/packages/project-aws/src/abstractions/services/AdminStackOutputService.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -AdminAfterBuildHook, AdminBeforeBuildHook, AdminAfterDeployHook, AdminBeforeDeployHook, AdminBeforeWatchHook, AdminPulumi, GetAdminStackOutput - -Import Path: webiny/infra/admin - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/infra/admin.mdx b/docs/developer-docs/6.x/reference/infra/admin.mdx deleted file mode 100644 index 52b6ce44a..000000000 --- a/docs/developer-docs/6.x/reference/infra/admin.mdx +++ /dev/null @@ -1,198 +0,0 @@ ---- -id: aw5mcmev -title: Admin -description: "Admin infrastructure lifecycle hooks and Pulumi abstraction" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/infra/admin`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/infra/admin`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `AdminAfterBuildHook` - -**Abstraction** — imported from `webiny/infra/admin` - -```typescript -import { AdminAfterBuildHook } from "webiny/infra/admin"; -``` - -**Interface `AdminAfterBuildHook.Interface`:** - -```typescript -interface AdminAfterBuildHook.Interface { - execute(params: BuildApp.Params): void | Promise; -} -``` - -**Types:** - -```typescript -namespace AdminAfterBuildHook { - type Interface = IAdminAfterBuild; - type Params = BuildApp.Params; -} -``` - -## `AdminAfterDeployHook` - -**Abstraction** — imported from `webiny/infra/admin` - -```typescript -import { AdminAfterDeployHook } from "webiny/infra/admin"; -``` - -**Interface `AdminAfterDeployHook.Interface`:** - -```typescript -interface AdminAfterDeployHook.Interface { - execute(params: DeployApp.Params): void | Promise; -} -``` - -**Types:** - -```typescript -namespace AdminAfterDeployHook { - type Interface = IAdminAfterDeploy; - type Params = DeployApp.Params; -} -``` - -## `AdminBeforeBuildHook` - -**Abstraction** — imported from `webiny/infra/admin` - -```typescript -import { AdminBeforeBuildHook } from "webiny/infra/admin"; -``` - -**Interface `AdminBeforeBuildHook.Interface`:** - -```typescript -interface AdminBeforeBuildHook.Interface { - execute(params: BuildApp.Params): void | Promise; -} -``` - -**Types:** - -```typescript -namespace AdminBeforeBuildHook { - type Interface = IAdminBeforeBuild; - type Params = BuildApp.Params; -} -``` - -## `AdminBeforeDeployHook` - -**Abstraction** — imported from `webiny/infra/admin` - -```typescript -import { AdminBeforeDeployHook } from "webiny/infra/admin"; -``` - -**Interface `AdminBeforeDeployHook.Interface`:** - -```typescript -interface AdminBeforeDeployHook.Interface { - execute(params: DeployApp.Params): void | Promise; -} -``` - -**Types:** - -```typescript -namespace AdminBeforeDeployHook { - type Interface = IAdminBeforeDeploy; - type Params = DeployApp.Params; -} -``` - -## `AdminBeforeWatchHook` - -**Abstraction** — imported from `webiny/infra/admin` - -```typescript -import { AdminBeforeWatchHook } from "webiny/infra/admin"; -``` - -**Interface `AdminBeforeWatchHook.Interface`:** - -```typescript -interface AdminBeforeWatchHook.Interface { - execute(params: Watch.WatchWithAppParams): void | Promise; -} -``` - -**Types:** - -```typescript -namespace AdminBeforeWatchHook { - type Interface = IAdminBeforeWatch; - type Params = Watch.WatchWithAppParams; -} -``` - -## `AdminPulumi` - -**Abstraction** — imported from `webiny/infra/admin` - -```typescript -import { AdminPulumi } from "webiny/infra/admin"; -``` - -**Types:** - -```typescript -namespace AdminPulumi { - type Interface = IAdminPulumi; - type Params = unknown; -} -``` - -## `GetAdminStackOutput` - -**Abstraction** — imported from `webiny/infra/admin` - -```typescript -import { GetAdminStackOutput } from "webiny/infra/admin"; -``` - -**Interface `GetAdminStackOutput.Interface`:** - -```typescript -interface GetAdminStackOutput.Interface { - execute(): Promise; -} -``` - -**Types:** - -```typescript -namespace GetAdminStackOutput { - type Interface = IAdminStackOutputService; - type Output = IAdminStackOutput; -} -``` diff --git a/docs/developer-docs/6.x/reference/infra/api.ai.txt b/docs/developer-docs/6.x/reference/infra/api.ai.txt deleted file mode 100644 index f0d65c33f..000000000 --- a/docs/developer-docs/6.x/reference/infra/api.ai.txt +++ /dev/null @@ -1,31 +0,0 @@ -AI Context: API (reference/infra/api.mdx) - -Source of Information: -1. packages/webiny/src/infra/api.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/ApiAfterBuild.ts — originating source -3. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/ApiBeforeBuild.ts — originating source -4. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/ApiAfterDeploy.ts — originating source -5. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/ApiBeforeDeploy.ts — originating source -6. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/ApiBeforeWatch.ts — originating source -7. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/pulumi/ApiPulumi.ts — originating source -8. /Users/adrian/dev/wby-next/packages/project-aws/src/abstractions/services/ApiStackOutputService.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -ApiAfterBuildHook, ApiBeforeBuildHook, ApiAfterDeployHook, ApiBeforeDeployHook, ApiBeforeWatchHook, ApiPulumi, GetApiStackOutput - -Import Path: webiny/infra/api - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/infra/api.mdx b/docs/developer-docs/6.x/reference/infra/api.mdx deleted file mode 100644 index cb9614e18..000000000 --- a/docs/developer-docs/6.x/reference/infra/api.mdx +++ /dev/null @@ -1,198 +0,0 @@ ---- -id: aw5mcmev -title: API -description: "API infrastructure lifecycle hooks and Pulumi abstraction" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/infra/api`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/infra/api`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `ApiAfterBuildHook` - -**Abstraction** — imported from `webiny/infra/api` - -```typescript -import { ApiAfterBuildHook } from "webiny/infra/api"; -``` - -**Interface `ApiAfterBuildHook.Interface`:** - -```typescript -interface ApiAfterBuildHook.Interface { - execute(params: BuildApp.Params): void | Promise; -} -``` - -**Types:** - -```typescript -namespace ApiAfterBuildHook { - type Interface = IApiAfterBuild; - type Params = BuildApp.Params; -} -``` - -## `ApiAfterDeployHook` - -**Abstraction** — imported from `webiny/infra/api` - -```typescript -import { ApiAfterDeployHook } from "webiny/infra/api"; -``` - -**Interface `ApiAfterDeployHook.Interface`:** - -```typescript -interface ApiAfterDeployHook.Interface { - execute(params: DeployApp.Params): void | Promise; -} -``` - -**Types:** - -```typescript -namespace ApiAfterDeployHook { - type Interface = IApiAfterDeploy; - type Params = DeployApp.Params; -} -``` - -## `ApiBeforeBuildHook` - -**Abstraction** — imported from `webiny/infra/api` - -```typescript -import { ApiBeforeBuildHook } from "webiny/infra/api"; -``` - -**Interface `ApiBeforeBuildHook.Interface`:** - -```typescript -interface ApiBeforeBuildHook.Interface { - execute(params: BuildApp.Params): void | Promise; -} -``` - -**Types:** - -```typescript -namespace ApiBeforeBuildHook { - type Interface = IApiBeforeBuild; - type Params = BuildApp.Params; -} -``` - -## `ApiBeforeDeployHook` - -**Abstraction** — imported from `webiny/infra/api` - -```typescript -import { ApiBeforeDeployHook } from "webiny/infra/api"; -``` - -**Interface `ApiBeforeDeployHook.Interface`:** - -```typescript -interface ApiBeforeDeployHook.Interface { - execute(params: DeployApp.Params): void | Promise; -} -``` - -**Types:** - -```typescript -namespace ApiBeforeDeployHook { - type Interface = IApiBeforeDeploy; - type Params = DeployApp.Params; -} -``` - -## `ApiBeforeWatchHook` - -**Abstraction** — imported from `webiny/infra/api` - -```typescript -import { ApiBeforeWatchHook } from "webiny/infra/api"; -``` - -**Interface `ApiBeforeWatchHook.Interface`:** - -```typescript -interface ApiBeforeWatchHook.Interface { - execute(params: Watch.WatchWithAppParams): void | Promise; -} -``` - -**Types:** - -```typescript -namespace ApiBeforeWatchHook { - type Interface = IApiBeforeWatch; - type Params = Watch.WatchWithAppParams; -} -``` - -## `ApiPulumi` - -**Abstraction** — imported from `webiny/infra/api` - -```typescript -import { ApiPulumi } from "webiny/infra/api"; -``` - -**Types:** - -```typescript -namespace ApiPulumi { - type Interface = IApiPulumi; - type Params = unknown; -} -``` - -## `GetApiStackOutput` - -**Abstraction** — imported from `webiny/infra/api` - -```typescript -import { GetApiStackOutput } from "webiny/infra/api"; -``` - -**Interface `GetApiStackOutput.Interface`:** - -```typescript -interface GetApiStackOutput.Interface { - execute(): Promise; -} -``` - -**Types:** - -```typescript -namespace GetApiStackOutput { - type Interface = IApiStackOutputService; - type Output = IApiStackOutput; -} -``` diff --git a/docs/developer-docs/6.x/reference/infra/core.ai.txt b/docs/developer-docs/6.x/reference/infra/core.ai.txt deleted file mode 100644 index 1ed9c8652..000000000 --- a/docs/developer-docs/6.x/reference/infra/core.ai.txt +++ /dev/null @@ -1,30 +0,0 @@ -AI Context: Core (reference/infra/core.mdx) - -Source of Information: -1. packages/webiny/src/infra/core.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/CoreAfterBuild.ts — originating source -3. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/CoreBeforeBuild.ts — originating source -4. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/CoreAfterDeploy.ts — originating source -5. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/CoreBeforeDeploy.ts — originating source -6. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/pulumi/CorePulumi.ts — originating source -7. /Users/adrian/dev/wby-next/packages/project-aws/src/abstractions/services/CoreStackOutputService.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -CoreAfterBuildHook, CoreBeforeBuildHook, CoreAfterDeployHook, CoreBeforeDeployHook, CorePulumi, GetCoreStackOutput - -Import Path: webiny/infra/core - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/infra/core.mdx b/docs/developer-docs/6.x/reference/infra/core.mdx deleted file mode 100644 index 1951f6482..000000000 --- a/docs/developer-docs/6.x/reference/infra/core.mdx +++ /dev/null @@ -1,172 +0,0 @@ ---- -id: aw5mcmev -title: Core -description: "Core infrastructure lifecycle hooks and Pulumi abstraction" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/infra/core`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/infra/core`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `CoreAfterBuildHook` - -**Abstraction** — imported from `webiny/infra/core` - -```typescript -import { CoreAfterBuildHook } from "webiny/infra/core"; -``` - -**Interface `CoreAfterBuildHook.Interface`:** - -```typescript -interface CoreAfterBuildHook.Interface { - execute(params: BuildApp.Params): void | Promise; -} -``` - -**Types:** - -```typescript -namespace CoreAfterBuildHook { - type Interface = ICoreAfterBuild; - type Params = BuildApp.Params; -} -``` - -## `CoreAfterDeployHook` - -**Abstraction** — imported from `webiny/infra/core` - -```typescript -import { CoreAfterDeployHook } from "webiny/infra/core"; -``` - -**Interface `CoreAfterDeployHook.Interface`:** - -```typescript -interface CoreAfterDeployHook.Interface { - execute(params: DeployApp.Params): void | Promise; -} -``` - -**Types:** - -```typescript -namespace CoreAfterDeployHook { - type Interface = ICoreAfterDeploy; - type Params = DeployApp.Params; -} -``` - -## `CoreBeforeBuildHook` - -**Abstraction** — imported from `webiny/infra/core` - -```typescript -import { CoreBeforeBuildHook } from "webiny/infra/core"; -``` - -**Interface `CoreBeforeBuildHook.Interface`:** - -```typescript -interface CoreBeforeBuildHook.Interface { - execute(params: BuildApp.Params): void | Promise; -} -``` - -**Types:** - -```typescript -namespace CoreBeforeBuildHook { - type Interface = ICoreBeforeBuild; - type Params = BuildApp.Params; -} -``` - -## `CoreBeforeDeployHook` - -**Abstraction** — imported from `webiny/infra/core` - -```typescript -import { CoreBeforeDeployHook } from "webiny/infra/core"; -``` - -**Interface `CoreBeforeDeployHook.Interface`:** - -```typescript -interface CoreBeforeDeployHook.Interface { - execute(params: DeployApp.Params): void | Promise; -} -``` - -**Types:** - -```typescript -namespace CoreBeforeDeployHook { - type Interface = ICoreBeforeDeploy; - type Params = DeployApp.Params; -} -``` - -## `CorePulumi` - -**Abstraction** — imported from `webiny/infra/core` - -```typescript -import { CorePulumi } from "webiny/infra/core"; -``` - -**Types:** - -```typescript -namespace CorePulumi { - type Interface = ICorePulumi; - type Params = unknown; -} -``` - -## `GetCoreStackOutput` - -**Abstraction** — imported from `webiny/infra/core` - -```typescript -import { GetCoreStackOutput } from "webiny/infra/core"; -``` - -**Interface `GetCoreStackOutput.Interface`:** - -```typescript -interface GetCoreStackOutput.Interface { - execute(): Promise; -} -``` - -**Types:** - -```typescript -namespace GetCoreStackOutput { - type Interface = ICoreStackOutputService; - type Output = ICoreStackOutput; -} -``` diff --git a/docs/developer-docs/6.x/reference/infra/overview.ai.txt b/docs/developer-docs/6.x/reference/infra/overview.ai.txt deleted file mode 100644 index a47be40ab..000000000 --- a/docs/developer-docs/6.x/reference/infra/overview.ai.txt +++ /dev/null @@ -1,33 +0,0 @@ -AI Context: Infrastructure (reference/infra/index.mdx) - -Source of Information: -1. packages/webiny/src/infra/index.ts — barrel re-export file -2. /Users/adrian/dev/wby-next/packages/project/src/abstractions/services/LoggerService.ts — originating source -3. /Users/adrian/dev/wby-next/packages/project/src/abstractions/services/UiService.ts — originating source -4. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/AfterBuild.ts — originating source -5. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/BeforeBuild.ts — originating source -6. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/AfterDeploy.ts — originating source -7. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/BeforeDeploy.ts — originating source -8. /Users/adrian/dev/wby-next/packages/project/src/abstractions/features/hooks/BeforeWatch.ts — originating source -9. /Users/adrian/dev/wby-next/packages/project/src/extensions/EnvVar.ts — originating source -10. /Users/adrian/dev/wby-next/packages/project-aws/src/abstractions/index.ts — originating source - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -Logger, Ui, AfterBuildHook, BeforeBuildHook, AfterDeployHook, BeforeDeployHook, BeforeWatchHook, EnvVar, ApiStackOutput, CoreStackOutput, ApiGqlClient, AdminStackOutput, InvokeLambdaFunction - -Import Path: webiny/infra/index - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those diff --git a/docs/developer-docs/6.x/reference/infra/overview.mdx b/docs/developer-docs/6.x/reference/infra/overview.mdx deleted file mode 100644 index 88e6188e1..000000000 --- a/docs/developer-docs/6.x/reference/infra/overview.mdx +++ /dev/null @@ -1,377 +0,0 @@ ---- -id: aw5mcmev -title: Infrastructure -description: "Infrastructure primitives: Logger, Ui, lifecycle hooks" ---- - -import { Alert } from "@/components/Alert"; -import { SymbolList } from "@/components/SymbolList"; - - - -- What is exported from `webiny/infra/index`? -- How to import and use each exported item? - - - -## Overview - -This page documents everything exported from `webiny/infra/index`. Import any of the items below directly from this path in your Webiny extensions. - - - -## `AdminStackOutput` - -**Abstraction** — imported from `webiny/infra/index` - -```typescript -import { AdminStackOutput } from "webiny/infra/index"; -``` - -**Interface `AdminStackOutput.Interface`:** - -```typescript -interface AdminStackOutput.Interface { - execute(): Promise; -} -``` - -**Types:** - -```typescript -namespace AdminStackOutput { - type Interface = IAdminStackOutputService; - type Output = IAdminStackOutput; -} -``` - -## `AfterBuildHook` - -**Abstraction** — imported from `webiny/infra/index` - -```typescript -import { AfterBuildHook } from "webiny/infra/index"; -``` - -**Interface `AfterBuildHook.Interface`:** - -```typescript -interface AfterBuildHook.Interface { - execute(params: BuildApp.Params): void | Promise; -} -``` - -**Types:** - -```typescript -namespace AfterBuildHook { - type Interface = IAfterBuild; - type Params = BuildApp.Params; -} -``` - -## `AfterDeployHook` - -**Abstraction** — imported from `webiny/infra/index` - -```typescript -import { AfterDeployHook } from "webiny/infra/index"; -``` - -**Interface `AfterDeployHook.Interface`:** - -```typescript -interface AfterDeployHook.Interface { - execute(params: DeployApp.Params): void | Promise; -} -``` - -**Types:** - -```typescript -namespace AfterDeployHook { - type Interface = IAfterDeploy; - type Params = DeployApp.Params; -} -``` - -## `ApiGqlClient` - -**Abstraction** — imported from `webiny/infra/index` - -```typescript -import { ApiGqlClient } from "webiny/infra/index"; -``` - -**Interface `ApiGqlClient.Interface`:** - -```typescript -interface ApiGqlClient.Interface { - query(params: { - query: string; - variables?: Record; - }): Promise>; - mutation(params: { - mutation: string; - variables?: Record; - }): Promise>; -} -``` - -**Types:** - -```typescript -namespace ApiGqlClient { - type Interface = IApiGqlClient; - type Response = IApiGqlClientResponse; -} -``` - -## `ApiStackOutput` - -**Abstraction** — imported from `webiny/infra/index` - -```typescript -import { ApiStackOutput } from "webiny/infra/index"; -``` - -**Interface `ApiStackOutput.Interface`:** - -```typescript -interface ApiStackOutput.Interface { - execute(): Promise; -} -``` - -**Types:** - -```typescript -namespace ApiStackOutput { - type Interface = IApiStackOutputService; - type Output = IApiStackOutput; -} -``` - -## `BeforeBuildHook` - -**Abstraction** — imported from `webiny/infra/index` - -```typescript -import { BeforeBuildHook } from "webiny/infra/index"; -``` - -**Interface `BeforeBuildHook.Interface`:** - -```typescript -interface BeforeBuildHook.Interface { - execute(params: BuildApp.Params): void | Promise; -} -``` - -**Types:** - -```typescript -namespace BeforeBuildHook { - type Interface = IBeforeBuild; - type Params = BuildApp.Params; -} -``` - -## `BeforeDeployHook` - -**Abstraction** — imported from `webiny/infra/index` - -```typescript -import { BeforeDeployHook } from "webiny/infra/index"; -``` - -**Interface `BeforeDeployHook.Interface`:** - -```typescript -interface BeforeDeployHook.Interface { - execute(params: DeployApp.Params): void | Promise; -} -``` - -**Types:** - -```typescript -namespace BeforeDeployHook { - type Interface = IBeforeDeploy; - type Params = DeployApp.Params; -} -``` - -## `BeforeWatchHook` - -**Abstraction** — imported from `webiny/infra/index` - -```typescript -import { BeforeWatchHook } from "webiny/infra/index"; -``` - -**Interface `BeforeWatchHook.Interface`:** - -```typescript -interface BeforeWatchHook.Interface { - execute(params: Watch.Params): void | Promise; -} -``` - -**Types:** - -```typescript -namespace BeforeWatchHook { - type Interface = IBeforeWatch; - type Params = Watch.Params; -} -``` - -## `CoreStackOutput` - -**Abstraction** — imported from `webiny/infra/index` - -```typescript -import { CoreStackOutput } from "webiny/infra/index"; -``` - -**Interface `CoreStackOutput.Interface`:** - -```typescript -interface CoreStackOutput.Interface { - execute(): Promise; -} -``` - -**Types:** - -```typescript -namespace CoreStackOutput { - type Interface = ICoreStackOutputService; - type Output = ICoreStackOutput; -} -``` - -## `EnvVar` - -**Constant** — imported from `webiny/infra/index` - -```typescript -import { EnvVar } from "webiny/infra/index"; -``` - -```typescript -export const EnvVar = defineExtension({ - type: "Project/EnvVar", - tags: { runtimeContext: "project" }, - description: "Set an environment variable in the project context.", - multiple: true, - paramsSchema: z.object({ - // TODO: enable using `name` instead of `varName` for better consistency. - varName: z.string().describe("The environment variable name."), - value: z -``` - -## `InvokeLambdaFunction` - -**Abstraction** — imported from `webiny/infra/index` - -```typescript -import { InvokeLambdaFunction } from "webiny/infra/index"; -``` - -**Interface `InvokeLambdaFunction.Interface`:** - -```typescript -interface InvokeLambdaFunction.Interface { - execute(params: IInvokeLambdaFunctionParams): Promise>; -} -``` - -**Types:** - -```typescript -namespace InvokeLambdaFunction { - type Interface = IInvokeLambdaFunction; - type Params = IInvokeLambdaFunctionParams; - type Result = IInvokeLambdaFunctionResult; -} -``` - -## `Logger` - -**Abstraction** — imported from `webiny/infra/index` - -```typescript -import { Logger } from "webiny/infra/index"; -``` - -**Interface `Logger.Interface`:** - -```typescript -interface Logger.Interface { - trace(objOrMsg: object | string, ...args: any[]): void; - debug(objOrMsg: object | string, ...args: any[]): void; - info(objOrMsg: object | string, ...args: any[]): void; - warn(objOrMsg: object | string, ...args: any[]): void; - error(objOrMsg: object | string, ...args: any[]): void; - fatal(objOrMsg: object | string, ...args: any[]): void; - log(objOrMsg: object | string, ...args: any[]): void; -} -``` - -**Types:** - -```typescript -namespace Logger { - type Interface = ILoggerService; -} -``` - -## `Ui` - -**Abstraction** — imported from `webiny/infra/index` - -```typescript -import { Ui } from "webiny/infra/index"; -``` - -**Interface `Ui.Interface`:** - -```typescript -interface Ui.Interface { - raw(text: string): void; - text(text: string): void; - textBold(text: string): void; - emptyLine(): void; - info(text: string, ...args: any[]): void; - success(text: string, ...args: any[]): void; - error(text: string, ...args: any[]): void; - warning(text: string, ...args: any[]): void; - debug(text: string, ...args: any[]): void; -} -``` - -**Types:** - -```typescript -namespace Ui { - type Interface = IUiService; -} -``` diff --git a/docs/developer-docs/6.x/reference/sdk/cms.ai.txt b/docs/developer-docs/6.x/reference/sdk/cms.ai.txt new file mode 100644 index 000000000..d936ce8b1 --- /dev/null +++ b/docs/developer-docs/6.x/reference/sdk/cms.ai.txt @@ -0,0 +1,6 @@ +AI Context: CMS SDK Reference (cms.mdx) + +This file is auto-generated by scripts/generate-sdk-reference.ts. +Source of truth: /Users/adrian/dev/wby-next2/packages/sdk/src/CmsSdk.ts + +Do not edit by hand — re-run the generator after SDK changes. \ No newline at end of file diff --git a/docs/developer-docs/6.x/reference/sdk/cms.mdx b/docs/developer-docs/6.x/reference/sdk/cms.mdx new file mode 100644 index 000000000..3e2ef02f8 --- /dev/null +++ b/docs/developer-docs/6.x/reference/sdk/cms.mdx @@ -0,0 +1,177 @@ +--- +id: m3q8vcj1 +title: CMS SDK Reference +description: API reference for the CMS SDK — methods for querying and mutating Headless CMS entries. +--- + +import { Alert } from "@/components/Alert"; + + + +- What methods are available on `sdk.cms`? +- What parameters each method accepts? +- What each method returns? + + + + + +See [Using the Webiny SDK](/{version}/headless-cms/using-webiny-sdk) for end-to-end usage examples. + + + +## Overview + +The `CmsSdk` is accessed via `sdk.cms` on a `Webiny` instance. It provides methods for reading and writing Headless CMS entries over GraphQL. All methods return a `Result` type — use `result.isOk()` and `result.isFail()` to handle success and error cases. See the [SDK overview](/{version}/reference/sdk/overview) for initialization and error handling details. + +## Methods + +### getEntry + +Retrieves a single entry from the CMS. + +**Signature:** + +```typescript +sdk.cms.getEntry(params: GetEntryParams): Promise, HttpError | GraphQLError | NetworkError>> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| --------------- | ------------------------- | :------: | -------------------------------------------------------------------------------------------------------------------------------------------------- | +| `modelId` | `string` | Yes | The model ID of the entry to retrieve | +| `where` | `GetEntryWhere` | Yes | Where conditions to filter the entry. Can filter by id, entryId, or values | +| `where.id` | `string` | No | The revision ID (e.g., "123#0001") | +| `where.entryId` | `string` | No | The entry ID (e.g., "123") | +| `where.values` | `Record` | No | Filter by entry values | +| `fields` | `string[]` | Yes | Fields to include in the response. Use "values." prefix for entry values (e.g., "values.author.name") or specify top-level fields like "createdOn" | +| `preview` | `boolean` | No | When true, uses preview API to access unpublished/draft content. When false (default), uses read API for published content only. | + +--- + +### listEntries + +Lists entries from the CMS with filtering, sorting, and pagination support. + +**Signature:** + +```typescript +sdk.cms.listEntries(params: ListEntriesParams): Promise, HttpError | GraphQLError | NetworkError>> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| --------- | --------------------------------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `modelId` | `string` | Yes | The model ID of entries to list | +| `where` | `Record` | No | Optional where conditions to filter entries | +| `sort` | `Record` | No | Optional sort configuration | +| `limit` | `number` | No | Maximum number of entries to return (default: 10) | +| `after` | `string` | No | Cursor for pagination | +| `search` | `string` | No | Optional full-text search term to filter entries across searchable fields (text, longText fields with fullTextSearch enabled) | +| `fields` | `string[]` | Yes | Specific fields to return. Use "values." prefix for entry values (e.g., "values.author.name") or specify top-level fields like "createdOn" | +| `preview` | `boolean` | No | When true, uses preview API to access unpublished/draft content. When false (default), uses read API for published content only. | + +--- + +### createEntry + +Creates a new entry in the CMS. + +**Signature:** + +```typescript +sdk.cms.createEntry(params: CreateEntryParams): Promise, HttpError | GraphQLError | NetworkError>> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| --------- | ----------------------------- | :------: | -------------------------------------------------------------------------------------------------------------------------------------------------- | +| `modelId` | `string` | Yes | The model ID for the entry | +| `data` | `CreateCmsEntryData` | Yes | The entry data to create | +| `fields` | `string[]` | Yes | Fields to include in the response. Use "values." prefix for entry values (e.g., "values.author.name") or specify top-level fields like "createdOn" | + +--- + +### updateEntryRevision + +Updates an existing entry revision in the CMS. + +**Signature:** + +```typescript +sdk.cms.updateEntryRevision(params: UpdateEntryRevisionParams): Promise, HttpError | GraphQLError | NetworkError>> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| ------------ | ----------------------------- | :------: | -------------------------------------------------------------------------------------------------------------------------------------------------- | +| `modelId` | `string` | Yes | The model ID for the entry | +| `revisionId` | `string` | Yes | The revision ID of the entry to update (e.g., "123#0001") | +| `data` | `UpdateCmsEntryData` | Yes | The updated entry data | +| `fields` | `string[]` | Yes | Fields to include in the response. Use "values." prefix for entry values (e.g., "values.author.name") or specify top-level fields like "createdOn" | + +--- + +### deleteEntryRevision + +Deletes an entry revision from the CMS. + +**Signature:** + +```typescript +sdk.cms.deleteEntryRevision(params: DeleteEntryRevisionParams): Promise> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| ------------ | --------- | :------: | --------------------------------------------------------- | +| `modelId` | `string` | Yes | The model ID of the entry to delete | +| `revisionId` | `string` | Yes | The revision ID of the entry to delete (e.g., "123#0001") | +| `permanent` | `boolean` | No | Whether to permanently delete the entry (default: false) | + +--- + +### publishEntryRevision + +Publishes an entry revision in the CMS. + +**Signature:** + +```typescript +sdk.cms.publishEntryRevision(params: PublishEntryRevisionParams): Promise, HttpError | GraphQLError | NetworkError>> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| ------------ | ---------- | :------: | ------------------------------------------------------------------------------------------------- | +| `modelId` | `string` | Yes | The model ID of the entry to publish | +| `revisionId` | `string` | Yes | The revision ID of the entry to publish (e.g., "123#0001") | +| `fields` | `string[]` | Yes | Fields to include in response. Use "values." prefix for entry values (e.g., "values.author.name") | + +--- + +### unpublishEntryRevision + +Unpublishes an entry revision in the CMS. + +**Signature:** + +```typescript +sdk.cms.unpublishEntryRevision(params: UnpublishEntryRevisionParams): Promise, HttpError | GraphQLError | NetworkError>> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| ------------ | ---------- | :------: | ------------------------------------------------------------------------------------------------- | +| `modelId` | `string` | Yes | The model ID of the entry to unpublish | +| `revisionId` | `string` | Yes | The revision ID of the entry to unpublish (e.g., "123#0001") | +| `fields` | `string[]` | Yes | Fields to include in response. Use "values." prefix for entry values (e.g., "values.author.name") | + +--- diff --git a/docs/developer-docs/6.x/reference/sdk/file-manager.ai.txt b/docs/developer-docs/6.x/reference/sdk/file-manager.ai.txt new file mode 100644 index 000000000..91069172e --- /dev/null +++ b/docs/developer-docs/6.x/reference/sdk/file-manager.ai.txt @@ -0,0 +1,6 @@ +AI Context: File Manager SDK Reference (file-manager.mdx) + +This file is auto-generated by scripts/generate-sdk-reference.ts. +Source of truth: /Users/adrian/dev/wby-next2/packages/sdk/src/FileManagerSdk.ts + +Do not edit by hand — re-run the generator after SDK changes. \ No newline at end of file diff --git a/docs/developer-docs/6.x/reference/sdk/file-manager.mdx b/docs/developer-docs/6.x/reference/sdk/file-manager.mdx new file mode 100644 index 000000000..ab847fc82 --- /dev/null +++ b/docs/developer-docs/6.x/reference/sdk/file-manager.mdx @@ -0,0 +1,248 @@ +--- +id: f5t4wh6p +title: File Manager SDK Reference +description: API reference for the File Manager SDK — methods for uploading and managing files. +--- + +import { Alert } from "@/components/Alert"; + + + +- What methods are available on `sdk.fileManager`? +- What parameters each method accepts? +- What each method returns? + + + + + +See [Using the Webiny SDK](/{version}/headless-cms/using-webiny-sdk) for end-to-end usage examples. + + + +## Overview + +The `FileManagerSdk` is accessed via `sdk.fileManager` on a `Webiny` instance. It provides methods for listing, uploading, updating, and deleting files. For large files, use `createMultiPartUpload` followed by `completeMultiPartUpload`. All methods return a `Result` type — see the [SDK overview](/{version}/reference/sdk/overview) for initialization and error handling details. + +## Methods + +### getFile + +Gets a single file from the file manager. + +**Signature:** + +```typescript +sdk.fileManager.getFile(params: GetFileParams): Promise> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| --------- | ---------- | :------: | --------------------- | +| `id` | `string` | Yes | ID of the file to get | +| `fields` | `string[]` | Yes | — | + +--- + +### listFiles + +Lists files from the file manager. + +**Signature:** + +```typescript +sdk.fileManager.listFiles(params: ListFilesParams): Promise> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| --------- | ---------------------- | :------: | --------------------------------- | +| `search` | `string` | No | Search query | +| `where` | `FmFileListWhereInput` | No | Filter conditions | +| `limit` | `number` | No | Maximum number of items to return | +| `after` | `string` | No | Cursor for pagination | +| `sort` | `FmFileListSorter[]` | No | Sort order | +| `fields` | `string[]` | Yes | — | + +--- + +### createFile + +Creates a new file in the file manager. If a file is provided, it will be uploaded to S3 first, then the record is created. If no file is provided, only the metadata record is created. + +**Signature:** + +```typescript +sdk.fileManager.createFile(params: CreateFileParams): Promise> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| -------------------- | ------------------------------------ | :------: | -------------------------------------------------------------- | +| `file` | `Buffer \| Blob \| File` | No | Optional: The actual file content to upload | +| `data` | `CreateFileData` | Yes | The file metadata | +| `fields` | `string[]` | Yes | — | +| `onProgress` | `(progress: UploadProgress) => void` | No | Optional: Progress callback | +| `multiPartThreshold` | `number` | No | Optional: Threshold in MB for multi-part upload (default: 100) | +| `signal` | `AbortSignal` | No | Optional: AbortSignal for cancellation | + +--- + +### createFiles + +Creates multiple files in the file manager. If files are provided, they will be uploaded to S3 first, then records are created. If no files are provided, only metadata records are created. + +**Signature:** + +```typescript +sdk.fileManager.createFiles(params: CreateFilesParams): Promise> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| -------------------- | --------------------- | :------: | -------------------------------------------------------------- | +| `files` | `Array` | Yes | Array of files with their data | +| `multiPartThreshold` | `number` | No | Optional: Threshold in MB for multi-part upload (default: 100) | +| `concurrency` | `number` | No | Optional: Number of concurrent uploads (default: 5) | +| `strategy` | `BatchUploadStrategy` | No | Optional: Batch upload strategy (default: FAIL_FAST) | +| `signal` | `AbortSignal` | No | Optional: AbortSignal for cancellation | + +--- + +### updateFile + +Updates a file in the file manager. + +**Signature:** + +```typescript +sdk.fileManager.updateFile(params: UpdateFileParams): Promise> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| --------- | ---------------- | :------: | ------------------------ | +| `id` | `string` | Yes | ID of the file to update | +| `data` | `UpdateFileData` | Yes | The file data to update | +| `fields` | `string[]` | Yes | — | + +--- + +### deleteFile + +Deletes a file from the file manager. + +**Signature:** + +```typescript +sdk.fileManager.deleteFile(params: DeleteFileParams): Promise> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| --------- | -------- | :------: | ------------------------ | +| `id` | `string` | Yes | ID of the file to delete | + +--- + +### listTags + +Lists tags from the file manager. + +**Signature:** + +```typescript +sdk.fileManager.listTags(params: ListTagsParams): Promise> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| --------- | ---------------------- | :------: | ----------------- | +| `where` | `FmTagsListWhereInput` | No | Filter conditions | + +--- + +### getPresignedPostPayload + +Gets a presigned POST payload for uploading a file to S3. + +**Signature:** + +```typescript +sdk.fileManager.getPresignedPostPayload(params: GetPresignedPostPayloadParams): Promise> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| ----------- | -------- | :------: | -------------------------- | +| `name` | `string` | Yes | File name | +| `type` | `string` | Yes | File MIME type | +| `size` | `number` | Yes | File size in bytes | +| `key` | `string` | No | Optional custom S3 key | +| `keyPrefix` | `string` | No | Optional custom key prefix | + +--- + +### getPresignedPostPayloads + +Gets presigned POST payloads for uploading multiple files to S3. + +**Signature:** + +```typescript +sdk.fileManager.getPresignedPostPayloads(params: GetPresignedPostPayloadsParams): Promise> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| --------- | --------------------------------- | :------: | --------------------------------------------------------------- | +| `files` | `GetPresignedPostPayloadParams[]` | Yes | Array of file metadata for which to get presigned POST payloads | + +--- + +### createMultiPartUpload + +Creates a multi-part upload for a large file. + +**Signature:** + +```typescript +sdk.fileManager.createMultiPartUpload(params: CreateMultiPartUploadParams): Promise> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| --------------- | -------- | :------: | -------------------------------------- | +| `data` | `object` | Yes | File metadata | +| `numberOfParts` | `number` | Yes | Number of parts to split the file into | + +--- + +### completeMultiPartUpload + +Completes a multi-part upload. + +**Signature:** + +```typescript +sdk.fileManager.completeMultiPartUpload(params: CompleteMultiPartUploadParams): Promise> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| ---------- | -------- | :------: | ------------------------------------ | +| `fileKey` | `string` | Yes | S3 key of the uploaded file | +| `uploadId` | `string` | Yes | Upload ID from createMultiPartUpload | + +--- diff --git a/docs/developer-docs/6.x/reference/sdk/languages.ai.txt b/docs/developer-docs/6.x/reference/sdk/languages.ai.txt new file mode 100644 index 000000000..c197db02f --- /dev/null +++ b/docs/developer-docs/6.x/reference/sdk/languages.ai.txt @@ -0,0 +1,13 @@ +AI Context: Languages SDK Reference (languages.mdx) + +Source of truth: packages/sdk/src (LanguagesSdk, when added to Webiny class) + +Key source files consulted: +- packages/languages/src/api/domain/Language.ts — Language interface (id, name, code, direction, isDefault, enabled) +- packages/languages/src/admin/features/listLanguages/ListLanguagesGateway.ts — GraphQL query shape, response envelope +- packages/languages/src/admin/features/listLanguages/abstractions.ts — LanguageDto shape +- packages/sdk/src/Webiny.ts — Webiny class (languages not yet added at time of writing) + +Note: At time of writing, the Webiny SDK class does not yet expose `sdk.languages`. This doc was written ahead of the implementation. Update the signature and return type if the actual LanguagesSdk implementation differs. + +Only method currently: listLanguages() — no parameters, returns Language[]. diff --git a/docs/developer-docs/6.x/reference/sdk/languages.mdx b/docs/developer-docs/6.x/reference/sdk/languages.mdx new file mode 100644 index 000000000..a3f7910ed --- /dev/null +++ b/docs/developer-docs/6.x/reference/sdk/languages.mdx @@ -0,0 +1,62 @@ +--- +id: lx2r8wk4 +title: Languages SDK Reference +description: API reference for the Languages SDK — methods for retrieving configured languages. +--- + +import { Alert } from "@/components/Alert"; + + + +- What methods are available on `sdk.languages`? +- What parameters each method accepts? +- What each method returns? + + + +## Overview + +The `LanguagesSdk` is accessed via `sdk.languages` on a `Webiny` instance. It provides methods for retrieving the languages configured in Webiny. All methods return a `Result` type — see the [SDK overview](/{version}/reference/sdk/overview) for initialization and error handling details. + +## Methods + +### listLanguages + +Returns all languages configured in the Webiny instance. + +**Signature:** + +```typescript +sdk.languages.listLanguages(): Promise> +``` + +_This method takes no parameters._ + +**Returns:** + +An array of `Language` objects: + +| Field | Type | Description | +| ----------- | ---------------- | ----------------------------------------------- | +| `id` | `string` | Unique language ID | +| `name` | `string` | Human-readable language name (e.g. `"English"`) | +| `code` | `string` | BCP 47 language code (e.g. `"en-US"`) | +| `direction` | `"ltr" \| "rtl"` | Text direction | +| `isDefault` | `boolean` | Whether this is the default language | +| `enabled` | `boolean` | Whether this language is currently active | + +**Example:** + +```typescript +const result = await sdk.languages.listLanguages(); + +if (result.isFail()) { + console.error(result.error.message); + return; +} + +const languages = result.value; +const defaultLanguage = languages.find(lang => lang.isDefault); +``` + +--- diff --git a/docs/developer-docs/6.x/reference/sdk/overview.ai.txt b/docs/developer-docs/6.x/reference/sdk/overview.ai.txt new file mode 100644 index 000000000..983c7c369 --- /dev/null +++ b/docs/developer-docs/6.x/reference/sdk/overview.ai.txt @@ -0,0 +1,6 @@ +AI Context: Webiny SDK Reference Index (index.mdx) + +This file is auto-generated by scripts/generate-sdk-reference.ts. +Source of truth: /Users/adrian/dev/wby-next2/packages/sdk/src + +Do not edit by hand — re-run the generator after SDK changes. \ No newline at end of file diff --git a/docs/developer-docs/6.x/reference/sdk/overview.mdx b/docs/developer-docs/6.x/reference/sdk/overview.mdx new file mode 100644 index 000000000..45781e040 --- /dev/null +++ b/docs/developer-docs/6.x/reference/sdk/overview.mdx @@ -0,0 +1,85 @@ +--- +id: s7b2nk9x +title: Webiny SDK Reference +description: API reference for the Webiny SDK — a type-safe JavaScript/TypeScript client for interacting with Webiny. +--- + +import { Alert } from "@/components/Alert"; + + + +- How to initialize the Webiny SDK? +- What configuration options are available? +- What sub-SDKs are available and what they do? + + + +## Overview + +The Webiny SDK is a type-safe JavaScript/TypeScript client for interacting with a Webiny instance from external applications — Node.js scripts, Next.js, Vue, SvelteKit, and others. + +Install it from npm: + +``` +yarn add @webiny/sdk +``` + +## Initialization + +Create a `Webiny` instance with your endpoint and API token: + +```typescript +import { Webiny } from "@webiny/sdk"; + +const sdk = new Webiny({ + endpoint: "https://your-webiny-endpoint.com", + token: "your-api-token", + tenant: "root" // optional, defaults to "root" +}); +``` + +## Configuration + +| Option | Type | Required | Description | +| ---------- | ------------------------ | :------: | ----------------------------------------------------------- | +| `endpoint` | `string` | Yes | The URL of your Webiny API endpoint | +| `token` | `string` | No | API token for authentication | +| `tenant` | `string` | No | Tenant ID. Defaults to `"root"` | +| `headers` | `Record` | No | Additional HTTP headers sent with every request | +| `fetch` | `typeof fetch` | No | Custom fetch implementation. Defaults to the global `fetch` | + +## Sub-SDKs + +| Property | Class | Description | +| ------------------- | ------------------------------------------------------------- | ------------------------------------- | +| `sdk.cms` | [`CmsSdk`](/{version}/reference/sdk/cms) | Query and mutate Headless CMS entries | +| `sdk.fileManager` | [`FileManagerSdk`](/{version}/reference/sdk/file-manager) | Upload and manage files | +| `sdk.languages` | [`LanguagesSdk`](/{version}/reference/sdk/languages) | Retrieve configured languages | +| `sdk.tenantManager` | [`TenantManagerSdk`](/{version}/reference/sdk/tenant-manager) | Create and manage tenants | + +## Error Handling + +All SDK methods return a `Result` type. Use `result.isOk()` and `result.isFail()` to branch on success or failure: + +```typescript +const result = await sdk.cms.getEntry({ + modelId: "article", + where: { entryId: "abc" }, + fields: ["id"] +}); + +if (result.isFail()) { + console.error(result.error.message); + return; +} + +console.log(result.value); // typed as CmsEntryData +``` + +### Error types + +| Error class | `code` | When thrown | +| -------------- | --------------- | ---------------------------------------------------- | +| `HttpError` | `HTTP_ERROR` | The API responded with a non-2xx HTTP status | +| `GraphQLError` | `GRAPHQL_ERROR` | The API returned a GraphQL-level error | +| `NetworkError` | `NETWORK_ERROR` | The `fetch` call itself threw (e.g. no connectivity) | diff --git a/docs/developer-docs/6.x/reference/sdk/tenant-manager.ai.txt b/docs/developer-docs/6.x/reference/sdk/tenant-manager.ai.txt new file mode 100644 index 000000000..f1dafa60e --- /dev/null +++ b/docs/developer-docs/6.x/reference/sdk/tenant-manager.ai.txt @@ -0,0 +1,6 @@ +AI Context: Tenant Manager SDK Reference (tenant-manager.mdx) + +This file is auto-generated by scripts/generate-sdk-reference.ts. +Source of truth: /Users/adrian/dev/wby-next2/packages/sdk/src/TenantManagerSdk.ts + +Do not edit by hand — re-run the generator after SDK changes. \ No newline at end of file diff --git a/docs/developer-docs/6.x/reference/sdk/tenant-manager.mdx b/docs/developer-docs/6.x/reference/sdk/tenant-manager.mdx new file mode 100644 index 000000000..69d7ad386 --- /dev/null +++ b/docs/developer-docs/6.x/reference/sdk/tenant-manager.mdx @@ -0,0 +1,113 @@ +--- +id: r2y9dk0e +title: Tenant Manager SDK Reference +description: API reference for the Tenant Manager SDK — methods for managing tenants. +--- + +import { Alert } from "@/components/Alert"; + + + +- What methods are available on `sdk.tenantManager`? +- What parameters each method accepts? +- What each method returns? + + + + + +See [Using the Webiny SDK](/{version}/headless-cms/using-webiny-sdk) for end-to-end usage examples. + + + +## Overview + +The `TenantManagerSdk` is accessed via `sdk.tenantManager` on a `Webiny` instance. It provides methods for creating, installing, enabling, and disabling tenants in a multi-tenant Webiny setup. All methods return a `Result` type — see the [SDK overview](/{version}/reference/sdk/overview) for initialization and error handling details. + +## Methods + +### createTenant + +Creates a new tenant in the system. + +**Signature:** + +```typescript +sdk.tenantManager.createTenant(params: CreateTenantParams): Promise> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| --------- | ------------------- | :------: | ------------------------- | +| `data` | `CreateTenantInput` | Yes | The tenant data to create | + +--- + +### installTenant + +Installs and provisions a tenant with default settings and configurations. + +**Signature:** + +```typescript +sdk.tenantManager.installTenant(params: InstallTenantParams): Promise> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| ---------- | -------- | :------: | --------------------------- | +| `tenantId` | `string` | Yes | ID of the tenant to install | + +--- + +### disableTenant + +Disables a tenant, preventing access to its resources. + +**Signature:** + +```typescript +sdk.tenantManager.disableTenant(params: DisableTenantParams): Promise> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| ---------- | -------- | :------: | --------------------------- | +| `tenantId` | `string` | Yes | ID of the tenant to disable | + +--- + +### enableTenant + +Re-enables a previously disabled tenant. + +**Signature:** + +```typescript +sdk.tenantManager.enableTenant(params: EnableTenantParams): Promise> +``` + +**Parameters:** + +| Parameter | Type | Required | Description | +| ---------- | -------- | :------: | -------------------------- | +| `tenantId` | `string` | Yes | ID of the tenant to enable | + +--- + +### getCurrentTenant + +Returns the current tenant for the authenticated context. + +**Signature:** + +```typescript +sdk.tenantManager.getCurrentTenant(): Promise> +``` + +_This method takes no parameters._ + +--- diff --git a/docs/developer-docs/6.x/security/roles.ai.txt b/docs/developer-docs/6.x/security/roles.ai.txt new file mode 100644 index 000000000..7120f95b7 --- /dev/null +++ b/docs/developer-docs/6.x/security/roles.ai.txt @@ -0,0 +1,38 @@ +AI Context: Programmatically Create Roles (roles.mdx) + +Source of Information: +1. packages/api-core/src/features/security/roles/shared/abstractions.ts — RoleFactory interface, CodeRole type, namespace exports +2. packages/api-core/src/features/security/roles/shared/RoleProvider.ts — how roles are loaded at boot (in-memory, plugin: true flag, slug becomes id) +3. packages/api-core/__tests__/security/roles.test.ts — usage pattern, CANNOT_UPDATE_PLUGIN_ROLES / CANNOT_DELETE_PLUGIN_ROLES error codes +4. packages/webiny/src/api/security.ts — public export path: "webiny/api/security" +5. docs/developer-docs/5.x/security/extensions/programmatically-create-roles-and-teams.mdx — v5 article ported as reference +6. docs/developer-docs/6.x/security/universal-api-keys.mdx — structural reference for the article format + +Key Documentation Decisions: +1. Two separate articles (roles.mdx + teams.mdx) rather than one combined article — roles and teams are independent abstractions; teams is enterprise-only while roles is available to all +2. No "Deploying" section — unlike ApiKeyFactory, RoleFactory does NOT persist to the database; roles are loaded in-memory at boot via RoleProvider and merged with database roles at query time +3. Slug is explained as the role identifier throughout the system (for team assignment, user assignment) rather than just an "idempotency key" — because there is no upsert, the slug IS the id (RoleProvider sets id = slug) +4. Included the "Copy Permissions as JSON" tip from v5 — still relevant in v6 +5. Multiple roles per execute() shown, plus mention of multiple extensions — because RoleFactory supports multiple: true (RoleProvider collects from all registered factories) +6. Read-only note uses Alert type="info" not type="warning" — it's informational, not a dangerous caution + +Understanding: +RoleFactory is a createAbstraction-based DI token. RoleProvider (also via createImplementation) collects all registered RoleFactory implementations using dependencies: [[RoleFactory, { multiple: true }]]. On first call to getRoles(), it calls execute() on each factory, flattens the results, and caches them with plugin: true and id = slug. These in-memory roles are then merged with database roles at the GraphQL list/get level. Because plugin: true is set, the security layer rejects update and delete mutations for these roles with CANNOT_UPDATE_PLUGIN_ROLES / CANNOT_DELETE_PLUGIN_ROLES. + +The return type is Promise but async execute() returning a plain array satisfies this. + +Related Documents: +- docs/developer-docs/6.x/security/teams.mdx — TeamFactory, references roles by slug +- docs/developer-docs/6.x/security/universal-api-keys.mdx — similar factory pattern (ApiKeyFactory) +- docs/developer-docs/6.x/core-concepts/di.mdx — DI pattern used by RoleFactory + +Key Code Locations: +- packages/api-core/src/features/security/roles/shared/abstractions.ts — RoleFactory, CodeRole +- packages/api-core/src/features/security/roles/shared/RoleProvider.ts — boot-time loading +- packages/api-core/__tests__/security/roles.test.ts — usage examples and behavior tests +- packages/webiny/src/api/security.ts — public export + +Tone Guidelines: +- Technical and practical — reader knows what roles are, explain the Webiny-specific factory pattern +- Lead with the problem (roles don't live in version control) then the solution +- Table for properties; inline list for permission examples — keeps it scannable diff --git a/docs/developer-docs/6.x/security/roles.mdx b/docs/developer-docs/6.x/security/roles.mdx new file mode 100644 index 000000000..286793269 --- /dev/null +++ b/docs/developer-docs/6.x/security/roles.mdx @@ -0,0 +1,114 @@ +--- +id: rn4x7p2k +title: Roles +description: Learn how to define security roles in code using the RoleFactory extension. +--- + +import { Alert } from "@/components/Alert"; + + + +- what `RoleFactory` is and when to use it +- how to define roles and their permissions in code +- how code-defined roles behave in the Admin UI + + + +## Overview + +Security roles define what users can access in Webiny. By default, roles are created in the Admin UI under **Settings → Access Management → Roles**. This works for initial setup, but the roles live only in the database: they must be recreated on every new environment and are not tracked in version control. + +`RoleFactory` is an extension that lets you define roles in code. Webiny loads them at boot time and merges them with database roles so they appear in the Admin UI like any other role. Because they come from code, they cannot be edited or deleted through the UI. + +## Creating the Extension + +Create a new extension file: + +```typescript extensions/security/contentEditorRole.ts +import { RoleFactory } from "webiny/api/security"; + +class ContentEditorRoleImpl implements RoleFactory.Interface { + async execute(): RoleFactory.Return { + return [ + { + name: "Content Editor", + slug: "content-editor", + description: "Full access to Headless CMS content entries.", + permissions: [{ name: "cms.*" }, { name: "content.i18n" }] + } + ]; + } +} + +export default RoleFactory.createImplementation({ + implementation: ContentEditorRoleImpl, + dependencies: [] +}); +``` + +Then register it in `webiny.config.tsx`: + +```tsx webiny.config.tsx +import React from "react"; +import { Api } from "webiny/extensions"; + +export const Extensions = () => { + return ( + <> + {/* ... other extensions */} + + + ); +}; +``` + +## Role Properties + +| Property | Description | +| ------------- | ------------------------------------------------------------------------- | +| `name` | Human-readable label shown in the Admin UI | +| `slug` | Unique identifier used to reference this role from teams and user records | +| `description` | Short description shown in the Admin UI | +| `permissions` | Array of permission objects that define what this role grants | + +The `slug` is used as the role's identifier throughout the system. When assigning a code-defined role to a [team](/{version}/security/teams) or a user, you reference it by this slug. Use a stable, unique value — changing a slug is equivalent to deleting the old role and creating a new one. + + + +Roles defined via `RoleFactory` are read-only in the Admin UI. Attempts to update or delete them through the UI will be rejected. + + + +## Defining Permissions + +Each permission object requires at minimum a `name` field that identifies the application or resource: + +- `{ name: "cms.*" }` — full access to Headless CMS +- `{ name: "pb.*" }` — full access to Website Builder +- `{ name: "content.i18n" }` — access to content locales +- `{ name: "*" }` — full access to everything + +The easiest way to build a permissions array for a complex role is to configure it in the Admin UI Role Editor, then click **Copy Permissions as JSON** to copy the exact permission objects and paste them into your code. + +A single `execute()` call can return multiple role definitions: + +```typescript +async execute(): RoleFactory.Return { + return [ + { + name: "Content Editor", + slug: "content-editor", + description: "Full access to Headless CMS.", + permissions: [{ name: "cms.*" }, { name: "content.i18n" }] + }, + { + name: "Website Publisher", + slug: "website-publisher", + description: "Full access to Website Builder.", + permissions: [{ name: "pb.*" }, { name: "content.i18n" }] + } + ]; +} +``` + +Alternatively, split them across multiple extension files — each registered separately in `webiny.config.tsx`. Webiny merges all `RoleFactory` implementations automatically. diff --git a/docs/developer-docs/6.x/security/teams.ai.txt b/docs/developer-docs/6.x/security/teams.ai.txt new file mode 100644 index 000000000..30c5b6961 --- /dev/null +++ b/docs/developer-docs/6.x/security/teams.ai.txt @@ -0,0 +1,38 @@ +AI Context: Programmatically Create Teams (teams.mdx) + +Source of Information: +1. packages/api-core/src/features/security/teams/shared/abstractions.ts — TeamFactory interface, CodeTeam type, namespace exports +2. packages/api-core/src/features/security/teams/shared/TeamProvider.ts — how teams are loaded at boot (in-memory, plugin: true, slug becomes id) +3. packages/api-core/__tests__/security/teams.test.ts — usage pattern, CANNOT_UPDATE_PLUGIN_TEAMS / CANNOT_DELETE_PLUGIN_TEAMS, roles referenced by slug +4. packages/webiny/src/api/security.ts — public export path: "webiny/api/security" +5. docs/developer-docs/5.x/security/extensions/programmatically-create-roles-and-teams.mdx — v5 article ported as reference +6. docs/developer-docs/6.x/security/roles.mdx — companion article, referenced for RoleFactory + +Key Documentation Decisions: +1. Article focuses on TeamFactory only — roles are in roles.mdx; cross-link rather than repeat +2. Enterprise note placed in Overview (before code) — important gating info; reader needs to know before deciding to implement +3. "Define the required roles first" in the Creating section — teams.roles is an array of role slugs; if slugs don't resolve, teams will be missing their roles; this is the primary footgun +4. No "Deploying" section — same reasoning as roles.mdx: TeamFactory is loaded in-memory at boot, not persisted to the database +5. Multiple teams section at the end — same pattern as roles.mdx for consistency + +Understanding: +TeamFactory works identically to RoleFactory but for teams. TeamProvider collects all TeamFactory implementations with { multiple: true } and caches them in memory with plugin: true and id = slug. Teams appear in the list/get API merged with database teams. The roles array contains role slugs; the system resolves these at query time to populate role names and ids. Because plugin: true is set, the security layer rejects update/delete mutations with CANNOT_UPDATE_PLUGIN_TEAMS / CANNOT_DELETE_PLUGIN_TEAMS. + +CodeTeam shape: { name: string, slug: string, description: string, roles: string[], system?: boolean } +The roles field is string[] (slugs), not full Role objects. + +Related Documents: +- docs/developer-docs/6.x/security/roles.mdx — RoleFactory, role slugs referenced by teams +- docs/developer-docs/6.x/security/universal-api-keys.mdx — similar factory pattern +- docs/developer-docs/6.x/core-concepts/di.mdx — DI pattern + +Key Code Locations: +- packages/api-core/src/features/security/teams/shared/abstractions.ts — TeamFactory, CodeTeam +- packages/api-core/src/features/security/teams/shared/TeamProvider.ts — boot-time loading +- packages/api-core/__tests__/security/teams.test.ts — usage examples and behavior tests +- packages/webiny/src/api/security.ts — public export + +Tone Guidelines: +- Technical and practical — assume reader has read roles.mdx or is familiar with the pattern +- Keep the enterprise note factual and brief, not alarming +- Lead with what teams do (group roles) before explaining the factory pattern diff --git a/docs/developer-docs/6.x/security/teams.mdx b/docs/developer-docs/6.x/security/teams.mdx new file mode 100644 index 000000000..b7dde8ebc --- /dev/null +++ b/docs/developer-docs/6.x/security/teams.mdx @@ -0,0 +1,111 @@ +--- +id: k7qm3hj9 +title: Teams +description: Learn how to define security teams in code using the TeamFactory extension. +--- + +import { Alert } from "@/components/Alert"; + + + +- what `TeamFactory` is and when to use it +- how to define teams that group roles in code +- how code-defined teams behave in the Admin UI + + + +## Overview + +Teams group roles together and can be assigned to users, granting them all the permissions the included roles provide. By default, teams are managed in the Admin UI under **Settings → Access Management → Teams**. Like manually created roles, manually created teams live only in the database and must be recreated on each new environment. + +`TeamFactory` is an extension that lets you define teams in code. Webiny loads them at boot time and merges them with database teams so they appear in the Admin UI like any other team. Because they come from code, they cannot be edited or deleted through the UI. + + + +Teams are an enterprise feature. Confirm your Webiny license includes team support before using `TeamFactory`. + + + +## Creating the Extension + +Teams reference roles by their `slug`. Define the required roles first — either in the Admin UI or via [`RoleFactory`](/{version}/security/roles) — then create a team extension that references them: + +```typescript extensions/security/contentTeam.ts +import { TeamFactory } from "webiny/api/security"; + +class ContentTeamImpl implements TeamFactory.Interface { + async execute(): TeamFactory.Return { + return [ + { + name: "Content Team", + slug: "content-team", + description: "Team responsible for managing content across all channels.", + roles: ["content-editor", "website-publisher"] + } + ]; + } +} + +export default TeamFactory.createImplementation({ + implementation: ContentTeamImpl, + dependencies: [] +}); +``` + +Then register it in `webiny.config.tsx`: + +```tsx webiny.config.tsx +import React from "react"; +import { Api } from "webiny/extensions"; + +export const Extensions = () => { + return ( + <> + {/* ... other extensions */} + + + ); +}; +``` + +## Team Properties + +| Property | Description | +| ------------- | -------------------------------------------------------------------------------------- | +| `name` | Human-readable label shown in the Admin UI | +| `slug` | Unique identifier for the team; used when assigning the team to users | +| `description` | Short description shown in the Admin UI | +| `roles` | Array of role slugs the team includes; can mix code-defined and database-created roles | + +The `roles` array accepts role slugs — the same `slug` values defined in `RoleFactory` or visible in the Admin UI Roles module. A team can combine code-defined roles and roles created through the UI. + + + +Teams defined via `TeamFactory` are read-only in the Admin UI. Attempts to update or delete them through the UI will be rejected. + + + +## Defining Multiple Teams + +A single `execute()` call can return multiple team definitions: + +```typescript +async execute(): TeamFactory.Return { + return [ + { + name: "Content Team", + slug: "content-team", + description: "Manages CMS and Website Builder content.", + roles: ["content-editor", "website-publisher"] + }, + { + name: "Admin Team", + slug: "admin-team", + description: "Full platform access.", + roles: ["full-access"] + } + ]; +} +``` + +As with `RoleFactory`, you can also split teams across multiple extension files — each registered separately in `webiny.config.tsx`. Webiny merges all `TeamFactory` implementations automatically. diff --git a/docs/developer-docs/6.x/security/universal-api-keys.ai.txt b/docs/developer-docs/6.x/security/universal-api-keys.ai.txt new file mode 100644 index 000000000..cf0fd1187 --- /dev/null +++ b/docs/developer-docs/6.x/security/universal-api-keys.ai.txt @@ -0,0 +1,29 @@ +AI Context: Universal API Keys (universal-api-keys.mdx) + +Source of Information: +1. docs/developer-docs/6.x/website-builder/multi-tenant-nextjs.mdx — "API Key Strategy" and "Creating a Universal API Key" sections; code examples taken from there +2. User-provided code snippet showing ApiKeyFactory pattern +3. admin/whitelabeling.mdx — structural reference for extension articles + +Key Documentation Decisions: +1. Scoped to the API key provisioning pattern — does not repeat multi-tenancy concepts from multi-tenant-nextjs +2. Included a properties table to explain slug, name, token, permissions fields clearly +3. Called out slug as the idempotency key (Webiny looks up by slug to update vs create) +4. Added a "Restricting Permissions" section to discourage blanket { name: "*" } in production +5. The wat_ token prefix is documented as required based on the example +6. Warning about not committing tokens carried over from multi-tenant-nextjs + +Understanding: +ApiKeyFactory is an extension that runs at boot time. It returns an array of key definitions. Each definition has name, slug, token, and permissions. The slug is used for idempotent upsert — if a key with that slug exists it is updated, otherwise created. The token is the raw secret clients send in API requests. permissions is an array of permission objects where name: "*" is the wildcard. For multi-tenant deployments, one universal key at the root tenant with { name: "*" } is the recommended starting point; tenant scoping happens via the apiTenant SDK parameter, not the key. + +Related Documents: +- docs/developer-docs/6.x/website-builder/multi-tenant-nextjs.mdx — usage of universal key in Next.js +- docs/developer-docs/6.x/reference/api/security/api-key.mdx — API reference + +Key Code Locations: +- packages/api-security — ApiKeyFactory interface and createImplementation + +Tone Guidelines: +- Technical and practical — audience knows what API keys are, explain the Webiny-specific factory pattern +- Lead with the what/when (overview), then the how (extension + registration) +- Table for properties adds scannability without verbose prose diff --git a/docs/developer-docs/6.x/security/universal-api-keys.mdx b/docs/developer-docs/6.x/security/universal-api-keys.mdx new file mode 100644 index 000000000..a4e9c0b47 --- /dev/null +++ b/docs/developer-docs/6.x/security/universal-api-keys.mdx @@ -0,0 +1,110 @@ +--- +id: tm8c6wj1 +title: Universal API Keys +description: Learn how to provision a universal API key programmatically using the ApiKeyFactory extension. +--- + +import { Alert } from "@/components/Alert"; + + + +- what a universal API key is and when to use one +- how to create an API key programmatically using `ApiKeyFactory` +- how to control permissions on the key + + + +## Overview + +API keys are used by external clients — such as a Next.js front end, a mobile app, or a CI/CD pipeline — to authenticate requests to the Webiny API. By default, every tenant gets its own API key managed through the Admin UI under **Settings → Access Management → API Keys**. + +For multi-tenant deployments, managing one key per tenant becomes impractical. A **universal API key** is a single key provisioned at the root tenant level that can access content across all tenants. The tenant is scoped per request through the `apiTenant` parameter on the SDK, not through the key itself. + +Universal keys are created programmatically via the `ApiKeyFactory` extension. The factory runs when Webiny boots and ensures the key exists with the permissions you specify. + +## Creating the Extension + +Create a new extension file: + +```typescript extensions/security/universalApiKey.ts +import { ApiKeyFactory } from "webiny/api/security"; + +class UniversalApiKeyImpl implements ApiKeyFactory.Interface { + async execute(): ApiKeyFactory.Return { + return [ + { + name: "Universal API Key", + slug: "universal-key", + token: process.env.WEBINY_API_UNIVERSAL_KEY as string, + permissions: [{ name: "*" }] + } + ]; + } +} + +export default ApiKeyFactory.createImplementation({ + implementation: UniversalApiKeyImpl, + dependencies: [] +}); +``` + +Set `WEBINY_API_UNIVERSAL_KEY` in your environment before deploying. Generate a strong, random token prefixed with `wat_` (e.g. `wat_` followed by a securely generated string) and store it in your secret manager. Inject it at deploy time — do not commit the value to source control. + +Then register it in `webiny.config.tsx`: + +```tsx webiny.config.tsx +import React from "react"; +import { Api } from "webiny/extensions"; + +export const Extensions = () => { + return ( + <> + {/* ... other extensions */} + + + ); +}; +``` + +## Key Properties + +| Property | Description | +| ------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `name` | Human-readable label shown in the Admin UI | +| `slug` | Unique identifier for the key; used internally to look up and update the key on each boot | +| `token` | The secret value clients include in API requests; must be prefixed with `wat_`; read from an environment variable, never hardcoded | +| `permissions` | Array of permission objects; `{ name: "*" }` grants full access across all tenants | + +The `slug` field is important: Webiny uses it to determine whether the key already exists. If the key is found by its slug, it is updated in place rather than created again. Use a stable, unique slug for each key in your project. + + + +Store the token value in a secret manager and inject it at deploy time. Do not commit the raw token to source control. + + + +## Restricting Permissions + +The `permissions: [{ name: "*" }]` grant gives broad access. For tighter control, specify the exact permission scopes your clients need. For example, to restrict the key to read-only Website Builder access: + +```typescript +permissions: [{ name: "wb.page", rwd: "r" }, { name: "wb.settings" }]; +``` + +The available permission names and their options depend on the Webiny applications you have installed. You can inspect the permissions an existing key holds in the Admin UI under **Settings → Access Management → API Keys**. + +## Deploying the Key + +After creating the extension, deploy the API so the factory runs and the key is provisioned: + +``` +yarn webiny deploy api +``` + +During development, the key is created on the next boot triggered by watch mode: + +``` +yarn webiny watch api +``` + +Once deployed, use the token value wherever your client authenticates against the Webiny API — for example, as the `NEXT_PUBLIC_WEBSITE_BUILDER_API_KEY` environment variable in a Next.js project. diff --git a/docs/developer-docs/6.x/webiny-api/connect-custom-domain.ai.txt b/docs/developer-docs/6.x/webiny-api/connect-custom-domain.ai.txt new file mode 100644 index 000000000..ed3ef731a --- /dev/null +++ b/docs/developer-docs/6.x/webiny-api/connect-custom-domain.ai.txt @@ -0,0 +1,25 @@ +AI Context: Connect Custom Domain (connect-custom-domain.mdx) + +Source of Information: +1. admin/connect-custom-domain.mdx — parallel article for the Admin Area; this article mirrors its structure for the API +2. navigation.tsx — confirmed Infra.Api pattern exists alongside Infra.Admin + +Key Documentation Decisions: +1. Mirrors admin/connect-custom-domain.mdx exactly in structure — same Before You Begin, Configure, Point Your Domain sections +2. Uses Infra.Api.CustomDomains (vs Infra.Admin.CustomDomains for admin) +3. Domain example uses api.my-domain.com subdomain convention to distinguish from admin domain +4. No code changes required beyond webiny.config.tsx — kept article short like admin counterpart + +Understanding: +The Webiny API is served via a CloudFront distribution. Connecting a custom domain requires an ACM certificate in us-east-1 (CloudFront requirement) and declaring the domain via the Infra extension. Webiny attaches it as an alternate domain name on the distribution automatically on next deploy. + +Related Documents: +- docs/developer-docs/6.x/admin/connect-custom-domain.mdx — same process for Admin +- docs/developer-docs/6.x/cli/deploy.mdx — deploy command reference + +Key Code Locations: +- webiny.config.tsx — Infra.Api.CustomDomains extension registration + +Tone Guidelines: +- Concise operational doc — minimal prose, lead with what to do +- Same length and depth as admin/connect-custom-domain.mdx diff --git a/docs/developer-docs/6.x/webiny-api/connect-custom-domain.mdx b/docs/developer-docs/6.x/webiny-api/connect-custom-domain.mdx new file mode 100644 index 000000000..1abbc6b36 --- /dev/null +++ b/docs/developer-docs/6.x/webiny-api/connect-custom-domain.mdx @@ -0,0 +1,91 @@ +--- +id: xp4k9r2m +title: Connect Custom Domain +description: Learn how to connect a custom domain to the Webiny API application. +--- + +import { Alert } from "@/components/Alert"; + + + +- how to connect a custom domain to the API CloudFront distribution + + + + + +To connect a custom domain to the Admin Area instead, see [Connect Custom Domain](/{version}/admin/connect-custom-domain). + + + +## Overview + +By default, the Webiny API is accessible via an auto-generated CloudFront URL. For production environments, you will typically want to serve it from a custom domain. + +To do this, you need an AWS Certificate Manager (ACM) certificate that covers your domain, then declare the domain via `Infra.Api.CustomDomains` in `webiny.config.tsx`. Webiny will attach the domain as an alternate domain name on the API's CloudFront distribution. + +## Before You Begin + +- Register your domain with a DNS provider of your choice. +- Create (or import) a certificate in [AWS Certificate Manager (ACM)](https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html) that covers the domain you plan to use. + + + +The certificate **must** be created in the `us-east-1` region — this is an AWS requirement for certificates used with CloudFront distributions. + + + + + +Learn how to request a public certificate in the official [AWS documentation](https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html#request-public-console). Read more about [alternate domain name requirements](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html#alternate-domain-names-requirements) for CloudFront. + + + +## Configure the Custom Domain + +Add `Infra.Api.CustomDomains` to `webiny.config.tsx`: + +```tsx webiny.config.tsx +import React from "react"; +import { Infra } from "webiny/extensions"; + +export const Extensions = () => { + return ( + <> + + + ); +}; +``` + +Replace `api.my-domain.com` with your domain and `certificateArn` with the ARN of your ACM certificate. + +After making the change, redeploy: + +``` +yarn webiny deploy +``` + +Use `--env ` to target a specific environment if needed. + +## Point Your Domain to CloudFront + +Once deployed, Webiny will output the CloudFront domain name for the API distribution (e.g. `d111111abcdef8.cloudfront.net`). + +Add a **CNAME** record with your DNS provider pointing your domain to that CloudFront domain name: + +| Type | Name | Value | +| ----- | ------------------- | ------------------------------- | +| CNAME | `api.my-domain.com` | `d111111abcdef8.cloudfront.net` | + + + +DNS changes can take a few minutes to propagate. Use a service like [DNS Checker](https://dnschecker.org/) to verify that your CNAME record is live. + + + +Once propagated, the Webiny API will be accessible at your custom domain. diff --git a/docs/developer-docs/6.x/webiny-api/extend-graphql-schema.ai.txt b/docs/developer-docs/6.x/webiny-api/extend-graphql-schema.ai.txt new file mode 100644 index 000000000..f18304825 --- /dev/null +++ b/docs/developer-docs/6.x/webiny-api/extend-graphql-schema.ai.txt @@ -0,0 +1,44 @@ +AI Context: Extend the GraphQL Schema (extend-graphql-schema.mdx) + +Source of Information: +1. docs/developer-docs/6.x/graphql/about.mdx — archived about article (structure/concepts) +2. docs/developer-docs/6.x/graphql/reference.mdx — archived reference article (API signatures) +3. docs/developer-docs/6.x/graphql/example.mdx — archived example article (full query/mutation examples) +4. headless-cms/content-models-via-code.mdx — structural reference for the new format + +Key Documentation Decisions: +1. Merged the three archived graphql articles (about, reference, example) into one practical article +2. Did not carry over the old about/reference structure — the new article leads with a working example +3. Kept both a query example and a mutation example to show the pattern is symmetric +4. Used /* GraphQL */ template tag in addTypeDefs() calls — matches codebase convention +5. Explained the Result pattern inline in the "How It Works" section rather than linking to a hidden doc +6. Archived graphql/ directory articles intentionally excluded from navigation — data was correct but structure was wrong + +Understanding: +GraphQLSchemaFactory is the extension point for adding custom queries/mutations. It uses a builder pattern: +- builder.addTypeDefs(sdl) — extends the schema with new types +- builder.addResolver({ path, dependencies, resolver }) — registers resolver with DI +- path uses dot notation: "Query.myField" or "Mutation.myMutation" +- dependencies array is positional — matches resolver factory parameters in order +- resolver factory returns the actual async resolver function (double-function pattern) +- All resolver operations return structured { data, error } responses using the Result pattern + +Code Patterns: +- extend type Query / extend type Mutation to add to existing root types +- Custom response types follow { data, error } or { data, meta, error } shapes +- CmsError and CmsListMeta are built-in types available in the schema +- createImplementation wraps the class for DI registration + +Related Documents: +- docs/developer-docs/6.x/core-concepts/di.mdx — dependency injection pattern +- docs/developer-docs/6.x/core-concepts/result.mdx — Result pattern +- docs/developer-docs/6.x/reference/api/graphql.mdx — API reference + +Key Code Locations: +- packages/api-graphql — GraphQLSchemaFactory implementation +- packages/api-headless-cms — GetModelUseCase, ListPublishedEntriesUseCase, CreateEntryUseCase + +Tone Guidelines: +- Technical and practical — lead with working code +- Explain the "how it works" after the example, not before +- Same depth and style as headless-cms/content-models-via-code.mdx diff --git a/docs/developer-docs/6.x/webiny-api/extend-graphql-schema.mdx b/docs/developer-docs/6.x/webiny-api/extend-graphql-schema.mdx new file mode 100644 index 000000000..42745cbca --- /dev/null +++ b/docs/developer-docs/6.x/webiny-api/extend-graphql-schema.mdx @@ -0,0 +1,201 @@ +--- +id: nf7q3bv5 +title: Extend the GraphQL Schema +description: Learn how to add custom types, queries, and mutations to the Webiny GraphQL API using the GraphQLSchemaFactory. +--- + +import { Alert } from "@/components/Alert"; + + + +- how to add custom GraphQL types, queries, and mutations +- how to register resolvers with dependency injection +- how to handle errors in GraphQL responses using the Result pattern + + + +## Overview + +Webiny exposes a GraphQL API for all its core applications. You can extend it with your own types, queries, and mutations by implementing the `GraphQLSchemaFactory` interface. The factory receives a schema builder, you call `addTypeDefs()` and `addResolver()` on it, and Webiny merges your additions into the running schema. + +The GraphQL layer stays thin: resolvers delegate to use cases and services that carry the business logic. + +## Adding a Custom Query + +Create an extension file and implement `GraphQLSchemaFactory.Interface`: + +```typescript extensions/listCmsEntriesGraphQL.ts +import { GraphQLSchemaFactory } from "webiny/api/graphql"; +import { GetModelUseCase } from "webiny/api/cms/model"; +import { ListPublishedEntriesUseCase } from "webiny/api/cms/entry"; + +interface IListCmsEntriesArgs { + modelId: string; + limit?: number; + after?: string; +} + +class ListCmsEntriesGraphQL implements GraphQLSchemaFactory.Interface { + public async execute(builder: GraphQLSchemaFactory.SchemaBuilder): GraphQLSchemaFactory.Return { + builder.addTypeDefs(/* GraphQL */ ` + type CustomListCmsEntriesResponseItem { + id: ID! + title: String! + } + type CustomListCmsEntriesResponse { + data: [CustomListCmsEntriesResponseItem!] + meta: CmsListMeta + error: CmsError + } + + extend type Query { + listCmsEntries(modelId: ID!, limit: Int, after: String): CustomListCmsEntriesResponse! + } + `); + + builder.addResolver({ + path: "Query.listCmsEntries", + dependencies: [GetModelUseCase, ListPublishedEntriesUseCase], + resolver( + getModel: GetModelUseCase.Interface, + listEntries: ListPublishedEntriesUseCase.Interface + ) { + return async ({ args }) => { + const { modelId, limit, after } = args; + + const modelResult = await getModel.execute(modelId); + if (modelResult.isFail()) { + return { error: modelResult.error, data: null, meta: null }; + } + const model = modelResult.value; + + const entriesResult = await listEntries.execute(model, { + limit: limit ?? 10, + after: after ?? null + }); + if (entriesResult.isFail()) { + return { error: entriesResult.error, data: null, meta: null }; + } + + const { entries, meta } = entriesResult.value; + return { + data: entries.map(item => ({ + id: item.id, + title: item.values[model.titleFieldId] || "No title" + })), + meta, + error: null + }; + }; + } + }); + + return builder; + } +} + +export default GraphQLSchemaFactory.createImplementation({ + implementation: ListCmsEntriesGraphQL, + dependencies: [] +}); +``` + +Then register it in `webiny.config.tsx`: + +```tsx webiny.config.tsx +import React from "react"; +import { Api } from "webiny/extensions"; + +export const Extensions = () => { + return ( + <> + {/* ... other extensions */} + + + ); +}; +``` + +### How It Works + +- **`addTypeDefs()`** — accepts a GraphQL SDL string (use the `/* GraphQL */` tag for editor syntax highlighting). Extend built-in types with `extend type Query` or `extend type Mutation`. +- **`addResolver()`** — registers a resolver for a path in the schema (e.g. `"Query.listCmsEntries"`). The `dependencies` array lists the DI tokens that Webiny injects into the `resolver` factory in the same order. +- **Result pattern** — all use cases return a `Result` object. Check `result.isFail()` before accessing `result.value`, and return the error from the GraphQL response so clients receive structured error information. + +## Adding a Custom Mutation + +The same pattern applies for mutations — extend `Mutation` instead of `Query`: + +```typescript extensions/logMyClickGraphQL.ts +import { GraphQLSchemaFactory } from "webiny/api/graphql"; +import { GetModelUseCase } from "webiny/api/cms/model"; +import { CreateEntryUseCase } from "webiny/api/cms/entry"; + +interface ILogMyClickArgs { + id: string; + ip: string; +} + +class LogMyClickGraphQL implements GraphQLSchemaFactory.Interface { + public async execute(builder: GraphQLSchemaFactory.SchemaBuilder): GraphQLSchemaFactory.Return { + builder.addTypeDefs(/* GraphQL */ ` + type LogMyClickResponseItem { + id: ID! + ip: String! + createdOn: String! + } + type LogMyClickResponse { + data: LogMyClickResponseItem + error: CmsError + } + + extend type Mutation { + logMyClick(id: ID!, ip: String!): LogMyClickResponse! + } + `); + + builder.addResolver({ + path: "Mutation.logMyClick", + dependencies: [GetModelUseCase, CreateEntryUseCase], + resolver(getModel: GetModelUseCase.Interface, createEntry: CreateEntryUseCase.Interface) { + return async ({ args }) => { + const modelResult = await getModel.execute("logMyClickModel"); + if (modelResult.isFail()) { + return { error: modelResult.error, data: null }; + } + const model = modelResult.value; + + const result = await createEntry.execute(model, { + values: { id: args.id, ip: args.ip } + }); + if (result.isFail()) { + return { error: result.error, data: null }; + } + return { data: result.value, error: null }; + }; + } + }); + + return builder; + } +} + +export default GraphQLSchemaFactory.createImplementation({ + implementation: LogMyClickGraphQL, + dependencies: [] +}); +``` + +## Deploying Changes + +After creating or modifying a GraphQL extension, deploy the API: + +``` +yarn webiny deploy api +``` + +During development, use watch mode for automatic redeployment: + +``` +yarn webiny watch api +``` diff --git a/docs/developer-docs/6.x/website-builder/assets/page-types-funnel-dialog.png b/docs/developer-docs/6.x/website-builder/assets/page-types-funnel-dialog.png new file mode 100644 index 000000000..b296541b3 Binary files /dev/null and b/docs/developer-docs/6.x/website-builder/assets/page-types-funnel-dialog.png differ diff --git a/docs/developer-docs/6.x/website-builder/customize-page-list-columns.ai.txt b/docs/developer-docs/6.x/website-builder/customize-page-list-columns.ai.txt new file mode 100644 index 000000000..3e12b34f5 --- /dev/null +++ b/docs/developer-docs/6.x/website-builder/customize-page-list-columns.ai.txt @@ -0,0 +1,43 @@ +AI Context: Customize Page List Columns (customize-page-list-columns.mdx) + +Source of Information: +1. User-provided working code snippet using PageListConfig.Browser.Table.Column with modifiedBy.displayName example +2. packages/app-website-builder/src/modules/pages/configs/list/Browser/Table/Column.tsx — Column component, isFolderRow, useTableRow +3. packages/app-website-builder/src/modules/pages/configs/list/PageListConfig.tsx — PageListConfig shape and Browser export +4. packages/app-website-builder/src/modules/pages/PagesListConfig.tsx — default column definitions (name, createdBy, createdOn, savedOn, status, live, actions) +5. packages/app-website-builder/src/domain/Page/PageDto.ts — PageDto fields available in row.data +6. packages/app-website-builder/src/modules/pages/PagesList/components/Table/Cells/*.tsx — internal cell component patterns +7. packages/webiny/src/admin/website-builder/page/list.ts — public import path: "webiny/admin/website-builder/page/list" +8. docs/developer-docs/6.x/headless-cms/customize-entry-list-columns.mdx — structural reference (ported from CMS article) + +Key Documentation Decisions: +1. No `path` prop documented — not verified to work for page data; CMS uses `values.fieldName` but pages have a flat PageDto; user's example always uses custom cell renderer, so document that pattern only +2. No `modelIds` prop — pages have no content model concept; omitted entirely +3. PageDto table included — unlike CMS (where field names come from user-defined models), page fields are fixed and worth enumerating for discoverability +4. row.data is PageDto directly — NOT row.data.values like CMS; this is the critical difference, called out clearly +5. isFolderRow guard is mandatory — page list has folders; skipping the check causes errors on folder rows +6. Default column names listed explicitly in "Position a Column" — name, createdBy, createdOn, savedOn, status, live, actions — easier than DevTools for the common case; DevTools tip still included for completeness +7. Main example uses the user's tested modifiedBy.displayName code — verified working + +Key Differences from CMS Customize Entry List Columns: +- Import: "webiny/admin/website-builder/page/list" vs "webiny/admin/cms/entry/list" +- Config: PageListConfig vs ContentEntryListConfig +- No modelIds prop +- No path prop (use cell renderer instead) +- row.data is PageDto (flat), not { values: { ... } } +- Page data fields: id, status, version, createdBy/savedBy/modifiedBy (identity objects), createdOn/savedOn/modifiedOn, properties, live, system + +Related Documents: +- docs/developer-docs/6.x/headless-cms/customize-entry-list-columns.mdx — CMS equivalent +- docs/developer-docs/6.x/website-builder/event-handlers.mdx — other WB extensibility + +Key Code Locations: +- packages/app-website-builder/src/modules/pages/configs/list/Browser/Table/Column.tsx — Column component +- packages/app-website-builder/src/modules/pages/PagesListConfig.tsx — default columns +- packages/app-website-builder/src/domain/Page/PageDto.ts — PageDto type +- packages/webiny/src/admin/website-builder/page/list.ts — public export path + +Tone Guidelines: +- Practical reference — show code first, explain props inline +- Call out the isFolderRow guard clearly since it's a runtime error if skipped +- PageDto table helps discoverability since page fields aren't user-defined like CMS models diff --git a/docs/developer-docs/6.x/website-builder/customize-page-list-columns.mdx b/docs/developer-docs/6.x/website-builder/customize-page-list-columns.mdx new file mode 100644 index 000000000..59eb5f78f --- /dev/null +++ b/docs/developer-docs/6.x/website-builder/customize-page-list-columns.mdx @@ -0,0 +1,208 @@ +--- +id: wb4c9pnx +title: Customize Page List Columns +description: Learn how to add, replace, remove, or reposition columns in the Website Builder page list table. +--- + +import { Alert } from "@/components/Alert"; + + + +- how to add a column to the page list table +- how to render custom cell content +- how to control column position, visibility, and sortability +- how to remove or replace an existing column + + + +## Overview + +The page list table displays all pages in a folder. By default, it shows the following columns: + +- **Name** — the page title and path +- **Author** — the `createdBy` identity +- **Created** — the `createdOn` date +- **Modified** — the `savedOn` date +- **Status** — the status and version of the current page revision +- **Live** — whether any revision of the page is currently published + +Columns are configured using `PageListConfig`. You create an extension file, define your columns inside it, and register it as an [`Admin.Extension`](/{version}/reference/extensions#extension-1) in `webiny.config.tsx`. + +## Add a Column + +To add a column with a custom cell renderer, pass a React component via the `cell` prop. The component can access the current row via `useTableRow()` and `isFolderRow()` from `PageListConfig.Browser.Table.Column`: + +```tsx extensions/websiteBuilder/PagesListColumns.tsx +import React from "react"; +import { PageListConfig } from "webiny/admin/website-builder/page/list"; + +const { Browser } = PageListConfig; + +const ModifiedByCell = () => { + const { useTableRow, isFolderRow } = PageListConfig.Browser.Table.Column; + const { row } = useTableRow(); + + if (isFolderRow(row)) { + return <>{"-"}; + } + + return <>{row.data.modifiedBy.displayName}; +}; + +const PagesListColumns = () => { + return ( + + } + sortable={true} + visible={true} + /> + + ); +}; + +export default PagesListColumns; +``` + +- `name` — unique identifier for the column; also used to reference it in `before`, `after`, and `remove` +- `header` — column header label +- `cell` — React component to render each cell; receives row data via `useTableRow()` +- `useTableRow()` — returns `{ row }` with the full page data at `row.data` +- `isFolderRow(row)` — returns `true` when the row is a folder rather than a page; always handle this case to avoid rendering errors + +**Page data shape** — `row.data` is a `PageDto` with these fields available in cell renderers: + +| Field | Type | Description | +| ------------ | -------- | ------------------------------------------------- | +| `id` | `string` | Page ID | +| `status` | `string` | Current revision status (`draft`, `published`, …) | +| `version` | `number` | Revision number | +| `createdBy` | identity | `{ id, displayName, type }` | +| `createdOn` | `string` | ISO date string | +| `savedBy` | identity | `{ id, displayName, type }` | +| `savedOn` | `string` | ISO date string | +| `modifiedBy` | identity | `{ id, displayName, type }` | +| `modifiedOn` | `string` | ISO date string | +| `properties` | object | Page properties (e.g. `title`, `path`, `seo`) | +| `live` | object | Live revision info, or `null` if not published | + +## Sortable Column + +Set `sortable={true}` to allow users to sort by the column: + +```tsx +} +/> +``` + +## Column Size + +Use `size` to control the initial column width (default: `100`). The value is proportional — `200` means twice the default width. Set `resizable={false}` to prevent users from resizing the column: + +```tsx +} +/> +``` + +## Column Visibility + +By default columns are visible. Set `visible={false}` to hide a column initially — users can still show it via the column settings menu: + +```tsx +} +/> +``` + +Set `hideable={false}` to lock a column as always-visible, preventing users from toggling it off: + +```tsx +} /> +``` + +## Custom Class Names + +Use `className` to apply CSS class names to both the column header and cells: + +```tsx +} +/> +``` + +## Position a Column + +Use `before` or `after` to position a column relative to an existing one. The built-in column names are: `name`, `createdBy`, `createdOn`, `savedOn`, `status`, `live`, `actions`. + +```tsx +} +/> +``` + +## Discover Existing Column Names + +To find the names of built-in columns for use with `before`, `after`, or `remove`, use your browser's React DevTools and search for `BaseColumns`. + +## Remove a Column + +Pass `remove` to remove an existing column by name: + +```tsx + + + +``` + +## Replace a Column + +Reference an existing column by name and pass a new `cell` component to replace its renderer: + +```tsx + + {"Custom Status Cell"}} + /> + +``` + +## Registering the Extension + +Register the extension file as an [`Admin.Extension`](/{version}/reference/extensions#extension-1) in `webiny.config.tsx`: + +```tsx webiny.config.tsx +import React from "react"; +import { Admin } from "webiny/extensions"; + +export const Extensions = () => { + return ( + <> + {/* ... other extensions */} + + + ); +}; +``` diff --git a/docs/developer-docs/6.x/website-builder/multi-tenant-nextjs.ai.txt b/docs/developer-docs/6.x/website-builder/multi-tenant-nextjs.ai.txt new file mode 100644 index 000000000..b82e77955 --- /dev/null +++ b/docs/developer-docs/6.x/website-builder/multi-tenant-nextjs.ai.txt @@ -0,0 +1,53 @@ +AI Context: Multi-Tenant Next.js Setup (website-builder/multi-tenant-nextjs.mdx) + +Source of Information: +1. /Users/adrian/dev/website-builder-nextjs-presales - Internal POC codebase demonstrating the pattern +2. Slack thread (Boris → Pavel → Adrian) confirming multi-tenancy is supported and POCs exist +3. website-builder/setup-nextjs.mdx - Single-tenant baseline this article extends +4. website-builder/how-it-works.mdx - Architecture context + +Key Documentation Decisions: +1. Based on internal presales POC at ~/dev/website-builder-nextjs-presales - not a public repo +2. Simplified examples: stripped project-specific component groups (restaurant, retail, clover) from initializeContentSdk +3. Kept wb.tenant query param handling because the editor iframe passes tenant this way +4. Subdomain resolution is the example strategy — article makes clear other strategies (domain table, path prefix, cookie) are equally valid +5. Per-tenant theming kept as brief conceptual section — implementation is project-specific (requires custom fields on tenant model) +6. Universal API key recommended as default — Pavel confirmed this is a supported approach +7. ApiKeyFactory extension pattern added to show how to programmatically provision the universal key — token set as NEXT_PUBLIC_WEBSITE_BUILDER_API_KEY in Next.js env +7. Did not document the webinyApi.js GraphQL utility from presales — too project-specific +8. ContentSdkInitializer is a client component wrapping initializeContentSdk; passes tenantId from server layout to browser side + +Understanding Multi-Tenant Architecture: +- SDK apiTenant param scopes all API calls to that tenant +- Middleware is the canonical place to resolve tenant identity (runs before all rendering) +- X-Tenant header propagates tenant ID from middleware to server components +- getTenant() reads X-Tenant header; falls back to "root" when missing (build-time static generation) +- initializeContentSdk called in: generateStaticParams, generateMetadata, getPage (server), ContentSdkInitializer (client) +- Editor loads Next.js in iframe with ?wb.tenant=&wb.editing=true — middleware already handles this via wb.tenant query param check + +Key Files in Presales POC: +- src/middleware.ts — tenant from wb.tenant param; preview mode handling +- src/contentSdk/getTenant.ts — reads X-Tenant header from next/headers +- src/contentSdk/initializeContentSdk.ts — accepts tenantId, passes as apiTenant +- src/contentSdk/ContentSdkInitializer.ts — client-side wrapper (React.memo) +- src/app/layout.tsx — calls getTenant(), does dynamic theme merge, passes tenantId to ContentSdkInitializer +- src/app/[[...slug]]/page.tsx — calls initializeContentSdk({ tenantId: await getTenant() }) in all three functions + +Dynamic Theming Pattern (from presales layout.tsx): +- Fetch static base theme from getTheme() +- Fetch per-tenant dynamic theme (websiteTitle, font, primaryColor, additionalColors) from Webiny GraphQL API with X-Tenant header +- Merge: dynamic font → fonts array, dynamic colors → cssVariables, CSS injected into +- Theme stored as custom fields on tenant model in Webiny +- mergeThemes() is project-specific utility — not included in docs example + +Related Documents: +- website-builder/setup-nextjs.mdx — single-tenant baseline (prerequisite) +- website-builder/how-it-works.mdx — SDK and architecture overview +- website-builder/theme.mdx — theme configuration +- core-concepts/multi-tenancy.mdx — Webiny tenant model and provisioning + +Tone Guidelines: +- Practical and direct — this is an implementation guide for developers setting up multi-tenancy +- Show real code; explain why each piece exists +- Don't over-explain; trust the reader can adapt examples to their strategy +- Keep per-tenant theming brief — it's project-specific, not prescriptive diff --git a/docs/developer-docs/6.x/website-builder/multi-tenant-nextjs.mdx b/docs/developer-docs/6.x/website-builder/multi-tenant-nextjs.mdx new file mode 100644 index 000000000..f4a44168b --- /dev/null +++ b/docs/developer-docs/6.x/website-builder/multi-tenant-nextjs.mdx @@ -0,0 +1,283 @@ +--- +id: wbmt7n4k +title: Multi-Tenant Setup +description: Configure a single front-end application to serve content from multiple Webiny tenants based on domain, subdomain, or other request context. +--- + +import { Alert } from "@/components/Alert"; + + + +- How a single front-end app can serve content from multiple Webiny tenants +- How to resolve tenant identity from the incoming request +- How to initialize the SDK with the correct tenant per request +- Which API key strategy fits multi-tenant deployments +- How to fetch per-tenant brand colors server-side and inject them as CSS custom properties + + + +## Overview + +By default, the Website Builder SDK connects to one Webiny tenant configured via an environment variable. For SaaS platforms and multi-tenant deployments, a single front-end instance can serve content from many tenants by resolving tenant identity at request time and passing it to the SDK. + +The core idea is the same regardless of framework: resolve the tenant from the incoming request, then pass it to the SDK initializer so all API calls are scoped to that tenant. + +## Next.js + +### How Tenant Scoping Works + +The `contentSdk.init()` call accepts an `apiTenant` parameter. Normally this is set from the environment variable, but you can pass it dynamically. The SDK then scopes all API calls — page fetching, redirect resolution — to that tenant. + +``` +Request arrives + │ + ▼ +middleware.ts ← resolves tenant from hostname, subdomain, etc. + │ sets X-Tenant header + ▼ +Server component + │ + ▼ +getTenant() ← reads X-Tenant header + │ + ▼ +initializeContentSdk({ tenantId }) ← scopes SDK to tenant + │ + ▼ +contentSdk.getPage() ← fetches pages for that tenant only +``` + +### Resolving Tenant in Middleware + +Next.js middleware runs before any rendering and is the right place to resolve tenant identity from the request — subdomain, full domain, path prefix, or any other signal — and attach it as a header for downstream components. + +Create or update `src/middleware.ts`: + +```typescript src/middleware.ts +import { draftMode } from "next/headers"; +import { NextResponse, type NextRequest } from "next/server"; + +const ENABLE_DRAFT_MODE_ROUTE = "/api/preview"; + +export async function middleware(request: NextRequest) { + const { searchParams, hostname } = request.nextUrl; + const requestHeaders = new Headers(request.headers); + + // Resolve tenant from the wb.tenant query param (sent by the editor iframe), + // or fall back to subdomain-based resolution for public traffic. + const tenantId = searchParams.get("wb.tenant") ?? resolveTenantFromHostname(hostname); + + if (tenantId) { + requestHeaders.set("X-Tenant", tenantId); + } + + // Handle preview/draft mode. + const previewRequested = + searchParams.get("wb.preview") === "true" || searchParams.get("wb.editing") === "true"; + const previewMode = await draftMode(); + + if (previewRequested) { + const response = NextResponse.next({ request: { headers: requestHeaders } }); + if (previewMode.isEnabled) { + response.headers.set("Cache-Control", "no-store, no-cache, must-revalidate"); + return response; + } + const url = new URL(request.url); + url.pathname = ENABLE_DRAFT_MODE_ROUTE; + return NextResponse.redirect(url); + } else if (!previewRequested && previewMode.isEnabled) { + previewMode.disable(); + return NextResponse.redirect(request.url); + } + + return NextResponse.next({ request: { headers: requestHeaders } }); +} + +function resolveTenantFromHostname(hostname: string): string | undefined { + // Example: tenant-a.example.com → "tenant-a" + const subdomain = hostname.split(".")[0]; + return subdomain !== "www" ? subdomain : undefined; +} + +export const config = { + matcher: ["/((?!_next|api|static|favicon.ico|.well-known).*)"] +}; +``` + +The `wb.tenant` check handles editor traffic: when the Website Builder editor loads your Next.js app in an iframe, it passes the current tenant via this query parameter. Your domain-based resolution runs as a fallback for public visitors. + + + +The example above uses subdomain-based resolution. Replace `resolveTenantFromHostname` with any strategy that fits your routing — full domain matching against a lookup table, a path prefix, a cookie, or a JWT claim. + + + +### Reading Tenant in Server Components + +Add a utility that reads the `X-Tenant` header set by middleware: + +```typescript src/contentSdk/getTenant.ts +import { headers } from "next/headers"; + +export const getTenant = async (): Promise => { + try { + const headersContainer = await headers(); + return headersContainer.get("X-Tenant") ?? "root"; + } catch { + return "root"; + } +}; +``` + +The fallback to `"root"` ensures the app keeps working when no tenant header is present, for example during static generation at build time. + +### Initializing the SDK Per Request + +Update `initializeContentSdk` to accept a `tenantId` parameter. When provided, it overrides the `NEXT_PUBLIC_WEBSITE_BUILDER_API_TENANT` environment variable: + +```typescript src/contentSdk/initializeContentSdk.ts +import { contentSdk } from "@webiny/website-builder-nextjs"; + +interface ContentSdkOptions { + tenantId?: string; + preview?: boolean; +} + +export const initializeContentSdk = ({ tenantId, preview }: ContentSdkOptions = {}) => { + contentSdk.init({ + apiKey: String(process.env.NEXT_PUBLIC_WEBSITE_BUILDER_API_KEY), + apiHost: String(process.env.NEXT_PUBLIC_WEBSITE_BUILDER_API_HOST), + apiTenant: tenantId ?? String(process.env.NEXT_PUBLIC_WEBSITE_BUILDER_API_TENANT), + preview + }); +}; +``` + +Call `getTenant()` and pass the result wherever you initialize the SDK — in `generateStaticParams`, `generateMetadata`, and the page render function: + +```typescript src/app/[[...slug]]/page.tsx +import { draftMode } from "next/headers"; +import { contentSdk } from "@webiny/website-builder-nextjs"; +import { initializeContentSdk, getTenant } from "@/src/contentSdk"; + +export async function generateStaticParams() { + initializeContentSdk({ tenantId: await getTenant() }); + const pages = await contentSdk.listPages(); + return pages.map(page => ({ + slug: page.properties.path.split("/").slice(1) + })); +} + +export async function generateMetadata({ params }: PageProps) { + initializeContentSdk({ tenantId: await getTenant() }); + // ... +} + +async function getPage(path: string) { + const { isEnabled } = await draftMode(); + initializeContentSdk({ preview: isEnabled, tenantId: await getTenant() }); + return await contentSdk.getPage(path); +} +``` + +The root layout passes the tenant to the client-side `ContentSdkInitializer` component: + +```typescript src/app/layout.tsx +import { draftMode } from "next/headers"; +import { ContentSdkInitializer, getTenant } from "@/src/contentSdk"; +import { getTheme } from "@/src/theme"; + +export default async function RootLayout({ children }: { children: React.ReactNode }) { + const tenantId = await getTenant(); + const { isEnabled } = await draftMode(); + const { theme } = await getTheme(); + + return ( + + + + {children} + + + ); +} +``` + +`ContentSdkInitializer` is a memoized client component that calls `initializeContentSdk` on the browser side with the same tenant context. + +### API Key Strategy + +Two approaches work for multi-tenant deployments: + +**Universal key** — Create one API key at the root tenant level with read access across all tenants. Set it as `NEXT_PUBLIC_WEBSITE_BUILDER_API_KEY`. The `apiTenant` parameter already scopes all API calls to the correct tenant, so a single key is sufficient for most cases. + +**Per-tenant keys** — Each tenant has its own Website Builder API key (auto-created by the platform under **Settings → Access Management → API Keys**). You resolve the key per request by fetching it from your own data store or the Webiny API. This adds per-request key resolution overhead but provides stronger isolation at the credential level. + +For most SaaS deployments, a universal key is the simpler and recommended starting point. + +#### Creating a Universal API Key + +See [Universal API Keys](/{version}/webiny-api/universal-api-keys) for a complete guide on provisioning a universal API key programmatically. Once deployed, set the token as `NEXT_PUBLIC_WEBSITE_BUILDER_API_KEY` in your Next.js environment. + +### Per-Tenant Theming + +Each tenant can carry its own brand colors stored as custom fields on the Webiny tenant model (e.g. `primaryColor`, `secondaryColor`). The recommended pattern is to fetch them server-side in your page component using `@webiny/sdk`, then inject them into `` as CSS custom properties — available on the very first render with no client-side flash. + +#### Initialize the Webiny SDK + +Create a singleton `Sdk` instance using the same environment variables as the Website Builder SDK: + +```typescript src/lib/webiny.ts +import { Sdk } from "@webiny/sdk"; + +export const sdk = new Sdk({ + token: process.env.NEXT_PUBLIC_WEBSITE_BUILDER_API_KEY!, + endpoint: process.env.NEXT_PUBLIC_WEBSITE_BUILDER_API_HOST!, + tenant: process.env.NEXT_PUBLIC_WEBSITE_BUILDER_API_TENANT ?? "root" +}); +``` + +#### Fetch and inject theme colors + +Add a server-side helper that calls `sdk.tenantManager.getCurrentTenant()`, reads the custom `extensions.theme` object, and builds a `:root` CSS rule. The `extensions.theme` fields are defined via a tenant model extension — see [Extend Tenant Model](/{version}/tenant-manager/extend-tenant-model) for how to add them. This is the simplest approach; alternatively, theme data can also be stored in a single-entry Headless CMS content model and fetched via the CMS API. + +```typescript +async function getTenantThemeCss(): Promise { + const result = await sdk.tenantManager.getCurrentTenant(); + if (!result.isOk()) { + return ""; + } + const theme = ((result.value.values.extensions as any)?.theme ?? {}) as { + primaryColor?: string; + secondaryColor?: string; + }; + const primary = theme.primaryColor || "#000000"; + const secondary = theme.secondaryColor || "#000000"; + return `:root { --fub-primary-color: ${primary}; --fub-secondary-color: ${secondary}; }`; +} +``` + +Call it in parallel with your page fetch and inject the result as a `} + + + ); +} +``` + +#### Use the CSS variables in components + +Any client component can now reference the variables directly — no props, no context: + +```tsx + +``` + +The custom properties are set on `:root` before any React hydration, so the correct tenant colors are always visible on first paint. diff --git a/docs/developer-docs/6.x/website-builder/page-types.ai.txt b/docs/developer-docs/6.x/website-builder/page-types.ai.txt new file mode 100644 index 000000000..4adfdd9b2 --- /dev/null +++ b/docs/developer-docs/6.x/website-builder/page-types.ai.txt @@ -0,0 +1,39 @@ +AI Context: Page Types (page-types.mdx) + +Source of Information: +1. extensions/funnelBuilder/pageType/index.tsx — user-provided working sample (PageListConfig.PageType usage) +2. extensions/funnelBuilder/pageType/FunnelPageForm.tsx — user-provided form component (Bind, UnsetOnUnmount, useForm, pagePathFromTitle) +3. packages/app-website-builder/src/modules/pages/configs/list/PageType.tsx — PageTypeProps type definition (name, label, element, remove) +4. packages/app-website-builder/src/modules/pages/configs/list/PageListConfig.tsx — PageListConfig exports PageType +5. packages/app-website-builder/src/modules/pages/PagesList/components/Main/CreatePage/CreatePage.tsx — how the dialog works: type selector dropdown, element rendering, metadata.pageType, properties passthrough +6. packages/app-website-builder/src/modules/pages/PagesList/components/Main/CreatePage/StaticPageForm.tsx — built-in static form pattern +7. packages/app-website-builder/src/features/pageTypes/PageType.ts — PageType domain type +8. packages/webiny/src/admin/website-builder.ts — pagePathFromTitle public export path + +Key Documentation Decisions: +1. Explained the dialog mechanics upfront (type selector + form, metadata.pageType storage) — this context explains why the pattern works +2. UnsetOnUnmount is called out explicitly — easy to forget; causes stale data bugs when switching types +3. Single-type auto-skip behavior documented ("dropdown skipped when only one type") — discovered from CreatePage.tsx (auto-select logic) +4. Validators shown inline (simple arrow function) — avoids introducing unknown validator utility imports; user's code used a local `required` import +5. Kept the FunnelPageForm example close to user's tested code; cleaned up validator syntax +6. pagePathFromTitle utility documented in-context rather than a separate section — it's a one-liner utility, inline explanation suffices + +Understanding: +PageType registration works through usePageTypes() which manages a Map of name -> PageType entries. addPageType adds an entry, removePageType removes by name. The CreatePage dialog renders the selected type's `element` inside a form context. On submit, `formData.properties` and `formData.extensions` and `formData.metadata` are spread into CreatePageParams, with `metadata.pageType: type` always set. This means the form's Bind fields under properties.* become page properties. + +The `element` is rendered inside a `` that already wraps the type selector, so Grid.Column is used directly (no nested Grid needed). + +Related Documents: +- docs/developer-docs/6.x/website-builder/customize-page-list-columns.mdx — PageListConfig usage for table columns +- docs/developer-docs/6.x/website-builder/custom-component.mdx — other WB extensibility + +Key Code Locations: +- packages/app-website-builder/src/modules/pages/configs/list/PageType.tsx — PageTypeProps +- packages/app-website-builder/src/modules/pages/PagesList/components/Main/CreatePage/CreatePage.tsx — dialog logic +- packages/webiny/src/admin/website-builder.ts — pagePathFromTitle export +- packages/app-website-builder/src/modules/pages/PagesList/components/Main/CreatePage/StaticPageForm.tsx — reference form + +Tone Guidelines: +- Practical and complete — show both the form and the registration together +- Explain the "why" behind UnsetOnUnmount and metadata.pageType storage +- Keep the example grounded in the funnel builder use case from the sample code diff --git a/docs/developer-docs/6.x/website-builder/page-types.mdx b/docs/developer-docs/6.x/website-builder/page-types.mdx new file mode 100644 index 000000000..2aac6730d --- /dev/null +++ b/docs/developer-docs/6.x/website-builder/page-types.mdx @@ -0,0 +1,134 @@ +--- +id: pb7r3kx2 +title: Page Types +description: Learn how to add custom page types to the Website Builder's Create Page dialog. +--- + +import { Alert } from "@/components/Alert"; +import { Image } from "@/components/Image"; +import pageTypesFunnelDialog from "./assets/page-types-funnel-dialog.png"; + + + +- what page types are and how they work +- how to register a custom page type with its own creation form +- how to remove the built-in page type + + + +## Overview + +When a user clicks **Create Page** in the Website Builder, a dialog appears with a **Page Type** dropdown and a form below it. Selecting a type changes the form, letting each type collect the properties it needs before the page is created. + +By default, only the **Static Page** type is registered. It collects a title and a URL path. Page types are registered via `PageListConfig.PageType` — you define a name, a dropdown label, and a React element that renders the creation form. + +The form fields bind directly to the page properties that will be persisted when the dialog is confirmed. Fields under `properties.*` end up on the page's `properties` object. The page type name itself is stored on `metadata.pageType`, making it available for conditional rendering, routing, or API filtering later. + + + +## Add a Page Type + +A custom page type consists of two parts: a form component and a `PageListConfig.PageType` registration. + +### The Form Component + +The form component renders inside the Create Page dialog below the type selector. Use `Bind` and `useForm` from `webiny/admin/form` to connect fields to the page data, and `UnsetOnUnmount` to clean up field values when the user switches to a different page type: + +```tsx extensions/funnelBuilder/pageType/FunnelPageForm.tsx +import React from "react"; +import { Grid, Input } from "webiny/admin/ui"; +import { pagePathFromTitle } from "webiny/admin/website-builder"; +import type { FormApi } from "webiny/admin/form"; +import { Bind, UnsetOnUnmount, useForm } from "webiny/admin/form"; + +const generatePath = (form: FormApi) => () => { + const title = form.getValue("properties.title"); + form.setValue("properties.path", `/funnel/${pagePathFromTitle(title ?? "")}`); +}; + +export const FunnelPageForm = () => { + const form = useForm(); + + return ( + <> + + + !value && "Title is required."}> + + + + + + + !value && "Path is required."}> + + + + + + ); +}; +``` + +- `Bind name={"properties.title"}` — binds the input to `properties.title` on the new page +- `UnsetOnUnmount` — clears the field value when the user switches to a different page type in the dropdown, preventing stale data from being submitted +- `useForm()` — gives access to `getValue` and `setValue` for reading and updating other fields, useful for auto-generating the path from the title +- `pagePathFromTitle` — utility that converts a human-readable title to a URL-safe path segment (e.g. `"My Funnel Page"` → `"my-funnel-page"`) + +### Registering the Page Type + +Create an extension that uses `PageListConfig.PageType` to register the new type: + +```tsx extensions/funnelBuilder/pageType/index.tsx +import React from "react"; +import { PageListConfig } from "webiny/admin/website-builder/page/list"; +import { FunnelPageForm } from "./FunnelPageForm.js"; + +export default () => { + return ( + + } /> + + ); +}; +``` + +### PageType Properties + +| Prop | Type | Description | +| --------- | ----------------- | ----------------------------------------------------------------------------- | +| `name` | `string` | Unique identifier stored on `metadata.pageType` when created | +| `label` | `string` | Label shown in the Page Type dropdown | +| `element` | `React.ReactNode` | Form rendered in the dialog when this type is selected | +| `remove` | `boolean` | When `true`, removes an existing type by `name`; other props are not required | + +## Remove a Page Type + +To remove the built-in **Static Page** type — for example, when replacing it entirely with your own type — pass `remove`: + +```tsx + + + } /> + +``` + +With the static type removed, the dropdown is skipped automatically when there is only one type registered — the dialog goes straight to the form. + +## Registering the Extension + +Register the extension file as an [`Admin.Extension`](/{version}/reference/extensions#extension-1) in `webiny.config.tsx`: + +```tsx webiny.config.tsx +import React from "react"; +import { Admin } from "webiny/extensions"; + +export const Extensions = () => { + return ( + <> + {/* ... other extensions */} + + + ); +}; +``` diff --git a/generator/src/components/navigation.tsx b/generator/src/components/navigation.tsx index 1497fc046..8047c6df4 100644 --- a/generator/src/components/navigation.tsx +++ b/generator/src/components/navigation.tsx @@ -140,12 +140,14 @@ interface SeparatorProps { remove?: boolean; before?: string; after?: string; + title?: string; } -export const Separator = ({ after, before, remove }: SeparatorProps) => { +export const Separator = ({ after, before, remove, title }: SeparatorProps) => { return ( + {title ? : null} ); }; diff --git a/package.json b/package.json index f43ca71f2..708e6d3fd 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "lint:fix": "yarn format && yarn eslint", "get-id": "node -e 'console.log(require(\"@webiny/utils\").mdbid().slice(-8))'", "validate:mdx": "tsx scripts/validate-mdx-pairing.ts", + "generate-sdk-reference": "tsx scripts/generate-sdk-reference.ts", "generate:reference": "tsx scripts/generate-reference.ts", "generate:changelog": "tsx scripts/generate-changelog.ts", "generate:upgrade-guide": "tsx scripts/generate-upgrade-guide.ts", @@ -112,7 +113,7 @@ "@typescript-eslint/parser": "2.x", "babel-eslint": "10.x", "concurrently": "^7.2.2", - "dotenv": "^17.3.1", + "dotenv": "^17.4.1", "eslint": "7.x", "eslint-config-react-app": "^5.2.1", "eslint-plugin-flowtype": "4.x", diff --git a/public/menu-icons/api.svg b/public/menu-icons/api.svg new file mode 100644 index 000000000..cfbe8dc3a --- /dev/null +++ b/public/menu-icons/api.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/scripts/generate-reference.ts b/scripts/generate-reference.ts deleted file mode 100644 index cd0e087e4..000000000 --- a/scripts/generate-reference.ts +++ /dev/null @@ -1,2478 +0,0 @@ -/** - * Reference Documentation Generator - * - * Reads every export path from packages/webiny/src/, resolves each exported - * symbol back to its originating @webiny/* source file, extracts TypeScript - * interface signatures + JSDoc comments + namespace types, and writes: - * - One .mdx page per webiny/* entry point - * - One .ai.txt companion per page - * - * Then rewrites the Reference in navigation.tsx with all generated pages. - * - * Usage: yarn generate:reference - */ - -import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs"; -import { join, dirname } from "path"; -import { Project, SourceFile, SyntaxKind, Node } from "ts-morph"; -import slugify from "@sindresorhus/slugify"; - -// --------------------------------------------------------------------------- -// Config -// --------------------------------------------------------------------------- - -const WEBINY_PKG = "/Users/adrian/dev/wby-next/packages/webiny"; -const WEBINY_MONOREPO = "/Users/adrian/dev/wby-next/packages"; -const DOCS_ROOT = join(process.cwd(), "docs/developer-docs/6.x"); -const REF_DIR = join(DOCS_ROOT, "reference"); -const NAV_FILE = join(DOCS_ROOT, "navigation.tsx"); - -// Module-level package path map, populated in main() before any extraction -let PKG_MAP: Map = new Map(); - -// --------------------------------------------------------------------------- -// Types -// --------------------------------------------------------------------------- - -interface ExportEntry { - /** The local alias used in the barrel (what consumers import) */ - exportedName: string; - /** Original name in the source file (before `as` rename) */ - originalName: string; - /** Absolute path to the originating source .ts file */ - sourceFile: string; - /** Whether it's a type-only export */ - isTypeOnly: boolean; -} - -interface InterfaceMember { - /** e.g. "execute(model: CmsModel, input: Input): Promise>" */ - signature: string; - /** JSDoc on this specific member */ - jsDoc: string; -} - -interface ResolvedTypeFields { - /** The interface/type name that was resolved (e.g. "AppInstallationData") */ - typeName: string; - /** Whether it was an array (e.g. InstallSystemInput = AppInstallationData[]) */ - isArray: boolean; - /** JSDoc on the resolved interface */ - jsDoc: string; - /** The fields of the resolved object interface */ - fields: EventPayloadField[]; -} - -interface NamespaceMember { - /** e.g. "Interface" */ - name: string; - /** e.g. "ICreateEntryUseCase" or "Promise>" */ - value: string; - /** Resolved fields if the type alias points to a plain object interface */ - resolvedFields?: ResolvedTypeFields; - /** Resolved interface members if the type alias points to a method interface (e.g. Foo.Interface) */ - resolvedMembers?: { members: InterfaceMember[]; jsDoc: string }; -} - -interface EventPayloadField { - name: string; - typeText: string; - optional: boolean; -} - -type AbstractionKind = "useCase" | "eventHandler" | "service"; - -interface ExtractedSymbol { - name: string; - kind: - | "abstraction" - | "interface" - | "class" - | "namespace" - | "function" - | "variable" - | "type" - | "enum" - | "other"; - isTypeOnly: boolean; - /** Full text of the declaration (interface body, class signature, etc.) */ - declarationText: string; - /** JSDoc comment attached to the declaration */ - jsDoc: string; - /** Namespace members if kind === 'namespace' */ - namespaceMembers: string[]; - sourceFile: string; - - // --- Abstraction-specific enrichment --- - /** Set when kind === 'abstraction' */ - abstractionKind?: AbstractionKind; - /** The resolved Interface members (from IFoo that createAbstraction wraps) */ - interfaceMembers?: InterfaceMember[]; - /** JSDoc on the IFoo interface itself (description paragraph) */ - interfaceJsDoc?: string; - /** Resolved namespace type members: Interface, Input, Return, Error, Event, etc. */ - namespaceTypes?: NamespaceMember[]; - /** For eventHandler: the payload fields of the event */ - eventPayloadFields?: EventPayloadField[]; - /** For eventHandler: the event type name e.g. "EntryBeforeCreateEvent" */ - eventTypeName?: string; - /** For eventHandler: the payload interface name */ - eventPayloadName?: string; -} - -interface EntryPointDoc { - /** e.g. "webiny/api/cms/entry" */ - importPath: string; - /** e.g. "api/cms/entry" */ - relPath: string; - /** Human-readable title */ - title: string; - /** Short description */ - description: string; - /** All symbols exported from this entry point */ - symbols: ExtractedSymbol[]; -} - -// --------------------------------------------------------------------------- -// Helpers -// --------------------------------------------------------------------------- - -function randomId(): string { - return Math.random().toString(36).slice(2, 10).padEnd(8, "0").slice(0, 8); -} - -/** Convert a barrel-relative path to a human title: "api/cms/entry" -> "CMS Entry" */ -function toTitle(relPath: string): string { - const parts = relPath.split("/"); - const last = parts[parts.length - 1]; - - const specialCases: Record = { - api: "API", - cms: "CMS", - graphql: "GraphQL", - ui: "UI", - aco: "ACO", - cli: "CLI", - infra: "Infrastructure", - extensions: "Extensions", - admin: "Admin", - index: "Overview", - buildParams: "Build Params", - eventPublisher: "Event Publisher", - keyValueStore: "Key-Value Store", - tenancy: "Tenancy", - security: "Security", - system: "System", - tasks: "Tasks", - logger: "Logger", - entry: "Entry", - group: "Group", - model: "Model", - field: "Field", - page: "Page", - redirect: "Redirect", - nextjs: "Next.js", - apiKey: "API Key", - authentication: "Authentication", - role: "Role", - user: "User", - lexical: "Lexical Editor", - form: "Form", - router: "Router", - localStorage: "Local Storage", - envConfig: "Env Config", - graphqlClient: "GraphQL Client", - configs: "Configs", - "website-builder": "Website Builder", - "tenant-manager": "Tenant Manager", - command: "Command", - core: "Core" - }; - - const section = - specialCases[last] ?? last.replace(/-/g, " ").replace(/\b\w/g, c => c.toUpperCase()); - const parentSection = - parts.length > 1 ? (specialCases[parts[parts.length - 2]] ?? parts[parts.length - 2]) : ""; - - // Compose a meaningful title from last two segments - if (parts.length === 1) return section; - if (last === "index") return parentSection; - return section; -} - -/** Derive a description string from the entry point path */ -function toDescription(relPath: string): string { - const map: Record = { - api: "Core API primitives: createFeature, createAbstraction, Result, BaseError", - "api/logger": "Logger abstraction for server-side logging", - "api/graphql": "GraphQL schema factory and response helpers", - "api/eventPublisher": "Domain event publishing primitives", - "api/keyValueStore": "Key-value store abstraction", - "api/buildParams": "API build parameter types", - "api/tasks": "Background task abstractions: TaskService, TaskDefinition", - "api/system": "System installation abstractions", - "api/tenancy": "Tenancy context and tenant management", - "api/tenant-manager": "Tenant manager abstractions", - "api/security": "Security primitives: Identity, Authenticator, Authorizer", - "api/security/apiKey": "API key use cases and event handlers", - "api/security/authentication": "Authentication event handlers", - "api/security/role": "Role use cases and event handlers", - "api/security/user": "User use cases and event handlers", - "api/cms/entry": "CMS entry use cases and event handlers", - "api/cms/group": "CMS group use cases and event handlers", - "api/cms/model": "CMS model builders, factories, use cases and event handlers", - "api/website-builder/page": "Website Builder page use cases and event handlers", - "api/website-builder/redirect": "Website Builder redirect use cases and event handlers", - "api/website-builder/nextjs": "Next.js configuration abstraction", - admin: "Admin app core: createFeature, createAbstraction, Provider, Plugin", - "admin/ui": "Admin UI component library", - "admin/form": "Form primitives: Bind, Form, useForm, validation", - "admin/aco": "ACO (Advanced Content Organisation) hooks and utilities", - "admin/buildParams": "Admin build parameter types", - "admin/cms": "CMS admin hooks, types and utilities", - "admin/cms/entry/editor": "Content entry editor components and hooks", - "admin/cms/entry/list": "Content entry list configuration", - "admin/cms/fieldRenderers/dynamicZone": "Dynamic zone field renderer components", - "admin/cms/fieldRenderers/object": "Object field renderer components", - "admin/cms/lexical": "CMS Lexical rich-text editor config", - "admin/configs": "Admin configuration types", - "admin/envConfig": "Environment configuration for admin", - "admin/graphqlClient": "GraphQL client hooks and utilities", - "admin/localStorage": "Local storage abstraction and hooks", - "admin/lexical": "Lexical editor components and hooks", - "admin/router": "Router components and hooks", - "admin/security": "Admin security: authentication, identity, permissions", - "admin/tenancy": "Admin tenancy hooks and context", - "admin/website-builder": "Website Builder admin utilities", - "admin/website-builder/lexical": "Website Builder Lexical editor config", - "admin/website-builder/page/editor": "Page editor components", - "admin/website-builder/page/list": "Page list configuration", - "admin/website-builder/redirect/list": "Redirect list configuration", - extensions: "Project extension wiring: Api, Admin, Cli, Infra, Project, EnvVar, FeatureFlags", - "infra/index": "Infrastructure primitives: Logger, Ui, lifecycle hooks", - "infra/api": "API infrastructure lifecycle hooks and Pulumi abstraction", - "infra/admin": "Admin infrastructure lifecycle hooks and Pulumi abstraction", - "infra/core": "Core infrastructure lifecycle hooks and Pulumi abstraction", - "cli/index": "CLI-scoped Logger and Ui abstractions", - "cli/command": "CLI command factory abstraction" - }; - return map[relPath] ?? `Reference for webiny/${relPath}`; -} - -// --------------------------------------------------------------------------- -// Path resolution: @webiny/pkg/path.js -> absolute filesystem path -// --------------------------------------------------------------------------- - -/** Build a map of @webiny/* package names to their src/ directories */ -function buildPackagePathMap(): Map { - const map = new Map(); - const entries = readFileSync(join(WEBINY_PKG, "tsconfig.json"), "utf-8"); - // strip comments from tsconfig (it's not valid JSON) - const cleaned = entries.replace(/\/\/[^\n]*/g, "").replace(/\/\*[\s\S]*?\*\//g, ""); - const tsconfig = JSON.parse(cleaned); - const paths: Record = tsconfig?.compilerOptions?.paths ?? {}; - - for (const [alias, targets] of Object.entries(paths)) { - if (!alias.startsWith("@webiny/")) continue; - const rawTarget = targets[0]; - if (!rawTarget) continue; - // e.g. "../api-core/src/*" -> /abs/path/to/api-core/src - const resolved = join(WEBINY_PKG, rawTarget.replace(/\/\*$/, "").replace(/\*$/, "")); - // strip trailing /src to get the package root, store both with and without - const pkgAlias = alias.replace(/\/\*$/, ""); - map.set(pkgAlias, resolved); - } - return map; -} - -/** Resolve "@webiny/api-core/features/task/TaskDefinition/index.js" to absolute path */ -function resolveWebinyImport(importPath: string, pkgMap: Map): string | null { - for (const [alias, srcDir] of Array.from(pkgMap.entries())) { - if (importPath.startsWith(alias + "/")) { - const rest = importPath.slice(alias.length + 1).replace(/\.js$/, ".ts"); - return join(srcDir, rest); - } - if (importPath === alias) { - return join(srcDir, "index.ts"); - } - } - return null; -} - -// --------------------------------------------------------------------------- -// Barrel parsing: collect all re-exported names from a barrel .ts file -// --------------------------------------------------------------------------- - -function parseBarrel(sf: SourceFile, pkgMap: Map): ExportEntry[] { - const entries: ExportEntry[] = []; - - for (const decl of sf.getExportDeclarations()) { - const moduleSpecifier = decl.getModuleSpecifierValue(); - if (!moduleSpecifier) continue; - - const resolvedPath = resolveWebinyImport(moduleSpecifier, pkgMap); - if (!resolvedPath) continue; - - const isTypeOnly = decl.isTypeOnly(); - const namedExports = decl.getNamedExports(); - - if (namedExports.length === 0) { - // export * from "..." - entries.push({ - exportedName: "*", - originalName: "*", - sourceFile: resolvedPath, - isTypeOnly - }); - } else { - for (const ne of namedExports) { - entries.push({ - exportedName: ne.getAliasNode()?.getText() ?? ne.getNameNode().getText(), - originalName: ne.getNameNode().getText(), - sourceFile: resolvedPath, - isTypeOnly: isTypeOnly || ne.isTypeOnly() - }); - } - } - } - - return entries; -} - -// --------------------------------------------------------------------------- -// Symbol extraction from a source file -// --------------------------------------------------------------------------- - -function extractJsDoc(node: Node): string { - const jsDocNodes = node.getChildrenOfKind(SyntaxKind.JSDoc); - if (jsDocNodes.length === 0) return ""; - return jsDocNodes - .map(jd => jd.getInnerText().trim()) - .filter(Boolean) - .join("\n"); -} - -/** Returns true if a node has an @internal JSDoc tag */ -function isInternalNode(node: Node): boolean { - const jsDocNodes = node.getChildrenOfKind(SyntaxKind.JSDoc); - return jsDocNodes.some(jd => jd.getText().includes("@internal")); -} - -function cleanDeclarationText(text: string): string { - return text - .replace(/\{[\s\S]*\}/g, match => { - if (match.length < 200 && !match.includes("return ") && !match.includes("const ")) { - return match; - } - return "{ ... }"; - }) - .trim(); -} - -// Isolated project for interface extraction (avoids cross-file resolution issues) -let _isolatedProject: Project | null = null; -function getIsolatedProject(): Project { - if (!_isolatedProject) { - _isolatedProject = new Project({ - useInMemoryFileSystem: false, - skipAddingFilesFromTsConfig: true - }); - } - return _isolatedProject; -} - -/** - * Search a source file (and any files it re-exports from) for an interface by name. - * Returns the interface members and interface-level JSDoc, or empty if not found. - */ -interface InterfaceResult { - members: InterfaceMember[]; - jsDoc: string; -} - -function extractInterfaceMembers( - sf: SourceFile, - interfaceName: string, - pkgMap?: Map, - visited = new Set() -): InterfaceResult { - const filePath = sf.getFilePath(); - if (visited.has(filePath)) return { members: [], jsDoc: "" }; - visited.add(filePath); - - // Search all interfaces in this file - const allIfaces = [ - ...sf.getInterfaces(), - ...sf.getStatements().filter(Node.isInterfaceDeclaration) - ].filter(Node.isInterfaceDeclaration); - - const iface = allIfaces.find(i => i.getName() === interfaceName); - if (iface) { - return { - members: iface - .getMembers() - .filter(m => !isInternalNode(m)) - .map(m => ({ - signature: m.getText().trim().replace(/;$/, ""), - jsDoc: extractJsDoc(m) - })), - jsDoc: extractJsDoc(iface) - }; - } - - // Raw text fallback for this file (no JSDoc available here) - const src = sf.getFullText(); - const rawMatch = src.match( - new RegExp(`interface\\s+${interfaceName}\\s*(?:<[^{]*>)?\\s*\\{([^}]+)\\}`) - ); - if (rawMatch) { - return { - members: rawMatch[1] - .split("\n") - .map(l => l.trim()) - .filter(l => l && !l.startsWith("//") && l !== "{" && l !== "}") - .map(l => ({ signature: l.replace(/;$/, ""), jsDoc: "" })), - jsDoc: "" - }; - } - - // Follow re-exports into sibling files (handles index.ts -> abstractions.ts pattern) - if (pkgMap) { - for (const decl of sf.getExportDeclarations()) { - const modSpec = decl.getModuleSpecifierValue(); - if (!modSpec) continue; - - let resolvedPath: string | null = null; - if (modSpec.startsWith(".")) { - const dir = sf.getDirectoryPath(); - resolvedPath = join(dir, modSpec.replace(/\.js$/, ".ts")); - } else { - resolvedPath = resolveWebinyImport(modSpec, pkgMap); - } - - if (!resolvedPath || !existsSync(resolvedPath)) continue; - - try { - const siblingSf = sf.getProject().addSourceFileAtPath(resolvedPath); - const result = extractInterfaceMembers(siblingSf, interfaceName, pkgMap, visited); - if (result.members.length > 0) return result; - } catch { - continue; - } - } - } - - return { members: [], jsDoc: "" }; -} - -/** Extract fields from an interface declaration as EventPayloadField[] */ -function extractPayloadFields(sf: SourceFile, interfaceName: string): EventPayloadField[] { - // Try AST first - const iface = [ - ...sf.getInterfaces(), - ...sf.getStatements().filter(Node.isInterfaceDeclaration) - ].find(i => Node.isInterfaceDeclaration(i) && i.getName() === interfaceName); - - if (iface && Node.isInterfaceDeclaration(iface)) { - return iface.getProperties().map(p => ({ - name: p.getName(), - typeText: p.getTypeNode()?.getText() ?? "unknown", - optional: p.hasQuestionToken() - })); - } - - // Raw text fallback - const src = sf.getFullText(); - const regex = new RegExp(`interface\\s+${interfaceName}\\s*\\{([^}]+)\\}`); - const match = src.match(regex); - if (!match) return []; - - return match[1] - .split("\n") - .map(l => l.trim()) - .filter(l => l && !l.startsWith("//")) - .map(l => { - const propMatch = l.match(/^(\w+)(\?)?:\s*(.+?);?$/); - if (!propMatch) return null; - return { name: propMatch[1], typeText: propMatch[3], optional: !!propMatch[2] }; - }) - .filter((f): f is EventPayloadField => f !== null); -} - -/** - * Resolve a module specifier to an absolute .ts file path. - * Handles: relative ("./" "../"), @webiny/* aliases, and "~/*" (local src alias). - */ -function resolveModuleSpecifier( - sf: SourceFile, - modSpec: string, - pkgMap: Map -): string | null { - if (modSpec.startsWith(".")) { - return join(sf.getDirectoryPath(), modSpec.replace(/\.js$/, ".ts")); - } - if (modSpec.startsWith("~/")) { - // "~/" maps to the "src/" root of the current package. - // Walk up from the current file to find the "src" directory boundary. - const parts = sf.getFilePath().split("/"); - const srcIdx = parts.lastIndexOf("src"); - if (srcIdx !== -1) { - const srcRoot = parts.slice(0, srcIdx + 1).join("/"); - return join(srcRoot, modSpec.slice(2).replace(/\.js$/, ".ts")); - } - return null; - } - return resolveWebinyImport(modSpec, pkgMap); -} - -/** - * Resolve a "Namespace.Interface" type reference to interface members. - * e.g. "GraphQLSchemaBuilder.Interface" → finds GraphQLSchemaBuilder's IGraphQLSchemaBuilder interface. - */ -function resolveNamespaceDotInterface( - sf: SourceFile, - typeText: string, - pkgMap: Map -): { members: InterfaceMember[]; jsDoc: string } | null { - // Only handle Foo.Interface pattern - const m = typeText.match(/^(\w+)\.Interface$/); - if (!m) return null; - const abstractionName = m[1]; - - // Find where abstractionName is imported from - for (const decl of sf.getImportDeclarations()) { - const named = decl.getNamedImports().find(n => n.getName() === abstractionName); - if (!named) continue; - const modSpec = decl.getModuleSpecifierValue(); - const resolvedPath = resolveModuleSpecifier(sf, modSpec, pkgMap); - if (!resolvedPath || !existsSync(resolvedPath)) continue; - try { - const targetSf = sf.getProject().addSourceFileAtPath(resolvedPath); - // In the target file, find createAbstraction for this name and extract IFoo - const exported = targetSf.getExportedDeclarations(); - const decls = exported.get(abstractionName); - if (!decls) continue; - const varDecl = decls.find(d => Node.isVariableDeclaration(d)); - if (!varDecl || !Node.isVariableDeclaration(varDecl)) continue; - const genericArg = getCreateAbstractionGeneric(varDecl); - if (!genericArg) continue; - const nodeSf = varDecl.getSourceFile(); - return extractInterfaceMembers(nodeSf, genericArg, pkgMap).members.length > 0 - ? extractInterfaceMembers(nodeSf, genericArg, pkgMap) - : null; - } catch { - continue; - } - } - return null; -} - -/** - * Given a type alias name (e.g. "InstallSystemInput") in a source file, resolves it to - * an object interface and returns its fields. Only resolves simple aliases: - * type Foo = SomeInterface → fields of SomeInterface - * type Foo = SomeInterface[] → fields of SomeInterface (isArray=true) - * Skips generics, unions, Promise<...>, primitives, etc. - * Follows re-exports into sibling files. - */ -function resolveTypeToFields( - sf: SourceFile, - typeName: string, - pkgMap: Map, - visited = new Set() -): ResolvedTypeFields | null { - const filePath = sf.getFilePath(); - if (visited.has(filePath)) return null; - visited.add(filePath); - - // Find the type alias in this file - const typeAlias = sf.getTypeAliases().find(t => t.getName() === typeName); - if (typeAlias) { - const typeNode = typeAlias.getTypeNode(); - if (!typeNode) return null; - const typeText = typeNode.getText().trim(); - - // Skip anything with generics, unions, intersections, Promise, or primitives - if ( - typeText.includes("<") || - typeText.includes("|") || - typeText.includes("&") || - typeText === "string" || - typeText === "number" || - typeText === "boolean" || - typeText === "any" || - typeText === "void" || - typeText === "unknown" - ) { - return null; - } - - // Array alias: type Foo = Bar[] - const arrayMatch = typeText.match(/^(\w+)\[\]$/); - if (arrayMatch) { - const innerName = arrayMatch[1]; - const inner = resolveInterfaceFields(sf, innerName, pkgMap); - if (!inner) return null; - return { typeName: innerName, isArray: true, jsDoc: inner.jsDoc, fields: inner.fields }; - } - - // Direct alias: type Foo = Bar - if (/^\w+$/.test(typeText)) { - const inner = resolveInterfaceFields(sf, typeText, pkgMap); - if (!inner) return null; - return { typeName: typeText, isArray: false, jsDoc: inner.jsDoc, fields: inner.fields }; - } - - return null; - } - - // Follow re-exports - for (const decl of sf.getExportDeclarations()) { - const modSpec = decl.getModuleSpecifierValue(); - if (!modSpec) continue; - const resolvedPath = resolveModuleSpecifier(sf, modSpec, pkgMap); - if (!resolvedPath || !existsSync(resolvedPath)) continue; - try { - const siblingSf = sf.getProject().addSourceFileAtPath(resolvedPath); - const result = resolveTypeToFields(siblingSf, typeName, pkgMap, visited); - if (result) return result; - } catch { - continue; - } - } - - return null; -} - -/** - * Find an interface by name in a source file (or via imports) and return its fields + JSDoc. - */ -function resolveInterfaceFields( - sf: SourceFile, - interfaceName: string, - pkgMap: Map, - visited = new Set() -): { fields: EventPayloadField[]; jsDoc: string } | null { - const filePath = sf.getFilePath(); - if (visited.has(filePath)) return null; - visited.add(filePath); - - // Look for the interface in this file - const allIfaces = [ - ...sf.getInterfaces(), - ...sf.getStatements().filter(Node.isInterfaceDeclaration) - ].filter(Node.isInterfaceDeclaration); - - const iface = allIfaces.find(i => i.getName() === interfaceName); - if (iface) { - const fields = iface - .getProperties() - .filter(p => !isInternalNode(p)) - .map(p => ({ - name: p.getName(), - typeText: p.getTypeNode()?.getText() ?? "unknown", - optional: p.hasQuestionToken() - })); - return { fields, jsDoc: extractJsDoc(iface) }; - } - - // Follow named imports - for (const decl of sf.getImportDeclarations()) { - const named = decl.getNamedImports().find(n => n.getName() === interfaceName); - if (!named) continue; - const modSpec = decl.getModuleSpecifierValue(); - const resolvedPath = resolveModuleSpecifier(sf, modSpec, pkgMap); - if (!resolvedPath || !existsSync(resolvedPath)) continue; - try { - const siblingSf = sf.getProject().addSourceFileAtPath(resolvedPath); - const result = resolveInterfaceFields(siblingSf, interfaceName, pkgMap, visited); - if (result) return result; - } catch { - continue; - } - } - - // Follow re-exports (export * from "..." or export { X } from "...") - for (const decl of sf.getExportDeclarations()) { - const namedExports = decl.getNamedExports(); - // Only follow if it's export * or exports our interface name - if (namedExports.length > 0 && !namedExports.some(n => n.getName() === interfaceName)) continue; - const modSpec = decl.getModuleSpecifierValue(); - if (!modSpec) continue; - const resolvedPath = resolveModuleSpecifier(sf, modSpec, pkgMap); - if (!resolvedPath || !existsSync(resolvedPath)) continue; - try { - const siblingSf = sf.getProject().addSourceFileAtPath(resolvedPath); - const result = resolveInterfaceFields(siblingSf, interfaceName, pkgMap, visited); - if (result) return result; - } catch { - continue; - } - } - - return null; -} - -/** Extract namespace type members as NamespaceMember[] */ -function extractNamespaceTypes(sf: SourceFile, namespaceName: string): NamespaceMember[] { - const allModules = sf.getModules(); - const ns = allModules.find(m => m.getName() === namespaceName); - if (!ns) return []; - - const body = ns.getBody(); - if (!body || !Node.isModuleBlock(body)) return []; - - const members: NamespaceMember[] = []; - for (const stmt of body.getStatements()) { - if (Node.isTypeAliasDeclaration(stmt)) { - const typeNode = stmt.getTypeNode(); - members.push({ - name: stmt.getName(), - value: typeNode?.getText() ?? stmt.getText() - }); - } else if (Node.isInterfaceDeclaration(stmt)) { - members.push({ name: stmt.getName() ?? "", value: "interface" }); - } else if (Node.isExportDeclaration(stmt)) { - members.push({ name: "", value: stmt.getText() }); - } - } - return members.filter(m => m.name); -} - -/** - * If a variable declaration is `createAbstraction(...)` or - * `createAbstraction>(...)`, return the generic arg text. - * Handles nested generics by counting angle brackets. - */ -function getCreateAbstractionGeneric(node: Node): string | null { - if (!Node.isVariableDeclaration(node)) return null; - const initializer = node.getInitializer(); - if (!initializer) return null; - - const txt = initializer.getText().replace(/\s+/g, " "); - const startKeyword = "createAbstraction<"; - const idx = txt.indexOf(startKeyword); - if (idx === -1) return null; - - // Walk from after the '<', counting depth to find the matching '>' - let depth = 1; - let i = idx + startKeyword.length; - let start = i; - while (i < txt.length && depth > 0) { - if (txt[i] === "<") depth++; - else if (txt[i] === ">") depth--; - i++; - } - if (depth !== 0) return null; - return txt.slice(start, i - 1).trim(); -} - -/** - * Classify an abstraction based on its name and generic type arg. - */ -function classifyAbstraction(name: string, genericArg: string): AbstractionKind { - if (name.endsWith("EventHandler") || name.endsWith("Handler")) return "eventHandler"; - if (name.endsWith("UseCase") || name.endsWith("Repository")) return "useCase"; - return "service"; -} - -/** - * For an IEventHandler generic arg, extract the event class name. - * e.g. "IEventHandler" -> "EntryBeforeCreateEvent" - * Also handles "IEventHandler>" -> "DomainEvent" - */ -function extractEventTypeName(genericArg: string): string | null { - // Simple case: IEventHandler - const simple = genericArg.match(/IEventHandler\s*<\s*(\w+)\s*>/); - if (simple) return simple[1]; - // Nested case: IEventHandler> - const nested = genericArg.match(/IEventHandler\s*<\s*(DomainEvent\s*<\s*\w+\s*>)\s*>/); - if (nested) return nested[1]; - return null; -} - -/** - * For an IEventHandler> generic arg, extract the payload name directly. - * e.g. "IEventHandler>" -> "PageBeforeCreatePayload" - */ -function extractPayloadNameFromGenericArg(genericArg: string): string | null { - const m = genericArg.match(/IEventHandler\s*<\s*DomainEvent\s*<\s*(\w+)\s*>/); - return m ? m[1] : null; -} - -/** - * Find the payload interface name from an event class in the source file. - * Looks for: class SomeEvent extends DomainEvent - */ -function extractEventPayloadInterfaceName(sf: SourceFile, eventClassName: string): string | null { - // Try AST first - const cls = sf.getClasses().find(c => c.getName() === eventClassName); - if (cls) { - const extendsClause = cls.getExtends(); - if (extendsClause) { - const m = extendsClause.getText().match(/DomainEvent\s*<\s*(\w+)\s*>/); - if (m) return m[1]; - } - } - // Raw text fallback: class SomeEvent extends DomainEvent - const src = sf.getFullText(); - const regex = new RegExp( - `class\\s+${eventClassName}\\s+extends\\s+DomainEvent\\s*<\\s*(\\w+)\\s*>` - ); - const m = src.match(regex); - return m ? m[1] : null; -} - -function extractSymbol(sf: SourceFile, name: string): ExtractedSymbol | null { - const allExported = sf.getExportedDeclarations(); - - for (const [exportName, decls] of Array.from(allExported.entries())) { - if (exportName !== name) continue; - if (decls.length === 0) continue; - - // When a name has both a VariableDeclaration and a ModuleDeclaration (namespace), - // prefer the variable and merge namespace types in below. - const varDecl = decls.find(d => Node.isVariableDeclaration(d)); - const nsDecl = decls.find(d => Node.isModuleDeclaration(d)); - const node = varDecl ?? decls[0]; - const jsDoc = extractJsDoc(node); - - // ----------------------------------------------------------------------- - // Interface - // ----------------------------------------------------------------------- - if (Node.isInterfaceDeclaration(node)) { - return { - name, - kind: "interface", - isTypeOnly: true, - declarationText: cleanDeclarationText(node.getText()), - jsDoc, - namespaceMembers: [], - sourceFile: sf.getFilePath() - }; - } - - // ----------------------------------------------------------------------- - // Class - // ----------------------------------------------------------------------- - if (Node.isClassDeclaration(node)) { - const members = node - .getMembers() - .map(m => { - const txt = m.getText().trim(); - return txt.replace(/\{[\s\S]*$/, "").trim() + (txt.includes("{") ? ";" : ""); - }) - .filter(Boolean); - - const classHead = node.getText().split("{")[0].trim(); - const body = members.length ? "\n " + members.join("\n ") + "\n" : ""; - return { - name, - kind: "class", - isTypeOnly: false, - declarationText: `${classHead} {${body}}`, - jsDoc, - namespaceMembers: [], - sourceFile: sf.getFilePath() - }; - } - - // ----------------------------------------------------------------------- - // Namespace — skip here, handled separately in enrichment pass - // ----------------------------------------------------------------------- - if (Node.isModuleDeclaration(node)) { - const members: string[] = []; - const body = node.getBody(); - if (body && Node.isModuleBlock(body)) { - for (const stmt of body.getStatements()) { - members.push(stmt.getText().trim()); - } - } - return { - name, - kind: "namespace", - isTypeOnly: true, - declarationText: node.getText().split("{")[0].trim(), - jsDoc, - namespaceMembers: members, - sourceFile: sf.getFilePath() - }; - } - - // ----------------------------------------------------------------------- - // Function - // ----------------------------------------------------------------------- - if ( - Node.isFunctionDeclaration(node) || - Node.isArrowFunction(node) || - Node.isFunctionExpression(node) - ) { - const txt = node.getText().trim(); - return { - name, - kind: "function", - isTypeOnly: false, - declarationText: txt.replace(/\{[\s\S]*$/, "").trim(), - jsDoc, - namespaceMembers: [], - sourceFile: sf.getFilePath() - }; - } - - // ----------------------------------------------------------------------- - // Variable — detect createAbstraction() and enrich - // ----------------------------------------------------------------------- - if (Node.isVariableDeclaration(node)) { - const genericArg = getCreateAbstractionGeneric(node); - - if (genericArg) { - // It's an abstraction token — resolve the wrapped interface - const abstractionKind = classifyAbstraction(name, genericArg); - const interfaceMembers: InterfaceMember[] = []; - const eventPayloadFields: EventPayloadField[] = []; - let eventTypeName: string | undefined; - let eventPayloadName: string | undefined; - let interfaceJsDoc: string | undefined; - - if (abstractionKind === "eventHandler") { - // IEventHandler or IEventHandler> - eventTypeName = extractEventTypeName(genericArg) ?? undefined; - if (eventTypeName) { - // If eventTypeName is a simple class name (e.g. EntryBeforeCreateEvent), - // find the payload via its extends clause. Otherwise (DomainEvent), - // extract payload name directly from the generic arg. - const isDomainEventWrapper = eventTypeName.startsWith("DomainEvent"); - if (isDomainEventWrapper) { - eventPayloadName = extractPayloadNameFromGenericArg(genericArg) ?? undefined; - } else { - eventPayloadName = extractEventPayloadInterfaceName(sf, eventTypeName) ?? undefined; - } - if (eventPayloadName) { - const fields = extractPayloadFields(sf, eventPayloadName); - eventPayloadFields.push(...fields); - } - } - // The handle() method signature — use the specific event type - interfaceMembers.push({ - signature: `handle(event: ${eventTypeName ?? "DomainEvent"}): Promise`, - jsDoc: "" - }); - } else { - // useCase or service — resolve the IFoo interface. - // Start from the file where createAbstraction is actually defined - // (which may be a deep source file, not the barrel re-exporting it). - const nodeSf = node.getSourceFile(); - const resolved = extractInterfaceMembers(nodeSf, genericArg, PKG_MAP); - interfaceMembers.push(...resolved.members); - if (resolved.jsDoc) interfaceJsDoc = resolved.jsDoc; - } - - // Extract namespace types — first try the co-located nsDecl, then search by name - let namespaceTypes = nsDecl - ? (() => { - const body = (nsDecl as any).getBody?.(); - if (!body || !Node.isModuleBlock(body)) return []; - const members: NamespaceMember[] = []; - for (const stmt of body.getStatements()) { - if (Node.isTypeAliasDeclaration(stmt)) { - const typeNode = stmt.getTypeNode(); - members.push({ - name: stmt.getName(), - value: typeNode?.getText() ?? stmt.getText() - }); - } - } - return members; - })() - : extractNamespaceTypes(sf, name); - - // For each namespace type, try to resolve its fields or members - const nodeSfForTypes = node.getSourceFile(); - namespaceTypes = namespaceTypes.map(t => { - // Skip Interface — it just aliases the abstraction itself - if (t.name === "Interface") return t; - const val = t.value.trim(); - - // Foo.Interface pattern → resolve as method interface - if (/^\w+\.Interface$/.test(val)) { - try { - const resolved = resolveNamespaceDotInterface(nodeSfForTypes, val, PKG_MAP); - if (resolved && resolved.members.length > 0) - return { ...t, resolvedMembers: resolved }; - } catch { - /* ignore */ - } - return t; - } - - // Simple identifier → try to resolve as plain object fields - if (/^\w+$/.test(val)) { - try { - const resolved = resolveTypeToFields(nodeSfForTypes, val, PKG_MAP); - if (resolved && resolved.fields.length > 0) return { ...t, resolvedFields: resolved }; - } catch { - /* ignore */ - } - } - - return t; - }); - - return { - name, - kind: "abstraction", - isTypeOnly: false, - declarationText: "", - jsDoc, - namespaceMembers: [], - sourceFile: sf.getFilePath(), - abstractionKind, - interfaceMembers, - interfaceJsDoc, - namespaceTypes, - eventPayloadFields, - eventTypeName, - eventPayloadName - }; - } - - // Regular variable - const parent = node.getParent(); - const gp = parent?.getParent(); - const txt = gp ? gp.getText().trim() : node.getText().trim(); - return { - name, - kind: "variable", - isTypeOnly: false, - declarationText: txt.slice(0, 400), - jsDoc, - namespaceMembers: [], - sourceFile: sf.getFilePath() - }; - } - - // ----------------------------------------------------------------------- - // Type alias - // ----------------------------------------------------------------------- - if (Node.isTypeAliasDeclaration(node)) { - return { - name, - kind: "type", - isTypeOnly: true, - declarationText: cleanDeclarationText(node.getText()), - jsDoc, - namespaceMembers: [], - sourceFile: sf.getFilePath() - }; - } - - // ----------------------------------------------------------------------- - // Enum - // ----------------------------------------------------------------------- - if (Node.isEnumDeclaration(node)) { - return { - name, - kind: "enum", - isTypeOnly: false, - declarationText: node.getText().trim(), - jsDoc, - namespaceMembers: [], - sourceFile: sf.getFilePath() - }; - } - - // Fallback - return { - name, - kind: "other", - isTypeOnly: false, - declarationText: node.getText().slice(0, 300).trim(), - jsDoc, - namespaceMembers: [], - sourceFile: sf.getFilePath() - }; - } - - return null; -} - -/** - * After all symbols for an entry point are collected, pair each abstraction - * with its corresponding namespace symbol (same name) to merge namespace types. - * Namespaces are exported separately from their abstraction constant — - * e.g. both `Logger` (variable) and `Logger` (namespace) are exported. - * ts-morph returns each separately; we collapse them here. - */ -function mergeNamespaceSymbols(symbols: ExtractedSymbol[]): ExtractedSymbol[] { - const merged: ExtractedSymbol[] = []; - const nsMap = new Map(); - - // First pass: collect namespaces - for (const sym of symbols) { - if (sym.kind === "namespace") { - nsMap.set(sym.name, sym); - } - } - - for (const sym of symbols) { - if (sym.kind === "namespace") continue; // will be merged into abstraction - - if (sym.kind === "abstraction") { - const ns = nsMap.get(sym.name); - if ( - ns && - ns.namespaceMembers.length > 0 && - (!sym.namespaceTypes || sym.namespaceTypes.length === 0) - ) { - // Parse namespace members into NamespaceMember[] - const parsed: NamespaceMember[] = []; - for (const m of ns.namespaceMembers) { - const typeMatch = m.match(/export\s+type\s+(\w+)\s*(?:<[^>]*>)?\s*=\s*([\s\S]+?);/); - if (typeMatch) { - parsed.push({ name: typeMatch[1], value: typeMatch[2].trim() }); - } - } - merged.push({ ...sym, namespaceTypes: parsed.length ? parsed : sym.namespaceTypes }); - } else { - merged.push(sym); - } - } else { - merged.push(sym); - } - } - - return merged; -} - -// --------------------------------------------------------------------------- -// MDX rendering -// --------------------------------------------------------------------------- - -interface SymbolGroup { - title: string; - symbols: ExtractedSymbol[]; -} - -/** - * Group symbols into logical sections depending on the entry point layer (api vs admin). - * Returns groups in display order, skipping empty groups. - */ -function groupSymbols(relPath: string, symbols: ExtractedSymbol[]): SymbolGroup[] { - const layer = relPath.split("/")[0]; // "api" | "admin" | "infra" | "cli" | "extensions" - - if (layer === "api") { - const useCases = symbols.filter( - s => s.kind === "abstraction" && s.abstractionKind === "useCase" - ); - const handlers = symbols.filter( - s => s.kind === "abstraction" && s.abstractionKind === "eventHandler" - ); - const services = symbols.filter( - s => s.kind === "abstraction" && s.abstractionKind === "service" - ); - const rest = symbols.filter(s => s.kind !== "abstraction"); - - return [ - { title: "Use Cases", symbols: useCases }, - { title: "Event Handlers", symbols: handlers }, - { title: "Services", symbols: services }, - { title: "Types & Classes", symbols: rest } - ].filter(g => g.symbols.length > 0); - } - - if (layer === "admin") { - const hooks = symbols.filter( - s => - (s.kind === "function" || s.kind === "variable") && - s.name.startsWith("use") && - s.name.length > 3 && - s.name[3] === s.name[3].toUpperCase() - ); - const hookNames = new Set(hooks.map(s => s.name)); - const components = symbols.filter( - s => - !hookNames.has(s.name) && - (s.kind === "variable" || s.kind === "function" || s.kind === "class") && - s.name[0] === s.name[0].toUpperCase() && - s.name[0] !== s.name[0].toLowerCase() - ); - const componentNames = new Set(components.map(s => s.name)); - const types = symbols.filter( - s => - !hookNames.has(s.name) && - !componentNames.has(s.name) && - (s.kind === "type" || s.kind === "interface") - ); - const typeNames = new Set(types.map(s => s.name)); - const rest = symbols.filter( - s => !hookNames.has(s.name) && !componentNames.has(s.name) && !typeNames.has(s.name) - ); - - return [ - { title: "Components", symbols: components }, - { title: "Hooks", symbols: hooks }, - { title: "Types", symbols: types }, - { title: "Other", symbols: rest } - ].filter(g => g.symbols.length > 0); - } - - // For infra, cli, extensions — no grouping, single flat group - return [{ title: "", symbols }]; -} - -function renderLearnBlock(relPath: string, symbols: ExtractedSymbol[]): string { - const useCases = symbols.filter(s => s.name.endsWith("UseCase")); - const handlers = symbols.filter(s => s.name.endsWith("EventHandler")); - const builders = symbols.filter(s => s.name.endsWith("Builder") || s.name.endsWith("Factory")); - const components = symbols.filter( - s => - s.kind === "class" || - (s.name[0] === s.name[0].toUpperCase() && - !s.name.endsWith("UseCase") && - !s.name.endsWith("EventHandler")) - ); - - const bullets: string[] = []; - - if (useCases.length > 0) bullets.push(`- What use cases are available in \`webiny/${relPath}\`?`); - if (handlers.length > 0) bullets.push(`- Which event handlers can you implement?`); - if (builders.length > 0) bullets.push(`- How to use the builder and factory APIs?`); - if (bullets.length === 0) bullets.push(`- What is exported from \`webiny/${relPath}\`?`); - bullets.push(`- How to import and use each exported item?`); - - return bullets.join("\n"); -} - -function kindLabel(sym: ExtractedSymbol): string { - if (sym.kind === "abstraction") { - if (sym.abstractionKind === "eventHandler") return "Event Handler Abstraction"; - if (sym.abstractionKind === "useCase") return "Use Case Abstraction"; - return "Abstraction"; - } - if (sym.isTypeOnly && sym.kind !== "namespace") return "Type"; - const map: Record = { - interface: "Interface", - class: "Class", - namespace: "Namespace", - function: "Function", - variable: "Constant", - type: "Type", - enum: "Enum", - other: "Export" - }; - return map[sym.kind] ?? "Export"; -} - -function renderUsageSnippet( - sym: ExtractedSymbol, - importPath: string -): { file: string; body: string } | null { - if (sym.kind !== "abstraction") return null; - - const lines: string[] = []; - - if (sym.abstractionKind === "eventHandler") { - lines.push(`import { ${sym.name} } from "${importPath}";`); - lines.push(``); - lines.push(`class MyHandler implements ${sym.name}.Interface {`); - lines.push(` public constructor(/* inject dependencies here */) {}`); - lines.push(``); - lines.push(` public async handle(event: ${sym.name}.Event): Promise {`); - if (sym.eventPayloadFields && sym.eventPayloadFields.length > 0) { - const fields = sym.eventPayloadFields.map(f => f.name).join(", "); - lines.push(` const { ${fields} } = event.payload;`); - } else { - lines.push(` // implementation`); - } - lines.push(` }`); - lines.push(`}`); - lines.push(``); - lines.push(`export default ${sym.name}.createImplementation({`); - lines.push(` implementation: MyHandler,`); - lines.push(` dependencies: []`); - lines.push(`});`); - } else { - // use case or service abstraction — show it being injected and called - const paramName = sym.name.charAt(0).toLowerCase() + sym.name.slice(1); - - // Pick a representative method to call: prefer common primary names, fall back to first - const PREFERRED = [ - "execute", - "handle", - "get", - "list", - "create", - "info", - "log", - "map", - "resolve", - "build" - ]; - const pick = - sym.interfaceMembers && sym.interfaceMembers.length > 0 - ? (PREFERRED.map(p => - sym.interfaceMembers!.find( - m => m.signature.startsWith(p + "(") || m.signature.startsWith(p + "<") - ) - ).find(Boolean) ?? sym.interfaceMembers[0]) - : null; - // Strip generic type params from call site (e.g. "map" -> "map") - const methodName = pick ? pick.signature.split("(")[0].split("<")[0].trim() : null; - const isAsync = pick ? pick.signature.includes("Promise<") : false; - - lines.push(`import { ${sym.name} } from "${importPath}";`); - lines.push(``); - lines.push(`class MyImpl implements MyUseCase.Interface {`); - lines.push(` public constructor(private ${paramName}: ${sym.name}.Interface) {}`); - lines.push(``); - lines.push(` public async execute(/* ... */): Promise {`); - if (methodName) { - lines.push(` ${isAsync ? "await " : ""}this.${paramName}.${methodName}(/* ... */);`); - } - lines.push(` }`); - lines.push(`}`); - lines.push(``); - lines.push(`export default MyUseCase.createImplementation({`); - lines.push(` implementation: MyImpl,`); - lines.push(` dependencies: [${sym.name}]`); - lines.push(`});`); - } - - // file is declared in each branch above - const file = - sym.abstractionKind === "eventHandler" ? "extensions/MyHandler.ts" : "extensions/MyImpl.ts"; - return { file, body: lines.join("\n") }; -} - -function renderSymbolSection( - sym: ExtractedSymbol, - importPath: string, - headingLevel: 2 | 3 | 4 = 2 -): string { - const label = kindLabel(sym); - const lines: string[] = []; - const hashes = "#".repeat(headingLevel); - - lines.push(`${hashes} \`${sym.name}\``); - lines.push(""); - lines.push(`**${label}** — imported from \`${importPath}\``); - lines.push(""); - - if (sym.jsDoc) { - lines.push(sym.jsDoc); - lines.push(""); - } - - // Import snippet - const importKeyword = sym.isTypeOnly && sym.kind !== "namespace" ? "import type" : "import"; - lines.push("```typescript"); - lines.push(`${importKeyword} { ${sym.name} } from "${importPath}";`); - lines.push("```"); - lines.push(""); - - // ------------------------------------------------------------------------- - // Abstraction: rich rendering - // ------------------------------------------------------------------------- - if (sym.kind === "abstraction") { - // Interface section — description, code block for signatures, table for descriptions - if (sym.interfaceMembers && sym.interfaceMembers.length > 0) { - lines.push(`**Interface \`${sym.name}.Interface\`:**`); - lines.push(""); - if (sym.interfaceJsDoc) { - lines.push(sym.interfaceJsDoc); - lines.push(""); - } - // Full signatures in a code block - lines.push("```typescript"); - lines.push(`interface ${sym.name}.Interface {`); - for (const m of sym.interfaceMembers) { - lines.push(` ${m.signature};`); - } - lines.push("}"); - lines.push("```"); - lines.push(""); - // Description table — only rendered if any member has JSDoc - const hasAnyJsDoc = sym.interfaceMembers.some(m => m.jsDoc); - if (hasAnyJsDoc) { - lines.push("| Method | Description |"); - lines.push("| ------ | ----------- |"); - for (const m of sym.interfaceMembers) { - const methodName = m.signature.split("(")[0].trim(); - const desc = m.jsDoc ? m.jsDoc.replace(/\|/g, "\\|") : "—"; - lines.push(`| \`${methodName}()\` | ${desc} |`); - } - lines.push(""); - } - } - - // Event payload section - if ( - sym.abstractionKind === "eventHandler" && - sym.eventPayloadFields && - sym.eventPayloadFields.length > 0 - ) { - lines.push(`**Event payload \`${sym.eventPayloadName ?? "payload"}\`:**`); - lines.push(""); - lines.push("```typescript"); - lines.push(`interface ${sym.eventPayloadName ?? "Payload"} {`); - for (const f of sym.eventPayloadFields) { - lines.push(` ${f.name}${f.optional ? "?" : ""}: ${f.typeText};`); - } - lines.push("}"); - lines.push("```"); - lines.push(""); - } - - // Namespace types section - if (sym.namespaceTypes && sym.namespaceTypes.length > 0) { - lines.push(`**Types:**`); - lines.push(""); - lines.push("```typescript"); - lines.push(`namespace ${sym.name} {`); - for (const t of sym.namespaceTypes) { - lines.push(` type ${t.name} = ${t.value};`); - } - lines.push("}"); - lines.push("```"); - lines.push(""); - - // For each resolved type, emit a field table or method table - for (const t of sym.namespaceTypes) { - if (t.resolvedFields && t.resolvedFields.fields.length > 0) { - const { typeName, isArray, jsDoc, fields } = t.resolvedFields; - const label = isArray ? `${typeName}[]` : typeName; - lines.push(`**\`${t.name}\` — \`${label}\`:**`); - lines.push(""); - if (jsDoc) { - lines.push(jsDoc); - lines.push(""); - } - lines.push("| Field | Type | Required | Description |"); - lines.push("| ----- | ---- | -------- | ----------- |"); - for (const f of fields) { - const req = f.optional ? "no" : "yes"; - lines.push(`| \`${f.name}\` | \`${f.typeText.replace(/\|/g, "\\|")}\` | ${req} | — |`); - } - lines.push(""); - } else if (t.resolvedMembers && t.resolvedMembers.members.length > 0) { - const { members, jsDoc } = t.resolvedMembers; - lines.push(`**\`${t.name}\` — \`${t.value}\`:**`); - lines.push(""); - if (jsDoc) { - lines.push(jsDoc); - lines.push(""); - } - lines.push("```typescript"); - lines.push(`interface ${t.value} {`); - for (const m of members) lines.push(` ${m.signature};`); - lines.push("}"); - lines.push("```"); - lines.push(""); - const hasJsDoc = members.some(m => m.jsDoc); - if (hasJsDoc) { - lines.push("| Method | Description |"); - lines.push("| ------ | ----------- |"); - for (const m of members) { - const methodName = m.signature.split("(")[0].trim(); - const desc = m.jsDoc ? m.jsDoc.replace(/\|/g, "\\|") : "—"; - lines.push(`| \`${methodName}()\` | ${desc} |`); - } - lines.push(""); - } - } - } - } - - return lines.join("\n"); - } - - // ------------------------------------------------------------------------- - // Plain declaration - // ------------------------------------------------------------------------- - if (sym.declarationText && sym.declarationText.length > 0) { - lines.push("```typescript"); - lines.push(sym.declarationText); - lines.push("```"); - lines.push(""); - } - - // Namespace members (raw, for non-abstraction namespaces) - if (sym.kind === "namespace" && sym.namespaceMembers.length > 0) { - lines.push("```typescript"); - lines.push(`namespace ${sym.name} {`); - for (const m of sym.namespaceMembers) { - lines.push(` ${m}`); - } - lines.push("}"); - lines.push("```"); - lines.push(""); - } - - return lines.join("\n"); -} - -// --------------------------------------------------------------------------- -// Extensions page — defineExtension-aware extraction + rendering -// --------------------------------------------------------------------------- - -interface ExtParamEntry { - name: string; - type: string; - required: boolean; - description: string; - /** Raw live Zod schema node — used to expand complex types in footnotes */ - schema?: any; -} - -interface ExtensionEntry { - /** Dot-notation namespace path, e.g. "Infra.Admin.BeforeBuild" */ - path: string; - /** Value of the `type` field, e.g. "Admin/BeforeBuild" */ - extensionType: string; - description: string; - multiple: boolean; - params: ExtParamEntry[]; -} - -// Minimal mock context for paramsSchema functions that receive ({ project }) => z.object(...) -const EXT_MOCK_CTX = { - project: { - paths: { - projectFolder: { toString: () => "/project", join: (...a: string[]) => a.join("/") }, - workspaceFolder: { toString: () => "/project", join: (...a: string[]) => a.join("/") } - }, - config: {} - } -}; - -/** Resolve a live Zod schema from a paramsSchema value (direct schema or function) */ -function resolveParamsSchema(paramsSchema: unknown): unknown { - if (!paramsSchema) return null; - if (typeof paramsSchema === "function") { - try { - return (paramsSchema as Function)(EXT_MOCK_CTX); - } catch { - return null; - } - } - return paramsSchema; -} - -/** Map a live Zod type instance to a readable type string */ -function liveZodTypeName(schema: any): string { - const t: string = schema?._def?.typeName ?? ""; - // Unwrap modifiers - if (t === "ZodOptional" || t === "ZodDefault") return liveZodTypeName(schema._def.innerType); - const map: Record = { - ZodString: "string", - ZodBoolean: "boolean", - ZodNumber: "number", - ZodArray: "array", - ZodObject: "object", - ZodUnion: "union", - ZodEnum: "enum", - ZodRecord: "record", - ZodAny: "any", - // zodSrcPath returns a ZodEffects (transform/refine wrapper around ZodString) - ZodEffects: "string" - }; - return map[t] ?? t.replace(/^Zod/, "").toLowerCase(); -} - -/** Unwrap ZodOptional/ZodDefault to get the inner schema */ -function unwrapZod(schema: any): any { - const t = schema?._def?.typeName; - if (t === "ZodOptional" || t === "ZodDefault") return unwrapZod(schema._def.innerType); - return schema; -} - -/** Recursively extract params from a live ZodObject schema, dot-notating nested objects */ -function liveZodObjectParams(schema: any, prefix: string): ExtParamEntry[] { - if (unwrapZod(schema)?._def?.typeName !== "ZodObject") return []; - const obj = unwrapZod(schema); - const results: ExtParamEntry[] = []; - for (const [key, val] of Object.entries(obj.shape as Record)) { - const name = prefix ? `${prefix}.${key}` : key; - const type = liveZodTypeName(val); - const optional = val.isOptional?.() ?? false; - const innerDef = unwrapZod(val)?._def; - const description = innerDef?.description ?? ""; - results.push({ name, type, required: !optional, description, schema: val }); - // Recurse into nested ZodObject (so nested fields also appear in the table) - if (type === "object") { - results.push(...liveZodObjectParams(unwrapZod(val), name)); - } - } - return results; -} - -/** Walk a live runtime namespace object, calling getDefinition() on each leaf */ -function walkRuntimeNamespace(obj: any, path: string, results: ExtensionEntry[]) { - if (!obj || (typeof obj !== "object" && typeof obj !== "function")) return; - if (typeof obj.getDefinition === "function") { - const def = obj.getDefinition(); - const schema = resolveParamsSchema(def.paramsSchema); - const params = schema ? liveZodObjectParams(schema, "") : []; - results.push({ - path, - extensionType: def.type ?? path, - description: def.description ?? "", - multiple: def.multiple ?? false, - params - }); - return; - } - // Plain object namespace — recurse - for (const [k, v] of Object.entries(obj)) { - if (v && (typeof v === "function" || typeof v === "object")) { - walkRuntimeNamespace(v, path ? `${path}.${k}` : k, results); - } - } -} - -/** - * Extract all defineExtension entries by dynamically importing the compiled dist files. - * Uses real Zod schema instances — no AST text parsing. - */ -async function extractExtensions(): Promise { - const PROJECT_DIST = `${WEBINY_MONOREPO}/project/dist`; - const PROJECT_AWS_DIST = `${WEBINY_MONOREPO}/project-aws/dist`; - - // Import compiled dist barrels — these use fully-resolved relative imports, no alias issues - const [projectAws, project] = await Promise.all([ - import(PROJECT_AWS_DIST + "/index.js"), - import(PROJECT_DIST + "/extensions/index.js") - ]); - - const namespaces: Record = { - Api: projectAws.Api, - Admin: projectAws.Admin, - Cli: projectAws.Cli, - Infra: projectAws.Infra, - Project: projectAws.Project - }; - - const results: ExtensionEntry[] = []; - for (const [name, val] of Object.entries(namespaces)) { - walkRuntimeNamespace(val, name, results); - } - return results; -} - -/** Render the param type as a readable string */ -function renderParamType(p: ExtParamEntry): string { - if (p.type === "unknown") return "string"; // zodSrcPath and similar are always strings - return p.type; -} - -/** - * Returns true if a Zod schema node is "complex" — i.e. needs its own sub-section - * rather than just a type name in the table. - */ -function isComplexZodType(schema: any): boolean { - const t: string = unwrapZod(schema)?._def?.typeName ?? ""; - if (t === "ZodObject") return Object.keys(unwrapZod(schema).shape as object).length > 0; - if (t === "ZodUnion") { - return unwrapZod(schema)._def.options.some((o: any) => isComplexZodType(o)); - } - if (t === "ZodArray") return isComplexZodType(unwrapZod(schema)._def.type); - if (t === "ZodTuple") return true; - return false; -} - -/** - * Render a short display type for the table cell — primitive types as-is, - * complex types as a link to their sub-section anchor. - */ -function renderParamTypeCell(p: ExtParamEntry, sectionAnchor: string): string { - if (!p.schema || !isComplexZodType(p.schema)) { - return `\`${renderParamType(p)}\``; - } - // Escape pipes in type labels so they don't break markdown table rendering - const label = renderParamType(p).replace(/\|/g, "\\|"); - return `[${label}](#${sectionAnchor})`; -} - -interface TypeSubSection { - /** Anchor id for the sub-section heading */ - anchor: string; - /** Display heading text */ - heading: string; - /** The live Zod schema to render */ - schema: any; - /** Sub-sections collected recursively from this one */ - children: TypeSubSection[]; -} - -/** - * Collect all TypeSubSections needed for a list of top-level params. - * Walks recursively — objects inside unions get their own sub-sections too. - */ -function collectSubSections(params: ExtParamEntry[], anchorPrefix: string): TypeSubSection[] { - const sections: TypeSubSection[] = []; - - for (const p of params) { - if (!p.schema || !isComplexZodType(p.schema)) continue; - const inner = unwrapZod(p.schema); - const t: string = inner?._def?.typeName ?? ""; - const anchor = slugify(`${anchorPrefix}-${p.name}`); - - if (t === "ZodObject") { - const childParams: ExtParamEntry[] = Object.entries(inner.shape as Record).map( - ([k, v]: [string, any]) => ({ - name: k, - type: liveZodTypeName(v), - required: !(v.isOptional?.() ?? false), - description: unwrapZod(v)?._def?.description ?? "", - schema: v - }) - ); - const children = collectSubSections(childParams, anchor); - sections.push({ anchor, heading: p.name, schema: inner, children }); - } else if (t === "ZodUnion") { - // Each complex union member gets its own sub-section - const children: TypeSubSection[] = []; - inner._def.options.forEach((opt: any, i: number) => { - const optInner = unwrapZod(opt); - const ot: string = optInner?._def?.typeName ?? ""; - if (ot === "ZodObject") { - const optAnchor = slugify(`${anchor}-option-${i + 1}`); - const childParams: ExtParamEntry[] = Object.entries( - optInner.shape as Record - ).map(([k, v]: [string, any]) => ({ - name: k, - type: liveZodTypeName(v), - required: !(v.isOptional?.() ?? false), - description: unwrapZod(v)?._def?.description ?? "", - schema: v - })); - const grandchildren = collectSubSections(childParams, optAnchor); - children.push({ - anchor: optAnchor, - heading: `${p.name} (option ${i + 1})`, - schema: optInner, - children: grandchildren - }); - } - }); - sections.push({ anchor, heading: p.name, schema: inner, children }); - } else if (t === "ZodArray") { - const el = unwrapZod(inner._def.type); - if (el?._def?.typeName === "ZodObject") { - const childParams: ExtParamEntry[] = Object.entries(el.shape as Record).map( - ([k, v]: [string, any]) => ({ - name: k, - type: liveZodTypeName(v), - required: !(v.isOptional?.() ?? false), - description: unwrapZod(v)?._def?.description ?? "", - schema: v - }) - ); - const children = collectSubSections(childParams, anchor); - sections.push({ anchor, heading: p.name, schema: el, children }); - } - } else if (t === "ZodTuple") { - sections.push({ anchor, heading: p.name, schema: inner, children: [] }); - } - } - - return sections; -} - -/** Render a short inline type label (for table cells and union member lists) */ -function renderZodTypeShort(schema: any): string { - const inner = unwrapZod(schema); - const t: string = inner?._def?.typeName ?? "unknown"; - if (t === "ZodString") return "string"; - if (t === "ZodBoolean") return "boolean"; - if (t === "ZodNumber") return "number"; - if (t === "ZodAny") return "any"; - if (t === "ZodEffects") return "string"; - if (t === "ZodEnum") return inner._def.values.map((v: string) => `"${v}"`).join(" | "); - if (t === "ZodArray") return `${renderZodTypeShort(inner._def.type)}[]`; - if (t === "ZodRecord") return `Record`; - if (t === "ZodUnion") - return inner._def.options.map((o: any) => renderZodTypeShort(o)).join(" | "); - if (t === "ZodTuple") - return `[${inner._def.items.map((i: any) => renderZodTypeShort(i)).join(", ")}]`; - if (t === "ZodObject") return "object"; - return t.replace(/^Zod/, "").toLowerCase(); -} - -/** Render a TypeSubSection and all its children recursively into lines */ -function renderSubSection(sec: TypeSubSection, headingLevel: number): string[] { - const lines: string[] = []; - const hashes = "#".repeat(headingLevel); - - lines.push(``); - lines.push(""); - lines.push(`${hashes} \`${sec.heading}\``); - lines.push(""); - - const inner = unwrapZod(sec.schema); - const t: string = inner?._def?.typeName ?? ""; - - if (t === "ZodObject") { - lines.push("| Field | Type | Required | Description |"); - lines.push("| ----- | ---- | -------- | ----------- |"); - for (const [key, val] of Object.entries(inner.shape as Record)) { - const req = (val.isOptional?.() ?? false) ? "no" : "yes"; - const desc = unwrapZod(val)?._def?.description ?? "—"; - // Find a child sub-section for this field if it's complex - const child = sec.children.find(c => c.heading === key); - const typeCell = child - ? `[${renderZodTypeShort(val).replace(/\|/g, "\\|")}](#${child.anchor})` - : `\`${renderZodTypeShort(val)}\``; - lines.push(`| \`${key}\` | ${typeCell} | ${req} | ${desc || "—"} |`); - } - lines.push(""); - } else if (t === "ZodUnion") { - // List each member with a link if it has a sub-section - const options: any[] = inner._def.options; - lines.push("Accepts one of:"); - lines.push(""); - options.forEach((opt: any, i: number) => { - const child = sec.children.find(c => c.heading === `${sec.heading} (option ${i + 1})`); - const label = child ? `[object](#${child.anchor})` : `\`${renderZodTypeShort(opt)}\``; - lines.push(`- ${label}`); - }); - lines.push(""); - } else if (t === "ZodTuple") { - const items: string[] = inner._def.items.map((i: any) => `\`${renderZodTypeShort(i)}\``); - lines.push(`A tuple: \`[${items.join(", ")}]\``); - lines.push(""); - } - - // Render children recursively - for (const child of sec.children) { - lines.push(...renderSubSection(child, headingLevel)); - } - - return lines; -} - -/** Render the extensions.mdx page from extracted defineExtension data */ -function renderExtensionsMdx(extensions: ExtensionEntry[], id: string): string { - const lines: string[] = []; - - lines.push("---"); - lines.push(`id: ${id}`); - lines.push("title: Extensions"); - lines.push( - `description: "Reference for all webiny/extensions exports — React components used in webiny.config.tsx to wire extensions into the project."` - ); - lines.push("---"); - lines.push(""); - lines.push(`import {Alert} from "@/components/Alert";`); - lines.push(`import {SymbolList} from "@/components/SymbolList";`); - lines.push(""); - lines.push(``); - lines.push(""); - lines.push("- What extension components are available in `webiny/extensions`?"); - lines.push("- What parameters does each extension accept?"); - lines.push("- How to use each extension in your `webiny.config.tsx`?"); - lines.push(""); - lines.push(""); - lines.push(""); - lines.push("## Overview"); - lines.push(""); - lines.push( - "The `webiny/extensions` package exports React components used inside `webiny.config.tsx` " + - "to wire extensions into your Webiny project. Each component corresponds to a `defineExtension()` " + - "call in the Webiny source and accepts typed props defined by its Zod schema." - ); - lines.push(""); - - // Group by top-level namespace (first segment of path) - const groups = new Map(); - for (const ext of extensions) { - const top = ext.path.split(".")[0]; - if (!groups.has(top)) groups.set(top, []); - groups.get(top)!.push(ext); - } - - // Chip lists grouped by namespace - for (const [groupName, exts] of Array.from(groups.entries())) { - if (groups.size > 1) { - lines.push(`**${groupName}**`); - lines.push(""); - } - const chips = exts.map(e => `{ name: "${e.path}", anchor: "${slugify(e.path)}" }`).join(", "); - lines.push(``); - lines.push(""); - } - - // Detail sections per namespace group - for (const [groupName, exts] of Array.from(groups.entries())) { - if (groups.size > 1) { - lines.push(`## ${groupName}`); - lines.push(""); - } - for (const ext of exts) { - // Heading: last two segments of path for nested (e.g. "Infra.Admin.BeforeBuild" → "### `Admin.BeforeBuild`") - // Top-level (e.g. "EnvVar") → "### `EnvVar`" - const parts = ext.path.split("."); - const headingName = parts.length > 2 ? parts.slice(1).join(".") : parts[parts.length - 1]; - lines.push(`### \`${headingName}\``); - lines.push(""); - if (ext.description) { - lines.push(ext.description); - lines.push(""); - } - // Badges - const badge = ext.multiple ? "Can be used **multiple times**." : "Can only be used **once**."; - lines.push(badge); - lines.push(""); - // Params table + sub-sections - const topLevelParams = ext.params.filter(p => !p.name.includes(".")); - const anchorPrefix = slugify(ext.path); - const subSections = collectSubSections(topLevelParams, anchorPrefix); - - // Usage example (before props table) - const usageParts = topLevelParams - .filter(p => p.required) - .map(p => { - if (p.type === "unknown" || p.name === "src") - return `${p.name}="/extensions/my-extension.ts"`; - if (p.type === "string") return `${p.name}="value"`; - if (p.type === "boolean") return `${p.name}={true}`; - if (p.type === "array") return `${p.name}={[]}`; - if (p.type === "object") return `${p.name}={{}}`; - return `${p.name}={...}`; - }); - const selfClosing = usageParts.length <= 2; - lines.push("```tsx webiny.config.tsx"); - lines.push(`import { ${ext.path.split(".")[0]} } from "webiny/extensions";`); - lines.push(""); - lines.push("export const Extensions = () => ("); - if (selfClosing) { - lines.push(` <${ext.path}${usageParts.length ? " " + usageParts.join(" ") : ""} />`); - } else { - lines.push(` <${ext.path}`); - for (const p of usageParts) lines.push(` ${p}`); - lines.push(` />`); - } - lines.push(");"); - lines.push("```"); - lines.push(""); - - // Props table - if (topLevelParams.length > 0) { - lines.push("**Props**"); - lines.push(""); - lines.push("| Prop | Type | Required | Description |"); - lines.push("| ---- | ---- | -------- | ----------- |"); - for (const p of topLevelParams) { - const req = p.required ? "yes" : "no"; - const desc = p.description || "—"; - const sec = subSections.find(s => s.heading === p.name); - const typeCell = sec - ? `[${renderParamType(p)}](#${sec.anchor})` - : `\`${renderParamType(p)}\``; - lines.push(`| \`${p.name}\` | ${typeCell} | ${req} | ${desc} |`); - } - lines.push(""); - } - - // Type detail sub-sections - if (subSections.length > 0) { - for (const sec of subSections) { - lines.push(...renderSubSection(sec, 4)); - } - } - } - } - - return lines.join("\n"); -} - -function renderMdx(doc: EntryPointDoc, id: string): string { - const lines: string[] = []; - - lines.push("---"); - lines.push(`id: ${id}`); - lines.push(`title: ${doc.title}`); - lines.push(`description: "${doc.description}"`); - lines.push("---"); - lines.push(""); - lines.push(`import {Alert} from "@/components/Alert";`); - lines.push(`import {SymbolList} from "@/components/SymbolList";`); - lines.push(""); - lines.push(``); - lines.push(""); - lines.push(renderLearnBlock(doc.relPath, doc.symbols)); - lines.push(""); - lines.push(""); - lines.push(""); - lines.push("## Overview"); - lines.push(""); - lines.push( - `This page documents everything exported from \`webiny/${doc.relPath}\`. Import any of the items below directly from this path in your Webiny extensions.` - ); - lines.push(""); - - if (doc.symbols.length === 0) { - lines.push("*No exported symbols found.*"); - lines.push(""); - } else { - const groups = groupSymbols(doc.relPath, doc.symbols); - const hasMultipleGroups = groups.length > 1; - - // Pre-sort symbols A-Z within each group - const sortedGroups = groups.map(g => ({ - ...g, - symbols: [...g.symbols].sort((a, b) => a.name.localeCompare(b.name)) - })); - - // --- All chip lists first, bold labels (visible on page, no sidebar sub-items) --- - for (const group of sortedGroups) { - if (hasMultipleGroups && group.title) { - lines.push(`**${group.title}**`); - lines.push(""); - } - const symbolsJson = group.symbols - .map(sym => { - const anchor = slugify(sym.name); - return `{ name: "${sym.name}", anchor: "${anchor}" }`; - }) - .join(", "); - lines.push(``); - lines.push(""); - } - - // --- Symbol detail sections below --- - // Group headings are H2 (peers of ## Overview), symbol headings are H3 (multi-group) or H2 (single-group). - const headingLevel = hasMultipleGroups ? 3 : 2; - for (const group of sortedGroups) { - if (hasMultipleGroups && group.title) { - lines.push(`## ${group.title}`); - lines.push(""); - } - for (const sym of group.symbols) { - lines.push(renderSymbolSection(sym, `webiny/${doc.relPath}`, headingLevel)); - } - } - } - - return lines.join("\n"); -} - -// --------------------------------------------------------------------------- -// .ai.txt rendering -// --------------------------------------------------------------------------- - -function renderAiTxt(doc: EntryPointDoc): string { - const symbolNames = doc.symbols.map(s => s.name).join(", "); - const sourceFiles = Array.from(new Set(doc.symbols.map(s => s.sourceFile))); - - return `AI Context: ${doc.title} (reference/${doc.relPath}.mdx) - -Source of Information: -1. packages/webiny/src/${doc.relPath}.ts — barrel re-export file -${sourceFiles.map((f, i) => `${i + 2}. ${f} — originating source`).join("\n")} - -Key Documentation Decisions: -- This file is auto-generated by scripts/generate-reference.ts — do not edit manually -- Symbols are documented in the order they appear in the barrel file -- Declaration text is extracted from the TypeScript AST; method bodies are stripped -- Type-only exports are labeled as "Type"; namespace exports include member listings - -Exported Symbols: -${symbolNames} - -Import Path: webiny/${doc.relPath} - -Related Documents: -- docs/developer-docs/6.x/basic/di.mdx — DI pattern used by all abstractions -- docs/developer-docs/6.x/basic/result.mdx — Result type used in use case returns - -Tone Guidelines: -- This is a reference page — terse, API-focused, no prose beyond what's necessary -- Code blocks are the primary content; descriptions serve only to clarify intent -- Do not add analogies or long explanations — link to guide pages for those -`; -} - -// --------------------------------------------------------------------------- -// Navigation generation -// --------------------------------------------------------------------------- - -interface NavPage { - link: string; - title?: string; -} - -interface NavGroup { - title: string; - pages: Array; -} - -function isNavGroup(x: NavPage | NavGroup): x is NavGroup { - return "pages" in x; -} - -// Sub-domains that get their own sub-group within a layer -// key: "layer/subdomain", value: preferred landing link -const SUBDOMAIN_LANDING: Record = { - "api/cms": "reference/api/cms/entry", - "api/website-builder": "reference/api/website-builder/page", - "api/security": "reference/api/security", - "admin/cms": "reference/admin/cms", - "admin/website-builder": "reference/admin/website-builder" -}; - -// Preferred landing page for each top-level layer group -const LAYER_LANDING: Record = { - api: "reference/api/cms/entry", - admin: "reference/admin", - infra: "reference/infra/overview", - cli: "reference/cli/overview" -}; - -/** - * Some relPaths end in "index" which Next.js treats as a directory index route, - * causing 404s. Map those to a non-index output path here. - * Key: relPath (e.g. "cli/index"), Value: output path WITHOUT extension (e.g. "cli/overview") - */ -const OUTPUT_PATH_OVERRIDE: Record = { - "cli/index": "cli/overview", - "infra/index": "infra/overview" -}; - -/** Return the output path for a given relPath (may be overridden to avoid index routes). */ -function toOutputPath(relPath: string): string { - return OUTPUT_PATH_OVERRIDE[relPath] ?? relPath; -} - -type NavGroupWithLink = NavGroup & { link: string }; - -function makeGroup(title: string, link: string): NavGroupWithLink { - return { title, link, pages: [] } as NavGroupWithLink; -} - -// Explicit layer order for navigation -const LAYER_ORDER = ["extensions", "admin", "api", "cli", "infra"]; - -function buildNavTree(entryPoints: EntryPointDoc[]): NavGroup { - const root: NavGroup = { title: "Reference", pages: [] }; - - // Layer map: "api" | "admin" | "infra" | "cli" | "extensions" - const byLayer = new Map(); - for (const ep of entryPoints) { - const layer = ep.relPath.split("/")[0]; - if (!byLayer.has(layer)) byLayer.set(layer, []); - byLayer.get(layer)!.push(ep); - } - - // Sort layers by explicit order, unknown layers go to the end alphabetically - const orderedLayers = Array.from(byLayer.keys()).sort((a, b) => { - const ai = LAYER_ORDER.indexOf(a); - const bi = LAYER_ORDER.indexOf(b); - if (ai === -1 && bi === -1) return a.localeCompare(b); - if (ai === -1) return 1; - if (bi === -1) return -1; - return ai - bi; - }); - - for (const layer of orderedLayers) { - const eps = byLayer.get(layer)!; - if (eps.length === 1) { - // Single entry (extensions) — flat page - root.pages.push({ link: `reference/${toOutputPath(eps[0].relPath)}` }); - continue; - } - - const layerGroup = makeGroup( - toTitle(layer), - LAYER_LANDING[layer] ?? `reference/${toOutputPath(eps[0].relPath)}` - ); - - // Within this layer, group by sub-domain (second segment) when applicable - // Sub-domains: cms, website-builder, security — anything else is flat - const SUB_DOMAINS = ["cms", "website-builder", "security"]; - const bySubDomain = new Map(); - const flat: EntryPointDoc[] = []; - - // Sub-domain index pages: 2-part paths where the second segment is a sub-domain - // e.g. "api/security" → becomes the "Overview" first child of the Security group - const subDomainIndex = new Map(); - - for (const ep of eps) { - const parts = ep.relPath.split("/"); // e.g. ["api","cms","entry"] - if (parts.length === 2 && SUB_DOMAINS.includes(parts[1])) { - subDomainIndex.set(parts[1], ep); - } else if (parts.length >= 3 && SUB_DOMAINS.includes(parts[1])) { - const subDomain = parts[1]; - if (!bySubDomain.has(subDomain)) bySubDomain.set(subDomain, []); - bySubDomain.get(subDomain)!.push(ep); - } else { - flat.push(ep); - } - } - - // Add flat items (e.g. api, api/logger, api/graphql…) - // Root page (landing) always goes first, rest in their natural order. - const layerLanding = LAYER_LANDING[layer] ?? `reference/${toOutputPath(eps[0].relPath)}`; - const rootFlat = flat.filter( - ep => `reference/${toOutputPath(ep.relPath)}` === layerLanding || ep.relPath === layer - ); - const otherFlat = flat.filter(ep => !rootFlat.includes(ep)); - - for (const ep of [...rootFlat, ...otherFlat]) { - const isLayerRoot = rootFlat.includes(ep); - const title = isLayerRoot ? "Root" : ep.title; - layerGroup.pages.push({ link: `reference/${toOutputPath(ep.relPath)}`, title }); - } - - // Add sub-domain groups — index page is "Overview" first child, then sub-pages - for (const [subDomain, subEps] of Array.from(bySubDomain.entries())) { - const key = `${layer}/${subDomain}`; - const subLanding = SUBDOMAIN_LANDING[key] ?? `reference/${toOutputPath(subEps[0].relPath)}`; - const subGroup = makeGroup(toTitle(subDomain), subLanding); - const indexEp = subDomainIndex.get(subDomain); - if (indexEp) { - subGroup.pages.push({ - link: `reference/${toOutputPath(indexEp.relPath)}`, - title: "Root" - }); - } - for (const ep of subEps) { - subGroup.pages.push({ link: `reference/${toOutputPath(ep.relPath)}`, title: ep.title }); - } - layerGroup.pages.push(subGroup); - } - - root.pages.push(layerGroup); - } - - return root; -} - -function renderNavGroup(group: NavGroup, indent: number): string { - const pad = " ".repeat(indent); - const lines: string[] = []; - - if (indent === 0) { - // root Reference group — already in navigation.tsx, we just emit children - for (const page of group.pages) { - lines.push(renderNavItem(page, indent + 1)); - } - } else { - const groupLink = (group as NavGroup & { link?: string }).link ?? findFirstLink(group); - lines.push(`${pad}`); - for (const page of group.pages) { - lines.push(renderNavItem(page, indent + 1)); - } - lines.push(`${pad}`); - } - - return lines.join("\n"); -} - -function findFirstLink(group: NavGroup): string { - for (const p of group.pages) { - if (!isNavGroup(p)) return p.link; - const nested = findFirstLink(p); - if (nested) return nested; - } - return ""; -} - -function renderNavItem(item: NavPage | NavGroup, indent: number): string { - const pad = " ".repeat(indent); - if (isNavGroup(item)) { - return renderNavGroup(item, indent); - } - if (item.title) { - return `${pad}`; - } - return `${pad}`; -} - -const NAV_MARKER_START = " {/* __REFERENCE_PAGES_START__ */}"; -const NAV_MARKER_END = " {/* __REFERENCE_PAGES_END__ */}"; - -function rewriteNavigation(entryPoints: EntryPointDoc[]): void { - const nav = readFileSync(NAV_FILE, "utf-8"); - const tree = buildNavTree(entryPoints); - - // Build inner content for the Reference group - const innerLines: string[] = []; - for (const page of tree.pages) { - innerLines.push(renderNavItem(page, 2)); - } - const inner = innerLines.join("\n"); - - // Replace between markers - const startIdx = nav.indexOf(NAV_MARKER_START); - const endIdx = nav.indexOf(NAV_MARKER_END); - - if (startIdx === -1 || endIdx === -1) { - console.warn(" [nav] Markers not found in navigation.tsx — skipping nav update"); - console.warn(` [nav] Add these markers inside the Reference :`); - console.warn(` ${NAV_MARKER_START}`); - console.warn(` ${NAV_MARKER_END}`); - return; - } - - const before = nav.slice(0, startIdx + NAV_MARKER_START.length); - const after = nav.slice(endIdx); - const updated = `${before}\n${inner}\n ${after}`; - - writeFileSync(NAV_FILE, updated, "utf-8"); - console.log(` [nav] Updated navigation.tsx Reference group`); -} - -// --------------------------------------------------------------------------- -// Main -// --------------------------------------------------------------------------- - -async function main(): Promise { - console.log("Reading webiny package..."); - - const pkgJson = JSON.parse(readFileSync(join(WEBINY_PKG, "package.json"), "utf-8")); - const exports: Record = pkgJson.exports ?? {}; - const pkgMap = buildPackagePathMap(); - PKG_MAP = pkgMap; - - console.log(` Found ${Object.keys(exports).length} export paths`); - console.log(` Found ${pkgMap.size} @webiny/* package aliases`); - - // Set up ts-morph project pointing at the webiny package tsconfig - const project = new Project({ - tsConfigFilePath: join(WEBINY_PKG, "tsconfig.json"), - skipAddingFilesFromTsConfig: true - }); - - // Entry points to process — derive from exports map - // Filter out non-JS entries (tsconfig.json, global.ts, icons/*) - const entryPaths: string[] = Object.keys(exports) - .filter(k => !k.includes("*") && !k.endsWith(".json") && !k.endsWith(".ts")) - .map(k => k.replace(/^\.\//, "")) // strip leading "./" - .sort(); - - console.log(` Processing ${entryPaths.length} entry points...`); - - const docs: EntryPointDoc[] = []; - - for (const relPath of entryPaths) { - const barrelSrc = join(WEBINY_PKG, "src", relPath + ".ts"); - - if (!existsSync(barrelSrc)) { - console.warn(` [skip] ${relPath} — barrel not found at ${barrelSrc}`); - continue; - } - - process.stdout.write(` [parse] ${relPath}...`); - - // Add barrel file to project - let barrelFile: SourceFile; - try { - barrelFile = project.addSourceFileAtPath(barrelSrc); - } catch { - console.log(" ERROR adding to project"); - continue; - } - - // Parse barrel to get all re-exported names + their source files - const exports_ = parseBarrel(barrelFile, pkgMap); - - // For each exported name, open the source file and extract the symbol - const symbols: ExtractedSymbol[] = []; - const loadedSourceFiles = new Map(); - - for (const entry of exports_) { - if (entry.exportedName === "*") { - // export * — we can't enumerate without resolving, skip for now - continue; - } - - let sourceSf = loadedSourceFiles.get(entry.sourceFile); - if (!sourceSf) { - if (!existsSync(entry.sourceFile)) continue; - try { - sourceSf = project.addSourceFileAtPath(entry.sourceFile); - loadedSourceFiles.set(entry.sourceFile, sourceSf); - } catch { - continue; - } - } - - const sym = extractSymbol(sourceSf, entry.originalName); - if (sym) { - symbols.push({ - ...sym, - name: entry.exportedName, - isTypeOnly: entry.isTypeOnly || sym.isTypeOnly - }); - } else { - // Symbol not found via exported declarations — add a stub - symbols.push({ - name: entry.exportedName, - kind: "other", - isTypeOnly: entry.isTypeOnly, - declarationText: "", - jsDoc: "", - namespaceMembers: [], - sourceFile: entry.sourceFile - }); - } - } - - const doc: EntryPointDoc = { - importPath: `webiny/${relPath}`, - relPath, - title: toTitle(relPath), - description: toDescription(relPath), - symbols: mergeNamespaceSymbols(symbols) - }; - - docs.push(doc); - console.log(` ${symbols.length} symbols`); - } - - // Pre-extract extensions data (used when writing the extensions page) - console.log("\nExtracting defineExtension metadata..."); - const extensionEntries = await extractExtensions(); - console.log(` Found ${extensionEntries.length} extension definitions`); - - // Write MDX + .ai.txt files - console.log("\nWriting documentation files..."); - - for (const doc of docs) { - const outputPath = toOutputPath(doc.relPath); - const dir = join(REF_DIR, dirname(outputPath)); - mkdirSync(dir, { recursive: true }); - - const mdxPath = join(REF_DIR, outputPath + ".mdx"); - const aiTxtPath = join(REF_DIR, outputPath + ".ai.txt"); - - // Generate stable ID from path (8 chars) - const id = Buffer.from(doc.relPath) - .toString("base64") - .replace(/[^a-z0-9]/gi, "") - .slice(0, 8) - .toLowerCase() - .padEnd(8, "0"); - - // Extensions page gets its own dedicated renderer - const mdxContent = - doc.relPath === "extensions" ? renderExtensionsMdx(extensionEntries, id) : renderMdx(doc, id); - const aiTxtContent = renderAiTxt(doc); - - writeFileSync(mdxPath, mdxContent, "utf-8"); - writeFileSync(aiTxtPath, aiTxtContent, "utf-8"); - console.log(` [write] reference/${outputPath}.mdx (${doc.symbols.length} symbols)`); - } - - // Rewrite navigation - console.log("\nUpdating navigation.tsx..."); - rewriteNavigation(docs); - - console.log(`\nDone. Generated ${docs.length} reference pages.`); -} - -main().catch(err => { - console.error("Fatal error:", err); - process.exit(1); -}); diff --git a/scripts/generate-sdk-reference.ts b/scripts/generate-sdk-reference.ts new file mode 100644 index 000000000..39a9b9a50 --- /dev/null +++ b/scripts/generate-sdk-reference.ts @@ -0,0 +1,664 @@ +#!/usr/bin/env tsx +/** + * Generates Webiny SDK reference documentation from TypeScript source files. + * + * Usage: yarn generate:sdk-reference + * Source: /Users/adrian/dev/wby-next2/packages/sdk/src/ + * Output: docs/developer-docs/6.x/reference/sdk/ + * + * Re-run whenever the SDK source changes. + */ + +import { readFileSync, writeFileSync, mkdirSync } from "fs"; +import { join } from "path"; + +// ─── Configuration ──────────────────────────────────────────────────────────── + +const SDK_SRC = "/Users/adrian/dev/wby-next2/packages/sdk/src"; +const DOCS_OUT = join(process.cwd(), "docs/developer-docs/6.x/reference/sdk"); + +// ─── Types ──────────────────────────────────────────────────────────────────── + +interface Field { + name: string; + type: string; + required: boolean; + description: string; +} + +interface MethodInfo { + name: string; + description: string; + isGeneric: boolean; + genericParam: string; + paramsType: string; + params: Field[]; + paramsOptional: boolean; + returnType: string; +} + +// ─── Parsing helpers ────────────────────────────────────────────────────────── + +function readFile(path: string): string { + return readFileSync(path, "utf-8"); +} + +/** + * Extract the JSDoc block that immediately precedes a regex match in source. + */ +function extractJsDocBefore(source: string, pattern: RegExp): string { + const match = source.match(pattern); + if (!match || match.index === undefined) return ""; + const before = source.slice(0, match.index); + const endIdx = before.lastIndexOf("*/"); + if (endIdx === -1) return ""; + const startIdx = before.lastIndexOf("/**", endIdx); + if (startIdx === -1) return ""; + return before.slice(startIdx + 3, endIdx); +} + +/** + * Parse raw JSDoc content into description, @param map, and @returns. + */ +function parseJsDoc(raw: string): { + description: string; + paramDocs: Record; + returns: string; +} { + const lines = raw.split("\n").map(l => l.replace(/^\s*\*\s?/, "").trimEnd()); + + // Drop the first line if it's noise immediately after /** (e.g. "/**1`" artifacts) + if (lines.length > 0 && !lines[0].match(/[a-zA-Z@]/)) { + lines.shift(); + } + + const descLines: string[] = []; + const paramDocs: Record = {}; + let returns = ""; + let pastDescription = false; + + for (const line of lines) { + if (line.startsWith("@template") || line.startsWith("@param") || line.startsWith("@returns")) { + pastDescription = true; + } + if (!pastDescription) { + if (line) descLines.push(line); + continue; + } + const paramMatch = line.match(/^@param\s+([\w.]+)\s+-\s+(.*)/); + if (paramMatch) { + paramDocs[paramMatch[1]] = paramMatch[2].trim(); + } + const returnsMatch = line.match(/^@returns\s+(.*)/); + if (returnsMatch) { + returns = returnsMatch[1].trim(); + } + } + + return { description: descLines.join(" ").trim(), paramDocs, returns }; +} + +/** + * Find what's inside Promise<...> by balancing angle brackets. + */ +function extractReturnType(source: string): string { + const idx = source.indexOf("): Promise<"); + if (idx === -1) return ""; + const start = idx + 11; // skip `): Promise<` + let depth = 1; + let pos = start; + while (pos < source.length && depth > 0) { + if (source[pos] === "<") depth++; + else if (source[pos] === ">") depth--; + pos++; + } + return source.slice(start, pos - 1).trim(); +} + +/** + * Extract the first type parameter name from the function signature (e.g. TValues). + */ +function extractGenericParam(source: string): string | null { + const m = source.match(/export\s+async\s+function\s+\w+<(\w+)/); + return m ? m[1] : null; +} + +/** + * Find the params type from the implementation function signature. + */ +function extractParamsType(source: string): { type: string; optional: boolean } | null { + const m = source.match(/\bparams(\?)?:\s*(\w+(?:<[^>]*>)?)/); + if (!m) return null; + return { type: m[2], optional: !!m[1] }; +} + +/** + * Parse an interface body (between the outer braces) into Field[]. + * Handles: simple fields, inline nested objects, Array<{...}> types. + */ +function parseInterfaceBody(body: string): Field[] { + const fields: Field[] = []; + const lines = body.split("\n"); + let jsDocLines: string[] = []; + let inJsDoc = false; + let depth = 0; + let pendingField: Field | null = null; + + for (const line of lines) { + const t = line.trim(); + + // When inside a nested object/array-of-objects, track depth and skip + if (depth > 0) { + const opens = (t.match(/\{/g) || []).length; + const closes = (t.match(/\}/g) || []).length; + depth += opens - closes; + if (depth <= 0) { + depth = 0; + if (pendingField) { + fields.push(pendingField); + pendingField = null; + } + jsDocLines = []; + } + continue; + } + + // JSDoc block + if (t.startsWith("/**")) { + inJsDoc = true; + jsDocLines = []; + continue; + } + if (inJsDoc) { + if (t.startsWith("*/")) { + inJsDoc = false; + } else { + jsDocLines.push(t.replace(/^\*\s?/, "")); + } + continue; + } + + // Single-line comment + if (t.startsWith("//")) { + jsDocLines = [t.replace(/^\/\/\s*/, "")]; + continue; + } + + // Index signature [key: string]: any — skip + if (t.startsWith("[")) { + jsDocLines = []; + continue; + } + + // Detect opening of inline nested object or Array<{...}> + const opens = (t.match(/\{/g) || []).length; + const closes = (t.match(/\}/g) || []).length; + if (opens > closes) { + depth = opens - closes; + const nestMatch = t.match(/^(\w+)(\?)?:/); + if (nestMatch) { + const typeStr = t.includes("Array<{") ? "Array" : "object"; + pendingField = { + name: nestMatch[1], + type: typeStr, + required: !nestMatch[2], + description: jsDocLines.join(" ").trim() + }; + } + jsDocLines = []; + continue; + } + + // Regular field: name?: type; + const fieldMatch = t.match(/^(\w+)(\?)?\s*:\s*(.+?)(?:;)?\s*$/); + if (fieldMatch && t !== "{" && t !== "}") { + fields.push({ + name: fieldMatch[1], + type: fieldMatch[3].trim(), + required: !fieldMatch[2], + description: jsDocLines.join(" ").trim() + }); + jsDocLines = []; + } else if (t && !t.match(/^[{}]/) && !t.startsWith("export") && !t.startsWith("import")) { + jsDocLines = []; + } + } + + return fields; +} + +/** + * Extract all named interfaces from source, returning name → Field[]. + * Uses brace-balancing to correctly find interface boundaries. + */ +function extractInterfaces(source: string): Record { + const result: Record = {}; + const headerRegex = /export\s+interface\s+(\w+)(?:<[^>]*>)?(?:\s+extends[^{]+)?\s*\{/g; + let m: RegExpExecArray | null; + + while ((m = headerRegex.exec(source)) !== null) { + const name = m[1]; + const braceStart = m.index + m[0].length - 1; // position of opening `{` + let depth = 1; + let pos = braceStart + 1; + while (pos < source.length && depth > 0) { + if (source[pos] === "{") depth++; + else if (source[pos] === "}") depth--; + pos++; + } + const body = source.slice(braceStart + 1, pos - 1); + result[name] = parseInterfaceBody(body); + } + + return result; +} + +// ─── Method file parsing ────────────────────────────────────────────────────── + +function parseMethodFile(filePath: string, methodName: string): MethodInfo | null { + let source: string; + try { + source = readFile(filePath); + } catch { + return null; + } + + // JSDoc before `export async function` + const jsDocRaw = extractJsDocBefore(source, /export\s+async\s+function\s+\w+/); + const { description, paramDocs, returns } = parseJsDoc(jsDocRaw); + + // Generic type param + const genericParam = extractGenericParam(source); + const isGeneric = genericParam !== null; + + // Return type (inside Promise<...>) + const returnType = extractReturnType(source); + + // Params type + const paramsTypeInfo = extractParamsType(source); + const paramsType = paramsTypeInfo?.type ?? ""; + const paramsOptional = paramsTypeInfo?.optional ?? false; + + // Parse all interfaces in the file + const interfaces = extractInterfaces(source); + + // Build field list from the Params interface + const params: Field[] = []; + // Strip generic suffix for map lookup: "CreateEntryParams" → "CreateEntryParams" + const baseParamsType = paramsType.split("<")[0]; + + if (baseParamsType && interfaces[baseParamsType]) { + for (const field of interfaces[baseParamsType]) { + const desc = + field.description || paramDocs[`params.${field.name}`] || paramDocs[field.name] || ""; + + params.push({ ...field, description: desc }); + + // Expand referenced interface if it's small and defined in the same file + const cleanType = field.type.split(/[<|, ]/)[0].trim(); // base type name + const referenced = interfaces[cleanType]; + if (referenced && referenced.length > 0 && referenced.length <= 6) { + for (const sub of referenced) { + params.push({ + name: `${field.name}.${sub.name}`, + type: sub.type, + required: false, + description: sub.description || paramDocs[`params.${field.name}.${sub.name}`] || "" + }); + } + } + } + } + + return { + name: methodName, + description, + isGeneric, + genericParam: genericParam ?? "TValues", + paramsType, + params, + paramsOptional, + returnType + }; +} + +/** + * Extract public async method names from a class file. + */ +function getMethodNamesFromClass(source: string): string[] { + const names: string[] = []; + // Match indented `async methodName` (4 spaces = class method, not nested function) + const regex = /^ {4}async\s+(\w+)[(<]/gm; + let m: RegExpExecArray | null; + while ((m = regex.exec(source)) !== null) { + names.push(m[1]); + } + return names; +} + +// ─── MDX rendering ──────────────────────────────────────────────────────────── + +function escMd(text: string): string { + return text.replace(/\|/g, "\\|"); +} + +function renderParamsTable(fields: Field[]): string { + const rows = fields.map(f => { + const name = `\`${f.name}\``; + const type = `\`${escMd(f.type)}\``; + const req = f.required ? "Yes" : "No"; + const desc = escMd(f.description || "—"); + return `| ${name} | ${type} | ${req} | ${desc} |`; + }); + return [ + "| Parameter | Type | Required | Description |", + "|-----------|------|:--------:|-------------|", + ...rows + ].join("\n"); +} + +function buildDisplaySignature(method: MethodInfo, sdkProp: string): string { + const generic = method.isGeneric ? `<${method.genericParam}>` : ""; + const paramStr = + method.params.length > 0 || method.paramsType + ? `params${method.paramsOptional ? "?" : ""}: ${method.paramsType}` + : ""; + const ret = method.returnType ? `Promise<${method.returnType}>` : "Promise"; + return `sdk.${sdkProp}.${method.name}${generic}(${paramStr}): ${ret}`; +} + +function renderMethod(method: MethodInfo, sdkProp: string): string { + const out: string[] = []; + + out.push(`### ${method.name}`); + out.push(""); + + if (method.description) { + out.push(method.description); + out.push(""); + } + + out.push("**Signature:**"); + out.push(""); + out.push("```typescript"); + out.push(buildDisplaySignature(method, sdkProp)); + out.push("```"); + out.push(""); + + if (method.params.length > 0) { + out.push("**Parameters:**"); + out.push(""); + out.push(renderParamsTable(method.params)); + out.push(""); + } else if (!method.paramsType) { + out.push("_This method takes no parameters._"); + out.push(""); + } + + out.push("---"); + out.push(""); + + return out.join("\n"); +} + +function generateNamespacePage(opts: { + id: string; + title: string; + description: string; + sdkProp: string; + overviewText: string; + methods: MethodInfo[]; +}): string { + const { id, title, description, sdkProp, overviewText, methods } = opts; + const out: string[] = []; + + out.push("---"); + out.push(`id: ${id}`); + out.push(`title: ${title}`); + out.push(`description: ${description}`); + out.push("---"); + out.push(""); + out.push('import { Alert } from "@/components/Alert";'); + out.push(""); + out.push(''); + out.push(""); + out.push(`- What methods are available on \`sdk.${sdkProp}\`?`); + out.push("- What parameters each method accepts?"); + out.push("- What each method returns?"); + out.push(""); + out.push(""); + out.push(""); + out.push(''); + out.push(""); + out.push( + "See [Using the Webiny SDK](/{version}/headless-cms/using-webiny-sdk) for end-to-end usage examples." + ); + out.push(""); + out.push(""); + out.push(""); + out.push("## Overview"); + out.push(""); + out.push(overviewText); + out.push(""); + out.push("## Methods"); + out.push(""); + + for (const method of methods) { + out.push(renderMethod(method, sdkProp)); + } + + return out.join("\n"); +} + +// ─── Namespace definitions ──────────────────────────────────────────────────── + +const NAMESPACES = [ + { + classFile: join(SDK_SRC, "CmsSdk.ts"), + dir: "cms", + sdkProp: "cms", + id: "m3q8vcj1", + title: "CMS SDK Reference", + description: + "API reference for the CMS SDK — methods for querying and mutating Headless CMS entries.", + overviewText: + "The `CmsSdk` is accessed via `sdk.cms` on a `Webiny` instance. " + + "It provides methods for reading and writing Headless CMS entries over GraphQL. " + + "All methods return a `Result` type — use `result.isOk()` and `result.isFail()` " + + "to handle success and error cases. See the [SDK overview](/{version}/reference/sdk/overview) " + + "for initialization and error handling details.", + outFile: join(DOCS_OUT, "cms.mdx") + }, + { + classFile: join(SDK_SRC, "FileManagerSdk.ts"), + dir: "fileManager", + sdkProp: "fileManager", + id: "f5t4wh6p", + title: "File Manager SDK Reference", + description: + "API reference for the File Manager SDK — methods for uploading and managing files.", + overviewText: + "The `FileManagerSdk` is accessed via `sdk.fileManager` on a `Webiny` instance. " + + "It provides methods for listing, uploading, updating, and deleting files. " + + "For large files, use `createMultiPartUpload` followed by `completeMultiPartUpload`. " + + "All methods return a `Result` type — see the [SDK overview](/{version}/reference/sdk/overview) " + + "for initialization and error handling details.", + outFile: join(DOCS_OUT, "file-manager.mdx") + }, + { + classFile: join(SDK_SRC, "TenantManagerSdk.ts"), + dir: "tenantManager", + sdkProp: "tenantManager", + id: "r2y9dk0e", + title: "Tenant Manager SDK Reference", + description: "API reference for the Tenant Manager SDK — methods for managing tenants.", + overviewText: + "The `TenantManagerSdk` is accessed via `sdk.tenantManager` on a `Webiny` instance. " + + "It provides methods for creating, installing, enabling, and disabling tenants in a " + + "multi-tenant Webiny setup. All methods return a `Result` type — see the " + + "[SDK overview](/{version}/reference/sdk/overview) for initialization and error handling details.", + outFile: join(DOCS_OUT, "tenant-manager.mdx") + } +]; + +// ─── Index page (static) ───────────────────────────────────────────────────── + +const INDEX_PAGE = `--- +id: s7b2nk9x +title: Webiny SDK Reference +description: API reference for the Webiny SDK — a type-safe JavaScript/TypeScript client for interacting with Webiny. +--- + +import { Alert } from "@/components/Alert"; + + + +- How to initialize the Webiny SDK? +- What configuration options are available? +- What sub-SDKs are available and what they do? + + + +## Overview + +The Webiny SDK is a type-safe JavaScript/TypeScript client for interacting with a Webiny instance from external applications — Node.js scripts, Next.js, Vue, SvelteKit, and others. + +Install it from npm: + +\`\`\` +yarn add @webiny/sdk +\`\`\` + +## Initialization + +Create a \`Webiny\` instance with your endpoint and API token: + +\`\`\`typescript +import { Webiny } from "@webiny/sdk"; + +const sdk = new Webiny({ + endpoint: "https://your-webiny-endpoint.com", + token: "your-api-token", + tenant: "root", // optional, defaults to "root" +}); +\`\`\` + +## Configuration + +| Option | Type | Required | Description | +|--------|------|:--------:|-------------| +| \`endpoint\` | \`string\` | Yes | The URL of your Webiny API endpoint | +| \`token\` | \`string\` | No | API token for authentication | +| \`tenant\` | \`string\` | No | Tenant ID. Defaults to \`"root"\` | +| \`headers\` | \`Record\` | No | Additional HTTP headers sent with every request | +| \`fetch\` | \`typeof fetch\` | No | Custom fetch implementation. Defaults to the global \`fetch\` | + +## Sub-SDKs + +| Property | Class | Description | +|----------|-------|-------------| +| \`sdk.cms\` | [\`CmsSdk\`](/{version}/reference/sdk/cms) | Query and mutate Headless CMS entries | +| \`sdk.fileManager\` | [\`FileManagerSdk\`](/{version}/reference/sdk/file-manager) | Upload and manage files | +| \`sdk.tenantManager\` | [\`TenantManagerSdk\`](/{version}/reference/sdk/tenant-manager) | Create and manage tenants | + +## Error Handling + +All SDK methods return a \`Result\` type. Use \`result.isOk()\` and \`result.isFail()\` to branch on success or failure: + +\`\`\`typescript +const result = await sdk.cms.getEntry({ + modelId: "article", + where: { entryId: "abc" }, + fields: ["id"], +}); + +if (result.isFail()) { + console.error(result.error.message); + return; +} + +console.log(result.value); // typed as CmsEntryData +\`\`\` + +### Error types + +| Error class | \`code\` | When thrown | +|-------------|---------|-------------| +| \`HttpError\` | \`HTTP_ERROR\` | The API responded with a non-2xx HTTP status | +| \`GraphQLError\` | \`GRAPHQL_ERROR\` | The API returned a GraphQL-level error | +| \`NetworkError\` | \`NETWORK_ERROR\` | The \`fetch\` call itself threw (e.g. no connectivity) | +`; + +// ─── Main ───────────────────────────────────────────────────────────────────── + +function main(): void { + mkdirSync(DOCS_OUT, { recursive: true }); + + // Write index page + ai.txt + writeFileSync(join(DOCS_OUT, "index.mdx"), INDEX_PAGE, "utf-8"); + writeFileSync( + join(DOCS_OUT, "index.ai.txt"), + [ + "AI Context: Webiny SDK Reference Index (index.mdx)", + "", + "This file is auto-generated by scripts/generate-sdk-reference.ts.", + `Source of truth: ${SDK_SRC}`, + "", + "Do not edit by hand — re-run the generator after SDK changes." + ].join("\n"), + "utf-8" + ); + console.log("✓ index.mdx"); + + for (const ns of NAMESPACES) { + const classSource = readFile(ns.classFile); + const methodNames = getMethodNamesFromClass(classSource); + + console.log(`\nParsing ${ns.classFile.split("/").pop()} → ${methodNames.join(", ")}`); + + const methods: MethodInfo[] = []; + for (const name of methodNames) { + const implFile = join(SDK_SRC, "methods", ns.dir, `${name}.ts`); + const info = parseMethodFile(implFile, name); + if (info) { + methods.push(info); + console.log( + ` ✓ ${name} (${info.params.length} params, returnType: ${info.returnType.slice(0, 40)}...)` + ); + } else { + console.warn(` ✗ Could not parse: ${implFile}`); + } + } + + const content = generateNamespacePage({ + id: ns.id, + title: ns.title, + description: ns.description, + sdkProp: ns.sdkProp, + overviewText: ns.overviewText, + methods + }); + + writeFileSync(ns.outFile, content, "utf-8"); + + const aiTxtPath = ns.outFile.replace(".mdx", ".ai.txt"); + writeFileSync( + aiTxtPath, + [ + `AI Context: ${ns.title} (${ns.outFile.split("/").pop()})`, + "", + "This file is auto-generated by scripts/generate-sdk-reference.ts.", + `Source of truth: ${ns.classFile}`, + "", + "Do not edit by hand — re-run the generator after SDK changes." + ].join("\n"), + "utf-8" + ); + + console.log(` → ${ns.outFile.replace(process.cwd() + "/", "")}`); + } + + console.log("\nDone. Run `yarn validate:mdx` to verify pairing."); +} + +main(); diff --git a/src/layouts/sidebar/components/HorizontalLine.js b/src/layouts/sidebar/components/HorizontalLine.js index 272bb5a21..bb0fbe6b0 100644 --- a/src/layouts/sidebar/components/HorizontalLine.js +++ b/src/layouts/sidebar/components/HorizontalLine.js @@ -1,7 +1,7 @@ import { useRouter } from "next/router"; import { useHomepage } from "@/hooks/useHomepage"; -export const HorizontalLine = ({ visible }) => { +export const HorizontalLine = ({ visible, title }) => { const router = useRouter(); const { homepageUrl } = useHomepage(); const showFullMenu = visible || router.pathname === homepageUrl; @@ -10,6 +10,16 @@ export const HorizontalLine = ({ visible }) => { return null; } + if (title) { + return ( +
+ + {title} + +
+ ); + } + return (
diff --git a/src/layouts/sidebar/components/NavTreeElement.js b/src/layouts/sidebar/components/NavTreeElement.js index ab26e5a1c..5540cab2b 100644 --- a/src/layouts/sidebar/components/NavTreeElement.js +++ b/src/layouts/sidebar/components/NavTreeElement.js @@ -46,7 +46,7 @@ export const NavTreeElement = forwardRef(({ element, depth = 0, mode, depthOverr ); if (type === "separator") { - return ; + return ; } if (type === "page") { diff --git a/yarn.lock b/yarn.lock index f13d85034..ff3719d5d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5464,10 +5464,10 @@ __metadata: languageName: node linkType: hard -"dotenv@npm:^17.3.1": - version: 17.3.1 - resolution: "dotenv@npm:17.3.1" - checksum: 3723ef6766ce91b0b9fa68fd5bf0fd6b77e316daa2ac8746bacbe301608b311b4abae63e475cacd5901cb3ad9cb6b07d0719fd1a030162fe09c56a583dd1ec50 +"dotenv@npm:^17.4.1": + version: 17.4.1 + resolution: "dotenv@npm:17.4.1" + checksum: 938df27b93476a696f9a9b3cd6c6801f175233f95819b082609fb61993f50d69ae21648ca8be7af90efab29a43c0c131ea19db9b83d219625078eb65ad635be4 languageName: node linkType: hard @@ -10707,7 +10707,7 @@ __metadata: concurrently: ^7.2.2 debounce: ^1.2.0 dlv: ^1.1.3 - dotenv: ^17.3.1 + dotenv: ^17.4.1 eslint: 7.x eslint-config-react-app: ^5.2.1 eslint-plugin-flowtype: 4.x