Browse Source

docs: Fix doc links

Michael Bromley 2 years ago
parent
commit
e9fba59755

+ 1 - 1
docs/docs/guides/core-concepts/auth/index.md

@@ -449,7 +449,7 @@ vendureLoginButton.addEventListener('click', () => {
 });
 ```
 
-We also need to tell the Admin UI application about the custom login URL, since we have no need for the default "username/password" login form. This can be done by setting the [`loginUrl` property](/reference/core-plugins/admin-ui-plugin/admin-ui-config/#loginurl) in the AdminUiConfig:
+We also need to tell the Admin UI application about the custom login URL, since we have no need for the default "username/password" login form. This can be done by setting the [`loginUrl` property](/reference/typescript-api/common/admin-ui/admin-ui-config#loginurl) in the AdminUiConfig:
 
 ```ts title="/src/vendure-config.ts"
 import { VendureConfig } from '@vendure/core';

+ 1 - 1
docs/docs/guides/developer-guide/overview/index.md

@@ -13,7 +13,7 @@ These are the major parts of a Vendure application:
 
 * **Server**: The Vendure server is the part that handles requests coming in to the GraphQL APIs. It serves both the [Shop API](/reference/graphql-api/shop/queries) and [Admin API](/reference/graphql-api/admin/queries), and can send jobs to the Job Queue to be processed by the Worker.
 * **Worker**: The Worker runs in the background and deals with tasks such as updating the search index, sending emails, and other tasks which may be long-running, resource-intensive or require retries.
-* **Admin UI**: The Admin UI is how shop administrators manage orders, customers, products, settings and so on. It is not actually part of the Vendure core, but is provided as a plugin (the [AdminUiPlugin](reference/typescript-api/core-plugins/admin-ui-plugin/)) which is installed for you in a standard Vendure installation. The Admin UI can be further extended to support custom functionality, as detailed in the 
+* **Admin UI**: The Admin UI is how shop administrators manage orders, customers, products, settings and so on. It is not actually part of the Vendure core, but is provided as a plugin (the [AdminUiPlugin](/reference/core-plugins/admin-ui-plugin/)) which is installed for you in a standard Vendure installation. The Admin UI can be further extended to support custom functionality, as detailed in the 
 * **Storefront**: With headless commerce, you are free to implement your storefront exactly as you see fit, unconstrained by the back-end, using any technologies that you like. To make this process easier, we have created a number of [storefront starter kits](/guides/storefront/storefront-starters/), as well as [guides on building a storefront](/guides/storefront/connect-api/).
 
 ![./Vendure_docs-architecture.webp](./Vendure_docs-architecture.webp) 

+ 1 - 1
docs/docs/guides/extending-the-admin-ui/custom-timeline-components/index.md

@@ -5,7 +5,7 @@ weight: 6
 
 # Custom History Timeline Components
 
-The Order & Customer detail pages feature a timeline of history entries. Since v1.9.0 it is possible to define custom history entry types - see the [HistoryService docs](0/reference/typescript-api/services/history-service/) for an example.
+The Order & Customer detail pages feature a timeline of history entries. Since v1.9.0 it is possible to define custom history entry types - see the [HistoryService docs](/reference/typescript-api/services/history-service/) for an example.
 
 You can also define a custom Angular component to render any timeline entry using the [registerHistoryEntryComponent function](/reference/admin-ui-api/custom-history-entry-components/register-history-entry-component/).
 

+ 1 - 1
docs/docs/reference/admin-ui-api/ui-devkit/admin-ui-extension.md

@@ -17,7 +17,7 @@ Defines extensions to the Admin UI application by specifying additional
 Angular [NgModules](https://angular.io/guide/ngmodules) which are compiled
 into the application.
 
-See [Extending the Admin UI](/guides/extending-the-admin-ui/) for
+See [Extending the Admin UI](/guides/extending-the-admin-ui/introduction) for
 detailed instructions.
 
 ```ts title="Signature"

+ 3 - 3
docs/docs/reference/core-plugins/asset-server-plugin/index.md

@@ -41,7 +41,7 @@ const config: VendureConfig = {
 };
 ```
 
-The full configuration is documented at [AssetServerOptions](/reference/typescript-api/core-plugins/asset-server-plugin/asset-server-options)
+The full configuration is documented at [AssetServerOptions](/reference/core-plugins/asset-server-plugin/asset-server-options)
 
 ## Image transformation
 
@@ -53,7 +53,7 @@ The above URL will return `some-asset.jpg`, resized to fit in the bounds of a 50
 
 ### Preview mode
 
-The `mode` parameter can be either `crop` or `resize`. See the [ImageTransformMode](/reference/typescript-api/core-plugins/asset-server-plugin/image-transform-mode) docs for details.
+The `mode` parameter can be either `crop` or `resize`. See the [ImageTransformMode](/reference/core-plugins/asset-server-plugin/image-transform-mode) docs for details.
 
 ### Focal point
 
@@ -88,7 +88,7 @@ The `format` parameter can also be combined with presets (see below).
 ### Transform presets
 
 Presets can be defined which allow a single preset name to be used instead of specifying the width, height and mode. Presets are
-configured via the AssetServerOptions [presets property](/reference/typescript-api/core-plugins/asset-server-plugin/asset-server-options/#presets).
+configured via the AssetServerOptions [presets property](/reference/core-plugins/asset-server-plugin/asset-server-options/#presets).
 
 For example, defining the following preset:
 

+ 47 - 0
docs/docs/reference/typescript-api/common/admin-ui/admin-ui-app-config.md

@@ -0,0 +1,47 @@
+---
+title: "AdminUiAppConfig"
+isDefaultIndex: false
+generated: true
+---
+<!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script -->
+import MemberInfo from '@site/src/components/MemberInfo';
+import GenerationInfo from '@site/src/components/GenerationInfo';
+import MemberDescription from '@site/src/components/MemberDescription';
+
+
+## AdminUiAppConfig
+
+<GenerationInfo sourceFile="packages/common/src/shared-types.ts" sourceLine="338" packageName="@vendure/common" />
+
+Configures the path to a custom-build of the Admin UI app.
+
+```ts title="Signature"
+interface AdminUiAppConfig {
+    path: string;
+    route?: string;
+    compile?: () => Promise<void>;
+}
+```
+
+<div className="members-wrapper">
+
+### path
+
+<MemberInfo kind="property" type={`string`}   />
+
+The path to the compiled admin UI app files. If not specified, an internal
+default build is used. This path should contain the `vendure-ui-config.json` file,
+index.html, the compiled js bundles etc.
+### route
+
+<MemberInfo kind="property" type={`string`} default="'admin'"   />
+
+Specifies the url route to the Admin UI app.
+### compile
+
+<MemberInfo kind="property" type={`() =&#62; Promise&#60;void&#62;`}   />
+
+The function which will be invoked to start the app compilation process.
+
+
+</div>

+ 51 - 0
docs/docs/reference/typescript-api/common/admin-ui/admin-ui-app-dev-mode-config.md

@@ -0,0 +1,51 @@
+---
+title: "AdminUiAppDevModeConfig"
+isDefaultIndex: false
+generated: true
+---
+<!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script -->
+import MemberInfo from '@site/src/components/MemberInfo';
+import GenerationInfo from '@site/src/components/GenerationInfo';
+import MemberDescription from '@site/src/components/MemberDescription';
+
+
+## AdminUiAppDevModeConfig
+
+<GenerationInfo sourceFile="packages/common/src/shared-types.ts" sourceLine="366" packageName="@vendure/common" />
+
+Information about the Admin UI app dev server.
+
+```ts title="Signature"
+interface AdminUiAppDevModeConfig {
+    sourcePath: string;
+    port: number;
+    route?: string;
+    compile: () => Promise<void>;
+}
+```
+
+<div className="members-wrapper">
+
+### sourcePath
+
+<MemberInfo kind="property" type={`string`}   />
+
+The path to the uncompiled UI app source files. This path should contain the `vendure-ui-config.json` file.
+### port
+
+<MemberInfo kind="property" type={`number`}   />
+
+The port on which the dev server is listening. Overrides the value set by `AdminUiOptions.port`.
+### route
+
+<MemberInfo kind="property" type={`string`} default="'admin'"   />
+
+Specifies the url route to the Admin UI app.
+### compile
+
+<MemberInfo kind="property" type={`() =&#62; Promise&#60;void&#62;`}   />
+
+The function which will be invoked to start the app compilation process.
+
+
+</div>

+ 136 - 0
docs/docs/reference/typescript-api/common/admin-ui/admin-ui-config.md

@@ -0,0 +1,136 @@
+---
+title: "AdminUiConfig"
+isDefaultIndex: false
+generated: true
+---
+<!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script -->
+import MemberInfo from '@site/src/components/MemberInfo';
+import GenerationInfo from '@site/src/components/GenerationInfo';
+import MemberDescription from '@site/src/components/MemberDescription';
+
+
+## AdminUiConfig
+
+<GenerationInfo sourceFile="packages/common/src/shared-types.ts" sourceLine="214" packageName="@vendure/common" />
+
+This interface describes JSON config file (vendure-ui-config.json) used by the Admin UI.
+The values are loaded at run-time by the Admin UI app, and allow core configuration to be
+managed without the need to re-build the application.
+
+```ts title="Signature"
+interface AdminUiConfig {
+    apiHost: string | 'auto';
+    apiPort: number | 'auto';
+    adminApiPath: string;
+    tokenMethod: 'cookie' | 'bearer';
+    authTokenHeaderKey: string;
+    channelTokenKey: string;
+    defaultLanguage: LanguageCode;
+    defaultLocale?: string;
+    availableLanguages: LanguageCode[];
+    loginUrl?: string;
+    brand?: string;
+    hideVendureBranding?: boolean;
+    hideVersion?: boolean;
+    loginImageUrl?: string;
+    cancellationReasons?: string[];
+}
+```
+
+<div className="members-wrapper">
+
+### apiHost
+
+<MemberInfo kind="property" type={`string | 'auto'`} default="'http://localhost'"   />
+
+The hostname of the Vendure server which the admin UI will be making API calls
+to. If set to "auto", the Admin UI app will determine the hostname from the
+current location (i.e. `window.location.hostname`).
+### apiPort
+
+<MemberInfo kind="property" type={`number | 'auto'`} default="3000"   />
+
+The port of the Vendure server which the admin UI will be making API calls
+to. If set to "auto", the Admin UI app will determine the port from the
+current location (i.e. `window.location.port`).
+### adminApiPath
+
+<MemberInfo kind="property" type={`string`} default="'admin-api'"   />
+
+The path to the GraphQL Admin API.
+### tokenMethod
+
+<MemberInfo kind="property" type={`'cookie' | 'bearer'`} default="'cookie'"   />
+
+Whether to use cookies or bearer tokens to track sessions.
+Should match the setting of in the server's `tokenMethod` config
+option.
+### authTokenHeaderKey
+
+<MemberInfo kind="property" type={`string`} default="'vendure-auth-token'"   />
+
+The header used when using the 'bearer' auth method. Should match the
+setting of the server's `authOptions.authTokenHeaderKey` config option.
+### channelTokenKey
+
+<MemberInfo kind="property" type={`string`} default="'vendure-token'"   />
+
+The name of the header which contains the channel token. Should match the
+setting of the server's `apiOptions.channelTokenKey` config option.
+### defaultLanguage
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/common/language-code#languagecode'>LanguageCode</a>`} default="<a href='/reference/typescript-api/common/language-code#languagecode'>LanguageCode</a>.en"   />
+
+The default language for the Admin UI. Must be one of the
+items specified in the `availableLanguages` property.
+### defaultLocale
+
+<MemberInfo kind="property" type={`string`}   />
+
+The default locale for the Admin UI. The locale affects the formatting of
+currencies & dates.
+
+If not set, the browser default locale will be used.
+### availableLanguages
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/common/language-code#languagecode'>LanguageCode</a>[]`}   />
+
+An array of languages for which translations exist for the Admin UI.
+### loginUrl
+
+<MemberInfo kind="property" type={`string`}   />
+
+If you are using an external <a href='/reference/typescript-api/auth/authentication-strategy#authenticationstrategy'>AuthenticationStrategy</a> for the Admin API, you can configure
+a custom URL for the login page with this option. On logging out or redirecting an unauthenticated
+user, the Admin UI app will redirect the user to this URL rather than the default username/password
+screen.
+### brand
+
+<MemberInfo kind="property" type={`string`}   />
+
+The custom brand name.
+### hideVendureBranding
+
+<MemberInfo kind="property" type={`boolean`} default="false"   />
+
+Option to hide vendure branding.
+### hideVersion
+
+<MemberInfo kind="property" type={`boolean`} default="false"   />
+
+Option to hide version.
+### loginImageUrl
+
+<MemberInfo kind="property" type={`string`}  since="1.9.0"  />
+
+A url of a custom image to be used on the login screen, to override the images provided by Vendure's login image server.
+### cancellationReasons
+
+<MemberInfo kind="property" type={`string[]`} default="['order.cancel-reason-customer-request', 'order.cancel-reason-not-available']"  since="1.5.0"  />
+
+Allows you to provide default reasons for a refund or cancellation. This will be used in the
+refund/cancel dialog. The values can be literal strings (e.g. "Not in stock") or translation
+tokens (see [Adding Admin UI Translations](/guides/extending-the-admin-ui/adding-ui-translations/)).
+
+
+</div>

+ 14 - 0
docs/docs/reference/typescript-api/common/admin-ui/index.md

@@ -0,0 +1,14 @@
+---
+title: "Admin Ui"
+isDefaultIndex: true
+generated: true
+---
+<!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script -->
+import MemberInfo from '@site/src/components/MemberInfo';
+import GenerationInfo from '@site/src/components/GenerationInfo';
+import MemberDescription from '@site/src/components/MemberDescription';
+
+
+import DocCardList from '@theme/DocCardList';
+
+<DocCardList />

+ 130 - 0
docs/docs/reference/typescript-api/default-search-plugin/default-search-plugin-init-options.md

@@ -0,0 +1,130 @@
+---
+title: "DefaultSearchPluginInitOptions"
+isDefaultIndex: false
+generated: true
+---
+<!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script -->
+import MemberInfo from '@site/src/components/MemberInfo';
+import GenerationInfo from '@site/src/components/GenerationInfo';
+import MemberDescription from '@site/src/components/MemberDescription';
+
+
+## DefaultSearchPluginInitOptions
+
+<GenerationInfo sourceFile="packages/core/src/plugin/default-search-plugin/types.ts" sourceLine="15" packageName="@vendure/core" />
+
+Options which configure the behaviour of the DefaultSearchPlugin
+
+```ts title="Signature"
+interface DefaultSearchPluginInitOptions {
+    indexStockStatus?: boolean;
+    bufferUpdates?: boolean;
+    searchStrategy?: SearchStrategy;
+}
+```
+
+<div className="members-wrapper">
+
+### indexStockStatus
+
+<MemberInfo kind="property" type={`boolean`} default="false."   />
+
+If set to `true`, the stock status of a ProductVariant (inStock: Boolean) will
+be exposed in the `search` query results. Enabling this option on an existing
+Vendure installation will require a DB migration/synchronization.
+### bufferUpdates
+
+<MemberInfo kind="property" type={`boolean`} default="false"  since="1.3.0"  />
+
+If set to `true`, updates to Products, ProductVariants and Collections will not immediately
+trigger an update to the search index. Instead, all these changes will be buffered and will
+only be run via a call to the `runPendingSearchIndexUpdates` mutation in the Admin API.
+
+This is very useful for installations with a large number of ProductVariants and/or
+Collections, as the buffering allows better control over when these expensive jobs are run,
+and also performs optimizations to minimize the amount of work that needs to be performed by
+the worker.
+### searchStrategy
+
+<MemberInfo kind="property" type={`SearchStrategy`} default="undefined"  since="1.6.0"  />
+
+Set a custom search strategy that implements {@link SearchStrategy} or extends an existing search strategy
+such as {@link MysqlSearchStrategy}, {@link PostgresSearchStrategy} or {@link SqliteSearchStrategy}.
+
+*Example*
+
+```ts
+export class MySearchStrategy implements SearchStrategy {
+    private readonly minTermLength = 2;
+    private connection: TransactionalConnection;
+    private options: DefaultSearchPluginInitOptions;
+
+    async init(injector: Injector) {
+        this.connection = injector.get(TransactionalConnection);
+        this.options = injector.get(PLUGIN_INIT_OPTIONS);
+    }
+
+    async getFacetValueIds(
+        ctx: RequestContext,
+        input: SearchInput,
+        enabledOnly: boolean,
+    ): Promise<Map<ID, number>> {
+        // ...
+        return createFacetIdCountMap(facetValuesResult);
+    }
+
+    async getCollectionIds(
+        ctx: RequestContext,
+        input: SearchInput,
+        enabledOnly: boolean,
+    ): Promise<Map<ID, number>> {
+        // ...
+        return createCollectionIdCountMap(collectionsResult);
+    }
+
+    async getSearchResults(
+        ctx: RequestContext,
+        input: SearchInput,
+        enabledOnly: boolean,
+    ): Promise<SearchResult[]> {
+        const take = input.take || 25;
+        const skip = input.skip || 0;
+        const sort = input.sort;
+        const qb = this.connection
+            .getRepository(SearchIndexItem)
+            .createQueryBuilder('si')
+            .select(this.createMysqlSelect(!!input.groupByProduct));
+        // ...
+
+        return qb
+            .take(take)
+            .skip(skip)
+            .getRawMany()
+            .then(res => res.map(r => mapToSearchResult(r, ctx.channel.currencyCode)));
+    }
+
+    async getTotalCount(ctx: RequestContext, input: SearchInput, enabledOnly: boolean): Promise<number> {
+        const innerQb = this.applyTermAndFilters(
+            ctx,
+            this.connection
+                .getRepository(SearchIndexItem)
+                .createQueryBuilder('si')
+                .select(this.createMysqlSelect(!!input.groupByProduct)),
+            input,
+        );
+        if (enabledOnly) {
+            innerQb.andWhere('si.enabled = :enabled', { enabled: true });
+        }
+
+        const totalItemsQb = this.connection.rawConnection
+            .createQueryBuilder()
+            .select('COUNT(*) as total')
+            .from(`(${innerQb.getQuery()})`, 'inner')
+            .setParameters(innerQb.getParameters());
+        return totalItemsQb.getRawOne().then(res => res.total);
+    }
+}
+```
+
+
+</div>

+ 68 - 0
docs/docs/reference/typescript-api/default-search-plugin/index.md

@@ -0,0 +1,68 @@
+---
+title: "DefaultSearchPlugin"
+isDefaultIndex: false
+generated: true
+---
+<!-- This file was generated from the Vendure source. Do not modify. Instead, re-run the "docs:build" script -->
+import MemberInfo from '@site/src/components/MemberInfo';
+import GenerationInfo from '@site/src/components/GenerationInfo';
+import MemberDescription from '@site/src/components/MemberDescription';
+
+
+## DefaultSearchPlugin
+
+<GenerationInfo sourceFile="packages/core/src/plugin/default-search-plugin/default-search-plugin.ts" sourceLine="69" packageName="@vendure/core" />
+
+The DefaultSearchPlugin provides a full-text Product search based on the full-text searching capabilities of the
+underlying database.
+
+The DefaultSearchPlugin is bundled with the `@vendure/core` package. If you are not using an alternative search
+plugin, then make sure this one is used, otherwise you will not be able to search products via the
+[`search` query](/reference/graphql-api/shop/queries#search).
+
+{{% alert "warning" %}}
+Note that the quality of the fulltext search capabilities varies depending on the underlying database being used. For example,
+the MySQL & Postgres implementations will typically yield better results than the SQLite implementation.
+{{% /alert %}}
+
+*Example*
+
+```ts
+import { DefaultSearchPlugin, VendureConfig } from '@vendure/core';
+
+export const config: VendureConfig = {
+  // Add an instance of the plugin to the plugins array
+  plugins: [
+    DefaultSearchPlugin.init({
+      indexStockStatus: true,
+      bufferUpdates: true,
+    }),
+  ],
+};
+```
+
+```ts title="Signature"
+class DefaultSearchPlugin implements OnApplicationBootstrap, OnApplicationShutdown {
+    static options: DefaultSearchPluginInitOptions = {};
+    init(options: DefaultSearchPluginInitOptions) => Type<DefaultSearchPlugin>;
+}
+```
+* Implements: <code>OnApplicationBootstrap</code>, <code>OnApplicationShutdown</code>
+
+
+
+<div className="members-wrapper">
+
+### options
+
+<MemberInfo kind="property" type={`<a href='/reference/typescript-api/default-search-plugin/default-search-plugin-init-options#defaultsearchplugininitoptions'>DefaultSearchPluginInitOptions</a>`}   />
+
+
+### init
+
+<MemberInfo kind="method" type={`(options: <a href='/reference/typescript-api/default-search-plugin/default-search-plugin-init-options#defaultsearchplugininitoptions'>DefaultSearchPluginInitOptions</a>) => Type&#60;<a href='/reference/typescript-api/default-search-plugin/#defaultsearchplugin'>DefaultSearchPlugin</a>&#62;`}   />
+
+
+
+
+</div>

+ 3 - 3
packages/asset-server-plugin/src/plugin.ts

@@ -52,7 +52,7 @@ import { AssetServerOptions, ImageTransformPreset } from './types';
  * };
  * ```
  *
- * The full configuration is documented at [AssetServerOptions](/reference/typescript-api/core-plugins/asset-server-plugin/asset-server-options)
+ * The full configuration is documented at [AssetServerOptions](/reference/core-plugins/asset-server-plugin/asset-server-options)
  *
  * ## Image transformation
  *
@@ -64,7 +64,7 @@ import { AssetServerOptions, ImageTransformPreset } from './types';
  *
  * ### Preview mode
  *
- * The `mode` parameter can be either `crop` or `resize`. See the [ImageTransformMode](/reference/typescript-api/core-plugins/asset-server-plugin/image-transform-mode) docs for details.
+ * The `mode` parameter can be either `crop` or `resize`. See the [ImageTransformMode](/reference/core-plugins/asset-server-plugin/image-transform-mode) docs for details.
  *
  * ### Focal point
  *
@@ -99,7 +99,7 @@ import { AssetServerOptions, ImageTransformPreset } from './types';
  * ### Transform presets
  *
  * Presets can be defined which allow a single preset name to be used instead of specifying the width, height and mode. Presets are
- * configured via the AssetServerOptions [presets property](/reference/typescript-api/core-plugins/asset-server-plugin/asset-server-options/#presets).
+ * configured via the AssetServerOptions [presets property](/reference/core-plugins/asset-server-plugin/asset-server-options/#presets).
  *
  * For example, defining the following preset:
  *

+ 1 - 1
packages/ui-devkit/src/compiler/types.ts

@@ -88,7 +88,7 @@ export interface SassVariableOverridesExtension {
  * Angular [NgModules](https://angular.io/guide/ngmodules) which are compiled
  * into the application.
  *
- * See [Extending the Admin UI](/guides/extending-the-admin-ui/) for
+ * See [Extending the Admin UI](/guides/extending-the-admin-ui/introduction) for
  * detailed instructions.
  *
  * @docsCategory UiDevkit